summaryrefslogtreecommitdiffstats
path: root/library/stdarch/crates/core_arch/src
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
commit698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch)
tree173a775858bd501c378080a10dca74132f05bc50 /library/stdarch/crates/core_arch/src
parentInitial commit. (diff)
downloadrustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz
rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'library/stdarch/crates/core_arch/src')
-rw-r--r--library/stdarch/crates/core_arch/src/aarch64/armclang.rs23
-rw-r--r--library/stdarch/crates/core_arch/src/aarch64/crc.rs45
-rw-r--r--library/stdarch/crates/core_arch/src/aarch64/mod.rs41
-rw-r--r--library/stdarch/crates/core_arch/src/aarch64/neon/generated.rs25758
-rw-r--r--library/stdarch/crates/core_arch/src/aarch64/neon/mod.rs5440
-rw-r--r--library/stdarch/crates/core_arch/src/aarch64/prefetch.rs73
-rw-r--r--library/stdarch/crates/core_arch/src/aarch64/test_support.rs184
-rw-r--r--library/stdarch/crates/core_arch/src/aarch64/tme.rs179
-rw-r--r--library/stdarch/crates/core_arch/src/aarch64/v8.rs104
-rw-r--r--library/stdarch/crates/core_arch/src/arm/armclang.rs35
-rw-r--r--library/stdarch/crates/core_arch/src/arm/dsp.rs384
-rw-r--r--library/stdarch/crates/core_arch/src/arm/ex.rs125
-rw-r--r--library/stdarch/crates/core_arch/src/arm/mod.rs113
-rw-r--r--library/stdarch/crates/core_arch/src/arm/neon.rs1369
-rw-r--r--library/stdarch/crates/core_arch/src/arm/sat.rs8
-rw-r--r--library/stdarch/crates/core_arch/src/arm/simd32.rs728
-rw-r--r--library/stdarch/crates/core_arch/src/arm/v6.rs49
-rw-r--r--library/stdarch/crates/core_arch/src/arm/v7.rs88
-rw-r--r--library/stdarch/crates/core_arch/src/arm_shared/barrier/common.rs14
-rw-r--r--library/stdarch/crates/core_arch/src/arm_shared/barrier/cp15.rs38
-rw-r--r--library/stdarch/crates/core_arch/src/arm_shared/barrier/mod.rs154
-rw-r--r--library/stdarch/crates/core_arch/src/arm_shared/barrier/not_mclass.rs43
-rw-r--r--library/stdarch/crates/core_arch/src/arm_shared/barrier/v8.rs23
-rw-r--r--library/stdarch/crates/core_arch/src/arm_shared/crc.rs121
-rw-r--r--library/stdarch/crates/core_arch/src/arm_shared/crypto.rs374
-rw-r--r--library/stdarch/crates/core_arch/src/arm_shared/hints.rs95
-rw-r--r--library/stdarch/crates/core_arch/src/arm_shared/mod.rs120
-rw-r--r--library/stdarch/crates/core_arch/src/arm_shared/neon/generated.rs40888
-rw-r--r--library/stdarch/crates/core_arch/src/arm_shared/neon/load_tests.rs206
-rw-r--r--library/stdarch/crates/core_arch/src/arm_shared/neon/mod.rs12347
-rw-r--r--library/stdarch/crates/core_arch/src/arm_shared/neon/shift_and_insert_tests.rs93
-rw-r--r--library/stdarch/crates/core_arch/src/arm_shared/neon/store_tests.rs389
-rw-r--r--library/stdarch/crates/core_arch/src/arm_shared/neon/table_lookup_tests.rs1042
-rw-r--r--library/stdarch/crates/core_arch/src/arm_shared/registers/aarch32.rs9
-rw-r--r--library/stdarch/crates/core_arch/src/arm_shared/registers/mod.rs121
-rw-r--r--library/stdarch/crates/core_arch/src/arm_shared/registers/v6m.rs39
-rw-r--r--library/stdarch/crates/core_arch/src/arm_shared/registers/v7m.rs17
-rw-r--r--library/stdarch/crates/core_arch/src/arm_shared/test_support.rs836
-rw-r--r--library/stdarch/crates/core_arch/src/core_arch_docs.md344
-rw-r--r--library/stdarch/crates/core_arch/src/lib.rs74
-rw-r--r--library/stdarch/crates/core_arch/src/macros.rs190
-rw-r--r--library/stdarch/crates/core_arch/src/mips/mod.rs18
-rw-r--r--library/stdarch/crates/core_arch/src/mips/msa.rs17894
-rw-r--r--library/stdarch/crates/core_arch/src/mips/msa/macros.rs31
-rw-r--r--library/stdarch/crates/core_arch/src/mod.rs305
-rw-r--r--library/stdarch/crates/core_arch/src/nvptx/mod.rs213
-rw-r--r--library/stdarch/crates/core_arch/src/powerpc/altivec.rs2778
-rw-r--r--library/stdarch/crates/core_arch/src/powerpc/mod.rs19
-rw-r--r--library/stdarch/crates/core_arch/src/powerpc/vsx.rs118
-rw-r--r--library/stdarch/crates/core_arch/src/powerpc64/mod.rs8
-rw-r--r--library/stdarch/crates/core_arch/src/riscv64/mod.rs49
-rw-r--r--library/stdarch/crates/core_arch/src/riscv_shared/mod.rs771
-rw-r--r--library/stdarch/crates/core_arch/src/simd.rs1105
-rw-r--r--library/stdarch/crates/core_arch/src/simd_llvm.rs81
-rw-r--r--library/stdarch/crates/core_arch/src/v64.rs85
-rw-r--r--library/stdarch/crates/core_arch/src/wasm32/atomic.rs93
-rw-r--r--library/stdarch/crates/core_arch/src/wasm32/memory.rs58
-rw-r--r--library/stdarch/crates/core_arch/src/wasm32/mod.rs26
-rw-r--r--library/stdarch/crates/core_arch/src/wasm32/simd128.rs6136
-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
-rw-r--r--library/stdarch/crates/core_arch/src/x86_64/abm.rs62
-rw-r--r--library/stdarch/crates/core_arch/src/x86_64/adx.rs148
-rw-r--r--library/stdarch/crates/core_arch/src/x86_64/avx.rs48
-rw-r--r--library/stdarch/crates/core_arch/src/x86_64/avx2.rs47
-rw-r--r--library/stdarch/crates/core_arch/src/x86_64/avx512f.rs12346
-rw-r--r--library/stdarch/crates/core_arch/src/x86_64/bmi.rs183
-rw-r--r--library/stdarch/crates/core_arch/src/x86_64/bmi2.rs139
-rw-r--r--library/stdarch/crates/core_arch/src/x86_64/bswap.rs29
-rw-r--r--library/stdarch/crates/core_arch/src/x86_64/bt.rs135
-rw-r--r--library/stdarch/crates/core_arch/src/x86_64/cmpxchg16b.rs73
-rw-r--r--library/stdarch/crates/core_arch/src/x86_64/fxsr.rs112
-rw-r--r--library/stdarch/crates/core_arch/src/x86_64/macros.rs36
-rw-r--r--library/stdarch/crates/core_arch/src/x86_64/mod.rs55
-rw-r--r--library/stdarch/crates/core_arch/src/x86_64/rdrand.rs44
-rw-r--r--library/stdarch/crates/core_arch/src/x86_64/sse.rs148
-rw-r--r--library/stdarch/crates/core_arch/src/x86_64/sse2.rs209
-rw-r--r--library/stdarch/crates/core_arch/src/x86_64/sse41.rs62
-rw-r--r--library/stdarch/crates/core_arch/src/x86_64/sse42.rs37
-rw-r--r--library/stdarch/crates/core_arch/src/x86_64/xsave.rs227
122 files changed, 250367 insertions, 0 deletions
diff --git a/library/stdarch/crates/core_arch/src/aarch64/armclang.rs b/library/stdarch/crates/core_arch/src/aarch64/armclang.rs
new file mode 100644
index 000000000..7ad6ae50c
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/aarch64/armclang.rs
@@ -0,0 +1,23 @@
+//! ARM compiler specific intrinsics
+//!
+//! # References
+//!
+//! - [ARM Compiler v 6.10 - armclang Reference Guide][arm_comp_ref]
+//!
+//! [arm_comp_ref]: https://developer.arm.com/docs/100067/0610
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+/// Inserts a breakpoint instruction.
+///
+/// `VAL` is a compile-time constant integer in range `[0, 65535]`.
+///
+/// The breakpoint instruction inserted is `BRK` on A64.
+#[cfg_attr(test, assert_instr(brk, VAL = 0))]
+#[inline(always)]
+#[rustc_legacy_const_generics(0)]
+pub unsafe fn __breakpoint<const VAL: i32>() {
+ static_assert_imm16!(VAL);
+ crate::arch::asm!("brk {}", const VAL);
+}
diff --git a/library/stdarch/crates/core_arch/src/aarch64/crc.rs b/library/stdarch/crates/core_arch/src/aarch64/crc.rs
new file mode 100644
index 000000000..6e8128534
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/aarch64/crc.rs
@@ -0,0 +1,45 @@
+extern "unadjusted" {
+ #[link_name = "llvm.aarch64.crc32x"]
+ fn crc32x_(crc: u32, data: u64) -> u32;
+
+ #[link_name = "llvm.aarch64.crc32cx"]
+ fn crc32cx_(crc: u32, data: u64) -> u32;
+}
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+/// CRC32 single round checksum for quad words (64 bits).
+#[inline]
+#[target_feature(enable = "crc")]
+#[cfg_attr(test, assert_instr(crc32x))]
+pub unsafe fn __crc32d(crc: u32, data: u64) -> u32 {
+ crc32x_(crc, data)
+}
+
+/// CRC32-C single round checksum for quad words (64 bits).
+#[inline]
+#[target_feature(enable = "crc")]
+#[cfg_attr(test, assert_instr(crc32cx))]
+pub unsafe fn __crc32cd(crc: u32, data: u64) -> u32 {
+ crc32cx_(crc, data)
+}
+
+#[cfg(test)]
+mod tests {
+ use crate::core_arch::{aarch64::*, simd::*};
+ use std::mem;
+ use stdarch_test::simd_test;
+
+ #[simd_test(enable = "crc")]
+ unsafe fn test_crc32d() {
+ assert_eq!(__crc32d(0, 0), 0);
+ assert_eq!(__crc32d(0, 18446744073709551615), 1147535477);
+ }
+
+ #[simd_test(enable = "crc")]
+ unsafe fn test_crc32cd() {
+ assert_eq!(__crc32cd(0, 0), 0);
+ assert_eq!(__crc32cd(0, 18446744073709551615), 3293575501);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/aarch64/mod.rs b/library/stdarch/crates/core_arch/src/aarch64/mod.rs
new file mode 100644
index 000000000..0411fc106
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/aarch64/mod.rs
@@ -0,0 +1,41 @@
+//! AArch64 intrinsics.
+//!
+//! The reference for NEON is [ARM's NEON Intrinsics Reference][arm_ref]. The
+//! [ARM's NEON Intrinsics Online Database][arm_dat] is also useful.
+//!
+//! [arm_ref]: http://infocenter.arm.com/help/topic/com.arm.doc.ihi0073a/IHI0073A_arm_neon_intrinsics_ref.pdf
+//! [arm_dat]: https://developer.arm.com/technologies/neon/intrinsics
+
+mod v8;
+pub use self::v8::*;
+
+mod neon;
+pub use self::neon::*;
+
+mod tme;
+pub use self::tme::*;
+
+mod crc;
+pub use self::crc::*;
+
+mod prefetch;
+pub use self::prefetch::*;
+
+pub use super::arm_shared::*;
+
+mod armclang;
+
+pub use self::armclang::*;
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+/// Generates the trap instruction `BRK 1`
+#[cfg_attr(test, assert_instr(brk))]
+#[inline]
+pub unsafe fn brk() -> ! {
+ crate::intrinsics::abort()
+}
+
+#[cfg(test)]
+pub(crate) mod test_support;
diff --git a/library/stdarch/crates/core_arch/src/aarch64/neon/generated.rs b/library/stdarch/crates/core_arch/src/aarch64/neon/generated.rs
new file mode 100644
index 000000000..74ea2963c
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/aarch64/neon/generated.rs
@@ -0,0 +1,25758 @@
+// This code is automatically generated. DO NOT MODIFY.
+//
+// Instead, modify `crates/stdarch-gen/neon.spec` and run the following command to re-generate this file:
+//
+// ```
+// OUT_DIR=`pwd`/crates/core_arch cargo run -p stdarch-gen -- crates/stdarch-gen/neon.spec
+// ```
+use super::*;
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+/// Three-way exclusive OR
+#[inline]
+#[target_feature(enable = "neon,sha3")]
+#[cfg_attr(test, assert_instr(eor3))]
+pub unsafe fn veor3q_s8(a: int8x16_t, b: int8x16_t, c: int8x16_t) -> int8x16_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.eor3s.v16i8")]
+ fn veor3q_s8_(a: int8x16_t, b: int8x16_t, c: int8x16_t) -> int8x16_t;
+ }
+ veor3q_s8_(a, b, c)
+}
+
+/// Three-way exclusive OR
+#[inline]
+#[target_feature(enable = "neon,sha3")]
+#[cfg_attr(test, assert_instr(eor3))]
+pub unsafe fn veor3q_s16(a: int16x8_t, b: int16x8_t, c: int16x8_t) -> int16x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.eor3s.v8i16")]
+ fn veor3q_s16_(a: int16x8_t, b: int16x8_t, c: int16x8_t) -> int16x8_t;
+ }
+ veor3q_s16_(a, b, c)
+}
+
+/// Three-way exclusive OR
+#[inline]
+#[target_feature(enable = "neon,sha3")]
+#[cfg_attr(test, assert_instr(eor3))]
+pub unsafe fn veor3q_s32(a: int32x4_t, b: int32x4_t, c: int32x4_t) -> int32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.eor3s.v4i32")]
+ fn veor3q_s32_(a: int32x4_t, b: int32x4_t, c: int32x4_t) -> int32x4_t;
+ }
+ veor3q_s32_(a, b, c)
+}
+
+/// Three-way exclusive OR
+#[inline]
+#[target_feature(enable = "neon,sha3")]
+#[cfg_attr(test, assert_instr(eor3))]
+pub unsafe fn veor3q_s64(a: int64x2_t, b: int64x2_t, c: int64x2_t) -> int64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.eor3s.v2i64")]
+ fn veor3q_s64_(a: int64x2_t, b: int64x2_t, c: int64x2_t) -> int64x2_t;
+ }
+ veor3q_s64_(a, b, c)
+}
+
+/// Three-way exclusive OR
+#[inline]
+#[target_feature(enable = "neon,sha3")]
+#[cfg_attr(test, assert_instr(eor3))]
+pub unsafe fn veor3q_u8(a: uint8x16_t, b: uint8x16_t, c: uint8x16_t) -> uint8x16_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.eor3u.v16i8")]
+ fn veor3q_u8_(a: uint8x16_t, b: uint8x16_t, c: uint8x16_t) -> uint8x16_t;
+ }
+ veor3q_u8_(a, b, c)
+}
+
+/// Three-way exclusive OR
+#[inline]
+#[target_feature(enable = "neon,sha3")]
+#[cfg_attr(test, assert_instr(eor3))]
+pub unsafe fn veor3q_u16(a: uint16x8_t, b: uint16x8_t, c: uint16x8_t) -> uint16x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.eor3u.v8i16")]
+ fn veor3q_u16_(a: uint16x8_t, b: uint16x8_t, c: uint16x8_t) -> uint16x8_t;
+ }
+ veor3q_u16_(a, b, c)
+}
+
+/// Three-way exclusive OR
+#[inline]
+#[target_feature(enable = "neon,sha3")]
+#[cfg_attr(test, assert_instr(eor3))]
+pub unsafe fn veor3q_u32(a: uint32x4_t, b: uint32x4_t, c: uint32x4_t) -> uint32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.eor3u.v4i32")]
+ fn veor3q_u32_(a: uint32x4_t, b: uint32x4_t, c: uint32x4_t) -> uint32x4_t;
+ }
+ veor3q_u32_(a, b, c)
+}
+
+/// Three-way exclusive OR
+#[inline]
+#[target_feature(enable = "neon,sha3")]
+#[cfg_attr(test, assert_instr(eor3))]
+pub unsafe fn veor3q_u64(a: uint64x2_t, b: uint64x2_t, c: uint64x2_t) -> uint64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.eor3u.v2i64")]
+ fn veor3q_u64_(a: uint64x2_t, b: uint64x2_t, c: uint64x2_t) -> uint64x2_t;
+ }
+ veor3q_u64_(a, b, c)
+}
+
+/// Absolute difference between the arguments of Floating
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fabd))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vabd_f64(a: float64x1_t, b: float64x1_t) -> float64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fabd.v1f64")]
+ fn vabd_f64_(a: float64x1_t, b: float64x1_t) -> float64x1_t;
+ }
+ vabd_f64_(a, b)
+}
+
+/// Absolute difference between the arguments of Floating
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fabd))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vabdq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fabd.v2f64")]
+ fn vabdq_f64_(a: float64x2_t, b: float64x2_t) -> float64x2_t;
+ }
+ vabdq_f64_(a, b)
+}
+
+/// Floating-point absolute difference
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fabd))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vabds_f32(a: f32, b: f32) -> f32 {
+ simd_extract(vabd_f32(vdup_n_f32(a), vdup_n_f32(b)), 0)
+}
+
+/// Floating-point absolute difference
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fabd))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vabdd_f64(a: f64, b: f64) -> f64 {
+ simd_extract(vabd_f64(vdup_n_f64(a), vdup_n_f64(b)), 0)
+}
+
+/// Unsigned Absolute difference Long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uabdl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vabdl_high_u8(a: uint8x16_t, b: uint8x16_t) -> uint16x8_t {
+ let c: uint8x8_t = simd_shuffle8!(a, a, [8, 9, 10, 11, 12, 13, 14, 15]);
+ let d: uint8x8_t = simd_shuffle8!(b, b, [8, 9, 10, 11, 12, 13, 14, 15]);
+ simd_cast(vabd_u8(c, d))
+}
+
+/// Unsigned Absolute difference Long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uabdl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vabdl_high_u16(a: uint16x8_t, b: uint16x8_t) -> uint32x4_t {
+ let c: uint16x4_t = simd_shuffle4!(a, a, [4, 5, 6, 7]);
+ let d: uint16x4_t = simd_shuffle4!(b, b, [4, 5, 6, 7]);
+ simd_cast(vabd_u16(c, d))
+}
+
+/// Unsigned Absolute difference Long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uabdl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vabdl_high_u32(a: uint32x4_t, b: uint32x4_t) -> uint64x2_t {
+ let c: uint32x2_t = simd_shuffle2!(a, a, [2, 3]);
+ let d: uint32x2_t = simd_shuffle2!(b, b, [2, 3]);
+ simd_cast(vabd_u32(c, d))
+}
+
+/// Signed Absolute difference Long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sabdl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vabdl_high_s8(a: int8x16_t, b: int8x16_t) -> int16x8_t {
+ let c: int8x8_t = simd_shuffle8!(a, a, [8, 9, 10, 11, 12, 13, 14, 15]);
+ let d: int8x8_t = simd_shuffle8!(b, b, [8, 9, 10, 11, 12, 13, 14, 15]);
+ let e: uint8x8_t = simd_cast(vabd_s8(c, d));
+ simd_cast(e)
+}
+
+/// Signed Absolute difference Long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sabdl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vabdl_high_s16(a: int16x8_t, b: int16x8_t) -> int32x4_t {
+ let c: int16x4_t = simd_shuffle4!(a, a, [4, 5, 6, 7]);
+ let d: int16x4_t = simd_shuffle4!(b, b, [4, 5, 6, 7]);
+ let e: uint16x4_t = simd_cast(vabd_s16(c, d));
+ simd_cast(e)
+}
+
+/// Signed Absolute difference Long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sabdl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vabdl_high_s32(a: int32x4_t, b: int32x4_t) -> int64x2_t {
+ let c: int32x2_t = simd_shuffle2!(a, a, [2, 3]);
+ let d: int32x2_t = simd_shuffle2!(b, b, [2, 3]);
+ let e: uint32x2_t = simd_cast(vabd_s32(c, d));
+ simd_cast(e)
+}
+
+/// Compare bitwise Equal (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmeq))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vceq_u64(a: uint64x1_t, b: uint64x1_t) -> uint64x1_t {
+ simd_eq(a, b)
+}
+
+/// Compare bitwise Equal (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmeq))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vceqq_u64(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t {
+ simd_eq(a, b)
+}
+
+/// Compare bitwise Equal (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmeq))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vceq_s64(a: int64x1_t, b: int64x1_t) -> uint64x1_t {
+ simd_eq(a, b)
+}
+
+/// Compare bitwise Equal (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmeq))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vceqq_s64(a: int64x2_t, b: int64x2_t) -> uint64x2_t {
+ simd_eq(a, b)
+}
+
+/// Compare bitwise Equal (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmeq))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vceq_p64(a: poly64x1_t, b: poly64x1_t) -> uint64x1_t {
+ simd_eq(a, b)
+}
+
+/// Compare bitwise Equal (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmeq))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vceqq_p64(a: poly64x2_t, b: poly64x2_t) -> uint64x2_t {
+ simd_eq(a, b)
+}
+
+/// Floating-point compare equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmeq))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vceq_f64(a: float64x1_t, b: float64x1_t) -> uint64x1_t {
+ simd_eq(a, b)
+}
+
+/// Floating-point compare equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmeq))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vceqq_f64(a: float64x2_t, b: float64x2_t) -> uint64x2_t {
+ simd_eq(a, b)
+}
+
+/// Compare bitwise equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vceqd_s64(a: i64, b: i64) -> u64 {
+ transmute(vceq_s64(transmute(a), transmute(b)))
+}
+
+/// Compare bitwise equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vceqd_u64(a: u64, b: u64) -> u64 {
+ transmute(vceq_u64(transmute(a), transmute(b)))
+}
+
+/// Floating-point compare equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vceqs_f32(a: f32, b: f32) -> u32 {
+ simd_extract(vceq_f32(vdup_n_f32(a), vdup_n_f32(b)), 0)
+}
+
+/// Floating-point compare equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vceqd_f64(a: f64, b: f64) -> u64 {
+ simd_extract(vceq_f64(vdup_n_f64(a), vdup_n_f64(b)), 0)
+}
+
+/// Signed compare bitwise equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmeq))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vceqz_s8(a: int8x8_t) -> uint8x8_t {
+ let b: i8x8 = i8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ simd_eq(a, transmute(b))
+}
+
+/// Signed compare bitwise equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmeq))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vceqzq_s8(a: int8x16_t) -> uint8x16_t {
+ let b: i8x16 = i8x16::new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ simd_eq(a, transmute(b))
+}
+
+/// Signed compare bitwise equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmeq))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vceqz_s16(a: int16x4_t) -> uint16x4_t {
+ let b: i16x4 = i16x4::new(0, 0, 0, 0);
+ simd_eq(a, transmute(b))
+}
+
+/// Signed compare bitwise equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmeq))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vceqzq_s16(a: int16x8_t) -> uint16x8_t {
+ let b: i16x8 = i16x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ simd_eq(a, transmute(b))
+}
+
+/// Signed compare bitwise equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmeq))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vceqz_s32(a: int32x2_t) -> uint32x2_t {
+ let b: i32x2 = i32x2::new(0, 0);
+ simd_eq(a, transmute(b))
+}
+
+/// Signed compare bitwise equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmeq))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vceqzq_s32(a: int32x4_t) -> uint32x4_t {
+ let b: i32x4 = i32x4::new(0, 0, 0, 0);
+ simd_eq(a, transmute(b))
+}
+
+/// Signed compare bitwise equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmeq))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vceqz_s64(a: int64x1_t) -> uint64x1_t {
+ let b: i64x1 = i64x1::new(0);
+ simd_eq(a, transmute(b))
+}
+
+/// Signed compare bitwise equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmeq))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vceqzq_s64(a: int64x2_t) -> uint64x2_t {
+ let b: i64x2 = i64x2::new(0, 0);
+ simd_eq(a, transmute(b))
+}
+
+/// Signed compare bitwise equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmeq))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vceqz_p8(a: poly8x8_t) -> uint8x8_t {
+ let b: i8x8 = i8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ simd_eq(a, transmute(b))
+}
+
+/// Signed compare bitwise equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmeq))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vceqzq_p8(a: poly8x16_t) -> uint8x16_t {
+ let b: i8x16 = i8x16::new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ simd_eq(a, transmute(b))
+}
+
+/// Signed compare bitwise equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmeq))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vceqz_p64(a: poly64x1_t) -> uint64x1_t {
+ let b: i64x1 = i64x1::new(0);
+ simd_eq(a, transmute(b))
+}
+
+/// Signed compare bitwise equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmeq))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vceqzq_p64(a: poly64x2_t) -> uint64x2_t {
+ let b: i64x2 = i64x2::new(0, 0);
+ simd_eq(a, transmute(b))
+}
+
+/// Unsigned compare bitwise equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmeq))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vceqz_u8(a: uint8x8_t) -> uint8x8_t {
+ let b: u8x8 = u8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ simd_eq(a, transmute(b))
+}
+
+/// Unsigned compare bitwise equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmeq))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vceqzq_u8(a: uint8x16_t) -> uint8x16_t {
+ let b: u8x16 = u8x16::new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ simd_eq(a, transmute(b))
+}
+
+/// Unsigned compare bitwise equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmeq))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vceqz_u16(a: uint16x4_t) -> uint16x4_t {
+ let b: u16x4 = u16x4::new(0, 0, 0, 0);
+ simd_eq(a, transmute(b))
+}
+
+/// Unsigned compare bitwise equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmeq))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vceqzq_u16(a: uint16x8_t) -> uint16x8_t {
+ let b: u16x8 = u16x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ simd_eq(a, transmute(b))
+}
+
+/// Unsigned compare bitwise equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmeq))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vceqz_u32(a: uint32x2_t) -> uint32x2_t {
+ let b: u32x2 = u32x2::new(0, 0);
+ simd_eq(a, transmute(b))
+}
+
+/// Unsigned compare bitwise equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmeq))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vceqzq_u32(a: uint32x4_t) -> uint32x4_t {
+ let b: u32x4 = u32x4::new(0, 0, 0, 0);
+ simd_eq(a, transmute(b))
+}
+
+/// Unsigned compare bitwise equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmeq))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vceqz_u64(a: uint64x1_t) -> uint64x1_t {
+ let b: u64x1 = u64x1::new(0);
+ simd_eq(a, transmute(b))
+}
+
+/// Unsigned compare bitwise equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmeq))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vceqzq_u64(a: uint64x2_t) -> uint64x2_t {
+ let b: u64x2 = u64x2::new(0, 0);
+ simd_eq(a, transmute(b))
+}
+
+/// Floating-point compare bitwise equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmeq))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vceqz_f32(a: float32x2_t) -> uint32x2_t {
+ let b: f32x2 = f32x2::new(0.0, 0.0);
+ simd_eq(a, transmute(b))
+}
+
+/// Floating-point compare bitwise equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmeq))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vceqzq_f32(a: float32x4_t) -> uint32x4_t {
+ let b: f32x4 = f32x4::new(0.0, 0.0, 0.0, 0.0);
+ simd_eq(a, transmute(b))
+}
+
+/// Floating-point compare bitwise equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmeq))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vceqz_f64(a: float64x1_t) -> uint64x1_t {
+ let b: f64 = 0.0;
+ simd_eq(a, transmute(b))
+}
+
+/// Floating-point compare bitwise equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmeq))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vceqzq_f64(a: float64x2_t) -> uint64x2_t {
+ let b: f64x2 = f64x2::new(0.0, 0.0);
+ simd_eq(a, transmute(b))
+}
+
+/// Compare bitwise equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vceqzd_s64(a: i64) -> u64 {
+ transmute(vceqz_s64(transmute(a)))
+}
+
+/// Compare bitwise equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vceqzd_u64(a: u64) -> u64 {
+ transmute(vceqz_u64(transmute(a)))
+}
+
+/// Floating-point compare bitwise equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vceqzs_f32(a: f32) -> u32 {
+ simd_extract(vceqz_f32(vdup_n_f32(a)), 0)
+}
+
+/// Floating-point compare bitwise equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vceqzd_f64(a: f64) -> u64 {
+ simd_extract(vceqz_f64(vdup_n_f64(a)), 0)
+}
+
+/// Signed compare bitwise Test bits nonzero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmtst))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtst_s64(a: int64x1_t, b: int64x1_t) -> uint64x1_t {
+ let c: int64x1_t = simd_and(a, b);
+ let d: i64x1 = i64x1::new(0);
+ simd_ne(c, transmute(d))
+}
+
+/// Signed compare bitwise Test bits nonzero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmtst))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtstq_s64(a: int64x2_t, b: int64x2_t) -> uint64x2_t {
+ let c: int64x2_t = simd_and(a, b);
+ let d: i64x2 = i64x2::new(0, 0);
+ simd_ne(c, transmute(d))
+}
+
+/// Signed compare bitwise Test bits nonzero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmtst))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtst_p64(a: poly64x1_t, b: poly64x1_t) -> uint64x1_t {
+ let c: poly64x1_t = simd_and(a, b);
+ let d: i64x1 = i64x1::new(0);
+ simd_ne(c, transmute(d))
+}
+
+/// Signed compare bitwise Test bits nonzero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmtst))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtstq_p64(a: poly64x2_t, b: poly64x2_t) -> uint64x2_t {
+ let c: poly64x2_t = simd_and(a, b);
+ let d: i64x2 = i64x2::new(0, 0);
+ simd_ne(c, transmute(d))
+}
+
+/// Unsigned compare bitwise Test bits nonzero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmtst))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtst_u64(a: uint64x1_t, b: uint64x1_t) -> uint64x1_t {
+ let c: uint64x1_t = simd_and(a, b);
+ let d: u64x1 = u64x1::new(0);
+ simd_ne(c, transmute(d))
+}
+
+/// Unsigned compare bitwise Test bits nonzero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmtst))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtstq_u64(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t {
+ let c: uint64x2_t = simd_and(a, b);
+ let d: u64x2 = u64x2::new(0, 0);
+ simd_ne(c, transmute(d))
+}
+
+/// Compare bitwise test bits nonzero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tst))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtstd_s64(a: i64, b: i64) -> u64 {
+ transmute(vtst_s64(transmute(a), transmute(b)))
+}
+
+/// Compare bitwise test bits nonzero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tst))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtstd_u64(a: u64, b: u64) -> u64 {
+ transmute(vtst_u64(transmute(a), transmute(b)))
+}
+
+/// Signed saturating accumulate of unsigned value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(suqadd))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuqadds_s32(a: i32, b: u32) -> i32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.suqadd.i32")]
+ fn vuqadds_s32_(a: i32, b: u32) -> i32;
+ }
+ vuqadds_s32_(a, b)
+}
+
+/// Signed saturating accumulate of unsigned value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(suqadd))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuqaddd_s64(a: i64, b: u64) -> i64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.suqadd.i64")]
+ fn vuqaddd_s64_(a: i64, b: u64) -> i64;
+ }
+ vuqaddd_s64_(a, b)
+}
+
+/// Signed saturating accumulate of unsigned value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(suqadd))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuqaddb_s8(a: i8, b: u8) -> i8 {
+ simd_extract(vuqadd_s8(vdup_n_s8(a), vdup_n_u8(b)), 0)
+}
+
+/// Signed saturating accumulate of unsigned value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(suqadd))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuqaddh_s16(a: i16, b: u16) -> i16 {
+ simd_extract(vuqadd_s16(vdup_n_s16(a), vdup_n_u16(b)), 0)
+}
+
+/// Floating-point absolute value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fabs))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vabs_f64(a: float64x1_t) -> float64x1_t {
+ simd_fabs(a)
+}
+
+/// Floating-point absolute value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fabs))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vabsq_f64(a: float64x2_t) -> float64x2_t {
+ simd_fabs(a)
+}
+
+/// Compare signed greater than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmgt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgt_s64(a: int64x1_t, b: int64x1_t) -> uint64x1_t {
+ simd_gt(a, b)
+}
+
+/// Compare signed greater than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmgt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgtq_s64(a: int64x2_t, b: int64x2_t) -> uint64x2_t {
+ simd_gt(a, b)
+}
+
+/// Compare unsigned highe
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmhi))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgt_u64(a: uint64x1_t, b: uint64x1_t) -> uint64x1_t {
+ simd_gt(a, b)
+}
+
+/// Compare unsigned highe
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmhi))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgtq_u64(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t {
+ simd_gt(a, b)
+}
+
+/// Floating-point compare greater than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmgt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgt_f64(a: float64x1_t, b: float64x1_t) -> uint64x1_t {
+ simd_gt(a, b)
+}
+
+/// Floating-point compare greater than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmgt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgtq_f64(a: float64x2_t, b: float64x2_t) -> uint64x2_t {
+ simd_gt(a, b)
+}
+
+/// Compare greater than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgtd_s64(a: i64, b: i64) -> u64 {
+ transmute(vcgt_s64(transmute(a), transmute(b)))
+}
+
+/// Compare greater than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgtd_u64(a: u64, b: u64) -> u64 {
+ transmute(vcgt_u64(transmute(a), transmute(b)))
+}
+
+/// Floating-point compare greater than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgts_f32(a: f32, b: f32) -> u32 {
+ simd_extract(vcgt_f32(vdup_n_f32(a), vdup_n_f32(b)), 0)
+}
+
+/// Floating-point compare greater than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgtd_f64(a: f64, b: f64) -> u64 {
+ simd_extract(vcgt_f64(vdup_n_f64(a), vdup_n_f64(b)), 0)
+}
+
+/// Compare signed less than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmgt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vclt_s64(a: int64x1_t, b: int64x1_t) -> uint64x1_t {
+ simd_lt(a, b)
+}
+
+/// Compare signed less than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmgt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcltq_s64(a: int64x2_t, b: int64x2_t) -> uint64x2_t {
+ simd_lt(a, b)
+}
+
+/// Compare unsigned less than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmhi))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vclt_u64(a: uint64x1_t, b: uint64x1_t) -> uint64x1_t {
+ simd_lt(a, b)
+}
+
+/// Compare unsigned less than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmhi))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcltq_u64(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t {
+ simd_lt(a, b)
+}
+
+/// Floating-point compare less than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmgt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vclt_f64(a: float64x1_t, b: float64x1_t) -> uint64x1_t {
+ simd_lt(a, b)
+}
+
+/// Floating-point compare less than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmgt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcltq_f64(a: float64x2_t, b: float64x2_t) -> uint64x2_t {
+ simd_lt(a, b)
+}
+
+/// Compare less than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcltd_s64(a: i64, b: i64) -> u64 {
+ transmute(vclt_s64(transmute(a), transmute(b)))
+}
+
+/// Compare less than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcltd_u64(a: u64, b: u64) -> u64 {
+ transmute(vclt_u64(transmute(a), transmute(b)))
+}
+
+/// Floating-point compare less than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vclts_f32(a: f32, b: f32) -> u32 {
+ simd_extract(vclt_f32(vdup_n_f32(a), vdup_n_f32(b)), 0)
+}
+
+/// Floating-point compare less than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcltd_f64(a: f64, b: f64) -> u64 {
+ simd_extract(vclt_f64(vdup_n_f64(a), vdup_n_f64(b)), 0)
+}
+
+/// Compare signed less than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmge))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcle_s64(a: int64x1_t, b: int64x1_t) -> uint64x1_t {
+ simd_le(a, b)
+}
+
+/// Compare signed less than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmge))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcleq_s64(a: int64x2_t, b: int64x2_t) -> uint64x2_t {
+ simd_le(a, b)
+}
+
+/// Compare greater than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcged_s64(a: i64, b: i64) -> u64 {
+ transmute(vcge_s64(transmute(a), transmute(b)))
+}
+
+/// Compare greater than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcged_u64(a: u64, b: u64) -> u64 {
+ transmute(vcge_u64(transmute(a), transmute(b)))
+}
+
+/// Floating-point compare greater than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcges_f32(a: f32, b: f32) -> u32 {
+ simd_extract(vcge_f32(vdup_n_f32(a), vdup_n_f32(b)), 0)
+}
+
+/// Floating-point compare greater than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcged_f64(a: f64, b: f64) -> u64 {
+ simd_extract(vcge_f64(vdup_n_f64(a), vdup_n_f64(b)), 0)
+}
+
+/// Compare unsigned less than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmhs))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcle_u64(a: uint64x1_t, b: uint64x1_t) -> uint64x1_t {
+ simd_le(a, b)
+}
+
+/// Compare unsigned less than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmhs))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcleq_u64(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t {
+ simd_le(a, b)
+}
+
+/// Floating-point compare less than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmge))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcle_f64(a: float64x1_t, b: float64x1_t) -> uint64x1_t {
+ simd_le(a, b)
+}
+
+/// Floating-point compare less than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmge))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcleq_f64(a: float64x2_t, b: float64x2_t) -> uint64x2_t {
+ simd_le(a, b)
+}
+
+/// Compare less than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcled_s64(a: i64, b: i64) -> u64 {
+ transmute(vcle_s64(transmute(a), transmute(b)))
+}
+
+/// Compare less than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcled_u64(a: u64, b: u64) -> u64 {
+ transmute(vcle_u64(transmute(a), transmute(b)))
+}
+
+/// Floating-point compare less than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcles_f32(a: f32, b: f32) -> u32 {
+ simd_extract(vcle_f32(vdup_n_f32(a), vdup_n_f32(b)), 0)
+}
+
+/// Floating-point compare less than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcled_f64(a: f64, b: f64) -> u64 {
+ simd_extract(vcle_f64(vdup_n_f64(a), vdup_n_f64(b)), 0)
+}
+
+/// Compare signed greater than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmge))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcge_s64(a: int64x1_t, b: int64x1_t) -> uint64x1_t {
+ simd_ge(a, b)
+}
+
+/// Compare signed greater than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmge))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgeq_s64(a: int64x2_t, b: int64x2_t) -> uint64x2_t {
+ simd_ge(a, b)
+}
+
+/// Compare unsigned greater than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmhs))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcge_u64(a: uint64x1_t, b: uint64x1_t) -> uint64x1_t {
+ simd_ge(a, b)
+}
+
+/// Compare unsigned greater than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmhs))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgeq_u64(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t {
+ simd_ge(a, b)
+}
+
+/// Floating-point compare greater than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmge))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcge_f64(a: float64x1_t, b: float64x1_t) -> uint64x1_t {
+ simd_ge(a, b)
+}
+
+/// Floating-point compare greater than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmge))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgeq_f64(a: float64x2_t, b: float64x2_t) -> uint64x2_t {
+ simd_ge(a, b)
+}
+
+/// Compare signed greater than or equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmge))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgez_s8(a: int8x8_t) -> uint8x8_t {
+ let b: i8x8 = i8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ simd_ge(a, transmute(b))
+}
+
+/// Compare signed greater than or equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmge))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgezq_s8(a: int8x16_t) -> uint8x16_t {
+ let b: i8x16 = i8x16::new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ simd_ge(a, transmute(b))
+}
+
+/// Compare signed greater than or equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmge))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgez_s16(a: int16x4_t) -> uint16x4_t {
+ let b: i16x4 = i16x4::new(0, 0, 0, 0);
+ simd_ge(a, transmute(b))
+}
+
+/// Compare signed greater than or equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmge))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgezq_s16(a: int16x8_t) -> uint16x8_t {
+ let b: i16x8 = i16x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ simd_ge(a, transmute(b))
+}
+
+/// Compare signed greater than or equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmge))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgez_s32(a: int32x2_t) -> uint32x2_t {
+ let b: i32x2 = i32x2::new(0, 0);
+ simd_ge(a, transmute(b))
+}
+
+/// Compare signed greater than or equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmge))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgezq_s32(a: int32x4_t) -> uint32x4_t {
+ let b: i32x4 = i32x4::new(0, 0, 0, 0);
+ simd_ge(a, transmute(b))
+}
+
+/// Compare signed greater than or equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmge))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgez_s64(a: int64x1_t) -> uint64x1_t {
+ let b: i64x1 = i64x1::new(0);
+ simd_ge(a, transmute(b))
+}
+
+/// Compare signed greater than or equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmge))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgezq_s64(a: int64x2_t) -> uint64x2_t {
+ let b: i64x2 = i64x2::new(0, 0);
+ simd_ge(a, transmute(b))
+}
+
+/// Floating-point compare greater than or equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmge))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgez_f32(a: float32x2_t) -> uint32x2_t {
+ let b: f32x2 = f32x2::new(0.0, 0.0);
+ simd_ge(a, transmute(b))
+}
+
+/// Floating-point compare greater than or equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmge))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgezq_f32(a: float32x4_t) -> uint32x4_t {
+ let b: f32x4 = f32x4::new(0.0, 0.0, 0.0, 0.0);
+ simd_ge(a, transmute(b))
+}
+
+/// Floating-point compare greater than or equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmge))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgez_f64(a: float64x1_t) -> uint64x1_t {
+ let b: f64 = 0.0;
+ simd_ge(a, transmute(b))
+}
+
+/// Floating-point compare greater than or equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmge))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgezq_f64(a: float64x2_t) -> uint64x2_t {
+ let b: f64x2 = f64x2::new(0.0, 0.0);
+ simd_ge(a, transmute(b))
+}
+
+/// Compare signed greater than or equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(eor))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgezd_s64(a: i64) -> u64 {
+ transmute(vcgez_s64(transmute(a)))
+}
+
+/// Floating-point compare greater than or equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgezs_f32(a: f32) -> u32 {
+ simd_extract(vcgez_f32(vdup_n_f32(a)), 0)
+}
+
+/// Floating-point compare greater than or equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgezd_f64(a: f64) -> u64 {
+ simd_extract(vcgez_f64(vdup_n_f64(a)), 0)
+}
+
+/// Compare signed greater than zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmgt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgtz_s8(a: int8x8_t) -> uint8x8_t {
+ let b: i8x8 = i8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ simd_gt(a, transmute(b))
+}
+
+/// Compare signed greater than zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmgt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgtzq_s8(a: int8x16_t) -> uint8x16_t {
+ let b: i8x16 = i8x16::new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ simd_gt(a, transmute(b))
+}
+
+/// Compare signed greater than zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmgt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgtz_s16(a: int16x4_t) -> uint16x4_t {
+ let b: i16x4 = i16x4::new(0, 0, 0, 0);
+ simd_gt(a, transmute(b))
+}
+
+/// Compare signed greater than zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmgt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgtzq_s16(a: int16x8_t) -> uint16x8_t {
+ let b: i16x8 = i16x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ simd_gt(a, transmute(b))
+}
+
+/// Compare signed greater than zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmgt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgtz_s32(a: int32x2_t) -> uint32x2_t {
+ let b: i32x2 = i32x2::new(0, 0);
+ simd_gt(a, transmute(b))
+}
+
+/// Compare signed greater than zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmgt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgtzq_s32(a: int32x4_t) -> uint32x4_t {
+ let b: i32x4 = i32x4::new(0, 0, 0, 0);
+ simd_gt(a, transmute(b))
+}
+
+/// Compare signed greater than zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmgt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgtz_s64(a: int64x1_t) -> uint64x1_t {
+ let b: i64x1 = i64x1::new(0);
+ simd_gt(a, transmute(b))
+}
+
+/// Compare signed greater than zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmgt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgtzq_s64(a: int64x2_t) -> uint64x2_t {
+ let b: i64x2 = i64x2::new(0, 0);
+ simd_gt(a, transmute(b))
+}
+
+/// Floating-point compare greater than zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmgt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgtz_f32(a: float32x2_t) -> uint32x2_t {
+ let b: f32x2 = f32x2::new(0.0, 0.0);
+ simd_gt(a, transmute(b))
+}
+
+/// Floating-point compare greater than zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmgt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgtzq_f32(a: float32x4_t) -> uint32x4_t {
+ let b: f32x4 = f32x4::new(0.0, 0.0, 0.0, 0.0);
+ simd_gt(a, transmute(b))
+}
+
+/// Floating-point compare greater than zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmgt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgtz_f64(a: float64x1_t) -> uint64x1_t {
+ let b: f64 = 0.0;
+ simd_gt(a, transmute(b))
+}
+
+/// Floating-point compare greater than zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmgt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgtzq_f64(a: float64x2_t) -> uint64x2_t {
+ let b: f64x2 = f64x2::new(0.0, 0.0);
+ simd_gt(a, transmute(b))
+}
+
+/// Compare signed greater than zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgtzd_s64(a: i64) -> u64 {
+ transmute(vcgtz_s64(transmute(a)))
+}
+
+/// Floating-point compare greater than zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgtzs_f32(a: f32) -> u32 {
+ simd_extract(vcgtz_f32(vdup_n_f32(a)), 0)
+}
+
+/// Floating-point compare greater than zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcgtzd_f64(a: f64) -> u64 {
+ simd_extract(vcgtz_f64(vdup_n_f64(a)), 0)
+}
+
+/// Compare signed less than or equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmgt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vclez_s8(a: int8x8_t) -> uint8x8_t {
+ let b: i8x8 = i8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ simd_le(a, transmute(b))
+}
+
+/// Compare signed less than or equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmgt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vclezq_s8(a: int8x16_t) -> uint8x16_t {
+ let b: i8x16 = i8x16::new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ simd_le(a, transmute(b))
+}
+
+/// Compare signed less than or equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmgt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vclez_s16(a: int16x4_t) -> uint16x4_t {
+ let b: i16x4 = i16x4::new(0, 0, 0, 0);
+ simd_le(a, transmute(b))
+}
+
+/// Compare signed less than or equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmgt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vclezq_s16(a: int16x8_t) -> uint16x8_t {
+ let b: i16x8 = i16x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ simd_le(a, transmute(b))
+}
+
+/// Compare signed less than or equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmgt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vclez_s32(a: int32x2_t) -> uint32x2_t {
+ let b: i32x2 = i32x2::new(0, 0);
+ simd_le(a, transmute(b))
+}
+
+/// Compare signed less than or equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmgt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vclezq_s32(a: int32x4_t) -> uint32x4_t {
+ let b: i32x4 = i32x4::new(0, 0, 0, 0);
+ simd_le(a, transmute(b))
+}
+
+/// Compare signed less than or equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmgt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vclez_s64(a: int64x1_t) -> uint64x1_t {
+ let b: i64x1 = i64x1::new(0);
+ simd_le(a, transmute(b))
+}
+
+/// Compare signed less than or equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmgt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vclezq_s64(a: int64x2_t) -> uint64x2_t {
+ let b: i64x2 = i64x2::new(0, 0);
+ simd_le(a, transmute(b))
+}
+
+/// Floating-point compare less than or equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmle))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vclez_f32(a: float32x2_t) -> uint32x2_t {
+ let b: f32x2 = f32x2::new(0.0, 0.0);
+ simd_le(a, transmute(b))
+}
+
+/// Floating-point compare less than or equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmle))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vclezq_f32(a: float32x4_t) -> uint32x4_t {
+ let b: f32x4 = f32x4::new(0.0, 0.0, 0.0, 0.0);
+ simd_le(a, transmute(b))
+}
+
+/// Floating-point compare less than or equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmle))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vclez_f64(a: float64x1_t) -> uint64x1_t {
+ let b: f64 = 0.0;
+ simd_le(a, transmute(b))
+}
+
+/// Floating-point compare less than or equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmle))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vclezq_f64(a: float64x2_t) -> uint64x2_t {
+ let b: f64x2 = f64x2::new(0.0, 0.0);
+ simd_le(a, transmute(b))
+}
+
+/// Compare less than or equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vclezd_s64(a: i64) -> u64 {
+ transmute(vclez_s64(transmute(a)))
+}
+
+/// Floating-point compare less than or equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vclezs_f32(a: f32) -> u32 {
+ simd_extract(vclez_f32(vdup_n_f32(a)), 0)
+}
+
+/// Floating-point compare less than or equal to zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vclezd_f64(a: f64) -> u64 {
+ simd_extract(vclez_f64(vdup_n_f64(a)), 0)
+}
+
+/// Compare signed less than zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmlt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcltz_s8(a: int8x8_t) -> uint8x8_t {
+ let b: i8x8 = i8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ simd_lt(a, transmute(b))
+}
+
+/// Compare signed less than zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmlt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcltzq_s8(a: int8x16_t) -> uint8x16_t {
+ let b: i8x16 = i8x16::new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ simd_lt(a, transmute(b))
+}
+
+/// Compare signed less than zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmlt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcltz_s16(a: int16x4_t) -> uint16x4_t {
+ let b: i16x4 = i16x4::new(0, 0, 0, 0);
+ simd_lt(a, transmute(b))
+}
+
+/// Compare signed less than zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmlt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcltzq_s16(a: int16x8_t) -> uint16x8_t {
+ let b: i16x8 = i16x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ simd_lt(a, transmute(b))
+}
+
+/// Compare signed less than zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmlt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcltz_s32(a: int32x2_t) -> uint32x2_t {
+ let b: i32x2 = i32x2::new(0, 0);
+ simd_lt(a, transmute(b))
+}
+
+/// Compare signed less than zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmlt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcltzq_s32(a: int32x4_t) -> uint32x4_t {
+ let b: i32x4 = i32x4::new(0, 0, 0, 0);
+ simd_lt(a, transmute(b))
+}
+
+/// Compare signed less than zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmlt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcltz_s64(a: int64x1_t) -> uint64x1_t {
+ let b: i64x1 = i64x1::new(0);
+ simd_lt(a, transmute(b))
+}
+
+/// Compare signed less than zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(cmlt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcltzq_s64(a: int64x2_t) -> uint64x2_t {
+ let b: i64x2 = i64x2::new(0, 0);
+ simd_lt(a, transmute(b))
+}
+
+/// Floating-point compare less than zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmlt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcltz_f32(a: float32x2_t) -> uint32x2_t {
+ let b: f32x2 = f32x2::new(0.0, 0.0);
+ simd_lt(a, transmute(b))
+}
+
+/// Floating-point compare less than zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmlt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcltzq_f32(a: float32x4_t) -> uint32x4_t {
+ let b: f32x4 = f32x4::new(0.0, 0.0, 0.0, 0.0);
+ simd_lt(a, transmute(b))
+}
+
+/// Floating-point compare less than zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmlt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcltz_f64(a: float64x1_t) -> uint64x1_t {
+ let b: f64 = 0.0;
+ simd_lt(a, transmute(b))
+}
+
+/// Floating-point compare less than zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmlt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcltzq_f64(a: float64x2_t) -> uint64x2_t {
+ let b: f64x2 = f64x2::new(0.0, 0.0);
+ simd_lt(a, transmute(b))
+}
+
+/// Compare less than zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(asr))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcltzd_s64(a: i64) -> u64 {
+ transmute(vcltz_s64(transmute(a)))
+}
+
+/// Floating-point compare less than zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcltzs_f32(a: f32) -> u32 {
+ simd_extract(vcltz_f32(vdup_n_f32(a)), 0)
+}
+
+/// Floating-point compare less than zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcltzd_f64(a: f64) -> u64 {
+ simd_extract(vcltz_f64(vdup_n_f64(a)), 0)
+}
+
+/// Floating-point absolute compare greater than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(facgt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcagt_f64(a: float64x1_t, b: float64x1_t) -> uint64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.facgt.v1i64.v1f64")]
+ fn vcagt_f64_(a: float64x1_t, b: float64x1_t) -> uint64x1_t;
+ }
+ vcagt_f64_(a, b)
+}
+
+/// Floating-point absolute compare greater than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(facgt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcagtq_f64(a: float64x2_t, b: float64x2_t) -> uint64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.facgt.v2i64.v2f64")]
+ fn vcagtq_f64_(a: float64x2_t, b: float64x2_t) -> uint64x2_t;
+ }
+ vcagtq_f64_(a, b)
+}
+
+/// Floating-point absolute compare greater than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(facgt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcagts_f32(a: f32, b: f32) -> u32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.facgt.i32.f32")]
+ fn vcagts_f32_(a: f32, b: f32) -> u32;
+ }
+ vcagts_f32_(a, b)
+}
+
+/// Floating-point absolute compare greater than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(facgt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcagtd_f64(a: f64, b: f64) -> u64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.facgt.i64.f64")]
+ fn vcagtd_f64_(a: f64, b: f64) -> u64;
+ }
+ vcagtd_f64_(a, b)
+}
+
+/// Floating-point absolute compare greater than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(facge))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcage_f64(a: float64x1_t, b: float64x1_t) -> uint64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.facge.v1i64.v1f64")]
+ fn vcage_f64_(a: float64x1_t, b: float64x1_t) -> uint64x1_t;
+ }
+ vcage_f64_(a, b)
+}
+
+/// Floating-point absolute compare greater than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(facge))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcageq_f64(a: float64x2_t, b: float64x2_t) -> uint64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.facge.v2i64.v2f64")]
+ fn vcageq_f64_(a: float64x2_t, b: float64x2_t) -> uint64x2_t;
+ }
+ vcageq_f64_(a, b)
+}
+
+/// Floating-point absolute compare greater than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(facge))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcages_f32(a: f32, b: f32) -> u32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.facge.i32.f32")]
+ fn vcages_f32_(a: f32, b: f32) -> u32;
+ }
+ vcages_f32_(a, b)
+}
+
+/// Floating-point absolute compare greater than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(facge))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcaged_f64(a: f64, b: f64) -> u64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.facge.i64.f64")]
+ fn vcaged_f64_(a: f64, b: f64) -> u64;
+ }
+ vcaged_f64_(a, b)
+}
+
+/// Floating-point absolute compare less than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(facgt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcalt_f64(a: float64x1_t, b: float64x1_t) -> uint64x1_t {
+ vcagt_f64(b, a)
+}
+
+/// Floating-point absolute compare less than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(facgt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcaltq_f64(a: float64x2_t, b: float64x2_t) -> uint64x2_t {
+ vcagtq_f64(b, a)
+}
+
+/// Floating-point absolute compare less than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(facgt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcalts_f32(a: f32, b: f32) -> u32 {
+ vcagts_f32(b, a)
+}
+
+/// Floating-point absolute compare less than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(facgt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcaltd_f64(a: f64, b: f64) -> u64 {
+ vcagtd_f64(b, a)
+}
+
+/// Floating-point absolute compare less than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(facge))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcale_f64(a: float64x1_t, b: float64x1_t) -> uint64x1_t {
+ vcage_f64(b, a)
+}
+
+/// Floating-point absolute compare less than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(facge))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcaleq_f64(a: float64x2_t, b: float64x2_t) -> uint64x2_t {
+ vcageq_f64(b, a)
+}
+
+/// Floating-point absolute compare less than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(facge))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcales_f32(a: f32, b: f32) -> u32 {
+ vcages_f32(b, a)
+}
+
+/// Floating-point absolute compare less than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(facge))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcaled_f64(a: f64, b: f64) -> u64 {
+ vcaged_f64(b, a)
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopy_lane_s8<const LANE1: i32, const LANE2: i32>(a: int8x8_t, b: int8x8_t) -> int8x8_t {
+ static_assert_imm3!(LANE1);
+ static_assert_imm3!(LANE2);
+ match LANE1 & 0b111 {
+ 0 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [8 + LANE2 as u32, 1, 2, 3, 4, 5, 6, 7]),
+ 1 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 8 + LANE2 as u32, 2, 3, 4, 5, 6, 7]),
+ 2 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 8 + LANE2 as u32, 3, 4, 5, 6, 7]),
+ 3 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 8 + LANE2 as u32, 4, 5, 6, 7]),
+ 4 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 8 + LANE2 as u32, 5, 6, 7]),
+ 5 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 8 + LANE2 as u32, 6, 7]),
+ 6 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 8 + LANE2 as u32, 7]),
+ 7 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 8 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopyq_laneq_s8<const LANE1: i32, const LANE2: i32>(a: int8x16_t, b: int8x16_t) -> int8x16_t {
+ static_assert_imm4!(LANE1);
+ static_assert_imm4!(LANE2);
+ match LANE1 & 0b1111 {
+ 0 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [16 + LANE2 as u32, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 1 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 16 + LANE2 as u32, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 2 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 16 + LANE2 as u32, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 3 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 16 + LANE2 as u32, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 4 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 16 + LANE2 as u32, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 5 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 16 + LANE2 as u32, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 6 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 16 + LANE2 as u32, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 7 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 16 + LANE2 as u32, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 8 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 16 + LANE2 as u32, 9, 10, 11, 12, 13, 14, 15]),
+ 9 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 8, 16 + LANE2 as u32, 10, 11, 12, 13, 14, 15]),
+ 10 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 16 + LANE2 as u32, 11, 12, 13, 14, 15]),
+ 11 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 16 + LANE2 as u32, 12, 13, 14, 15]),
+ 12 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 16 + LANE2 as u32, 13, 14, 15]),
+ 13 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 16 + LANE2 as u32, 14, 15]),
+ 14 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16 + LANE2 as u32, 15]),
+ 15 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopy_lane_s16<const LANE1: i32, const LANE2: i32>(a: int16x4_t, b: int16x4_t) -> int16x4_t {
+ static_assert_imm2!(LANE1);
+ static_assert_imm2!(LANE2);
+ match LANE1 & 0b11 {
+ 0 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [4 + LANE2 as u32, 1, 2, 3]),
+ 1 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [0, 4 + LANE2 as u32, 2, 3]),
+ 2 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 4 + LANE2 as u32, 3]),
+ 3 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 4 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopyq_laneq_s16<const LANE1: i32, const LANE2: i32>(a: int16x8_t, b: int16x8_t) -> int16x8_t {
+ static_assert_imm3!(LANE1);
+ static_assert_imm3!(LANE2);
+ match LANE1 & 0b111 {
+ 0 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [8 + LANE2 as u32, 1, 2, 3, 4, 5, 6, 7]),
+ 1 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 8 + LANE2 as u32, 2, 3, 4, 5, 6, 7]),
+ 2 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 8 + LANE2 as u32, 3, 4, 5, 6, 7]),
+ 3 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 8 + LANE2 as u32, 4, 5, 6, 7]),
+ 4 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 8 + LANE2 as u32, 5, 6, 7]),
+ 5 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 8 + LANE2 as u32, 6, 7]),
+ 6 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 8 + LANE2 as u32, 7]),
+ 7 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 8 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopy_lane_s32<const LANE1: i32, const LANE2: i32>(a: int32x2_t, b: int32x2_t) -> int32x2_t {
+ static_assert_imm1!(LANE1);
+ static_assert_imm1!(LANE2);
+ match LANE1 & 0b1 {
+ 0 => simd_shuffle2!(a, b, <const LANE1: i32, const LANE2: i32> [2 + LANE2 as u32, 1]),
+ 1 => simd_shuffle2!(a, b, <const LANE1: i32, const LANE2: i32> [0, 2 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopyq_laneq_s32<const LANE1: i32, const LANE2: i32>(a: int32x4_t, b: int32x4_t) -> int32x4_t {
+ static_assert_imm2!(LANE1);
+ static_assert_imm2!(LANE2);
+ match LANE1 & 0b11 {
+ 0 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [4 + LANE2 as u32, 1, 2, 3]),
+ 1 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [0, 4 + LANE2 as u32, 2, 3]),
+ 2 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 4 + LANE2 as u32, 3]),
+ 3 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 4 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopyq_laneq_s64<const LANE1: i32, const LANE2: i32>(a: int64x2_t, b: int64x2_t) -> int64x2_t {
+ static_assert_imm1!(LANE1);
+ static_assert_imm1!(LANE2);
+ match LANE1 & 0b1 {
+ 0 => simd_shuffle2!(a, b, <const LANE1: i32, const LANE2: i32> [2 + LANE2 as u32, 1]),
+ 1 => simd_shuffle2!(a, b, <const LANE1: i32, const LANE2: i32> [0, 2 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopy_lane_u8<const LANE1: i32, const LANE2: i32>(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t {
+ static_assert_imm3!(LANE1);
+ static_assert_imm3!(LANE2);
+ match LANE1 & 0b111 {
+ 0 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [8 + LANE2 as u32, 1, 2, 3, 4, 5, 6, 7]),
+ 1 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 8 + LANE2 as u32, 2, 3, 4, 5, 6, 7]),
+ 2 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 8 + LANE2 as u32, 3, 4, 5, 6, 7]),
+ 3 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 8 + LANE2 as u32, 4, 5, 6, 7]),
+ 4 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 8 + LANE2 as u32, 5, 6, 7]),
+ 5 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 8 + LANE2 as u32, 6, 7]),
+ 6 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 8 + LANE2 as u32, 7]),
+ 7 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 8 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopyq_laneq_u8<const LANE1: i32, const LANE2: i32>(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t {
+ static_assert_imm4!(LANE1);
+ static_assert_imm4!(LANE2);
+ match LANE1 & 0b1111 {
+ 0 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [16 + LANE2 as u32, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 1 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 16 + LANE2 as u32, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 2 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 16 + LANE2 as u32, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 3 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 16 + LANE2 as u32, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 4 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 16 + LANE2 as u32, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 5 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 16 + LANE2 as u32, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 6 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 16 + LANE2 as u32, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 7 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 16 + LANE2 as u32, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 8 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 16 + LANE2 as u32, 9, 10, 11, 12, 13, 14, 15]),
+ 9 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 8, 16 + LANE2 as u32, 10, 11, 12, 13, 14, 15]),
+ 10 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 16 + LANE2 as u32, 11, 12, 13, 14, 15]),
+ 11 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 16 + LANE2 as u32, 12, 13, 14, 15]),
+ 12 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 16 + LANE2 as u32, 13, 14, 15]),
+ 13 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 16 + LANE2 as u32, 14, 15]),
+ 14 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16 + LANE2 as u32, 15]),
+ 15 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopy_lane_u16<const LANE1: i32, const LANE2: i32>(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t {
+ static_assert_imm2!(LANE1);
+ static_assert_imm2!(LANE2);
+ match LANE1 & 0b11 {
+ 0 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [4 + LANE2 as u32, 1, 2, 3]),
+ 1 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [0, 4 + LANE2 as u32, 2, 3]),
+ 2 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 4 + LANE2 as u32, 3]),
+ 3 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 4 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopyq_laneq_u16<const LANE1: i32, const LANE2: i32>(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t {
+ static_assert_imm3!(LANE1);
+ static_assert_imm3!(LANE2);
+ match LANE1 & 0b111 {
+ 0 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [8 + LANE2 as u32, 1, 2, 3, 4, 5, 6, 7]),
+ 1 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 8 + LANE2 as u32, 2, 3, 4, 5, 6, 7]),
+ 2 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 8 + LANE2 as u32, 3, 4, 5, 6, 7]),
+ 3 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 8 + LANE2 as u32, 4, 5, 6, 7]),
+ 4 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 8 + LANE2 as u32, 5, 6, 7]),
+ 5 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 8 + LANE2 as u32, 6, 7]),
+ 6 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 8 + LANE2 as u32, 7]),
+ 7 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 8 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopy_lane_u32<const LANE1: i32, const LANE2: i32>(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t {
+ static_assert_imm1!(LANE1);
+ static_assert_imm1!(LANE2);
+ match LANE1 & 0b1 {
+ 0 => simd_shuffle2!(a, b, <const LANE1: i32, const LANE2: i32> [2 + LANE2 as u32, 1]),
+ 1 => simd_shuffle2!(a, b, <const LANE1: i32, const LANE2: i32> [0, 2 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopyq_laneq_u32<const LANE1: i32, const LANE2: i32>(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
+ static_assert_imm2!(LANE1);
+ static_assert_imm2!(LANE2);
+ match LANE1 & 0b11 {
+ 0 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [4 + LANE2 as u32, 1, 2, 3]),
+ 1 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [0, 4 + LANE2 as u32, 2, 3]),
+ 2 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 4 + LANE2 as u32, 3]),
+ 3 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 4 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopyq_laneq_u64<const LANE1: i32, const LANE2: i32>(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t {
+ static_assert_imm1!(LANE1);
+ static_assert_imm1!(LANE2);
+ match LANE1 & 0b1 {
+ 0 => simd_shuffle2!(a, b, <const LANE1: i32, const LANE2: i32> [2 + LANE2 as u32, 1]),
+ 1 => simd_shuffle2!(a, b, <const LANE1: i32, const LANE2: i32> [0, 2 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopy_lane_p8<const LANE1: i32, const LANE2: i32>(a: poly8x8_t, b: poly8x8_t) -> poly8x8_t {
+ static_assert_imm3!(LANE1);
+ static_assert_imm3!(LANE2);
+ match LANE1 & 0b111 {
+ 0 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [8 + LANE2 as u32, 1, 2, 3, 4, 5, 6, 7]),
+ 1 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 8 + LANE2 as u32, 2, 3, 4, 5, 6, 7]),
+ 2 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 8 + LANE2 as u32, 3, 4, 5, 6, 7]),
+ 3 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 8 + LANE2 as u32, 4, 5, 6, 7]),
+ 4 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 8 + LANE2 as u32, 5, 6, 7]),
+ 5 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 8 + LANE2 as u32, 6, 7]),
+ 6 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 8 + LANE2 as u32, 7]),
+ 7 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 8 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopyq_laneq_p8<const LANE1: i32, const LANE2: i32>(a: poly8x16_t, b: poly8x16_t) -> poly8x16_t {
+ static_assert_imm4!(LANE1);
+ static_assert_imm4!(LANE2);
+ match LANE1 & 0b1111 {
+ 0 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [16 + LANE2 as u32, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 1 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 16 + LANE2 as u32, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 2 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 16 + LANE2 as u32, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 3 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 16 + LANE2 as u32, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 4 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 16 + LANE2 as u32, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 5 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 16 + LANE2 as u32, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 6 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 16 + LANE2 as u32, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 7 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 16 + LANE2 as u32, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 8 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 16 + LANE2 as u32, 9, 10, 11, 12, 13, 14, 15]),
+ 9 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 8, 16 + LANE2 as u32, 10, 11, 12, 13, 14, 15]),
+ 10 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 16 + LANE2 as u32, 11, 12, 13, 14, 15]),
+ 11 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 16 + LANE2 as u32, 12, 13, 14, 15]),
+ 12 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 16 + LANE2 as u32, 13, 14, 15]),
+ 13 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 16 + LANE2 as u32, 14, 15]),
+ 14 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16 + LANE2 as u32, 15]),
+ 15 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopy_lane_p16<const LANE1: i32, const LANE2: i32>(a: poly16x4_t, b: poly16x4_t) -> poly16x4_t {
+ static_assert_imm2!(LANE1);
+ static_assert_imm2!(LANE2);
+ match LANE1 & 0b11 {
+ 0 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [4 + LANE2 as u32, 1, 2, 3]),
+ 1 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [0, 4 + LANE2 as u32, 2, 3]),
+ 2 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 4 + LANE2 as u32, 3]),
+ 3 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 4 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopyq_laneq_p16<const LANE1: i32, const LANE2: i32>(a: poly16x8_t, b: poly16x8_t) -> poly16x8_t {
+ static_assert_imm3!(LANE1);
+ static_assert_imm3!(LANE2);
+ match LANE1 & 0b111 {
+ 0 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [8 + LANE2 as u32, 1, 2, 3, 4, 5, 6, 7]),
+ 1 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 8 + LANE2 as u32, 2, 3, 4, 5, 6, 7]),
+ 2 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 8 + LANE2 as u32, 3, 4, 5, 6, 7]),
+ 3 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 8 + LANE2 as u32, 4, 5, 6, 7]),
+ 4 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 8 + LANE2 as u32, 5, 6, 7]),
+ 5 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 8 + LANE2 as u32, 6, 7]),
+ 6 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 8 + LANE2 as u32, 7]),
+ 7 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 8 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopyq_laneq_p64<const LANE1: i32, const LANE2: i32>(a: poly64x2_t, b: poly64x2_t) -> poly64x2_t {
+ static_assert_imm1!(LANE1);
+ static_assert_imm1!(LANE2);
+ match LANE1 & 0b1 {
+ 0 => simd_shuffle2!(a, b, <const LANE1: i32, const LANE2: i32> [2 + LANE2 as u32, 1]),
+ 1 => simd_shuffle2!(a, b, <const LANE1: i32, const LANE2: i32> [0, 2 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopy_lane_f32<const LANE1: i32, const LANE2: i32>(a: float32x2_t, b: float32x2_t) -> float32x2_t {
+ static_assert_imm1!(LANE1);
+ static_assert_imm1!(LANE2);
+ match LANE1 & 0b1 {
+ 0 => simd_shuffle2!(a, b, <const LANE1: i32, const LANE2: i32> [2 + LANE2 as u32, 1]),
+ 1 => simd_shuffle2!(a, b, <const LANE1: i32, const LANE2: i32> [0, 2 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopyq_laneq_f32<const LANE1: i32, const LANE2: i32>(a: float32x4_t, b: float32x4_t) -> float32x4_t {
+ static_assert_imm2!(LANE1);
+ static_assert_imm2!(LANE2);
+ match LANE1 & 0b11 {
+ 0 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [4 + LANE2 as u32, 1, 2, 3]),
+ 1 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [0, 4 + LANE2 as u32, 2, 3]),
+ 2 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 4 + LANE2 as u32, 3]),
+ 3 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 4 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopyq_laneq_f64<const LANE1: i32, const LANE2: i32>(a: float64x2_t, b: float64x2_t) -> float64x2_t {
+ static_assert_imm1!(LANE1);
+ static_assert_imm1!(LANE2);
+ match LANE1 & 0b1 {
+ 0 => simd_shuffle2!(a, b, <const LANE1: i32, const LANE2: i32> [2 + LANE2 as u32, 1]),
+ 1 => simd_shuffle2!(a, b, <const LANE1: i32, const LANE2: i32> [0, 2 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopy_laneq_s8<const LANE1: i32, const LANE2: i32>(a: int8x8_t, b: int8x16_t) -> int8x8_t {
+ static_assert_imm3!(LANE1);
+ static_assert_imm4!(LANE2);
+ let a: int8x16_t = simd_shuffle16!(a, a, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]);
+ match LANE1 & 0b111 {
+ 0 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [16 + LANE2 as u32, 1, 2, 3, 4, 5, 6, 7]),
+ 1 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 16 + LANE2 as u32, 2, 3, 4, 5, 6, 7]),
+ 2 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 16 + LANE2 as u32, 3, 4, 5, 6, 7]),
+ 3 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 16 + LANE2 as u32, 4, 5, 6, 7]),
+ 4 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 16 + LANE2 as u32, 5, 6, 7]),
+ 5 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 16 + LANE2 as u32, 6, 7]),
+ 6 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 16 + LANE2 as u32, 7]),
+ 7 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 16 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopy_laneq_s16<const LANE1: i32, const LANE2: i32>(a: int16x4_t, b: int16x8_t) -> int16x4_t {
+ static_assert_imm2!(LANE1);
+ static_assert_imm3!(LANE2);
+ let a: int16x8_t = simd_shuffle8!(a, a, [0, 1, 2, 3, 4, 5, 6, 7]);
+ match LANE1 & 0b11 {
+ 0 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [8 + LANE2 as u32, 1, 2, 3]),
+ 1 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [0, 8 + LANE2 as u32, 2, 3]),
+ 2 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 8 + LANE2 as u32, 3]),
+ 3 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 8 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopy_laneq_s32<const LANE1: i32, const LANE2: i32>(a: int32x2_t, b: int32x4_t) -> int32x2_t {
+ static_assert_imm1!(LANE1);
+ static_assert_imm2!(LANE2);
+ let a: int32x4_t = simd_shuffle4!(a, a, [0, 1, 2, 3]);
+ match LANE1 & 0b1 {
+ 0 => simd_shuffle2!(a, b, <const LANE1: i32, const LANE2: i32> [4 + LANE2 as u32, 1]),
+ 1 => simd_shuffle2!(a, b, <const LANE1: i32, const LANE2: i32> [0, 4 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopy_laneq_u8<const LANE1: i32, const LANE2: i32>(a: uint8x8_t, b: uint8x16_t) -> uint8x8_t {
+ static_assert_imm3!(LANE1);
+ static_assert_imm4!(LANE2);
+ let a: uint8x16_t = simd_shuffle16!(a, a, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]);
+ match LANE1 & 0b111 {
+ 0 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [16 + LANE2 as u32, 1, 2, 3, 4, 5, 6, 7]),
+ 1 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 16 + LANE2 as u32, 2, 3, 4, 5, 6, 7]),
+ 2 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 16 + LANE2 as u32, 3, 4, 5, 6, 7]),
+ 3 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 16 + LANE2 as u32, 4, 5, 6, 7]),
+ 4 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 16 + LANE2 as u32, 5, 6, 7]),
+ 5 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 16 + LANE2 as u32, 6, 7]),
+ 6 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 16 + LANE2 as u32, 7]),
+ 7 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 16 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopy_laneq_u16<const LANE1: i32, const LANE2: i32>(a: uint16x4_t, b: uint16x8_t) -> uint16x4_t {
+ static_assert_imm2!(LANE1);
+ static_assert_imm3!(LANE2);
+ let a: uint16x8_t = simd_shuffle8!(a, a, [0, 1, 2, 3, 4, 5, 6, 7]);
+ match LANE1 & 0b11 {
+ 0 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [8 + LANE2 as u32, 1, 2, 3]),
+ 1 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [0, 8 + LANE2 as u32, 2, 3]),
+ 2 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 8 + LANE2 as u32, 3]),
+ 3 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 8 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopy_laneq_u32<const LANE1: i32, const LANE2: i32>(a: uint32x2_t, b: uint32x4_t) -> uint32x2_t {
+ static_assert_imm1!(LANE1);
+ static_assert_imm2!(LANE2);
+ let a: uint32x4_t = simd_shuffle4!(a, a, [0, 1, 2, 3]);
+ match LANE1 & 0b1 {
+ 0 => simd_shuffle2!(a, b, <const LANE1: i32, const LANE2: i32> [4 + LANE2 as u32, 1]),
+ 1 => simd_shuffle2!(a, b, <const LANE1: i32, const LANE2: i32> [0, 4 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopy_laneq_p8<const LANE1: i32, const LANE2: i32>(a: poly8x8_t, b: poly8x16_t) -> poly8x8_t {
+ static_assert_imm3!(LANE1);
+ static_assert_imm4!(LANE2);
+ let a: poly8x16_t = simd_shuffle16!(a, a, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]);
+ match LANE1 & 0b111 {
+ 0 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [16 + LANE2 as u32, 1, 2, 3, 4, 5, 6, 7]),
+ 1 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 16 + LANE2 as u32, 2, 3, 4, 5, 6, 7]),
+ 2 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 16 + LANE2 as u32, 3, 4, 5, 6, 7]),
+ 3 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 16 + LANE2 as u32, 4, 5, 6, 7]),
+ 4 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 16 + LANE2 as u32, 5, 6, 7]),
+ 5 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 16 + LANE2 as u32, 6, 7]),
+ 6 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 16 + LANE2 as u32, 7]),
+ 7 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 16 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopy_laneq_p16<const LANE1: i32, const LANE2: i32>(a: poly16x4_t, b: poly16x8_t) -> poly16x4_t {
+ static_assert_imm2!(LANE1);
+ static_assert_imm3!(LANE2);
+ let a: poly16x8_t = simd_shuffle8!(a, a, [0, 1, 2, 3, 4, 5, 6, 7]);
+ match LANE1 & 0b11 {
+ 0 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [8 + LANE2 as u32, 1, 2, 3]),
+ 1 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [0, 8 + LANE2 as u32, 2, 3]),
+ 2 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 8 + LANE2 as u32, 3]),
+ 3 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 8 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopy_laneq_f32<const LANE1: i32, const LANE2: i32>(a: float32x2_t, b: float32x4_t) -> float32x2_t {
+ static_assert_imm1!(LANE1);
+ static_assert_imm2!(LANE2);
+ let a: float32x4_t = simd_shuffle4!(a, a, [0, 1, 2, 3]);
+ match LANE1 & 0b1 {
+ 0 => simd_shuffle2!(a, b, <const LANE1: i32, const LANE2: i32> [4 + LANE2 as u32, 1]),
+ 1 => simd_shuffle2!(a, b, <const LANE1: i32, const LANE2: i32> [0, 4 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopyq_lane_s8<const LANE1: i32, const LANE2: i32>(a: int8x16_t, b: int8x8_t) -> int8x16_t {
+ static_assert_imm4!(LANE1);
+ static_assert_imm3!(LANE2);
+ let b: int8x16_t = simd_shuffle16!(b, b, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]);
+ match LANE1 & 0b1111 {
+ 0 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [16 + LANE2 as u32, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 1 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 16 + LANE2 as u32, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 2 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 16 + LANE2 as u32, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 3 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 16 + LANE2 as u32, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 4 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 16 + LANE2 as u32, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 5 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 16 + LANE2 as u32, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 6 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 16 + LANE2 as u32, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 7 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 16 + LANE2 as u32, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 8 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 16 + LANE2 as u32, 9, 10, 11, 12, 13, 14, 15]),
+ 9 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 8, 16 + LANE2 as u32, 10, 11, 12, 13, 14, 15]),
+ 10 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 16 + LANE2 as u32, 11, 12, 13, 14, 15]),
+ 11 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 16 + LANE2 as u32, 12, 13, 14, 15]),
+ 12 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 16 + LANE2 as u32, 13, 14, 15]),
+ 13 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 16 + LANE2 as u32, 14, 15]),
+ 14 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16 + LANE2 as u32, 15]),
+ 15 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopyq_lane_s16<const LANE1: i32, const LANE2: i32>(a: int16x8_t, b: int16x4_t) -> int16x8_t {
+ static_assert_imm3!(LANE1);
+ static_assert_imm2!(LANE2);
+ let b: int16x8_t = simd_shuffle8!(b, b, [0, 1, 2, 3, 4, 5, 6, 7]);
+ match LANE1 & 0b111 {
+ 0 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [8 + LANE2 as u32, 1, 2, 3, 4, 5, 6, 7]),
+ 1 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 8 + LANE2 as u32, 2, 3, 4, 5, 6, 7]),
+ 2 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 8 + LANE2 as u32, 3, 4, 5, 6, 7]),
+ 3 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 8 + LANE2 as u32, 4, 5, 6, 7]),
+ 4 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 8 + LANE2 as u32, 5, 6, 7]),
+ 5 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 8 + LANE2 as u32, 6, 7]),
+ 6 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 8 + LANE2 as u32, 7]),
+ 7 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 8 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopyq_lane_s32<const LANE1: i32, const LANE2: i32>(a: int32x4_t, b: int32x2_t) -> int32x4_t {
+ static_assert_imm2!(LANE1);
+ static_assert_imm1!(LANE2);
+ let b: int32x4_t = simd_shuffle4!(b, b, [0, 1, 2, 3]);
+ match LANE1 & 0b11 {
+ 0 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [4 + LANE2 as u32, 1, 2, 3]),
+ 1 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [0, 4 + LANE2 as u32, 2, 3]),
+ 2 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 4 + LANE2 as u32, 3]),
+ 3 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 4 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopyq_lane_u8<const LANE1: i32, const LANE2: i32>(a: uint8x16_t, b: uint8x8_t) -> uint8x16_t {
+ static_assert_imm4!(LANE1);
+ static_assert_imm3!(LANE2);
+ let b: uint8x16_t = simd_shuffle16!(b, b, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]);
+ match LANE1 & 0b1111 {
+ 0 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [16 + LANE2 as u32, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 1 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 16 + LANE2 as u32, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 2 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 16 + LANE2 as u32, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 3 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 16 + LANE2 as u32, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 4 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 16 + LANE2 as u32, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 5 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 16 + LANE2 as u32, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 6 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 16 + LANE2 as u32, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 7 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 16 + LANE2 as u32, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 8 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 16 + LANE2 as u32, 9, 10, 11, 12, 13, 14, 15]),
+ 9 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 8, 16 + LANE2 as u32, 10, 11, 12, 13, 14, 15]),
+ 10 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 16 + LANE2 as u32, 11, 12, 13, 14, 15]),
+ 11 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 16 + LANE2 as u32, 12, 13, 14, 15]),
+ 12 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 16 + LANE2 as u32, 13, 14, 15]),
+ 13 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 16 + LANE2 as u32, 14, 15]),
+ 14 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16 + LANE2 as u32, 15]),
+ 15 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopyq_lane_u16<const LANE1: i32, const LANE2: i32>(a: uint16x8_t, b: uint16x4_t) -> uint16x8_t {
+ static_assert_imm3!(LANE1);
+ static_assert_imm2!(LANE2);
+ let b: uint16x8_t = simd_shuffle8!(b, b, [0, 1, 2, 3, 4, 5, 6, 7]);
+ match LANE1 & 0b111 {
+ 0 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [8 + LANE2 as u32, 1, 2, 3, 4, 5, 6, 7]),
+ 1 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 8 + LANE2 as u32, 2, 3, 4, 5, 6, 7]),
+ 2 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 8 + LANE2 as u32, 3, 4, 5, 6, 7]),
+ 3 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 8 + LANE2 as u32, 4, 5, 6, 7]),
+ 4 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 8 + LANE2 as u32, 5, 6, 7]),
+ 5 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 8 + LANE2 as u32, 6, 7]),
+ 6 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 8 + LANE2 as u32, 7]),
+ 7 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 8 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopyq_lane_u32<const LANE1: i32, const LANE2: i32>(a: uint32x4_t, b: uint32x2_t) -> uint32x4_t {
+ static_assert_imm2!(LANE1);
+ static_assert_imm1!(LANE2);
+ let b: uint32x4_t = simd_shuffle4!(b, b, [0, 1, 2, 3]);
+ match LANE1 & 0b11 {
+ 0 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [4 + LANE2 as u32, 1, 2, 3]),
+ 1 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [0, 4 + LANE2 as u32, 2, 3]),
+ 2 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 4 + LANE2 as u32, 3]),
+ 3 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 4 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopyq_lane_p8<const LANE1: i32, const LANE2: i32>(a: poly8x16_t, b: poly8x8_t) -> poly8x16_t {
+ static_assert_imm4!(LANE1);
+ static_assert_imm3!(LANE2);
+ let b: poly8x16_t = simd_shuffle16!(b, b, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]);
+ match LANE1 & 0b1111 {
+ 0 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [16 + LANE2 as u32, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 1 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 16 + LANE2 as u32, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 2 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 16 + LANE2 as u32, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 3 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 16 + LANE2 as u32, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 4 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 16 + LANE2 as u32, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 5 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 16 + LANE2 as u32, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 6 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 16 + LANE2 as u32, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 7 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 16 + LANE2 as u32, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 8 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 16 + LANE2 as u32, 9, 10, 11, 12, 13, 14, 15]),
+ 9 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 8, 16 + LANE2 as u32, 10, 11, 12, 13, 14, 15]),
+ 10 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 16 + LANE2 as u32, 11, 12, 13, 14, 15]),
+ 11 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 16 + LANE2 as u32, 12, 13, 14, 15]),
+ 12 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 16 + LANE2 as u32, 13, 14, 15]),
+ 13 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 16 + LANE2 as u32, 14, 15]),
+ 14 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16 + LANE2 as u32, 15]),
+ 15 => simd_shuffle16!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopyq_lane_p16<const LANE1: i32, const LANE2: i32>(a: poly16x8_t, b: poly16x4_t) -> poly16x8_t {
+ static_assert_imm3!(LANE1);
+ static_assert_imm2!(LANE2);
+ let b: poly16x8_t = simd_shuffle8!(b, b, [0, 1, 2, 3, 4, 5, 6, 7]);
+ match LANE1 & 0b111 {
+ 0 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [8 + LANE2 as u32, 1, 2, 3, 4, 5, 6, 7]),
+ 1 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 8 + LANE2 as u32, 2, 3, 4, 5, 6, 7]),
+ 2 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 8 + LANE2 as u32, 3, 4, 5, 6, 7]),
+ 3 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 8 + LANE2 as u32, 4, 5, 6, 7]),
+ 4 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 8 + LANE2 as u32, 5, 6, 7]),
+ 5 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 8 + LANE2 as u32, 6, 7]),
+ 6 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 8 + LANE2 as u32, 7]),
+ 7 => simd_shuffle8!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 3, 4, 5, 6, 8 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 1, LANE2 = 0))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopyq_lane_s64<const LANE1: i32, const LANE2: i32>(a: int64x2_t, b: int64x1_t) -> int64x2_t {
+ static_assert_imm1!(LANE1);
+ static_assert!(LANE2 : i32 where LANE2 == 0);
+ let b: int64x2_t = simd_shuffle2!(b, b, [0, 1]);
+ match LANE1 & 0b1 {
+ 0 => simd_shuffle2!(a, b, <const LANE1: i32, const LANE2: i32> [2 + LANE2 as u32, 1]),
+ 1 => simd_shuffle2!(a, b, <const LANE1: i32, const LANE2: i32> [0, 2 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 1, LANE2 = 0))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopyq_lane_u64<const LANE1: i32, const LANE2: i32>(a: uint64x2_t, b: uint64x1_t) -> uint64x2_t {
+ static_assert_imm1!(LANE1);
+ static_assert!(LANE2 : i32 where LANE2 == 0);
+ let b: uint64x2_t = simd_shuffle2!(b, b, [0, 1]);
+ match LANE1 & 0b1 {
+ 0 => simd_shuffle2!(a, b, <const LANE1: i32, const LANE2: i32> [2 + LANE2 as u32, 1]),
+ 1 => simd_shuffle2!(a, b, <const LANE1: i32, const LANE2: i32> [0, 2 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 1, LANE2 = 0))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopyq_lane_p64<const LANE1: i32, const LANE2: i32>(a: poly64x2_t, b: poly64x1_t) -> poly64x2_t {
+ static_assert_imm1!(LANE1);
+ static_assert!(LANE2 : i32 where LANE2 == 0);
+ let b: poly64x2_t = simd_shuffle2!(b, b, [0, 1]);
+ match LANE1 & 0b1 {
+ 0 => simd_shuffle2!(a, b, <const LANE1: i32, const LANE2: i32> [2 + LANE2 as u32, 1]),
+ 1 => simd_shuffle2!(a, b, <const LANE1: i32, const LANE2: i32> [0, 2 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 1, LANE2 = 0))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopyq_lane_f32<const LANE1: i32, const LANE2: i32>(a: float32x4_t, b: float32x2_t) -> float32x4_t {
+ static_assert_imm2!(LANE1);
+ static_assert_imm1!(LANE2);
+ let b: float32x4_t = simd_shuffle4!(b, b, [0, 1, 2, 3]);
+ match LANE1 & 0b11 {
+ 0 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [4 + LANE2 as u32, 1, 2, 3]),
+ 1 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [0, 4 + LANE2 as u32, 2, 3]),
+ 2 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 4 + LANE2 as u32, 3]),
+ 3 => simd_shuffle4!(a, b, <const LANE1: i32, const LANE2: i32> [0, 1, 2, 4 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov, LANE1 = 1, LANE2 = 0))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopyq_lane_f64<const LANE1: i32, const LANE2: i32>(a: float64x2_t, b: float64x1_t) -> float64x2_t {
+ static_assert_imm1!(LANE1);
+ static_assert!(LANE2 : i32 where LANE2 == 0);
+ let b: float64x2_t = simd_shuffle2!(b, b, [0, 1]);
+ match LANE1 & 0b1 {
+ 0 => simd_shuffle2!(a, b, <const LANE1: i32, const LANE2: i32> [2 + LANE2 as u32, 1]),
+ 1 => simd_shuffle2!(a, b, <const LANE1: i32, const LANE2: i32> [0, 2 + LANE2 as u32]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcreate_f64(a: u64) -> float64x1_t {
+ transmute(a)
+}
+
+/// Fixed-point convert to floating-point
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(scvtf))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvt_f64_s64(a: int64x1_t) -> float64x1_t {
+ simd_cast(a)
+}
+
+/// Fixed-point convert to floating-point
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(scvtf))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtq_f64_s64(a: int64x2_t) -> float64x2_t {
+ simd_cast(a)
+}
+
+/// Fixed-point convert to floating-point
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ucvtf))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvt_f64_u64(a: uint64x1_t) -> float64x1_t {
+ simd_cast(a)
+}
+
+/// Fixed-point convert to floating-point
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ucvtf))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtq_f64_u64(a: uint64x2_t) -> float64x2_t {
+ simd_cast(a)
+}
+
+/// Floating-point convert to higher precision long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvt_f64_f32(a: float32x2_t) -> float64x2_t {
+ simd_cast(a)
+}
+
+/// Floating-point convert to higher precision long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvt_high_f64_f32(a: float32x4_t) -> float64x2_t {
+ let b: float32x2_t = simd_shuffle2!(a, a, [2, 3]);
+ simd_cast(b)
+}
+
+/// Floating-point convert to lower precision narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtn))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvt_f32_f64(a: float64x2_t) -> float32x2_t {
+ simd_cast(a)
+}
+
+/// Floating-point convert to lower precision narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtn))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvt_high_f32_f64(a: float32x2_t, b: float64x2_t) -> float32x4_t {
+ simd_shuffle4!(a, simd_cast(b), [0, 1, 2, 3])
+}
+
+/// Floating-point convert to lower precision narrow, rounding to odd
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtxn))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtx_f32_f64(a: float64x2_t) -> float32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtxn.v2f32.v2f64")]
+ fn vcvtx_f32_f64_(a: float64x2_t) -> float32x2_t;
+ }
+ vcvtx_f32_f64_(a)
+}
+
+/// Floating-point convert to lower precision narrow, rounding to odd
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtxn))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtxd_f32_f64(a: f64) -> f32 {
+ simd_extract(vcvtx_f32_f64(vdupq_n_f64(a)), 0)
+}
+
+/// Floating-point convert to lower precision narrow, rounding to odd
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtxn))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtx_high_f32_f64(a: float32x2_t, b: float64x2_t) -> float32x4_t {
+ simd_shuffle4!(a, vcvtx_f32_f64(b), [0, 1, 2, 3])
+}
+
+/// Fixed-point convert to floating-point
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(scvtf, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvt_n_f64_s64<const N: i32>(a: int64x1_t) -> float64x1_t {
+ static_assert!(N : i32 where N >= 1 && N <= 64);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.vcvtfxs2fp.v1f64.v1i64")]
+ fn vcvt_n_f64_s64_(a: int64x1_t, n: i32) -> float64x1_t;
+ }
+ vcvt_n_f64_s64_(a, N)
+}
+
+/// Fixed-point convert to floating-point
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(scvtf, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtq_n_f64_s64<const N: i32>(a: int64x2_t) -> float64x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 64);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.vcvtfxs2fp.v2f64.v2i64")]
+ fn vcvtq_n_f64_s64_(a: int64x2_t, n: i32) -> float64x2_t;
+ }
+ vcvtq_n_f64_s64_(a, N)
+}
+
+/// Fixed-point convert to floating-point
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(scvtf, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvts_n_f32_s32<const N: i32>(a: i32) -> f32 {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.vcvtfxs2fp.f32.i32")]
+ fn vcvts_n_f32_s32_(a: i32, n: i32) -> f32;
+ }
+ vcvts_n_f32_s32_(a, N)
+}
+
+/// Fixed-point convert to floating-point
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(scvtf, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtd_n_f64_s64<const N: i32>(a: i64) -> f64 {
+ static_assert!(N : i32 where N >= 1 && N <= 64);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.vcvtfxs2fp.f64.i64")]
+ fn vcvtd_n_f64_s64_(a: i64, n: i32) -> f64;
+ }
+ vcvtd_n_f64_s64_(a, N)
+}
+
+/// Fixed-point convert to floating-point
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ucvtf, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvt_n_f64_u64<const N: i32>(a: uint64x1_t) -> float64x1_t {
+ static_assert!(N : i32 where N >= 1 && N <= 64);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.vcvtfxu2fp.v1f64.v1i64")]
+ fn vcvt_n_f64_u64_(a: uint64x1_t, n: i32) -> float64x1_t;
+ }
+ vcvt_n_f64_u64_(a, N)
+}
+
+/// Fixed-point convert to floating-point
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ucvtf, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtq_n_f64_u64<const N: i32>(a: uint64x2_t) -> float64x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 64);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.vcvtfxu2fp.v2f64.v2i64")]
+ fn vcvtq_n_f64_u64_(a: uint64x2_t, n: i32) -> float64x2_t;
+ }
+ vcvtq_n_f64_u64_(a, N)
+}
+
+/// Fixed-point convert to floating-point
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ucvtf, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvts_n_f32_u32<const N: i32>(a: u32) -> f32 {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.vcvtfxu2fp.f32.i32")]
+ fn vcvts_n_f32_u32_(a: u32, n: i32) -> f32;
+ }
+ vcvts_n_f32_u32_(a, N)
+}
+
+/// Fixed-point convert to floating-point
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ucvtf, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtd_n_f64_u64<const N: i32>(a: u64) -> f64 {
+ static_assert!(N : i32 where N >= 1 && N <= 64);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.vcvtfxu2fp.f64.i64")]
+ fn vcvtd_n_f64_u64_(a: u64, n: i32) -> f64;
+ }
+ vcvtd_n_f64_u64_(a, N)
+}
+
+/// Floating-point convert to fixed-point, rounding toward zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtzs, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvt_n_s64_f64<const N: i32>(a: float64x1_t) -> int64x1_t {
+ static_assert!(N : i32 where N >= 1 && N <= 64);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.vcvtfp2fxs.v1i64.v1f64")]
+ fn vcvt_n_s64_f64_(a: float64x1_t, n: i32) -> int64x1_t;
+ }
+ vcvt_n_s64_f64_(a, N)
+}
+
+/// Floating-point convert to fixed-point, rounding toward zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtzs, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtq_n_s64_f64<const N: i32>(a: float64x2_t) -> int64x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 64);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.vcvtfp2fxs.v2i64.v2f64")]
+ fn vcvtq_n_s64_f64_(a: float64x2_t, n: i32) -> int64x2_t;
+ }
+ vcvtq_n_s64_f64_(a, N)
+}
+
+/// Floating-point convert to fixed-point, rounding toward zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtzs, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvts_n_s32_f32<const N: i32>(a: f32) -> i32 {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.vcvtfp2fxs.i32.f32")]
+ fn vcvts_n_s32_f32_(a: f32, n: i32) -> i32;
+ }
+ vcvts_n_s32_f32_(a, N)
+}
+
+/// Floating-point convert to fixed-point, rounding toward zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtzs, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtd_n_s64_f64<const N: i32>(a: f64) -> i64 {
+ static_assert!(N : i32 where N >= 1 && N <= 64);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.vcvtfp2fxs.i64.f64")]
+ fn vcvtd_n_s64_f64_(a: f64, n: i32) -> i64;
+ }
+ vcvtd_n_s64_f64_(a, N)
+}
+
+/// Floating-point convert to fixed-point, rounding toward zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtzu, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvt_n_u64_f64<const N: i32>(a: float64x1_t) -> uint64x1_t {
+ static_assert!(N : i32 where N >= 1 && N <= 64);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.vcvtfp2fxu.v1i64.v1f64")]
+ fn vcvt_n_u64_f64_(a: float64x1_t, n: i32) -> uint64x1_t;
+ }
+ vcvt_n_u64_f64_(a, N)
+}
+
+/// Floating-point convert to fixed-point, rounding toward zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtzu, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtq_n_u64_f64<const N: i32>(a: float64x2_t) -> uint64x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 64);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.vcvtfp2fxu.v2i64.v2f64")]
+ fn vcvtq_n_u64_f64_(a: float64x2_t, n: i32) -> uint64x2_t;
+ }
+ vcvtq_n_u64_f64_(a, N)
+}
+
+/// Floating-point convert to fixed-point, rounding toward zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtzu, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvts_n_u32_f32<const N: i32>(a: f32) -> u32 {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.vcvtfp2fxu.i32.f32")]
+ fn vcvts_n_u32_f32_(a: f32, n: i32) -> u32;
+ }
+ vcvts_n_u32_f32_(a, N)
+}
+
+/// Floating-point convert to fixed-point, rounding toward zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtzu, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtd_n_u64_f64<const N: i32>(a: f64) -> u64 {
+ static_assert!(N : i32 where N >= 1 && N <= 64);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.vcvtfp2fxu.i64.f64")]
+ fn vcvtd_n_u64_f64_(a: f64, n: i32) -> u64;
+ }
+ vcvtd_n_u64_f64_(a, N)
+}
+
+/// Fixed-point convert to floating-point
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(scvtf))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvts_f32_s32(a: i32) -> f32 {
+ a as f32
+}
+
+/// Fixed-point convert to floating-point
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(scvtf))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtd_f64_s64(a: i64) -> f64 {
+ a as f64
+}
+
+/// Fixed-point convert to floating-point
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ucvtf))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvts_f32_u32(a: u32) -> f32 {
+ a as f32
+}
+
+/// Fixed-point convert to floating-point
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ucvtf))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtd_f64_u64(a: u64) -> f64 {
+ a as f64
+}
+
+/// Fixed-point convert to floating-point
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtzs))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvts_s32_f32(a: f32) -> i32 {
+ a as i32
+}
+
+/// Fixed-point convert to floating-point
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtzs))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtd_s64_f64(a: f64) -> i64 {
+ a as i64
+}
+
+/// Fixed-point convert to floating-point
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtzu))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvts_u32_f32(a: f32) -> u32 {
+ a as u32
+}
+
+/// Fixed-point convert to floating-point
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtzu))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtd_u64_f64(a: f64) -> u64 {
+ a as u64
+}
+
+/// Floating-point convert to signed fixed-point, rounding toward zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtzs))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvt_s64_f64(a: float64x1_t) -> int64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.fptosi.sat.v1i64.v1f64")]
+ fn vcvt_s64_f64_(a: float64x1_t) -> int64x1_t;
+ }
+ vcvt_s64_f64_(a)
+}
+
+/// Floating-point convert to signed fixed-point, rounding toward zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtzs))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtq_s64_f64(a: float64x2_t) -> int64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.fptosi.sat.v2i64.v2f64")]
+ fn vcvtq_s64_f64_(a: float64x2_t) -> int64x2_t;
+ }
+ vcvtq_s64_f64_(a)
+}
+
+/// Floating-point convert to unsigned fixed-point, rounding toward zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtzu))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvt_u64_f64(a: float64x1_t) -> uint64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.fptoui.sat.v1i64.v1f64")]
+ fn vcvt_u64_f64_(a: float64x1_t) -> uint64x1_t;
+ }
+ vcvt_u64_f64_(a)
+}
+
+/// Floating-point convert to unsigned fixed-point, rounding toward zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtzu))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtq_u64_f64(a: float64x2_t) -> uint64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.fptoui.sat.v2i64.v2f64")]
+ fn vcvtq_u64_f64_(a: float64x2_t) -> uint64x2_t;
+ }
+ vcvtq_u64_f64_(a)
+}
+
+/// Floating-point convert to signed integer, rounding to nearest with ties to away
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtas))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvta_s32_f32(a: float32x2_t) -> int32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtas.v2i32.v2f32")]
+ fn vcvta_s32_f32_(a: float32x2_t) -> int32x2_t;
+ }
+ vcvta_s32_f32_(a)
+}
+
+/// Floating-point convert to signed integer, rounding to nearest with ties to away
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtas))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtaq_s32_f32(a: float32x4_t) -> int32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtas.v4i32.v4f32")]
+ fn vcvtaq_s32_f32_(a: float32x4_t) -> int32x4_t;
+ }
+ vcvtaq_s32_f32_(a)
+}
+
+/// Floating-point convert to signed integer, rounding to nearest with ties to away
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtas))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvta_s64_f64(a: float64x1_t) -> int64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtas.v1i64.v1f64")]
+ fn vcvta_s64_f64_(a: float64x1_t) -> int64x1_t;
+ }
+ vcvta_s64_f64_(a)
+}
+
+/// Floating-point convert to signed integer, rounding to nearest with ties to away
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtas))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtaq_s64_f64(a: float64x2_t) -> int64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtas.v2i64.v2f64")]
+ fn vcvtaq_s64_f64_(a: float64x2_t) -> int64x2_t;
+ }
+ vcvtaq_s64_f64_(a)
+}
+
+/// Floating-point convert to integer, rounding to nearest with ties to away
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtas))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtas_s32_f32(a: f32) -> i32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtas.i32.f32")]
+ fn vcvtas_s32_f32_(a: f32) -> i32;
+ }
+ vcvtas_s32_f32_(a)
+}
+
+/// Floating-point convert to integer, rounding to nearest with ties to away
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtas))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtad_s64_f64(a: f64) -> i64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtas.i64.f64")]
+ fn vcvtad_s64_f64_(a: f64) -> i64;
+ }
+ vcvtad_s64_f64_(a)
+}
+
+/// Floating-point convert to integer, rounding to nearest with ties to away
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtau))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtas_u32_f32(a: f32) -> u32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtau.i32.f32")]
+ fn vcvtas_u32_f32_(a: f32) -> u32;
+ }
+ vcvtas_u32_f32_(a)
+}
+
+/// Floating-point convert to integer, rounding to nearest with ties to away
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtau))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtad_u64_f64(a: f64) -> u64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtau.i64.f64")]
+ fn vcvtad_u64_f64_(a: f64) -> u64;
+ }
+ vcvtad_u64_f64_(a)
+}
+
+/// Floating-point convert to signed integer, rounding to nearest with ties to even
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtns))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtn_s32_f32(a: float32x2_t) -> int32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtns.v2i32.v2f32")]
+ fn vcvtn_s32_f32_(a: float32x2_t) -> int32x2_t;
+ }
+ vcvtn_s32_f32_(a)
+}
+
+/// Floating-point convert to signed integer, rounding to nearest with ties to even
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtns))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtnq_s32_f32(a: float32x4_t) -> int32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtns.v4i32.v4f32")]
+ fn vcvtnq_s32_f32_(a: float32x4_t) -> int32x4_t;
+ }
+ vcvtnq_s32_f32_(a)
+}
+
+/// Floating-point convert to signed integer, rounding to nearest with ties to even
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtns))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtn_s64_f64(a: float64x1_t) -> int64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtns.v1i64.v1f64")]
+ fn vcvtn_s64_f64_(a: float64x1_t) -> int64x1_t;
+ }
+ vcvtn_s64_f64_(a)
+}
+
+/// Floating-point convert to signed integer, rounding to nearest with ties to even
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtns))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtnq_s64_f64(a: float64x2_t) -> int64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtns.v2i64.v2f64")]
+ fn vcvtnq_s64_f64_(a: float64x2_t) -> int64x2_t;
+ }
+ vcvtnq_s64_f64_(a)
+}
+
+/// Floating-point convert to signed integer, rounding to nearest with ties to even
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtns))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtns_s32_f32(a: f32) -> i32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtns.i32.f32")]
+ fn vcvtns_s32_f32_(a: f32) -> i32;
+ }
+ vcvtns_s32_f32_(a)
+}
+
+/// Floating-point convert to signed integer, rounding to nearest with ties to even
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtns))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtnd_s64_f64(a: f64) -> i64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtns.i64.f64")]
+ fn vcvtnd_s64_f64_(a: f64) -> i64;
+ }
+ vcvtnd_s64_f64_(a)
+}
+
+/// Floating-point convert to signed integer, rounding toward minus infinity
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtms))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtm_s32_f32(a: float32x2_t) -> int32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtms.v2i32.v2f32")]
+ fn vcvtm_s32_f32_(a: float32x2_t) -> int32x2_t;
+ }
+ vcvtm_s32_f32_(a)
+}
+
+/// Floating-point convert to signed integer, rounding toward minus infinity
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtms))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtmq_s32_f32(a: float32x4_t) -> int32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtms.v4i32.v4f32")]
+ fn vcvtmq_s32_f32_(a: float32x4_t) -> int32x4_t;
+ }
+ vcvtmq_s32_f32_(a)
+}
+
+/// Floating-point convert to signed integer, rounding toward minus infinity
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtms))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtm_s64_f64(a: float64x1_t) -> int64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtms.v1i64.v1f64")]
+ fn vcvtm_s64_f64_(a: float64x1_t) -> int64x1_t;
+ }
+ vcvtm_s64_f64_(a)
+}
+
+/// Floating-point convert to signed integer, rounding toward minus infinity
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtms))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtmq_s64_f64(a: float64x2_t) -> int64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtms.v2i64.v2f64")]
+ fn vcvtmq_s64_f64_(a: float64x2_t) -> int64x2_t;
+ }
+ vcvtmq_s64_f64_(a)
+}
+
+/// Floating-point convert to signed integer, rounding toward minus infinity
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtms))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtms_s32_f32(a: f32) -> i32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtms.i32.f32")]
+ fn vcvtms_s32_f32_(a: f32) -> i32;
+ }
+ vcvtms_s32_f32_(a)
+}
+
+/// Floating-point convert to signed integer, rounding toward minus infinity
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtms))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtmd_s64_f64(a: f64) -> i64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtms.i64.f64")]
+ fn vcvtmd_s64_f64_(a: f64) -> i64;
+ }
+ vcvtmd_s64_f64_(a)
+}
+
+/// Floating-point convert to signed integer, rounding toward plus infinity
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtps))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtp_s32_f32(a: float32x2_t) -> int32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtps.v2i32.v2f32")]
+ fn vcvtp_s32_f32_(a: float32x2_t) -> int32x2_t;
+ }
+ vcvtp_s32_f32_(a)
+}
+
+/// Floating-point convert to signed integer, rounding toward plus infinity
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtps))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtpq_s32_f32(a: float32x4_t) -> int32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtps.v4i32.v4f32")]
+ fn vcvtpq_s32_f32_(a: float32x4_t) -> int32x4_t;
+ }
+ vcvtpq_s32_f32_(a)
+}
+
+/// Floating-point convert to signed integer, rounding toward plus infinity
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtps))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtp_s64_f64(a: float64x1_t) -> int64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtps.v1i64.v1f64")]
+ fn vcvtp_s64_f64_(a: float64x1_t) -> int64x1_t;
+ }
+ vcvtp_s64_f64_(a)
+}
+
+/// Floating-point convert to signed integer, rounding toward plus infinity
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtps))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtpq_s64_f64(a: float64x2_t) -> int64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtps.v2i64.v2f64")]
+ fn vcvtpq_s64_f64_(a: float64x2_t) -> int64x2_t;
+ }
+ vcvtpq_s64_f64_(a)
+}
+
+/// Floating-point convert to signed integer, rounding toward plus infinity
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtps))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtps_s32_f32(a: f32) -> i32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtps.i32.f32")]
+ fn vcvtps_s32_f32_(a: f32) -> i32;
+ }
+ vcvtps_s32_f32_(a)
+}
+
+/// Floating-point convert to signed integer, rounding toward plus infinity
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtps))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtpd_s64_f64(a: f64) -> i64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtps.i64.f64")]
+ fn vcvtpd_s64_f64_(a: f64) -> i64;
+ }
+ vcvtpd_s64_f64_(a)
+}
+
+/// Floating-point convert to unsigned integer, rounding to nearest with ties to away
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtau))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvta_u32_f32(a: float32x2_t) -> uint32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtau.v2i32.v2f32")]
+ fn vcvta_u32_f32_(a: float32x2_t) -> uint32x2_t;
+ }
+ vcvta_u32_f32_(a)
+}
+
+/// Floating-point convert to unsigned integer, rounding to nearest with ties to away
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtau))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtaq_u32_f32(a: float32x4_t) -> uint32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtau.v4i32.v4f32")]
+ fn vcvtaq_u32_f32_(a: float32x4_t) -> uint32x4_t;
+ }
+ vcvtaq_u32_f32_(a)
+}
+
+/// Floating-point convert to unsigned integer, rounding to nearest with ties to away
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtau))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvta_u64_f64(a: float64x1_t) -> uint64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtau.v1i64.v1f64")]
+ fn vcvta_u64_f64_(a: float64x1_t) -> uint64x1_t;
+ }
+ vcvta_u64_f64_(a)
+}
+
+/// Floating-point convert to unsigned integer, rounding to nearest with ties to away
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtau))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtaq_u64_f64(a: float64x2_t) -> uint64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtau.v2i64.v2f64")]
+ fn vcvtaq_u64_f64_(a: float64x2_t) -> uint64x2_t;
+ }
+ vcvtaq_u64_f64_(a)
+}
+
+/// Floating-point convert to unsigned integer, rounding to nearest with ties to even
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtnu))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtn_u32_f32(a: float32x2_t) -> uint32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtnu.v2i32.v2f32")]
+ fn vcvtn_u32_f32_(a: float32x2_t) -> uint32x2_t;
+ }
+ vcvtn_u32_f32_(a)
+}
+
+/// Floating-point convert to unsigned integer, rounding to nearest with ties to even
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtnu))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtnq_u32_f32(a: float32x4_t) -> uint32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtnu.v4i32.v4f32")]
+ fn vcvtnq_u32_f32_(a: float32x4_t) -> uint32x4_t;
+ }
+ vcvtnq_u32_f32_(a)
+}
+
+/// Floating-point convert to unsigned integer, rounding to nearest with ties to even
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtnu))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtn_u64_f64(a: float64x1_t) -> uint64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtnu.v1i64.v1f64")]
+ fn vcvtn_u64_f64_(a: float64x1_t) -> uint64x1_t;
+ }
+ vcvtn_u64_f64_(a)
+}
+
+/// Floating-point convert to unsigned integer, rounding to nearest with ties to even
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtnu))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtnq_u64_f64(a: float64x2_t) -> uint64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtnu.v2i64.v2f64")]
+ fn vcvtnq_u64_f64_(a: float64x2_t) -> uint64x2_t;
+ }
+ vcvtnq_u64_f64_(a)
+}
+
+/// Floating-point convert to unsigned integer, rounding to nearest with ties to even
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtnu))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtns_u32_f32(a: f32) -> u32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtnu.i32.f32")]
+ fn vcvtns_u32_f32_(a: f32) -> u32;
+ }
+ vcvtns_u32_f32_(a)
+}
+
+/// Floating-point convert to unsigned integer, rounding to nearest with ties to even
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtnu))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtnd_u64_f64(a: f64) -> u64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtnu.i64.f64")]
+ fn vcvtnd_u64_f64_(a: f64) -> u64;
+ }
+ vcvtnd_u64_f64_(a)
+}
+
+/// Floating-point convert to unsigned integer, rounding toward minus infinity
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtmu))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtm_u32_f32(a: float32x2_t) -> uint32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtmu.v2i32.v2f32")]
+ fn vcvtm_u32_f32_(a: float32x2_t) -> uint32x2_t;
+ }
+ vcvtm_u32_f32_(a)
+}
+
+/// Floating-point convert to unsigned integer, rounding toward minus infinity
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtmu))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtmq_u32_f32(a: float32x4_t) -> uint32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtmu.v4i32.v4f32")]
+ fn vcvtmq_u32_f32_(a: float32x4_t) -> uint32x4_t;
+ }
+ vcvtmq_u32_f32_(a)
+}
+
+/// Floating-point convert to unsigned integer, rounding toward minus infinity
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtmu))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtm_u64_f64(a: float64x1_t) -> uint64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtmu.v1i64.v1f64")]
+ fn vcvtm_u64_f64_(a: float64x1_t) -> uint64x1_t;
+ }
+ vcvtm_u64_f64_(a)
+}
+
+/// Floating-point convert to unsigned integer, rounding toward minus infinity
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtmu))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtmq_u64_f64(a: float64x2_t) -> uint64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtmu.v2i64.v2f64")]
+ fn vcvtmq_u64_f64_(a: float64x2_t) -> uint64x2_t;
+ }
+ vcvtmq_u64_f64_(a)
+}
+
+/// Floating-point convert to unsigned integer, rounding toward minus infinity
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtmu))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtms_u32_f32(a: f32) -> u32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtmu.i32.f32")]
+ fn vcvtms_u32_f32_(a: f32) -> u32;
+ }
+ vcvtms_u32_f32_(a)
+}
+
+/// Floating-point convert to unsigned integer, rounding toward minus infinity
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtmu))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtmd_u64_f64(a: f64) -> u64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtmu.i64.f64")]
+ fn vcvtmd_u64_f64_(a: f64) -> u64;
+ }
+ vcvtmd_u64_f64_(a)
+}
+
+/// Floating-point convert to unsigned integer, rounding toward plus infinity
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtpu))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtp_u32_f32(a: float32x2_t) -> uint32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtpu.v2i32.v2f32")]
+ fn vcvtp_u32_f32_(a: float32x2_t) -> uint32x2_t;
+ }
+ vcvtp_u32_f32_(a)
+}
+
+/// Floating-point convert to unsigned integer, rounding toward plus infinity
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtpu))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtpq_u32_f32(a: float32x4_t) -> uint32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtpu.v4i32.v4f32")]
+ fn vcvtpq_u32_f32_(a: float32x4_t) -> uint32x4_t;
+ }
+ vcvtpq_u32_f32_(a)
+}
+
+/// Floating-point convert to unsigned integer, rounding toward plus infinity
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtpu))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtp_u64_f64(a: float64x1_t) -> uint64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtpu.v1i64.v1f64")]
+ fn vcvtp_u64_f64_(a: float64x1_t) -> uint64x1_t;
+ }
+ vcvtp_u64_f64_(a)
+}
+
+/// Floating-point convert to unsigned integer, rounding toward plus infinity
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtpu))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtpq_u64_f64(a: float64x2_t) -> uint64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtpu.v2i64.v2f64")]
+ fn vcvtpq_u64_f64_(a: float64x2_t) -> uint64x2_t;
+ }
+ vcvtpq_u64_f64_(a)
+}
+
+/// Floating-point convert to unsigned integer, rounding toward plus infinity
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtpu))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtps_u32_f32(a: f32) -> u32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtpu.i32.f32")]
+ fn vcvtps_u32_f32_(a: f32) -> u32;
+ }
+ vcvtps_u32_f32_(a)
+}
+
+/// Floating-point convert to unsigned integer, rounding toward plus infinity
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtpu))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtpd_u64_f64(a: f64) -> u64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtpu.i64.f64")]
+ fn vcvtpd_u64_f64_(a: f64) -> u64;
+ }
+ vcvtpd_u64_f64_(a)
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(dup, N = 1))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vdupq_laneq_p64<const N: i32>(a: poly64x2_t) -> poly64x2_t {
+ static_assert_imm1!(N);
+ simd_shuffle2!(a, a, <const N: i32> [N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(dup, N = 0))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vdupq_lane_p64<const N: i32>(a: poly64x1_t) -> poly64x2_t {
+ static_assert!(N : i32 where N == 0);
+ simd_shuffle2!(a, a, <const N: i32> [N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(dup, N = 1))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vdupq_laneq_f64<const N: i32>(a: float64x2_t) -> float64x2_t {
+ static_assert_imm1!(N);
+ simd_shuffle2!(a, a, <const N: i32> [N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(dup, N = 0))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vdupq_lane_f64<const N: i32>(a: float64x1_t) -> float64x2_t {
+ static_assert!(N : i32 where N == 0);
+ simd_shuffle2!(a, a, <const N: i32> [N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, N = 0))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vdup_lane_p64<const N: i32>(a: poly64x1_t) -> poly64x1_t {
+ static_assert!(N : i32 where N == 0);
+ a
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, N = 0))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vdup_lane_f64<const N: i32>(a: float64x1_t) -> float64x1_t {
+ static_assert!(N : i32 where N == 0);
+ a
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, N = 1))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vdup_laneq_p64<const N: i32>(a: poly64x2_t) -> poly64x1_t {
+ static_assert_imm1!(N);
+ transmute::<u64, _>(simd_extract(a, N as u32))
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, N = 1))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vdup_laneq_f64<const N: i32>(a: float64x2_t) -> float64x1_t {
+ static_assert_imm1!(N);
+ transmute::<f64, _>(simd_extract(a, N as u32))
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, N = 4))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vdupb_lane_s8<const N: i32>(a: int8x8_t) -> i8 {
+ static_assert_imm3!(N);
+ simd_extract(a, N as u32)
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, N = 8))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vdupb_laneq_s8<const N: i32>(a: int8x16_t) -> i8 {
+ static_assert_imm4!(N);
+ simd_extract(a, N as u32)
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vduph_lane_s16<const N: i32>(a: int16x4_t) -> i16 {
+ static_assert_imm2!(N);
+ simd_extract(a, N as u32)
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, N = 4))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vduph_laneq_s16<const N: i32>(a: int16x8_t) -> i16 {
+ static_assert_imm3!(N);
+ simd_extract(a, N as u32)
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, N = 1))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vdups_lane_s32<const N: i32>(a: int32x2_t) -> i32 {
+ static_assert_imm1!(N);
+ simd_extract(a, N as u32)
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vdups_laneq_s32<const N: i32>(a: int32x4_t) -> i32 {
+ static_assert_imm2!(N);
+ simd_extract(a, N as u32)
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, N = 0))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vdupd_lane_s64<const N: i32>(a: int64x1_t) -> i64 {
+ static_assert!(N : i32 where N == 0);
+ simd_extract(a, N as u32)
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, N = 1))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vdupd_laneq_s64<const N: i32>(a: int64x2_t) -> i64 {
+ static_assert_imm1!(N);
+ simd_extract(a, N as u32)
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, N = 4))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vdupb_lane_u8<const N: i32>(a: uint8x8_t) -> u8 {
+ static_assert_imm3!(N);
+ simd_extract(a, N as u32)
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, N = 8))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vdupb_laneq_u8<const N: i32>(a: uint8x16_t) -> u8 {
+ static_assert_imm4!(N);
+ simd_extract(a, N as u32)
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vduph_lane_u16<const N: i32>(a: uint16x4_t) -> u16 {
+ static_assert_imm2!(N);
+ simd_extract(a, N as u32)
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, N = 4))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vduph_laneq_u16<const N: i32>(a: uint16x8_t) -> u16 {
+ static_assert_imm3!(N);
+ simd_extract(a, N as u32)
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, N = 1))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vdups_lane_u32<const N: i32>(a: uint32x2_t) -> u32 {
+ static_assert_imm1!(N);
+ simd_extract(a, N as u32)
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vdups_laneq_u32<const N: i32>(a: uint32x4_t) -> u32 {
+ static_assert_imm2!(N);
+ simd_extract(a, N as u32)
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, N = 0))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vdupd_lane_u64<const N: i32>(a: uint64x1_t) -> u64 {
+ static_assert!(N : i32 where N == 0);
+ simd_extract(a, N as u32)
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, N = 1))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vdupd_laneq_u64<const N: i32>(a: uint64x2_t) -> u64 {
+ static_assert_imm1!(N);
+ simd_extract(a, N as u32)
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, N = 4))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vdupb_lane_p8<const N: i32>(a: poly8x8_t) -> p8 {
+ static_assert_imm3!(N);
+ simd_extract(a, N as u32)
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, N = 8))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vdupb_laneq_p8<const N: i32>(a: poly8x16_t) -> p8 {
+ static_assert_imm4!(N);
+ simd_extract(a, N as u32)
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vduph_lane_p16<const N: i32>(a: poly16x4_t) -> p16 {
+ static_assert_imm2!(N);
+ simd_extract(a, N as u32)
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, N = 4))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vduph_laneq_p16<const N: i32>(a: poly16x8_t) -> p16 {
+ static_assert_imm3!(N);
+ simd_extract(a, N as u32)
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, N = 1))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vdups_lane_f32<const N: i32>(a: float32x2_t) -> f32 {
+ static_assert_imm1!(N);
+ simd_extract(a, N as u32)
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vdups_laneq_f32<const N: i32>(a: float32x4_t) -> f32 {
+ static_assert_imm2!(N);
+ simd_extract(a, N as u32)
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, N = 0))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vdupd_lane_f64<const N: i32>(a: float64x1_t) -> f64 {
+ static_assert!(N : i32 where N == 0);
+ simd_extract(a, N as u32)
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, N = 1))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vdupd_laneq_f64<const N: i32>(a: float64x2_t) -> f64 {
+ static_assert_imm1!(N);
+ simd_extract(a, N as u32)
+}
+
+/// Extract vector from pair of vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ext, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vextq_p64<const N: i32>(a: poly64x2_t, b: poly64x2_t) -> poly64x2_t {
+ static_assert_imm1!(N);
+ match N & 0b1 {
+ 0 => simd_shuffle2!(a, b, [0, 1]),
+ 1 => simd_shuffle2!(a, b, [1, 2]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Extract vector from pair of vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ext, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vextq_f64<const N: i32>(a: float64x2_t, b: float64x2_t) -> float64x2_t {
+ static_assert_imm1!(N);
+ match N & 0b1 {
+ 0 => simd_shuffle2!(a, b, [0, 1]),
+ 1 => simd_shuffle2!(a, b, [1, 2]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Floating-point multiply-add to accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmul))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmla_f64(a: float64x1_t, b: float64x1_t, c: float64x1_t) -> float64x1_t {
+ simd_add(a, simd_mul(b, c))
+}
+
+/// Floating-point multiply-add to accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmul))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmlaq_f64(a: float64x2_t, b: float64x2_t, c: float64x2_t) -> float64x2_t {
+ simd_add(a, simd_mul(b, c))
+}
+
+/// Signed multiply-add long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(smlal2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmlal_high_s8(a: int16x8_t, b: int8x16_t, c: int8x16_t) -> int16x8_t {
+ let b: int8x8_t = simd_shuffle8!(b, b, [8, 9, 10, 11, 12, 13, 14, 15]);
+ let c: int8x8_t = simd_shuffle8!(c, c, [8, 9, 10, 11, 12, 13, 14, 15]);
+ vmlal_s8(a, b, c)
+}
+
+/// Signed multiply-add long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(smlal2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmlal_high_s16(a: int32x4_t, b: int16x8_t, c: int16x8_t) -> int32x4_t {
+ let b: int16x4_t = simd_shuffle4!(b, b, [4, 5, 6, 7]);
+ let c: int16x4_t = simd_shuffle4!(c, c, [4, 5, 6, 7]);
+ vmlal_s16(a, b, c)
+}
+
+/// Signed multiply-add long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(smlal2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmlal_high_s32(a: int64x2_t, b: int32x4_t, c: int32x4_t) -> int64x2_t {
+ let b: int32x2_t = simd_shuffle2!(b, b, [2, 3]);
+ let c: int32x2_t = simd_shuffle2!(c, c, [2, 3]);
+ vmlal_s32(a, b, c)
+}
+
+/// Unsigned multiply-add long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(umlal2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmlal_high_u8(a: uint16x8_t, b: uint8x16_t, c: uint8x16_t) -> uint16x8_t {
+ let b: uint8x8_t = simd_shuffle8!(b, b, [8, 9, 10, 11, 12, 13, 14, 15]);
+ let c: uint8x8_t = simd_shuffle8!(c, c, [8, 9, 10, 11, 12, 13, 14, 15]);
+ vmlal_u8(a, b, c)
+}
+
+/// Unsigned multiply-add long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(umlal2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmlal_high_u16(a: uint32x4_t, b: uint16x8_t, c: uint16x8_t) -> uint32x4_t {
+ let b: uint16x4_t = simd_shuffle4!(b, b, [4, 5, 6, 7]);
+ let c: uint16x4_t = simd_shuffle4!(c, c, [4, 5, 6, 7]);
+ vmlal_u16(a, b, c)
+}
+
+/// Unsigned multiply-add long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(umlal2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmlal_high_u32(a: uint64x2_t, b: uint32x4_t, c: uint32x4_t) -> uint64x2_t {
+ let b: uint32x2_t = simd_shuffle2!(b, b, [2, 3]);
+ let c: uint32x2_t = simd_shuffle2!(c, c, [2, 3]);
+ vmlal_u32(a, b, c)
+}
+
+/// Multiply-add long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(smlal2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmlal_high_n_s16(a: int32x4_t, b: int16x8_t, c: i16) -> int32x4_t {
+ vmlal_high_s16(a, b, vdupq_n_s16(c))
+}
+
+/// Multiply-add long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(smlal2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmlal_high_n_s32(a: int64x2_t, b: int32x4_t, c: i32) -> int64x2_t {
+ vmlal_high_s32(a, b, vdupq_n_s32(c))
+}
+
+/// Multiply-add long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(umlal2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmlal_high_n_u16(a: uint32x4_t, b: uint16x8_t, c: u16) -> uint32x4_t {
+ vmlal_high_u16(a, b, vdupq_n_u16(c))
+}
+
+/// Multiply-add long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(umlal2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmlal_high_n_u32(a: uint64x2_t, b: uint32x4_t, c: u32) -> uint64x2_t {
+ vmlal_high_u32(a, b, vdupq_n_u32(c))
+}
+
+/// Multiply-add long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(smlal2, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmlal_high_lane_s16<const LANE: i32>(a: int32x4_t, b: int16x8_t, c: int16x4_t) -> int32x4_t {
+ static_assert_imm2!(LANE);
+ vmlal_high_s16(a, b, simd_shuffle8!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Multiply-add long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(smlal2, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmlal_high_laneq_s16<const LANE: i32>(a: int32x4_t, b: int16x8_t, c: int16x8_t) -> int32x4_t {
+ static_assert_imm3!(LANE);
+ vmlal_high_s16(a, b, simd_shuffle8!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Multiply-add long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(smlal2, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmlal_high_lane_s32<const LANE: i32>(a: int64x2_t, b: int32x4_t, c: int32x2_t) -> int64x2_t {
+ static_assert_imm1!(LANE);
+ vmlal_high_s32(a, b, simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Multiply-add long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(smlal2, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmlal_high_laneq_s32<const LANE: i32>(a: int64x2_t, b: int32x4_t, c: int32x4_t) -> int64x2_t {
+ static_assert_imm2!(LANE);
+ vmlal_high_s32(a, b, simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Multiply-add long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(umlal2, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmlal_high_lane_u16<const LANE: i32>(a: uint32x4_t, b: uint16x8_t, c: uint16x4_t) -> uint32x4_t {
+ static_assert_imm2!(LANE);
+ vmlal_high_u16(a, b, simd_shuffle8!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Multiply-add long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(umlal2, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmlal_high_laneq_u16<const LANE: i32>(a: uint32x4_t, b: uint16x8_t, c: uint16x8_t) -> uint32x4_t {
+ static_assert_imm3!(LANE);
+ vmlal_high_u16(a, b, simd_shuffle8!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Multiply-add long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(umlal2, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmlal_high_lane_u32<const LANE: i32>(a: uint64x2_t, b: uint32x4_t, c: uint32x2_t) -> uint64x2_t {
+ static_assert_imm1!(LANE);
+ vmlal_high_u32(a, b, simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Multiply-add long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(umlal2, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmlal_high_laneq_u32<const LANE: i32>(a: uint64x2_t, b: uint32x4_t, c: uint32x4_t) -> uint64x2_t {
+ static_assert_imm2!(LANE);
+ vmlal_high_u32(a, b, simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Floating-point multiply-subtract from accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmul))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmls_f64(a: float64x1_t, b: float64x1_t, c: float64x1_t) -> float64x1_t {
+ simd_sub(a, simd_mul(b, c))
+}
+
+/// Floating-point multiply-subtract from accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmul))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmlsq_f64(a: float64x2_t, b: float64x2_t, c: float64x2_t) -> float64x2_t {
+ simd_sub(a, simd_mul(b, c))
+}
+
+/// Signed multiply-subtract long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(smlsl2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmlsl_high_s8(a: int16x8_t, b: int8x16_t, c: int8x16_t) -> int16x8_t {
+ let b: int8x8_t = simd_shuffle8!(b, b, [8, 9, 10, 11, 12, 13, 14, 15]);
+ let c: int8x8_t = simd_shuffle8!(c, c, [8, 9, 10, 11, 12, 13, 14, 15]);
+ vmlsl_s8(a, b, c)
+}
+
+/// Signed multiply-subtract long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(smlsl2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmlsl_high_s16(a: int32x4_t, b: int16x8_t, c: int16x8_t) -> int32x4_t {
+ let b: int16x4_t = simd_shuffle4!(b, b, [4, 5, 6, 7]);
+ let c: int16x4_t = simd_shuffle4!(c, c, [4, 5, 6, 7]);
+ vmlsl_s16(a, b, c)
+}
+
+/// Signed multiply-subtract long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(smlsl2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmlsl_high_s32(a: int64x2_t, b: int32x4_t, c: int32x4_t) -> int64x2_t {
+ let b: int32x2_t = simd_shuffle2!(b, b, [2, 3]);
+ let c: int32x2_t = simd_shuffle2!(c, c, [2, 3]);
+ vmlsl_s32(a, b, c)
+}
+
+/// Unsigned multiply-subtract long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(umlsl2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmlsl_high_u8(a: uint16x8_t, b: uint8x16_t, c: uint8x16_t) -> uint16x8_t {
+ let b: uint8x8_t = simd_shuffle8!(b, b, [8, 9, 10, 11, 12, 13, 14, 15]);
+ let c: uint8x8_t = simd_shuffle8!(c, c, [8, 9, 10, 11, 12, 13, 14, 15]);
+ vmlsl_u8(a, b, c)
+}
+
+/// Unsigned multiply-subtract long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(umlsl2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmlsl_high_u16(a: uint32x4_t, b: uint16x8_t, c: uint16x8_t) -> uint32x4_t {
+ let b: uint16x4_t = simd_shuffle4!(b, b, [4, 5, 6, 7]);
+ let c: uint16x4_t = simd_shuffle4!(c, c, [4, 5, 6, 7]);
+ vmlsl_u16(a, b, c)
+}
+
+/// Unsigned multiply-subtract long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(umlsl2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmlsl_high_u32(a: uint64x2_t, b: uint32x4_t, c: uint32x4_t) -> uint64x2_t {
+ let b: uint32x2_t = simd_shuffle2!(b, b, [2, 3]);
+ let c: uint32x2_t = simd_shuffle2!(c, c, [2, 3]);
+ vmlsl_u32(a, b, c)
+}
+
+/// Multiply-subtract long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(smlsl2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmlsl_high_n_s16(a: int32x4_t, b: int16x8_t, c: i16) -> int32x4_t {
+ vmlsl_high_s16(a, b, vdupq_n_s16(c))
+}
+
+/// Multiply-subtract long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(smlsl2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmlsl_high_n_s32(a: int64x2_t, b: int32x4_t, c: i32) -> int64x2_t {
+ vmlsl_high_s32(a, b, vdupq_n_s32(c))
+}
+
+/// Multiply-subtract long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(umlsl2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmlsl_high_n_u16(a: uint32x4_t, b: uint16x8_t, c: u16) -> uint32x4_t {
+ vmlsl_high_u16(a, b, vdupq_n_u16(c))
+}
+
+/// Multiply-subtract long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(umlsl2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmlsl_high_n_u32(a: uint64x2_t, b: uint32x4_t, c: u32) -> uint64x2_t {
+ vmlsl_high_u32(a, b, vdupq_n_u32(c))
+}
+
+/// Multiply-subtract long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(smlsl2, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmlsl_high_lane_s16<const LANE: i32>(a: int32x4_t, b: int16x8_t, c: int16x4_t) -> int32x4_t {
+ static_assert_imm2!(LANE);
+ vmlsl_high_s16(a, b, simd_shuffle8!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Multiply-subtract long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(smlsl2, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmlsl_high_laneq_s16<const LANE: i32>(a: int32x4_t, b: int16x8_t, c: int16x8_t) -> int32x4_t {
+ static_assert_imm3!(LANE);
+ vmlsl_high_s16(a, b, simd_shuffle8!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Multiply-subtract long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(smlsl2, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmlsl_high_lane_s32<const LANE: i32>(a: int64x2_t, b: int32x4_t, c: int32x2_t) -> int64x2_t {
+ static_assert_imm1!(LANE);
+ vmlsl_high_s32(a, b, simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Multiply-subtract long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(smlsl2, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmlsl_high_laneq_s32<const LANE: i32>(a: int64x2_t, b: int32x4_t, c: int32x4_t) -> int64x2_t {
+ static_assert_imm2!(LANE);
+ vmlsl_high_s32(a, b, simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Multiply-subtract long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(umlsl2, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmlsl_high_lane_u16<const LANE: i32>(a: uint32x4_t, b: uint16x8_t, c: uint16x4_t) -> uint32x4_t {
+ static_assert_imm2!(LANE);
+ vmlsl_high_u16(a, b, simd_shuffle8!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Multiply-subtract long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(umlsl2, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmlsl_high_laneq_u16<const LANE: i32>(a: uint32x4_t, b: uint16x8_t, c: uint16x8_t) -> uint32x4_t {
+ static_assert_imm3!(LANE);
+ vmlsl_high_u16(a, b, simd_shuffle8!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Multiply-subtract long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(umlsl2, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmlsl_high_lane_u32<const LANE: i32>(a: uint64x2_t, b: uint32x4_t, c: uint32x2_t) -> uint64x2_t {
+ static_assert_imm1!(LANE);
+ vmlsl_high_u32(a, b, simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Multiply-subtract long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(umlsl2, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmlsl_high_laneq_u32<const LANE: i32>(a: uint64x2_t, b: uint32x4_t, c: uint32x4_t) -> uint64x2_t {
+ static_assert_imm2!(LANE);
+ vmlsl_high_u32(a, b, simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Extract narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(xtn2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmovn_high_s16(a: int8x8_t, b: int16x8_t) -> int8x16_t {
+ let c: int8x8_t = simd_cast(b);
+ simd_shuffle16!(a, c, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15])
+}
+
+/// Extract narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(xtn2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmovn_high_s32(a: int16x4_t, b: int32x4_t) -> int16x8_t {
+ let c: int16x4_t = simd_cast(b);
+ simd_shuffle8!(a, c, [0, 1, 2, 3, 4, 5, 6, 7])
+}
+
+/// Extract narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(xtn2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmovn_high_s64(a: int32x2_t, b: int64x2_t) -> int32x4_t {
+ let c: int32x2_t = simd_cast(b);
+ simd_shuffle4!(a, c, [0, 1, 2, 3])
+}
+
+/// Extract narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(xtn2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmovn_high_u16(a: uint8x8_t, b: uint16x8_t) -> uint8x16_t {
+ let c: uint8x8_t = simd_cast(b);
+ simd_shuffle16!(a, c, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15])
+}
+
+/// Extract narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(xtn2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmovn_high_u32(a: uint16x4_t, b: uint32x4_t) -> uint16x8_t {
+ let c: uint16x4_t = simd_cast(b);
+ simd_shuffle8!(a, c, [0, 1, 2, 3, 4, 5, 6, 7])
+}
+
+/// Extract narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(xtn2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmovn_high_u64(a: uint32x2_t, b: uint64x2_t) -> uint32x4_t {
+ let c: uint32x2_t = simd_cast(b);
+ simd_shuffle4!(a, c, [0, 1, 2, 3])
+}
+
+/// Negate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(neg))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vneg_s64(a: int64x1_t) -> int64x1_t {
+ simd_neg(a)
+}
+
+/// Negate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(neg))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vnegq_s64(a: int64x2_t) -> int64x2_t {
+ simd_neg(a)
+}
+
+/// Negate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(neg))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vnegd_s64(a: i64) -> i64 {
+ a.wrapping_neg()
+}
+
+/// Negate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fneg))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vneg_f64(a: float64x1_t) -> float64x1_t {
+ simd_neg(a)
+}
+
+/// Negate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fneg))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vnegq_f64(a: float64x2_t) -> float64x2_t {
+ simd_neg(a)
+}
+
+/// Signed saturating negate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqneg))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqneg_s64(a: int64x1_t) -> int64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqneg.v1i64")]
+ fn vqneg_s64_(a: int64x1_t) -> int64x1_t;
+ }
+ vqneg_s64_(a)
+}
+
+/// Signed saturating negate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqneg))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqnegq_s64(a: int64x2_t) -> int64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqneg.v2i64")]
+ fn vqnegq_s64_(a: int64x2_t) -> int64x2_t;
+ }
+ vqnegq_s64_(a)
+}
+
+/// Signed saturating negate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqneg))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqnegb_s8(a: i8) -> i8 {
+ simd_extract(vqneg_s8(vdup_n_s8(a)), 0)
+}
+
+/// Signed saturating negate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqneg))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqnegh_s16(a: i16) -> i16 {
+ simd_extract(vqneg_s16(vdup_n_s16(a)), 0)
+}
+
+/// Signed saturating negate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqneg))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqnegs_s32(a: i32) -> i32 {
+ simd_extract(vqneg_s32(vdup_n_s32(a)), 0)
+}
+
+/// Signed saturating negate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqneg))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqnegd_s64(a: i64) -> i64 {
+ simd_extract(vqneg_s64(vdup_n_s64(a)), 0)
+}
+
+/// Saturating subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqsub))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqsubb_s8(a: i8, b: i8) -> i8 {
+ let a: int8x8_t = vdup_n_s8(a);
+ let b: int8x8_t = vdup_n_s8(b);
+ simd_extract(vqsub_s8(a, b), 0)
+}
+
+/// Saturating subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqsub))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqsubh_s16(a: i16, b: i16) -> i16 {
+ let a: int16x4_t = vdup_n_s16(a);
+ let b: int16x4_t = vdup_n_s16(b);
+ simd_extract(vqsub_s16(a, b), 0)
+}
+
+/// Saturating subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqsub))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqsubb_u8(a: u8, b: u8) -> u8 {
+ let a: uint8x8_t = vdup_n_u8(a);
+ let b: uint8x8_t = vdup_n_u8(b);
+ simd_extract(vqsub_u8(a, b), 0)
+}
+
+/// Saturating subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqsub))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqsubh_u16(a: u16, b: u16) -> u16 {
+ let a: uint16x4_t = vdup_n_u16(a);
+ let b: uint16x4_t = vdup_n_u16(b);
+ simd_extract(vqsub_u16(a, b), 0)
+}
+
+/// Saturating subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqsub))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqsubs_u32(a: u32, b: u32) -> u32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqsub.i32")]
+ fn vqsubs_u32_(a: u32, b: u32) -> u32;
+ }
+ vqsubs_u32_(a, b)
+}
+
+/// Saturating subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqsub))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqsubd_u64(a: u64, b: u64) -> u64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqsub.i64")]
+ fn vqsubd_u64_(a: u64, b: u64) -> u64;
+ }
+ vqsubd_u64_(a, b)
+}
+
+/// Saturating subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqsub))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqsubs_s32(a: i32, b: i32) -> i32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqsub.i32")]
+ fn vqsubs_s32_(a: i32, b: i32) -> i32;
+ }
+ vqsubs_s32_(a, b)
+}
+
+/// Saturating subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqsub))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqsubd_s64(a: i64, b: i64) -> i64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqsub.i64")]
+ fn vqsubd_s64_(a: i64, b: i64) -> i64;
+ }
+ vqsubd_s64_(a, b)
+}
+
+/// Reverse bit order
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(rbit))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrbit_s8(a: int8x8_t) -> int8x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.rbit.v8i8")]
+ fn vrbit_s8_(a: int8x8_t) -> int8x8_t;
+ }
+ vrbit_s8_(a)
+}
+
+/// Reverse bit order
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(rbit))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrbitq_s8(a: int8x16_t) -> int8x16_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.rbit.v16i8")]
+ fn vrbitq_s8_(a: int8x16_t) -> int8x16_t;
+ }
+ vrbitq_s8_(a)
+}
+
+/// Reverse bit order
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(rbit))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrbit_u8(a: uint8x8_t) -> uint8x8_t {
+ transmute(vrbit_s8(transmute(a)))
+}
+
+/// Reverse bit order
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(rbit))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrbitq_u8(a: uint8x16_t) -> uint8x16_t {
+ transmute(vrbitq_s8(transmute(a)))
+}
+
+/// Reverse bit order
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(rbit))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrbit_p8(a: poly8x8_t) -> poly8x8_t {
+ transmute(vrbit_s8(transmute(a)))
+}
+
+/// Reverse bit order
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(rbit))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrbitq_p8(a: poly8x16_t) -> poly8x16_t {
+ transmute(vrbitq_s8(transmute(a)))
+}
+
+/// Floating-point round to integral exact, using current rounding mode
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frintx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrndx_f32(a: float32x2_t) -> float32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.rint.v2f32")]
+ fn vrndx_f32_(a: float32x2_t) -> float32x2_t;
+ }
+ vrndx_f32_(a)
+}
+
+/// Floating-point round to integral exact, using current rounding mode
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frintx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrndxq_f32(a: float32x4_t) -> float32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.rint.v4f32")]
+ fn vrndxq_f32_(a: float32x4_t) -> float32x4_t;
+ }
+ vrndxq_f32_(a)
+}
+
+/// Floating-point round to integral exact, using current rounding mode
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frintx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrndx_f64(a: float64x1_t) -> float64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.rint.v1f64")]
+ fn vrndx_f64_(a: float64x1_t) -> float64x1_t;
+ }
+ vrndx_f64_(a)
+}
+
+/// Floating-point round to integral exact, using current rounding mode
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frintx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrndxq_f64(a: float64x2_t) -> float64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.rint.v2f64")]
+ fn vrndxq_f64_(a: float64x2_t) -> float64x2_t;
+ }
+ vrndxq_f64_(a)
+}
+
+/// Floating-point round to integral, to nearest with ties to away
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frinta))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrnda_f32(a: float32x2_t) -> float32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.round.v2f32")]
+ fn vrnda_f32_(a: float32x2_t) -> float32x2_t;
+ }
+ vrnda_f32_(a)
+}
+
+/// Floating-point round to integral, to nearest with ties to away
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frinta))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrndaq_f32(a: float32x4_t) -> float32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.round.v4f32")]
+ fn vrndaq_f32_(a: float32x4_t) -> float32x4_t;
+ }
+ vrndaq_f32_(a)
+}
+
+/// Floating-point round to integral, to nearest with ties to away
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frinta))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrnda_f64(a: float64x1_t) -> float64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.round.v1f64")]
+ fn vrnda_f64_(a: float64x1_t) -> float64x1_t;
+ }
+ vrnda_f64_(a)
+}
+
+/// Floating-point round to integral, to nearest with ties to away
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frinta))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrndaq_f64(a: float64x2_t) -> float64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.round.v2f64")]
+ fn vrndaq_f64_(a: float64x2_t) -> float64x2_t;
+ }
+ vrndaq_f64_(a)
+}
+
+/// Floating-point round to integral, to nearest with ties to even
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frintn))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrndn_f64(a: float64x1_t) -> float64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.frintn.v1f64")]
+ fn vrndn_f64_(a: float64x1_t) -> float64x1_t;
+ }
+ vrndn_f64_(a)
+}
+
+/// Floating-point round to integral, to nearest with ties to even
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frintn))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrndnq_f64(a: float64x2_t) -> float64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.frintn.v2f64")]
+ fn vrndnq_f64_(a: float64x2_t) -> float64x2_t;
+ }
+ vrndnq_f64_(a)
+}
+
+/// Floating-point round to integral, to nearest with ties to even
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frintn))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrndns_f32(a: f32) -> f32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.roundeven.f32")]
+ fn vrndns_f32_(a: f32) -> f32;
+ }
+ vrndns_f32_(a)
+}
+
+/// Floating-point round to integral, toward minus infinity
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frintm))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrndm_f32(a: float32x2_t) -> float32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.floor.v2f32")]
+ fn vrndm_f32_(a: float32x2_t) -> float32x2_t;
+ }
+ vrndm_f32_(a)
+}
+
+/// Floating-point round to integral, toward minus infinity
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frintm))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrndmq_f32(a: float32x4_t) -> float32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.floor.v4f32")]
+ fn vrndmq_f32_(a: float32x4_t) -> float32x4_t;
+ }
+ vrndmq_f32_(a)
+}
+
+/// Floating-point round to integral, toward minus infinity
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frintm))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrndm_f64(a: float64x1_t) -> float64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.floor.v1f64")]
+ fn vrndm_f64_(a: float64x1_t) -> float64x1_t;
+ }
+ vrndm_f64_(a)
+}
+
+/// Floating-point round to integral, toward minus infinity
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frintm))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrndmq_f64(a: float64x2_t) -> float64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.floor.v2f64")]
+ fn vrndmq_f64_(a: float64x2_t) -> float64x2_t;
+ }
+ vrndmq_f64_(a)
+}
+
+/// Floating-point round to integral, toward plus infinity
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frintp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrndp_f32(a: float32x2_t) -> float32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.ceil.v2f32")]
+ fn vrndp_f32_(a: float32x2_t) -> float32x2_t;
+ }
+ vrndp_f32_(a)
+}
+
+/// Floating-point round to integral, toward plus infinity
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frintp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrndpq_f32(a: float32x4_t) -> float32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.ceil.v4f32")]
+ fn vrndpq_f32_(a: float32x4_t) -> float32x4_t;
+ }
+ vrndpq_f32_(a)
+}
+
+/// Floating-point round to integral, toward plus infinity
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frintp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrndp_f64(a: float64x1_t) -> float64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.ceil.v1f64")]
+ fn vrndp_f64_(a: float64x1_t) -> float64x1_t;
+ }
+ vrndp_f64_(a)
+}
+
+/// Floating-point round to integral, toward plus infinity
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frintp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrndpq_f64(a: float64x2_t) -> float64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.ceil.v2f64")]
+ fn vrndpq_f64_(a: float64x2_t) -> float64x2_t;
+ }
+ vrndpq_f64_(a)
+}
+
+/// Floating-point round to integral, toward zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frintz))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrnd_f32(a: float32x2_t) -> float32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.trunc.v2f32")]
+ fn vrnd_f32_(a: float32x2_t) -> float32x2_t;
+ }
+ vrnd_f32_(a)
+}
+
+/// Floating-point round to integral, toward zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frintz))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrndq_f32(a: float32x4_t) -> float32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.trunc.v4f32")]
+ fn vrndq_f32_(a: float32x4_t) -> float32x4_t;
+ }
+ vrndq_f32_(a)
+}
+
+/// Floating-point round to integral, toward zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frintz))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrnd_f64(a: float64x1_t) -> float64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.trunc.v1f64")]
+ fn vrnd_f64_(a: float64x1_t) -> float64x1_t;
+ }
+ vrnd_f64_(a)
+}
+
+/// Floating-point round to integral, toward zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frintz))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrndq_f64(a: float64x2_t) -> float64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.trunc.v2f64")]
+ fn vrndq_f64_(a: float64x2_t) -> float64x2_t;
+ }
+ vrndq_f64_(a)
+}
+
+/// Floating-point round to integral, using current rounding mode
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frinti))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrndi_f32(a: float32x2_t) -> float32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.nearbyint.v2f32")]
+ fn vrndi_f32_(a: float32x2_t) -> float32x2_t;
+ }
+ vrndi_f32_(a)
+}
+
+/// Floating-point round to integral, using current rounding mode
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frinti))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrndiq_f32(a: float32x4_t) -> float32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.nearbyint.v4f32")]
+ fn vrndiq_f32_(a: float32x4_t) -> float32x4_t;
+ }
+ vrndiq_f32_(a)
+}
+
+/// Floating-point round to integral, using current rounding mode
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frinti))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrndi_f64(a: float64x1_t) -> float64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.nearbyint.v1f64")]
+ fn vrndi_f64_(a: float64x1_t) -> float64x1_t;
+ }
+ vrndi_f64_(a)
+}
+
+/// Floating-point round to integral, using current rounding mode
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frinti))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrndiq_f64(a: float64x2_t) -> float64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.nearbyint.v2f64")]
+ fn vrndiq_f64_(a: float64x2_t) -> float64x2_t;
+ }
+ vrndiq_f64_(a)
+}
+
+/// Saturating add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqadd))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqaddb_s8(a: i8, b: i8) -> i8 {
+ let a: int8x8_t = vdup_n_s8(a);
+ let b: int8x8_t = vdup_n_s8(b);
+ simd_extract(vqadd_s8(a, b), 0)
+}
+
+/// Saturating add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqadd))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqaddh_s16(a: i16, b: i16) -> i16 {
+ let a: int16x4_t = vdup_n_s16(a);
+ let b: int16x4_t = vdup_n_s16(b);
+ simd_extract(vqadd_s16(a, b), 0)
+}
+
+/// Saturating add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqadd))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqaddb_u8(a: u8, b: u8) -> u8 {
+ let a: uint8x8_t = vdup_n_u8(a);
+ let b: uint8x8_t = vdup_n_u8(b);
+ simd_extract(vqadd_u8(a, b), 0)
+}
+
+/// Saturating add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqadd))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqaddh_u16(a: u16, b: u16) -> u16 {
+ let a: uint16x4_t = vdup_n_u16(a);
+ let b: uint16x4_t = vdup_n_u16(b);
+ simd_extract(vqadd_u16(a, b), 0)
+}
+
+/// Saturating add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqadd))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqadds_u32(a: u32, b: u32) -> u32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqadd.i32")]
+ fn vqadds_u32_(a: u32, b: u32) -> u32;
+ }
+ vqadds_u32_(a, b)
+}
+
+/// Saturating add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqadd))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqaddd_u64(a: u64, b: u64) -> u64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqadd.i64")]
+ fn vqaddd_u64_(a: u64, b: u64) -> u64;
+ }
+ vqaddd_u64_(a, b)
+}
+
+/// Saturating add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqadd))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqadds_s32(a: i32, b: i32) -> i32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqadd.i32")]
+ fn vqadds_s32_(a: i32, b: i32) -> i32;
+ }
+ vqadds_s32_(a, b)
+}
+
+/// Saturating add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqadd))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqaddd_s64(a: i64, b: i64) -> i64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqadd.i64")]
+ fn vqaddd_s64_(a: i64, b: i64) -> i64;
+ }
+ vqaddd_s64_(a, b)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld1_f64_x2(a: *const f64) -> float64x1x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld1x2.v1f64.p0f64")]
+ fn vld1_f64_x2_(a: *const f64) -> float64x1x2_t;
+ }
+ vld1_f64_x2_(a)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld1q_f64_x2(a: *const f64) -> float64x2x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld1x2.v2f64.p0f64")]
+ fn vld1q_f64_x2_(a: *const f64) -> float64x2x2_t;
+ }
+ vld1q_f64_x2_(a)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld1_f64_x3(a: *const f64) -> float64x1x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld1x3.v1f64.p0f64")]
+ fn vld1_f64_x3_(a: *const f64) -> float64x1x3_t;
+ }
+ vld1_f64_x3_(a)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld1q_f64_x3(a: *const f64) -> float64x2x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld1x3.v2f64.p0f64")]
+ fn vld1q_f64_x3_(a: *const f64) -> float64x2x3_t;
+ }
+ vld1q_f64_x3_(a)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld1_f64_x4(a: *const f64) -> float64x1x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld1x4.v1f64.p0f64")]
+ fn vld1_f64_x4_(a: *const f64) -> float64x1x4_t;
+ }
+ vld1_f64_x4_(a)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld1q_f64_x4(a: *const f64) -> float64x2x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld1x4.v2f64.p0f64")]
+ fn vld1q_f64_x4_(a: *const f64) -> float64x2x4_t;
+ }
+ vld1q_f64_x4_(a)
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2q_s64(a: *const i64) -> int64x2x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld2.v2i64.p0v2i64")]
+ fn vld2q_s64_(ptr: *const int64x2_t) -> int64x2x2_t;
+ }
+ vld2q_s64_(a as _)
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2q_u64(a: *const u64) -> uint64x2x2_t {
+ transmute(vld2q_s64(transmute(a)))
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(test, assert_instr(ld2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2q_p64(a: *const p64) -> poly64x2x2_t {
+ transmute(vld2q_s64(transmute(a)))
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2_f64(a: *const f64) -> float64x1x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld2.v1f64.p0v1f64")]
+ fn vld2_f64_(ptr: *const float64x1_t) -> float64x1x2_t;
+ }
+ vld2_f64_(a as _)
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2q_f64(a: *const f64) -> float64x2x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld2.v2f64.p0v2f64")]
+ fn vld2q_f64_(ptr: *const float64x2_t) -> float64x2x2_t;
+ }
+ vld2q_f64_(a as _)
+}
+
+/// Load single 2-element structure and replicate to all lanes of two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld2r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2q_dup_s64(a: *const i64) -> int64x2x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld2r.v2i64.p0i64")]
+ fn vld2q_dup_s64_(ptr: *const i64) -> int64x2x2_t;
+ }
+ vld2q_dup_s64_(a as _)
+}
+
+/// Load single 2-element structure and replicate to all lanes of two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld2r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2q_dup_u64(a: *const u64) -> uint64x2x2_t {
+ transmute(vld2q_dup_s64(transmute(a)))
+}
+
+/// Load single 2-element structure and replicate to all lanes of two registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(test, assert_instr(ld2r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2q_dup_p64(a: *const p64) -> poly64x2x2_t {
+ transmute(vld2q_dup_s64(transmute(a)))
+}
+
+/// Load single 2-element structure and replicate to all lanes of two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld2r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2_dup_f64(a: *const f64) -> float64x1x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld2r.v1f64.p0f64")]
+ fn vld2_dup_f64_(ptr: *const f64) -> float64x1x2_t;
+ }
+ vld2_dup_f64_(a as _)
+}
+
+/// Load single 2-element structure and replicate to all lanes of two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld2r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2q_dup_f64(a: *const f64) -> float64x2x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld2r.v2f64.p0f64")]
+ fn vld2q_dup_f64_(ptr: *const f64) -> float64x2x2_t;
+ }
+ vld2q_dup_f64_(a as _)
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2q_lane_s8<const LANE: i32>(a: *const i8, b: int8x16x2_t) -> int8x16x2_t {
+ static_assert_imm4!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld2lane.v16i8.p0i8")]
+ fn vld2q_lane_s8_(a: int8x16_t, b: int8x16_t, n: i64, ptr: *const i8) -> int8x16x2_t;
+ }
+ vld2q_lane_s8_(b.0, b.1, LANE as i64, a as _)
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2_lane_s64<const LANE: i32>(a: *const i64, b: int64x1x2_t) -> int64x1x2_t {
+ static_assert!(LANE : i32 where LANE == 0);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld2lane.v1i64.p0i8")]
+ fn vld2_lane_s64_(a: int64x1_t, b: int64x1_t, n: i64, ptr: *const i8) -> int64x1x2_t;
+ }
+ vld2_lane_s64_(b.0, b.1, LANE as i64, a as _)
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2q_lane_s64<const LANE: i32>(a: *const i64, b: int64x2x2_t) -> int64x2x2_t {
+ static_assert_imm1!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld2lane.v2i64.p0i8")]
+ fn vld2q_lane_s64_(a: int64x2_t, b: int64x2_t, n: i64, ptr: *const i8) -> int64x2x2_t;
+ }
+ vld2q_lane_s64_(b.0, b.1, LANE as i64, a as _)
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(test, assert_instr(ld2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2_lane_p64<const LANE: i32>(a: *const p64, b: poly64x1x2_t) -> poly64x1x2_t {
+ static_assert!(LANE : i32 where LANE == 0);
+ transmute(vld2_lane_s64::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(test, assert_instr(ld2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2q_lane_p64<const LANE: i32>(a: *const p64, b: poly64x2x2_t) -> poly64x2x2_t {
+ static_assert_imm1!(LANE);
+ transmute(vld2q_lane_s64::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2q_lane_u8<const LANE: i32>(a: *const u8, b: uint8x16x2_t) -> uint8x16x2_t {
+ static_assert_imm4!(LANE);
+ transmute(vld2q_lane_s8::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2_lane_u64<const LANE: i32>(a: *const u64, b: uint64x1x2_t) -> uint64x1x2_t {
+ static_assert!(LANE : i32 where LANE == 0);
+ transmute(vld2_lane_s64::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2q_lane_u64<const LANE: i32>(a: *const u64, b: uint64x2x2_t) -> uint64x2x2_t {
+ static_assert_imm1!(LANE);
+ transmute(vld2q_lane_s64::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2q_lane_p8<const LANE: i32>(a: *const p8, b: poly8x16x2_t) -> poly8x16x2_t {
+ static_assert_imm4!(LANE);
+ transmute(vld2q_lane_s8::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2_lane_f64<const LANE: i32>(a: *const f64, b: float64x1x2_t) -> float64x1x2_t {
+ static_assert!(LANE : i32 where LANE == 0);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld2lane.v1f64.p0i8")]
+ fn vld2_lane_f64_(a: float64x1_t, b: float64x1_t, n: i64, ptr: *const i8) -> float64x1x2_t;
+ }
+ vld2_lane_f64_(b.0, b.1, LANE as i64, a as _)
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2q_lane_f64<const LANE: i32>(a: *const f64, b: float64x2x2_t) -> float64x2x2_t {
+ static_assert_imm1!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld2lane.v2f64.p0i8")]
+ fn vld2q_lane_f64_(a: float64x2_t, b: float64x2_t, n: i64, ptr: *const i8) -> float64x2x2_t;
+ }
+ vld2q_lane_f64_(b.0, b.1, LANE as i64, a as _)
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld3))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3q_s64(a: *const i64) -> int64x2x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld3.v2i64.p0v2i64")]
+ fn vld3q_s64_(ptr: *const int64x2_t) -> int64x2x3_t;
+ }
+ vld3q_s64_(a as _)
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld3))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3q_u64(a: *const u64) -> uint64x2x3_t {
+ transmute(vld3q_s64(transmute(a)))
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(test, assert_instr(ld3))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3q_p64(a: *const p64) -> poly64x2x3_t {
+ transmute(vld3q_s64(transmute(a)))
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3_f64(a: *const f64) -> float64x1x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld3.v1f64.p0v1f64")]
+ fn vld3_f64_(ptr: *const float64x1_t) -> float64x1x3_t;
+ }
+ vld3_f64_(a as _)
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld3))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3q_f64(a: *const f64) -> float64x2x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld3.v2f64.p0v2f64")]
+ fn vld3q_f64_(ptr: *const float64x2_t) -> float64x2x3_t;
+ }
+ vld3q_f64_(a as _)
+}
+
+/// Load single 3-element structure and replicate to all lanes of three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld3r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3q_dup_s64(a: *const i64) -> int64x2x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld3r.v2i64.p0i64")]
+ fn vld3q_dup_s64_(ptr: *const i64) -> int64x2x3_t;
+ }
+ vld3q_dup_s64_(a as _)
+}
+
+/// Load single 3-element structure and replicate to all lanes of three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld3r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3q_dup_u64(a: *const u64) -> uint64x2x3_t {
+ transmute(vld3q_dup_s64(transmute(a)))
+}
+
+/// Load single 3-element structure and replicate to all lanes of three registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(test, assert_instr(ld3r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3q_dup_p64(a: *const p64) -> poly64x2x3_t {
+ transmute(vld3q_dup_s64(transmute(a)))
+}
+
+/// Load single 3-element structure and replicate to all lanes of three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld3r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3_dup_f64(a: *const f64) -> float64x1x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld3r.v1f64.p0f64")]
+ fn vld3_dup_f64_(ptr: *const f64) -> float64x1x3_t;
+ }
+ vld3_dup_f64_(a as _)
+}
+
+/// Load single 3-element structure and replicate to all lanes of three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld3r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3q_dup_f64(a: *const f64) -> float64x2x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld3r.v2f64.p0f64")]
+ fn vld3q_dup_f64_(ptr: *const f64) -> float64x2x3_t;
+ }
+ vld3q_dup_f64_(a as _)
+}
+
+/// Load multiple 3-element structures to two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3q_lane_s8<const LANE: i32>(a: *const i8, b: int8x16x3_t) -> int8x16x3_t {
+ static_assert_imm4!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld3lane.v16i8.p0i8")]
+ fn vld3q_lane_s8_(a: int8x16_t, b: int8x16_t, c: int8x16_t, n: i64, ptr: *const i8) -> int8x16x3_t;
+ }
+ vld3q_lane_s8_(b.0, b.1, b.2, LANE as i64, a as _)
+}
+
+/// Load multiple 3-element structures to two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3_lane_s64<const LANE: i32>(a: *const i64, b: int64x1x3_t) -> int64x1x3_t {
+ static_assert!(LANE : i32 where LANE == 0);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld3lane.v1i64.p0i8")]
+ fn vld3_lane_s64_(a: int64x1_t, b: int64x1_t, c: int64x1_t, n: i64, ptr: *const i8) -> int64x1x3_t;
+ }
+ vld3_lane_s64_(b.0, b.1, b.2, LANE as i64, a as _)
+}
+
+/// Load multiple 3-element structures to two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3q_lane_s64<const LANE: i32>(a: *const i64, b: int64x2x3_t) -> int64x2x3_t {
+ static_assert_imm1!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld3lane.v2i64.p0i8")]
+ fn vld3q_lane_s64_(a: int64x2_t, b: int64x2_t, c: int64x2_t, n: i64, ptr: *const i8) -> int64x2x3_t;
+ }
+ vld3q_lane_s64_(b.0, b.1, b.2, LANE as i64, a as _)
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(test, assert_instr(ld3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3_lane_p64<const LANE: i32>(a: *const p64, b: poly64x1x3_t) -> poly64x1x3_t {
+ static_assert!(LANE : i32 where LANE == 0);
+ transmute(vld3_lane_s64::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(test, assert_instr(ld3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3q_lane_p64<const LANE: i32>(a: *const p64, b: poly64x2x3_t) -> poly64x2x3_t {
+ static_assert_imm1!(LANE);
+ transmute(vld3q_lane_s64::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3q_lane_p8<const LANE: i32>(a: *const p8, b: poly8x16x3_t) -> poly8x16x3_t {
+ static_assert_imm4!(LANE);
+ transmute(vld3q_lane_s8::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3q_lane_u8<const LANE: i32>(a: *const u8, b: uint8x16x3_t) -> uint8x16x3_t {
+ static_assert_imm4!(LANE);
+ transmute(vld3q_lane_s8::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3_lane_u64<const LANE: i32>(a: *const u64, b: uint64x1x3_t) -> uint64x1x3_t {
+ static_assert!(LANE : i32 where LANE == 0);
+ transmute(vld3_lane_s64::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3q_lane_u64<const LANE: i32>(a: *const u64, b: uint64x2x3_t) -> uint64x2x3_t {
+ static_assert_imm1!(LANE);
+ transmute(vld3q_lane_s64::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3_lane_f64<const LANE: i32>(a: *const f64, b: float64x1x3_t) -> float64x1x3_t {
+ static_assert!(LANE : i32 where LANE == 0);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld3lane.v1f64.p0i8")]
+ fn vld3_lane_f64_(a: float64x1_t, b: float64x1_t, c: float64x1_t, n: i64, ptr: *const i8) -> float64x1x3_t;
+ }
+ vld3_lane_f64_(b.0, b.1, b.2, LANE as i64, a as _)
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3q_lane_f64<const LANE: i32>(a: *const f64, b: float64x2x3_t) -> float64x2x3_t {
+ static_assert_imm1!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld3lane.v2f64.p0i8")]
+ fn vld3q_lane_f64_(a: float64x2_t, b: float64x2_t, c: float64x2_t, n: i64, ptr: *const i8) -> float64x2x3_t;
+ }
+ vld3q_lane_f64_(b.0, b.1, b.2, LANE as i64, a as _)
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld4))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4q_s64(a: *const i64) -> int64x2x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld4.v2i64.p0v2i64")]
+ fn vld4q_s64_(ptr: *const int64x2_t) -> int64x2x4_t;
+ }
+ vld4q_s64_(a as _)
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld4))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4q_u64(a: *const u64) -> uint64x2x4_t {
+ transmute(vld4q_s64(transmute(a)))
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(test, assert_instr(ld4))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4q_p64(a: *const p64) -> poly64x2x4_t {
+ transmute(vld4q_s64(transmute(a)))
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4_f64(a: *const f64) -> float64x1x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld4.v1f64.p0v1f64")]
+ fn vld4_f64_(ptr: *const float64x1_t) -> float64x1x4_t;
+ }
+ vld4_f64_(a as _)
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld4))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4q_f64(a: *const f64) -> float64x2x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld4.v2f64.p0v2f64")]
+ fn vld4q_f64_(ptr: *const float64x2_t) -> float64x2x4_t;
+ }
+ vld4q_f64_(a as _)
+}
+
+/// Load single 4-element structure and replicate to all lanes of four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld4r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4q_dup_s64(a: *const i64) -> int64x2x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld4r.v2i64.p0i64")]
+ fn vld4q_dup_s64_(ptr: *const i64) -> int64x2x4_t;
+ }
+ vld4q_dup_s64_(a as _)
+}
+
+/// Load single 4-element structure and replicate to all lanes of four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld4r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4q_dup_u64(a: *const u64) -> uint64x2x4_t {
+ transmute(vld4q_dup_s64(transmute(a)))
+}
+
+/// Load single 4-element structure and replicate to all lanes of four registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(test, assert_instr(ld4r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4q_dup_p64(a: *const p64) -> poly64x2x4_t {
+ transmute(vld4q_dup_s64(transmute(a)))
+}
+
+/// Load single 4-element structure and replicate to all lanes of four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld4r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4_dup_f64(a: *const f64) -> float64x1x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld4r.v1f64.p0f64")]
+ fn vld4_dup_f64_(ptr: *const f64) -> float64x1x4_t;
+ }
+ vld4_dup_f64_(a as _)
+}
+
+/// Load single 4-element structure and replicate to all lanes of four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld4r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4q_dup_f64(a: *const f64) -> float64x2x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld4r.v2f64.p0f64")]
+ fn vld4q_dup_f64_(ptr: *const f64) -> float64x2x4_t;
+ }
+ vld4q_dup_f64_(a as _)
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4q_lane_s8<const LANE: i32>(a: *const i8, b: int8x16x4_t) -> int8x16x4_t {
+ static_assert_imm4!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld4lane.v16i8.p0i8")]
+ fn vld4q_lane_s8_(a: int8x16_t, b: int8x16_t, c: int8x16_t, d: int8x16_t, n: i64, ptr: *const i8) -> int8x16x4_t;
+ }
+ vld4q_lane_s8_(b.0, b.1, b.2, b.3, LANE as i64, a as _)
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4_lane_s64<const LANE: i32>(a: *const i64, b: int64x1x4_t) -> int64x1x4_t {
+ static_assert!(LANE : i32 where LANE == 0);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld4lane.v1i64.p0i8")]
+ fn vld4_lane_s64_(a: int64x1_t, b: int64x1_t, c: int64x1_t, d: int64x1_t, n: i64, ptr: *const i8) -> int64x1x4_t;
+ }
+ vld4_lane_s64_(b.0, b.1, b.2, b.3, LANE as i64, a as _)
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4q_lane_s64<const LANE: i32>(a: *const i64, b: int64x2x4_t) -> int64x2x4_t {
+ static_assert_imm1!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld4lane.v2i64.p0i8")]
+ fn vld4q_lane_s64_(a: int64x2_t, b: int64x2_t, c: int64x2_t, d: int64x2_t, n: i64, ptr: *const i8) -> int64x2x4_t;
+ }
+ vld4q_lane_s64_(b.0, b.1, b.2, b.3, LANE as i64, a as _)
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(test, assert_instr(ld4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4_lane_p64<const LANE: i32>(a: *const p64, b: poly64x1x4_t) -> poly64x1x4_t {
+ static_assert!(LANE : i32 where LANE == 0);
+ transmute(vld4_lane_s64::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(test, assert_instr(ld4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4q_lane_p64<const LANE: i32>(a: *const p64, b: poly64x2x4_t) -> poly64x2x4_t {
+ static_assert_imm1!(LANE);
+ transmute(vld4q_lane_s64::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4q_lane_p8<const LANE: i32>(a: *const p8, b: poly8x16x4_t) -> poly8x16x4_t {
+ static_assert_imm4!(LANE);
+ transmute(vld4q_lane_s8::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4q_lane_u8<const LANE: i32>(a: *const u8, b: uint8x16x4_t) -> uint8x16x4_t {
+ static_assert_imm4!(LANE);
+ transmute(vld4q_lane_s8::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4_lane_u64<const LANE: i32>(a: *const u64, b: uint64x1x4_t) -> uint64x1x4_t {
+ static_assert!(LANE : i32 where LANE == 0);
+ transmute(vld4_lane_s64::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4q_lane_u64<const LANE: i32>(a: *const u64, b: uint64x2x4_t) -> uint64x2x4_t {
+ static_assert_imm1!(LANE);
+ transmute(vld4q_lane_s64::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4_lane_f64<const LANE: i32>(a: *const f64, b: float64x1x4_t) -> float64x1x4_t {
+ static_assert!(LANE : i32 where LANE == 0);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld4lane.v1f64.p0i8")]
+ fn vld4_lane_f64_(a: float64x1_t, b: float64x1_t, c: float64x1_t, d: float64x1_t, n: i64, ptr: *const i8) -> float64x1x4_t;
+ }
+ vld4_lane_f64_(b.0, b.1, b.2, b.3, LANE as i64, a as _)
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4q_lane_f64<const LANE: i32>(a: *const f64, b: float64x2x4_t) -> float64x2x4_t {
+ static_assert_imm1!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld4lane.v2f64.p0i8")]
+ fn vld4q_lane_f64_(a: float64x2_t, b: float64x2_t, c: float64x2_t, d: float64x2_t, n: i64, ptr: *const i8) -> float64x2x4_t;
+ }
+ vld4q_lane_f64_(b.0, b.1, b.2, b.3, LANE as i64, a as _)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1_lane_f64<const LANE: i32>(a: *mut f64, b: float64x1_t) {
+ static_assert!(LANE : i32 where LANE == 0);
+ *a = simd_extract(b, LANE as u32);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1q_lane_f64<const LANE: i32>(a: *mut f64, b: float64x2_t) {
+ static_assert_imm1!(LANE);
+ *a = simd_extract(b, LANE as u32);
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1_f64_x2(a: *mut f64, b: float64x1x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st1x2.v1f64.p0f64")]
+ fn vst1_f64_x2_(a: float64x1_t, b: float64x1_t, ptr: *mut f64);
+ }
+ vst1_f64_x2_(b.0, b.1, a)
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1q_f64_x2(a: *mut f64, b: float64x2x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st1x2.v2f64.p0f64")]
+ fn vst1q_f64_x2_(a: float64x2_t, b: float64x2_t, ptr: *mut f64);
+ }
+ vst1q_f64_x2_(b.0, b.1, a)
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1_f64_x3(a: *mut f64, b: float64x1x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st1x3.v1f64.p0f64")]
+ fn vst1_f64_x3_(a: float64x1_t, b: float64x1_t, c: float64x1_t, ptr: *mut f64);
+ }
+ vst1_f64_x3_(b.0, b.1, b.2, a)
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1q_f64_x3(a: *mut f64, b: float64x2x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st1x3.v2f64.p0f64")]
+ fn vst1q_f64_x3_(a: float64x2_t, b: float64x2_t, c: float64x2_t, ptr: *mut f64);
+ }
+ vst1q_f64_x3_(b.0, b.1, b.2, a)
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1_f64_x4(a: *mut f64, b: float64x1x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st1x4.v1f64.p0f64")]
+ fn vst1_f64_x4_(a: float64x1_t, b: float64x1_t, c: float64x1_t, d: float64x1_t, ptr: *mut f64);
+ }
+ vst1_f64_x4_(b.0, b.1, b.2, b.3, a)
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1q_f64_x4(a: *mut f64, b: float64x2x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st1x4.v2f64.p0f64")]
+ fn vst1q_f64_x4_(a: float64x2_t, b: float64x2_t, c: float64x2_t, d: float64x2_t, ptr: *mut f64);
+ }
+ vst1q_f64_x4_(b.0, b.1, b.2, b.3, a)
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst2q_s64(a: *mut i64, b: int64x2x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st2.v2i64.p0i8")]
+ fn vst2q_s64_(a: int64x2_t, b: int64x2_t, ptr: *mut i8);
+ }
+ vst2q_s64_(b.0, b.1, a as _)
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst2q_u64(a: *mut u64, b: uint64x2x2_t) {
+ transmute(vst2q_s64(transmute(a), transmute(b)))
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(test, assert_instr(st2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst2q_p64(a: *mut p64, b: poly64x2x2_t) {
+ transmute(vst2q_s64(transmute(a), transmute(b)))
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst2_f64(a: *mut f64, b: float64x1x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st2.v1f64.p0i8")]
+ fn vst2_f64_(a: float64x1_t, b: float64x1_t, ptr: *mut i8);
+ }
+ vst2_f64_(b.0, b.1, a as _)
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst2q_f64(a: *mut f64, b: float64x2x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st2.v2f64.p0i8")]
+ fn vst2q_f64_(a: float64x2_t, b: float64x2_t, ptr: *mut i8);
+ }
+ vst2q_f64_(b.0, b.1, a as _)
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst2q_lane_s8<const LANE: i32>(a: *mut i8, b: int8x16x2_t) {
+ static_assert_imm4!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st2lane.v16i8.p0i8")]
+ fn vst2q_lane_s8_(a: int8x16_t, b: int8x16_t, n: i64, ptr: *mut i8);
+ }
+ vst2q_lane_s8_(b.0, b.1, LANE as i64, a as _)
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst2_lane_s64<const LANE: i32>(a: *mut i64, b: int64x1x2_t) {
+ static_assert!(LANE : i32 where LANE == 0);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st2lane.v1i64.p0i8")]
+ fn vst2_lane_s64_(a: int64x1_t, b: int64x1_t, n: i64, ptr: *mut i8);
+ }
+ vst2_lane_s64_(b.0, b.1, LANE as i64, a as _)
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst2q_lane_s64<const LANE: i32>(a: *mut i64, b: int64x2x2_t) {
+ static_assert_imm1!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st2lane.v2i64.p0i8")]
+ fn vst2q_lane_s64_(a: int64x2_t, b: int64x2_t, n: i64, ptr: *mut i8);
+ }
+ vst2q_lane_s64_(b.0, b.1, LANE as i64, a as _)
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst2q_lane_u8<const LANE: i32>(a: *mut u8, b: uint8x16x2_t) {
+ static_assert_imm4!(LANE);
+ transmute(vst2q_lane_s8::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst2_lane_u64<const LANE: i32>(a: *mut u64, b: uint64x1x2_t) {
+ static_assert!(LANE : i32 where LANE == 0);
+ transmute(vst2_lane_s64::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst2q_lane_u64<const LANE: i32>(a: *mut u64, b: uint64x2x2_t) {
+ static_assert_imm1!(LANE);
+ transmute(vst2q_lane_s64::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst2q_lane_p8<const LANE: i32>(a: *mut p8, b: poly8x16x2_t) {
+ static_assert_imm4!(LANE);
+ transmute(vst2q_lane_s8::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(test, assert_instr(st2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst2_lane_p64<const LANE: i32>(a: *mut p64, b: poly64x1x2_t) {
+ static_assert!(LANE : i32 where LANE == 0);
+ transmute(vst2_lane_s64::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(test, assert_instr(st2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst2q_lane_p64<const LANE: i32>(a: *mut p64, b: poly64x2x2_t) {
+ static_assert_imm1!(LANE);
+ transmute(vst2q_lane_s64::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst2_lane_f64<const LANE: i32>(a: *mut f64, b: float64x1x2_t) {
+ static_assert!(LANE : i32 where LANE == 0);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st2lane.v1f64.p0i8")]
+ fn vst2_lane_f64_(a: float64x1_t, b: float64x1_t, n: i64, ptr: *mut i8);
+ }
+ vst2_lane_f64_(b.0, b.1, LANE as i64, a as _)
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst2q_lane_f64<const LANE: i32>(a: *mut f64, b: float64x2x2_t) {
+ static_assert_imm1!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st2lane.v2f64.p0i8")]
+ fn vst2q_lane_f64_(a: float64x2_t, b: float64x2_t, n: i64, ptr: *mut i8);
+ }
+ vst2q_lane_f64_(b.0, b.1, LANE as i64, a as _)
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st3))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst3q_s64(a: *mut i64, b: int64x2x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st3.v2i64.p0i8")]
+ fn vst3q_s64_(a: int64x2_t, b: int64x2_t, c: int64x2_t, ptr: *mut i8);
+ }
+ vst3q_s64_(b.0, b.1, b.2, a as _)
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st3))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst3q_u64(a: *mut u64, b: uint64x2x3_t) {
+ transmute(vst3q_s64(transmute(a), transmute(b)))
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(test, assert_instr(st3))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst3q_p64(a: *mut p64, b: poly64x2x3_t) {
+ transmute(vst3q_s64(transmute(a), transmute(b)))
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst3_f64(a: *mut f64, b: float64x1x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st3.v1f64.p0i8")]
+ fn vst3_f64_(a: float64x1_t, b: float64x1_t, c: float64x1_t, ptr: *mut i8);
+ }
+ vst3_f64_(b.0, b.1, b.2, a as _)
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st3))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst3q_f64(a: *mut f64, b: float64x2x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st3.v2f64.p0i8")]
+ fn vst3q_f64_(a: float64x2_t, b: float64x2_t, c: float64x2_t, ptr: *mut i8);
+ }
+ vst3q_f64_(b.0, b.1, b.2, a as _)
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst3q_lane_s8<const LANE: i32>(a: *mut i8, b: int8x16x3_t) {
+ static_assert_imm4!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st3lane.v16i8.p0i8")]
+ fn vst3q_lane_s8_(a: int8x16_t, b: int8x16_t, c: int8x16_t, n: i64, ptr: *mut i8);
+ }
+ vst3q_lane_s8_(b.0, b.1, b.2, LANE as i64, a as _)
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst3_lane_s64<const LANE: i32>(a: *mut i64, b: int64x1x3_t) {
+ static_assert!(LANE : i32 where LANE == 0);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st3lane.v1i64.p0i8")]
+ fn vst3_lane_s64_(a: int64x1_t, b: int64x1_t, c: int64x1_t, n: i64, ptr: *mut i8);
+ }
+ vst3_lane_s64_(b.0, b.1, b.2, LANE as i64, a as _)
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst3q_lane_s64<const LANE: i32>(a: *mut i64, b: int64x2x3_t) {
+ static_assert_imm1!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st3lane.v2i64.p0i8")]
+ fn vst3q_lane_s64_(a: int64x2_t, b: int64x2_t, c: int64x2_t, n: i64, ptr: *mut i8);
+ }
+ vst3q_lane_s64_(b.0, b.1, b.2, LANE as i64, a as _)
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst3q_lane_u8<const LANE: i32>(a: *mut u8, b: uint8x16x3_t) {
+ static_assert_imm4!(LANE);
+ transmute(vst3q_lane_s8::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst3_lane_u64<const LANE: i32>(a: *mut u64, b: uint64x1x3_t) {
+ static_assert!(LANE : i32 where LANE == 0);
+ transmute(vst3_lane_s64::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst3q_lane_u64<const LANE: i32>(a: *mut u64, b: uint64x2x3_t) {
+ static_assert_imm1!(LANE);
+ transmute(vst3q_lane_s64::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst3q_lane_p8<const LANE: i32>(a: *mut p8, b: poly8x16x3_t) {
+ static_assert_imm4!(LANE);
+ transmute(vst3q_lane_s8::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(test, assert_instr(st3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst3_lane_p64<const LANE: i32>(a: *mut p64, b: poly64x1x3_t) {
+ static_assert!(LANE : i32 where LANE == 0);
+ transmute(vst3_lane_s64::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(test, assert_instr(st3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst3q_lane_p64<const LANE: i32>(a: *mut p64, b: poly64x2x3_t) {
+ static_assert_imm1!(LANE);
+ transmute(vst3q_lane_s64::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst3_lane_f64<const LANE: i32>(a: *mut f64, b: float64x1x3_t) {
+ static_assert!(LANE : i32 where LANE == 0);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st3lane.v1f64.p0i8")]
+ fn vst3_lane_f64_(a: float64x1_t, b: float64x1_t, c: float64x1_t, n: i64, ptr: *mut i8);
+ }
+ vst3_lane_f64_(b.0, b.1, b.2, LANE as i64, a as _)
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst3q_lane_f64<const LANE: i32>(a: *mut f64, b: float64x2x3_t) {
+ static_assert_imm1!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st3lane.v2f64.p0i8")]
+ fn vst3q_lane_f64_(a: float64x2_t, b: float64x2_t, c: float64x2_t, n: i64, ptr: *mut i8);
+ }
+ vst3q_lane_f64_(b.0, b.1, b.2, LANE as i64, a as _)
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st4))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst4q_s64(a: *mut i64, b: int64x2x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st4.v2i64.p0i8")]
+ fn vst4q_s64_(a: int64x2_t, b: int64x2_t, c: int64x2_t, d: int64x2_t, ptr: *mut i8);
+ }
+ vst4q_s64_(b.0, b.1, b.2, b.3, a as _)
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st4))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst4q_u64(a: *mut u64, b: uint64x2x4_t) {
+ transmute(vst4q_s64(transmute(a), transmute(b)))
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(test, assert_instr(st4))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst4q_p64(a: *mut p64, b: poly64x2x4_t) {
+ transmute(vst4q_s64(transmute(a), transmute(b)))
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst4_f64(a: *mut f64, b: float64x1x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st4.v1f64.p0i8")]
+ fn vst4_f64_(a: float64x1_t, b: float64x1_t, c: float64x1_t, d: float64x1_t, ptr: *mut i8);
+ }
+ vst4_f64_(b.0, b.1, b.2, b.3, a as _)
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st4))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst4q_f64(a: *mut f64, b: float64x2x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st4.v2f64.p0i8")]
+ fn vst4q_f64_(a: float64x2_t, b: float64x2_t, c: float64x2_t, d: float64x2_t, ptr: *mut i8);
+ }
+ vst4q_f64_(b.0, b.1, b.2, b.3, a as _)
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst4q_lane_s8<const LANE: i32>(a: *mut i8, b: int8x16x4_t) {
+ static_assert_imm4!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st4lane.v16i8.p0i8")]
+ fn vst4q_lane_s8_(a: int8x16_t, b: int8x16_t, c: int8x16_t, d: int8x16_t, n: i64, ptr: *mut i8);
+ }
+ vst4q_lane_s8_(b.0, b.1, b.2, b.3, LANE as i64, a as _)
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst4_lane_s64<const LANE: i32>(a: *mut i64, b: int64x1x4_t) {
+ static_assert!(LANE : i32 where LANE == 0);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st4lane.v1i64.p0i8")]
+ fn vst4_lane_s64_(a: int64x1_t, b: int64x1_t, c: int64x1_t, d: int64x1_t, n: i64, ptr: *mut i8);
+ }
+ vst4_lane_s64_(b.0, b.1, b.2, b.3, LANE as i64, a as _)
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst4q_lane_s64<const LANE: i32>(a: *mut i64, b: int64x2x4_t) {
+ static_assert_imm1!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st4lane.v2i64.p0i8")]
+ fn vst4q_lane_s64_(a: int64x2_t, b: int64x2_t, c: int64x2_t, d: int64x2_t, n: i64, ptr: *mut i8);
+ }
+ vst4q_lane_s64_(b.0, b.1, b.2, b.3, LANE as i64, a as _)
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst4q_lane_u8<const LANE: i32>(a: *mut u8, b: uint8x16x4_t) {
+ static_assert_imm4!(LANE);
+ transmute(vst4q_lane_s8::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst4_lane_u64<const LANE: i32>(a: *mut u64, b: uint64x1x4_t) {
+ static_assert!(LANE : i32 where LANE == 0);
+ transmute(vst4_lane_s64::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst4q_lane_u64<const LANE: i32>(a: *mut u64, b: uint64x2x4_t) {
+ static_assert_imm1!(LANE);
+ transmute(vst4q_lane_s64::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst4q_lane_p8<const LANE: i32>(a: *mut p8, b: poly8x16x4_t) {
+ static_assert_imm4!(LANE);
+ transmute(vst4q_lane_s8::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(test, assert_instr(st4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst4_lane_p64<const LANE: i32>(a: *mut p64, b: poly64x1x4_t) {
+ static_assert!(LANE : i32 where LANE == 0);
+ transmute(vst4_lane_s64::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(test, assert_instr(st4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst4q_lane_p64<const LANE: i32>(a: *mut p64, b: poly64x2x4_t) {
+ static_assert_imm1!(LANE);
+ transmute(vst4q_lane_s64::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst4_lane_f64<const LANE: i32>(a: *mut f64, b: float64x1x4_t) {
+ static_assert!(LANE : i32 where LANE == 0);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st4lane.v1f64.p0i8")]
+ fn vst4_lane_f64_(a: float64x1_t, b: float64x1_t, c: float64x1_t, d: float64x1_t, n: i64, ptr: *mut i8);
+ }
+ vst4_lane_f64_(b.0, b.1, b.2, b.3, LANE as i64, a as _)
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst4q_lane_f64<const LANE: i32>(a: *mut f64, b: float64x2x4_t) {
+ static_assert_imm1!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st4lane.v2f64.p0i8")]
+ fn vst4q_lane_f64_(a: float64x2_t, b: float64x2_t, c: float64x2_t, d: float64x2_t, n: i64, ptr: *mut i8);
+ }
+ vst4q_lane_f64_(b.0, b.1, b.2, b.3, LANE as i64, a as _)
+}
+
+/// Multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmul))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmul_f64(a: float64x1_t, b: float64x1_t) -> float64x1_t {
+ simd_mul(a, b)
+}
+
+/// Multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmul))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmulq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t {
+ simd_mul(a, b)
+}
+
+/// Vector multiply by scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmul))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmul_n_f64(a: float64x1_t, b: f64) -> float64x1_t {
+ simd_mul(a, vdup_n_f64(b))
+}
+
+/// Vector multiply by scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmul))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmulq_n_f64(a: float64x2_t, b: f64) -> float64x2_t {
+ simd_mul(a, vdupq_n_f64(b))
+}
+
+/// Floating-point multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmul, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmul_lane_f64<const LANE: i32>(a: float64x1_t, b: float64x1_t) -> float64x1_t {
+ static_assert!(LANE : i32 where LANE == 0);
+ simd_mul(a, transmute::<f64, _>(simd_extract(b, LANE as u32)))
+}
+
+/// Floating-point multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmul, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmul_laneq_f64<const LANE: i32>(a: float64x1_t, b: float64x2_t) -> float64x1_t {
+ static_assert_imm1!(LANE);
+ simd_mul(a, transmute::<f64, _>(simd_extract(b, LANE as u32)))
+}
+
+/// Floating-point multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmul, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmulq_lane_f64<const LANE: i32>(a: float64x2_t, b: float64x1_t) -> float64x2_t {
+ static_assert!(LANE : i32 where LANE == 0);
+ simd_mul(a, simd_shuffle2!(b, b, <const LANE: i32> [LANE as u32, LANE as u32]))
+}
+
+/// Floating-point multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmul, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmulq_laneq_f64<const LANE: i32>(a: float64x2_t, b: float64x2_t) -> float64x2_t {
+ static_assert_imm1!(LANE);
+ simd_mul(a, simd_shuffle2!(b, b, <const LANE: i32> [LANE as u32, LANE as u32]))
+}
+
+/// Floating-point multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmul, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmuls_lane_f32<const LANE: i32>(a: f32, b: float32x2_t) -> f32 {
+ static_assert_imm1!(LANE);
+ let b: f32 = simd_extract(b, LANE as u32);
+ a * b
+}
+
+/// Floating-point multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmul, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmuls_laneq_f32<const LANE: i32>(a: f32, b: float32x4_t) -> f32 {
+ static_assert_imm2!(LANE);
+ let b: f32 = simd_extract(b, LANE as u32);
+ a * b
+}
+
+/// Floating-point multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmul, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmuld_lane_f64<const LANE: i32>(a: f64, b: float64x1_t) -> f64 {
+ static_assert!(LANE : i32 where LANE == 0);
+ let b: f64 = simd_extract(b, LANE as u32);
+ a * b
+}
+
+/// Floating-point multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmul, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmuld_laneq_f64<const LANE: i32>(a: f64, b: float64x2_t) -> f64 {
+ static_assert_imm1!(LANE);
+ let b: f64 = simd_extract(b, LANE as u32);
+ a * b
+}
+
+/// Signed multiply long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(smull2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmull_high_s8(a: int8x16_t, b: int8x16_t) -> int16x8_t {
+ let a: int8x8_t = simd_shuffle8!(a, a, [8, 9, 10, 11, 12, 13, 14, 15]);
+ let b: int8x8_t = simd_shuffle8!(b, b, [8, 9, 10, 11, 12, 13, 14, 15]);
+ vmull_s8(a, b)
+}
+
+/// Signed multiply long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(smull2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmull_high_s16(a: int16x8_t, b: int16x8_t) -> int32x4_t {
+ let a: int16x4_t = simd_shuffle4!(a, a, [4, 5, 6, 7]);
+ let b: int16x4_t = simd_shuffle4!(b, b, [4, 5, 6, 7]);
+ vmull_s16(a, b)
+}
+
+/// Signed multiply long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(smull2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmull_high_s32(a: int32x4_t, b: int32x4_t) -> int64x2_t {
+ let a: int32x2_t = simd_shuffle2!(a, a, [2, 3]);
+ let b: int32x2_t = simd_shuffle2!(b, b, [2, 3]);
+ vmull_s32(a, b)
+}
+
+/// Unsigned multiply long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(umull2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmull_high_u8(a: uint8x16_t, b: uint8x16_t) -> uint16x8_t {
+ let a: uint8x8_t = simd_shuffle8!(a, a, [8, 9, 10, 11, 12, 13, 14, 15]);
+ let b: uint8x8_t = simd_shuffle8!(b, b, [8, 9, 10, 11, 12, 13, 14, 15]);
+ vmull_u8(a, b)
+}
+
+/// Unsigned multiply long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(umull2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmull_high_u16(a: uint16x8_t, b: uint16x8_t) -> uint32x4_t {
+ let a: uint16x4_t = simd_shuffle4!(a, a, [4, 5, 6, 7]);
+ let b: uint16x4_t = simd_shuffle4!(b, b, [4, 5, 6, 7]);
+ vmull_u16(a, b)
+}
+
+/// Unsigned multiply long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(umull2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmull_high_u32(a: uint32x4_t, b: uint32x4_t) -> uint64x2_t {
+ let a: uint32x2_t = simd_shuffle2!(a, a, [2, 3]);
+ let b: uint32x2_t = simd_shuffle2!(b, b, [2, 3]);
+ vmull_u32(a, b)
+}
+
+/// Polynomial multiply long
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(test, assert_instr(pmull))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmull_p64(a: p64, b: p64) -> p128 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.pmull64")]
+ fn vmull_p64_(a: p64, b: p64) -> int8x16_t;
+ }
+ transmute(vmull_p64_(a, b))
+}
+
+/// Polynomial multiply long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(pmull))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmull_high_p8(a: poly8x16_t, b: poly8x16_t) -> poly16x8_t {
+ let a: poly8x8_t = simd_shuffle8!(a, a, [8, 9, 10, 11, 12, 13, 14, 15]);
+ let b: poly8x8_t = simd_shuffle8!(b, b, [8, 9, 10, 11, 12, 13, 14, 15]);
+ vmull_p8(a, b)
+}
+
+/// Polynomial multiply long
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(test, assert_instr(pmull))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmull_high_p64(a: poly64x2_t, b: poly64x2_t) -> p128 {
+ vmull_p64(simd_extract(a, 1), simd_extract(b, 1))
+}
+
+/// Multiply long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(smull2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmull_high_n_s16(a: int16x8_t, b: i16) -> int32x4_t {
+ vmull_high_s16(a, vdupq_n_s16(b))
+}
+
+/// Multiply long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(smull2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmull_high_n_s32(a: int32x4_t, b: i32) -> int64x2_t {
+ vmull_high_s32(a, vdupq_n_s32(b))
+}
+
+/// Multiply long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(umull2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmull_high_n_u16(a: uint16x8_t, b: u16) -> uint32x4_t {
+ vmull_high_u16(a, vdupq_n_u16(b))
+}
+
+/// Multiply long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(umull2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmull_high_n_u32(a: uint32x4_t, b: u32) -> uint64x2_t {
+ vmull_high_u32(a, vdupq_n_u32(b))
+}
+
+/// Multiply long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(smull2, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmull_high_lane_s16<const LANE: i32>(a: int16x8_t, b: int16x4_t) -> int32x4_t {
+ static_assert_imm2!(LANE);
+ vmull_high_s16(a, simd_shuffle8!(b, b, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Multiply long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(smull2, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmull_high_laneq_s16<const LANE: i32>(a: int16x8_t, b: int16x8_t) -> int32x4_t {
+ static_assert_imm3!(LANE);
+ vmull_high_s16(a, simd_shuffle8!(b, b, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Multiply long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(smull2, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmull_high_lane_s32<const LANE: i32>(a: int32x4_t, b: int32x2_t) -> int64x2_t {
+ static_assert_imm1!(LANE);
+ vmull_high_s32(a, simd_shuffle4!(b, b, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Multiply long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(smull2, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmull_high_laneq_s32<const LANE: i32>(a: int32x4_t, b: int32x4_t) -> int64x2_t {
+ static_assert_imm2!(LANE);
+ vmull_high_s32(a, simd_shuffle4!(b, b, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Multiply long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(umull2, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmull_high_lane_u16<const LANE: i32>(a: uint16x8_t, b: uint16x4_t) -> uint32x4_t {
+ static_assert_imm2!(LANE);
+ vmull_high_u16(a, simd_shuffle8!(b, b, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Multiply long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(umull2, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmull_high_laneq_u16<const LANE: i32>(a: uint16x8_t, b: uint16x8_t) -> uint32x4_t {
+ static_assert_imm3!(LANE);
+ vmull_high_u16(a, simd_shuffle8!(b, b, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Multiply long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(umull2, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmull_high_lane_u32<const LANE: i32>(a: uint32x4_t, b: uint32x2_t) -> uint64x2_t {
+ static_assert_imm1!(LANE);
+ vmull_high_u32(a, simd_shuffle4!(b, b, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Multiply long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(umull2, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmull_high_laneq_u32<const LANE: i32>(a: uint32x4_t, b: uint32x4_t) -> uint64x2_t {
+ static_assert_imm2!(LANE);
+ vmull_high_u32(a, simd_shuffle4!(b, b, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Floating-point multiply extended
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmulx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmulx_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fmulx.v2f32")]
+ fn vmulx_f32_(a: float32x2_t, b: float32x2_t) -> float32x2_t;
+ }
+ vmulx_f32_(a, b)
+}
+
+/// Floating-point multiply extended
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmulx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmulxq_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fmulx.v4f32")]
+ fn vmulxq_f32_(a: float32x4_t, b: float32x4_t) -> float32x4_t;
+ }
+ vmulxq_f32_(a, b)
+}
+
+/// Floating-point multiply extended
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmulx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmulx_f64(a: float64x1_t, b: float64x1_t) -> float64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fmulx.v1f64")]
+ fn vmulx_f64_(a: float64x1_t, b: float64x1_t) -> float64x1_t;
+ }
+ vmulx_f64_(a, b)
+}
+
+/// Floating-point multiply extended
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmulx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmulxq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fmulx.v2f64")]
+ fn vmulxq_f64_(a: float64x2_t, b: float64x2_t) -> float64x2_t;
+ }
+ vmulxq_f64_(a, b)
+}
+
+/// Floating-point multiply extended
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmulx, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmulx_lane_f64<const LANE: i32>(a: float64x1_t, b: float64x1_t) -> float64x1_t {
+ static_assert!(LANE : i32 where LANE == 0);
+ vmulx_f64(a, transmute::<f64, _>(simd_extract(b, LANE as u32)))
+}
+
+/// Floating-point multiply extended
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmulx, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmulx_laneq_f64<const LANE: i32>(a: float64x1_t, b: float64x2_t) -> float64x1_t {
+ static_assert_imm1!(LANE);
+ vmulx_f64(a, transmute::<f64, _>(simd_extract(b, LANE as u32)))
+}
+
+/// Floating-point multiply extended
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmulx, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmulx_lane_f32<const LANE: i32>(a: float32x2_t, b: float32x2_t) -> float32x2_t {
+ static_assert_imm1!(LANE);
+ vmulx_f32(a, simd_shuffle2!(b, b, <const LANE: i32> [LANE as u32, LANE as u32]))
+}
+
+/// Floating-point multiply extended
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmulx, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmulx_laneq_f32<const LANE: i32>(a: float32x2_t, b: float32x4_t) -> float32x2_t {
+ static_assert_imm2!(LANE);
+ vmulx_f32(a, simd_shuffle2!(b, b, <const LANE: i32> [LANE as u32, LANE as u32]))
+}
+
+/// Floating-point multiply extended
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmulx, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmulxq_lane_f32<const LANE: i32>(a: float32x4_t, b: float32x2_t) -> float32x4_t {
+ static_assert_imm1!(LANE);
+ vmulxq_f32(a, simd_shuffle4!(b, b, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Floating-point multiply extended
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmulx, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmulxq_laneq_f32<const LANE: i32>(a: float32x4_t, b: float32x4_t) -> float32x4_t {
+ static_assert_imm2!(LANE);
+ vmulxq_f32(a, simd_shuffle4!(b, b, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Floating-point multiply extended
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmulx, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmulxq_lane_f64<const LANE: i32>(a: float64x2_t, b: float64x1_t) -> float64x2_t {
+ static_assert!(LANE : i32 where LANE == 0);
+ vmulxq_f64(a, simd_shuffle2!(b, b, <const LANE: i32> [LANE as u32, LANE as u32]))
+}
+
+/// Floating-point multiply extended
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmulx, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmulxq_laneq_f64<const LANE: i32>(a: float64x2_t, b: float64x2_t) -> float64x2_t {
+ static_assert_imm1!(LANE);
+ vmulxq_f64(a, simd_shuffle2!(b, b, <const LANE: i32> [LANE as u32, LANE as u32]))
+}
+
+/// Floating-point multiply extended
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmulx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmulxs_f32(a: f32, b: f32) -> f32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fmulx.f32")]
+ fn vmulxs_f32_(a: f32, b: f32) -> f32;
+ }
+ vmulxs_f32_(a, b)
+}
+
+/// Floating-point multiply extended
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmulx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmulxd_f64(a: f64, b: f64) -> f64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fmulx.f64")]
+ fn vmulxd_f64_(a: f64, b: f64) -> f64;
+ }
+ vmulxd_f64_(a, b)
+}
+
+/// Floating-point multiply extended
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmulx, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmulxs_lane_f32<const LANE: i32>(a: f32, b: float32x2_t) -> f32 {
+ static_assert_imm1!(LANE);
+ vmulxs_f32(a, simd_extract(b, LANE as u32))
+}
+
+/// Floating-point multiply extended
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmulx, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmulxs_laneq_f32<const LANE: i32>(a: f32, b: float32x4_t) -> f32 {
+ static_assert_imm2!(LANE);
+ vmulxs_f32(a, simd_extract(b, LANE as u32))
+}
+
+/// Floating-point multiply extended
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmulx, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmulxd_lane_f64<const LANE: i32>(a: f64, b: float64x1_t) -> f64 {
+ static_assert!(LANE : i32 where LANE == 0);
+ vmulxd_f64(a, simd_extract(b, LANE as u32))
+}
+
+/// Floating-point multiply extended
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmulx, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmulxd_laneq_f64<const LANE: i32>(a: f64, b: float64x2_t) -> f64 {
+ static_assert_imm1!(LANE);
+ vmulxd_f64(a, simd_extract(b, LANE as u32))
+}
+
+/// Floating-point fused Multiply-Add to accumulator(vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmadd))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vfma_f64(a: float64x1_t, b: float64x1_t, c: float64x1_t) -> float64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.fma.v1f64")]
+ fn vfma_f64_(a: float64x1_t, b: float64x1_t, c: float64x1_t) -> float64x1_t;
+ }
+ vfma_f64_(b, c, a)
+}
+
+/// Floating-point fused Multiply-Add to accumulator(vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmla))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vfmaq_f64(a: float64x2_t, b: float64x2_t, c: float64x2_t) -> float64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.fma.v2f64")]
+ fn vfmaq_f64_(a: float64x2_t, b: float64x2_t, c: float64x2_t) -> float64x2_t;
+ }
+ vfmaq_f64_(b, c, a)
+}
+
+/// Floating-point fused Multiply-Add to accumulator(vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmadd))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vfma_n_f64(a: float64x1_t, b: float64x1_t, c: f64) -> float64x1_t {
+ vfma_f64(a, b, vdup_n_f64(c))
+}
+
+/// Floating-point fused Multiply-Add to accumulator(vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmla))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vfmaq_n_f64(a: float64x2_t, b: float64x2_t, c: f64) -> float64x2_t {
+ vfmaq_f64(a, b, vdupq_n_f64(c))
+}
+
+/// Floating-point fused multiply-add to accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmla, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vfma_lane_f32<const LANE: i32>(a: float32x2_t, b: float32x2_t, c: float32x2_t) -> float32x2_t {
+ static_assert_imm1!(LANE);
+ vfma_f32(a, b, vdup_n_f32(simd_extract(c, LANE as u32)))
+}
+
+/// Floating-point fused multiply-add to accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmla, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vfma_laneq_f32<const LANE: i32>(a: float32x2_t, b: float32x2_t, c: float32x4_t) -> float32x2_t {
+ static_assert_imm2!(LANE);
+ vfma_f32(a, b, vdup_n_f32(simd_extract(c, LANE as u32)))
+}
+
+/// Floating-point fused multiply-add to accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmla, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vfmaq_lane_f32<const LANE: i32>(a: float32x4_t, b: float32x4_t, c: float32x2_t) -> float32x4_t {
+ static_assert_imm1!(LANE);
+ vfmaq_f32(a, b, vdupq_n_f32(simd_extract(c, LANE as u32)))
+}
+
+/// Floating-point fused multiply-add to accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmla, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vfmaq_laneq_f32<const LANE: i32>(a: float32x4_t, b: float32x4_t, c: float32x4_t) -> float32x4_t {
+ static_assert_imm2!(LANE);
+ vfmaq_f32(a, b, vdupq_n_f32(simd_extract(c, LANE as u32)))
+}
+
+/// Floating-point fused multiply-add to accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmadd, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vfma_lane_f64<const LANE: i32>(a: float64x1_t, b: float64x1_t, c: float64x1_t) -> float64x1_t {
+ static_assert!(LANE : i32 where LANE == 0);
+ vfma_f64(a, b, vdup_n_f64(simd_extract(c, LANE as u32)))
+}
+
+/// Floating-point fused multiply-add to accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmla, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vfma_laneq_f64<const LANE: i32>(a: float64x1_t, b: float64x1_t, c: float64x2_t) -> float64x1_t {
+ static_assert_imm1!(LANE);
+ vfma_f64(a, b, vdup_n_f64(simd_extract(c, LANE as u32)))
+}
+
+/// Floating-point fused multiply-add to accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmla, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vfmaq_lane_f64<const LANE: i32>(a: float64x2_t, b: float64x2_t, c: float64x1_t) -> float64x2_t {
+ static_assert!(LANE : i32 where LANE == 0);
+ vfmaq_f64(a, b, vdupq_n_f64(simd_extract(c, LANE as u32)))
+}
+
+/// Floating-point fused multiply-add to accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmla, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vfmaq_laneq_f64<const LANE: i32>(a: float64x2_t, b: float64x2_t, c: float64x2_t) -> float64x2_t {
+ static_assert_imm1!(LANE);
+ vfmaq_f64(a, b, vdupq_n_f64(simd_extract(c, LANE as u32)))
+}
+
+/// Floating-point fused multiply-add to accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmla, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vfmas_lane_f32<const LANE: i32>(a: f32, b: f32, c: float32x2_t) -> f32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.fma.f32")]
+ fn vfmas_lane_f32_(a: f32, b: f32, c: f32) -> f32;
+ }
+ static_assert_imm1!(LANE);
+ let c: f32 = simd_extract(c, LANE as u32);
+ vfmas_lane_f32_(b, c, a)
+}
+
+/// Floating-point fused multiply-add to accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmla, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vfmas_laneq_f32<const LANE: i32>(a: f32, b: f32, c: float32x4_t) -> f32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.fma.f32")]
+ fn vfmas_laneq_f32_(a: f32, b: f32, c: f32) -> f32;
+ }
+ static_assert_imm2!(LANE);
+ let c: f32 = simd_extract(c, LANE as u32);
+ vfmas_laneq_f32_(b, c, a)
+}
+
+/// Floating-point fused multiply-add to accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmadd, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vfmad_lane_f64<const LANE: i32>(a: f64, b: f64, c: float64x1_t) -> f64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.fma.f64")]
+ fn vfmad_lane_f64_(a: f64, b: f64, c: f64) -> f64;
+ }
+ static_assert!(LANE : i32 where LANE == 0);
+ let c: f64 = simd_extract(c, LANE as u32);
+ vfmad_lane_f64_(b, c, a)
+}
+
+/// Floating-point fused multiply-add to accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmla, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vfmad_laneq_f64<const LANE: i32>(a: f64, b: f64, c: float64x2_t) -> f64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.fma.f64")]
+ fn vfmad_laneq_f64_(a: f64, b: f64, c: f64) -> f64;
+ }
+ static_assert_imm1!(LANE);
+ let c: f64 = simd_extract(c, LANE as u32);
+ vfmad_laneq_f64_(b, c, a)
+}
+
+/// Floating-point fused multiply-subtract from accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmsub))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vfms_f64(a: float64x1_t, b: float64x1_t, c: float64x1_t) -> float64x1_t {
+ let b: float64x1_t = simd_neg(b);
+ vfma_f64(a, b, c)
+}
+
+/// Floating-point fused multiply-subtract from accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmls))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vfmsq_f64(a: float64x2_t, b: float64x2_t, c: float64x2_t) -> float64x2_t {
+ let b: float64x2_t = simd_neg(b);
+ vfmaq_f64(a, b, c)
+}
+
+/// Floating-point fused Multiply-subtract to accumulator(vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmsub))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vfms_n_f64(a: float64x1_t, b: float64x1_t, c: f64) -> float64x1_t {
+ vfms_f64(a, b, vdup_n_f64(c))
+}
+
+/// Floating-point fused Multiply-subtract to accumulator(vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmls))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vfmsq_n_f64(a: float64x2_t, b: float64x2_t, c: f64) -> float64x2_t {
+ vfmsq_f64(a, b, vdupq_n_f64(c))
+}
+
+/// Floating-point fused multiply-subtract to accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmls, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vfms_lane_f32<const LANE: i32>(a: float32x2_t, b: float32x2_t, c: float32x2_t) -> float32x2_t {
+ static_assert_imm1!(LANE);
+ vfms_f32(a, b, vdup_n_f32(simd_extract(c, LANE as u32)))
+}
+
+/// Floating-point fused multiply-subtract to accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmls, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vfms_laneq_f32<const LANE: i32>(a: float32x2_t, b: float32x2_t, c: float32x4_t) -> float32x2_t {
+ static_assert_imm2!(LANE);
+ vfms_f32(a, b, vdup_n_f32(simd_extract(c, LANE as u32)))
+}
+
+/// Floating-point fused multiply-subtract to accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmls, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vfmsq_lane_f32<const LANE: i32>(a: float32x4_t, b: float32x4_t, c: float32x2_t) -> float32x4_t {
+ static_assert_imm1!(LANE);
+ vfmsq_f32(a, b, vdupq_n_f32(simd_extract(c, LANE as u32)))
+}
+
+/// Floating-point fused multiply-subtract to accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmls, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vfmsq_laneq_f32<const LANE: i32>(a: float32x4_t, b: float32x4_t, c: float32x4_t) -> float32x4_t {
+ static_assert_imm2!(LANE);
+ vfmsq_f32(a, b, vdupq_n_f32(simd_extract(c, LANE as u32)))
+}
+
+/// Floating-point fused multiply-subtract to accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmsub, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vfms_lane_f64<const LANE: i32>(a: float64x1_t, b: float64x1_t, c: float64x1_t) -> float64x1_t {
+ static_assert!(LANE : i32 where LANE == 0);
+ vfms_f64(a, b, vdup_n_f64(simd_extract(c, LANE as u32)))
+}
+
+/// Floating-point fused multiply-subtract to accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmls, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vfms_laneq_f64<const LANE: i32>(a: float64x1_t, b: float64x1_t, c: float64x2_t) -> float64x1_t {
+ static_assert_imm1!(LANE);
+ vfms_f64(a, b, vdup_n_f64(simd_extract(c, LANE as u32)))
+}
+
+/// Floating-point fused multiply-subtract to accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmls, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vfmsq_lane_f64<const LANE: i32>(a: float64x2_t, b: float64x2_t, c: float64x1_t) -> float64x2_t {
+ static_assert!(LANE : i32 where LANE == 0);
+ vfmsq_f64(a, b, vdupq_n_f64(simd_extract(c, LANE as u32)))
+}
+
+/// Floating-point fused multiply-subtract to accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmls, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vfmsq_laneq_f64<const LANE: i32>(a: float64x2_t, b: float64x2_t, c: float64x2_t) -> float64x2_t {
+ static_assert_imm1!(LANE);
+ vfmsq_f64(a, b, vdupq_n_f64(simd_extract(c, LANE as u32)))
+}
+
+/// Floating-point fused multiply-subtract to accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmls, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vfmss_lane_f32<const LANE: i32>(a: f32, b: f32, c: float32x2_t) -> f32 {
+ vfmas_lane_f32::<LANE>(a, -b, c)
+}
+
+/// Floating-point fused multiply-subtract to accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmls, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vfmss_laneq_f32<const LANE: i32>(a: f32, b: f32, c: float32x4_t) -> f32 {
+ vfmas_laneq_f32::<LANE>(a, -b, c)
+}
+
+/// Floating-point fused multiply-subtract to accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmsub, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vfmsd_lane_f64<const LANE: i32>(a: f64, b: f64, c: float64x1_t) -> f64 {
+ vfmad_lane_f64::<LANE>(a, -b, c)
+}
+
+/// Floating-point fused multiply-subtract to accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmls, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vfmsd_laneq_f64<const LANE: i32>(a: f64, b: f64, c: float64x2_t) -> f64 {
+ vfmad_laneq_f64::<LANE>(a, -b, c)
+}
+
+/// Divide
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fdiv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vdiv_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t {
+ simd_div(a, b)
+}
+
+/// Divide
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fdiv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vdivq_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t {
+ simd_div(a, b)
+}
+
+/// Divide
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fdiv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vdiv_f64(a: float64x1_t, b: float64x1_t) -> float64x1_t {
+ simd_div(a, b)
+}
+
+/// Divide
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fdiv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vdivq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t {
+ simd_div(a, b)
+}
+
+/// Subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fsub))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsub_f64(a: float64x1_t, b: float64x1_t) -> float64x1_t {
+ simd_sub(a, b)
+}
+
+/// Subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fsub))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsubq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t {
+ simd_sub(a, b)
+}
+
+/// Subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsubd_s64(a: i64, b: i64) -> i64 {
+ a.wrapping_sub(b)
+}
+
+/// Subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsubd_u64(a: u64, b: u64) -> u64 {
+ a.wrapping_sub(b)
+}
+
+/// Add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vaddd_s64(a: i64, b: i64) -> i64 {
+ a.wrapping_add(b)
+}
+
+/// Add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vaddd_u64(a: u64, b: u64) -> u64 {
+ a.wrapping_add(b)
+}
+
+/// Floating-point add across vector
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(faddp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vaddv_f32(a: float32x2_t) -> f32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.faddv.f32.v2f32")]
+ fn vaddv_f32_(a: float32x2_t) -> f32;
+ }
+ vaddv_f32_(a)
+}
+
+/// Floating-point add across vector
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(faddp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vaddvq_f32(a: float32x4_t) -> f32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.faddv.f32.v4f32")]
+ fn vaddvq_f32_(a: float32x4_t) -> f32;
+ }
+ vaddvq_f32_(a)
+}
+
+/// Floating-point add across vector
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(faddp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vaddvq_f64(a: float64x2_t) -> f64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.faddv.f64.v2f64")]
+ fn vaddvq_f64_(a: float64x2_t) -> f64;
+ }
+ vaddvq_f64_(a)
+}
+
+/// Signed Add Long across Vector
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(saddlv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vaddlv_s16(a: int16x4_t) -> i32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.saddlv.i32.v4i16")]
+ fn vaddlv_s16_(a: int16x4_t) -> i32;
+ }
+ vaddlv_s16_(a)
+}
+
+/// Signed Add Long across Vector
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(saddlv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vaddlvq_s16(a: int16x8_t) -> i32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.saddlv.i32.v8i16")]
+ fn vaddlvq_s16_(a: int16x8_t) -> i32;
+ }
+ vaddlvq_s16_(a)
+}
+
+/// Signed Add Long across Vector
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(saddlp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vaddlv_s32(a: int32x2_t) -> i64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.saddlv.i64.v2i32")]
+ fn vaddlv_s32_(a: int32x2_t) -> i64;
+ }
+ vaddlv_s32_(a)
+}
+
+/// Signed Add Long across Vector
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(saddlv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vaddlvq_s32(a: int32x4_t) -> i64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.saddlv.i64.v4i32")]
+ fn vaddlvq_s32_(a: int32x4_t) -> i64;
+ }
+ vaddlvq_s32_(a)
+}
+
+/// Unsigned Add Long across Vector
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uaddlv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vaddlv_u16(a: uint16x4_t) -> u32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uaddlv.i32.v4i16")]
+ fn vaddlv_u16_(a: uint16x4_t) -> u32;
+ }
+ vaddlv_u16_(a)
+}
+
+/// Unsigned Add Long across Vector
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uaddlv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vaddlvq_u16(a: uint16x8_t) -> u32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uaddlv.i32.v8i16")]
+ fn vaddlvq_u16_(a: uint16x8_t) -> u32;
+ }
+ vaddlvq_u16_(a)
+}
+
+/// Unsigned Add Long across Vector
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uaddlp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vaddlv_u32(a: uint32x2_t) -> u64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uaddlv.i64.v2i32")]
+ fn vaddlv_u32_(a: uint32x2_t) -> u64;
+ }
+ vaddlv_u32_(a)
+}
+
+/// Unsigned Add Long across Vector
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uaddlv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vaddlvq_u32(a: uint32x4_t) -> u64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uaddlv.i64.v4i32")]
+ fn vaddlvq_u32_(a: uint32x4_t) -> u64;
+ }
+ vaddlvq_u32_(a)
+}
+
+/// Signed Subtract Wide
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ssubw))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsubw_high_s8(a: int16x8_t, b: int8x16_t) -> int16x8_t {
+ let c: int8x8_t = simd_shuffle8!(b, b, [8, 9, 10, 11, 12, 13, 14, 15]);
+ simd_sub(a, simd_cast(c))
+}
+
+/// Signed Subtract Wide
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ssubw))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsubw_high_s16(a: int32x4_t, b: int16x8_t) -> int32x4_t {
+ let c: int16x4_t = simd_shuffle4!(b, b, [4, 5, 6, 7]);
+ simd_sub(a, simd_cast(c))
+}
+
+/// Signed Subtract Wide
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ssubw))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsubw_high_s32(a: int64x2_t, b: int32x4_t) -> int64x2_t {
+ let c: int32x2_t = simd_shuffle2!(b, b, [2, 3]);
+ simd_sub(a, simd_cast(c))
+}
+
+/// Unsigned Subtract Wide
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(usubw))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsubw_high_u8(a: uint16x8_t, b: uint8x16_t) -> uint16x8_t {
+ let c: uint8x8_t = simd_shuffle8!(b, b, [8, 9, 10, 11, 12, 13, 14, 15]);
+ simd_sub(a, simd_cast(c))
+}
+
+/// Unsigned Subtract Wide
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(usubw))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsubw_high_u16(a: uint32x4_t, b: uint16x8_t) -> uint32x4_t {
+ let c: uint16x4_t = simd_shuffle4!(b, b, [4, 5, 6, 7]);
+ simd_sub(a, simd_cast(c))
+}
+
+/// Unsigned Subtract Wide
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(usubw))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsubw_high_u32(a: uint64x2_t, b: uint32x4_t) -> uint64x2_t {
+ let c: uint32x2_t = simd_shuffle2!(b, b, [2, 3]);
+ simd_sub(a, simd_cast(c))
+}
+
+/// Signed Subtract Long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ssubl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsubl_high_s8(a: int8x16_t, b: int8x16_t) -> int16x8_t {
+ let c: int8x8_t = simd_shuffle8!(a, a, [8, 9, 10, 11, 12, 13, 14, 15]);
+ let d: int16x8_t = simd_cast(c);
+ let e: int8x8_t = simd_shuffle8!(b, b, [8, 9, 10, 11, 12, 13, 14, 15]);
+ let f: int16x8_t = simd_cast(e);
+ simd_sub(d, f)
+}
+
+/// Signed Subtract Long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ssubl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsubl_high_s16(a: int16x8_t, b: int16x8_t) -> int32x4_t {
+ let c: int16x4_t = simd_shuffle4!(a, a, [4, 5, 6, 7]);
+ let d: int32x4_t = simd_cast(c);
+ let e: int16x4_t = simd_shuffle4!(b, b, [4, 5, 6, 7]);
+ let f: int32x4_t = simd_cast(e);
+ simd_sub(d, f)
+}
+
+/// Signed Subtract Long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ssubl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsubl_high_s32(a: int32x4_t, b: int32x4_t) -> int64x2_t {
+ let c: int32x2_t = simd_shuffle2!(a, a, [2, 3]);
+ let d: int64x2_t = simd_cast(c);
+ let e: int32x2_t = simd_shuffle2!(b, b, [2, 3]);
+ let f: int64x2_t = simd_cast(e);
+ simd_sub(d, f)
+}
+
+/// Unsigned Subtract Long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(usubl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsubl_high_u8(a: uint8x16_t, b: uint8x16_t) -> uint16x8_t {
+ let c: uint8x8_t = simd_shuffle8!(a, a, [8, 9, 10, 11, 12, 13, 14, 15]);
+ let d: uint16x8_t = simd_cast(c);
+ let e: uint8x8_t = simd_shuffle8!(b, b, [8, 9, 10, 11, 12, 13, 14, 15]);
+ let f: uint16x8_t = simd_cast(e);
+ simd_sub(d, f)
+}
+
+/// Unsigned Subtract Long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(usubl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsubl_high_u16(a: uint16x8_t, b: uint16x8_t) -> uint32x4_t {
+ let c: uint16x4_t = simd_shuffle4!(a, a, [4, 5, 6, 7]);
+ let d: uint32x4_t = simd_cast(c);
+ let e: uint16x4_t = simd_shuffle4!(b, b, [4, 5, 6, 7]);
+ let f: uint32x4_t = simd_cast(e);
+ simd_sub(d, f)
+}
+
+/// Unsigned Subtract Long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(usubl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsubl_high_u32(a: uint32x4_t, b: uint32x4_t) -> uint64x2_t {
+ let c: uint32x2_t = simd_shuffle2!(a, a, [2, 3]);
+ let d: uint64x2_t = simd_cast(c);
+ let e: uint32x2_t = simd_shuffle2!(b, b, [2, 3]);
+ let f: uint64x2_t = simd_cast(e);
+ simd_sub(d, f)
+}
+
+/// Bit clear and exclusive OR
+#[inline]
+#[target_feature(enable = "neon,sha3")]
+#[cfg_attr(test, assert_instr(bcax))]
+pub unsafe fn vbcaxq_s8(a: int8x16_t, b: int8x16_t, c: int8x16_t) -> int8x16_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.bcaxs.v16i8")]
+ fn vbcaxq_s8_(a: int8x16_t, b: int8x16_t, c: int8x16_t) -> int8x16_t;
+ }
+ vbcaxq_s8_(a, b, c)
+}
+
+/// Bit clear and exclusive OR
+#[inline]
+#[target_feature(enable = "neon,sha3")]
+#[cfg_attr(test, assert_instr(bcax))]
+pub unsafe fn vbcaxq_s16(a: int16x8_t, b: int16x8_t, c: int16x8_t) -> int16x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.bcaxs.v8i16")]
+ fn vbcaxq_s16_(a: int16x8_t, b: int16x8_t, c: int16x8_t) -> int16x8_t;
+ }
+ vbcaxq_s16_(a, b, c)
+}
+
+/// Bit clear and exclusive OR
+#[inline]
+#[target_feature(enable = "neon,sha3")]
+#[cfg_attr(test, assert_instr(bcax))]
+pub unsafe fn vbcaxq_s32(a: int32x4_t, b: int32x4_t, c: int32x4_t) -> int32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.bcaxs.v4i32")]
+ fn vbcaxq_s32_(a: int32x4_t, b: int32x4_t, c: int32x4_t) -> int32x4_t;
+ }
+ vbcaxq_s32_(a, b, c)
+}
+
+/// Bit clear and exclusive OR
+#[inline]
+#[target_feature(enable = "neon,sha3")]
+#[cfg_attr(test, assert_instr(bcax))]
+pub unsafe fn vbcaxq_s64(a: int64x2_t, b: int64x2_t, c: int64x2_t) -> int64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.bcaxs.v2i64")]
+ fn vbcaxq_s64_(a: int64x2_t, b: int64x2_t, c: int64x2_t) -> int64x2_t;
+ }
+ vbcaxq_s64_(a, b, c)
+}
+
+/// Bit clear and exclusive OR
+#[inline]
+#[target_feature(enable = "neon,sha3")]
+#[cfg_attr(test, assert_instr(bcax))]
+pub unsafe fn vbcaxq_u8(a: uint8x16_t, b: uint8x16_t, c: uint8x16_t) -> uint8x16_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.bcaxu.v16i8")]
+ fn vbcaxq_u8_(a: uint8x16_t, b: uint8x16_t, c: uint8x16_t) -> uint8x16_t;
+ }
+ vbcaxq_u8_(a, b, c)
+}
+
+/// Bit clear and exclusive OR
+#[inline]
+#[target_feature(enable = "neon,sha3")]
+#[cfg_attr(test, assert_instr(bcax))]
+pub unsafe fn vbcaxq_u16(a: uint16x8_t, b: uint16x8_t, c: uint16x8_t) -> uint16x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.bcaxu.v8i16")]
+ fn vbcaxq_u16_(a: uint16x8_t, b: uint16x8_t, c: uint16x8_t) -> uint16x8_t;
+ }
+ vbcaxq_u16_(a, b, c)
+}
+
+/// Bit clear and exclusive OR
+#[inline]
+#[target_feature(enable = "neon,sha3")]
+#[cfg_attr(test, assert_instr(bcax))]
+pub unsafe fn vbcaxq_u32(a: uint32x4_t, b: uint32x4_t, c: uint32x4_t) -> uint32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.bcaxu.v4i32")]
+ fn vbcaxq_u32_(a: uint32x4_t, b: uint32x4_t, c: uint32x4_t) -> uint32x4_t;
+ }
+ vbcaxq_u32_(a, b, c)
+}
+
+/// Bit clear and exclusive OR
+#[inline]
+#[target_feature(enable = "neon,sha3")]
+#[cfg_attr(test, assert_instr(bcax))]
+pub unsafe fn vbcaxq_u64(a: uint64x2_t, b: uint64x2_t, c: uint64x2_t) -> uint64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.bcaxu.v2i64")]
+ fn vbcaxq_u64_(a: uint64x2_t, b: uint64x2_t, c: uint64x2_t) -> uint64x2_t;
+ }
+ vbcaxq_u64_(a, b, c)
+}
+
+/// Floating-point complex add
+#[inline]
+#[target_feature(enable = "neon,fcma")]
+#[cfg_attr(test, assert_instr(fcadd))]
+pub unsafe fn vcadd_rot270_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.vcadd.rot270.v2f32")]
+ fn vcadd_rot270_f32_(a: float32x2_t, b: float32x2_t) -> float32x2_t;
+ }
+ vcadd_rot270_f32_(a, b)
+}
+
+/// Floating-point complex add
+#[inline]
+#[target_feature(enable = "neon,fcma")]
+#[cfg_attr(test, assert_instr(fcadd))]
+pub unsafe fn vcaddq_rot270_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.vcadd.rot270.v4f32")]
+ fn vcaddq_rot270_f32_(a: float32x4_t, b: float32x4_t) -> float32x4_t;
+ }
+ vcaddq_rot270_f32_(a, b)
+}
+
+/// Floating-point complex add
+#[inline]
+#[target_feature(enable = "neon,fcma")]
+#[cfg_attr(test, assert_instr(fcadd))]
+pub unsafe fn vcaddq_rot270_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.vcadd.rot270.v2f64")]
+ fn vcaddq_rot270_f64_(a: float64x2_t, b: float64x2_t) -> float64x2_t;
+ }
+ vcaddq_rot270_f64_(a, b)
+}
+
+/// Floating-point complex add
+#[inline]
+#[target_feature(enable = "neon,fcma")]
+#[cfg_attr(test, assert_instr(fcadd))]
+pub unsafe fn vcadd_rot90_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.vcadd.rot90.v2f32")]
+ fn vcadd_rot90_f32_(a: float32x2_t, b: float32x2_t) -> float32x2_t;
+ }
+ vcadd_rot90_f32_(a, b)
+}
+
+/// Floating-point complex add
+#[inline]
+#[target_feature(enable = "neon,fcma")]
+#[cfg_attr(test, assert_instr(fcadd))]
+pub unsafe fn vcaddq_rot90_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.vcadd.rot90.v4f32")]
+ fn vcaddq_rot90_f32_(a: float32x4_t, b: float32x4_t) -> float32x4_t;
+ }
+ vcaddq_rot90_f32_(a, b)
+}
+
+/// Floating-point complex add
+#[inline]
+#[target_feature(enable = "neon,fcma")]
+#[cfg_attr(test, assert_instr(fcadd))]
+pub unsafe fn vcaddq_rot90_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.vcadd.rot90.v2f64")]
+ fn vcaddq_rot90_f64_(a: float64x2_t, b: float64x2_t) -> float64x2_t;
+ }
+ vcaddq_rot90_f64_(a, b)
+}
+
+/// Floating-point complex multiply accumulate
+#[inline]
+#[target_feature(enable = "neon,fcma")]
+#[cfg_attr(test, assert_instr(fcmla))]
+pub unsafe fn vcmla_f32(a: float32x2_t, b: float32x2_t, c: float32x2_t) -> float32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.vcmla.rot0.v2f32")]
+ fn vcmla_f32_(a: float32x2_t, b: float32x2_t, c: float32x2_t) -> float32x2_t;
+ }
+ vcmla_f32_(a, b, c)
+}
+
+/// Floating-point complex multiply accumulate
+#[inline]
+#[target_feature(enable = "neon,fcma")]
+#[cfg_attr(test, assert_instr(fcmla))]
+pub unsafe fn vcmlaq_f32(a: float32x4_t, b: float32x4_t, c: float32x4_t) -> float32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.vcmla.rot0.v4f32")]
+ fn vcmlaq_f32_(a: float32x4_t, b: float32x4_t, c: float32x4_t) -> float32x4_t;
+ }
+ vcmlaq_f32_(a, b, c)
+}
+
+/// Floating-point complex multiply accumulate
+#[inline]
+#[target_feature(enable = "neon,fcma")]
+#[cfg_attr(test, assert_instr(fcmla))]
+pub unsafe fn vcmlaq_f64(a: float64x2_t, b: float64x2_t, c: float64x2_t) -> float64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.vcmla.rot0.v2f64")]
+ fn vcmlaq_f64_(a: float64x2_t, b: float64x2_t, c: float64x2_t) -> float64x2_t;
+ }
+ vcmlaq_f64_(a, b, c)
+}
+
+/// Floating-point complex multiply accumulate
+#[inline]
+#[target_feature(enable = "neon,fcma")]
+#[cfg_attr(test, assert_instr(fcmla))]
+pub unsafe fn vcmla_rot90_f32(a: float32x2_t, b: float32x2_t, c: float32x2_t) -> float32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.vcmla.rot90.v2f32")]
+ fn vcmla_rot90_f32_(a: float32x2_t, b: float32x2_t, c: float32x2_t) -> float32x2_t;
+ }
+ vcmla_rot90_f32_(a, b, c)
+}
+
+/// Floating-point complex multiply accumulate
+#[inline]
+#[target_feature(enable = "neon,fcma")]
+#[cfg_attr(test, assert_instr(fcmla))]
+pub unsafe fn vcmlaq_rot90_f32(a: float32x4_t, b: float32x4_t, c: float32x4_t) -> float32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.vcmla.rot90.v4f32")]
+ fn vcmlaq_rot90_f32_(a: float32x4_t, b: float32x4_t, c: float32x4_t) -> float32x4_t;
+ }
+ vcmlaq_rot90_f32_(a, b, c)
+}
+
+/// Floating-point complex multiply accumulate
+#[inline]
+#[target_feature(enable = "neon,fcma")]
+#[cfg_attr(test, assert_instr(fcmla))]
+pub unsafe fn vcmlaq_rot90_f64(a: float64x2_t, b: float64x2_t, c: float64x2_t) -> float64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.vcmla.rot90.v2f64")]
+ fn vcmlaq_rot90_f64_(a: float64x2_t, b: float64x2_t, c: float64x2_t) -> float64x2_t;
+ }
+ vcmlaq_rot90_f64_(a, b, c)
+}
+
+/// Floating-point complex multiply accumulate
+#[inline]
+#[target_feature(enable = "neon,fcma")]
+#[cfg_attr(test, assert_instr(fcmla))]
+pub unsafe fn vcmla_rot180_f32(a: float32x2_t, b: float32x2_t, c: float32x2_t) -> float32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.vcmla.rot180.v2f32")]
+ fn vcmla_rot180_f32_(a: float32x2_t, b: float32x2_t, c: float32x2_t) -> float32x2_t;
+ }
+ vcmla_rot180_f32_(a, b, c)
+}
+
+/// Floating-point complex multiply accumulate
+#[inline]
+#[target_feature(enable = "neon,fcma")]
+#[cfg_attr(test, assert_instr(fcmla))]
+pub unsafe fn vcmlaq_rot180_f32(a: float32x4_t, b: float32x4_t, c: float32x4_t) -> float32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.vcmla.rot180.v4f32")]
+ fn vcmlaq_rot180_f32_(a: float32x4_t, b: float32x4_t, c: float32x4_t) -> float32x4_t;
+ }
+ vcmlaq_rot180_f32_(a, b, c)
+}
+
+/// Floating-point complex multiply accumulate
+#[inline]
+#[target_feature(enable = "neon,fcma")]
+#[cfg_attr(test, assert_instr(fcmla))]
+pub unsafe fn vcmlaq_rot180_f64(a: float64x2_t, b: float64x2_t, c: float64x2_t) -> float64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.vcmla.rot180.v2f64")]
+ fn vcmlaq_rot180_f64_(a: float64x2_t, b: float64x2_t, c: float64x2_t) -> float64x2_t;
+ }
+ vcmlaq_rot180_f64_(a, b, c)
+}
+
+/// Floating-point complex multiply accumulate
+#[inline]
+#[target_feature(enable = "neon,fcma")]
+#[cfg_attr(test, assert_instr(fcmla))]
+pub unsafe fn vcmla_rot270_f32(a: float32x2_t, b: float32x2_t, c: float32x2_t) -> float32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.vcmla.rot270.v2f32")]
+ fn vcmla_rot270_f32_(a: float32x2_t, b: float32x2_t, c: float32x2_t) -> float32x2_t;
+ }
+ vcmla_rot270_f32_(a, b, c)
+}
+
+/// Floating-point complex multiply accumulate
+#[inline]
+#[target_feature(enable = "neon,fcma")]
+#[cfg_attr(test, assert_instr(fcmla))]
+pub unsafe fn vcmlaq_rot270_f32(a: float32x4_t, b: float32x4_t, c: float32x4_t) -> float32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.vcmla.rot270.v4f32")]
+ fn vcmlaq_rot270_f32_(a: float32x4_t, b: float32x4_t, c: float32x4_t) -> float32x4_t;
+ }
+ vcmlaq_rot270_f32_(a, b, c)
+}
+
+/// Floating-point complex multiply accumulate
+#[inline]
+#[target_feature(enable = "neon,fcma")]
+#[cfg_attr(test, assert_instr(fcmla))]
+pub unsafe fn vcmlaq_rot270_f64(a: float64x2_t, b: float64x2_t, c: float64x2_t) -> float64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.vcmla.rot270.v2f64")]
+ fn vcmlaq_rot270_f64_(a: float64x2_t, b: float64x2_t, c: float64x2_t) -> float64x2_t;
+ }
+ vcmlaq_rot270_f64_(a, b, c)
+}
+
+/// Floating-point complex multiply accumulate
+#[inline]
+#[target_feature(enable = "neon,fcma")]
+#[cfg_attr(test, assert_instr(fcmla, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn vcmla_lane_f32<const LANE: i32>(a: float32x2_t, b: float32x2_t, c: float32x2_t) -> float32x2_t {
+ static_assert!(LANE : i32 where LANE == 0);
+ let c: float32x2_t = simd_shuffle2!(c, c, <const LANE: i32> [2 * LANE as u32, 2 * LANE as u32 + 1]);
+ vcmla_f32(a, b, c)
+}
+
+/// Floating-point complex multiply accumulate
+#[inline]
+#[target_feature(enable = "neon,fcma")]
+#[cfg_attr(test, assert_instr(fcmla, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn vcmla_laneq_f32<const LANE: i32>(a: float32x2_t, b: float32x2_t, c: float32x4_t) -> float32x2_t {
+ static_assert_imm1!(LANE);
+ let c: float32x2_t = simd_shuffle2!(c, c, <const LANE: i32> [2 * LANE as u32, 2 * LANE as u32 + 1]);
+ vcmla_f32(a, b, c)
+}
+
+/// Floating-point complex multiply accumulate
+#[inline]
+#[target_feature(enable = "neon,fcma")]
+#[cfg_attr(test, assert_instr(fcmla, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn vcmlaq_lane_f32<const LANE: i32>(a: float32x4_t, b: float32x4_t, c: float32x2_t) -> float32x4_t {
+ static_assert!(LANE : i32 where LANE == 0);
+ let c: float32x4_t = simd_shuffle4!(c, c, <const LANE: i32> [2 * LANE as u32, 2 * LANE as u32 + 1, 2 * LANE as u32, 2 * LANE as u32 + 1]);
+ vcmlaq_f32(a, b, c)
+}
+
+/// Floating-point complex multiply accumulate
+#[inline]
+#[target_feature(enable = "neon,fcma")]
+#[cfg_attr(test, assert_instr(fcmla, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn vcmlaq_laneq_f32<const LANE: i32>(a: float32x4_t, b: float32x4_t, c: float32x4_t) -> float32x4_t {
+ static_assert_imm1!(LANE);
+ let c: float32x4_t = simd_shuffle4!(c, c, <const LANE: i32> [2 * LANE as u32, 2 * LANE as u32 + 1, 2 * LANE as u32, 2 * LANE as u32 + 1]);
+ vcmlaq_f32(a, b, c)
+}
+
+/// Floating-point complex multiply accumulate
+#[inline]
+#[target_feature(enable = "neon,fcma")]
+#[cfg_attr(test, assert_instr(fcmla, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn vcmla_rot90_lane_f32<const LANE: i32>(a: float32x2_t, b: float32x2_t, c: float32x2_t) -> float32x2_t {
+ static_assert!(LANE : i32 where LANE == 0);
+ let c: float32x2_t = simd_shuffle2!(c, c, <const LANE: i32> [2 * LANE as u32, 2 * LANE as u32 + 1]);
+ vcmla_rot90_f32(a, b, c)
+}
+
+/// Floating-point complex multiply accumulate
+#[inline]
+#[target_feature(enable = "neon,fcma")]
+#[cfg_attr(test, assert_instr(fcmla, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn vcmla_rot90_laneq_f32<const LANE: i32>(a: float32x2_t, b: float32x2_t, c: float32x4_t) -> float32x2_t {
+ static_assert_imm1!(LANE);
+ let c: float32x2_t = simd_shuffle2!(c, c, <const LANE: i32> [2 * LANE as u32, 2 * LANE as u32 + 1]);
+ vcmla_rot90_f32(a, b, c)
+}
+
+/// Floating-point complex multiply accumulate
+#[inline]
+#[target_feature(enable = "neon,fcma")]
+#[cfg_attr(test, assert_instr(fcmla, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn vcmlaq_rot90_lane_f32<const LANE: i32>(a: float32x4_t, b: float32x4_t, c: float32x2_t) -> float32x4_t {
+ static_assert!(LANE : i32 where LANE == 0);
+ let c: float32x4_t = simd_shuffle4!(c, c, <const LANE: i32> [2 * LANE as u32, 2 * LANE as u32 + 1, 2 * LANE as u32, 2 * LANE as u32 + 1]);
+ vcmlaq_rot90_f32(a, b, c)
+}
+
+/// Floating-point complex multiply accumulate
+#[inline]
+#[target_feature(enable = "neon,fcma")]
+#[cfg_attr(test, assert_instr(fcmla, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn vcmlaq_rot90_laneq_f32<const LANE: i32>(a: float32x4_t, b: float32x4_t, c: float32x4_t) -> float32x4_t {
+ static_assert_imm1!(LANE);
+ let c: float32x4_t = simd_shuffle4!(c, c, <const LANE: i32> [2 * LANE as u32, 2 * LANE as u32 + 1, 2 * LANE as u32, 2 * LANE as u32 + 1]);
+ vcmlaq_rot90_f32(a, b, c)
+}
+
+/// Floating-point complex multiply accumulate
+#[inline]
+#[target_feature(enable = "neon,fcma")]
+#[cfg_attr(test, assert_instr(fcmla, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn vcmla_rot180_lane_f32<const LANE: i32>(a: float32x2_t, b: float32x2_t, c: float32x2_t) -> float32x2_t {
+ static_assert!(LANE : i32 where LANE == 0);
+ let c: float32x2_t = simd_shuffle2!(c, c, <const LANE: i32> [2 * LANE as u32, 2 * LANE as u32 + 1]);
+ vcmla_rot180_f32(a, b, c)
+}
+
+/// Floating-point complex multiply accumulate
+#[inline]
+#[target_feature(enable = "neon,fcma")]
+#[cfg_attr(test, assert_instr(fcmla, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn vcmla_rot180_laneq_f32<const LANE: i32>(a: float32x2_t, b: float32x2_t, c: float32x4_t) -> float32x2_t {
+ static_assert_imm1!(LANE);
+ let c: float32x2_t = simd_shuffle2!(c, c, <const LANE: i32> [2 * LANE as u32, 2 * LANE as u32 + 1]);
+ vcmla_rot180_f32(a, b, c)
+}
+
+/// Floating-point complex multiply accumulate
+#[inline]
+#[target_feature(enable = "neon,fcma")]
+#[cfg_attr(test, assert_instr(fcmla, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn vcmlaq_rot180_lane_f32<const LANE: i32>(a: float32x4_t, b: float32x4_t, c: float32x2_t) -> float32x4_t {
+ static_assert!(LANE : i32 where LANE == 0);
+ let c: float32x4_t = simd_shuffle4!(c, c, <const LANE: i32> [2 * LANE as u32, 2 * LANE as u32 + 1, 2 * LANE as u32, 2 * LANE as u32 + 1]);
+ vcmlaq_rot180_f32(a, b, c)
+}
+
+/// Floating-point complex multiply accumulate
+#[inline]
+#[target_feature(enable = "neon,fcma")]
+#[cfg_attr(test, assert_instr(fcmla, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn vcmlaq_rot180_laneq_f32<const LANE: i32>(a: float32x4_t, b: float32x4_t, c: float32x4_t) -> float32x4_t {
+ static_assert_imm1!(LANE);
+ let c: float32x4_t = simd_shuffle4!(c, c, <const LANE: i32> [2 * LANE as u32, 2 * LANE as u32 + 1, 2 * LANE as u32, 2 * LANE as u32 + 1]);
+ vcmlaq_rot180_f32(a, b, c)
+}
+
+/// Floating-point complex multiply accumulate
+#[inline]
+#[target_feature(enable = "neon,fcma")]
+#[cfg_attr(test, assert_instr(fcmla, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn vcmla_rot270_lane_f32<const LANE: i32>(a: float32x2_t, b: float32x2_t, c: float32x2_t) -> float32x2_t {
+ static_assert!(LANE : i32 where LANE == 0);
+ let c: float32x2_t = simd_shuffle2!(c, c, <const LANE: i32> [2 * LANE as u32, 2 * LANE as u32 + 1]);
+ vcmla_rot270_f32(a, b, c)
+}
+
+/// Floating-point complex multiply accumulate
+#[inline]
+#[target_feature(enable = "neon,fcma")]
+#[cfg_attr(test, assert_instr(fcmla, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn vcmla_rot270_laneq_f32<const LANE: i32>(a: float32x2_t, b: float32x2_t, c: float32x4_t) -> float32x2_t {
+ static_assert_imm1!(LANE);
+ let c: float32x2_t = simd_shuffle2!(c, c, <const LANE: i32> [2 * LANE as u32, 2 * LANE as u32 + 1]);
+ vcmla_rot270_f32(a, b, c)
+}
+
+/// Floating-point complex multiply accumulate
+#[inline]
+#[target_feature(enable = "neon,fcma")]
+#[cfg_attr(test, assert_instr(fcmla, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn vcmlaq_rot270_lane_f32<const LANE: i32>(a: float32x4_t, b: float32x4_t, c: float32x2_t) -> float32x4_t {
+ static_assert!(LANE : i32 where LANE == 0);
+ let c: float32x4_t = simd_shuffle4!(c, c, <const LANE: i32> [2 * LANE as u32, 2 * LANE as u32 + 1, 2 * LANE as u32, 2 * LANE as u32 + 1]);
+ vcmlaq_rot270_f32(a, b, c)
+}
+
+/// Floating-point complex multiply accumulate
+#[inline]
+#[target_feature(enable = "neon,fcma")]
+#[cfg_attr(test, assert_instr(fcmla, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn vcmlaq_rot270_laneq_f32<const LANE: i32>(a: float32x4_t, b: float32x4_t, c: float32x4_t) -> float32x4_t {
+ static_assert_imm1!(LANE);
+ let c: float32x4_t = simd_shuffle4!(c, c, <const LANE: i32> [2 * LANE as u32, 2 * LANE as u32 + 1, 2 * LANE as u32, 2 * LANE as u32 + 1]);
+ vcmlaq_rot270_f32(a, b, c)
+}
+
+/// Dot product arithmetic
+#[inline]
+#[target_feature(enable = "neon,dotprod")]
+#[cfg_attr(test, assert_instr(sdot))]
+pub unsafe fn vdot_s32(a: int32x2_t, b: int8x8_t, c: int8x8_t) -> int32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sdot.v2i32.v8i8")]
+ fn vdot_s32_(a: int32x2_t, b: int8x8_t, c: int8x8_t) -> int32x2_t;
+ }
+ vdot_s32_(a, b, c)
+}
+
+/// Dot product arithmetic
+#[inline]
+#[target_feature(enable = "neon,dotprod")]
+#[cfg_attr(test, assert_instr(sdot))]
+pub unsafe fn vdotq_s32(a: int32x4_t, b: int8x16_t, c: int8x16_t) -> int32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sdot.v4i32.v16i8")]
+ fn vdotq_s32_(a: int32x4_t, b: int8x16_t, c: int8x16_t) -> int32x4_t;
+ }
+ vdotq_s32_(a, b, c)
+}
+
+/// Dot product arithmetic
+#[inline]
+#[target_feature(enable = "neon,dotprod")]
+#[cfg_attr(test, assert_instr(udot))]
+pub unsafe fn vdot_u32(a: uint32x2_t, b: uint8x8_t, c: uint8x8_t) -> uint32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.udot.v2i32.v8i8")]
+ fn vdot_u32_(a: uint32x2_t, b: uint8x8_t, c: uint8x8_t) -> uint32x2_t;
+ }
+ vdot_u32_(a, b, c)
+}
+
+/// Dot product arithmetic
+#[inline]
+#[target_feature(enable = "neon,dotprod")]
+#[cfg_attr(test, assert_instr(udot))]
+pub unsafe fn vdotq_u32(a: uint32x4_t, b: uint8x16_t, c: uint8x16_t) -> uint32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.udot.v4i32.v16i8")]
+ fn vdotq_u32_(a: uint32x4_t, b: uint8x16_t, c: uint8x16_t) -> uint32x4_t;
+ }
+ vdotq_u32_(a, b, c)
+}
+
+/// Dot product arithmetic
+#[inline]
+#[target_feature(enable = "neon,dotprod")]
+#[cfg_attr(test, assert_instr(sdot, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn vdot_lane_s32<const LANE: i32>(a: int32x2_t, b: int8x8_t, c: int8x8_t) -> int32x2_t {
+ static_assert_imm1!(LANE);
+ let c: int8x8_t = simd_shuffle8!(c, c, <const LANE: i32> [4 * LANE as u32, 4 * LANE as u32 + 1, 4 * LANE as u32 + 2, 4 * LANE as u32 + 3, 4 * LANE as u32, 4 * LANE as u32 + 1, 4 * LANE as u32 + 2, 4 * LANE as u32 + 3]);
+ vdot_s32(a, b, c)
+}
+
+/// Dot product arithmetic
+#[inline]
+#[target_feature(enable = "neon,dotprod")]
+#[cfg_attr(test, assert_instr(sdot, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn vdot_laneq_s32<const LANE: i32>(a: int32x2_t, b: int8x8_t, c: int8x16_t) -> int32x2_t {
+ static_assert_imm2!(LANE);
+ let c: int8x8_t = simd_shuffle8!(c, c, <const LANE: i32> [4 * LANE as u32, 4 * LANE as u32 + 1, 4 * LANE as u32 + 2, 4 * LANE as u32 + 3, 4 * LANE as u32, 4 * LANE as u32 + 1, 4 * LANE as u32 + 2, 4 * LANE as u32 + 3]);
+ vdot_s32(a, b, c)
+}
+
+/// Dot product arithmetic
+#[inline]
+#[target_feature(enable = "neon,dotprod")]
+#[cfg_attr(test, assert_instr(sdot, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn vdotq_lane_s32<const LANE: i32>(a: int32x4_t, b: int8x16_t, c: int8x8_t) -> int32x4_t {
+ static_assert_imm1!(LANE);
+ let c: int8x16_t = simd_shuffle16!(c, c, <const LANE: i32> [4 * LANE as u32, 4 * LANE as u32 + 1, 4 * LANE as u32 + 2, 4 * LANE as u32 + 3, 4 * LANE as u32, 4 * LANE as u32 + 1, 4 * LANE as u32 + 2, 4 * LANE as u32 + 3, 4 * LANE as u32, 4 * LANE as u32 + 1, 4 * LANE as u32 + 2, 4 * LANE as u32 + 3, 4 * LANE as u32, 4 * LANE as u32 + 1, 4 * LANE as u32 + 2, 4 * LANE as u32 + 3]);
+ vdotq_s32(a, b, c)
+}
+
+/// Dot product arithmetic
+#[inline]
+#[target_feature(enable = "neon,dotprod")]
+#[cfg_attr(test, assert_instr(sdot, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn vdotq_laneq_s32<const LANE: i32>(a: int32x4_t, b: int8x16_t, c: int8x16_t) -> int32x4_t {
+ static_assert_imm2!(LANE);
+ let c: int8x16_t = simd_shuffle16!(c, c, <const LANE: i32> [4 * LANE as u32, 4 * LANE as u32 + 1, 4 * LANE as u32 + 2, 4 * LANE as u32 + 3, 4 * LANE as u32, 4 * LANE as u32 + 1, 4 * LANE as u32 + 2, 4 * LANE as u32 + 3, 4 * LANE as u32, 4 * LANE as u32 + 1, 4 * LANE as u32 + 2, 4 * LANE as u32 + 3, 4 * LANE as u32, 4 * LANE as u32 + 1, 4 * LANE as u32 + 2, 4 * LANE as u32 + 3]);
+ vdotq_s32(a, b, c)
+}
+
+/// Dot product arithmetic
+#[inline]
+#[target_feature(enable = "neon,dotprod")]
+#[cfg_attr(test, assert_instr(udot, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn vdot_lane_u32<const LANE: i32>(a: uint32x2_t, b: uint8x8_t, c: uint8x8_t) -> uint32x2_t {
+ static_assert_imm1!(LANE);
+ let c: uint8x8_t = simd_shuffle8!(c, c, <const LANE: i32> [4 * LANE as u32, 4 * LANE as u32 + 1, 4 * LANE as u32 + 2, 4 * LANE as u32 + 3, 4 * LANE as u32, 4 * LANE as u32 + 1, 4 * LANE as u32 + 2, 4 * LANE as u32 + 3]);
+ vdot_u32(a, b, c)
+}
+
+/// Dot product arithmetic
+#[inline]
+#[target_feature(enable = "neon,dotprod")]
+#[cfg_attr(test, assert_instr(udot, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn vdot_laneq_u32<const LANE: i32>(a: uint32x2_t, b: uint8x8_t, c: uint8x16_t) -> uint32x2_t {
+ static_assert_imm2!(LANE);
+ let c: uint8x8_t = simd_shuffle8!(c, c, <const LANE: i32> [4 * LANE as u32, 4 * LANE as u32 + 1, 4 * LANE as u32 + 2, 4 * LANE as u32 + 3, 4 * LANE as u32, 4 * LANE as u32 + 1, 4 * LANE as u32 + 2, 4 * LANE as u32 + 3]);
+ vdot_u32(a, b, c)
+}
+
+/// Dot product arithmetic
+#[inline]
+#[target_feature(enable = "neon,dotprod")]
+#[cfg_attr(test, assert_instr(udot, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn vdotq_lane_u32<const LANE: i32>(a: uint32x4_t, b: uint8x16_t, c: uint8x8_t) -> uint32x4_t {
+ static_assert_imm1!(LANE);
+ let c: uint8x16_t = simd_shuffle16!(c, c, <const LANE: i32> [4 * LANE as u32, 4 * LANE as u32 + 1, 4 * LANE as u32 + 2, 4 * LANE as u32 + 3, 4 * LANE as u32, 4 * LANE as u32 + 1, 4 * LANE as u32 + 2, 4 * LANE as u32 + 3, 4 * LANE as u32, 4 * LANE as u32 + 1, 4 * LANE as u32 + 2, 4 * LANE as u32 + 3, 4 * LANE as u32, 4 * LANE as u32 + 1, 4 * LANE as u32 + 2, 4 * LANE as u32 + 3]);
+ vdotq_u32(a, b, c)
+}
+
+/// Dot product arithmetic
+#[inline]
+#[target_feature(enable = "neon,dotprod")]
+#[cfg_attr(test, assert_instr(udot, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn vdotq_laneq_u32<const LANE: i32>(a: uint32x4_t, b: uint8x16_t, c: uint8x16_t) -> uint32x4_t {
+ static_assert_imm2!(LANE);
+ let c: uint8x16_t = simd_shuffle16!(c, c, <const LANE: i32> [4 * LANE as u32, 4 * LANE as u32 + 1, 4 * LANE as u32 + 2, 4 * LANE as u32 + 3, 4 * LANE as u32, 4 * LANE as u32 + 1, 4 * LANE as u32 + 2, 4 * LANE as u32 + 3, 4 * LANE as u32, 4 * LANE as u32 + 1, 4 * LANE as u32 + 2, 4 * LANE as u32 + 3, 4 * LANE as u32, 4 * LANE as u32 + 1, 4 * LANE as u32 + 2, 4 * LANE as u32 + 3]);
+ vdotq_u32(a, b, c)
+}
+
+/// Maximum (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmax))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmax_f64(a: float64x1_t, b: float64x1_t) -> float64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fmax.v1f64")]
+ fn vmax_f64_(a: float64x1_t, b: float64x1_t) -> float64x1_t;
+ }
+ vmax_f64_(a, b)
+}
+
+/// Maximum (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmax))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmaxq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fmax.v2f64")]
+ fn vmaxq_f64_(a: float64x2_t, b: float64x2_t) -> float64x2_t;
+ }
+ vmaxq_f64_(a, b)
+}
+
+/// Floating-point Maximum Number (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmaxnm))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmaxnm_f64(a: float64x1_t, b: float64x1_t) -> float64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fmaxnm.v1f64")]
+ fn vmaxnm_f64_(a: float64x1_t, b: float64x1_t) -> float64x1_t;
+ }
+ vmaxnm_f64_(a, b)
+}
+
+/// Floating-point Maximum Number (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmaxnm))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmaxnmq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fmaxnm.v2f64")]
+ fn vmaxnmq_f64_(a: float64x2_t, b: float64x2_t) -> float64x2_t;
+ }
+ vmaxnmq_f64_(a, b)
+}
+
+/// Floating-point maximum number across vector
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmaxnmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmaxnmv_f32(a: float32x2_t) -> f32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fmaxnmv.f32.v2f32")]
+ fn vmaxnmv_f32_(a: float32x2_t) -> f32;
+ }
+ vmaxnmv_f32_(a)
+}
+
+/// Floating-point maximum number across vector
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmaxnmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmaxnmvq_f64(a: float64x2_t) -> f64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fmaxnmv.f64.v2f64")]
+ fn vmaxnmvq_f64_(a: float64x2_t) -> f64;
+ }
+ vmaxnmvq_f64_(a)
+}
+
+/// Floating-point maximum number across vector
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmaxnmv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmaxnmvq_f32(a: float32x4_t) -> f32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fmaxnmv.f32.v4f32")]
+ fn vmaxnmvq_f32_(a: float32x4_t) -> f32;
+ }
+ vmaxnmvq_f32_(a)
+}
+
+/// Floating-point Maximum Number Pairwise (vector).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmaxnmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpmaxnm_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fmaxnmp.v2f32")]
+ fn vpmaxnm_f32_(a: float32x2_t, b: float32x2_t) -> float32x2_t;
+ }
+ vpmaxnm_f32_(a, b)
+}
+
+/// Floating-point Maximum Number Pairwise (vector).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmaxnmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpmaxnmq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fmaxnmp.v2f64")]
+ fn vpmaxnmq_f64_(a: float64x2_t, b: float64x2_t) -> float64x2_t;
+ }
+ vpmaxnmq_f64_(a, b)
+}
+
+/// Floating-point Maximum Number Pairwise (vector).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmaxnmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpmaxnmq_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fmaxnmp.v4f32")]
+ fn vpmaxnmq_f32_(a: float32x4_t, b: float32x4_t) -> float32x4_t;
+ }
+ vpmaxnmq_f32_(a, b)
+}
+
+/// Floating-point maximum number pairwise
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmaxnmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpmaxnms_f32(a: float32x2_t) -> f32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fmaxnmv.f32.v2f32")]
+ fn vpmaxnms_f32_(a: float32x2_t) -> f32;
+ }
+ vpmaxnms_f32_(a)
+}
+
+/// Floating-point maximum number pairwise
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmaxnmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpmaxnmqd_f64(a: float64x2_t) -> f64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fmaxnmv.f64.v2f64")]
+ fn vpmaxnmqd_f64_(a: float64x2_t) -> f64;
+ }
+ vpmaxnmqd_f64_(a)
+}
+
+/// Floating-point maximum pairwise
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmaxp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpmaxs_f32(a: float32x2_t) -> f32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fmaxv.f32.v2f32")]
+ fn vpmaxs_f32_(a: float32x2_t) -> f32;
+ }
+ vpmaxs_f32_(a)
+}
+
+/// Floating-point maximum pairwise
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmaxp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpmaxqd_f64(a: float64x2_t) -> f64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fmaxv.f64.v2f64")]
+ fn vpmaxqd_f64_(a: float64x2_t) -> f64;
+ }
+ vpmaxqd_f64_(a)
+}
+
+/// Minimum (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmin))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmin_f64(a: float64x1_t, b: float64x1_t) -> float64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fmin.v1f64")]
+ fn vmin_f64_(a: float64x1_t, b: float64x1_t) -> float64x1_t;
+ }
+ vmin_f64_(a, b)
+}
+
+/// Minimum (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmin))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vminq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fmin.v2f64")]
+ fn vminq_f64_(a: float64x2_t, b: float64x2_t) -> float64x2_t;
+ }
+ vminq_f64_(a, b)
+}
+
+/// Floating-point Minimum Number (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fminnm))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vminnm_f64(a: float64x1_t, b: float64x1_t) -> float64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fminnm.v1f64")]
+ fn vminnm_f64_(a: float64x1_t, b: float64x1_t) -> float64x1_t;
+ }
+ vminnm_f64_(a, b)
+}
+
+/// Floating-point Minimum Number (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fminnm))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vminnmq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fminnm.v2f64")]
+ fn vminnmq_f64_(a: float64x2_t, b: float64x2_t) -> float64x2_t;
+ }
+ vminnmq_f64_(a, b)
+}
+
+/// Floating-point minimum number across vector
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fminnmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vminnmv_f32(a: float32x2_t) -> f32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fminnmv.f32.v2f32")]
+ fn vminnmv_f32_(a: float32x2_t) -> f32;
+ }
+ vminnmv_f32_(a)
+}
+
+/// Floating-point minimum number across vector
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fminnmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vminnmvq_f64(a: float64x2_t) -> f64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fminnmv.f64.v2f64")]
+ fn vminnmvq_f64_(a: float64x2_t) -> f64;
+ }
+ vminnmvq_f64_(a)
+}
+
+/// Floating-point minimum number across vector
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fminnmv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vminnmvq_f32(a: float32x4_t) -> f32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fminnmv.f32.v4f32")]
+ fn vminnmvq_f32_(a: float32x4_t) -> f32;
+ }
+ vminnmvq_f32_(a)
+}
+
+/// Vector move
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sxtl2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmovl_high_s8(a: int8x16_t) -> int16x8_t {
+ let a: int8x8_t = simd_shuffle8!(a, a, [8, 9, 10, 11, 12, 13, 14, 15]);
+ vmovl_s8(a)
+}
+
+/// Vector move
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sxtl2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmovl_high_s16(a: int16x8_t) -> int32x4_t {
+ let a: int16x4_t = simd_shuffle4!(a, a, [4, 5, 6, 7]);
+ vmovl_s16(a)
+}
+
+/// Vector move
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sxtl2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmovl_high_s32(a: int32x4_t) -> int64x2_t {
+ let a: int32x2_t = simd_shuffle2!(a, a, [2, 3]);
+ vmovl_s32(a)
+}
+
+/// Vector move
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uxtl2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmovl_high_u8(a: uint8x16_t) -> uint16x8_t {
+ let a: uint8x8_t = simd_shuffle8!(a, a, [8, 9, 10, 11, 12, 13, 14, 15]);
+ vmovl_u8(a)
+}
+
+/// Vector move
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uxtl2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmovl_high_u16(a: uint16x8_t) -> uint32x4_t {
+ let a: uint16x4_t = simd_shuffle4!(a, a, [4, 5, 6, 7]);
+ vmovl_u16(a)
+}
+
+/// Vector move
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uxtl2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmovl_high_u32(a: uint32x4_t) -> uint64x2_t {
+ let a: uint32x2_t = simd_shuffle2!(a, a, [2, 3]);
+ vmovl_u32(a)
+}
+
+/// Floating-point add pairwise
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(faddp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpaddq_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.faddp.v4f32")]
+ fn vpaddq_f32_(a: float32x4_t, b: float32x4_t) -> float32x4_t;
+ }
+ vpaddq_f32_(a, b)
+}
+
+/// Floating-point add pairwise
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(faddp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpaddq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.faddp.v2f64")]
+ fn vpaddq_f64_(a: float64x2_t, b: float64x2_t) -> float64x2_t;
+ }
+ vpaddq_f64_(a, b)
+}
+
+/// Floating-point add pairwise
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpadds_f32(a: float32x2_t) -> f32 {
+ let a1: f32 = simd_extract(a, 0);
+ let a2: f32 = simd_extract(a, 1);
+ a1 + a2
+}
+
+/// Floating-point add pairwise
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpaddd_f64(a: float64x2_t) -> f64 {
+ let a1: f64 = simd_extract(a, 0);
+ let a2: f64 = simd_extract(a, 1);
+ a1 + a2
+}
+
+/// Floating-point Minimum Number Pairwise (vector).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fminnmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpminnm_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fminnmp.v2f32")]
+ fn vpminnm_f32_(a: float32x2_t, b: float32x2_t) -> float32x2_t;
+ }
+ vpminnm_f32_(a, b)
+}
+
+/// Floating-point Minimum Number Pairwise (vector).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fminnmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpminnmq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fminnmp.v2f64")]
+ fn vpminnmq_f64_(a: float64x2_t, b: float64x2_t) -> float64x2_t;
+ }
+ vpminnmq_f64_(a, b)
+}
+
+/// Floating-point Minimum Number Pairwise (vector).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fminnmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpminnmq_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fminnmp.v4f32")]
+ fn vpminnmq_f32_(a: float32x4_t, b: float32x4_t) -> float32x4_t;
+ }
+ vpminnmq_f32_(a, b)
+}
+
+/// Floating-point minimum number pairwise
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fminnmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpminnms_f32(a: float32x2_t) -> f32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fminnmv.f32.v2f32")]
+ fn vpminnms_f32_(a: float32x2_t) -> f32;
+ }
+ vpminnms_f32_(a)
+}
+
+/// Floating-point minimum number pairwise
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fminnmp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpminnmqd_f64(a: float64x2_t) -> f64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fminnmv.f64.v2f64")]
+ fn vpminnmqd_f64_(a: float64x2_t) -> f64;
+ }
+ vpminnmqd_f64_(a)
+}
+
+/// Floating-point minimum pairwise
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fminp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpmins_f32(a: float32x2_t) -> f32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fminv.f32.v2f32")]
+ fn vpmins_f32_(a: float32x2_t) -> f32;
+ }
+ vpmins_f32_(a)
+}
+
+/// Floating-point minimum pairwise
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fminp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpminqd_f64(a: float64x2_t) -> f64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fminv.f64.v2f64")]
+ fn vpminqd_f64_(a: float64x2_t) -> f64;
+ }
+ vpminqd_f64_(a)
+}
+
+/// Signed saturating doubling multiply long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmull))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmullh_s16(a: i16, b: i16) -> i32 {
+ let a: int16x4_t = vdup_n_s16(a);
+ let b: int16x4_t = vdup_n_s16(b);
+ simd_extract(vqdmull_s16(a, b), 0)
+}
+
+/// Signed saturating doubling multiply long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmull))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmulls_s32(a: i32, b: i32) -> i64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqdmulls.scalar")]
+ fn vqdmulls_s32_(a: i32, b: i32) -> i64;
+ }
+ vqdmulls_s32_(a, b)
+}
+
+/// Signed saturating doubling multiply long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmull2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmull_high_s16(a: int16x8_t, b: int16x8_t) -> int32x4_t {
+ let a: int16x4_t = simd_shuffle4!(a, a, [4, 5, 6, 7]);
+ let b: int16x4_t = simd_shuffle4!(b, b, [4, 5, 6, 7]);
+ vqdmull_s16(a, b)
+}
+
+/// Signed saturating doubling multiply long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmull2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmull_high_s32(a: int32x4_t, b: int32x4_t) -> int64x2_t {
+ let a: int32x2_t = simd_shuffle2!(a, a, [2, 3]);
+ let b: int32x2_t = simd_shuffle2!(b, b, [2, 3]);
+ vqdmull_s32(a, b)
+}
+
+/// Signed saturating doubling multiply long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmull2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmull_high_n_s16(a: int16x8_t, b: i16) -> int32x4_t {
+ let a: int16x4_t = simd_shuffle4!(a, a, [4, 5, 6, 7]);
+ let b: int16x4_t = vdup_n_s16(b);
+ vqdmull_s16(a, b)
+}
+
+/// Signed saturating doubling multiply long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmull2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmull_high_n_s32(a: int32x4_t, b: i32) -> int64x2_t {
+ let a: int32x2_t = simd_shuffle2!(a, a, [2, 3]);
+ let b: int32x2_t = vdup_n_s32(b);
+ vqdmull_s32(a, b)
+}
+
+/// Vector saturating doubling long multiply by scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmull, N = 4))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmull_laneq_s16<const N: i32>(a: int16x4_t, b: int16x8_t) -> int32x4_t {
+ static_assert_imm3!(N);
+ let b: int16x4_t = simd_shuffle4!(b, b, <const N: i32> [N as u32, N as u32, N as u32, N as u32]);
+ vqdmull_s16(a, b)
+}
+
+/// Vector saturating doubling long multiply by scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmull, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmull_laneq_s32<const N: i32>(a: int32x2_t, b: int32x4_t) -> int64x2_t {
+ static_assert_imm2!(N);
+ let b: int32x2_t = simd_shuffle2!(b, b, <const N: i32> [N as u32, N as u32]);
+ vqdmull_s32(a, b)
+}
+
+/// Signed saturating doubling multiply long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmull, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmullh_lane_s16<const N: i32>(a: i16, b: int16x4_t) -> i32 {
+ static_assert_imm2!(N);
+ let b: i16 = simd_extract(b, N as u32);
+ vqdmullh_s16(a, b)
+}
+
+/// Signed saturating doubling multiply long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmull, N = 4))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmullh_laneq_s16<const N: i32>(a: i16, b: int16x8_t) -> i32 {
+ static_assert_imm3!(N);
+ let b: i16 = simd_extract(b, N as u32);
+ vqdmullh_s16(a, b)
+}
+
+/// Signed saturating doubling multiply long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmull, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmulls_lane_s32<const N: i32>(a: i32, b: int32x2_t) -> i64 {
+ static_assert_imm1!(N);
+ let b: i32 = simd_extract(b, N as u32);
+ vqdmulls_s32(a, b)
+}
+
+/// Signed saturating doubling multiply long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmull, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmulls_laneq_s32<const N: i32>(a: i32, b: int32x4_t) -> i64 {
+ static_assert_imm2!(N);
+ let b: i32 = simd_extract(b, N as u32);
+ vqdmulls_s32(a, b)
+}
+
+/// Signed saturating doubling multiply long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmull2, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmull_high_lane_s16<const N: i32>(a: int16x8_t, b: int16x4_t) -> int32x4_t {
+ static_assert_imm2!(N);
+ let a: int16x4_t = simd_shuffle4!(a, a, [4, 5, 6, 7]);
+ let b: int16x4_t = simd_shuffle4!(b, b, <const N: i32> [N as u32, N as u32, N as u32, N as u32]);
+ vqdmull_s16(a, b)
+}
+
+/// Signed saturating doubling multiply long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmull2, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmull_high_lane_s32<const N: i32>(a: int32x4_t, b: int32x2_t) -> int64x2_t {
+ static_assert_imm1!(N);
+ let a: int32x2_t = simd_shuffle2!(a, a, [2, 3]);
+ let b: int32x2_t = simd_shuffle2!(b, b, <const N: i32> [N as u32, N as u32]);
+ vqdmull_s32(a, b)
+}
+
+/// Signed saturating doubling multiply long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmull2, N = 4))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmull_high_laneq_s16<const N: i32>(a: int16x8_t, b: int16x8_t) -> int32x4_t {
+ static_assert_imm3!(N);
+ let a: int16x4_t = simd_shuffle4!(a, a, [4, 5, 6, 7]);
+ let b: int16x4_t = simd_shuffle4!(b, b, <const N: i32> [N as u32, N as u32, N as u32, N as u32]);
+ vqdmull_s16(a, b)
+}
+
+/// Signed saturating doubling multiply long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmull2, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmull_high_laneq_s32<const N: i32>(a: int32x4_t, b: int32x4_t) -> int64x2_t {
+ static_assert_imm2!(N);
+ let a: int32x2_t = simd_shuffle2!(a, a, [2, 3]);
+ let b: int32x2_t = simd_shuffle2!(b, b, <const N: i32> [N as u32, N as u32]);
+ vqdmull_s32(a, b)
+}
+
+/// Signed saturating doubling multiply-add long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmlal2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmlal_high_s16(a: int32x4_t, b: int16x8_t, c: int16x8_t) -> int32x4_t {
+ vqaddq_s32(a, vqdmull_high_s16(b, c))
+}
+
+/// Signed saturating doubling multiply-add long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmlal2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmlal_high_s32(a: int64x2_t, b: int32x4_t, c: int32x4_t) -> int64x2_t {
+ vqaddq_s64(a, vqdmull_high_s32(b, c))
+}
+
+/// Signed saturating doubling multiply-add long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmlal2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmlal_high_n_s16(a: int32x4_t, b: int16x8_t, c: i16) -> int32x4_t {
+ vqaddq_s32(a, vqdmull_high_n_s16(b, c))
+}
+
+/// Signed saturating doubling multiply-add long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmlal2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmlal_high_n_s32(a: int64x2_t, b: int32x4_t, c: i32) -> int64x2_t {
+ vqaddq_s64(a, vqdmull_high_n_s32(b, c))
+}
+
+/// Vector widening saturating doubling multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmlal, N = 2))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmlal_laneq_s16<const N: i32>(a: int32x4_t, b: int16x4_t, c: int16x8_t) -> int32x4_t {
+ static_assert_imm3!(N);
+ vqaddq_s32(a, vqdmull_laneq_s16::<N>(b, c))
+}
+
+/// Vector widening saturating doubling multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmlal, N = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmlal_laneq_s32<const N: i32>(a: int64x2_t, b: int32x2_t, c: int32x4_t) -> int64x2_t {
+ static_assert_imm2!(N);
+ vqaddq_s64(a, vqdmull_laneq_s32::<N>(b, c))
+}
+
+/// Signed saturating doubling multiply-add long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmlal2, N = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmlal_high_lane_s16<const N: i32>(a: int32x4_t, b: int16x8_t, c: int16x4_t) -> int32x4_t {
+ static_assert_imm2!(N);
+ vqaddq_s32(a, vqdmull_high_lane_s16::<N>(b, c))
+}
+
+/// Signed saturating doubling multiply-add long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmlal2, N = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmlal_high_laneq_s16<const N: i32>(a: int32x4_t, b: int16x8_t, c: int16x8_t) -> int32x4_t {
+ static_assert_imm3!(N);
+ vqaddq_s32(a, vqdmull_high_laneq_s16::<N>(b, c))
+}
+
+/// Signed saturating doubling multiply-add long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmlal2, N = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmlal_high_lane_s32<const N: i32>(a: int64x2_t, b: int32x4_t, c: int32x2_t) -> int64x2_t {
+ static_assert_imm1!(N);
+ vqaddq_s64(a, vqdmull_high_lane_s32::<N>(b, c))
+}
+
+/// Signed saturating doubling multiply-add long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmlal2, N = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmlal_high_laneq_s32<const N: i32>(a: int64x2_t, b: int32x4_t, c: int32x4_t) -> int64x2_t {
+ static_assert_imm2!(N);
+ vqaddq_s64(a, vqdmull_high_laneq_s32::<N>(b, c))
+}
+
+/// Signed saturating doubling multiply-add long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmull))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmlalh_s16(a: i32, b: i16, c: i16) -> i32 {
+ let x: int32x4_t = vqdmull_s16(vdup_n_s16(b), vdup_n_s16(c));
+ vqadds_s32(a, simd_extract(x, 0))
+}
+
+/// Signed saturating doubling multiply-add long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmull))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmlals_s32(a: i64, b: i32, c: i32) -> i64 {
+ let x: int64x2_t = vqdmull_s32(vdup_n_s32(b), vdup_n_s32(c));
+ vqaddd_s64(a, simd_extract(x, 0))
+}
+
+/// Signed saturating doubling multiply-add long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmlal, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmlalh_lane_s16<const LANE: i32>(a: i32, b: i16, c: int16x4_t) -> i32 {
+ static_assert_imm2!(LANE);
+ vqdmlalh_s16(a, b, simd_extract(c, LANE as u32))
+}
+
+/// Signed saturating doubling multiply-add long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmlal, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmlalh_laneq_s16<const LANE: i32>(a: i32, b: i16, c: int16x8_t) -> i32 {
+ static_assert_imm3!(LANE);
+ vqdmlalh_s16(a, b, simd_extract(c, LANE as u32))
+}
+
+/// Signed saturating doubling multiply-add long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmull, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmlals_lane_s32<const LANE: i32>(a: i64, b: i32, c: int32x2_t) -> i64 {
+ static_assert_imm1!(LANE);
+ vqdmlals_s32(a, b, simd_extract(c, LANE as u32))
+}
+
+/// Signed saturating doubling multiply-add long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmull, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmlals_laneq_s32<const LANE: i32>(a: i64, b: i32, c: int32x4_t) -> i64 {
+ static_assert_imm2!(LANE);
+ vqdmlals_s32(a, b, simd_extract(c, LANE as u32))
+}
+
+/// Signed saturating doubling multiply-subtract long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmlsl2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmlsl_high_s16(a: int32x4_t, b: int16x8_t, c: int16x8_t) -> int32x4_t {
+ vqsubq_s32(a, vqdmull_high_s16(b, c))
+}
+
+/// Signed saturating doubling multiply-subtract long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmlsl2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmlsl_high_s32(a: int64x2_t, b: int32x4_t, c: int32x4_t) -> int64x2_t {
+ vqsubq_s64(a, vqdmull_high_s32(b, c))
+}
+
+/// Signed saturating doubling multiply-subtract long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmlsl2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmlsl_high_n_s16(a: int32x4_t, b: int16x8_t, c: i16) -> int32x4_t {
+ vqsubq_s32(a, vqdmull_high_n_s16(b, c))
+}
+
+/// Signed saturating doubling multiply-subtract long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmlsl2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmlsl_high_n_s32(a: int64x2_t, b: int32x4_t, c: i32) -> int64x2_t {
+ vqsubq_s64(a, vqdmull_high_n_s32(b, c))
+}
+
+/// Vector widening saturating doubling multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmlsl, N = 2))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmlsl_laneq_s16<const N: i32>(a: int32x4_t, b: int16x4_t, c: int16x8_t) -> int32x4_t {
+ static_assert_imm3!(N);
+ vqsubq_s32(a, vqdmull_laneq_s16::<N>(b, c))
+}
+
+/// Vector widening saturating doubling multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmlsl, N = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmlsl_laneq_s32<const N: i32>(a: int64x2_t, b: int32x2_t, c: int32x4_t) -> int64x2_t {
+ static_assert_imm2!(N);
+ vqsubq_s64(a, vqdmull_laneq_s32::<N>(b, c))
+}
+
+/// Signed saturating doubling multiply-subtract long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmlsl2, N = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmlsl_high_lane_s16<const N: i32>(a: int32x4_t, b: int16x8_t, c: int16x4_t) -> int32x4_t {
+ static_assert_imm2!(N);
+ vqsubq_s32(a, vqdmull_high_lane_s16::<N>(b, c))
+}
+
+/// Signed saturating doubling multiply-subtract long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmlsl2, N = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmlsl_high_laneq_s16<const N: i32>(a: int32x4_t, b: int16x8_t, c: int16x8_t) -> int32x4_t {
+ static_assert_imm3!(N);
+ vqsubq_s32(a, vqdmull_high_laneq_s16::<N>(b, c))
+}
+
+/// Signed saturating doubling multiply-subtract long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmlsl2, N = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmlsl_high_lane_s32<const N: i32>(a: int64x2_t, b: int32x4_t, c: int32x2_t) -> int64x2_t {
+ static_assert_imm1!(N);
+ vqsubq_s64(a, vqdmull_high_lane_s32::<N>(b, c))
+}
+
+/// Signed saturating doubling multiply-subtract long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmlsl2, N = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmlsl_high_laneq_s32<const N: i32>(a: int64x2_t, b: int32x4_t, c: int32x4_t) -> int64x2_t {
+ static_assert_imm2!(N);
+ vqsubq_s64(a, vqdmull_high_laneq_s32::<N>(b, c))
+}
+
+/// Signed saturating doubling multiply-subtract long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmull))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmlslh_s16(a: i32, b: i16, c: i16) -> i32 {
+ let x: int32x4_t = vqdmull_s16(vdup_n_s16(b), vdup_n_s16(c));
+ vqsubs_s32(a, simd_extract(x, 0))
+}
+
+/// Signed saturating doubling multiply-subtract long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmull))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmlsls_s32(a: i64, b: i32, c: i32) -> i64 {
+ let x: int64x2_t = vqdmull_s32(vdup_n_s32(b), vdup_n_s32(c));
+ vqsubd_s64(a, simd_extract(x, 0))
+}
+
+/// Signed saturating doubling multiply-subtract long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmlsl, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmlslh_lane_s16<const LANE: i32>(a: i32, b: i16, c: int16x4_t) -> i32 {
+ static_assert_imm2!(LANE);
+ vqdmlslh_s16(a, b, simd_extract(c, LANE as u32))
+}
+
+/// Signed saturating doubling multiply-subtract long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmlsl, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmlslh_laneq_s16<const LANE: i32>(a: i32, b: i16, c: int16x8_t) -> i32 {
+ static_assert_imm3!(LANE);
+ vqdmlslh_s16(a, b, simd_extract(c, LANE as u32))
+}
+
+/// Signed saturating doubling multiply-subtract long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmull, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmlsls_lane_s32<const LANE: i32>(a: i64, b: i32, c: int32x2_t) -> i64 {
+ static_assert_imm1!(LANE);
+ vqdmlsls_s32(a, b, simd_extract(c, LANE as u32))
+}
+
+/// Signed saturating doubling multiply-subtract long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmull, LANE = 0))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmlsls_laneq_s32<const LANE: i32>(a: i64, b: i32, c: int32x4_t) -> i64 {
+ static_assert_imm2!(LANE);
+ vqdmlsls_s32(a, b, simd_extract(c, LANE as u32))
+}
+
+/// Signed saturating doubling multiply returning high half
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmulh))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmulhh_s16(a: i16, b: i16) -> i16 {
+ let a: int16x4_t = vdup_n_s16(a);
+ let b: int16x4_t = vdup_n_s16(b);
+ simd_extract(vqdmulh_s16(a, b), 0)
+}
+
+/// Signed saturating doubling multiply returning high half
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmulh))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmulhs_s32(a: i32, b: i32) -> i32 {
+ let a: int32x2_t = vdup_n_s32(a);
+ let b: int32x2_t = vdup_n_s32(b);
+ simd_extract(vqdmulh_s32(a, b), 0)
+}
+
+/// Signed saturating doubling multiply returning high half
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmulh, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmulhh_lane_s16<const N: i32>(a: i16, b: int16x4_t) -> i16 {
+ static_assert_imm2!(N);
+ let b: i16 = simd_extract(b, N as u32);
+ vqdmulhh_s16(a, b)
+}
+
+/// Signed saturating doubling multiply returning high half
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmulh, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmulhh_laneq_s16<const N: i32>(a: i16, b: int16x8_t) -> i16 {
+ static_assert_imm3!(N);
+ let b: i16 = simd_extract(b, N as u32);
+ vqdmulhh_s16(a, b)
+}
+
+/// Signed saturating doubling multiply returning high half
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmulh, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmulhs_lane_s32<const N: i32>(a: i32, b: int32x2_t) -> i32 {
+ static_assert_imm1!(N);
+ let b: i32 = simd_extract(b, N as u32);
+ vqdmulhs_s32(a, b)
+}
+
+/// Signed saturating doubling multiply returning high half
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmulh, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmulhs_laneq_s32<const N: i32>(a: i32, b: int32x4_t) -> i32 {
+ static_assert_imm2!(N);
+ let b: i32 = simd_extract(b, N as u32);
+ vqdmulhs_s32(a, b)
+}
+
+/// Vector saturating doubling multiply high by scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmulh, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmulh_lane_s16<const LANE: i32>(a: int16x4_t, b: int16x4_t) -> int16x4_t {
+ static_assert_imm2!(LANE);
+ vqdmulh_s16(a, vdup_n_s16(simd_extract(b, LANE as u32)))
+}
+
+/// Vector saturating doubling multiply high by scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmulh, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmulhq_lane_s16<const LANE: i32>(a: int16x8_t, b: int16x4_t) -> int16x8_t {
+ static_assert_imm2!(LANE);
+ vqdmulhq_s16(a, vdupq_n_s16(simd_extract(b, LANE as u32)))
+}
+
+/// Vector saturating doubling multiply high by scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmulh, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmulh_lane_s32<const LANE: i32>(a: int32x2_t, b: int32x2_t) -> int32x2_t {
+ static_assert_imm1!(LANE);
+ vqdmulh_s32(a, vdup_n_s32(simd_extract(b, LANE as u32)))
+}
+
+/// Vector saturating doubling multiply high by scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqdmulh, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqdmulhq_lane_s32<const LANE: i32>(a: int32x4_t, b: int32x2_t) -> int32x4_t {
+ static_assert_imm1!(LANE);
+ vqdmulhq_s32(a, vdupq_n_s32(simd_extract(b, LANE as u32)))
+}
+
+/// Saturating extract narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqxtn))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqmovnh_s16(a: i16) -> i8 {
+ simd_extract(vqmovn_s16(vdupq_n_s16(a)), 0)
+}
+
+/// Saturating extract narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqxtn))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqmovns_s32(a: i32) -> i16 {
+ simd_extract(vqmovn_s32(vdupq_n_s32(a)), 0)
+}
+
+/// Saturating extract narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqxtn))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqmovnh_u16(a: u16) -> u8 {
+ simd_extract(vqmovn_u16(vdupq_n_u16(a)), 0)
+}
+
+/// Saturating extract narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqxtn))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqmovns_u32(a: u32) -> u16 {
+ simd_extract(vqmovn_u32(vdupq_n_u32(a)), 0)
+}
+
+/// Saturating extract narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqxtn))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqmovnd_s64(a: i64) -> i32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.scalar.sqxtn.i32.i64")]
+ fn vqmovnd_s64_(a: i64) -> i32;
+ }
+ vqmovnd_s64_(a)
+}
+
+/// Saturating extract narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqxtn))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqmovnd_u64(a: u64) -> u32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.scalar.uqxtn.i32.i64")]
+ fn vqmovnd_u64_(a: u64) -> u32;
+ }
+ vqmovnd_u64_(a)
+}
+
+/// Signed saturating extract narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqxtn2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqmovn_high_s16(a: int8x8_t, b: int16x8_t) -> int8x16_t {
+ simd_shuffle16!(a, vqmovn_s16(b), [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15])
+}
+
+/// Signed saturating extract narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqxtn2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqmovn_high_s32(a: int16x4_t, b: int32x4_t) -> int16x8_t {
+ simd_shuffle8!(a, vqmovn_s32(b), [0, 1, 2, 3, 4, 5, 6, 7])
+}
+
+/// Signed saturating extract narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqxtn2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqmovn_high_s64(a: int32x2_t, b: int64x2_t) -> int32x4_t {
+ simd_shuffle4!(a, vqmovn_s64(b), [0, 1, 2, 3])
+}
+
+/// Signed saturating extract narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqxtn2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqmovn_high_u16(a: uint8x8_t, b: uint16x8_t) -> uint8x16_t {
+ simd_shuffle16!(a, vqmovn_u16(b), [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15])
+}
+
+/// Signed saturating extract narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqxtn2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqmovn_high_u32(a: uint16x4_t, b: uint32x4_t) -> uint16x8_t {
+ simd_shuffle8!(a, vqmovn_u32(b), [0, 1, 2, 3, 4, 5, 6, 7])
+}
+
+/// Signed saturating extract narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqxtn2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqmovn_high_u64(a: uint32x2_t, b: uint64x2_t) -> uint32x4_t {
+ simd_shuffle4!(a, vqmovn_u64(b), [0, 1, 2, 3])
+}
+
+/// Signed saturating extract unsigned narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqxtun))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqmovunh_s16(a: i16) -> u8 {
+ simd_extract(vqmovun_s16(vdupq_n_s16(a)), 0)
+}
+
+/// Signed saturating extract unsigned narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqxtun))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqmovuns_s32(a: i32) -> u16 {
+ simd_extract(vqmovun_s32(vdupq_n_s32(a)), 0)
+}
+
+/// Signed saturating extract unsigned narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqxtun))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqmovund_s64(a: i64) -> u32 {
+ simd_extract(vqmovun_s64(vdupq_n_s64(a)), 0)
+}
+
+/// Signed saturating extract unsigned narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqxtun2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqmovun_high_s16(a: uint8x8_t, b: int16x8_t) -> uint8x16_t {
+ simd_shuffle16!(a, vqmovun_s16(b), [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15])
+}
+
+/// Signed saturating extract unsigned narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqxtun2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqmovun_high_s32(a: uint16x4_t, b: int32x4_t) -> uint16x8_t {
+ simd_shuffle8!(a, vqmovun_s32(b), [0, 1, 2, 3, 4, 5, 6, 7])
+}
+
+/// Signed saturating extract unsigned narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqxtun2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqmovun_high_s64(a: uint32x2_t, b: int64x2_t) -> uint32x4_t {
+ simd_shuffle4!(a, vqmovun_s64(b), [0, 1, 2, 3])
+}
+
+/// Signed saturating rounding doubling multiply returning high half
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqrdmulh))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqrdmulhh_s16(a: i16, b: i16) -> i16 {
+ simd_extract(vqrdmulh_s16(vdup_n_s16(a), vdup_n_s16(b)), 0)
+}
+
+/// Signed saturating rounding doubling multiply returning high half
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqrdmulh))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqrdmulhs_s32(a: i32, b: i32) -> i32 {
+ simd_extract(vqrdmulh_s32(vdup_n_s32(a), vdup_n_s32(b)), 0)
+}
+
+/// Signed saturating rounding doubling multiply returning high half
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqrdmulh, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqrdmulhh_lane_s16<const LANE: i32>(a: i16, b: int16x4_t) -> i16 {
+ static_assert_imm2!(LANE);
+ vqrdmulhh_s16(a, simd_extract(b, LANE as u32))
+}
+
+/// Signed saturating rounding doubling multiply returning high half
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqrdmulh, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqrdmulhh_laneq_s16<const LANE: i32>(a: i16, b: int16x8_t) -> i16 {
+ static_assert_imm3!(LANE);
+ vqrdmulhh_s16(a, simd_extract(b, LANE as u32))
+}
+
+/// Signed saturating rounding doubling multiply returning high half
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqrdmulh, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqrdmulhs_lane_s32<const LANE: i32>(a: i32, b: int32x2_t) -> i32 {
+ static_assert_imm1!(LANE);
+ vqrdmulhs_s32(a, simd_extract(b, LANE as u32))
+}
+
+/// Signed saturating rounding doubling multiply returning high half
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqrdmulh, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqrdmulhs_laneq_s32<const LANE: i32>(a: i32, b: int32x4_t) -> i32 {
+ static_assert_imm2!(LANE);
+ vqrdmulhs_s32(a, simd_extract(b, LANE as u32))
+}
+
+/// Signed saturating rounding doubling multiply accumulate returning high half
+#[inline]
+#[target_feature(enable = "rdm")]
+#[cfg_attr(test, assert_instr(sqrdmlah))]
+#[stable(feature = "rdm_intrinsics", since = "1.62.0")]
+pub unsafe fn vqrdmlah_s16(a: int16x4_t, b: int16x4_t, c: int16x4_t) -> int16x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqrdmlah.v4i16")]
+ fn vqrdmlah_s16_(a: int16x4_t, b: int16x4_t, c: int16x4_t) -> int16x4_t;
+ }
+ vqrdmlah_s16_(a, b, c)
+}
+
+/// Signed saturating rounding doubling multiply accumulate returning high half
+#[inline]
+#[target_feature(enable = "rdm")]
+#[cfg_attr(test, assert_instr(sqrdmlah))]
+#[stable(feature = "rdm_intrinsics", since = "1.62.0")]
+pub unsafe fn vqrdmlahq_s16(a: int16x8_t, b: int16x8_t, c: int16x8_t) -> int16x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqrdmlah.v8i16")]
+ fn vqrdmlahq_s16_(a: int16x8_t, b: int16x8_t, c: int16x8_t) -> int16x8_t;
+ }
+ vqrdmlahq_s16_(a, b, c)
+}
+
+/// Signed saturating rounding doubling multiply accumulate returning high half
+#[inline]
+#[target_feature(enable = "rdm")]
+#[cfg_attr(test, assert_instr(sqrdmlah))]
+#[stable(feature = "rdm_intrinsics", since = "1.62.0")]
+pub unsafe fn vqrdmlah_s32(a: int32x2_t, b: int32x2_t, c: int32x2_t) -> int32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqrdmlah.v2i32")]
+ fn vqrdmlah_s32_(a: int32x2_t, b: int32x2_t, c: int32x2_t) -> int32x2_t;
+ }
+ vqrdmlah_s32_(a, b, c)
+}
+
+/// Signed saturating rounding doubling multiply accumulate returning high half
+#[inline]
+#[target_feature(enable = "rdm")]
+#[cfg_attr(test, assert_instr(sqrdmlah))]
+#[stable(feature = "rdm_intrinsics", since = "1.62.0")]
+pub unsafe fn vqrdmlahq_s32(a: int32x4_t, b: int32x4_t, c: int32x4_t) -> int32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqrdmlah.v4i32")]
+ fn vqrdmlahq_s32_(a: int32x4_t, b: int32x4_t, c: int32x4_t) -> int32x4_t;
+ }
+ vqrdmlahq_s32_(a, b, c)
+}
+
+/// Signed saturating rounding doubling multiply accumulate returning high half
+#[inline]
+#[target_feature(enable = "rdm")]
+#[cfg_attr(test, assert_instr(sqrdmlah))]
+#[stable(feature = "rdm_intrinsics", since = "1.62.0")]
+pub unsafe fn vqrdmlahh_s16(a: i16, b: i16, c: i16) -> i16 {
+ let a: int16x4_t = vdup_n_s16(a);
+ let b: int16x4_t = vdup_n_s16(b);
+ let c: int16x4_t = vdup_n_s16(c);
+ simd_extract(vqrdmlah_s16(a, b, c), 0)
+}
+
+/// Signed saturating rounding doubling multiply accumulate returning high half
+#[inline]
+#[target_feature(enable = "rdm")]
+#[cfg_attr(test, assert_instr(sqrdmlah))]
+#[stable(feature = "rdm_intrinsics", since = "1.62.0")]
+pub unsafe fn vqrdmlahs_s32(a: i32, b: i32, c: i32) -> i32 {
+ let a: int32x2_t = vdup_n_s32(a);
+ let b: int32x2_t = vdup_n_s32(b);
+ let c: int32x2_t = vdup_n_s32(c);
+ simd_extract(vqrdmlah_s32(a, b, c), 0)
+}
+
+/// Signed saturating rounding doubling multiply accumulate returning high half
+#[inline]
+#[target_feature(enable = "rdm")]
+#[cfg_attr(test, assert_instr(sqrdmlah, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "rdm_intrinsics", since = "1.62.0")]
+pub unsafe fn vqrdmlah_lane_s16<const LANE: i32>(a: int16x4_t, b: int16x4_t, c: int16x4_t) -> int16x4_t {
+ static_assert_imm2!(LANE);
+ let c: int16x4_t = simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]);
+ vqrdmlah_s16(a, b, c)
+}
+
+/// Signed saturating rounding doubling multiply accumulate returning high half
+#[inline]
+#[target_feature(enable = "rdm")]
+#[cfg_attr(test, assert_instr(sqrdmlah, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "rdm_intrinsics", since = "1.62.0")]
+pub unsafe fn vqrdmlah_laneq_s16<const LANE: i32>(a: int16x4_t, b: int16x4_t, c: int16x8_t) -> int16x4_t {
+ static_assert_imm3!(LANE);
+ let c: int16x4_t = simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]);
+ vqrdmlah_s16(a, b, c)
+}
+
+/// Signed saturating rounding doubling multiply accumulate returning high half
+#[inline]
+#[target_feature(enable = "rdm")]
+#[cfg_attr(test, assert_instr(sqrdmlah, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "rdm_intrinsics", since = "1.62.0")]
+pub unsafe fn vqrdmlahq_lane_s16<const LANE: i32>(a: int16x8_t, b: int16x8_t, c: int16x4_t) -> int16x8_t {
+ static_assert_imm2!(LANE);
+ let c: int16x8_t = simd_shuffle8!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]);
+ vqrdmlahq_s16(a, b, c)
+}
+
+/// Signed saturating rounding doubling multiply accumulate returning high half
+#[inline]
+#[target_feature(enable = "rdm")]
+#[cfg_attr(test, assert_instr(sqrdmlah, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "rdm_intrinsics", since = "1.62.0")]
+pub unsafe fn vqrdmlahq_laneq_s16<const LANE: i32>(a: int16x8_t, b: int16x8_t, c: int16x8_t) -> int16x8_t {
+ static_assert_imm3!(LANE);
+ let c: int16x8_t = simd_shuffle8!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]);
+ vqrdmlahq_s16(a, b, c)
+}
+
+/// Signed saturating rounding doubling multiply accumulate returning high half
+#[inline]
+#[target_feature(enable = "rdm")]
+#[cfg_attr(test, assert_instr(sqrdmlah, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "rdm_intrinsics", since = "1.62.0")]
+pub unsafe fn vqrdmlah_lane_s32<const LANE: i32>(a: int32x2_t, b: int32x2_t, c: int32x2_t) -> int32x2_t {
+ static_assert_imm1!(LANE);
+ let c: int32x2_t = simd_shuffle2!(c, c, <const LANE: i32> [LANE as u32, LANE as u32]);
+ vqrdmlah_s32(a, b, c)
+}
+
+/// Signed saturating rounding doubling multiply accumulate returning high half
+#[inline]
+#[target_feature(enable = "rdm")]
+#[cfg_attr(test, assert_instr(sqrdmlah, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "rdm_intrinsics", since = "1.62.0")]
+pub unsafe fn vqrdmlah_laneq_s32<const LANE: i32>(a: int32x2_t, b: int32x2_t, c: int32x4_t) -> int32x2_t {
+ static_assert_imm2!(LANE);
+ let c: int32x2_t = simd_shuffle2!(c, c, <const LANE: i32> [LANE as u32, LANE as u32]);
+ vqrdmlah_s32(a, b, c)
+}
+
+/// Signed saturating rounding doubling multiply accumulate returning high half
+#[inline]
+#[target_feature(enable = "rdm")]
+#[cfg_attr(test, assert_instr(sqrdmlah, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "rdm_intrinsics", since = "1.62.0")]
+pub unsafe fn vqrdmlahq_lane_s32<const LANE: i32>(a: int32x4_t, b: int32x4_t, c: int32x2_t) -> int32x4_t {
+ static_assert_imm1!(LANE);
+ let c: int32x4_t = simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]);
+ vqrdmlahq_s32(a, b, c)
+}
+
+/// Signed saturating rounding doubling multiply accumulate returning high half
+#[inline]
+#[target_feature(enable = "rdm")]
+#[cfg_attr(test, assert_instr(sqrdmlah, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "rdm_intrinsics", since = "1.62.0")]
+pub unsafe fn vqrdmlahq_laneq_s32<const LANE: i32>(a: int32x4_t, b: int32x4_t, c: int32x4_t) -> int32x4_t {
+ static_assert_imm2!(LANE);
+ let c: int32x4_t = simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]);
+ vqrdmlahq_s32(a, b, c)
+}
+
+/// Signed saturating rounding doubling multiply accumulate returning high half
+#[inline]
+#[target_feature(enable = "rdm")]
+#[cfg_attr(test, assert_instr(sqrdmlah, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "rdm_intrinsics", since = "1.62.0")]
+pub unsafe fn vqrdmlahh_lane_s16<const LANE: i32>(a: i16, b: i16, c: int16x4_t) -> i16 {
+ static_assert_imm2!(LANE);
+ vqrdmlahh_s16(a, b, simd_extract(c, LANE as u32))
+}
+
+/// Signed saturating rounding doubling multiply accumulate returning high half
+#[inline]
+#[target_feature(enable = "rdm")]
+#[cfg_attr(test, assert_instr(sqrdmlah, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "rdm_intrinsics", since = "1.62.0")]
+pub unsafe fn vqrdmlahh_laneq_s16<const LANE: i32>(a: i16, b: i16, c: int16x8_t) -> i16 {
+ static_assert_imm3!(LANE);
+ vqrdmlahh_s16(a, b, simd_extract(c, LANE as u32))
+}
+
+/// Signed saturating rounding doubling multiply accumulate returning high half
+#[inline]
+#[target_feature(enable = "rdm")]
+#[cfg_attr(test, assert_instr(sqrdmlah, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "rdm_intrinsics", since = "1.62.0")]
+pub unsafe fn vqrdmlahs_lane_s32<const LANE: i32>(a: i32, b: i32, c: int32x2_t) -> i32 {
+ static_assert_imm1!(LANE);
+ vqrdmlahs_s32(a, b, simd_extract(c, LANE as u32))
+}
+
+/// Signed saturating rounding doubling multiply accumulate returning high half
+#[inline]
+#[target_feature(enable = "rdm")]
+#[cfg_attr(test, assert_instr(sqrdmlah, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "rdm_intrinsics", since = "1.62.0")]
+pub unsafe fn vqrdmlahs_laneq_s32<const LANE: i32>(a: i32, b: i32, c: int32x4_t) -> i32 {
+ static_assert_imm2!(LANE);
+ vqrdmlahs_s32(a, b, simd_extract(c, LANE as u32))
+}
+
+/// Signed saturating rounding doubling multiply subtract returning high half
+#[inline]
+#[target_feature(enable = "rdm")]
+#[cfg_attr(test, assert_instr(sqrdmlsh))]
+#[stable(feature = "rdm_intrinsics", since = "1.62.0")]
+pub unsafe fn vqrdmlsh_s16(a: int16x4_t, b: int16x4_t, c: int16x4_t) -> int16x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqrdmlsh.v4i16")]
+ fn vqrdmlsh_s16_(a: int16x4_t, b: int16x4_t, c: int16x4_t) -> int16x4_t;
+ }
+ vqrdmlsh_s16_(a, b, c)
+}
+
+/// Signed saturating rounding doubling multiply subtract returning high half
+#[inline]
+#[target_feature(enable = "rdm")]
+#[cfg_attr(test, assert_instr(sqrdmlsh))]
+#[stable(feature = "rdm_intrinsics", since = "1.62.0")]
+pub unsafe fn vqrdmlshq_s16(a: int16x8_t, b: int16x8_t, c: int16x8_t) -> int16x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqrdmlsh.v8i16")]
+ fn vqrdmlshq_s16_(a: int16x8_t, b: int16x8_t, c: int16x8_t) -> int16x8_t;
+ }
+ vqrdmlshq_s16_(a, b, c)
+}
+
+/// Signed saturating rounding doubling multiply subtract returning high half
+#[inline]
+#[target_feature(enable = "rdm")]
+#[cfg_attr(test, assert_instr(sqrdmlsh))]
+#[stable(feature = "rdm_intrinsics", since = "1.62.0")]
+pub unsafe fn vqrdmlsh_s32(a: int32x2_t, b: int32x2_t, c: int32x2_t) -> int32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqrdmlsh.v2i32")]
+ fn vqrdmlsh_s32_(a: int32x2_t, b: int32x2_t, c: int32x2_t) -> int32x2_t;
+ }
+ vqrdmlsh_s32_(a, b, c)
+}
+
+/// Signed saturating rounding doubling multiply subtract returning high half
+#[inline]
+#[target_feature(enable = "rdm")]
+#[cfg_attr(test, assert_instr(sqrdmlsh))]
+#[stable(feature = "rdm_intrinsics", since = "1.62.0")]
+pub unsafe fn vqrdmlshq_s32(a: int32x4_t, b: int32x4_t, c: int32x4_t) -> int32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqrdmlsh.v4i32")]
+ fn vqrdmlshq_s32_(a: int32x4_t, b: int32x4_t, c: int32x4_t) -> int32x4_t;
+ }
+ vqrdmlshq_s32_(a, b, c)
+}
+
+/// Signed saturating rounding doubling multiply subtract returning high half
+#[inline]
+#[target_feature(enable = "rdm")]
+#[cfg_attr(test, assert_instr(sqrdmlsh))]
+#[stable(feature = "rdm_intrinsics", since = "1.62.0")]
+pub unsafe fn vqrdmlshh_s16(a: i16, b: i16, c: i16) -> i16 {
+ let a: int16x4_t = vdup_n_s16(a);
+ let b: int16x4_t = vdup_n_s16(b);
+ let c: int16x4_t = vdup_n_s16(c);
+ simd_extract(vqrdmlsh_s16(a, b, c), 0)
+}
+
+/// Signed saturating rounding doubling multiply subtract returning high half
+#[inline]
+#[target_feature(enable = "rdm")]
+#[cfg_attr(test, assert_instr(sqrdmlsh))]
+#[stable(feature = "rdm_intrinsics", since = "1.62.0")]
+pub unsafe fn vqrdmlshs_s32(a: i32, b: i32, c: i32) -> i32 {
+ let a: int32x2_t = vdup_n_s32(a);
+ let b: int32x2_t = vdup_n_s32(b);
+ let c: int32x2_t = vdup_n_s32(c);
+ simd_extract(vqrdmlsh_s32(a, b, c), 0)
+}
+
+/// Signed saturating rounding doubling multiply subtract returning high half
+#[inline]
+#[target_feature(enable = "rdm")]
+#[cfg_attr(test, assert_instr(sqrdmlsh, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "rdm_intrinsics", since = "1.62.0")]
+pub unsafe fn vqrdmlsh_lane_s16<const LANE: i32>(a: int16x4_t, b: int16x4_t, c: int16x4_t) -> int16x4_t {
+ static_assert_imm2!(LANE);
+ let c: int16x4_t = simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]);
+ vqrdmlsh_s16(a, b, c)
+}
+
+/// Signed saturating rounding doubling multiply subtract returning high half
+#[inline]
+#[target_feature(enable = "rdm")]
+#[cfg_attr(test, assert_instr(sqrdmlsh, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "rdm_intrinsics", since = "1.62.0")]
+pub unsafe fn vqrdmlsh_laneq_s16<const LANE: i32>(a: int16x4_t, b: int16x4_t, c: int16x8_t) -> int16x4_t {
+ static_assert_imm3!(LANE);
+ let c: int16x4_t = simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]);
+ vqrdmlsh_s16(a, b, c)
+}
+
+/// Signed saturating rounding doubling multiply subtract returning high half
+#[inline]
+#[target_feature(enable = "rdm")]
+#[cfg_attr(test, assert_instr(sqrdmlsh, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "rdm_intrinsics", since = "1.62.0")]
+pub unsafe fn vqrdmlshq_lane_s16<const LANE: i32>(a: int16x8_t, b: int16x8_t, c: int16x4_t) -> int16x8_t {
+ static_assert_imm2!(LANE);
+ let c: int16x8_t = simd_shuffle8!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]);
+ vqrdmlshq_s16(a, b, c)
+}
+
+/// Signed saturating rounding doubling multiply subtract returning high half
+#[inline]
+#[target_feature(enable = "rdm")]
+#[cfg_attr(test, assert_instr(sqrdmlsh, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "rdm_intrinsics", since = "1.62.0")]
+pub unsafe fn vqrdmlshq_laneq_s16<const LANE: i32>(a: int16x8_t, b: int16x8_t, c: int16x8_t) -> int16x8_t {
+ static_assert_imm3!(LANE);
+ let c: int16x8_t = simd_shuffle8!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]);
+ vqrdmlshq_s16(a, b, c)
+}
+
+/// Signed saturating rounding doubling multiply subtract returning high half
+#[inline]
+#[target_feature(enable = "rdm")]
+#[cfg_attr(test, assert_instr(sqrdmlsh, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "rdm_intrinsics", since = "1.62.0")]
+pub unsafe fn vqrdmlsh_lane_s32<const LANE: i32>(a: int32x2_t, b: int32x2_t, c: int32x2_t) -> int32x2_t {
+ static_assert_imm1!(LANE);
+ let c: int32x2_t = simd_shuffle2!(c, c, <const LANE: i32> [LANE as u32, LANE as u32]);
+ vqrdmlsh_s32(a, b, c)
+}
+
+/// Signed saturating rounding doubling multiply subtract returning high half
+#[inline]
+#[target_feature(enable = "rdm")]
+#[cfg_attr(test, assert_instr(sqrdmlsh, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "rdm_intrinsics", since = "1.62.0")]
+pub unsafe fn vqrdmlsh_laneq_s32<const LANE: i32>(a: int32x2_t, b: int32x2_t, c: int32x4_t) -> int32x2_t {
+ static_assert_imm2!(LANE);
+ let c: int32x2_t = simd_shuffle2!(c, c, <const LANE: i32> [LANE as u32, LANE as u32]);
+ vqrdmlsh_s32(a, b, c)
+}
+
+/// Signed saturating rounding doubling multiply subtract returning high half
+#[inline]
+#[target_feature(enable = "rdm")]
+#[cfg_attr(test, assert_instr(sqrdmlsh, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "rdm_intrinsics", since = "1.62.0")]
+pub unsafe fn vqrdmlshq_lane_s32<const LANE: i32>(a: int32x4_t, b: int32x4_t, c: int32x2_t) -> int32x4_t {
+ static_assert_imm1!(LANE);
+ let c: int32x4_t = simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]);
+ vqrdmlshq_s32(a, b, c)
+}
+
+/// Signed saturating rounding doubling multiply subtract returning high half
+#[inline]
+#[target_feature(enable = "rdm")]
+#[cfg_attr(test, assert_instr(sqrdmlsh, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "rdm_intrinsics", since = "1.62.0")]
+pub unsafe fn vqrdmlshq_laneq_s32<const LANE: i32>(a: int32x4_t, b: int32x4_t, c: int32x4_t) -> int32x4_t {
+ static_assert_imm2!(LANE);
+ let c: int32x4_t = simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]);
+ vqrdmlshq_s32(a, b, c)
+}
+
+/// Signed saturating rounding doubling multiply subtract returning high half
+#[inline]
+#[target_feature(enable = "rdm")]
+#[cfg_attr(test, assert_instr(sqrdmlsh, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "rdm_intrinsics", since = "1.62.0")]
+pub unsafe fn vqrdmlshh_lane_s16<const LANE: i32>(a: i16, b: i16, c: int16x4_t) -> i16 {
+ static_assert_imm2!(LANE);
+ vqrdmlshh_s16(a, b, simd_extract(c, LANE as u32))
+}
+
+/// Signed saturating rounding doubling multiply subtract returning high half
+#[inline]
+#[target_feature(enable = "rdm")]
+#[cfg_attr(test, assert_instr(sqrdmlsh, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "rdm_intrinsics", since = "1.62.0")]
+pub unsafe fn vqrdmlshh_laneq_s16<const LANE: i32>(a: i16, b: i16, c: int16x8_t) -> i16 {
+ static_assert_imm3!(LANE);
+ vqrdmlshh_s16(a, b, simd_extract(c, LANE as u32))
+}
+
+/// Signed saturating rounding doubling multiply subtract returning high half
+#[inline]
+#[target_feature(enable = "rdm")]
+#[cfg_attr(test, assert_instr(sqrdmlsh, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "rdm_intrinsics", since = "1.62.0")]
+pub unsafe fn vqrdmlshs_lane_s32<const LANE: i32>(a: i32, b: i32, c: int32x2_t) -> i32 {
+ static_assert_imm1!(LANE);
+ vqrdmlshs_s32(a, b, simd_extract(c, LANE as u32))
+}
+
+/// Signed saturating rounding doubling multiply subtract returning high half
+#[inline]
+#[target_feature(enable = "rdm")]
+#[cfg_attr(test, assert_instr(sqrdmlsh, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[stable(feature = "rdm_intrinsics", since = "1.62.0")]
+pub unsafe fn vqrdmlshs_laneq_s32<const LANE: i32>(a: i32, b: i32, c: int32x4_t) -> i32 {
+ static_assert_imm2!(LANE);
+ vqrdmlshs_s32(a, b, simd_extract(c, LANE as u32))
+}
+
+/// Signed saturating rounding shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqrshl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqrshls_s32(a: i32, b: i32) -> i32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqrshl.i32")]
+ fn vqrshls_s32_(a: i32, b: i32) -> i32;
+ }
+ vqrshls_s32_(a, b)
+}
+
+/// Signed saturating rounding shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqrshl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqrshld_s64(a: i64, b: i64) -> i64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqrshl.i64")]
+ fn vqrshld_s64_(a: i64, b: i64) -> i64;
+ }
+ vqrshld_s64_(a, b)
+}
+
+/// Signed saturating rounding shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqrshl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqrshlb_s8(a: i8, b: i8) -> i8 {
+ let a: int8x8_t = vdup_n_s8(a);
+ let b: int8x8_t = vdup_n_s8(b);
+ simd_extract(vqrshl_s8(a, b), 0)
+}
+
+/// Signed saturating rounding shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqrshl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqrshlh_s16(a: i16, b: i16) -> i16 {
+ let a: int16x4_t = vdup_n_s16(a);
+ let b: int16x4_t = vdup_n_s16(b);
+ simd_extract(vqrshl_s16(a, b), 0)
+}
+
+/// Unsigned signed saturating rounding shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqrshl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqrshls_u32(a: u32, b: i32) -> u32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqrshl.i32")]
+ fn vqrshls_u32_(a: u32, b: i32) -> u32;
+ }
+ vqrshls_u32_(a, b)
+}
+
+/// Unsigned signed saturating rounding shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqrshl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqrshld_u64(a: u64, b: i64) -> u64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqrshl.i64")]
+ fn vqrshld_u64_(a: u64, b: i64) -> u64;
+ }
+ vqrshld_u64_(a, b)
+}
+
+/// Unsigned signed saturating rounding shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqrshl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqrshlb_u8(a: u8, b: i8) -> u8 {
+ let a: uint8x8_t = vdup_n_u8(a);
+ let b: int8x8_t = vdup_n_s8(b);
+ simd_extract(vqrshl_u8(a, b), 0)
+}
+
+/// Unsigned signed saturating rounding shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqrshl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqrshlh_u16(a: u16, b: i16) -> u16 {
+ let a: uint16x4_t = vdup_n_u16(a);
+ let b: int16x4_t = vdup_n_s16(b);
+ simd_extract(vqrshl_u16(a, b), 0)
+}
+
+/// Signed saturating rounded shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqrshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqrshrnh_n_s16<const N: i32>(a: i16) -> i8 {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ let a: int16x8_t = vdupq_n_s16(a);
+ simd_extract(vqrshrn_n_s16::<N>(a), 0)
+}
+
+/// Signed saturating rounded shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqrshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqrshrns_n_s32<const N: i32>(a: i32) -> i16 {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ let a: int32x4_t = vdupq_n_s32(a);
+ simd_extract(vqrshrn_n_s32::<N>(a), 0)
+}
+
+/// Signed saturating rounded shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqrshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqrshrnd_n_s64<const N: i32>(a: i64) -> i32 {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ let a: int64x2_t = vdupq_n_s64(a);
+ simd_extract(vqrshrn_n_s64::<N>(a), 0)
+}
+
+/// Signed saturating rounded shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqrshrn2, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqrshrn_high_n_s16<const N: i32>(a: int8x8_t, b: int16x8_t) -> int8x16_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ simd_shuffle16!(a, vqrshrn_n_s16::<N>(b), [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15])
+}
+
+/// Signed saturating rounded shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqrshrn2, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqrshrn_high_n_s32<const N: i32>(a: int16x4_t, b: int32x4_t) -> int16x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ simd_shuffle8!(a, vqrshrn_n_s32::<N>(b), [0, 1, 2, 3, 4, 5, 6, 7])
+}
+
+/// Signed saturating rounded shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqrshrn2, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqrshrn_high_n_s64<const N: i32>(a: int32x2_t, b: int64x2_t) -> int32x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ simd_shuffle4!(a, vqrshrn_n_s64::<N>(b), [0, 1, 2, 3])
+}
+
+/// Unsigned saturating rounded shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqrshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqrshrnh_n_u16<const N: i32>(a: u16) -> u8 {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ let a: uint16x8_t = vdupq_n_u16(a);
+ simd_extract(vqrshrn_n_u16::<N>(a), 0)
+}
+
+/// Unsigned saturating rounded shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqrshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqrshrns_n_u32<const N: i32>(a: u32) -> u16 {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ let a: uint32x4_t = vdupq_n_u32(a);
+ simd_extract(vqrshrn_n_u32::<N>(a), 0)
+}
+
+/// Unsigned saturating rounded shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqrshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqrshrnd_n_u64<const N: i32>(a: u64) -> u32 {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ let a: uint64x2_t = vdupq_n_u64(a);
+ simd_extract(vqrshrn_n_u64::<N>(a), 0)
+}
+
+/// Unsigned saturating rounded shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqrshrn2, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqrshrn_high_n_u16<const N: i32>(a: uint8x8_t, b: uint16x8_t) -> uint8x16_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ simd_shuffle16!(a, vqrshrn_n_u16::<N>(b), [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15])
+}
+
+/// Unsigned saturating rounded shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqrshrn2, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqrshrn_high_n_u32<const N: i32>(a: uint16x4_t, b: uint32x4_t) -> uint16x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ simd_shuffle8!(a, vqrshrn_n_u32::<N>(b), [0, 1, 2, 3, 4, 5, 6, 7])
+}
+
+/// Unsigned saturating rounded shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqrshrn2, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqrshrn_high_n_u64<const N: i32>(a: uint32x2_t, b: uint64x2_t) -> uint32x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ simd_shuffle4!(a, vqrshrn_n_u64::<N>(b), [0, 1, 2, 3])
+}
+
+/// Signed saturating rounded shift right unsigned narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqrshrun, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqrshrunh_n_s16<const N: i32>(a: i16) -> u8 {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ let a: int16x8_t = vdupq_n_s16(a);
+ simd_extract(vqrshrun_n_s16::<N>(a), 0)
+}
+
+/// Signed saturating rounded shift right unsigned narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqrshrun, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqrshruns_n_s32<const N: i32>(a: i32) -> u16 {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ let a: int32x4_t = vdupq_n_s32(a);
+ simd_extract(vqrshrun_n_s32::<N>(a), 0)
+}
+
+/// Signed saturating rounded shift right unsigned narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqrshrun, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqrshrund_n_s64<const N: i32>(a: i64) -> u32 {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ let a: int64x2_t = vdupq_n_s64(a);
+ simd_extract(vqrshrun_n_s64::<N>(a), 0)
+}
+
+/// Signed saturating rounded shift right unsigned narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqrshrun2, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqrshrun_high_n_s16<const N: i32>(a: uint8x8_t, b: int16x8_t) -> uint8x16_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ simd_shuffle16!(a, vqrshrun_n_s16::<N>(b), [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15])
+}
+
+/// Signed saturating rounded shift right unsigned narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqrshrun2, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqrshrun_high_n_s32<const N: i32>(a: uint16x4_t, b: int32x4_t) -> uint16x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ simd_shuffle8!(a, vqrshrun_n_s32::<N>(b), [0, 1, 2, 3, 4, 5, 6, 7])
+}
+
+/// Signed saturating rounded shift right unsigned narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqrshrun2, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqrshrun_high_n_s64<const N: i32>(a: uint32x2_t, b: int64x2_t) -> uint32x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ simd_shuffle4!(a, vqrshrun_n_s64::<N>(b), [0, 1, 2, 3])
+}
+
+/// Signed saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqshl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshld_s64(a: i64, b: i64) -> i64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqshl.i64")]
+ fn vqshld_s64_(a: i64, b: i64) -> i64;
+ }
+ vqshld_s64_(a, b)
+}
+
+/// Signed saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqshl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshlb_s8(a: i8, b: i8) -> i8 {
+ let c: int8x8_t = vqshl_s8(vdup_n_s8(a), vdup_n_s8(b));
+ simd_extract(c, 0)
+}
+
+/// Signed saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqshl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshlh_s16(a: i16, b: i16) -> i16 {
+ let c: int16x4_t = vqshl_s16(vdup_n_s16(a), vdup_n_s16(b));
+ simd_extract(c, 0)
+}
+
+/// Signed saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqshl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshls_s32(a: i32, b: i32) -> i32 {
+ let c: int32x2_t = vqshl_s32(vdup_n_s32(a), vdup_n_s32(b));
+ simd_extract(c, 0)
+}
+
+/// Unsigned saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqshl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshld_u64(a: u64, b: i64) -> u64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqshl.i64")]
+ fn vqshld_u64_(a: u64, b: i64) -> u64;
+ }
+ vqshld_u64_(a, b)
+}
+
+/// Unsigned saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqshl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshlb_u8(a: u8, b: i8) -> u8 {
+ let c: uint8x8_t = vqshl_u8(vdup_n_u8(a), vdup_n_s8(b));
+ simd_extract(c, 0)
+}
+
+/// Unsigned saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqshl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshlh_u16(a: u16, b: i16) -> u16 {
+ let c: uint16x4_t = vqshl_u16(vdup_n_u16(a), vdup_n_s16(b));
+ simd_extract(c, 0)
+}
+
+/// Unsigned saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqshl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshls_u32(a: u32, b: i32) -> u32 {
+ let c: uint32x2_t = vqshl_u32(vdup_n_u32(a), vdup_n_s32(b));
+ simd_extract(c, 0)
+}
+
+/// Signed saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqshl, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshlb_n_s8<const N: i32>(a: i8) -> i8 {
+ static_assert_imm3!(N);
+ simd_extract(vqshl_n_s8::<N>(vdup_n_s8(a)), 0)
+}
+
+/// Signed saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqshl, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshlh_n_s16<const N: i32>(a: i16) -> i16 {
+ static_assert_imm4!(N);
+ simd_extract(vqshl_n_s16::<N>(vdup_n_s16(a)), 0)
+}
+
+/// Signed saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqshl, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshls_n_s32<const N: i32>(a: i32) -> i32 {
+ static_assert_imm5!(N);
+ simd_extract(vqshl_n_s32::<N>(vdup_n_s32(a)), 0)
+}
+
+/// Signed saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqshl, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshld_n_s64<const N: i32>(a: i64) -> i64 {
+ static_assert_imm6!(N);
+ simd_extract(vqshl_n_s64::<N>(vdup_n_s64(a)), 0)
+}
+
+/// Unsigned saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqshl, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshlb_n_u8<const N: i32>(a: u8) -> u8 {
+ static_assert_imm3!(N);
+ simd_extract(vqshl_n_u8::<N>(vdup_n_u8(a)), 0)
+}
+
+/// Unsigned saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqshl, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshlh_n_u16<const N: i32>(a: u16) -> u16 {
+ static_assert_imm4!(N);
+ simd_extract(vqshl_n_u16::<N>(vdup_n_u16(a)), 0)
+}
+
+/// Unsigned saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqshl, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshls_n_u32<const N: i32>(a: u32) -> u32 {
+ static_assert_imm5!(N);
+ simd_extract(vqshl_n_u32::<N>(vdup_n_u32(a)), 0)
+}
+
+/// Unsigned saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqshl, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshld_n_u64<const N: i32>(a: u64) -> u64 {
+ static_assert_imm6!(N);
+ simd_extract(vqshl_n_u64::<N>(vdup_n_u64(a)), 0)
+}
+
+/// Signed saturating shift left unsigned
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqshlu, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshlub_n_s8<const N: i32>(a: i8) -> u8 {
+ static_assert_imm3!(N);
+ simd_extract(vqshlu_n_s8::<N>(vdup_n_s8(a)), 0)
+}
+
+/// Signed saturating shift left unsigned
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqshlu, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshluh_n_s16<const N: i32>(a: i16) -> u16 {
+ static_assert_imm4!(N);
+ simd_extract(vqshlu_n_s16::<N>(vdup_n_s16(a)), 0)
+}
+
+/// Signed saturating shift left unsigned
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqshlu, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshlus_n_s32<const N: i32>(a: i32) -> u32 {
+ static_assert_imm5!(N);
+ simd_extract(vqshlu_n_s32::<N>(vdup_n_s32(a)), 0)
+}
+
+/// Signed saturating shift left unsigned
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqshlu, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshlud_n_s64<const N: i32>(a: i64) -> u64 {
+ static_assert_imm6!(N);
+ simd_extract(vqshlu_n_s64::<N>(vdup_n_s64(a)), 0)
+}
+
+/// Signed saturating shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshrnd_n_s64<const N: i32>(a: i64) -> i32 {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqshrn.i32")]
+ fn vqshrnd_n_s64_(a: i64, n: i32) -> i32;
+ }
+ vqshrnd_n_s64_(a, N)
+}
+
+/// Signed saturating shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshrnh_n_s16<const N: i32>(a: i16) -> i8 {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ simd_extract(vqshrn_n_s16::<N>(vdupq_n_s16(a)), 0)
+}
+
+/// Signed saturating shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshrns_n_s32<const N: i32>(a: i32) -> i16 {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ simd_extract(vqshrn_n_s32::<N>(vdupq_n_s32(a)), 0)
+}
+
+/// Signed saturating shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqshrn2, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshrn_high_n_s16<const N: i32>(a: int8x8_t, b: int16x8_t) -> int8x16_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ simd_shuffle16!(a, vqshrn_n_s16::<N>(b), [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15])
+}
+
+/// Signed saturating shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqshrn2, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshrn_high_n_s32<const N: i32>(a: int16x4_t, b: int32x4_t) -> int16x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ simd_shuffle8!(a, vqshrn_n_s32::<N>(b), [0, 1, 2, 3, 4, 5, 6, 7])
+}
+
+/// Signed saturating shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqshrn2, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshrn_high_n_s64<const N: i32>(a: int32x2_t, b: int64x2_t) -> int32x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ simd_shuffle4!(a, vqshrn_n_s64::<N>(b), [0, 1, 2, 3])
+}
+
+/// Unsigned saturating shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshrnd_n_u64<const N: i32>(a: u64) -> u32 {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqshrn.i32")]
+ fn vqshrnd_n_u64_(a: u64, n: i32) -> u32;
+ }
+ vqshrnd_n_u64_(a, N)
+}
+
+/// Unsigned saturating shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshrnh_n_u16<const N: i32>(a: u16) -> u8 {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ simd_extract(vqshrn_n_u16::<N>(vdupq_n_u16(a)), 0)
+}
+
+/// Unsigned saturating shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshrns_n_u32<const N: i32>(a: u32) -> u16 {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ simd_extract(vqshrn_n_u32::<N>(vdupq_n_u32(a)), 0)
+}
+
+/// Unsigned saturating shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqshrn2, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshrn_high_n_u16<const N: i32>(a: uint8x8_t, b: uint16x8_t) -> uint8x16_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ simd_shuffle16!(a, vqshrn_n_u16::<N>(b), [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15])
+}
+
+/// Unsigned saturating shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqshrn2, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshrn_high_n_u32<const N: i32>(a: uint16x4_t, b: uint32x4_t) -> uint16x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ simd_shuffle8!(a, vqshrn_n_u32::<N>(b), [0, 1, 2, 3, 4, 5, 6, 7])
+}
+
+/// Unsigned saturating shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqshrn2, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshrn_high_n_u64<const N: i32>(a: uint32x2_t, b: uint64x2_t) -> uint32x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ simd_shuffle4!(a, vqshrn_n_u64::<N>(b), [0, 1, 2, 3])
+}
+
+/// Signed saturating shift right unsigned narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqshrun, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshrunh_n_s16<const N: i32>(a: i16) -> u8 {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ simd_extract(vqshrun_n_s16::<N>(vdupq_n_s16(a)), 0)
+}
+
+/// Signed saturating shift right unsigned narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqshrun, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshruns_n_s32<const N: i32>(a: i32) -> u16 {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ simd_extract(vqshrun_n_s32::<N>(vdupq_n_s32(a)), 0)
+}
+
+/// Signed saturating shift right unsigned narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqshrun, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshrund_n_s64<const N: i32>(a: i64) -> u32 {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ simd_extract(vqshrun_n_s64::<N>(vdupq_n_s64(a)), 0)
+}
+
+/// Signed saturating shift right unsigned narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqshrun2, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshrun_high_n_s16<const N: i32>(a: uint8x8_t, b: int16x8_t) -> uint8x16_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ simd_shuffle16!(a, vqshrun_n_s16::<N>(b), [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15])
+}
+
+/// Signed saturating shift right unsigned narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqshrun2, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshrun_high_n_s32<const N: i32>(a: uint16x4_t, b: int32x4_t) -> uint16x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ simd_shuffle8!(a, vqshrun_n_s32::<N>(b), [0, 1, 2, 3, 4, 5, 6, 7])
+}
+
+/// Signed saturating shift right unsigned narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqshrun2, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshrun_high_n_s64<const N: i32>(a: uint32x2_t, b: int64x2_t) -> uint32x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ simd_shuffle4!(a, vqshrun_n_s64::<N>(b), [0, 1, 2, 3])
+}
+
+/// Unsigned saturating accumulate of signed value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(usqadd))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsqaddb_u8(a: u8, b: i8) -> u8 {
+ simd_extract(vsqadd_u8(vdup_n_u8(a), vdup_n_s8(b)), 0)
+}
+
+/// Unsigned saturating accumulate of signed value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(usqadd))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsqaddh_u16(a: u16, b: i16) -> u16 {
+ simd_extract(vsqadd_u16(vdup_n_u16(a), vdup_n_s16(b)), 0)
+}
+
+/// Unsigned saturating accumulate of signed value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(usqadd))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsqadds_u32(a: u32, b: i32) -> u32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.usqadd.i32")]
+ fn vsqadds_u32_(a: u32, b: i32) -> u32;
+ }
+ vsqadds_u32_(a, b)
+}
+
+/// Unsigned saturating accumulate of signed value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(usqadd))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsqaddd_u64(a: u64, b: i64) -> u64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.usqadd.i64")]
+ fn vsqaddd_u64_(a: u64, b: i64) -> u64;
+ }
+ vsqaddd_u64_(a, b)
+}
+
+/// Calculates the square root of each lane.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fsqrt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsqrt_f32(a: float32x2_t) -> float32x2_t {
+ simd_fsqrt(a)
+}
+
+/// Calculates the square root of each lane.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fsqrt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsqrtq_f32(a: float32x4_t) -> float32x4_t {
+ simd_fsqrt(a)
+}
+
+/// Calculates the square root of each lane.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fsqrt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsqrt_f64(a: float64x1_t) -> float64x1_t {
+ simd_fsqrt(a)
+}
+
+/// Calculates the square root of each lane.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fsqrt))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsqrtq_f64(a: float64x2_t) -> float64x2_t {
+ simd_fsqrt(a)
+}
+
+/// Reciprocal square-root estimate.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frsqrte))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrsqrte_f64(a: float64x1_t) -> float64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.frsqrte.v1f64")]
+ fn vrsqrte_f64_(a: float64x1_t) -> float64x1_t;
+ }
+ vrsqrte_f64_(a)
+}
+
+/// Reciprocal square-root estimate.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frsqrte))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrsqrteq_f64(a: float64x2_t) -> float64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.frsqrte.v2f64")]
+ fn vrsqrteq_f64_(a: float64x2_t) -> float64x2_t;
+ }
+ vrsqrteq_f64_(a)
+}
+
+/// Reciprocal square-root estimate.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frsqrte))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrsqrtes_f32(a: f32) -> f32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.frsqrte.f32")]
+ fn vrsqrtes_f32_(a: f32) -> f32;
+ }
+ vrsqrtes_f32_(a)
+}
+
+/// Reciprocal square-root estimate.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frsqrte))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrsqrted_f64(a: f64) -> f64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.frsqrte.f64")]
+ fn vrsqrted_f64_(a: f64) -> f64;
+ }
+ vrsqrted_f64_(a)
+}
+
+/// Floating-point reciprocal square root step
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frsqrts))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrsqrts_f64(a: float64x1_t, b: float64x1_t) -> float64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.frsqrts.v1f64")]
+ fn vrsqrts_f64_(a: float64x1_t, b: float64x1_t) -> float64x1_t;
+ }
+ vrsqrts_f64_(a, b)
+}
+
+/// Floating-point reciprocal square root step
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frsqrts))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrsqrtsq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.frsqrts.v2f64")]
+ fn vrsqrtsq_f64_(a: float64x2_t, b: float64x2_t) -> float64x2_t;
+ }
+ vrsqrtsq_f64_(a, b)
+}
+
+/// Floating-point reciprocal square root step
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frsqrts))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrsqrtss_f32(a: f32, b: f32) -> f32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.frsqrts.f32")]
+ fn vrsqrtss_f32_(a: f32, b: f32) -> f32;
+ }
+ vrsqrtss_f32_(a, b)
+}
+
+/// Floating-point reciprocal square root step
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frsqrts))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrsqrtsd_f64(a: f64, b: f64) -> f64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.frsqrts.f64")]
+ fn vrsqrtsd_f64_(a: f64, b: f64) -> f64;
+ }
+ vrsqrtsd_f64_(a, b)
+}
+
+/// Reciprocal estimate.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frecpe))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrecpe_f64(a: float64x1_t) -> float64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.frecpe.v1f64")]
+ fn vrecpe_f64_(a: float64x1_t) -> float64x1_t;
+ }
+ vrecpe_f64_(a)
+}
+
+/// Reciprocal estimate.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frecpe))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrecpeq_f64(a: float64x2_t) -> float64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.frecpe.v2f64")]
+ fn vrecpeq_f64_(a: float64x2_t) -> float64x2_t;
+ }
+ vrecpeq_f64_(a)
+}
+
+/// Reciprocal estimate.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frecpe))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrecpes_f32(a: f32) -> f32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.frecpe.f32")]
+ fn vrecpes_f32_(a: f32) -> f32;
+ }
+ vrecpes_f32_(a)
+}
+
+/// Reciprocal estimate.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frecpe))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrecped_f64(a: f64) -> f64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.frecpe.f64")]
+ fn vrecped_f64_(a: f64) -> f64;
+ }
+ vrecped_f64_(a)
+}
+
+/// Floating-point reciprocal step
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frecps))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrecps_f64(a: float64x1_t, b: float64x1_t) -> float64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.frecps.v1f64")]
+ fn vrecps_f64_(a: float64x1_t, b: float64x1_t) -> float64x1_t;
+ }
+ vrecps_f64_(a, b)
+}
+
+/// Floating-point reciprocal step
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frecps))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrecpsq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.frecps.v2f64")]
+ fn vrecpsq_f64_(a: float64x2_t, b: float64x2_t) -> float64x2_t;
+ }
+ vrecpsq_f64_(a, b)
+}
+
+/// Floating-point reciprocal step
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frecps))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrecpss_f32(a: f32, b: f32) -> f32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.frecps.f32")]
+ fn vrecpss_f32_(a: f32, b: f32) -> f32;
+ }
+ vrecpss_f32_(a, b)
+}
+
+/// Floating-point reciprocal step
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frecps))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrecpsd_f64(a: f64, b: f64) -> f64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.frecps.f64")]
+ fn vrecpsd_f64_(a: f64, b: f64) -> f64;
+ }
+ vrecpsd_f64_(a, b)
+}
+
+/// Floating-point reciprocal exponent
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frecpx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrecpxs_f32(a: f32) -> f32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.frecpx.f32")]
+ fn vrecpxs_f32_(a: f32) -> f32;
+ }
+ vrecpxs_f32_(a)
+}
+
+/// Floating-point reciprocal exponent
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(frecpx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrecpxd_f64(a: f64) -> f64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.frecpx.f64")]
+ fn vrecpxd_f64_(a: f64) -> f64;
+ }
+ vrecpxd_f64_(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpret_s64_p64(a: poly64x1_t) -> int64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpret_u64_p64(a: poly64x1_t) -> uint64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpret_p64_s64(a: int64x1_t) -> poly64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpret_p64_u64(a: uint64x1_t) -> poly64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpretq_s64_p64(a: poly64x2_t) -> int64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpretq_u64_p64(a: poly64x2_t) -> uint64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpretq_p64_s64(a: int64x2_t) -> poly64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpretq_p64_u64(a: uint64x2_t) -> poly64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpret_s8_f64(a: float64x1_t) -> int8x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpret_s16_f64(a: float64x1_t) -> int16x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpret_s32_f64(a: float64x1_t) -> int32x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpret_s64_f64(a: float64x1_t) -> int64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpretq_s8_f64(a: float64x2_t) -> int8x16_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpretq_s16_f64(a: float64x2_t) -> int16x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpretq_s32_f64(a: float64x2_t) -> int32x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpretq_s64_f64(a: float64x2_t) -> int64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpret_u8_f64(a: float64x1_t) -> uint8x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpret_u16_f64(a: float64x1_t) -> uint16x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpret_u32_f64(a: float64x1_t) -> uint32x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpret_u64_f64(a: float64x1_t) -> uint64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpretq_u8_f64(a: float64x2_t) -> uint8x16_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpretq_u16_f64(a: float64x2_t) -> uint16x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpretq_u32_f64(a: float64x2_t) -> uint32x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpretq_u64_f64(a: float64x2_t) -> uint64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpret_p8_f64(a: float64x1_t) -> poly8x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpret_p16_f64(a: float64x1_t) -> poly16x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpret_p64_f32(a: float32x2_t) -> poly64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpret_p64_f64(a: float64x1_t) -> poly64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpretq_p8_f64(a: float64x2_t) -> poly8x16_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpretq_p16_f64(a: float64x2_t) -> poly16x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpretq_p64_f32(a: float32x4_t) -> poly64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpretq_p64_f64(a: float64x2_t) -> poly64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpretq_p128_f64(a: float64x2_t) -> p128 {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpret_f64_s8(a: int8x8_t) -> float64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpret_f64_s16(a: int16x4_t) -> float64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpret_f64_s32(a: int32x2_t) -> float64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpret_f64_s64(a: int64x1_t) -> float64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpretq_f64_s8(a: int8x16_t) -> float64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpretq_f64_s16(a: int16x8_t) -> float64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpretq_f64_s32(a: int32x4_t) -> float64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpretq_f64_s64(a: int64x2_t) -> float64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpret_f64_p8(a: poly8x8_t) -> float64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpret_f64_u16(a: uint16x4_t) -> float64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpret_f64_u32(a: uint32x2_t) -> float64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpret_f64_u64(a: uint64x1_t) -> float64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpretq_f64_p8(a: poly8x16_t) -> float64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpretq_f64_u16(a: uint16x8_t) -> float64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpretq_f64_u32(a: uint32x4_t) -> float64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpretq_f64_u64(a: uint64x2_t) -> float64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpret_f64_u8(a: uint8x8_t) -> float64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpret_f64_p16(a: poly16x4_t) -> float64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpret_f64_p64(a: poly64x1_t) -> float64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpret_f32_p64(a: poly64x1_t) -> float32x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpretq_f64_u8(a: uint8x16_t) -> float64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpretq_f64_p16(a: poly16x8_t) -> float64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpretq_f64_p64(a: poly64x2_t) -> float64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpretq_f32_p64(a: poly64x2_t) -> float32x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpretq_f64_p128(a: p128) -> float64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpret_f64_f32(a: float32x2_t) -> float64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpret_f32_f64(a: float64x1_t) -> float32x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpretq_f64_f32(a: float32x4_t) -> float64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vreinterpretq_f32_f64(a: float64x2_t) -> float32x4_t {
+ transmute(a)
+}
+
+/// Signed rounding shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(srshl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrshld_s64(a: i64, b: i64) -> i64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.srshl.i64")]
+ fn vrshld_s64_(a: i64, b: i64) -> i64;
+ }
+ vrshld_s64_(a, b)
+}
+
+/// Unsigned rounding shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(urshl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrshld_u64(a: u64, b: i64) -> u64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.urshl.i64")]
+ fn vrshld_u64_(a: u64, b: i64) -> u64;
+ }
+ vrshld_u64_(a, b)
+}
+
+/// Signed rounding shift right
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(srshr, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrshrd_n_s64<const N: i32>(a: i64) -> i64 {
+ static_assert!(N : i32 where N >= 1 && N <= 64);
+ vrshld_s64(a, -N as i64)
+}
+
+/// Unsigned rounding shift right
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(urshr, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrshrd_n_u64<const N: i32>(a: u64) -> u64 {
+ static_assert!(N : i32 where N >= 1 && N <= 64);
+ vrshld_u64(a, -N as i64)
+}
+
+/// Rounding shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(rshrn2, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrshrn_high_n_s16<const N: i32>(a: int8x8_t, b: int16x8_t) -> int8x16_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ simd_shuffle16!(a, vrshrn_n_s16::<N>(b), [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15])
+}
+
+/// Rounding shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(rshrn2, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrshrn_high_n_s32<const N: i32>(a: int16x4_t, b: int32x4_t) -> int16x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ simd_shuffle8!(a, vrshrn_n_s32::<N>(b), [0, 1, 2, 3, 4, 5, 6, 7])
+}
+
+/// Rounding shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(rshrn2, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrshrn_high_n_s64<const N: i32>(a: int32x2_t, b: int64x2_t) -> int32x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ simd_shuffle4!(a, vrshrn_n_s64::<N>(b), [0, 1, 2, 3])
+}
+
+/// Rounding shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(rshrn2, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrshrn_high_n_u16<const N: i32>(a: uint8x8_t, b: uint16x8_t) -> uint8x16_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ simd_shuffle16!(a, vrshrn_n_u16::<N>(b), [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15])
+}
+
+/// Rounding shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(rshrn2, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrshrn_high_n_u32<const N: i32>(a: uint16x4_t, b: uint32x4_t) -> uint16x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ simd_shuffle8!(a, vrshrn_n_u32::<N>(b), [0, 1, 2, 3, 4, 5, 6, 7])
+}
+
+/// Rounding shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(rshrn2, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrshrn_high_n_u64<const N: i32>(a: uint32x2_t, b: uint64x2_t) -> uint32x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ simd_shuffle4!(a, vrshrn_n_u64::<N>(b), [0, 1, 2, 3])
+}
+
+/// Signed rounding shift right and accumulate.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(srsra, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrsrad_n_s64<const N: i32>(a: i64, b: i64) -> i64 {
+ static_assert!(N : i32 where N >= 1 && N <= 64);
+ let b: i64 = vrshrd_n_s64::<N>(b);
+ a.wrapping_add(b)
+}
+
+/// Ungisned rounding shift right and accumulate.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ursra, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrsrad_n_u64<const N: i32>(a: u64, b: u64) -> u64 {
+ static_assert!(N : i32 where N >= 1 && N <= 64);
+ let b: u64 = vrshrd_n_u64::<N>(b);
+ a.wrapping_add(b)
+}
+
+/// Rounding subtract returning high narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(rsubhn2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrsubhn_high_s16(a: int8x8_t, b: int16x8_t, c: int16x8_t) -> int8x16_t {
+ let x: int8x8_t = vrsubhn_s16(b, c);
+ simd_shuffle16!(a, x, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15])
+}
+
+/// Rounding subtract returning high narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(rsubhn2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrsubhn_high_s32(a: int16x4_t, b: int32x4_t, c: int32x4_t) -> int16x8_t {
+ let x: int16x4_t = vrsubhn_s32(b, c);
+ simd_shuffle8!(a, x, [0, 1, 2, 3, 4, 5, 6, 7])
+}
+
+/// Rounding subtract returning high narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(rsubhn2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrsubhn_high_s64(a: int32x2_t, b: int64x2_t, c: int64x2_t) -> int32x4_t {
+ let x: int32x2_t = vrsubhn_s64(b, c);
+ simd_shuffle4!(a, x, [0, 1, 2, 3])
+}
+
+/// Rounding subtract returning high narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(rsubhn2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrsubhn_high_u16(a: uint8x8_t, b: uint16x8_t, c: uint16x8_t) -> uint8x16_t {
+ let x: uint8x8_t = vrsubhn_u16(b, c);
+ simd_shuffle16!(a, x, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15])
+}
+
+/// Rounding subtract returning high narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(rsubhn2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrsubhn_high_u32(a: uint16x4_t, b: uint32x4_t, c: uint32x4_t) -> uint16x8_t {
+ let x: uint16x4_t = vrsubhn_u32(b, c);
+ simd_shuffle8!(a, x, [0, 1, 2, 3, 4, 5, 6, 7])
+}
+
+/// Rounding subtract returning high narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(rsubhn2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrsubhn_high_u64(a: uint32x2_t, b: uint64x2_t, c: uint64x2_t) -> uint32x4_t {
+ let x: uint32x2_t = vrsubhn_u64(b, c);
+ simd_shuffle4!(a, x, [0, 1, 2, 3])
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vset_lane_f64<const LANE: i32>(a: f64, b: float64x1_t) -> float64x1_t {
+ static_assert!(LANE : i32 where LANE == 0);
+ simd_insert(b, LANE as u32, a)
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsetq_lane_f64<const LANE: i32>(a: f64, b: float64x2_t) -> float64x2_t {
+ static_assert_imm1!(LANE);
+ simd_insert(b, LANE as u32, a)
+}
+
+/// Signed Shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sshl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vshld_s64(a: i64, b: i64) -> i64 {
+ transmute(vshl_s64(transmute(a), transmute(b)))
+}
+
+/// Unsigned Shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ushl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vshld_u64(a: u64, b: i64) -> u64 {
+ transmute(vshl_u64(transmute(a), transmute(b)))
+}
+
+/// Signed shift left long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sshll2, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vshll_high_n_s8<const N: i32>(a: int8x16_t) -> int16x8_t {
+ static_assert!(N : i32 where N >= 0 && N <= 8);
+ let b: int8x8_t = simd_shuffle8!(a, a, [8, 9, 10, 11, 12, 13, 14, 15]);
+ vshll_n_s8::<N>(b)
+}
+
+/// Signed shift left long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sshll2, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vshll_high_n_s16<const N: i32>(a: int16x8_t) -> int32x4_t {
+ static_assert!(N : i32 where N >= 0 && N <= 16);
+ let b: int16x4_t = simd_shuffle4!(a, a, [4, 5, 6, 7]);
+ vshll_n_s16::<N>(b)
+}
+
+/// Signed shift left long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sshll2, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vshll_high_n_s32<const N: i32>(a: int32x4_t) -> int64x2_t {
+ static_assert!(N : i32 where N >= 0 && N <= 32);
+ let b: int32x2_t = simd_shuffle2!(a, a, [2, 3]);
+ vshll_n_s32::<N>(b)
+}
+
+/// Signed shift left long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ushll2, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vshll_high_n_u8<const N: i32>(a: uint8x16_t) -> uint16x8_t {
+ static_assert!(N : i32 where N >= 0 && N <= 8);
+ let b: uint8x8_t = simd_shuffle8!(a, a, [8, 9, 10, 11, 12, 13, 14, 15]);
+ vshll_n_u8::<N>(b)
+}
+
+/// Signed shift left long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ushll2, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vshll_high_n_u16<const N: i32>(a: uint16x8_t) -> uint32x4_t {
+ static_assert!(N : i32 where N >= 0 && N <= 16);
+ let b: uint16x4_t = simd_shuffle4!(a, a, [4, 5, 6, 7]);
+ vshll_n_u16::<N>(b)
+}
+
+/// Signed shift left long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ushll2, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vshll_high_n_u32<const N: i32>(a: uint32x4_t) -> uint64x2_t {
+ static_assert!(N : i32 where N >= 0 && N <= 32);
+ let b: uint32x2_t = simd_shuffle2!(a, a, [2, 3]);
+ vshll_n_u32::<N>(b)
+}
+
+/// Shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(shrn2, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vshrn_high_n_s16<const N: i32>(a: int8x8_t, b: int16x8_t) -> int8x16_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ simd_shuffle16!(a, vshrn_n_s16::<N>(b), [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15])
+}
+
+/// Shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(shrn2, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vshrn_high_n_s32<const N: i32>(a: int16x4_t, b: int32x4_t) -> int16x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ simd_shuffle8!(a, vshrn_n_s32::<N>(b), [0, 1, 2, 3, 4, 5, 6, 7])
+}
+
+/// Shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(shrn2, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vshrn_high_n_s64<const N: i32>(a: int32x2_t, b: int64x2_t) -> int32x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ simd_shuffle4!(a, vshrn_n_s64::<N>(b), [0, 1, 2, 3])
+}
+
+/// Shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(shrn2, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vshrn_high_n_u16<const N: i32>(a: uint8x8_t, b: uint16x8_t) -> uint8x16_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ simd_shuffle16!(a, vshrn_n_u16::<N>(b), [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15])
+}
+
+/// Shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(shrn2, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vshrn_high_n_u32<const N: i32>(a: uint16x4_t, b: uint32x4_t) -> uint16x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ simd_shuffle8!(a, vshrn_n_u32::<N>(b), [0, 1, 2, 3, 4, 5, 6, 7])
+}
+
+/// Shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(shrn2, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vshrn_high_n_u64<const N: i32>(a: uint32x2_t, b: uint64x2_t) -> uint32x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ simd_shuffle4!(a, vshrn_n_u64::<N>(b), [0, 1, 2, 3])
+}
+
+/// SM3PARTW1
+#[inline]
+#[target_feature(enable = "neon,sm4")]
+#[cfg_attr(test, assert_instr(sm3partw1))]
+pub unsafe fn vsm3partw1q_u32(a: uint32x4_t, b: uint32x4_t, c: uint32x4_t) -> uint32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.sm3partw1")]
+ fn vsm3partw1q_u32_(a: uint32x4_t, b: uint32x4_t, c: uint32x4_t) -> uint32x4_t;
+ }
+ vsm3partw1q_u32_(a, b, c)
+}
+
+/// SM3PARTW2
+#[inline]
+#[target_feature(enable = "neon,sm4")]
+#[cfg_attr(test, assert_instr(sm3partw2))]
+pub unsafe fn vsm3partw2q_u32(a: uint32x4_t, b: uint32x4_t, c: uint32x4_t) -> uint32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.sm3partw2")]
+ fn vsm3partw2q_u32_(a: uint32x4_t, b: uint32x4_t, c: uint32x4_t) -> uint32x4_t;
+ }
+ vsm3partw2q_u32_(a, b, c)
+}
+
+/// SM3SS1
+#[inline]
+#[target_feature(enable = "neon,sm4")]
+#[cfg_attr(test, assert_instr(sm3ss1))]
+pub unsafe fn vsm3ss1q_u32(a: uint32x4_t, b: uint32x4_t, c: uint32x4_t) -> uint32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.sm3ss1")]
+ fn vsm3ss1q_u32_(a: uint32x4_t, b: uint32x4_t, c: uint32x4_t) -> uint32x4_t;
+ }
+ vsm3ss1q_u32_(a, b, c)
+}
+
+/// SM4 key
+#[inline]
+#[target_feature(enable = "neon,sm4")]
+#[cfg_attr(test, assert_instr(sm4ekey))]
+pub unsafe fn vsm4ekeyq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.sm4ekey")]
+ fn vsm4ekeyq_u32_(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t;
+ }
+ vsm4ekeyq_u32_(a, b)
+}
+
+/// SM4 encode
+#[inline]
+#[target_feature(enable = "neon,sm4")]
+#[cfg_attr(test, assert_instr(sm4e))]
+pub unsafe fn vsm4eq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.sm4e")]
+ fn vsm4eq_u32_(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t;
+ }
+ vsm4eq_u32_(a, b)
+}
+
+/// Rotate and exclusive OR
+#[inline]
+#[target_feature(enable = "neon,sha3")]
+#[cfg_attr(test, assert_instr(rax1))]
+pub unsafe fn vrax1q_u64(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.rax1")]
+ fn vrax1q_u64_(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t;
+ }
+ vrax1q_u64_(a, b)
+}
+
+/// SHA512 hash update part 1
+#[inline]
+#[target_feature(enable = "neon,sha3")]
+#[cfg_attr(test, assert_instr(sha512h))]
+pub unsafe fn vsha512hq_u64(a: uint64x2_t, b: uint64x2_t, c: uint64x2_t) -> uint64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.sha512h")]
+ fn vsha512hq_u64_(a: uint64x2_t, b: uint64x2_t, c: uint64x2_t) -> uint64x2_t;
+ }
+ vsha512hq_u64_(a, b, c)
+}
+
+/// SHA512 hash update part 2
+#[inline]
+#[target_feature(enable = "neon,sha3")]
+#[cfg_attr(test, assert_instr(sha512h2))]
+pub unsafe fn vsha512h2q_u64(a: uint64x2_t, b: uint64x2_t, c: uint64x2_t) -> uint64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.sha512h2")]
+ fn vsha512h2q_u64_(a: uint64x2_t, b: uint64x2_t, c: uint64x2_t) -> uint64x2_t;
+ }
+ vsha512h2q_u64_(a, b, c)
+}
+
+/// SHA512 schedule update 0
+#[inline]
+#[target_feature(enable = "neon,sha3")]
+#[cfg_attr(test, assert_instr(sha512su0))]
+pub unsafe fn vsha512su0q_u64(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.sha512su0")]
+ fn vsha512su0q_u64_(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t;
+ }
+ vsha512su0q_u64_(a, b)
+}
+
+/// SHA512 schedule update 1
+#[inline]
+#[target_feature(enable = "neon,sha3")]
+#[cfg_attr(test, assert_instr(sha512su1))]
+pub unsafe fn vsha512su1q_u64(a: uint64x2_t, b: uint64x2_t, c: uint64x2_t) -> uint64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.sha512su1")]
+ fn vsha512su1q_u64_(a: uint64x2_t, b: uint64x2_t, c: uint64x2_t) -> uint64x2_t;
+ }
+ vsha512su1q_u64_(a, b, c)
+}
+
+/// Floating-point round to 32-bit integer, using current rounding mode
+#[inline]
+#[target_feature(enable = "neon,frintts")]
+#[cfg_attr(test, assert_instr(frint32x))]
+pub unsafe fn vrnd32x_f32(a: float32x2_t) -> float32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.frint32x.v2f32")]
+ fn vrnd32x_f32_(a: float32x2_t) -> float32x2_t;
+ }
+ vrnd32x_f32_(a)
+}
+
+/// Floating-point round to 32-bit integer, using current rounding mode
+#[inline]
+#[target_feature(enable = "neon,frintts")]
+#[cfg_attr(test, assert_instr(frint32x))]
+pub unsafe fn vrnd32xq_f32(a: float32x4_t) -> float32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.frint32x.v4f32")]
+ fn vrnd32xq_f32_(a: float32x4_t) -> float32x4_t;
+ }
+ vrnd32xq_f32_(a)
+}
+
+/// Floating-point round to 32-bit integer toward zero
+#[inline]
+#[target_feature(enable = "neon,frintts")]
+#[cfg_attr(test, assert_instr(frint32z))]
+pub unsafe fn vrnd32z_f32(a: float32x2_t) -> float32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.frint32z.v2f32")]
+ fn vrnd32z_f32_(a: float32x2_t) -> float32x2_t;
+ }
+ vrnd32z_f32_(a)
+}
+
+/// Floating-point round to 32-bit integer toward zero
+#[inline]
+#[target_feature(enable = "neon,frintts")]
+#[cfg_attr(test, assert_instr(frint32z))]
+pub unsafe fn vrnd32zq_f32(a: float32x4_t) -> float32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.frint32z.v4f32")]
+ fn vrnd32zq_f32_(a: float32x4_t) -> float32x4_t;
+ }
+ vrnd32zq_f32_(a)
+}
+
+/// Floating-point round to 64-bit integer, using current rounding mode
+#[inline]
+#[target_feature(enable = "neon,frintts")]
+#[cfg_attr(test, assert_instr(frint64x))]
+pub unsafe fn vrnd64x_f32(a: float32x2_t) -> float32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.frint64x.v2f32")]
+ fn vrnd64x_f32_(a: float32x2_t) -> float32x2_t;
+ }
+ vrnd64x_f32_(a)
+}
+
+/// Floating-point round to 64-bit integer, using current rounding mode
+#[inline]
+#[target_feature(enable = "neon,frintts")]
+#[cfg_attr(test, assert_instr(frint64x))]
+pub unsafe fn vrnd64xq_f32(a: float32x4_t) -> float32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.frint64x.v4f32")]
+ fn vrnd64xq_f32_(a: float32x4_t) -> float32x4_t;
+ }
+ vrnd64xq_f32_(a)
+}
+
+/// Floating-point round to 64-bit integer toward zero
+#[inline]
+#[target_feature(enable = "neon,frintts")]
+#[cfg_attr(test, assert_instr(frint64z))]
+pub unsafe fn vrnd64z_f32(a: float32x2_t) -> float32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.frint64z.v2f32")]
+ fn vrnd64z_f32_(a: float32x2_t) -> float32x2_t;
+ }
+ vrnd64z_f32_(a)
+}
+
+/// Floating-point round to 64-bit integer toward zero
+#[inline]
+#[target_feature(enable = "neon,frintts")]
+#[cfg_attr(test, assert_instr(frint64z))]
+pub unsafe fn vrnd64zq_f32(a: float32x4_t) -> float32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.frint64z.v4f32")]
+ fn vrnd64zq_f32_(a: float32x4_t) -> float32x4_t;
+ }
+ vrnd64zq_f32_(a)
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(trn1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn1_s8(a: int8x8_t, b: int8x8_t) -> int8x8_t {
+ simd_shuffle8!(a, b, [0, 8, 2, 10, 4, 12, 6, 14])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(trn1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn1q_s8(a: int8x16_t, b: int8x16_t) -> int8x16_t {
+ simd_shuffle16!(a, b, [0, 16, 2, 18, 4, 20, 6, 22, 8, 24, 10, 26, 12, 28, 14, 30])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(trn1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn1_s16(a: int16x4_t, b: int16x4_t) -> int16x4_t {
+ simd_shuffle4!(a, b, [0, 4, 2, 6])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(trn1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn1q_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t {
+ simd_shuffle8!(a, b, [0, 8, 2, 10, 4, 12, 6, 14])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(trn1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn1q_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t {
+ simd_shuffle4!(a, b, [0, 4, 2, 6])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(trn1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn1_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t {
+ simd_shuffle8!(a, b, [0, 8, 2, 10, 4, 12, 6, 14])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(trn1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn1q_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t {
+ simd_shuffle16!(a, b, [0, 16, 2, 18, 4, 20, 6, 22, 8, 24, 10, 26, 12, 28, 14, 30])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(trn1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn1_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t {
+ simd_shuffle4!(a, b, [0, 4, 2, 6])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(trn1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn1q_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t {
+ simd_shuffle8!(a, b, [0, 8, 2, 10, 4, 12, 6, 14])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(trn1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn1q_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
+ simd_shuffle4!(a, b, [0, 4, 2, 6])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(trn1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn1_p8(a: poly8x8_t, b: poly8x8_t) -> poly8x8_t {
+ simd_shuffle8!(a, b, [0, 8, 2, 10, 4, 12, 6, 14])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(trn1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn1q_p8(a: poly8x16_t, b: poly8x16_t) -> poly8x16_t {
+ simd_shuffle16!(a, b, [0, 16, 2, 18, 4, 20, 6, 22, 8, 24, 10, 26, 12, 28, 14, 30])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(trn1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn1_p16(a: poly16x4_t, b: poly16x4_t) -> poly16x4_t {
+ simd_shuffle4!(a, b, [0, 4, 2, 6])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(trn1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn1q_p16(a: poly16x8_t, b: poly16x8_t) -> poly16x8_t {
+ simd_shuffle8!(a, b, [0, 8, 2, 10, 4, 12, 6, 14])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn1_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t {
+ simd_shuffle2!(a, b, [0, 2])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn1q_s64(a: int64x2_t, b: int64x2_t) -> int64x2_t {
+ simd_shuffle2!(a, b, [0, 2])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn1_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t {
+ simd_shuffle2!(a, b, [0, 2])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn1q_u64(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t {
+ simd_shuffle2!(a, b, [0, 2])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn1q_p64(a: poly64x2_t, b: poly64x2_t) -> poly64x2_t {
+ simd_shuffle2!(a, b, [0, 2])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(trn1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn1q_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t {
+ simd_shuffle4!(a, b, [0, 4, 2, 6])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn1_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t {
+ simd_shuffle2!(a, b, [0, 2])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn1q_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t {
+ simd_shuffle2!(a, b, [0, 2])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(trn2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn2_s8(a: int8x8_t, b: int8x8_t) -> int8x8_t {
+ simd_shuffle8!(a, b, [1, 9, 3, 11, 5, 13, 7, 15])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(trn2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn2q_s8(a: int8x16_t, b: int8x16_t) -> int8x16_t {
+ simd_shuffle16!(a, b, [1, 17, 3, 19, 5, 21, 7, 23, 9, 25, 11, 27, 13, 29, 15, 31])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(trn2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn2_s16(a: int16x4_t, b: int16x4_t) -> int16x4_t {
+ simd_shuffle4!(a, b, [1, 5, 3, 7])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(trn2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn2q_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t {
+ simd_shuffle8!(a, b, [1, 9, 3, 11, 5, 13, 7, 15])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(trn2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn2q_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t {
+ simd_shuffle4!(a, b, [1, 5, 3, 7])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(trn2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn2_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t {
+ simd_shuffle8!(a, b, [1, 9, 3, 11, 5, 13, 7, 15])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(trn2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn2q_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t {
+ simd_shuffle16!(a, b, [1, 17, 3, 19, 5, 21, 7, 23, 9, 25, 11, 27, 13, 29, 15, 31])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(trn2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn2_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t {
+ simd_shuffle4!(a, b, [1, 5, 3, 7])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(trn2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn2q_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t {
+ simd_shuffle8!(a, b, [1, 9, 3, 11, 5, 13, 7, 15])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(trn2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn2q_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
+ simd_shuffle4!(a, b, [1, 5, 3, 7])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(trn2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn2_p8(a: poly8x8_t, b: poly8x8_t) -> poly8x8_t {
+ simd_shuffle8!(a, b, [1, 9, 3, 11, 5, 13, 7, 15])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(trn2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn2q_p8(a: poly8x16_t, b: poly8x16_t) -> poly8x16_t {
+ simd_shuffle16!(a, b, [1, 17, 3, 19, 5, 21, 7, 23, 9, 25, 11, 27, 13, 29, 15, 31])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(trn2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn2_p16(a: poly16x4_t, b: poly16x4_t) -> poly16x4_t {
+ simd_shuffle4!(a, b, [1, 5, 3, 7])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(trn2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn2q_p16(a: poly16x8_t, b: poly16x8_t) -> poly16x8_t {
+ simd_shuffle8!(a, b, [1, 9, 3, 11, 5, 13, 7, 15])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn2_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t {
+ simd_shuffle2!(a, b, [1, 3])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn2q_s64(a: int64x2_t, b: int64x2_t) -> int64x2_t {
+ simd_shuffle2!(a, b, [1, 3])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn2_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t {
+ simd_shuffle2!(a, b, [1, 3])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn2q_u64(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t {
+ simd_shuffle2!(a, b, [1, 3])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn2q_p64(a: poly64x2_t, b: poly64x2_t) -> poly64x2_t {
+ simd_shuffle2!(a, b, [1, 3])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(trn2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn2q_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t {
+ simd_shuffle4!(a, b, [1, 5, 3, 7])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn2_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t {
+ simd_shuffle2!(a, b, [1, 3])
+}
+
+/// Transpose vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtrn2q_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t {
+ simd_shuffle2!(a, b, [1, 3])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip1_s8(a: int8x8_t, b: int8x8_t) -> int8x8_t {
+ simd_shuffle8!(a, b, [0, 8, 1, 9, 2, 10, 3, 11])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip1q_s8(a: int8x16_t, b: int8x16_t) -> int8x16_t {
+ simd_shuffle16!(a, b, [0, 16, 1, 17, 2, 18, 3, 19, 4, 20, 5, 21, 6, 22, 7, 23])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip1_s16(a: int16x4_t, b: int16x4_t) -> int16x4_t {
+ simd_shuffle4!(a, b, [0, 4, 1, 5])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip1q_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t {
+ simd_shuffle8!(a, b, [0, 8, 1, 9, 2, 10, 3, 11])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip1_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t {
+ simd_shuffle2!(a, b, [0, 2])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip1q_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t {
+ simd_shuffle4!(a, b, [0, 4, 1, 5])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip1q_s64(a: int64x2_t, b: int64x2_t) -> int64x2_t {
+ simd_shuffle2!(a, b, [0, 2])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip1_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t {
+ simd_shuffle8!(a, b, [0, 8, 1, 9, 2, 10, 3, 11])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip1q_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t {
+ simd_shuffle16!(a, b, [0, 16, 1, 17, 2, 18, 3, 19, 4, 20, 5, 21, 6, 22, 7, 23])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip1_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t {
+ simd_shuffle4!(a, b, [0, 4, 1, 5])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip1q_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t {
+ simd_shuffle8!(a, b, [0, 8, 1, 9, 2, 10, 3, 11])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip1_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t {
+ simd_shuffle2!(a, b, [0, 2])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip1q_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
+ simd_shuffle4!(a, b, [0, 4, 1, 5])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip1q_u64(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t {
+ simd_shuffle2!(a, b, [0, 2])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip1_p8(a: poly8x8_t, b: poly8x8_t) -> poly8x8_t {
+ simd_shuffle8!(a, b, [0, 8, 1, 9, 2, 10, 3, 11])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip1q_p8(a: poly8x16_t, b: poly8x16_t) -> poly8x16_t {
+ simd_shuffle16!(a, b, [0, 16, 1, 17, 2, 18, 3, 19, 4, 20, 5, 21, 6, 22, 7, 23])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip1_p16(a: poly16x4_t, b: poly16x4_t) -> poly16x4_t {
+ simd_shuffle4!(a, b, [0, 4, 1, 5])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip1q_p16(a: poly16x8_t, b: poly16x8_t) -> poly16x8_t {
+ simd_shuffle8!(a, b, [0, 8, 1, 9, 2, 10, 3, 11])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip1q_p64(a: poly64x2_t, b: poly64x2_t) -> poly64x2_t {
+ simd_shuffle2!(a, b, [0, 2])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip1_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t {
+ simd_shuffle2!(a, b, [0, 2])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip1q_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t {
+ simd_shuffle4!(a, b, [0, 4, 1, 5])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip1q_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t {
+ simd_shuffle2!(a, b, [0, 2])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip2_s8(a: int8x8_t, b: int8x8_t) -> int8x8_t {
+ simd_shuffle8!(a, b, [4, 12, 5, 13, 6, 14, 7, 15])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip2q_s8(a: int8x16_t, b: int8x16_t) -> int8x16_t {
+ simd_shuffle16!(a, b, [8, 24, 9, 25, 10, 26, 11, 27, 12, 28, 13, 29, 14, 30, 15, 31])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip2_s16(a: int16x4_t, b: int16x4_t) -> int16x4_t {
+ simd_shuffle4!(a, b, [2, 6, 3, 7])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip2q_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t {
+ simd_shuffle8!(a, b, [4, 12, 5, 13, 6, 14, 7, 15])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip2_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t {
+ simd_shuffle2!(a, b, [1, 3])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip2q_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t {
+ simd_shuffle4!(a, b, [2, 6, 3, 7])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip2q_s64(a: int64x2_t, b: int64x2_t) -> int64x2_t {
+ simd_shuffle2!(a, b, [1, 3])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip2_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t {
+ simd_shuffle8!(a, b, [4, 12, 5, 13, 6, 14, 7, 15])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip2q_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t {
+ simd_shuffle16!(a, b, [8, 24, 9, 25, 10, 26, 11, 27, 12, 28, 13, 29, 14, 30, 15, 31])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip2_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t {
+ simd_shuffle4!(a, b, [2, 6, 3, 7])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip2q_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t {
+ simd_shuffle8!(a, b, [4, 12, 5, 13, 6, 14, 7, 15])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip2_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t {
+ simd_shuffle2!(a, b, [1, 3])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip2q_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
+ simd_shuffle4!(a, b, [2, 6, 3, 7])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip2q_u64(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t {
+ simd_shuffle2!(a, b, [1, 3])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip2_p8(a: poly8x8_t, b: poly8x8_t) -> poly8x8_t {
+ simd_shuffle8!(a, b, [4, 12, 5, 13, 6, 14, 7, 15])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip2q_p8(a: poly8x16_t, b: poly8x16_t) -> poly8x16_t {
+ simd_shuffle16!(a, b, [8, 24, 9, 25, 10, 26, 11, 27, 12, 28, 13, 29, 14, 30, 15, 31])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip2_p16(a: poly16x4_t, b: poly16x4_t) -> poly16x4_t {
+ simd_shuffle4!(a, b, [2, 6, 3, 7])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip2q_p16(a: poly16x8_t, b: poly16x8_t) -> poly16x8_t {
+ simd_shuffle8!(a, b, [4, 12, 5, 13, 6, 14, 7, 15])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip2q_p64(a: poly64x2_t, b: poly64x2_t) -> poly64x2_t {
+ simd_shuffle2!(a, b, [1, 3])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip2_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t {
+ simd_shuffle2!(a, b, [1, 3])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip2q_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t {
+ simd_shuffle4!(a, b, [2, 6, 3, 7])
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vzip2q_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t {
+ simd_shuffle2!(a, b, [1, 3])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uzp1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp1_s8(a: int8x8_t, b: int8x8_t) -> int8x8_t {
+ simd_shuffle8!(a, b, [0, 2, 4, 6, 8, 10, 12, 14])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uzp1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp1q_s8(a: int8x16_t, b: int8x16_t) -> int8x16_t {
+ simd_shuffle16!(a, b, [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uzp1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp1_s16(a: int16x4_t, b: int16x4_t) -> int16x4_t {
+ simd_shuffle4!(a, b, [0, 2, 4, 6])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uzp1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp1q_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t {
+ simd_shuffle8!(a, b, [0, 2, 4, 6, 8, 10, 12, 14])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uzp1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp1q_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t {
+ simd_shuffle4!(a, b, [0, 2, 4, 6])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uzp1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp1_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t {
+ simd_shuffle8!(a, b, [0, 2, 4, 6, 8, 10, 12, 14])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uzp1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp1q_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t {
+ simd_shuffle16!(a, b, [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uzp1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp1_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t {
+ simd_shuffle4!(a, b, [0, 2, 4, 6])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uzp1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp1q_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t {
+ simd_shuffle8!(a, b, [0, 2, 4, 6, 8, 10, 12, 14])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uzp1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp1q_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
+ simd_shuffle4!(a, b, [0, 2, 4, 6])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uzp1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp1_p8(a: poly8x8_t, b: poly8x8_t) -> poly8x8_t {
+ simd_shuffle8!(a, b, [0, 2, 4, 6, 8, 10, 12, 14])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uzp1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp1q_p8(a: poly8x16_t, b: poly8x16_t) -> poly8x16_t {
+ simd_shuffle16!(a, b, [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uzp1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp1_p16(a: poly16x4_t, b: poly16x4_t) -> poly16x4_t {
+ simd_shuffle4!(a, b, [0, 2, 4, 6])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uzp1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp1q_p16(a: poly16x8_t, b: poly16x8_t) -> poly16x8_t {
+ simd_shuffle8!(a, b, [0, 2, 4, 6, 8, 10, 12, 14])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp1_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t {
+ simd_shuffle2!(a, b, [0, 2])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp1q_s64(a: int64x2_t, b: int64x2_t) -> int64x2_t {
+ simd_shuffle2!(a, b, [0, 2])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp1_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t {
+ simd_shuffle2!(a, b, [0, 2])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp1q_u64(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t {
+ simd_shuffle2!(a, b, [0, 2])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp1q_p64(a: poly64x2_t, b: poly64x2_t) -> poly64x2_t {
+ simd_shuffle2!(a, b, [0, 2])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uzp1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp1q_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t {
+ simd_shuffle4!(a, b, [0, 2, 4, 6])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp1_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t {
+ simd_shuffle2!(a, b, [0, 2])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp1q_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t {
+ simd_shuffle2!(a, b, [0, 2])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uzp2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp2_s8(a: int8x8_t, b: int8x8_t) -> int8x8_t {
+ simd_shuffle8!(a, b, [1, 3, 5, 7, 9, 11, 13, 15])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uzp2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp2q_s8(a: int8x16_t, b: int8x16_t) -> int8x16_t {
+ simd_shuffle16!(a, b, [1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uzp2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp2_s16(a: int16x4_t, b: int16x4_t) -> int16x4_t {
+ simd_shuffle4!(a, b, [1, 3, 5, 7])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uzp2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp2q_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t {
+ simd_shuffle8!(a, b, [1, 3, 5, 7, 9, 11, 13, 15])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uzp2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp2q_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t {
+ simd_shuffle4!(a, b, [1, 3, 5, 7])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uzp2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp2_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t {
+ simd_shuffle8!(a, b, [1, 3, 5, 7, 9, 11, 13, 15])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uzp2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp2q_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t {
+ simd_shuffle16!(a, b, [1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uzp2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp2_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t {
+ simd_shuffle4!(a, b, [1, 3, 5, 7])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uzp2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp2q_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t {
+ simd_shuffle8!(a, b, [1, 3, 5, 7, 9, 11, 13, 15])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uzp2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp2q_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
+ simd_shuffle4!(a, b, [1, 3, 5, 7])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uzp2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp2_p8(a: poly8x8_t, b: poly8x8_t) -> poly8x8_t {
+ simd_shuffle8!(a, b, [1, 3, 5, 7, 9, 11, 13, 15])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uzp2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp2q_p8(a: poly8x16_t, b: poly8x16_t) -> poly8x16_t {
+ simd_shuffle16!(a, b, [1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uzp2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp2_p16(a: poly16x4_t, b: poly16x4_t) -> poly16x4_t {
+ simd_shuffle4!(a, b, [1, 3, 5, 7])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uzp2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp2q_p16(a: poly16x8_t, b: poly16x8_t) -> poly16x8_t {
+ simd_shuffle8!(a, b, [1, 3, 5, 7, 9, 11, 13, 15])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp2_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t {
+ simd_shuffle2!(a, b, [1, 3])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp2q_s64(a: int64x2_t, b: int64x2_t) -> int64x2_t {
+ simd_shuffle2!(a, b, [1, 3])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp2_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t {
+ simd_shuffle2!(a, b, [1, 3])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp2q_u64(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t {
+ simd_shuffle2!(a, b, [1, 3])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp2q_p64(a: poly64x2_t, b: poly64x2_t) -> poly64x2_t {
+ simd_shuffle2!(a, b, [1, 3])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uzp2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp2q_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t {
+ simd_shuffle4!(a, b, [1, 3, 5, 7])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp2_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t {
+ simd_shuffle2!(a, b, [1, 3])
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(zip2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuzp2q_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t {
+ simd_shuffle2!(a, b, [1, 3])
+}
+
+/// Unsigned Absolute difference and Accumulate Long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uabal))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vabal_high_u8(a: uint16x8_t, b: uint8x16_t, c: uint8x16_t) -> uint16x8_t {
+ let d: uint8x8_t = simd_shuffle8!(b, b, [8, 9, 10, 11, 12, 13, 14, 15]);
+ let e: uint8x8_t = simd_shuffle8!(c, c, [8, 9, 10, 11, 12, 13, 14, 15]);
+ let f: uint8x8_t = vabd_u8(d, e);
+ simd_add(a, simd_cast(f))
+}
+
+/// Unsigned Absolute difference and Accumulate Long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uabal))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vabal_high_u16(a: uint32x4_t, b: uint16x8_t, c: uint16x8_t) -> uint32x4_t {
+ let d: uint16x4_t = simd_shuffle4!(b, b, [4, 5, 6, 7]);
+ let e: uint16x4_t = simd_shuffle4!(c, c, [4, 5, 6, 7]);
+ let f: uint16x4_t = vabd_u16(d, e);
+ simd_add(a, simd_cast(f))
+}
+
+/// Unsigned Absolute difference and Accumulate Long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uabal))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vabal_high_u32(a: uint64x2_t, b: uint32x4_t, c: uint32x4_t) -> uint64x2_t {
+ let d: uint32x2_t = simd_shuffle2!(b, b, [2, 3]);
+ let e: uint32x2_t = simd_shuffle2!(c, c, [2, 3]);
+ let f: uint32x2_t = vabd_u32(d, e);
+ simd_add(a, simd_cast(f))
+}
+
+/// Signed Absolute difference and Accumulate Long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sabal))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vabal_high_s8(a: int16x8_t, b: int8x16_t, c: int8x16_t) -> int16x8_t {
+ let d: int8x8_t = simd_shuffle8!(b, b, [8, 9, 10, 11, 12, 13, 14, 15]);
+ let e: int8x8_t = simd_shuffle8!(c, c, [8, 9, 10, 11, 12, 13, 14, 15]);
+ let f: int8x8_t = vabd_s8(d, e);
+ let f: uint8x8_t = simd_cast(f);
+ simd_add(a, simd_cast(f))
+}
+
+/// Signed Absolute difference and Accumulate Long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sabal))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vabal_high_s16(a: int32x4_t, b: int16x8_t, c: int16x8_t) -> int32x4_t {
+ let d: int16x4_t = simd_shuffle4!(b, b, [4, 5, 6, 7]);
+ let e: int16x4_t = simd_shuffle4!(c, c, [4, 5, 6, 7]);
+ let f: int16x4_t = vabd_s16(d, e);
+ let f: uint16x4_t = simd_cast(f);
+ simd_add(a, simd_cast(f))
+}
+
+/// Signed Absolute difference and Accumulate Long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sabal))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vabal_high_s32(a: int64x2_t, b: int32x4_t, c: int32x4_t) -> int64x2_t {
+ let d: int32x2_t = simd_shuffle2!(b, b, [2, 3]);
+ let e: int32x2_t = simd_shuffle2!(c, c, [2, 3]);
+ let f: int32x2_t = vabd_s32(d, e);
+ let f: uint32x2_t = simd_cast(f);
+ simd_add(a, simd_cast(f))
+}
+
+/// Singned saturating Absolute value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqabs))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqabs_s64(a: int64x1_t) -> int64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqabs.v1i64")]
+ fn vqabs_s64_(a: int64x1_t) -> int64x1_t;
+ }
+ vqabs_s64_(a)
+}
+
+/// Singned saturating Absolute value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqabs))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqabsq_s64(a: int64x2_t) -> int64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqabs.v2i64")]
+ fn vqabsq_s64_(a: int64x2_t) -> int64x2_t;
+ }
+ vqabsq_s64_(a)
+}
+
+/// Signed saturating absolute value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqabs))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqabsb_s8(a: i8) -> i8 {
+ simd_extract(vqabs_s8(vdup_n_s8(a)), 0)
+}
+
+/// Signed saturating absolute value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqabs))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqabsh_s16(a: i16) -> i16 {
+ simd_extract(vqabs_s16(vdup_n_s16(a)), 0)
+}
+
+/// Signed saturating absolute value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqabs))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqabss_s32(a: i32) -> i32 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqabs.i32")]
+ fn vqabss_s32_(a: i32) -> i32;
+ }
+ vqabss_s32_(a)
+}
+
+/// Signed saturating absolute value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqabs))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqabsd_s64(a: i64) -> i64 {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqabs.i64")]
+ fn vqabsd_s64_(a: i64) -> i64;
+ }
+ vqabsd_s64_(a)
+}
+
+/// Shift left and insert
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sli, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vslid_n_s64<const N: i32>(a: i64, b: i64) -> i64 {
+ static_assert!(N : i32 where N >= 0 && N <= 63);
+ transmute(vsli_n_s64::<N>(transmute(a), transmute(b)))
+}
+
+/// Shift left and insert
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sli, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vslid_n_u64<const N: i32>(a: u64, b: u64) -> u64 {
+ static_assert!(N : i32 where N >= 0 && N <= 63);
+ transmute(vsli_n_u64::<N>(transmute(a), transmute(b)))
+}
+
+/// Shift right and insert
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sri, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsrid_n_s64<const N: i32>(a: i64, b: i64) -> i64 {
+ static_assert!(N : i32 where N >= 1 && N <= 64);
+ transmute(vsri_n_s64::<N>(transmute(a), transmute(b)))
+}
+
+/// Shift right and insert
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sri, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsrid_n_u64<const N: i32>(a: u64, b: u64) -> u64 {
+ static_assert!(N : i32 where N >= 1 && N <= 64);
+ transmute(vsri_n_u64::<N>(transmute(a), transmute(b)))
+}
+
+#[cfg(test)]
+mod test {
+ use super::*;
+ use crate::core_arch::simd::*;
+ use std::mem::transmute;
+ use stdarch_test::simd_test;
+
+ #[simd_test(enable = "neon,sha3")]
+ unsafe fn test_veor3q_s8() {
+ let a: i8x16 = i8x16::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F);
+ let b: i8x16 = i8x16::new(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
+ let c: i8x16 = i8x16::new(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
+ let e: i8x16 = i8x16::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F);
+ let r: i8x16 = transmute(veor3q_s8(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon,sha3")]
+ unsafe fn test_veor3q_s16() {
+ let a: i16x8 = i16x8::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let b: i16x8 = i16x8::new(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
+ let c: i16x8 = i16x8::new(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
+ let e: i16x8 = i16x8::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let r: i16x8 = transmute(veor3q_s16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon,sha3")]
+ unsafe fn test_veor3q_s32() {
+ let a: i32x4 = i32x4::new(0x00, 0x01, 0x02, 0x03);
+ let b: i32x4 = i32x4::new(0x00, 0x00, 0x00, 0x00);
+ let c: i32x4 = i32x4::new(0x00, 0x00, 0x00, 0x00);
+ let e: i32x4 = i32x4::new(0x00, 0x01, 0x02, 0x03);
+ let r: i32x4 = transmute(veor3q_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon,sha3")]
+ unsafe fn test_veor3q_s64() {
+ let a: i64x2 = i64x2::new(0x00, 0x01);
+ let b: i64x2 = i64x2::new(0x00, 0x00);
+ let c: i64x2 = i64x2::new(0x00, 0x00);
+ let e: i64x2 = i64x2::new(0x00, 0x01);
+ let r: i64x2 = transmute(veor3q_s64(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon,sha3")]
+ unsafe fn test_veor3q_u8() {
+ let a: u8x16 = u8x16::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F);
+ let b: u8x16 = u8x16::new(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
+ let c: u8x16 = u8x16::new(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
+ let e: u8x16 = u8x16::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F);
+ let r: u8x16 = transmute(veor3q_u8(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon,sha3")]
+ unsafe fn test_veor3q_u16() {
+ let a: u16x8 = u16x8::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let b: u16x8 = u16x8::new(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
+ let c: u16x8 = u16x8::new(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
+ let e: u16x8 = u16x8::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let r: u16x8 = transmute(veor3q_u16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon,sha3")]
+ unsafe fn test_veor3q_u32() {
+ let a: u32x4 = u32x4::new(0x00, 0x01, 0x02, 0x03);
+ let b: u32x4 = u32x4::new(0x00, 0x00, 0x00, 0x00);
+ let c: u32x4 = u32x4::new(0x00, 0x00, 0x00, 0x00);
+ let e: u32x4 = u32x4::new(0x00, 0x01, 0x02, 0x03);
+ let r: u32x4 = transmute(veor3q_u32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon,sha3")]
+ unsafe fn test_veor3q_u64() {
+ let a: u64x2 = u64x2::new(0x00, 0x01);
+ let b: u64x2 = u64x2::new(0x00, 0x00);
+ let c: u64x2 = u64x2::new(0x00, 0x00);
+ let e: u64x2 = u64x2::new(0x00, 0x01);
+ let r: u64x2 = transmute(veor3q_u64(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabd_f64() {
+ let a: f64 = 1.0;
+ let b: f64 = 9.0;
+ let e: f64 = 8.0;
+ let r: f64 = transmute(vabd_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabdq_f64() {
+ let a: f64x2 = f64x2::new(1.0, 2.0);
+ let b: f64x2 = f64x2::new(9.0, 3.0);
+ let e: f64x2 = f64x2::new(8.0, 1.0);
+ let r: f64x2 = transmute(vabdq_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabds_f32() {
+ let a: f32 = 1.0;
+ let b: f32 = 9.0;
+ let e: f32 = 8.0;
+ let r: f32 = transmute(vabds_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabdd_f64() {
+ let a: f64 = 1.0;
+ let b: f64 = 9.0;
+ let e: f64 = 8.0;
+ let r: f64 = transmute(vabdd_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabdl_high_u8() {
+ let a: u8x16 = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let b: u8x16 = u8x16::new(10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10);
+ let e: u16x8 = u16x8::new(1, 0, 1, 2, 3, 4, 5, 6);
+ let r: u16x8 = transmute(vabdl_high_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabdl_high_u16() {
+ let a: u16x8 = u16x8::new(1, 2, 3, 4, 8, 9, 11, 12);
+ let b: u16x8 = u16x8::new(10, 10, 10, 10, 10, 10, 10, 10);
+ let e: u32x4 = u32x4::new(2, 1, 1, 2);
+ let r: u32x4 = transmute(vabdl_high_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabdl_high_u32() {
+ let a: u32x4 = u32x4::new(1, 2, 3, 4);
+ let b: u32x4 = u32x4::new(10, 10, 10, 10);
+ let e: u64x2 = u64x2::new(7, 6);
+ let r: u64x2 = transmute(vabdl_high_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabdl_high_s8() {
+ let a: i8x16 = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let b: i8x16 = i8x16::new(10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10);
+ let e: i16x8 = i16x8::new(1, 0, 1, 2, 3, 4, 5, 6);
+ let r: i16x8 = transmute(vabdl_high_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabdl_high_s16() {
+ let a: i16x8 = i16x8::new(1, 2, 3, 4, 9, 10, 11, 12);
+ let b: i16x8 = i16x8::new(10, 10, 10, 10, 10, 10, 10, 10);
+ let e: i32x4 = i32x4::new(1, 0, 1, 2);
+ let r: i32x4 = transmute(vabdl_high_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabdl_high_s32() {
+ let a: i32x4 = i32x4::new(1, 2, 3, 4);
+ let b: i32x4 = i32x4::new(10, 10, 10, 10);
+ let e: i64x2 = i64x2::new(7, 6);
+ let r: i64x2 = transmute(vabdl_high_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceq_u64() {
+ let a: u64x1 = u64x1::new(0);
+ let b: u64x1 = u64x1::new(0);
+ let e: u64x1 = u64x1::new(0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x1 = transmute(vceq_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+
+ let a: u64x1 = u64x1::new(0);
+ let b: u64x1 = u64x1::new(0);
+ let e: u64x1 = u64x1::new(0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x1 = transmute(vceq_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqq_u64() {
+ let a: u64x2 = u64x2::new(0, 0x01);
+ let b: u64x2 = u64x2::new(0, 0x01);
+ let e: u64x2 = u64x2::new(0xFF_FF_FF_FF_FF_FF_FF_FF, 0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x2 = transmute(vceqq_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+
+ let a: u64x2 = u64x2::new(0, 0);
+ let b: u64x2 = u64x2::new(0, 0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let e: u64x2 = u64x2::new(0xFF_FF_FF_FF_FF_FF_FF_FF, 0);
+ let r: u64x2 = transmute(vceqq_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceq_s64() {
+ let a: i64x1 = i64x1::new(-9223372036854775808);
+ let b: i64x1 = i64x1::new(-9223372036854775808);
+ let e: u64x1 = u64x1::new(0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x1 = transmute(vceq_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+
+ let a: i64x1 = i64x1::new(-9223372036854775808);
+ let b: i64x1 = i64x1::new(-9223372036854775808);
+ let e: u64x1 = u64x1::new(0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x1 = transmute(vceq_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqq_s64() {
+ let a: i64x2 = i64x2::new(-9223372036854775808, 0x01);
+ let b: i64x2 = i64x2::new(-9223372036854775808, 0x01);
+ let e: u64x2 = u64x2::new(0xFF_FF_FF_FF_FF_FF_FF_FF, 0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x2 = transmute(vceqq_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+
+ let a: i64x2 = i64x2::new(-9223372036854775808, -9223372036854775808);
+ let b: i64x2 = i64x2::new(-9223372036854775808, 0x7F_FF_FF_FF_FF_FF_FF_FF);
+ let e: u64x2 = u64x2::new(0xFF_FF_FF_FF_FF_FF_FF_FF, 0);
+ let r: u64x2 = transmute(vceqq_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceq_p64() {
+ let a: i64x1 = i64x1::new(-9223372036854775808);
+ let b: i64x1 = i64x1::new(-9223372036854775808);
+ let e: u64x1 = u64x1::new(0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x1 = transmute(vceq_p64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+
+ let a: i64x1 = i64x1::new(-9223372036854775808);
+ let b: i64x1 = i64x1::new(-9223372036854775808);
+ let e: u64x1 = u64x1::new(0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x1 = transmute(vceq_p64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqq_p64() {
+ let a: i64x2 = i64x2::new(-9223372036854775808, 0x01);
+ let b: i64x2 = i64x2::new(-9223372036854775808, 0x01);
+ let e: u64x2 = u64x2::new(0xFF_FF_FF_FF_FF_FF_FF_FF, 0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x2 = transmute(vceqq_p64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+
+ let a: i64x2 = i64x2::new(-9223372036854775808, -9223372036854775808);
+ let b: i64x2 = i64x2::new(-9223372036854775808, 0x7F_FF_FF_FF_FF_FF_FF_FF);
+ let e: u64x2 = u64x2::new(0xFF_FF_FF_FF_FF_FF_FF_FF, 0);
+ let r: u64x2 = transmute(vceqq_p64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceq_f64() {
+ let a: f64 = 1.2;
+ let b: f64 = 1.2;
+ let e: u64x1 = u64x1::new(0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x1 = transmute(vceq_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqq_f64() {
+ let a: f64x2 = f64x2::new(1.2, 3.4);
+ let b: f64x2 = f64x2::new(1.2, 3.4);
+ let e: u64x2 = u64x2::new(0xFF_FF_FF_FF_FF_FF_FF_FF, 0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x2 = transmute(vceqq_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqd_s64() {
+ let a: i64 = 1;
+ let b: i64 = 2;
+ let e: u64 = 0;
+ let r: u64 = transmute(vceqd_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqd_u64() {
+ let a: u64 = 1;
+ let b: u64 = 2;
+ let e: u64 = 0;
+ let r: u64 = transmute(vceqd_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqs_f32() {
+ let a: f32 = 1.;
+ let b: f32 = 2.;
+ let e: u32 = 0;
+ let r: u32 = transmute(vceqs_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqd_f64() {
+ let a: f64 = 1.;
+ let b: f64 = 2.;
+ let e: u64 = 0;
+ let r: u64 = transmute(vceqd_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqz_s8() {
+ let a: i8x8 = i8x8::new(-128, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06);
+ let e: u8x8 = u8x8::new(0, 0xFF, 0, 0, 0, 0, 0, 0);
+ let r: u8x8 = transmute(vceqz_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqzq_s8() {
+ let a: i8x16 = i8x16::new(-128, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x7F);
+ let e: u8x16 = u8x16::new(0, 0xFF, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ let r: u8x16 = transmute(vceqzq_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqz_s16() {
+ let a: i16x4 = i16x4::new(-32768, 0x00, 0x01, 0x02);
+ let e: u16x4 = u16x4::new(0, 0xFF_FF, 0, 0);
+ let r: u16x4 = transmute(vceqz_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqzq_s16() {
+ let a: i16x8 = i16x8::new(-32768, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06);
+ let e: u16x8 = u16x8::new(0, 0xFF_FF, 0, 0, 0, 0, 0, 0);
+ let r: u16x8 = transmute(vceqzq_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqz_s32() {
+ let a: i32x2 = i32x2::new(-2147483648, 0x00);
+ let e: u32x2 = u32x2::new(0, 0xFF_FF_FF_FF);
+ let r: u32x2 = transmute(vceqz_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqzq_s32() {
+ let a: i32x4 = i32x4::new(-2147483648, 0x00, 0x01, 0x02);
+ let e: u32x4 = u32x4::new(0, 0xFF_FF_FF_FF, 0, 0);
+ let r: u32x4 = transmute(vceqzq_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqz_s64() {
+ let a: i64x1 = i64x1::new(-9223372036854775808);
+ let e: u64x1 = u64x1::new(0);
+ let r: u64x1 = transmute(vceqz_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqzq_s64() {
+ let a: i64x2 = i64x2::new(-9223372036854775808, 0x00);
+ let e: u64x2 = u64x2::new(0, 0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x2 = transmute(vceqzq_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqz_p8() {
+ let a: i8x8 = i8x8::new(-128, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06);
+ let e: u8x8 = u8x8::new(0, 0xFF, 0, 0, 0, 0, 0, 0);
+ let r: u8x8 = transmute(vceqz_p8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqzq_p8() {
+ let a: i8x16 = i8x16::new(-128, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x7F);
+ let e: u8x16 = u8x16::new(0, 0xFF, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ let r: u8x16 = transmute(vceqzq_p8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqz_p64() {
+ let a: i64x1 = i64x1::new(-9223372036854775808);
+ let e: u64x1 = u64x1::new(0);
+ let r: u64x1 = transmute(vceqz_p64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqzq_p64() {
+ let a: i64x2 = i64x2::new(-9223372036854775808, 0x00);
+ let e: u64x2 = u64x2::new(0, 0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x2 = transmute(vceqzq_p64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqz_u8() {
+ let a: u8x8 = u8x8::new(0, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06);
+ let e: u8x8 = u8x8::new(0xFF, 0xFF, 0, 0, 0, 0, 0, 0);
+ let r: u8x8 = transmute(vceqz_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqzq_u8() {
+ let a: u8x16 = u8x16::new(0, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0xFF);
+ let e: u8x16 = u8x16::new(0xFF, 0xFF, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ let r: u8x16 = transmute(vceqzq_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqz_u16() {
+ let a: u16x4 = u16x4::new(0, 0x00, 0x01, 0x02);
+ let e: u16x4 = u16x4::new(0xFF_FF, 0xFF_FF, 0, 0);
+ let r: u16x4 = transmute(vceqz_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqzq_u16() {
+ let a: u16x8 = u16x8::new(0, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06);
+ let e: u16x8 = u16x8::new(0xFF_FF, 0xFF_FF, 0, 0, 0, 0, 0, 0);
+ let r: u16x8 = transmute(vceqzq_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqz_u32() {
+ let a: u32x2 = u32x2::new(0, 0x00);
+ let e: u32x2 = u32x2::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let r: u32x2 = transmute(vceqz_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqzq_u32() {
+ let a: u32x4 = u32x4::new(0, 0x00, 0x01, 0x02);
+ let e: u32x4 = u32x4::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0, 0);
+ let r: u32x4 = transmute(vceqzq_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqz_u64() {
+ let a: u64x1 = u64x1::new(0);
+ let e: u64x1 = u64x1::new(0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x1 = transmute(vceqz_u64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqzq_u64() {
+ let a: u64x2 = u64x2::new(0, 0x00);
+ let e: u64x2 = u64x2::new(0xFF_FF_FF_FF_FF_FF_FF_FF, 0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x2 = transmute(vceqzq_u64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqz_f32() {
+ let a: f32x2 = f32x2::new(0.0, 1.2);
+ let e: u32x2 = u32x2::new(0xFF_FF_FF_FF, 0);
+ let r: u32x2 = transmute(vceqz_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqzq_f32() {
+ let a: f32x4 = f32x4::new(0.0, 1.2, 3.4, 5.6);
+ let e: u32x4 = u32x4::new(0xFF_FF_FF_FF, 0, 0, 0);
+ let r: u32x4 = transmute(vceqzq_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqz_f64() {
+ let a: f64 = 0.0;
+ let e: u64x1 = u64x1::new(0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x1 = transmute(vceqz_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqzq_f64() {
+ let a: f64x2 = f64x2::new(0.0, 1.2);
+ let e: u64x2 = u64x2::new(0xFF_FF_FF_FF_FF_FF_FF_FF, 0);
+ let r: u64x2 = transmute(vceqzq_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqzd_s64() {
+ let a: i64 = 1;
+ let e: u64 = 0;
+ let r: u64 = transmute(vceqzd_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqzd_u64() {
+ let a: u64 = 1;
+ let e: u64 = 0;
+ let r: u64 = transmute(vceqzd_u64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqzs_f32() {
+ let a: f32 = 1.;
+ let e: u32 = 0;
+ let r: u32 = transmute(vceqzs_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqzd_f64() {
+ let a: f64 = 1.;
+ let e: u64 = 0;
+ let r: u64 = transmute(vceqzd_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtst_s64() {
+ let a: i64x1 = i64x1::new(-9223372036854775808);
+ let b: i64x1 = i64x1::new(-9223372036854775808);
+ let e: u64x1 = u64x1::new(0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x1 = transmute(vtst_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtstq_s64() {
+ let a: i64x2 = i64x2::new(-9223372036854775808, 0x00);
+ let b: i64x2 = i64x2::new(-9223372036854775808, 0x00);
+ let e: u64x2 = u64x2::new(0xFF_FF_FF_FF_FF_FF_FF_FF, 0);
+ let r: u64x2 = transmute(vtstq_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtst_p64() {
+ let a: i64x1 = i64x1::new(-9223372036854775808);
+ let b: i64x1 = i64x1::new(-9223372036854775808);
+ let e: u64x1 = u64x1::new(0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x1 = transmute(vtst_p64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtstq_p64() {
+ let a: i64x2 = i64x2::new(-9223372036854775808, 0x00);
+ let b: i64x2 = i64x2::new(-9223372036854775808, 0x00);
+ let e: u64x2 = u64x2::new(0xFF_FF_FF_FF_FF_FF_FF_FF, 0);
+ let r: u64x2 = transmute(vtstq_p64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtst_u64() {
+ let a: u64x1 = u64x1::new(0);
+ let b: u64x1 = u64x1::new(0);
+ let e: u64x1 = u64x1::new(0);
+ let r: u64x1 = transmute(vtst_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtstq_u64() {
+ let a: u64x2 = u64x2::new(0, 0x00);
+ let b: u64x2 = u64x2::new(0, 0x00);
+ let e: u64x2 = u64x2::new(0, 0);
+ let r: u64x2 = transmute(vtstq_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtstd_s64() {
+ let a: i64 = 0;
+ let b: i64 = 0;
+ let e: u64 = 0;
+ let r: u64 = transmute(vtstd_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtstd_u64() {
+ let a: u64 = 0;
+ let b: u64 = 0;
+ let e: u64 = 0;
+ let r: u64 = transmute(vtstd_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuqadds_s32() {
+ let a: i32 = 1;
+ let b: u32 = 1;
+ let e: i32 = 2;
+ let r: i32 = transmute(vuqadds_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuqaddd_s64() {
+ let a: i64 = 1;
+ let b: u64 = 1;
+ let e: i64 = 2;
+ let r: i64 = transmute(vuqaddd_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuqaddb_s8() {
+ let a: i8 = 1;
+ let b: u8 = 2;
+ let e: i8 = 3;
+ let r: i8 = transmute(vuqaddb_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuqaddh_s16() {
+ let a: i16 = 1;
+ let b: u16 = 2;
+ let e: i16 = 3;
+ let r: i16 = transmute(vuqaddh_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabs_f64() {
+ let a: f64 = -0.1;
+ let e: f64 = 0.1;
+ let r: f64 = transmute(vabs_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabsq_f64() {
+ let a: f64x2 = f64x2::new(-0.1, -2.2);
+ let e: f64x2 = f64x2::new(0.1, 2.2);
+ let r: f64x2 = transmute(vabsq_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgt_s64() {
+ let a: i64x1 = i64x1::new(1);
+ let b: i64x1 = i64x1::new(0);
+ let e: u64x1 = u64x1::new(0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x1 = transmute(vcgt_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgtq_s64() {
+ let a: i64x2 = i64x2::new(1, 2);
+ let b: i64x2 = i64x2::new(0, 1);
+ let e: u64x2 = u64x2::new(0xFF_FF_FF_FF_FF_FF_FF_FF, 0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x2 = transmute(vcgtq_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgt_u64() {
+ let a: u64x1 = u64x1::new(1);
+ let b: u64x1 = u64x1::new(0);
+ let e: u64x1 = u64x1::new(0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x1 = transmute(vcgt_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgtq_u64() {
+ let a: u64x2 = u64x2::new(1, 2);
+ let b: u64x2 = u64x2::new(0, 1);
+ let e: u64x2 = u64x2::new(0xFF_FF_FF_FF_FF_FF_FF_FF, 0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x2 = transmute(vcgtq_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgt_f64() {
+ let a: f64 = 1.2;
+ let b: f64 = 0.1;
+ let e: u64x1 = u64x1::new(0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x1 = transmute(vcgt_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgtq_f64() {
+ let a: f64x2 = f64x2::new(1.2, 2.3);
+ let b: f64x2 = f64x2::new(0.1, 1.2);
+ let e: u64x2 = u64x2::new(0xFF_FF_FF_FF_FF_FF_FF_FF, 0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x2 = transmute(vcgtq_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgtd_s64() {
+ let a: i64 = 1;
+ let b: i64 = 2;
+ let e: u64 = 0;
+ let r: u64 = transmute(vcgtd_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgtd_u64() {
+ let a: u64 = 1;
+ let b: u64 = 2;
+ let e: u64 = 0;
+ let r: u64 = transmute(vcgtd_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgts_f32() {
+ let a: f32 = 1.;
+ let b: f32 = 2.;
+ let e: u32 = 0;
+ let r: u32 = transmute(vcgts_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgtd_f64() {
+ let a: f64 = 1.;
+ let b: f64 = 2.;
+ let e: u64 = 0;
+ let r: u64 = transmute(vcgtd_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclt_s64() {
+ let a: i64x1 = i64x1::new(0);
+ let b: i64x1 = i64x1::new(1);
+ let e: u64x1 = u64x1::new(0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x1 = transmute(vclt_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcltq_s64() {
+ let a: i64x2 = i64x2::new(0, 1);
+ let b: i64x2 = i64x2::new(1, 2);
+ let e: u64x2 = u64x2::new(0xFF_FF_FF_FF_FF_FF_FF_FF, 0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x2 = transmute(vcltq_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclt_u64() {
+ let a: u64x1 = u64x1::new(0);
+ let b: u64x1 = u64x1::new(1);
+ let e: u64x1 = u64x1::new(0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x1 = transmute(vclt_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcltq_u64() {
+ let a: u64x2 = u64x2::new(0, 1);
+ let b: u64x2 = u64x2::new(1, 2);
+ let e: u64x2 = u64x2::new(0xFF_FF_FF_FF_FF_FF_FF_FF, 0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x2 = transmute(vcltq_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclt_f64() {
+ let a: f64 = 0.1;
+ let b: f64 = 1.2;
+ let e: u64x1 = u64x1::new(0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x1 = transmute(vclt_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcltq_f64() {
+ let a: f64x2 = f64x2::new(0.1, 1.2);
+ let b: f64x2 = f64x2::new(1.2, 2.3);
+ let e: u64x2 = u64x2::new(0xFF_FF_FF_FF_FF_FF_FF_FF, 0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x2 = transmute(vcltq_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcltd_s64() {
+ let a: i64 = 2;
+ let b: i64 = 1;
+ let e: u64 = 0;
+ let r: u64 = transmute(vcltd_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcltd_u64() {
+ let a: u64 = 2;
+ let b: u64 = 1;
+ let e: u64 = 0;
+ let r: u64 = transmute(vcltd_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclts_f32() {
+ let a: f32 = 2.;
+ let b: f32 = 1.;
+ let e: u32 = 0;
+ let r: u32 = transmute(vclts_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcltd_f64() {
+ let a: f64 = 2.;
+ let b: f64 = 1.;
+ let e: u64 = 0;
+ let r: u64 = transmute(vcltd_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcle_s64() {
+ let a: i64x1 = i64x1::new(0);
+ let b: i64x1 = i64x1::new(1);
+ let e: u64x1 = u64x1::new(0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x1 = transmute(vcle_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcleq_s64() {
+ let a: i64x2 = i64x2::new(0, 1);
+ let b: i64x2 = i64x2::new(1, 2);
+ let e: u64x2 = u64x2::new(0xFF_FF_FF_FF_FF_FF_FF_FF, 0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x2 = transmute(vcleq_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcged_s64() {
+ let a: i64 = 1;
+ let b: i64 = 2;
+ let e: u64 = 0;
+ let r: u64 = transmute(vcged_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcged_u64() {
+ let a: u64 = 1;
+ let b: u64 = 2;
+ let e: u64 = 0;
+ let r: u64 = transmute(vcged_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcges_f32() {
+ let a: f32 = 1.;
+ let b: f32 = 2.;
+ let e: u32 = 0;
+ let r: u32 = transmute(vcges_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcged_f64() {
+ let a: f64 = 1.;
+ let b: f64 = 2.;
+ let e: u64 = 0;
+ let r: u64 = transmute(vcged_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcle_u64() {
+ let a: u64x1 = u64x1::new(0);
+ let b: u64x1 = u64x1::new(1);
+ let e: u64x1 = u64x1::new(0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x1 = transmute(vcle_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcleq_u64() {
+ let a: u64x2 = u64x2::new(0, 1);
+ let b: u64x2 = u64x2::new(1, 2);
+ let e: u64x2 = u64x2::new(0xFF_FF_FF_FF_FF_FF_FF_FF, 0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x2 = transmute(vcleq_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcle_f64() {
+ let a: f64 = 0.1;
+ let b: f64 = 1.2;
+ let e: u64x1 = u64x1::new(0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x1 = transmute(vcle_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcleq_f64() {
+ let a: f64x2 = f64x2::new(0.1, 1.2);
+ let b: f64x2 = f64x2::new(1.2, 2.3);
+ let e: u64x2 = u64x2::new(0xFF_FF_FF_FF_FF_FF_FF_FF, 0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x2 = transmute(vcleq_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcled_s64() {
+ let a: i64 = 2;
+ let b: i64 = 1;
+ let e: u64 = 0;
+ let r: u64 = transmute(vcled_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcled_u64() {
+ let a: u64 = 2;
+ let b: u64 = 1;
+ let e: u64 = 0;
+ let r: u64 = transmute(vcled_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcles_f32() {
+ let a: f32 = 2.;
+ let b: f32 = 1.;
+ let e: u32 = 0;
+ let r: u32 = transmute(vcles_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcled_f64() {
+ let a: f64 = 2.;
+ let b: f64 = 1.;
+ let e: u64 = 0;
+ let r: u64 = transmute(vcled_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcge_s64() {
+ let a: i64x1 = i64x1::new(1);
+ let b: i64x1 = i64x1::new(0);
+ let e: u64x1 = u64x1::new(0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x1 = transmute(vcge_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgeq_s64() {
+ let a: i64x2 = i64x2::new(1, 2);
+ let b: i64x2 = i64x2::new(0, 1);
+ let e: u64x2 = u64x2::new(0xFF_FF_FF_FF_FF_FF_FF_FF, 0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x2 = transmute(vcgeq_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcge_u64() {
+ let a: u64x1 = u64x1::new(1);
+ let b: u64x1 = u64x1::new(0);
+ let e: u64x1 = u64x1::new(0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x1 = transmute(vcge_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgeq_u64() {
+ let a: u64x2 = u64x2::new(1, 2);
+ let b: u64x2 = u64x2::new(0, 1);
+ let e: u64x2 = u64x2::new(0xFF_FF_FF_FF_FF_FF_FF_FF, 0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x2 = transmute(vcgeq_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcge_f64() {
+ let a: f64 = 1.2;
+ let b: f64 = 0.1;
+ let e: u64x1 = u64x1::new(0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x1 = transmute(vcge_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgeq_f64() {
+ let a: f64x2 = f64x2::new(1.2, 2.3);
+ let b: f64x2 = f64x2::new(0.1, 1.2);
+ let e: u64x2 = u64x2::new(0xFF_FF_FF_FF_FF_FF_FF_FF, 0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x2 = transmute(vcgeq_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgez_s8() {
+ let a: i8x8 = i8x8::new(-128, -1, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05);
+ let e: u8x8 = u8x8::new(0, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
+ let r: u8x8 = transmute(vcgez_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgezq_s8() {
+ let a: i8x16 = i8x16::new(-128, -1, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x7F);
+ let e: u8x16 = u8x16::new(0, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
+ let r: u8x16 = transmute(vcgezq_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgez_s16() {
+ let a: i16x4 = i16x4::new(-32768, -1, 0x00, 0x01);
+ let e: u16x4 = u16x4::new(0, 0, 0xFF_FF, 0xFF_FF);
+ let r: u16x4 = transmute(vcgez_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgezq_s16() {
+ let a: i16x8 = i16x8::new(-32768, -1, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05);
+ let e: u16x8 = u16x8::new(0, 0, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF);
+ let r: u16x8 = transmute(vcgezq_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgez_s32() {
+ let a: i32x2 = i32x2::new(-2147483648, -1);
+ let e: u32x2 = u32x2::new(0, 0);
+ let r: u32x2 = transmute(vcgez_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgezq_s32() {
+ let a: i32x4 = i32x4::new(-2147483648, -1, 0x00, 0x01);
+ let e: u32x4 = u32x4::new(0, 0, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let r: u32x4 = transmute(vcgezq_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgez_s64() {
+ let a: i64x1 = i64x1::new(-9223372036854775808);
+ let e: u64x1 = u64x1::new(0);
+ let r: u64x1 = transmute(vcgez_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgezq_s64() {
+ let a: i64x2 = i64x2::new(-9223372036854775808, -1);
+ let e: u64x2 = u64x2::new(0, 0);
+ let r: u64x2 = transmute(vcgezq_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgez_f32() {
+ let a: f32x2 = f32x2::new(-1.2, 0.0);
+ let e: u32x2 = u32x2::new(0, 0xFF_FF_FF_FF);
+ let r: u32x2 = transmute(vcgez_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgezq_f32() {
+ let a: f32x4 = f32x4::new(-1.2, 0.0, 1.2, 2.3);
+ let e: u32x4 = u32x4::new(0, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let r: u32x4 = transmute(vcgezq_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgez_f64() {
+ let a: f64 = -1.2;
+ let e: u64x1 = u64x1::new(0);
+ let r: u64x1 = transmute(vcgez_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgezq_f64() {
+ let a: f64x2 = f64x2::new(-1.2, 0.0);
+ let e: u64x2 = u64x2::new(0, 0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x2 = transmute(vcgezq_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgezd_s64() {
+ let a: i64 = -1;
+ let e: u64 = 0;
+ let r: u64 = transmute(vcgezd_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgezs_f32() {
+ let a: f32 = -1.;
+ let e: u32 = 0;
+ let r: u32 = transmute(vcgezs_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgezd_f64() {
+ let a: f64 = -1.;
+ let e: u64 = 0;
+ let r: u64 = transmute(vcgezd_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgtz_s8() {
+ let a: i8x8 = i8x8::new(-128, -1, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05);
+ let e: u8x8 = u8x8::new(0, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
+ let r: u8x8 = transmute(vcgtz_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgtzq_s8() {
+ let a: i8x16 = i8x16::new(-128, -1, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x7F);
+ let e: u8x16 = u8x16::new(0, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
+ let r: u8x16 = transmute(vcgtzq_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgtz_s16() {
+ let a: i16x4 = i16x4::new(-32768, -1, 0x00, 0x01);
+ let e: u16x4 = u16x4::new(0, 0, 0, 0xFF_FF);
+ let r: u16x4 = transmute(vcgtz_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgtzq_s16() {
+ let a: i16x8 = i16x8::new(-32768, -1, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05);
+ let e: u16x8 = u16x8::new(0, 0, 0, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF);
+ let r: u16x8 = transmute(vcgtzq_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgtz_s32() {
+ let a: i32x2 = i32x2::new(-2147483648, -1);
+ let e: u32x2 = u32x2::new(0, 0);
+ let r: u32x2 = transmute(vcgtz_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgtzq_s32() {
+ let a: i32x4 = i32x4::new(-2147483648, -1, 0x00, 0x01);
+ let e: u32x4 = u32x4::new(0, 0, 0, 0xFF_FF_FF_FF);
+ let r: u32x4 = transmute(vcgtzq_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgtz_s64() {
+ let a: i64x1 = i64x1::new(-9223372036854775808);
+ let e: u64x1 = u64x1::new(0);
+ let r: u64x1 = transmute(vcgtz_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgtzq_s64() {
+ let a: i64x2 = i64x2::new(-9223372036854775808, -1);
+ let e: u64x2 = u64x2::new(0, 0);
+ let r: u64x2 = transmute(vcgtzq_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgtz_f32() {
+ let a: f32x2 = f32x2::new(-1.2, 0.0);
+ let e: u32x2 = u32x2::new(0, 0);
+ let r: u32x2 = transmute(vcgtz_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgtzq_f32() {
+ let a: f32x4 = f32x4::new(-1.2, 0.0, 1.2, 2.3);
+ let e: u32x4 = u32x4::new(0, 0, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let r: u32x4 = transmute(vcgtzq_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgtz_f64() {
+ let a: f64 = -1.2;
+ let e: u64x1 = u64x1::new(0);
+ let r: u64x1 = transmute(vcgtz_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgtzq_f64() {
+ let a: f64x2 = f64x2::new(-1.2, 0.0);
+ let e: u64x2 = u64x2::new(0, 0);
+ let r: u64x2 = transmute(vcgtzq_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgtzd_s64() {
+ let a: i64 = -1;
+ let e: u64 = 0;
+ let r: u64 = transmute(vcgtzd_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgtzs_f32() {
+ let a: f32 = -1.;
+ let e: u32 = 0;
+ let r: u32 = transmute(vcgtzs_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgtzd_f64() {
+ let a: f64 = -1.;
+ let e: u64 = 0;
+ let r: u64 = transmute(vcgtzd_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclez_s8() {
+ let a: i8x8 = i8x8::new(-128, -1, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05);
+ let e: u8x8 = u8x8::new(0xFF, 0xFF, 0xFF, 0, 0, 0, 0, 0);
+ let r: u8x8 = transmute(vclez_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclezq_s8() {
+ let a: i8x16 = i8x16::new(-128, -1, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x7F);
+ let e: u8x16 = u8x16::new(0xFF, 0xFF, 0xFF, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ let r: u8x16 = transmute(vclezq_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclez_s16() {
+ let a: i16x4 = i16x4::new(-32768, -1, 0x00, 0x01);
+ let e: u16x4 = u16x4::new(0xFF_FF, 0xFF_FF, 0xFF_FF, 0);
+ let r: u16x4 = transmute(vclez_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclezq_s16() {
+ let a: i16x8 = i16x8::new(-32768, -1, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05);
+ let e: u16x8 = u16x8::new(0xFF_FF, 0xFF_FF, 0xFF_FF, 0, 0, 0, 0, 0);
+ let r: u16x8 = transmute(vclezq_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclez_s32() {
+ let a: i32x2 = i32x2::new(-2147483648, -1);
+ let e: u32x2 = u32x2::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let r: u32x2 = transmute(vclez_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclezq_s32() {
+ let a: i32x4 = i32x4::new(-2147483648, -1, 0x00, 0x01);
+ let e: u32x4 = u32x4::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0);
+ let r: u32x4 = transmute(vclezq_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclez_s64() {
+ let a: i64x1 = i64x1::new(-9223372036854775808);
+ let e: u64x1 = u64x1::new(0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x1 = transmute(vclez_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclezq_s64() {
+ let a: i64x2 = i64x2::new(-9223372036854775808, -1);
+ let e: u64x2 = u64x2::new(0xFF_FF_FF_FF_FF_FF_FF_FF, 0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x2 = transmute(vclezq_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclez_f32() {
+ let a: f32x2 = f32x2::new(-1.2, 0.0);
+ let e: u32x2 = u32x2::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let r: u32x2 = transmute(vclez_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclezq_f32() {
+ let a: f32x4 = f32x4::new(-1.2, 0.0, 1.2, 2.3);
+ let e: u32x4 = u32x4::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0, 0);
+ let r: u32x4 = transmute(vclezq_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclez_f64() {
+ let a: f64 = -1.2;
+ let e: u64x1 = u64x1::new(0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x1 = transmute(vclez_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclezq_f64() {
+ let a: f64x2 = f64x2::new(-1.2, 0.0);
+ let e: u64x2 = u64x2::new(0xFF_FF_FF_FF_FF_FF_FF_FF, 0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x2 = transmute(vclezq_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclezd_s64() {
+ let a: i64 = 2;
+ let e: u64 = 0;
+ let r: u64 = transmute(vclezd_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclezs_f32() {
+ let a: f32 = 2.;
+ let e: u32 = 0;
+ let r: u32 = transmute(vclezs_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclezd_f64() {
+ let a: f64 = 2.;
+ let e: u64 = 0;
+ let r: u64 = transmute(vclezd_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcltz_s8() {
+ let a: i8x8 = i8x8::new(-128, -1, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05);
+ let e: u8x8 = u8x8::new(0xFF, 0xFF, 0, 0, 0, 0, 0, 0);
+ let r: u8x8 = transmute(vcltz_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcltzq_s8() {
+ let a: i8x16 = i8x16::new(-128, -1, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x7F);
+ let e: u8x16 = u8x16::new(0xFF, 0xFF, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ let r: u8x16 = transmute(vcltzq_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcltz_s16() {
+ let a: i16x4 = i16x4::new(-32768, -1, 0x00, 0x01);
+ let e: u16x4 = u16x4::new(0xFF_FF, 0xFF_FF, 0, 0);
+ let r: u16x4 = transmute(vcltz_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcltzq_s16() {
+ let a: i16x8 = i16x8::new(-32768, -1, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05);
+ let e: u16x8 = u16x8::new(0xFF_FF, 0xFF_FF, 0, 0, 0, 0, 0, 0);
+ let r: u16x8 = transmute(vcltzq_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcltz_s32() {
+ let a: i32x2 = i32x2::new(-2147483648, -1);
+ let e: u32x2 = u32x2::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let r: u32x2 = transmute(vcltz_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcltzq_s32() {
+ let a: i32x4 = i32x4::new(-2147483648, -1, 0x00, 0x01);
+ let e: u32x4 = u32x4::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0, 0);
+ let r: u32x4 = transmute(vcltzq_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcltz_s64() {
+ let a: i64x1 = i64x1::new(-9223372036854775808);
+ let e: u64x1 = u64x1::new(0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x1 = transmute(vcltz_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcltzq_s64() {
+ let a: i64x2 = i64x2::new(-9223372036854775808, -1);
+ let e: u64x2 = u64x2::new(0xFF_FF_FF_FF_FF_FF_FF_FF, 0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x2 = transmute(vcltzq_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcltz_f32() {
+ let a: f32x2 = f32x2::new(-1.2, 0.0);
+ let e: u32x2 = u32x2::new(0xFF_FF_FF_FF, 0);
+ let r: u32x2 = transmute(vcltz_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcltzq_f32() {
+ let a: f32x4 = f32x4::new(-1.2, 0.0, 1.2, 2.3);
+ let e: u32x4 = u32x4::new(0xFF_FF_FF_FF, 0, 0, 0);
+ let r: u32x4 = transmute(vcltzq_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcltz_f64() {
+ let a: f64 = -1.2;
+ let e: u64x1 = u64x1::new(0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x1 = transmute(vcltz_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcltzq_f64() {
+ let a: f64x2 = f64x2::new(-1.2, 0.0);
+ let e: u64x2 = u64x2::new(0xFF_FF_FF_FF_FF_FF_FF_FF, 0);
+ let r: u64x2 = transmute(vcltzq_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcltzd_s64() {
+ let a: i64 = 2;
+ let e: u64 = 0;
+ let r: u64 = transmute(vcltzd_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcltzs_f32() {
+ let a: f32 = 2.;
+ let e: u32 = 0;
+ let r: u32 = transmute(vcltzs_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcltzd_f64() {
+ let a: f64 = 2.;
+ let e: u64 = 0;
+ let r: u64 = transmute(vcltzd_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcagt_f64() {
+ let a: f64 = -1.2;
+ let b: f64 = -1.1;
+ let e: u64x1 = u64x1::new(!0);
+ let r: u64x1 = transmute(vcagt_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcagtq_f64() {
+ let a: f64x2 = f64x2::new(-1.2, 0.0);
+ let b: f64x2 = f64x2::new(-1.1, 0.0);
+ let e: u64x2 = u64x2::new(!0, 0);
+ let r: u64x2 = transmute(vcagtq_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcagts_f32() {
+ let a: f32 = -1.2;
+ let b: f32 = -1.1;
+ let e: u32 = !0;
+ let r: u32 = transmute(vcagts_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcagtd_f64() {
+ let a: f64 = -1.2;
+ let b: f64 = -1.1;
+ let e: u64 = !0;
+ let r: u64 = transmute(vcagtd_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcage_f64() {
+ let a: f64 = -1.2;
+ let b: f64 = -1.1;
+ let e: u64x1 = u64x1::new(!0);
+ let r: u64x1 = transmute(vcage_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcageq_f64() {
+ let a: f64x2 = f64x2::new(-1.2, 0.0);
+ let b: f64x2 = f64x2::new(-1.1, 0.0);
+ let e: u64x2 = u64x2::new(!0, 0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x2 = transmute(vcageq_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcages_f32() {
+ let a: f32 = -1.2;
+ let b: f32 = -1.1;
+ let e: u32 = !0;
+ let r: u32 = transmute(vcages_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcaged_f64() {
+ let a: f64 = -1.2;
+ let b: f64 = -1.1;
+ let e: u64 = !0;
+ let r: u64 = transmute(vcaged_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcalt_f64() {
+ let a: f64 = -1.2;
+ let b: f64 = -1.1;
+ let e: u64x1 = u64x1::new(0);
+ let r: u64x1 = transmute(vcalt_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcaltq_f64() {
+ let a: f64x2 = f64x2::new(-1.2, 0.0);
+ let b: f64x2 = f64x2::new(-1.1, 0.0);
+ let e: u64x2 = u64x2::new(0, 0);
+ let r: u64x2 = transmute(vcaltq_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcalts_f32() {
+ let a: f32 = -1.2;
+ let b: f32 = -1.1;
+ let e: u32 = 0;
+ let r: u32 = transmute(vcalts_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcaltd_f64() {
+ let a: f64 = -1.2;
+ let b: f64 = -1.1;
+ let e: u64 = 0;
+ let r: u64 = transmute(vcaltd_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcale_f64() {
+ let a: f64 = -1.2;
+ let b: f64 = -1.1;
+ let e: u64x1 = u64x1::new(0);
+ let r: u64x1 = transmute(vcale_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcaleq_f64() {
+ let a: f64x2 = f64x2::new(-1.2, 0.0);
+ let b: f64x2 = f64x2::new(-1.1, 0.0);
+ let e: u64x2 = u64x2::new(0, 0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x2 = transmute(vcaleq_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcales_f32() {
+ let a: f32 = -1.2;
+ let b: f32 = -1.1;
+ let e: u32 = 0;
+ let r: u32 = transmute(vcales_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcaled_f64() {
+ let a: f64 = -1.2;
+ let b: f64 = -1.1;
+ let e: u64 = 0;
+ let r: u64 = transmute(vcaled_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopy_lane_s8() {
+ let a: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: i8x8 = i8x8::new(0, 0x7F, 0, 0, 0, 0, 0, 0);
+ let e: i8x8 = i8x8::new(0x7F, 2, 3, 4, 5, 6, 7, 8);
+ let r: i8x8 = transmute(vcopy_lane_s8::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopyq_laneq_s8() {
+ let a: i8x16 = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let b: i8x16 = i8x16::new(0, 0x7F, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ let e: i8x16 = i8x16::new(0x7F, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let r: i8x16 = transmute(vcopyq_laneq_s8::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopy_lane_s16() {
+ let a: i16x4 = i16x4::new(1, 2, 3, 4);
+ let b: i16x4 = i16x4::new(0, 0x7F_FF, 0, 0);
+ let e: i16x4 = i16x4::new(0x7F_FF, 2, 3, 4);
+ let r: i16x4 = transmute(vcopy_lane_s16::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopyq_laneq_s16() {
+ let a: i16x8 = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: i16x8 = i16x8::new(0, 0x7F_FF, 0, 0, 0, 0, 0, 0);
+ let e: i16x8 = i16x8::new(0x7F_FF, 2, 3, 4, 5, 6, 7, 8);
+ let r: i16x8 = transmute(vcopyq_laneq_s16::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopy_lane_s32() {
+ let a: i32x2 = i32x2::new(1, 2);
+ let b: i32x2 = i32x2::new(0, 0x7F_FF_FF_FF);
+ let e: i32x2 = i32x2::new(0x7F_FF_FF_FF, 2);
+ let r: i32x2 = transmute(vcopy_lane_s32::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopyq_laneq_s32() {
+ let a: i32x4 = i32x4::new(1, 2, 3, 4);
+ let b: i32x4 = i32x4::new(0, 0x7F_FF_FF_FF, 0, 0);
+ let e: i32x4 = i32x4::new(0x7F_FF_FF_FF, 2, 3, 4);
+ let r: i32x4 = transmute(vcopyq_laneq_s32::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopyq_laneq_s64() {
+ let a: i64x2 = i64x2::new(1, 2);
+ let b: i64x2 = i64x2::new(0, 0x7F_FF_FF_FF_FF_FF_FF_FF);
+ let e: i64x2 = i64x2::new(0x7F_FF_FF_FF_FF_FF_FF_FF, 2);
+ let r: i64x2 = transmute(vcopyq_laneq_s64::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopy_lane_u8() {
+ let a: u8x8 = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: u8x8 = u8x8::new(0, 0xFF, 0, 0, 0, 0, 0, 0);
+ let e: u8x8 = u8x8::new(0xFF, 2, 3, 4, 5, 6, 7, 8);
+ let r: u8x8 = transmute(vcopy_lane_u8::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopyq_laneq_u8() {
+ let a: u8x16 = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let b: u8x16 = u8x16::new(0, 0xFF, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ let e: u8x16 = u8x16::new(0xFF, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let r: u8x16 = transmute(vcopyq_laneq_u8::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopy_lane_u16() {
+ let a: u16x4 = u16x4::new(1, 2, 3, 4);
+ let b: u16x4 = u16x4::new(0, 0xFF_FF, 0, 0);
+ let e: u16x4 = u16x4::new(0xFF_FF, 2, 3, 4);
+ let r: u16x4 = transmute(vcopy_lane_u16::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopyq_laneq_u16() {
+ let a: u16x8 = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: u16x8 = u16x8::new(0, 0xFF_FF, 0, 0, 0, 0, 0, 0);
+ let e: u16x8 = u16x8::new(0xFF_FF, 2, 3, 4, 5, 6, 7, 8);
+ let r: u16x8 = transmute(vcopyq_laneq_u16::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopy_lane_u32() {
+ let a: u32x2 = u32x2::new(1, 2);
+ let b: u32x2 = u32x2::new(0, 0xFF_FF_FF_FF);
+ let e: u32x2 = u32x2::new(0xFF_FF_FF_FF, 2);
+ let r: u32x2 = transmute(vcopy_lane_u32::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopyq_laneq_u32() {
+ let a: u32x4 = u32x4::new(1, 2, 3, 4);
+ let b: u32x4 = u32x4::new(0, 0xFF_FF_FF_FF, 0, 0);
+ let e: u32x4 = u32x4::new(0xFF_FF_FF_FF, 2, 3, 4);
+ let r: u32x4 = transmute(vcopyq_laneq_u32::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopyq_laneq_u64() {
+ let a: u64x2 = u64x2::new(1, 2);
+ let b: u64x2 = u64x2::new(0, 0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let e: u64x2 = u64x2::new(0xFF_FF_FF_FF_FF_FF_FF_FF, 2);
+ let r: u64x2 = transmute(vcopyq_laneq_u64::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopy_lane_p8() {
+ let a: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: i8x8 = i8x8::new(0, 0x7F, 0, 0, 0, 0, 0, 0);
+ let e: i8x8 = i8x8::new(0x7F, 2, 3, 4, 5, 6, 7, 8);
+ let r: i8x8 = transmute(vcopy_lane_p8::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopyq_laneq_p8() {
+ let a: i8x16 = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let b: i8x16 = i8x16::new(0, 0x7F, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ let e: i8x16 = i8x16::new(0x7F, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let r: i8x16 = transmute(vcopyq_laneq_p8::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopy_lane_p16() {
+ let a: i16x4 = i16x4::new(1, 2, 3, 4);
+ let b: i16x4 = i16x4::new(0, 0x7F_FF, 0, 0);
+ let e: i16x4 = i16x4::new(0x7F_FF, 2, 3, 4);
+ let r: i16x4 = transmute(vcopy_lane_p16::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopyq_laneq_p16() {
+ let a: i16x8 = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: i16x8 = i16x8::new(0, 0x7F_FF, 0, 0, 0, 0, 0, 0);
+ let e: i16x8 = i16x8::new(0x7F_FF, 2, 3, 4, 5, 6, 7, 8);
+ let r: i16x8 = transmute(vcopyq_laneq_p16::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopyq_laneq_p64() {
+ let a: i64x2 = i64x2::new(1, 2);
+ let b: i64x2 = i64x2::new(0, 0x7F_FF_FF_FF_FF_FF_FF_FF);
+ let e: i64x2 = i64x2::new(0x7F_FF_FF_FF_FF_FF_FF_FF, 2);
+ let r: i64x2 = transmute(vcopyq_laneq_p64::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopy_lane_f32() {
+ let a: f32x2 = f32x2::new(1., 2.);
+ let b: f32x2 = f32x2::new(0., 0.5);
+ let e: f32x2 = f32x2::new(0.5, 2.);
+ let r: f32x2 = transmute(vcopy_lane_f32::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopyq_laneq_f32() {
+ let a: f32x4 = f32x4::new(1., 2., 3., 4.);
+ let b: f32x4 = f32x4::new(0., 0.5, 0., 0.);
+ let e: f32x4 = f32x4::new(0.5, 2., 3., 4.);
+ let r: f32x4 = transmute(vcopyq_laneq_f32::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopyq_laneq_f64() {
+ let a: f64x2 = f64x2::new(1., 2.);
+ let b: f64x2 = f64x2::new(0., 0.5);
+ let e: f64x2 = f64x2::new(0.5, 2.);
+ let r: f64x2 = transmute(vcopyq_laneq_f64::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopy_laneq_s8() {
+ let a: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: i8x16 = i8x16::new(0, 0x7F, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ let e: i8x8 = i8x8::new(0x7F, 2, 3, 4, 5, 6, 7, 8);
+ let r: i8x8 = transmute(vcopy_laneq_s8::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopy_laneq_s16() {
+ let a: i16x4 = i16x4::new(1, 2, 3, 4);
+ let b: i16x8 = i16x8::new(0, 0x7F_FF, 0, 0, 0, 0, 0, 0);
+ let e: i16x4 = i16x4::new(0x7F_FF, 2, 3, 4);
+ let r: i16x4 = transmute(vcopy_laneq_s16::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopy_laneq_s32() {
+ let a: i32x2 = i32x2::new(1, 2);
+ let b: i32x4 = i32x4::new(0, 0x7F_FF_FF_FF, 0, 0);
+ let e: i32x2 = i32x2::new(0x7F_FF_FF_FF, 2);
+ let r: i32x2 = transmute(vcopy_laneq_s32::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopy_laneq_u8() {
+ let a: u8x8 = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: u8x16 = u8x16::new(0, 0xFF, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ let e: u8x8 = u8x8::new(0xFF, 2, 3, 4, 5, 6, 7, 8);
+ let r: u8x8 = transmute(vcopy_laneq_u8::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopy_laneq_u16() {
+ let a: u16x4 = u16x4::new(1, 2, 3, 4);
+ let b: u16x8 = u16x8::new(0, 0xFF_FF, 0, 0, 0, 0, 0, 0);
+ let e: u16x4 = u16x4::new(0xFF_FF, 2, 3, 4);
+ let r: u16x4 = transmute(vcopy_laneq_u16::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopy_laneq_u32() {
+ let a: u32x2 = u32x2::new(1, 2);
+ let b: u32x4 = u32x4::new(0, 0xFF_FF_FF_FF, 0, 0);
+ let e: u32x2 = u32x2::new(0xFF_FF_FF_FF, 2);
+ let r: u32x2 = transmute(vcopy_laneq_u32::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopy_laneq_p8() {
+ let a: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: i8x16 = i8x16::new(0, 0x7F, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ let e: i8x8 = i8x8::new(0x7F, 2, 3, 4, 5, 6, 7, 8);
+ let r: i8x8 = transmute(vcopy_laneq_p8::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopy_laneq_p16() {
+ let a: i16x4 = i16x4::new(1, 2, 3, 4);
+ let b: i16x8 = i16x8::new(0, 0x7F_FF, 0, 0, 0, 0, 0, 0);
+ let e: i16x4 = i16x4::new(0x7F_FF, 2, 3, 4);
+ let r: i16x4 = transmute(vcopy_laneq_p16::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopy_laneq_f32() {
+ let a: f32x2 = f32x2::new(1., 2.);
+ let b: f32x4 = f32x4::new(0., 0.5, 0., 0.);
+ let e: f32x2 = f32x2::new(0.5, 2.);
+ let r: f32x2 = transmute(vcopy_laneq_f32::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopyq_lane_s8() {
+ let a: i8x16 = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let b: i8x8 = i8x8::new(0, 0x7F, 0, 0, 0, 0, 0, 0);
+ let e: i8x16 = i8x16::new(0x7F, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let r: i8x16 = transmute(vcopyq_lane_s8::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopyq_lane_s16() {
+ let a: i16x8 = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: i16x4 = i16x4::new(0, 0x7F_FF, 0, 0);
+ let e: i16x8 = i16x8::new(0x7F_FF, 2, 3, 4, 5, 6, 7, 8);
+ let r: i16x8 = transmute(vcopyq_lane_s16::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopyq_lane_s32() {
+ let a: i32x4 = i32x4::new(1, 2, 3, 4);
+ let b: i32x2 = i32x2::new(0, 0x7F_FF_FF_FF);
+ let e: i32x4 = i32x4::new(0x7F_FF_FF_FF, 2, 3, 4);
+ let r: i32x4 = transmute(vcopyq_lane_s32::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopyq_lane_u8() {
+ let a: u8x16 = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let b: u8x8 = u8x8::new(0, 0xFF, 0, 0, 0, 0, 0, 0);
+ let e: u8x16 = u8x16::new(0xFF, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let r: u8x16 = transmute(vcopyq_lane_u8::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopyq_lane_u16() {
+ let a: u16x8 = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: u16x4 = u16x4::new(0, 0xFF_FF, 0, 0);
+ let e: u16x8 = u16x8::new(0xFF_FF, 2, 3, 4, 5, 6, 7, 8);
+ let r: u16x8 = transmute(vcopyq_lane_u16::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopyq_lane_u32() {
+ let a: u32x4 = u32x4::new(1, 2, 3, 4);
+ let b: u32x2 = u32x2::new(0, 0xFF_FF_FF_FF);
+ let e: u32x4 = u32x4::new(0xFF_FF_FF_FF, 2, 3, 4);
+ let r: u32x4 = transmute(vcopyq_lane_u32::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopyq_lane_p8() {
+ let a: i8x16 = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let b: i8x8 = i8x8::new(0, 0x7F, 0, 0, 0, 0, 0, 0);
+ let e: i8x16 = i8x16::new(0x7F, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let r: i8x16 = transmute(vcopyq_lane_p8::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopyq_lane_p16() {
+ let a: i16x8 = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: i16x4 = i16x4::new(0, 0x7F_FF, 0, 0);
+ let e: i16x8 = i16x8::new(0x7F_FF, 2, 3, 4, 5, 6, 7, 8);
+ let r: i16x8 = transmute(vcopyq_lane_p16::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopyq_lane_s64() {
+ let a: i64x2 = i64x2::new(1, 2);
+ let b: i64x1 = i64x1::new(0x7F_FF_FF_FF_FF_FF_FF_FF);
+ let e: i64x2 = i64x2::new(1, 0x7F_FF_FF_FF_FF_FF_FF_FF);
+ let r: i64x2 = transmute(vcopyq_lane_s64::<1, 0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopyq_lane_u64() {
+ let a: u64x2 = u64x2::new(1, 2);
+ let b: u64x1 = u64x1::new(0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let e: u64x2 = u64x2::new(1, 0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x2 = transmute(vcopyq_lane_u64::<1, 0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopyq_lane_p64() {
+ let a: i64x2 = i64x2::new(1, 2);
+ let b: i64x1 = i64x1::new(0x7F_FF_FF_FF_FF_FF_FF_FF);
+ let e: i64x2 = i64x2::new(1, 0x7F_FF_FF_FF_FF_FF_FF_FF);
+ let r: i64x2 = transmute(vcopyq_lane_p64::<1, 0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopyq_lane_f32() {
+ let a: f32x4 = f32x4::new(1., 2., 3., 4.);
+ let b: f32x2 = f32x2::new(0.5, 0.);
+ let e: f32x4 = f32x4::new(1., 0.5, 3., 4.);
+ let r: f32x4 = transmute(vcopyq_lane_f32::<1, 0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopyq_lane_f64() {
+ let a: f64x2 = f64x2::new(1., 2.);
+ let b: f64 = 0.5;
+ let e: f64x2 = f64x2::new(1., 0.5);
+ let r: f64x2 = transmute(vcopyq_lane_f64::<1, 0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcreate_f64() {
+ let a: u64 = 0;
+ let e: f64 = 0.;
+ let r: f64 = transmute(vcreate_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvt_f64_s64() {
+ let a: i64x1 = i64x1::new(1);
+ let e: f64 = 1.;
+ let r: f64 = transmute(vcvt_f64_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtq_f64_s64() {
+ let a: i64x2 = i64x2::new(1, 2);
+ let e: f64x2 = f64x2::new(1., 2.);
+ let r: f64x2 = transmute(vcvtq_f64_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvt_f64_u64() {
+ let a: u64x1 = u64x1::new(1);
+ let e: f64 = 1.;
+ let r: f64 = transmute(vcvt_f64_u64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtq_f64_u64() {
+ let a: u64x2 = u64x2::new(1, 2);
+ let e: f64x2 = f64x2::new(1., 2.);
+ let r: f64x2 = transmute(vcvtq_f64_u64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvt_f64_f32() {
+ let a: f32x2 = f32x2::new(-1.2, 1.2);
+ let e: f64x2 = f64x2::new(-1.2f32 as f64, 1.2f32 as f64);
+ let r: f64x2 = transmute(vcvt_f64_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvt_high_f64_f32() {
+ let a: f32x4 = f32x4::new(-1.2, 1.2, 2.3, 3.4);
+ let e: f64x2 = f64x2::new(2.3f32 as f64, 3.4f32 as f64);
+ let r: f64x2 = transmute(vcvt_high_f64_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvt_f32_f64() {
+ let a: f64x2 = f64x2::new(-1.2, 1.2);
+ let e: f32x2 = f32x2::new(-1.2f64 as f32, 1.2f64 as f32);
+ let r: f32x2 = transmute(vcvt_f32_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvt_high_f32_f64() {
+ let a: f32x2 = f32x2::new(-1.2, 1.2);
+ let b: f64x2 = f64x2::new(-2.3, 3.4);
+ let e: f32x4 = f32x4::new(-1.2, 1.2, -2.3f64 as f32, 3.4f64 as f32);
+ let r: f32x4 = transmute(vcvt_high_f32_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtx_f32_f64() {
+ let a: f64x2 = f64x2::new(-1.0, 2.0);
+ let e: f32x2 = f32x2::new(-1.0, 2.0);
+ let r: f32x2 = transmute(vcvtx_f32_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtxd_f32_f64() {
+ let a: f64 = -1.0;
+ let e: f32 = -1.0;
+ let r: f32 = transmute(vcvtxd_f32_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtx_high_f32_f64() {
+ let a: f32x2 = f32x2::new(-1.0, 2.0);
+ let b: f64x2 = f64x2::new(-3.0, 4.0);
+ let e: f32x4 = f32x4::new(-1.0, 2.0, -3.0, 4.0);
+ let r: f32x4 = transmute(vcvtx_high_f32_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvt_n_f64_s64() {
+ let a: i64x1 = i64x1::new(1);
+ let e: f64 = 0.25;
+ let r: f64 = transmute(vcvt_n_f64_s64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtq_n_f64_s64() {
+ let a: i64x2 = i64x2::new(1, 2);
+ let e: f64x2 = f64x2::new(0.25, 0.5);
+ let r: f64x2 = transmute(vcvtq_n_f64_s64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvts_n_f32_s32() {
+ let a: i32 = 1;
+ let e: f32 = 0.25;
+ let r: f32 = transmute(vcvts_n_f32_s32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtd_n_f64_s64() {
+ let a: i64 = 1;
+ let e: f64 = 0.25;
+ let r: f64 = transmute(vcvtd_n_f64_s64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvt_n_f64_u64() {
+ let a: u64x1 = u64x1::new(1);
+ let e: f64 = 0.25;
+ let r: f64 = transmute(vcvt_n_f64_u64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtq_n_f64_u64() {
+ let a: u64x2 = u64x2::new(1, 2);
+ let e: f64x2 = f64x2::new(0.25, 0.5);
+ let r: f64x2 = transmute(vcvtq_n_f64_u64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvts_n_f32_u32() {
+ let a: u32 = 1;
+ let e: f32 = 0.25;
+ let r: f32 = transmute(vcvts_n_f32_u32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtd_n_f64_u64() {
+ let a: u64 = 1;
+ let e: f64 = 0.25;
+ let r: f64 = transmute(vcvtd_n_f64_u64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvt_n_s64_f64() {
+ let a: f64 = 0.25;
+ let e: i64x1 = i64x1::new(1);
+ let r: i64x1 = transmute(vcvt_n_s64_f64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtq_n_s64_f64() {
+ let a: f64x2 = f64x2::new(0.25, 0.5);
+ let e: i64x2 = i64x2::new(1, 2);
+ let r: i64x2 = transmute(vcvtq_n_s64_f64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvts_n_s32_f32() {
+ let a: f32 = 0.25;
+ let e: i32 = 1;
+ let r: i32 = transmute(vcvts_n_s32_f32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtd_n_s64_f64() {
+ let a: f64 = 0.25;
+ let e: i64 = 1;
+ let r: i64 = transmute(vcvtd_n_s64_f64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvt_n_u64_f64() {
+ let a: f64 = 0.25;
+ let e: u64x1 = u64x1::new(1);
+ let r: u64x1 = transmute(vcvt_n_u64_f64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtq_n_u64_f64() {
+ let a: f64x2 = f64x2::new(0.25, 0.5);
+ let e: u64x2 = u64x2::new(1, 2);
+ let r: u64x2 = transmute(vcvtq_n_u64_f64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvts_n_u32_f32() {
+ let a: f32 = 0.25;
+ let e: u32 = 1;
+ let r: u32 = transmute(vcvts_n_u32_f32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtd_n_u64_f64() {
+ let a: f64 = 0.25;
+ let e: u64 = 1;
+ let r: u64 = transmute(vcvtd_n_u64_f64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvts_f32_s32() {
+ let a: i32 = 1;
+ let e: f32 = 1.;
+ let r: f32 = transmute(vcvts_f32_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtd_f64_s64() {
+ let a: i64 = 1;
+ let e: f64 = 1.;
+ let r: f64 = transmute(vcvtd_f64_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvts_f32_u32() {
+ let a: u32 = 1;
+ let e: f32 = 1.;
+ let r: f32 = transmute(vcvts_f32_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtd_f64_u64() {
+ let a: u64 = 1;
+ let e: f64 = 1.;
+ let r: f64 = transmute(vcvtd_f64_u64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvts_s32_f32() {
+ let a: f32 = 1.;
+ let e: i32 = 1;
+ let r: i32 = transmute(vcvts_s32_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtd_s64_f64() {
+ let a: f64 = 1.;
+ let e: i64 = 1;
+ let r: i64 = transmute(vcvtd_s64_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvts_u32_f32() {
+ let a: f32 = 1.;
+ let e: u32 = 1;
+ let r: u32 = transmute(vcvts_u32_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtd_u64_f64() {
+ let a: f64 = 1.;
+ let e: u64 = 1;
+ let r: u64 = transmute(vcvtd_u64_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvt_s64_f64() {
+ let a: f64 = -1.1;
+ let e: i64x1 = i64x1::new(-1);
+ let r: i64x1 = transmute(vcvt_s64_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtq_s64_f64() {
+ let a: f64x2 = f64x2::new(-1.1, 2.1);
+ let e: i64x2 = i64x2::new(-1, 2);
+ let r: i64x2 = transmute(vcvtq_s64_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvt_u64_f64() {
+ let a: f64 = 1.1;
+ let e: u64x1 = u64x1::new(1);
+ let r: u64x1 = transmute(vcvt_u64_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtq_u64_f64() {
+ let a: f64x2 = f64x2::new(1.1, 2.1);
+ let e: u64x2 = u64x2::new(1, 2);
+ let r: u64x2 = transmute(vcvtq_u64_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvta_s32_f32() {
+ let a: f32x2 = f32x2::new(-1.1, 2.1);
+ let e: i32x2 = i32x2::new(-1, 2);
+ let r: i32x2 = transmute(vcvta_s32_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtaq_s32_f32() {
+ let a: f32x4 = f32x4::new(-1.1, 2.1, -2.9, 3.9);
+ let e: i32x4 = i32x4::new(-1, 2, -3, 4);
+ let r: i32x4 = transmute(vcvtaq_s32_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvta_s64_f64() {
+ let a: f64 = -1.1;
+ let e: i64x1 = i64x1::new(-1);
+ let r: i64x1 = transmute(vcvta_s64_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtaq_s64_f64() {
+ let a: f64x2 = f64x2::new(-1.1, 2.1);
+ let e: i64x2 = i64x2::new(-1, 2);
+ let r: i64x2 = transmute(vcvtaq_s64_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtas_s32_f32() {
+ let a: f32 = 2.9;
+ let e: i32 = 3;
+ let r: i32 = transmute(vcvtas_s32_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtad_s64_f64() {
+ let a: f64 = 2.9;
+ let e: i64 = 3;
+ let r: i64 = transmute(vcvtad_s64_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtas_u32_f32() {
+ let a: f32 = 2.9;
+ let e: u32 = 3;
+ let r: u32 = transmute(vcvtas_u32_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtad_u64_f64() {
+ let a: f64 = 2.9;
+ let e: u64 = 3;
+ let r: u64 = transmute(vcvtad_u64_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtn_s32_f32() {
+ let a: f32x2 = f32x2::new(-1.5, 2.1);
+ let e: i32x2 = i32x2::new(-2, 2);
+ let r: i32x2 = transmute(vcvtn_s32_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtnq_s32_f32() {
+ let a: f32x4 = f32x4::new(-1.5, 2.1, -2.9, 3.9);
+ let e: i32x4 = i32x4::new(-2, 2, -3, 4);
+ let r: i32x4 = transmute(vcvtnq_s32_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtn_s64_f64() {
+ let a: f64 = -1.5;
+ let e: i64x1 = i64x1::new(-2);
+ let r: i64x1 = transmute(vcvtn_s64_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtnq_s64_f64() {
+ let a: f64x2 = f64x2::new(-1.5, 2.1);
+ let e: i64x2 = i64x2::new(-2, 2);
+ let r: i64x2 = transmute(vcvtnq_s64_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtns_s32_f32() {
+ let a: f32 = -1.5;
+ let e: i32 = -2;
+ let r: i32 = transmute(vcvtns_s32_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtnd_s64_f64() {
+ let a: f64 = -1.5;
+ let e: i64 = -2;
+ let r: i64 = transmute(vcvtnd_s64_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtm_s32_f32() {
+ let a: f32x2 = f32x2::new(-1.1, 2.1);
+ let e: i32x2 = i32x2::new(-2, 2);
+ let r: i32x2 = transmute(vcvtm_s32_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtmq_s32_f32() {
+ let a: f32x4 = f32x4::new(-1.1, 2.1, -2.9, 3.9);
+ let e: i32x4 = i32x4::new(-2, 2, -3, 3);
+ let r: i32x4 = transmute(vcvtmq_s32_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtm_s64_f64() {
+ let a: f64 = -1.1;
+ let e: i64x1 = i64x1::new(-2);
+ let r: i64x1 = transmute(vcvtm_s64_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtmq_s64_f64() {
+ let a: f64x2 = f64x2::new(-1.1, 2.1);
+ let e: i64x2 = i64x2::new(-2, 2);
+ let r: i64x2 = transmute(vcvtmq_s64_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtms_s32_f32() {
+ let a: f32 = -1.1;
+ let e: i32 = -2;
+ let r: i32 = transmute(vcvtms_s32_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtmd_s64_f64() {
+ let a: f64 = -1.1;
+ let e: i64 = -2;
+ let r: i64 = transmute(vcvtmd_s64_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtp_s32_f32() {
+ let a: f32x2 = f32x2::new(-1.1, 2.1);
+ let e: i32x2 = i32x2::new(-1, 3);
+ let r: i32x2 = transmute(vcvtp_s32_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtpq_s32_f32() {
+ let a: f32x4 = f32x4::new(-1.1, 2.1, -2.9, 3.9);
+ let e: i32x4 = i32x4::new(-1, 3, -2, 4);
+ let r: i32x4 = transmute(vcvtpq_s32_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtp_s64_f64() {
+ let a: f64 = -1.1;
+ let e: i64x1 = i64x1::new(-1);
+ let r: i64x1 = transmute(vcvtp_s64_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtpq_s64_f64() {
+ let a: f64x2 = f64x2::new(-1.1, 2.1);
+ let e: i64x2 = i64x2::new(-1, 3);
+ let r: i64x2 = transmute(vcvtpq_s64_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtps_s32_f32() {
+ let a: f32 = -1.1;
+ let e: i32 = -1;
+ let r: i32 = transmute(vcvtps_s32_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtpd_s64_f64() {
+ let a: f64 = -1.1;
+ let e: i64 = -1;
+ let r: i64 = transmute(vcvtpd_s64_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvta_u32_f32() {
+ let a: f32x2 = f32x2::new(1.1, 2.1);
+ let e: u32x2 = u32x2::new(1, 2);
+ let r: u32x2 = transmute(vcvta_u32_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtaq_u32_f32() {
+ let a: f32x4 = f32x4::new(1.1, 2.1, 2.9, 3.9);
+ let e: u32x4 = u32x4::new(1, 2, 3, 4);
+ let r: u32x4 = transmute(vcvtaq_u32_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvta_u64_f64() {
+ let a: f64 = 1.1;
+ let e: u64x1 = u64x1::new(1);
+ let r: u64x1 = transmute(vcvta_u64_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtaq_u64_f64() {
+ let a: f64x2 = f64x2::new(1.1, 2.1);
+ let e: u64x2 = u64x2::new(1, 2);
+ let r: u64x2 = transmute(vcvtaq_u64_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtn_u32_f32() {
+ let a: f32x2 = f32x2::new(1.5, 2.1);
+ let e: u32x2 = u32x2::new(2, 2);
+ let r: u32x2 = transmute(vcvtn_u32_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtnq_u32_f32() {
+ let a: f32x4 = f32x4::new(1.5, 2.1, 2.9, 3.9);
+ let e: u32x4 = u32x4::new(2, 2, 3, 4);
+ let r: u32x4 = transmute(vcvtnq_u32_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtn_u64_f64() {
+ let a: f64 = 1.5;
+ let e: u64x1 = u64x1::new(2);
+ let r: u64x1 = transmute(vcvtn_u64_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtnq_u64_f64() {
+ let a: f64x2 = f64x2::new(1.5, 2.1);
+ let e: u64x2 = u64x2::new(2, 2);
+ let r: u64x2 = transmute(vcvtnq_u64_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtns_u32_f32() {
+ let a: f32 = 1.5;
+ let e: u32 = 2;
+ let r: u32 = transmute(vcvtns_u32_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtnd_u64_f64() {
+ let a: f64 = 1.5;
+ let e: u64 = 2;
+ let r: u64 = transmute(vcvtnd_u64_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtm_u32_f32() {
+ let a: f32x2 = f32x2::new(1.1, 2.1);
+ let e: u32x2 = u32x2::new(1, 2);
+ let r: u32x2 = transmute(vcvtm_u32_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtmq_u32_f32() {
+ let a: f32x4 = f32x4::new(1.1, 2.1, 2.9, 3.9);
+ let e: u32x4 = u32x4::new(1, 2, 2, 3);
+ let r: u32x4 = transmute(vcvtmq_u32_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtm_u64_f64() {
+ let a: f64 = 1.1;
+ let e: u64x1 = u64x1::new(1);
+ let r: u64x1 = transmute(vcvtm_u64_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtmq_u64_f64() {
+ let a: f64x2 = f64x2::new(1.1, 2.1);
+ let e: u64x2 = u64x2::new(1, 2);
+ let r: u64x2 = transmute(vcvtmq_u64_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtms_u32_f32() {
+ let a: f32 = 1.1;
+ let e: u32 = 1;
+ let r: u32 = transmute(vcvtms_u32_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtmd_u64_f64() {
+ let a: f64 = 1.1;
+ let e: u64 = 1;
+ let r: u64 = transmute(vcvtmd_u64_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtp_u32_f32() {
+ let a: f32x2 = f32x2::new(1.1, 2.1);
+ let e: u32x2 = u32x2::new(2, 3);
+ let r: u32x2 = transmute(vcvtp_u32_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtpq_u32_f32() {
+ let a: f32x4 = f32x4::new(1.1, 2.1, 2.9, 3.9);
+ let e: u32x4 = u32x4::new(2, 3, 3, 4);
+ let r: u32x4 = transmute(vcvtpq_u32_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtp_u64_f64() {
+ let a: f64 = 1.1;
+ let e: u64x1 = u64x1::new(2);
+ let r: u64x1 = transmute(vcvtp_u64_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtpq_u64_f64() {
+ let a: f64x2 = f64x2::new(1.1, 2.1);
+ let e: u64x2 = u64x2::new(2, 3);
+ let r: u64x2 = transmute(vcvtpq_u64_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtps_u32_f32() {
+ let a: f32 = 1.1;
+ let e: u32 = 2;
+ let r: u32 = transmute(vcvtps_u32_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtpd_u64_f64() {
+ let a: f64 = 1.1;
+ let e: u64 = 2;
+ let r: u64 = transmute(vcvtpd_u64_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupq_laneq_p64() {
+ let a: i64x2 = i64x2::new(1, 1);
+ let e: i64x2 = i64x2::new(1, 1);
+ let r: i64x2 = transmute(vdupq_laneq_p64::<1>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupq_lane_p64() {
+ let a: i64x1 = i64x1::new(1);
+ let e: i64x2 = i64x2::new(1, 1);
+ let r: i64x2 = transmute(vdupq_lane_p64::<0>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupq_laneq_f64() {
+ let a: f64x2 = f64x2::new(1., 1.);
+ let e: f64x2 = f64x2::new(1., 1.);
+ let r: f64x2 = transmute(vdupq_laneq_f64::<1>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupq_lane_f64() {
+ let a: f64 = 1.;
+ let e: f64x2 = f64x2::new(1., 1.);
+ let r: f64x2 = transmute(vdupq_lane_f64::<0>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdup_lane_p64() {
+ let a: i64x1 = i64x1::new(0);
+ let e: i64x1 = i64x1::new(0);
+ let r: i64x1 = transmute(vdup_lane_p64::<0>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdup_lane_f64() {
+ let a: f64 = 0.;
+ let e: f64 = 0.;
+ let r: f64 = transmute(vdup_lane_f64::<0>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdup_laneq_p64() {
+ let a: i64x2 = i64x2::new(0, 1);
+ let e: i64x1 = i64x1::new(1);
+ let r: i64x1 = transmute(vdup_laneq_p64::<1>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdup_laneq_f64() {
+ let a: f64x2 = f64x2::new(0., 1.);
+ let e: f64 = 1.;
+ let r: f64 = transmute(vdup_laneq_f64::<1>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupb_lane_s8() {
+ let a: i8x8 = i8x8::new(1, 1, 1, 4, 1, 6, 7, 8);
+ let e: i8 = 1;
+ let r: i8 = transmute(vdupb_lane_s8::<4>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupb_laneq_s8() {
+ let a: i8x16 = i8x16::new(1, 1, 1, 4, 1, 6, 7, 8, 1, 10, 11, 12, 13, 14, 15, 16);
+ let e: i8 = 1;
+ let r: i8 = transmute(vdupb_laneq_s8::<8>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vduph_lane_s16() {
+ let a: i16x4 = i16x4::new(1, 1, 1, 4);
+ let e: i16 = 1;
+ let r: i16 = transmute(vduph_lane_s16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vduph_laneq_s16() {
+ let a: i16x8 = i16x8::new(1, 1, 1, 4, 1, 6, 7, 8);
+ let e: i16 = 1;
+ let r: i16 = transmute(vduph_laneq_s16::<4>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdups_lane_s32() {
+ let a: i32x2 = i32x2::new(1, 1);
+ let e: i32 = 1;
+ let r: i32 = transmute(vdups_lane_s32::<1>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdups_laneq_s32() {
+ let a: i32x4 = i32x4::new(1, 1, 1, 4);
+ let e: i32 = 1;
+ let r: i32 = transmute(vdups_laneq_s32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupd_lane_s64() {
+ let a: i64x1 = i64x1::new(1);
+ let e: i64 = 1;
+ let r: i64 = transmute(vdupd_lane_s64::<0>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupd_laneq_s64() {
+ let a: i64x2 = i64x2::new(1, 1);
+ let e: i64 = 1;
+ let r: i64 = transmute(vdupd_laneq_s64::<1>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupb_lane_u8() {
+ let a: u8x8 = u8x8::new(1, 1, 1, 4, 1, 6, 7, 8);
+ let e: u8 = 1;
+ let r: u8 = transmute(vdupb_lane_u8::<4>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupb_laneq_u8() {
+ let a: u8x16 = u8x16::new(1, 1, 1, 4, 1, 6, 7, 8, 1, 10, 11, 12, 13, 14, 15, 16);
+ let e: u8 = 1;
+ let r: u8 = transmute(vdupb_laneq_u8::<8>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vduph_lane_u16() {
+ let a: u16x4 = u16x4::new(1, 1, 1, 4);
+ let e: u16 = 1;
+ let r: u16 = transmute(vduph_lane_u16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vduph_laneq_u16() {
+ let a: u16x8 = u16x8::new(1, 1, 1, 4, 1, 6, 7, 8);
+ let e: u16 = 1;
+ let r: u16 = transmute(vduph_laneq_u16::<4>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdups_lane_u32() {
+ let a: u32x2 = u32x2::new(1, 1);
+ let e: u32 = 1;
+ let r: u32 = transmute(vdups_lane_u32::<1>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdups_laneq_u32() {
+ let a: u32x4 = u32x4::new(1, 1, 1, 4);
+ let e: u32 = 1;
+ let r: u32 = transmute(vdups_laneq_u32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupd_lane_u64() {
+ let a: u64x1 = u64x1::new(1);
+ let e: u64 = 1;
+ let r: u64 = transmute(vdupd_lane_u64::<0>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupd_laneq_u64() {
+ let a: u64x2 = u64x2::new(1, 1);
+ let e: u64 = 1;
+ let r: u64 = transmute(vdupd_laneq_u64::<1>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupb_lane_p8() {
+ let a: i8x8 = i8x8::new(1, 1, 1, 4, 1, 6, 7, 8);
+ let e: p8 = 1;
+ let r: p8 = transmute(vdupb_lane_p8::<4>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupb_laneq_p8() {
+ let a: i8x16 = i8x16::new(1, 1, 1, 4, 1, 6, 7, 8, 1, 10, 11, 12, 13, 14, 15, 16);
+ let e: p8 = 1;
+ let r: p8 = transmute(vdupb_laneq_p8::<8>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vduph_lane_p16() {
+ let a: i16x4 = i16x4::new(1, 1, 1, 4);
+ let e: p16 = 1;
+ let r: p16 = transmute(vduph_lane_p16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vduph_laneq_p16() {
+ let a: i16x8 = i16x8::new(1, 1, 1, 4, 1, 6, 7, 8);
+ let e: p16 = 1;
+ let r: p16 = transmute(vduph_laneq_p16::<4>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdups_lane_f32() {
+ let a: f32x2 = f32x2::new(1., 1.);
+ let e: f32 = 1.;
+ let r: f32 = transmute(vdups_lane_f32::<1>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdups_laneq_f32() {
+ let a: f32x4 = f32x4::new(1., 1., 1., 4.);
+ let e: f32 = 1.;
+ let r: f32 = transmute(vdups_laneq_f32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupd_lane_f64() {
+ let a: f64 = 1.;
+ let e: f64 = 1.;
+ let r: f64 = transmute(vdupd_lane_f64::<0>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupd_laneq_f64() {
+ let a: f64x2 = f64x2::new(1., 1.);
+ let e: f64 = 1.;
+ let r: f64 = transmute(vdupd_laneq_f64::<1>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vextq_p64() {
+ let a: i64x2 = i64x2::new(0, 8);
+ let b: i64x2 = i64x2::new(9, 11);
+ let e: i64x2 = i64x2::new(8, 9);
+ let r: i64x2 = transmute(vextq_p64::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vextq_f64() {
+ let a: f64x2 = f64x2::new(0., 2.);
+ let b: f64x2 = f64x2::new(3., 4.);
+ let e: f64x2 = f64x2::new(2., 3.);
+ let r: f64x2 = transmute(vextq_f64::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmla_f64() {
+ let a: f64 = 0.;
+ let b: f64 = 2.;
+ let c: f64 = 3.;
+ let e: f64 = 6.;
+ let r: f64 = transmute(vmla_f64(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlaq_f64() {
+ let a: f64x2 = f64x2::new(0., 1.);
+ let b: f64x2 = f64x2::new(2., 2.);
+ let c: f64x2 = f64x2::new(3., 3.);
+ let e: f64x2 = f64x2::new(6., 7.);
+ let r: f64x2 = transmute(vmlaq_f64(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlal_high_s8() {
+ let a: i16x8 = i16x8::new(8, 7, 6, 5, 4, 3, 2, 1);
+ let b: i8x16 = i8x16::new(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
+ let c: i8x16 = i8x16::new(3, 3, 0, 1, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 6, 7);
+ let e: i16x8 = i16x8::new(8, 9, 10, 11, 12, 13, 14, 15);
+ let r: i16x8 = transmute(vmlal_high_s8(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlal_high_s16() {
+ let a: i32x4 = i32x4::new(8, 7, 6, 5);
+ let b: i16x8 = i16x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let c: i16x8 = i16x8::new(3, 3, 0, 1, 0, 1, 2, 3);
+ let e: i32x4 = i32x4::new(8, 9, 10, 11);
+ let r: i32x4 = transmute(vmlal_high_s16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlal_high_s32() {
+ let a: i64x2 = i64x2::new(8, 7);
+ let b: i32x4 = i32x4::new(2, 2, 2, 2);
+ let c: i32x4 = i32x4::new(3, 3, 0, 1);
+ let e: i64x2 = i64x2::new(8, 9);
+ let r: i64x2 = transmute(vmlal_high_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlal_high_u8() {
+ let a: u16x8 = u16x8::new(8, 7, 6, 5, 4, 3, 2, 1);
+ let b: u8x16 = u8x16::new(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
+ let c: u8x16 = u8x16::new(3, 3, 0, 1, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 6, 7);
+ let e: u16x8 = u16x8::new(8, 9, 10, 11, 12, 13, 14, 15);
+ let r: u16x8 = transmute(vmlal_high_u8(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlal_high_u16() {
+ let a: u32x4 = u32x4::new(8, 7, 6, 5);
+ let b: u16x8 = u16x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let c: u16x8 = u16x8::new(3, 3, 0, 1, 0, 1, 2, 3);
+ let e: u32x4 = u32x4::new(8, 9, 10, 11);
+ let r: u32x4 = transmute(vmlal_high_u16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlal_high_u32() {
+ let a: u64x2 = u64x2::new(8, 7);
+ let b: u32x4 = u32x4::new(2, 2, 2, 2);
+ let c: u32x4 = u32x4::new(3, 3, 0, 1);
+ let e: u64x2 = u64x2::new(8, 9);
+ let r: u64x2 = transmute(vmlal_high_u32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlal_high_n_s16() {
+ let a: i32x4 = i32x4::new(8, 7, 6, 5);
+ let b: i16x8 = i16x8::new(3, 3, 0, 1, 0, 1, 2, 3);
+ let c: i16 = 2;
+ let e: i32x4 = i32x4::new(8, 9, 10, 11);
+ let r: i32x4 = transmute(vmlal_high_n_s16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlal_high_n_s32() {
+ let a: i64x2 = i64x2::new(8, 7);
+ let b: i32x4 = i32x4::new(3, 3, 0, 1);
+ let c: i32 = 2;
+ let e: i64x2 = i64x2::new(8, 9);
+ let r: i64x2 = transmute(vmlal_high_n_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlal_high_n_u16() {
+ let a: u32x4 = u32x4::new(8, 7, 6, 5);
+ let b: u16x8 = u16x8::new(3, 3, 0, 1, 0, 1, 2, 3);
+ let c: u16 = 2;
+ let e: u32x4 = u32x4::new(8, 9, 10, 11);
+ let r: u32x4 = transmute(vmlal_high_n_u16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlal_high_n_u32() {
+ let a: u64x2 = u64x2::new(8, 7);
+ let b: u32x4 = u32x4::new(3, 3, 0, 1);
+ let c: u32 = 2;
+ let e: u64x2 = u64x2::new(8, 9);
+ let r: u64x2 = transmute(vmlal_high_n_u32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlal_high_lane_s16() {
+ let a: i32x4 = i32x4::new(8, 7, 6, 5);
+ let b: i16x8 = i16x8::new(3, 3, 0, 1, 0, 1, 2, 3);
+ let c: i16x4 = i16x4::new(0, 2, 0, 0);
+ let e: i32x4 = i32x4::new(8, 9, 10, 11);
+ let r: i32x4 = transmute(vmlal_high_lane_s16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlal_high_laneq_s16() {
+ let a: i32x4 = i32x4::new(8, 7, 6, 5);
+ let b: i16x8 = i16x8::new(3, 3, 0, 1, 0, 1, 2, 3);
+ let c: i16x8 = i16x8::new(0, 2, 0, 0, 0, 0, 0, 0);
+ let e: i32x4 = i32x4::new(8, 9, 10, 11);
+ let r: i32x4 = transmute(vmlal_high_laneq_s16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlal_high_lane_s32() {
+ let a: i64x2 = i64x2::new(8, 7);
+ let b: i32x4 = i32x4::new(3, 3, 0, 1);
+ let c: i32x2 = i32x2::new(0, 2);
+ let e: i64x2 = i64x2::new(8, 9);
+ let r: i64x2 = transmute(vmlal_high_lane_s32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlal_high_laneq_s32() {
+ let a: i64x2 = i64x2::new(8, 7);
+ let b: i32x4 = i32x4::new(3, 3, 0, 1);
+ let c: i32x4 = i32x4::new(0, 2, 0, 0);
+ let e: i64x2 = i64x2::new(8, 9);
+ let r: i64x2 = transmute(vmlal_high_laneq_s32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlal_high_lane_u16() {
+ let a: u32x4 = u32x4::new(8, 7, 6, 5);
+ let b: u16x8 = u16x8::new(3, 3, 0, 1, 0, 1, 2, 3);
+ let c: u16x4 = u16x4::new(0, 2, 0, 0);
+ let e: u32x4 = u32x4::new(8, 9, 10, 11);
+ let r: u32x4 = transmute(vmlal_high_lane_u16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlal_high_laneq_u16() {
+ let a: u32x4 = u32x4::new(8, 7, 6, 5);
+ let b: u16x8 = u16x8::new(3, 3, 0, 1, 0, 1, 2, 3);
+ let c: u16x8 = u16x8::new(0, 2, 0, 0, 0, 0, 0, 0);
+ let e: u32x4 = u32x4::new(8, 9, 10, 11);
+ let r: u32x4 = transmute(vmlal_high_laneq_u16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlal_high_lane_u32() {
+ let a: u64x2 = u64x2::new(8, 7);
+ let b: u32x4 = u32x4::new(3, 3, 0, 1);
+ let c: u32x2 = u32x2::new(0, 2);
+ let e: u64x2 = u64x2::new(8, 9);
+ let r: u64x2 = transmute(vmlal_high_lane_u32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlal_high_laneq_u32() {
+ let a: u64x2 = u64x2::new(8, 7);
+ let b: u32x4 = u32x4::new(3, 3, 0, 1);
+ let c: u32x4 = u32x4::new(0, 2, 0, 0);
+ let e: u64x2 = u64x2::new(8, 9);
+ let r: u64x2 = transmute(vmlal_high_laneq_u32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmls_f64() {
+ let a: f64 = 6.;
+ let b: f64 = 2.;
+ let c: f64 = 3.;
+ let e: f64 = 0.;
+ let r: f64 = transmute(vmls_f64(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsq_f64() {
+ let a: f64x2 = f64x2::new(6., 7.);
+ let b: f64x2 = f64x2::new(2., 2.);
+ let c: f64x2 = f64x2::new(3., 3.);
+ let e: f64x2 = f64x2::new(0., 1.);
+ let r: f64x2 = transmute(vmlsq_f64(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsl_high_s8() {
+ let a: i16x8 = i16x8::new(14, 15, 16, 17, 18, 19, 20, 21);
+ let b: i8x16 = i8x16::new(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
+ let c: i8x16 = i8x16::new(3, 3, 0, 1, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 6, 7);
+ let e: i16x8 = i16x8::new(14, 13, 12, 11, 10, 9, 8, 7);
+ let r: i16x8 = transmute(vmlsl_high_s8(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsl_high_s16() {
+ let a: i32x4 = i32x4::new(14, 15, 16, 17);
+ let b: i16x8 = i16x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let c: i16x8 = i16x8::new(3, 3, 0, 1, 0, 1, 2, 3);
+ let e: i32x4 = i32x4::new(14, 13, 12, 11);
+ let r: i32x4 = transmute(vmlsl_high_s16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsl_high_s32() {
+ let a: i64x2 = i64x2::new(14, 15);
+ let b: i32x4 = i32x4::new(2, 2, 2, 2);
+ let c: i32x4 = i32x4::new(3, 3, 0, 1);
+ let e: i64x2 = i64x2::new(14, 13);
+ let r: i64x2 = transmute(vmlsl_high_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsl_high_u8() {
+ let a: u16x8 = u16x8::new(14, 15, 16, 17, 18, 19, 20, 21);
+ let b: u8x16 = u8x16::new(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
+ let c: u8x16 = u8x16::new(3, 3, 0, 1, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 6, 7);
+ let e: u16x8 = u16x8::new(14, 13, 12, 11, 10, 9, 8, 7);
+ let r: u16x8 = transmute(vmlsl_high_u8(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsl_high_u16() {
+ let a: u32x4 = u32x4::new(14, 15, 16, 17);
+ let b: u16x8 = u16x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let c: u16x8 = u16x8::new(3, 3, 0, 1, 0, 1, 2, 3);
+ let e: u32x4 = u32x4::new(14, 13, 12, 11);
+ let r: u32x4 = transmute(vmlsl_high_u16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsl_high_u32() {
+ let a: u64x2 = u64x2::new(14, 15);
+ let b: u32x4 = u32x4::new(2, 2, 2, 2);
+ let c: u32x4 = u32x4::new(3, 3, 0, 1);
+ let e: u64x2 = u64x2::new(14, 13);
+ let r: u64x2 = transmute(vmlsl_high_u32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsl_high_n_s16() {
+ let a: i32x4 = i32x4::new(14, 15, 16, 17);
+ let b: i16x8 = i16x8::new(3, 3, 0, 1, 0, 1, 2, 3);
+ let c: i16 = 2;
+ let e: i32x4 = i32x4::new(14, 13, 12, 11);
+ let r: i32x4 = transmute(vmlsl_high_n_s16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsl_high_n_s32() {
+ let a: i64x2 = i64x2::new(14, 15);
+ let b: i32x4 = i32x4::new(3, 3, 0, 1);
+ let c: i32 = 2;
+ let e: i64x2 = i64x2::new(14, 13);
+ let r: i64x2 = transmute(vmlsl_high_n_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsl_high_n_u16() {
+ let a: u32x4 = u32x4::new(14, 15, 16, 17);
+ let b: u16x8 = u16x8::new(3, 3, 0, 1, 0, 1, 2, 3);
+ let c: u16 = 2;
+ let e: u32x4 = u32x4::new(14, 13, 12, 11);
+ let r: u32x4 = transmute(vmlsl_high_n_u16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsl_high_n_u32() {
+ let a: u64x2 = u64x2::new(14, 15);
+ let b: u32x4 = u32x4::new(3, 3, 0, 1);
+ let c: u32 = 2;
+ let e: u64x2 = u64x2::new(14, 13);
+ let r: u64x2 = transmute(vmlsl_high_n_u32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsl_high_lane_s16() {
+ let a: i32x4 = i32x4::new(14, 15, 16, 17);
+ let b: i16x8 = i16x8::new(3, 3, 0, 1, 0, 1, 2, 3);
+ let c: i16x4 = i16x4::new(0, 2, 0, 0);
+ let e: i32x4 = i32x4::new(14, 13, 12, 11);
+ let r: i32x4 = transmute(vmlsl_high_lane_s16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsl_high_laneq_s16() {
+ let a: i32x4 = i32x4::new(14, 15, 16, 17);
+ let b: i16x8 = i16x8::new(3, 3, 0, 1, 0, 1, 2, 3);
+ let c: i16x8 = i16x8::new(0, 2, 0, 0, 0, 0, 0, 0);
+ let e: i32x4 = i32x4::new(14, 13, 12, 11);
+ let r: i32x4 = transmute(vmlsl_high_laneq_s16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsl_high_lane_s32() {
+ let a: i64x2 = i64x2::new(14, 15);
+ let b: i32x4 = i32x4::new(3, 3, 0, 1);
+ let c: i32x2 = i32x2::new(0, 2);
+ let e: i64x2 = i64x2::new(14, 13);
+ let r: i64x2 = transmute(vmlsl_high_lane_s32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsl_high_laneq_s32() {
+ let a: i64x2 = i64x2::new(14, 15);
+ let b: i32x4 = i32x4::new(3, 3, 0, 1);
+ let c: i32x4 = i32x4::new(0, 2, 0, 0);
+ let e: i64x2 = i64x2::new(14, 13);
+ let r: i64x2 = transmute(vmlsl_high_laneq_s32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsl_high_lane_u16() {
+ let a: u32x4 = u32x4::new(14, 15, 16, 17);
+ let b: u16x8 = u16x8::new(3, 3, 0, 1, 0, 1, 2, 3);
+ let c: u16x4 = u16x4::new(0, 2, 0, 0);
+ let e: u32x4 = u32x4::new(14, 13, 12, 11);
+ let r: u32x4 = transmute(vmlsl_high_lane_u16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsl_high_laneq_u16() {
+ let a: u32x4 = u32x4::new(14, 15, 16, 17);
+ let b: u16x8 = u16x8::new(3, 3, 0, 1, 0, 1, 2, 3);
+ let c: u16x8 = u16x8::new(0, 2, 0, 0, 0, 0, 0, 0);
+ let e: u32x4 = u32x4::new(14, 13, 12, 11);
+ let r: u32x4 = transmute(vmlsl_high_laneq_u16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsl_high_lane_u32() {
+ let a: u64x2 = u64x2::new(14, 15);
+ let b: u32x4 = u32x4::new(3, 3, 0, 1);
+ let c: u32x2 = u32x2::new(0, 2);
+ let e: u64x2 = u64x2::new(14, 13);
+ let r: u64x2 = transmute(vmlsl_high_lane_u32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsl_high_laneq_u32() {
+ let a: u64x2 = u64x2::new(14, 15);
+ let b: u32x4 = u32x4::new(3, 3, 0, 1);
+ let c: u32x4 = u32x4::new(0, 2, 0, 0);
+ let e: u64x2 = u64x2::new(14, 13);
+ let r: u64x2 = transmute(vmlsl_high_laneq_u32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmovn_high_s16() {
+ let a: i8x8 = i8x8::new(0, 1, 2, 3, 2, 3, 4, 5);
+ let b: i16x8 = i16x8::new(2, 3, 4, 5, 12, 13, 14, 15);
+ let e: i8x16 = i8x16::new(0, 1, 2, 3, 2, 3, 4, 5, 2, 3, 4, 5, 12, 13, 14, 15);
+ let r: i8x16 = transmute(vmovn_high_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmovn_high_s32() {
+ let a: i16x4 = i16x4::new(0, 1, 2, 3);
+ let b: i32x4 = i32x4::new(2, 3, 4, 5);
+ let e: i16x8 = i16x8::new(0, 1, 2, 3, 2, 3, 4, 5);
+ let r: i16x8 = transmute(vmovn_high_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmovn_high_s64() {
+ let a: i32x2 = i32x2::new(0, 1);
+ let b: i64x2 = i64x2::new(2, 3);
+ let e: i32x4 = i32x4::new(0, 1, 2, 3);
+ let r: i32x4 = transmute(vmovn_high_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmovn_high_u16() {
+ let a: u8x8 = u8x8::new(0, 1, 2, 3, 2, 3, 4, 5);
+ let b: u16x8 = u16x8::new(2, 3, 4, 5, 12, 13, 14, 15);
+ let e: u8x16 = u8x16::new(0, 1, 2, 3, 2, 3, 4, 5, 2, 3, 4, 5, 12, 13, 14, 15);
+ let r: u8x16 = transmute(vmovn_high_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmovn_high_u32() {
+ let a: u16x4 = u16x4::new(0, 1, 2, 3);
+ let b: u32x4 = u32x4::new(2, 3, 4, 5);
+ let e: u16x8 = u16x8::new(0, 1, 2, 3, 2, 3, 4, 5);
+ let r: u16x8 = transmute(vmovn_high_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmovn_high_u64() {
+ let a: u32x2 = u32x2::new(0, 1);
+ let b: u64x2 = u64x2::new(2, 3);
+ let e: u32x4 = u32x4::new(0, 1, 2, 3);
+ let r: u32x4 = transmute(vmovn_high_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vneg_s64() {
+ let a: i64x1 = i64x1::new(0);
+ let e: i64x1 = i64x1::new(0);
+ let r: i64x1 = transmute(vneg_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vnegq_s64() {
+ let a: i64x2 = i64x2::new(0, 1);
+ let e: i64x2 = i64x2::new(0, -1);
+ let r: i64x2 = transmute(vnegq_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vnegd_s64() {
+ let a: i64 = 1;
+ let e: i64 = -1;
+ let r: i64 = transmute(vnegd_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vneg_f64() {
+ let a: f64 = 0.;
+ let e: f64 = 0.;
+ let r: f64 = transmute(vneg_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vnegq_f64() {
+ let a: f64x2 = f64x2::new(0., 1.);
+ let e: f64x2 = f64x2::new(0., -1.);
+ let r: f64x2 = transmute(vnegq_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqneg_s64() {
+ let a: i64x1 = i64x1::new(-9223372036854775808);
+ let e: i64x1 = i64x1::new(0x7F_FF_FF_FF_FF_FF_FF_FF);
+ let r: i64x1 = transmute(vqneg_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqnegq_s64() {
+ let a: i64x2 = i64x2::new(-9223372036854775808, 0);
+ let e: i64x2 = i64x2::new(0x7F_FF_FF_FF_FF_FF_FF_FF, 0);
+ let r: i64x2 = transmute(vqnegq_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqnegb_s8() {
+ let a: i8 = 1;
+ let e: i8 = -1;
+ let r: i8 = transmute(vqnegb_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqnegh_s16() {
+ let a: i16 = 1;
+ let e: i16 = -1;
+ let r: i16 = transmute(vqnegh_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqnegs_s32() {
+ let a: i32 = 1;
+ let e: i32 = -1;
+ let r: i32 = transmute(vqnegs_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqnegd_s64() {
+ let a: i64 = 1;
+ let e: i64 = -1;
+ let r: i64 = transmute(vqnegd_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqsubb_s8() {
+ let a: i8 = 42;
+ let b: i8 = 1;
+ let e: i8 = 41;
+ let r: i8 = transmute(vqsubb_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqsubh_s16() {
+ let a: i16 = 42;
+ let b: i16 = 1;
+ let e: i16 = 41;
+ let r: i16 = transmute(vqsubh_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqsubb_u8() {
+ let a: u8 = 42;
+ let b: u8 = 1;
+ let e: u8 = 41;
+ let r: u8 = transmute(vqsubb_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqsubh_u16() {
+ let a: u16 = 42;
+ let b: u16 = 1;
+ let e: u16 = 41;
+ let r: u16 = transmute(vqsubh_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqsubs_u32() {
+ let a: u32 = 42;
+ let b: u32 = 1;
+ let e: u32 = 41;
+ let r: u32 = transmute(vqsubs_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqsubd_u64() {
+ let a: u64 = 42;
+ let b: u64 = 1;
+ let e: u64 = 41;
+ let r: u64 = transmute(vqsubd_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqsubs_s32() {
+ let a: i32 = 42;
+ let b: i32 = 1;
+ let e: i32 = 41;
+ let r: i32 = transmute(vqsubs_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqsubd_s64() {
+ let a: i64 = 42;
+ let b: i64 = 1;
+ let e: i64 = 41;
+ let r: i64 = transmute(vqsubd_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrbit_s8() {
+ let a: i8x8 = i8x8::new(0, 2, 4, 6, 8, 10, 12, 14);
+ let e: i8x8 = i8x8::new(0, 64, 32, 96, 16, 80, 48, 112);
+ let r: i8x8 = transmute(vrbit_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrbitq_s8() {
+ let a: i8x16 = i8x16::new(0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30);
+ let e: i8x16 = i8x16::new(0, 64, 32, 96, 16, 80, 48, 112, 8, 72, 40, 104, 24, 88, 56, 120);
+ let r: i8x16 = transmute(vrbitq_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrbit_u8() {
+ let a: u8x8 = u8x8::new(0, 2, 4, 6, 8, 10, 12, 14);
+ let e: u8x8 = u8x8::new(0, 64, 32, 96, 16, 80, 48, 112);
+ let r: u8x8 = transmute(vrbit_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrbitq_u8() {
+ let a: u8x16 = u8x16::new(0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30);
+ let e: u8x16 = u8x16::new(0, 64, 32, 96, 16, 80, 48, 112, 8, 72, 40, 104, 24, 88, 56, 120);
+ let r: u8x16 = transmute(vrbitq_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrbit_p8() {
+ let a: i8x8 = i8x8::new(0, 2, 4, 6, 8, 10, 12, 14);
+ let e: i8x8 = i8x8::new(0, 64, 32, 96, 16, 80, 48, 112);
+ let r: i8x8 = transmute(vrbit_p8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrbitq_p8() {
+ let a: i8x16 = i8x16::new(0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30);
+ let e: i8x16 = i8x16::new(0, 64, 32, 96, 16, 80, 48, 112, 8, 72, 40, 104, 24, 88, 56, 120);
+ let r: i8x16 = transmute(vrbitq_p8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrndx_f32() {
+ let a: f32x2 = f32x2::new(-1.5, 0.5);
+ let e: f32x2 = f32x2::new(-2.0, 0.0);
+ let r: f32x2 = transmute(vrndx_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrndxq_f32() {
+ let a: f32x4 = f32x4::new(-1.5, 0.5, 1.5, 2.5);
+ let e: f32x4 = f32x4::new(-2.0, 0.0, 2.0, 2.0);
+ let r: f32x4 = transmute(vrndxq_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrndx_f64() {
+ let a: f64 = -1.5;
+ let e: f64 = -2.0;
+ let r: f64 = transmute(vrndx_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrndxq_f64() {
+ let a: f64x2 = f64x2::new(-1.5, 0.5);
+ let e: f64x2 = f64x2::new(-2.0, 0.0);
+ let r: f64x2 = transmute(vrndxq_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrnda_f32() {
+ let a: f32x2 = f32x2::new(-1.5, 0.5);
+ let e: f32x2 = f32x2::new(-2.0, 1.0);
+ let r: f32x2 = transmute(vrnda_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrndaq_f32() {
+ let a: f32x4 = f32x4::new(-1.5, 0.5, 1.5, 2.5);
+ let e: f32x4 = f32x4::new(-2.0, 1.0, 2.0, 3.0);
+ let r: f32x4 = transmute(vrndaq_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrnda_f64() {
+ let a: f64 = -1.5;
+ let e: f64 = -2.0;
+ let r: f64 = transmute(vrnda_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrndaq_f64() {
+ let a: f64x2 = f64x2::new(-1.5, 0.5);
+ let e: f64x2 = f64x2::new(-2.0, 1.0);
+ let r: f64x2 = transmute(vrndaq_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrndn_f64() {
+ let a: f64 = -1.5;
+ let e: f64 = -2.0;
+ let r: f64 = transmute(vrndn_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrndnq_f64() {
+ let a: f64x2 = f64x2::new(-1.5, 0.5);
+ let e: f64x2 = f64x2::new(-2.0, 0.0);
+ let r: f64x2 = transmute(vrndnq_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrndns_f32() {
+ let a: f32 = -1.5;
+ let e: f32 = -2.0;
+ let r: f32 = transmute(vrndns_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrndm_f32() {
+ let a: f32x2 = f32x2::new(-1.5, 0.5);
+ let e: f32x2 = f32x2::new(-2.0, 0.0);
+ let r: f32x2 = transmute(vrndm_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrndmq_f32() {
+ let a: f32x4 = f32x4::new(-1.5, 0.5, 1.5, 2.5);
+ let e: f32x4 = f32x4::new(-2.0, 0.0, 1.0, 2.0);
+ let r: f32x4 = transmute(vrndmq_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrndm_f64() {
+ let a: f64 = -1.5;
+ let e: f64 = -2.0;
+ let r: f64 = transmute(vrndm_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrndmq_f64() {
+ let a: f64x2 = f64x2::new(-1.5, 0.5);
+ let e: f64x2 = f64x2::new(-2.0, 0.0);
+ let r: f64x2 = transmute(vrndmq_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrndp_f32() {
+ let a: f32x2 = f32x2::new(-1.5, 0.5);
+ let e: f32x2 = f32x2::new(-1.0, 1.0);
+ let r: f32x2 = transmute(vrndp_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrndpq_f32() {
+ let a: f32x4 = f32x4::new(-1.5, 0.5, 1.5, 2.5);
+ let e: f32x4 = f32x4::new(-1.0, 1.0, 2.0, 3.0);
+ let r: f32x4 = transmute(vrndpq_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrndp_f64() {
+ let a: f64 = -1.5;
+ let e: f64 = -1.0;
+ let r: f64 = transmute(vrndp_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrndpq_f64() {
+ let a: f64x2 = f64x2::new(-1.5, 0.5);
+ let e: f64x2 = f64x2::new(-1.0, 1.0);
+ let r: f64x2 = transmute(vrndpq_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrnd_f32() {
+ let a: f32x2 = f32x2::new(-1.5, 0.5);
+ let e: f32x2 = f32x2::new(-1.0, 0.0);
+ let r: f32x2 = transmute(vrnd_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrndq_f32() {
+ let a: f32x4 = f32x4::new(-1.5, 0.5, 1.5, 2.5);
+ let e: f32x4 = f32x4::new(-1.0, 0.0, 1.0, 2.0);
+ let r: f32x4 = transmute(vrndq_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrnd_f64() {
+ let a: f64 = -1.5;
+ let e: f64 = -1.0;
+ let r: f64 = transmute(vrnd_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrndq_f64() {
+ let a: f64x2 = f64x2::new(-1.5, 0.5);
+ let e: f64x2 = f64x2::new(-1.0, 0.0);
+ let r: f64x2 = transmute(vrndq_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrndi_f32() {
+ let a: f32x2 = f32x2::new(-1.5, 0.5);
+ let e: f32x2 = f32x2::new(-2.0, 0.0);
+ let r: f32x2 = transmute(vrndi_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrndiq_f32() {
+ let a: f32x4 = f32x4::new(-1.5, 0.5, 1.5, 2.5);
+ let e: f32x4 = f32x4::new(-2.0, 0.0, 2.0, 2.0);
+ let r: f32x4 = transmute(vrndiq_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrndi_f64() {
+ let a: f64 = -1.5;
+ let e: f64 = -2.0;
+ let r: f64 = transmute(vrndi_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrndiq_f64() {
+ let a: f64x2 = f64x2::new(-1.5, 0.5);
+ let e: f64x2 = f64x2::new(-2.0, 0.0);
+ let r: f64x2 = transmute(vrndiq_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqaddb_s8() {
+ let a: i8 = 42;
+ let b: i8 = 1;
+ let e: i8 = 43;
+ let r: i8 = transmute(vqaddb_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqaddh_s16() {
+ let a: i16 = 42;
+ let b: i16 = 1;
+ let e: i16 = 43;
+ let r: i16 = transmute(vqaddh_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqaddb_u8() {
+ let a: u8 = 42;
+ let b: u8 = 1;
+ let e: u8 = 43;
+ let r: u8 = transmute(vqaddb_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqaddh_u16() {
+ let a: u16 = 42;
+ let b: u16 = 1;
+ let e: u16 = 43;
+ let r: u16 = transmute(vqaddh_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqadds_u32() {
+ let a: u32 = 42;
+ let b: u32 = 1;
+ let e: u32 = 43;
+ let r: u32 = transmute(vqadds_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqaddd_u64() {
+ let a: u64 = 42;
+ let b: u64 = 1;
+ let e: u64 = 43;
+ let r: u64 = transmute(vqaddd_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqadds_s32() {
+ let a: i32 = 42;
+ let b: i32 = 1;
+ let e: i32 = 43;
+ let r: i32 = transmute(vqadds_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqaddd_s64() {
+ let a: i64 = 42;
+ let b: i64 = 1;
+ let e: i64 = 43;
+ let r: i64 = transmute(vqaddd_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_f64_x2() {
+ let a: [f64; 3] = [0., 1., 2.];
+ let e: [f64; 2] = [1., 2.];
+ let r: [f64; 2] = transmute(vld1_f64_x2(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_f64_x2() {
+ let a: [f64; 5] = [0., 1., 2., 3., 4.];
+ let e: [f64x2; 2] = [f64x2::new(1., 2.), f64x2::new(3., 4.)];
+ let r: [f64x2; 2] = transmute(vld1q_f64_x2(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_f64_x3() {
+ let a: [f64; 4] = [0., 1., 2., 3.];
+ let e: [f64; 3] = [1., 2., 3.];
+ let r: [f64; 3] = transmute(vld1_f64_x3(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_f64_x3() {
+ let a: [f64; 7] = [0., 1., 2., 3., 4., 5., 6.];
+ let e: [f64x2; 3] = [f64x2::new(1., 2.), f64x2::new(3., 4.), f64x2::new(5., 6.)];
+ let r: [f64x2; 3] = transmute(vld1q_f64_x3(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_f64_x4() {
+ let a: [f64; 5] = [0., 1., 2., 3., 4.];
+ let e: [f64; 4] = [1., 2., 3., 4.];
+ let r: [f64; 4] = transmute(vld1_f64_x4(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_f64_x4() {
+ let a: [f64; 9] = [0., 1., 2., 3., 4., 5., 6., 7., 8.];
+ let e: [f64x2; 4] = [f64x2::new(1., 2.), f64x2::new(3., 4.), f64x2::new(5., 6.), f64x2::new(7., 8.)];
+ let r: [f64x2; 4] = transmute(vld1q_f64_x4(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2q_s64() {
+ let a: [i64; 5] = [0, 1, 2, 2, 3];
+ let e: [i64x2; 2] = [i64x2::new(1, 2), i64x2::new(2, 3)];
+ let r: [i64x2; 2] = transmute(vld2q_s64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2q_u64() {
+ let a: [u64; 5] = [0, 1, 2, 2, 3];
+ let e: [u64x2; 2] = [u64x2::new(1, 2), u64x2::new(2, 3)];
+ let r: [u64x2; 2] = transmute(vld2q_u64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2q_p64() {
+ let a: [u64; 5] = [0, 1, 2, 2, 3];
+ let e: [i64x2; 2] = [i64x2::new(1, 2), i64x2::new(2, 3)];
+ let r: [i64x2; 2] = transmute(vld2q_p64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2_f64() {
+ let a: [f64; 3] = [0., 1., 2.];
+ let e: [f64; 2] = [1., 2.];
+ let r: [f64; 2] = transmute(vld2_f64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2q_f64() {
+ let a: [f64; 5] = [0., 1., 2., 2., 3.];
+ let e: [f64x2; 2] = [f64x2::new(1., 2.), f64x2::new(2., 3.)];
+ let r: [f64x2; 2] = transmute(vld2q_f64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2q_dup_s64() {
+ let a: [i64; 5] = [0, 1, 1, 2, 3];
+ let e: [i64x2; 2] = [i64x2::new(1, 1), i64x2::new(1, 1)];
+ let r: [i64x2; 2] = transmute(vld2q_dup_s64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2q_dup_u64() {
+ let a: [u64; 5] = [0, 1, 1, 2, 3];
+ let e: [u64x2; 2] = [u64x2::new(1, 1), u64x2::new(1, 1)];
+ let r: [u64x2; 2] = transmute(vld2q_dup_u64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2q_dup_p64() {
+ let a: [u64; 5] = [0, 1, 1, 2, 3];
+ let e: [i64x2; 2] = [i64x2::new(1, 1), i64x2::new(1, 1)];
+ let r: [i64x2; 2] = transmute(vld2q_dup_p64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2_dup_f64() {
+ let a: [f64; 3] = [0., 1., 1.];
+ let e: [f64; 2] = [1., 1.];
+ let r: [f64; 2] = transmute(vld2_dup_f64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2q_dup_f64() {
+ let a: [f64; 5] = [0., 1., 1., 2., 3.];
+ let e: [f64x2; 2] = [f64x2::new(1., 1.), f64x2::new(1., 1.)];
+ let r: [f64x2; 2] = transmute(vld2q_dup_f64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2q_lane_s8() {
+ let a: [i8; 33] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8];
+ let b: [i8x16; 2] = [i8x16::new(0, 2, 2, 14, 2, 16, 17, 18, 2, 20, 21, 22, 23, 24, 25, 26), i8x16::new(11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26)];
+ let e: [i8x16; 2] = [i8x16::new(1, 2, 2, 14, 2, 16, 17, 18, 2, 20, 21, 22, 23, 24, 25, 26), i8x16::new(2, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26)];
+ let r: [i8x16; 2] = transmute(vld2q_lane_s8::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2_lane_s64() {
+ let a: [i64; 3] = [0, 1, 2];
+ let b: [i64x1; 2] = [i64x1::new(0), i64x1::new(2)];
+ let e: [i64x1; 2] = [i64x1::new(1), i64x1::new(2)];
+ let r: [i64x1; 2] = transmute(vld2_lane_s64::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2q_lane_s64() {
+ let a: [i64; 5] = [0, 1, 2, 3, 4];
+ let b: [i64x2; 2] = [i64x2::new(0, 2), i64x2::new(2, 14)];
+ let e: [i64x2; 2] = [i64x2::new(1, 2), i64x2::new(2, 14)];
+ let r: [i64x2; 2] = transmute(vld2q_lane_s64::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2_lane_p64() {
+ let a: [u64; 3] = [0, 1, 2];
+ let b: [i64x1; 2] = [i64x1::new(0), i64x1::new(2)];
+ let e: [i64x1; 2] = [i64x1::new(1), i64x1::new(2)];
+ let r: [i64x1; 2] = transmute(vld2_lane_p64::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2q_lane_p64() {
+ let a: [u64; 5] = [0, 1, 2, 3, 4];
+ let b: [i64x2; 2] = [i64x2::new(0, 2), i64x2::new(2, 14)];
+ let e: [i64x2; 2] = [i64x2::new(1, 2), i64x2::new(2, 14)];
+ let r: [i64x2; 2] = transmute(vld2q_lane_p64::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2q_lane_u8() {
+ let a: [u8; 33] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8];
+ let b: [u8x16; 2] = [u8x16::new(0, 2, 2, 14, 2, 16, 17, 18, 2, 20, 21, 22, 23, 24, 25, 26), u8x16::new(11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26)];
+ let e: [u8x16; 2] = [u8x16::new(1, 2, 2, 14, 2, 16, 17, 18, 2, 20, 21, 22, 23, 24, 25, 26), u8x16::new(2, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26)];
+ let r: [u8x16; 2] = transmute(vld2q_lane_u8::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2_lane_u64() {
+ let a: [u64; 3] = [0, 1, 2];
+ let b: [u64x1; 2] = [u64x1::new(0), u64x1::new(2)];
+ let e: [u64x1; 2] = [u64x1::new(1), u64x1::new(2)];
+ let r: [u64x1; 2] = transmute(vld2_lane_u64::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2q_lane_u64() {
+ let a: [u64; 5] = [0, 1, 2, 3, 4];
+ let b: [u64x2; 2] = [u64x2::new(0, 2), u64x2::new(2, 14)];
+ let e: [u64x2; 2] = [u64x2::new(1, 2), u64x2::new(2, 14)];
+ let r: [u64x2; 2] = transmute(vld2q_lane_u64::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2q_lane_p8() {
+ let a: [u8; 33] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8];
+ let b: [i8x16; 2] = [i8x16::new(0, 2, 2, 14, 2, 16, 17, 18, 2, 20, 21, 22, 23, 24, 25, 26), i8x16::new(11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26)];
+ let e: [i8x16; 2] = [i8x16::new(1, 2, 2, 14, 2, 16, 17, 18, 2, 20, 21, 22, 23, 24, 25, 26), i8x16::new(2, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26)];
+ let r: [i8x16; 2] = transmute(vld2q_lane_p8::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2_lane_f64() {
+ let a: [f64; 3] = [0., 1., 2.];
+ let b: [f64; 2] = [0., 2.];
+ let e: [f64; 2] = [1., 2.];
+ let r: [f64; 2] = transmute(vld2_lane_f64::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2q_lane_f64() {
+ let a: [f64; 5] = [0., 1., 2., 3., 4.];
+ let b: [f64x2; 2] = [f64x2::new(0., 2.), f64x2::new(2., 14.)];
+ let e: [f64x2; 2] = [f64x2::new(1., 2.), f64x2::new(2., 14.)];
+ let r: [f64x2; 2] = transmute(vld2q_lane_f64::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3q_s64() {
+ let a: [i64; 7] = [0, 1, 2, 2, 2, 4, 4];
+ let e: [i64x2; 3] = [i64x2::new(1, 2), i64x2::new(2, 4), i64x2::new(2, 4)];
+ let r: [i64x2; 3] = transmute(vld3q_s64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3q_u64() {
+ let a: [u64; 7] = [0, 1, 2, 2, 2, 4, 4];
+ let e: [u64x2; 3] = [u64x2::new(1, 2), u64x2::new(2, 4), u64x2::new(2, 4)];
+ let r: [u64x2; 3] = transmute(vld3q_u64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3q_p64() {
+ let a: [u64; 7] = [0, 1, 2, 2, 2, 4, 4];
+ let e: [i64x2; 3] = [i64x2::new(1, 2), i64x2::new(2, 4), i64x2::new(2, 4)];
+ let r: [i64x2; 3] = transmute(vld3q_p64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3_f64() {
+ let a: [f64; 4] = [0., 1., 2., 2.];
+ let e: [f64; 3] = [1., 2., 2.];
+ let r: [f64; 3] = transmute(vld3_f64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3q_f64() {
+ let a: [f64; 7] = [0., 1., 2., 2., 2., 4., 4.];
+ let e: [f64x2; 3] = [f64x2::new(1., 2.), f64x2::new(2., 4.), f64x2::new(2., 4.)];
+ let r: [f64x2; 3] = transmute(vld3q_f64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3q_dup_s64() {
+ let a: [i64; 7] = [0, 1, 1, 1, 3, 1, 4];
+ let e: [i64x2; 3] = [i64x2::new(1, 1), i64x2::new(1, 1), i64x2::new(1, 1)];
+ let r: [i64x2; 3] = transmute(vld3q_dup_s64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3q_dup_u64() {
+ let a: [u64; 7] = [0, 1, 1, 1, 3, 1, 4];
+ let e: [u64x2; 3] = [u64x2::new(1, 1), u64x2::new(1, 1), u64x2::new(1, 1)];
+ let r: [u64x2; 3] = transmute(vld3q_dup_u64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3q_dup_p64() {
+ let a: [u64; 7] = [0, 1, 1, 1, 3, 1, 4];
+ let e: [i64x2; 3] = [i64x2::new(1, 1), i64x2::new(1, 1), i64x2::new(1, 1)];
+ let r: [i64x2; 3] = transmute(vld3q_dup_p64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3_dup_f64() {
+ let a: [f64; 4] = [0., 1., 1., 1.];
+ let e: [f64; 3] = [1., 1., 1.];
+ let r: [f64; 3] = transmute(vld3_dup_f64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3q_dup_f64() {
+ let a: [f64; 7] = [0., 1., 1., 1., 3., 1., 4.];
+ let e: [f64x2; 3] = [f64x2::new(1., 1.), f64x2::new(1., 1.), f64x2::new(1., 1.)];
+ let r: [f64x2; 3] = transmute(vld3q_dup_f64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3q_lane_s8() {
+ let a: [i8; 49] = [0, 1, 2, 2, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8];
+ let b: [i8x16; 3] = [i8x16::new(0, 2, 2, 14, 2, 16, 17, 18, 2, 20, 21, 22, 23, 24, 25, 26), i8x16::new(11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26), i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8)];
+ let e: [i8x16; 3] = [i8x16::new(1, 2, 2, 14, 2, 16, 17, 18, 2, 20, 21, 22, 23, 24, 25, 26), i8x16::new(2, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26), i8x16::new(2, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8)];
+ let r: [i8x16; 3] = transmute(vld3q_lane_s8::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3_lane_s64() {
+ let a: [i64; 4] = [0, 1, 2, 2];
+ let b: [i64x1; 3] = [i64x1::new(0), i64x1::new(2), i64x1::new(2)];
+ let e: [i64x1; 3] = [i64x1::new(1), i64x1::new(2), i64x1::new(2)];
+ let r: [i64x1; 3] = transmute(vld3_lane_s64::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3q_lane_s64() {
+ let a: [i64; 7] = [0, 1, 2, 2, 4, 5, 6];
+ let b: [i64x2; 3] = [i64x2::new(0, 2), i64x2::new(2, 14), i64x2::new(2, 16)];
+ let e: [i64x2; 3] = [i64x2::new(1, 2), i64x2::new(2, 14), i64x2::new(2, 16)];
+ let r: [i64x2; 3] = transmute(vld3q_lane_s64::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3_lane_p64() {
+ let a: [u64; 4] = [0, 1, 2, 2];
+ let b: [i64x1; 3] = [i64x1::new(0), i64x1::new(2), i64x1::new(2)];
+ let e: [i64x1; 3] = [i64x1::new(1), i64x1::new(2), i64x1::new(2)];
+ let r: [i64x1; 3] = transmute(vld3_lane_p64::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3q_lane_p64() {
+ let a: [u64; 7] = [0, 1, 2, 2, 4, 5, 6];
+ let b: [i64x2; 3] = [i64x2::new(0, 2), i64x2::new(2, 14), i64x2::new(2, 16)];
+ let e: [i64x2; 3] = [i64x2::new(1, 2), i64x2::new(2, 14), i64x2::new(2, 16)];
+ let r: [i64x2; 3] = transmute(vld3q_lane_p64::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3q_lane_p8() {
+ let a: [u8; 49] = [0, 1, 2, 2, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8];
+ let b: [i8x16; 3] = [i8x16::new(0, 2, 2, 14, 2, 16, 17, 18, 2, 20, 21, 22, 23, 24, 25, 26), i8x16::new(11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26), i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8)];
+ let e: [i8x16; 3] = [i8x16::new(1, 2, 2, 14, 2, 16, 17, 18, 2, 20, 21, 22, 23, 24, 25, 26), i8x16::new(2, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26), i8x16::new(2, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8)];
+ let r: [i8x16; 3] = transmute(vld3q_lane_p8::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3q_lane_u8() {
+ let a: [u8; 49] = [0, 1, 2, 2, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8];
+ let b: [u8x16; 3] = [u8x16::new(0, 2, 2, 14, 2, 16, 17, 18, 2, 20, 21, 22, 23, 24, 25, 26), u8x16::new(11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26), u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8)];
+ let e: [u8x16; 3] = [u8x16::new(1, 2, 2, 14, 2, 16, 17, 18, 2, 20, 21, 22, 23, 24, 25, 26), u8x16::new(2, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26), u8x16::new(2, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8)];
+ let r: [u8x16; 3] = transmute(vld3q_lane_u8::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3_lane_u64() {
+ let a: [u64; 4] = [0, 1, 2, 2];
+ let b: [u64x1; 3] = [u64x1::new(0), u64x1::new(2), u64x1::new(2)];
+ let e: [u64x1; 3] = [u64x1::new(1), u64x1::new(2), u64x1::new(2)];
+ let r: [u64x1; 3] = transmute(vld3_lane_u64::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3q_lane_u64() {
+ let a: [u64; 7] = [0, 1, 2, 2, 4, 5, 6];
+ let b: [u64x2; 3] = [u64x2::new(0, 2), u64x2::new(2, 14), u64x2::new(2, 16)];
+ let e: [u64x2; 3] = [u64x2::new(1, 2), u64x2::new(2, 14), u64x2::new(2, 16)];
+ let r: [u64x2; 3] = transmute(vld3q_lane_u64::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3_lane_f64() {
+ let a: [f64; 4] = [0., 1., 2., 2.];
+ let b: [f64; 3] = [0., 2., 2.];
+ let e: [f64; 3] = [1., 2., 2.];
+ let r: [f64; 3] = transmute(vld3_lane_f64::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3q_lane_f64() {
+ let a: [f64; 7] = [0., 1., 2., 2., 4., 5., 6.];
+ let b: [f64x2; 3] = [f64x2::new(0., 2.), f64x2::new(2., 14.), f64x2::new(9., 16.)];
+ let e: [f64x2; 3] = [f64x2::new(1., 2.), f64x2::new(2., 14.), f64x2::new(2., 16.)];
+ let r: [f64x2; 3] = transmute(vld3q_lane_f64::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4q_s64() {
+ let a: [i64; 9] = [0, 1, 2, 2, 6, 2, 6, 6, 8];
+ let e: [i64x2; 4] = [i64x2::new(1, 2), i64x2::new(2, 6), i64x2::new(2, 6), i64x2::new(6, 8)];
+ let r: [i64x2; 4] = transmute(vld4q_s64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4q_u64() {
+ let a: [u64; 9] = [0, 1, 2, 2, 6, 2, 6, 6, 8];
+ let e: [u64x2; 4] = [u64x2::new(1, 2), u64x2::new(2, 6), u64x2::new(2, 6), u64x2::new(6, 8)];
+ let r: [u64x2; 4] = transmute(vld4q_u64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4q_p64() {
+ let a: [u64; 9] = [0, 1, 2, 2, 6, 2, 6, 6, 8];
+ let e: [i64x2; 4] = [i64x2::new(1, 2), i64x2::new(2, 6), i64x2::new(2, 6), i64x2::new(6, 8)];
+ let r: [i64x2; 4] = transmute(vld4q_p64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4_f64() {
+ let a: [f64; 5] = [0., 1., 2., 2., 6.];
+ let e: [f64; 4] = [1., 2., 2., 6.];
+ let r: [f64; 4] = transmute(vld4_f64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4q_f64() {
+ let a: [f64; 9] = [0., 1., 2., 2., 6., 2., 6., 6., 8.];
+ let e: [f64x2; 4] = [f64x2::new(1., 2.), f64x2::new(2., 6.), f64x2::new(2., 6.), f64x2::new(6., 8.)];
+ let r: [f64x2; 4] = transmute(vld4q_f64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4q_dup_s64() {
+ let a: [i64; 9] = [0, 1, 1, 1, 1, 2, 4, 3, 5];
+ let e: [i64x2; 4] = [i64x2::new(1, 1), i64x2::new(1, 1), i64x2::new(1, 1), i64x2::new(1, 1)];
+ let r: [i64x2; 4] = transmute(vld4q_dup_s64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4q_dup_u64() {
+ let a: [u64; 9] = [0, 1, 1, 1, 1, 2, 4, 3, 5];
+ let e: [u64x2; 4] = [u64x2::new(1, 1), u64x2::new(1, 1), u64x2::new(1, 1), u64x2::new(1, 1)];
+ let r: [u64x2; 4] = transmute(vld4q_dup_u64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4q_dup_p64() {
+ let a: [u64; 9] = [0, 1, 1, 1, 1, 2, 4, 3, 5];
+ let e: [i64x2; 4] = [i64x2::new(1, 1), i64x2::new(1, 1), i64x2::new(1, 1), i64x2::new(1, 1)];
+ let r: [i64x2; 4] = transmute(vld4q_dup_p64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4_dup_f64() {
+ let a: [f64; 5] = [0., 1., 1., 1., 1.];
+ let e: [f64; 4] = [1., 1., 1., 1.];
+ let r: [f64; 4] = transmute(vld4_dup_f64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4q_dup_f64() {
+ let a: [f64; 9] = [0., 1., 1., 1., 1., 6., 4., 3., 5.];
+ let e: [f64x2; 4] = [f64x2::new(1., 1.), f64x2::new(1., 1.), f64x2::new(1., 1.), f64x2::new(1., 1.)];
+ let r: [f64x2; 4] = transmute(vld4q_dup_f64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4q_lane_s8() {
+ let a: [i8; 65] = [0, 1, 2, 2, 2, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 2, 4, 2, 4, 7, 8, 2, 4, 7, 8, 13, 14, 15, 16];
+ let b: [i8x16; 4] = [i8x16::new(0, 2, 2, 2, 2, 16, 2, 18, 2, 20, 21, 22, 2, 24, 25, 26), i8x16::new(11, 12, 13, 14, 15, 16, 2, 18, 2, 20, 21, 22, 23, 24, 25, 26), i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8), i8x16::new(1, 2, 2, 4, 2, 4, 7, 8, 2, 4, 7, 8, 13, 14, 15, 16)];
+ let e: [i8x16; 4] = [i8x16::new(1, 2, 2, 2, 2, 16, 2, 18, 2, 20, 21, 22, 2, 24, 25, 26), i8x16::new(2, 12, 13, 14, 15, 16, 2, 18, 2, 20, 21, 22, 23, 24, 25, 26), i8x16::new(2, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8), i8x16::new(2, 2, 2, 4, 2, 4, 7, 8, 2, 4, 7, 8, 13, 14, 15, 16)];
+ let r: [i8x16; 4] = transmute(vld4q_lane_s8::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4_lane_s64() {
+ let a: [i64; 5] = [0, 1, 2, 2, 2];
+ let b: [i64x1; 4] = [i64x1::new(0), i64x1::new(2), i64x1::new(2), i64x1::new(2)];
+ let e: [i64x1; 4] = [i64x1::new(1), i64x1::new(2), i64x1::new(2), i64x1::new(2)];
+ let r: [i64x1; 4] = transmute(vld4_lane_s64::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4q_lane_s64() {
+ let a: [i64; 9] = [0, 1, 2, 2, 2, 5, 6, 7, 8];
+ let b: [i64x2; 4] = [i64x2::new(0, 2), i64x2::new(2, 2), i64x2::new(2, 16), i64x2::new(2, 18)];
+ let e: [i64x2; 4] = [i64x2::new(1, 2), i64x2::new(2, 2), i64x2::new(2, 16), i64x2::new(2, 18)];
+ let r: [i64x2; 4] = transmute(vld4q_lane_s64::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4_lane_p64() {
+ let a: [u64; 5] = [0, 1, 2, 2, 2];
+ let b: [i64x1; 4] = [i64x1::new(0), i64x1::new(2), i64x1::new(2), i64x1::new(2)];
+ let e: [i64x1; 4] = [i64x1::new(1), i64x1::new(2), i64x1::new(2), i64x1::new(2)];
+ let r: [i64x1; 4] = transmute(vld4_lane_p64::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4q_lane_p64() {
+ let a: [u64; 9] = [0, 1, 2, 2, 2, 5, 6, 7, 8];
+ let b: [i64x2; 4] = [i64x2::new(0, 2), i64x2::new(2, 2), i64x2::new(2, 16), i64x2::new(2, 18)];
+ let e: [i64x2; 4] = [i64x2::new(1, 2), i64x2::new(2, 2), i64x2::new(2, 16), i64x2::new(2, 18)];
+ let r: [i64x2; 4] = transmute(vld4q_lane_p64::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4q_lane_p8() {
+ let a: [u8; 65] = [0, 1, 2, 2, 2, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 2, 4, 2, 4, 7, 8, 2, 4, 7, 8, 13, 14, 15, 16];
+ let b: [i8x16; 4] = [i8x16::new(0, 2, 2, 2, 2, 16, 2, 18, 2, 20, 21, 22, 2, 24, 25, 26), i8x16::new(11, 12, 13, 14, 15, 16, 2, 18, 2, 20, 21, 22, 23, 24, 25, 26), i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8), i8x16::new(1, 2, 2, 4, 2, 4, 7, 8, 2, 4, 7, 8, 13, 14, 15, 16)];
+ let e: [i8x16; 4] = [i8x16::new(1, 2, 2, 2, 2, 16, 2, 18, 2, 20, 21, 22, 2, 24, 25, 26), i8x16::new(2, 12, 13, 14, 15, 16, 2, 18, 2, 20, 21, 22, 23, 24, 25, 26), i8x16::new(2, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8), i8x16::new(2, 2, 2, 4, 2, 4, 7, 8, 2, 4, 7, 8, 13, 14, 15, 16)];
+ let r: [i8x16; 4] = transmute(vld4q_lane_p8::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4q_lane_u8() {
+ let a: [u8; 65] = [0, 1, 2, 2, 2, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 2, 4, 2, 4, 7, 8, 2, 4, 7, 8, 13, 14, 15, 16];
+ let b: [u8x16; 4] = [u8x16::new(0, 2, 2, 2, 2, 16, 2, 18, 2, 20, 21, 22, 2, 24, 25, 26), u8x16::new(11, 12, 13, 14, 15, 16, 2, 18, 2, 20, 21, 22, 23, 24, 25, 26), u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8), u8x16::new(1, 2, 2, 4, 2, 4, 7, 8, 2, 4, 7, 8, 13, 14, 15, 16)];
+ let e: [u8x16; 4] = [u8x16::new(1, 2, 2, 2, 2, 16, 2, 18, 2, 20, 21, 22, 2, 24, 25, 26), u8x16::new(2, 12, 13, 14, 15, 16, 2, 18, 2, 20, 21, 22, 23, 24, 25, 26), u8x16::new(2, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8), u8x16::new(2, 2, 2, 4, 2, 4, 7, 8, 2, 4, 7, 8, 13, 14, 15, 16)];
+ let r: [u8x16; 4] = transmute(vld4q_lane_u8::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4_lane_u64() {
+ let a: [u64; 5] = [0, 1, 2, 2, 2];
+ let b: [u64x1; 4] = [u64x1::new(0), u64x1::new(2), u64x1::new(2), u64x1::new(2)];
+ let e: [u64x1; 4] = [u64x1::new(1), u64x1::new(2), u64x1::new(2), u64x1::new(2)];
+ let r: [u64x1; 4] = transmute(vld4_lane_u64::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4q_lane_u64() {
+ let a: [u64; 9] = [0, 1, 2, 2, 2, 5, 6, 7, 8];
+ let b: [u64x2; 4] = [u64x2::new(0, 2), u64x2::new(2, 2), u64x2::new(2, 16), u64x2::new(2, 18)];
+ let e: [u64x2; 4] = [u64x2::new(1, 2), u64x2::new(2, 2), u64x2::new(2, 16), u64x2::new(2, 18)];
+ let r: [u64x2; 4] = transmute(vld4q_lane_u64::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4_lane_f64() {
+ let a: [f64; 5] = [0., 1., 2., 2., 2.];
+ let b: [f64; 4] = [0., 2., 2., 2.];
+ let e: [f64; 4] = [1., 2., 2., 2.];
+ let r: [f64; 4] = transmute(vld4_lane_f64::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4q_lane_f64() {
+ let a: [f64; 9] = [0., 1., 2., 2., 2., 5., 6., 7., 8.];
+ let b: [f64x2; 4] = [f64x2::new(0., 2.), f64x2::new(2., 2.), f64x2::new(2., 16.), f64x2::new(2., 18.)];
+ let e: [f64x2; 4] = [f64x2::new(1., 2.), f64x2::new(2., 2.), f64x2::new(2., 16.), f64x2::new(2., 18.)];
+ let r: [f64x2; 4] = transmute(vld4q_lane_f64::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_lane_f64() {
+ let a: [f64; 2] = [0., 1.];
+ let e: [f64; 1] = [1.];
+ let mut r: [f64; 1] = [0f64; 1];
+ vst1_lane_f64::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_lane_f64() {
+ let a: [f64; 3] = [0., 1., 2.];
+ let e: [f64; 2] = [1., 0.];
+ let mut r: [f64; 2] = [0f64; 2];
+ vst1q_lane_f64::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_f64_x2() {
+ let a: [f64; 3] = [0., 1., 2.];
+ let e: [f64; 2] = [1., 2.];
+ let mut r: [f64; 2] = [0f64; 2];
+ vst1_f64_x2(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_f64_x2() {
+ let a: [f64; 5] = [0., 1., 2., 3., 4.];
+ let e: [f64; 4] = [1., 2., 3., 4.];
+ let mut r: [f64; 4] = [0f64; 4];
+ vst1q_f64_x2(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_f64_x3() {
+ let a: [f64; 4] = [0., 1., 2., 3.];
+ let e: [f64; 3] = [1., 2., 3.];
+ let mut r: [f64; 3] = [0f64; 3];
+ vst1_f64_x3(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_f64_x3() {
+ let a: [f64; 7] = [0., 1., 2., 3., 4., 5., 6.];
+ let e: [f64; 6] = [1., 2., 3., 4., 5., 6.];
+ let mut r: [f64; 6] = [0f64; 6];
+ vst1q_f64_x3(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_f64_x4() {
+ let a: [f64; 5] = [0., 1., 2., 3., 4.];
+ let e: [f64; 4] = [1., 2., 3., 4.];
+ let mut r: [f64; 4] = [0f64; 4];
+ vst1_f64_x4(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_f64_x4() {
+ let a: [f64; 9] = [0., 1., 2., 3., 4., 5., 6., 7., 8.];
+ let e: [f64; 8] = [1., 2., 3., 4., 5., 6., 7., 8.];
+ let mut r: [f64; 8] = [0f64; 8];
+ vst1q_f64_x4(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2q_s64() {
+ let a: [i64; 5] = [0, 1, 2, 2, 3];
+ let e: [i64; 4] = [1, 2, 2, 3];
+ let mut r: [i64; 4] = [0i64; 4];
+ vst2q_s64(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2q_u64() {
+ let a: [u64; 5] = [0, 1, 2, 2, 3];
+ let e: [u64; 4] = [1, 2, 2, 3];
+ let mut r: [u64; 4] = [0u64; 4];
+ vst2q_u64(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2q_p64() {
+ let a: [u64; 5] = [0, 1, 2, 2, 3];
+ let e: [u64; 4] = [1, 2, 2, 3];
+ let mut r: [u64; 4] = [0u64; 4];
+ vst2q_p64(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2_f64() {
+ let a: [f64; 3] = [0., 1., 2.];
+ let e: [f64; 2] = [1., 2.];
+ let mut r: [f64; 2] = [0f64; 2];
+ vst2_f64(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2q_f64() {
+ let a: [f64; 5] = [0., 1., 2., 2., 3.];
+ let e: [f64; 4] = [1., 2., 2., 3.];
+ let mut r: [f64; 4] = [0f64; 4];
+ vst2q_f64(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2q_lane_s8() {
+ let a: [i8; 33] = [0, 1, 2, 2, 3, 2, 3, 4, 5, 2, 3, 4, 5, 6, 7, 8, 9, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17];
+ let e: [i8; 32] = [1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [i8; 32] = [0i8; 32];
+ vst2q_lane_s8::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2_lane_s64() {
+ let a: [i64; 3] = [0, 1, 2];
+ let e: [i64; 2] = [1, 2];
+ let mut r: [i64; 2] = [0i64; 2];
+ vst2_lane_s64::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2q_lane_s64() {
+ let a: [i64; 5] = [0, 1, 2, 2, 3];
+ let e: [i64; 4] = [1, 2, 0, 0];
+ let mut r: [i64; 4] = [0i64; 4];
+ vst2q_lane_s64::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2q_lane_u8() {
+ let a: [u8; 33] = [0, 1, 2, 2, 3, 2, 3, 4, 5, 2, 3, 4, 5, 6, 7, 8, 9, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17];
+ let e: [u8; 32] = [1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [u8; 32] = [0u8; 32];
+ vst2q_lane_u8::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2_lane_u64() {
+ let a: [u64; 3] = [0, 1, 2];
+ let e: [u64; 2] = [1, 2];
+ let mut r: [u64; 2] = [0u64; 2];
+ vst2_lane_u64::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2q_lane_u64() {
+ let a: [u64; 5] = [0, 1, 2, 2, 3];
+ let e: [u64; 4] = [1, 2, 0, 0];
+ let mut r: [u64; 4] = [0u64; 4];
+ vst2q_lane_u64::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2q_lane_p8() {
+ let a: [u8; 33] = [0, 1, 2, 2, 3, 2, 3, 4, 5, 2, 3, 4, 5, 6, 7, 8, 9, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17];
+ let e: [u8; 32] = [1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [u8; 32] = [0u8; 32];
+ vst2q_lane_p8::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2_lane_p64() {
+ let a: [u64; 3] = [0, 1, 2];
+ let e: [u64; 2] = [1, 2];
+ let mut r: [u64; 2] = [0u64; 2];
+ vst2_lane_p64::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2q_lane_p64() {
+ let a: [u64; 5] = [0, 1, 2, 2, 3];
+ let e: [u64; 4] = [1, 2, 0, 0];
+ let mut r: [u64; 4] = [0u64; 4];
+ vst2q_lane_p64::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2_lane_f64() {
+ let a: [f64; 3] = [0., 1., 2.];
+ let e: [f64; 2] = [1., 2.];
+ let mut r: [f64; 2] = [0f64; 2];
+ vst2_lane_f64::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2q_lane_f64() {
+ let a: [f64; 5] = [0., 1., 2., 2., 3.];
+ let e: [f64; 4] = [1., 2., 0., 0.];
+ let mut r: [f64; 4] = [0f64; 4];
+ vst2q_lane_f64::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3q_s64() {
+ let a: [i64; 7] = [0, 1, 2, 2, 4, 2, 4];
+ let e: [i64; 6] = [1, 2, 2, 2, 4, 4];
+ let mut r: [i64; 6] = [0i64; 6];
+ vst3q_s64(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3q_u64() {
+ let a: [u64; 7] = [0, 1, 2, 2, 4, 2, 4];
+ let e: [u64; 6] = [1, 2, 2, 2, 4, 4];
+ let mut r: [u64; 6] = [0u64; 6];
+ vst3q_u64(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3q_p64() {
+ let a: [u64; 7] = [0, 1, 2, 2, 4, 2, 4];
+ let e: [u64; 6] = [1, 2, 2, 2, 4, 4];
+ let mut r: [u64; 6] = [0u64; 6];
+ vst3q_p64(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3_f64() {
+ let a: [f64; 4] = [0., 1., 2., 2.];
+ let e: [f64; 3] = [1., 2., 2.];
+ let mut r: [f64; 3] = [0f64; 3];
+ vst3_f64(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3q_f64() {
+ let a: [f64; 7] = [0., 1., 2., 2., 4., 2., 4.];
+ let e: [f64; 6] = [1., 2., 2., 2., 4., 4.];
+ let mut r: [f64; 6] = [0f64; 6];
+ vst3q_f64(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3q_lane_s8() {
+ let a: [i8; 49] = [0, 1, 2, 2, 4, 2, 4, 7, 8, 2, 4, 7, 8, 13, 14, 15, 16, 2, 4, 7, 8, 13, 14, 15, 16, 25, 26, 27, 28, 29, 30, 31, 32, 2, 4, 7, 8, 13, 14, 15, 16, 41, 42, 43, 44, 45, 46, 47, 48];
+ let e: [i8; 48] = [1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [i8; 48] = [0i8; 48];
+ vst3q_lane_s8::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3_lane_s64() {
+ let a: [i64; 4] = [0, 1, 2, 2];
+ let e: [i64; 3] = [1, 2, 2];
+ let mut r: [i64; 3] = [0i64; 3];
+ vst3_lane_s64::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3q_lane_s64() {
+ let a: [i64; 7] = [0, 1, 2, 2, 4, 2, 4];
+ let e: [i64; 6] = [1, 2, 2, 0, 0, 0];
+ let mut r: [i64; 6] = [0i64; 6];
+ vst3q_lane_s64::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3q_lane_u8() {
+ let a: [u8; 49] = [0, 1, 2, 2, 4, 2, 4, 7, 8, 2, 4, 7, 8, 13, 14, 15, 16, 2, 4, 7, 8, 13, 14, 15, 16, 25, 26, 27, 28, 29, 30, 31, 32, 2, 4, 7, 8, 13, 14, 15, 16, 41, 42, 43, 44, 45, 46, 47, 48];
+ let e: [u8; 48] = [1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [u8; 48] = [0u8; 48];
+ vst3q_lane_u8::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3_lane_u64() {
+ let a: [u64; 4] = [0, 1, 2, 2];
+ let e: [u64; 3] = [1, 2, 2];
+ let mut r: [u64; 3] = [0u64; 3];
+ vst3_lane_u64::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3q_lane_u64() {
+ let a: [u64; 7] = [0, 1, 2, 2, 4, 2, 4];
+ let e: [u64; 6] = [1, 2, 2, 0, 0, 0];
+ let mut r: [u64; 6] = [0u64; 6];
+ vst3q_lane_u64::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3q_lane_p8() {
+ let a: [u8; 49] = [0, 1, 2, 2, 4, 2, 4, 7, 8, 2, 4, 7, 8, 13, 14, 15, 16, 2, 4, 7, 8, 13, 14, 15, 16, 25, 26, 27, 28, 29, 30, 31, 32, 2, 4, 7, 8, 13, 14, 15, 16, 41, 42, 43, 44, 45, 46, 47, 48];
+ let e: [u8; 48] = [1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [u8; 48] = [0u8; 48];
+ vst3q_lane_p8::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3_lane_p64() {
+ let a: [u64; 4] = [0, 1, 2, 2];
+ let e: [u64; 3] = [1, 2, 2];
+ let mut r: [u64; 3] = [0u64; 3];
+ vst3_lane_p64::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3q_lane_p64() {
+ let a: [u64; 7] = [0, 1, 2, 2, 4, 2, 4];
+ let e: [u64; 6] = [1, 2, 2, 0, 0, 0];
+ let mut r: [u64; 6] = [0u64; 6];
+ vst3q_lane_p64::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3_lane_f64() {
+ let a: [f64; 4] = [0., 1., 2., 2.];
+ let e: [f64; 3] = [1., 2., 2.];
+ let mut r: [f64; 3] = [0f64; 3];
+ vst3_lane_f64::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3q_lane_f64() {
+ let a: [f64; 7] = [0., 1., 2., 2., 3., 2., 3.];
+ let e: [f64; 6] = [1., 2., 2., 0., 0., 0.];
+ let mut r: [f64; 6] = [0f64; 6];
+ vst3q_lane_f64::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4q_s64() {
+ let a: [i64; 9] = [0, 1, 2, 2, 6, 2, 6, 6, 8];
+ let e: [i64; 8] = [1, 2, 2, 6, 2, 6, 6, 8];
+ let mut r: [i64; 8] = [0i64; 8];
+ vst4q_s64(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4q_u64() {
+ let a: [u64; 9] = [0, 1, 2, 2, 6, 2, 6, 6, 8];
+ let e: [u64; 8] = [1, 2, 2, 6, 2, 6, 6, 8];
+ let mut r: [u64; 8] = [0u64; 8];
+ vst4q_u64(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4q_p64() {
+ let a: [u64; 9] = [0, 1, 2, 2, 6, 2, 6, 6, 8];
+ let e: [u64; 8] = [1, 2, 2, 6, 2, 6, 6, 8];
+ let mut r: [u64; 8] = [0u64; 8];
+ vst4q_p64(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4_f64() {
+ let a: [f64; 5] = [0., 1., 2., 2., 6.];
+ let e: [f64; 4] = [1., 2., 2., 6.];
+ let mut r: [f64; 4] = [0f64; 4];
+ vst4_f64(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4q_f64() {
+ let a: [f64; 9] = [0., 1., 2., 2., 6., 2., 6., 6., 8.];
+ let e: [f64; 8] = [1., 2., 2., 6., 2., 6., 6., 8.];
+ let mut r: [f64; 8] = [0f64; 8];
+ vst4q_f64(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4q_lane_s8() {
+ let a: [i8; 65] = [0, 1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 8, 16, 8, 16, 16, 32, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 43, 44, 8, 16, 44, 48, 6, 8, 8, 16, 8, 16, 16, 32, 8, 16, 44, 48, 16, 32, 48, 64];
+ let e: [i8; 64] = [1, 2, 2, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [i8; 64] = [0i8; 64];
+ vst4q_lane_s8::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4_lane_s64() {
+ let a: [i64; 5] = [0, 1, 2, 2, 6];
+ let e: [i64; 4] = [1, 2, 2, 6];
+ let mut r: [i64; 4] = [0i64; 4];
+ vst4_lane_s64::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4q_lane_s64() {
+ let a: [i64; 9] = [0, 1, 2, 2, 6, 2, 6, 6, 8];
+ let e: [i64; 8] = [1, 2, 2, 6, 0, 0, 0, 0];
+ let mut r: [i64; 8] = [0i64; 8];
+ vst4q_lane_s64::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4q_lane_u8() {
+ let a: [u8; 65] = [0, 1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 8, 16, 8, 16, 16, 32, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 43, 44, 8, 16, 44, 48, 6, 8, 8, 16, 8, 16, 16, 32, 8, 16, 44, 48, 16, 32, 48, 64];
+ let e: [u8; 64] = [1, 2, 2, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [u8; 64] = [0u8; 64];
+ vst4q_lane_u8::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4_lane_u64() {
+ let a: [u64; 5] = [0, 1, 2, 2, 6];
+ let e: [u64; 4] = [1, 2, 2, 6];
+ let mut r: [u64; 4] = [0u64; 4];
+ vst4_lane_u64::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4q_lane_u64() {
+ let a: [u64; 9] = [0, 1, 2, 2, 6, 2, 6, 6, 8];
+ let e: [u64; 8] = [1, 2, 2, 6, 0, 0, 0, 0];
+ let mut r: [u64; 8] = [0u64; 8];
+ vst4q_lane_u64::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4q_lane_p8() {
+ let a: [u8; 65] = [0, 1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 8, 16, 8, 16, 16, 32, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 43, 44, 8, 16, 44, 48, 6, 8, 8, 16, 8, 16, 16, 32, 8, 16, 44, 48, 16, 32, 48, 64];
+ let e: [u8; 64] = [1, 2, 2, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [u8; 64] = [0u8; 64];
+ vst4q_lane_p8::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4_lane_p64() {
+ let a: [u64; 5] = [0, 1, 2, 2, 6];
+ let e: [u64; 4] = [1, 2, 2, 6];
+ let mut r: [u64; 4] = [0u64; 4];
+ vst4_lane_p64::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4q_lane_p64() {
+ let a: [u64; 9] = [0, 1, 2, 2, 6, 2, 6, 6, 8];
+ let e: [u64; 8] = [1, 2, 2, 6, 0, 0, 0, 0];
+ let mut r: [u64; 8] = [0u64; 8];
+ vst4q_lane_p64::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4_lane_f64() {
+ let a: [f64; 5] = [0., 1., 2., 2., 6.];
+ let e: [f64; 4] = [1., 2., 2., 6.];
+ let mut r: [f64; 4] = [0f64; 4];
+ vst4_lane_f64::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4q_lane_f64() {
+ let a: [f64; 9] = [0., 1., 2., 2., 6., 2., 6., 6., 8.];
+ let e: [f64; 8] = [1., 2., 2., 6., 0., 0., 0., 0.];
+ let mut r: [f64; 8] = [0f64; 8];
+ vst4q_lane_f64::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmul_f64() {
+ let a: f64 = 1.0;
+ let b: f64 = 2.0;
+ let e: f64 = 2.0;
+ let r: f64 = transmute(vmul_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulq_f64() {
+ let a: f64x2 = f64x2::new(1.0, 2.0);
+ let b: f64x2 = f64x2::new(2.0, 3.0);
+ let e: f64x2 = f64x2::new(2.0, 6.0);
+ let r: f64x2 = transmute(vmulq_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmul_n_f64() {
+ let a: f64 = 1.;
+ let b: f64 = 2.;
+ let e: f64 = 2.;
+ let r: f64 = transmute(vmul_n_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulq_n_f64() {
+ let a: f64x2 = f64x2::new(1., 2.);
+ let b: f64 = 2.;
+ let e: f64x2 = f64x2::new(2., 4.);
+ let r: f64x2 = transmute(vmulq_n_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmul_lane_f64() {
+ let a: f64 = 1.;
+ let b: f64 = 2.;
+ let e: f64 = 2.;
+ let r: f64 = transmute(vmul_lane_f64::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmul_laneq_f64() {
+ let a: f64 = 1.;
+ let b: f64x2 = f64x2::new(2., 0.);
+ let e: f64 = 2.;
+ let r: f64 = transmute(vmul_laneq_f64::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulq_lane_f64() {
+ let a: f64x2 = f64x2::new(1., 2.);
+ let b: f64 = 2.;
+ let e: f64x2 = f64x2::new(2., 4.);
+ let r: f64x2 = transmute(vmulq_lane_f64::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulq_laneq_f64() {
+ let a: f64x2 = f64x2::new(1., 2.);
+ let b: f64x2 = f64x2::new(2., 0.);
+ let e: f64x2 = f64x2::new(2., 4.);
+ let r: f64x2 = transmute(vmulq_laneq_f64::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmuls_lane_f32() {
+ let a: f32 = 1.;
+ let b: f32x2 = f32x2::new(2., 0.);
+ let e: f32 = 2.;
+ let r: f32 = transmute(vmuls_lane_f32::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmuls_laneq_f32() {
+ let a: f32 = 1.;
+ let b: f32x4 = f32x4::new(2., 0., 0., 0.);
+ let e: f32 = 2.;
+ let r: f32 = transmute(vmuls_laneq_f32::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmuld_lane_f64() {
+ let a: f64 = 1.;
+ let b: f64 = 2.;
+ let e: f64 = 2.;
+ let r: f64 = transmute(vmuld_lane_f64::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmuld_laneq_f64() {
+ let a: f64 = 1.;
+ let b: f64x2 = f64x2::new(2., 0.);
+ let e: f64 = 2.;
+ let r: f64 = transmute(vmuld_laneq_f64::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmull_high_s8() {
+ let a: i8x16 = i8x16::new(1, 2, 9, 10, 9, 10, 11, 12, 9, 10, 11, 12, 13, 14, 15, 16);
+ let b: i8x16 = i8x16::new(1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2);
+ let e: i16x8 = i16x8::new(9, 20, 11, 24, 13, 28, 15, 32);
+ let r: i16x8 = transmute(vmull_high_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmull_high_s16() {
+ let a: i16x8 = i16x8::new(1, 2, 9, 10, 9, 10, 11, 12);
+ let b: i16x8 = i16x8::new(1, 2, 1, 2, 1, 2, 1, 2);
+ let e: i32x4 = i32x4::new(9, 20, 11, 24);
+ let r: i32x4 = transmute(vmull_high_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmull_high_s32() {
+ let a: i32x4 = i32x4::new(1, 2, 9, 10);
+ let b: i32x4 = i32x4::new(1, 2, 1, 2);
+ let e: i64x2 = i64x2::new(9, 20);
+ let r: i64x2 = transmute(vmull_high_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmull_high_u8() {
+ let a: u8x16 = u8x16::new(1, 2, 9, 10, 9, 10, 11, 12, 9, 10, 11, 12, 13, 14, 15, 16);
+ let b: u8x16 = u8x16::new(1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2);
+ let e: u16x8 = u16x8::new(9, 20, 11, 24, 13, 28, 15, 32);
+ let r: u16x8 = transmute(vmull_high_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmull_high_u16() {
+ let a: u16x8 = u16x8::new(1, 2, 9, 10, 9, 10, 11, 12);
+ let b: u16x8 = u16x8::new(1, 2, 1, 2, 1, 2, 1, 2);
+ let e: u32x4 = u32x4::new(9, 20, 11, 24);
+ let r: u32x4 = transmute(vmull_high_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmull_high_u32() {
+ let a: u32x4 = u32x4::new(1, 2, 9, 10);
+ let b: u32x4 = u32x4::new(1, 2, 1, 2);
+ let e: u64x2 = u64x2::new(9, 20);
+ let r: u64x2 = transmute(vmull_high_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmull_p64() {
+ let a: p64 = 15;
+ let b: p64 = 3;
+ let e: p128 = 17;
+ let r: p128 = transmute(vmull_p64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmull_high_p8() {
+ let a: i8x16 = i8x16::new(1, 2, 9, 10, 9, 10, 11, 12, 9, 10, 11, 12, 13, 14, 15, 16);
+ let b: i8x16 = i8x16::new(1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3);
+ let e: i16x8 = i16x8::new(9, 30, 11, 20, 13, 18, 15, 48);
+ let r: i16x8 = transmute(vmull_high_p8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmull_high_p64() {
+ let a: i64x2 = i64x2::new(1, 15);
+ let b: i64x2 = i64x2::new(1, 3);
+ let e: p128 = 17;
+ let r: p128 = transmute(vmull_high_p64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmull_high_n_s16() {
+ let a: i16x8 = i16x8::new(1, 2, 9, 10, 9, 10, 11, 12);
+ let b: i16 = 2;
+ let e: i32x4 = i32x4::new(18, 20, 22, 24);
+ let r: i32x4 = transmute(vmull_high_n_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmull_high_n_s32() {
+ let a: i32x4 = i32x4::new(1, 2, 9, 10);
+ let b: i32 = 2;
+ let e: i64x2 = i64x2::new(18, 20);
+ let r: i64x2 = transmute(vmull_high_n_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmull_high_n_u16() {
+ let a: u16x8 = u16x8::new(1, 2, 9, 10, 9, 10, 11, 12);
+ let b: u16 = 2;
+ let e: u32x4 = u32x4::new(18, 20, 22, 24);
+ let r: u32x4 = transmute(vmull_high_n_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmull_high_n_u32() {
+ let a: u32x4 = u32x4::new(1, 2, 9, 10);
+ let b: u32 = 2;
+ let e: u64x2 = u64x2::new(18, 20);
+ let r: u64x2 = transmute(vmull_high_n_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmull_high_lane_s16() {
+ let a: i16x8 = i16x8::new(1, 2, 9, 10, 9, 10, 11, 12);
+ let b: i16x4 = i16x4::new(0, 2, 0, 0);
+ let e: i32x4 = i32x4::new(18, 20, 22, 24);
+ let r: i32x4 = transmute(vmull_high_lane_s16::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmull_high_laneq_s16() {
+ let a: i16x8 = i16x8::new(1, 2, 9, 10, 9, 10, 11, 12);
+ let b: i16x8 = i16x8::new(0, 2, 0, 0, 0, 0, 0, 0);
+ let e: i32x4 = i32x4::new(18, 20, 22, 24);
+ let r: i32x4 = transmute(vmull_high_laneq_s16::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmull_high_lane_s32() {
+ let a: i32x4 = i32x4::new(1, 2, 9, 10);
+ let b: i32x2 = i32x2::new(0, 2);
+ let e: i64x2 = i64x2::new(18, 20);
+ let r: i64x2 = transmute(vmull_high_lane_s32::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmull_high_laneq_s32() {
+ let a: i32x4 = i32x4::new(1, 2, 9, 10);
+ let b: i32x4 = i32x4::new(0, 2, 0, 0);
+ let e: i64x2 = i64x2::new(18, 20);
+ let r: i64x2 = transmute(vmull_high_laneq_s32::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmull_high_lane_u16() {
+ let a: u16x8 = u16x8::new(1, 2, 9, 10, 9, 10, 11, 12);
+ let b: u16x4 = u16x4::new(0, 2, 0, 0);
+ let e: u32x4 = u32x4::new(18, 20, 22, 24);
+ let r: u32x4 = transmute(vmull_high_lane_u16::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmull_high_laneq_u16() {
+ let a: u16x8 = u16x8::new(1, 2, 9, 10, 9, 10, 11, 12);
+ let b: u16x8 = u16x8::new(0, 2, 0, 0, 0, 0, 0, 0);
+ let e: u32x4 = u32x4::new(18, 20, 22, 24);
+ let r: u32x4 = transmute(vmull_high_laneq_u16::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmull_high_lane_u32() {
+ let a: u32x4 = u32x4::new(1, 2, 9, 10);
+ let b: u32x2 = u32x2::new(0, 2);
+ let e: u64x2 = u64x2::new(18, 20);
+ let r: u64x2 = transmute(vmull_high_lane_u32::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmull_high_laneq_u32() {
+ let a: u32x4 = u32x4::new(1, 2, 9, 10);
+ let b: u32x4 = u32x4::new(0, 2, 0, 0);
+ let e: u64x2 = u64x2::new(18, 20);
+ let r: u64x2 = transmute(vmull_high_laneq_u32::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulx_f32() {
+ let a: f32x2 = f32x2::new(1., 2.);
+ let b: f32x2 = f32x2::new(2., 2.);
+ let e: f32x2 = f32x2::new(2., 4.);
+ let r: f32x2 = transmute(vmulx_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulxq_f32() {
+ let a: f32x4 = f32x4::new(1., 2., 3., 4.);
+ let b: f32x4 = f32x4::new(2., 2., 2., 2.);
+ let e: f32x4 = f32x4::new(2., 4., 6., 8.);
+ let r: f32x4 = transmute(vmulxq_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulx_f64() {
+ let a: f64 = 1.;
+ let b: f64 = 2.;
+ let e: f64 = 2.;
+ let r: f64 = transmute(vmulx_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulxq_f64() {
+ let a: f64x2 = f64x2::new(1., 2.);
+ let b: f64x2 = f64x2::new(2., 2.);
+ let e: f64x2 = f64x2::new(2., 4.);
+ let r: f64x2 = transmute(vmulxq_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulx_lane_f64() {
+ let a: f64 = 1.;
+ let b: f64 = 2.;
+ let e: f64 = 2.;
+ let r: f64 = transmute(vmulx_lane_f64::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulx_laneq_f64() {
+ let a: f64 = 1.;
+ let b: f64x2 = f64x2::new(2., 0.);
+ let e: f64 = 2.;
+ let r: f64 = transmute(vmulx_laneq_f64::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulx_lane_f32() {
+ let a: f32x2 = f32x2::new(1., 2.);
+ let b: f32x2 = f32x2::new(2., 0.);
+ let e: f32x2 = f32x2::new(2., 4.);
+ let r: f32x2 = transmute(vmulx_lane_f32::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulx_laneq_f32() {
+ let a: f32x2 = f32x2::new(1., 2.);
+ let b: f32x4 = f32x4::new(2., 0., 0., 0.);
+ let e: f32x2 = f32x2::new(2., 4.);
+ let r: f32x2 = transmute(vmulx_laneq_f32::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulxq_lane_f32() {
+ let a: f32x4 = f32x4::new(1., 2., 3., 4.);
+ let b: f32x2 = f32x2::new(2., 0.);
+ let e: f32x4 = f32x4::new(2., 4., 6., 8.);
+ let r: f32x4 = transmute(vmulxq_lane_f32::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulxq_laneq_f32() {
+ let a: f32x4 = f32x4::new(1., 2., 3., 4.);
+ let b: f32x4 = f32x4::new(2., 0., 0., 0.);
+ let e: f32x4 = f32x4::new(2., 4., 6., 8.);
+ let r: f32x4 = transmute(vmulxq_laneq_f32::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulxq_lane_f64() {
+ let a: f64x2 = f64x2::new(1., 2.);
+ let b: f64 = 2.;
+ let e: f64x2 = f64x2::new(2., 4.);
+ let r: f64x2 = transmute(vmulxq_lane_f64::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulxq_laneq_f64() {
+ let a: f64x2 = f64x2::new(1., 2.);
+ let b: f64x2 = f64x2::new(2., 0.);
+ let e: f64x2 = f64x2::new(2., 4.);
+ let r: f64x2 = transmute(vmulxq_laneq_f64::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulxs_f32() {
+ let a: f32 = 2.;
+ let b: f32 = 3.;
+ let e: f32 = 6.;
+ let r: f32 = transmute(vmulxs_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulxd_f64() {
+ let a: f64 = 2.;
+ let b: f64 = 3.;
+ let e: f64 = 6.;
+ let r: f64 = transmute(vmulxd_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulxs_lane_f32() {
+ let a: f32 = 2.;
+ let b: f32x2 = f32x2::new(3., 0.);
+ let e: f32 = 6.;
+ let r: f32 = transmute(vmulxs_lane_f32::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulxs_laneq_f32() {
+ let a: f32 = 2.;
+ let b: f32x4 = f32x4::new(3., 0., 0., 0.);
+ let e: f32 = 6.;
+ let r: f32 = transmute(vmulxs_laneq_f32::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulxd_lane_f64() {
+ let a: f64 = 2.;
+ let b: f64 = 3.;
+ let e: f64 = 6.;
+ let r: f64 = transmute(vmulxd_lane_f64::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulxd_laneq_f64() {
+ let a: f64 = 2.;
+ let b: f64x2 = f64x2::new(3., 0.);
+ let e: f64 = 6.;
+ let r: f64 = transmute(vmulxd_laneq_f64::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vfma_f64() {
+ let a: f64 = 8.0;
+ let b: f64 = 6.0;
+ let c: f64 = 2.0;
+ let e: f64 = 20.0;
+ let r: f64 = transmute(vfma_f64(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vfmaq_f64() {
+ let a: f64x2 = f64x2::new(8.0, 18.0);
+ let b: f64x2 = f64x2::new(6.0, 4.0);
+ let c: f64x2 = f64x2::new(2.0, 3.0);
+ let e: f64x2 = f64x2::new(20.0, 30.0);
+ let r: f64x2 = transmute(vfmaq_f64(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vfma_n_f64() {
+ let a: f64 = 2.0;
+ let b: f64 = 6.0;
+ let c: f64 = 8.0;
+ let e: f64 = 50.0;
+ let r: f64 = transmute(vfma_n_f64(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vfmaq_n_f64() {
+ let a: f64x2 = f64x2::new(2.0, 3.0);
+ let b: f64x2 = f64x2::new(6.0, 4.0);
+ let c: f64 = 8.0;
+ let e: f64x2 = f64x2::new(50.0, 35.0);
+ let r: f64x2 = transmute(vfmaq_n_f64(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vfma_lane_f32() {
+ let a: f32x2 = f32x2::new(2., 3.);
+ let b: f32x2 = f32x2::new(6., 4.);
+ let c: f32x2 = f32x2::new(2., 0.);
+ let e: f32x2 = f32x2::new(14., 11.);
+ let r: f32x2 = transmute(vfma_lane_f32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vfma_laneq_f32() {
+ let a: f32x2 = f32x2::new(2., 3.);
+ let b: f32x2 = f32x2::new(6., 4.);
+ let c: f32x4 = f32x4::new(2., 0., 0., 0.);
+ let e: f32x2 = f32x2::new(14., 11.);
+ let r: f32x2 = transmute(vfma_laneq_f32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vfmaq_lane_f32() {
+ let a: f32x4 = f32x4::new(2., 3., 4., 5.);
+ let b: f32x4 = f32x4::new(6., 4., 7., 8.);
+ let c: f32x2 = f32x2::new(2., 0.);
+ let e: f32x4 = f32x4::new(14., 11., 18., 21.);
+ let r: f32x4 = transmute(vfmaq_lane_f32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vfmaq_laneq_f32() {
+ let a: f32x4 = f32x4::new(2., 3., 4., 5.);
+ let b: f32x4 = f32x4::new(6., 4., 7., 8.);
+ let c: f32x4 = f32x4::new(2., 0., 0., 0.);
+ let e: f32x4 = f32x4::new(14., 11., 18., 21.);
+ let r: f32x4 = transmute(vfmaq_laneq_f32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vfma_lane_f64() {
+ let a: f64 = 2.;
+ let b: f64 = 6.;
+ let c: f64 = 2.;
+ let e: f64 = 14.;
+ let r: f64 = transmute(vfma_lane_f64::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vfma_laneq_f64() {
+ let a: f64 = 2.;
+ let b: f64 = 6.;
+ let c: f64x2 = f64x2::new(2., 0.);
+ let e: f64 = 14.;
+ let r: f64 = transmute(vfma_laneq_f64::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vfmaq_lane_f64() {
+ let a: f64x2 = f64x2::new(2., 3.);
+ let b: f64x2 = f64x2::new(6., 4.);
+ let c: f64 = 2.;
+ let e: f64x2 = f64x2::new(14., 11.);
+ let r: f64x2 = transmute(vfmaq_lane_f64::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vfmaq_laneq_f64() {
+ let a: f64x2 = f64x2::new(2., 3.);
+ let b: f64x2 = f64x2::new(6., 4.);
+ let c: f64x2 = f64x2::new(2., 0.);
+ let e: f64x2 = f64x2::new(14., 11.);
+ let r: f64x2 = transmute(vfmaq_laneq_f64::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vfmas_lane_f32() {
+ let a: f32 = 2.;
+ let b: f32 = 6.;
+ let c: f32x2 = f32x2::new(3., 0.);
+ let e: f32 = 20.;
+ let r: f32 = transmute(vfmas_lane_f32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vfmas_laneq_f32() {
+ let a: f32 = 2.;
+ let b: f32 = 6.;
+ let c: f32x4 = f32x4::new(3., 0., 0., 0.);
+ let e: f32 = 20.;
+ let r: f32 = transmute(vfmas_laneq_f32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vfmad_lane_f64() {
+ let a: f64 = 2.;
+ let b: f64 = 6.;
+ let c: f64 = 3.;
+ let e: f64 = 20.;
+ let r: f64 = transmute(vfmad_lane_f64::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vfmad_laneq_f64() {
+ let a: f64 = 2.;
+ let b: f64 = 6.;
+ let c: f64x2 = f64x2::new(3., 0.);
+ let e: f64 = 20.;
+ let r: f64 = transmute(vfmad_laneq_f64::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vfms_f64() {
+ let a: f64 = 20.0;
+ let b: f64 = 6.0;
+ let c: f64 = 2.0;
+ let e: f64 = 8.0;
+ let r: f64 = transmute(vfms_f64(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vfmsq_f64() {
+ let a: f64x2 = f64x2::new(20.0, 30.0);
+ let b: f64x2 = f64x2::new(6.0, 4.0);
+ let c: f64x2 = f64x2::new(2.0, 3.0);
+ let e: f64x2 = f64x2::new(8.0, 18.0);
+ let r: f64x2 = transmute(vfmsq_f64(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vfms_n_f64() {
+ let a: f64 = 50.0;
+ let b: f64 = 6.0;
+ let c: f64 = 8.0;
+ let e: f64 = 2.0;
+ let r: f64 = transmute(vfms_n_f64(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vfmsq_n_f64() {
+ let a: f64x2 = f64x2::new(50.0, 35.0);
+ let b: f64x2 = f64x2::new(6.0, 4.0);
+ let c: f64 = 8.0;
+ let e: f64x2 = f64x2::new(2.0, 3.0);
+ let r: f64x2 = transmute(vfmsq_n_f64(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vfms_lane_f32() {
+ let a: f32x2 = f32x2::new(14., 11.);
+ let b: f32x2 = f32x2::new(6., 4.);
+ let c: f32x2 = f32x2::new(2., 0.);
+ let e: f32x2 = f32x2::new(2., 3.);
+ let r: f32x2 = transmute(vfms_lane_f32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vfms_laneq_f32() {
+ let a: f32x2 = f32x2::new(14., 11.);
+ let b: f32x2 = f32x2::new(6., 4.);
+ let c: f32x4 = f32x4::new(2., 0., 0., 0.);
+ let e: f32x2 = f32x2::new(2., 3.);
+ let r: f32x2 = transmute(vfms_laneq_f32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vfmsq_lane_f32() {
+ let a: f32x4 = f32x4::new(14., 11., 18., 21.);
+ let b: f32x4 = f32x4::new(6., 4., 7., 8.);
+ let c: f32x2 = f32x2::new(2., 0.);
+ let e: f32x4 = f32x4::new(2., 3., 4., 5.);
+ let r: f32x4 = transmute(vfmsq_lane_f32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vfmsq_laneq_f32() {
+ let a: f32x4 = f32x4::new(14., 11., 18., 21.);
+ let b: f32x4 = f32x4::new(6., 4., 7., 8.);
+ let c: f32x4 = f32x4::new(2., 0., 0., 0.);
+ let e: f32x4 = f32x4::new(2., 3., 4., 5.);
+ let r: f32x4 = transmute(vfmsq_laneq_f32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vfms_lane_f64() {
+ let a: f64 = 14.;
+ let b: f64 = 6.;
+ let c: f64 = 2.;
+ let e: f64 = 2.;
+ let r: f64 = transmute(vfms_lane_f64::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vfms_laneq_f64() {
+ let a: f64 = 14.;
+ let b: f64 = 6.;
+ let c: f64x2 = f64x2::new(2., 0.);
+ let e: f64 = 2.;
+ let r: f64 = transmute(vfms_laneq_f64::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vfmsq_lane_f64() {
+ let a: f64x2 = f64x2::new(14., 11.);
+ let b: f64x2 = f64x2::new(6., 4.);
+ let c: f64 = 2.;
+ let e: f64x2 = f64x2::new(2., 3.);
+ let r: f64x2 = transmute(vfmsq_lane_f64::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vfmsq_laneq_f64() {
+ let a: f64x2 = f64x2::new(14., 11.);
+ let b: f64x2 = f64x2::new(6., 4.);
+ let c: f64x2 = f64x2::new(2., 0.);
+ let e: f64x2 = f64x2::new(2., 3.);
+ let r: f64x2 = transmute(vfmsq_laneq_f64::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vfmss_lane_f32() {
+ let a: f32 = 14.;
+ let b: f32 = 6.;
+ let c: f32x2 = f32x2::new(2., 0.);
+ let e: f32 = 2.;
+ let r: f32 = transmute(vfmss_lane_f32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vfmss_laneq_f32() {
+ let a: f32 = 14.;
+ let b: f32 = 6.;
+ let c: f32x4 = f32x4::new(2., 0., 0., 0.);
+ let e: f32 = 2.;
+ let r: f32 = transmute(vfmss_laneq_f32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vfmsd_lane_f64() {
+ let a: f64 = 14.;
+ let b: f64 = 6.;
+ let c: f64 = 2.;
+ let e: f64 = 2.;
+ let r: f64 = transmute(vfmsd_lane_f64::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vfmsd_laneq_f64() {
+ let a: f64 = 14.;
+ let b: f64 = 6.;
+ let c: f64x2 = f64x2::new(2., 0.);
+ let e: f64 = 2.;
+ let r: f64 = transmute(vfmsd_laneq_f64::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdiv_f32() {
+ let a: f32x2 = f32x2::new(2.0, 6.0);
+ let b: f32x2 = f32x2::new(1.0, 2.0);
+ let e: f32x2 = f32x2::new(2.0, 3.0);
+ let r: f32x2 = transmute(vdiv_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdivq_f32() {
+ let a: f32x4 = f32x4::new(2.0, 6.0, 4.0, 10.0);
+ let b: f32x4 = f32x4::new(1.0, 2.0, 1.0, 2.0);
+ let e: f32x4 = f32x4::new(2.0, 3.0, 4.0, 5.0);
+ let r: f32x4 = transmute(vdivq_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdiv_f64() {
+ let a: f64 = 2.0;
+ let b: f64 = 1.0;
+ let e: f64 = 2.0;
+ let r: f64 = transmute(vdiv_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdivq_f64() {
+ let a: f64x2 = f64x2::new(2.0, 6.0);
+ let b: f64x2 = f64x2::new(1.0, 2.0);
+ let e: f64x2 = f64x2::new(2.0, 3.0);
+ let r: f64x2 = transmute(vdivq_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsub_f64() {
+ let a: f64 = 1.0;
+ let b: f64 = 1.0;
+ let e: f64 = 0.0;
+ let r: f64 = transmute(vsub_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubq_f64() {
+ let a: f64x2 = f64x2::new(1.0, 4.0);
+ let b: f64x2 = f64x2::new(1.0, 2.0);
+ let e: f64x2 = f64x2::new(0.0, 2.0);
+ let r: f64x2 = transmute(vsubq_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubd_s64() {
+ let a: i64 = 3;
+ let b: i64 = 2;
+ let e: i64 = 1;
+ let r: i64 = transmute(vsubd_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubd_u64() {
+ let a: u64 = 3;
+ let b: u64 = 2;
+ let e: u64 = 1;
+ let r: u64 = transmute(vsubd_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddd_s64() {
+ let a: i64 = 1;
+ let b: i64 = 2;
+ let e: i64 = 3;
+ let r: i64 = transmute(vaddd_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddd_u64() {
+ let a: u64 = 1;
+ let b: u64 = 2;
+ let e: u64 = 3;
+ let r: u64 = transmute(vaddd_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddv_f32() {
+ let a: f32x2 = f32x2::new(1., 2.);
+ let e: f32 = 3.;
+ let r: f32 = transmute(vaddv_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddvq_f32() {
+ let a: f32x4 = f32x4::new(1., 2., 0., 0.);
+ let e: f32 = 3.;
+ let r: f32 = transmute(vaddvq_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddvq_f64() {
+ let a: f64x2 = f64x2::new(1., 2.);
+ let e: f64 = 3.;
+ let r: f64 = transmute(vaddvq_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddlv_s16() {
+ let a: i16x4 = i16x4::new(1, 2, 3, 4);
+ let e: i32 = 10;
+ let r: i32 = transmute(vaddlv_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddlvq_s16() {
+ let a: i16x8 = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: i32 = 36;
+ let r: i32 = transmute(vaddlvq_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddlv_s32() {
+ let a: i32x2 = i32x2::new(1, 2);
+ let e: i64 = 3;
+ let r: i64 = transmute(vaddlv_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddlvq_s32() {
+ let a: i32x4 = i32x4::new(1, 2, 3, 4);
+ let e: i64 = 10;
+ let r: i64 = transmute(vaddlvq_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddlv_u16() {
+ let a: u16x4 = u16x4::new(1, 2, 3, 4);
+ let e: u32 = 10;
+ let r: u32 = transmute(vaddlv_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddlvq_u16() {
+ let a: u16x8 = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: u32 = 36;
+ let r: u32 = transmute(vaddlvq_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddlv_u32() {
+ let a: u32x2 = u32x2::new(1, 2);
+ let e: u64 = 3;
+ let r: u64 = transmute(vaddlv_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddlvq_u32() {
+ let a: u32x4 = u32x4::new(1, 2, 3, 4);
+ let e: u64 = 10;
+ let r: u64 = transmute(vaddlvq_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubw_high_s8() {
+ let a: i16x8 = i16x8::new(8, 9, 10, 12, 13, 14, 15, 16);
+ let b: i8x16 = i8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16);
+ let e: i16x8 = i16x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let r: i16x8 = transmute(vsubw_high_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubw_high_s16() {
+ let a: i32x4 = i32x4::new(8, 9, 10, 11);
+ let b: i16x8 = i16x8::new(0, 1, 2, 3, 8, 9, 10, 11);
+ let e: i32x4 = i32x4::new(0, 0, 0, 0);
+ let r: i32x4 = transmute(vsubw_high_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubw_high_s32() {
+ let a: i64x2 = i64x2::new(8, 9);
+ let b: i32x4 = i32x4::new(6, 7, 8, 9);
+ let e: i64x2 = i64x2::new(0, 0);
+ let r: i64x2 = transmute(vsubw_high_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubw_high_u8() {
+ let a: u16x8 = u16x8::new(8, 9, 10, 11, 12, 13, 14, 15);
+ let b: u8x16 = u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let e: u16x8 = u16x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let r: u16x8 = transmute(vsubw_high_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubw_high_u16() {
+ let a: u32x4 = u32x4::new(8, 9, 10, 11);
+ let b: u16x8 = u16x8::new(0, 1, 2, 3, 8, 9, 10, 11);
+ let e: u32x4 = u32x4::new(0, 0, 0, 0);
+ let r: u32x4 = transmute(vsubw_high_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubw_high_u32() {
+ let a: u64x2 = u64x2::new(8, 9);
+ let b: u32x4 = u32x4::new(6, 7, 8, 9);
+ let e: u64x2 = u64x2::new(0, 0);
+ let r: u64x2 = transmute(vsubw_high_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubl_high_s8() {
+ let a: i8x16 = i8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let b: i8x16 = i8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2);
+ let e: i16x8 = i16x8::new(6, 7, 8, 9, 10, 11, 12, 13);
+ let r: i16x8 = transmute(vsubl_high_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubl_high_s16() {
+ let a: i16x8 = i16x8::new(8, 9, 10, 11, 12, 13, 14, 15);
+ let b: i16x8 = i16x8::new(6, 6, 6, 6, 8, 8, 8, 8);
+ let e: i32x4 = i32x4::new(4, 5, 6, 7);
+ let r: i32x4 = transmute(vsubl_high_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubl_high_s32() {
+ let a: i32x4 = i32x4::new(12, 13, 14, 15);
+ let b: i32x4 = i32x4::new(6, 6, 8, 8);
+ let e: i64x2 = i64x2::new(6, 7);
+ let r: i64x2 = transmute(vsubl_high_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubl_high_u8() {
+ let a: u8x16 = u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let b: u8x16 = u8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2);
+ let e: u16x8 = u16x8::new(6, 7, 8, 9, 10, 11, 12, 13);
+ let r: u16x8 = transmute(vsubl_high_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubl_high_u16() {
+ let a: u16x8 = u16x8::new(8, 9, 10, 11, 12, 13, 14, 15);
+ let b: u16x8 = u16x8::new(6, 6, 6, 6, 8, 8, 8, 8);
+ let e: u32x4 = u32x4::new(4, 5, 6, 7);
+ let r: u32x4 = transmute(vsubl_high_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubl_high_u32() {
+ let a: u32x4 = u32x4::new(12, 13, 14, 15);
+ let b: u32x4 = u32x4::new(6, 6, 8, 8);
+ let e: u64x2 = u64x2::new(6, 7);
+ let r: u64x2 = transmute(vsubl_high_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon,sha3")]
+ unsafe fn test_vbcaxq_s8() {
+ let a: i8x16 = i8x16::new(1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0);
+ let b: i8x16 = i8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let c: i8x16 = i8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
+ let e: i8x16 = i8x16::new(1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14);
+ let r: i8x16 = transmute(vbcaxq_s8(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon,sha3")]
+ unsafe fn test_vbcaxq_s16() {
+ let a: i16x8 = i16x8::new(1, 0, 1, 0, 1, 0, 1, 0);
+ let b: i16x8 = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let c: i16x8 = i16x8::new(1, 1, 1, 1, 1, 1, 1, 1);
+ let e: i16x8 = i16x8::new(1, 0, 3, 2, 5, 4, 7, 6);
+ let r: i16x8 = transmute(vbcaxq_s16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon,sha3")]
+ unsafe fn test_vbcaxq_s32() {
+ let a: i32x4 = i32x4::new(1, 0, 1, 0);
+ let b: i32x4 = i32x4::new(0, 1, 2, 3);
+ let c: i32x4 = i32x4::new(1, 1, 1, 1);
+ let e: i32x4 = i32x4::new(1, 0, 3, 2);
+ let r: i32x4 = transmute(vbcaxq_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon,sha3")]
+ unsafe fn test_vbcaxq_s64() {
+ let a: i64x2 = i64x2::new(1, 0);
+ let b: i64x2 = i64x2::new(0, 1);
+ let c: i64x2 = i64x2::new(1, 1);
+ let e: i64x2 = i64x2::new(1, 0);
+ let r: i64x2 = transmute(vbcaxq_s64(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon,sha3")]
+ unsafe fn test_vbcaxq_u8() {
+ let a: u8x16 = u8x16::new(1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0);
+ let b: u8x16 = u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let c: u8x16 = u8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
+ let e: u8x16 = u8x16::new(1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14);
+ let r: u8x16 = transmute(vbcaxq_u8(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon,sha3")]
+ unsafe fn test_vbcaxq_u16() {
+ let a: u16x8 = u16x8::new(1, 0, 1, 0, 1, 0, 1, 0);
+ let b: u16x8 = u16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let c: u16x8 = u16x8::new(1, 1, 1, 1, 1, 1, 1, 1);
+ let e: u16x8 = u16x8::new(1, 0, 3, 2, 5, 4, 7, 6);
+ let r: u16x8 = transmute(vbcaxq_u16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon,sha3")]
+ unsafe fn test_vbcaxq_u32() {
+ let a: u32x4 = u32x4::new(1, 0, 1, 0);
+ let b: u32x4 = u32x4::new(0, 1, 2, 3);
+ let c: u32x4 = u32x4::new(1, 1, 1, 1);
+ let e: u32x4 = u32x4::new(1, 0, 3, 2);
+ let r: u32x4 = transmute(vbcaxq_u32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon,sha3")]
+ unsafe fn test_vbcaxq_u64() {
+ let a: u64x2 = u64x2::new(1, 0);
+ let b: u64x2 = u64x2::new(0, 1);
+ let c: u64x2 = u64x2::new(1, 1);
+ let e: u64x2 = u64x2::new(1, 0);
+ let r: u64x2 = transmute(vbcaxq_u64(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcadd_rot270_f32() {
+ let a: f32x2 = f32x2::new(1., -1.);
+ let b: f32x2 = f32x2::new(-1., 1.);
+ let e: f32x2 = f32x2::new(2., 0.);
+ let r: f32x2 = transmute(vcadd_rot270_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcaddq_rot270_f32() {
+ let a: f32x4 = f32x4::new(1., -1., 1., -1.);
+ let b: f32x4 = f32x4::new(-1., 1., -1., 1.);
+ let e: f32x4 = f32x4::new(2., 0., 2., 0.);
+ let r: f32x4 = transmute(vcaddq_rot270_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcaddq_rot270_f64() {
+ let a: f64x2 = f64x2::new(1., -1.);
+ let b: f64x2 = f64x2::new(-1., 1.);
+ let e: f64x2 = f64x2::new(2., 0.);
+ let r: f64x2 = transmute(vcaddq_rot270_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcadd_rot90_f32() {
+ let a: f32x2 = f32x2::new(1., -1.);
+ let b: f32x2 = f32x2::new(-1., 1.);
+ let e: f32x2 = f32x2::new(0., -2.);
+ let r: f32x2 = transmute(vcadd_rot90_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcaddq_rot90_f32() {
+ let a: f32x4 = f32x4::new(1., -1., 1., -1.);
+ let b: f32x4 = f32x4::new(-1., 1., -1., 1.);
+ let e: f32x4 = f32x4::new(0., -2., 0., -2.);
+ let r: f32x4 = transmute(vcaddq_rot90_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcaddq_rot90_f64() {
+ let a: f64x2 = f64x2::new(1., -1.);
+ let b: f64x2 = f64x2::new(-1., 1.);
+ let e: f64x2 = f64x2::new(0., -2.);
+ let r: f64x2 = transmute(vcaddq_rot90_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcmla_f32() {
+ let a: f32x2 = f32x2::new(1., -1.);
+ let b: f32x2 = f32x2::new(-1., 1.);
+ let c: f32x2 = f32x2::new(1., 1.);
+ let e: f32x2 = f32x2::new(0., -2.);
+ let r: f32x2 = transmute(vcmla_f32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcmlaq_f32() {
+ let a: f32x4 = f32x4::new(1., -1., 1., -1.);
+ let b: f32x4 = f32x4::new(-1., 1., -1., 1.);
+ let c: f32x4 = f32x4::new(1., 1., -1., -1.);
+ let e: f32x4 = f32x4::new(0., -2., 2., 0.);
+ let r: f32x4 = transmute(vcmlaq_f32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcmlaq_f64() {
+ let a: f64x2 = f64x2::new(1., -1.);
+ let b: f64x2 = f64x2::new(-1., 1.);
+ let c: f64x2 = f64x2::new(1., 1.);
+ let e: f64x2 = f64x2::new(0., -2.);
+ let r: f64x2 = transmute(vcmlaq_f64(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcmla_rot90_f32() {
+ let a: f32x2 = f32x2::new(1., 1.);
+ let b: f32x2 = f32x2::new(1., -1.);
+ let c: f32x2 = f32x2::new(1., 1.);
+ let e: f32x2 = f32x2::new(2., 0.);
+ let r: f32x2 = transmute(vcmla_rot90_f32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcmlaq_rot90_f32() {
+ let a: f32x4 = f32x4::new(1., 1., 1., 1.);
+ let b: f32x4 = f32x4::new(1., -1., 1., -1.);
+ let c: f32x4 = f32x4::new(1., 1., 1., 1.);
+ let e: f32x4 = f32x4::new(2., 0., 2., 0.);
+ let r: f32x4 = transmute(vcmlaq_rot90_f32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcmlaq_rot90_f64() {
+ let a: f64x2 = f64x2::new(1., 1.);
+ let b: f64x2 = f64x2::new(1., -1.);
+ let c: f64x2 = f64x2::new(1., 1.);
+ let e: f64x2 = f64x2::new(2., 0.);
+ let r: f64x2 = transmute(vcmlaq_rot90_f64(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcmla_rot180_f32() {
+ let a: f32x2 = f32x2::new(1., 1.);
+ let b: f32x2 = f32x2::new(1., -1.);
+ let c: f32x2 = f32x2::new(1., 1.);
+ let e: f32x2 = f32x2::new(0., 0.);
+ let r: f32x2 = transmute(vcmla_rot180_f32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcmlaq_rot180_f32() {
+ let a: f32x4 = f32x4::new(1., 1., 1., 1.);
+ let b: f32x4 = f32x4::new(1., -1., 1., -1.);
+ let c: f32x4 = f32x4::new(1., 1., 1., 1.);
+ let e: f32x4 = f32x4::new(0., 0., 0., 0.);
+ let r: f32x4 = transmute(vcmlaq_rot180_f32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcmlaq_rot180_f64() {
+ let a: f64x2 = f64x2::new(1., 1.);
+ let b: f64x2 = f64x2::new(1., -1.);
+ let c: f64x2 = f64x2::new(1., 1.);
+ let e: f64x2 = f64x2::new(0., 0.);
+ let r: f64x2 = transmute(vcmlaq_rot180_f64(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcmla_rot270_f32() {
+ let a: f32x2 = f32x2::new(1., 1.);
+ let b: f32x2 = f32x2::new(1., -1.);
+ let c: f32x2 = f32x2::new(1., 1.);
+ let e: f32x2 = f32x2::new(0., 2.);
+ let r: f32x2 = transmute(vcmla_rot270_f32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcmlaq_rot270_f32() {
+ let a: f32x4 = f32x4::new(1., 1., 1., 1.);
+ let b: f32x4 = f32x4::new(1., -1., 1., -1.);
+ let c: f32x4 = f32x4::new(1., 1., 1., 1.);
+ let e: f32x4 = f32x4::new(0., 2., 0., 2.);
+ let r: f32x4 = transmute(vcmlaq_rot270_f32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcmlaq_rot270_f64() {
+ let a: f64x2 = f64x2::new(1., 1.);
+ let b: f64x2 = f64x2::new(1., -1.);
+ let c: f64x2 = f64x2::new(1., 1.);
+ let e: f64x2 = f64x2::new(0., 2.);
+ let r: f64x2 = transmute(vcmlaq_rot270_f64(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcmla_lane_f32() {
+ let a: f32x2 = f32x2::new(1., -1.);
+ let b: f32x2 = f32x2::new(-1., 1.);
+ let c: f32x2 = f32x2::new(1., 1.);
+ let e: f32x2 = f32x2::new(0., -2.);
+ let r: f32x2 = transmute(vcmla_lane_f32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcmla_laneq_f32() {
+ let a: f32x2 = f32x2::new(1., -1.);
+ let b: f32x2 = f32x2::new(-1., 1.);
+ let c: f32x4 = f32x4::new(1., 1., -1., -1.);
+ let e: f32x2 = f32x2::new(0., -2.);
+ let r: f32x2 = transmute(vcmla_laneq_f32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcmlaq_lane_f32() {
+ let a: f32x4 = f32x4::new(1., -1., 1., -1.);
+ let b: f32x4 = f32x4::new(-1., 1., -1., 1.);
+ let c: f32x2 = f32x2::new(1., 1.);
+ let e: f32x4 = f32x4::new(0., -2., 0., -2.);
+ let r: f32x4 = transmute(vcmlaq_lane_f32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcmlaq_laneq_f32() {
+ let a: f32x4 = f32x4::new(1., -1., 1., -1.);
+ let b: f32x4 = f32x4::new(-1., 1., -1., 1.);
+ let c: f32x4 = f32x4::new(1., 1., -1., -1.);
+ let e: f32x4 = f32x4::new(0., -2., 0., -2.);
+ let r: f32x4 = transmute(vcmlaq_laneq_f32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcmla_rot90_lane_f32() {
+ let a: f32x2 = f32x2::new(1., -1.);
+ let b: f32x2 = f32x2::new(-1., 1.);
+ let c: f32x2 = f32x2::new(1., 1.);
+ let e: f32x2 = f32x2::new(0., 0.);
+ let r: f32x2 = transmute(vcmla_rot90_lane_f32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcmla_rot90_laneq_f32() {
+ let a: f32x2 = f32x2::new(1., -1.);
+ let b: f32x2 = f32x2::new(-1., 1.);
+ let c: f32x4 = f32x4::new(1., 1., -1., -1.);
+ let e: f32x2 = f32x2::new(0., 0.);
+ let r: f32x2 = transmute(vcmla_rot90_laneq_f32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcmlaq_rot90_lane_f32() {
+ let a: f32x4 = f32x4::new(1., -1., 1., -1.);
+ let b: f32x4 = f32x4::new(-1., 1., -1., 1.);
+ let c: f32x2 = f32x2::new(1., 1.);
+ let e: f32x4 = f32x4::new(0., 0., 0., 0.);
+ let r: f32x4 = transmute(vcmlaq_rot90_lane_f32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcmlaq_rot90_laneq_f32() {
+ let a: f32x4 = f32x4::new(1., -1., 1., -1.);
+ let b: f32x4 = f32x4::new(-1., 1., -1., 1.);
+ let c: f32x4 = f32x4::new(1., 1., -1., -1.);
+ let e: f32x4 = f32x4::new(0., 0., 0., 0.);
+ let r: f32x4 = transmute(vcmlaq_rot90_laneq_f32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcmla_rot180_lane_f32() {
+ let a: f32x2 = f32x2::new(1., -1.);
+ let b: f32x2 = f32x2::new(-1., 1.);
+ let c: f32x2 = f32x2::new(1., 1.);
+ let e: f32x2 = f32x2::new(2., 0.);
+ let r: f32x2 = transmute(vcmla_rot180_lane_f32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcmla_rot180_laneq_f32() {
+ let a: f32x2 = f32x2::new(1., -1.);
+ let b: f32x2 = f32x2::new(-1., 1.);
+ let c: f32x4 = f32x4::new(1., 1., -1., -1.);
+ let e: f32x2 = f32x2::new(2., 0.);
+ let r: f32x2 = transmute(vcmla_rot180_laneq_f32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcmlaq_rot180_lane_f32() {
+ let a: f32x4 = f32x4::new(1., -1., 1., -1.);
+ let b: f32x4 = f32x4::new(-1., 1., -1., 1.);
+ let c: f32x2 = f32x2::new(1., 1.);
+ let e: f32x4 = f32x4::new(2., 0., 2., 0.);
+ let r: f32x4 = transmute(vcmlaq_rot180_lane_f32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcmlaq_rot180_laneq_f32() {
+ let a: f32x4 = f32x4::new(1., -1., 1., -1.);
+ let b: f32x4 = f32x4::new(-1., 1., -1., 1.);
+ let c: f32x4 = f32x4::new(1., 1., -1., -1.);
+ let e: f32x4 = f32x4::new(2., 0., 2., 0.);
+ let r: f32x4 = transmute(vcmlaq_rot180_laneq_f32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcmla_rot270_lane_f32() {
+ let a: f32x2 = f32x2::new(1., -1.);
+ let b: f32x2 = f32x2::new(-1., 1.);
+ let c: f32x2 = f32x2::new(1., 1.);
+ let e: f32x2 = f32x2::new(2., -2.);
+ let r: f32x2 = transmute(vcmla_rot270_lane_f32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcmla_rot270_laneq_f32() {
+ let a: f32x2 = f32x2::new(1., -1.);
+ let b: f32x2 = f32x2::new(-1., 1.);
+ let c: f32x4 = f32x4::new(1., 1., -1., -1.);
+ let e: f32x2 = f32x2::new(2., -2.);
+ let r: f32x2 = transmute(vcmla_rot270_laneq_f32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcmlaq_rot270_lane_f32() {
+ let a: f32x4 = f32x4::new(1., -1., 1., -1.);
+ let b: f32x4 = f32x4::new(-1., 1., -1., 1.);
+ let c: f32x2 = f32x2::new(1., 1.);
+ let e: f32x4 = f32x4::new(2., -2., 2., -2.);
+ let r: f32x4 = transmute(vcmlaq_rot270_lane_f32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcmlaq_rot270_laneq_f32() {
+ let a: f32x4 = f32x4::new(1., -1., 1., -1.);
+ let b: f32x4 = f32x4::new(-1., 1., -1., 1.);
+ let c: f32x4 = f32x4::new(1., 1., -1., -1.);
+ let e: f32x4 = f32x4::new(2., -2., 2., -2.);
+ let r: f32x4 = transmute(vcmlaq_rot270_laneq_f32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdot_s32() {
+ let a: i32x2 = i32x2::new(1, 2);
+ let b: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let c: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: i32x2 = i32x2::new(31, 176);
+ let r: i32x2 = transmute(vdot_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdotq_s32() {
+ let a: i32x4 = i32x4::new(1, 2, 1, 2);
+ let b: i8x16 = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
+ let c: i8x16 = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
+ let e: i32x4 = i32x4::new(31, 176, 31, 176);
+ let r: i32x4 = transmute(vdotq_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdot_u32() {
+ let a: u32x2 = u32x2::new(1, 2);
+ let b: u8x8 = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let c: u8x8 = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: u32x2 = u32x2::new(31, 176);
+ let r: u32x2 = transmute(vdot_u32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdotq_u32() {
+ let a: u32x4 = u32x4::new(1, 2, 1, 2);
+ let b: u8x16 = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
+ let c: u8x16 = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
+ let e: u32x4 = u32x4::new(31, 176, 31, 176);
+ let r: u32x4 = transmute(vdotq_u32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdot_lane_s32() {
+ let a: i32x2 = i32x2::new(1, 2);
+ let b: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let c: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: i32x2 = i32x2::new(31, 72);
+ let r: i32x2 = transmute(vdot_lane_s32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdot_laneq_s32() {
+ let a: i32x2 = i32x2::new(1, 2);
+ let b: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let c: i8x16 = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
+ let e: i32x2 = i32x2::new(31, 72);
+ let r: i32x2 = transmute(vdot_laneq_s32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdotq_lane_s32() {
+ let a: i32x4 = i32x4::new(1, 2, 1, 2);
+ let b: i8x16 = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
+ let c: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: i32x4 = i32x4::new(31, 72, 31, 72);
+ let r: i32x4 = transmute(vdotq_lane_s32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdotq_laneq_s32() {
+ let a: i32x4 = i32x4::new(1, 2, 1, 2);
+ let b: i8x16 = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
+ let c: i8x16 = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
+ let e: i32x4 = i32x4::new(31, 72, 31, 72);
+ let r: i32x4 = transmute(vdotq_laneq_s32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdot_lane_u32() {
+ let a: u32x2 = u32x2::new(1, 2);
+ let b: u8x8 = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let c: u8x8 = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: u32x2 = u32x2::new(31, 72);
+ let r: u32x2 = transmute(vdot_lane_u32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdot_laneq_u32() {
+ let a: u32x2 = u32x2::new(1, 2);
+ let b: u8x8 = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let c: u8x16 = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
+ let e: u32x2 = u32x2::new(31, 72);
+ let r: u32x2 = transmute(vdot_laneq_u32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdotq_lane_u32() {
+ let a: u32x4 = u32x4::new(1, 2, 1, 2);
+ let b: u8x16 = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
+ let c: u8x8 = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: u32x4 = u32x4::new(31, 72, 31, 72);
+ let r: u32x4 = transmute(vdotq_lane_u32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdotq_laneq_u32() {
+ let a: u32x4 = u32x4::new(1, 2, 1, 2);
+ let b: u8x16 = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
+ let c: u8x16 = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
+ let e: u32x4 = u32x4::new(31, 72, 31, 72);
+ let r: u32x4 = transmute(vdotq_laneq_u32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmax_f64() {
+ let a: f64 = 1.0;
+ let b: f64 = 0.0;
+ let e: f64 = 1.0;
+ let r: f64 = transmute(vmax_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmaxq_f64() {
+ let a: f64x2 = f64x2::new(1.0, -2.0);
+ let b: f64x2 = f64x2::new(0.0, 3.0);
+ let e: f64x2 = f64x2::new(1.0, 3.0);
+ let r: f64x2 = transmute(vmaxq_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmaxnm_f64() {
+ let a: f64 = 1.0;
+ let b: f64 = 8.0;
+ let e: f64 = 8.0;
+ let r: f64 = transmute(vmaxnm_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmaxnmq_f64() {
+ let a: f64x2 = f64x2::new(1.0, 2.0);
+ let b: f64x2 = f64x2::new(8.0, 16.0);
+ let e: f64x2 = f64x2::new(8.0, 16.0);
+ let r: f64x2 = transmute(vmaxnmq_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmaxnmv_f32() {
+ let a: f32x2 = f32x2::new(1., 2.);
+ let e: f32 = 2.;
+ let r: f32 = transmute(vmaxnmv_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmaxnmvq_f64() {
+ let a: f64x2 = f64x2::new(1., 2.);
+ let e: f64 = 2.;
+ let r: f64 = transmute(vmaxnmvq_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmaxnmvq_f32() {
+ let a: f32x4 = f32x4::new(1., 2., 0., 1.);
+ let e: f32 = 2.;
+ let r: f32 = transmute(vmaxnmvq_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpmaxnm_f32() {
+ let a: f32x2 = f32x2::new(1.0, 2.0);
+ let b: f32x2 = f32x2::new(6.0, -3.0);
+ let e: f32x2 = f32x2::new(2.0, 6.0);
+ let r: f32x2 = transmute(vpmaxnm_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpmaxnmq_f64() {
+ let a: f64x2 = f64x2::new(1.0, 2.0);
+ let b: f64x2 = f64x2::new(6.0, -3.0);
+ let e: f64x2 = f64x2::new(2.0, 6.0);
+ let r: f64x2 = transmute(vpmaxnmq_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpmaxnmq_f32() {
+ let a: f32x4 = f32x4::new(1.0, 2.0, 3.0, -4.0);
+ let b: f32x4 = f32x4::new(8.0, 16.0, -1.0, 6.0);
+ let e: f32x4 = f32x4::new(2.0, 3.0, 16.0, 6.0);
+ let r: f32x4 = transmute(vpmaxnmq_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpmaxnms_f32() {
+ let a: f32x2 = f32x2::new(1., 2.);
+ let e: f32 = 2.;
+ let r: f32 = transmute(vpmaxnms_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpmaxnmqd_f64() {
+ let a: f64x2 = f64x2::new(1., 2.);
+ let e: f64 = 2.;
+ let r: f64 = transmute(vpmaxnmqd_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpmaxs_f32() {
+ let a: f32x2 = f32x2::new(1., 2.);
+ let e: f32 = 2.;
+ let r: f32 = transmute(vpmaxs_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpmaxqd_f64() {
+ let a: f64x2 = f64x2::new(1., 2.);
+ let e: f64 = 2.;
+ let r: f64 = transmute(vpmaxqd_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmin_f64() {
+ let a: f64 = 1.0;
+ let b: f64 = 0.0;
+ let e: f64 = 0.0;
+ let r: f64 = transmute(vmin_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vminq_f64() {
+ let a: f64x2 = f64x2::new(1.0, -2.0);
+ let b: f64x2 = f64x2::new(0.0, 3.0);
+ let e: f64x2 = f64x2::new(0.0, -2.0);
+ let r: f64x2 = transmute(vminq_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vminnm_f64() {
+ let a: f64 = 1.0;
+ let b: f64 = 8.0;
+ let e: f64 = 1.0;
+ let r: f64 = transmute(vminnm_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vminnmq_f64() {
+ let a: f64x2 = f64x2::new(1.0, 2.0);
+ let b: f64x2 = f64x2::new(8.0, 16.0);
+ let e: f64x2 = f64x2::new(1.0, 2.0);
+ let r: f64x2 = transmute(vminnmq_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vminnmv_f32() {
+ let a: f32x2 = f32x2::new(1., 0.);
+ let e: f32 = 0.;
+ let r: f32 = transmute(vminnmv_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vminnmvq_f64() {
+ let a: f64x2 = f64x2::new(1., 0.);
+ let e: f64 = 0.;
+ let r: f64 = transmute(vminnmvq_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vminnmvq_f32() {
+ let a: f32x4 = f32x4::new(1., 0., 2., 3.);
+ let e: f32 = 0.;
+ let r: f32 = transmute(vminnmvq_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmovl_high_s8() {
+ let a: i8x16 = i8x16::new(1, 2, 3, 4, 3, 4, 5, 6, 3, 4, 5, 6, 7, 8, 9, 10);
+ let e: i16x8 = i16x8::new(3, 4, 5, 6, 7, 8, 9, 10);
+ let r: i16x8 = transmute(vmovl_high_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmovl_high_s16() {
+ let a: i16x8 = i16x8::new(1, 2, 3, 4, 3, 4, 5, 6);
+ let e: i32x4 = i32x4::new(3, 4, 5, 6);
+ let r: i32x4 = transmute(vmovl_high_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmovl_high_s32() {
+ let a: i32x4 = i32x4::new(1, 2, 3, 4);
+ let e: i64x2 = i64x2::new(3, 4);
+ let r: i64x2 = transmute(vmovl_high_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmovl_high_u8() {
+ let a: u8x16 = u8x16::new(1, 2, 3, 4, 3, 4, 5, 6, 3, 4, 5, 6, 7, 8, 9, 10);
+ let e: u16x8 = u16x8::new(3, 4, 5, 6, 7, 8, 9, 10);
+ let r: u16x8 = transmute(vmovl_high_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmovl_high_u16() {
+ let a: u16x8 = u16x8::new(1, 2, 3, 4, 3, 4, 5, 6);
+ let e: u32x4 = u32x4::new(3, 4, 5, 6);
+ let r: u32x4 = transmute(vmovl_high_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmovl_high_u32() {
+ let a: u32x4 = u32x4::new(1, 2, 3, 4);
+ let e: u64x2 = u64x2::new(3, 4);
+ let r: u64x2 = transmute(vmovl_high_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpaddq_f32() {
+ let a: f32x4 = f32x4::new(1., 2., 3., 4.);
+ let b: f32x4 = f32x4::new(3., 4., 5., 6.);
+ let e: f32x4 = f32x4::new(3., 7., 7., 11.);
+ let r: f32x4 = transmute(vpaddq_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpaddq_f64() {
+ let a: f64x2 = f64x2::new(1., 2.);
+ let b: f64x2 = f64x2::new(3., 4.);
+ let e: f64x2 = f64x2::new(3., 7.);
+ let r: f64x2 = transmute(vpaddq_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpadds_f32() {
+ let a: f32x2 = f32x2::new(1., 2.);
+ let e: f32 = 3.;
+ let r: f32 = transmute(vpadds_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpaddd_f64() {
+ let a: f64x2 = f64x2::new(1., 2.);
+ let e: f64 = 3.;
+ let r: f64 = transmute(vpaddd_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpminnm_f32() {
+ let a: f32x2 = f32x2::new(1.0, 2.0);
+ let b: f32x2 = f32x2::new(6.0, -3.0);
+ let e: f32x2 = f32x2::new(1.0, -3.0);
+ let r: f32x2 = transmute(vpminnm_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpminnmq_f64() {
+ let a: f64x2 = f64x2::new(1.0, 2.0);
+ let b: f64x2 = f64x2::new(6.0, -3.0);
+ let e: f64x2 = f64x2::new(1.0, -3.0);
+ let r: f64x2 = transmute(vpminnmq_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpminnmq_f32() {
+ let a: f32x4 = f32x4::new(1.0, 2.0, 3.0, -4.0);
+ let b: f32x4 = f32x4::new(8.0, 16.0, -1.0, 6.0);
+ let e: f32x4 = f32x4::new(1.0, -4.0, 8.0, -1.0);
+ let r: f32x4 = transmute(vpminnmq_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpminnms_f32() {
+ let a: f32x2 = f32x2::new(1., 2.);
+ let e: f32 = 1.;
+ let r: f32 = transmute(vpminnms_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpminnmqd_f64() {
+ let a: f64x2 = f64x2::new(1., 2.);
+ let e: f64 = 1.;
+ let r: f64 = transmute(vpminnmqd_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpmins_f32() {
+ let a: f32x2 = f32x2::new(1., 2.);
+ let e: f32 = 1.;
+ let r: f32 = transmute(vpmins_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpminqd_f64() {
+ let a: f64x2 = f64x2::new(1., 2.);
+ let e: f64 = 1.;
+ let r: f64 = transmute(vpminqd_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmullh_s16() {
+ let a: i16 = 2;
+ let b: i16 = 3;
+ let e: i32 = 12;
+ let r: i32 = transmute(vqdmullh_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmulls_s32() {
+ let a: i32 = 2;
+ let b: i32 = 3;
+ let e: i64 = 12;
+ let r: i64 = transmute(vqdmulls_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmull_high_s16() {
+ let a: i16x8 = i16x8::new(0, 1, 4, 5, 4, 5, 6, 7);
+ let b: i16x8 = i16x8::new(1, 2, 5, 6, 5, 6, 7, 8);
+ let e: i32x4 = i32x4::new(40, 60, 84, 112);
+ let r: i32x4 = transmute(vqdmull_high_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmull_high_s32() {
+ let a: i32x4 = i32x4::new(0, 1, 4, 5);
+ let b: i32x4 = i32x4::new(1, 2, 5, 6);
+ let e: i64x2 = i64x2::new(40, 60);
+ let r: i64x2 = transmute(vqdmull_high_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmull_high_n_s16() {
+ let a: i16x8 = i16x8::new(0, 2, 8, 10, 8, 10, 12, 14);
+ let b: i16 = 2;
+ let e: i32x4 = i32x4::new(32, 40, 48, 56);
+ let r: i32x4 = transmute(vqdmull_high_n_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmull_high_n_s32() {
+ let a: i32x4 = i32x4::new(0, 2, 8, 10);
+ let b: i32 = 2;
+ let e: i64x2 = i64x2::new(32, 40);
+ let r: i64x2 = transmute(vqdmull_high_n_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmull_laneq_s16() {
+ let a: i16x4 = i16x4::new(1, 2, 3, 4);
+ let b: i16x8 = i16x8::new(0, 2, 2, 0, 2, 0, 0, 0);
+ let e: i32x4 = i32x4::new(4, 8, 12, 16);
+ let r: i32x4 = transmute(vqdmull_laneq_s16::<4>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmull_laneq_s32() {
+ let a: i32x2 = i32x2::new(1, 2);
+ let b: i32x4 = i32x4::new(0, 2, 2, 0);
+ let e: i64x2 = i64x2::new(4, 8);
+ let r: i64x2 = transmute(vqdmull_laneq_s32::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmullh_lane_s16() {
+ let a: i16 = 2;
+ let b: i16x4 = i16x4::new(0, 2, 2, 0);
+ let e: i32 = 8;
+ let r: i32 = transmute(vqdmullh_lane_s16::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmullh_laneq_s16() {
+ let a: i16 = 2;
+ let b: i16x8 = i16x8::new(0, 2, 2, 0, 2, 0, 0, 0);
+ let e: i32 = 8;
+ let r: i32 = transmute(vqdmullh_laneq_s16::<4>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmulls_lane_s32() {
+ let a: i32 = 2;
+ let b: i32x2 = i32x2::new(0, 2);
+ let e: i64 = 8;
+ let r: i64 = transmute(vqdmulls_lane_s32::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmulls_laneq_s32() {
+ let a: i32 = 2;
+ let b: i32x4 = i32x4::new(0, 2, 2, 0);
+ let e: i64 = 8;
+ let r: i64 = transmute(vqdmulls_laneq_s32::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmull_high_lane_s16() {
+ let a: i16x8 = i16x8::new(0, 1, 4, 5, 4, 5, 6, 7);
+ let b: i16x4 = i16x4::new(0, 2, 2, 0);
+ let e: i32x4 = i32x4::new(16, 20, 24, 28);
+ let r: i32x4 = transmute(vqdmull_high_lane_s16::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmull_high_lane_s32() {
+ let a: i32x4 = i32x4::new(0, 1, 4, 5);
+ let b: i32x2 = i32x2::new(0, 2);
+ let e: i64x2 = i64x2::new(16, 20);
+ let r: i64x2 = transmute(vqdmull_high_lane_s32::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmull_high_laneq_s16() {
+ let a: i16x8 = i16x8::new(0, 1, 4, 5, 4, 5, 6, 7);
+ let b: i16x8 = i16x8::new(0, 2, 2, 0, 2, 0, 0, 0);
+ let e: i32x4 = i32x4::new(16, 20, 24, 28);
+ let r: i32x4 = transmute(vqdmull_high_laneq_s16::<4>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmull_high_laneq_s32() {
+ let a: i32x4 = i32x4::new(0, 1, 4, 5);
+ let b: i32x4 = i32x4::new(0, 2, 2, 0);
+ let e: i64x2 = i64x2::new(16, 20);
+ let r: i64x2 = transmute(vqdmull_high_laneq_s32::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlal_high_s16() {
+ let a: i32x4 = i32x4::new(1, 2, 3, 4);
+ let b: i16x8 = i16x8::new(0, 1, 4, 5, 4, 5, 6, 7);
+ let c: i16x8 = i16x8::new(1, 2, 5, 6, 5, 6, 7, 8);
+ let e: i32x4 = i32x4::new(41, 62, 87, 116);
+ let r: i32x4 = transmute(vqdmlal_high_s16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlal_high_s32() {
+ let a: i64x2 = i64x2::new(1, 2);
+ let b: i32x4 = i32x4::new(0, 1, 4, 5);
+ let c: i32x4 = i32x4::new(1, 2, 5, 6);
+ let e: i64x2 = i64x2::new(41, 62);
+ let r: i64x2 = transmute(vqdmlal_high_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlal_high_n_s16() {
+ let a: i32x4 = i32x4::new(1, 2, 3, 4);
+ let b: i16x8 = i16x8::new(0, 2, 8, 10, 8, 10, 12, 14);
+ let c: i16 = 2;
+ let e: i32x4 = i32x4::new(33, 42, 51, 60);
+ let r: i32x4 = transmute(vqdmlal_high_n_s16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlal_high_n_s32() {
+ let a: i64x2 = i64x2::new(1, 2);
+ let b: i32x4 = i32x4::new(0, 2, 8, 10);
+ let c: i32 = 2;
+ let e: i64x2 = i64x2::new(33, 42);
+ let r: i64x2 = transmute(vqdmlal_high_n_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlal_laneq_s16() {
+ let a: i32x4 = i32x4::new(1, 2, 3, 4);
+ let b: i16x4 = i16x4::new(1, 2, 3, 4);
+ let c: i16x8 = i16x8::new(0, 2, 2, 0, 2, 0, 0, 0);
+ let e: i32x4 = i32x4::new(5, 10, 15, 20);
+ let r: i32x4 = transmute(vqdmlal_laneq_s16::<2>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlal_laneq_s32() {
+ let a: i64x2 = i64x2::new(1, 2);
+ let b: i32x2 = i32x2::new(1, 2);
+ let c: i32x4 = i32x4::new(0, 2, 2, 0);
+ let e: i64x2 = i64x2::new(5, 10);
+ let r: i64x2 = transmute(vqdmlal_laneq_s32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlal_high_lane_s16() {
+ let a: i32x4 = i32x4::new(1, 2, 3, 4);
+ let b: i16x8 = i16x8::new(0, 1, 4, 5, 4, 5, 6, 7);
+ let c: i16x4 = i16x4::new(0, 2, 0, 0);
+ let e: i32x4 = i32x4::new(17, 22, 27, 32);
+ let r: i32x4 = transmute(vqdmlal_high_lane_s16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlal_high_laneq_s16() {
+ let a: i32x4 = i32x4::new(1, 2, 3, 4);
+ let b: i16x8 = i16x8::new(0, 1, 4, 5, 4, 5, 6, 7);
+ let c: i16x8 = i16x8::new(0, 2, 0, 0, 0, 0, 0, 0);
+ let e: i32x4 = i32x4::new(17, 22, 27, 32);
+ let r: i32x4 = transmute(vqdmlal_high_laneq_s16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlal_high_lane_s32() {
+ let a: i64x2 = i64x2::new(1, 2);
+ let b: i32x4 = i32x4::new(0, 1, 4, 5);
+ let c: i32x2 = i32x2::new(0, 2);
+ let e: i64x2 = i64x2::new(17, 22);
+ let r: i64x2 = transmute(vqdmlal_high_lane_s32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlal_high_laneq_s32() {
+ let a: i64x2 = i64x2::new(1, 2);
+ let b: i32x4 = i32x4::new(0, 1, 4, 5);
+ let c: i32x4 = i32x4::new(0, 2, 0, 0);
+ let e: i64x2 = i64x2::new(17, 22);
+ let r: i64x2 = transmute(vqdmlal_high_laneq_s32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlalh_s16() {
+ let a: i32 = 1;
+ let b: i16 = 1;
+ let c: i16 = 2;
+ let e: i32 = 5;
+ let r: i32 = transmute(vqdmlalh_s16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlals_s32() {
+ let a: i64 = 1;
+ let b: i32 = 1;
+ let c: i32 = 2;
+ let e: i64 = 5;
+ let r: i64 = transmute(vqdmlals_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlalh_lane_s16() {
+ let a: i32 = 1;
+ let b: i16 = 1;
+ let c: i16x4 = i16x4::new(2, 1, 1, 1);
+ let e: i32 = 5;
+ let r: i32 = transmute(vqdmlalh_lane_s16::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlalh_laneq_s16() {
+ let a: i32 = 1;
+ let b: i16 = 1;
+ let c: i16x8 = i16x8::new(2, 1, 1, 1, 1, 1, 1, 1);
+ let e: i32 = 5;
+ let r: i32 = transmute(vqdmlalh_laneq_s16::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlals_lane_s32() {
+ let a: i64 = 1;
+ let b: i32 = 1;
+ let c: i32x2 = i32x2::new(2, 1);
+ let e: i64 = 5;
+ let r: i64 = transmute(vqdmlals_lane_s32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlals_laneq_s32() {
+ let a: i64 = 1;
+ let b: i32 = 1;
+ let c: i32x4 = i32x4::new(2, 1, 1, 1);
+ let e: i64 = 5;
+ let r: i64 = transmute(vqdmlals_laneq_s32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlsl_high_s16() {
+ let a: i32x4 = i32x4::new(39, 58, 81, 108);
+ let b: i16x8 = i16x8::new(0, 1, 4, 5, 4, 5, 6, 7);
+ let c: i16x8 = i16x8::new(1, 2, 5, 6, 5, 6, 7, 8);
+ let e: i32x4 = i32x4::new(-1, -2, -3, -4);
+ let r: i32x4 = transmute(vqdmlsl_high_s16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlsl_high_s32() {
+ let a: i64x2 = i64x2::new(39, 58);
+ let b: i32x4 = i32x4::new(0, 1, 4, 5);
+ let c: i32x4 = i32x4::new(1, 2, 5, 6);
+ let e: i64x2 = i64x2::new(-1, -2);
+ let r: i64x2 = transmute(vqdmlsl_high_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlsl_high_n_s16() {
+ let a: i32x4 = i32x4::new(31, 38, 45, 52);
+ let b: i16x8 = i16x8::new(0, 2, 8, 10, 8, 10, 12, 14);
+ let c: i16 = 2;
+ let e: i32x4 = i32x4::new(-1, -2, -3, -4);
+ let r: i32x4 = transmute(vqdmlsl_high_n_s16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlsl_high_n_s32() {
+ let a: i64x2 = i64x2::new(31, 38);
+ let b: i32x4 = i32x4::new(0, 2, 8, 10);
+ let c: i32 = 2;
+ let e: i64x2 = i64x2::new(-1, -2);
+ let r: i64x2 = transmute(vqdmlsl_high_n_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlsl_laneq_s16() {
+ let a: i32x4 = i32x4::new(3, 6, 9, 12);
+ let b: i16x4 = i16x4::new(1, 2, 3, 4);
+ let c: i16x8 = i16x8::new(0, 2, 2, 0, 2, 0, 0, 0);
+ let e: i32x4 = i32x4::new(-1, -2, -3, -4);
+ let r: i32x4 = transmute(vqdmlsl_laneq_s16::<2>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlsl_laneq_s32() {
+ let a: i64x2 = i64x2::new(3, 6);
+ let b: i32x2 = i32x2::new(1, 2);
+ let c: i32x4 = i32x4::new(0, 2, 2, 0);
+ let e: i64x2 = i64x2::new(-1, -2);
+ let r: i64x2 = transmute(vqdmlsl_laneq_s32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlsl_high_lane_s16() {
+ let a: i32x4 = i32x4::new(15, 18, 21, 24);
+ let b: i16x8 = i16x8::new(0, 1, 4, 5, 4, 5, 6, 7);
+ let c: i16x4 = i16x4::new(0, 2, 0, 0);
+ let e: i32x4 = i32x4::new(-1, -2, -3, -4);
+ let r: i32x4 = transmute(vqdmlsl_high_lane_s16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlsl_high_laneq_s16() {
+ let a: i32x4 = i32x4::new(15, 18, 21, 24);
+ let b: i16x8 = i16x8::new(0, 1, 4, 5, 4, 5, 6, 7);
+ let c: i16x8 = i16x8::new(0, 2, 0, 0, 0, 0, 0, 0);
+ let e: i32x4 = i32x4::new(-1, -2, -3, -4);
+ let r: i32x4 = transmute(vqdmlsl_high_laneq_s16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlsl_high_lane_s32() {
+ let a: i64x2 = i64x2::new(15, 18);
+ let b: i32x4 = i32x4::new(0, 1, 4, 5);
+ let c: i32x2 = i32x2::new(0, 2);
+ let e: i64x2 = i64x2::new(-1, -2);
+ let r: i64x2 = transmute(vqdmlsl_high_lane_s32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlsl_high_laneq_s32() {
+ let a: i64x2 = i64x2::new(15, 18);
+ let b: i32x4 = i32x4::new(0, 1, 4, 5);
+ let c: i32x4 = i32x4::new(0, 2, 0, 0);
+ let e: i64x2 = i64x2::new(-1, -2);
+ let r: i64x2 = transmute(vqdmlsl_high_laneq_s32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlslh_s16() {
+ let a: i32 = 10;
+ let b: i16 = 1;
+ let c: i16 = 2;
+ let e: i32 = 6;
+ let r: i32 = transmute(vqdmlslh_s16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlsls_s32() {
+ let a: i64 = 10;
+ let b: i32 = 1;
+ let c: i32 = 2;
+ let e: i64 = 6;
+ let r: i64 = transmute(vqdmlsls_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlslh_lane_s16() {
+ let a: i32 = 10;
+ let b: i16 = 1;
+ let c: i16x4 = i16x4::new(2, 1, 1, 1);
+ let e: i32 = 6;
+ let r: i32 = transmute(vqdmlslh_lane_s16::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlslh_laneq_s16() {
+ let a: i32 = 10;
+ let b: i16 = 1;
+ let c: i16x8 = i16x8::new(2, 1, 1, 1, 1, 1, 1, 1);
+ let e: i32 = 6;
+ let r: i32 = transmute(vqdmlslh_laneq_s16::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlsls_lane_s32() {
+ let a: i64 = 10;
+ let b: i32 = 1;
+ let c: i32x2 = i32x2::new(2, 1);
+ let e: i64 = 6;
+ let r: i64 = transmute(vqdmlsls_lane_s32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlsls_laneq_s32() {
+ let a: i64 = 10;
+ let b: i32 = 1;
+ let c: i32x4 = i32x4::new(2, 1, 1, 1);
+ let e: i64 = 6;
+ let r: i64 = transmute(vqdmlsls_laneq_s32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmulhh_s16() {
+ let a: i16 = 1;
+ let b: i16 = 2;
+ let e: i16 = 0;
+ let r: i16 = transmute(vqdmulhh_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmulhs_s32() {
+ let a: i32 = 1;
+ let b: i32 = 2;
+ let e: i32 = 0;
+ let r: i32 = transmute(vqdmulhs_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmulhh_lane_s16() {
+ let a: i16 = 2;
+ let b: i16x4 = i16x4::new(0, 0, 0x7F_FF, 0);
+ let e: i16 = 1;
+ let r: i16 = transmute(vqdmulhh_lane_s16::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmulhh_laneq_s16() {
+ let a: i16 = 2;
+ let b: i16x8 = i16x8::new(0, 0, 0x7F_FF, 0, 0, 0, 0, 0);
+ let e: i16 = 1;
+ let r: i16 = transmute(vqdmulhh_laneq_s16::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmulhs_lane_s32() {
+ let a: i32 = 2;
+ let b: i32x2 = i32x2::new(0, 0x7F_FF_FF_FF);
+ let e: i32 = 1;
+ let r: i32 = transmute(vqdmulhs_lane_s32::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmulhs_laneq_s32() {
+ let a: i32 = 2;
+ let b: i32x4 = i32x4::new(0, 0x7F_FF_FF_FF, 0, 0);
+ let e: i32 = 1;
+ let r: i32 = transmute(vqdmulhs_laneq_s32::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmulh_lane_s16() {
+ let a: i16x4 = i16x4::new(0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF);
+ let b: i16x4 = i16x4::new(2, 1, 1, 1);
+ let e: i16x4 = i16x4::new(1, 1, 1, 1);
+ let r: i16x4 = transmute(vqdmulh_lane_s16::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmulhq_lane_s16() {
+ let a: i16x8 = i16x8::new(0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF);
+ let b: i16x4 = i16x4::new(2, 1, 1, 1);
+ let e: i16x8 = i16x8::new(1, 1, 1, 1, 1, 1, 1, 1);
+ let r: i16x8 = transmute(vqdmulhq_lane_s16::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmulh_lane_s32() {
+ let a: i32x2 = i32x2::new(0x7F_FF_FF_FF, 0x7F_FF_FF_FF);
+ let b: i32x2 = i32x2::new(2, 1);
+ let e: i32x2 = i32x2::new(1, 1);
+ let r: i32x2 = transmute(vqdmulh_lane_s32::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmulhq_lane_s32() {
+ let a: i32x4 = i32x4::new(0x7F_FF_FF_FF, 0x7F_FF_FF_FF, 0x7F_FF_FF_FF, 0x7F_FF_FF_FF);
+ let b: i32x2 = i32x2::new(2, 1);
+ let e: i32x4 = i32x4::new(1, 1, 1, 1);
+ let r: i32x4 = transmute(vqdmulhq_lane_s32::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqmovnh_s16() {
+ let a: i16 = 1;
+ let e: i8 = 1;
+ let r: i8 = transmute(vqmovnh_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqmovns_s32() {
+ let a: i32 = 1;
+ let e: i16 = 1;
+ let r: i16 = transmute(vqmovns_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqmovnh_u16() {
+ let a: u16 = 1;
+ let e: u8 = 1;
+ let r: u8 = transmute(vqmovnh_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqmovns_u32() {
+ let a: u32 = 1;
+ let e: u16 = 1;
+ let r: u16 = transmute(vqmovns_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqmovnd_s64() {
+ let a: i64 = 1;
+ let e: i32 = 1;
+ let r: i32 = transmute(vqmovnd_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqmovnd_u64() {
+ let a: u64 = 1;
+ let e: u32 = 1;
+ let r: u32 = transmute(vqmovnd_u64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqmovn_high_s16() {
+ let a: i8x8 = i8x8::new(0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F);
+ let b: i16x8 = i16x8::new(0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF);
+ let e: i8x16 = i8x16::new(0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F);
+ let r: i8x16 = transmute(vqmovn_high_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqmovn_high_s32() {
+ let a: i16x4 = i16x4::new(0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF);
+ let b: i32x4 = i32x4::new(0x7F_FF_FF_FF, 0x7F_FF_FF_FF, 0x7F_FF_FF_FF, 0x7F_FF_FF_FF);
+ let e: i16x8 = i16x8::new(0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF);
+ let r: i16x8 = transmute(vqmovn_high_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqmovn_high_s64() {
+ let a: i32x2 = i32x2::new(0x7F_FF_FF_FF, 0x7F_FF_FF_FF);
+ let b: i64x2 = i64x2::new(0x7F_FF_FF_FF_FF_FF_FF_FF, 0x7F_FF_FF_FF_FF_FF_FF_FF);
+ let e: i32x4 = i32x4::new(0x7F_FF_FF_FF, 0x7F_FF_FF_FF, 0x7F_FF_FF_FF, 0x7F_FF_FF_FF);
+ let r: i32x4 = transmute(vqmovn_high_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqmovn_high_u16() {
+ let a: u8x8 = u8x8::new(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
+ let b: u16x8 = u16x8::new(0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF);
+ let e: u8x16 = u8x16::new(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
+ let r: u8x16 = transmute(vqmovn_high_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqmovn_high_u32() {
+ let a: u16x4 = u16x4::new(0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF);
+ let b: u32x4 = u32x4::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let e: u16x8 = u16x8::new(0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF);
+ let r: u16x8 = transmute(vqmovn_high_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqmovn_high_u64() {
+ let a: u32x2 = u32x2::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let b: u64x2 = u64x2::new(0xFF_FF_FF_FF_FF_FF_FF_FF, 0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let e: u32x4 = u32x4::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let r: u32x4 = transmute(vqmovn_high_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqmovunh_s16() {
+ let a: i16 = 1;
+ let e: u8 = 1;
+ let r: u8 = transmute(vqmovunh_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqmovuns_s32() {
+ let a: i32 = 1;
+ let e: u16 = 1;
+ let r: u16 = transmute(vqmovuns_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqmovund_s64() {
+ let a: i64 = 1;
+ let e: u32 = 1;
+ let r: u32 = transmute(vqmovund_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqmovun_high_s16() {
+ let a: u8x8 = u8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let b: i16x8 = i16x8::new(-1, -1, -1, -1, -1, -1, -1, -1);
+ let e: u8x16 = u8x16::new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ let r: u8x16 = transmute(vqmovun_high_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqmovun_high_s32() {
+ let a: u16x4 = u16x4::new(0, 0, 0, 0);
+ let b: i32x4 = i32x4::new(-1, -1, -1, -1);
+ let e: u16x8 = u16x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let r: u16x8 = transmute(vqmovun_high_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqmovun_high_s64() {
+ let a: u32x2 = u32x2::new(0, 0);
+ let b: i64x2 = i64x2::new(-1, -1);
+ let e: u32x4 = u32x4::new(0, 0, 0, 0);
+ let r: u32x4 = transmute(vqmovun_high_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmulhh_s16() {
+ let a: i16 = 1;
+ let b: i16 = 2;
+ let e: i16 = 0;
+ let r: i16 = transmute(vqrdmulhh_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmulhs_s32() {
+ let a: i32 = 1;
+ let b: i32 = 2;
+ let e: i32 = 0;
+ let r: i32 = transmute(vqrdmulhs_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmulhh_lane_s16() {
+ let a: i16 = 1;
+ let b: i16x4 = i16x4::new(0, 2, 0, 0);
+ let e: i16 = 0;
+ let r: i16 = transmute(vqrdmulhh_lane_s16::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmulhh_laneq_s16() {
+ let a: i16 = 1;
+ let b: i16x8 = i16x8::new(0, 2, 0, 0, 0, 0, 0, 0);
+ let e: i16 = 0;
+ let r: i16 = transmute(vqrdmulhh_laneq_s16::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmulhs_lane_s32() {
+ let a: i32 = 1;
+ let b: i32x2 = i32x2::new(0, 2);
+ let e: i32 = 0;
+ let r: i32 = transmute(vqrdmulhs_lane_s32::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmulhs_laneq_s32() {
+ let a: i32 = 1;
+ let b: i32x4 = i32x4::new(0, 2, 0, 0);
+ let e: i32 = 0;
+ let r: i32 = transmute(vqrdmulhs_laneq_s32::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmlah_s16() {
+ let a: i16x4 = i16x4::new(1, 1, 1, 1);
+ let b: i16x4 = i16x4::new(0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF);
+ let c: i16x4 = i16x4::new(2, 2, 2, 2);
+ let e: i16x4 = i16x4::new(3, 3, 3, 3);
+ let r: i16x4 = transmute(vqrdmlah_s16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmlahq_s16() {
+ let a: i16x8 = i16x8::new(1, 1, 1, 1, 1, 1, 1, 1);
+ let b: i16x8 = i16x8::new(0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF);
+ let c: i16x8 = i16x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let e: i16x8 = i16x8::new(3, 3, 3, 3, 3, 3, 3, 3);
+ let r: i16x8 = transmute(vqrdmlahq_s16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmlah_s32() {
+ let a: i32x2 = i32x2::new(1, 1);
+ let b: i32x2 = i32x2::new(0x7F_FF_FF_FF, 0x7F_FF_FF_FF);
+ let c: i32x2 = i32x2::new(2, 2);
+ let e: i32x2 = i32x2::new(3, 3);
+ let r: i32x2 = transmute(vqrdmlah_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmlahq_s32() {
+ let a: i32x4 = i32x4::new(1, 1, 1, 1);
+ let b: i32x4 = i32x4::new(0x7F_FF_FF_FF, 0x7F_FF_FF_FF, 0x7F_FF_FF_FF, 0x7F_FF_FF_FF);
+ let c: i32x4 = i32x4::new(2, 2, 2, 2);
+ let e: i32x4 = i32x4::new(3, 3, 3, 3);
+ let r: i32x4 = transmute(vqrdmlahq_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmlahh_s16() {
+ let a: i16 = 1;
+ let b: i16 = 1;
+ let c: i16 = 2;
+ let e: i16 = 1;
+ let r: i16 = transmute(vqrdmlahh_s16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmlahs_s32() {
+ let a: i32 = 1;
+ let b: i32 = 1;
+ let c: i32 = 2;
+ let e: i32 = 1;
+ let r: i32 = transmute(vqrdmlahs_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmlah_lane_s16() {
+ let a: i16x4 = i16x4::new(1, 1, 1, 1);
+ let b: i16x4 = i16x4::new(0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF);
+ let c: i16x4 = i16x4::new(0, 2, 0, 0);
+ let e: i16x4 = i16x4::new(3, 3, 3, 3);
+ let r: i16x4 = transmute(vqrdmlah_lane_s16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmlah_laneq_s16() {
+ let a: i16x4 = i16x4::new(1, 1, 1, 1);
+ let b: i16x4 = i16x4::new(0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF);
+ let c: i16x8 = i16x8::new(0, 2, 0, 0, 0, 0, 0, 0);
+ let e: i16x4 = i16x4::new(3, 3, 3, 3);
+ let r: i16x4 = transmute(vqrdmlah_laneq_s16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmlahq_lane_s16() {
+ let a: i16x8 = i16x8::new(1, 1, 1, 1, 1, 1, 1, 1);
+ let b: i16x8 = i16x8::new(0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF);
+ let c: i16x4 = i16x4::new(0, 2, 0, 0);
+ let e: i16x8 = i16x8::new(3, 3, 3, 3, 3, 3, 3, 3);
+ let r: i16x8 = transmute(vqrdmlahq_lane_s16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmlahq_laneq_s16() {
+ let a: i16x8 = i16x8::new(1, 1, 1, 1, 1, 1, 1, 1);
+ let b: i16x8 = i16x8::new(0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF);
+ let c: i16x8 = i16x8::new(0, 2, 0, 0, 0, 0, 0, 0);
+ let e: i16x8 = i16x8::new(3, 3, 3, 3, 3, 3, 3, 3);
+ let r: i16x8 = transmute(vqrdmlahq_laneq_s16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmlah_lane_s32() {
+ let a: i32x2 = i32x2::new(1, 1);
+ let b: i32x2 = i32x2::new(0x7F_FF_FF_FF, 0x7F_FF_FF_FF);
+ let c: i32x2 = i32x2::new(0, 2);
+ let e: i32x2 = i32x2::new(3, 3);
+ let r: i32x2 = transmute(vqrdmlah_lane_s32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmlah_laneq_s32() {
+ let a: i32x2 = i32x2::new(1, 1);
+ let b: i32x2 = i32x2::new(0x7F_FF_FF_FF, 0x7F_FF_FF_FF);
+ let c: i32x4 = i32x4::new(0, 2, 0, 0);
+ let e: i32x2 = i32x2::new(3, 3);
+ let r: i32x2 = transmute(vqrdmlah_laneq_s32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmlahq_lane_s32() {
+ let a: i32x4 = i32x4::new(1, 1, 1, 1);
+ let b: i32x4 = i32x4::new(0x7F_FF_FF_FF, 0x7F_FF_FF_FF, 0x7F_FF_FF_FF, 0x7F_FF_FF_FF);
+ let c: i32x2 = i32x2::new(0, 2);
+ let e: i32x4 = i32x4::new(3, 3, 3, 3);
+ let r: i32x4 = transmute(vqrdmlahq_lane_s32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmlahq_laneq_s32() {
+ let a: i32x4 = i32x4::new(1, 1, 1, 1);
+ let b: i32x4 = i32x4::new(0x7F_FF_FF_FF, 0x7F_FF_FF_FF, 0x7F_FF_FF_FF, 0x7F_FF_FF_FF);
+ let c: i32x4 = i32x4::new(0, 2, 0, 0);
+ let e: i32x4 = i32x4::new(3, 3, 3, 3);
+ let r: i32x4 = transmute(vqrdmlahq_laneq_s32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmlahh_lane_s16() {
+ let a: i16 = 1;
+ let b: i16 = 1;
+ let c: i16x4 = i16x4::new(0, 2, 0, 0);
+ let e: i16 = 1;
+ let r: i16 = transmute(vqrdmlahh_lane_s16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmlahh_laneq_s16() {
+ let a: i16 = 1;
+ let b: i16 = 1;
+ let c: i16x8 = i16x8::new(0, 2, 0, 0, 0, 0, 0, 0);
+ let e: i16 = 1;
+ let r: i16 = transmute(vqrdmlahh_laneq_s16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmlahs_lane_s32() {
+ let a: i32 = 1;
+ let b: i32 = 1;
+ let c: i32x2 = i32x2::new(0, 2);
+ let e: i32 = 1;
+ let r: i32 = transmute(vqrdmlahs_lane_s32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmlahs_laneq_s32() {
+ let a: i32 = 1;
+ let b: i32 = 1;
+ let c: i32x4 = i32x4::new(0, 2, 0, 0);
+ let e: i32 = 1;
+ let r: i32 = transmute(vqrdmlahs_laneq_s32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmlsh_s16() {
+ let a: i16x4 = i16x4::new(1, 1, 1, 1);
+ let b: i16x4 = i16x4::new(0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF);
+ let c: i16x4 = i16x4::new(2, 2, 2, 2);
+ let e: i16x4 = i16x4::new(-1, -1, -1, -1);
+ let r: i16x4 = transmute(vqrdmlsh_s16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmlshq_s16() {
+ let a: i16x8 = i16x8::new(1, 1, 1, 1, 1, 1, 1, 1);
+ let b: i16x8 = i16x8::new(0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF);
+ let c: i16x8 = i16x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let e: i16x8 = i16x8::new(-1, -1, -1, -1, -1, -1, -1, -1);
+ let r: i16x8 = transmute(vqrdmlshq_s16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmlsh_s32() {
+ let a: i32x2 = i32x2::new(1, 1);
+ let b: i32x2 = i32x2::new(0x7F_FF_FF_FF, 0x7F_FF_FF_FF);
+ let c: i32x2 = i32x2::new(2, 2);
+ let e: i32x2 = i32x2::new(-1, -1);
+ let r: i32x2 = transmute(vqrdmlsh_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmlshq_s32() {
+ let a: i32x4 = i32x4::new(1, 1, 1, 1);
+ let b: i32x4 = i32x4::new(0x7F_FF_FF_FF, 0x7F_FF_FF_FF, 0x7F_FF_FF_FF, 0x7F_FF_FF_FF);
+ let c: i32x4 = i32x4::new(2, 2, 2, 2);
+ let e: i32x4 = i32x4::new(-1, -1, -1, -1);
+ let r: i32x4 = transmute(vqrdmlshq_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmlshh_s16() {
+ let a: i16 = 1;
+ let b: i16 = 1;
+ let c: i16 = 2;
+ let e: i16 = 1;
+ let r: i16 = transmute(vqrdmlshh_s16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmlshs_s32() {
+ let a: i32 = 1;
+ let b: i32 = 1;
+ let c: i32 = 2;
+ let e: i32 = 1;
+ let r: i32 = transmute(vqrdmlshs_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmlsh_lane_s16() {
+ let a: i16x4 = i16x4::new(1, 1, 1, 1);
+ let b: i16x4 = i16x4::new(0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF);
+ let c: i16x4 = i16x4::new(0, 2, 0, 0);
+ let e: i16x4 = i16x4::new(-1, -1, -1, -1);
+ let r: i16x4 = transmute(vqrdmlsh_lane_s16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmlsh_laneq_s16() {
+ let a: i16x4 = i16x4::new(1, 1, 1, 1);
+ let b: i16x4 = i16x4::new(0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF);
+ let c: i16x8 = i16x8::new(0, 2, 0, 0, 0, 0, 0, 0);
+ let e: i16x4 = i16x4::new(-1, -1, -1, -1);
+ let r: i16x4 = transmute(vqrdmlsh_laneq_s16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmlshq_lane_s16() {
+ let a: i16x8 = i16x8::new(1, 1, 1, 1, 1, 1, 1, 1);
+ let b: i16x8 = i16x8::new(0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF);
+ let c: i16x4 = i16x4::new(0, 2, 0, 0);
+ let e: i16x8 = i16x8::new(-1, -1, -1, -1, -1, -1, -1, -1);
+ let r: i16x8 = transmute(vqrdmlshq_lane_s16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmlshq_laneq_s16() {
+ let a: i16x8 = i16x8::new(1, 1, 1, 1, 1, 1, 1, 1);
+ let b: i16x8 = i16x8::new(0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF);
+ let c: i16x8 = i16x8::new(0, 2, 0, 0, 0, 0, 0, 0);
+ let e: i16x8 = i16x8::new(-1, -1, -1, -1, -1, -1, -1, -1);
+ let r: i16x8 = transmute(vqrdmlshq_laneq_s16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmlsh_lane_s32() {
+ let a: i32x2 = i32x2::new(1, 1);
+ let b: i32x2 = i32x2::new(0x7F_FF_FF_FF, 0x7F_FF_FF_FF);
+ let c: i32x2 = i32x2::new(0, 2);
+ let e: i32x2 = i32x2::new(-1, -1);
+ let r: i32x2 = transmute(vqrdmlsh_lane_s32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmlsh_laneq_s32() {
+ let a: i32x2 = i32x2::new(1, 1);
+ let b: i32x2 = i32x2::new(0x7F_FF_FF_FF, 0x7F_FF_FF_FF);
+ let c: i32x4 = i32x4::new(0, 2, 0, 0);
+ let e: i32x2 = i32x2::new(-1, -1);
+ let r: i32x2 = transmute(vqrdmlsh_laneq_s32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmlshq_lane_s32() {
+ let a: i32x4 = i32x4::new(1, 1, 1, 1);
+ let b: i32x4 = i32x4::new(0x7F_FF_FF_FF, 0x7F_FF_FF_FF, 0x7F_FF_FF_FF, 0x7F_FF_FF_FF);
+ let c: i32x2 = i32x2::new(0, 2);
+ let e: i32x4 = i32x4::new(-1, -1, -1, -1);
+ let r: i32x4 = transmute(vqrdmlshq_lane_s32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmlshq_laneq_s32() {
+ let a: i32x4 = i32x4::new(1, 1, 1, 1);
+ let b: i32x4 = i32x4::new(0x7F_FF_FF_FF, 0x7F_FF_FF_FF, 0x7F_FF_FF_FF, 0x7F_FF_FF_FF);
+ let c: i32x4 = i32x4::new(0, 2, 0, 0);
+ let e: i32x4 = i32x4::new(-1, -1, -1, -1);
+ let r: i32x4 = transmute(vqrdmlshq_laneq_s32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmlshh_lane_s16() {
+ let a: i16 = 1;
+ let b: i16 = 1;
+ let c: i16x4 = i16x4::new(0, 2, 0, 0);
+ let e: i16 = 1;
+ let r: i16 = transmute(vqrdmlshh_lane_s16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmlshh_laneq_s16() {
+ let a: i16 = 1;
+ let b: i16 = 1;
+ let c: i16x8 = i16x8::new(0, 2, 0, 0, 0, 0, 0, 0);
+ let e: i16 = 1;
+ let r: i16 = transmute(vqrdmlshh_laneq_s16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmlshs_lane_s32() {
+ let a: i32 = 1;
+ let b: i32 = 1;
+ let c: i32x2 = i32x2::new(0, 2);
+ let e: i32 = 1;
+ let r: i32 = transmute(vqrdmlshs_lane_s32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmlshs_laneq_s32() {
+ let a: i32 = 1;
+ let b: i32 = 1;
+ let c: i32x4 = i32x4::new(0, 2, 0, 0);
+ let e: i32 = 1;
+ let r: i32 = transmute(vqrdmlshs_laneq_s32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshls_s32() {
+ let a: i32 = 2;
+ let b: i32 = 2;
+ let e: i32 = 8;
+ let r: i32 = transmute(vqrshls_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshld_s64() {
+ let a: i64 = 2;
+ let b: i64 = 2;
+ let e: i64 = 8;
+ let r: i64 = transmute(vqrshld_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshlb_s8() {
+ let a: i8 = 1;
+ let b: i8 = 2;
+ let e: i8 = 4;
+ let r: i8 = transmute(vqrshlb_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshlh_s16() {
+ let a: i16 = 1;
+ let b: i16 = 2;
+ let e: i16 = 4;
+ let r: i16 = transmute(vqrshlh_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshls_u32() {
+ let a: u32 = 2;
+ let b: i32 = 2;
+ let e: u32 = 8;
+ let r: u32 = transmute(vqrshls_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshld_u64() {
+ let a: u64 = 2;
+ let b: i64 = 2;
+ let e: u64 = 8;
+ let r: u64 = transmute(vqrshld_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshlb_u8() {
+ let a: u8 = 1;
+ let b: i8 = 2;
+ let e: u8 = 4;
+ let r: u8 = transmute(vqrshlb_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshlh_u16() {
+ let a: u16 = 1;
+ let b: i16 = 2;
+ let e: u16 = 4;
+ let r: u16 = transmute(vqrshlh_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshrnh_n_s16() {
+ let a: i16 = 4;
+ let e: i8 = 1;
+ let r: i8 = transmute(vqrshrnh_n_s16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshrns_n_s32() {
+ let a: i32 = 4;
+ let e: i16 = 1;
+ let r: i16 = transmute(vqrshrns_n_s32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshrnd_n_s64() {
+ let a: i64 = 4;
+ let e: i32 = 1;
+ let r: i32 = transmute(vqrshrnd_n_s64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshrn_high_n_s16() {
+ let a: i8x8 = i8x8::new(0, 1, 2, 3, 2, 3, 6, 7);
+ let b: i16x8 = i16x8::new(8, 12, 24, 28, 48, 52, 56, 60);
+ let e: i8x16 = i8x16::new(0, 1, 2, 3, 2, 3, 6, 7, 2, 3, 6, 7, 12, 13, 14, 15);
+ let r: i8x16 = transmute(vqrshrn_high_n_s16::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshrn_high_n_s32() {
+ let a: i16x4 = i16x4::new(0, 1, 2, 3);
+ let b: i32x4 = i32x4::new(8, 12, 24, 28);
+ let e: i16x8 = i16x8::new(0, 1, 2, 3, 2, 3, 6, 7);
+ let r: i16x8 = transmute(vqrshrn_high_n_s32::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshrn_high_n_s64() {
+ let a: i32x2 = i32x2::new(0, 1);
+ let b: i64x2 = i64x2::new(8, 12);
+ let e: i32x4 = i32x4::new(0, 1, 2, 3);
+ let r: i32x4 = transmute(vqrshrn_high_n_s64::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshrnh_n_u16() {
+ let a: u16 = 4;
+ let e: u8 = 1;
+ let r: u8 = transmute(vqrshrnh_n_u16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshrns_n_u32() {
+ let a: u32 = 4;
+ let e: u16 = 1;
+ let r: u16 = transmute(vqrshrns_n_u32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshrnd_n_u64() {
+ let a: u64 = 4;
+ let e: u32 = 1;
+ let r: u32 = transmute(vqrshrnd_n_u64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshrn_high_n_u16() {
+ let a: u8x8 = u8x8::new(0, 1, 2, 3, 2, 3, 6, 7);
+ let b: u16x8 = u16x8::new(8, 12, 24, 28, 48, 52, 56, 60);
+ let e: u8x16 = u8x16::new(0, 1, 2, 3, 2, 3, 6, 7, 2, 3, 6, 7, 12, 13, 14, 15);
+ let r: u8x16 = transmute(vqrshrn_high_n_u16::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshrn_high_n_u32() {
+ let a: u16x4 = u16x4::new(0, 1, 2, 3);
+ let b: u32x4 = u32x4::new(8, 12, 24, 28);
+ let e: u16x8 = u16x8::new(0, 1, 2, 3, 2, 3, 6, 7);
+ let r: u16x8 = transmute(vqrshrn_high_n_u32::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshrn_high_n_u64() {
+ let a: u32x2 = u32x2::new(0, 1);
+ let b: u64x2 = u64x2::new(8, 12);
+ let e: u32x4 = u32x4::new(0, 1, 2, 3);
+ let r: u32x4 = transmute(vqrshrn_high_n_u64::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshrunh_n_s16() {
+ let a: i16 = 4;
+ let e: u8 = 1;
+ let r: u8 = transmute(vqrshrunh_n_s16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshruns_n_s32() {
+ let a: i32 = 4;
+ let e: u16 = 1;
+ let r: u16 = transmute(vqrshruns_n_s32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshrund_n_s64() {
+ let a: i64 = 4;
+ let e: u32 = 1;
+ let r: u32 = transmute(vqrshrund_n_s64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshrun_high_n_s16() {
+ let a: u8x8 = u8x8::new(0, 1, 2, 3, 2, 3, 6, 7);
+ let b: i16x8 = i16x8::new(8, 12, 24, 28, 48, 52, 56, 60);
+ let e: u8x16 = u8x16::new(0, 1, 2, 3, 2, 3, 6, 7, 2, 3, 6, 7, 12, 13, 14, 15);
+ let r: u8x16 = transmute(vqrshrun_high_n_s16::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshrun_high_n_s32() {
+ let a: u16x4 = u16x4::new(0, 1, 2, 3);
+ let b: i32x4 = i32x4::new(8, 12, 24, 28);
+ let e: u16x8 = u16x8::new(0, 1, 2, 3, 2, 3, 6, 7);
+ let r: u16x8 = transmute(vqrshrun_high_n_s32::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshrun_high_n_s64() {
+ let a: u32x2 = u32x2::new(0, 1);
+ let b: i64x2 = i64x2::new(8, 12);
+ let e: u32x4 = u32x4::new(0, 1, 2, 3);
+ let r: u32x4 = transmute(vqrshrun_high_n_s64::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshld_s64() {
+ let a: i64 = 0;
+ let b: i64 = 2;
+ let e: i64 = 0;
+ let r: i64 = transmute(vqshld_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshlb_s8() {
+ let a: i8 = 1;
+ let b: i8 = 2;
+ let e: i8 = 4;
+ let r: i8 = transmute(vqshlb_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshlh_s16() {
+ let a: i16 = 1;
+ let b: i16 = 2;
+ let e: i16 = 4;
+ let r: i16 = transmute(vqshlh_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshls_s32() {
+ let a: i32 = 1;
+ let b: i32 = 2;
+ let e: i32 = 4;
+ let r: i32 = transmute(vqshls_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshld_u64() {
+ let a: u64 = 0;
+ let b: i64 = 2;
+ let e: u64 = 0;
+ let r: u64 = transmute(vqshld_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshlb_u8() {
+ let a: u8 = 1;
+ let b: i8 = 2;
+ let e: u8 = 4;
+ let r: u8 = transmute(vqshlb_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshlh_u16() {
+ let a: u16 = 1;
+ let b: i16 = 2;
+ let e: u16 = 4;
+ let r: u16 = transmute(vqshlh_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshls_u32() {
+ let a: u32 = 1;
+ let b: i32 = 2;
+ let e: u32 = 4;
+ let r: u32 = transmute(vqshls_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshlb_n_s8() {
+ let a: i8 = 1;
+ let e: i8 = 4;
+ let r: i8 = transmute(vqshlb_n_s8::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshlh_n_s16() {
+ let a: i16 = 1;
+ let e: i16 = 4;
+ let r: i16 = transmute(vqshlh_n_s16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshls_n_s32() {
+ let a: i32 = 1;
+ let e: i32 = 4;
+ let r: i32 = transmute(vqshls_n_s32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshld_n_s64() {
+ let a: i64 = 1;
+ let e: i64 = 4;
+ let r: i64 = transmute(vqshld_n_s64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshlb_n_u8() {
+ let a: u8 = 1;
+ let e: u8 = 4;
+ let r: u8 = transmute(vqshlb_n_u8::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshlh_n_u16() {
+ let a: u16 = 1;
+ let e: u16 = 4;
+ let r: u16 = transmute(vqshlh_n_u16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshls_n_u32() {
+ let a: u32 = 1;
+ let e: u32 = 4;
+ let r: u32 = transmute(vqshls_n_u32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshld_n_u64() {
+ let a: u64 = 1;
+ let e: u64 = 4;
+ let r: u64 = transmute(vqshld_n_u64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshlub_n_s8() {
+ let a: i8 = 1;
+ let e: u8 = 4;
+ let r: u8 = transmute(vqshlub_n_s8::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshluh_n_s16() {
+ let a: i16 = 1;
+ let e: u16 = 4;
+ let r: u16 = transmute(vqshluh_n_s16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshlus_n_s32() {
+ let a: i32 = 1;
+ let e: u32 = 4;
+ let r: u32 = transmute(vqshlus_n_s32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshlud_n_s64() {
+ let a: i64 = 1;
+ let e: u64 = 4;
+ let r: u64 = transmute(vqshlud_n_s64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshrnd_n_s64() {
+ let a: i64 = 0;
+ let e: i32 = 0;
+ let r: i32 = transmute(vqshrnd_n_s64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshrnh_n_s16() {
+ let a: i16 = 4;
+ let e: i8 = 1;
+ let r: i8 = transmute(vqshrnh_n_s16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshrns_n_s32() {
+ let a: i32 = 4;
+ let e: i16 = 1;
+ let r: i16 = transmute(vqshrns_n_s32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshrn_high_n_s16() {
+ let a: i8x8 = i8x8::new(0, 1, 8, 9, 8, 9, 10, 11);
+ let b: i16x8 = i16x8::new(32, 36, 40, 44, 48, 52, 56, 60);
+ let e: i8x16 = i8x16::new(0, 1, 8, 9, 8, 9, 10, 11, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r: i8x16 = transmute(vqshrn_high_n_s16::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshrn_high_n_s32() {
+ let a: i16x4 = i16x4::new(0, 1, 8, 9);
+ let b: i32x4 = i32x4::new(32, 36, 40, 44);
+ let e: i16x8 = i16x8::new(0, 1, 8, 9, 8, 9, 10, 11);
+ let r: i16x8 = transmute(vqshrn_high_n_s32::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshrn_high_n_s64() {
+ let a: i32x2 = i32x2::new(0, 1);
+ let b: i64x2 = i64x2::new(32, 36);
+ let e: i32x4 = i32x4::new(0, 1, 8, 9);
+ let r: i32x4 = transmute(vqshrn_high_n_s64::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshrnd_n_u64() {
+ let a: u64 = 0;
+ let e: u32 = 0;
+ let r: u32 = transmute(vqshrnd_n_u64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshrnh_n_u16() {
+ let a: u16 = 4;
+ let e: u8 = 1;
+ let r: u8 = transmute(vqshrnh_n_u16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshrns_n_u32() {
+ let a: u32 = 4;
+ let e: u16 = 1;
+ let r: u16 = transmute(vqshrns_n_u32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshrn_high_n_u16() {
+ let a: u8x8 = u8x8::new(0, 1, 8, 9, 8, 9, 10, 11);
+ let b: u16x8 = u16x8::new(32, 36, 40, 44, 48, 52, 56, 60);
+ let e: u8x16 = u8x16::new(0, 1, 8, 9, 8, 9, 10, 11, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r: u8x16 = transmute(vqshrn_high_n_u16::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshrn_high_n_u32() {
+ let a: u16x4 = u16x4::new(0, 1, 8, 9);
+ let b: u32x4 = u32x4::new(32, 36, 40, 44);
+ let e: u16x8 = u16x8::new(0, 1, 8, 9, 8, 9, 10, 11);
+ let r: u16x8 = transmute(vqshrn_high_n_u32::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshrn_high_n_u64() {
+ let a: u32x2 = u32x2::new(0, 1);
+ let b: u64x2 = u64x2::new(32, 36);
+ let e: u32x4 = u32x4::new(0, 1, 8, 9);
+ let r: u32x4 = transmute(vqshrn_high_n_u64::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshrunh_n_s16() {
+ let a: i16 = 4;
+ let e: u8 = 1;
+ let r: u8 = transmute(vqshrunh_n_s16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshruns_n_s32() {
+ let a: i32 = 4;
+ let e: u16 = 1;
+ let r: u16 = transmute(vqshruns_n_s32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshrund_n_s64() {
+ let a: i64 = 4;
+ let e: u32 = 1;
+ let r: u32 = transmute(vqshrund_n_s64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshrun_high_n_s16() {
+ let a: u8x8 = u8x8::new(0, 1, 8, 9, 8, 9, 10, 11);
+ let b: i16x8 = i16x8::new(32, 36, 40, 44, 48, 52, 56, 60);
+ let e: u8x16 = u8x16::new(0, 1, 8, 9, 8, 9, 10, 11, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r: u8x16 = transmute(vqshrun_high_n_s16::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshrun_high_n_s32() {
+ let a: u16x4 = u16x4::new(0, 1, 8, 9);
+ let b: i32x4 = i32x4::new(32, 36, 40, 44);
+ let e: u16x8 = u16x8::new(0, 1, 8, 9, 8, 9, 10, 11);
+ let r: u16x8 = transmute(vqshrun_high_n_s32::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshrun_high_n_s64() {
+ let a: u32x2 = u32x2::new(0, 1);
+ let b: i64x2 = i64x2::new(32, 36);
+ let e: u32x4 = u32x4::new(0, 1, 8, 9);
+ let r: u32x4 = transmute(vqshrun_high_n_s64::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsqaddb_u8() {
+ let a: u8 = 2;
+ let b: i8 = 2;
+ let e: u8 = 4;
+ let r: u8 = transmute(vsqaddb_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsqaddh_u16() {
+ let a: u16 = 2;
+ let b: i16 = 2;
+ let e: u16 = 4;
+ let r: u16 = transmute(vsqaddh_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsqadds_u32() {
+ let a: u32 = 2;
+ let b: i32 = 2;
+ let e: u32 = 4;
+ let r: u32 = transmute(vsqadds_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsqaddd_u64() {
+ let a: u64 = 2;
+ let b: i64 = 2;
+ let e: u64 = 4;
+ let r: u64 = transmute(vsqaddd_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsqrt_f32() {
+ let a: f32x2 = f32x2::new(4.0, 9.0);
+ let e: f32x2 = f32x2::new(2.0, 3.0);
+ let r: f32x2 = transmute(vsqrt_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsqrtq_f32() {
+ let a: f32x4 = f32x4::new(4.0, 9.0, 16.0, 25.0);
+ let e: f32x4 = f32x4::new(2.0, 3.0, 4.0, 5.0);
+ let r: f32x4 = transmute(vsqrtq_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsqrt_f64() {
+ let a: f64 = 4.0;
+ let e: f64 = 2.0;
+ let r: f64 = transmute(vsqrt_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsqrtq_f64() {
+ let a: f64x2 = f64x2::new(4.0, 9.0);
+ let e: f64x2 = f64x2::new(2.0, 3.0);
+ let r: f64x2 = transmute(vsqrtq_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsqrte_f64() {
+ let a: f64 = 1.0;
+ let e: f64 = 0.998046875;
+ let r: f64 = transmute(vrsqrte_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsqrteq_f64() {
+ let a: f64x2 = f64x2::new(1.0, 2.0);
+ let e: f64x2 = f64x2::new(0.998046875, 0.705078125);
+ let r: f64x2 = transmute(vrsqrteq_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsqrtes_f32() {
+ let a: f32 = 1.0;
+ let e: f32 = 0.998046875;
+ let r: f32 = transmute(vrsqrtes_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsqrted_f64() {
+ let a: f64 = 1.0;
+ let e: f64 = 0.998046875;
+ let r: f64 = transmute(vrsqrted_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsqrts_f64() {
+ let a: f64 = 1.0;
+ let b: f64 = 1.0;
+ let e: f64 = 1.;
+ let r: f64 = transmute(vrsqrts_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsqrtsq_f64() {
+ let a: f64x2 = f64x2::new(1.0, 2.0);
+ let b: f64x2 = f64x2::new(1.0, 2.0);
+ let e: f64x2 = f64x2::new(1., -0.5);
+ let r: f64x2 = transmute(vrsqrtsq_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsqrtss_f32() {
+ let a: f32 = 1.0;
+ let b: f32 = 1.0;
+ let e: f32 = 1.;
+ let r: f32 = transmute(vrsqrtss_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsqrtsd_f64() {
+ let a: f64 = 1.0;
+ let b: f64 = 1.0;
+ let e: f64 = 1.;
+ let r: f64 = transmute(vrsqrtsd_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrecpe_f64() {
+ let a: f64 = 4.0;
+ let e: f64 = 0.24951171875;
+ let r: f64 = transmute(vrecpe_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrecpeq_f64() {
+ let a: f64x2 = f64x2::new(4.0, 3.0);
+ let e: f64x2 = f64x2::new(0.24951171875, 0.3330078125);
+ let r: f64x2 = transmute(vrecpeq_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrecpes_f32() {
+ let a: f32 = 4.0;
+ let e: f32 = 0.24951171875;
+ let r: f32 = transmute(vrecpes_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrecped_f64() {
+ let a: f64 = 4.0;
+ let e: f64 = 0.24951171875;
+ let r: f64 = transmute(vrecped_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrecps_f64() {
+ let a: f64 = 4.0;
+ let b: f64 = 4.0;
+ let e: f64 = -14.;
+ let r: f64 = transmute(vrecps_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrecpsq_f64() {
+ let a: f64x2 = f64x2::new(4.0, 3.0);
+ let b: f64x2 = f64x2::new(4.0, 3.0);
+ let e: f64x2 = f64x2::new(-14., -7.);
+ let r: f64x2 = transmute(vrecpsq_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrecpss_f32() {
+ let a: f32 = 4.0;
+ let b: f32 = 4.0;
+ let e: f32 = -14.;
+ let r: f32 = transmute(vrecpss_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrecpsd_f64() {
+ let a: f64 = 4.0;
+ let b: f64 = 4.0;
+ let e: f64 = -14.;
+ let r: f64 = transmute(vrecpsd_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrecpxs_f32() {
+ let a: f32 = 4.0;
+ let e: f32 = 0.5;
+ let r: f32 = transmute(vrecpxs_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrecpxd_f64() {
+ let a: f64 = 4.0;
+ let e: f64 = 0.5;
+ let r: f64 = transmute(vrecpxd_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s64_p64() {
+ let a: i64x1 = i64x1::new(0);
+ let e: i64x1 = i64x1::new(0);
+ let r: i64x1 = transmute(vreinterpret_s64_p64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u64_p64() {
+ let a: i64x1 = i64x1::new(0);
+ let e: u64x1 = u64x1::new(0);
+ let r: u64x1 = transmute(vreinterpret_u64_p64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_p64_s64() {
+ let a: i64x1 = i64x1::new(0);
+ let e: i64x1 = i64x1::new(0);
+ let r: i64x1 = transmute(vreinterpret_p64_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_p64_u64() {
+ let a: u64x1 = u64x1::new(0);
+ let e: i64x1 = i64x1::new(0);
+ let r: i64x1 = transmute(vreinterpret_p64_u64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s64_p64() {
+ let a: i64x2 = i64x2::new(0, 1);
+ let e: i64x2 = i64x2::new(0, 1);
+ let r: i64x2 = transmute(vreinterpretq_s64_p64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u64_p64() {
+ let a: i64x2 = i64x2::new(0, 1);
+ let e: u64x2 = u64x2::new(0, 1);
+ let r: u64x2 = transmute(vreinterpretq_u64_p64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p64_s64() {
+ let a: i64x2 = i64x2::new(0, 1);
+ let e: i64x2 = i64x2::new(0, 1);
+ let r: i64x2 = transmute(vreinterpretq_p64_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p64_u64() {
+ let a: u64x2 = u64x2::new(0, 1);
+ let e: i64x2 = i64x2::new(0, 1);
+ let r: i64x2 = transmute(vreinterpretq_p64_u64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s8_f64() {
+ let a: f64 = 0.;
+ let e: i8x8 = i8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let r: i8x8 = transmute(vreinterpret_s8_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s16_f64() {
+ let a: f64 = 0.;
+ let e: i16x4 = i16x4::new(0, 0, 0, 0);
+ let r: i16x4 = transmute(vreinterpret_s16_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s32_f64() {
+ let a: f64 = 0.;
+ let e: i32x2 = i32x2::new(0, 0);
+ let r: i32x2 = transmute(vreinterpret_s32_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s64_f64() {
+ let a: f64 = 0.;
+ let e: i64x1 = i64x1::new(0);
+ let r: i64x1 = transmute(vreinterpret_s64_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s8_f64() {
+ let a: f64x2 = f64x2::new(0., 0.);
+ let e: i8x16 = i8x16::new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ let r: i8x16 = transmute(vreinterpretq_s8_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s16_f64() {
+ let a: f64x2 = f64x2::new(0., 0.);
+ let e: i16x8 = i16x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let r: i16x8 = transmute(vreinterpretq_s16_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s32_f64() {
+ let a: f64x2 = f64x2::new(0., 0.);
+ let e: i32x4 = i32x4::new(0, 0, 0, 0);
+ let r: i32x4 = transmute(vreinterpretq_s32_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s64_f64() {
+ let a: f64x2 = f64x2::new(0., 0.);
+ let e: i64x2 = i64x2::new(0, 0);
+ let r: i64x2 = transmute(vreinterpretq_s64_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u8_f64() {
+ let a: f64 = 0.;
+ let e: u8x8 = u8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let r: u8x8 = transmute(vreinterpret_u8_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u16_f64() {
+ let a: f64 = 0.;
+ let e: u16x4 = u16x4::new(0, 0, 0, 0);
+ let r: u16x4 = transmute(vreinterpret_u16_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u32_f64() {
+ let a: f64 = 0.;
+ let e: u32x2 = u32x2::new(0, 0);
+ let r: u32x2 = transmute(vreinterpret_u32_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u64_f64() {
+ let a: f64 = 0.;
+ let e: u64x1 = u64x1::new(0);
+ let r: u64x1 = transmute(vreinterpret_u64_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u8_f64() {
+ let a: f64x2 = f64x2::new(0., 0.);
+ let e: u8x16 = u8x16::new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ let r: u8x16 = transmute(vreinterpretq_u8_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u16_f64() {
+ let a: f64x2 = f64x2::new(0., 0.);
+ let e: u16x8 = u16x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let r: u16x8 = transmute(vreinterpretq_u16_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u32_f64() {
+ let a: f64x2 = f64x2::new(0., 0.);
+ let e: u32x4 = u32x4::new(0, 0, 0, 0);
+ let r: u32x4 = transmute(vreinterpretq_u32_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u64_f64() {
+ let a: f64x2 = f64x2::new(0., 0.);
+ let e: u64x2 = u64x2::new(0, 0);
+ let r: u64x2 = transmute(vreinterpretq_u64_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_p8_f64() {
+ let a: f64 = 0.;
+ let e: i8x8 = i8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let r: i8x8 = transmute(vreinterpret_p8_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_p16_f64() {
+ let a: f64 = 0.;
+ let e: i16x4 = i16x4::new(0, 0, 0, 0);
+ let r: i16x4 = transmute(vreinterpret_p16_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_p64_f32() {
+ let a: f32x2 = f32x2::new(0., 0.);
+ let e: i64x1 = i64x1::new(0);
+ let r: i64x1 = transmute(vreinterpret_p64_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_p64_f64() {
+ let a: f64 = 0.;
+ let e: i64x1 = i64x1::new(0);
+ let r: i64x1 = transmute(vreinterpret_p64_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p8_f64() {
+ let a: f64x2 = f64x2::new(0., 0.);
+ let e: i8x16 = i8x16::new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ let r: i8x16 = transmute(vreinterpretq_p8_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p16_f64() {
+ let a: f64x2 = f64x2::new(0., 0.);
+ let e: i16x8 = i16x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let r: i16x8 = transmute(vreinterpretq_p16_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p64_f32() {
+ let a: f32x4 = f32x4::new(0., 0., 0., 0.);
+ let e: i64x2 = i64x2::new(0, 0);
+ let r: i64x2 = transmute(vreinterpretq_p64_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p64_f64() {
+ let a: f64x2 = f64x2::new(0., 0.);
+ let e: i64x2 = i64x2::new(0, 0);
+ let r: i64x2 = transmute(vreinterpretq_p64_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p128_f64() {
+ let a: f64x2 = f64x2::new(0., 0.);
+ let e: p128 = 0;
+ let r: p128 = transmute(vreinterpretq_p128_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_f64_s8() {
+ let a: i8x8 = i8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let e: f64 = 0.;
+ let r: f64 = transmute(vreinterpret_f64_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_f64_s16() {
+ let a: i16x4 = i16x4::new(0, 0, 0, 0);
+ let e: f64 = 0.;
+ let r: f64 = transmute(vreinterpret_f64_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_f64_s32() {
+ let a: i32x2 = i32x2::new(0, 0);
+ let e: f64 = 0.;
+ let r: f64 = transmute(vreinterpret_f64_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_f64_s64() {
+ let a: i64x1 = i64x1::new(0);
+ let e: f64 = 0.;
+ let r: f64 = transmute(vreinterpret_f64_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_f64_s8() {
+ let a: i8x16 = i8x16::new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ let e: f64x2 = f64x2::new(0., 0.);
+ let r: f64x2 = transmute(vreinterpretq_f64_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_f64_s16() {
+ let a: i16x8 = i16x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let e: f64x2 = f64x2::new(0., 0.);
+ let r: f64x2 = transmute(vreinterpretq_f64_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_f64_s32() {
+ let a: i32x4 = i32x4::new(0, 0, 0, 0);
+ let e: f64x2 = f64x2::new(0., 0.);
+ let r: f64x2 = transmute(vreinterpretq_f64_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_f64_s64() {
+ let a: i64x2 = i64x2::new(0, 0);
+ let e: f64x2 = f64x2::new(0., 0.);
+ let r: f64x2 = transmute(vreinterpretq_f64_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_f64_p8() {
+ let a: i8x8 = i8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let e: f64 = 0.;
+ let r: f64 = transmute(vreinterpret_f64_p8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_f64_u16() {
+ let a: u16x4 = u16x4::new(0, 0, 0, 0);
+ let e: f64 = 0.;
+ let r: f64 = transmute(vreinterpret_f64_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_f64_u32() {
+ let a: u32x2 = u32x2::new(0, 0);
+ let e: f64 = 0.;
+ let r: f64 = transmute(vreinterpret_f64_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_f64_u64() {
+ let a: u64x1 = u64x1::new(0);
+ let e: f64 = 0.;
+ let r: f64 = transmute(vreinterpret_f64_u64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_f64_p8() {
+ let a: i8x16 = i8x16::new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ let e: f64x2 = f64x2::new(0., 0.);
+ let r: f64x2 = transmute(vreinterpretq_f64_p8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_f64_u16() {
+ let a: u16x8 = u16x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let e: f64x2 = f64x2::new(0., 0.);
+ let r: f64x2 = transmute(vreinterpretq_f64_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_f64_u32() {
+ let a: u32x4 = u32x4::new(0, 0, 0, 0);
+ let e: f64x2 = f64x2::new(0., 0.);
+ let r: f64x2 = transmute(vreinterpretq_f64_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_f64_u64() {
+ let a: u64x2 = u64x2::new(0, 0);
+ let e: f64x2 = f64x2::new(0., 0.);
+ let r: f64x2 = transmute(vreinterpretq_f64_u64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_f64_u8() {
+ let a: u8x8 = u8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let e: f64 = 0.;
+ let r: f64 = transmute(vreinterpret_f64_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_f64_p16() {
+ let a: i16x4 = i16x4::new(0, 0, 0, 0);
+ let e: f64 = 0.;
+ let r: f64 = transmute(vreinterpret_f64_p16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_f64_p64() {
+ let a: i64x1 = i64x1::new(0);
+ let e: f64 = 0.;
+ let r: f64 = transmute(vreinterpret_f64_p64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_f32_p64() {
+ let a: i64x1 = i64x1::new(0);
+ let e: f32x2 = f32x2::new(0., 0.);
+ let r: f32x2 = transmute(vreinterpret_f32_p64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_f64_u8() {
+ let a: u8x16 = u8x16::new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ let e: f64x2 = f64x2::new(0., 0.);
+ let r: f64x2 = transmute(vreinterpretq_f64_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_f64_p16() {
+ let a: i16x8 = i16x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let e: f64x2 = f64x2::new(0., 0.);
+ let r: f64x2 = transmute(vreinterpretq_f64_p16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_f64_p64() {
+ let a: i64x2 = i64x2::new(0, 0);
+ let e: f64x2 = f64x2::new(0., 0.);
+ let r: f64x2 = transmute(vreinterpretq_f64_p64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_f32_p64() {
+ let a: i64x2 = i64x2::new(0, 0);
+ let e: f32x4 = f32x4::new(0., 0., 0., 0.);
+ let r: f32x4 = transmute(vreinterpretq_f32_p64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_f64_p128() {
+ let a: p128 = 0;
+ let e: f64x2 = f64x2::new(0., 0.);
+ let r: f64x2 = transmute(vreinterpretq_f64_p128(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_f64_f32() {
+ let a: f32x2 = f32x2::new(0., 0.);
+ let e: f64 = 0.;
+ let r: f64 = transmute(vreinterpret_f64_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_f32_f64() {
+ let a: f64 = 0.;
+ let e: f32x2 = f32x2::new(0., 0.);
+ let r: f32x2 = transmute(vreinterpret_f32_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_f64_f32() {
+ let a: f32x4 = f32x4::new(0., 0., 0., 0.);
+ let e: f64x2 = f64x2::new(0., 0.);
+ let r: f64x2 = transmute(vreinterpretq_f64_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_f32_f64() {
+ let a: f64x2 = f64x2::new(0., 0.);
+ let e: f32x4 = f32x4::new(0., 0., 0., 0.);
+ let r: f32x4 = transmute(vreinterpretq_f32_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshld_s64() {
+ let a: i64 = 1;
+ let b: i64 = 2;
+ let e: i64 = 4;
+ let r: i64 = transmute(vrshld_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshld_u64() {
+ let a: u64 = 1;
+ let b: i64 = 2;
+ let e: u64 = 4;
+ let r: u64 = transmute(vrshld_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshrd_n_s64() {
+ let a: i64 = 4;
+ let e: i64 = 1;
+ let r: i64 = transmute(vrshrd_n_s64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshrd_n_u64() {
+ let a: u64 = 4;
+ let e: u64 = 1;
+ let r: u64 = transmute(vrshrd_n_u64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshrn_high_n_s16() {
+ let a: i8x8 = i8x8::new(0, 1, 8, 9, 8, 9, 10, 11);
+ let b: i16x8 = i16x8::new(32, 36, 40, 44, 48, 52, 56, 60);
+ let e: i8x16 = i8x16::new(0, 1, 8, 9, 8, 9, 10, 11, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r: i8x16 = transmute(vrshrn_high_n_s16::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshrn_high_n_s32() {
+ let a: i16x4 = i16x4::new(0, 1, 8, 9);
+ let b: i32x4 = i32x4::new(32, 36, 40, 44);
+ let e: i16x8 = i16x8::new(0, 1, 8, 9, 8, 9, 10, 11);
+ let r: i16x8 = transmute(vrshrn_high_n_s32::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshrn_high_n_s64() {
+ let a: i32x2 = i32x2::new(0, 1);
+ let b: i64x2 = i64x2::new(32, 36);
+ let e: i32x4 = i32x4::new(0, 1, 8, 9);
+ let r: i32x4 = transmute(vrshrn_high_n_s64::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshrn_high_n_u16() {
+ let a: u8x8 = u8x8::new(0, 1, 8, 9, 8, 9, 10, 11);
+ let b: u16x8 = u16x8::new(32, 36, 40, 44, 48, 52, 56, 60);
+ let e: u8x16 = u8x16::new(0, 1, 8, 9, 8, 9, 10, 11, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r: u8x16 = transmute(vrshrn_high_n_u16::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshrn_high_n_u32() {
+ let a: u16x4 = u16x4::new(0, 1, 8, 9);
+ let b: u32x4 = u32x4::new(32, 36, 40, 44);
+ let e: u16x8 = u16x8::new(0, 1, 8, 9, 8, 9, 10, 11);
+ let r: u16x8 = transmute(vrshrn_high_n_u32::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshrn_high_n_u64() {
+ let a: u32x2 = u32x2::new(0, 1);
+ let b: u64x2 = u64x2::new(32, 36);
+ let e: u32x4 = u32x4::new(0, 1, 8, 9);
+ let r: u32x4 = transmute(vrshrn_high_n_u64::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsrad_n_s64() {
+ let a: i64 = 1;
+ let b: i64 = 4;
+ let e: i64 = 2;
+ let r: i64 = transmute(vrsrad_n_s64::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsrad_n_u64() {
+ let a: u64 = 1;
+ let b: u64 = 4;
+ let e: u64 = 2;
+ let r: u64 = transmute(vrsrad_n_u64::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsubhn_high_s16() {
+ let a: i8x8 = i8x8::new(1, 2, 0, 0, 0, 0, 0, 0);
+ let b: i16x8 = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let c: i16x8 = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: i8x16 = i8x16::new(1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ let r: i8x16 = transmute(vrsubhn_high_s16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsubhn_high_s32() {
+ let a: i16x4 = i16x4::new(1, 2, 0, 0);
+ let b: i32x4 = i32x4::new(1, 2, 3, 4);
+ let c: i32x4 = i32x4::new(1, 2, 3, 4);
+ let e: i16x8 = i16x8::new(1, 2, 0, 0, 0, 0, 0, 0);
+ let r: i16x8 = transmute(vrsubhn_high_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsubhn_high_s64() {
+ let a: i32x2 = i32x2::new(1, 2);
+ let b: i64x2 = i64x2::new(1, 2);
+ let c: i64x2 = i64x2::new(1, 2);
+ let e: i32x4 = i32x4::new(1, 2, 0, 0);
+ let r: i32x4 = transmute(vrsubhn_high_s64(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsubhn_high_u16() {
+ let a: u8x8 = u8x8::new(1, 2, 0, 0, 0, 0, 0, 0);
+ let b: u16x8 = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let c: u16x8 = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: u8x16 = u8x16::new(1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ let r: u8x16 = transmute(vrsubhn_high_u16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsubhn_high_u32() {
+ let a: u16x4 = u16x4::new(1, 2, 0, 0);
+ let b: u32x4 = u32x4::new(1, 2, 3, 4);
+ let c: u32x4 = u32x4::new(1, 2, 3, 4);
+ let e: u16x8 = u16x8::new(1, 2, 0, 0, 0, 0, 0, 0);
+ let r: u16x8 = transmute(vrsubhn_high_u32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsubhn_high_u64() {
+ let a: u32x2 = u32x2::new(1, 2);
+ let b: u64x2 = u64x2::new(1, 2);
+ let c: u64x2 = u64x2::new(1, 2);
+ let e: u32x4 = u32x4::new(1, 2, 0, 0);
+ let r: u32x4 = transmute(vrsubhn_high_u64(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vset_lane_f64() {
+ let a: f64 = 1.;
+ let b: f64 = 0.;
+ let e: f64 = 1.;
+ let r: f64 = transmute(vset_lane_f64::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsetq_lane_f64() {
+ let a: f64 = 1.;
+ let b: f64x2 = f64x2::new(0., 2.);
+ let e: f64x2 = f64x2::new(1., 2.);
+ let r: f64x2 = transmute(vsetq_lane_f64::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshld_s64() {
+ let a: i64 = 1;
+ let b: i64 = 2;
+ let e: i64 = 4;
+ let r: i64 = transmute(vshld_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshld_u64() {
+ let a: u64 = 1;
+ let b: i64 = 2;
+ let e: u64 = 4;
+ let r: u64 = transmute(vshld_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshll_high_n_s8() {
+ let a: i8x16 = i8x16::new(0, 0, 1, 2, 1, 2, 3, 4, 1, 2, 3, 4, 5, 6, 7, 8);
+ let e: i16x8 = i16x8::new(4, 8, 12, 16, 20, 24, 28, 32);
+ let r: i16x8 = transmute(vshll_high_n_s8::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshll_high_n_s16() {
+ let a: i16x8 = i16x8::new(0, 0, 1, 2, 1, 2, 3, 4);
+ let e: i32x4 = i32x4::new(4, 8, 12, 16);
+ let r: i32x4 = transmute(vshll_high_n_s16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshll_high_n_s32() {
+ let a: i32x4 = i32x4::new(0, 0, 1, 2);
+ let e: i64x2 = i64x2::new(4, 8);
+ let r: i64x2 = transmute(vshll_high_n_s32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshll_high_n_u8() {
+ let a: u8x16 = u8x16::new(0, 0, 1, 2, 1, 2, 3, 4, 1, 2, 3, 4, 5, 6, 7, 8);
+ let e: u16x8 = u16x8::new(4, 8, 12, 16, 20, 24, 28, 32);
+ let r: u16x8 = transmute(vshll_high_n_u8::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshll_high_n_u16() {
+ let a: u16x8 = u16x8::new(0, 0, 1, 2, 1, 2, 3, 4);
+ let e: u32x4 = u32x4::new(4, 8, 12, 16);
+ let r: u32x4 = transmute(vshll_high_n_u16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshll_high_n_u32() {
+ let a: u32x4 = u32x4::new(0, 0, 1, 2);
+ let e: u64x2 = u64x2::new(4, 8);
+ let r: u64x2 = transmute(vshll_high_n_u32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshrn_high_n_s16() {
+ let a: i8x8 = i8x8::new(1, 2, 5, 6, 5, 6, 7, 8);
+ let b: i16x8 = i16x8::new(20, 24, 28, 32, 52, 56, 60, 64);
+ let e: i8x16 = i8x16::new(1, 2, 5, 6, 5, 6, 7, 8, 5, 6, 7, 8, 13, 14, 15, 16);
+ let r: i8x16 = transmute(vshrn_high_n_s16::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshrn_high_n_s32() {
+ let a: i16x4 = i16x4::new(1, 2, 5, 6);
+ let b: i32x4 = i32x4::new(20, 24, 28, 32);
+ let e: i16x8 = i16x8::new(1, 2, 5, 6, 5, 6, 7, 8);
+ let r: i16x8 = transmute(vshrn_high_n_s32::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshrn_high_n_s64() {
+ let a: i32x2 = i32x2::new(1, 2);
+ let b: i64x2 = i64x2::new(20, 24);
+ let e: i32x4 = i32x4::new(1, 2, 5, 6);
+ let r: i32x4 = transmute(vshrn_high_n_s64::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshrn_high_n_u16() {
+ let a: u8x8 = u8x8::new(1, 2, 5, 6, 5, 6, 7, 8);
+ let b: u16x8 = u16x8::new(20, 24, 28, 32, 52, 56, 60, 64);
+ let e: u8x16 = u8x16::new(1, 2, 5, 6, 5, 6, 7, 8, 5, 6, 7, 8, 13, 14, 15, 16);
+ let r: u8x16 = transmute(vshrn_high_n_u16::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshrn_high_n_u32() {
+ let a: u16x4 = u16x4::new(1, 2, 5, 6);
+ let b: u32x4 = u32x4::new(20, 24, 28, 32);
+ let e: u16x8 = u16x8::new(1, 2, 5, 6, 5, 6, 7, 8);
+ let r: u16x8 = transmute(vshrn_high_n_u32::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshrn_high_n_u64() {
+ let a: u32x2 = u32x2::new(1, 2);
+ let b: u64x2 = u64x2::new(20, 24);
+ let e: u32x4 = u32x4::new(1, 2, 5, 6);
+ let r: u32x4 = transmute(vshrn_high_n_u64::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon,sm4")]
+ unsafe fn test_vsm3partw1q_u32() {
+ let a: u32x4 = u32x4::new(1, 2, 3, 4);
+ let b: u32x4 = u32x4::new(1, 2, 3, 4);
+ let c: u32x4 = u32x4::new(1, 2, 3, 4);
+ let e: u32x4 = u32x4::new(2147549312, 3221323968, 131329, 2684362752);
+ let r: u32x4 = transmute(vsm3partw1q_u32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon,sm4")]
+ unsafe fn test_vsm3partw2q_u32() {
+ let a: u32x4 = u32x4::new(1, 2, 3, 4);
+ let b: u32x4 = u32x4::new(1, 2, 3, 4);
+ let c: u32x4 = u32x4::new(1, 2, 3, 4);
+ let e: u32x4 = u32x4::new(128, 256, 384, 1077977696);
+ let r: u32x4 = transmute(vsm3partw2q_u32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon,sm4")]
+ unsafe fn test_vsm3ss1q_u32() {
+ let a: u32x4 = u32x4::new(1, 2, 3, 4);
+ let b: u32x4 = u32x4::new(1, 2, 3, 4);
+ let c: u32x4 = u32x4::new(1, 2, 3, 4);
+ let e: u32x4 = u32x4::new(0, 0, 0, 2098176);
+ let r: u32x4 = transmute(vsm3ss1q_u32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon,sm4")]
+ unsafe fn test_vsm4ekeyq_u32() {
+ let a: u32x4 = u32x4::new(1, 2, 3, 4);
+ let b: u32x4 = u32x4::new(1, 2, 3, 4);
+ let e: u32x4 = u32x4::new(1784948604, 136020997, 2940231695, 3789947679);
+ let r: u32x4 = transmute(vsm4ekeyq_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon,sm4")]
+ unsafe fn test_vsm4eq_u32() {
+ let a: u32x4 = u32x4::new(1, 2, 3, 4);
+ let b: u32x4 = u32x4::new(1, 2, 3, 4);
+ let e: u32x4 = u32x4::new(1093874472, 3616769504, 3878330411, 2765298765);
+ let r: u32x4 = transmute(vsm4eq_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon,sha3")]
+ unsafe fn test_vrax1q_u64() {
+ let a: u64x2 = u64x2::new(1, 2);
+ let b: u64x2 = u64x2::new(3, 4);
+ let e: u64x2 = u64x2::new(7, 10);
+ let r: u64x2 = transmute(vrax1q_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon,sha3")]
+ unsafe fn test_vsha512hq_u64() {
+ let a: u64x2 = u64x2::new(1, 2);
+ let b: u64x2 = u64x2::new(3, 4);
+ let c: u64x2 = u64x2::new(5, 6);
+ let e: u64x2 = u64x2::new(11189044327219203, 7177611956453380);
+ let r: u64x2 = transmute(vsha512hq_u64(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon,sha3")]
+ unsafe fn test_vsha512h2q_u64() {
+ let a: u64x2 = u64x2::new(1, 2);
+ let b: u64x2 = u64x2::new(3, 4);
+ let c: u64x2 = u64x2::new(5, 6);
+ let e: u64x2 = u64x2::new(5770237651009406214, 349133864969);
+ let r: u64x2 = transmute(vsha512h2q_u64(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon,sha3")]
+ unsafe fn test_vsha512su0q_u64() {
+ let a: u64x2 = u64x2::new(1, 2);
+ let b: u64x2 = u64x2::new(3, 4);
+ let e: u64x2 = u64x2::new(144115188075855874, 9439544818968559619);
+ let r: u64x2 = transmute(vsha512su0q_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon,sha3")]
+ unsafe fn test_vsha512su1q_u64() {
+ let a: u64x2 = u64x2::new(1, 2);
+ let b: u64x2 = u64x2::new(3, 4);
+ let c: u64x2 = u64x2::new(5, 6);
+ let e: u64x2 = u64x2::new(105553116266526, 140737488355368);
+ let r: u64x2 = transmute(vsha512su1q_u64(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon,frintts")]
+ unsafe fn test_vrnd32x_f32() {
+ let a: f32x2 = f32x2::new(1.1, 1.9);
+ let e: f32x2 = f32x2::new(1.0, 2.0);
+ let r: f32x2 = transmute(vrnd32x_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon,frintts")]
+ unsafe fn test_vrnd32xq_f32() {
+ let a: f32x4 = f32x4::new(1.1, 1.9, -1.7, -2.3);
+ let e: f32x4 = f32x4::new(1.0, 2.0, -2.0, -2.0);
+ let r: f32x4 = transmute(vrnd32xq_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon,frintts")]
+ unsafe fn test_vrnd32z_f32() {
+ let a: f32x2 = f32x2::new(1.1, 1.9);
+ let e: f32x2 = f32x2::new(1.0, 1.0);
+ let r: f32x2 = transmute(vrnd32z_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon,frintts")]
+ unsafe fn test_vrnd32zq_f32() {
+ let a: f32x4 = f32x4::new(1.1, 1.9, -1.7, -2.3);
+ let e: f32x4 = f32x4::new(1.0, 1.0, -1.0, -2.0);
+ let r: f32x4 = transmute(vrnd32zq_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon,frintts")]
+ unsafe fn test_vrnd64x_f32() {
+ let a: f32x2 = f32x2::new(1.1, 1.9);
+ let e: f32x2 = f32x2::new(1.0, 2.0);
+ let r: f32x2 = transmute(vrnd64x_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon,frintts")]
+ unsafe fn test_vrnd64xq_f32() {
+ let a: f32x4 = f32x4::new(1.1, 1.9, -1.7, -2.3);
+ let e: f32x4 = f32x4::new(1.0, 2.0, -2.0, -2.0);
+ let r: f32x4 = transmute(vrnd64xq_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon,frintts")]
+ unsafe fn test_vrnd64z_f32() {
+ let a: f32x2 = f32x2::new(1.1, 1.9);
+ let e: f32x2 = f32x2::new(1.0, 1.0);
+ let r: f32x2 = transmute(vrnd64z_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon,frintts")]
+ unsafe fn test_vrnd64zq_f32() {
+ let a: f32x4 = f32x4::new(1.1, 1.9, -1.7, -2.3);
+ let e: f32x4 = f32x4::new(1.0, 1.0, -1.0, -2.0);
+ let r: f32x4 = transmute(vrnd64zq_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn1_s8() {
+ let a: i8x8 = i8x8::new(0, 2, 4, 6, 8, 10, 12, 14);
+ let b: i8x8 = i8x8::new(1, 3, 5, 7, 9, 11, 13, 15);
+ let e: i8x8 = i8x8::new(0, 1, 4, 5, 8, 9, 12, 13);
+ let r: i8x8 = transmute(vtrn1_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn1q_s8() {
+ let a: i8x16 = i8x16::new(0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30);
+ let b: i8x16 = i8x16::new(1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31);
+ let e: i8x16 = i8x16::new(0, 1, 4, 5, 8, 9, 12, 13, 16, 17, 20, 21, 24, 25, 28, 29);
+ let r: i8x16 = transmute(vtrn1q_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn1_s16() {
+ let a: i16x4 = i16x4::new(0, 2, 4, 6);
+ let b: i16x4 = i16x4::new(1, 3, 5, 7);
+ let e: i16x4 = i16x4::new(0, 1, 4, 5);
+ let r: i16x4 = transmute(vtrn1_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn1q_s16() {
+ let a: i16x8 = i16x8::new(0, 2, 4, 6, 8, 10, 12, 14);
+ let b: i16x8 = i16x8::new(1, 3, 5, 7, 9, 11, 13, 15);
+ let e: i16x8 = i16x8::new(0, 1, 4, 5, 8, 9, 12, 13);
+ let r: i16x8 = transmute(vtrn1q_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn1q_s32() {
+ let a: i32x4 = i32x4::new(0, 2, 4, 6);
+ let b: i32x4 = i32x4::new(1, 3, 5, 7);
+ let e: i32x4 = i32x4::new(0, 1, 4, 5);
+ let r: i32x4 = transmute(vtrn1q_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn1_u8() {
+ let a: u8x8 = u8x8::new(0, 2, 4, 6, 8, 10, 12, 14);
+ let b: u8x8 = u8x8::new(1, 3, 5, 7, 9, 11, 13, 15);
+ let e: u8x8 = u8x8::new(0, 1, 4, 5, 8, 9, 12, 13);
+ let r: u8x8 = transmute(vtrn1_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn1q_u8() {
+ let a: u8x16 = u8x16::new(0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30);
+ let b: u8x16 = u8x16::new(1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31);
+ let e: u8x16 = u8x16::new(0, 1, 4, 5, 8, 9, 12, 13, 16, 17, 20, 21, 24, 25, 28, 29);
+ let r: u8x16 = transmute(vtrn1q_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn1_u16() {
+ let a: u16x4 = u16x4::new(0, 2, 4, 6);
+ let b: u16x4 = u16x4::new(1, 3, 5, 7);
+ let e: u16x4 = u16x4::new(0, 1, 4, 5);
+ let r: u16x4 = transmute(vtrn1_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn1q_u16() {
+ let a: u16x8 = u16x8::new(0, 2, 4, 6, 8, 10, 12, 14);
+ let b: u16x8 = u16x8::new(1, 3, 5, 7, 9, 11, 13, 15);
+ let e: u16x8 = u16x8::new(0, 1, 4, 5, 8, 9, 12, 13);
+ let r: u16x8 = transmute(vtrn1q_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn1q_u32() {
+ let a: u32x4 = u32x4::new(0, 2, 4, 6);
+ let b: u32x4 = u32x4::new(1, 3, 5, 7);
+ let e: u32x4 = u32x4::new(0, 1, 4, 5);
+ let r: u32x4 = transmute(vtrn1q_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn1_p8() {
+ let a: i8x8 = i8x8::new(0, 2, 4, 6, 8, 10, 12, 14);
+ let b: i8x8 = i8x8::new(1, 3, 5, 7, 9, 11, 13, 15);
+ let e: i8x8 = i8x8::new(0, 1, 4, 5, 8, 9, 12, 13);
+ let r: i8x8 = transmute(vtrn1_p8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn1q_p8() {
+ let a: i8x16 = i8x16::new(0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30);
+ let b: i8x16 = i8x16::new(1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31);
+ let e: i8x16 = i8x16::new(0, 1, 4, 5, 8, 9, 12, 13, 16, 17, 20, 21, 24, 25, 28, 29);
+ let r: i8x16 = transmute(vtrn1q_p8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn1_p16() {
+ let a: i16x4 = i16x4::new(0, 2, 4, 6);
+ let b: i16x4 = i16x4::new(1, 3, 5, 7);
+ let e: i16x4 = i16x4::new(0, 1, 4, 5);
+ let r: i16x4 = transmute(vtrn1_p16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn1q_p16() {
+ let a: i16x8 = i16x8::new(0, 2, 4, 6, 8, 10, 12, 14);
+ let b: i16x8 = i16x8::new(1, 3, 5, 7, 9, 11, 13, 15);
+ let e: i16x8 = i16x8::new(0, 1, 4, 5, 8, 9, 12, 13);
+ let r: i16x8 = transmute(vtrn1q_p16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn1_s32() {
+ let a: i32x2 = i32x2::new(0, 2);
+ let b: i32x2 = i32x2::new(1, 3);
+ let e: i32x2 = i32x2::new(0, 1);
+ let r: i32x2 = transmute(vtrn1_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn1q_s64() {
+ let a: i64x2 = i64x2::new(0, 2);
+ let b: i64x2 = i64x2::new(1, 3);
+ let e: i64x2 = i64x2::new(0, 1);
+ let r: i64x2 = transmute(vtrn1q_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn1_u32() {
+ let a: u32x2 = u32x2::new(0, 2);
+ let b: u32x2 = u32x2::new(1, 3);
+ let e: u32x2 = u32x2::new(0, 1);
+ let r: u32x2 = transmute(vtrn1_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn1q_u64() {
+ let a: u64x2 = u64x2::new(0, 2);
+ let b: u64x2 = u64x2::new(1, 3);
+ let e: u64x2 = u64x2::new(0, 1);
+ let r: u64x2 = transmute(vtrn1q_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn1q_p64() {
+ let a: i64x2 = i64x2::new(0, 2);
+ let b: i64x2 = i64x2::new(1, 3);
+ let e: i64x2 = i64x2::new(0, 1);
+ let r: i64x2 = transmute(vtrn1q_p64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn1q_f32() {
+ let a: f32x4 = f32x4::new(0., 2., 4., 6.);
+ let b: f32x4 = f32x4::new(1., 3., 5., 7.);
+ let e: f32x4 = f32x4::new(0., 1., 4., 5.);
+ let r: f32x4 = transmute(vtrn1q_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn1_f32() {
+ let a: f32x2 = f32x2::new(0., 2.);
+ let b: f32x2 = f32x2::new(1., 3.);
+ let e: f32x2 = f32x2::new(0., 1.);
+ let r: f32x2 = transmute(vtrn1_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn1q_f64() {
+ let a: f64x2 = f64x2::new(0., 2.);
+ let b: f64x2 = f64x2::new(1., 3.);
+ let e: f64x2 = f64x2::new(0., 1.);
+ let r: f64x2 = transmute(vtrn1q_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn2_s8() {
+ let a: i8x8 = i8x8::new(0, 2, 4, 6, 8, 10, 12, 14);
+ let b: i8x8 = i8x8::new(1, 3, 5, 7, 9, 11, 13, 15);
+ let e: i8x8 = i8x8::new(2, 3, 6, 7, 10, 11, 14, 15);
+ let r: i8x8 = transmute(vtrn2_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn2q_s8() {
+ let a: i8x16 = i8x16::new(0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30);
+ let b: i8x16 = i8x16::new(1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31);
+ let e: i8x16 = i8x16::new(2, 3, 6, 7, 10, 11, 14, 15, 18, 19, 22, 23, 26, 27, 30, 31);
+ let r: i8x16 = transmute(vtrn2q_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn2_s16() {
+ let a: i16x4 = i16x4::new(0, 2, 4, 6);
+ let b: i16x4 = i16x4::new(1, 3, 5, 7);
+ let e: i16x4 = i16x4::new(2, 3, 6, 7);
+ let r: i16x4 = transmute(vtrn2_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn2q_s16() {
+ let a: i16x8 = i16x8::new(0, 2, 4, 6, 8, 10, 12, 14);
+ let b: i16x8 = i16x8::new(1, 3, 5, 7, 9, 11, 13, 15);
+ let e: i16x8 = i16x8::new(2, 3, 6, 7, 10, 11, 14, 15);
+ let r: i16x8 = transmute(vtrn2q_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn2q_s32() {
+ let a: i32x4 = i32x4::new(0, 2, 4, 6);
+ let b: i32x4 = i32x4::new(1, 3, 5, 7);
+ let e: i32x4 = i32x4::new(2, 3, 6, 7);
+ let r: i32x4 = transmute(vtrn2q_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn2_u8() {
+ let a: u8x8 = u8x8::new(0, 2, 4, 6, 8, 10, 12, 14);
+ let b: u8x8 = u8x8::new(1, 3, 5, 7, 9, 11, 13, 15);
+ let e: u8x8 = u8x8::new(2, 3, 6, 7, 10, 11, 14, 15);
+ let r: u8x8 = transmute(vtrn2_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn2q_u8() {
+ let a: u8x16 = u8x16::new(0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30);
+ let b: u8x16 = u8x16::new(1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31);
+ let e: u8x16 = u8x16::new(2, 3, 6, 7, 10, 11, 14, 15, 18, 19, 22, 23, 26, 27, 30, 31);
+ let r: u8x16 = transmute(vtrn2q_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn2_u16() {
+ let a: u16x4 = u16x4::new(0, 2, 4, 6);
+ let b: u16x4 = u16x4::new(1, 3, 5, 7);
+ let e: u16x4 = u16x4::new(2, 3, 6, 7);
+ let r: u16x4 = transmute(vtrn2_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn2q_u16() {
+ let a: u16x8 = u16x8::new(0, 2, 4, 6, 8, 10, 12, 14);
+ let b: u16x8 = u16x8::new(1, 3, 5, 7, 9, 11, 13, 15);
+ let e: u16x8 = u16x8::new(2, 3, 6, 7, 10, 11, 14, 15);
+ let r: u16x8 = transmute(vtrn2q_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn2q_u32() {
+ let a: u32x4 = u32x4::new(0, 2, 4, 6);
+ let b: u32x4 = u32x4::new(1, 3, 5, 7);
+ let e: u32x4 = u32x4::new(2, 3, 6, 7);
+ let r: u32x4 = transmute(vtrn2q_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn2_p8() {
+ let a: i8x8 = i8x8::new(0, 2, 4, 6, 8, 10, 12, 14);
+ let b: i8x8 = i8x8::new(1, 3, 5, 7, 9, 11, 13, 15);
+ let e: i8x8 = i8x8::new(2, 3, 6, 7, 10, 11, 14, 15);
+ let r: i8x8 = transmute(vtrn2_p8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn2q_p8() {
+ let a: i8x16 = i8x16::new(0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30);
+ let b: i8x16 = i8x16::new(1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31);
+ let e: i8x16 = i8x16::new(2, 3, 6, 7, 10, 11, 14, 15, 18, 19, 22, 23, 26, 27, 30, 31);
+ let r: i8x16 = transmute(vtrn2q_p8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn2_p16() {
+ let a: i16x4 = i16x4::new(0, 2, 4, 6);
+ let b: i16x4 = i16x4::new(1, 3, 5, 7);
+ let e: i16x4 = i16x4::new(2, 3, 6, 7);
+ let r: i16x4 = transmute(vtrn2_p16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn2q_p16() {
+ let a: i16x8 = i16x8::new(0, 2, 4, 6, 8, 10, 12, 14);
+ let b: i16x8 = i16x8::new(1, 3, 5, 7, 9, 11, 13, 15);
+ let e: i16x8 = i16x8::new(2, 3, 6, 7, 10, 11, 14, 15);
+ let r: i16x8 = transmute(vtrn2q_p16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn2_s32() {
+ let a: i32x2 = i32x2::new(0, 2);
+ let b: i32x2 = i32x2::new(1, 3);
+ let e: i32x2 = i32x2::new(2, 3);
+ let r: i32x2 = transmute(vtrn2_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn2q_s64() {
+ let a: i64x2 = i64x2::new(0, 2);
+ let b: i64x2 = i64x2::new(1, 3);
+ let e: i64x2 = i64x2::new(2, 3);
+ let r: i64x2 = transmute(vtrn2q_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn2_u32() {
+ let a: u32x2 = u32x2::new(0, 2);
+ let b: u32x2 = u32x2::new(1, 3);
+ let e: u32x2 = u32x2::new(2, 3);
+ let r: u32x2 = transmute(vtrn2_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn2q_u64() {
+ let a: u64x2 = u64x2::new(0, 2);
+ let b: u64x2 = u64x2::new(1, 3);
+ let e: u64x2 = u64x2::new(2, 3);
+ let r: u64x2 = transmute(vtrn2q_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn2q_p64() {
+ let a: i64x2 = i64x2::new(0, 2);
+ let b: i64x2 = i64x2::new(1, 3);
+ let e: i64x2 = i64x2::new(2, 3);
+ let r: i64x2 = transmute(vtrn2q_p64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn2q_f32() {
+ let a: f32x4 = f32x4::new(0., 2., 4., 6.);
+ let b: f32x4 = f32x4::new(1., 3., 5., 7.);
+ let e: f32x4 = f32x4::new(2., 3., 6., 7.);
+ let r: f32x4 = transmute(vtrn2q_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn2_f32() {
+ let a: f32x2 = f32x2::new(0., 2.);
+ let b: f32x2 = f32x2::new(1., 3.);
+ let e: f32x2 = f32x2::new(2., 3.);
+ let r: f32x2 = transmute(vtrn2_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn2q_f64() {
+ let a: f64x2 = f64x2::new(0., 2.);
+ let b: f64x2 = f64x2::new(1., 3.);
+ let e: f64x2 = f64x2::new(2., 3.);
+ let r: f64x2 = transmute(vtrn2q_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip1_s8() {
+ let a: i8x8 = i8x8::new(0, 2, 4, 6, 8, 10, 12, 14);
+ let b: i8x8 = i8x8::new(1, 3, 5, 7, 9, 11, 13, 15);
+ let e: i8x8 = i8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: i8x8 = transmute(vzip1_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip1q_s8() {
+ let a: i8x16 = i8x16::new(0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30);
+ let b: i8x16 = i8x16::new(1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31);
+ let e: i8x16 = i8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r: i8x16 = transmute(vzip1q_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip1_s16() {
+ let a: i16x4 = i16x4::new(0, 2, 4, 6);
+ let b: i16x4 = i16x4::new(1, 3, 5, 7);
+ let e: i16x4 = i16x4::new(0, 1, 2, 3);
+ let r: i16x4 = transmute(vzip1_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip1q_s16() {
+ let a: i16x8 = i16x8::new(0, 2, 4, 6, 8, 10, 12, 14);
+ let b: i16x8 = i16x8::new(1, 3, 5, 7, 9, 11, 13, 15);
+ let e: i16x8 = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: i16x8 = transmute(vzip1q_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip1_s32() {
+ let a: i32x2 = i32x2::new(0, 2);
+ let b: i32x2 = i32x2::new(1, 3);
+ let e: i32x2 = i32x2::new(0, 1);
+ let r: i32x2 = transmute(vzip1_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip1q_s32() {
+ let a: i32x4 = i32x4::new(0, 2, 4, 6);
+ let b: i32x4 = i32x4::new(1, 3, 5, 7);
+ let e: i32x4 = i32x4::new(0, 1, 2, 3);
+ let r: i32x4 = transmute(vzip1q_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip1q_s64() {
+ let a: i64x2 = i64x2::new(0, 2);
+ let b: i64x2 = i64x2::new(1, 3);
+ let e: i64x2 = i64x2::new(0, 1);
+ let r: i64x2 = transmute(vzip1q_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip1_u8() {
+ let a: u8x8 = u8x8::new(0, 2, 4, 6, 8, 10, 12, 14);
+ let b: u8x8 = u8x8::new(1, 3, 5, 7, 9, 11, 13, 15);
+ let e: u8x8 = u8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: u8x8 = transmute(vzip1_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip1q_u8() {
+ let a: u8x16 = u8x16::new(0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30);
+ let b: u8x16 = u8x16::new(1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31);
+ let e: u8x16 = u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r: u8x16 = transmute(vzip1q_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip1_u16() {
+ let a: u16x4 = u16x4::new(0, 2, 4, 6);
+ let b: u16x4 = u16x4::new(1, 3, 5, 7);
+ let e: u16x4 = u16x4::new(0, 1, 2, 3);
+ let r: u16x4 = transmute(vzip1_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip1q_u16() {
+ let a: u16x8 = u16x8::new(0, 2, 4, 6, 8, 10, 12, 14);
+ let b: u16x8 = u16x8::new(1, 3, 5, 7, 9, 11, 13, 15);
+ let e: u16x8 = u16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: u16x8 = transmute(vzip1q_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip1_u32() {
+ let a: u32x2 = u32x2::new(0, 2);
+ let b: u32x2 = u32x2::new(1, 3);
+ let e: u32x2 = u32x2::new(0, 1);
+ let r: u32x2 = transmute(vzip1_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip1q_u32() {
+ let a: u32x4 = u32x4::new(0, 2, 4, 6);
+ let b: u32x4 = u32x4::new(1, 3, 5, 7);
+ let e: u32x4 = u32x4::new(0, 1, 2, 3);
+ let r: u32x4 = transmute(vzip1q_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip1q_u64() {
+ let a: u64x2 = u64x2::new(0, 2);
+ let b: u64x2 = u64x2::new(1, 3);
+ let e: u64x2 = u64x2::new(0, 1);
+ let r: u64x2 = transmute(vzip1q_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip1_p8() {
+ let a: i8x8 = i8x8::new(0, 2, 4, 6, 8, 10, 12, 14);
+ let b: i8x8 = i8x8::new(1, 3, 5, 7, 9, 11, 13, 15);
+ let e: i8x8 = i8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: i8x8 = transmute(vzip1_p8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip1q_p8() {
+ let a: i8x16 = i8x16::new(0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30);
+ let b: i8x16 = i8x16::new(1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31);
+ let e: i8x16 = i8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r: i8x16 = transmute(vzip1q_p8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip1_p16() {
+ let a: i16x4 = i16x4::new(0, 2, 4, 6);
+ let b: i16x4 = i16x4::new(1, 3, 5, 7);
+ let e: i16x4 = i16x4::new(0, 1, 2, 3);
+ let r: i16x4 = transmute(vzip1_p16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip1q_p16() {
+ let a: i16x8 = i16x8::new(0, 2, 4, 6, 8, 10, 12, 14);
+ let b: i16x8 = i16x8::new(1, 3, 5, 7, 9, 11, 13, 15);
+ let e: i16x8 = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: i16x8 = transmute(vzip1q_p16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip1q_p64() {
+ let a: i64x2 = i64x2::new(0, 2);
+ let b: i64x2 = i64x2::new(1, 3);
+ let e: i64x2 = i64x2::new(0, 1);
+ let r: i64x2 = transmute(vzip1q_p64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip1_f32() {
+ let a: f32x2 = f32x2::new(0., 2.);
+ let b: f32x2 = f32x2::new(1., 3.);
+ let e: f32x2 = f32x2::new(0., 1.);
+ let r: f32x2 = transmute(vzip1_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip1q_f32() {
+ let a: f32x4 = f32x4::new(0., 2., 4., 6.);
+ let b: f32x4 = f32x4::new(1., 3., 5., 7.);
+ let e: f32x4 = f32x4::new(0., 1., 2., 3.);
+ let r: f32x4 = transmute(vzip1q_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip1q_f64() {
+ let a: f64x2 = f64x2::new(0., 2.);
+ let b: f64x2 = f64x2::new(1., 3.);
+ let e: f64x2 = f64x2::new(0., 1.);
+ let r: f64x2 = transmute(vzip1q_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip2_s8() {
+ let a: i8x8 = i8x8::new(0, 16, 16, 18, 16, 18, 20, 22);
+ let b: i8x8 = i8x8::new(1, 17, 17, 19, 17, 19, 21, 23);
+ let e: i8x8 = i8x8::new(16, 17, 18, 19, 20, 21, 22, 23);
+ let r: i8x8 = transmute(vzip2_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip2q_s8() {
+ let a: i8x16 = i8x16::new(0, 16, 16, 18, 16, 18, 20, 22, 16, 18, 20, 22, 24, 26, 28, 30);
+ let b: i8x16 = i8x16::new(1, 17, 17, 19, 17, 19, 21, 23, 17, 19, 21, 23, 25, 27, 29, 31);
+ let e: i8x16 = i8x16::new(16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31);
+ let r: i8x16 = transmute(vzip2q_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip2_s16() {
+ let a: i16x4 = i16x4::new(0, 16, 16, 18);
+ let b: i16x4 = i16x4::new(1, 17, 17, 19);
+ let e: i16x4 = i16x4::new(16, 17, 18, 19);
+ let r: i16x4 = transmute(vzip2_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip2q_s16() {
+ let a: i16x8 = i16x8::new(0, 16, 16, 18, 16, 18, 20, 22);
+ let b: i16x8 = i16x8::new(1, 17, 17, 19, 17, 19, 21, 23);
+ let e: i16x8 = i16x8::new(16, 17, 18, 19, 20, 21, 22, 23);
+ let r: i16x8 = transmute(vzip2q_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip2_s32() {
+ let a: i32x2 = i32x2::new(0, 16);
+ let b: i32x2 = i32x2::new(1, 17);
+ let e: i32x2 = i32x2::new(16, 17);
+ let r: i32x2 = transmute(vzip2_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip2q_s32() {
+ let a: i32x4 = i32x4::new(0, 16, 16, 18);
+ let b: i32x4 = i32x4::new(1, 17, 17, 19);
+ let e: i32x4 = i32x4::new(16, 17, 18, 19);
+ let r: i32x4 = transmute(vzip2q_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip2q_s64() {
+ let a: i64x2 = i64x2::new(0, 16);
+ let b: i64x2 = i64x2::new(1, 17);
+ let e: i64x2 = i64x2::new(16, 17);
+ let r: i64x2 = transmute(vzip2q_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip2_u8() {
+ let a: u8x8 = u8x8::new(0, 16, 16, 18, 16, 18, 20, 22);
+ let b: u8x8 = u8x8::new(1, 17, 17, 19, 17, 19, 21, 23);
+ let e: u8x8 = u8x8::new(16, 17, 18, 19, 20, 21, 22, 23);
+ let r: u8x8 = transmute(vzip2_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip2q_u8() {
+ let a: u8x16 = u8x16::new(0, 16, 16, 18, 16, 18, 20, 22, 16, 18, 20, 22, 24, 26, 28, 30);
+ let b: u8x16 = u8x16::new(1, 17, 17, 19, 17, 19, 21, 23, 17, 19, 21, 23, 25, 27, 29, 31);
+ let e: u8x16 = u8x16::new(16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31);
+ let r: u8x16 = transmute(vzip2q_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip2_u16() {
+ let a: u16x4 = u16x4::new(0, 16, 16, 18);
+ let b: u16x4 = u16x4::new(1, 17, 17, 19);
+ let e: u16x4 = u16x4::new(16, 17, 18, 19);
+ let r: u16x4 = transmute(vzip2_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip2q_u16() {
+ let a: u16x8 = u16x8::new(0, 16, 16, 18, 16, 18, 20, 22);
+ let b: u16x8 = u16x8::new(1, 17, 17, 19, 17, 19, 21, 23);
+ let e: u16x8 = u16x8::new(16, 17, 18, 19, 20, 21, 22, 23);
+ let r: u16x8 = transmute(vzip2q_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip2_u32() {
+ let a: u32x2 = u32x2::new(0, 16);
+ let b: u32x2 = u32x2::new(1, 17);
+ let e: u32x2 = u32x2::new(16, 17);
+ let r: u32x2 = transmute(vzip2_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip2q_u32() {
+ let a: u32x4 = u32x4::new(0, 16, 16, 18);
+ let b: u32x4 = u32x4::new(1, 17, 17, 19);
+ let e: u32x4 = u32x4::new(16, 17, 18, 19);
+ let r: u32x4 = transmute(vzip2q_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip2q_u64() {
+ let a: u64x2 = u64x2::new(0, 16);
+ let b: u64x2 = u64x2::new(1, 17);
+ let e: u64x2 = u64x2::new(16, 17);
+ let r: u64x2 = transmute(vzip2q_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip2_p8() {
+ let a: i8x8 = i8x8::new(0, 16, 16, 18, 16, 18, 20, 22);
+ let b: i8x8 = i8x8::new(1, 17, 17, 19, 17, 19, 21, 23);
+ let e: i8x8 = i8x8::new(16, 17, 18, 19, 20, 21, 22, 23);
+ let r: i8x8 = transmute(vzip2_p8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip2q_p8() {
+ let a: i8x16 = i8x16::new(0, 16, 16, 18, 16, 18, 20, 22, 16, 18, 20, 22, 24, 26, 28, 30);
+ let b: i8x16 = i8x16::new(1, 17, 17, 19, 17, 19, 21, 23, 17, 19, 21, 23, 25, 27, 29, 31);
+ let e: i8x16 = i8x16::new(16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31);
+ let r: i8x16 = transmute(vzip2q_p8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip2_p16() {
+ let a: i16x4 = i16x4::new(0, 16, 16, 18);
+ let b: i16x4 = i16x4::new(1, 17, 17, 19);
+ let e: i16x4 = i16x4::new(16, 17, 18, 19);
+ let r: i16x4 = transmute(vzip2_p16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip2q_p16() {
+ let a: i16x8 = i16x8::new(0, 16, 16, 18, 16, 18, 20, 22);
+ let b: i16x8 = i16x8::new(1, 17, 17, 19, 17, 19, 21, 23);
+ let e: i16x8 = i16x8::new(16, 17, 18, 19, 20, 21, 22, 23);
+ let r: i16x8 = transmute(vzip2q_p16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip2q_p64() {
+ let a: i64x2 = i64x2::new(0, 16);
+ let b: i64x2 = i64x2::new(1, 17);
+ let e: i64x2 = i64x2::new(16, 17);
+ let r: i64x2 = transmute(vzip2q_p64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip2_f32() {
+ let a: f32x2 = f32x2::new(0., 8.);
+ let b: f32x2 = f32x2::new(1., 9.);
+ let e: f32x2 = f32x2::new(8., 9.);
+ let r: f32x2 = transmute(vzip2_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip2q_f32() {
+ let a: f32x4 = f32x4::new(0., 8., 8., 10.);
+ let b: f32x4 = f32x4::new(1., 9., 9., 11.);
+ let e: f32x4 = f32x4::new(8., 9., 10., 11.);
+ let r: f32x4 = transmute(vzip2q_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip2q_f64() {
+ let a: f64x2 = f64x2::new(0., 8.);
+ let b: f64x2 = f64x2::new(1., 9.);
+ let e: f64x2 = f64x2::new(8., 9.);
+ let r: f64x2 = transmute(vzip2q_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp1_s8() {
+ let a: i8x8 = i8x8::new(1, 0, 2, 0, 2, 0, 3, 0);
+ let b: i8x8 = i8x8::new(2, 0, 3, 0, 7, 0, 8, 0);
+ let e: i8x8 = i8x8::new(1, 2, 2, 3, 2, 3, 7, 8);
+ let r: i8x8 = transmute(vuzp1_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp1q_s8() {
+ let a: i8x16 = i8x16::new(1, 0, 2, 0, 2, 0, 3, 0, 2, 0, 3, 0, 7, 0, 8, 0);
+ let b: i8x16 = i8x16::new(2, 0, 3, 0, 7, 0, 8, 0, 13, 0, 14, 0, 15, 0, 16, 0);
+ let e: i8x16 = i8x16::new(1, 2, 2, 3, 2, 3, 7, 8, 2, 3, 7, 8, 13, 14, 15, 16);
+ let r: i8x16 = transmute(vuzp1q_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp1_s16() {
+ let a: i16x4 = i16x4::new(1, 0, 2, 0);
+ let b: i16x4 = i16x4::new(2, 0, 3, 0);
+ let e: i16x4 = i16x4::new(1, 2, 2, 3);
+ let r: i16x4 = transmute(vuzp1_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp1q_s16() {
+ let a: i16x8 = i16x8::new(1, 0, 2, 0, 2, 0, 3, 0);
+ let b: i16x8 = i16x8::new(2, 0, 3, 0, 7, 0, 8, 0);
+ let e: i16x8 = i16x8::new(1, 2, 2, 3, 2, 3, 7, 8);
+ let r: i16x8 = transmute(vuzp1q_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp1q_s32() {
+ let a: i32x4 = i32x4::new(1, 0, 2, 0);
+ let b: i32x4 = i32x4::new(2, 0, 3, 0);
+ let e: i32x4 = i32x4::new(1, 2, 2, 3);
+ let r: i32x4 = transmute(vuzp1q_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp1_u8() {
+ let a: u8x8 = u8x8::new(1, 0, 2, 0, 2, 0, 3, 0);
+ let b: u8x8 = u8x8::new(2, 0, 3, 0, 7, 0, 8, 0);
+ let e: u8x8 = u8x8::new(1, 2, 2, 3, 2, 3, 7, 8);
+ let r: u8x8 = transmute(vuzp1_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp1q_u8() {
+ let a: u8x16 = u8x16::new(1, 0, 2, 0, 2, 0, 3, 0, 2, 0, 3, 0, 7, 0, 8, 0);
+ let b: u8x16 = u8x16::new(2, 0, 3, 0, 7, 0, 8, 0, 13, 0, 14, 0, 15, 0, 16, 0);
+ let e: u8x16 = u8x16::new(1, 2, 2, 3, 2, 3, 7, 8, 2, 3, 7, 8, 13, 14, 15, 16);
+ let r: u8x16 = transmute(vuzp1q_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp1_u16() {
+ let a: u16x4 = u16x4::new(1, 0, 2, 0);
+ let b: u16x4 = u16x4::new(2, 0, 3, 0);
+ let e: u16x4 = u16x4::new(1, 2, 2, 3);
+ let r: u16x4 = transmute(vuzp1_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp1q_u16() {
+ let a: u16x8 = u16x8::new(1, 0, 2, 0, 2, 0, 3, 0);
+ let b: u16x8 = u16x8::new(2, 0, 3, 0, 7, 0, 8, 0);
+ let e: u16x8 = u16x8::new(1, 2, 2, 3, 2, 3, 7, 8);
+ let r: u16x8 = transmute(vuzp1q_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp1q_u32() {
+ let a: u32x4 = u32x4::new(1, 0, 2, 0);
+ let b: u32x4 = u32x4::new(2, 0, 3, 0);
+ let e: u32x4 = u32x4::new(1, 2, 2, 3);
+ let r: u32x4 = transmute(vuzp1q_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp1_p8() {
+ let a: i8x8 = i8x8::new(1, 0, 2, 0, 2, 0, 3, 0);
+ let b: i8x8 = i8x8::new(2, 0, 3, 0, 7, 0, 8, 0);
+ let e: i8x8 = i8x8::new(1, 2, 2, 3, 2, 3, 7, 8);
+ let r: i8x8 = transmute(vuzp1_p8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp1q_p8() {
+ let a: i8x16 = i8x16::new(1, 0, 2, 0, 2, 0, 3, 0, 2, 0, 3, 0, 7, 0, 8, 0);
+ let b: i8x16 = i8x16::new(2, 0, 3, 0, 7, 0, 8, 0, 13, 0, 14, 0, 15, 0, 16, 0);
+ let e: i8x16 = i8x16::new(1, 2, 2, 3, 2, 3, 7, 8, 2, 3, 7, 8, 13, 14, 15, 16);
+ let r: i8x16 = transmute(vuzp1q_p8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp1_p16() {
+ let a: i16x4 = i16x4::new(1, 0, 2, 0);
+ let b: i16x4 = i16x4::new(2, 0, 3, 0);
+ let e: i16x4 = i16x4::new(1, 2, 2, 3);
+ let r: i16x4 = transmute(vuzp1_p16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp1q_p16() {
+ let a: i16x8 = i16x8::new(1, 0, 2, 0, 2, 0, 3, 0);
+ let b: i16x8 = i16x8::new(2, 0, 3, 0, 7, 0, 8, 0);
+ let e: i16x8 = i16x8::new(1, 2, 2, 3, 2, 3, 7, 8);
+ let r: i16x8 = transmute(vuzp1q_p16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp1_s32() {
+ let a: i32x2 = i32x2::new(1, 0);
+ let b: i32x2 = i32x2::new(2, 0);
+ let e: i32x2 = i32x2::new(1, 2);
+ let r: i32x2 = transmute(vuzp1_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp1q_s64() {
+ let a: i64x2 = i64x2::new(1, 0);
+ let b: i64x2 = i64x2::new(2, 0);
+ let e: i64x2 = i64x2::new(1, 2);
+ let r: i64x2 = transmute(vuzp1q_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp1_u32() {
+ let a: u32x2 = u32x2::new(1, 0);
+ let b: u32x2 = u32x2::new(2, 0);
+ let e: u32x2 = u32x2::new(1, 2);
+ let r: u32x2 = transmute(vuzp1_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp1q_u64() {
+ let a: u64x2 = u64x2::new(1, 0);
+ let b: u64x2 = u64x2::new(2, 0);
+ let e: u64x2 = u64x2::new(1, 2);
+ let r: u64x2 = transmute(vuzp1q_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp1q_p64() {
+ let a: i64x2 = i64x2::new(1, 0);
+ let b: i64x2 = i64x2::new(2, 0);
+ let e: i64x2 = i64x2::new(1, 2);
+ let r: i64x2 = transmute(vuzp1q_p64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp1q_f32() {
+ let a: f32x4 = f32x4::new(0., 8., 1., 9.);
+ let b: f32x4 = f32x4::new(1., 10., 3., 11.);
+ let e: f32x4 = f32x4::new(0., 1., 1., 3.);
+ let r: f32x4 = transmute(vuzp1q_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp1_f32() {
+ let a: f32x2 = f32x2::new(0., 8.);
+ let b: f32x2 = f32x2::new(1., 10.);
+ let e: f32x2 = f32x2::new(0., 1.);
+ let r: f32x2 = transmute(vuzp1_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp1q_f64() {
+ let a: f64x2 = f64x2::new(0., 8.);
+ let b: f64x2 = f64x2::new(1., 10.);
+ let e: f64x2 = f64x2::new(0., 1.);
+ let r: f64x2 = transmute(vuzp1q_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp2_s8() {
+ let a: i8x8 = i8x8::new(0, 17, 0, 18, 0, 18, 0, 19);
+ let b: i8x8 = i8x8::new(0, 18, 0, 19, 0, 23, 0, 24);
+ let e: i8x8 = i8x8::new(17, 18, 18, 19, 18, 19, 23, 24);
+ let r: i8x8 = transmute(vuzp2_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp2q_s8() {
+ let a: i8x16 = i8x16::new(0, 17, 0, 18, 0, 18, 0, 19, 0, 18, 0, 19, 0, 23, 0, 24);
+ let b: i8x16 = i8x16::new(0, 18, 0, 19, 0, 23, 0, 24, 0, 29, 0, 30, 0, 31, 0, 32);
+ let e: i8x16 = i8x16::new(17, 18, 18, 19, 18, 19, 23, 24, 18, 19, 23, 24, 29, 30, 31, 32);
+ let r: i8x16 = transmute(vuzp2q_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp2_s16() {
+ let a: i16x4 = i16x4::new(0, 17, 0, 18);
+ let b: i16x4 = i16x4::new(0, 18, 0, 19);
+ let e: i16x4 = i16x4::new(17, 18, 18, 19);
+ let r: i16x4 = transmute(vuzp2_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp2q_s16() {
+ let a: i16x8 = i16x8::new(0, 17, 0, 18, 0, 18, 0, 19);
+ let b: i16x8 = i16x8::new(0, 18, 0, 19, 0, 23, 0, 24);
+ let e: i16x8 = i16x8::new(17, 18, 18, 19, 18, 19, 23, 24);
+ let r: i16x8 = transmute(vuzp2q_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp2q_s32() {
+ let a: i32x4 = i32x4::new(0, 17, 0, 18);
+ let b: i32x4 = i32x4::new(0, 18, 0, 19);
+ let e: i32x4 = i32x4::new(17, 18, 18, 19);
+ let r: i32x4 = transmute(vuzp2q_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp2_u8() {
+ let a: u8x8 = u8x8::new(0, 17, 0, 18, 0, 18, 0, 19);
+ let b: u8x8 = u8x8::new(0, 18, 0, 19, 0, 23, 0, 24);
+ let e: u8x8 = u8x8::new(17, 18, 18, 19, 18, 19, 23, 24);
+ let r: u8x8 = transmute(vuzp2_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp2q_u8() {
+ let a: u8x16 = u8x16::new(0, 17, 0, 18, 0, 18, 0, 19, 0, 18, 0, 19, 0, 23, 0, 24);
+ let b: u8x16 = u8x16::new(0, 18, 0, 19, 0, 23, 0, 24, 0, 29, 0, 30, 0, 31, 0, 32);
+ let e: u8x16 = u8x16::new(17, 18, 18, 19, 18, 19, 23, 24, 18, 19, 23, 24, 29, 30, 31, 32);
+ let r: u8x16 = transmute(vuzp2q_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp2_u16() {
+ let a: u16x4 = u16x4::new(0, 17, 0, 18);
+ let b: u16x4 = u16x4::new(0, 18, 0, 19);
+ let e: u16x4 = u16x4::new(17, 18, 18, 19);
+ let r: u16x4 = transmute(vuzp2_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp2q_u16() {
+ let a: u16x8 = u16x8::new(0, 17, 0, 18, 0, 18, 0, 19);
+ let b: u16x8 = u16x8::new(0, 18, 0, 19, 0, 23, 0, 24);
+ let e: u16x8 = u16x8::new(17, 18, 18, 19, 18, 19, 23, 24);
+ let r: u16x8 = transmute(vuzp2q_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp2q_u32() {
+ let a: u32x4 = u32x4::new(0, 17, 0, 18);
+ let b: u32x4 = u32x4::new(0, 18, 0, 19);
+ let e: u32x4 = u32x4::new(17, 18, 18, 19);
+ let r: u32x4 = transmute(vuzp2q_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp2_p8() {
+ let a: i8x8 = i8x8::new(0, 17, 0, 18, 0, 18, 0, 19);
+ let b: i8x8 = i8x8::new(0, 18, 0, 19, 0, 23, 0, 24);
+ let e: i8x8 = i8x8::new(17, 18, 18, 19, 18, 19, 23, 24);
+ let r: i8x8 = transmute(vuzp2_p8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp2q_p8() {
+ let a: i8x16 = i8x16::new(0, 17, 0, 18, 0, 18, 0, 19, 0, 18, 0, 19, 0, 23, 0, 24);
+ let b: i8x16 = i8x16::new(0, 18, 0, 19, 0, 23, 0, 24, 0, 29, 0, 30, 0, 31, 0, 32);
+ let e: i8x16 = i8x16::new(17, 18, 18, 19, 18, 19, 23, 24, 18, 19, 23, 24, 29, 30, 31, 32);
+ let r: i8x16 = transmute(vuzp2q_p8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp2_p16() {
+ let a: i16x4 = i16x4::new(0, 17, 0, 18);
+ let b: i16x4 = i16x4::new(0, 18, 0, 19);
+ let e: i16x4 = i16x4::new(17, 18, 18, 19);
+ let r: i16x4 = transmute(vuzp2_p16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp2q_p16() {
+ let a: i16x8 = i16x8::new(0, 17, 0, 18, 0, 18, 0, 19);
+ let b: i16x8 = i16x8::new(0, 18, 0, 19, 0, 23, 0, 24);
+ let e: i16x8 = i16x8::new(17, 18, 18, 19, 18, 19, 23, 24);
+ let r: i16x8 = transmute(vuzp2q_p16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp2_s32() {
+ let a: i32x2 = i32x2::new(0, 17);
+ let b: i32x2 = i32x2::new(0, 18);
+ let e: i32x2 = i32x2::new(17, 18);
+ let r: i32x2 = transmute(vuzp2_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp2q_s64() {
+ let a: i64x2 = i64x2::new(0, 17);
+ let b: i64x2 = i64x2::new(0, 18);
+ let e: i64x2 = i64x2::new(17, 18);
+ let r: i64x2 = transmute(vuzp2q_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp2_u32() {
+ let a: u32x2 = u32x2::new(0, 17);
+ let b: u32x2 = u32x2::new(0, 18);
+ let e: u32x2 = u32x2::new(17, 18);
+ let r: u32x2 = transmute(vuzp2_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp2q_u64() {
+ let a: u64x2 = u64x2::new(0, 17);
+ let b: u64x2 = u64x2::new(0, 18);
+ let e: u64x2 = u64x2::new(17, 18);
+ let r: u64x2 = transmute(vuzp2q_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp2q_p64() {
+ let a: i64x2 = i64x2::new(0, 17);
+ let b: i64x2 = i64x2::new(0, 18);
+ let e: i64x2 = i64x2::new(17, 18);
+ let r: i64x2 = transmute(vuzp2q_p64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp2q_f32() {
+ let a: f32x4 = f32x4::new(0., 8., 1., 9.);
+ let b: f32x4 = f32x4::new(2., 9., 3., 11.);
+ let e: f32x4 = f32x4::new(8., 9., 9., 11.);
+ let r: f32x4 = transmute(vuzp2q_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp2_f32() {
+ let a: f32x2 = f32x2::new(0., 8.);
+ let b: f32x2 = f32x2::new(2., 9.);
+ let e: f32x2 = f32x2::new(8., 9.);
+ let r: f32x2 = transmute(vuzp2_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp2q_f64() {
+ let a: f64x2 = f64x2::new(0., 8.);
+ let b: f64x2 = f64x2::new(2., 9.);
+ let e: f64x2 = f64x2::new(8., 9.);
+ let r: f64x2 = transmute(vuzp2q_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabal_high_u8() {
+ let a: u16x8 = u16x8::new(9, 10, 11, 12, 13, 14, 15, 16);
+ let b: u8x16 = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let c: u8x16 = u8x16::new(10, 10, 10, 10, 10, 10, 10, 10, 20, 0, 2, 4, 6, 8, 10, 12);
+ let e: u16x8 = u16x8::new(20, 20, 20, 20, 20, 20, 20, 20);
+ let r: u16x8 = transmute(vabal_high_u8(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabal_high_u16() {
+ let a: u32x4 = u32x4::new(9, 10, 11, 12);
+ let b: u16x8 = u16x8::new(1, 2, 3, 4, 9, 10, 11, 12);
+ let c: u16x8 = u16x8::new(10, 10, 10, 10, 20, 0, 2, 4);
+ let e: u32x4 = u32x4::new(20, 20, 20, 20);
+ let r: u32x4 = transmute(vabal_high_u16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabal_high_u32() {
+ let a: u64x2 = u64x2::new(15, 16);
+ let b: u32x4 = u32x4::new(1, 2, 15, 16);
+ let c: u32x4 = u32x4::new(10, 10, 10, 12);
+ let e: u64x2 = u64x2::new(20, 20);
+ let r: u64x2 = transmute(vabal_high_u32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabal_high_s8() {
+ let a: i16x8 = i16x8::new(9, 10, 11, 12, 13, 14, 15, 16);
+ let b: i8x16 = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let c: i8x16 = i8x16::new(10, 10, 10, 10, 10, 10, 10, 10, 20, 0, 2, 4, 6, 8, 10, 12);
+ let e: i16x8 = i16x8::new(20, 20, 20, 20, 20, 20, 20, 20);
+ let r: i16x8 = transmute(vabal_high_s8(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabal_high_s16() {
+ let a: i32x4 = i32x4::new(9, 10, 11, 12);
+ let b: i16x8 = i16x8::new(1, 2, 3, 4, 9, 10, 11, 12);
+ let c: i16x8 = i16x8::new(10, 10, 10, 10, 20, 0, 2, 4);
+ let e: i32x4 = i32x4::new(20, 20, 20, 20);
+ let r: i32x4 = transmute(vabal_high_s16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabal_high_s32() {
+ let a: i64x2 = i64x2::new(15, 16);
+ let b: i32x4 = i32x4::new(1, 2, 15, 16);
+ let c: i32x4 = i32x4::new(10, 10, 10, 12);
+ let e: i64x2 = i64x2::new(20, 20);
+ let r: i64x2 = transmute(vabal_high_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqabs_s64() {
+ let a: i64x1 = i64x1::new(-9223372036854775808);
+ let e: i64x1 = i64x1::new(0x7F_FF_FF_FF_FF_FF_FF_FF);
+ let r: i64x1 = transmute(vqabs_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqabsq_s64() {
+ let a: i64x2 = i64x2::new(-9223372036854775808, -7);
+ let e: i64x2 = i64x2::new(0x7F_FF_FF_FF_FF_FF_FF_FF, 7);
+ let r: i64x2 = transmute(vqabsq_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqabsb_s8() {
+ let a: i8 = -7;
+ let e: i8 = 7;
+ let r: i8 = transmute(vqabsb_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqabsh_s16() {
+ let a: i16 = -7;
+ let e: i16 = 7;
+ let r: i16 = transmute(vqabsh_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqabss_s32() {
+ let a: i32 = -7;
+ let e: i32 = 7;
+ let r: i32 = transmute(vqabss_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqabsd_s64() {
+ let a: i64 = -7;
+ let e: i64 = 7;
+ let r: i64 = transmute(vqabsd_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vslid_n_s64() {
+ let a: i64 = 333;
+ let b: i64 = 2042;
+ let e: i64 = 8169;
+ let r: i64 = transmute(vslid_n_s64::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vslid_n_u64() {
+ let a: u64 = 333;
+ let b: u64 = 2042;
+ let e: u64 = 8169;
+ let r: u64 = transmute(vslid_n_u64::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsrid_n_s64() {
+ let a: i64 = 333;
+ let b: i64 = 2042;
+ let e: i64 = 510;
+ let r: i64 = transmute(vsrid_n_s64::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsrid_n_u64() {
+ let a: u64 = 333;
+ let b: u64 = 2042;
+ let e: u64 = 510;
+ let r: u64 = transmute(vsrid_n_u64::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/aarch64/neon/mod.rs b/library/stdarch/crates/core_arch/src/aarch64/neon/mod.rs
new file mode 100644
index 000000000..65ba527ee
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/aarch64/neon/mod.rs
@@ -0,0 +1,5440 @@
+//! ARMv8 ASIMD intrinsics
+
+#![allow(non_camel_case_types)]
+
+#[rustfmt::skip]
+mod generated;
+#[rustfmt::skip]
+pub use self::generated::*;
+
+// FIXME: replace neon with asimd
+
+use crate::{
+ core_arch::{arm_shared::*, simd::*, simd_llvm::*},
+ hint::unreachable_unchecked,
+ mem::{transmute, zeroed},
+ ptr::{read_unaligned, write_unaligned},
+};
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+types! {
+ /// ARM-specific 64-bit wide vector of one packed `f64`.
+ #[stable(feature = "neon_intrinsics", since = "1.59.0")]
+ pub struct float64x1_t(f64); // FIXME: check this!
+ /// ARM-specific 128-bit wide vector of two packed `f64`.
+ #[stable(feature = "neon_intrinsics", since = "1.59.0")]
+ pub struct float64x2_t(f64, f64);
+}
+
+/// ARM-specific type containing two `float64x1_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub struct float64x1x2_t(pub float64x1_t, pub float64x1_t);
+/// ARM-specific type containing three `float64x1_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub struct float64x1x3_t(pub float64x1_t, pub float64x1_t, pub float64x1_t);
+/// ARM-specific type containing four `float64x1_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub struct float64x1x4_t(
+ pub float64x1_t,
+ pub float64x1_t,
+ pub float64x1_t,
+ pub float64x1_t,
+);
+
+/// ARM-specific type containing two `float64x2_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub struct float64x2x2_t(pub float64x2_t, pub float64x2_t);
+/// ARM-specific type containing three `float64x2_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub struct float64x2x3_t(pub float64x2_t, pub float64x2_t, pub float64x2_t);
+/// ARM-specific type containing four `float64x2_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub struct float64x2x4_t(
+ pub float64x2_t,
+ pub float64x2_t,
+ pub float64x2_t,
+ pub float64x2_t,
+);
+
+#[allow(improper_ctypes)]
+extern "unadjusted" {
+ // absolute value
+ #[link_name = "llvm.aarch64.neon.abs.i64"]
+ fn vabsd_s64_(a: i64) -> i64;
+ #[link_name = "llvm.aarch64.neon.abs.v1i64"]
+ fn vabs_s64_(a: int64x1_t) -> int64x1_t;
+ #[link_name = "llvm.aarch64.neon.abs.v2i64"]
+ fn vabsq_s64_(a: int64x2_t) -> int64x2_t;
+
+ #[link_name = "llvm.aarch64.neon.suqadd.v8i8"]
+ fn vuqadd_s8_(a: int8x8_t, b: uint8x8_t) -> int8x8_t;
+ #[link_name = "llvm.aarch64.neon.suqadd.v16i8"]
+ fn vuqaddq_s8_(a: int8x16_t, b: uint8x16_t) -> int8x16_t;
+ #[link_name = "llvm.aarch64.neon.suqadd.v4i16"]
+ fn vuqadd_s16_(a: int16x4_t, b: uint16x4_t) -> int16x4_t;
+ #[link_name = "llvm.aarch64.neon.suqadd.v8i16"]
+ fn vuqaddq_s16_(a: int16x8_t, b: uint16x8_t) -> int16x8_t;
+ #[link_name = "llvm.aarch64.neon.suqadd.v2i32"]
+ fn vuqadd_s32_(a: int32x2_t, b: uint32x2_t) -> int32x2_t;
+ #[link_name = "llvm.aarch64.neon.suqadd.v4i32"]
+ fn vuqaddq_s32_(a: int32x4_t, b: uint32x4_t) -> int32x4_t;
+ #[link_name = "llvm.aarch64.neon.suqadd.v1i64"]
+ fn vuqadd_s64_(a: int64x1_t, b: uint64x1_t) -> int64x1_t;
+ #[link_name = "llvm.aarch64.neon.suqadd.v2i64"]
+ fn vuqaddq_s64_(a: int64x2_t, b: uint64x2_t) -> int64x2_t;
+
+ #[link_name = "llvm.aarch64.neon.usqadd.v8i8"]
+ fn vsqadd_u8_(a: uint8x8_t, b: int8x8_t) -> uint8x8_t;
+ #[link_name = "llvm.aarch64.neon.usqadd.v16i8"]
+ fn vsqaddq_u8_(a: uint8x16_t, b: int8x16_t) -> uint8x16_t;
+ #[link_name = "llvm.aarch64.neon.usqadd.v4i16"]
+ fn vsqadd_u16_(a: uint16x4_t, b: int16x4_t) -> uint16x4_t;
+ #[link_name = "llvm.aarch64.neon.usqadd.v8i16"]
+ fn vsqaddq_u16_(a: uint16x8_t, b: int16x8_t) -> uint16x8_t;
+ #[link_name = "llvm.aarch64.neon.usqadd.v2i32"]
+ fn vsqadd_u32_(a: uint32x2_t, b: int32x2_t) -> uint32x2_t;
+ #[link_name = "llvm.aarch64.neon.usqadd.v4i32"]
+ fn vsqaddq_u32_(a: uint32x4_t, b: int32x4_t) -> uint32x4_t;
+ #[link_name = "llvm.aarch64.neon.usqadd.v1i64"]
+ fn vsqadd_u64_(a: uint64x1_t, b: int64x1_t) -> uint64x1_t;
+ #[link_name = "llvm.aarch64.neon.usqadd.v2i64"]
+ fn vsqaddq_u64_(a: uint64x2_t, b: int64x2_t) -> uint64x2_t;
+
+ #[link_name = "llvm.aarch64.neon.addp.v8i16"]
+ fn vpaddq_s16_(a: int16x8_t, b: int16x8_t) -> int16x8_t;
+ #[link_name = "llvm.aarch64.neon.addp.v4i32"]
+ fn vpaddq_s32_(a: int32x4_t, b: int32x4_t) -> int32x4_t;
+ #[link_name = "llvm.aarch64.neon.addp.v2i64"]
+ fn vpaddq_s64_(a: int64x2_t, b: int64x2_t) -> int64x2_t;
+ #[link_name = "llvm.aarch64.neon.addp.v16i8"]
+ fn vpaddq_s8_(a: int8x16_t, b: int8x16_t) -> int8x16_t;
+
+ #[link_name = "llvm.aarch64.neon.saddv.i32.v4i16"]
+ fn vaddv_s16_(a: int16x4_t) -> i16;
+ #[link_name = "llvm.aarch64.neon.saddv.i32.v2i32"]
+ fn vaddv_s32_(a: int32x2_t) -> i32;
+ #[link_name = "llvm.aarch64.neon.saddv.i32.v8i8"]
+ fn vaddv_s8_(a: int8x8_t) -> i8;
+ #[link_name = "llvm.aarch64.neon.uaddv.i32.v4i16"]
+ fn vaddv_u16_(a: uint16x4_t) -> u16;
+ #[link_name = "llvm.aarch64.neon.uaddv.i32.v2i32"]
+ fn vaddv_u32_(a: uint32x2_t) -> u32;
+ #[link_name = "llvm.aarch64.neon.uaddv.i32.v8i8"]
+ fn vaddv_u8_(a: uint8x8_t) -> u8;
+ #[link_name = "llvm.aarch64.neon.saddv.i32.v8i16"]
+ fn vaddvq_s16_(a: int16x8_t) -> i16;
+ #[link_name = "llvm.aarch64.neon.saddv.i32.v4i32"]
+ fn vaddvq_s32_(a: int32x4_t) -> i32;
+ #[link_name = "llvm.aarch64.neon.saddv.i32.v16i8"]
+ fn vaddvq_s8_(a: int8x16_t) -> i8;
+ #[link_name = "llvm.aarch64.neon.uaddv.i32.v8i16"]
+ fn vaddvq_u16_(a: uint16x8_t) -> u16;
+ #[link_name = "llvm.aarch64.neon.uaddv.i32.v4i32"]
+ fn vaddvq_u32_(a: uint32x4_t) -> u32;
+ #[link_name = "llvm.aarch64.neon.uaddv.i32.v16i8"]
+ fn vaddvq_u8_(a: uint8x16_t) -> u8;
+ #[link_name = "llvm.aarch64.neon.saddv.i64.v2i64"]
+ fn vaddvq_s64_(a: int64x2_t) -> i64;
+ #[link_name = "llvm.aarch64.neon.uaddv.i64.v2i64"]
+ fn vaddvq_u64_(a: uint64x2_t) -> u64;
+
+ #[link_name = "llvm.aarch64.neon.saddlv.i32.v8i8"]
+ fn vaddlv_s8_(a: int8x8_t) -> i32;
+ #[link_name = "llvm.aarch64.neon.uaddlv.i32.v8i8"]
+ fn vaddlv_u8_(a: uint8x8_t) -> u32;
+ #[link_name = "llvm.aarch64.neon.saddlv.i32.v16i8"]
+ fn vaddlvq_s8_(a: int8x16_t) -> i32;
+ #[link_name = "llvm.aarch64.neon.uaddlv.i32.v16i8"]
+ fn vaddlvq_u8_(a: uint8x16_t) -> u32;
+
+ #[link_name = "llvm.aarch64.neon.smaxv.i8.v8i8"]
+ fn vmaxv_s8_(a: int8x8_t) -> i8;
+ #[link_name = "llvm.aarch64.neon.smaxv.i8.6i8"]
+ fn vmaxvq_s8_(a: int8x16_t) -> i8;
+ #[link_name = "llvm.aarch64.neon.smaxv.i16.v4i16"]
+ fn vmaxv_s16_(a: int16x4_t) -> i16;
+ #[link_name = "llvm.aarch64.neon.smaxv.i16.v8i16"]
+ fn vmaxvq_s16_(a: int16x8_t) -> i16;
+ #[link_name = "llvm.aarch64.neon.smaxv.i32.v2i32"]
+ fn vmaxv_s32_(a: int32x2_t) -> i32;
+ #[link_name = "llvm.aarch64.neon.smaxv.i32.v4i32"]
+ fn vmaxvq_s32_(a: int32x4_t) -> i32;
+
+ #[link_name = "llvm.aarch64.neon.umaxv.i8.v8i8"]
+ fn vmaxv_u8_(a: uint8x8_t) -> u8;
+ #[link_name = "llvm.aarch64.neon.umaxv.i8.6i8"]
+ fn vmaxvq_u8_(a: uint8x16_t) -> u8;
+ #[link_name = "llvm.aarch64.neon.umaxv.i16.v4i16"]
+ fn vmaxv_u16_(a: uint16x4_t) -> u16;
+ #[link_name = "llvm.aarch64.neon.umaxv.i16.v8i16"]
+ fn vmaxvq_u16_(a: uint16x8_t) -> u16;
+ #[link_name = "llvm.aarch64.neon.umaxv.i32.v2i32"]
+ fn vmaxv_u32_(a: uint32x2_t) -> u32;
+ #[link_name = "llvm.aarch64.neon.umaxv.i32.v4i32"]
+ fn vmaxvq_u32_(a: uint32x4_t) -> u32;
+
+ #[link_name = "llvm.aarch64.neon.fmaxv.f32.v2f32"]
+ fn vmaxv_f32_(a: float32x2_t) -> f32;
+ #[link_name = "llvm.aarch64.neon.fmaxv.f32.v4f32"]
+ fn vmaxvq_f32_(a: float32x4_t) -> f32;
+ #[link_name = "llvm.aarch64.neon.fmaxv.f64.v2f64"]
+ fn vmaxvq_f64_(a: float64x2_t) -> f64;
+
+ #[link_name = "llvm.aarch64.neon.sminv.i8.v8i8"]
+ fn vminv_s8_(a: int8x8_t) -> i8;
+ #[link_name = "llvm.aarch64.neon.sminv.i8.6i8"]
+ fn vminvq_s8_(a: int8x16_t) -> i8;
+ #[link_name = "llvm.aarch64.neon.sminv.i16.v4i16"]
+ fn vminv_s16_(a: int16x4_t) -> i16;
+ #[link_name = "llvm.aarch64.neon.sminv.i16.v8i16"]
+ fn vminvq_s16_(a: int16x8_t) -> i16;
+ #[link_name = "llvm.aarch64.neon.sminv.i32.v2i32"]
+ fn vminv_s32_(a: int32x2_t) -> i32;
+ #[link_name = "llvm.aarch64.neon.sminv.i32.v4i32"]
+ fn vminvq_s32_(a: int32x4_t) -> i32;
+
+ #[link_name = "llvm.aarch64.neon.uminv.i8.v8i8"]
+ fn vminv_u8_(a: uint8x8_t) -> u8;
+ #[link_name = "llvm.aarch64.neon.uminv.i8.6i8"]
+ fn vminvq_u8_(a: uint8x16_t) -> u8;
+ #[link_name = "llvm.aarch64.neon.uminv.i16.v4i16"]
+ fn vminv_u16_(a: uint16x4_t) -> u16;
+ #[link_name = "llvm.aarch64.neon.uminv.i16.v8i16"]
+ fn vminvq_u16_(a: uint16x8_t) -> u16;
+ #[link_name = "llvm.aarch64.neon.uminv.i32.v2i32"]
+ fn vminv_u32_(a: uint32x2_t) -> u32;
+ #[link_name = "llvm.aarch64.neon.uminv.i32.v4i32"]
+ fn vminvq_u32_(a: uint32x4_t) -> u32;
+
+ #[link_name = "llvm.aarch64.neon.fminv.f32.v2f32"]
+ fn vminv_f32_(a: float32x2_t) -> f32;
+ #[link_name = "llvm.aarch64.neon.fminv.f32.v4f32"]
+ fn vminvq_f32_(a: float32x4_t) -> f32;
+ #[link_name = "llvm.aarch64.neon.fminv.f64.v2f64"]
+ fn vminvq_f64_(a: float64x2_t) -> f64;
+
+ #[link_name = "llvm.aarch64.neon.sminp.v16i8"]
+ fn vpminq_s8_(a: int8x16_t, b: int8x16_t) -> int8x16_t;
+ #[link_name = "llvm.aarch64.neon.sminp.v8i16"]
+ fn vpminq_s16_(a: int16x8_t, b: int16x8_t) -> int16x8_t;
+ #[link_name = "llvm.aarch64.neon.sminp.v4i32"]
+ fn vpminq_s32_(a: int32x4_t, b: int32x4_t) -> int32x4_t;
+ #[link_name = "llvm.aarch64.neon.uminp.v16i8"]
+ fn vpminq_u8_(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t;
+ #[link_name = "llvm.aarch64.neon.uminp.v8i16"]
+ fn vpminq_u16_(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t;
+ #[link_name = "llvm.aarch64.neon.uminp.v4i32"]
+ fn vpminq_u32_(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t;
+ #[link_name = "llvm.aarch64.neon.fminp.4f32"]
+ fn vpminq_f32_(a: float32x4_t, b: float32x4_t) -> float32x4_t;
+ #[link_name = "llvm.aarch64.neon.fminp.v2f64"]
+ fn vpminq_f64_(a: float64x2_t, b: float64x2_t) -> float64x2_t;
+
+ #[link_name = "llvm.aarch64.neon.smaxp.v16i8"]
+ fn vpmaxq_s8_(a: int8x16_t, b: int8x16_t) -> int8x16_t;
+ #[link_name = "llvm.aarch64.neon.smaxp.v8i16"]
+ fn vpmaxq_s16_(a: int16x8_t, b: int16x8_t) -> int16x8_t;
+ #[link_name = "llvm.aarch64.neon.smaxp.v4i32"]
+ fn vpmaxq_s32_(a: int32x4_t, b: int32x4_t) -> int32x4_t;
+ #[link_name = "llvm.aarch64.neon.umaxp.v16i8"]
+ fn vpmaxq_u8_(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t;
+ #[link_name = "llvm.aarch64.neon.umaxp.v8i16"]
+ fn vpmaxq_u16_(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t;
+ #[link_name = "llvm.aarch64.neon.umaxp.v4i32"]
+ fn vpmaxq_u32_(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t;
+ #[link_name = "llvm.aarch64.neon.fmaxp.4f32"]
+ fn vpmaxq_f32_(a: float32x4_t, b: float32x4_t) -> float32x4_t;
+ #[link_name = "llvm.aarch64.neon.fmaxp.v2f64"]
+ fn vpmaxq_f64_(a: float64x2_t, b: float64x2_t) -> float64x2_t;
+
+ #[link_name = "llvm.aarch64.neon.tbl1.v8i8"]
+ fn vqtbl1(a: int8x16_t, b: uint8x8_t) -> int8x8_t;
+ #[link_name = "llvm.aarch64.neon.tbl1.v16i8"]
+ fn vqtbl1q(a: int8x16_t, b: uint8x16_t) -> int8x16_t;
+
+ #[link_name = "llvm.aarch64.neon.tbx1.v8i8"]
+ fn vqtbx1(a: int8x8_t, b: int8x16_t, c: uint8x8_t) -> int8x8_t;
+ #[link_name = "llvm.aarch64.neon.tbx1.v16i8"]
+ fn vqtbx1q(a: int8x16_t, b: int8x16_t, c: uint8x16_t) -> int8x16_t;
+
+ #[link_name = "llvm.aarch64.neon.tbl2.v8i8"]
+ fn vqtbl2(a0: int8x16_t, a1: int8x16_t, b: uint8x8_t) -> int8x8_t;
+ #[link_name = "llvm.aarch64.neon.tbl2.v16i8"]
+ fn vqtbl2q(a0: int8x16_t, a1: int8x16_t, b: uint8x16_t) -> int8x16_t;
+
+ #[link_name = "llvm.aarch64.neon.tbx2.v8i8"]
+ fn vqtbx2(a: int8x8_t, b0: int8x16_t, b1: int8x16_t, c: uint8x8_t) -> int8x8_t;
+ #[link_name = "llvm.aarch64.neon.tbx2.v16i8"]
+ fn vqtbx2q(a: int8x16_t, b0: int8x16_t, b1: int8x16_t, c: uint8x16_t) -> int8x16_t;
+
+ #[link_name = "llvm.aarch64.neon.tbl3.v8i8"]
+ fn vqtbl3(a0: int8x16_t, a1: int8x16_t, a2: int8x16_t, b: uint8x8_t) -> int8x8_t;
+ #[link_name = "llvm.aarch64.neon.tbl3.v16i8"]
+ fn vqtbl3q(a0: int8x16_t, a1: int8x16_t, a2: int8x16_t, b: uint8x16_t) -> int8x16_t;
+
+ #[link_name = "llvm.aarch64.neon.tbx3.v8i8"]
+ fn vqtbx3(a: int8x8_t, b0: int8x16_t, b1: int8x16_t, b2: int8x16_t, c: uint8x8_t) -> int8x8_t;
+ #[link_name = "llvm.aarch64.neon.tbx3.v16i8"]
+ fn vqtbx3q(
+ a: int8x16_t,
+ b0: int8x16_t,
+ b1: int8x16_t,
+ b2: int8x16_t,
+ c: uint8x16_t,
+ ) -> int8x16_t;
+
+ #[link_name = "llvm.aarch64.neon.tbl4.v8i8"]
+ fn vqtbl4(a0: int8x16_t, a1: int8x16_t, a2: int8x16_t, a3: int8x16_t, b: uint8x8_t)
+ -> int8x8_t;
+ #[link_name = "llvm.aarch64.neon.tbl4.v16i8"]
+ fn vqtbl4q(
+ a0: int8x16_t,
+ a1: int8x16_t,
+ a2: int8x16_t,
+ a3: int8x16_t,
+ b: uint8x16_t,
+ ) -> int8x16_t;
+
+ #[link_name = "llvm.aarch64.neon.tbx4.v8i8"]
+ fn vqtbx4(
+ a: int8x8_t,
+ b0: int8x16_t,
+ b1: int8x16_t,
+ b2: int8x16_t,
+ b3: int8x16_t,
+ c: uint8x8_t,
+ ) -> int8x8_t;
+
+ #[link_name = "llvm.aarch64.neon.tbx4.v16i8"]
+ fn vqtbx4q(
+ a: int8x16_t,
+ b0: int8x16_t,
+ b1: int8x16_t,
+ b2: int8x16_t,
+ b3: int8x16_t,
+ c: uint8x16_t,
+ ) -> int8x16_t;
+
+ #[link_name = "llvm.aarch64.neon.vsli.v8i8"]
+ fn vsli_n_s8_(a: int8x8_t, b: int8x8_t, n: i32) -> int8x8_t;
+ #[link_name = "llvm.aarch64.neon.vsli.v16i8"]
+ fn vsliq_n_s8_(a: int8x16_t, b: int8x16_t, n: i32) -> int8x16_t;
+ #[link_name = "llvm.aarch64.neon.vsli.v4i16"]
+ fn vsli_n_s16_(a: int16x4_t, b: int16x4_t, n: i32) -> int16x4_t;
+ #[link_name = "llvm.aarch64.neon.vsli.v8i16"]
+ fn vsliq_n_s16_(a: int16x8_t, b: int16x8_t, n: i32) -> int16x8_t;
+ #[link_name = "llvm.aarch64.neon.vsli.v2i32"]
+ fn vsli_n_s32_(a: int32x2_t, b: int32x2_t, n: i32) -> int32x2_t;
+ #[link_name = "llvm.aarch64.neon.vsli.v4i32"]
+ fn vsliq_n_s32_(a: int32x4_t, b: int32x4_t, n: i32) -> int32x4_t;
+ #[link_name = "llvm.aarch64.neon.vsli.v1i64"]
+ fn vsli_n_s64_(a: int64x1_t, b: int64x1_t, n: i32) -> int64x1_t;
+ #[link_name = "llvm.aarch64.neon.vsli.v2i64"]
+ fn vsliq_n_s64_(a: int64x2_t, b: int64x2_t, n: i32) -> int64x2_t;
+
+ #[link_name = "llvm.aarch64.neon.vsri.v8i8"]
+ fn vsri_n_s8_(a: int8x8_t, b: int8x8_t, n: i32) -> int8x8_t;
+ #[link_name = "llvm.aarch64.neon.vsri.v16i8"]
+ fn vsriq_n_s8_(a: int8x16_t, b: int8x16_t, n: i32) -> int8x16_t;
+ #[link_name = "llvm.aarch64.neon.vsri.v4i16"]
+ fn vsri_n_s16_(a: int16x4_t, b: int16x4_t, n: i32) -> int16x4_t;
+ #[link_name = "llvm.aarch64.neon.vsri.v8i16"]
+ fn vsriq_n_s16_(a: int16x8_t, b: int16x8_t, n: i32) -> int16x8_t;
+ #[link_name = "llvm.aarch64.neon.vsri.v2i32"]
+ fn vsri_n_s32_(a: int32x2_t, b: int32x2_t, n: i32) -> int32x2_t;
+ #[link_name = "llvm.aarch64.neon.vsri.v4i32"]
+ fn vsriq_n_s32_(a: int32x4_t, b: int32x4_t, n: i32) -> int32x4_t;
+ #[link_name = "llvm.aarch64.neon.vsri.v1i64"]
+ fn vsri_n_s64_(a: int64x1_t, b: int64x1_t, n: i32) -> int64x1_t;
+ #[link_name = "llvm.aarch64.neon.vsri.v2i64"]
+ fn vsriq_n_s64_(a: int64x2_t, b: int64x2_t, n: i32) -> int64x2_t;
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, N1 = 0, N2 = 0))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopy_lane_s64<const N1: i32, const N2: i32>(
+ _a: int64x1_t,
+ b: int64x1_t,
+) -> int64x1_t {
+ static_assert!(N1 : i32 where N1 == 0);
+ static_assert!(N2 : i32 where N2 == 0);
+ b
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, N1 = 0, N2 = 0))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopy_lane_u64<const N1: i32, const N2: i32>(
+ _a: uint64x1_t,
+ b: uint64x1_t,
+) -> uint64x1_t {
+ static_assert!(N1 : i32 where N1 == 0);
+ static_assert!(N2 : i32 where N2 == 0);
+ b
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, N1 = 0, N2 = 0))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopy_lane_p64<const N1: i32, const N2: i32>(
+ _a: poly64x1_t,
+ b: poly64x1_t,
+) -> poly64x1_t {
+ static_assert!(N1 : i32 where N1 == 0);
+ static_assert!(N2 : i32 where N2 == 0);
+ b
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, N1 = 0, N2 = 0))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopy_lane_f64<const N1: i32, const N2: i32>(
+ _a: float64x1_t,
+ b: float64x1_t,
+) -> float64x1_t {
+ static_assert!(N1 : i32 where N1 == 0);
+ static_assert!(N2 : i32 where N2 == 0);
+ b
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopy_laneq_s64<const LANE1: i32, const LANE2: i32>(
+ _a: int64x1_t,
+ b: int64x2_t,
+) -> int64x1_t {
+ static_assert!(LANE1 : i32 where LANE1 == 0);
+ static_assert_imm1!(LANE2);
+ transmute::<i64, _>(simd_extract(b, LANE2 as u32))
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopy_laneq_u64<const LANE1: i32, const LANE2: i32>(
+ _a: uint64x1_t,
+ b: uint64x2_t,
+) -> uint64x1_t {
+ static_assert!(LANE1 : i32 where LANE1 == 0);
+ static_assert_imm1!(LANE2);
+ transmute::<u64, _>(simd_extract(b, LANE2 as u32))
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopy_laneq_p64<const LANE1: i32, const LANE2: i32>(
+ _a: poly64x1_t,
+ b: poly64x2_t,
+) -> poly64x1_t {
+ static_assert!(LANE1 : i32 where LANE1 == 0);
+ static_assert_imm1!(LANE2);
+ transmute::<u64, _>(simd_extract(b, LANE2 as u32))
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, LANE1 = 0, LANE2 = 1))]
+#[rustc_legacy_const_generics(1, 3)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcopy_laneq_f64<const LANE1: i32, const LANE2: i32>(
+ _a: float64x1_t,
+ b: float64x2_t,
+) -> float64x1_t {
+ static_assert!(LANE1 : i32 where LANE1 == 0);
+ static_assert_imm1!(LANE2);
+ transmute::<f64, _>(simd_extract(b, LANE2 as u32))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ldr))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld1_s8(ptr: *const i8) -> int8x8_t {
+ read_unaligned(ptr.cast())
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ldr))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld1q_s8(ptr: *const i8) -> int8x16_t {
+ read_unaligned(ptr.cast())
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ldr))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld1_s16(ptr: *const i16) -> int16x4_t {
+ read_unaligned(ptr.cast())
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ldr))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld1q_s16(ptr: *const i16) -> int16x8_t {
+ read_unaligned(ptr.cast())
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ldr))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld1_s32(ptr: *const i32) -> int32x2_t {
+ read_unaligned(ptr.cast())
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ldr))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld1q_s32(ptr: *const i32) -> int32x4_t {
+ read_unaligned(ptr.cast())
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ldr))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld1_s64(ptr: *const i64) -> int64x1_t {
+ read_unaligned(ptr.cast())
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ldr))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld1q_s64(ptr: *const i64) -> int64x2_t {
+ read_unaligned(ptr.cast())
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ldr))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld1_u8(ptr: *const u8) -> uint8x8_t {
+ read_unaligned(ptr.cast())
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ldr))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld1q_u8(ptr: *const u8) -> uint8x16_t {
+ read_unaligned(ptr.cast())
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ldr))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld1_u16(ptr: *const u16) -> uint16x4_t {
+ read_unaligned(ptr.cast())
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ldr))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld1q_u16(ptr: *const u16) -> uint16x8_t {
+ read_unaligned(ptr.cast())
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ldr))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld1_u32(ptr: *const u32) -> uint32x2_t {
+ read_unaligned(ptr.cast())
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ldr))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld1q_u32(ptr: *const u32) -> uint32x4_t {
+ read_unaligned(ptr.cast())
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ldr))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld1_u64(ptr: *const u64) -> uint64x1_t {
+ read_unaligned(ptr.cast())
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ldr))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld1q_u64(ptr: *const u64) -> uint64x2_t {
+ read_unaligned(ptr.cast())
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ldr))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld1_p8(ptr: *const p8) -> poly8x8_t {
+ read_unaligned(ptr.cast())
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ldr))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld1q_p8(ptr: *const p8) -> poly8x16_t {
+ read_unaligned(ptr.cast())
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ldr))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld1_p16(ptr: *const p16) -> poly16x4_t {
+ read_unaligned(ptr.cast())
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ldr))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld1q_p16(ptr: *const p16) -> poly16x8_t {
+ read_unaligned(ptr.cast())
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(test, assert_instr(ldr))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld1_p64(ptr: *const p64) -> poly64x1_t {
+ read_unaligned(ptr.cast())
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(test, assert_instr(ldr))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld1q_p64(ptr: *const p64) -> poly64x2_t {
+ read_unaligned(ptr.cast())
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ldr))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld1_f32(ptr: *const f32) -> float32x2_t {
+ read_unaligned(ptr.cast())
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ldr))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld1q_f32(ptr: *const f32) -> float32x4_t {
+ read_unaligned(ptr.cast())
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ldr))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld1_f64(ptr: *const f64) -> float64x1_t {
+ read_unaligned(ptr.cast())
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ldr))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld1q_f64(ptr: *const f64) -> float64x2_t {
+ read_unaligned(ptr.cast())
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ldr))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld1_dup_f64(ptr: *const f64) -> float64x1_t {
+ vld1_f64(ptr)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld1r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld1q_dup_f64(ptr: *const f64) -> float64x2_t {
+ let x = vld1q_lane_f64::<0>(ptr, transmute(f64x2::splat(0.)));
+ simd_shuffle2!(x, x, [0, 0])
+}
+
+/// Load one single-element structure to one lane of one register.
+#[inline]
+#[target_feature(enable = "neon")]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(test, assert_instr(ldr, LANE = 0))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld1_lane_f64<const LANE: i32>(ptr: *const f64, src: float64x1_t) -> float64x1_t {
+ static_assert!(LANE : i32 where LANE == 0);
+ simd_insert(src, LANE as u32, *ptr)
+}
+
+/// Load one single-element structure to one lane of one register.
+#[inline]
+#[target_feature(enable = "neon")]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(test, assert_instr(ld1, LANE = 1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld1q_lane_f64<const LANE: i32>(ptr: *const f64, src: float64x2_t) -> float64x2_t {
+ static_assert_imm1!(LANE);
+ simd_insert(src, LANE as u32, *ptr)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(str))]
+#[allow(clippy::cast_ptr_alignment)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1_s8(ptr: *mut i8, a: int8x8_t) {
+ write_unaligned(ptr.cast(), a);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(str))]
+#[allow(clippy::cast_ptr_alignment)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1q_s8(ptr: *mut i8, a: int8x16_t) {
+ write_unaligned(ptr.cast(), a);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(str))]
+#[allow(clippy::cast_ptr_alignment)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1_s16(ptr: *mut i16, a: int16x4_t) {
+ write_unaligned(ptr.cast(), a);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(str))]
+#[allow(clippy::cast_ptr_alignment)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1q_s16(ptr: *mut i16, a: int16x8_t) {
+ write_unaligned(ptr.cast(), a);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(str))]
+#[allow(clippy::cast_ptr_alignment)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1_s32(ptr: *mut i32, a: int32x2_t) {
+ write_unaligned(ptr.cast(), a);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(str))]
+#[allow(clippy::cast_ptr_alignment)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1q_s32(ptr: *mut i32, a: int32x4_t) {
+ write_unaligned(ptr.cast(), a);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(str))]
+#[allow(clippy::cast_ptr_alignment)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1_s64(ptr: *mut i64, a: int64x1_t) {
+ write_unaligned(ptr.cast(), a);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(str))]
+#[allow(clippy::cast_ptr_alignment)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1q_s64(ptr: *mut i64, a: int64x2_t) {
+ write_unaligned(ptr.cast(), a);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(str))]
+#[allow(clippy::cast_ptr_alignment)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1_u8(ptr: *mut u8, a: uint8x8_t) {
+ write_unaligned(ptr.cast(), a);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(str))]
+#[allow(clippy::cast_ptr_alignment)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1q_u8(ptr: *mut u8, a: uint8x16_t) {
+ write_unaligned(ptr.cast(), a);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(str))]
+#[allow(clippy::cast_ptr_alignment)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1_u16(ptr: *mut u16, a: uint16x4_t) {
+ write_unaligned(ptr.cast(), a);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(str))]
+#[allow(clippy::cast_ptr_alignment)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1q_u16(ptr: *mut u16, a: uint16x8_t) {
+ write_unaligned(ptr.cast(), a);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(str))]
+#[allow(clippy::cast_ptr_alignment)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1_u32(ptr: *mut u32, a: uint32x2_t) {
+ write_unaligned(ptr.cast(), a);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(str))]
+#[allow(clippy::cast_ptr_alignment)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1q_u32(ptr: *mut u32, a: uint32x4_t) {
+ write_unaligned(ptr.cast(), a);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(str))]
+#[allow(clippy::cast_ptr_alignment)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1_u64(ptr: *mut u64, a: uint64x1_t) {
+ write_unaligned(ptr.cast(), a);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(str))]
+#[allow(clippy::cast_ptr_alignment)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1q_u64(ptr: *mut u64, a: uint64x2_t) {
+ write_unaligned(ptr.cast(), a);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(str))]
+#[allow(clippy::cast_ptr_alignment)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1_p8(ptr: *mut p8, a: poly8x8_t) {
+ write_unaligned(ptr.cast(), a);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(str))]
+#[allow(clippy::cast_ptr_alignment)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1q_p8(ptr: *mut p8, a: poly8x16_t) {
+ write_unaligned(ptr.cast(), a);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(str))]
+#[allow(clippy::cast_ptr_alignment)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1_p16(ptr: *mut p16, a: poly16x4_t) {
+ write_unaligned(ptr.cast(), a);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(str))]
+#[allow(clippy::cast_ptr_alignment)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1q_p16(ptr: *mut p16, a: poly16x8_t) {
+ write_unaligned(ptr.cast(), a);
+}
+
+// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(test, assert_instr(str))]
+#[allow(clippy::cast_ptr_alignment)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1_p64(ptr: *mut p64, a: poly64x1_t) {
+ write_unaligned(ptr.cast(), a);
+}
+
+// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(test, assert_instr(str))]
+#[allow(clippy::cast_ptr_alignment)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1q_p64(ptr: *mut p64, a: poly64x2_t) {
+ write_unaligned(ptr.cast(), a);
+}
+
+// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(str))]
+#[allow(clippy::cast_ptr_alignment)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1_f32(ptr: *mut f32, a: float32x2_t) {
+ write_unaligned(ptr.cast(), a);
+}
+
+// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(str))]
+#[allow(clippy::cast_ptr_alignment)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1q_f32(ptr: *mut f32, a: float32x4_t) {
+ write_unaligned(ptr.cast(), a);
+}
+
+// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(str))]
+#[allow(clippy::cast_ptr_alignment)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1_f64(ptr: *mut f64, a: float64x1_t) {
+ write_unaligned(ptr.cast(), a);
+}
+
+// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(str))]
+#[allow(clippy::cast_ptr_alignment)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1q_f64(ptr: *mut f64, a: float64x2_t) {
+ write_unaligned(ptr.cast(), a);
+}
+
+/// Absolute Value (wrapping).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(abs))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vabsd_s64(a: i64) -> i64 {
+ vabsd_s64_(a)
+}
+/// Absolute Value (wrapping).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(abs))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vabs_s64(a: int64x1_t) -> int64x1_t {
+ vabs_s64_(a)
+}
+/// Absolute Value (wrapping).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(abs))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vabsq_s64(a: int64x2_t) -> int64x2_t {
+ vabsq_s64_(a)
+}
+
+/// Bitwise Select instructions. This instruction sets each bit in the destination SIMD&FP register
+/// to the corresponding bit from the first source SIMD&FP register when the original
+/// destination bit was 1, otherwise from the second source SIMD&FP register.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(bsl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vbsl_f64(a: uint64x1_t, b: float64x1_t, c: float64x1_t) -> float64x1_t {
+ simd_select(transmute::<_, int64x1_t>(a), b, c)
+}
+/// Bitwise Select.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(bsl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vbsl_p64(a: poly64x1_t, b: poly64x1_t, c: poly64x1_t) -> poly64x1_t {
+ simd_select(transmute::<_, int64x1_t>(a), b, c)
+}
+/// Bitwise Select. (128-bit)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(bsl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vbslq_f64(a: uint64x2_t, b: float64x2_t, c: float64x2_t) -> float64x2_t {
+ simd_select(transmute::<_, int64x2_t>(a), b, c)
+}
+/// Bitwise Select. (128-bit)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(bsl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vbslq_p64(a: poly64x2_t, b: poly64x2_t, c: poly64x2_t) -> poly64x2_t {
+ simd_select(transmute::<_, int64x2_t>(a), b, c)
+}
+
+/// Signed saturating Accumulate of Unsigned value.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(suqadd))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuqadd_s8(a: int8x8_t, b: uint8x8_t) -> int8x8_t {
+ vuqadd_s8_(a, b)
+}
+/// Signed saturating Accumulate of Unsigned value.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(suqadd))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuqaddq_s8(a: int8x16_t, b: uint8x16_t) -> int8x16_t {
+ vuqaddq_s8_(a, b)
+}
+/// Signed saturating Accumulate of Unsigned value.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(suqadd))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuqadd_s16(a: int16x4_t, b: uint16x4_t) -> int16x4_t {
+ vuqadd_s16_(a, b)
+}
+/// Signed saturating Accumulate of Unsigned value.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(suqadd))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuqaddq_s16(a: int16x8_t, b: uint16x8_t) -> int16x8_t {
+ vuqaddq_s16_(a, b)
+}
+/// Signed saturating Accumulate of Unsigned value.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(suqadd))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuqadd_s32(a: int32x2_t, b: uint32x2_t) -> int32x2_t {
+ vuqadd_s32_(a, b)
+}
+/// Signed saturating Accumulate of Unsigned value.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(suqadd))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuqaddq_s32(a: int32x4_t, b: uint32x4_t) -> int32x4_t {
+ vuqaddq_s32_(a, b)
+}
+/// Signed saturating Accumulate of Unsigned value.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(suqadd))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuqadd_s64(a: int64x1_t, b: uint64x1_t) -> int64x1_t {
+ vuqadd_s64_(a, b)
+}
+/// Signed saturating Accumulate of Unsigned value.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(suqadd))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vuqaddq_s64(a: int64x2_t, b: uint64x2_t) -> int64x2_t {
+ vuqaddq_s64_(a, b)
+}
+
+/// Unsigned saturating Accumulate of Signed value.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(usqadd))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsqadd_u8(a: uint8x8_t, b: int8x8_t) -> uint8x8_t {
+ vsqadd_u8_(a, b)
+}
+/// Unsigned saturating Accumulate of Signed value.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(usqadd))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsqaddq_u8(a: uint8x16_t, b: int8x16_t) -> uint8x16_t {
+ vsqaddq_u8_(a, b)
+}
+/// Unsigned saturating Accumulate of Signed value.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(usqadd))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsqadd_u16(a: uint16x4_t, b: int16x4_t) -> uint16x4_t {
+ vsqadd_u16_(a, b)
+}
+/// Unsigned saturating Accumulate of Signed value.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(usqadd))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsqaddq_u16(a: uint16x8_t, b: int16x8_t) -> uint16x8_t {
+ vsqaddq_u16_(a, b)
+}
+/// Unsigned saturating Accumulate of Signed value.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(usqadd))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsqadd_u32(a: uint32x2_t, b: int32x2_t) -> uint32x2_t {
+ vsqadd_u32_(a, b)
+}
+/// Unsigned saturating Accumulate of Signed value.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(usqadd))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsqaddq_u32(a: uint32x4_t, b: int32x4_t) -> uint32x4_t {
+ vsqaddq_u32_(a, b)
+}
+/// Unsigned saturating Accumulate of Signed value.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(usqadd))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsqadd_u64(a: uint64x1_t, b: int64x1_t) -> uint64x1_t {
+ vsqadd_u64_(a, b)
+}
+/// Unsigned saturating Accumulate of Signed value.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(usqadd))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsqaddq_u64(a: uint64x2_t, b: int64x2_t) -> uint64x2_t {
+ vsqaddq_u64_(a, b)
+}
+
+/// Add pairwise
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(addp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpaddq_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t {
+ vpaddq_s16_(a, b)
+}
+/// Add pairwise
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(addp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpaddq_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t {
+ transmute(vpaddq_s16_(transmute(a), transmute(b)))
+}
+/// Add pairwise
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(addp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpaddq_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t {
+ vpaddq_s32_(a, b)
+}
+/// Add pairwise
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(addp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpaddq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
+ transmute(vpaddq_s32_(transmute(a), transmute(b)))
+}
+/// Add pairwise
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(addp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpaddq_s64(a: int64x2_t, b: int64x2_t) -> int64x2_t {
+ vpaddq_s64_(a, b)
+}
+/// Add pairwise
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(addp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpaddq_u64(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t {
+ transmute(vpaddq_s64_(transmute(a), transmute(b)))
+}
+/// Add pairwise
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(addp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpaddq_s8(a: int8x16_t, b: int8x16_t) -> int8x16_t {
+ vpaddq_s8_(a, b)
+}
+/// Add pairwise
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(addp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpaddq_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t {
+ transmute(vpaddq_s8_(transmute(a), transmute(b)))
+}
+/// Add pairwise
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(addp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpaddd_s64(a: int64x2_t) -> i64 {
+ transmute(vaddvq_u64_(transmute(a)))
+}
+/// Add pairwise
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(addp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpaddd_u64(a: uint64x2_t) -> u64 {
+ transmute(vaddvq_u64_(transmute(a)))
+}
+
+/// Add across vector
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(addv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vaddv_s16(a: int16x4_t) -> i16 {
+ vaddv_s16_(a)
+}
+
+/// Add across vector
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(addp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vaddv_s32(a: int32x2_t) -> i32 {
+ vaddv_s32_(a)
+}
+
+/// Add across vector
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(addv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vaddv_s8(a: int8x8_t) -> i8 {
+ vaddv_s8_(a)
+}
+
+/// Add across vector
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(addv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vaddv_u16(a: uint16x4_t) -> u16 {
+ vaddv_u16_(a)
+}
+
+/// Add across vector
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(addp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vaddv_u32(a: uint32x2_t) -> u32 {
+ vaddv_u32_(a)
+}
+
+/// Add across vector
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(addv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vaddv_u8(a: uint8x8_t) -> u8 {
+ vaddv_u8_(a)
+}
+
+/// Add across vector
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(addv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vaddvq_s16(a: int16x8_t) -> i16 {
+ vaddvq_s16_(a)
+}
+
+/// Add across vector
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(addv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vaddvq_s32(a: int32x4_t) -> i32 {
+ vaddvq_s32_(a)
+}
+
+/// Add across vector
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(addv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vaddvq_s8(a: int8x16_t) -> i8 {
+ vaddvq_s8_(a)
+}
+
+/// Add across vector
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(addv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vaddvq_u16(a: uint16x8_t) -> u16 {
+ vaddvq_u16_(a)
+}
+
+/// Add across vector
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(addv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vaddvq_u32(a: uint32x4_t) -> u32 {
+ vaddvq_u32_(a)
+}
+
+/// Add across vector
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(addv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vaddvq_u8(a: uint8x16_t) -> u8 {
+ vaddvq_u8_(a)
+}
+
+/// Add across vector
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(addp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vaddvq_s64(a: int64x2_t) -> i64 {
+ vaddvq_s64_(a)
+}
+
+/// Add across vector
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(addp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vaddvq_u64(a: uint64x2_t) -> u64 {
+ vaddvq_u64_(a)
+}
+
+/// Signed Add Long across Vector
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(saddlv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vaddlv_s8(a: int8x8_t) -> i16 {
+ vaddlv_s8_(a) as i16
+}
+
+/// Signed Add Long across Vector
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(saddlv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vaddlvq_s8(a: int8x16_t) -> i16 {
+ vaddlvq_s8_(a) as i16
+}
+
+/// Unsigned Add Long across Vector
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uaddlv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vaddlv_u8(a: uint8x8_t) -> u16 {
+ vaddlv_u8_(a) as u16
+}
+
+/// Unsigned Add Long across Vector
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uaddlv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vaddlvq_u8(a: uint8x16_t) -> u16 {
+ vaddlvq_u8_(a) as u16
+}
+
+/// Vector add.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fadd))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vadd_f64(a: float64x1_t, b: float64x1_t) -> float64x1_t {
+ simd_add(a, b)
+}
+
+/// Vector add.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fadd))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vaddq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t {
+ simd_add(a, b)
+}
+
+/// Vector add.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(add))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vadd_s64(a: int64x1_t, b: int64x1_t) -> int64x1_t {
+ simd_add(a, b)
+}
+
+/// Vector add.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(add))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vadd_u64(a: uint64x1_t, b: uint64x1_t) -> uint64x1_t {
+ simd_add(a, b)
+}
+
+/// Vector add.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(add))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vaddd_s64(a: i64, b: i64) -> i64 {
+ a.wrapping_add(b)
+}
+
+/// Vector add.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(add))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vaddd_u64(a: u64, b: u64) -> u64 {
+ a.wrapping_add(b)
+}
+
+/// Horizontal vector max.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(smaxv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmaxv_s8(a: int8x8_t) -> i8 {
+ vmaxv_s8_(a)
+}
+
+/// Horizontal vector max.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(smaxv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmaxvq_s8(a: int8x16_t) -> i8 {
+ vmaxvq_s8_(a)
+}
+
+/// Horizontal vector max.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(smaxv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmaxv_s16(a: int16x4_t) -> i16 {
+ vmaxv_s16_(a)
+}
+
+/// Horizontal vector max.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(smaxv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmaxvq_s16(a: int16x8_t) -> i16 {
+ vmaxvq_s16_(a)
+}
+
+/// Horizontal vector max.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(smaxp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmaxv_s32(a: int32x2_t) -> i32 {
+ vmaxv_s32_(a)
+}
+
+/// Horizontal vector max.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(smaxv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmaxvq_s32(a: int32x4_t) -> i32 {
+ vmaxvq_s32_(a)
+}
+
+/// Horizontal vector max.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(umaxv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmaxv_u8(a: uint8x8_t) -> u8 {
+ vmaxv_u8_(a)
+}
+
+/// Horizontal vector max.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(umaxv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmaxvq_u8(a: uint8x16_t) -> u8 {
+ vmaxvq_u8_(a)
+}
+
+/// Horizontal vector max.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(umaxv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmaxv_u16(a: uint16x4_t) -> u16 {
+ vmaxv_u16_(a)
+}
+
+/// Horizontal vector max.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(umaxv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmaxvq_u16(a: uint16x8_t) -> u16 {
+ vmaxvq_u16_(a)
+}
+
+/// Horizontal vector max.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(umaxp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmaxv_u32(a: uint32x2_t) -> u32 {
+ vmaxv_u32_(a)
+}
+
+/// Horizontal vector max.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(umaxv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmaxvq_u32(a: uint32x4_t) -> u32 {
+ vmaxvq_u32_(a)
+}
+
+/// Horizontal vector max.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmaxp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmaxv_f32(a: float32x2_t) -> f32 {
+ vmaxv_f32_(a)
+}
+
+/// Horizontal vector max.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmaxv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmaxvq_f32(a: float32x4_t) -> f32 {
+ vmaxvq_f32_(a)
+}
+
+/// Horizontal vector max.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmaxp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmaxvq_f64(a: float64x2_t) -> f64 {
+ vmaxvq_f64_(a)
+}
+
+/// Horizontal vector min.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sminv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vminv_s8(a: int8x8_t) -> i8 {
+ vminv_s8_(a)
+}
+
+/// Horizontal vector min.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sminv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vminvq_s8(a: int8x16_t) -> i8 {
+ vminvq_s8_(a)
+}
+
+/// Horizontal vector min.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sminv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vminv_s16(a: int16x4_t) -> i16 {
+ vminv_s16_(a)
+}
+
+/// Horizontal vector min.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sminv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vminvq_s16(a: int16x8_t) -> i16 {
+ vminvq_s16_(a)
+}
+
+/// Horizontal vector min.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sminp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vminv_s32(a: int32x2_t) -> i32 {
+ vminv_s32_(a)
+}
+
+/// Horizontal vector min.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sminv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vminvq_s32(a: int32x4_t) -> i32 {
+ vminvq_s32_(a)
+}
+
+/// Horizontal vector min.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uminv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vminv_u8(a: uint8x8_t) -> u8 {
+ vminv_u8_(a)
+}
+
+/// Horizontal vector min.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uminv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vminvq_u8(a: uint8x16_t) -> u8 {
+ vminvq_u8_(a)
+}
+
+/// Horizontal vector min.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uminv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vminv_u16(a: uint16x4_t) -> u16 {
+ vminv_u16_(a)
+}
+
+/// Horizontal vector min.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uminv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vminvq_u16(a: uint16x8_t) -> u16 {
+ vminvq_u16_(a)
+}
+
+/// Horizontal vector min.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uminp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vminv_u32(a: uint32x2_t) -> u32 {
+ vminv_u32_(a)
+}
+
+/// Horizontal vector min.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uminv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vminvq_u32(a: uint32x4_t) -> u32 {
+ vminvq_u32_(a)
+}
+
+/// Horizontal vector min.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fminp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vminv_f32(a: float32x2_t) -> f32 {
+ vminv_f32_(a)
+}
+
+/// Horizontal vector min.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fminv))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vminvq_f32(a: float32x4_t) -> f32 {
+ vminvq_f32_(a)
+}
+
+/// Horizontal vector min.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fminp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vminvq_f64(a: float64x2_t) -> f64 {
+ vminvq_f64_(a)
+}
+
+/// Folding minimum of adjacent pairs
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sminp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpminq_s8(a: int8x16_t, b: int8x16_t) -> int8x16_t {
+ vpminq_s8_(a, b)
+}
+
+/// Folding minimum of adjacent pairs
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sminp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpminq_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t {
+ vpminq_s16_(a, b)
+}
+
+/// Folding minimum of adjacent pairs
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sminp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpminq_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t {
+ vpminq_s32_(a, b)
+}
+
+/// Folding minimum of adjacent pairs
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uminp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpminq_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t {
+ vpminq_u8_(a, b)
+}
+
+/// Folding minimum of adjacent pairs
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uminp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpminq_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t {
+ vpminq_u16_(a, b)
+}
+
+/// Folding minimum of adjacent pairs
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uminp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpminq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
+ vpminq_u32_(a, b)
+}
+
+/// Folding minimum of adjacent pairs
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fminp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpminq_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t {
+ vpminq_f32_(a, b)
+}
+
+/// Folding minimum of adjacent pairs
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fminp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpminq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t {
+ vpminq_f64_(a, b)
+}
+
+/// Folding maximum of adjacent pairs
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(smaxp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpmaxq_s8(a: int8x16_t, b: int8x16_t) -> int8x16_t {
+ vpmaxq_s8_(a, b)
+}
+
+/// Folding maximum of adjacent pairs
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(smaxp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpmaxq_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t {
+ vpmaxq_s16_(a, b)
+}
+
+/// Folding maximum of adjacent pairs
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(smaxp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpmaxq_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t {
+ vpmaxq_s32_(a, b)
+}
+
+/// Folding maximum of adjacent pairs
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(umaxp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpmaxq_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t {
+ vpmaxq_u8_(a, b)
+}
+
+/// Folding maximum of adjacent pairs
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(umaxp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpmaxq_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t {
+ vpmaxq_u16_(a, b)
+}
+
+/// Folding maximum of adjacent pairs
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(umaxp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpmaxq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
+ vpmaxq_u32_(a, b)
+}
+
+/// Folding maximum of adjacent pairs
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmaxp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpmaxq_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t {
+ vpmaxq_f32_(a, b)
+}
+
+/// Folding maximum of adjacent pairs
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmaxp))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vpmaxq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t {
+ vpmaxq_f64_(a, b)
+}
+
+/// Extract vector from pair of vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, N = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vext_p64<const N: i32>(a: poly64x1_t, _b: poly64x1_t) -> poly64x1_t {
+ static_assert!(N : i32 where N == 0);
+ a
+}
+
+/// Extract vector from pair of vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, N = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vext_f64<const N: i32>(a: float64x1_t, _b: float64x1_t) -> float64x1_t {
+ static_assert!(N : i32 where N == 0);
+ a
+}
+/// Vector combine
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcombine_s8(low: int8x8_t, high: int8x8_t) -> int8x16_t {
+ simd_shuffle16!(
+ low,
+ high,
+ [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
+ )
+}
+
+/// Vector combine
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcombine_s16(low: int16x4_t, high: int16x4_t) -> int16x8_t {
+ simd_shuffle8!(low, high, [0, 1, 2, 3, 4, 5, 6, 7])
+}
+
+/// Vector combine
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcombine_s32(low: int32x2_t, high: int32x2_t) -> int32x4_t {
+ simd_shuffle4!(low, high, [0, 1, 2, 3])
+}
+
+/// Vector combine
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcombine_s64(low: int64x1_t, high: int64x1_t) -> int64x2_t {
+ simd_shuffle2!(low, high, [0, 1])
+}
+
+/// Vector combine
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcombine_u8(low: uint8x8_t, high: uint8x8_t) -> uint8x16_t {
+ simd_shuffle16!(
+ low,
+ high,
+ [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
+ )
+}
+
+/// Vector combine
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcombine_u16(low: uint16x4_t, high: uint16x4_t) -> uint16x8_t {
+ simd_shuffle8!(low, high, [0, 1, 2, 3, 4, 5, 6, 7])
+}
+
+/// Vector combine
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcombine_u32(low: uint32x2_t, high: uint32x2_t) -> uint32x4_t {
+ simd_shuffle4!(low, high, [0, 1, 2, 3])
+}
+
+/// Vector combine
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcombine_u64(low: uint64x1_t, high: uint64x1_t) -> uint64x2_t {
+ simd_shuffle2!(low, high, [0, 1])
+}
+
+/// Vector combine
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcombine_p64(low: poly64x1_t, high: poly64x1_t) -> poly64x2_t {
+ simd_shuffle2!(low, high, [0, 1])
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmov))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vdup_n_p64(value: p64) -> poly64x1_t {
+ transmute(u64x1::new(value))
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vdup_n_f64(value: f64) -> float64x1_t {
+ float64x1_t(value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(dup))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vdupq_n_p64(value: p64) -> poly64x2_t {
+ transmute(u64x2::new(value, value))
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(dup))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vdupq_n_f64(value: f64) -> float64x2_t {
+ float64x2_t(value, value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fmov))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmov_n_p64(value: p64) -> poly64x1_t {
+ vdup_n_p64(value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmov_n_f64(value: f64) -> float64x1_t {
+ vdup_n_f64(value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(dup))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmovq_n_p64(value: p64) -> poly64x2_t {
+ vdupq_n_p64(value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(dup))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vmovq_n_f64(value: f64) -> float64x2_t {
+ vdupq_n_f64(value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vget_high_f64(a: float64x2_t) -> float64x1_t {
+ float64x1_t(simd_extract(a, 1))
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ext))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vget_high_p64(a: poly64x2_t) -> poly64x1_t {
+ transmute(u64x1::new(simd_extract(a, 1)))
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vget_low_f64(a: float64x2_t) -> float64x1_t {
+ float64x1_t(simd_extract(a, 0))
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vget_low_p64(a: poly64x2_t) -> poly64x1_t {
+ transmute(u64x1::new(simd_extract(a, 0)))
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, IMM5 = 0))]
+pub unsafe fn vget_lane_f64<const IMM5: i32>(v: float64x1_t) -> f64 {
+ static_assert!(IMM5 : i32 where IMM5 == 0);
+ simd_extract(v, IMM5 as u32)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, IMM5 = 0))]
+pub unsafe fn vgetq_lane_f64<const IMM5: i32>(v: float64x2_t) -> f64 {
+ static_assert_imm1!(IMM5);
+ simd_extract(v, IMM5 as u32)
+}
+
+/* FIXME: 16-bit float
+/// Vector combine
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov))]
+pub unsafe fn vcombine_f16 ( low: float16x4_t, high: float16x4_t) -> float16x8_t {
+ simd_shuffle8!(low, high, [0, 1, 2, 3, 4, 5, 6, 7])
+}
+*/
+
+/// Vector combine
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcombine_f32(low: float32x2_t, high: float32x2_t) -> float32x4_t {
+ simd_shuffle4!(low, high, [0, 1, 2, 3])
+}
+
+/// Vector combine
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcombine_p8(low: poly8x8_t, high: poly8x8_t) -> poly8x16_t {
+ simd_shuffle16!(
+ low,
+ high,
+ [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
+ )
+}
+
+/// Vector combine
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcombine_p16(low: poly16x4_t, high: poly16x4_t) -> poly16x8_t {
+ simd_shuffle8!(low, high, [0, 1, 2, 3, 4, 5, 6, 7])
+}
+
+/// Vector combine
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(mov))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcombine_f64(low: float64x1_t, high: float64x1_t) -> float64x2_t {
+ simd_shuffle2!(low, high, [0, 1])
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtbl1_s8(a: int8x8_t, b: int8x8_t) -> int8x8_t {
+ vqtbl1_s8(vcombine_s8(a, zeroed()), transmute(b))
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtbl1_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t {
+ vqtbl1_u8(vcombine_u8(a, zeroed()), b)
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtbl1_p8(a: poly8x8_t, b: uint8x8_t) -> poly8x8_t {
+ vqtbl1_p8(vcombine_p8(a, zeroed()), b)
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtbl2_s8(a: int8x8x2_t, b: int8x8_t) -> int8x8_t {
+ vqtbl1_s8(vcombine_s8(a.0, a.1), transmute(b))
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtbl2_u8(a: uint8x8x2_t, b: uint8x8_t) -> uint8x8_t {
+ vqtbl1_u8(vcombine_u8(a.0, a.1), b)
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtbl2_p8(a: poly8x8x2_t, b: uint8x8_t) -> poly8x8_t {
+ vqtbl1_p8(vcombine_p8(a.0, a.1), b)
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtbl3_s8(a: int8x8x3_t, b: int8x8_t) -> int8x8_t {
+ vqtbl2_s8(
+ int8x16x2_t(vcombine_s8(a.0, a.1), vcombine_s8(a.2, zeroed())),
+ transmute(b),
+ )
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtbl3_u8(a: uint8x8x3_t, b: uint8x8_t) -> uint8x8_t {
+ vqtbl2_u8(
+ uint8x16x2_t(vcombine_u8(a.0, a.1), vcombine_u8(a.2, zeroed())),
+ b,
+ )
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtbl3_p8(a: poly8x8x3_t, b: uint8x8_t) -> poly8x8_t {
+ vqtbl2_p8(
+ poly8x16x2_t(vcombine_p8(a.0, a.1), vcombine_p8(a.2, zeroed())),
+ b,
+ )
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtbl4_s8(a: int8x8x4_t, b: int8x8_t) -> int8x8_t {
+ vqtbl2_s8(
+ int8x16x2_t(vcombine_s8(a.0, a.1), vcombine_s8(a.2, a.3)),
+ transmute(b),
+ )
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtbl4_u8(a: uint8x8x4_t, b: uint8x8_t) -> uint8x8_t {
+ vqtbl2_u8(
+ uint8x16x2_t(vcombine_u8(a.0, a.1), vcombine_u8(a.2, a.3)),
+ b,
+ )
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtbl4_p8(a: poly8x8x4_t, b: uint8x8_t) -> poly8x8_t {
+ vqtbl2_p8(
+ poly8x16x2_t(vcombine_p8(a.0, a.1), vcombine_p8(a.2, a.3)),
+ b,
+ )
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtbx1_s8(a: int8x8_t, b: int8x8_t, c: int8x8_t) -> int8x8_t {
+ let r = vqtbx1_s8(a, vcombine_s8(b, zeroed()), transmute(c));
+ let m: int8x8_t = simd_lt(c, transmute(i8x8::splat(8)));
+ simd_select(m, r, a)
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtbx1_u8(a: uint8x8_t, b: uint8x8_t, c: uint8x8_t) -> uint8x8_t {
+ let r = vqtbx1_u8(a, vcombine_u8(b, zeroed()), c);
+ let m: int8x8_t = simd_lt(c, transmute(u8x8::splat(8)));
+ simd_select(m, r, a)
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtbx1_p8(a: poly8x8_t, b: poly8x8_t, c: uint8x8_t) -> poly8x8_t {
+ let r = vqtbx1_p8(a, vcombine_p8(b, zeroed()), c);
+ let m: int8x8_t = simd_lt(c, transmute(u8x8::splat(8)));
+ simd_select(m, r, a)
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtbx2_s8(a: int8x8_t, b: int8x8x2_t, c: int8x8_t) -> int8x8_t {
+ vqtbx1_s8(a, vcombine_s8(b.0, b.1), transmute(c))
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtbx2_u8(a: uint8x8_t, b: uint8x8x2_t, c: uint8x8_t) -> uint8x8_t {
+ vqtbx1_u8(a, vcombine_u8(b.0, b.1), c)
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtbx2_p8(a: poly8x8_t, b: poly8x8x2_t, c: uint8x8_t) -> poly8x8_t {
+ vqtbx1_p8(a, vcombine_p8(b.0, b.1), c)
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtbx3_s8(a: int8x8_t, b: int8x8x3_t, c: int8x8_t) -> int8x8_t {
+ let r = vqtbx2_s8(
+ a,
+ int8x16x2_t(vcombine_s8(b.0, b.1), vcombine_s8(b.2, zeroed())),
+ transmute(c),
+ );
+ let m: int8x8_t = simd_lt(c, transmute(i8x8::splat(24)));
+ simd_select(m, r, a)
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtbx3_u8(a: uint8x8_t, b: uint8x8x3_t, c: uint8x8_t) -> uint8x8_t {
+ let r = vqtbx2_u8(
+ a,
+ uint8x16x2_t(vcombine_u8(b.0, b.1), vcombine_u8(b.2, zeroed())),
+ c,
+ );
+ let m: int8x8_t = simd_lt(c, transmute(u8x8::splat(24)));
+ simd_select(m, r, a)
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtbx3_p8(a: poly8x8_t, b: poly8x8x3_t, c: uint8x8_t) -> poly8x8_t {
+ let r = vqtbx2_p8(
+ a,
+ poly8x16x2_t(vcombine_p8(b.0, b.1), vcombine_p8(b.2, zeroed())),
+ c,
+ );
+ let m: int8x8_t = simd_lt(c, transmute(u8x8::splat(24)));
+ simd_select(m, r, a)
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtbx4_s8(a: int8x8_t, b: int8x8x4_t, c: int8x8_t) -> int8x8_t {
+ vqtbx2_s8(
+ a,
+ int8x16x2_t(vcombine_s8(b.0, b.1), vcombine_s8(b.2, b.3)),
+ transmute(c),
+ )
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtbx4_u8(a: uint8x8_t, b: uint8x8x4_t, c: uint8x8_t) -> uint8x8_t {
+ vqtbx2_u8(
+ a,
+ uint8x16x2_t(vcombine_u8(b.0, b.1), vcombine_u8(b.2, b.3)),
+ c,
+ )
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vtbx4_p8(a: poly8x8_t, b: poly8x8x4_t, c: uint8x8_t) -> poly8x8_t {
+ vqtbx2_p8(
+ a,
+ poly8x16x2_t(vcombine_p8(b.0, b.1), vcombine_p8(b.2, b.3)),
+ c,
+ )
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbl1_s8(t: int8x16_t, idx: uint8x8_t) -> int8x8_t {
+ vqtbl1(t, idx)
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbl1q_s8(t: int8x16_t, idx: uint8x16_t) -> int8x16_t {
+ vqtbl1q(t, idx)
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbl1_u8(t: uint8x16_t, idx: uint8x8_t) -> uint8x8_t {
+ transmute(vqtbl1(transmute(t), transmute(idx)))
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbl1q_u8(t: uint8x16_t, idx: uint8x16_t) -> uint8x16_t {
+ transmute(vqtbl1q(transmute(t), transmute(idx)))
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbl1_p8(t: poly8x16_t, idx: uint8x8_t) -> poly8x8_t {
+ transmute(vqtbl1(transmute(t), transmute(idx)))
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbl1q_p8(t: poly8x16_t, idx: uint8x16_t) -> poly8x16_t {
+ transmute(vqtbl1q(transmute(t), transmute(idx)))
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbx1_s8(a: int8x8_t, t: int8x16_t, idx: uint8x8_t) -> int8x8_t {
+ vqtbx1(a, t, idx)
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbx1q_s8(a: int8x16_t, t: int8x16_t, idx: uint8x16_t) -> int8x16_t {
+ vqtbx1q(a, t, idx)
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbx1_u8(a: uint8x8_t, t: uint8x16_t, idx: uint8x8_t) -> uint8x8_t {
+ transmute(vqtbx1(transmute(a), transmute(t), transmute(idx)))
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbx1q_u8(a: uint8x16_t, t: uint8x16_t, idx: uint8x16_t) -> uint8x16_t {
+ transmute(vqtbx1q(transmute(a), transmute(t), transmute(idx)))
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbx1_p8(a: poly8x8_t, t: poly8x16_t, idx: uint8x8_t) -> poly8x8_t {
+ transmute(vqtbx1(transmute(a), transmute(t), transmute(idx)))
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbx1q_p8(a: poly8x16_t, t: poly8x16_t, idx: uint8x16_t) -> poly8x16_t {
+ transmute(vqtbx1q(transmute(a), transmute(t), transmute(idx)))
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbl2_s8(t: int8x16x2_t, idx: uint8x8_t) -> int8x8_t {
+ vqtbl2(t.0, t.1, idx)
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbl2q_s8(t: int8x16x2_t, idx: uint8x16_t) -> int8x16_t {
+ vqtbl2q(t.0, t.1, idx)
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbl2_u8(t: uint8x16x2_t, idx: uint8x8_t) -> uint8x8_t {
+ transmute(vqtbl2(transmute(t.0), transmute(t.1), transmute(idx)))
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbl2q_u8(t: uint8x16x2_t, idx: uint8x16_t) -> uint8x16_t {
+ transmute(vqtbl2q(transmute(t.0), transmute(t.1), transmute(idx)))
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbl2_p8(t: poly8x16x2_t, idx: uint8x8_t) -> poly8x8_t {
+ transmute(vqtbl2(transmute(t.0), transmute(t.1), transmute(idx)))
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbl2q_p8(t: poly8x16x2_t, idx: uint8x16_t) -> poly8x16_t {
+ transmute(vqtbl2q(transmute(t.0), transmute(t.1), transmute(idx)))
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbx2_s8(a: int8x8_t, t: int8x16x2_t, idx: uint8x8_t) -> int8x8_t {
+ vqtbx2(a, t.0, t.1, idx)
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbx2q_s8(a: int8x16_t, t: int8x16x2_t, idx: uint8x16_t) -> int8x16_t {
+ vqtbx2q(a, t.0, t.1, idx)
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbx2_u8(a: uint8x8_t, t: uint8x16x2_t, idx: uint8x8_t) -> uint8x8_t {
+ transmute(vqtbx2(
+ transmute(a),
+ transmute(t.0),
+ transmute(t.1),
+ transmute(idx),
+ ))
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbx2q_u8(a: uint8x16_t, t: uint8x16x2_t, idx: uint8x16_t) -> uint8x16_t {
+ transmute(vqtbx2q(
+ transmute(a),
+ transmute(t.0),
+ transmute(t.1),
+ transmute(idx),
+ ))
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbx2_p8(a: poly8x8_t, t: poly8x16x2_t, idx: uint8x8_t) -> poly8x8_t {
+ transmute(vqtbx2(
+ transmute(a),
+ transmute(t.0),
+ transmute(t.1),
+ transmute(idx),
+ ))
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbx2q_p8(a: poly8x16_t, t: poly8x16x2_t, idx: uint8x16_t) -> poly8x16_t {
+ transmute(vqtbx2q(
+ transmute(a),
+ transmute(t.0),
+ transmute(t.1),
+ transmute(idx),
+ ))
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbl3_s8(t: int8x16x3_t, idx: uint8x8_t) -> int8x8_t {
+ vqtbl3(t.0, t.1, t.2, idx)
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbl3q_s8(t: int8x16x3_t, idx: uint8x16_t) -> int8x16_t {
+ vqtbl3q(t.0, t.1, t.2, idx)
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbl3_u8(t: uint8x16x3_t, idx: uint8x8_t) -> uint8x8_t {
+ transmute(vqtbl3(
+ transmute(t.0),
+ transmute(t.1),
+ transmute(t.2),
+ transmute(idx),
+ ))
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbl3q_u8(t: uint8x16x3_t, idx: uint8x16_t) -> uint8x16_t {
+ transmute(vqtbl3q(
+ transmute(t.0),
+ transmute(t.1),
+ transmute(t.2),
+ transmute(idx),
+ ))
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbl3_p8(t: poly8x16x3_t, idx: uint8x8_t) -> poly8x8_t {
+ transmute(vqtbl3(
+ transmute(t.0),
+ transmute(t.1),
+ transmute(t.2),
+ transmute(idx),
+ ))
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbl3q_p8(t: poly8x16x3_t, idx: uint8x16_t) -> poly8x16_t {
+ transmute(vqtbl3q(
+ transmute(t.0),
+ transmute(t.1),
+ transmute(t.2),
+ transmute(idx),
+ ))
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbx3_s8(a: int8x8_t, t: int8x16x3_t, idx: uint8x8_t) -> int8x8_t {
+ vqtbx3(a, t.0, t.1, t.2, idx)
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbx3q_s8(a: int8x16_t, t: int8x16x3_t, idx: uint8x16_t) -> int8x16_t {
+ vqtbx3q(a, t.0, t.1, t.2, idx)
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbx3_u8(a: uint8x8_t, t: uint8x16x3_t, idx: uint8x8_t) -> uint8x8_t {
+ transmute(vqtbx3(
+ transmute(a),
+ transmute(t.0),
+ transmute(t.1),
+ transmute(t.2),
+ transmute(idx),
+ ))
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbx3q_u8(a: uint8x16_t, t: uint8x16x3_t, idx: uint8x16_t) -> uint8x16_t {
+ transmute(vqtbx3q(
+ transmute(a),
+ transmute(t.0),
+ transmute(t.1),
+ transmute(t.2),
+ transmute(idx),
+ ))
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbx3_p8(a: poly8x8_t, t: poly8x16x3_t, idx: uint8x8_t) -> poly8x8_t {
+ transmute(vqtbx3(
+ transmute(a),
+ transmute(t.0),
+ transmute(t.1),
+ transmute(t.2),
+ transmute(idx),
+ ))
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbx3q_p8(a: poly8x16_t, t: poly8x16x3_t, idx: uint8x16_t) -> poly8x16_t {
+ transmute(vqtbx3q(
+ transmute(a),
+ transmute(t.0),
+ transmute(t.1),
+ transmute(t.2),
+ transmute(idx),
+ ))
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbl4_s8(t: int8x16x4_t, idx: uint8x8_t) -> int8x8_t {
+ vqtbl4(t.0, t.1, t.2, t.3, idx)
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbl4q_s8(t: int8x16x4_t, idx: uint8x16_t) -> int8x16_t {
+ vqtbl4q(t.0, t.1, t.2, t.3, idx)
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbl4_u8(t: uint8x16x4_t, idx: uint8x8_t) -> uint8x8_t {
+ transmute(vqtbl4(
+ transmute(t.0),
+ transmute(t.1),
+ transmute(t.2),
+ transmute(t.3),
+ transmute(idx),
+ ))
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbl4q_u8(t: uint8x16x4_t, idx: uint8x16_t) -> uint8x16_t {
+ transmute(vqtbl4q(
+ transmute(t.0),
+ transmute(t.1),
+ transmute(t.2),
+ transmute(t.3),
+ transmute(idx),
+ ))
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbl4_p8(t: poly8x16x4_t, idx: uint8x8_t) -> poly8x8_t {
+ transmute(vqtbl4(
+ transmute(t.0),
+ transmute(t.1),
+ transmute(t.2),
+ transmute(t.3),
+ transmute(idx),
+ ))
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbl))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbl4q_p8(t: poly8x16x4_t, idx: uint8x16_t) -> poly8x16_t {
+ transmute(vqtbl4q(
+ transmute(t.0),
+ transmute(t.1),
+ transmute(t.2),
+ transmute(t.3),
+ transmute(idx),
+ ))
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbx4_s8(a: int8x8_t, t: int8x16x4_t, idx: uint8x8_t) -> int8x8_t {
+ vqtbx4(a, t.0, t.1, t.2, t.3, idx)
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbx4q_s8(a: int8x16_t, t: int8x16x4_t, idx: uint8x16_t) -> int8x16_t {
+ vqtbx4q(a, t.0, t.1, t.2, t.3, idx)
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbx4_u8(a: uint8x8_t, t: uint8x16x4_t, idx: uint8x8_t) -> uint8x8_t {
+ transmute(vqtbx4(
+ transmute(a),
+ transmute(t.0),
+ transmute(t.1),
+ transmute(t.2),
+ transmute(t.3),
+ transmute(idx),
+ ))
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbx4q_u8(a: uint8x16_t, t: uint8x16x4_t, idx: uint8x16_t) -> uint8x16_t {
+ transmute(vqtbx4q(
+ transmute(a),
+ transmute(t.0),
+ transmute(t.1),
+ transmute(t.2),
+ transmute(t.3),
+ transmute(idx),
+ ))
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbx4_p8(a: poly8x8_t, t: poly8x16x4_t, idx: uint8x8_t) -> poly8x8_t {
+ transmute(vqtbx4(
+ transmute(a),
+ transmute(t.0),
+ transmute(t.1),
+ transmute(t.2),
+ transmute(t.3),
+ transmute(idx),
+ ))
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(tbx))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqtbx4q_p8(a: poly8x16_t, t: poly8x16x4_t, idx: uint8x16_t) -> poly8x16_t {
+ transmute(vqtbx4q(
+ transmute(a),
+ transmute(t.0),
+ transmute(t.1),
+ transmute(t.2),
+ transmute(t.3),
+ transmute(idx),
+ ))
+}
+
+/// Shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vshld_n_s64<const N: i32>(a: i64) -> i64 {
+ static_assert_imm6!(N);
+ a << N
+}
+
+/// Shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vshld_n_u64<const N: i32>(a: u64) -> u64 {
+ static_assert_imm6!(N);
+ a << N
+}
+
+/// Signed shift right
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vshrd_n_s64<const N: i32>(a: i64) -> i64 {
+ static_assert!(N : i32 where N >= 1 && N <= 64);
+ let n: i32 = if N == 64 { 63 } else { N };
+ a >> n
+}
+
+/// Unsigned shift right
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vshrd_n_u64<const N: i32>(a: u64) -> u64 {
+ static_assert!(N : i32 where N >= 1 && N <= 64);
+ let n: i32 = if N == 64 {
+ return 0;
+ } else {
+ N
+ };
+ a >> n
+}
+
+/// Signed shift right and accumulate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsrad_n_s64<const N: i32>(a: i64, b: i64) -> i64 {
+ static_assert!(N : i32 where N >= 1 && N <= 64);
+ a.wrapping_add(vshrd_n_s64::<N>(b))
+}
+
+/// Unsigned shift right and accumulate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsrad_n_u64<const N: i32>(a: u64, b: u64) -> u64 {
+ static_assert!(N : i32 where N >= 1 && N <= 64);
+ a.wrapping_add(vshrd_n_u64::<N>(b))
+}
+
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sli, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsli_n_s8<const N: i32>(a: int8x8_t, b: int8x8_t) -> int8x8_t {
+ static_assert_imm3!(N);
+ vsli_n_s8_(a, b, N)
+}
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sli, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsliq_n_s8<const N: i32>(a: int8x16_t, b: int8x16_t) -> int8x16_t {
+ static_assert_imm3!(N);
+ vsliq_n_s8_(a, b, N)
+}
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sli, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsli_n_s16<const N: i32>(a: int16x4_t, b: int16x4_t) -> int16x4_t {
+ static_assert_imm4!(N);
+ vsli_n_s16_(a, b, N)
+}
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sli, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsliq_n_s16<const N: i32>(a: int16x8_t, b: int16x8_t) -> int16x8_t {
+ static_assert_imm4!(N);
+ vsliq_n_s16_(a, b, N)
+}
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sli, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsli_n_s32<const N: i32>(a: int32x2_t, b: int32x2_t) -> int32x2_t {
+ static_assert!(N: i32 where N >= 0 && N <= 31);
+ vsli_n_s32_(a, b, N)
+}
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sli, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsliq_n_s32<const N: i32>(a: int32x4_t, b: int32x4_t) -> int32x4_t {
+ static_assert!(N: i32 where N >= 0 && N <= 31);
+ vsliq_n_s32_(a, b, N)
+}
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sli, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsli_n_s64<const N: i32>(a: int64x1_t, b: int64x1_t) -> int64x1_t {
+ static_assert!(N: i32 where N >= 0 && N <= 63);
+ vsli_n_s64_(a, b, N)
+}
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sli, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsliq_n_s64<const N: i32>(a: int64x2_t, b: int64x2_t) -> int64x2_t {
+ static_assert!(N: i32 where N >= 0 && N <= 63);
+ vsliq_n_s64_(a, b, N)
+}
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sli, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsli_n_u8<const N: i32>(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t {
+ static_assert_imm3!(N);
+ transmute(vsli_n_s8_(transmute(a), transmute(b), N))
+}
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sli, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsliq_n_u8<const N: i32>(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t {
+ static_assert_imm3!(N);
+ transmute(vsliq_n_s8_(transmute(a), transmute(b), N))
+}
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sli, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsli_n_u16<const N: i32>(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t {
+ static_assert_imm4!(N);
+ transmute(vsli_n_s16_(transmute(a), transmute(b), N))
+}
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sli, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsliq_n_u16<const N: i32>(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t {
+ static_assert_imm4!(N);
+ transmute(vsliq_n_s16_(transmute(a), transmute(b), N))
+}
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sli, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsli_n_u32<const N: i32>(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t {
+ static_assert!(N: i32 where N >= 0 && N <= 31);
+ transmute(vsli_n_s32_(transmute(a), transmute(b), N))
+}
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sli, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsliq_n_u32<const N: i32>(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
+ static_assert!(N: i32 where N >= 0 && N <= 31);
+ transmute(vsliq_n_s32_(transmute(a), transmute(b), N))
+}
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sli, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsli_n_u64<const N: i32>(a: uint64x1_t, b: uint64x1_t) -> uint64x1_t {
+ static_assert!(N: i32 where N >= 0 && N <= 63);
+ transmute(vsli_n_s64_(transmute(a), transmute(b), N))
+}
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sli, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsliq_n_u64<const N: i32>(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t {
+ static_assert!(N: i32 where N >= 0 && N <= 63);
+ transmute(vsliq_n_s64_(transmute(a), transmute(b), N))
+}
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sli, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsli_n_p8<const N: i32>(a: poly8x8_t, b: poly8x8_t) -> poly8x8_t {
+ static_assert_imm3!(N);
+ transmute(vsli_n_s8_(transmute(a), transmute(b), N))
+}
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sli, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsliq_n_p8<const N: i32>(a: poly8x16_t, b: poly8x16_t) -> poly8x16_t {
+ static_assert_imm3!(N);
+ transmute(vsliq_n_s8_(transmute(a), transmute(b), N))
+}
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sli, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsli_n_p16<const N: i32>(a: poly16x4_t, b: poly16x4_t) -> poly16x4_t {
+ static_assert_imm4!(N);
+ transmute(vsli_n_s16_(transmute(a), transmute(b), N))
+}
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sli, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsliq_n_p16<const N: i32>(a: poly16x8_t, b: poly16x8_t) -> poly16x8_t {
+ static_assert_imm4!(N);
+ transmute(vsliq_n_s16_(transmute(a), transmute(b), N))
+}
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(test, assert_instr(sli, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsli_n_p64<const N: i32>(a: poly64x1_t, b: poly64x1_t) -> poly64x1_t {
+ static_assert!(N: i32 where N >= 0 && N <= 63);
+ transmute(vsli_n_s64_(transmute(a), transmute(b), N))
+}
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(test, assert_instr(sli, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsliq_n_p64<const N: i32>(a: poly64x2_t, b: poly64x2_t) -> poly64x2_t {
+ static_assert!(N: i32 where N >= 0 && N <= 63);
+ transmute(vsliq_n_s64_(transmute(a), transmute(b), N))
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sri, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsri_n_s8<const N: i32>(a: int8x8_t, b: int8x8_t) -> int8x8_t {
+ static_assert!(N: i32 where N >= 1 && N <= 8);
+ vsri_n_s8_(a, b, N)
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sri, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsriq_n_s8<const N: i32>(a: int8x16_t, b: int8x16_t) -> int8x16_t {
+ static_assert!(N: i32 where N >= 1 && N <= 8);
+ vsriq_n_s8_(a, b, N)
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sri, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsri_n_s16<const N: i32>(a: int16x4_t, b: int16x4_t) -> int16x4_t {
+ static_assert!(N: i32 where N >= 1 && N <= 16);
+ vsri_n_s16_(a, b, N)
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sri, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsriq_n_s16<const N: i32>(a: int16x8_t, b: int16x8_t) -> int16x8_t {
+ static_assert!(N: i32 where N >= 1 && N <= 16);
+ vsriq_n_s16_(a, b, N)
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sri, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsri_n_s32<const N: i32>(a: int32x2_t, b: int32x2_t) -> int32x2_t {
+ static_assert!(N: i32 where N >= 1 && N <= 32);
+ vsri_n_s32_(a, b, N)
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sri, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsriq_n_s32<const N: i32>(a: int32x4_t, b: int32x4_t) -> int32x4_t {
+ static_assert!(N: i32 where N >= 1 && N <= 32);
+ vsriq_n_s32_(a, b, N)
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sri, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsri_n_s64<const N: i32>(a: int64x1_t, b: int64x1_t) -> int64x1_t {
+ static_assert!(N: i32 where N >= 1 && N <= 64);
+ vsri_n_s64_(a, b, N)
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sri, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsriq_n_s64<const N: i32>(a: int64x2_t, b: int64x2_t) -> int64x2_t {
+ static_assert!(N: i32 where N >= 1 && N <= 64);
+ vsriq_n_s64_(a, b, N)
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sri, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsri_n_u8<const N: i32>(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t {
+ static_assert!(N: i32 where N >= 1 && N <= 8);
+ transmute(vsri_n_s8_(transmute(a), transmute(b), N))
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sri, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsriq_n_u8<const N: i32>(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t {
+ static_assert!(N: i32 where N >= 1 && N <= 8);
+ transmute(vsriq_n_s8_(transmute(a), transmute(b), N))
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sri, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsri_n_u16<const N: i32>(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t {
+ static_assert!(N: i32 where N >= 1 && N <= 16);
+ transmute(vsri_n_s16_(transmute(a), transmute(b), N))
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sri, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsriq_n_u16<const N: i32>(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t {
+ static_assert!(N: i32 where N >= 1 && N <= 16);
+ transmute(vsriq_n_s16_(transmute(a), transmute(b), N))
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sri, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsri_n_u32<const N: i32>(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t {
+ static_assert!(N: i32 where N >= 1 && N <= 32);
+ transmute(vsri_n_s32_(transmute(a), transmute(b), N))
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sri, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsriq_n_u32<const N: i32>(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
+ static_assert!(N: i32 where N >= 1 && N <= 32);
+ transmute(vsriq_n_s32_(transmute(a), transmute(b), N))
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sri, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsri_n_u64<const N: i32>(a: uint64x1_t, b: uint64x1_t) -> uint64x1_t {
+ static_assert!(N: i32 where N >= 1 && N <= 64);
+ transmute(vsri_n_s64_(transmute(a), transmute(b), N))
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sri, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsriq_n_u64<const N: i32>(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t {
+ static_assert!(N: i32 where N >= 1 && N <= 64);
+ transmute(vsriq_n_s64_(transmute(a), transmute(b), N))
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sri, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsri_n_p8<const N: i32>(a: poly8x8_t, b: poly8x8_t) -> poly8x8_t {
+ static_assert!(N: i32 where N >= 1 && N <= 8);
+ transmute(vsri_n_s8_(transmute(a), transmute(b), N))
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sri, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsriq_n_p8<const N: i32>(a: poly8x16_t, b: poly8x16_t) -> poly8x16_t {
+ static_assert!(N: i32 where N >= 1 && N <= 8);
+ transmute(vsriq_n_s8_(transmute(a), transmute(b), N))
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sri, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsri_n_p16<const N: i32>(a: poly16x4_t, b: poly16x4_t) -> poly16x4_t {
+ static_assert!(N: i32 where N >= 1 && N <= 16);
+ transmute(vsri_n_s16_(transmute(a), transmute(b), N))
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sri, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsriq_n_p16<const N: i32>(a: poly16x8_t, b: poly16x8_t) -> poly16x8_t {
+ static_assert!(N: i32 where N >= 1 && N <= 16);
+ transmute(vsriq_n_s16_(transmute(a), transmute(b), N))
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(test, assert_instr(sri, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsri_n_p64<const N: i32>(a: poly64x1_t, b: poly64x1_t) -> poly64x1_t {
+ static_assert!(N: i32 where N >= 1 && N <= 64);
+ transmute(vsri_n_s64_(transmute(a), transmute(b), N))
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(test, assert_instr(sri, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vsriq_n_p64<const N: i32>(a: poly64x2_t, b: poly64x2_t) -> poly64x2_t {
+ static_assert!(N: i32 where N >= 1 && N <= 64);
+ transmute(vsriq_n_s64_(transmute(a), transmute(b), N))
+}
+
+/// SM3TT1A
+#[inline]
+#[target_feature(enable = "neon,sm4")]
+#[cfg_attr(test, assert_instr(sm3tt1a, IMM2 = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn vsm3tt1aq_u32<const IMM2: i32>(
+ a: uint32x4_t,
+ b: uint32x4_t,
+ c: uint32x4_t,
+) -> uint32x4_t {
+ static_assert_imm2!(IMM2);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.sm3tt1a")]
+ fn vsm3tt1aq_u32_(a: uint32x4_t, b: uint32x4_t, c: uint32x4_t, imm2: i64) -> uint32x4_t;
+ }
+ vsm3tt1aq_u32_(a, b, c, IMM2 as i64)
+}
+
+/// SM3TT1B
+#[inline]
+#[target_feature(enable = "neon,sm4")]
+#[cfg_attr(test, assert_instr(sm3tt1b, IMM2 = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn vsm3tt1bq_u32<const IMM2: i32>(
+ a: uint32x4_t,
+ b: uint32x4_t,
+ c: uint32x4_t,
+) -> uint32x4_t {
+ static_assert_imm2!(IMM2);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.sm3tt1b")]
+ fn vsm3tt1bq_u32_(a: uint32x4_t, b: uint32x4_t, c: uint32x4_t, imm2: i64) -> uint32x4_t;
+ }
+ vsm3tt1bq_u32_(a, b, c, IMM2 as i64)
+}
+
+/// SM3TT2A
+#[inline]
+#[target_feature(enable = "neon,sm4")]
+#[cfg_attr(test, assert_instr(sm3tt2a, IMM2 = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn vsm3tt2aq_u32<const IMM2: i32>(
+ a: uint32x4_t,
+ b: uint32x4_t,
+ c: uint32x4_t,
+) -> uint32x4_t {
+ static_assert_imm2!(IMM2);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.sm3tt2a")]
+ fn vsm3tt2aq_u32_(a: uint32x4_t, b: uint32x4_t, c: uint32x4_t, imm2: i64) -> uint32x4_t;
+ }
+ vsm3tt2aq_u32_(a, b, c, IMM2 as i64)
+}
+
+/// SM3TT2B
+#[inline]
+#[target_feature(enable = "neon,sm4")]
+#[cfg_attr(test, assert_instr(sm3tt2b, IMM2 = 0))]
+#[rustc_legacy_const_generics(3)]
+pub unsafe fn vsm3tt2bq_u32<const IMM2: i32>(
+ a: uint32x4_t,
+ b: uint32x4_t,
+ c: uint32x4_t,
+) -> uint32x4_t {
+ static_assert_imm2!(IMM2);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.sm3tt2b")]
+ fn vsm3tt2bq_u32_(a: uint32x4_t, b: uint32x4_t, c: uint32x4_t, imm2: i64) -> uint32x4_t;
+ }
+ vsm3tt2bq_u32_(a, b, c, IMM2 as i64)
+}
+
+/// Exclusive OR and rotate
+#[inline]
+#[target_feature(enable = "neon,sha3")]
+#[cfg_attr(test, assert_instr(xar, IMM6 = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vxarq_u64<const IMM6: i32>(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t {
+ static_assert_imm6!(IMM6);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.xar")]
+ fn vxarq_u64_(a: uint64x2_t, b: uint64x2_t, n: i64) -> uint64x2_t;
+ }
+ vxarq_u64_(a, b, IMM6 as i64)
+}
+
+#[cfg(test)]
+mod tests {
+ use crate::core_arch::aarch64::test_support::*;
+ use crate::core_arch::arm_shared::test_support::*;
+ use crate::core_arch::{aarch64::neon::*, aarch64::*, simd::*};
+ use std::mem::transmute;
+ use stdarch_test::simd_test;
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuqadd_s8() {
+ let a = i8x8::new(i8::MIN, -3, -2, -1, 0, 1, 2, i8::MAX);
+ let b = u8x8::new(u8::MAX, 1, 2, 3, 4, 5, 6, 7);
+ let e = i8x8::new(i8::MAX, -2, 0, 2, 4, 6, 8, i8::MAX);
+ let r: i8x8 = transmute(vuqadd_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuqaddq_s8() {
+ let a = i8x16::new(
+ i8::MIN,
+ -7,
+ -6,
+ -5,
+ -4,
+ -3,
+ -2,
+ -1,
+ 0,
+ 1,
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ i8::MAX,
+ );
+ let b = u8x16::new(u8::MAX, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let e = i8x16::new(
+ i8::MAX,
+ -6,
+ -4,
+ -2,
+ 0,
+ 2,
+ 4,
+ 6,
+ 8,
+ 10,
+ 12,
+ 14,
+ 16,
+ 18,
+ 20,
+ i8::MAX,
+ );
+ let r: i8x16 = transmute(vuqaddq_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuqadd_s16() {
+ let a = i16x4::new(i16::MIN, -1, 0, i16::MAX);
+ let b = u16x4::new(u16::MAX, 1, 2, 3);
+ let e = i16x4::new(i16::MAX, 0, 2, i16::MAX);
+ let r: i16x4 = transmute(vuqadd_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuqaddq_s16() {
+ let a = i16x8::new(i16::MIN, -3, -2, -1, 0, 1, 2, i16::MAX);
+ let b = u16x8::new(u16::MAX, 1, 2, 3, 4, 5, 6, 7);
+ let e = i16x8::new(i16::MAX, -2, 0, 2, 4, 6, 8, i16::MAX);
+ let r: i16x8 = transmute(vuqaddq_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuqadd_s32() {
+ let a = i32x2::new(i32::MIN, i32::MAX);
+ let b = u32x2::new(u32::MAX, 1);
+ let e = i32x2::new(i32::MAX, i32::MAX);
+ let r: i32x2 = transmute(vuqadd_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuqaddq_s32() {
+ let a = i32x4::new(i32::MIN, -1, 0, i32::MAX);
+ let b = u32x4::new(u32::MAX, 1, 2, 3);
+ let e = i32x4::new(i32::MAX, 0, 2, i32::MAX);
+ let r: i32x4 = transmute(vuqaddq_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuqadd_s64() {
+ let a = i64x1::new(i64::MIN);
+ let b = u64x1::new(u64::MAX);
+ let e = i64x1::new(i64::MAX);
+ let r: i64x1 = transmute(vuqadd_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuqaddq_s64() {
+ let a = i64x2::new(i64::MIN, i64::MAX);
+ let b = u64x2::new(u64::MAX, 1);
+ let e = i64x2::new(i64::MAX, i64::MAX);
+ let r: i64x2 = transmute(vuqaddq_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsqadd_u8() {
+ let a = u8x8::new(0, 1, 2, 3, 4, 5, 6, u8::MAX);
+ let b = i8x8::new(i8::MIN, -3, -2, -1, 0, 1, 2, 3);
+ let e = u8x8::new(0, 0, 0, 2, 4, 6, 8, u8::MAX);
+ let r: u8x8 = transmute(vsqadd_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsqaddq_u8() {
+ let a = u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, u8::MAX);
+ let b = i8x16::new(i8::MIN, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7);
+ let e = u8x16::new(0, 0, 0, 0, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, u8::MAX);
+ let r: u8x16 = transmute(vsqaddq_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsqadd_u16() {
+ let a = u16x4::new(0, 1, 2, u16::MAX);
+ let b = i16x4::new(i16::MIN, -1, 0, 1);
+ let e = u16x4::new(0, 0, 2, u16::MAX);
+ let r: u16x4 = transmute(vsqadd_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsqaddq_u16() {
+ let a = u16x8::new(0, 1, 2, 3, 4, 5, 6, u16::MAX);
+ let b = i16x8::new(i16::MIN, -3, -2, -1, 0, 1, 2, 3);
+ let e = u16x8::new(0, 0, 0, 2, 4, 6, 8, u16::MAX);
+ let r: u16x8 = transmute(vsqaddq_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsqadd_u32() {
+ let a = u32x2::new(0, u32::MAX);
+ let b = i32x2::new(i32::MIN, 1);
+ let e = u32x2::new(0, u32::MAX);
+ let r: u32x2 = transmute(vsqadd_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsqaddq_u32() {
+ let a = u32x4::new(0, 1, 2, u32::MAX);
+ let b = i32x4::new(i32::MIN, -1, 0, 1);
+ let e = u32x4::new(0, 0, 2, u32::MAX);
+ let r: u32x4 = transmute(vsqaddq_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsqadd_u64() {
+ let a = u64x1::new(0);
+ let b = i64x1::new(i64::MIN);
+ let e = u64x1::new(0);
+ let r: u64x1 = transmute(vsqadd_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsqaddq_u64() {
+ let a = u64x2::new(0, u64::MAX);
+ let b = i64x2::new(i64::MIN, 1);
+ let e = u64x2::new(0, u64::MAX);
+ let r: u64x2 = transmute(vsqaddq_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpaddq_s16() {
+ let a = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b = i16x8::new(0, -1, -2, -3, -4, -5, -6, -7);
+ let r: i16x8 = transmute(vpaddq_s16(transmute(a), transmute(b)));
+ let e = i16x8::new(3, 7, 11, 15, -1, -5, -9, -13);
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpaddq_s32() {
+ let a = i32x4::new(1, 2, 3, 4);
+ let b = i32x4::new(0, -1, -2, -3);
+ let r: i32x4 = transmute(vpaddq_s32(transmute(a), transmute(b)));
+ let e = i32x4::new(3, 7, -1, -5);
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpaddq_s64() {
+ let a = i64x2::new(1, 2);
+ let b = i64x2::new(0, -1);
+ let r: i64x2 = transmute(vpaddq_s64(transmute(a), transmute(b)));
+ let e = i64x2::new(3, -1);
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpaddq_s8() {
+ let a = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let b = i8x16::new(
+ 0, -1, -2, -3, -4, -5, -6, -7, -8, -8, -10, -11, -12, -13, -14, -15,
+ );
+ let r: i8x16 = transmute(vpaddq_s8(transmute(a), transmute(b)));
+ let e = i8x16::new(
+ 3, 7, 11, 15, 19, 23, 27, 31, -1, -5, -9, -13, -16, -21, -25, -29,
+ );
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpaddq_u16() {
+ let a = u16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let b = u16x8::new(17, 18, 19, 20, 20, 21, 22, 23);
+ let r: u16x8 = transmute(vpaddq_u16(transmute(a), transmute(b)));
+ let e = u16x8::new(1, 5, 9, 13, 35, 39, 41, 45);
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpaddq_u32() {
+ let a = u32x4::new(0, 1, 2, 3);
+ let b = u32x4::new(17, 18, 19, 20);
+ let r: u32x4 = transmute(vpaddq_u32(transmute(a), transmute(b)));
+ let e = u32x4::new(1, 5, 35, 39);
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpaddq_u64() {
+ let a = u64x2::new(0, 1);
+ let b = u64x2::new(17, 18);
+ let r: u64x2 = transmute(vpaddq_u64(transmute(a), transmute(b)));
+ let e = u64x2::new(1, 35);
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpaddq_u8() {
+ let a = i8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let b = i8x16::new(
+ 17, 18, 19, 20, 20, 21, 22, 23, 24, 25, 26, 27, 29, 29, 30, 31,
+ );
+ let r = i8x16(1, 5, 9, 13, 17, 21, 25, 29, 35, 39, 41, 45, 49, 53, 58, 61);
+ let e: i8x16 = transmute(vpaddq_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpaddd_s64() {
+ let a = i64x2::new(2, -3);
+ let r: i64 = transmute(vpaddd_s64(transmute(a)));
+ let e = -1_i64;
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpaddd_u64() {
+ let a = i64x2::new(2, 3);
+ let r: u64 = transmute(vpaddd_u64(transmute(a)));
+ let e = 5_u64;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vadd_f64() {
+ let a = 1.;
+ let b = 8.;
+ let e = 9.;
+ let r: f64 = transmute(vadd_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddq_f64() {
+ let a = f64x2::new(1., 2.);
+ let b = f64x2::new(8., 7.);
+ let e = f64x2::new(9., 9.);
+ let r: f64x2 = transmute(vaddq_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vadd_s64() {
+ let a = 1_i64;
+ let b = 8_i64;
+ let e = 9_i64;
+ let r: i64 = transmute(vadd_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vadd_u64() {
+ let a = 1_u64;
+ let b = 8_u64;
+ let e = 9_u64;
+ let r: u64 = transmute(vadd_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddd_s64() {
+ let a = 1_i64;
+ let b = 8_i64;
+ let e = 9_i64;
+ let r: i64 = transmute(vaddd_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddd_u64() {
+ let a = 1_u64;
+ let b = 8_u64;
+ let e = 9_u64;
+ let r: u64 = transmute(vaddd_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmaxv_s8() {
+ let r = vmaxv_s8(transmute(i8x8::new(1, 2, 3, 4, -8, 6, 7, 5)));
+ assert_eq!(r, 7_i8);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmaxvq_s8() {
+ #[rustfmt::skip]
+ let r = vmaxvq_s8(transmute(i8x16::new(
+ 1, 2, 3, 4,
+ -16, 6, 7, 5,
+ 8, 1, 1, 1,
+ 1, 1, 1, 1,
+ )));
+ assert_eq!(r, 8_i8);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmaxv_s16() {
+ let r = vmaxv_s16(transmute(i16x4::new(1, 2, -4, 3)));
+ assert_eq!(r, 3_i16);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmaxvq_s16() {
+ let r = vmaxvq_s16(transmute(i16x8::new(1, 2, 7, 4, -16, 6, 7, 5)));
+ assert_eq!(r, 7_i16);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmaxv_s32() {
+ let r = vmaxv_s32(transmute(i32x2::new(1, -4)));
+ assert_eq!(r, 1_i32);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmaxvq_s32() {
+ let r = vmaxvq_s32(transmute(i32x4::new(1, 2, -32, 4)));
+ assert_eq!(r, 4_i32);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmaxv_u8() {
+ let r = vmaxv_u8(transmute(u8x8::new(1, 2, 3, 4, 8, 6, 7, 5)));
+ assert_eq!(r, 8_u8);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmaxvq_u8() {
+ #[rustfmt::skip]
+ let r = vmaxvq_u8(transmute(u8x16::new(
+ 1, 2, 3, 4,
+ 16, 6, 7, 5,
+ 8, 1, 1, 1,
+ 1, 1, 1, 1,
+ )));
+ assert_eq!(r, 16_u8);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmaxv_u16() {
+ let r = vmaxv_u16(transmute(u16x4::new(1, 2, 4, 3)));
+ assert_eq!(r, 4_u16);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmaxvq_u16() {
+ let r = vmaxvq_u16(transmute(u16x8::new(1, 2, 7, 4, 16, 6, 7, 5)));
+ assert_eq!(r, 16_u16);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmaxv_u32() {
+ let r = vmaxv_u32(transmute(u32x2::new(1, 4)));
+ assert_eq!(r, 4_u32);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmaxvq_u32() {
+ let r = vmaxvq_u32(transmute(u32x4::new(1, 2, 32, 4)));
+ assert_eq!(r, 32_u32);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmaxv_f32() {
+ let r = vmaxv_f32(transmute(f32x2::new(1., 4.)));
+ assert_eq!(r, 4_f32);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmaxvq_f32() {
+ let r = vmaxvq_f32(transmute(f32x4::new(1., 2., 32., 4.)));
+ assert_eq!(r, 32_f32);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmaxvq_f64() {
+ let r = vmaxvq_f64(transmute(f64x2::new(1., 4.)));
+ assert_eq!(r, 4_f64);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vminv_s8() {
+ let r = vminv_s8(transmute(i8x8::new(1, 2, 3, 4, -8, 6, 7, 5)));
+ assert_eq!(r, -8_i8);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vminvq_s8() {
+ #[rustfmt::skip]
+ let r = vminvq_s8(transmute(i8x16::new(
+ 1, 2, 3, 4,
+ -16, 6, 7, 5,
+ 8, 1, 1, 1,
+ 1, 1, 1, 1,
+ )));
+ assert_eq!(r, -16_i8);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vminv_s16() {
+ let r = vminv_s16(transmute(i16x4::new(1, 2, -4, 3)));
+ assert_eq!(r, -4_i16);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vminvq_s16() {
+ let r = vminvq_s16(transmute(i16x8::new(1, 2, 7, 4, -16, 6, 7, 5)));
+ assert_eq!(r, -16_i16);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vminv_s32() {
+ let r = vminv_s32(transmute(i32x2::new(1, -4)));
+ assert_eq!(r, -4_i32);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vminvq_s32() {
+ let r = vminvq_s32(transmute(i32x4::new(1, 2, -32, 4)));
+ assert_eq!(r, -32_i32);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vminv_u8() {
+ let r = vminv_u8(transmute(u8x8::new(1, 2, 3, 4, 8, 6, 7, 5)));
+ assert_eq!(r, 1_u8);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vminvq_u8() {
+ #[rustfmt::skip]
+ let r = vminvq_u8(transmute(u8x16::new(
+ 1, 2, 3, 4,
+ 16, 6, 7, 5,
+ 8, 1, 1, 1,
+ 1, 1, 1, 1,
+ )));
+ assert_eq!(r, 1_u8);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vminv_u16() {
+ let r = vminv_u16(transmute(u16x4::new(1, 2, 4, 3)));
+ assert_eq!(r, 1_u16);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vminvq_u16() {
+ let r = vminvq_u16(transmute(u16x8::new(1, 2, 7, 4, 16, 6, 7, 5)));
+ assert_eq!(r, 1_u16);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vminv_u32() {
+ let r = vminv_u32(transmute(u32x2::new(1, 4)));
+ assert_eq!(r, 1_u32);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vminvq_u32() {
+ let r = vminvq_u32(transmute(u32x4::new(1, 2, 32, 4)));
+ assert_eq!(r, 1_u32);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vminv_f32() {
+ let r = vminv_f32(transmute(f32x2::new(1., 4.)));
+ assert_eq!(r, 1_f32);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vminvq_f32() {
+ let r = vminvq_f32(transmute(f32x4::new(1., 2., 32., 4.)));
+ assert_eq!(r, 1_f32);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vminvq_f64() {
+ let r = vminvq_f64(transmute(f64x2::new(1., 4.)));
+ assert_eq!(r, 1_f64);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpminq_s8() {
+ #[cfg_attr(rustfmt, skip)]
+ let a = i8x16::new(1, -2, 3, -4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
+ #[cfg_attr(rustfmt, skip)]
+ let b = i8x16::new(0, 3, 2, 5, 4, 7, 6, 9, 0, 3, 2, 5, 4, 7, 6, 9);
+ #[cfg_attr(rustfmt, skip)]
+ let e = i8x16::new(-2, -4, 5, 7, 1, 3, 5, 7, 0, 2, 4, 6, 0, 2, 4, 6);
+ let r: i8x16 = transmute(vpminq_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpminq_s16() {
+ let a = i16x8::new(1, -2, 3, 4, 5, 6, 7, 8);
+ let b = i16x8::new(0, 3, 2, 5, 4, 7, 6, 9);
+ let e = i16x8::new(-2, 3, 5, 7, 0, 2, 4, 6);
+ let r: i16x8 = transmute(vpminq_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpminq_s32() {
+ let a = i32x4::new(1, -2, 3, 4);
+ let b = i32x4::new(0, 3, 2, 5);
+ let e = i32x4::new(-2, 3, 0, 2);
+ let r: i32x4 = transmute(vpminq_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpminq_u8() {
+ #[cfg_attr(rustfmt, skip)]
+ let a = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
+ #[cfg_attr(rustfmt, skip)]
+ let b = u8x16::new(0, 3, 2, 5, 4, 7, 6, 9, 0, 3, 2, 5, 4, 7, 6, 9);
+ #[cfg_attr(rustfmt, skip)]
+ let e = u8x16::new(1, 3, 5, 7, 1, 3, 5, 7, 0, 2, 4, 6, 0, 2, 4, 6);
+ let r: u8x16 = transmute(vpminq_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpminq_u16() {
+ let a = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b = u16x8::new(0, 3, 2, 5, 4, 7, 6, 9);
+ let e = u16x8::new(1, 3, 5, 7, 0, 2, 4, 6);
+ let r: u16x8 = transmute(vpminq_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpminq_u32() {
+ let a = u32x4::new(1, 2, 3, 4);
+ let b = u32x4::new(0, 3, 2, 5);
+ let e = u32x4::new(1, 3, 0, 2);
+ let r: u32x4 = transmute(vpminq_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpmin_f32() {
+ let a = f32x4::new(1., -2., 3., 4.);
+ let b = f32x4::new(0., 3., 2., 5.);
+ let e = f32x4::new(-2., 3., 0., 2.);
+ let r: f32x4 = transmute(vpminq_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpmin_f64() {
+ let a = f64x2::new(1., -2.);
+ let b = f64x2::new(0., 3.);
+ let e = f64x2::new(-2., 0.);
+ let r: f64x2 = transmute(vpminq_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpmaxq_s8() {
+ #[cfg_attr(rustfmt, skip)]
+ let a = i8x16::new(1, -2, 3, -4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
+ #[cfg_attr(rustfmt, skip)]
+ let b = i8x16::new(0, 3, 2, 5, 4, 7, 6, 9, 0, 3, 2, 5, 4, 7, 6, 9);
+ #[cfg_attr(rustfmt, skip)]
+ let e = i8x16::new(1, 3, 6, 8, 2, 4, 6, 8, 3, 5, 7, 9, 3, 5, 7, 9);
+ let r: i8x16 = transmute(vpmaxq_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpmaxq_s16() {
+ let a = i16x8::new(1, -2, 3, 4, 5, 6, 7, 8);
+ let b = i16x8::new(0, 3, 2, 5, 4, 7, 6, 9);
+ let e = i16x8::new(1, 4, 6, 8, 3, 5, 7, 9);
+ let r: i16x8 = transmute(vpmaxq_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpmaxq_s32() {
+ let a = i32x4::new(1, -2, 3, 4);
+ let b = i32x4::new(0, 3, 2, 5);
+ let e = i32x4::new(1, 4, 3, 5);
+ let r: i32x4 = transmute(vpmaxq_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpmaxq_u8() {
+ #[cfg_attr(rustfmt, skip)]
+ let a = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
+ #[cfg_attr(rustfmt, skip)]
+ let b = u8x16::new(0, 3, 2, 5, 4, 7, 6, 9, 0, 3, 2, 5, 4, 7, 6, 9);
+ #[cfg_attr(rustfmt, skip)]
+ let e = u8x16::new(2, 4, 6, 8, 2, 4, 6, 8, 3, 5, 7, 9, 3, 5, 7, 9);
+ let r: u8x16 = transmute(vpmaxq_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpmaxq_u16() {
+ let a = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b = u16x8::new(0, 3, 2, 5, 4, 7, 6, 9);
+ let e = u16x8::new(2, 4, 6, 8, 3, 5, 7, 9);
+ let r: u16x8 = transmute(vpmaxq_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpmaxq_u32() {
+ let a = u32x4::new(1, 2, 3, 4);
+ let b = u32x4::new(0, 3, 2, 5);
+ let e = u32x4::new(2, 4, 3, 5);
+ let r: u32x4 = transmute(vpmaxq_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpmax_f32() {
+ let a = f32x4::new(1., -2., 3., 4.);
+ let b = f32x4::new(0., 3., 2., 5.);
+ let e = f32x4::new(1., 4., 3., 5.);
+ let r: f32x4 = transmute(vpmaxq_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpmax_f64() {
+ let a = f64x2::new(1., -2.);
+ let b = f64x2::new(0., 3.);
+ let e = f64x2::new(1., 3.);
+ let r: f64x2 = transmute(vpmaxq_f64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vext_p64() {
+ let a: i64x1 = i64x1::new(0);
+ let b: i64x1 = i64x1::new(1);
+ let e: i64x1 = i64x1::new(0);
+ let r: i64x1 = transmute(vext_p64::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vext_f64() {
+ let a: f64x1 = f64x1::new(0.);
+ let b: f64x1 = f64x1::new(1.);
+ let e: f64x1 = f64x1::new(0.);
+ let r: f64x1 = transmute(vext_f64::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshld_n_s64() {
+ let a: i64 = 1;
+ let e: i64 = 4;
+ let r: i64 = vshld_n_s64::<2>(a);
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshld_n_u64() {
+ let a: u64 = 1;
+ let e: u64 = 4;
+ let r: u64 = vshld_n_u64::<2>(a);
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshrd_n_s64() {
+ let a: i64 = 4;
+ let e: i64 = 1;
+ let r: i64 = vshrd_n_s64::<2>(a);
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshrd_n_u64() {
+ let a: u64 = 4;
+ let e: u64 = 1;
+ let r: u64 = vshrd_n_u64::<2>(a);
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsrad_n_s64() {
+ let a: i64 = 1;
+ let b: i64 = 4;
+ let e: i64 = 2;
+ let r: i64 = vsrad_n_s64::<2>(a, b);
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsrad_n_u64() {
+ let a: u64 = 1;
+ let b: u64 = 4;
+ let e: u64 = 2;
+ let r: u64 = vsrad_n_u64::<2>(a, b);
+ assert_eq!(r, e);
+ }
+
+ macro_rules! test_vcombine {
+ ($test_id:ident => $fn_id:ident ([$($a:expr),*], [$($b:expr),*])) => {
+ #[allow(unused_assignments)]
+ #[simd_test(enable = "neon")]
+ unsafe fn $test_id() {
+ let a = [$($a),*];
+ let b = [$($b),*];
+ let e = [$($a),* $(, $b)*];
+ let c = $fn_id(transmute(a), transmute(b));
+ let mut d = e;
+ d = transmute(c);
+ assert_eq!(d, e);
+ }
+ }
+ }
+
+ test_vcombine!(test_vcombine_s8 => vcombine_s8([3_i8, -4, 5, -6, 7, 8, 9, 10], [13_i8, -14, 15, -16, 17, 18, 19, 110]));
+ test_vcombine!(test_vcombine_u8 => vcombine_u8([3_u8, 4, 5, 6, 7, 8, 9, 10], [13_u8, 14, 15, 16, 17, 18, 19, 110]));
+ test_vcombine!(test_vcombine_p8 => vcombine_p8([3_u8, 4, 5, 6, 7, 8, 9, 10], [13_u8, 14, 15, 16, 17, 18, 19, 110]));
+
+ test_vcombine!(test_vcombine_s16 => vcombine_s16([3_i16, -4, 5, -6], [13_i16, -14, 15, -16]));
+ test_vcombine!(test_vcombine_u16 => vcombine_u16([3_u16, 4, 5, 6], [13_u16, 14, 15, 16]));
+ test_vcombine!(test_vcombine_p16 => vcombine_p16([3_u16, 4, 5, 6], [13_u16, 14, 15, 16]));
+ // FIXME: 16-bit floats
+ // test_vcombine!(test_vcombine_f16 => vcombine_f16([3_f16, 4., 5., 6.],
+ // [13_f16, 14., 15., 16.]));
+
+ test_vcombine!(test_vcombine_s32 => vcombine_s32([3_i32, -4], [13_i32, -14]));
+ test_vcombine!(test_vcombine_u32 => vcombine_u32([3_u32, 4], [13_u32, 14]));
+ // note: poly32x4 does not exist, and neither does vcombine_p32
+ test_vcombine!(test_vcombine_f32 => vcombine_f32([3_f32, -4.], [13_f32, -14.]));
+
+ test_vcombine!(test_vcombine_s64 => vcombine_s64([-3_i64], [13_i64]));
+ test_vcombine!(test_vcombine_u64 => vcombine_u64([3_u64], [13_u64]));
+ test_vcombine!(test_vcombine_p64 => vcombine_p64([3_u64], [13_u64]));
+ test_vcombine!(test_vcombine_f64 => vcombine_f64([-3_f64], [13_f64]));
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdup_n_f64() {
+ let a: f64 = 3.3;
+ let e = f64x1::new(3.3);
+ let r: f64x1 = transmute(vdup_n_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdup_n_p64() {
+ let a: u64 = 3;
+ let e = u64x1::new(3);
+ let r: u64x1 = transmute(vdup_n_p64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupq_n_f64() {
+ let a: f64 = 3.3;
+ let e = f64x2::new(3.3, 3.3);
+ let r: f64x2 = transmute(vdupq_n_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupq_n_p64() {
+ let a: u64 = 3;
+ let e = u64x2::new(3, 3);
+ let r: u64x2 = transmute(vdupq_n_p64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmov_n_p64() {
+ let a: u64 = 3;
+ let e = u64x1::new(3);
+ let r: u64x1 = transmute(vmov_n_p64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmov_n_f64() {
+ let a: f64 = 3.3;
+ let e = f64x1::new(3.3);
+ let r: f64x1 = transmute(vmov_n_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmovq_n_p64() {
+ let a: u64 = 3;
+ let e = u64x2::new(3, 3);
+ let r: u64x2 = transmute(vmovq_n_p64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmovq_n_f64() {
+ let a: f64 = 3.3;
+ let e = f64x2::new(3.3, 3.3);
+ let r: f64x2 = transmute(vmovq_n_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vget_high_f64() {
+ let a = f64x2::new(1.0, 2.0);
+ let e = f64x1::new(2.0);
+ let r: f64x1 = transmute(vget_high_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vget_high_p64() {
+ let a = u64x2::new(1, 2);
+ let e = u64x1::new(2);
+ let r: u64x1 = transmute(vget_high_p64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vget_low_f64() {
+ let a = f64x2::new(1.0, 2.0);
+ let e = f64x1::new(1.0);
+ let r: f64x1 = transmute(vget_low_f64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vget_low_p64() {
+ let a = u64x2::new(1, 2);
+ let e = u64x1::new(1);
+ let r: u64x1 = transmute(vget_low_p64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vget_lane_f64() {
+ let v = f64x1::new(1.0);
+ let r = vget_lane_f64::<0>(transmute(v));
+ assert_eq!(r, 1.0);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vgetq_lane_f64() {
+ let v = f64x2::new(0.0, 1.0);
+ let r = vgetq_lane_f64::<1>(transmute(v));
+ assert_eq!(r, 1.0);
+ let r = vgetq_lane_f64::<0>(transmute(v));
+ assert_eq!(r, 0.0);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopy_lane_s64() {
+ let a: i64x1 = i64x1::new(1);
+ let b: i64x1 = i64x1::new(0x7F_FF_FF_FF_FF_FF_FF_FF);
+ let e: i64x1 = i64x1::new(0x7F_FF_FF_FF_FF_FF_FF_FF);
+ let r: i64x1 = transmute(vcopy_lane_s64::<0, 0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopy_lane_u64() {
+ let a: u64x1 = u64x1::new(1);
+ let b: u64x1 = u64x1::new(0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let e: u64x1 = u64x1::new(0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x1 = transmute(vcopy_lane_u64::<0, 0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopy_lane_p64() {
+ let a: i64x1 = i64x1::new(1);
+ let b: i64x1 = i64x1::new(0x7F_FF_FF_FF_FF_FF_FF_FF);
+ let e: i64x1 = i64x1::new(0x7F_FF_FF_FF_FF_FF_FF_FF);
+ let r: i64x1 = transmute(vcopy_lane_p64::<0, 0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopy_lane_f64() {
+ let a: f64 = 1.;
+ let b: f64 = 0.;
+ let e: f64 = 0.;
+ let r: f64 = transmute(vcopy_lane_f64::<0, 0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopy_laneq_s64() {
+ let a: i64x1 = i64x1::new(1);
+ let b: i64x2 = i64x2::new(0, 0x7F_FF_FF_FF_FF_FF_FF_FF);
+ let e: i64x1 = i64x1::new(0x7F_FF_FF_FF_FF_FF_FF_FF);
+ let r: i64x1 = transmute(vcopy_laneq_s64::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopy_laneq_u64() {
+ let a: u64x1 = u64x1::new(1);
+ let b: u64x2 = u64x2::new(0, 0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let e: u64x1 = u64x1::new(0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let r: u64x1 = transmute(vcopy_laneq_u64::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopy_laneq_p64() {
+ let a: i64x1 = i64x1::new(1);
+ let b: i64x2 = i64x2::new(0, 0x7F_FF_FF_FF_FF_FF_FF_FF);
+ let e: i64x1 = i64x1::new(0x7F_FF_FF_FF_FF_FF_FF_FF);
+ let r: i64x1 = transmute(vcopy_laneq_p64::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcopy_laneq_f64() {
+ let a: f64 = 1.;
+ let b: f64x2 = f64x2::new(0., 0.5);
+ let e: f64 = 0.5;
+ let r: f64 = transmute(vcopy_laneq_f64::<0, 1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceq_u64() {
+ test_cmp_u64(
+ |i, j| vceq_u64(i, j),
+ |a: u64, b: u64| -> u64 {
+ if a == b {
+ 0xFFFFFFFFFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqq_u64() {
+ testq_cmp_u64(
+ |i, j| vceqq_u64(i, j),
+ |a: u64, b: u64| -> u64 {
+ if a == b {
+ 0xFFFFFFFFFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceq_s64() {
+ test_cmp_s64(
+ |i, j| vceq_s64(i, j),
+ |a: i64, b: i64| -> u64 {
+ if a == b {
+ 0xFFFFFFFFFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqq_s64() {
+ testq_cmp_s64(
+ |i, j| vceqq_s64(i, j),
+ |a: i64, b: i64| -> u64 {
+ if a == b {
+ 0xFFFFFFFFFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceq_p64() {
+ test_cmp_p64(
+ |i, j| vceq_p64(i, j),
+ |a: u64, b: u64| -> u64 {
+ if a == b {
+ 0xFFFFFFFFFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqq_p64() {
+ testq_cmp_p64(
+ |i, j| vceqq_p64(i, j),
+ |a: u64, b: u64| -> u64 {
+ if a == b {
+ 0xFFFFFFFFFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceq_f64() {
+ test_cmp_f64(
+ |i, j| vceq_f64(i, j),
+ |a: f64, b: f64| -> u64 {
+ if a == b {
+ 0xFFFFFFFFFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqq_f64() {
+ testq_cmp_f64(
+ |i, j| vceqq_f64(i, j),
+ |a: f64, b: f64| -> u64 {
+ if a == b {
+ 0xFFFFFFFFFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgt_s64() {
+ test_cmp_s64(
+ |i, j| vcgt_s64(i, j),
+ |a: i64, b: i64| -> u64 {
+ if a > b {
+ 0xFFFFFFFFFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgtq_s64() {
+ testq_cmp_s64(
+ |i, j| vcgtq_s64(i, j),
+ |a: i64, b: i64| -> u64 {
+ if a > b {
+ 0xFFFFFFFFFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgt_u64() {
+ test_cmp_u64(
+ |i, j| vcgt_u64(i, j),
+ |a: u64, b: u64| -> u64 {
+ if a > b {
+ 0xFFFFFFFFFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgtq_u64() {
+ testq_cmp_u64(
+ |i, j| vcgtq_u64(i, j),
+ |a: u64, b: u64| -> u64 {
+ if a > b {
+ 0xFFFFFFFFFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgt_f64() {
+ test_cmp_f64(
+ |i, j| vcgt_f64(i, j),
+ |a: f64, b: f64| -> u64 {
+ if a > b {
+ 0xFFFFFFFFFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgtq_f64() {
+ testq_cmp_f64(
+ |i, j| vcgtq_f64(i, j),
+ |a: f64, b: f64| -> u64 {
+ if a > b {
+ 0xFFFFFFFFFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclt_s64() {
+ test_cmp_s64(
+ |i, j| vclt_s64(i, j),
+ |a: i64, b: i64| -> u64 {
+ if a < b {
+ 0xFFFFFFFFFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcltq_s64() {
+ testq_cmp_s64(
+ |i, j| vcltq_s64(i, j),
+ |a: i64, b: i64| -> u64 {
+ if a < b {
+ 0xFFFFFFFFFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclt_u64() {
+ test_cmp_u64(
+ |i, j| vclt_u64(i, j),
+ |a: u64, b: u64| -> u64 {
+ if a < b {
+ 0xFFFFFFFFFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcltq_u64() {
+ testq_cmp_u64(
+ |i, j| vcltq_u64(i, j),
+ |a: u64, b: u64| -> u64 {
+ if a < b {
+ 0xFFFFFFFFFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vltq_f64() {
+ test_cmp_f64(
+ |i, j| vclt_f64(i, j),
+ |a: f64, b: f64| -> u64 {
+ if a < b {
+ 0xFFFFFFFFFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcltq_f64() {
+ testq_cmp_f64(
+ |i, j| vcltq_f64(i, j),
+ |a: f64, b: f64| -> u64 {
+ if a < b {
+ 0xFFFFFFFFFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcle_s64() {
+ test_cmp_s64(
+ |i, j| vcle_s64(i, j),
+ |a: i64, b: i64| -> u64 {
+ if a <= b {
+ 0xFFFFFFFFFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcleq_s64() {
+ testq_cmp_s64(
+ |i, j| vcleq_s64(i, j),
+ |a: i64, b: i64| -> u64 {
+ if a <= b {
+ 0xFFFFFFFFFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcle_u64() {
+ test_cmp_u64(
+ |i, j| vcle_u64(i, j),
+ |a: u64, b: u64| -> u64 {
+ if a <= b {
+ 0xFFFFFFFFFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcleq_u64() {
+ testq_cmp_u64(
+ |i, j| vcleq_u64(i, j),
+ |a: u64, b: u64| -> u64 {
+ if a <= b {
+ 0xFFFFFFFFFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vleq_f64() {
+ test_cmp_f64(
+ |i, j| vcle_f64(i, j),
+ |a: f64, b: f64| -> u64 {
+ if a <= b {
+ 0xFFFFFFFFFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcleq_f64() {
+ testq_cmp_f64(
+ |i, j| vcleq_f64(i, j),
+ |a: f64, b: f64| -> u64 {
+ if a <= b {
+ 0xFFFFFFFFFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcge_s64() {
+ test_cmp_s64(
+ |i, j| vcge_s64(i, j),
+ |a: i64, b: i64| -> u64 {
+ if a >= b {
+ 0xFFFFFFFFFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgeq_s64() {
+ testq_cmp_s64(
+ |i, j| vcgeq_s64(i, j),
+ |a: i64, b: i64| -> u64 {
+ if a >= b {
+ 0xFFFFFFFFFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcge_u64() {
+ test_cmp_u64(
+ |i, j| vcge_u64(i, j),
+ |a: u64, b: u64| -> u64 {
+ if a >= b {
+ 0xFFFFFFFFFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgeq_u64() {
+ testq_cmp_u64(
+ |i, j| vcgeq_u64(i, j),
+ |a: u64, b: u64| -> u64 {
+ if a >= b {
+ 0xFFFFFFFFFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vgeq_f64() {
+ test_cmp_f64(
+ |i, j| vcge_f64(i, j),
+ |a: f64, b: f64| -> u64 {
+ if a >= b {
+ 0xFFFFFFFFFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgeq_f64() {
+ testq_cmp_f64(
+ |i, j| vcgeq_f64(i, j),
+ |a: f64, b: f64| -> u64 {
+ if a >= b {
+ 0xFFFFFFFFFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmul_f64() {
+ test_ari_f64(|i, j| vmul_f64(i, j), |a: f64, b: f64| -> f64 { a * b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulq_f64() {
+ testq_ari_f64(|i, j| vmulq_f64(i, j), |a: f64, b: f64| -> f64 { a * b });
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsub_f64() {
+ test_ari_f64(|i, j| vsub_f64(i, j), |a: f64, b: f64| -> f64 { a - b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubq_f64() {
+ testq_ari_f64(|i, j| vsubq_f64(i, j), |a: f64, b: f64| -> f64 { a - b });
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabsd_s64() {
+ assert_eq!(vabsd_s64(-1), 1);
+ assert_eq!(vabsd_s64(0), 0);
+ assert_eq!(vabsd_s64(1), 1);
+ assert_eq!(vabsd_s64(i64::MIN), i64::MIN);
+ assert_eq!(vabsd_s64(i64::MIN + 1), i64::MAX);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabs_s64() {
+ let a = i64x1::new(i64::MIN);
+ let r: i64x1 = transmute(vabs_s64(transmute(a)));
+ let e = i64x1::new(i64::MIN);
+ assert_eq!(r, e);
+ let a = i64x1::new(i64::MIN + 1);
+ let r: i64x1 = transmute(vabs_s64(transmute(a)));
+ let e = i64x1::new(i64::MAX);
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabsq_s64() {
+ let a = i64x2::new(i64::MIN, i64::MIN + 1);
+ let r: i64x2 = transmute(vabsq_s64(transmute(a)));
+ let e = i64x2::new(i64::MIN, i64::MAX);
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vbsl_f64() {
+ let a = u64x1::new(u64::MAX);
+ let b = f64x1::new(f64::MAX);
+ let c = f64x1::new(f64::MIN);
+ let e = f64x1::new(f64::MAX);
+ let r: f64x1 = transmute(vbsl_f64(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vbsl_p64() {
+ let a = u64x1::new(u64::MAX);
+ let b = u64x1::new(u64::MAX);
+ let c = u64x1::new(u64::MIN);
+ let e = u64x1::new(u64::MAX);
+ let r: u64x1 = transmute(vbsl_p64(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vbslq_f64() {
+ let a = u64x2::new(u64::MAX, 0);
+ let b = f64x2::new(f64::MAX, f64::MAX);
+ let c = f64x2::new(f64::MIN, f64::MIN);
+ let e = f64x2::new(f64::MAX, f64::MIN);
+ let r: f64x2 = transmute(vbslq_f64(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vbslq_p64() {
+ let a = u64x2::new(u64::MAX, 0);
+ let b = u64x2::new(u64::MAX, u64::MAX);
+ let c = u64x2::new(u64::MIN, u64::MIN);
+ let e = u64x2::new(u64::MAX, u64::MIN);
+ let r: u64x2 = transmute(vbslq_p64(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddv_s16() {
+ let a = i16x4::new(1, 2, 3, -4);
+ let r: i16 = transmute(vaddv_s16(transmute(a)));
+ let e = 2_i16;
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddv_u16() {
+ let a = u16x4::new(1, 2, 3, 4);
+ let r: u16 = transmute(vaddv_u16(transmute(a)));
+ let e = 10_u16;
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddv_s32() {
+ let a = i32x2::new(1, -2);
+ let r: i32 = transmute(vaddv_s32(transmute(a)));
+ let e = -1_i32;
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddv_u32() {
+ let a = u32x2::new(1, 2);
+ let r: u32 = transmute(vaddv_u32(transmute(a)));
+ let e = 3_u32;
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddv_s8() {
+ let a = i8x8::new(1, 2, 3, 4, 5, 6, 7, -8);
+ let r: i8 = transmute(vaddv_s8(transmute(a)));
+ let e = 20_i8;
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddv_u8() {
+ let a = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let r: u8 = transmute(vaddv_u8(transmute(a)));
+ let e = 36_u8;
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddvq_s16() {
+ let a = i16x8::new(1, 2, 3, 4, 5, 6, 7, -8);
+ let r: i16 = transmute(vaddvq_s16(transmute(a)));
+ let e = 20_i16;
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddvq_u16() {
+ let a = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let r: u16 = transmute(vaddvq_u16(transmute(a)));
+ let e = 36_u16;
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddvq_s32() {
+ let a = i32x4::new(1, 2, 3, -4);
+ let r: i32 = transmute(vaddvq_s32(transmute(a)));
+ let e = 2_i32;
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddvq_u32() {
+ let a = u32x4::new(1, 2, 3, 4);
+ let r: u32 = transmute(vaddvq_u32(transmute(a)));
+ let e = 10_u32;
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddvq_s8() {
+ let a = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, -16);
+ let r: i8 = transmute(vaddvq_s8(transmute(a)));
+ let e = 104_i8;
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddvq_u8() {
+ let a = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let r: u8 = transmute(vaddvq_u8(transmute(a)));
+ let e = 136_u8;
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddvq_s64() {
+ let a = i64x2::new(1, -2);
+ let r: i64 = transmute(vaddvq_s64(transmute(a)));
+ let e = -1_i64;
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddvq_u64() {
+ let a = u64x2::new(1, 2);
+ let r: u64 = transmute(vaddvq_u64(transmute(a)));
+ let e = 3_u64;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddlv_s8() {
+ let a = i8x8::new(1, 2, 3, 4, 5, 6, 7, -8);
+ let r: i16 = vaddlv_s8(transmute(a));
+ let e = 20_i16;
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddlv_u8() {
+ let a = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let r: u16 = vaddlv_u8(transmute(a));
+ let e = 36_u16;
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddlvq_s8() {
+ let a = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, -16);
+ let r: i16 = vaddlvq_s8(transmute(a));
+ let e = 104_i16;
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddlvq_u8() {
+ let a = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let r: u16 = vaddlvq_u8(transmute(a));
+ let e = 136_u16;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_f64() {
+ let a: [f64; 2] = [0., 1.];
+ let e = f64x1::new(1.);
+ let r: f64x1 = transmute(vld1_f64(a[1..].as_ptr()));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_f64() {
+ let a: [f64; 3] = [0., 1., 2.];
+ let e = f64x2::new(1., 2.);
+ let r: f64x2 = transmute(vld1q_f64(a[1..].as_ptr()));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_dup_f64() {
+ let a: [f64; 2] = [1., 42.];
+ let e = f64x1::new(42.);
+ let r: f64x1 = transmute(vld1_dup_f64(a[1..].as_ptr()));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_dup_f64() {
+ let elem: f64 = 42.;
+ let e = f64x2::new(42., 42.);
+ let r: f64x2 = transmute(vld1q_dup_f64(&elem));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_lane_f64() {
+ let a = f64x1::new(0.);
+ let elem: f64 = 42.;
+ let e = f64x1::new(42.);
+ let r: f64x1 = transmute(vld1_lane_f64::<0>(&elem, transmute(a)));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_lane_f64() {
+ let a = f64x2::new(0., 1.);
+ let elem: f64 = 42.;
+ let e = f64x2::new(0., 42.);
+ let r: f64x2 = transmute(vld1q_lane_f64::<1>(&elem, transmute(a)));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_f64() {
+ let mut vals = [0_f64; 2];
+ let a = f64x1::new(1.);
+
+ vst1_f64(vals[1..].as_mut_ptr(), transmute(a));
+
+ assert_eq!(vals[0], 0.);
+ assert_eq!(vals[1], 1.);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_f64() {
+ let mut vals = [0_f64; 3];
+ let a = f64x2::new(1., 2.);
+
+ vst1q_f64(vals[1..].as_mut_ptr(), transmute(a));
+
+ assert_eq!(vals[0], 0.);
+ assert_eq!(vals[1], 1.);
+ assert_eq!(vals[2], 2.);
+ }
+
+ #[simd_test(enable = "neon,sm4")]
+ unsafe fn test_vsm3tt1aq_u32() {
+ let a: u32x4 = u32x4::new(1, 2, 3, 4);
+ let b: u32x4 = u32x4::new(1, 2, 3, 4);
+ let c: u32x4 = u32x4::new(1, 2, 3, 4);
+ let e: u32x4 = u32x4::new(2, 1536, 4, 16395);
+ let r: u32x4 = transmute(vsm3tt1aq_u32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon,sm4")]
+ unsafe fn test_vsm3tt1bq_u32() {
+ let a: u32x4 = u32x4::new(1, 2, 3, 4);
+ let b: u32x4 = u32x4::new(1, 2, 3, 4);
+ let c: u32x4 = u32x4::new(1, 2, 3, 4);
+ let e: u32x4 = u32x4::new(2, 1536, 4, 16392);
+ let r: u32x4 = transmute(vsm3tt1bq_u32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon,sm4")]
+ unsafe fn test_vsm3tt2aq_u32() {
+ let a: u32x4 = u32x4::new(1, 2, 3, 4);
+ let b: u32x4 = u32x4::new(1, 2, 3, 4);
+ let c: u32x4 = u32x4::new(1, 2, 3, 4);
+ let e: u32x4 = u32x4::new(2, 1572864, 4, 1447435);
+ let r: u32x4 = transmute(vsm3tt2aq_u32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon,sm4")]
+ unsafe fn test_vsm3tt2bq_u32() {
+ let a: u32x4 = u32x4::new(1, 2, 3, 4);
+ let b: u32x4 = u32x4::new(1, 2, 3, 4);
+ let c: u32x4 = u32x4::new(1, 2, 3, 4);
+ let e: u32x4 = u32x4::new(2, 1572864, 4, 1052680);
+ let r: u32x4 = transmute(vsm3tt2bq_u32::<0>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon,sha3")]
+ unsafe fn test_vxarq_u64() {
+ let a: u64x2 = u64x2::new(1, 2);
+ let b: u64x2 = u64x2::new(3, 4);
+ let e: u64x2 = u64x2::new(2, 6);
+ let r: u64x2 = transmute(vxarq_u64::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+}
+
+#[cfg(test)]
+#[cfg(target_endian = "little")]
+#[path = "../../arm_shared/neon/table_lookup_tests.rs"]
+mod table_lookup_tests;
+
+#[cfg(test)]
+#[path = "../../arm_shared/neon/shift_and_insert_tests.rs"]
+mod shift_and_insert_tests;
+
+#[cfg(test)]
+#[path = "../../arm_shared/neon/load_tests.rs"]
+mod load_tests;
+
+#[cfg(test)]
+#[path = "../../arm_shared/neon/store_tests.rs"]
+mod store_tests;
diff --git a/library/stdarch/crates/core_arch/src/aarch64/prefetch.rs b/library/stdarch/crates/core_arch/src/aarch64/prefetch.rs
new file mode 100644
index 000000000..3ae0ef506
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/aarch64/prefetch.rs
@@ -0,0 +1,73 @@
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+extern "unadjusted" {
+ #[link_name = "llvm.prefetch"]
+ fn prefetch(p: *const i8, rw: i32, loc: i32, ty: i32);
+}
+
+/// See [`prefetch`](fn._prefetch.html).
+pub const _PREFETCH_READ: i32 = 0;
+
+/// See [`prefetch`](fn._prefetch.html).
+pub const _PREFETCH_WRITE: i32 = 1;
+
+/// See [`prefetch`](fn._prefetch.html).
+pub const _PREFETCH_LOCALITY0: i32 = 0;
+
+/// See [`prefetch`](fn._prefetch.html).
+pub const _PREFETCH_LOCALITY1: i32 = 1;
+
+/// See [`prefetch`](fn._prefetch.html).
+pub const _PREFETCH_LOCALITY2: i32 = 2;
+
+/// See [`prefetch`](fn._prefetch.html).
+pub const _PREFETCH_LOCALITY3: i32 = 3;
+
+/// Fetch the cache line that contains address `p` using the given `RW` and `LOCALITY`.
+///
+/// The `RW` must be one of:
+///
+/// * [`_PREFETCH_READ`](constant._PREFETCH_READ.html): the prefetch is preparing
+/// for a read.
+///
+/// * [`_PREFETCH_WRITE`](constant._PREFETCH_WRITE.html): the prefetch is preparing
+/// for a write.
+///
+/// The `LOCALITY` must be one of:
+///
+/// * [`_PREFETCH_LOCALITY0`](constant._PREFETCH_LOCALITY0.html): Streaming or
+/// non-temporal prefetch, for data that is used only once.
+///
+/// * [`_PREFETCH_LOCALITY1`](constant._PREFETCH_LOCALITY1.html): Fetch into level 3 cache.
+///
+/// * [`_PREFETCH_LOCALITY2`](constant._PREFETCH_LOCALITY2.html): Fetch into level 2 cache.
+///
+/// * [`_PREFETCH_LOCALITY3`](constant._PREFETCH_LOCALITY3.html): Fetch into level 1 cache.
+///
+/// The prefetch memory instructions signal to the memory system that memory accesses
+/// from a specified address are likely to occur in the near future. The memory system
+/// can respond by taking actions that are expected to speed up the memory access when
+/// they do occur, such as preloading the specified address into one or more caches.
+/// Because these signals are only hints, it is valid for a particular CPU to treat
+/// any or all prefetch instructions as a NOP.
+///
+///
+/// [Arm's documentation](https://developer.arm.com/documentation/den0024/a/the-a64-instruction-set/memory-access-instructions/prefetching-memory?lang=en)
+#[inline(always)]
+#[cfg_attr(test, assert_instr("prfm pldl1strm", RW = _PREFETCH_READ, LOCALITY = _PREFETCH_LOCALITY0))]
+#[cfg_attr(test, assert_instr("prfm pldl3keep", RW = _PREFETCH_READ, LOCALITY = _PREFETCH_LOCALITY1))]
+#[cfg_attr(test, assert_instr("prfm pldl2keep", RW = _PREFETCH_READ, LOCALITY = _PREFETCH_LOCALITY2))]
+#[cfg_attr(test, assert_instr("prfm pldl1keep", RW = _PREFETCH_READ, LOCALITY = _PREFETCH_LOCALITY3))]
+#[cfg_attr(test, assert_instr("prfm pstl1strm", RW = _PREFETCH_WRITE, LOCALITY = _PREFETCH_LOCALITY0))]
+#[cfg_attr(test, assert_instr("prfm pstl3keep", RW = _PREFETCH_WRITE, LOCALITY = _PREFETCH_LOCALITY1))]
+#[cfg_attr(test, assert_instr("prfm pstl2keep", RW = _PREFETCH_WRITE, LOCALITY = _PREFETCH_LOCALITY2))]
+#[cfg_attr(test, assert_instr("prfm pstl1keep", RW = _PREFETCH_WRITE, LOCALITY = _PREFETCH_LOCALITY3))]
+#[rustc_legacy_const_generics(1, 2)]
+// FIXME: Replace this with the standard ACLE __pld/__pldx/__pli/__plix intrinsics
+pub unsafe fn _prefetch<const RW: i32, const LOCALITY: i32>(p: *const i8) {
+ // We use the `llvm.prefetch` intrinsic with `cache type` = 1 (data cache).
+ static_assert_imm1!(RW);
+ static_assert_imm2!(LOCALITY);
+ prefetch(p, RW, LOCALITY, 1);
+}
diff --git a/library/stdarch/crates/core_arch/src/aarch64/test_support.rs b/library/stdarch/crates/core_arch/src/aarch64/test_support.rs
new file mode 100644
index 000000000..9c5994b15
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/aarch64/test_support.rs
@@ -0,0 +1,184 @@
+use crate::core_arch::{aarch64::neon::*, arm_shared::*, simd::*};
+use std::{i16, i32, i8, mem::transmute, u16, u32, u8, vec::Vec};
+
+macro_rules! V_u64 {
+ () => {
+ vec![
+ 0x0000000000000000u64,
+ 0x0101010101010101u64,
+ 0x0202020202020202u64,
+ 0x0F0F0F0F0F0F0F0Fu64,
+ 0x8080808080808080u64,
+ 0xF0F0F0F0F0F0F0F0u64,
+ 0xFFFFFFFFFFFFFFFFu64,
+ ]
+ };
+}
+
+macro_rules! V_f64 {
+ () => {
+ vec![
+ 0.0f64,
+ 1.0f64,
+ -1.0f64,
+ 1.2f64,
+ 2.4f64,
+ std::f64::MAX,
+ std::f64::MIN,
+ std::f64::INFINITY,
+ std::f64::NEG_INFINITY,
+ std::f64::NAN,
+ ]
+ };
+}
+
+macro_rules! to64 {
+ ($t : ident) => {
+ |v: $t| -> u64 { transmute(v) }
+ };
+}
+
+macro_rules! to128 {
+ ($t : ident) => {
+ |v: $t| -> u128 { transmute(v) }
+ };
+}
+
+pub(crate) fn test<T, U, V, W, X>(
+ vals: Vec<T>,
+ fill1: fn(T) -> V,
+ fill2: fn(U) -> W,
+ cast: fn(W) -> X,
+ test_fun: fn(V, V) -> W,
+ verify_fun: fn(T, T) -> U,
+) where
+ T: Copy + core::fmt::Debug,
+ U: Copy + core::fmt::Debug + std::cmp::PartialEq,
+ V: Copy + core::fmt::Debug,
+ W: Copy + core::fmt::Debug,
+ X: Copy + core::fmt::Debug + std::cmp::PartialEq,
+{
+ let pairs = vals.iter().zip(vals.iter());
+
+ for (i, j) in pairs {
+ let a: V = fill1(*i);
+ let b: V = fill1(*j);
+
+ let actual_pre: W = test_fun(a, b);
+ let expected_pre: W = fill2(verify_fun(*i, *j));
+
+ let actual: X = cast(actual_pre);
+ let expected: X = cast(expected_pre);
+
+ assert_eq!(
+ actual, expected,
+ "[{:?}:{:?}] :\nf({:?}, {:?}) = {:?}\ng({:?}, {:?}) = {:?}\n",
+ *i, *j, &a, &b, actual_pre, &a, &b, expected_pre
+ );
+ }
+}
+
+macro_rules! gen_test_fn {
+ ($n: ident, $t: ident, $u: ident, $v: ident, $w: ident, $x: ident, $vals: expr, $fill1: expr, $fill2: expr, $cast: expr) => {
+ pub(crate) fn $n(test_fun: fn($v, $v) -> $w, verify_fun: fn($t, $t) -> $u) {
+ unsafe {
+ test::<$t, $u, $v, $w, $x>($vals, $fill1, $fill2, $cast, test_fun, verify_fun)
+ };
+ }
+ };
+}
+
+macro_rules! gen_fill_fn {
+ ($id: ident, $el_width: expr, $num_els: expr, $in_t : ident, $out_t: ident, $cmp_t: ident) => {
+ pub(crate) fn $id(val: $in_t) -> $out_t {
+ let initial: [$in_t; $num_els] = [val; $num_els];
+ let result: $cmp_t = unsafe { transmute(initial) };
+ let result_out: $out_t = unsafe { transmute(result) };
+
+ // println!("FILL: {:016x} as {} x {}: {:016x}", val.reverse_bits(), $el_width, $num_els, (result as u64).reverse_bits());
+
+ result_out
+ }
+ };
+}
+
+gen_fill_fn!(fill_u64, 64, 1, u64, uint64x1_t, u64);
+gen_fill_fn!(fillq_u64, 64, 2, u64, uint64x2_t, u128);
+gen_fill_fn!(fill_f64, 64, 1, f64, float64x1_t, u64);
+gen_fill_fn!(fillq_f64, 64, 2, f64, float64x2_t, u128);
+gen_fill_fn!(fill_p64, 64, 1, u64, poly64x1_t, u64);
+gen_fill_fn!(fillq_p64, 64, 2, u64, poly64x2_t, u128);
+
+gen_test_fn!(
+ test_ari_f64,
+ f64,
+ f64,
+ float64x1_t,
+ float64x1_t,
+ u64,
+ V_f64!(),
+ fill_f64,
+ fill_f64,
+ to64!(float64x1_t)
+);
+gen_test_fn!(
+ test_cmp_f64,
+ f64,
+ u64,
+ float64x1_t,
+ uint64x1_t,
+ u64,
+ V_f64!(),
+ fill_f64,
+ fill_u64,
+ to64!(uint64x1_t)
+);
+gen_test_fn!(
+ testq_ari_f64,
+ f64,
+ f64,
+ float64x2_t,
+ float64x2_t,
+ u128,
+ V_f64!(),
+ fillq_f64,
+ fillq_f64,
+ to128!(float64x2_t)
+);
+gen_test_fn!(
+ testq_cmp_f64,
+ f64,
+ u64,
+ float64x2_t,
+ uint64x2_t,
+ u128,
+ V_f64!(),
+ fillq_f64,
+ fillq_u64,
+ to128!(uint64x2_t)
+);
+
+gen_test_fn!(
+ test_cmp_p64,
+ u64,
+ u64,
+ poly64x1_t,
+ uint64x1_t,
+ u64,
+ V_u64!(),
+ fill_p64,
+ fill_u64,
+ to64!(uint64x1_t)
+);
+gen_test_fn!(
+ testq_cmp_p64,
+ u64,
+ u64,
+ poly64x2_t,
+ uint64x2_t,
+ u128,
+ V_u64!(),
+ fillq_p64,
+ fillq_u64,
+ to128!(uint64x2_t)
+);
diff --git a/library/stdarch/crates/core_arch/src/aarch64/tme.rs b/library/stdarch/crates/core_arch/src/aarch64/tme.rs
new file mode 100644
index 000000000..d1b2cf334
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/aarch64/tme.rs
@@ -0,0 +1,179 @@
+//! ARM's Transactional Memory Extensions (TME).
+//!
+//! This CPU feature is available on Aarch64 - A architecture profile.
+//! This feature is in the non-neon feature set. TME specific vendor documentation can
+//! be found [TME Intrinsics Introduction][tme_intrinsics_intro].
+//!
+//! The reference is [ACLE Q4 2019][acle_q4_2019_ref].
+//!
+//! ACLE has a section for TME extensions and state masks for aborts and failure codes.
+//! [ARM A64 Architecture Register Datasheet][a_profile_future] also describes possible failure code scenarios.
+//!
+//! [acle_q4_2019_ref]: https://static.docs.arm.com/101028/0010/ACLE_2019Q4_release-0010.pdf
+//! [tme_intrinsics_intro]: https://developer.arm.com/docs/101028/0010/transactional-memory-extension-tme-intrinsics
+//! [llvm_aarch64_int]: https://github.com/llvm/llvm-project/commit/a36d31478c182903523e04eb271bbf102bfab2cc#diff-ff24e1c35f4d54f1110ce5d90c709319R626-R646
+//! [a_profile_future]: https://static.docs.arm.com/ddi0601/a/SysReg_xml_futureA-2019-04.pdf?_ga=2.116560387.441514988.1590524918-1110153136.1588469296
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+extern "unadjusted" {
+ #[link_name = "llvm.aarch64.tstart"]
+ fn aarch64_tstart() -> u64;
+ #[link_name = "llvm.aarch64.tcommit"]
+ fn aarch64_tcommit() -> ();
+ #[link_name = "llvm.aarch64.tcancel"]
+ fn aarch64_tcancel(imm0: u64) -> ();
+ #[link_name = "llvm.aarch64.ttest"]
+ fn aarch64_ttest() -> u64;
+}
+
+/// Transaction successfully started.
+pub const _TMSTART_SUCCESS: u64 = 0x00_u64;
+
+/// Extraction mask for failure reason
+pub const _TMFAILURE_REASON: u64 = 0x00007FFF_u64;
+
+/// Transaction retry is possible.
+pub const _TMFAILURE_RTRY: u64 = 1 << 15;
+
+/// Transaction executed a TCANCEL instruction
+pub const _TMFAILURE_CNCL: u64 = 1 << 16;
+
+/// Transaction aborted because a conflict occurred
+pub const _TMFAILURE_MEM: u64 = 1 << 17;
+
+/// Fallback error type for any other reason
+pub const _TMFAILURE_IMP: u64 = 1 << 18;
+
+/// Transaction aborted because a non-permissible operation was attempted
+pub const _TMFAILURE_ERR: u64 = 1 << 19;
+
+/// Transaction aborted due to read or write set limit was exceeded
+pub const _TMFAILURE_SIZE: u64 = 1 << 20;
+
+/// Transaction aborted due to transactional nesting level was exceeded
+pub const _TMFAILURE_NEST: u64 = 1 << 21;
+
+/// Transaction aborted due to a debug trap.
+pub const _TMFAILURE_DBG: u64 = 1 << 22;
+
+/// Transaction failed from interrupt
+pub const _TMFAILURE_INT: u64 = 1 << 23;
+
+/// Indicates a TRIVIAL version of TM is available
+pub const _TMFAILURE_TRIVIAL: u64 = 1 << 24;
+
+/// Starts a new transaction. When the transaction starts successfully the return value is 0.
+/// If the transaction fails, all state modifications are discarded and a cause of the failure
+/// is encoded in the return value.
+///
+/// [ARM TME Intrinsics](https://developer.arm.com/docs/101028/0010/transactional-memory-extension-tme-intrinsics).
+#[inline]
+#[target_feature(enable = "tme")]
+#[cfg_attr(test, assert_instr(tstart))]
+pub unsafe fn __tstart() -> u64 {
+ aarch64_tstart()
+}
+
+/// Commits the current transaction. For a nested transaction, the only effect is that the
+/// transactional nesting depth is decreased. For an outer transaction, the state modifications
+/// performed transactionally are committed to the architectural state.
+///
+/// [ARM TME Intrinsics](https://developer.arm.com/docs/101028/0010/transactional-memory-extension-tme-intrinsics).
+#[inline]
+#[target_feature(enable = "tme")]
+#[cfg_attr(test, assert_instr(tcommit))]
+pub unsafe fn __tcommit() {
+ aarch64_tcommit()
+}
+
+/// Cancels the current transaction and discards all state modifications that were performed transactionally.
+///
+/// [ARM TME Intrinsics](https://developer.arm.com/docs/101028/0010/transactional-memory-extension-tme-intrinsics).
+#[inline]
+#[target_feature(enable = "tme")]
+#[cfg_attr(test, assert_instr(tcancel, IMM16 = 0x0))]
+#[rustc_legacy_const_generics(0)]
+pub unsafe fn __tcancel<const IMM16: u64>() {
+ static_assert!(IMM16: u64 where IMM16 <= 65535);
+ aarch64_tcancel(IMM16);
+}
+
+/// Tests if executing inside a transaction. If no transaction is currently executing,
+/// the return value is 0. Otherwise, this intrinsic returns the depth of the transaction.
+///
+/// [ARM TME Intrinsics](https://developer.arm.com/docs/101028/0010/transactional-memory-extension-tme-intrinsics).
+#[inline]
+#[target_feature(enable = "tme")]
+#[cfg_attr(test, assert_instr(ttest))]
+pub unsafe fn __ttest() -> u64 {
+ aarch64_ttest()
+}
+
+#[cfg(test)]
+mod tests {
+ use stdarch_test::simd_test;
+
+ use crate::core_arch::aarch64::*;
+
+ const CANCEL_CODE: u64 = (0 | (0x123 & _TMFAILURE_REASON) as u64) as u64;
+
+ #[simd_test(enable = "tme")]
+ unsafe fn test_tstart() {
+ let mut x = 0;
+ for i in 0..10 {
+ let code = tme::__tstart();
+ if code == _TMSTART_SUCCESS {
+ x += 1;
+ assert_eq!(x, i + 1);
+ break;
+ }
+ assert_eq!(x, 0);
+ }
+ }
+
+ #[simd_test(enable = "tme")]
+ unsafe fn test_tcommit() {
+ let mut x = 0;
+ for i in 0..10 {
+ let code = tme::__tstart();
+ if code == _TMSTART_SUCCESS {
+ x += 1;
+ assert_eq!(x, i + 1);
+ tme::__tcommit();
+ }
+ assert_eq!(x, i + 1);
+ }
+ }
+
+ #[simd_test(enable = "tme")]
+ unsafe fn test_tcancel() {
+ let mut x = 0;
+
+ for i in 0..10 {
+ let code = tme::__tstart();
+ if code == _TMSTART_SUCCESS {
+ x += 1;
+ assert_eq!(x, i + 1);
+ tme::__tcancel::<CANCEL_CODE>();
+ break;
+ }
+ }
+
+ assert_eq!(x, 0);
+ }
+
+ #[simd_test(enable = "tme")]
+ unsafe fn test_ttest() {
+ for _ in 0..10 {
+ let code = tme::__tstart();
+ if code == _TMSTART_SUCCESS {
+ if tme::__ttest() == 2 {
+ tme::__tcancel::<CANCEL_CODE>();
+ break;
+ }
+ }
+ }
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/aarch64/v8.rs b/library/stdarch/crates/core_arch/src/aarch64/v8.rs
new file mode 100644
index 000000000..778721c68
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/aarch64/v8.rs
@@ -0,0 +1,104 @@
+//! ARMv8 intrinsics.
+//!
+//! The reference is [ARMv8-A Reference Manual][armv8].
+//!
+//! [armv8]: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.
+//! ddi0487a.k_10775/index.html
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+/// Reverse the order of the bytes.
+#[inline]
+#[cfg_attr(test, assert_instr(rev))]
+pub unsafe fn _rev_u64(x: u64) -> u64 {
+ x.swap_bytes() as u64
+}
+
+/// Count Leading Zeros.
+#[inline]
+#[cfg_attr(test, assert_instr(clz))]
+pub unsafe fn _clz_u64(x: u64) -> u64 {
+ x.leading_zeros() as u64
+}
+
+/// Reverse the bit order.
+#[inline]
+#[cfg_attr(test, assert_instr(rbit))]
+pub unsafe fn _rbit_u64(x: u64) -> u64 {
+ crate::intrinsics::bitreverse(x)
+}
+
+/// Counts the leading most significant bits set.
+///
+/// When all bits of the operand are set it returns the size of the operand in
+/// bits.
+#[inline]
+#[cfg_attr(test, assert_instr(cls))]
+pub unsafe fn _cls_u32(x: u32) -> u32 {
+ u32::leading_zeros((((((x as i32) >> 31) as u32) ^ x) << 1) | 1) as u32
+}
+
+/// Counts the leading most significant bits set.
+///
+/// When all bits of the operand are set it returns the size of the operand in
+/// bits.
+#[inline]
+#[cfg_attr(test, assert_instr(cls))]
+pub unsafe fn _cls_u64(x: u64) -> u64 {
+ u64::leading_zeros((((((x as i64) >> 63) as u64) ^ x) << 1) | 1) as u64
+}
+
+#[cfg(test)]
+mod tests {
+ use crate::core_arch::aarch64::v8;
+
+ #[test]
+ fn _rev_u64() {
+ unsafe {
+ assert_eq!(
+ v8::_rev_u64(0b0000_0000_1111_1111_0000_0000_1111_1111_u64),
+ 0b1111_1111_0000_0000_1111_1111_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_u64
+ );
+ }
+ }
+
+ #[test]
+ fn _clz_u64() {
+ unsafe {
+ assert_eq!(v8::_clz_u64(0b0000_1010u64), 60u64);
+ }
+ }
+
+ #[test]
+ fn _rbit_u64() {
+ unsafe {
+ assert_eq!(
+ v8::_rbit_u64(0b0000_0000_1111_1101_0000_0000_1111_1111_u64),
+ 0b1111_1111_0000_0000_1011_1111_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_u64
+ );
+ }
+ }
+
+ #[test]
+ fn _cls_u32() {
+ unsafe {
+ assert_eq!(
+ v8::_cls_u32(0b1111_1111_1111_1111_0000_0000_1111_1111_u32),
+ 15_u32
+ );
+ }
+ }
+
+ #[test]
+ fn _cls_u64() {
+ unsafe {
+ assert_eq!(
+ v8::_cls_u64(
+ 0b1111_1111_1111_1111_0000_0000_1111_1111_0000_0000_0000_0000_0000_0000_0000_0000_u64
+ ),
+ 15_u64
+ );
+ }
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/arm/armclang.rs b/library/stdarch/crates/core_arch/src/arm/armclang.rs
new file mode 100644
index 000000000..e68c02d02
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/arm/armclang.rs
@@ -0,0 +1,35 @@
+//! ARM compiler specific intrinsics
+//!
+//! # References
+//!
+//! - [ARM Compiler v 6.10 - armclang Reference Guide][arm_comp_ref]
+//!
+//! [arm_comp_ref]: https://developer.arm.com/docs/100067/0610
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+/// Inserts a breakpoint instruction.
+///
+/// `VAL` is a compile-time constant integer in range `[0, 255]`.
+///
+/// The breakpoint instruction inserted is `BKPT` on A32/T32.
+///
+/// # Note
+///
+/// [ARM's documentation][arm_docs] defines that `__breakpoint` accepts the
+/// following values for `VAL`:
+///
+/// - `0...65535` when compiling as A32,
+/// - `0...255` when compiling as T32.
+///
+/// The current implementation only accepts values in range `[0, 255]`.
+///
+/// [arm_docs]: https://developer.arm.com/docs/100067/latest/compiler-specific-intrinsics/__breakpoint-intrinsic
+#[cfg_attr(test, assert_instr(bkpt, VAL = 0))]
+#[inline(always)]
+#[rustc_legacy_const_generics(0)]
+pub unsafe fn __breakpoint<const VAL: i32>() {
+ static_assert_imm8!(VAL);
+ crate::arch::asm!("bkpt #{}", const VAL);
+}
diff --git a/library/stdarch/crates/core_arch/src/arm/dsp.rs b/library/stdarch/crates/core_arch/src/arm/dsp.rs
new file mode 100644
index 000000000..6720f97a5
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/arm/dsp.rs
@@ -0,0 +1,384 @@
+//! # References:
+//!
+//! - Section 8.3 "16-bit multiplications"
+//!
+//! Intrinsics that could live here:
+//!
+//! - \[x\] __smulbb
+//! - \[x\] __smulbt
+//! - \[x\] __smultb
+//! - \[x\] __smultt
+//! - \[x\] __smulwb
+//! - \[x\] __smulwt
+//! - \[x\] __qadd
+//! - \[x\] __qsub
+//! - \[x\] __qdbl
+//! - \[x\] __smlabb
+//! - \[x\] __smlabt
+//! - \[x\] __smlatb
+//! - \[x\] __smlatt
+//! - \[x\] __smlawb
+//! - \[x\] __smlawt
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+use crate::mem::transmute;
+
+types! {
+ /// ARM-specific 32-bit wide vector of two packed `i16`.
+ pub struct int16x2_t(i16, i16);
+ /// ARM-specific 32-bit wide vector of two packed `u16`.
+ pub struct uint16x2_t(u16, u16);
+}
+
+extern "unadjusted" {
+ #[link_name = "llvm.arm.smulbb"]
+ fn arm_smulbb(a: i32, b: i32) -> i32;
+
+ #[link_name = "llvm.arm.smulbt"]
+ fn arm_smulbt(a: i32, b: i32) -> i32;
+
+ #[link_name = "llvm.arm.smultb"]
+ fn arm_smultb(a: i32, b: i32) -> i32;
+
+ #[link_name = "llvm.arm.smultt"]
+ fn arm_smultt(a: i32, b: i32) -> i32;
+
+ #[link_name = "llvm.arm.smulwb"]
+ fn arm_smulwb(a: i32, b: i32) -> i32;
+
+ #[link_name = "llvm.arm.smulwt"]
+ fn arm_smulwt(a: i32, b: i32) -> i32;
+
+ #[link_name = "llvm.arm.qadd"]
+ fn arm_qadd(a: i32, b: i32) -> i32;
+
+ #[link_name = "llvm.arm.qsub"]
+ fn arm_qsub(a: i32, b: i32) -> i32;
+
+ #[link_name = "llvm.arm.smlabb"]
+ fn arm_smlabb(a: i32, b: i32, c: i32) -> i32;
+
+ #[link_name = "llvm.arm.smlabt"]
+ fn arm_smlabt(a: i32, b: i32, c: i32) -> i32;
+
+ #[link_name = "llvm.arm.smlatb"]
+ fn arm_smlatb(a: i32, b: i32, c: i32) -> i32;
+
+ #[link_name = "llvm.arm.smlatt"]
+ fn arm_smlatt(a: i32, b: i32, c: i32) -> i32;
+
+ #[link_name = "llvm.arm.smlawb"]
+ fn arm_smlawb(a: i32, b: i32, c: i32) -> i32;
+
+ #[link_name = "llvm.arm.smlawt"]
+ fn arm_smlawt(a: i32, b: i32, c: i32) -> i32;
+}
+
+/// Insert a SMULBB instruction
+///
+/// Returns the equivalent of a\[0\] * b\[0\]
+/// where \[0\] is the lower 16 bits and \[1\] is the upper 16 bits.
+#[inline]
+#[cfg_attr(test, assert_instr(smulbb))]
+pub unsafe fn __smulbb(a: int16x2_t, b: int16x2_t) -> i32 {
+ arm_smulbb(transmute(a), transmute(b))
+}
+
+/// Insert a SMULTB instruction
+///
+/// Returns the equivalent of a\[0\] * b\[1\]
+/// where \[0\] is the lower 16 bits and \[1\] is the upper 16 bits.
+#[inline]
+#[cfg_attr(test, assert_instr(smultb))]
+pub unsafe fn __smultb(a: int16x2_t, b: int16x2_t) -> i32 {
+ arm_smultb(transmute(a), transmute(b))
+}
+
+/// Insert a SMULTB instruction
+///
+/// Returns the equivalent of a\[1\] * b\[0\]
+/// where \[0\] is the lower 16 bits and \[1\] is the upper 16 bits.
+#[inline]
+#[cfg_attr(test, assert_instr(smulbt))]
+pub unsafe fn __smulbt(a: int16x2_t, b: int16x2_t) -> i32 {
+ arm_smulbt(transmute(a), transmute(b))
+}
+
+/// Insert a SMULTT instruction
+///
+/// Returns the equivalent of a\[1\] * b\[1\]
+/// where \[0\] is the lower 16 bits and \[1\] is the upper 16 bits.
+#[inline]
+#[cfg_attr(test, assert_instr(smultt))]
+pub unsafe fn __smultt(a: int16x2_t, b: int16x2_t) -> i32 {
+ arm_smultt(transmute(a), transmute(b))
+}
+
+/// Insert a SMULWB instruction
+///
+/// Multiplies the 32-bit signed first operand with the low halfword
+/// (as a 16-bit signed integer) of the second operand.
+/// Return the top 32 bits of the 48-bit product
+#[inline]
+#[cfg_attr(test, assert_instr(smulwb))]
+pub unsafe fn __smulwb(a: int16x2_t, b: i32) -> i32 {
+ arm_smulwb(transmute(a), b)
+}
+
+/// Insert a SMULWT instruction
+///
+/// Multiplies the 32-bit signed first operand with the high halfword
+/// (as a 16-bit signed integer) of the second operand.
+/// Return the top 32 bits of the 48-bit product
+#[inline]
+#[cfg_attr(test, assert_instr(smulwt))]
+pub unsafe fn __smulwt(a: int16x2_t, b: i32) -> i32 {
+ arm_smulwt(transmute(a), b)
+}
+
+/// Signed saturating addition
+///
+/// Returns the 32-bit saturating signed equivalent of a + b.
+/// Sets the Q flag if saturation occurs.
+#[inline]
+#[cfg_attr(test, assert_instr(qadd))]
+pub unsafe fn __qadd(a: i32, b: i32) -> i32 {
+ arm_qadd(a, b)
+}
+
+/// Signed saturating subtraction
+///
+/// Returns the 32-bit saturating signed equivalent of a - b.
+/// Sets the Q flag if saturation occurs.
+#[inline]
+#[cfg_attr(test, assert_instr(qsub))]
+pub unsafe fn __qsub(a: i32, b: i32) -> i32 {
+ arm_qsub(a, b)
+}
+
+/// Insert a QADD instruction
+///
+/// Returns the 32-bit saturating signed equivalent of a + a
+/// Sets the Q flag if saturation occurs.
+#[inline]
+#[cfg_attr(test, assert_instr(qadd))]
+pub unsafe fn __qdbl(a: i32) -> i32 {
+ arm_qadd(a, a)
+}
+
+/// Insert a SMLABB instruction
+///
+/// Returns the equivalent of a\[0\] * b\[0\] + c
+/// where \[0\] is the lower 16 bits and \[1\] is the upper 16 bits.
+/// Sets the Q flag if overflow occurs on the addition.
+#[inline]
+#[cfg_attr(test, assert_instr(smlabb))]
+pub unsafe fn __smlabb(a: int16x2_t, b: int16x2_t, c: i32) -> i32 {
+ arm_smlabb(transmute(a), transmute(b), c)
+}
+
+/// Insert a SMLABT instruction
+///
+/// Returns the equivalent of a\[0\] * b\[1\] + c
+/// where \[0\] is the lower 16 bits and \[1\] is the upper 16 bits.
+/// Sets the Q flag if overflow occurs on the addition.
+#[inline]
+#[cfg_attr(test, assert_instr(smlabt))]
+pub unsafe fn __smlabt(a: int16x2_t, b: int16x2_t, c: i32) -> i32 {
+ arm_smlabt(transmute(a), transmute(b), c)
+}
+
+/// Insert a SMLATB instruction
+///
+/// Returns the equivalent of a\[1\] * b\[0\] + c
+/// where \[0\] is the lower 16 bits and \[1\] is the upper 16 bits.
+/// Sets the Q flag if overflow occurs on the addition.
+#[inline]
+#[cfg_attr(test, assert_instr(smlatb))]
+pub unsafe fn __smlatb(a: int16x2_t, b: int16x2_t, c: i32) -> i32 {
+ arm_smlatb(transmute(a), transmute(b), c)
+}
+
+/// Insert a SMLATT instruction
+///
+/// Returns the equivalent of a\[1\] * b\[1\] + c
+/// where \[0\] is the lower 16 bits and \[1\] is the upper 16 bits.
+/// Sets the Q flag if overflow occurs on the addition.
+#[inline]
+#[cfg_attr(test, assert_instr(smlatt))]
+pub unsafe fn __smlatt(a: int16x2_t, b: int16x2_t, c: i32) -> i32 {
+ arm_smlatt(transmute(a), transmute(b), c)
+}
+
+/// Insert a SMLAWB instruction
+///
+/// Returns the equivalent of (a * b\[0\] + (c << 16)) >> 16
+/// where \[0\] is the lower 16 bits and \[1\] is the upper 16 bits.
+/// Sets the Q flag if overflow occurs on the addition.
+#[inline]
+#[cfg_attr(test, assert_instr(smlawb))]
+pub unsafe fn __smlawb(a: i32, b: int16x2_t, c: i32) -> i32 {
+ arm_smlawb(a, transmute(b), c)
+}
+
+/// Insert a SMLAWT instruction
+///
+/// Returns the equivalent of (a * b\[1\] + (c << 16)) >> 16
+/// where \[0\] is the lower 16 bits and \[1\] is the upper 16 bits.
+/// Sets the Q flag if overflow occurs on the addition.
+#[inline]
+#[cfg_attr(test, assert_instr(smlawt))]
+pub unsafe fn __smlawt(a: i32, b: int16x2_t, c: i32) -> i32 {
+ arm_smlawt(a, transmute(b), c)
+}
+
+#[cfg(test)]
+mod tests {
+ use crate::core_arch::{
+ arm::*,
+ simd::{i16x2, i8x4, u8x4},
+ };
+ use std::mem::transmute;
+ use stdarch_test::simd_test;
+
+ #[test]
+ fn smulbb() {
+ unsafe {
+ let a = i16x2::new(10, 20);
+ let b = i16x2::new(30, 40);
+ assert_eq!(super::__smulbb(transmute(a), transmute(b)), 10 * 30);
+ }
+ }
+
+ #[test]
+ fn smulbt() {
+ unsafe {
+ let a = i16x2::new(10, 20);
+ let b = i16x2::new(30, 40);
+ assert_eq!(super::__smulbt(transmute(a), transmute(b)), 10 * 40);
+ }
+ }
+
+ #[test]
+ fn smultb() {
+ unsafe {
+ let a = i16x2::new(10, 20);
+ let b = i16x2::new(30, 40);
+ assert_eq!(super::__smultb(transmute(a), transmute(b)), 20 * 30);
+ }
+ }
+
+ #[test]
+ fn smultt() {
+ unsafe {
+ let a = i16x2::new(10, 20);
+ let b = i16x2::new(30, 40);
+ assert_eq!(super::__smultt(transmute(a), transmute(b)), 20 * 40);
+ }
+ }
+
+ #[test]
+ fn smulwb() {
+ unsafe {
+ let a = i16x2::new(10, 20);
+ let b = 30;
+ assert_eq!(super::__smulwb(transmute(a), b), 20 * b);
+ }
+ }
+
+ #[test]
+ fn smulwt() {
+ unsafe {
+ let a = i16x2::new(10, 20);
+ let b = 30;
+ assert_eq!(super::__smulwt(transmute(a), b), (10 * b) >> 16);
+ }
+ }
+
+ #[test]
+ fn qadd() {
+ unsafe {
+ assert_eq!(super::__qadd(-10, 60), 50);
+ assert_eq!(super::__qadd(i32::MAX, 10), i32::MAX);
+ assert_eq!(super::__qadd(i32::MIN, -10), i32::MIN);
+ }
+ }
+
+ #[test]
+ fn qsub() {
+ unsafe {
+ assert_eq!(super::__qsub(10, 60), -50);
+ assert_eq!(super::__qsub(i32::MAX, -10), i32::MAX);
+ assert_eq!(super::__qsub(i32::MIN, 10), i32::MIN);
+ }
+ }
+
+ fn qdbl() {
+ unsafe {
+ assert_eq!(super::__qdbl(10), 20);
+ assert_eq!(super::__qdbl(i32::MAX), i32::MAX);
+ }
+ }
+
+ fn smlabb() {
+ unsafe {
+ let a = i16x2::new(10, 20);
+ let b = i16x2::new(30, 40);
+ let c = 50;
+ let r = (10 * 30) + c;
+ assert_eq!(super::__smlabb(transmute(a), transmute(b), c), r);
+ }
+ }
+
+ fn smlabt() {
+ unsafe {
+ let a = i16x2::new(10, 20);
+ let b = i16x2::new(30, 40);
+ let c = 50;
+ let r = (10 * 40) + c;
+ assert_eq!(super::__smlabt(transmute(a), transmute(b), c), r);
+ }
+ }
+
+ fn smlatb() {
+ unsafe {
+ let a = i16x2::new(10, 20);
+ let b = i16x2::new(30, 40);
+ let c = 50;
+ let r = (20 * 30) + c;
+ assert_eq!(super::__smlabt(transmute(a), transmute(b), c), r);
+ }
+ }
+
+ fn smlatt() {
+ unsafe {
+ let a = i16x2::new(10, 20);
+ let b = i16x2::new(30, 40);
+ let c = 50;
+ let r = (20 * 40) + c;
+ assert_eq!(super::__smlatt(transmute(a), transmute(b), c), r);
+ }
+ }
+
+ fn smlawb() {
+ unsafe {
+ let a: i32 = 10;
+ let b = i16x2::new(30, 40);
+ let c: i32 = 50;
+ let r: i32 = ((a * 30) + (c << 16)) >> 16;
+ assert_eq!(super::__smlawb(a, transmute(b), c), r);
+ }
+ }
+
+ fn smlawt() {
+ unsafe {
+ let a: i32 = 10;
+ let b = i16x2::new(30, 40);
+ let c: i32 = 50;
+ let r: i32 = ((a * 40) + (c << 16)) >> 16;
+ assert_eq!(super::__smlawt(a, transmute(b), c), r);
+ }
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/arm/ex.rs b/library/stdarch/crates/core_arch/src/arm/ex.rs
new file mode 100644
index 000000000..75f378642
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/arm/ex.rs
@@ -0,0 +1,125 @@
+// Reference: Section 5.4.4 "LDREX / STREX" of ACLE
+
+/// Removes the exclusive lock created by LDREX
+// Supported: v6, v6K, v7-M, v7-A, v7-R
+// Not supported: v5, v6-M
+// NOTE: there's no dedicated CLREX instruction in v6 (<v6k); to clear the exclusive monitor users
+// have to do a dummy STREX operation
+#[cfg(any(
+ all(target_feature = "v6k", not(target_feature = "mclass")), // excludes v6-M
+ all(target_feature = "v7", target_feature = "mclass"), // v7-M
+ doc
+))]
+pub unsafe fn __clrex() {
+ extern "unadjusted" {
+ #[link_name = "llvm.arm.clrex"]
+ fn clrex();
+ }
+
+ clrex()
+}
+
+/// Executes an exclusive LDR instruction for 8 bit value.
+// Supported: v6K, v7-M, v7-A, v7-R
+// Not supported: v5, v6, v6-M
+#[cfg(any(
+ target_feature = "v6k", // includes v7-M but excludes v6-M
+ doc
+))]
+pub unsafe fn __ldrexb(p: *const u8) -> u8 {
+ extern "unadjusted" {
+ #[link_name = "llvm.arm.ldrex.p0i8"]
+ fn ldrex8(p: *const u8) -> u32;
+ }
+
+ ldrex8(p) as u8
+}
+
+/// Executes an exclusive LDR instruction for 16 bit value.
+// Supported: v6K, v7-M, v7-A, v7-R, v8
+// Not supported: v5, v6, v6-M
+#[cfg(any(
+ target_feature = "v6k", // includes v7-M but excludes v6-M
+ doc
+))]
+pub unsafe fn __ldrexh(p: *const u16) -> u16 {
+ extern "unadjusted" {
+ #[link_name = "llvm.arm.ldrex.p0i16"]
+ fn ldrex16(p: *const u16) -> u32;
+ }
+
+ ldrex16(p) as u16
+}
+
+/// Executes an exclusive LDR instruction for 32 bit value.
+// Supported: v6, v7-M, v6K, v7-A, v7-R, v8
+// Not supported: v5, v6-M
+#[cfg(any(
+ all(target_feature = "v6", not(target_feature = "mclass")), // excludes v6-M
+ all(target_feature = "v7", target_feature = "mclass"), // v7-M
+ doc
+))]
+pub unsafe fn __ldrex(p: *const u32) -> u32 {
+ extern "unadjusted" {
+ #[link_name = "llvm.arm.ldrex.p0i32"]
+ fn ldrex32(p: *const u32) -> u32;
+ }
+
+ ldrex32(p)
+}
+
+/// Executes an exclusive STR instruction for 8 bit values
+///
+/// Returns `0` if the operation succeeded, or `1` if it failed
+// supported: v6K, v7-M, v7-A, v7-R
+// Not supported: v5, v6, v6-M
+#[cfg(any(
+ target_feature = "v6k", // includes v7-M but excludes v6-M
+ doc
+))]
+pub unsafe fn __strexb(value: u32, addr: *mut u8) -> u32 {
+ extern "unadjusted" {
+ #[link_name = "llvm.arm.strex.p0i8"]
+ fn strex8(value: u32, addr: *mut u8) -> u32;
+ }
+
+ strex8(value, addr)
+}
+
+/// Executes an exclusive STR instruction for 16 bit values
+///
+/// Returns `0` if the operation succeeded, or `1` if it failed
+// Supported: v6K, v7-M, v7-A, v7-R, v8
+// Not supported: v5, v6, v6-M
+#[cfg(target_feature = "aarch64")]
+#[cfg(any(
+ target_feature = "v6k", // includes v7-M but excludes v6-M
+ doc
+))]
+pub unsafe fn __strexh(value: u16, addr: *mut u16) -> u32 {
+ extern "unadjusted" {
+ #[link_name = "llvm.arm.strex.p0i16"]
+ fn strex16(value: u32, addr: *mut u16) -> u32;
+ }
+
+ strex16(value as u32, addr)
+}
+
+/// Executes an exclusive STR instruction for 32 bit values
+///
+/// Returns `0` if the operation succeeded, or `1` if it failed
+// Supported: v6, v7-M, v6K, v7-A, v7-R, v8
+// Not supported: v5, v6-M
+#[cfg(any(
+ all(target_feature = "v6", not(target_feature = "mclass")), // excludes v6-M
+ all(target_feature = "v7", target_feature = "mclass"), // v7-M
+ doc
+))]
+pub unsafe fn __strex(value: u32, addr: *mut u32) -> u32 {
+ extern "unadjusted" {
+ #[link_name = "llvm.arm.strex.p0i32"]
+ fn strex32(value: u32, addr: *mut u32) -> u32;
+ }
+
+ strex32(value, addr)
+}
diff --git a/library/stdarch/crates/core_arch/src/arm/mod.rs b/library/stdarch/crates/core_arch/src/arm/mod.rs
new file mode 100644
index 000000000..efe0068d4
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/arm/mod.rs
@@ -0,0 +1,113 @@
+//! ARM intrinsics.
+//!
+//! The reference for NEON is [ARM's NEON Intrinsics Reference][arm_ref]. The
+//! [ARM's NEON Intrinsics Online Database][arm_dat] is also useful.
+//!
+//! [arm_ref]: http://infocenter.arm.com/help/topic/com.arm.doc.ihi0073a/IHI0073A_arm_neon_intrinsics_ref.pdf
+//! [arm_dat]: https://developer.arm.com/technologies/neon/intrinsics
+
+mod armclang;
+pub use self::armclang::*;
+
+mod v6;
+pub use self::v6::*;
+
+// Supported arches: 6, 7-M. See Section 10.1 of ACLE (e.g. SSAT)
+#[cfg(any(target_feature = "v6", doc))]
+mod sat;
+
+#[cfg(any(target_feature = "v6", doc))]
+pub use self::sat::*;
+
+// Supported arches: 5TE, 7E-M. See Section 10.1 of ACLE (e.g. QADD)
+// We also include the A profile even though DSP is deprecated on that profile as of ACLE 2.0 (see
+// section 5.4.7)
+// Here we workaround the difference between LLVM's +dsp and ACLE's __ARM_FEATURE_DSP by gating on
+// '+v5te' rather than on '+dsp'
+#[cfg(any(
+ // >= v5TE but excludes v7-M
+ all(target_feature = "v5te", not(target_feature = "mclass")),
+ // v7E-M
+ all(target_feature = "mclass", target_feature = "dsp"),
+ doc,
+))]
+pub mod dsp;
+
+#[cfg(any(
+ // >= v5TE but excludes v7-M
+ all(target_feature = "v5te", not(target_feature = "mclass")),
+ // v7E-M
+ all(target_feature = "mclass", target_feature = "dsp"),
+ doc,
+))]
+pub use self::dsp::*;
+
+// Deprecated in ACLE 2.0 for the A profile but fully supported on the M and R profiles, says
+// Section 5.4.9 of ACLE. We'll expose these for the A profile even if deprecated
+#[cfg(any(
+ // v7-A, v7-R
+ all(target_feature = "v6", not(target_feature = "mclass")),
+ // v7E-M
+ all(target_feature = "mclass", target_feature = "dsp"),
+ doc,
+))]
+mod simd32;
+
+#[cfg(any(
+ // v7-A, v7-R
+ all(target_feature = "v6", not(target_feature = "mclass")),
+ // v7E-M
+ all(target_feature = "mclass", target_feature = "dsp"),
+ doc,
+))]
+pub use self::simd32::*;
+
+#[cfg(any(target_feature = "v7", doc))]
+mod v7;
+#[cfg(any(target_feature = "v7", doc))]
+pub use self::v7::*;
+
+mod ex;
+pub use self::ex::*;
+
+pub use crate::core_arch::arm_shared::*;
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+#[cfg(any(target_feature = "v7", doc))]
+pub(crate) mod neon;
+#[cfg(any(target_feature = "v7", doc))]
+pub use neon::*;
+
+/// Generates the trap instruction `UDF`
+#[cfg(target_arch = "arm")]
+#[cfg_attr(test, assert_instr(udf))]
+#[inline]
+pub unsafe fn udf() -> ! {
+ crate::intrinsics::abort()
+}
+
+/// Generates a DBG instruction.
+///
+/// This provides a hint to debugging and related systems. The argument must be
+/// a constant integer from 0 to 15 inclusive. See implementation documentation
+/// for the effect (if any) of this instruction and the meaning of the
+/// argument. This is available only when compiling for AArch32.
+// Section 10.1 of ACLE says that the supported arches are: 7, 7-M
+// "The DBG hint instruction is added in ARMv7. It is UNDEFINED in the ARMv6 base architecture, and
+// executes as a NOP instruction in ARMv6K and ARMv6T2." - ARM Architecture Reference Manual ARMv7-A
+// and ARMv7-R edition (ARM DDI 0406C.c) sections D12.4.1 "ARM instruction set support" and D12.4.2
+// "Thumb instruction set support"
+#[cfg(any(target_feature = "v7", doc))]
+#[inline(always)]
+#[rustc_legacy_const_generics(0)]
+pub unsafe fn __dbg<const IMM4: i32>() {
+ static_assert_imm4!(IMM4);
+ dbg(IMM4);
+}
+
+extern "unadjusted" {
+ #[link_name = "llvm.arm.dbg"]
+ fn dbg(_: i32);
+}
diff --git a/library/stdarch/crates/core_arch/src/arm/neon.rs b/library/stdarch/crates/core_arch/src/arm/neon.rs
new file mode 100644
index 000000000..a0ad92c33
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/arm/neon.rs
@@ -0,0 +1,1369 @@
+use crate::core_arch::arm_shared::neon::*;
+use crate::core_arch::simd::{f32x4, i32x4, u32x4};
+use crate::core_arch::simd_llvm::*;
+use crate::mem::{align_of, transmute};
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+#[allow(non_camel_case_types)]
+pub(crate) type p8 = u8;
+#[allow(non_camel_case_types)]
+pub(crate) type p16 = u16;
+
+#[allow(improper_ctypes)]
+extern "unadjusted" {
+ #[link_name = "llvm.arm.neon.vbsl.v8i8"]
+ fn vbsl_s8_(a: int8x8_t, b: int8x8_t, c: int8x8_t) -> int8x8_t;
+ #[link_name = "llvm.arm.neon.vbsl.v16i8"]
+ fn vbslq_s8_(a: int8x16_t, b: int8x16_t, c: int8x16_t) -> int8x16_t;
+ #[link_name = "llvm.arm.neon.vpadals.v4i16.v8i8"]
+ pub(crate) fn vpadal_s8_(a: int16x4_t, b: int8x8_t) -> int16x4_t;
+ #[link_name = "llvm.arm.neon.vpadals.v2i32.v4i16"]
+ pub(crate) fn vpadal_s16_(a: int32x2_t, b: int16x4_t) -> int32x2_t;
+ #[link_name = "llvm.arm.neon.vpadals.v1i64.v2i32"]
+ pub(crate) fn vpadal_s32_(a: int64x1_t, b: int32x2_t) -> int64x1_t;
+ #[link_name = "llvm.arm.neon.vpadals.v8i16.v16i8"]
+ pub(crate) fn vpadalq_s8_(a: int16x8_t, b: int8x16_t) -> int16x8_t;
+ #[link_name = "llvm.arm.neon.vpadals.v4i32.v8i16"]
+ pub(crate) fn vpadalq_s16_(a: int32x4_t, b: int16x8_t) -> int32x4_t;
+ #[link_name = "llvm.arm.neon.vpadals.v2i64.v4i32"]
+ pub(crate) fn vpadalq_s32_(a: int64x2_t, b: int32x4_t) -> int64x2_t;
+
+ #[link_name = "llvm.arm.neon.vpadalu.v4i16.v8i8"]
+ pub(crate) fn vpadal_u8_(a: uint16x4_t, b: uint8x8_t) -> uint16x4_t;
+ #[link_name = "llvm.arm.neon.vpadalu.v2i32.v4i16"]
+ pub(crate) fn vpadal_u16_(a: uint32x2_t, b: uint16x4_t) -> uint32x2_t;
+ #[link_name = "llvm.arm.neon.vpadalu.v1i64.v2i32"]
+ pub(crate) fn vpadal_u32_(a: uint64x1_t, b: uint32x2_t) -> uint64x1_t;
+ #[link_name = "llvm.arm.neon.vpadalu.v8i16.v16i8"]
+ pub(crate) fn vpadalq_u8_(a: uint16x8_t, b: uint8x16_t) -> uint16x8_t;
+ #[link_name = "llvm.arm.neon.vpadalu.v4i32.v8i16"]
+ pub(crate) fn vpadalq_u16_(a: uint32x4_t, b: uint16x8_t) -> uint32x4_t;
+ #[link_name = "llvm.arm.neon.vpadalu.v2i64.v4i32"]
+ pub(crate) fn vpadalq_u32_(a: uint64x2_t, b: uint32x4_t) -> uint64x2_t;
+
+ #[link_name = "llvm.arm.neon.vtbl1"]
+ fn vtbl1(a: int8x8_t, b: int8x8_t) -> int8x8_t;
+ #[link_name = "llvm.arm.neon.vtbl2"]
+ fn vtbl2(a: int8x8_t, b: int8x8_t, b: int8x8_t) -> int8x8_t;
+ #[link_name = "llvm.arm.neon.vtbl3"]
+ fn vtbl3(a: int8x8_t, b: int8x8_t, b: int8x8_t, c: int8x8_t) -> int8x8_t;
+ #[link_name = "llvm.arm.neon.vtbl4"]
+ fn vtbl4(a: int8x8_t, b: int8x8_t, b: int8x8_t, c: int8x8_t, d: int8x8_t) -> int8x8_t;
+
+ #[link_name = "llvm.arm.neon.vtbx1"]
+ fn vtbx1(a: int8x8_t, b: int8x8_t, b: int8x8_t) -> int8x8_t;
+ #[link_name = "llvm.arm.neon.vtbx2"]
+ fn vtbx2(a: int8x8_t, b: int8x8_t, b: int8x8_t, c: int8x8_t) -> int8x8_t;
+ #[link_name = "llvm.arm.neon.vtbx3"]
+ fn vtbx3(a: int8x8_t, b: int8x8_t, b: int8x8_t, c: int8x8_t, d: int8x8_t) -> int8x8_t;
+ #[link_name = "llvm.arm.neon.vtbx4"]
+ fn vtbx4(
+ a: int8x8_t,
+ b: int8x8_t,
+ b: int8x8_t,
+ c: int8x8_t,
+ d: int8x8_t,
+ e: int8x8_t,
+ ) -> int8x8_t;
+
+ #[link_name = "llvm.arm.neon.vshiftins.v8i8"]
+ fn vshiftins_v8i8(a: int8x8_t, b: int8x8_t, shift: int8x8_t) -> int8x8_t;
+ #[link_name = "llvm.arm.neon.vshiftins.v16i8"]
+ fn vshiftins_v16i8(a: int8x16_t, b: int8x16_t, shift: int8x16_t) -> int8x16_t;
+ #[link_name = "llvm.arm.neon.vshiftins.v4i16"]
+ fn vshiftins_v4i16(a: int16x4_t, b: int16x4_t, shift: int16x4_t) -> int16x4_t;
+ #[link_name = "llvm.arm.neon.vshiftins.v8i16"]
+ fn vshiftins_v8i16(a: int16x8_t, b: int16x8_t, shift: int16x8_t) -> int16x8_t;
+ #[link_name = "llvm.arm.neon.vshiftins.v2i32"]
+ fn vshiftins_v2i32(a: int32x2_t, b: int32x2_t, shift: int32x2_t) -> int32x2_t;
+ #[link_name = "llvm.arm.neon.vshiftins.v4i32"]
+ fn vshiftins_v4i32(a: int32x4_t, b: int32x4_t, shift: int32x4_t) -> int32x4_t;
+ #[link_name = "llvm.arm.neon.vshiftins.v1i64"]
+ fn vshiftins_v1i64(a: int64x1_t, b: int64x1_t, shift: int64x1_t) -> int64x1_t;
+ #[link_name = "llvm.arm.neon.vshiftins.v2i64"]
+ fn vshiftins_v2i64(a: int64x2_t, b: int64x2_t, shift: int64x2_t) -> int64x2_t;
+
+ #[link_name = "llvm.arm.neon.vld1.v8i8.p0i8"]
+ fn vld1_v8i8(addr: *const i8, align: i32) -> int8x8_t;
+ #[link_name = "llvm.arm.neon.vld1.v16i8.p0i8"]
+ fn vld1q_v16i8(addr: *const i8, align: i32) -> int8x16_t;
+ #[link_name = "llvm.arm.neon.vld1.v4i16.p0i8"]
+ fn vld1_v4i16(addr: *const i8, align: i32) -> int16x4_t;
+ #[link_name = "llvm.arm.neon.vld1.v8i16.p0i8"]
+ fn vld1q_v8i16(addr: *const i8, align: i32) -> int16x8_t;
+ #[link_name = "llvm.arm.neon.vld1.v2i32.p0i8"]
+ fn vld1_v2i32(addr: *const i8, align: i32) -> int32x2_t;
+ #[link_name = "llvm.arm.neon.vld1.v4i32.p0i8"]
+ fn vld1q_v4i32(addr: *const i8, align: i32) -> int32x4_t;
+ #[link_name = "llvm.arm.neon.vld1.v1i64.p0i8"]
+ fn vld1_v1i64(addr: *const i8, align: i32) -> int64x1_t;
+ #[link_name = "llvm.arm.neon.vld1.v2i64.p0i8"]
+ fn vld1q_v2i64(addr: *const i8, align: i32) -> int64x2_t;
+ #[link_name = "llvm.arm.neon.vld1.v2f32.p0i8"]
+ fn vld1_v2f32(addr: *const i8, align: i32) -> float32x2_t;
+ #[link_name = "llvm.arm.neon.vld1.v4f32.p0i8"]
+ fn vld1q_v4f32(addr: *const i8, align: i32) -> float32x4_t;
+
+ #[link_name = "llvm.arm.neon.vst1.p0i8.v8i8"]
+ fn vst1_v8i8(addr: *const i8, val: int8x8_t, align: i32);
+ #[link_name = "llvm.arm.neon.vst1.p0i8.v16i8"]
+ fn vst1q_v16i8(addr: *const i8, val: int8x16_t, align: i32);
+ #[link_name = "llvm.arm.neon.vst1.p0i8.v4i16"]
+ fn vst1_v4i16(addr: *const i8, val: int16x4_t, align: i32);
+ #[link_name = "llvm.arm.neon.vst1.p0i8.v8i16"]
+ fn vst1q_v8i16(addr: *const i8, val: int16x8_t, align: i32);
+ #[link_name = "llvm.arm.neon.vst1.p0i8.v2i32"]
+ fn vst1_v2i32(addr: *const i8, val: int32x2_t, align: i32);
+ #[link_name = "llvm.arm.neon.vst1.p0i8.v4i32"]
+ fn vst1q_v4i32(addr: *const i8, val: int32x4_t, align: i32);
+ #[link_name = "llvm.arm.neon.vst1.p0i8.v1i64"]
+ fn vst1_v1i64(addr: *const i8, val: int64x1_t, align: i32);
+ #[link_name = "llvm.arm.neon.vst1.p0i8.v2i64"]
+ fn vst1q_v2i64(addr: *const i8, val: int64x2_t, align: i32);
+ #[link_name = "llvm.arm.neon.vst1.p0i8.v2f32"]
+ fn vst1_v2f32(addr: *const i8, val: float32x2_t, align: i32);
+ #[link_name = "llvm.arm.neon.vst1.p0i8.v4f32"]
+ fn vst1q_v4f32(addr: *const i8, val: float32x4_t, align: i32);
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vld1.8"))]
+pub unsafe fn vld1_s8(ptr: *const i8) -> int8x8_t {
+ vld1_v8i8(ptr as *const i8, align_of::<i8>() as i32)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vld1.8"))]
+pub unsafe fn vld1q_s8(ptr: *const i8) -> int8x16_t {
+ vld1q_v16i8(ptr as *const i8, align_of::<i8>() as i32)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vld1.16"))]
+pub unsafe fn vld1_s16(ptr: *const i16) -> int16x4_t {
+ vld1_v4i16(ptr as *const i8, align_of::<i16>() as i32)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vld1.16"))]
+pub unsafe fn vld1q_s16(ptr: *const i16) -> int16x8_t {
+ vld1q_v8i16(ptr as *const i8, align_of::<i16>() as i32)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vldr))]
+pub unsafe fn vld1_s32(ptr: *const i32) -> int32x2_t {
+ vld1_v2i32(ptr as *const i8, align_of::<i32>() as i32)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vld1.32"))]
+pub unsafe fn vld1q_s32(ptr: *const i32) -> int32x4_t {
+ vld1q_v4i32(ptr as *const i8, align_of::<i32>() as i32)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vldr))]
+pub unsafe fn vld1_s64(ptr: *const i64) -> int64x1_t {
+ vld1_v1i64(ptr as *const i8, align_of::<i64>() as i32)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vld1.64"))]
+pub unsafe fn vld1q_s64(ptr: *const i64) -> int64x2_t {
+ vld1q_v2i64(ptr as *const i8, align_of::<i64>() as i32)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vld1.8"))]
+pub unsafe fn vld1_u8(ptr: *const u8) -> uint8x8_t {
+ transmute(vld1_v8i8(ptr as *const i8, align_of::<u8>() as i32))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vld1.8"))]
+pub unsafe fn vld1q_u8(ptr: *const u8) -> uint8x16_t {
+ transmute(vld1q_v16i8(ptr as *const i8, align_of::<u8>() as i32))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vld1.16"))]
+pub unsafe fn vld1_u16(ptr: *const u16) -> uint16x4_t {
+ transmute(vld1_v4i16(ptr as *const i8, align_of::<u16>() as i32))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vld1.16"))]
+pub unsafe fn vld1q_u16(ptr: *const u16) -> uint16x8_t {
+ transmute(vld1q_v8i16(ptr as *const i8, align_of::<u16>() as i32))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vldr))]
+pub unsafe fn vld1_u32(ptr: *const u32) -> uint32x2_t {
+ transmute(vld1_v2i32(ptr as *const i8, align_of::<u32>() as i32))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vld1.32"))]
+pub unsafe fn vld1q_u32(ptr: *const u32) -> uint32x4_t {
+ transmute(vld1q_v4i32(ptr as *const i8, align_of::<u32>() as i32))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vldr))]
+pub unsafe fn vld1_u64(ptr: *const u64) -> uint64x1_t {
+ transmute(vld1_v1i64(ptr as *const i8, align_of::<u64>() as i32))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vld1.64"))]
+pub unsafe fn vld1q_u64(ptr: *const u64) -> uint64x2_t {
+ transmute(vld1q_v2i64(ptr as *const i8, align_of::<u64>() as i32))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vld1.8"))]
+pub unsafe fn vld1_p8(ptr: *const p8) -> poly8x8_t {
+ transmute(vld1_v8i8(ptr as *const i8, align_of::<p8>() as i32))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vld1.8"))]
+pub unsafe fn vld1q_p8(ptr: *const p8) -> poly8x16_t {
+ transmute(vld1q_v16i8(ptr as *const i8, align_of::<p8>() as i32))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vld1.16"))]
+pub unsafe fn vld1_p16(ptr: *const p16) -> poly16x4_t {
+ transmute(vld1_v4i16(ptr as *const i8, align_of::<p16>() as i32))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vld1.16"))]
+pub unsafe fn vld1q_p16(ptr: *const p16) -> poly16x8_t {
+ transmute(vld1q_v8i16(ptr as *const i8, align_of::<p16>() as i32))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(test, assert_instr(vldr))]
+pub unsafe fn vld1_p64(ptr: *const p64) -> poly64x1_t {
+ transmute(vld1_v1i64(ptr as *const i8, align_of::<p64>() as i32))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(test, assert_instr("vld1.64"))]
+pub unsafe fn vld1q_p64(ptr: *const p64) -> poly64x2_t {
+ transmute(vld1q_v2i64(ptr as *const i8, align_of::<p64>() as i32))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vldr))]
+pub unsafe fn vld1_f32(ptr: *const f32) -> float32x2_t {
+ vld1_v2f32(ptr as *const i8, align_of::<f32>() as i32)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vld1.32"))]
+pub unsafe fn vld1q_f32(ptr: *const f32) -> float32x4_t {
+ vld1q_v4f32(ptr as *const i8, align_of::<f32>() as i32)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vst1.8"))]
+pub unsafe fn vst1_s8(ptr: *mut i8, a: int8x8_t) {
+ vst1_v8i8(ptr as *const i8, a, align_of::<i8>() as i32)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vst1.8"))]
+pub unsafe fn vst1q_s8(ptr: *mut i8, a: int8x16_t) {
+ vst1q_v16i8(ptr as *const i8, a, align_of::<i8>() as i32)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vst1.16"))]
+pub unsafe fn vst1_s16(ptr: *mut i16, a: int16x4_t) {
+ vst1_v4i16(ptr as *const i8, a, align_of::<i16>() as i32)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vst1.16"))]
+pub unsafe fn vst1q_s16(ptr: *mut i16, a: int16x8_t) {
+ vst1q_v8i16(ptr as *const i8, a, align_of::<i16>() as i32)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vst1.32"))]
+pub unsafe fn vst1_s32(ptr: *mut i32, a: int32x2_t) {
+ vst1_v2i32(ptr as *const i8, a, align_of::<i32>() as i32)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vst1.32"))]
+pub unsafe fn vst1q_s32(ptr: *mut i32, a: int32x4_t) {
+ vst1q_v4i32(ptr as *const i8, a, align_of::<i32>() as i32)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vst1.64"))]
+pub unsafe fn vst1_s64(ptr: *mut i64, a: int64x1_t) {
+ vst1_v1i64(ptr as *const i8, a, align_of::<i64>() as i32)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vst1.64"))]
+pub unsafe fn vst1q_s64(ptr: *mut i64, a: int64x2_t) {
+ vst1q_v2i64(ptr as *const i8, a, align_of::<i64>() as i32)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vst1.8"))]
+pub unsafe fn vst1_u8(ptr: *mut u8, a: uint8x8_t) {
+ vst1_v8i8(ptr as *const i8, transmute(a), align_of::<u8>() as i32)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vst1.8"))]
+pub unsafe fn vst1q_u8(ptr: *mut u8, a: uint8x16_t) {
+ vst1q_v16i8(ptr as *const i8, transmute(a), align_of::<u8>() as i32)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vst1.16"))]
+pub unsafe fn vst1_u16(ptr: *mut u16, a: uint16x4_t) {
+ vst1_v4i16(ptr as *const i8, transmute(a), align_of::<u16>() as i32)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vst1.16"))]
+pub unsafe fn vst1q_u16(ptr: *mut u16, a: uint16x8_t) {
+ vst1q_v8i16(ptr as *const i8, transmute(a), align_of::<u16>() as i32)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vst1.32"))]
+pub unsafe fn vst1_u32(ptr: *mut u32, a: uint32x2_t) {
+ vst1_v2i32(ptr as *const i8, transmute(a), align_of::<u32>() as i32)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vst1.32"))]
+pub unsafe fn vst1q_u32(ptr: *mut u32, a: uint32x4_t) {
+ vst1q_v4i32(ptr as *const i8, transmute(a), align_of::<u32>() as i32)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vst1.64"))]
+pub unsafe fn vst1_u64(ptr: *mut u64, a: uint64x1_t) {
+ vst1_v1i64(ptr as *const i8, transmute(a), align_of::<u64>() as i32)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vst1.64"))]
+pub unsafe fn vst1q_u64(ptr: *mut u64, a: uint64x2_t) {
+ vst1q_v2i64(ptr as *const i8, transmute(a), align_of::<u64>() as i32)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vst1.8"))]
+pub unsafe fn vst1_p8(ptr: *mut p8, a: poly8x8_t) {
+ vst1_v8i8(ptr as *const i8, transmute(a), align_of::<p8>() as i32)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vst1.8"))]
+pub unsafe fn vst1q_p8(ptr: *mut p8, a: poly8x16_t) {
+ vst1q_v16i8(ptr as *const i8, transmute(a), align_of::<p8>() as i32)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vst1.16"))]
+pub unsafe fn vst1_p16(ptr: *mut p16, a: poly16x4_t) {
+ vst1_v4i16(ptr as *const i8, transmute(a), align_of::<p16>() as i32)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vst1.16"))]
+pub unsafe fn vst1q_p16(ptr: *mut p16, a: poly16x8_t) {
+ vst1q_v8i16(ptr as *const i8, transmute(a), align_of::<p8>() as i32)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,aes,v8")]
+#[cfg_attr(test, assert_instr("vst1.64"))]
+pub unsafe fn vst1_p64(ptr: *mut p64, a: poly64x1_t) {
+ vst1_v1i64(ptr as *const i8, transmute(a), align_of::<p64>() as i32)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,aes,v8")]
+#[cfg_attr(test, assert_instr("vst1.64"))]
+pub unsafe fn vst1q_p64(ptr: *mut p64, a: poly64x2_t) {
+ vst1q_v2i64(ptr as *const i8, transmute(a), align_of::<p64>() as i32)
+}
+
+// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vst1.32"))]
+pub unsafe fn vst1_f32(ptr: *mut f32, a: float32x2_t) {
+ vst1_v2f32(ptr as *const i8, a, align_of::<f32>() as i32)
+}
+
+// Store multiple single-element structures from one, two, three, or four registers.
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vst1.32"))]
+pub unsafe fn vst1q_f32(ptr: *mut f32, a: float32x4_t) {
+ vst1q_v4f32(ptr as *const i8, a, align_of::<f32>() as i32)
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vtbl))]
+pub unsafe fn vtbl1_s8(a: int8x8_t, b: int8x8_t) -> int8x8_t {
+ vtbl1(a, b)
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vtbl))]
+pub unsafe fn vtbl1_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t {
+ transmute(vtbl1(transmute(a), transmute(b)))
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vtbl))]
+pub unsafe fn vtbl1_p8(a: poly8x8_t, b: uint8x8_t) -> poly8x8_t {
+ transmute(vtbl1(transmute(a), transmute(b)))
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vtbl))]
+pub unsafe fn vtbl2_s8(a: int8x8x2_t, b: int8x8_t) -> int8x8_t {
+ vtbl2(a.0, a.1, b)
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vtbl))]
+pub unsafe fn vtbl2_u8(a: uint8x8x2_t, b: uint8x8_t) -> uint8x8_t {
+ transmute(vtbl2(transmute(a.0), transmute(a.1), transmute(b)))
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vtbl))]
+pub unsafe fn vtbl2_p8(a: poly8x8x2_t, b: uint8x8_t) -> poly8x8_t {
+ transmute(vtbl2(transmute(a.0), transmute(a.1), transmute(b)))
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vtbl))]
+pub unsafe fn vtbl3_s8(a: int8x8x3_t, b: int8x8_t) -> int8x8_t {
+ vtbl3(a.0, a.1, a.2, b)
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vtbl))]
+pub unsafe fn vtbl3_u8(a: uint8x8x3_t, b: uint8x8_t) -> uint8x8_t {
+ transmute(vtbl3(
+ transmute(a.0),
+ transmute(a.1),
+ transmute(a.2),
+ transmute(b),
+ ))
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vtbl))]
+pub unsafe fn vtbl3_p8(a: poly8x8x3_t, b: uint8x8_t) -> poly8x8_t {
+ transmute(vtbl3(
+ transmute(a.0),
+ transmute(a.1),
+ transmute(a.2),
+ transmute(b),
+ ))
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vtbl))]
+pub unsafe fn vtbl4_s8(a: int8x8x4_t, b: int8x8_t) -> int8x8_t {
+ vtbl4(a.0, a.1, a.2, a.3, b)
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vtbl))]
+pub unsafe fn vtbl4_u8(a: uint8x8x4_t, b: uint8x8_t) -> uint8x8_t {
+ transmute(vtbl4(
+ transmute(a.0),
+ transmute(a.1),
+ transmute(a.2),
+ transmute(a.3),
+ transmute(b),
+ ))
+}
+
+/// Table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vtbl))]
+pub unsafe fn vtbl4_p8(a: poly8x8x4_t, b: uint8x8_t) -> poly8x8_t {
+ transmute(vtbl4(
+ transmute(a.0),
+ transmute(a.1),
+ transmute(a.2),
+ transmute(a.3),
+ transmute(b),
+ ))
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vtbx))]
+pub unsafe fn vtbx1_s8(a: int8x8_t, b: int8x8_t, c: int8x8_t) -> int8x8_t {
+ vtbx1(a, b, c)
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vtbx))]
+pub unsafe fn vtbx1_u8(a: uint8x8_t, b: uint8x8_t, c: uint8x8_t) -> uint8x8_t {
+ transmute(vtbx1(transmute(a), transmute(b), transmute(c)))
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vtbx))]
+pub unsafe fn vtbx1_p8(a: poly8x8_t, b: poly8x8_t, c: uint8x8_t) -> poly8x8_t {
+ transmute(vtbx1(transmute(a), transmute(b), transmute(c)))
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vtbx))]
+pub unsafe fn vtbx2_s8(a: int8x8_t, b: int8x8x2_t, c: int8x8_t) -> int8x8_t {
+ vtbx2(a, b.0, b.1, c)
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vtbx))]
+pub unsafe fn vtbx2_u8(a: uint8x8_t, b: uint8x8x2_t, c: uint8x8_t) -> uint8x8_t {
+ transmute(vtbx2(
+ transmute(a),
+ transmute(b.0),
+ transmute(b.1),
+ transmute(c),
+ ))
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vtbx))]
+pub unsafe fn vtbx2_p8(a: poly8x8_t, b: poly8x8x2_t, c: uint8x8_t) -> poly8x8_t {
+ transmute(vtbx2(
+ transmute(a),
+ transmute(b.0),
+ transmute(b.1),
+ transmute(c),
+ ))
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vtbx))]
+pub unsafe fn vtbx3_s8(a: int8x8_t, b: int8x8x3_t, c: int8x8_t) -> int8x8_t {
+ vtbx3(a, b.0, b.1, b.2, c)
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vtbx))]
+pub unsafe fn vtbx3_u8(a: uint8x8_t, b: uint8x8x3_t, c: uint8x8_t) -> uint8x8_t {
+ transmute(vtbx3(
+ transmute(a),
+ transmute(b.0),
+ transmute(b.1),
+ transmute(b.2),
+ transmute(c),
+ ))
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vtbx))]
+pub unsafe fn vtbx3_p8(a: poly8x8_t, b: poly8x8x3_t, c: uint8x8_t) -> poly8x8_t {
+ transmute(vtbx3(
+ transmute(a),
+ transmute(b.0),
+ transmute(b.1),
+ transmute(b.2),
+ transmute(c),
+ ))
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vtbx))]
+pub unsafe fn vtbx4_s8(a: int8x8_t, b: int8x8x4_t, c: int8x8_t) -> int8x8_t {
+ vtbx4(a, b.0, b.1, b.2, b.3, c)
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vtbx))]
+pub unsafe fn vtbx4_u8(a: uint8x8_t, b: uint8x8x4_t, c: uint8x8_t) -> uint8x8_t {
+ transmute(vtbx4(
+ transmute(a),
+ transmute(b.0),
+ transmute(b.1),
+ transmute(b.2),
+ transmute(b.3),
+ transmute(c),
+ ))
+}
+
+/// Extended table look-up
+#[inline]
+#[cfg(target_endian = "little")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vtbx))]
+pub unsafe fn vtbx4_p8(a: poly8x8_t, b: poly8x8x4_t, c: uint8x8_t) -> poly8x8_t {
+ transmute(vtbx4(
+ transmute(a),
+ transmute(b.0),
+ transmute(b.1),
+ transmute(b.2),
+ transmute(b.3),
+ transmute(c),
+ ))
+}
+
+// These float-to-int implementations have undefined behaviour when `a` overflows
+// the destination type. Clang has the same problem: https://llvm.org/PR47510
+
+/// Floating-point Convert to Signed fixed-point, rounding toward Zero (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[target_feature(enable = "v7")]
+#[cfg_attr(test, assert_instr("vcvt.s32.f32"))]
+pub unsafe fn vcvtq_s32_f32(a: float32x4_t) -> int32x4_t {
+ transmute(simd_cast::<_, i32x4>(transmute::<_, f32x4>(a)))
+}
+
+/// Floating-point Convert to Unsigned fixed-point, rounding toward Zero (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[target_feature(enable = "v7")]
+#[cfg_attr(test, assert_instr("vcvt.u32.f32"))]
+pub unsafe fn vcvtq_u32_f32(a: float32x4_t) -> uint32x4_t {
+ transmute(simd_cast::<_, u32x4>(transmute::<_, f32x4>(a)))
+}
+
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vsli.8", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsli_n_s8<const N: i32>(a: int8x8_t, b: int8x8_t) -> int8x8_t {
+ static_assert_imm3!(N);
+ let n = N as i8;
+ vshiftins_v8i8(a, b, int8x8_t(n, n, n, n, n, n, n, n))
+}
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vsli.8", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsliq_n_s8<const N: i32>(a: int8x16_t, b: int8x16_t) -> int8x16_t {
+ static_assert_imm3!(N);
+ let n = N as i8;
+ vshiftins_v16i8(
+ a,
+ b,
+ int8x16_t(n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n),
+ )
+}
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vsli.16", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsli_n_s16<const N: i32>(a: int16x4_t, b: int16x4_t) -> int16x4_t {
+ static_assert_imm4!(N);
+ let n = N as i16;
+ vshiftins_v4i16(a, b, int16x4_t(n, n, n, n))
+}
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vsli.16", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsliq_n_s16<const N: i32>(a: int16x8_t, b: int16x8_t) -> int16x8_t {
+ static_assert_imm4!(N);
+ let n = N as i16;
+ vshiftins_v8i16(a, b, int16x8_t(n, n, n, n, n, n, n, n))
+}
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vsli.32", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsli_n_s32<const N: i32>(a: int32x2_t, b: int32x2_t) -> int32x2_t {
+ static_assert!(N: i32 where N >= 0 && N <= 31);
+ vshiftins_v2i32(a, b, int32x2_t(N, N))
+}
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vsli.32", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsliq_n_s32<const N: i32>(a: int32x4_t, b: int32x4_t) -> int32x4_t {
+ static_assert!(N: i32 where N >= 0 && N <= 31);
+ vshiftins_v4i32(a, b, int32x4_t(N, N, N, N))
+}
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vsli.64", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsli_n_s64<const N: i32>(a: int64x1_t, b: int64x1_t) -> int64x1_t {
+ static_assert!(N : i32 where 0 <= N && N <= 63);
+ vshiftins_v1i64(a, b, int64x1_t(N as i64))
+}
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vsli.64", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsliq_n_s64<const N: i32>(a: int64x2_t, b: int64x2_t) -> int64x2_t {
+ static_assert!(N : i32 where 0 <= N && N <= 63);
+ vshiftins_v2i64(a, b, int64x2_t(N as i64, N as i64))
+}
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vsli.8", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsli_n_u8<const N: i32>(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t {
+ static_assert_imm3!(N);
+ let n = N as i8;
+ transmute(vshiftins_v8i8(
+ transmute(a),
+ transmute(b),
+ int8x8_t(n, n, n, n, n, n, n, n),
+ ))
+}
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vsli.8", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsliq_n_u8<const N: i32>(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t {
+ static_assert_imm3!(N);
+ let n = N as i8;
+ transmute(vshiftins_v16i8(
+ transmute(a),
+ transmute(b),
+ int8x16_t(n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n),
+ ))
+}
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vsli.16", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsli_n_u16<const N: i32>(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t {
+ static_assert_imm4!(N);
+ let n = N as i16;
+ transmute(vshiftins_v4i16(
+ transmute(a),
+ transmute(b),
+ int16x4_t(n, n, n, n),
+ ))
+}
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vsli.16", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsliq_n_u16<const N: i32>(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t {
+ static_assert_imm4!(N);
+ let n = N as i16;
+ transmute(vshiftins_v8i16(
+ transmute(a),
+ transmute(b),
+ int16x8_t(n, n, n, n, n, n, n, n),
+ ))
+}
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vsli.32", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsli_n_u32<const N: i32>(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t {
+ static_assert!(N: i32 where N >= 0 && N <= 31);
+ transmute(vshiftins_v2i32(transmute(a), transmute(b), int32x2_t(N, N)))
+}
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vsli.32", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsliq_n_u32<const N: i32>(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
+ static_assert!(N: i32 where N >= 0 && N <= 31);
+ transmute(vshiftins_v4i32(
+ transmute(a),
+ transmute(b),
+ int32x4_t(N, N, N, N),
+ ))
+}
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vsli.64", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsli_n_u64<const N: i32>(a: uint64x1_t, b: uint64x1_t) -> uint64x1_t {
+ static_assert!(N : i32 where 0 <= N && N <= 63);
+ transmute(vshiftins_v1i64(
+ transmute(a),
+ transmute(b),
+ int64x1_t(N as i64),
+ ))
+}
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vsli.64", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsliq_n_u64<const N: i32>(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t {
+ static_assert!(N : i32 where 0 <= N && N <= 63);
+ transmute(vshiftins_v2i64(
+ transmute(a),
+ transmute(b),
+ int64x2_t(N as i64, N as i64),
+ ))
+}
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vsli.8", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsli_n_p8<const N: i32>(a: poly8x8_t, b: poly8x8_t) -> poly8x8_t {
+ static_assert_imm3!(N);
+ let n = N as i8;
+ transmute(vshiftins_v8i8(
+ transmute(a),
+ transmute(b),
+ int8x8_t(n, n, n, n, n, n, n, n),
+ ))
+}
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vsli.8", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsliq_n_p8<const N: i32>(a: poly8x16_t, b: poly8x16_t) -> poly8x16_t {
+ static_assert_imm3!(N);
+ let n = N as i8;
+ transmute(vshiftins_v16i8(
+ transmute(a),
+ transmute(b),
+ int8x16_t(n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n),
+ ))
+}
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vsli.16", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsli_n_p16<const N: i32>(a: poly16x4_t, b: poly16x4_t) -> poly16x4_t {
+ static_assert_imm4!(N);
+ let n = N as i16;
+ transmute(vshiftins_v4i16(
+ transmute(a),
+ transmute(b),
+ int16x4_t(n, n, n, n),
+ ))
+}
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vsli.16", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsliq_n_p16<const N: i32>(a: poly16x8_t, b: poly16x8_t) -> poly16x8_t {
+ static_assert_imm4!(N);
+ let n = N as i16;
+ transmute(vshiftins_v8i16(
+ transmute(a),
+ transmute(b),
+ int16x8_t(n, n, n, n, n, n, n, n),
+ ))
+}
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7,aes")]
+#[cfg_attr(test, assert_instr("vsli.64", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsli_n_p64<const N: i32>(a: poly64x1_t, b: poly64x1_t) -> poly64x1_t {
+ static_assert!(N : i32 where 0 <= N && N <= 63);
+ transmute(vshiftins_v1i64(
+ transmute(a),
+ transmute(b),
+ int64x1_t(N as i64),
+ ))
+}
+/// Shift Left and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7,aes")]
+#[cfg_attr(test, assert_instr("vsli.64", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsliq_n_p64<const N: i32>(a: poly64x2_t, b: poly64x2_t) -> poly64x2_t {
+ static_assert!(N : i32 where 0 <= N && N <= 63);
+ transmute(vshiftins_v2i64(
+ transmute(a),
+ transmute(b),
+ int64x2_t(N as i64, N as i64),
+ ))
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vsri.8", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsri_n_s8<const N: i32>(a: int8x8_t, b: int8x8_t) -> int8x8_t {
+ static_assert!(N : i32 where 1 <= N && N <= 8);
+ let n = -N as i8;
+ vshiftins_v8i8(a, b, int8x8_t(n, n, n, n, n, n, n, n))
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vsri.8", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsriq_n_s8<const N: i32>(a: int8x16_t, b: int8x16_t) -> int8x16_t {
+ static_assert!(N : i32 where 1 <= N && N <= 8);
+ let n = -N as i8;
+ vshiftins_v16i8(
+ a,
+ b,
+ int8x16_t(n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n),
+ )
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vsri.16", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsri_n_s16<const N: i32>(a: int16x4_t, b: int16x4_t) -> int16x4_t {
+ static_assert!(N : i32 where 1 <= N && N <= 16);
+ let n = -N as i16;
+ vshiftins_v4i16(a, b, int16x4_t(n, n, n, n))
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vsri.16", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsriq_n_s16<const N: i32>(a: int16x8_t, b: int16x8_t) -> int16x8_t {
+ static_assert!(N : i32 where 1 <= N && N <= 16);
+ let n = -N as i16;
+ vshiftins_v8i16(a, b, int16x8_t(n, n, n, n, n, n, n, n))
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vsri.32", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsri_n_s32<const N: i32>(a: int32x2_t, b: int32x2_t) -> int32x2_t {
+ static_assert!(N : i32 where 1 <= N && N <= 32);
+ vshiftins_v2i32(a, b, int32x2_t(-N, -N))
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vsri.32", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsriq_n_s32<const N: i32>(a: int32x4_t, b: int32x4_t) -> int32x4_t {
+ static_assert!(N : i32 where 1 <= N && N <= 32);
+ vshiftins_v4i32(a, b, int32x4_t(-N, -N, -N, -N))
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vsri.64", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsri_n_s64<const N: i32>(a: int64x1_t, b: int64x1_t) -> int64x1_t {
+ static_assert!(N : i32 where 1 <= N && N <= 64);
+ vshiftins_v1i64(a, b, int64x1_t(-N as i64))
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vsri.64", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsriq_n_s64<const N: i32>(a: int64x2_t, b: int64x2_t) -> int64x2_t {
+ static_assert!(N : i32 where 1 <= N && N <= 64);
+ vshiftins_v2i64(a, b, int64x2_t(-N as i64, -N as i64))
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vsri.8", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsri_n_u8<const N: i32>(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t {
+ static_assert!(N : i32 where 1 <= N && N <= 8);
+ let n = -N as i8;
+ transmute(vshiftins_v8i8(
+ transmute(a),
+ transmute(b),
+ int8x8_t(n, n, n, n, n, n, n, n),
+ ))
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vsri.8", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsriq_n_u8<const N: i32>(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t {
+ static_assert!(N : i32 where 1 <= N && N <= 8);
+ let n = -N as i8;
+ transmute(vshiftins_v16i8(
+ transmute(a),
+ transmute(b),
+ int8x16_t(n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n),
+ ))
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vsri.16", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsri_n_u16<const N: i32>(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t {
+ static_assert!(N : i32 where 1 <= N && N <= 16);
+ let n = -N as i16;
+ transmute(vshiftins_v4i16(
+ transmute(a),
+ transmute(b),
+ int16x4_t(n, n, n, n),
+ ))
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vsri.16", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsriq_n_u16<const N: i32>(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t {
+ static_assert!(N : i32 where 1 <= N && N <= 16);
+ let n = -N as i16;
+ transmute(vshiftins_v8i16(
+ transmute(a),
+ transmute(b),
+ int16x8_t(n, n, n, n, n, n, n, n),
+ ))
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vsri.32", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsri_n_u32<const N: i32>(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t {
+ static_assert!(N : i32 where 1 <= N && N <= 32);
+ transmute(vshiftins_v2i32(
+ transmute(a),
+ transmute(b),
+ int32x2_t(-N, -N),
+ ))
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vsri.32", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsriq_n_u32<const N: i32>(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
+ static_assert!(N : i32 where 1 <= N && N <= 32);
+ transmute(vshiftins_v4i32(
+ transmute(a),
+ transmute(b),
+ int32x4_t(-N, -N, -N, -N),
+ ))
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vsri.64", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsri_n_u64<const N: i32>(a: uint64x1_t, b: uint64x1_t) -> uint64x1_t {
+ static_assert!(N : i32 where 1 <= N && N <= 64);
+ transmute(vshiftins_v1i64(
+ transmute(a),
+ transmute(b),
+ int64x1_t(-N as i64),
+ ))
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vsri.64", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsriq_n_u64<const N: i32>(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t {
+ static_assert!(N : i32 where 1 <= N && N <= 64);
+ transmute(vshiftins_v2i64(
+ transmute(a),
+ transmute(b),
+ int64x2_t(-N as i64, -N as i64),
+ ))
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vsri.8", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsri_n_p8<const N: i32>(a: poly8x8_t, b: poly8x8_t) -> poly8x8_t {
+ static_assert!(N : i32 where 1 <= N && N <= 8);
+ let n = -N as i8;
+ transmute(vshiftins_v8i8(
+ transmute(a),
+ transmute(b),
+ int8x8_t(n, n, n, n, n, n, n, n),
+ ))
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vsri.8", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsriq_n_p8<const N: i32>(a: poly8x16_t, b: poly8x16_t) -> poly8x16_t {
+ static_assert!(N : i32 where 1 <= N && N <= 8);
+ let n = -N as i8;
+ transmute(vshiftins_v16i8(
+ transmute(a),
+ transmute(b),
+ int8x16_t(n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n),
+ ))
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vsri.16", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsri_n_p16<const N: i32>(a: poly16x4_t, b: poly16x4_t) -> poly16x4_t {
+ static_assert!(N : i32 where 1 <= N && N <= 16);
+ let n = -N as i16;
+ transmute(vshiftins_v4i16(
+ transmute(a),
+ transmute(b),
+ int16x4_t(n, n, n, n),
+ ))
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr("vsri.16", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsriq_n_p16<const N: i32>(a: poly16x8_t, b: poly16x8_t) -> poly16x8_t {
+ static_assert!(N : i32 where 1 <= N && N <= 16);
+ let n = -N as i16;
+ transmute(vshiftins_v8i16(
+ transmute(a),
+ transmute(b),
+ int16x8_t(n, n, n, n, n, n, n, n),
+ ))
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7,aes")]
+#[cfg_attr(test, assert_instr("vsri.64", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsri_n_p64<const N: i32>(a: poly64x1_t, b: poly64x1_t) -> poly64x1_t {
+ static_assert!(N : i32 where 1 <= N && N <= 64);
+ transmute(vshiftins_v1i64(
+ transmute(a),
+ transmute(b),
+ int64x1_t(-N as i64),
+ ))
+}
+/// Shift Right and Insert (immediate)
+#[inline]
+#[target_feature(enable = "neon,v7,aes")]
+#[cfg_attr(test, assert_instr("vsri.64", N = 1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vsriq_n_p64<const N: i32>(a: poly64x2_t, b: poly64x2_t) -> poly64x2_t {
+ static_assert!(N : i32 where 1 <= N && N <= 64);
+ transmute(vshiftins_v2i64(
+ transmute(a),
+ transmute(b),
+ int64x2_t(-N as i64, -N as i64),
+ ))
+}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+ use crate::core_arch::{arm::*, simd::*};
+ use crate::mem::transmute;
+ use stdarch_test::simd_test;
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtq_s32_f32() {
+ let f = f32x4::new(-1., 2., 3., 4.);
+ let e = i32x4::new(-1, 2, 3, 4);
+ let r: i32x4 = transmute(vcvtq_s32_f32(transmute(f)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtq_u32_f32() {
+ let f = f32x4::new(1., 2., 3., 4.);
+ let e = u32x4::new(1, 2, 3, 4);
+ let r: u32x4 = transmute(vcvtq_u32_f32(transmute(f)));
+ assert_eq!(r, e);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/arm/sat.rs b/library/stdarch/crates/core_arch/src/arm/sat.rs
new file mode 100644
index 000000000..38c98d734
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/arm/sat.rs
@@ -0,0 +1,8 @@
+//! # References:
+//!
+//! - Section 8.4 "Saturating intrinsics"
+//!
+//! Intrinsics that could live here:
+//!
+//! - __ssat
+//! - __usat
diff --git a/library/stdarch/crates/core_arch/src/arm/simd32.rs b/library/stdarch/crates/core_arch/src/arm/simd32.rs
new file mode 100644
index 000000000..2d867acc8
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/arm/simd32.rs
@@ -0,0 +1,728 @@
+//! # References
+//!
+//! - Section 8.5 "32-bit SIMD intrinsics" of ACLE
+//!
+//! Intrinsics that could live here
+//!
+//! - \[x\] __sel
+//! - \[ \] __ssat16
+//! - \[ \] __usat16
+//! - \[ \] __sxtab16
+//! - \[ \] __sxtb16
+//! - \[ \] __uxtab16
+//! - \[ \] __uxtb16
+//! - \[x\] __qadd8
+//! - \[x\] __qsub8
+//! - \[x\] __sadd8
+//! - \[x\] __shadd8
+//! - \[x\] __shsub8
+//! - \[x\] __ssub8
+//! - \[ \] __uadd8
+//! - \[ \] __uhadd8
+//! - \[ \] __uhsub8
+//! - \[ \] __uqadd8
+//! - \[ \] __uqsub8
+//! - \[x\] __usub8
+//! - \[x\] __usad8
+//! - \[x\] __usada8
+//! - \[x\] __qadd16
+//! - \[x\] __qasx
+//! - \[x\] __qsax
+//! - \[x\] __qsub16
+//! - \[x\] __sadd16
+//! - \[x\] __sasx
+//! - \[x\] __shadd16
+//! - \[ \] __shasx
+//! - \[ \] __shsax
+//! - \[x\] __shsub16
+//! - \[ \] __ssax
+//! - \[ \] __ssub16
+//! - \[ \] __uadd16
+//! - \[ \] __uasx
+//! - \[ \] __uhadd16
+//! - \[ \] __uhasx
+//! - \[ \] __uhsax
+//! - \[ \] __uhsub16
+//! - \[ \] __uqadd16
+//! - \[ \] __uqasx
+//! - \[x\] __uqsax
+//! - \[ \] __uqsub16
+//! - \[ \] __usax
+//! - \[ \] __usub16
+//! - \[x\] __smlad
+//! - \[ \] __smladx
+//! - \[ \] __smlald
+//! - \[ \] __smlaldx
+//! - \[x\] __smlsd
+//! - \[ \] __smlsdx
+//! - \[ \] __smlsld
+//! - \[ \] __smlsldx
+//! - \[x\] __smuad
+//! - \[x\] __smuadx
+//! - \[x\] __smusd
+//! - \[x\] __smusdx
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+use crate::{core_arch::arm::dsp::int16x2_t, mem::transmute};
+
+types! {
+ /// ARM-specific 32-bit wide vector of four packed `i8`.
+ pub struct int8x4_t(i8, i8, i8, i8);
+ /// ARM-specific 32-bit wide vector of four packed `u8`.
+ pub struct uint8x4_t(u8, u8, u8, u8);
+}
+
+macro_rules! dsp_call {
+ ($name:expr, $a:expr, $b:expr) => {
+ transmute($name(transmute($a), transmute($b)))
+ };
+}
+
+extern "unadjusted" {
+ #[link_name = "llvm.arm.qadd8"]
+ fn arm_qadd8(a: i32, b: i32) -> i32;
+
+ #[link_name = "llvm.arm.qsub8"]
+ fn arm_qsub8(a: i32, b: i32) -> i32;
+
+ #[link_name = "llvm.arm.qsub16"]
+ fn arm_qsub16(a: i32, b: i32) -> i32;
+
+ #[link_name = "llvm.arm.qadd16"]
+ fn arm_qadd16(a: i32, b: i32) -> i32;
+
+ #[link_name = "llvm.arm.qasx"]
+ fn arm_qasx(a: i32, b: i32) -> i32;
+
+ #[link_name = "llvm.arm.qsax"]
+ fn arm_qsax(a: i32, b: i32) -> i32;
+
+ #[link_name = "llvm.arm.sadd16"]
+ fn arm_sadd16(a: i32, b: i32) -> i32;
+
+ #[link_name = "llvm.arm.sadd8"]
+ fn arm_sadd8(a: i32, b: i32) -> i32;
+
+ #[link_name = "llvm.arm.smlad"]
+ fn arm_smlad(a: i32, b: i32, c: i32) -> i32;
+
+ #[link_name = "llvm.arm.smlsd"]
+ fn arm_smlsd(a: i32, b: i32, c: i32) -> i32;
+
+ #[link_name = "llvm.arm.sasx"]
+ fn arm_sasx(a: i32, b: i32) -> i32;
+
+ #[link_name = "llvm.arm.sel"]
+ fn arm_sel(a: i32, b: i32) -> i32;
+
+ #[link_name = "llvm.arm.shadd8"]
+ fn arm_shadd8(a: i32, b: i32) -> i32;
+
+ #[link_name = "llvm.arm.shadd16"]
+ fn arm_shadd16(a: i32, b: i32) -> i32;
+
+ #[link_name = "llvm.arm.shsub8"]
+ fn arm_shsub8(a: i32, b: i32) -> i32;
+
+ #[link_name = "llvm.arm.ssub8"]
+ fn arm_ssub8(a: i32, b: i32) -> i32;
+
+ #[link_name = "llvm.arm.usub8"]
+ fn arm_usub8(a: i32, b: i32) -> i32;
+
+ #[link_name = "llvm.arm.shsub16"]
+ fn arm_shsub16(a: i32, b: i32) -> i32;
+
+ #[link_name = "llvm.arm.smuad"]
+ fn arm_smuad(a: i32, b: i32) -> i32;
+
+ #[link_name = "llvm.arm.smuadx"]
+ fn arm_smuadx(a: i32, b: i32) -> i32;
+
+ #[link_name = "llvm.arm.smusd"]
+ fn arm_smusd(a: i32, b: i32) -> i32;
+
+ #[link_name = "llvm.arm.smusdx"]
+ fn arm_smusdx(a: i32, b: i32) -> i32;
+
+ #[link_name = "llvm.arm.usad8"]
+ fn arm_usad8(a: i32, b: i32) -> u32;
+}
+
+/// Saturating four 8-bit integer additions
+///
+/// Returns the 8-bit signed equivalent of
+///
+/// res\[0\] = a\[0\] + b\[0\]
+/// res\[1\] = a\[1\] + b\[1\]
+/// res\[2\] = a\[2\] + b\[2\]
+/// res\[3\] = a\[3\] + b\[3\]
+#[inline]
+#[cfg_attr(test, assert_instr(qadd8))]
+pub unsafe fn __qadd8(a: int8x4_t, b: int8x4_t) -> int8x4_t {
+ dsp_call!(arm_qadd8, a, b)
+}
+
+/// Saturating two 8-bit integer subtraction
+///
+/// Returns the 8-bit signed equivalent of
+///
+/// res\[0\] = a\[0\] - b\[0\]
+/// res\[1\] = a\[1\] - b\[1\]
+/// res\[2\] = a\[2\] - b\[2\]
+/// res\[3\] = a\[3\] - b\[3\]
+#[inline]
+#[cfg_attr(test, assert_instr(qsub8))]
+pub unsafe fn __qsub8(a: int8x4_t, b: int8x4_t) -> int8x4_t {
+ dsp_call!(arm_qsub8, a, b)
+}
+
+/// Saturating two 16-bit integer subtraction
+///
+/// Returns the 16-bit signed equivalent of
+///
+/// res\[0\] = a\[0\] - b\[0\]
+/// res\[1\] = a\[1\] - b\[1\]
+#[inline]
+#[cfg_attr(test, assert_instr(qsub16))]
+pub unsafe fn __qsub16(a: int16x2_t, b: int16x2_t) -> int16x2_t {
+ dsp_call!(arm_qsub16, a, b)
+}
+
+/// Saturating two 16-bit integer additions
+///
+/// Returns the 16-bit signed equivalent of
+///
+/// res\[0\] = a\[0\] + b\[0\]
+/// res\[1\] = a\[1\] + b\[1\]
+#[inline]
+#[cfg_attr(test, assert_instr(qadd16))]
+pub unsafe fn __qadd16(a: int16x2_t, b: int16x2_t) -> int16x2_t {
+ dsp_call!(arm_qadd16, a, b)
+}
+
+/// Returns the 16-bit signed saturated equivalent of
+///
+/// res\[0\] = a\[0\] - b\[1\]
+/// res\[1\] = a\[1\] + b\[0\]
+#[inline]
+#[cfg_attr(test, assert_instr(qasx))]
+pub unsafe fn __qasx(a: int16x2_t, b: int16x2_t) -> int16x2_t {
+ dsp_call!(arm_qasx, a, b)
+}
+
+/// Returns the 16-bit signed saturated equivalent of
+///
+/// res\[0\] = a\[0\] + b\[1\]
+/// res\[1\] = a\[1\] - b\[0\]
+#[inline]
+#[cfg_attr(test, assert_instr(qsax))]
+pub unsafe fn __qsax(a: int16x2_t, b: int16x2_t) -> int16x2_t {
+ dsp_call!(arm_qsax, a, b)
+}
+
+/// Returns the 16-bit signed saturated equivalent of
+///
+/// res\[0\] = a\[0\] + b\[1\]
+/// res\[1\] = a\[1\] + b\[0\]
+///
+/// and the GE bits of the APSR are set.
+#[inline]
+#[cfg_attr(test, assert_instr(sadd16))]
+pub unsafe fn __sadd16(a: int16x2_t, b: int16x2_t) -> int16x2_t {
+ dsp_call!(arm_sadd16, a, b)
+}
+
+/// Returns the 8-bit signed saturated equivalent of
+///
+/// res\[0\] = a\[0\] + b\[1\]
+/// res\[1\] = a\[1\] + b\[0\]
+/// res\[2\] = a\[2\] + b\[2\]
+/// res\[3\] = a\[3\] + b\[3\]
+///
+/// and the GE bits of the APSR are set.
+#[inline]
+#[cfg_attr(test, assert_instr(sadd8))]
+pub unsafe fn __sadd8(a: int8x4_t, b: int8x4_t) -> int8x4_t {
+ dsp_call!(arm_sadd8, a, b)
+}
+
+/// Dual 16-bit Signed Multiply with Addition of products
+/// and 32-bit accumulation.
+///
+/// Returns the 16-bit signed equivalent of
+/// res = a\[0\] * b\[0\] + a\[1\] * b\[1\] + c
+#[inline]
+#[cfg_attr(test, assert_instr(smlad))]
+pub unsafe fn __smlad(a: int16x2_t, b: int16x2_t, c: i32) -> i32 {
+ arm_smlad(transmute(a), transmute(b), c)
+}
+
+/// Dual 16-bit Signed Multiply with Subtraction of products
+/// and 32-bit accumulation and overflow detection.
+///
+/// Returns the 16-bit signed equivalent of
+/// res = a\[0\] * b\[0\] - a\[1\] * b\[1\] + c
+#[inline]
+#[cfg_attr(test, assert_instr(smlsd))]
+pub unsafe fn __smlsd(a: int16x2_t, b: int16x2_t, c: i32) -> i32 {
+ arm_smlsd(transmute(a), transmute(b), c)
+}
+
+/// Returns the 16-bit signed equivalent of
+///
+/// res\[0\] = a\[0\] - b\[1\]
+/// res\[1\] = a\[1\] + b\[0\]
+///
+/// and the GE bits of the APSR are set.
+#[inline]
+#[cfg_attr(test, assert_instr(sasx))]
+pub unsafe fn __sasx(a: int16x2_t, b: int16x2_t) -> int16x2_t {
+ dsp_call!(arm_sasx, a, b)
+}
+
+/// Select bytes from each operand according to APSR GE flags
+///
+/// Returns the equivalent of
+///
+/// res\[0\] = GE\[0\] ? a\[0\] : b\[0\]
+/// res\[1\] = GE\[1\] ? a\[1\] : b\[1\]
+/// res\[2\] = GE\[2\] ? a\[2\] : b\[2\]
+/// res\[3\] = GE\[3\] ? a\[3\] : b\[3\]
+///
+/// where GE are bits of APSR
+#[inline]
+#[cfg_attr(test, assert_instr(sel))]
+pub unsafe fn __sel(a: int8x4_t, b: int8x4_t) -> int8x4_t {
+ dsp_call!(arm_sel, a, b)
+}
+
+/// Signed halving parallel byte-wise addition.
+///
+/// Returns the 8-bit signed equivalent of
+///
+/// res\[0\] = (a\[0\] + b\[0\]) / 2
+/// res\[1\] = (a\[1\] + b\[1\]) / 2
+/// res\[2\] = (a\[2\] + b\[2\]) / 2
+/// res\[3\] = (a\[3\] + b\[3\]) / 2
+#[inline]
+#[cfg_attr(test, assert_instr(shadd8))]
+pub unsafe fn __shadd8(a: int8x4_t, b: int8x4_t) -> int8x4_t {
+ dsp_call!(arm_shadd8, a, b)
+}
+
+/// Signed halving parallel halfword-wise addition.
+///
+/// Returns the 16-bit signed equivalent of
+///
+/// res\[0\] = (a\[0\] + b\[0\]) / 2
+/// res\[1\] = (a\[1\] + b\[1\]) / 2
+#[inline]
+#[cfg_attr(test, assert_instr(shadd16))]
+pub unsafe fn __shadd16(a: int16x2_t, b: int16x2_t) -> int16x2_t {
+ dsp_call!(arm_shadd16, a, b)
+}
+
+/// Signed halving parallel byte-wise subtraction.
+///
+/// Returns the 8-bit signed equivalent of
+///
+/// res\[0\] = (a\[0\] - b\[0\]) / 2
+/// res\[1\] = (a\[1\] - b\[1\]) / 2
+/// res\[2\] = (a\[2\] - b\[2\]) / 2
+/// res\[3\] = (a\[3\] - b\[3\]) / 2
+#[inline]
+#[cfg_attr(test, assert_instr(shsub8))]
+pub unsafe fn __shsub8(a: int8x4_t, b: int8x4_t) -> int8x4_t {
+ dsp_call!(arm_shsub8, a, b)
+}
+
+/// Inserts a `USUB8` instruction.
+///
+/// Returns the 8-bit unsigned equivalent of
+///
+/// res\[0\] = a\[0\] - a\[0\]
+/// res\[1\] = a\[1\] - a\[1\]
+/// res\[2\] = a\[2\] - a\[2\]
+/// res\[3\] = a\[3\] - a\[3\]
+///
+/// where \[0\] is the lower 8 bits and \[3\] is the upper 8 bits.
+/// The GE bits of the APSR are set.
+#[inline]
+#[cfg_attr(test, assert_instr(usub8))]
+pub unsafe fn __usub8(a: uint8x4_t, b: uint8x4_t) -> uint8x4_t {
+ dsp_call!(arm_usub8, a, b)
+}
+
+/// Inserts a `SSUB8` instruction.
+///
+/// Returns the 8-bit signed equivalent of
+///
+/// res\[0\] = a\[0\] - a\[0\]
+/// res\[1\] = a\[1\] - a\[1\]
+/// res\[2\] = a\[2\] - a\[2\]
+/// res\[3\] = a\[3\] - a\[3\]
+///
+/// where \[0\] is the lower 8 bits and \[3\] is the upper 8 bits.
+/// The GE bits of the APSR are set.
+#[inline]
+#[cfg_attr(test, assert_instr(ssub8))]
+pub unsafe fn __ssub8(a: int8x4_t, b: int8x4_t) -> int8x4_t {
+ dsp_call!(arm_ssub8, a, b)
+}
+
+/// Signed halving parallel halfword-wise subtraction.
+///
+/// Returns the 16-bit signed equivalent of
+///
+/// res\[0\] = (a\[0\] - b\[0\]) / 2
+/// res\[1\] = (a\[1\] - b\[1\]) / 2
+#[inline]
+#[cfg_attr(test, assert_instr(shsub16))]
+pub unsafe fn __shsub16(a: int16x2_t, b: int16x2_t) -> int16x2_t {
+ dsp_call!(arm_shsub16, a, b)
+}
+
+/// Signed Dual Multiply Add.
+///
+/// Returns the equivalent of
+///
+/// res = a\[0\] * b\[0\] + a\[1\] * b\[1\]
+///
+/// and sets the Q flag if overflow occurs on the addition.
+#[inline]
+#[cfg_attr(test, assert_instr(smuad))]
+pub unsafe fn __smuad(a: int16x2_t, b: int16x2_t) -> i32 {
+ arm_smuad(transmute(a), transmute(b))
+}
+
+/// Signed Dual Multiply Add Reversed.
+///
+/// Returns the equivalent of
+///
+/// res = a\[0\] * b\[1\] + a\[1\] * b\[0\]
+///
+/// and sets the Q flag if overflow occurs on the addition.
+#[inline]
+#[cfg_attr(test, assert_instr(smuadx))]
+pub unsafe fn __smuadx(a: int16x2_t, b: int16x2_t) -> i32 {
+ arm_smuadx(transmute(a), transmute(b))
+}
+
+/// Signed Dual Multiply Subtract.
+///
+/// Returns the equivalent of
+///
+/// res = a\[0\] * b\[0\] - a\[1\] * b\[1\]
+///
+/// and sets the Q flag if overflow occurs on the addition.
+#[inline]
+#[cfg_attr(test, assert_instr(smusd))]
+pub unsafe fn __smusd(a: int16x2_t, b: int16x2_t) -> i32 {
+ arm_smusd(transmute(a), transmute(b))
+}
+
+/// Signed Dual Multiply Subtract Reversed.
+///
+/// Returns the equivalent of
+///
+/// res = a\[0\] * b\[1\] - a\[1\] * b\[0\]
+///
+/// and sets the Q flag if overflow occurs on the addition.
+#[inline]
+#[cfg_attr(test, assert_instr(smusdx))]
+pub unsafe fn __smusdx(a: int16x2_t, b: int16x2_t) -> i32 {
+ arm_smusdx(transmute(a), transmute(b))
+}
+
+/// Sum of 8-bit absolute differences.
+///
+/// Returns the 8-bit unsigned equivalent of
+///
+/// res = abs(a\[0\] - b\[0\]) + abs(a\[1\] - b\[1\]) +\
+/// (a\[2\] - b\[2\]) + (a\[3\] - b\[3\])
+#[inline]
+#[cfg_attr(test, assert_instr(usad8))]
+pub unsafe fn __usad8(a: int8x4_t, b: int8x4_t) -> u32 {
+ arm_usad8(transmute(a), transmute(b))
+}
+
+/// Sum of 8-bit absolute differences and constant.
+///
+/// Returns the 8-bit unsigned equivalent of
+///
+/// res = abs(a\[0\] - b\[0\]) + abs(a\[1\] - b\[1\]) +\
+/// (a\[2\] - b\[2\]) + (a\[3\] - b\[3\]) + c
+#[inline]
+#[cfg_attr(test, assert_instr(usad8))]
+pub unsafe fn __usada8(a: int8x4_t, b: int8x4_t, c: u32) -> u32 {
+ __usad8(a, b) + c
+}
+
+#[cfg(test)]
+mod tests {
+ use crate::core_arch::simd::{i16x2, i8x4, u8x4};
+ use std::mem::transmute;
+ use stdarch_test::simd_test;
+
+ #[test]
+ fn qadd8() {
+ unsafe {
+ let a = i8x4::new(1, 2, 3, i8::MAX);
+ let b = i8x4::new(2, -1, 0, 1);
+ let c = i8x4::new(3, 1, 3, i8::MAX);
+ let r: i8x4 = dsp_call!(super::__qadd8, a, b);
+ assert_eq!(r, c);
+ }
+ }
+
+ #[test]
+ fn qsub8() {
+ unsafe {
+ let a = i8x4::new(1, 2, 3, i8::MIN);
+ let b = i8x4::new(2, -1, 0, 1);
+ let c = i8x4::new(-1, 3, 3, i8::MIN);
+ let r: i8x4 = dsp_call!(super::__qsub8, a, b);
+ assert_eq!(r, c);
+ }
+ }
+
+ #[test]
+ fn qadd16() {
+ unsafe {
+ let a = i16x2::new(1, 2);
+ let b = i16x2::new(2, -1);
+ let c = i16x2::new(3, 1);
+ let r: i16x2 = dsp_call!(super::__qadd16, a, b);
+ assert_eq!(r, c);
+ }
+ }
+
+ #[test]
+ fn qsub16() {
+ unsafe {
+ let a = i16x2::new(10, 20);
+ let b = i16x2::new(20, -10);
+ let c = i16x2::new(-10, 30);
+ let r: i16x2 = dsp_call!(super::__qsub16, a, b);
+ assert_eq!(r, c);
+ }
+ }
+
+ #[test]
+ fn qasx() {
+ unsafe {
+ let a = i16x2::new(1, i16::MAX);
+ let b = i16x2::new(2, 2);
+ let c = i16x2::new(-1, i16::MAX);
+ let r: i16x2 = dsp_call!(super::__qasx, a, b);
+ assert_eq!(r, c);
+ }
+ }
+
+ #[test]
+ fn qsax() {
+ unsafe {
+ let a = i16x2::new(1, i16::MAX);
+ let b = i16x2::new(2, 2);
+ let c = i16x2::new(3, i16::MAX - 2);
+ let r: i16x2 = dsp_call!(super::__qsax, a, b);
+ assert_eq!(r, c);
+ }
+ }
+
+ #[test]
+ fn sadd16() {
+ unsafe {
+ let a = i16x2::new(1, i16::MAX);
+ let b = i16x2::new(2, 2);
+ let c = i16x2::new(3, -i16::MAX);
+ let r: i16x2 = dsp_call!(super::__sadd16, a, b);
+ assert_eq!(r, c);
+ }
+ }
+
+ #[test]
+ fn sadd8() {
+ unsafe {
+ let a = i8x4::new(1, 2, 3, i8::MAX);
+ let b = i8x4::new(4, 3, 2, 2);
+ let c = i8x4::new(5, 5, 5, -i8::MAX);
+ let r: i8x4 = dsp_call!(super::__sadd8, a, b);
+ assert_eq!(r, c);
+ }
+ }
+
+ #[test]
+ fn sasx() {
+ unsafe {
+ let a = i16x2::new(1, 2);
+ let b = i16x2::new(2, 1);
+ let c = i16x2::new(0, 4);
+ let r: i16x2 = dsp_call!(super::__sasx, a, b);
+ assert_eq!(r, c);
+ }
+ }
+
+ #[test]
+ fn smlad() {
+ unsafe {
+ let a = i16x2::new(1, 2);
+ let b = i16x2::new(3, 4);
+ let r = super::__smlad(transmute(a), transmute(b), 10);
+ assert_eq!(r, (1 * 3) + (2 * 4) + 10);
+ }
+ }
+
+ #[test]
+ fn smlsd() {
+ unsafe {
+ let a = i16x2::new(1, 2);
+ let b = i16x2::new(3, 4);
+ let r = super::__smlsd(transmute(a), transmute(b), 10);
+ assert_eq!(r, ((1 * 3) - (2 * 4)) + 10);
+ }
+ }
+
+ #[test]
+ fn sel() {
+ unsafe {
+ let a = i8x4::new(1, 2, 3, i8::MAX);
+ let b = i8x4::new(4, 3, 2, 2);
+ // call sadd8() to set GE bits
+ super::__sadd8(transmute(a), transmute(b));
+ let c = i8x4::new(1, 2, 3, i8::MAX);
+ let r: i8x4 = dsp_call!(super::__sel, a, b);
+ assert_eq!(r, c);
+ }
+ }
+
+ #[test]
+ fn shadd8() {
+ unsafe {
+ let a = i8x4::new(1, 2, 3, 4);
+ let b = i8x4::new(5, 4, 3, 2);
+ let c = i8x4::new(3, 3, 3, 3);
+ let r: i8x4 = dsp_call!(super::__shadd8, a, b);
+ assert_eq!(r, c);
+ }
+ }
+
+ #[test]
+ fn shadd16() {
+ unsafe {
+ let a = i16x2::new(1, 2);
+ let b = i16x2::new(5, 4);
+ let c = i16x2::new(3, 3);
+ let r: i16x2 = dsp_call!(super::__shadd16, a, b);
+ assert_eq!(r, c);
+ }
+ }
+
+ #[test]
+ fn shsub8() {
+ unsafe {
+ let a = i8x4::new(1, 2, 3, 4);
+ let b = i8x4::new(5, 4, 3, 2);
+ let c = i8x4::new(-2, -1, 0, 1);
+ let r: i8x4 = dsp_call!(super::__shsub8, a, b);
+ assert_eq!(r, c);
+ }
+ }
+
+ #[test]
+ fn ssub8() {
+ unsafe {
+ let a = i8x4::new(1, 2, 3, 4);
+ let b = i8x4::new(5, 4, 3, 2);
+ let c = i8x4::new(-4, -2, 0, 2);
+ let r: i8x4 = dsp_call!(super::__ssub8, a, b);
+ assert_eq!(r, c);
+ }
+ }
+
+ #[test]
+ fn usub8() {
+ unsafe {
+ let a = u8x4::new(1, 2, 3, 4);
+ let b = u8x4::new(5, 4, 3, 2);
+ let c = u8x4::new(252, 254, 0, 2);
+ let r: u8x4 = dsp_call!(super::__usub8, a, b);
+ assert_eq!(r, c);
+ }
+ }
+
+ #[test]
+ fn shsub16() {
+ unsafe {
+ let a = i16x2::new(1, 2);
+ let b = i16x2::new(5, 4);
+ let c = i16x2::new(-2, -1);
+ let r: i16x2 = dsp_call!(super::__shsub16, a, b);
+ assert_eq!(r, c);
+ }
+ }
+
+ #[test]
+ fn smuad() {
+ unsafe {
+ let a = i16x2::new(1, 2);
+ let b = i16x2::new(5, 4);
+ let r = super::__smuad(transmute(a), transmute(b));
+ assert_eq!(r, 13);
+ }
+ }
+
+ #[test]
+ fn smuadx() {
+ unsafe {
+ let a = i16x2::new(1, 2);
+ let b = i16x2::new(5, 4);
+ let r = super::__smuadx(transmute(a), transmute(b));
+ assert_eq!(r, 14);
+ }
+ }
+
+ #[test]
+ fn smusd() {
+ unsafe {
+ let a = i16x2::new(1, 2);
+ let b = i16x2::new(5, 4);
+ let r = super::__smusd(transmute(a), transmute(b));
+ assert_eq!(r, -3);
+ }
+ }
+
+ #[test]
+ fn smusdx() {
+ unsafe {
+ let a = i16x2::new(1, 2);
+ let b = i16x2::new(5, 4);
+ let r = super::__smusdx(transmute(a), transmute(b));
+ assert_eq!(r, -6);
+ }
+ }
+
+ #[test]
+ fn usad8() {
+ unsafe {
+ let a = i8x4::new(1, 2, 3, 4);
+ let b = i8x4::new(4, 3, 2, 1);
+ let r = super::__usad8(transmute(a), transmute(b));
+ assert_eq!(r, 8);
+ }
+ }
+
+ #[test]
+ fn usad8a() {
+ unsafe {
+ let a = i8x4::new(1, 2, 3, 4);
+ let b = i8x4::new(4, 3, 2, 1);
+ let c = 10;
+ let r = super::__usada8(transmute(a), transmute(b), c);
+ assert_eq!(r, 8 + c);
+ }
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/arm/v6.rs b/library/stdarch/crates/core_arch/src/arm/v6.rs
new file mode 100644
index 000000000..5df30cd62
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/arm/v6.rs
@@ -0,0 +1,49 @@
+//! ARMv6 intrinsics.
+//!
+//! The reference is [ARMv6-M Architecture Reference Manual][armv6m].
+//!
+//! [armv6m]:
+//! http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0419c/index.
+//! html
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+/// Reverse the order of the bytes.
+#[inline]
+#[cfg_attr(test, assert_instr(rev))]
+pub unsafe fn _rev_u16(x: u16) -> u16 {
+ x.swap_bytes() as u16
+}
+
+/// Reverse the order of the bytes.
+#[inline]
+#[cfg_attr(test, assert_instr(rev))]
+pub unsafe fn _rev_u32(x: u32) -> u32 {
+ x.swap_bytes() as u32
+}
+
+#[cfg(test)]
+mod tests {
+ use crate::core_arch::arm::v6;
+
+ #[test]
+ fn _rev_u16() {
+ unsafe {
+ assert_eq!(
+ v6::_rev_u16(0b0000_0000_1111_1111_u16),
+ 0b1111_1111_0000_0000_u16
+ );
+ }
+ }
+
+ #[test]
+ fn _rev_u32() {
+ unsafe {
+ assert_eq!(
+ v6::_rev_u32(0b0000_0000_1111_1111_0000_0000_1111_1111_u32),
+ 0b1111_1111_0000_0000_1111_1111_0000_0000_u32
+ );
+ }
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/arm/v7.rs b/library/stdarch/crates/core_arch/src/arm/v7.rs
new file mode 100644
index 000000000..e7507f9b9
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/arm/v7.rs
@@ -0,0 +1,88 @@
+//! ARMv7 intrinsics.
+//!
+//! The reference is [ARMv7-M Architecture Reference Manual (Issue
+//! E.b)][armv7m].
+//!
+//! [armv7m]:
+//! http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0403e.
+//! b/index.html
+
+pub use super::v6::*;
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+/// Count Leading Zeros.
+#[inline]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(clz))]
+// FIXME: https://github.com/rust-lang/stdarch/issues/382
+// #[cfg_attr(all(test, target_arch = "arm"), assert_instr(clz))]
+pub unsafe fn _clz_u8(x: u8) -> u8 {
+ x.leading_zeros() as u8
+}
+
+/// Count Leading Zeros.
+#[inline]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(clz))]
+// FIXME: https://github.com/rust-lang/stdarch/issues/382
+// #[cfg_attr(all(test, target_arch = "arm"), assert_instr(clz))]
+pub unsafe fn _clz_u16(x: u16) -> u16 {
+ x.leading_zeros() as u16
+}
+
+/// Count Leading Zeros.
+#[inline]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(clz))]
+// FIXME: https://github.com/rust-lang/stdarch/issues/382
+// #[cfg_attr(all(test, target_arch = "arm"), assert_instr(clz))]
+pub unsafe fn _clz_u32(x: u32) -> u32 {
+ x.leading_zeros() as u32
+}
+
+/// Reverse the bit order.
+#[inline]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(test, assert_instr(rbit))]
+pub unsafe fn _rbit_u32(x: u32) -> u32 {
+ crate::intrinsics::bitreverse(x)
+}
+
+#[cfg(test)]
+mod tests {
+ use crate::core_arch::arm::v7;
+
+ #[test]
+ fn _clz_u8() {
+ unsafe {
+ assert_eq!(v7::_clz_u8(0b0000_1010u8), 4u8);
+ }
+ }
+
+ #[test]
+ fn _clz_u16() {
+ unsafe {
+ assert_eq!(v7::_clz_u16(0b0000_1010u16), 12u16);
+ }
+ }
+
+ #[test]
+ fn _clz_u32() {
+ unsafe {
+ assert_eq!(v7::_clz_u32(0b0000_1010u32), 28u32);
+ }
+ }
+
+ #[test]
+ #[cfg(dont_compile_me)] // FIXME need to add `v7` upstream in rustc
+ fn _rbit_u32() {
+ unsafe {
+ assert_eq!(
+ v7::_rbit_u32(0b0000_1010u32),
+ 0b0101_0000_0000_0000_0000_0000_0000_0000u32
+ );
+ }
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/arm_shared/barrier/common.rs b/library/stdarch/crates/core_arch/src/arm_shared/barrier/common.rs
new file mode 100644
index 000000000..0fb35534d
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/arm_shared/barrier/common.rs
@@ -0,0 +1,14 @@
+//! Access types available on all architectures
+
+/// Full system is the required shareability domain, reads and writes are the
+/// required access types
+pub struct SY;
+
+dmb_dsb!(SY);
+
+impl super::super::sealed::Isb for SY {
+ #[inline(always)]
+ unsafe fn __isb(&self) {
+ super::isb(super::arg::SY)
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/arm_shared/barrier/cp15.rs b/library/stdarch/crates/core_arch/src/arm_shared/barrier/cp15.rs
new file mode 100644
index 000000000..6faae0fee
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/arm_shared/barrier/cp15.rs
@@ -0,0 +1,38 @@
+// Reference: ARM11 MPCore Processor Technical Reference Manual (ARM DDI 0360E) Section 3.5 "Summary
+// of CP15 instructions"
+
+use crate::arch::asm;
+
+/// Full system is the required shareability domain, reads and writes are the
+/// required access types
+pub struct SY;
+
+impl super::super::sealed::Dmb for SY {
+ #[inline(always)]
+ unsafe fn __dmb(&self) {
+ asm!(
+ "mcr p15, 0, r0, c7, c10, 5",
+ options(preserves_flags, nostack)
+ )
+ }
+}
+
+impl super::super::sealed::Dsb for SY {
+ #[inline(always)]
+ unsafe fn __dsb(&self) {
+ asm!(
+ "mcr p15, 0, r0, c7, c10, 4",
+ options(preserves_flags, nostack)
+ )
+ }
+}
+
+impl super::super::sealed::Isb for SY {
+ #[inline(always)]
+ unsafe fn __isb(&self) {
+ asm!(
+ "mcr p15, 0, r0, c7, c5, 4",
+ options(preserves_flags, nostack)
+ )
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/arm_shared/barrier/mod.rs b/library/stdarch/crates/core_arch/src/arm_shared/barrier/mod.rs
new file mode 100644
index 000000000..6ccced00e
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/arm_shared/barrier/mod.rs
@@ -0,0 +1,154 @@
+// Reference: Section 7.4 "Hints" of ACLE
+
+// CP15 instruction
+#[cfg(not(any(
+ // v8
+ target_arch = "aarch64",
+ // v7
+ target_feature = "v7",
+ // v6-M
+ target_feature = "mclass"
+)))]
+mod cp15;
+
+#[cfg(not(any(
+ target_arch = "aarch64",
+ target_feature = "v7",
+ target_feature = "mclass"
+)))]
+pub use self::cp15::*;
+
+// Dedicated instructions
+#[cfg(any(
+ target_arch = "aarch64",
+ target_feature = "v7",
+ target_feature = "mclass"
+))]
+macro_rules! dmb_dsb {
+ ($A:ident) => {
+ impl super::super::sealed::Dmb for $A {
+ #[inline(always)]
+ unsafe fn __dmb(&self) {
+ super::dmb(super::arg::$A)
+ }
+ }
+
+ impl super::super::sealed::Dsb for $A {
+ #[inline(always)]
+ unsafe fn __dsb(&self) {
+ super::dsb(super::arg::$A)
+ }
+ }
+ };
+}
+
+#[cfg(any(
+ target_arch = "aarch64",
+ target_feature = "v7",
+ target_feature = "mclass"
+))]
+mod common;
+
+#[cfg(any(
+ target_arch = "aarch64",
+ target_feature = "v7",
+ target_feature = "mclass"
+))]
+pub use self::common::*;
+
+#[cfg(any(target_arch = "aarch64", target_feature = "v7",))]
+mod not_mclass;
+
+#[cfg(any(target_arch = "aarch64", target_feature = "v7",))]
+pub use self::not_mclass::*;
+
+#[cfg(target_arch = "aarch64")]
+mod v8;
+
+#[cfg(target_arch = "aarch64")]
+pub use self::v8::*;
+
+/// Generates a DMB (data memory barrier) instruction or equivalent CP15 instruction.
+///
+/// DMB ensures the observed ordering of memory accesses. Memory accesses of the specified type
+/// issued before the DMB are guaranteed to be observed (in the specified scope) before memory
+/// accesses issued after the DMB.
+///
+/// For example, DMB should be used between storing data, and updating a flag variable that makes
+/// that data available to another core.
+///
+/// The __dmb() intrinsic also acts as a compiler memory barrier of the appropriate type.
+#[inline(always)]
+pub unsafe fn __dmb<A>(arg: A)
+where
+ A: super::sealed::Dmb,
+{
+ arg.__dmb()
+}
+
+/// Generates a DSB (data synchronization barrier) instruction or equivalent CP15 instruction.
+///
+/// DSB ensures the completion of memory accesses. A DSB behaves as the equivalent DMB and has
+/// additional properties. After a DSB instruction completes, all memory accesses of the specified
+/// type issued before the DSB are guaranteed to have completed.
+///
+/// The __dsb() intrinsic also acts as a compiler memory barrier of the appropriate type.
+#[inline(always)]
+pub unsafe fn __dsb<A>(arg: A)
+where
+ A: super::sealed::Dsb,
+{
+ arg.__dsb()
+}
+
+/// Generates an ISB (instruction synchronization barrier) instruction or equivalent CP15
+/// instruction.
+///
+/// This instruction flushes the processor pipeline fetch buffers, so that following instructions
+/// are fetched from cache or memory.
+///
+/// An ISB is needed after some system maintenance operations. An ISB is also needed before
+/// transferring control to code that has been loaded or modified in memory, for example by an
+/// overlay mechanism or just-in-time code generator. (Note that if instruction and data caches are
+/// separate, privileged cache maintenance operations would be needed in order to unify the caches.)
+///
+/// The only supported argument for the __isb() intrinsic is 15, corresponding to the SY (full
+/// system) scope of the ISB instruction.
+#[inline(always)]
+pub unsafe fn __isb<A>(arg: A)
+where
+ A: super::sealed::Isb,
+{
+ arg.__isb()
+}
+
+extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.dmb")]
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.dmb")]
+ fn dmb(_: i32);
+
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.dsb")]
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.dsb")]
+ fn dsb(_: i32);
+
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.isb")]
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.isb")]
+ fn isb(_: i32);
+}
+
+// we put these in a module to prevent weirdness with glob re-exports
+mod arg {
+ // See Section 7.3 Memory barriers of ACLE
+ pub const SY: i32 = 15;
+ pub const ST: i32 = 14;
+ pub const LD: i32 = 13;
+ pub const ISH: i32 = 11;
+ pub const ISHST: i32 = 10;
+ pub const ISHLD: i32 = 9;
+ pub const NSH: i32 = 7;
+ pub const NSHST: i32 = 6;
+ pub const NSHLD: i32 = 5;
+ pub const OSH: i32 = 3;
+ pub const OSHST: i32 = 2;
+ pub const OSHLD: i32 = 1;
+}
diff --git a/library/stdarch/crates/core_arch/src/arm_shared/barrier/not_mclass.rs b/library/stdarch/crates/core_arch/src/arm_shared/barrier/not_mclass.rs
new file mode 100644
index 000000000..385e1d528
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/arm_shared/barrier/not_mclass.rs
@@ -0,0 +1,43 @@
+//! Access types available on v7 and v8 but not on v7(E)-M or v8-M
+
+/// Full system is the required shareability domain, writes are the required
+/// access type
+pub struct ST;
+
+dmb_dsb!(ST);
+
+/// Inner Shareable is the required shareability domain, reads and writes are
+/// the required access types
+pub struct ISH;
+
+dmb_dsb!(ISH);
+
+/// Inner Shareable is the required shareability domain, writes are the required
+/// access type
+pub struct ISHST;
+
+dmb_dsb!(ISHST);
+
+/// Non-shareable is the required shareability domain, reads and writes are the
+/// required access types
+pub struct NSH;
+
+dmb_dsb!(NSH);
+
+/// Non-shareable is the required shareability domain, writes are the required
+/// access type
+pub struct NSHST;
+
+dmb_dsb!(NSHST);
+
+/// Outer Shareable is the required shareability domain, reads and writes are
+/// the required access types
+pub struct OSH;
+
+dmb_dsb!(OSH);
+
+/// Outer Shareable is the required shareability domain, writes are the required
+/// access type
+pub struct OSHST;
+
+dmb_dsb!(OSHST);
diff --git a/library/stdarch/crates/core_arch/src/arm_shared/barrier/v8.rs b/library/stdarch/crates/core_arch/src/arm_shared/barrier/v8.rs
new file mode 100644
index 000000000..db15da805
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/arm_shared/barrier/v8.rs
@@ -0,0 +1,23 @@
+/// Full system is the required shareability domain, reads are the required
+/// access type
+pub struct LD;
+
+dmb_dsb!(LD);
+
+/// Inner Shareable is the required shareability domain, reads are the required
+/// access type
+pub struct ISHLD;
+
+dmb_dsb!(ISHLD);
+
+/// Non-shareable is the required shareability domain, reads are the required
+/// access type
+pub struct NSHLD;
+
+dmb_dsb!(NSHLD);
+
+/// Outer Shareable is the required shareability domain, reads are the required
+/// access type
+pub struct OSHLD;
+
+dmb_dsb!(OSHLD);
diff --git a/library/stdarch/crates/core_arch/src/arm_shared/crc.rs b/library/stdarch/crates/core_arch/src/arm_shared/crc.rs
new file mode 100644
index 000000000..e0d0fbe35
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/arm_shared/crc.rs
@@ -0,0 +1,121 @@
+extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crc32b")]
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.crc32b")]
+ fn crc32b_(crc: u32, data: u32) -> u32;
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crc32h")]
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.crc32h")]
+ fn crc32h_(crc: u32, data: u32) -> u32;
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crc32w")]
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.crc32w")]
+ fn crc32w_(crc: u32, data: u32) -> u32;
+
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crc32cb")]
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.crc32cb")]
+ fn crc32cb_(crc: u32, data: u32) -> u32;
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crc32ch")]
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.crc32ch")]
+ fn crc32ch_(crc: u32, data: u32) -> u32;
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crc32cw")]
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.crc32cw")]
+ fn crc32cw_(crc: u32, data: u32) -> u32;
+}
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+/// CRC32 single round checksum for bytes (8 bits).
+#[inline]
+#[target_feature(enable = "crc")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))]
+#[cfg_attr(test, assert_instr(crc32b))]
+pub unsafe fn __crc32b(crc: u32, data: u8) -> u32 {
+ crc32b_(crc, data as u32)
+}
+
+/// CRC32 single round checksum for half words (16 bits).
+#[inline]
+#[target_feature(enable = "crc")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))]
+#[cfg_attr(test, assert_instr(crc32h))]
+pub unsafe fn __crc32h(crc: u32, data: u16) -> u32 {
+ crc32h_(crc, data as u32)
+}
+
+/// CRC32 single round checksum for words (32 bits).
+#[inline]
+#[target_feature(enable = "crc")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))]
+#[cfg_attr(test, assert_instr(crc32w))]
+pub unsafe fn __crc32w(crc: u32, data: u32) -> u32 {
+ crc32w_(crc, data)
+}
+
+/// CRC32-C single round checksum for bytes (8 bits).
+#[inline]
+#[target_feature(enable = "crc")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))]
+#[cfg_attr(test, assert_instr(crc32cb))]
+pub unsafe fn __crc32cb(crc: u32, data: u8) -> u32 {
+ crc32cb_(crc, data as u32)
+}
+
+/// CRC32-C single round checksum for half words (16 bits).
+#[inline]
+#[target_feature(enable = "crc")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))]
+#[cfg_attr(test, assert_instr(crc32ch))]
+pub unsafe fn __crc32ch(crc: u32, data: u16) -> u32 {
+ crc32ch_(crc, data as u32)
+}
+
+/// CRC32-C single round checksum for words (32 bits).
+#[inline]
+#[target_feature(enable = "crc")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))]
+#[cfg_attr(test, assert_instr(crc32cw))]
+pub unsafe fn __crc32cw(crc: u32, data: u32) -> u32 {
+ crc32cw_(crc, data)
+}
+
+#[cfg(test)]
+mod tests {
+ use crate::core_arch::{arm_shared::*, simd::*};
+ use std::mem;
+ use stdarch_test::simd_test;
+
+ #[simd_test(enable = "crc")]
+ unsafe fn test_crc32b() {
+ assert_eq!(__crc32b(0, 0), 0);
+ assert_eq!(__crc32b(0, 255), 755167117);
+ }
+
+ #[simd_test(enable = "crc")]
+ unsafe fn test_crc32h() {
+ assert_eq!(__crc32h(0, 0), 0);
+ assert_eq!(__crc32h(0, 16384), 1994146192);
+ }
+
+ #[simd_test(enable = "crc")]
+ unsafe fn test_crc32w() {
+ assert_eq!(__crc32w(0, 0), 0);
+ assert_eq!(__crc32w(0, 4294967295), 3736805603);
+ }
+
+ #[simd_test(enable = "crc")]
+ unsafe fn test_crc32cb() {
+ assert_eq!(__crc32cb(0, 0), 0);
+ assert_eq!(__crc32cb(0, 255), 2910671697);
+ }
+
+ #[simd_test(enable = "crc")]
+ unsafe fn test_crc32ch() {
+ assert_eq!(__crc32ch(0, 0), 0);
+ assert_eq!(__crc32ch(0, 16384), 1098587580);
+ }
+
+ #[simd_test(enable = "crc")]
+ unsafe fn test_crc32cw() {
+ assert_eq!(__crc32cw(0, 0), 0);
+ assert_eq!(__crc32cw(0, 4294967295), 3080238136);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/arm_shared/crypto.rs b/library/stdarch/crates/core_arch/src/arm_shared/crypto.rs
new file mode 100644
index 000000000..3e9515e59
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/arm_shared/crypto.rs
@@ -0,0 +1,374 @@
+use crate::core_arch::arm_shared::{uint32x4_t, uint8x16_t};
+
+#[allow(improper_ctypes)]
+extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.aese")]
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.aese")]
+ fn vaeseq_u8_(data: uint8x16_t, key: uint8x16_t) -> uint8x16_t;
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.aesd")]
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.aesd")]
+ fn vaesdq_u8_(data: uint8x16_t, key: uint8x16_t) -> uint8x16_t;
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.aesmc")]
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.aesmc")]
+ fn vaesmcq_u8_(data: uint8x16_t) -> uint8x16_t;
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.aesimc")]
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.aesimc")]
+ fn vaesimcq_u8_(data: uint8x16_t) -> uint8x16_t;
+
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.sha1h")]
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.sha1h")]
+ fn vsha1h_u32_(hash_e: u32) -> u32;
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.sha1su0")]
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.sha1su0")]
+ fn vsha1su0q_u32_(w0_3: uint32x4_t, w4_7: uint32x4_t, w8_11: uint32x4_t) -> uint32x4_t;
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.sha1su1")]
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.sha1su1")]
+ fn vsha1su1q_u32_(tw0_3: uint32x4_t, w12_15: uint32x4_t) -> uint32x4_t;
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.sha1c")]
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.sha1c")]
+ fn vsha1cq_u32_(hash_abcd: uint32x4_t, hash_e: u32, wk: uint32x4_t) -> uint32x4_t;
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.sha1p")]
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.sha1p")]
+ fn vsha1pq_u32_(hash_abcd: uint32x4_t, hash_e: u32, wk: uint32x4_t) -> uint32x4_t;
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.sha1m")]
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.sha1m")]
+ fn vsha1mq_u32_(hash_abcd: uint32x4_t, hash_e: u32, wk: uint32x4_t) -> uint32x4_t;
+
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.sha256h")]
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.sha256h")]
+ fn vsha256hq_u32_(hash_abcd: uint32x4_t, hash_efgh: uint32x4_t, wk: uint32x4_t) -> uint32x4_t;
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.sha256h2")]
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.sha256h2")]
+ fn vsha256h2q_u32_(hash_efgh: uint32x4_t, hash_abcd: uint32x4_t, wk: uint32x4_t) -> uint32x4_t;
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.sha256su0")]
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.sha256su0")]
+ fn vsha256su0q_u32_(w0_3: uint32x4_t, w4_7: uint32x4_t) -> uint32x4_t;
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.sha256su1")]
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.sha256su1")]
+ fn vsha256su1q_u32_(tw0_3: uint32x4_t, w8_11: uint32x4_t, w12_15: uint32x4_t) -> uint32x4_t;
+}
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+/// AES single round encryption.
+#[inline]
+#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "aes"))]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "crypto,v8"))]
+#[cfg_attr(test, assert_instr(aese))]
+pub unsafe fn vaeseq_u8(data: uint8x16_t, key: uint8x16_t) -> uint8x16_t {
+ vaeseq_u8_(data, key)
+}
+
+/// AES single round decryption.
+#[inline]
+#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "aes"))]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "crypto,v8"))]
+#[cfg_attr(test, assert_instr(aesd))]
+pub unsafe fn vaesdq_u8(data: uint8x16_t, key: uint8x16_t) -> uint8x16_t {
+ vaesdq_u8_(data, key)
+}
+
+/// AES mix columns.
+#[inline]
+#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "aes"))]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "crypto,v8"))]
+#[cfg_attr(test, assert_instr(aesmc))]
+pub unsafe fn vaesmcq_u8(data: uint8x16_t) -> uint8x16_t {
+ vaesmcq_u8_(data)
+}
+
+/// AES inverse mix columns.
+#[inline]
+#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "aes"))]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "crypto,v8"))]
+#[cfg_attr(test, assert_instr(aesimc))]
+pub unsafe fn vaesimcq_u8(data: uint8x16_t) -> uint8x16_t {
+ vaesimcq_u8_(data)
+}
+
+/// SHA1 fixed rotate.
+#[inline]
+#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "sha2"))]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "crypto,v8"))]
+#[cfg_attr(test, assert_instr(sha1h))]
+pub unsafe fn vsha1h_u32(hash_e: u32) -> u32 {
+ vsha1h_u32_(hash_e)
+}
+
+/// SHA1 hash update accelerator, choose.
+#[inline]
+#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "sha2"))]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "crypto,v8"))]
+#[cfg_attr(test, assert_instr(sha1c))]
+pub unsafe fn vsha1cq_u32(hash_abcd: uint32x4_t, hash_e: u32, wk: uint32x4_t) -> uint32x4_t {
+ vsha1cq_u32_(hash_abcd, hash_e, wk)
+}
+
+/// SHA1 hash update accelerator, majority.
+#[inline]
+#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "sha2"))]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "crypto,v8"))]
+#[cfg_attr(test, assert_instr(sha1m))]
+pub unsafe fn vsha1mq_u32(hash_abcd: uint32x4_t, hash_e: u32, wk: uint32x4_t) -> uint32x4_t {
+ vsha1mq_u32_(hash_abcd, hash_e, wk)
+}
+
+/// SHA1 hash update accelerator, parity.
+#[inline]
+#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "sha2"))]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "crypto,v8"))]
+#[cfg_attr(test, assert_instr(sha1p))]
+pub unsafe fn vsha1pq_u32(hash_abcd: uint32x4_t, hash_e: u32, wk: uint32x4_t) -> uint32x4_t {
+ vsha1pq_u32_(hash_abcd, hash_e, wk)
+}
+
+/// SHA1 schedule update accelerator, first part.
+#[inline]
+#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "sha2"))]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "crypto,v8"))]
+#[cfg_attr(test, assert_instr(sha1su0))]
+pub unsafe fn vsha1su0q_u32(w0_3: uint32x4_t, w4_7: uint32x4_t, w8_11: uint32x4_t) -> uint32x4_t {
+ vsha1su0q_u32_(w0_3, w4_7, w8_11)
+}
+
+/// SHA1 schedule update accelerator, second part.
+#[inline]
+#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "sha2"))]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "crypto,v8"))]
+#[cfg_attr(test, assert_instr(sha1su1))]
+pub unsafe fn vsha1su1q_u32(tw0_3: uint32x4_t, w12_15: uint32x4_t) -> uint32x4_t {
+ vsha1su1q_u32_(tw0_3, w12_15)
+}
+
+/// SHA256 hash update accelerator.
+#[inline]
+#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "sha2"))]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "crypto,v8"))]
+#[cfg_attr(test, assert_instr(sha256h))]
+pub unsafe fn vsha256hq_u32(
+ hash_abcd: uint32x4_t,
+ hash_efgh: uint32x4_t,
+ wk: uint32x4_t,
+) -> uint32x4_t {
+ vsha256hq_u32_(hash_abcd, hash_efgh, wk)
+}
+
+/// SHA256 hash update accelerator, upper part.
+#[inline]
+#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "sha2"))]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "crypto,v8"))]
+#[cfg_attr(test, assert_instr(sha256h2))]
+pub unsafe fn vsha256h2q_u32(
+ hash_efgh: uint32x4_t,
+ hash_abcd: uint32x4_t,
+ wk: uint32x4_t,
+) -> uint32x4_t {
+ vsha256h2q_u32_(hash_efgh, hash_abcd, wk)
+}
+
+/// SHA256 schedule update accelerator, first part.
+#[inline]
+#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "sha2"))]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "crypto,v8"))]
+#[cfg_attr(test, assert_instr(sha256su0))]
+pub unsafe fn vsha256su0q_u32(w0_3: uint32x4_t, w4_7: uint32x4_t) -> uint32x4_t {
+ vsha256su0q_u32_(w0_3, w4_7)
+}
+
+/// SHA256 schedule update accelerator, second part.
+#[inline]
+#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "sha2"))]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "crypto,v8"))]
+#[cfg_attr(test, assert_instr(sha256su1))]
+pub unsafe fn vsha256su1q_u32(
+ tw0_3: uint32x4_t,
+ w8_11: uint32x4_t,
+ w12_15: uint32x4_t,
+) -> uint32x4_t {
+ vsha256su1q_u32_(tw0_3, w8_11, w12_15)
+}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+ use crate::core_arch::{arm_shared::*, simd::*};
+ use std::mem;
+ use stdarch_test::simd_test;
+
+ #[cfg_attr(target_arch = "arm", simd_test(enable = "crypto"))]
+ #[cfg_attr(not(target_arch = "arm"), simd_test(enable = "aes"))]
+ unsafe fn test_vaeseq_u8() {
+ let data = mem::transmute(u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8));
+ let key = mem::transmute(u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7));
+ let r: u8x16 = mem::transmute(vaeseq_u8(data, key));
+ assert_eq!(
+ r,
+ u8x16::new(
+ 124, 123, 124, 118, 124, 123, 124, 197, 124, 123, 124, 118, 124, 123, 124, 197
+ )
+ );
+ }
+
+ #[cfg_attr(target_arch = "arm", simd_test(enable = "crypto"))]
+ #[cfg_attr(not(target_arch = "arm"), simd_test(enable = "aes"))]
+ unsafe fn test_vaesdq_u8() {
+ let data = mem::transmute(u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8));
+ let key = mem::transmute(u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7));
+ let r: u8x16 = mem::transmute(vaesdq_u8(data, key));
+ assert_eq!(
+ r,
+ u8x16::new(9, 213, 9, 251, 9, 213, 9, 56, 9, 213, 9, 251, 9, 213, 9, 56)
+ );
+ }
+
+ #[cfg_attr(target_arch = "arm", simd_test(enable = "crypto"))]
+ #[cfg_attr(not(target_arch = "arm"), simd_test(enable = "aes"))]
+ unsafe fn test_vaesmcq_u8() {
+ let data = mem::transmute(u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8));
+ let r: u8x16 = mem::transmute(vaesmcq_u8(data));
+ assert_eq!(
+ r,
+ u8x16::new(3, 4, 9, 10, 15, 8, 21, 30, 3, 4, 9, 10, 15, 8, 21, 30)
+ );
+ }
+
+ #[cfg_attr(target_arch = "arm", simd_test(enable = "crypto"))]
+ #[cfg_attr(not(target_arch = "arm"), simd_test(enable = "aes"))]
+ unsafe fn test_vaesimcq_u8() {
+ let data = mem::transmute(u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8));
+ let r: u8x16 = mem::transmute(vaesimcq_u8(data));
+ assert_eq!(
+ r,
+ u8x16::new(43, 60, 33, 50, 103, 80, 125, 70, 43, 60, 33, 50, 103, 80, 125, 70)
+ );
+ }
+
+ #[cfg_attr(target_arch = "arm", simd_test(enable = "crypto"))]
+ #[cfg_attr(not(target_arch = "arm"), simd_test(enable = "sha2"))]
+ unsafe fn test_vsha1h_u32() {
+ assert_eq!(vsha1h_u32(0x1234), 0x048d);
+ assert_eq!(vsha1h_u32(0x5678), 0x159e);
+ }
+
+ #[cfg_attr(target_arch = "arm", simd_test(enable = "crypto"))]
+ #[cfg_attr(not(target_arch = "arm"), simd_test(enable = "sha2"))]
+ unsafe fn test_vsha1su0q_u32() {
+ let r: u32x4 = mem::transmute(vsha1su0q_u32(
+ mem::transmute(u32x4::new(0x1234_u32, 0x5678_u32, 0x9abc_u32, 0xdef0_u32)),
+ mem::transmute(u32x4::new(0x1234_u32, 0x5678_u32, 0x9abc_u32, 0xdef0_u32)),
+ mem::transmute(u32x4::new(0x1234_u32, 0x5678_u32, 0x9abc_u32, 0xdef0_u32)),
+ ));
+ assert_eq!(r, u32x4::new(0x9abc, 0xdef0, 0x1234, 0x5678));
+ }
+
+ #[cfg_attr(target_arch = "arm", simd_test(enable = "crypto"))]
+ #[cfg_attr(not(target_arch = "arm"), simd_test(enable = "sha2"))]
+ unsafe fn test_vsha1su1q_u32() {
+ let r: u32x4 = mem::transmute(vsha1su1q_u32(
+ mem::transmute(u32x4::new(0x1234, 0x5678, 0x9abc, 0xdef0)),
+ mem::transmute(u32x4::new(0x1234, 0x5678, 0x9abc, 0xdef0)),
+ ));
+ assert_eq!(
+ r,
+ u32x4::new(0x00008898, 0x00019988, 0x00008898, 0x0000acd0)
+ );
+ }
+
+ #[cfg_attr(target_arch = "arm", simd_test(enable = "crypto"))]
+ #[cfg_attr(not(target_arch = "arm"), simd_test(enable = "sha2"))]
+ unsafe fn test_vsha1cq_u32() {
+ let r: u32x4 = mem::transmute(vsha1cq_u32(
+ mem::transmute(u32x4::new(0x1234, 0x5678, 0x9abc, 0xdef0)),
+ 0x1234,
+ mem::transmute(u32x4::new(0x1234, 0x5678, 0x9abc, 0xdef0)),
+ ));
+ assert_eq!(
+ r,
+ u32x4::new(0x8a32cbd8, 0x0c518a96, 0x0018a081, 0x0000c168)
+ );
+ }
+
+ #[cfg_attr(target_arch = "arm", simd_test(enable = "crypto"))]
+ #[cfg_attr(not(target_arch = "arm"), simd_test(enable = "sha2"))]
+ unsafe fn test_vsha1pq_u32() {
+ let r: u32x4 = mem::transmute(vsha1pq_u32(
+ mem::transmute(u32x4::new(0x1234, 0x5678, 0x9abc, 0xdef0)),
+ 0x1234,
+ mem::transmute(u32x4::new(0x1234, 0x5678, 0x9abc, 0xdef0)),
+ ));
+ assert_eq!(
+ r,
+ u32x4::new(0x469f0ba3, 0x0a326147, 0x80145d7f, 0x00009f47)
+ );
+ }
+
+ #[cfg_attr(target_arch = "arm", simd_test(enable = "crypto"))]
+ #[cfg_attr(not(target_arch = "arm"), simd_test(enable = "sha2"))]
+ unsafe fn test_vsha1mq_u32() {
+ let r: u32x4 = mem::transmute(vsha1mq_u32(
+ mem::transmute(u32x4::new(0x1234, 0x5678, 0x9abc, 0xdef0)),
+ 0x1234,
+ mem::transmute(u32x4::new(0x1234, 0x5678, 0x9abc, 0xdef0)),
+ ));
+ assert_eq!(
+ r,
+ u32x4::new(0xaa39693b, 0x0d51bf84, 0x001aa109, 0x0000d278)
+ );
+ }
+
+ #[cfg_attr(target_arch = "arm", simd_test(enable = "crypto"))]
+ #[cfg_attr(not(target_arch = "arm"), simd_test(enable = "sha2"))]
+ unsafe fn test_vsha256hq_u32() {
+ let r: u32x4 = mem::transmute(vsha256hq_u32(
+ mem::transmute(u32x4::new(0x1234, 0x5678, 0x9abc, 0xdef0)),
+ mem::transmute(u32x4::new(0x1234, 0x5678, 0x9abc, 0xdef0)),
+ mem::transmute(u32x4::new(0x1234, 0x5678, 0x9abc, 0xdef0)),
+ ));
+ assert_eq!(
+ r,
+ u32x4::new(0x05e9aaa8, 0xec5f4c02, 0x20a1ea61, 0x28738cef)
+ );
+ }
+
+ #[cfg_attr(target_arch = "arm", simd_test(enable = "crypto"))]
+ #[cfg_attr(not(target_arch = "arm"), simd_test(enable = "sha2"))]
+ unsafe fn test_vsha256h2q_u32() {
+ let r: u32x4 = mem::transmute(vsha256h2q_u32(
+ mem::transmute(u32x4::new(0x1234, 0x5678, 0x9abc, 0xdef0)),
+ mem::transmute(u32x4::new(0x1234, 0x5678, 0x9abc, 0xdef0)),
+ mem::transmute(u32x4::new(0x1234, 0x5678, 0x9abc, 0xdef0)),
+ ));
+ assert_eq!(
+ r,
+ u32x4::new(0x3745362e, 0x2fb51d00, 0xbd4c529b, 0x968b8516)
+ );
+ }
+
+ #[cfg_attr(target_arch = "arm", simd_test(enable = "crypto"))]
+ #[cfg_attr(not(target_arch = "arm"), simd_test(enable = "sha2"))]
+ unsafe fn test_vsha256su0q_u32() {
+ let r: u32x4 = mem::transmute(vsha256su0q_u32(
+ mem::transmute(u32x4::new(0x1234, 0x5678, 0x9abc, 0xdef0)),
+ mem::transmute(u32x4::new(0x1234, 0x5678, 0x9abc, 0xdef0)),
+ ));
+ assert_eq!(
+ r,
+ u32x4::new(0xe59e1c97, 0x5eaf68da, 0xd7bcb51f, 0x6c8de152)
+ );
+ }
+
+ #[cfg_attr(target_arch = "arm", simd_test(enable = "crypto"))]
+ #[cfg_attr(not(target_arch = "arm"), simd_test(enable = "sha2"))]
+ unsafe fn test_vsha256su1q_u32() {
+ let r: u32x4 = mem::transmute(vsha256su1q_u32(
+ mem::transmute(u32x4::new(0x1234, 0x5678, 0x9abc, 0xdef0)),
+ mem::transmute(u32x4::new(0x1234, 0x5678, 0x9abc, 0xdef0)),
+ mem::transmute(u32x4::new(0x1234, 0x5678, 0x9abc, 0xdef0)),
+ ));
+ assert_eq!(
+ r,
+ u32x4::new(0x5e09e8d2, 0x74a6f16b, 0xc966606b, 0xa686ee9f)
+ );
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/arm_shared/hints.rs b/library/stdarch/crates/core_arch/src/arm_shared/hints.rs
new file mode 100644
index 000000000..d7e43f551
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/arm_shared/hints.rs
@@ -0,0 +1,95 @@
+// # References
+//
+// - Section 7.4 "Hints" of ACLE
+// - Section 7.7 "NOP" of ACLE
+
+/// Generates a WFI (wait for interrupt) hint instruction, or nothing.
+///
+/// The WFI instruction allows (but does not require) the processor to enter a
+/// low-power state until one of a number of asynchronous events occurs.
+// Section 10.1 of ACLE says that the supported arches are: 8, 6K, 6-M
+// LLVM says "instruction requires: armv6k"
+#[cfg(any(target_feature = "v6", target_arch = "aarch64", doc))]
+#[inline(always)]
+pub unsafe fn __wfi() {
+ hint(HINT_WFI);
+}
+
+/// Generates a WFE (wait for event) hint instruction, or nothing.
+///
+/// The WFE instruction allows (but does not require) the processor to enter a
+/// low-power state until some event occurs such as a SEV being issued by
+/// another processor.
+// Section 10.1 of ACLE says that the supported arches are: 8, 6K, 6-M
+// LLVM says "instruction requires: armv6k"
+#[cfg(any(target_feature = "v6", target_arch = "aarch64", doc))]
+#[inline(always)]
+pub unsafe fn __wfe() {
+ hint(HINT_WFE);
+}
+
+/// Generates a SEV (send a global event) hint instruction.
+///
+/// This causes an event to be signaled to all processors in a multiprocessor
+/// system. It is a NOP on a uniprocessor system.
+// Section 10.1 of ACLE says that the supported arches are: 8, 6K, 6-M, 7-M
+// LLVM says "instruction requires: armv6k"
+#[cfg(any(target_feature = "v6", target_arch = "aarch64", doc))]
+#[inline(always)]
+pub unsafe fn __sev() {
+ hint(HINT_SEV);
+}
+
+/// Generates a send a local event hint instruction.
+///
+/// This causes an event to be signaled to only the processor executing this
+/// instruction. In a multiprocessor system, it is not required to affect the
+/// other processors.
+// LLVM says "instruction requires: armv8"
+#[cfg(any(
+ target_feature = "v8", // 32-bit ARMv8
+ target_arch = "aarch64", // AArch64
+ doc,
+))]
+#[inline(always)]
+pub unsafe fn __sevl() {
+ hint(HINT_SEVL);
+}
+
+/// Generates a YIELD hint instruction.
+///
+/// This enables multithreading software to indicate to the hardware that it is
+/// performing a task, for example a spin-lock, that could be swapped out to
+/// improve overall system performance.
+// Section 10.1 of ACLE says that the supported arches are: 8, 6K, 6-M
+// LLVM says "instruction requires: armv6k"
+#[cfg(any(target_feature = "v6", target_arch = "aarch64", doc))]
+#[inline(always)]
+pub unsafe fn __yield() {
+ hint(HINT_YIELD);
+}
+
+/// Generates an unspecified no-op instruction.
+///
+/// Note that not all architectures provide a distinguished NOP instruction. On
+/// those that do, it is unspecified whether this intrinsic generates it or
+/// another instruction. It is not guaranteed that inserting this instruction
+/// will increase execution time.
+#[inline(always)]
+pub unsafe fn __nop() {
+ crate::arch::asm!("nop", options(nomem, nostack, preserves_flags));
+}
+
+extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.hint")]
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.hint")]
+ fn hint(_: i32);
+}
+
+// from LLVM 7.0.1's lib/Target/ARM/{ARMInstrThumb,ARMInstrInfo,ARMInstrThumb2}.td
+const HINT_NOP: i32 = 0;
+const HINT_YIELD: i32 = 1;
+const HINT_WFE: i32 = 2;
+const HINT_WFI: i32 = 3;
+const HINT_SEV: i32 = 4;
+const HINT_SEVL: i32 = 5;
diff --git a/library/stdarch/crates/core_arch/src/arm_shared/mod.rs b/library/stdarch/crates/core_arch/src/arm_shared/mod.rs
new file mode 100644
index 000000000..4c8d19854
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/arm_shared/mod.rs
@@ -0,0 +1,120 @@
+//! ARM C Language Extensions (ACLE)
+//!
+//! # Developer notes
+//!
+//! Below is a list of built-in targets that are representative of the different ARM
+//! architectures; the list includes the `target_feature`s they possess.
+//!
+//! - `armv4t-unknown-linux-gnueabi` - **ARMv4** - `+v4t`
+//! - `armv5te-unknown-linux-gnueabi` - **ARMv5TE** - `+v4t +v5te`
+//! - `arm-unknown-linux-gnueabi` - **ARMv6** - `+v4t +v5te +v6`
+//! - `thumbv6m-none-eabi` - **ARMv6-M** - `+v4t +v5te +v6 +thumb-mode +mclass`
+//! - `armv7-unknown-linux-gnueabihf` - **ARMv7-A** - `+v4t +v5te +v6 +v6k +v6t2 +v7 +dsp +thumb2 +aclass`
+//! - `armv7r-none-eabi` - **ARMv7-R** - `+v4t +v5te +v6 +v6k +v6t2 +v7 +dsp +thumb2 +rclass`
+//! - `thumbv7m-none-eabi` - **ARMv7-M** - `+v4t +v5te +v6 +v6k +v6t2 +v7 +thumb2 +thumb-mode +mclass`
+//! - `thumbv7em-none-eabi` - **ARMv7E-M** - `+v4t +v5te +v6 +v6k +v6t2 +v7 +dsp +thumb2 +thumb-mode +mclass`
+//! - `thumbv8m.main-none-eabi` - **ARMv8-M** - `+v4t +v5te +v6 +v6k +v6t2 +v7 +thumb2 +thumb-mode +mclass`
+//! - `armv8r-none-eabi` - **ARMv8-R** - `+v4t +v5te +v6 +v6k +v6t2 +v7 +v8 +thumb2 +rclass`
+//! - `aarch64-unknown-linux-gnu` - **ARMv8-A (AArch64)** - `+fp +neon`
+//!
+//! Section 10.1 of ACLE says:
+//!
+//! - "In the sequence of Arm architectures { v5, v5TE, v6, v6T2, v7 } each architecture includes
+//! its predecessor instruction set."
+//!
+//! - "In the sequence of Thumb-only architectures { v6-M, v7-M, v7E-M } each architecture includes
+//! its predecessor instruction set."
+//!
+//! From that info and from looking at how LLVM features work (using custom targets) we can identify
+//! features that are subsets of others:
+//!
+//! Legend: `a < b` reads as "`a` is a subset of `b`"; this means that if `b` is enabled then `a` is
+//! enabled as well.
+//!
+//! - `v4t < v5te < v6 < v6k < v6t2 < v7 < v8`
+//! - `v6 < v8m < v6t2`
+//! - `v7 < v8m.main`
+//!
+//! *NOTE*: Section 5.4.7 of ACLE says:
+//!
+//! - "__ARM_FEATURE_DSP is defined to 1 if the DSP (v5E) instructions are supported and the
+//! intrinsics defined in Saturating intrinsics are available."
+//!
+//! This does *not* match how LLVM uses the '+dsp' feature; this feature is not set for v5te
+//! targets so we have to work around this difference.
+//!
+//! # References
+//!
+//! - [ACLE Q2 2018](https://developer.arm.com/docs/101028/latest)
+
+// Only for 'neon' submodule
+#![allow(non_camel_case_types)]
+
+// 8, 7 and 6-M are supported via dedicated instructions like DMB. All other arches are supported
+// via CP15 instructions. See Section 10.1 of ACLE
+mod barrier;
+
+pub use self::barrier::*;
+
+mod hints;
+pub use self::hints::*;
+
+mod registers;
+pub use self::registers::*;
+
+#[cfg(any(target_arch = "aarch64", target_feature = "v7", doc))]
+mod crc;
+#[cfg(any(target_arch = "aarch64", target_feature = "v7", doc))]
+pub use crc::*;
+
+#[cfg(any(target_arch = "aarch64", target_feature = "v7", doc))]
+mod crypto;
+#[cfg(any(target_arch = "aarch64", target_feature = "v7", doc))]
+pub use self::crypto::*;
+
+#[cfg(any(target_arch = "aarch64", target_feature = "v7", doc))]
+pub(crate) mod neon;
+#[cfg(any(target_arch = "aarch64", target_feature = "v7", doc))]
+pub use self::neon::*;
+
+#[cfg(test)]
+#[cfg(any(target_arch = "aarch64", target_feature = "v7", doc))]
+pub(crate) mod test_support;
+
+mod sealed {
+ pub trait Dmb {
+ unsafe fn __dmb(&self);
+ }
+
+ pub trait Dsb {
+ unsafe fn __dsb(&self);
+ }
+
+ pub trait Isb {
+ unsafe fn __isb(&self);
+ }
+
+ pub trait Rsr {
+ unsafe fn __rsr(&self) -> u32;
+ }
+
+ pub trait Rsr64 {
+ unsafe fn __rsr64(&self) -> u64;
+ }
+
+ pub trait Rsrp {
+ unsafe fn __rsrp(&self) -> *const u8;
+ }
+
+ pub trait Wsr {
+ unsafe fn __wsr(&self, value: u32);
+ }
+
+ pub trait Wsr64 {
+ unsafe fn __wsr64(&self, value: u64);
+ }
+
+ pub trait Wsrp {
+ unsafe fn __wsrp(&self, value: *const u8);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/arm_shared/neon/generated.rs b/library/stdarch/crates/core_arch/src/arm_shared/neon/generated.rs
new file mode 100644
index 000000000..d69fbd8e8
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/arm_shared/neon/generated.rs
@@ -0,0 +1,40888 @@
+// This code is automatically generated. DO NOT MODIFY.
+//
+// Instead, modify `crates/stdarch-gen/neon.spec` and run the following command to re-generate this file:
+//
+// ```
+// OUT_DIR=`pwd`/crates/core_arch cargo run -p stdarch-gen -- crates/stdarch-gen/neon.spec
+// ```
+use super::*;
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+/// Vector bitwise and
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vand))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(and))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vand_s8(a: int8x8_t, b: int8x8_t) -> int8x8_t {
+ simd_and(a, b)
+}
+
+/// Vector bitwise and
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vand))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(and))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vandq_s8(a: int8x16_t, b: int8x16_t) -> int8x16_t {
+ simd_and(a, b)
+}
+
+/// Vector bitwise and
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vand))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(and))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vand_s16(a: int16x4_t, b: int16x4_t) -> int16x4_t {
+ simd_and(a, b)
+}
+
+/// Vector bitwise and
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vand))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(and))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vandq_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t {
+ simd_and(a, b)
+}
+
+/// Vector bitwise and
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vand))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(and))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vand_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t {
+ simd_and(a, b)
+}
+
+/// Vector bitwise and
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vand))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(and))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vandq_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t {
+ simd_and(a, b)
+}
+
+/// Vector bitwise and
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vand))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(and))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vand_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t {
+ simd_and(a, b)
+}
+
+/// Vector bitwise and
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vand))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(and))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vandq_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t {
+ simd_and(a, b)
+}
+
+/// Vector bitwise and
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vand))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(and))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vand_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t {
+ simd_and(a, b)
+}
+
+/// Vector bitwise and
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vand))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(and))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vandq_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t {
+ simd_and(a, b)
+}
+
+/// Vector bitwise and
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vand))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(and))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vand_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t {
+ simd_and(a, b)
+}
+
+/// Vector bitwise and
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vand))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(and))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vandq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
+ simd_and(a, b)
+}
+
+/// Vector bitwise and
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vand))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(and))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vand_s64(a: int64x1_t, b: int64x1_t) -> int64x1_t {
+ simd_and(a, b)
+}
+
+/// Vector bitwise and
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vand))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(and))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vandq_s64(a: int64x2_t, b: int64x2_t) -> int64x2_t {
+ simd_and(a, b)
+}
+
+/// Vector bitwise and
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vand))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(and))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vand_u64(a: uint64x1_t, b: uint64x1_t) -> uint64x1_t {
+ simd_and(a, b)
+}
+
+/// Vector bitwise and
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vand))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(and))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vandq_u64(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t {
+ simd_and(a, b)
+}
+
+/// Vector bitwise or (immediate, inclusive)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorr))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(orr))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vorr_s8(a: int8x8_t, b: int8x8_t) -> int8x8_t {
+ simd_or(a, b)
+}
+
+/// Vector bitwise or (immediate, inclusive)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorr))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(orr))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vorrq_s8(a: int8x16_t, b: int8x16_t) -> int8x16_t {
+ simd_or(a, b)
+}
+
+/// Vector bitwise or (immediate, inclusive)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorr))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(orr))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vorr_s16(a: int16x4_t, b: int16x4_t) -> int16x4_t {
+ simd_or(a, b)
+}
+
+/// Vector bitwise or (immediate, inclusive)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorr))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(orr))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vorrq_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t {
+ simd_or(a, b)
+}
+
+/// Vector bitwise or (immediate, inclusive)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorr))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(orr))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vorr_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t {
+ simd_or(a, b)
+}
+
+/// Vector bitwise or (immediate, inclusive)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorr))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(orr))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vorrq_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t {
+ simd_or(a, b)
+}
+
+/// Vector bitwise or (immediate, inclusive)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorr))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(orr))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vorr_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t {
+ simd_or(a, b)
+}
+
+/// Vector bitwise or (immediate, inclusive)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorr))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(orr))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vorrq_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t {
+ simd_or(a, b)
+}
+
+/// Vector bitwise or (immediate, inclusive)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorr))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(orr))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vorr_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t {
+ simd_or(a, b)
+}
+
+/// Vector bitwise or (immediate, inclusive)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorr))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(orr))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vorrq_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t {
+ simd_or(a, b)
+}
+
+/// Vector bitwise or (immediate, inclusive)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorr))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(orr))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vorr_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t {
+ simd_or(a, b)
+}
+
+/// Vector bitwise or (immediate, inclusive)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorr))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(orr))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vorrq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
+ simd_or(a, b)
+}
+
+/// Vector bitwise or (immediate, inclusive)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorr))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(orr))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vorr_s64(a: int64x1_t, b: int64x1_t) -> int64x1_t {
+ simd_or(a, b)
+}
+
+/// Vector bitwise or (immediate, inclusive)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorr))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(orr))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vorrq_s64(a: int64x2_t, b: int64x2_t) -> int64x2_t {
+ simd_or(a, b)
+}
+
+/// Vector bitwise or (immediate, inclusive)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorr))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(orr))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vorr_u64(a: uint64x1_t, b: uint64x1_t) -> uint64x1_t {
+ simd_or(a, b)
+}
+
+/// Vector bitwise or (immediate, inclusive)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorr))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(orr))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vorrq_u64(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t {
+ simd_or(a, b)
+}
+
+/// Vector bitwise exclusive or (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(veor))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(eor))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn veor_s8(a: int8x8_t, b: int8x8_t) -> int8x8_t {
+ simd_xor(a, b)
+}
+
+/// Vector bitwise exclusive or (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(veor))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(eor))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn veorq_s8(a: int8x16_t, b: int8x16_t) -> int8x16_t {
+ simd_xor(a, b)
+}
+
+/// Vector bitwise exclusive or (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(veor))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(eor))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn veor_s16(a: int16x4_t, b: int16x4_t) -> int16x4_t {
+ simd_xor(a, b)
+}
+
+/// Vector bitwise exclusive or (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(veor))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(eor))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn veorq_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t {
+ simd_xor(a, b)
+}
+
+/// Vector bitwise exclusive or (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(veor))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(eor))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn veor_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t {
+ simd_xor(a, b)
+}
+
+/// Vector bitwise exclusive or (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(veor))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(eor))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn veorq_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t {
+ simd_xor(a, b)
+}
+
+/// Vector bitwise exclusive or (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(veor))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(eor))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn veor_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t {
+ simd_xor(a, b)
+}
+
+/// Vector bitwise exclusive or (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(veor))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(eor))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn veorq_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t {
+ simd_xor(a, b)
+}
+
+/// Vector bitwise exclusive or (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(veor))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(eor))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn veor_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t {
+ simd_xor(a, b)
+}
+
+/// Vector bitwise exclusive or (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(veor))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(eor))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn veorq_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t {
+ simd_xor(a, b)
+}
+
+/// Vector bitwise exclusive or (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(veor))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(eor))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn veor_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t {
+ simd_xor(a, b)
+}
+
+/// Vector bitwise exclusive or (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(veor))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(eor))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn veorq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
+ simd_xor(a, b)
+}
+
+/// Vector bitwise exclusive or (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(veor))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(eor))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn veor_s64(a: int64x1_t, b: int64x1_t) -> int64x1_t {
+ simd_xor(a, b)
+}
+
+/// Vector bitwise exclusive or (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(veor))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(eor))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn veorq_s64(a: int64x2_t, b: int64x2_t) -> int64x2_t {
+ simd_xor(a, b)
+}
+
+/// Vector bitwise exclusive or (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(veor))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(eor))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn veor_u64(a: uint64x1_t, b: uint64x1_t) -> uint64x1_t {
+ simd_xor(a, b)
+}
+
+/// Vector bitwise exclusive or (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(veor))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(eor))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn veorq_u64(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t {
+ simd_xor(a, b)
+}
+
+/// Absolute difference between the arguments
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vabd.s8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sabd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vabd_s8(a: int8x8_t, b: int8x8_t) -> int8x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vabds.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sabd.v8i8")]
+ fn vabd_s8_(a: int8x8_t, b: int8x8_t) -> int8x8_t;
+ }
+vabd_s8_(a, b)
+}
+
+/// Absolute difference between the arguments
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vabd.s8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sabd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vabdq_s8(a: int8x16_t, b: int8x16_t) -> int8x16_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vabds.v16i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sabd.v16i8")]
+ fn vabdq_s8_(a: int8x16_t, b: int8x16_t) -> int8x16_t;
+ }
+vabdq_s8_(a, b)
+}
+
+/// Absolute difference between the arguments
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vabd.s16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sabd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vabd_s16(a: int16x4_t, b: int16x4_t) -> int16x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vabds.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sabd.v4i16")]
+ fn vabd_s16_(a: int16x4_t, b: int16x4_t) -> int16x4_t;
+ }
+vabd_s16_(a, b)
+}
+
+/// Absolute difference between the arguments
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vabd.s16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sabd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vabdq_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vabds.v8i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sabd.v8i16")]
+ fn vabdq_s16_(a: int16x8_t, b: int16x8_t) -> int16x8_t;
+ }
+vabdq_s16_(a, b)
+}
+
+/// Absolute difference between the arguments
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vabd.s32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sabd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vabd_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vabds.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sabd.v2i32")]
+ fn vabd_s32_(a: int32x2_t, b: int32x2_t) -> int32x2_t;
+ }
+vabd_s32_(a, b)
+}
+
+/// Absolute difference between the arguments
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vabd.s32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sabd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vabdq_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vabds.v4i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sabd.v4i32")]
+ fn vabdq_s32_(a: int32x4_t, b: int32x4_t) -> int32x4_t;
+ }
+vabdq_s32_(a, b)
+}
+
+/// Absolute difference between the arguments
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vabd.u8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uabd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vabd_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vabdu.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uabd.v8i8")]
+ fn vabd_u8_(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t;
+ }
+vabd_u8_(a, b)
+}
+
+/// Absolute difference between the arguments
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vabd.u8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uabd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vabdq_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vabdu.v16i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uabd.v16i8")]
+ fn vabdq_u8_(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t;
+ }
+vabdq_u8_(a, b)
+}
+
+/// Absolute difference between the arguments
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vabd.u16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uabd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vabd_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vabdu.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uabd.v4i16")]
+ fn vabd_u16_(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t;
+ }
+vabd_u16_(a, b)
+}
+
+/// Absolute difference between the arguments
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vabd.u16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uabd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vabdq_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vabdu.v8i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uabd.v8i16")]
+ fn vabdq_u16_(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t;
+ }
+vabdq_u16_(a, b)
+}
+
+/// Absolute difference between the arguments
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vabd.u32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uabd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vabd_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vabdu.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uabd.v2i32")]
+ fn vabd_u32_(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t;
+ }
+vabd_u32_(a, b)
+}
+
+/// Absolute difference between the arguments
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vabd.u32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uabd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vabdq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vabdu.v4i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uabd.v4i32")]
+ fn vabdq_u32_(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t;
+ }
+vabdq_u32_(a, b)
+}
+
+/// Absolute difference between the arguments of Floating
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vabd.f32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fabd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vabd_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vabds.v2f32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fabd.v2f32")]
+ fn vabd_f32_(a: float32x2_t, b: float32x2_t) -> float32x2_t;
+ }
+vabd_f32_(a, b)
+}
+
+/// Absolute difference between the arguments of Floating
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vabd.f32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fabd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vabdq_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vabds.v4f32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fabd.v4f32")]
+ fn vabdq_f32_(a: float32x4_t, b: float32x4_t) -> float32x4_t;
+ }
+vabdq_f32_(a, b)
+}
+
+/// Unsigned Absolute difference Long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vabdl.u8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uabdl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vabdl_u8(a: uint8x8_t, b: uint8x8_t) -> uint16x8_t {
+ simd_cast(vabd_u8(a, b))
+}
+
+/// Unsigned Absolute difference Long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vabdl.u16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uabdl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vabdl_u16(a: uint16x4_t, b: uint16x4_t) -> uint32x4_t {
+ simd_cast(vabd_u16(a, b))
+}
+
+/// Unsigned Absolute difference Long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vabdl.u32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uabdl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vabdl_u32(a: uint32x2_t, b: uint32x2_t) -> uint64x2_t {
+ simd_cast(vabd_u32(a, b))
+}
+
+/// Signed Absolute difference Long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vabdl.s8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sabdl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vabdl_s8(a: int8x8_t, b: int8x8_t) -> int16x8_t {
+ let c: uint8x8_t = simd_cast(vabd_s8(a, b));
+ simd_cast(c)
+}
+
+/// Signed Absolute difference Long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vabdl.s16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sabdl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vabdl_s16(a: int16x4_t, b: int16x4_t) -> int32x4_t {
+ let c: uint16x4_t = simd_cast(vabd_s16(a, b));
+ simd_cast(c)
+}
+
+/// Signed Absolute difference Long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vabdl.s32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sabdl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vabdl_s32(a: int32x2_t, b: int32x2_t) -> int64x2_t {
+ let c: uint32x2_t = simd_cast(vabd_s32(a, b));
+ simd_cast(c)
+}
+
+/// Compare bitwise Equal (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vceq.i8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmeq))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vceq_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t {
+ simd_eq(a, b)
+}
+
+/// Compare bitwise Equal (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vceq.i8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmeq))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vceqq_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t {
+ simd_eq(a, b)
+}
+
+/// Compare bitwise Equal (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vceq.i16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmeq))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vceq_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t {
+ simd_eq(a, b)
+}
+
+/// Compare bitwise Equal (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vceq.i16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmeq))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vceqq_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t {
+ simd_eq(a, b)
+}
+
+/// Compare bitwise Equal (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vceq.i32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmeq))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vceq_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t {
+ simd_eq(a, b)
+}
+
+/// Compare bitwise Equal (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vceq.i32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmeq))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vceqq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
+ simd_eq(a, b)
+}
+
+/// Compare bitwise Equal (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vceq.i8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmeq))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vceq_s8(a: int8x8_t, b: int8x8_t) -> uint8x8_t {
+ simd_eq(a, b)
+}
+
+/// Compare bitwise Equal (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vceq.i8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmeq))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vceqq_s8(a: int8x16_t, b: int8x16_t) -> uint8x16_t {
+ simd_eq(a, b)
+}
+
+/// Compare bitwise Equal (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vceq.i16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmeq))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vceq_s16(a: int16x4_t, b: int16x4_t) -> uint16x4_t {
+ simd_eq(a, b)
+}
+
+/// Compare bitwise Equal (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vceq.i16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmeq))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vceqq_s16(a: int16x8_t, b: int16x8_t) -> uint16x8_t {
+ simd_eq(a, b)
+}
+
+/// Compare bitwise Equal (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vceq.i32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmeq))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vceq_s32(a: int32x2_t, b: int32x2_t) -> uint32x2_t {
+ simd_eq(a, b)
+}
+
+/// Compare bitwise Equal (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vceq.i32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmeq))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vceqq_s32(a: int32x4_t, b: int32x4_t) -> uint32x4_t {
+ simd_eq(a, b)
+}
+
+/// Compare bitwise Equal (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vceq.i8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmeq))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vceq_p8(a: poly8x8_t, b: poly8x8_t) -> uint8x8_t {
+ simd_eq(a, b)
+}
+
+/// Compare bitwise Equal (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vceq.i8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmeq))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vceqq_p8(a: poly8x16_t, b: poly8x16_t) -> uint8x16_t {
+ simd_eq(a, b)
+}
+
+/// Floating-point compare equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vceq.f32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fcmeq))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vceq_f32(a: float32x2_t, b: float32x2_t) -> uint32x2_t {
+ simd_eq(a, b)
+}
+
+/// Floating-point compare equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vceq.f32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fcmeq))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vceqq_f32(a: float32x4_t, b: float32x4_t) -> uint32x4_t {
+ simd_eq(a, b)
+}
+
+/// Signed compare bitwise Test bits nonzero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtst))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmtst))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vtst_s8(a: int8x8_t, b: int8x8_t) -> uint8x8_t {
+ let c: int8x8_t = simd_and(a, b);
+ let d: i8x8 = i8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ simd_ne(c, transmute(d))
+}
+
+/// Signed compare bitwise Test bits nonzero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtst))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmtst))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vtstq_s8(a: int8x16_t, b: int8x16_t) -> uint8x16_t {
+ let c: int8x16_t = simd_and(a, b);
+ let d: i8x16 = i8x16::new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ simd_ne(c, transmute(d))
+}
+
+/// Signed compare bitwise Test bits nonzero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtst))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmtst))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vtst_s16(a: int16x4_t, b: int16x4_t) -> uint16x4_t {
+ let c: int16x4_t = simd_and(a, b);
+ let d: i16x4 = i16x4::new(0, 0, 0, 0);
+ simd_ne(c, transmute(d))
+}
+
+/// Signed compare bitwise Test bits nonzero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtst))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmtst))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vtstq_s16(a: int16x8_t, b: int16x8_t) -> uint16x8_t {
+ let c: int16x8_t = simd_and(a, b);
+ let d: i16x8 = i16x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ simd_ne(c, transmute(d))
+}
+
+/// Signed compare bitwise Test bits nonzero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtst))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmtst))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vtst_s32(a: int32x2_t, b: int32x2_t) -> uint32x2_t {
+ let c: int32x2_t = simd_and(a, b);
+ let d: i32x2 = i32x2::new(0, 0);
+ simd_ne(c, transmute(d))
+}
+
+/// Signed compare bitwise Test bits nonzero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtst))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmtst))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vtstq_s32(a: int32x4_t, b: int32x4_t) -> uint32x4_t {
+ let c: int32x4_t = simd_and(a, b);
+ let d: i32x4 = i32x4::new(0, 0, 0, 0);
+ simd_ne(c, transmute(d))
+}
+
+/// Signed compare bitwise Test bits nonzero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtst))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmtst))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vtst_p8(a: poly8x8_t, b: poly8x8_t) -> uint8x8_t {
+ let c: poly8x8_t = simd_and(a, b);
+ let d: i8x8 = i8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ simd_ne(c, transmute(d))
+}
+
+/// Signed compare bitwise Test bits nonzero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtst))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmtst))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vtstq_p8(a: poly8x16_t, b: poly8x16_t) -> uint8x16_t {
+ let c: poly8x16_t = simd_and(a, b);
+ let d: i8x16 = i8x16::new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ simd_ne(c, transmute(d))
+}
+
+/// Signed compare bitwise Test bits nonzero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtst))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmtst))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vtst_p16(a: poly16x4_t, b: poly16x4_t) -> uint16x4_t {
+ let c: poly16x4_t = simd_and(a, b);
+ let d: i16x4 = i16x4::new(0, 0, 0, 0);
+ simd_ne(c, transmute(d))
+}
+
+/// Signed compare bitwise Test bits nonzero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtst))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmtst))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vtstq_p16(a: poly16x8_t, b: poly16x8_t) -> uint16x8_t {
+ let c: poly16x8_t = simd_and(a, b);
+ let d: i16x8 = i16x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ simd_ne(c, transmute(d))
+}
+
+/// Unsigned compare bitwise Test bits nonzero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtst))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmtst))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vtst_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t {
+ let c: uint8x8_t = simd_and(a, b);
+ let d: u8x8 = u8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ simd_ne(c, transmute(d))
+}
+
+/// Unsigned compare bitwise Test bits nonzero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtst))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmtst))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vtstq_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t {
+ let c: uint8x16_t = simd_and(a, b);
+ let d: u8x16 = u8x16::new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ simd_ne(c, transmute(d))
+}
+
+/// Unsigned compare bitwise Test bits nonzero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtst))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmtst))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vtst_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t {
+ let c: uint16x4_t = simd_and(a, b);
+ let d: u16x4 = u16x4::new(0, 0, 0, 0);
+ simd_ne(c, transmute(d))
+}
+
+/// Unsigned compare bitwise Test bits nonzero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtst))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmtst))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vtstq_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t {
+ let c: uint16x8_t = simd_and(a, b);
+ let d: u16x8 = u16x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ simd_ne(c, transmute(d))
+}
+
+/// Unsigned compare bitwise Test bits nonzero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtst))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmtst))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vtst_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t {
+ let c: uint32x2_t = simd_and(a, b);
+ let d: u32x2 = u32x2::new(0, 0);
+ simd_ne(c, transmute(d))
+}
+
+/// Unsigned compare bitwise Test bits nonzero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtst))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmtst))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vtstq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
+ let c: uint32x4_t = simd_and(a, b);
+ let d: u32x4 = u32x4::new(0, 0, 0, 0);
+ simd_ne(c, transmute(d))
+}
+
+/// Floating-point absolute value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vabs))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fabs))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vabs_f32(a: float32x2_t) -> float32x2_t {
+ simd_fabs(a)
+}
+
+/// Floating-point absolute value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vabs))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fabs))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vabsq_f32(a: float32x4_t) -> float32x4_t {
+ simd_fabs(a)
+}
+
+/// Compare signed greater than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcgt.s8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmgt))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcgt_s8(a: int8x8_t, b: int8x8_t) -> uint8x8_t {
+ simd_gt(a, b)
+}
+
+/// Compare signed greater than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcgt.s8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmgt))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcgtq_s8(a: int8x16_t, b: int8x16_t) -> uint8x16_t {
+ simd_gt(a, b)
+}
+
+/// Compare signed greater than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcgt.s16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmgt))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcgt_s16(a: int16x4_t, b: int16x4_t) -> uint16x4_t {
+ simd_gt(a, b)
+}
+
+/// Compare signed greater than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcgt.s16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmgt))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcgtq_s16(a: int16x8_t, b: int16x8_t) -> uint16x8_t {
+ simd_gt(a, b)
+}
+
+/// Compare signed greater than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcgt.s32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmgt))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcgt_s32(a: int32x2_t, b: int32x2_t) -> uint32x2_t {
+ simd_gt(a, b)
+}
+
+/// Compare signed greater than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcgt.s32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmgt))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcgtq_s32(a: int32x4_t, b: int32x4_t) -> uint32x4_t {
+ simd_gt(a, b)
+}
+
+/// Compare unsigned highe
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcgt.u8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmhi))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcgt_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t {
+ simd_gt(a, b)
+}
+
+/// Compare unsigned highe
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcgt.u8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmhi))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcgtq_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t {
+ simd_gt(a, b)
+}
+
+/// Compare unsigned highe
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcgt.u16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmhi))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcgt_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t {
+ simd_gt(a, b)
+}
+
+/// Compare unsigned highe
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcgt.u16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmhi))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcgtq_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t {
+ simd_gt(a, b)
+}
+
+/// Compare unsigned highe
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcgt.u32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmhi))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcgt_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t {
+ simd_gt(a, b)
+}
+
+/// Compare unsigned highe
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcgt.u32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmhi))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcgtq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
+ simd_gt(a, b)
+}
+
+/// Floating-point compare greater than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcgt.f32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fcmgt))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcgt_f32(a: float32x2_t, b: float32x2_t) -> uint32x2_t {
+ simd_gt(a, b)
+}
+
+/// Floating-point compare greater than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcgt.f32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fcmgt))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcgtq_f32(a: float32x4_t, b: float32x4_t) -> uint32x4_t {
+ simd_gt(a, b)
+}
+
+/// Compare signed less than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcgt.s8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmgt))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vclt_s8(a: int8x8_t, b: int8x8_t) -> uint8x8_t {
+ simd_lt(a, b)
+}
+
+/// Compare signed less than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcgt.s8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmgt))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcltq_s8(a: int8x16_t, b: int8x16_t) -> uint8x16_t {
+ simd_lt(a, b)
+}
+
+/// Compare signed less than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcgt.s16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmgt))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vclt_s16(a: int16x4_t, b: int16x4_t) -> uint16x4_t {
+ simd_lt(a, b)
+}
+
+/// Compare signed less than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcgt.s16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmgt))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcltq_s16(a: int16x8_t, b: int16x8_t) -> uint16x8_t {
+ simd_lt(a, b)
+}
+
+/// Compare signed less than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcgt.s32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmgt))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vclt_s32(a: int32x2_t, b: int32x2_t) -> uint32x2_t {
+ simd_lt(a, b)
+}
+
+/// Compare signed less than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcgt.s32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmgt))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcltq_s32(a: int32x4_t, b: int32x4_t) -> uint32x4_t {
+ simd_lt(a, b)
+}
+
+/// Compare unsigned less than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcgt.u8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmhi))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vclt_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t {
+ simd_lt(a, b)
+}
+
+/// Compare unsigned less than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcgt.u8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmhi))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcltq_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t {
+ simd_lt(a, b)
+}
+
+/// Compare unsigned less than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcgt.u16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmhi))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vclt_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t {
+ simd_lt(a, b)
+}
+
+/// Compare unsigned less than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcgt.u16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmhi))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcltq_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t {
+ simd_lt(a, b)
+}
+
+/// Compare unsigned less than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcgt.u32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmhi))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vclt_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t {
+ simd_lt(a, b)
+}
+
+/// Compare unsigned less than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcgt.u32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmhi))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcltq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
+ simd_lt(a, b)
+}
+
+/// Floating-point compare less than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcgt.f32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fcmgt))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vclt_f32(a: float32x2_t, b: float32x2_t) -> uint32x2_t {
+ simd_lt(a, b)
+}
+
+/// Floating-point compare less than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcgt.f32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fcmgt))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcltq_f32(a: float32x4_t, b: float32x4_t) -> uint32x4_t {
+ simd_lt(a, b)
+}
+
+/// Compare signed less than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcge.s8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmge))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcle_s8(a: int8x8_t, b: int8x8_t) -> uint8x8_t {
+ simd_le(a, b)
+}
+
+/// Compare signed less than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcge.s8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmge))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcleq_s8(a: int8x16_t, b: int8x16_t) -> uint8x16_t {
+ simd_le(a, b)
+}
+
+/// Compare signed less than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcge.s16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmge))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcle_s16(a: int16x4_t, b: int16x4_t) -> uint16x4_t {
+ simd_le(a, b)
+}
+
+/// Compare signed less than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcge.s16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmge))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcleq_s16(a: int16x8_t, b: int16x8_t) -> uint16x8_t {
+ simd_le(a, b)
+}
+
+/// Compare signed less than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcge.s32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmge))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcle_s32(a: int32x2_t, b: int32x2_t) -> uint32x2_t {
+ simd_le(a, b)
+}
+
+/// Compare signed less than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcge.s32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmge))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcleq_s32(a: int32x4_t, b: int32x4_t) -> uint32x4_t {
+ simd_le(a, b)
+}
+
+/// Compare unsigned less than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcge.u8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmhs))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcle_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t {
+ simd_le(a, b)
+}
+
+/// Compare unsigned less than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcge.u8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmhs))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcleq_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t {
+ simd_le(a, b)
+}
+
+/// Compare unsigned less than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcge.u16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmhs))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcle_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t {
+ simd_le(a, b)
+}
+
+/// Compare unsigned less than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcge.u16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmhs))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcleq_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t {
+ simd_le(a, b)
+}
+
+/// Compare unsigned less than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcge.u32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmhs))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcle_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t {
+ simd_le(a, b)
+}
+
+/// Compare unsigned less than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcge.u32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmhs))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcleq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
+ simd_le(a, b)
+}
+
+/// Floating-point compare less than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcge.f32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fcmge))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcle_f32(a: float32x2_t, b: float32x2_t) -> uint32x2_t {
+ simd_le(a, b)
+}
+
+/// Floating-point compare less than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcge.f32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fcmge))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcleq_f32(a: float32x4_t, b: float32x4_t) -> uint32x4_t {
+ simd_le(a, b)
+}
+
+/// Compare signed greater than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcge.s8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmge))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcge_s8(a: int8x8_t, b: int8x8_t) -> uint8x8_t {
+ simd_ge(a, b)
+}
+
+/// Compare signed greater than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcge.s8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmge))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcgeq_s8(a: int8x16_t, b: int8x16_t) -> uint8x16_t {
+ simd_ge(a, b)
+}
+
+/// Compare signed greater than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcge.s16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmge))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcge_s16(a: int16x4_t, b: int16x4_t) -> uint16x4_t {
+ simd_ge(a, b)
+}
+
+/// Compare signed greater than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcge.s16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmge))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcgeq_s16(a: int16x8_t, b: int16x8_t) -> uint16x8_t {
+ simd_ge(a, b)
+}
+
+/// Compare signed greater than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcge.s32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmge))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcge_s32(a: int32x2_t, b: int32x2_t) -> uint32x2_t {
+ simd_ge(a, b)
+}
+
+/// Compare signed greater than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcge.s32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmge))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcgeq_s32(a: int32x4_t, b: int32x4_t) -> uint32x4_t {
+ simd_ge(a, b)
+}
+
+/// Compare unsigned greater than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcge.u8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmhs))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcge_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t {
+ simd_ge(a, b)
+}
+
+/// Compare unsigned greater than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcge.u8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmhs))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcgeq_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t {
+ simd_ge(a, b)
+}
+
+/// Compare unsigned greater than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcge.u16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmhs))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcge_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t {
+ simd_ge(a, b)
+}
+
+/// Compare unsigned greater than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcge.u16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmhs))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcgeq_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t {
+ simd_ge(a, b)
+}
+
+/// Compare unsigned greater than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcge.u32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmhs))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcge_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t {
+ simd_ge(a, b)
+}
+
+/// Compare unsigned greater than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcge.u32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cmhs))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcgeq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
+ simd_ge(a, b)
+}
+
+/// Floating-point compare greater than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcge.f32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fcmge))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcge_f32(a: float32x2_t, b: float32x2_t) -> uint32x2_t {
+ simd_ge(a, b)
+}
+
+/// Floating-point compare greater than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcge.f32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fcmge))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcgeq_f32(a: float32x4_t, b: float32x4_t) -> uint32x4_t {
+ simd_ge(a, b)
+}
+
+/// Count leading sign bits
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcls.s8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cls))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcls_s8(a: int8x8_t) -> int8x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vcls.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.cls.v8i8")]
+ fn vcls_s8_(a: int8x8_t) -> int8x8_t;
+ }
+vcls_s8_(a)
+}
+
+/// Count leading sign bits
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcls.s8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cls))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vclsq_s8(a: int8x16_t) -> int8x16_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vcls.v16i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.cls.v16i8")]
+ fn vclsq_s8_(a: int8x16_t) -> int8x16_t;
+ }
+vclsq_s8_(a)
+}
+
+/// Count leading sign bits
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcls.s16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cls))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcls_s16(a: int16x4_t) -> int16x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vcls.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.cls.v4i16")]
+ fn vcls_s16_(a: int16x4_t) -> int16x4_t;
+ }
+vcls_s16_(a)
+}
+
+/// Count leading sign bits
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcls.s16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cls))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vclsq_s16(a: int16x8_t) -> int16x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vcls.v8i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.cls.v8i16")]
+ fn vclsq_s16_(a: int16x8_t) -> int16x8_t;
+ }
+vclsq_s16_(a)
+}
+
+/// Count leading sign bits
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcls.s32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cls))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcls_s32(a: int32x2_t) -> int32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vcls.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.cls.v2i32")]
+ fn vcls_s32_(a: int32x2_t) -> int32x2_t;
+ }
+vcls_s32_(a)
+}
+
+/// Count leading sign bits
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vcls.s32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cls))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vclsq_s32(a: int32x4_t) -> int32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vcls.v4i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.cls.v4i32")]
+ fn vclsq_s32_(a: int32x4_t) -> int32x4_t;
+ }
+vclsq_s32_(a)
+}
+
+/// Count leading sign bits
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vcls))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cls))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcls_u8(a: uint8x8_t) -> int8x8_t {
+ transmute(vcls_s8(transmute(a)))
+}
+
+/// Count leading sign bits
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vcls))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cls))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vclsq_u8(a: uint8x16_t) -> int8x16_t {
+ transmute(vclsq_s8(transmute(a)))
+}
+
+/// Count leading sign bits
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vcls))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cls))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcls_u16(a: uint16x4_t) -> int16x4_t {
+ transmute(vcls_s16(transmute(a)))
+}
+
+/// Count leading sign bits
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vcls))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cls))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vclsq_u16(a: uint16x8_t) -> int16x8_t {
+ transmute(vclsq_s16(transmute(a)))
+}
+
+/// Count leading sign bits
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vcls))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cls))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcls_u32(a: uint32x2_t) -> int32x2_t {
+ transmute(vcls_s32(transmute(a)))
+}
+
+/// Count leading sign bits
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vcls))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cls))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vclsq_u32(a: uint32x4_t) -> int32x4_t {
+ transmute(vclsq_s32(transmute(a)))
+}
+
+/// Count leading zero bits
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vclz.i8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(clz))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vclz_s8(a: int8x8_t) -> int8x8_t {
+ vclz_s8_(a)
+}
+
+/// Count leading zero bits
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vclz.i8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(clz))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vclzq_s8(a: int8x16_t) -> int8x16_t {
+ vclzq_s8_(a)
+}
+
+/// Count leading zero bits
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vclz.i16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(clz))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vclz_s16(a: int16x4_t) -> int16x4_t {
+ vclz_s16_(a)
+}
+
+/// Count leading zero bits
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vclz.i16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(clz))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vclzq_s16(a: int16x8_t) -> int16x8_t {
+ vclzq_s16_(a)
+}
+
+/// Count leading zero bits
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vclz.i32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(clz))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vclz_s32(a: int32x2_t) -> int32x2_t {
+ vclz_s32_(a)
+}
+
+/// Count leading zero bits
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vclz.i32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(clz))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vclzq_s32(a: int32x4_t) -> int32x4_t {
+ vclzq_s32_(a)
+}
+
+/// Count leading zero bits
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vclz.i8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(clz))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vclz_u8(a: uint8x8_t) -> uint8x8_t {
+ transmute(vclz_s8_(transmute(a)))
+}
+
+/// Count leading zero bits
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vclz.i8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(clz))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vclzq_u8(a: uint8x16_t) -> uint8x16_t {
+ transmute(vclzq_s8_(transmute(a)))
+}
+
+/// Count leading zero bits
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vclz.i16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(clz))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vclz_u16(a: uint16x4_t) -> uint16x4_t {
+ transmute(vclz_s16_(transmute(a)))
+}
+
+/// Count leading zero bits
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vclz.i16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(clz))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vclzq_u16(a: uint16x8_t) -> uint16x8_t {
+ transmute(vclzq_s16_(transmute(a)))
+}
+
+/// Count leading zero bits
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vclz.i32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(clz))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vclz_u32(a: uint32x2_t) -> uint32x2_t {
+ transmute(vclz_s32_(transmute(a)))
+}
+
+/// Count leading zero bits
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vclz.i32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(clz))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vclzq_u32(a: uint32x4_t) -> uint32x4_t {
+ transmute(vclzq_s32_(transmute(a)))
+}
+
+/// Floating-point absolute compare greater than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vacgt.f32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(facgt))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcagt_f32(a: float32x2_t, b: float32x2_t) -> uint32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vacgt.v2i32.v2f32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.facgt.v2i32.v2f32")]
+ fn vcagt_f32_(a: float32x2_t, b: float32x2_t) -> uint32x2_t;
+ }
+vcagt_f32_(a, b)
+}
+
+/// Floating-point absolute compare greater than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vacgt.f32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(facgt))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcagtq_f32(a: float32x4_t, b: float32x4_t) -> uint32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vacgt.v4i32.v4f32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.facgt.v4i32.v4f32")]
+ fn vcagtq_f32_(a: float32x4_t, b: float32x4_t) -> uint32x4_t;
+ }
+vcagtq_f32_(a, b)
+}
+
+/// Floating-point absolute compare greater than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vacge.f32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(facge))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcage_f32(a: float32x2_t, b: float32x2_t) -> uint32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vacge.v2i32.v2f32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.facge.v2i32.v2f32")]
+ fn vcage_f32_(a: float32x2_t, b: float32x2_t) -> uint32x2_t;
+ }
+vcage_f32_(a, b)
+}
+
+/// Floating-point absolute compare greater than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vacge.f32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(facge))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcageq_f32(a: float32x4_t, b: float32x4_t) -> uint32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vacge.v4i32.v4f32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.facge.v4i32.v4f32")]
+ fn vcageq_f32_(a: float32x4_t, b: float32x4_t) -> uint32x4_t;
+ }
+vcageq_f32_(a, b)
+}
+
+/// Floating-point absolute compare less than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vacgt.f32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(facgt))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcalt_f32(a: float32x2_t, b: float32x2_t) -> uint32x2_t {
+ vcagt_f32(b, a)
+}
+
+/// Floating-point absolute compare less than
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vacgt.f32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(facgt))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcaltq_f32(a: float32x4_t, b: float32x4_t) -> uint32x4_t {
+ vcagtq_f32(b, a)
+}
+
+/// Floating-point absolute compare less than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vacge.f32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(facge))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcale_f32(a: float32x2_t, b: float32x2_t) -> uint32x2_t {
+ vcage_f32(b, a)
+}
+
+/// Floating-point absolute compare less than or equal
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vacge.f32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(facge))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcaleq_f32(a: float32x4_t, b: float32x4_t) -> uint32x4_t {
+ vcageq_f32(b, a)
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcreate_s8(a: u64) -> int8x8_t {
+ transmute(a)
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcreate_s16(a: u64) -> int16x4_t {
+ transmute(a)
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcreate_s32(a: u64) -> int32x2_t {
+ transmute(a)
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcreate_s64(a: u64) -> int64x1_t {
+ transmute(a)
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcreate_u8(a: u64) -> uint8x8_t {
+ transmute(a)
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcreate_u16(a: u64) -> uint16x4_t {
+ transmute(a)
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcreate_u32(a: u64) -> uint32x2_t {
+ transmute(a)
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcreate_u64(a: u64) -> uint64x1_t {
+ transmute(a)
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcreate_p8(a: u64) -> poly8x8_t {
+ transmute(a)
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcreate_p16(a: u64) -> poly16x4_t {
+ transmute(a)
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcreate_p64(a: u64) -> poly64x1_t {
+ transmute(a)
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcreate_f32(a: u64) -> float32x2_t {
+ transmute(a)
+}
+
+/// Fixed-point convert to floating-point
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vcvt))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(scvtf))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcvt_f32_s32(a: int32x2_t) -> float32x2_t {
+ simd_cast(a)
+}
+
+/// Fixed-point convert to floating-point
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vcvt))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(scvtf))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcvtq_f32_s32(a: int32x4_t) -> float32x4_t {
+ simd_cast(a)
+}
+
+/// Fixed-point convert to floating-point
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vcvt))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ucvtf))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcvt_f32_u32(a: uint32x2_t) -> float32x2_t {
+ simd_cast(a)
+}
+
+/// Fixed-point convert to floating-point
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vcvt))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ucvtf))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcvtq_f32_u32(a: uint32x4_t) -> float32x4_t {
+ simd_cast(a)
+}
+
+/// Fixed-point convert to floating-point
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vcvt, N = 2))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn vcvt_n_f32_s32<const N: i32>(a: int32x2_t) -> float32x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vcvtfxs2fp.v2f32.v2i32")]
+ fn vcvt_n_f32_s32_(a: int32x2_t, n: i32) -> float32x2_t;
+ }
+vcvt_n_f32_s32_(a, N)
+}
+
+/// Fixed-point convert to floating-point
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(scvtf, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvt_n_f32_s32<const N: i32>(a: int32x2_t) -> float32x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.vcvtfxs2fp.v2f32.v2i32")]
+ fn vcvt_n_f32_s32_(a: int32x2_t, n: i32) -> float32x2_t;
+ }
+vcvt_n_f32_s32_(a, N)
+}
+
+/// Fixed-point convert to floating-point
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vcvt, N = 2))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn vcvtq_n_f32_s32<const N: i32>(a: int32x4_t) -> float32x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vcvtfxs2fp.v4f32.v4i32")]
+ fn vcvtq_n_f32_s32_(a: int32x4_t, n: i32) -> float32x4_t;
+ }
+vcvtq_n_f32_s32_(a, N)
+}
+
+/// Fixed-point convert to floating-point
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(scvtf, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtq_n_f32_s32<const N: i32>(a: int32x4_t) -> float32x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.vcvtfxs2fp.v4f32.v4i32")]
+ fn vcvtq_n_f32_s32_(a: int32x4_t, n: i32) -> float32x4_t;
+ }
+vcvtq_n_f32_s32_(a, N)
+}
+
+/// Fixed-point convert to floating-point
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vcvt, N = 2))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn vcvt_n_f32_u32<const N: i32>(a: uint32x2_t) -> float32x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vcvtfxu2fp.v2f32.v2i32")]
+ fn vcvt_n_f32_u32_(a: uint32x2_t, n: i32) -> float32x2_t;
+ }
+vcvt_n_f32_u32_(a, N)
+}
+
+/// Fixed-point convert to floating-point
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ucvtf, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvt_n_f32_u32<const N: i32>(a: uint32x2_t) -> float32x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.vcvtfxu2fp.v2f32.v2i32")]
+ fn vcvt_n_f32_u32_(a: uint32x2_t, n: i32) -> float32x2_t;
+ }
+vcvt_n_f32_u32_(a, N)
+}
+
+/// Fixed-point convert to floating-point
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vcvt, N = 2))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn vcvtq_n_f32_u32<const N: i32>(a: uint32x4_t) -> float32x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vcvtfxu2fp.v4f32.v4i32")]
+ fn vcvtq_n_f32_u32_(a: uint32x4_t, n: i32) -> float32x4_t;
+ }
+vcvtq_n_f32_u32_(a, N)
+}
+
+/// Fixed-point convert to floating-point
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ucvtf, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtq_n_f32_u32<const N: i32>(a: uint32x4_t) -> float32x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.vcvtfxu2fp.v4f32.v4i32")]
+ fn vcvtq_n_f32_u32_(a: uint32x4_t, n: i32) -> float32x4_t;
+ }
+vcvtq_n_f32_u32_(a, N)
+}
+
+/// Floating-point convert to fixed-point, rounding toward zero
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vcvt, N = 2))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn vcvt_n_s32_f32<const N: i32>(a: float32x2_t) -> int32x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vcvtfp2fxs.v2i32.v2f32")]
+ fn vcvt_n_s32_f32_(a: float32x2_t, n: i32) -> int32x2_t;
+ }
+vcvt_n_s32_f32_(a, N)
+}
+
+/// Floating-point convert to fixed-point, rounding toward zero
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtzs, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvt_n_s32_f32<const N: i32>(a: float32x2_t) -> int32x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.vcvtfp2fxs.v2i32.v2f32")]
+ fn vcvt_n_s32_f32_(a: float32x2_t, n: i32) -> int32x2_t;
+ }
+vcvt_n_s32_f32_(a, N)
+}
+
+/// Floating-point convert to fixed-point, rounding toward zero
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vcvt, N = 2))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn vcvtq_n_s32_f32<const N: i32>(a: float32x4_t) -> int32x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vcvtfp2fxs.v4i32.v4f32")]
+ fn vcvtq_n_s32_f32_(a: float32x4_t, n: i32) -> int32x4_t;
+ }
+vcvtq_n_s32_f32_(a, N)
+}
+
+/// Floating-point convert to fixed-point, rounding toward zero
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtzs, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtq_n_s32_f32<const N: i32>(a: float32x4_t) -> int32x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.vcvtfp2fxs.v4i32.v4f32")]
+ fn vcvtq_n_s32_f32_(a: float32x4_t, n: i32) -> int32x4_t;
+ }
+vcvtq_n_s32_f32_(a, N)
+}
+
+/// Floating-point convert to fixed-point, rounding toward zero
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vcvt, N = 2))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn vcvt_n_u32_f32<const N: i32>(a: float32x2_t) -> uint32x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vcvtfp2fxu.v2i32.v2f32")]
+ fn vcvt_n_u32_f32_(a: float32x2_t, n: i32) -> uint32x2_t;
+ }
+vcvt_n_u32_f32_(a, N)
+}
+
+/// Floating-point convert to fixed-point, rounding toward zero
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtzu, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvt_n_u32_f32<const N: i32>(a: float32x2_t) -> uint32x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.vcvtfp2fxu.v2i32.v2f32")]
+ fn vcvt_n_u32_f32_(a: float32x2_t, n: i32) -> uint32x2_t;
+ }
+vcvt_n_u32_f32_(a, N)
+}
+
+/// Floating-point convert to fixed-point, rounding toward zero
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vcvt, N = 2))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn vcvtq_n_u32_f32<const N: i32>(a: float32x4_t) -> uint32x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vcvtfp2fxu.v4i32.v4f32")]
+ fn vcvtq_n_u32_f32_(a: float32x4_t, n: i32) -> uint32x4_t;
+ }
+vcvtq_n_u32_f32_(a, N)
+}
+
+/// Floating-point convert to fixed-point, rounding toward zero
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(fcvtzu, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vcvtq_n_u32_f32<const N: i32>(a: float32x4_t) -> uint32x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.vcvtfp2fxu.v4i32.v4f32")]
+ fn vcvtq_n_u32_f32_(a: float32x4_t, n: i32) -> uint32x4_t;
+ }
+vcvtq_n_u32_f32_(a, N)
+}
+
+/// Floating-point convert to signed fixed-point, rounding toward zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vcvt))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fcvtzs))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcvt_s32_f32(a: float32x2_t) -> int32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.fptosi.sat.v2i32.v2f32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.fptosi.sat.v2i32.v2f32")]
+ fn vcvt_s32_f32_(a: float32x2_t) -> int32x2_t;
+ }
+vcvt_s32_f32_(a)
+}
+
+/// Floating-point convert to signed fixed-point, rounding toward zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vcvt))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fcvtzs))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcvtq_s32_f32(a: float32x4_t) -> int32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.fptosi.sat.v4i32.v4f32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.fptosi.sat.v4i32.v4f32")]
+ fn vcvtq_s32_f32_(a: float32x4_t) -> int32x4_t;
+ }
+vcvtq_s32_f32_(a)
+}
+
+/// Floating-point convert to unsigned fixed-point, rounding toward zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vcvt))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fcvtzu))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcvt_u32_f32(a: float32x2_t) -> uint32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.fptoui.sat.v2i32.v2f32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.fptoui.sat.v2i32.v2f32")]
+ fn vcvt_u32_f32_(a: float32x2_t) -> uint32x2_t;
+ }
+vcvt_u32_f32_(a)
+}
+
+/// Floating-point convert to unsigned fixed-point, rounding toward zero
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vcvt))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fcvtzu))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vcvtq_u32_f32(a: float32x4_t) -> uint32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.fptoui.sat.v4i32.v4f32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.fptoui.sat.v4i32.v4f32")]
+ fn vcvtq_u32_f32_(a: float32x4_t) -> uint32x4_t;
+ }
+vcvtq_u32_f32_(a)
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.8", N = 4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup, N = 4))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdup_lane_s8<const N: i32>(a: int8x8_t) -> int8x8_t {
+ static_assert_imm3!(N);
+ simd_shuffle8!(a, a, <const N: i32> [N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.8", N = 8))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup, N = 8))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdupq_laneq_s8<const N: i32>(a: int8x16_t) -> int8x16_t {
+ static_assert_imm4!(N);
+ simd_shuffle16!(a, a, <const N: i32> [N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.16", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdup_lane_s16<const N: i32>(a: int16x4_t) -> int16x4_t {
+ static_assert_imm2!(N);
+ simd_shuffle4!(a, a, <const N: i32> [N as u32, N as u32, N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.16", N = 4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup, N = 4))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdupq_laneq_s16<const N: i32>(a: int16x8_t) -> int16x8_t {
+ static_assert_imm3!(N);
+ simd_shuffle8!(a, a, <const N: i32> [N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.32", N = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup, N = 1))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdup_lane_s32<const N: i32>(a: int32x2_t) -> int32x2_t {
+ static_assert_imm1!(N);
+ simd_shuffle2!(a, a, <const N: i32> [N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.32", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdupq_laneq_s32<const N: i32>(a: int32x4_t) -> int32x4_t {
+ static_assert_imm2!(N);
+ simd_shuffle4!(a, a, <const N: i32> [N as u32, N as u32, N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.8", N = 8))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup, N = 8))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdup_laneq_s8<const N: i32>(a: int8x16_t) -> int8x8_t {
+ static_assert_imm4!(N);
+ simd_shuffle8!(a, a, <const N: i32> [N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.16", N = 4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup, N = 4))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdup_laneq_s16<const N: i32>(a: int16x8_t) -> int16x4_t {
+ static_assert_imm3!(N);
+ simd_shuffle4!(a, a, <const N: i32> [N as u32, N as u32, N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.32", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdup_laneq_s32<const N: i32>(a: int32x4_t) -> int32x2_t {
+ static_assert_imm2!(N);
+ simd_shuffle2!(a, a, <const N: i32> [N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.8", N = 4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup, N = 4))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdupq_lane_s8<const N: i32>(a: int8x8_t) -> int8x16_t {
+ static_assert_imm3!(N);
+ simd_shuffle16!(a, a, <const N: i32> [N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.16", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdupq_lane_s16<const N: i32>(a: int16x4_t) -> int16x8_t {
+ static_assert_imm2!(N);
+ simd_shuffle8!(a, a, <const N: i32> [N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.32", N = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup, N = 1))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdupq_lane_s32<const N: i32>(a: int32x2_t) -> int32x4_t {
+ static_assert_imm1!(N);
+ simd_shuffle4!(a, a, <const N: i32> [N as u32, N as u32, N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.8", N = 4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup, N = 4))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdup_lane_u8<const N: i32>(a: uint8x8_t) -> uint8x8_t {
+ static_assert_imm3!(N);
+ simd_shuffle8!(a, a, <const N: i32> [N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.8", N = 8))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup, N = 8))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdupq_laneq_u8<const N: i32>(a: uint8x16_t) -> uint8x16_t {
+ static_assert_imm4!(N);
+ simd_shuffle16!(a, a, <const N: i32> [N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.16", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdup_lane_u16<const N: i32>(a: uint16x4_t) -> uint16x4_t {
+ static_assert_imm2!(N);
+ simd_shuffle4!(a, a, <const N: i32> [N as u32, N as u32, N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.16", N = 4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup, N = 4))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdupq_laneq_u16<const N: i32>(a: uint16x8_t) -> uint16x8_t {
+ static_assert_imm3!(N);
+ simd_shuffle8!(a, a, <const N: i32> [N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.32", N = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup, N = 1))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdup_lane_u32<const N: i32>(a: uint32x2_t) -> uint32x2_t {
+ static_assert_imm1!(N);
+ simd_shuffle2!(a, a, <const N: i32> [N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.32", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdupq_laneq_u32<const N: i32>(a: uint32x4_t) -> uint32x4_t {
+ static_assert_imm2!(N);
+ simd_shuffle4!(a, a, <const N: i32> [N as u32, N as u32, N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.8", N = 8))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup, N = 8))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdup_laneq_u8<const N: i32>(a: uint8x16_t) -> uint8x8_t {
+ static_assert_imm4!(N);
+ simd_shuffle8!(a, a, <const N: i32> [N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.16", N = 4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup, N = 4))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdup_laneq_u16<const N: i32>(a: uint16x8_t) -> uint16x4_t {
+ static_assert_imm3!(N);
+ simd_shuffle4!(a, a, <const N: i32> [N as u32, N as u32, N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.32", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdup_laneq_u32<const N: i32>(a: uint32x4_t) -> uint32x2_t {
+ static_assert_imm2!(N);
+ simd_shuffle2!(a, a, <const N: i32> [N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.8", N = 4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup, N = 4))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdupq_lane_u8<const N: i32>(a: uint8x8_t) -> uint8x16_t {
+ static_assert_imm3!(N);
+ simd_shuffle16!(a, a, <const N: i32> [N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.16", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdupq_lane_u16<const N: i32>(a: uint16x4_t) -> uint16x8_t {
+ static_assert_imm2!(N);
+ simd_shuffle8!(a, a, <const N: i32> [N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.32", N = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup, N = 1))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdupq_lane_u32<const N: i32>(a: uint32x2_t) -> uint32x4_t {
+ static_assert_imm1!(N);
+ simd_shuffle4!(a, a, <const N: i32> [N as u32, N as u32, N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.8", N = 4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup, N = 4))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdup_lane_p8<const N: i32>(a: poly8x8_t) -> poly8x8_t {
+ static_assert_imm3!(N);
+ simd_shuffle8!(a, a, <const N: i32> [N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.8", N = 8))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup, N = 8))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdupq_laneq_p8<const N: i32>(a: poly8x16_t) -> poly8x16_t {
+ static_assert_imm4!(N);
+ simd_shuffle16!(a, a, <const N: i32> [N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.16", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdup_lane_p16<const N: i32>(a: poly16x4_t) -> poly16x4_t {
+ static_assert_imm2!(N);
+ simd_shuffle4!(a, a, <const N: i32> [N as u32, N as u32, N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.16", N = 4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup, N = 4))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdupq_laneq_p16<const N: i32>(a: poly16x8_t) -> poly16x8_t {
+ static_assert_imm3!(N);
+ simd_shuffle8!(a, a, <const N: i32> [N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.8", N = 8))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup, N = 8))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdup_laneq_p8<const N: i32>(a: poly8x16_t) -> poly8x8_t {
+ static_assert_imm4!(N);
+ simd_shuffle8!(a, a, <const N: i32> [N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.16", N = 4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup, N = 4))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdup_laneq_p16<const N: i32>(a: poly16x8_t) -> poly16x4_t {
+ static_assert_imm3!(N);
+ simd_shuffle4!(a, a, <const N: i32> [N as u32, N as u32, N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.8", N = 4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup, N = 4))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdupq_lane_p8<const N: i32>(a: poly8x8_t) -> poly8x16_t {
+ static_assert_imm3!(N);
+ simd_shuffle16!(a, a, <const N: i32> [N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.16", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdupq_lane_p16<const N: i32>(a: poly16x4_t) -> poly16x8_t {
+ static_assert_imm2!(N);
+ simd_shuffle8!(a, a, <const N: i32> [N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmov, N = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup, N = 1))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdupq_laneq_s64<const N: i32>(a: int64x2_t) -> int64x2_t {
+ static_assert_imm1!(N);
+ simd_shuffle2!(a, a, <const N: i32> [N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmov, N = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup, N = 0))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdupq_lane_s64<const N: i32>(a: int64x1_t) -> int64x2_t {
+ static_assert!(N : i32 where N == 0);
+ simd_shuffle2!(a, a, <const N: i32> [N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmov, N = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup, N = 1))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdupq_laneq_u64<const N: i32>(a: uint64x2_t) -> uint64x2_t {
+ static_assert_imm1!(N);
+ simd_shuffle2!(a, a, <const N: i32> [N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmov, N = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup, N = 0))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdupq_lane_u64<const N: i32>(a: uint64x1_t) -> uint64x2_t {
+ static_assert!(N : i32 where N == 0);
+ simd_shuffle2!(a, a, <const N: i32> [N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.32", N = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup, N = 1))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdup_lane_f32<const N: i32>(a: float32x2_t) -> float32x2_t {
+ static_assert_imm1!(N);
+ simd_shuffle2!(a, a, <const N: i32> [N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.32", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdupq_laneq_f32<const N: i32>(a: float32x4_t) -> float32x4_t {
+ static_assert_imm2!(N);
+ simd_shuffle4!(a, a, <const N: i32> [N as u32, N as u32, N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.32", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdup_laneq_f32<const N: i32>(a: float32x4_t) -> float32x2_t {
+ static_assert_imm2!(N);
+ simd_shuffle2!(a, a, <const N: i32> [N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.32", N = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup, N = 1))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdupq_lane_f32<const N: i32>(a: float32x2_t) -> float32x4_t {
+ static_assert_imm1!(N);
+ simd_shuffle4!(a, a, <const N: i32> [N as u32, N as u32, N as u32, N as u32])
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, N = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, N = 0))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdup_lane_s64<const N: i32>(a: int64x1_t) -> int64x1_t {
+ static_assert!(N : i32 where N == 0);
+ a
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, N = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, N = 0))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdup_lane_u64<const N: i32>(a: uint64x1_t) -> uint64x1_t {
+ static_assert!(N : i32 where N == 0);
+ a
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmov, N = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, N = 1))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdup_laneq_s64<const N: i32>(a: int64x2_t) -> int64x1_t {
+ static_assert_imm1!(N);
+ transmute::<i64, _>(simd_extract(a, N as u32))
+}
+
+/// Set all vector lanes to the same value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmov, N = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, N = 1))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vdup_laneq_u64<const N: i32>(a: uint64x2_t) -> uint64x1_t {
+ static_assert_imm1!(N);
+ transmute::<u64, _>(simd_extract(a, N as u32))
+}
+
+/// Extract vector from pair of vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vext.8", N = 4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ext, N = 4))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vext_s8<const N: i32>(a: int8x8_t, b: int8x8_t) -> int8x8_t {
+ static_assert_imm3!(N);
+ match N & 0b111 {
+ 0 => simd_shuffle8!(a, b, [0, 1, 2, 3, 4, 5, 6, 7]),
+ 1 => simd_shuffle8!(a, b, [1, 2, 3, 4, 5, 6, 7, 8]),
+ 2 => simd_shuffle8!(a, b, [2, 3, 4, 5, 6, 7, 8, 9]),
+ 3 => simd_shuffle8!(a, b, [3, 4, 5, 6, 7, 8, 9, 10]),
+ 4 => simd_shuffle8!(a, b, [4, 5, 6, 7, 8, 9, 10, 11]),
+ 5 => simd_shuffle8!(a, b, [5, 6, 7, 8, 9, 10, 11, 12]),
+ 6 => simd_shuffle8!(a, b, [6, 7, 8, 9, 10, 11, 12, 13]),
+ 7 => simd_shuffle8!(a, b, [7, 8, 9, 10, 11, 12, 13, 14]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Extract vector from pair of vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vext.8", N = 8))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ext, N = 8))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vextq_s8<const N: i32>(a: int8x16_t, b: int8x16_t) -> int8x16_t {
+ static_assert_imm4!(N);
+ match N & 0b1111 {
+ 0 => simd_shuffle16!(a, b, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 1 => simd_shuffle16!(a, b, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]),
+ 2 => simd_shuffle16!(a, b, [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]),
+ 3 => simd_shuffle16!(a, b, [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18]),
+ 4 => simd_shuffle16!(a, b, [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]),
+ 5 => simd_shuffle16!(a, b, [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]),
+ 6 => simd_shuffle16!(a, b, [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21]),
+ 7 => simd_shuffle16!(a, b, [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22]),
+ 8 => simd_shuffle16!(a, b, [8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23]),
+ 9 => simd_shuffle16!(a, b, [9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24]),
+ 10 => simd_shuffle16!(a, b, [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]),
+ 11 => simd_shuffle16!(a, b, [11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]),
+ 12 => simd_shuffle16!(a, b, [12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27]),
+ 13 => simd_shuffle16!(a, b, [13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28]),
+ 14 => simd_shuffle16!(a, b, [14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29]),
+ 15 => simd_shuffle16!(a, b, [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Extract vector from pair of vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vext.8", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ext, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vext_s16<const N: i32>(a: int16x4_t, b: int16x4_t) -> int16x4_t {
+ static_assert_imm2!(N);
+ match N & 0b11 {
+ 0 => simd_shuffle4!(a, b, [0, 1, 2, 3]),
+ 1 => simd_shuffle4!(a, b, [1, 2, 3, 4]),
+ 2 => simd_shuffle4!(a, b, [2, 3, 4, 5]),
+ 3 => simd_shuffle4!(a, b, [3, 4, 5, 6]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Extract vector from pair of vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vext.8", N = 4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ext, N = 4))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vextq_s16<const N: i32>(a: int16x8_t, b: int16x8_t) -> int16x8_t {
+ static_assert_imm3!(N);
+ match N & 0b111 {
+ 0 => simd_shuffle8!(a, b, [0, 1, 2, 3, 4, 5, 6, 7]),
+ 1 => simd_shuffle8!(a, b, [1, 2, 3, 4, 5, 6, 7, 8]),
+ 2 => simd_shuffle8!(a, b, [2, 3, 4, 5, 6, 7, 8, 9]),
+ 3 => simd_shuffle8!(a, b, [3, 4, 5, 6, 7, 8, 9, 10]),
+ 4 => simd_shuffle8!(a, b, [4, 5, 6, 7, 8, 9, 10, 11]),
+ 5 => simd_shuffle8!(a, b, [5, 6, 7, 8, 9, 10, 11, 12]),
+ 6 => simd_shuffle8!(a, b, [6, 7, 8, 9, 10, 11, 12, 13]),
+ 7 => simd_shuffle8!(a, b, [7, 8, 9, 10, 11, 12, 13, 14]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Extract vector from pair of vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vext.8", N = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ext, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vext_s32<const N: i32>(a: int32x2_t, b: int32x2_t) -> int32x2_t {
+ static_assert_imm1!(N);
+ match N & 0b1 {
+ 0 => simd_shuffle2!(a, b, [0, 1]),
+ 1 => simd_shuffle2!(a, b, [1, 2]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Extract vector from pair of vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vext.8", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ext, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vextq_s32<const N: i32>(a: int32x4_t, b: int32x4_t) -> int32x4_t {
+ static_assert_imm2!(N);
+ match N & 0b11 {
+ 0 => simd_shuffle4!(a, b, [0, 1, 2, 3]),
+ 1 => simd_shuffle4!(a, b, [1, 2, 3, 4]),
+ 2 => simd_shuffle4!(a, b, [2, 3, 4, 5]),
+ 3 => simd_shuffle4!(a, b, [3, 4, 5, 6]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Extract vector from pair of vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vext.8", N = 4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ext, N = 4))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vext_u8<const N: i32>(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t {
+ static_assert_imm3!(N);
+ match N & 0b111 {
+ 0 => simd_shuffle8!(a, b, [0, 1, 2, 3, 4, 5, 6, 7]),
+ 1 => simd_shuffle8!(a, b, [1, 2, 3, 4, 5, 6, 7, 8]),
+ 2 => simd_shuffle8!(a, b, [2, 3, 4, 5, 6, 7, 8, 9]),
+ 3 => simd_shuffle8!(a, b, [3, 4, 5, 6, 7, 8, 9, 10]),
+ 4 => simd_shuffle8!(a, b, [4, 5, 6, 7, 8, 9, 10, 11]),
+ 5 => simd_shuffle8!(a, b, [5, 6, 7, 8, 9, 10, 11, 12]),
+ 6 => simd_shuffle8!(a, b, [6, 7, 8, 9, 10, 11, 12, 13]),
+ 7 => simd_shuffle8!(a, b, [7, 8, 9, 10, 11, 12, 13, 14]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Extract vector from pair of vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vext.8", N = 8))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ext, N = 8))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vextq_u8<const N: i32>(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t {
+ static_assert_imm4!(N);
+ match N & 0b1111 {
+ 0 => simd_shuffle16!(a, b, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 1 => simd_shuffle16!(a, b, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]),
+ 2 => simd_shuffle16!(a, b, [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]),
+ 3 => simd_shuffle16!(a, b, [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18]),
+ 4 => simd_shuffle16!(a, b, [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]),
+ 5 => simd_shuffle16!(a, b, [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]),
+ 6 => simd_shuffle16!(a, b, [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21]),
+ 7 => simd_shuffle16!(a, b, [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22]),
+ 8 => simd_shuffle16!(a, b, [8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23]),
+ 9 => simd_shuffle16!(a, b, [9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24]),
+ 10 => simd_shuffle16!(a, b, [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]),
+ 11 => simd_shuffle16!(a, b, [11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]),
+ 12 => simd_shuffle16!(a, b, [12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27]),
+ 13 => simd_shuffle16!(a, b, [13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28]),
+ 14 => simd_shuffle16!(a, b, [14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29]),
+ 15 => simd_shuffle16!(a, b, [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Extract vector from pair of vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vext.8", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ext, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vext_u16<const N: i32>(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t {
+ static_assert_imm2!(N);
+ match N & 0b11 {
+ 0 => simd_shuffle4!(a, b, [0, 1, 2, 3]),
+ 1 => simd_shuffle4!(a, b, [1, 2, 3, 4]),
+ 2 => simd_shuffle4!(a, b, [2, 3, 4, 5]),
+ 3 => simd_shuffle4!(a, b, [3, 4, 5, 6]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Extract vector from pair of vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vext.8", N = 4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ext, N = 4))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vextq_u16<const N: i32>(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t {
+ static_assert_imm3!(N);
+ match N & 0b111 {
+ 0 => simd_shuffle8!(a, b, [0, 1, 2, 3, 4, 5, 6, 7]),
+ 1 => simd_shuffle8!(a, b, [1, 2, 3, 4, 5, 6, 7, 8]),
+ 2 => simd_shuffle8!(a, b, [2, 3, 4, 5, 6, 7, 8, 9]),
+ 3 => simd_shuffle8!(a, b, [3, 4, 5, 6, 7, 8, 9, 10]),
+ 4 => simd_shuffle8!(a, b, [4, 5, 6, 7, 8, 9, 10, 11]),
+ 5 => simd_shuffle8!(a, b, [5, 6, 7, 8, 9, 10, 11, 12]),
+ 6 => simd_shuffle8!(a, b, [6, 7, 8, 9, 10, 11, 12, 13]),
+ 7 => simd_shuffle8!(a, b, [7, 8, 9, 10, 11, 12, 13, 14]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Extract vector from pair of vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vext.8", N = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ext, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vext_u32<const N: i32>(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t {
+ static_assert_imm1!(N);
+ match N & 0b1 {
+ 0 => simd_shuffle2!(a, b, [0, 1]),
+ 1 => simd_shuffle2!(a, b, [1, 2]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Extract vector from pair of vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vext.8", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ext, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vextq_u32<const N: i32>(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
+ static_assert_imm2!(N);
+ match N & 0b11 {
+ 0 => simd_shuffle4!(a, b, [0, 1, 2, 3]),
+ 1 => simd_shuffle4!(a, b, [1, 2, 3, 4]),
+ 2 => simd_shuffle4!(a, b, [2, 3, 4, 5]),
+ 3 => simd_shuffle4!(a, b, [3, 4, 5, 6]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Extract vector from pair of vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vext.8", N = 4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ext, N = 4))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vext_p8<const N: i32>(a: poly8x8_t, b: poly8x8_t) -> poly8x8_t {
+ static_assert_imm3!(N);
+ match N & 0b111 {
+ 0 => simd_shuffle8!(a, b, [0, 1, 2, 3, 4, 5, 6, 7]),
+ 1 => simd_shuffle8!(a, b, [1, 2, 3, 4, 5, 6, 7, 8]),
+ 2 => simd_shuffle8!(a, b, [2, 3, 4, 5, 6, 7, 8, 9]),
+ 3 => simd_shuffle8!(a, b, [3, 4, 5, 6, 7, 8, 9, 10]),
+ 4 => simd_shuffle8!(a, b, [4, 5, 6, 7, 8, 9, 10, 11]),
+ 5 => simd_shuffle8!(a, b, [5, 6, 7, 8, 9, 10, 11, 12]),
+ 6 => simd_shuffle8!(a, b, [6, 7, 8, 9, 10, 11, 12, 13]),
+ 7 => simd_shuffle8!(a, b, [7, 8, 9, 10, 11, 12, 13, 14]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Extract vector from pair of vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vext.8", N = 8))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ext, N = 8))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vextq_p8<const N: i32>(a: poly8x16_t, b: poly8x16_t) -> poly8x16_t {
+ static_assert_imm4!(N);
+ match N & 0b1111 {
+ 0 => simd_shuffle16!(a, b, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
+ 1 => simd_shuffle16!(a, b, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]),
+ 2 => simd_shuffle16!(a, b, [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]),
+ 3 => simd_shuffle16!(a, b, [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18]),
+ 4 => simd_shuffle16!(a, b, [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]),
+ 5 => simd_shuffle16!(a, b, [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]),
+ 6 => simd_shuffle16!(a, b, [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21]),
+ 7 => simd_shuffle16!(a, b, [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22]),
+ 8 => simd_shuffle16!(a, b, [8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23]),
+ 9 => simd_shuffle16!(a, b, [9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24]),
+ 10 => simd_shuffle16!(a, b, [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]),
+ 11 => simd_shuffle16!(a, b, [11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]),
+ 12 => simd_shuffle16!(a, b, [12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27]),
+ 13 => simd_shuffle16!(a, b, [13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28]),
+ 14 => simd_shuffle16!(a, b, [14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29]),
+ 15 => simd_shuffle16!(a, b, [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Extract vector from pair of vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vext.8", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ext, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vext_p16<const N: i32>(a: poly16x4_t, b: poly16x4_t) -> poly16x4_t {
+ static_assert_imm2!(N);
+ match N & 0b11 {
+ 0 => simd_shuffle4!(a, b, [0, 1, 2, 3]),
+ 1 => simd_shuffle4!(a, b, [1, 2, 3, 4]),
+ 2 => simd_shuffle4!(a, b, [2, 3, 4, 5]),
+ 3 => simd_shuffle4!(a, b, [3, 4, 5, 6]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Extract vector from pair of vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vext.8", N = 4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ext, N = 4))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vextq_p16<const N: i32>(a: poly16x8_t, b: poly16x8_t) -> poly16x8_t {
+ static_assert_imm3!(N);
+ match N & 0b111 {
+ 0 => simd_shuffle8!(a, b, [0, 1, 2, 3, 4, 5, 6, 7]),
+ 1 => simd_shuffle8!(a, b, [1, 2, 3, 4, 5, 6, 7, 8]),
+ 2 => simd_shuffle8!(a, b, [2, 3, 4, 5, 6, 7, 8, 9]),
+ 3 => simd_shuffle8!(a, b, [3, 4, 5, 6, 7, 8, 9, 10]),
+ 4 => simd_shuffle8!(a, b, [4, 5, 6, 7, 8, 9, 10, 11]),
+ 5 => simd_shuffle8!(a, b, [5, 6, 7, 8, 9, 10, 11, 12]),
+ 6 => simd_shuffle8!(a, b, [6, 7, 8, 9, 10, 11, 12, 13]),
+ 7 => simd_shuffle8!(a, b, [7, 8, 9, 10, 11, 12, 13, 14]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Extract vector from pair of vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmov, N = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ext, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vextq_s64<const N: i32>(a: int64x2_t, b: int64x2_t) -> int64x2_t {
+ static_assert_imm1!(N);
+ match N & 0b1 {
+ 0 => simd_shuffle2!(a, b, [0, 1]),
+ 1 => simd_shuffle2!(a, b, [1, 2]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Extract vector from pair of vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmov, N = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ext, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vextq_u64<const N: i32>(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t {
+ static_assert_imm1!(N);
+ match N & 0b1 {
+ 0 => simd_shuffle2!(a, b, [0, 1]),
+ 1 => simd_shuffle2!(a, b, [1, 2]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Extract vector from pair of vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vext.8", N = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ext, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vext_f32<const N: i32>(a: float32x2_t, b: float32x2_t) -> float32x2_t {
+ static_assert_imm1!(N);
+ match N & 0b1 {
+ 0 => simd_shuffle2!(a, b, [0, 1]),
+ 1 => simd_shuffle2!(a, b, [1, 2]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Extract vector from pair of vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vext.8", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ext, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vextq_f32<const N: i32>(a: float32x4_t, b: float32x4_t) -> float32x4_t {
+ static_assert_imm2!(N);
+ match N & 0b11 {
+ 0 => simd_shuffle4!(a, b, [0, 1, 2, 3]),
+ 1 => simd_shuffle4!(a, b, [1, 2, 3, 4]),
+ 2 => simd_shuffle4!(a, b, [2, 3, 4, 5]),
+ 3 => simd_shuffle4!(a, b, [3, 4, 5, 6]),
+ _ => unreachable_unchecked(),
+ }
+}
+
+/// Multiply-add to accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.i8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mla))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmla_s8(a: int8x8_t, b: int8x8_t, c: int8x8_t) -> int8x8_t {
+ simd_add(a, simd_mul(b, c))
+}
+
+/// Multiply-add to accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.i8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mla))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlaq_s8(a: int8x16_t, b: int8x16_t, c: int8x16_t) -> int8x16_t {
+ simd_add(a, simd_mul(b, c))
+}
+
+/// Multiply-add to accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.i16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mla))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmla_s16(a: int16x4_t, b: int16x4_t, c: int16x4_t) -> int16x4_t {
+ simd_add(a, simd_mul(b, c))
+}
+
+/// Multiply-add to accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.i16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mla))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlaq_s16(a: int16x8_t, b: int16x8_t, c: int16x8_t) -> int16x8_t {
+ simd_add(a, simd_mul(b, c))
+}
+
+/// Multiply-add to accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.i32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mla))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmla_s32(a: int32x2_t, b: int32x2_t, c: int32x2_t) -> int32x2_t {
+ simd_add(a, simd_mul(b, c))
+}
+
+/// Multiply-add to accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.i32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mla))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlaq_s32(a: int32x4_t, b: int32x4_t, c: int32x4_t) -> int32x4_t {
+ simd_add(a, simd_mul(b, c))
+}
+
+/// Multiply-add to accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.i8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mla))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmla_u8(a: uint8x8_t, b: uint8x8_t, c: uint8x8_t) -> uint8x8_t {
+ simd_add(a, simd_mul(b, c))
+}
+
+/// Multiply-add to accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.i8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mla))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlaq_u8(a: uint8x16_t, b: uint8x16_t, c: uint8x16_t) -> uint8x16_t {
+ simd_add(a, simd_mul(b, c))
+}
+
+/// Multiply-add to accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.i16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mla))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmla_u16(a: uint16x4_t, b: uint16x4_t, c: uint16x4_t) -> uint16x4_t {
+ simd_add(a, simd_mul(b, c))
+}
+
+/// Multiply-add to accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.i16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mla))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlaq_u16(a: uint16x8_t, b: uint16x8_t, c: uint16x8_t) -> uint16x8_t {
+ simd_add(a, simd_mul(b, c))
+}
+
+/// Multiply-add to accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.i32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mla))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmla_u32(a: uint32x2_t, b: uint32x2_t, c: uint32x2_t) -> uint32x2_t {
+ simd_add(a, simd_mul(b, c))
+}
+
+/// Multiply-add to accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.i32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mla))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlaq_u32(a: uint32x4_t, b: uint32x4_t, c: uint32x4_t) -> uint32x4_t {
+ simd_add(a, simd_mul(b, c))
+}
+
+/// Floating-point multiply-add to accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.f32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmul))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmla_f32(a: float32x2_t, b: float32x2_t, c: float32x2_t) -> float32x2_t {
+ simd_add(a, simd_mul(b, c))
+}
+
+/// Floating-point multiply-add to accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.f32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmul))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlaq_f32(a: float32x4_t, b: float32x4_t, c: float32x4_t) -> float32x4_t {
+ simd_add(a, simd_mul(b, c))
+}
+
+/// Vector multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.i16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mla))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmla_n_s16(a: int16x4_t, b: int16x4_t, c: i16) -> int16x4_t {
+ vmla_s16(a, b, vdup_n_s16(c))
+}
+
+/// Vector multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.i16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mla))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlaq_n_s16(a: int16x8_t, b: int16x8_t, c: i16) -> int16x8_t {
+ vmlaq_s16(a, b, vdupq_n_s16(c))
+}
+
+/// Vector multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.i32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mla))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmla_n_s32(a: int32x2_t, b: int32x2_t, c: i32) -> int32x2_t {
+ vmla_s32(a, b, vdup_n_s32(c))
+}
+
+/// Vector multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.i32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mla))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlaq_n_s32(a: int32x4_t, b: int32x4_t, c: i32) -> int32x4_t {
+ vmlaq_s32(a, b, vdupq_n_s32(c))
+}
+
+/// Vector multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.i16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mla))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmla_n_u16(a: uint16x4_t, b: uint16x4_t, c: u16) -> uint16x4_t {
+ vmla_u16(a, b, vdup_n_u16(c))
+}
+
+/// Vector multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.i16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mla))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlaq_n_u16(a: uint16x8_t, b: uint16x8_t, c: u16) -> uint16x8_t {
+ vmlaq_u16(a, b, vdupq_n_u16(c))
+}
+
+/// Vector multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.i32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mla))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmla_n_u32(a: uint32x2_t, b: uint32x2_t, c: u32) -> uint32x2_t {
+ vmla_u32(a, b, vdup_n_u32(c))
+}
+
+/// Vector multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.i32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mla))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlaq_n_u32(a: uint32x4_t, b: uint32x4_t, c: u32) -> uint32x4_t {
+ vmlaq_u32(a, b, vdupq_n_u32(c))
+}
+
+/// Vector multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.f32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmul))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmla_n_f32(a: float32x2_t, b: float32x2_t, c: f32) -> float32x2_t {
+ vmla_f32(a, b, vdup_n_f32(c))
+}
+
+/// Vector multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.f32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmul))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlaq_n_f32(a: float32x4_t, b: float32x4_t, c: f32) -> float32x4_t {
+ vmlaq_f32(a, b, vdupq_n_f32(c))
+}
+
+/// Vector multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.i16", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mla, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmla_lane_s16<const LANE: i32>(a: int16x4_t, b: int16x4_t, c: int16x4_t) -> int16x4_t {
+ static_assert_imm2!(LANE);
+ vmla_s16(a, b, simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Vector multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.i16", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mla, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmla_laneq_s16<const LANE: i32>(a: int16x4_t, b: int16x4_t, c: int16x8_t) -> int16x4_t {
+ static_assert_imm3!(LANE);
+ vmla_s16(a, b, simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Vector multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.i16", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mla, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlaq_lane_s16<const LANE: i32>(a: int16x8_t, b: int16x8_t, c: int16x4_t) -> int16x8_t {
+ static_assert_imm2!(LANE);
+ vmlaq_s16(a, b, simd_shuffle8!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Vector multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.i16", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mla, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlaq_laneq_s16<const LANE: i32>(a: int16x8_t, b: int16x8_t, c: int16x8_t) -> int16x8_t {
+ static_assert_imm3!(LANE);
+ vmlaq_s16(a, b, simd_shuffle8!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Vector multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.i32", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mla, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmla_lane_s32<const LANE: i32>(a: int32x2_t, b: int32x2_t, c: int32x2_t) -> int32x2_t {
+ static_assert_imm1!(LANE);
+ vmla_s32(a, b, simd_shuffle2!(c, c, <const LANE: i32> [LANE as u32, LANE as u32]))
+}
+
+/// Vector multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.i32", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mla, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmla_laneq_s32<const LANE: i32>(a: int32x2_t, b: int32x2_t, c: int32x4_t) -> int32x2_t {
+ static_assert_imm2!(LANE);
+ vmla_s32(a, b, simd_shuffle2!(c, c, <const LANE: i32> [LANE as u32, LANE as u32]))
+}
+
+/// Vector multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.i32", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mla, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlaq_lane_s32<const LANE: i32>(a: int32x4_t, b: int32x4_t, c: int32x2_t) -> int32x4_t {
+ static_assert_imm1!(LANE);
+ vmlaq_s32(a, b, simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Vector multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.i32", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mla, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlaq_laneq_s32<const LANE: i32>(a: int32x4_t, b: int32x4_t, c: int32x4_t) -> int32x4_t {
+ static_assert_imm2!(LANE);
+ vmlaq_s32(a, b, simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Vector multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.i16", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mla, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmla_lane_u16<const LANE: i32>(a: uint16x4_t, b: uint16x4_t, c: uint16x4_t) -> uint16x4_t {
+ static_assert_imm2!(LANE);
+ vmla_u16(a, b, simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Vector multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.i16", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mla, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmla_laneq_u16<const LANE: i32>(a: uint16x4_t, b: uint16x4_t, c: uint16x8_t) -> uint16x4_t {
+ static_assert_imm3!(LANE);
+ vmla_u16(a, b, simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Vector multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.i16", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mla, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlaq_lane_u16<const LANE: i32>(a: uint16x8_t, b: uint16x8_t, c: uint16x4_t) -> uint16x8_t {
+ static_assert_imm2!(LANE);
+ vmlaq_u16(a, b, simd_shuffle8!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Vector multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.i16", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mla, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlaq_laneq_u16<const LANE: i32>(a: uint16x8_t, b: uint16x8_t, c: uint16x8_t) -> uint16x8_t {
+ static_assert_imm3!(LANE);
+ vmlaq_u16(a, b, simd_shuffle8!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Vector multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.i32", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mla, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmla_lane_u32<const LANE: i32>(a: uint32x2_t, b: uint32x2_t, c: uint32x2_t) -> uint32x2_t {
+ static_assert_imm1!(LANE);
+ vmla_u32(a, b, simd_shuffle2!(c, c, <const LANE: i32> [LANE as u32, LANE as u32]))
+}
+
+/// Vector multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.i32", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mla, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmla_laneq_u32<const LANE: i32>(a: uint32x2_t, b: uint32x2_t, c: uint32x4_t) -> uint32x2_t {
+ static_assert_imm2!(LANE);
+ vmla_u32(a, b, simd_shuffle2!(c, c, <const LANE: i32> [LANE as u32, LANE as u32]))
+}
+
+/// Vector multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.i32", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mla, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlaq_lane_u32<const LANE: i32>(a: uint32x4_t, b: uint32x4_t, c: uint32x2_t) -> uint32x4_t {
+ static_assert_imm1!(LANE);
+ vmlaq_u32(a, b, simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Vector multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.i32", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mla, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlaq_laneq_u32<const LANE: i32>(a: uint32x4_t, b: uint32x4_t, c: uint32x4_t) -> uint32x4_t {
+ static_assert_imm2!(LANE);
+ vmlaq_u32(a, b, simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Vector multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.f32", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmul, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmla_lane_f32<const LANE: i32>(a: float32x2_t, b: float32x2_t, c: float32x2_t) -> float32x2_t {
+ static_assert_imm1!(LANE);
+ vmla_f32(a, b, simd_shuffle2!(c, c, <const LANE: i32> [LANE as u32, LANE as u32]))
+}
+
+/// Vector multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.f32", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmul, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmla_laneq_f32<const LANE: i32>(a: float32x2_t, b: float32x2_t, c: float32x4_t) -> float32x2_t {
+ static_assert_imm2!(LANE);
+ vmla_f32(a, b, simd_shuffle2!(c, c, <const LANE: i32> [LANE as u32, LANE as u32]))
+}
+
+/// Vector multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.f32", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmul, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlaq_lane_f32<const LANE: i32>(a: float32x4_t, b: float32x4_t, c: float32x2_t) -> float32x4_t {
+ static_assert_imm1!(LANE);
+ vmlaq_f32(a, b, simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Vector multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmla.f32", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmul, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlaq_laneq_f32<const LANE: i32>(a: float32x4_t, b: float32x4_t, c: float32x4_t) -> float32x4_t {
+ static_assert_imm2!(LANE);
+ vmlaq_f32(a, b, simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Signed multiply-add long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmlal.s8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smlal))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlal_s8(a: int16x8_t, b: int8x8_t, c: int8x8_t) -> int16x8_t {
+ simd_add(a, vmull_s8(b, c))
+}
+
+/// Signed multiply-add long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmlal.s16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smlal))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlal_s16(a: int32x4_t, b: int16x4_t, c: int16x4_t) -> int32x4_t {
+ simd_add(a, vmull_s16(b, c))
+}
+
+/// Signed multiply-add long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmlal.s32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smlal))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlal_s32(a: int64x2_t, b: int32x2_t, c: int32x2_t) -> int64x2_t {
+ simd_add(a, vmull_s32(b, c))
+}
+
+/// Unsigned multiply-add long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmlal.u8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(umlal))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlal_u8(a: uint16x8_t, b: uint8x8_t, c: uint8x8_t) -> uint16x8_t {
+ simd_add(a, vmull_u8(b, c))
+}
+
+/// Unsigned multiply-add long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmlal.u16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(umlal))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlal_u16(a: uint32x4_t, b: uint16x4_t, c: uint16x4_t) -> uint32x4_t {
+ simd_add(a, vmull_u16(b, c))
+}
+
+/// Unsigned multiply-add long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmlal.u32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(umlal))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlal_u32(a: uint64x2_t, b: uint32x2_t, c: uint32x2_t) -> uint64x2_t {
+ simd_add(a, vmull_u32(b, c))
+}
+
+/// Vector widening multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmlal.s16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smlal))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlal_n_s16(a: int32x4_t, b: int16x4_t, c: i16) -> int32x4_t {
+ vmlal_s16(a, b, vdup_n_s16(c))
+}
+
+/// Vector widening multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmlal.s32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smlal))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlal_n_s32(a: int64x2_t, b: int32x2_t, c: i32) -> int64x2_t {
+ vmlal_s32(a, b, vdup_n_s32(c))
+}
+
+/// Vector widening multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmlal.u16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(umlal))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlal_n_u16(a: uint32x4_t, b: uint16x4_t, c: u16) -> uint32x4_t {
+ vmlal_u16(a, b, vdup_n_u16(c))
+}
+
+/// Vector widening multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmlal.u32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(umlal))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlal_n_u32(a: uint64x2_t, b: uint32x2_t, c: u32) -> uint64x2_t {
+ vmlal_u32(a, b, vdup_n_u32(c))
+}
+
+/// Vector widening multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmlal.s16", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smlal, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlal_lane_s16<const LANE: i32>(a: int32x4_t, b: int16x4_t, c: int16x4_t) -> int32x4_t {
+ static_assert_imm2!(LANE);
+ vmlal_s16(a, b, simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Vector widening multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmlal.s16", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smlal, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlal_laneq_s16<const LANE: i32>(a: int32x4_t, b: int16x4_t, c: int16x8_t) -> int32x4_t {
+ static_assert_imm3!(LANE);
+ vmlal_s16(a, b, simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Vector widening multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmlal.s32", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smlal, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlal_lane_s32<const LANE: i32>(a: int64x2_t, b: int32x2_t, c: int32x2_t) -> int64x2_t {
+ static_assert_imm1!(LANE);
+ vmlal_s32(a, b, simd_shuffle2!(c, c, <const LANE: i32> [LANE as u32, LANE as u32]))
+}
+
+/// Vector widening multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmlal.s32", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smlal, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlal_laneq_s32<const LANE: i32>(a: int64x2_t, b: int32x2_t, c: int32x4_t) -> int64x2_t {
+ static_assert_imm2!(LANE);
+ vmlal_s32(a, b, simd_shuffle2!(c, c, <const LANE: i32> [LANE as u32, LANE as u32]))
+}
+
+/// Vector widening multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmlal.u16", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(umlal, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlal_lane_u16<const LANE: i32>(a: uint32x4_t, b: uint16x4_t, c: uint16x4_t) -> uint32x4_t {
+ static_assert_imm2!(LANE);
+ vmlal_u16(a, b, simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Vector widening multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmlal.u16", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(umlal, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlal_laneq_u16<const LANE: i32>(a: uint32x4_t, b: uint16x4_t, c: uint16x8_t) -> uint32x4_t {
+ static_assert_imm3!(LANE);
+ vmlal_u16(a, b, simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Vector widening multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmlal.u32", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(umlal, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlal_lane_u32<const LANE: i32>(a: uint64x2_t, b: uint32x2_t, c: uint32x2_t) -> uint64x2_t {
+ static_assert_imm1!(LANE);
+ vmlal_u32(a, b, simd_shuffle2!(c, c, <const LANE: i32> [LANE as u32, LANE as u32]))
+}
+
+/// Vector widening multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmlal.u32", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(umlal, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlal_laneq_u32<const LANE: i32>(a: uint64x2_t, b: uint32x2_t, c: uint32x4_t) -> uint64x2_t {
+ static_assert_imm2!(LANE);
+ vmlal_u32(a, b, simd_shuffle2!(c, c, <const LANE: i32> [LANE as u32, LANE as u32]))
+}
+
+/// Multiply-subtract from accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.i8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mls))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmls_s8(a: int8x8_t, b: int8x8_t, c: int8x8_t) -> int8x8_t {
+ simd_sub(a, simd_mul(b, c))
+}
+
+/// Multiply-subtract from accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.i8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mls))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlsq_s8(a: int8x16_t, b: int8x16_t, c: int8x16_t) -> int8x16_t {
+ simd_sub(a, simd_mul(b, c))
+}
+
+/// Multiply-subtract from accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.i16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mls))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmls_s16(a: int16x4_t, b: int16x4_t, c: int16x4_t) -> int16x4_t {
+ simd_sub(a, simd_mul(b, c))
+}
+
+/// Multiply-subtract from accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.i16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mls))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlsq_s16(a: int16x8_t, b: int16x8_t, c: int16x8_t) -> int16x8_t {
+ simd_sub(a, simd_mul(b, c))
+}
+
+/// Multiply-subtract from accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.i32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mls))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmls_s32(a: int32x2_t, b: int32x2_t, c: int32x2_t) -> int32x2_t {
+ simd_sub(a, simd_mul(b, c))
+}
+
+/// Multiply-subtract from accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.i32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mls))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlsq_s32(a: int32x4_t, b: int32x4_t, c: int32x4_t) -> int32x4_t {
+ simd_sub(a, simd_mul(b, c))
+}
+
+/// Multiply-subtract from accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.i8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mls))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmls_u8(a: uint8x8_t, b: uint8x8_t, c: uint8x8_t) -> uint8x8_t {
+ simd_sub(a, simd_mul(b, c))
+}
+
+/// Multiply-subtract from accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.i8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mls))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlsq_u8(a: uint8x16_t, b: uint8x16_t, c: uint8x16_t) -> uint8x16_t {
+ simd_sub(a, simd_mul(b, c))
+}
+
+/// Multiply-subtract from accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.i16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mls))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmls_u16(a: uint16x4_t, b: uint16x4_t, c: uint16x4_t) -> uint16x4_t {
+ simd_sub(a, simd_mul(b, c))
+}
+
+/// Multiply-subtract from accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.i16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mls))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlsq_u16(a: uint16x8_t, b: uint16x8_t, c: uint16x8_t) -> uint16x8_t {
+ simd_sub(a, simd_mul(b, c))
+}
+
+/// Multiply-subtract from accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.i32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mls))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmls_u32(a: uint32x2_t, b: uint32x2_t, c: uint32x2_t) -> uint32x2_t {
+ simd_sub(a, simd_mul(b, c))
+}
+
+/// Multiply-subtract from accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.i32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mls))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlsq_u32(a: uint32x4_t, b: uint32x4_t, c: uint32x4_t) -> uint32x4_t {
+ simd_sub(a, simd_mul(b, c))
+}
+
+/// Floating-point multiply-subtract from accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.f32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmul))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmls_f32(a: float32x2_t, b: float32x2_t, c: float32x2_t) -> float32x2_t {
+ simd_sub(a, simd_mul(b, c))
+}
+
+/// Floating-point multiply-subtract from accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.f32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmul))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlsq_f32(a: float32x4_t, b: float32x4_t, c: float32x4_t) -> float32x4_t {
+ simd_sub(a, simd_mul(b, c))
+}
+
+/// Vector multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.i16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mls))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmls_n_s16(a: int16x4_t, b: int16x4_t, c: i16) -> int16x4_t {
+ vmls_s16(a, b, vdup_n_s16(c))
+}
+
+/// Vector multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.i16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mls))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlsq_n_s16(a: int16x8_t, b: int16x8_t, c: i16) -> int16x8_t {
+ vmlsq_s16(a, b, vdupq_n_s16(c))
+}
+
+/// Vector multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.i32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mls))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmls_n_s32(a: int32x2_t, b: int32x2_t, c: i32) -> int32x2_t {
+ vmls_s32(a, b, vdup_n_s32(c))
+}
+
+/// Vector multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.i32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mls))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlsq_n_s32(a: int32x4_t, b: int32x4_t, c: i32) -> int32x4_t {
+ vmlsq_s32(a, b, vdupq_n_s32(c))
+}
+
+/// Vector multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.i16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mls))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmls_n_u16(a: uint16x4_t, b: uint16x4_t, c: u16) -> uint16x4_t {
+ vmls_u16(a, b, vdup_n_u16(c))
+}
+
+/// Vector multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.i16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mls))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlsq_n_u16(a: uint16x8_t, b: uint16x8_t, c: u16) -> uint16x8_t {
+ vmlsq_u16(a, b, vdupq_n_u16(c))
+}
+
+/// Vector multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.i32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mls))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmls_n_u32(a: uint32x2_t, b: uint32x2_t, c: u32) -> uint32x2_t {
+ vmls_u32(a, b, vdup_n_u32(c))
+}
+
+/// Vector multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.i32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mls))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlsq_n_u32(a: uint32x4_t, b: uint32x4_t, c: u32) -> uint32x4_t {
+ vmlsq_u32(a, b, vdupq_n_u32(c))
+}
+
+/// Vector multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.f32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmul))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmls_n_f32(a: float32x2_t, b: float32x2_t, c: f32) -> float32x2_t {
+ vmls_f32(a, b, vdup_n_f32(c))
+}
+
+/// Vector multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.f32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmul))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlsq_n_f32(a: float32x4_t, b: float32x4_t, c: f32) -> float32x4_t {
+ vmlsq_f32(a, b, vdupq_n_f32(c))
+}
+
+/// Vector multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.i16", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mls, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmls_lane_s16<const LANE: i32>(a: int16x4_t, b: int16x4_t, c: int16x4_t) -> int16x4_t {
+ static_assert_imm2!(LANE);
+ vmls_s16(a, b, simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Vector multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.i16", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mls, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmls_laneq_s16<const LANE: i32>(a: int16x4_t, b: int16x4_t, c: int16x8_t) -> int16x4_t {
+ static_assert_imm3!(LANE);
+ vmls_s16(a, b, simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Vector multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.i16", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mls, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlsq_lane_s16<const LANE: i32>(a: int16x8_t, b: int16x8_t, c: int16x4_t) -> int16x8_t {
+ static_assert_imm2!(LANE);
+ vmlsq_s16(a, b, simd_shuffle8!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Vector multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.i16", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mls, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlsq_laneq_s16<const LANE: i32>(a: int16x8_t, b: int16x8_t, c: int16x8_t) -> int16x8_t {
+ static_assert_imm3!(LANE);
+ vmlsq_s16(a, b, simd_shuffle8!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Vector multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.i32", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mls, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmls_lane_s32<const LANE: i32>(a: int32x2_t, b: int32x2_t, c: int32x2_t) -> int32x2_t {
+ static_assert_imm1!(LANE);
+ vmls_s32(a, b, simd_shuffle2!(c, c, <const LANE: i32> [LANE as u32, LANE as u32]))
+}
+
+/// Vector multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.i32", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mls, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmls_laneq_s32<const LANE: i32>(a: int32x2_t, b: int32x2_t, c: int32x4_t) -> int32x2_t {
+ static_assert_imm2!(LANE);
+ vmls_s32(a, b, simd_shuffle2!(c, c, <const LANE: i32> [LANE as u32, LANE as u32]))
+}
+
+/// Vector multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.i32", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mls, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlsq_lane_s32<const LANE: i32>(a: int32x4_t, b: int32x4_t, c: int32x2_t) -> int32x4_t {
+ static_assert_imm1!(LANE);
+ vmlsq_s32(a, b, simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Vector multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.i32", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mls, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlsq_laneq_s32<const LANE: i32>(a: int32x4_t, b: int32x4_t, c: int32x4_t) -> int32x4_t {
+ static_assert_imm2!(LANE);
+ vmlsq_s32(a, b, simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Vector multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.i16", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mls, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmls_lane_u16<const LANE: i32>(a: uint16x4_t, b: uint16x4_t, c: uint16x4_t) -> uint16x4_t {
+ static_assert_imm2!(LANE);
+ vmls_u16(a, b, simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Vector multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.i16", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mls, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmls_laneq_u16<const LANE: i32>(a: uint16x4_t, b: uint16x4_t, c: uint16x8_t) -> uint16x4_t {
+ static_assert_imm3!(LANE);
+ vmls_u16(a, b, simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Vector multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.i16", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mls, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlsq_lane_u16<const LANE: i32>(a: uint16x8_t, b: uint16x8_t, c: uint16x4_t) -> uint16x8_t {
+ static_assert_imm2!(LANE);
+ vmlsq_u16(a, b, simd_shuffle8!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Vector multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.i16", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mls, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlsq_laneq_u16<const LANE: i32>(a: uint16x8_t, b: uint16x8_t, c: uint16x8_t) -> uint16x8_t {
+ static_assert_imm3!(LANE);
+ vmlsq_u16(a, b, simd_shuffle8!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Vector multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.i32", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mls, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmls_lane_u32<const LANE: i32>(a: uint32x2_t, b: uint32x2_t, c: uint32x2_t) -> uint32x2_t {
+ static_assert_imm1!(LANE);
+ vmls_u32(a, b, simd_shuffle2!(c, c, <const LANE: i32> [LANE as u32, LANE as u32]))
+}
+
+/// Vector multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.i32", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mls, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmls_laneq_u32<const LANE: i32>(a: uint32x2_t, b: uint32x2_t, c: uint32x4_t) -> uint32x2_t {
+ static_assert_imm2!(LANE);
+ vmls_u32(a, b, simd_shuffle2!(c, c, <const LANE: i32> [LANE as u32, LANE as u32]))
+}
+
+/// Vector multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.i32", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mls, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlsq_lane_u32<const LANE: i32>(a: uint32x4_t, b: uint32x4_t, c: uint32x2_t) -> uint32x4_t {
+ static_assert_imm1!(LANE);
+ vmlsq_u32(a, b, simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Vector multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.i32", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mls, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlsq_laneq_u32<const LANE: i32>(a: uint32x4_t, b: uint32x4_t, c: uint32x4_t) -> uint32x4_t {
+ static_assert_imm2!(LANE);
+ vmlsq_u32(a, b, simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Vector multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.f32", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmul, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmls_lane_f32<const LANE: i32>(a: float32x2_t, b: float32x2_t, c: float32x2_t) -> float32x2_t {
+ static_assert_imm1!(LANE);
+ vmls_f32(a, b, simd_shuffle2!(c, c, <const LANE: i32> [LANE as u32, LANE as u32]))
+}
+
+/// Vector multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.f32", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmul, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmls_laneq_f32<const LANE: i32>(a: float32x2_t, b: float32x2_t, c: float32x4_t) -> float32x2_t {
+ static_assert_imm2!(LANE);
+ vmls_f32(a, b, simd_shuffle2!(c, c, <const LANE: i32> [LANE as u32, LANE as u32]))
+}
+
+/// Vector multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.f32", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmul, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlsq_lane_f32<const LANE: i32>(a: float32x4_t, b: float32x4_t, c: float32x2_t) -> float32x4_t {
+ static_assert_imm1!(LANE);
+ vmlsq_f32(a, b, simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Vector multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmls.f32", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmul, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlsq_laneq_f32<const LANE: i32>(a: float32x4_t, b: float32x4_t, c: float32x4_t) -> float32x4_t {
+ static_assert_imm2!(LANE);
+ vmlsq_f32(a, b, simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Signed multiply-subtract long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmlsl.s8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smlsl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlsl_s8(a: int16x8_t, b: int8x8_t, c: int8x8_t) -> int16x8_t {
+ simd_sub(a, vmull_s8(b, c))
+}
+
+/// Signed multiply-subtract long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmlsl.s16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smlsl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlsl_s16(a: int32x4_t, b: int16x4_t, c: int16x4_t) -> int32x4_t {
+ simd_sub(a, vmull_s16(b, c))
+}
+
+/// Signed multiply-subtract long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmlsl.s32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smlsl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlsl_s32(a: int64x2_t, b: int32x2_t, c: int32x2_t) -> int64x2_t {
+ simd_sub(a, vmull_s32(b, c))
+}
+
+/// Unsigned multiply-subtract long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmlsl.u8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(umlsl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlsl_u8(a: uint16x8_t, b: uint8x8_t, c: uint8x8_t) -> uint16x8_t {
+ simd_sub(a, vmull_u8(b, c))
+}
+
+/// Unsigned multiply-subtract long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmlsl.u16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(umlsl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlsl_u16(a: uint32x4_t, b: uint16x4_t, c: uint16x4_t) -> uint32x4_t {
+ simd_sub(a, vmull_u16(b, c))
+}
+
+/// Unsigned multiply-subtract long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmlsl.u32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(umlsl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlsl_u32(a: uint64x2_t, b: uint32x2_t, c: uint32x2_t) -> uint64x2_t {
+ simd_sub(a, vmull_u32(b, c))
+}
+
+/// Vector widening multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmlsl.s16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smlsl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlsl_n_s16(a: int32x4_t, b: int16x4_t, c: i16) -> int32x4_t {
+ vmlsl_s16(a, b, vdup_n_s16(c))
+}
+
+/// Vector widening multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmlsl.s32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smlsl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlsl_n_s32(a: int64x2_t, b: int32x2_t, c: i32) -> int64x2_t {
+ vmlsl_s32(a, b, vdup_n_s32(c))
+}
+
+/// Vector widening multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmlsl.u16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(umlsl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlsl_n_u16(a: uint32x4_t, b: uint16x4_t, c: u16) -> uint32x4_t {
+ vmlsl_u16(a, b, vdup_n_u16(c))
+}
+
+/// Vector widening multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmlsl.u32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(umlsl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlsl_n_u32(a: uint64x2_t, b: uint32x2_t, c: u32) -> uint64x2_t {
+ vmlsl_u32(a, b, vdup_n_u32(c))
+}
+
+/// Vector widening multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmlsl.s16", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smlsl, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlsl_lane_s16<const LANE: i32>(a: int32x4_t, b: int16x4_t, c: int16x4_t) -> int32x4_t {
+ static_assert_imm2!(LANE);
+ vmlsl_s16(a, b, simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Vector widening multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmlsl.s16", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smlsl, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlsl_laneq_s16<const LANE: i32>(a: int32x4_t, b: int16x4_t, c: int16x8_t) -> int32x4_t {
+ static_assert_imm3!(LANE);
+ vmlsl_s16(a, b, simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Vector widening multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmlsl.s32", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smlsl, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlsl_lane_s32<const LANE: i32>(a: int64x2_t, b: int32x2_t, c: int32x2_t) -> int64x2_t {
+ static_assert_imm1!(LANE);
+ vmlsl_s32(a, b, simd_shuffle2!(c, c, <const LANE: i32> [LANE as u32, LANE as u32]))
+}
+
+/// Vector widening multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmlsl.s32", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smlsl, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlsl_laneq_s32<const LANE: i32>(a: int64x2_t, b: int32x2_t, c: int32x4_t) -> int64x2_t {
+ static_assert_imm2!(LANE);
+ vmlsl_s32(a, b, simd_shuffle2!(c, c, <const LANE: i32> [LANE as u32, LANE as u32]))
+}
+
+/// Vector widening multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmlsl.u16", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(umlsl, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlsl_lane_u16<const LANE: i32>(a: uint32x4_t, b: uint16x4_t, c: uint16x4_t) -> uint32x4_t {
+ static_assert_imm2!(LANE);
+ vmlsl_u16(a, b, simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Vector widening multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmlsl.u16", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(umlsl, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlsl_laneq_u16<const LANE: i32>(a: uint32x4_t, b: uint16x4_t, c: uint16x8_t) -> uint32x4_t {
+ static_assert_imm3!(LANE);
+ vmlsl_u16(a, b, simd_shuffle4!(c, c, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Vector widening multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmlsl.u32", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(umlsl, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlsl_lane_u32<const LANE: i32>(a: uint64x2_t, b: uint32x2_t, c: uint32x2_t) -> uint64x2_t {
+ static_assert_imm1!(LANE);
+ vmlsl_u32(a, b, simd_shuffle2!(c, c, <const LANE: i32> [LANE as u32, LANE as u32]))
+}
+
+/// Vector widening multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmlsl.u32", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(umlsl, LANE = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmlsl_laneq_u32<const LANE: i32>(a: uint64x2_t, b: uint32x2_t, c: uint32x4_t) -> uint64x2_t {
+ static_assert_imm2!(LANE);
+ vmlsl_u32(a, b, simd_shuffle2!(c, c, <const LANE: i32> [LANE as u32, LANE as u32]))
+}
+
+/// Negate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vneg.s8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(neg))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vneg_s8(a: int8x8_t) -> int8x8_t {
+ simd_neg(a)
+}
+
+/// Negate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vneg.s8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(neg))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vnegq_s8(a: int8x16_t) -> int8x16_t {
+ simd_neg(a)
+}
+
+/// Negate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vneg.s16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(neg))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vneg_s16(a: int16x4_t) -> int16x4_t {
+ simd_neg(a)
+}
+
+/// Negate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vneg.s16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(neg))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vnegq_s16(a: int16x8_t) -> int16x8_t {
+ simd_neg(a)
+}
+
+/// Negate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vneg.s32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(neg))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vneg_s32(a: int32x2_t) -> int32x2_t {
+ simd_neg(a)
+}
+
+/// Negate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vneg.s32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(neg))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vnegq_s32(a: int32x4_t) -> int32x4_t {
+ simd_neg(a)
+}
+
+/// Negate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vneg.f32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fneg))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vneg_f32(a: float32x2_t) -> float32x2_t {
+ simd_neg(a)
+}
+
+/// Negate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vneg.f32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fneg))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vnegq_f32(a: float32x4_t) -> float32x4_t {
+ simd_neg(a)
+}
+
+/// Signed saturating negate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqneg.s8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqneg))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqneg_s8(a: int8x8_t) -> int8x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqneg.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqneg.v8i8")]
+ fn vqneg_s8_(a: int8x8_t) -> int8x8_t;
+ }
+vqneg_s8_(a)
+}
+
+/// Signed saturating negate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqneg.s8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqneg))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqnegq_s8(a: int8x16_t) -> int8x16_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqneg.v16i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqneg.v16i8")]
+ fn vqnegq_s8_(a: int8x16_t) -> int8x16_t;
+ }
+vqnegq_s8_(a)
+}
+
+/// Signed saturating negate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqneg.s16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqneg))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqneg_s16(a: int16x4_t) -> int16x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqneg.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqneg.v4i16")]
+ fn vqneg_s16_(a: int16x4_t) -> int16x4_t;
+ }
+vqneg_s16_(a)
+}
+
+/// Signed saturating negate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqneg.s16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqneg))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqnegq_s16(a: int16x8_t) -> int16x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqneg.v8i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqneg.v8i16")]
+ fn vqnegq_s16_(a: int16x8_t) -> int16x8_t;
+ }
+vqnegq_s16_(a)
+}
+
+/// Signed saturating negate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqneg.s32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqneg))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqneg_s32(a: int32x2_t) -> int32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqneg.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqneg.v2i32")]
+ fn vqneg_s32_(a: int32x2_t) -> int32x2_t;
+ }
+vqneg_s32_(a)
+}
+
+/// Signed saturating negate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqneg.s32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqneg))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqnegq_s32(a: int32x4_t) -> int32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqneg.v4i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqneg.v4i32")]
+ fn vqnegq_s32_(a: int32x4_t) -> int32x4_t;
+ }
+vqnegq_s32_(a)
+}
+
+/// Saturating subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqsub.u8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqsub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqsub_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.usub.sat.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqsub.v8i8")]
+ fn vqsub_u8_(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t;
+ }
+vqsub_u8_(a, b)
+}
+
+/// Saturating subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqsub.u8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqsub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqsubq_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.usub.sat.v16i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqsub.v16i8")]
+ fn vqsubq_u8_(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t;
+ }
+vqsubq_u8_(a, b)
+}
+
+/// Saturating subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqsub.u16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqsub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqsub_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.usub.sat.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqsub.v4i16")]
+ fn vqsub_u16_(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t;
+ }
+vqsub_u16_(a, b)
+}
+
+/// Saturating subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqsub.u16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqsub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqsubq_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.usub.sat.v8i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqsub.v8i16")]
+ fn vqsubq_u16_(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t;
+ }
+vqsubq_u16_(a, b)
+}
+
+/// Saturating subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqsub.u32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqsub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqsub_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.usub.sat.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqsub.v2i32")]
+ fn vqsub_u32_(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t;
+ }
+vqsub_u32_(a, b)
+}
+
+/// Saturating subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqsub.u32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqsub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqsubq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.usub.sat.v4i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqsub.v4i32")]
+ fn vqsubq_u32_(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t;
+ }
+vqsubq_u32_(a, b)
+}
+
+/// Saturating subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqsub.u64"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqsub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqsub_u64(a: uint64x1_t, b: uint64x1_t) -> uint64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.usub.sat.v1i64")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqsub.v1i64")]
+ fn vqsub_u64_(a: uint64x1_t, b: uint64x1_t) -> uint64x1_t;
+ }
+vqsub_u64_(a, b)
+}
+
+/// Saturating subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqsub.u64"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqsub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqsubq_u64(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.usub.sat.v2i64")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqsub.v2i64")]
+ fn vqsubq_u64_(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t;
+ }
+vqsubq_u64_(a, b)
+}
+
+/// Saturating subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqsub.s8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqsub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqsub_s8(a: int8x8_t, b: int8x8_t) -> int8x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.ssub.sat.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqsub.v8i8")]
+ fn vqsub_s8_(a: int8x8_t, b: int8x8_t) -> int8x8_t;
+ }
+vqsub_s8_(a, b)
+}
+
+/// Saturating subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqsub.s8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqsub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqsubq_s8(a: int8x16_t, b: int8x16_t) -> int8x16_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.ssub.sat.v16i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqsub.v16i8")]
+ fn vqsubq_s8_(a: int8x16_t, b: int8x16_t) -> int8x16_t;
+ }
+vqsubq_s8_(a, b)
+}
+
+/// Saturating subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqsub.s16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqsub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqsub_s16(a: int16x4_t, b: int16x4_t) -> int16x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.ssub.sat.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqsub.v4i16")]
+ fn vqsub_s16_(a: int16x4_t, b: int16x4_t) -> int16x4_t;
+ }
+vqsub_s16_(a, b)
+}
+
+/// Saturating subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqsub.s16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqsub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqsubq_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.ssub.sat.v8i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqsub.v8i16")]
+ fn vqsubq_s16_(a: int16x8_t, b: int16x8_t) -> int16x8_t;
+ }
+vqsubq_s16_(a, b)
+}
+
+/// Saturating subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqsub.s32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqsub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqsub_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.ssub.sat.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqsub.v2i32")]
+ fn vqsub_s32_(a: int32x2_t, b: int32x2_t) -> int32x2_t;
+ }
+vqsub_s32_(a, b)
+}
+
+/// Saturating subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqsub.s32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqsub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqsubq_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.ssub.sat.v4i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqsub.v4i32")]
+ fn vqsubq_s32_(a: int32x4_t, b: int32x4_t) -> int32x4_t;
+ }
+vqsubq_s32_(a, b)
+}
+
+/// Saturating subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqsub.s64"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqsub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqsub_s64(a: int64x1_t, b: int64x1_t) -> int64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.ssub.sat.v1i64")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqsub.v1i64")]
+ fn vqsub_s64_(a: int64x1_t, b: int64x1_t) -> int64x1_t;
+ }
+vqsub_s64_(a, b)
+}
+
+/// Saturating subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqsub.s64"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqsub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqsubq_s64(a: int64x2_t, b: int64x2_t) -> int64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.ssub.sat.v2i64")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqsub.v2i64")]
+ fn vqsubq_s64_(a: int64x2_t, b: int64x2_t) -> int64x2_t;
+ }
+vqsubq_s64_(a, b)
+}
+
+/// Halving add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vhadd.u8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uhadd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vhadd_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vhaddu.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uhadd.v8i8")]
+ fn vhadd_u8_(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t;
+ }
+vhadd_u8_(a, b)
+}
+
+/// Halving add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vhadd.u8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uhadd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vhaddq_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vhaddu.v16i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uhadd.v16i8")]
+ fn vhaddq_u8_(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t;
+ }
+vhaddq_u8_(a, b)
+}
+
+/// Halving add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vhadd.u16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uhadd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vhadd_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vhaddu.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uhadd.v4i16")]
+ fn vhadd_u16_(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t;
+ }
+vhadd_u16_(a, b)
+}
+
+/// Halving add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vhadd.u16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uhadd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vhaddq_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vhaddu.v8i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uhadd.v8i16")]
+ fn vhaddq_u16_(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t;
+ }
+vhaddq_u16_(a, b)
+}
+
+/// Halving add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vhadd.u32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uhadd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vhadd_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vhaddu.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uhadd.v2i32")]
+ fn vhadd_u32_(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t;
+ }
+vhadd_u32_(a, b)
+}
+
+/// Halving add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vhadd.u32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uhadd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vhaddq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vhaddu.v4i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uhadd.v4i32")]
+ fn vhaddq_u32_(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t;
+ }
+vhaddq_u32_(a, b)
+}
+
+/// Halving add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vhadd.s8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(shadd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vhadd_s8(a: int8x8_t, b: int8x8_t) -> int8x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vhadds.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.shadd.v8i8")]
+ fn vhadd_s8_(a: int8x8_t, b: int8x8_t) -> int8x8_t;
+ }
+vhadd_s8_(a, b)
+}
+
+/// Halving add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vhadd.s8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(shadd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vhaddq_s8(a: int8x16_t, b: int8x16_t) -> int8x16_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vhadds.v16i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.shadd.v16i8")]
+ fn vhaddq_s8_(a: int8x16_t, b: int8x16_t) -> int8x16_t;
+ }
+vhaddq_s8_(a, b)
+}
+
+/// Halving add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vhadd.s16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(shadd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vhadd_s16(a: int16x4_t, b: int16x4_t) -> int16x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vhadds.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.shadd.v4i16")]
+ fn vhadd_s16_(a: int16x4_t, b: int16x4_t) -> int16x4_t;
+ }
+vhadd_s16_(a, b)
+}
+
+/// Halving add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vhadd.s16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(shadd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vhaddq_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vhadds.v8i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.shadd.v8i16")]
+ fn vhaddq_s16_(a: int16x8_t, b: int16x8_t) -> int16x8_t;
+ }
+vhaddq_s16_(a, b)
+}
+
+/// Halving add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vhadd.s32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(shadd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vhadd_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vhadds.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.shadd.v2i32")]
+ fn vhadd_s32_(a: int32x2_t, b: int32x2_t) -> int32x2_t;
+ }
+vhadd_s32_(a, b)
+}
+
+/// Halving add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vhadd.s32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(shadd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vhaddq_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vhadds.v4i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.shadd.v4i32")]
+ fn vhaddq_s32_(a: int32x4_t, b: int32x4_t) -> int32x4_t;
+ }
+vhaddq_s32_(a, b)
+}
+
+/// Rounding halving add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrhadd.u8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(urhadd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrhadd_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrhaddu.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.urhadd.v8i8")]
+ fn vrhadd_u8_(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t;
+ }
+vrhadd_u8_(a, b)
+}
+
+/// Rounding halving add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrhadd.u8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(urhadd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrhaddq_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrhaddu.v16i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.urhadd.v16i8")]
+ fn vrhaddq_u8_(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t;
+ }
+vrhaddq_u8_(a, b)
+}
+
+/// Rounding halving add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrhadd.u16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(urhadd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrhadd_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrhaddu.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.urhadd.v4i16")]
+ fn vrhadd_u16_(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t;
+ }
+vrhadd_u16_(a, b)
+}
+
+/// Rounding halving add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrhadd.u16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(urhadd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrhaddq_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrhaddu.v8i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.urhadd.v8i16")]
+ fn vrhaddq_u16_(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t;
+ }
+vrhaddq_u16_(a, b)
+}
+
+/// Rounding halving add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrhadd.u32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(urhadd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrhadd_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrhaddu.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.urhadd.v2i32")]
+ fn vrhadd_u32_(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t;
+ }
+vrhadd_u32_(a, b)
+}
+
+/// Rounding halving add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrhadd.u32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(urhadd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrhaddq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrhaddu.v4i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.urhadd.v4i32")]
+ fn vrhaddq_u32_(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t;
+ }
+vrhaddq_u32_(a, b)
+}
+
+/// Rounding halving add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrhadd.s8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(srhadd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrhadd_s8(a: int8x8_t, b: int8x8_t) -> int8x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrhadds.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.srhadd.v8i8")]
+ fn vrhadd_s8_(a: int8x8_t, b: int8x8_t) -> int8x8_t;
+ }
+vrhadd_s8_(a, b)
+}
+
+/// Rounding halving add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrhadd.s8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(srhadd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrhaddq_s8(a: int8x16_t, b: int8x16_t) -> int8x16_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrhadds.v16i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.srhadd.v16i8")]
+ fn vrhaddq_s8_(a: int8x16_t, b: int8x16_t) -> int8x16_t;
+ }
+vrhaddq_s8_(a, b)
+}
+
+/// Rounding halving add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrhadd.s16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(srhadd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrhadd_s16(a: int16x4_t, b: int16x4_t) -> int16x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrhadds.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.srhadd.v4i16")]
+ fn vrhadd_s16_(a: int16x4_t, b: int16x4_t) -> int16x4_t;
+ }
+vrhadd_s16_(a, b)
+}
+
+/// Rounding halving add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrhadd.s16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(srhadd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrhaddq_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrhadds.v8i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.srhadd.v8i16")]
+ fn vrhaddq_s16_(a: int16x8_t, b: int16x8_t) -> int16x8_t;
+ }
+vrhaddq_s16_(a, b)
+}
+
+/// Rounding halving add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrhadd.s32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(srhadd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrhadd_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrhadds.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.srhadd.v2i32")]
+ fn vrhadd_s32_(a: int32x2_t, b: int32x2_t) -> int32x2_t;
+ }
+vrhadd_s32_(a, b)
+}
+
+/// Rounding halving add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrhadd.s32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(srhadd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrhaddq_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrhadds.v4i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.srhadd.v4i32")]
+ fn vrhaddq_s32_(a: int32x4_t, b: int32x4_t) -> int32x4_t;
+ }
+vrhaddq_s32_(a, b)
+}
+
+/// Floating-point round to integral, to nearest with ties to even
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "fp-armv8,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrintn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(frintn))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrndn_f32(a: float32x2_t) -> float32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrintn.v2f32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.frintn.v2f32")]
+ fn vrndn_f32_(a: float32x2_t) -> float32x2_t;
+ }
+vrndn_f32_(a)
+}
+
+/// Floating-point round to integral, to nearest with ties to even
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "fp-armv8,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrintn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(frintn))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrndnq_f32(a: float32x4_t) -> float32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrintn.v4f32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.frintn.v4f32")]
+ fn vrndnq_f32_(a: float32x4_t) -> float32x4_t;
+ }
+vrndnq_f32_(a)
+}
+
+/// Saturating add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqadd.u8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqadd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqadd_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.uadd.sat.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqadd.v8i8")]
+ fn vqadd_u8_(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t;
+ }
+vqadd_u8_(a, b)
+}
+
+/// Saturating add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqadd.u8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqadd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqaddq_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.uadd.sat.v16i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqadd.v16i8")]
+ fn vqaddq_u8_(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t;
+ }
+vqaddq_u8_(a, b)
+}
+
+/// Saturating add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqadd.u16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqadd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqadd_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.uadd.sat.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqadd.v4i16")]
+ fn vqadd_u16_(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t;
+ }
+vqadd_u16_(a, b)
+}
+
+/// Saturating add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqadd.u16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqadd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqaddq_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.uadd.sat.v8i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqadd.v8i16")]
+ fn vqaddq_u16_(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t;
+ }
+vqaddq_u16_(a, b)
+}
+
+/// Saturating add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqadd.u32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqadd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqadd_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.uadd.sat.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqadd.v2i32")]
+ fn vqadd_u32_(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t;
+ }
+vqadd_u32_(a, b)
+}
+
+/// Saturating add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqadd.u32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqadd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqaddq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.uadd.sat.v4i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqadd.v4i32")]
+ fn vqaddq_u32_(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t;
+ }
+vqaddq_u32_(a, b)
+}
+
+/// Saturating add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqadd.u64"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqadd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqadd_u64(a: uint64x1_t, b: uint64x1_t) -> uint64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.uadd.sat.v1i64")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqadd.v1i64")]
+ fn vqadd_u64_(a: uint64x1_t, b: uint64x1_t) -> uint64x1_t;
+ }
+vqadd_u64_(a, b)
+}
+
+/// Saturating add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqadd.u64"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqadd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqaddq_u64(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.uadd.sat.v2i64")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqadd.v2i64")]
+ fn vqaddq_u64_(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t;
+ }
+vqaddq_u64_(a, b)
+}
+
+/// Saturating add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqadd.s8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqadd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqadd_s8(a: int8x8_t, b: int8x8_t) -> int8x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.sadd.sat.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqadd.v8i8")]
+ fn vqadd_s8_(a: int8x8_t, b: int8x8_t) -> int8x8_t;
+ }
+vqadd_s8_(a, b)
+}
+
+/// Saturating add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqadd.s8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqadd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqaddq_s8(a: int8x16_t, b: int8x16_t) -> int8x16_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.sadd.sat.v16i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqadd.v16i8")]
+ fn vqaddq_s8_(a: int8x16_t, b: int8x16_t) -> int8x16_t;
+ }
+vqaddq_s8_(a, b)
+}
+
+/// Saturating add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqadd.s16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqadd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqadd_s16(a: int16x4_t, b: int16x4_t) -> int16x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.sadd.sat.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqadd.v4i16")]
+ fn vqadd_s16_(a: int16x4_t, b: int16x4_t) -> int16x4_t;
+ }
+vqadd_s16_(a, b)
+}
+
+/// Saturating add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqadd.s16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqadd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqaddq_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.sadd.sat.v8i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqadd.v8i16")]
+ fn vqaddq_s16_(a: int16x8_t, b: int16x8_t) -> int16x8_t;
+ }
+vqaddq_s16_(a, b)
+}
+
+/// Saturating add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqadd.s32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqadd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqadd_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.sadd.sat.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqadd.v2i32")]
+ fn vqadd_s32_(a: int32x2_t, b: int32x2_t) -> int32x2_t;
+ }
+vqadd_s32_(a, b)
+}
+
+/// Saturating add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqadd.s32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqadd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqaddq_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.sadd.sat.v4i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqadd.v4i32")]
+ fn vqaddq_s32_(a: int32x4_t, b: int32x4_t) -> int32x4_t;
+ }
+vqaddq_s32_(a, b)
+}
+
+/// Saturating add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqadd.s64"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqadd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqadd_s64(a: int64x1_t, b: int64x1_t) -> int64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.sadd.sat.v1i64")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqadd.v1i64")]
+ fn vqadd_s64_(a: int64x1_t, b: int64x1_t) -> int64x1_t;
+ }
+vqadd_s64_(a, b)
+}
+
+/// Saturating add
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqadd.s64"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqadd))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqaddq_s64(a: int64x2_t, b: int64x2_t) -> int64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.sadd.sat.v2i64")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqadd.v2i64")]
+ fn vqaddq_s64_(a: int64x2_t, b: int64x2_t) -> int64x2_t;
+ }
+vqaddq_s64_(a, b)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1_s8_x2(a: *const i8) -> int8x8x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1x2.v8i8.p0i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld1x2.v8i8.p0i8")]
+ fn vld1_s8_x2_(a: *const i8) -> int8x8x2_t;
+ }
+vld1_s8_x2_(a)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1_s16_x2(a: *const i16) -> int16x4x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1x2.v4i16.p0i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld1x2.v4i16.p0i16")]
+ fn vld1_s16_x2_(a: *const i16) -> int16x4x2_t;
+ }
+vld1_s16_x2_(a)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1_s32_x2(a: *const i32) -> int32x2x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1x2.v2i32.p0i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld1x2.v2i32.p0i32")]
+ fn vld1_s32_x2_(a: *const i32) -> int32x2x2_t;
+ }
+vld1_s32_x2_(a)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1_s64_x2(a: *const i64) -> int64x1x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1x2.v1i64.p0i64")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld1x2.v1i64.p0i64")]
+ fn vld1_s64_x2_(a: *const i64) -> int64x1x2_t;
+ }
+vld1_s64_x2_(a)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1q_s8_x2(a: *const i8) -> int8x16x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1x2.v16i8.p0i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld1x2.v16i8.p0i8")]
+ fn vld1q_s8_x2_(a: *const i8) -> int8x16x2_t;
+ }
+vld1q_s8_x2_(a)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1q_s16_x2(a: *const i16) -> int16x8x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1x2.v8i16.p0i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld1x2.v8i16.p0i16")]
+ fn vld1q_s16_x2_(a: *const i16) -> int16x8x2_t;
+ }
+vld1q_s16_x2_(a)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1q_s32_x2(a: *const i32) -> int32x4x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1x2.v4i32.p0i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld1x2.v4i32.p0i32")]
+ fn vld1q_s32_x2_(a: *const i32) -> int32x4x2_t;
+ }
+vld1q_s32_x2_(a)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1q_s64_x2(a: *const i64) -> int64x2x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1x2.v2i64.p0i64")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld1x2.v2i64.p0i64")]
+ fn vld1q_s64_x2_(a: *const i64) -> int64x2x2_t;
+ }
+vld1q_s64_x2_(a)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1_s8_x3(a: *const i8) -> int8x8x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1x3.v8i8.p0i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld1x3.v8i8.p0i8")]
+ fn vld1_s8_x3_(a: *const i8) -> int8x8x3_t;
+ }
+vld1_s8_x3_(a)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1_s16_x3(a: *const i16) -> int16x4x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1x3.v4i16.p0i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld1x3.v4i16.p0i16")]
+ fn vld1_s16_x3_(a: *const i16) -> int16x4x3_t;
+ }
+vld1_s16_x3_(a)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1_s32_x3(a: *const i32) -> int32x2x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1x3.v2i32.p0i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld1x3.v2i32.p0i32")]
+ fn vld1_s32_x3_(a: *const i32) -> int32x2x3_t;
+ }
+vld1_s32_x3_(a)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1_s64_x3(a: *const i64) -> int64x1x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1x3.v1i64.p0i64")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld1x3.v1i64.p0i64")]
+ fn vld1_s64_x3_(a: *const i64) -> int64x1x3_t;
+ }
+vld1_s64_x3_(a)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1q_s8_x3(a: *const i8) -> int8x16x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1x3.v16i8.p0i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld1x3.v16i8.p0i8")]
+ fn vld1q_s8_x3_(a: *const i8) -> int8x16x3_t;
+ }
+vld1q_s8_x3_(a)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1q_s16_x3(a: *const i16) -> int16x8x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1x3.v8i16.p0i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld1x3.v8i16.p0i16")]
+ fn vld1q_s16_x3_(a: *const i16) -> int16x8x3_t;
+ }
+vld1q_s16_x3_(a)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1q_s32_x3(a: *const i32) -> int32x4x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1x3.v4i32.p0i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld1x3.v4i32.p0i32")]
+ fn vld1q_s32_x3_(a: *const i32) -> int32x4x3_t;
+ }
+vld1q_s32_x3_(a)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1q_s64_x3(a: *const i64) -> int64x2x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1x3.v2i64.p0i64")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld1x3.v2i64.p0i64")]
+ fn vld1q_s64_x3_(a: *const i64) -> int64x2x3_t;
+ }
+vld1q_s64_x3_(a)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1_s8_x4(a: *const i8) -> int8x8x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1x4.v8i8.p0i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld1x4.v8i8.p0i8")]
+ fn vld1_s8_x4_(a: *const i8) -> int8x8x4_t;
+ }
+vld1_s8_x4_(a)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1_s16_x4(a: *const i16) -> int16x4x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1x4.v4i16.p0i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld1x4.v4i16.p0i16")]
+ fn vld1_s16_x4_(a: *const i16) -> int16x4x4_t;
+ }
+vld1_s16_x4_(a)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1_s32_x4(a: *const i32) -> int32x2x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1x4.v2i32.p0i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld1x4.v2i32.p0i32")]
+ fn vld1_s32_x4_(a: *const i32) -> int32x2x4_t;
+ }
+vld1_s32_x4_(a)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1_s64_x4(a: *const i64) -> int64x1x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1x4.v1i64.p0i64")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld1x4.v1i64.p0i64")]
+ fn vld1_s64_x4_(a: *const i64) -> int64x1x4_t;
+ }
+vld1_s64_x4_(a)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1q_s8_x4(a: *const i8) -> int8x16x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1x4.v16i8.p0i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld1x4.v16i8.p0i8")]
+ fn vld1q_s8_x4_(a: *const i8) -> int8x16x4_t;
+ }
+vld1q_s8_x4_(a)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1q_s16_x4(a: *const i16) -> int16x8x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1x4.v8i16.p0i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld1x4.v8i16.p0i16")]
+ fn vld1q_s16_x4_(a: *const i16) -> int16x8x4_t;
+ }
+vld1q_s16_x4_(a)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1q_s32_x4(a: *const i32) -> int32x4x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1x4.v4i32.p0i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld1x4.v4i32.p0i32")]
+ fn vld1q_s32_x4_(a: *const i32) -> int32x4x4_t;
+ }
+vld1q_s32_x4_(a)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1q_s64_x4(a: *const i64) -> int64x2x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1x4.v2i64.p0i64")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld1x4.v2i64.p0i64")]
+ fn vld1q_s64_x4_(a: *const i64) -> int64x2x4_t;
+ }
+vld1q_s64_x4_(a)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1_u8_x2(a: *const u8) -> uint8x8x2_t {
+ transmute(vld1_s8_x2(transmute(a)))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1_u16_x2(a: *const u16) -> uint16x4x2_t {
+ transmute(vld1_s16_x2(transmute(a)))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1_u32_x2(a: *const u32) -> uint32x2x2_t {
+ transmute(vld1_s32_x2(transmute(a)))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1_u64_x2(a: *const u64) -> uint64x1x2_t {
+ transmute(vld1_s64_x2(transmute(a)))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1q_u8_x2(a: *const u8) -> uint8x16x2_t {
+ transmute(vld1q_s8_x2(transmute(a)))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1q_u16_x2(a: *const u16) -> uint16x8x2_t {
+ transmute(vld1q_s16_x2(transmute(a)))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1q_u32_x2(a: *const u32) -> uint32x4x2_t {
+ transmute(vld1q_s32_x2(transmute(a)))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1q_u64_x2(a: *const u64) -> uint64x2x2_t {
+ transmute(vld1q_s64_x2(transmute(a)))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1_u8_x3(a: *const u8) -> uint8x8x3_t {
+ transmute(vld1_s8_x3(transmute(a)))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1_u16_x3(a: *const u16) -> uint16x4x3_t {
+ transmute(vld1_s16_x3(transmute(a)))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1_u32_x3(a: *const u32) -> uint32x2x3_t {
+ transmute(vld1_s32_x3(transmute(a)))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1_u64_x3(a: *const u64) -> uint64x1x3_t {
+ transmute(vld1_s64_x3(transmute(a)))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1q_u8_x3(a: *const u8) -> uint8x16x3_t {
+ transmute(vld1q_s8_x3(transmute(a)))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1q_u16_x3(a: *const u16) -> uint16x8x3_t {
+ transmute(vld1q_s16_x3(transmute(a)))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1q_u32_x3(a: *const u32) -> uint32x4x3_t {
+ transmute(vld1q_s32_x3(transmute(a)))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1q_u64_x3(a: *const u64) -> uint64x2x3_t {
+ transmute(vld1q_s64_x3(transmute(a)))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1_u8_x4(a: *const u8) -> uint8x8x4_t {
+ transmute(vld1_s8_x4(transmute(a)))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1_u16_x4(a: *const u16) -> uint16x4x4_t {
+ transmute(vld1_s16_x4(transmute(a)))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1_u32_x4(a: *const u32) -> uint32x2x4_t {
+ transmute(vld1_s32_x4(transmute(a)))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1_u64_x4(a: *const u64) -> uint64x1x4_t {
+ transmute(vld1_s64_x4(transmute(a)))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1q_u8_x4(a: *const u8) -> uint8x16x4_t {
+ transmute(vld1q_s8_x4(transmute(a)))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1q_u16_x4(a: *const u16) -> uint16x8x4_t {
+ transmute(vld1q_s16_x4(transmute(a)))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1q_u32_x4(a: *const u32) -> uint32x4x4_t {
+ transmute(vld1q_s32_x4(transmute(a)))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1q_u64_x4(a: *const u64) -> uint64x2x4_t {
+ transmute(vld1q_s64_x4(transmute(a)))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1_p8_x2(a: *const p8) -> poly8x8x2_t {
+ transmute(vld1_s8_x2(transmute(a)))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1_p8_x3(a: *const p8) -> poly8x8x3_t {
+ transmute(vld1_s8_x3(transmute(a)))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1_p8_x4(a: *const p8) -> poly8x8x4_t {
+ transmute(vld1_s8_x4(transmute(a)))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1q_p8_x2(a: *const p8) -> poly8x16x2_t {
+ transmute(vld1q_s8_x2(transmute(a)))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1q_p8_x3(a: *const p8) -> poly8x16x3_t {
+ transmute(vld1q_s8_x3(transmute(a)))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1q_p8_x4(a: *const p8) -> poly8x16x4_t {
+ transmute(vld1q_s8_x4(transmute(a)))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1_p16_x2(a: *const p16) -> poly16x4x2_t {
+ transmute(vld1_s16_x2(transmute(a)))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1_p16_x3(a: *const p16) -> poly16x4x3_t {
+ transmute(vld1_s16_x3(transmute(a)))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1_p16_x4(a: *const p16) -> poly16x4x4_t {
+ transmute(vld1_s16_x4(transmute(a)))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1q_p16_x2(a: *const p16) -> poly16x8x2_t {
+ transmute(vld1q_s16_x2(transmute(a)))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1q_p16_x3(a: *const p16) -> poly16x8x3_t {
+ transmute(vld1q_s16_x3(transmute(a)))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1q_p16_x4(a: *const p16) -> poly16x8x4_t {
+ transmute(vld1q_s16_x4(transmute(a)))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1_p64_x2(a: *const p64) -> poly64x1x2_t {
+ transmute(vld1_s64_x2(transmute(a)))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1_p64_x3(a: *const p64) -> poly64x1x3_t {
+ transmute(vld1_s64_x3(transmute(a)))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1_p64_x4(a: *const p64) -> poly64x1x4_t {
+ transmute(vld1_s64_x4(transmute(a)))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1q_p64_x2(a: *const p64) -> poly64x2x2_t {
+ transmute(vld1q_s64_x2(transmute(a)))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1q_p64_x3(a: *const p64) -> poly64x2x3_t {
+ transmute(vld1q_s64_x3(transmute(a)))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1q_p64_x4(a: *const p64) -> poly64x2x4_t {
+ transmute(vld1q_s64_x4(transmute(a)))
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1_f32_x2(a: *const f32) -> float32x2x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1x2.v2f32.p0f32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld1x2.v2f32.p0f32")]
+ fn vld1_f32_x2_(a: *const f32) -> float32x2x2_t;
+ }
+vld1_f32_x2_(a)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1q_f32_x2(a: *const f32) -> float32x4x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1x2.v4f32.p0f32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld1x2.v4f32.p0f32")]
+ fn vld1q_f32_x2_(a: *const f32) -> float32x4x2_t;
+ }
+vld1q_f32_x2_(a)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1_f32_x3(a: *const f32) -> float32x2x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1x3.v2f32.p0f32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld1x3.v2f32.p0f32")]
+ fn vld1_f32_x3_(a: *const f32) -> float32x2x3_t;
+ }
+vld1_f32_x3_(a)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1q_f32_x3(a: *const f32) -> float32x4x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1x3.v4f32.p0f32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld1x3.v4f32.p0f32")]
+ fn vld1q_f32_x3_(a: *const f32) -> float32x4x3_t;
+ }
+vld1q_f32_x3_(a)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1_f32_x4(a: *const f32) -> float32x2x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1x4.v2f32.p0f32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld1x4.v2f32.p0f32")]
+ fn vld1_f32_x4_(a: *const f32) -> float32x2x4_t;
+ }
+vld1_f32_x4_(a)
+}
+
+/// Load multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld1q_f32_x4(a: *const f32) -> float32x4x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1x4.v4f32.p0f32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld1x4.v4f32.p0f32")]
+ fn vld1q_f32_x4_(a: *const f32) -> float32x4x4_t;
+ }
+vld1q_f32_x4_(a)
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld2))]
+pub unsafe fn vld2_s8(a: *const i8) -> int8x8x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld2.v8i8.p0i8")]
+ fn vld2_s8_(ptr: *const i8, size: i32) -> int8x8x2_t;
+ }
+vld2_s8_(a as *const i8, 1)
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2_s8(a: *const i8) -> int8x8x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld2.v8i8.p0v8i8")]
+ fn vld2_s8_(ptr: *const int8x8_t) -> int8x8x2_t;
+ }
+vld2_s8_(a as _)
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld2))]
+pub unsafe fn vld2_s16(a: *const i16) -> int16x4x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld2.v4i16.p0i8")]
+ fn vld2_s16_(ptr: *const i8, size: i32) -> int16x4x2_t;
+ }
+vld2_s16_(a as *const i8, 2)
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2_s16(a: *const i16) -> int16x4x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld2.v4i16.p0v4i16")]
+ fn vld2_s16_(ptr: *const int16x4_t) -> int16x4x2_t;
+ }
+vld2_s16_(a as _)
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld2))]
+pub unsafe fn vld2_s32(a: *const i32) -> int32x2x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld2.v2i32.p0i8")]
+ fn vld2_s32_(ptr: *const i8, size: i32) -> int32x2x2_t;
+ }
+vld2_s32_(a as *const i8, 4)
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2_s32(a: *const i32) -> int32x2x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld2.v2i32.p0v2i32")]
+ fn vld2_s32_(ptr: *const int32x2_t) -> int32x2x2_t;
+ }
+vld2_s32_(a as _)
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld2))]
+pub unsafe fn vld2q_s8(a: *const i8) -> int8x16x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld2.v16i8.p0i8")]
+ fn vld2q_s8_(ptr: *const i8, size: i32) -> int8x16x2_t;
+ }
+vld2q_s8_(a as *const i8, 1)
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2q_s8(a: *const i8) -> int8x16x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld2.v16i8.p0v16i8")]
+ fn vld2q_s8_(ptr: *const int8x16_t) -> int8x16x2_t;
+ }
+vld2q_s8_(a as _)
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld2))]
+pub unsafe fn vld2q_s16(a: *const i16) -> int16x8x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld2.v8i16.p0i8")]
+ fn vld2q_s16_(ptr: *const i8, size: i32) -> int16x8x2_t;
+ }
+vld2q_s16_(a as *const i8, 2)
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2q_s16(a: *const i16) -> int16x8x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld2.v8i16.p0v8i16")]
+ fn vld2q_s16_(ptr: *const int16x8_t) -> int16x8x2_t;
+ }
+vld2q_s16_(a as _)
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld2))]
+pub unsafe fn vld2q_s32(a: *const i32) -> int32x4x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld2.v4i32.p0i8")]
+ fn vld2q_s32_(ptr: *const i8, size: i32) -> int32x4x2_t;
+ }
+vld2q_s32_(a as *const i8, 4)
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2q_s32(a: *const i32) -> int32x4x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld2.v4i32.p0v4i32")]
+ fn vld2q_s32_(ptr: *const int32x4_t) -> int32x4x2_t;
+ }
+vld2q_s32_(a as _)
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(nop))]
+pub unsafe fn vld2_s64(a: *const i64) -> int64x1x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld2.v1i64.p0i8")]
+ fn vld2_s64_(ptr: *const i8, size: i32) -> int64x1x2_t;
+ }
+vld2_s64_(a as *const i8, 8)
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2_s64(a: *const i64) -> int64x1x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld2.v1i64.p0v1i64")]
+ fn vld2_s64_(ptr: *const int64x1_t) -> int64x1x2_t;
+ }
+vld2_s64_(a as _)
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld2))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld2_u8(a: *const u8) -> uint8x8x2_t {
+ transmute(vld2_s8(transmute(a)))
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld2))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld2_u16(a: *const u16) -> uint16x4x2_t {
+ transmute(vld2_s16(transmute(a)))
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld2))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld2_u32(a: *const u32) -> uint32x2x2_t {
+ transmute(vld2_s32(transmute(a)))
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld2))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld2q_u8(a: *const u8) -> uint8x16x2_t {
+ transmute(vld2q_s8(transmute(a)))
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld2))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld2q_u16(a: *const u16) -> uint16x8x2_t {
+ transmute(vld2q_s16(transmute(a)))
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld2))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld2q_u32(a: *const u32) -> uint32x4x2_t {
+ transmute(vld2q_s32(transmute(a)))
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld2))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld2_p8(a: *const p8) -> poly8x8x2_t {
+ transmute(vld2_s8(transmute(a)))
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld2))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld2_p16(a: *const p16) -> poly16x4x2_t {
+ transmute(vld2_s16(transmute(a)))
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld2))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld2q_p8(a: *const p8) -> poly8x16x2_t {
+ transmute(vld2q_s8(transmute(a)))
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld2))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld2q_p16(a: *const p16) -> poly16x8x2_t {
+ transmute(vld2q_s16(transmute(a)))
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld2_u64(a: *const u64) -> uint64x1x2_t {
+ transmute(vld2_s64(transmute(a)))
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld2_p64(a: *const p64) -> poly64x1x2_t {
+ transmute(vld2_s64(transmute(a)))
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld2))]
+pub unsafe fn vld2_f32(a: *const f32) -> float32x2x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld2.v2f32.p0i8")]
+ fn vld2_f32_(ptr: *const i8, size: i32) -> float32x2x2_t;
+ }
+vld2_f32_(a as *const i8, 4)
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2_f32(a: *const f32) -> float32x2x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld2.v2f32.p0v2f32")]
+ fn vld2_f32_(ptr: *const float32x2_t) -> float32x2x2_t;
+ }
+vld2_f32_(a as _)
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld2))]
+pub unsafe fn vld2q_f32(a: *const f32) -> float32x4x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld2.v4f32.p0i8")]
+ fn vld2q_f32_(ptr: *const i8, size: i32) -> float32x4x2_t;
+ }
+vld2q_f32_(a as *const i8, 4)
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2q_f32(a: *const f32) -> float32x4x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld2.v4f32.p0v4f32")]
+ fn vld2q_f32_(ptr: *const float32x4_t) -> float32x4x2_t;
+ }
+vld2q_f32_(a as _)
+}
+
+/// Load single 2-element structure and replicate to all lanes of two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld2))]
+pub unsafe fn vld2_dup_s8(a: *const i8) -> int8x8x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld2dup.v8i8.p0i8")]
+ fn vld2_dup_s8_(ptr: *const i8, size: i32) -> int8x8x2_t;
+ }
+vld2_dup_s8_(a as *const i8, 1)
+}
+
+/// Load single 2-element structure and replicate to all lanes of two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld2r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2_dup_s8(a: *const i8) -> int8x8x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld2r.v8i8.p0i8")]
+ fn vld2_dup_s8_(ptr: *const i8) -> int8x8x2_t;
+ }
+vld2_dup_s8_(a as _)
+}
+
+/// Load single 2-element structure and replicate to all lanes of two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld2))]
+pub unsafe fn vld2_dup_s16(a: *const i16) -> int16x4x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld2dup.v4i16.p0i8")]
+ fn vld2_dup_s16_(ptr: *const i8, size: i32) -> int16x4x2_t;
+ }
+vld2_dup_s16_(a as *const i8, 2)
+}
+
+/// Load single 2-element structure and replicate to all lanes of two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld2r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2_dup_s16(a: *const i16) -> int16x4x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld2r.v4i16.p0i16")]
+ fn vld2_dup_s16_(ptr: *const i16) -> int16x4x2_t;
+ }
+vld2_dup_s16_(a as _)
+}
+
+/// Load single 2-element structure and replicate to all lanes of two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld2))]
+pub unsafe fn vld2_dup_s32(a: *const i32) -> int32x2x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld2dup.v2i32.p0i8")]
+ fn vld2_dup_s32_(ptr: *const i8, size: i32) -> int32x2x2_t;
+ }
+vld2_dup_s32_(a as *const i8, 4)
+}
+
+/// Load single 2-element structure and replicate to all lanes of two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld2r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2_dup_s32(a: *const i32) -> int32x2x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld2r.v2i32.p0i32")]
+ fn vld2_dup_s32_(ptr: *const i32) -> int32x2x2_t;
+ }
+vld2_dup_s32_(a as _)
+}
+
+/// Load single 2-element structure and replicate to all lanes of two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld2))]
+pub unsafe fn vld2q_dup_s8(a: *const i8) -> int8x16x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld2dup.v16i8.p0i8")]
+ fn vld2q_dup_s8_(ptr: *const i8, size: i32) -> int8x16x2_t;
+ }
+vld2q_dup_s8_(a as *const i8, 1)
+}
+
+/// Load single 2-element structure and replicate to all lanes of two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld2r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2q_dup_s8(a: *const i8) -> int8x16x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld2r.v16i8.p0i8")]
+ fn vld2q_dup_s8_(ptr: *const i8) -> int8x16x2_t;
+ }
+vld2q_dup_s8_(a as _)
+}
+
+/// Load single 2-element structure and replicate to all lanes of two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld2))]
+pub unsafe fn vld2q_dup_s16(a: *const i16) -> int16x8x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld2dup.v8i16.p0i8")]
+ fn vld2q_dup_s16_(ptr: *const i8, size: i32) -> int16x8x2_t;
+ }
+vld2q_dup_s16_(a as *const i8, 2)
+}
+
+/// Load single 2-element structure and replicate to all lanes of two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld2r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2q_dup_s16(a: *const i16) -> int16x8x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld2r.v8i16.p0i16")]
+ fn vld2q_dup_s16_(ptr: *const i16) -> int16x8x2_t;
+ }
+vld2q_dup_s16_(a as _)
+}
+
+/// Load single 2-element structure and replicate to all lanes of two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld2))]
+pub unsafe fn vld2q_dup_s32(a: *const i32) -> int32x4x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld2dup.v4i32.p0i8")]
+ fn vld2q_dup_s32_(ptr: *const i8, size: i32) -> int32x4x2_t;
+ }
+vld2q_dup_s32_(a as *const i8, 4)
+}
+
+/// Load single 2-element structure and replicate to all lanes of two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld2r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2q_dup_s32(a: *const i32) -> int32x4x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld2r.v4i32.p0i32")]
+ fn vld2q_dup_s32_(ptr: *const i32) -> int32x4x2_t;
+ }
+vld2q_dup_s32_(a as _)
+}
+
+/// Load single 2-element structure and replicate to all lanes of two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(nop))]
+pub unsafe fn vld2_dup_s64(a: *const i64) -> int64x1x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld2dup.v1i64.p0i8")]
+ fn vld2_dup_s64_(ptr: *const i8, size: i32) -> int64x1x2_t;
+ }
+vld2_dup_s64_(a as *const i8, 8)
+}
+
+/// Load single 2-element structure and replicate to all lanes of two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld2r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2_dup_s64(a: *const i64) -> int64x1x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld2r.v1i64.p0i64")]
+ fn vld2_dup_s64_(ptr: *const i64) -> int64x1x2_t;
+ }
+vld2_dup_s64_(a as _)
+}
+
+/// Load single 2-element structure and replicate to all lanes of two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld2r))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld2_dup_u8(a: *const u8) -> uint8x8x2_t {
+ transmute(vld2_dup_s8(transmute(a)))
+}
+
+/// Load single 2-element structure and replicate to all lanes of two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld2r))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld2_dup_u16(a: *const u16) -> uint16x4x2_t {
+ transmute(vld2_dup_s16(transmute(a)))
+}
+
+/// Load single 2-element structure and replicate to all lanes of two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld2r))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld2_dup_u32(a: *const u32) -> uint32x2x2_t {
+ transmute(vld2_dup_s32(transmute(a)))
+}
+
+/// Load single 2-element structure and replicate to all lanes of two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld2r))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld2q_dup_u8(a: *const u8) -> uint8x16x2_t {
+ transmute(vld2q_dup_s8(transmute(a)))
+}
+
+/// Load single 2-element structure and replicate to all lanes of two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld2r))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld2q_dup_u16(a: *const u16) -> uint16x8x2_t {
+ transmute(vld2q_dup_s16(transmute(a)))
+}
+
+/// Load single 2-element structure and replicate to all lanes of two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld2r))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld2q_dup_u32(a: *const u32) -> uint32x4x2_t {
+ transmute(vld2q_dup_s32(transmute(a)))
+}
+
+/// Load single 2-element structure and replicate to all lanes of two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld2r))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld2_dup_p8(a: *const p8) -> poly8x8x2_t {
+ transmute(vld2_dup_s8(transmute(a)))
+}
+
+/// Load single 2-element structure and replicate to all lanes of two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld2r))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld2_dup_p16(a: *const p16) -> poly16x4x2_t {
+ transmute(vld2_dup_s16(transmute(a)))
+}
+
+/// Load single 2-element structure and replicate to all lanes of two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld2r))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld2q_dup_p8(a: *const p8) -> poly8x16x2_t {
+ transmute(vld2q_dup_s8(transmute(a)))
+}
+
+/// Load single 2-element structure and replicate to all lanes of two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld2r))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld2q_dup_p16(a: *const p16) -> poly16x8x2_t {
+ transmute(vld2q_dup_s16(transmute(a)))
+}
+
+/// Load single 2-element structure and replicate to all lanes of two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld2r))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld2_dup_u64(a: *const u64) -> uint64x1x2_t {
+ transmute(vld2_dup_s64(transmute(a)))
+}
+
+/// Load single 2-element structure and replicate to all lanes of two registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld2r))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld2_dup_p64(a: *const p64) -> poly64x1x2_t {
+ transmute(vld2_dup_s64(transmute(a)))
+}
+
+/// Load single 2-element structure and replicate to all lanes of two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld2))]
+pub unsafe fn vld2_dup_f32(a: *const f32) -> float32x2x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld2dup.v2f32.p0i8")]
+ fn vld2_dup_f32_(ptr: *const i8, size: i32) -> float32x2x2_t;
+ }
+vld2_dup_f32_(a as *const i8, 4)
+}
+
+/// Load single 2-element structure and replicate to all lanes of two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld2r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2_dup_f32(a: *const f32) -> float32x2x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld2r.v2f32.p0f32")]
+ fn vld2_dup_f32_(ptr: *const f32) -> float32x2x2_t;
+ }
+vld2_dup_f32_(a as _)
+}
+
+/// Load single 2-element structure and replicate to all lanes of two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld2))]
+pub unsafe fn vld2q_dup_f32(a: *const f32) -> float32x4x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld2dup.v4f32.p0i8")]
+ fn vld2q_dup_f32_(ptr: *const i8, size: i32) -> float32x4x2_t;
+ }
+vld2q_dup_f32_(a as *const i8, 4)
+}
+
+/// Load single 2-element structure and replicate to all lanes of two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld2r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2q_dup_f32(a: *const f32) -> float32x4x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld2r.v4f32.p0f32")]
+ fn vld2q_dup_f32_(ptr: *const f32) -> float32x4x2_t;
+ }
+vld2q_dup_f32_(a as _)
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vld2_lane_s8<const LANE: i32>(a: *const i8, b: int8x8x2_t) -> int8x8x2_t {
+ static_assert_imm3!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld2lane.v8i8.p0i8")]
+ fn vld2_lane_s8_(ptr: *const i8, a: int8x8_t, b: int8x8_t, n: i32, size: i32) -> int8x8x2_t;
+ }
+vld2_lane_s8_(a as _, b.0, b.1, LANE, 1)
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2_lane_s8<const LANE: i32>(a: *const i8, b: int8x8x2_t) -> int8x8x2_t {
+ static_assert_imm3!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld2lane.v8i8.p0i8")]
+ fn vld2_lane_s8_(a: int8x8_t, b: int8x8_t, n: i64, ptr: *const i8) -> int8x8x2_t;
+ }
+vld2_lane_s8_(b.0, b.1, LANE as i64, a as _)
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vld2_lane_s16<const LANE: i32>(a: *const i16, b: int16x4x2_t) -> int16x4x2_t {
+ static_assert_imm2!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld2lane.v4i16.p0i8")]
+ fn vld2_lane_s16_(ptr: *const i8, a: int16x4_t, b: int16x4_t, n: i32, size: i32) -> int16x4x2_t;
+ }
+vld2_lane_s16_(a as _, b.0, b.1, LANE, 2)
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2_lane_s16<const LANE: i32>(a: *const i16, b: int16x4x2_t) -> int16x4x2_t {
+ static_assert_imm2!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld2lane.v4i16.p0i8")]
+ fn vld2_lane_s16_(a: int16x4_t, b: int16x4_t, n: i64, ptr: *const i8) -> int16x4x2_t;
+ }
+vld2_lane_s16_(b.0, b.1, LANE as i64, a as _)
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vld2_lane_s32<const LANE: i32>(a: *const i32, b: int32x2x2_t) -> int32x2x2_t {
+ static_assert_imm1!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld2lane.v2i32.p0i8")]
+ fn vld2_lane_s32_(ptr: *const i8, a: int32x2_t, b: int32x2_t, n: i32, size: i32) -> int32x2x2_t;
+ }
+vld2_lane_s32_(a as _, b.0, b.1, LANE, 4)
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2_lane_s32<const LANE: i32>(a: *const i32, b: int32x2x2_t) -> int32x2x2_t {
+ static_assert_imm1!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld2lane.v2i32.p0i8")]
+ fn vld2_lane_s32_(a: int32x2_t, b: int32x2_t, n: i64, ptr: *const i8) -> int32x2x2_t;
+ }
+vld2_lane_s32_(b.0, b.1, LANE as i64, a as _)
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vld2q_lane_s16<const LANE: i32>(a: *const i16, b: int16x8x2_t) -> int16x8x2_t {
+ static_assert_imm3!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld2lane.v8i16.p0i8")]
+ fn vld2q_lane_s16_(ptr: *const i8, a: int16x8_t, b: int16x8_t, n: i32, size: i32) -> int16x8x2_t;
+ }
+vld2q_lane_s16_(a as _, b.0, b.1, LANE, 2)
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2q_lane_s16<const LANE: i32>(a: *const i16, b: int16x8x2_t) -> int16x8x2_t {
+ static_assert_imm3!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld2lane.v8i16.p0i8")]
+ fn vld2q_lane_s16_(a: int16x8_t, b: int16x8_t, n: i64, ptr: *const i8) -> int16x8x2_t;
+ }
+vld2q_lane_s16_(b.0, b.1, LANE as i64, a as _)
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vld2q_lane_s32<const LANE: i32>(a: *const i32, b: int32x4x2_t) -> int32x4x2_t {
+ static_assert_imm2!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld2lane.v4i32.p0i8")]
+ fn vld2q_lane_s32_(ptr: *const i8, a: int32x4_t, b: int32x4_t, n: i32, size: i32) -> int32x4x2_t;
+ }
+vld2q_lane_s32_(a as _, b.0, b.1, LANE, 4)
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2q_lane_s32<const LANE: i32>(a: *const i32, b: int32x4x2_t) -> int32x4x2_t {
+ static_assert_imm2!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld2lane.v4i32.p0i8")]
+ fn vld2q_lane_s32_(a: int32x4_t, b: int32x4_t, n: i64, ptr: *const i8) -> int32x4x2_t;
+ }
+vld2q_lane_s32_(b.0, b.1, LANE as i64, a as _)
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld2, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld2_lane_u8<const LANE: i32>(a: *const u8, b: uint8x8x2_t) -> uint8x8x2_t {
+ static_assert_imm3!(LANE);
+ transmute(vld2_lane_s8::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld2, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld2_lane_u16<const LANE: i32>(a: *const u16, b: uint16x4x2_t) -> uint16x4x2_t {
+ static_assert_imm2!(LANE);
+ transmute(vld2_lane_s16::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld2, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld2_lane_u32<const LANE: i32>(a: *const u32, b: uint32x2x2_t) -> uint32x2x2_t {
+ static_assert_imm1!(LANE);
+ transmute(vld2_lane_s32::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld2, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld2q_lane_u16<const LANE: i32>(a: *const u16, b: uint16x8x2_t) -> uint16x8x2_t {
+ static_assert_imm3!(LANE);
+ transmute(vld2q_lane_s16::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld2, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld2q_lane_u32<const LANE: i32>(a: *const u32, b: uint32x4x2_t) -> uint32x4x2_t {
+ static_assert_imm2!(LANE);
+ transmute(vld2q_lane_s32::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld2, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld2_lane_p8<const LANE: i32>(a: *const p8, b: poly8x8x2_t) -> poly8x8x2_t {
+ static_assert_imm3!(LANE);
+ transmute(vld2_lane_s8::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld2, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld2_lane_p16<const LANE: i32>(a: *const p16, b: poly16x4x2_t) -> poly16x4x2_t {
+ static_assert_imm2!(LANE);
+ transmute(vld2_lane_s16::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld2, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld2q_lane_p16<const LANE: i32>(a: *const p16, b: poly16x8x2_t) -> poly16x8x2_t {
+ static_assert_imm3!(LANE);
+ transmute(vld2q_lane_s16::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vld2_lane_f32<const LANE: i32>(a: *const f32, b: float32x2x2_t) -> float32x2x2_t {
+ static_assert_imm1!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld2lane.v2f32.p0i8")]
+ fn vld2_lane_f32_(ptr: *const i8, a: float32x2_t, b: float32x2_t, n: i32, size: i32) -> float32x2x2_t;
+ }
+vld2_lane_f32_(a as _, b.0, b.1, LANE, 4)
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2_lane_f32<const LANE: i32>(a: *const f32, b: float32x2x2_t) -> float32x2x2_t {
+ static_assert_imm1!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld2lane.v2f32.p0i8")]
+ fn vld2_lane_f32_(a: float32x2_t, b: float32x2_t, n: i64, ptr: *const i8) -> float32x2x2_t;
+ }
+vld2_lane_f32_(b.0, b.1, LANE as i64, a as _)
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vld2q_lane_f32<const LANE: i32>(a: *const f32, b: float32x4x2_t) -> float32x4x2_t {
+ static_assert_imm2!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld2lane.v4f32.p0i8")]
+ fn vld2q_lane_f32_(ptr: *const i8, a: float32x4_t, b: float32x4_t, n: i32, size: i32) -> float32x4x2_t;
+ }
+vld2q_lane_f32_(a as _, b.0, b.1, LANE, 4)
+}
+
+/// Load multiple 2-element structures to two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld2q_lane_f32<const LANE: i32>(a: *const f32, b: float32x4x2_t) -> float32x4x2_t {
+ static_assert_imm2!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld2lane.v4f32.p0i8")]
+ fn vld2q_lane_f32_(a: float32x4_t, b: float32x4_t, n: i64, ptr: *const i8) -> float32x4x2_t;
+ }
+vld2q_lane_f32_(b.0, b.1, LANE as i64, a as _)
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld3))]
+pub unsafe fn vld3_s8(a: *const i8) -> int8x8x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld3.v8i8.p0i8")]
+ fn vld3_s8_(ptr: *const i8, size: i32) -> int8x8x3_t;
+ }
+vld3_s8_(a as *const i8, 1)
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld3))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3_s8(a: *const i8) -> int8x8x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld3.v8i8.p0v8i8")]
+ fn vld3_s8_(ptr: *const int8x8_t) -> int8x8x3_t;
+ }
+vld3_s8_(a as _)
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld3))]
+pub unsafe fn vld3_s16(a: *const i16) -> int16x4x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld3.v4i16.p0i8")]
+ fn vld3_s16_(ptr: *const i8, size: i32) -> int16x4x3_t;
+ }
+vld3_s16_(a as *const i8, 2)
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld3))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3_s16(a: *const i16) -> int16x4x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld3.v4i16.p0v4i16")]
+ fn vld3_s16_(ptr: *const int16x4_t) -> int16x4x3_t;
+ }
+vld3_s16_(a as _)
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld3))]
+pub unsafe fn vld3_s32(a: *const i32) -> int32x2x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld3.v2i32.p0i8")]
+ fn vld3_s32_(ptr: *const i8, size: i32) -> int32x2x3_t;
+ }
+vld3_s32_(a as *const i8, 4)
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld3))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3_s32(a: *const i32) -> int32x2x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld3.v2i32.p0v2i32")]
+ fn vld3_s32_(ptr: *const int32x2_t) -> int32x2x3_t;
+ }
+vld3_s32_(a as _)
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld3))]
+pub unsafe fn vld3q_s8(a: *const i8) -> int8x16x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld3.v16i8.p0i8")]
+ fn vld3q_s8_(ptr: *const i8, size: i32) -> int8x16x3_t;
+ }
+vld3q_s8_(a as *const i8, 1)
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld3))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3q_s8(a: *const i8) -> int8x16x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld3.v16i8.p0v16i8")]
+ fn vld3q_s8_(ptr: *const int8x16_t) -> int8x16x3_t;
+ }
+vld3q_s8_(a as _)
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld3))]
+pub unsafe fn vld3q_s16(a: *const i16) -> int16x8x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld3.v8i16.p0i8")]
+ fn vld3q_s16_(ptr: *const i8, size: i32) -> int16x8x3_t;
+ }
+vld3q_s16_(a as *const i8, 2)
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld3))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3q_s16(a: *const i16) -> int16x8x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld3.v8i16.p0v8i16")]
+ fn vld3q_s16_(ptr: *const int16x8_t) -> int16x8x3_t;
+ }
+vld3q_s16_(a as _)
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld3))]
+pub unsafe fn vld3q_s32(a: *const i32) -> int32x4x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld3.v4i32.p0i8")]
+ fn vld3q_s32_(ptr: *const i8, size: i32) -> int32x4x3_t;
+ }
+vld3q_s32_(a as *const i8, 4)
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld3))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3q_s32(a: *const i32) -> int32x4x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld3.v4i32.p0v4i32")]
+ fn vld3q_s32_(ptr: *const int32x4_t) -> int32x4x3_t;
+ }
+vld3q_s32_(a as _)
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(nop))]
+pub unsafe fn vld3_s64(a: *const i64) -> int64x1x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld3.v1i64.p0i8")]
+ fn vld3_s64_(ptr: *const i8, size: i32) -> int64x1x3_t;
+ }
+vld3_s64_(a as *const i8, 8)
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3_s64(a: *const i64) -> int64x1x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld3.v1i64.p0v1i64")]
+ fn vld3_s64_(ptr: *const int64x1_t) -> int64x1x3_t;
+ }
+vld3_s64_(a as _)
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld3))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld3))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld3_u8(a: *const u8) -> uint8x8x3_t {
+ transmute(vld3_s8(transmute(a)))
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld3))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld3))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld3_u16(a: *const u16) -> uint16x4x3_t {
+ transmute(vld3_s16(transmute(a)))
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld3))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld3))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld3_u32(a: *const u32) -> uint32x2x3_t {
+ transmute(vld3_s32(transmute(a)))
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld3))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld3))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld3q_u8(a: *const u8) -> uint8x16x3_t {
+ transmute(vld3q_s8(transmute(a)))
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld3))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld3))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld3q_u16(a: *const u16) -> uint16x8x3_t {
+ transmute(vld3q_s16(transmute(a)))
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld3))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld3))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld3q_u32(a: *const u32) -> uint32x4x3_t {
+ transmute(vld3q_s32(transmute(a)))
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld3))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld3))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld3_p8(a: *const p8) -> poly8x8x3_t {
+ transmute(vld3_s8(transmute(a)))
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld3))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld3))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld3_p16(a: *const p16) -> poly16x4x3_t {
+ transmute(vld3_s16(transmute(a)))
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld3))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld3))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld3q_p8(a: *const p8) -> poly8x16x3_t {
+ transmute(vld3q_s8(transmute(a)))
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld3))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld3))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld3q_p16(a: *const p16) -> poly16x8x3_t {
+ transmute(vld3q_s16(transmute(a)))
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld3_u64(a: *const u64) -> uint64x1x3_t {
+ transmute(vld3_s64(transmute(a)))
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld3_p64(a: *const p64) -> poly64x1x3_t {
+ transmute(vld3_s64(transmute(a)))
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld3))]
+pub unsafe fn vld3_f32(a: *const f32) -> float32x2x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld3.v2f32.p0i8")]
+ fn vld3_f32_(ptr: *const i8, size: i32) -> float32x2x3_t;
+ }
+vld3_f32_(a as *const i8, 4)
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld3))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3_f32(a: *const f32) -> float32x2x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld3.v2f32.p0v2f32")]
+ fn vld3_f32_(ptr: *const float32x2_t) -> float32x2x3_t;
+ }
+vld3_f32_(a as _)
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld3))]
+pub unsafe fn vld3q_f32(a: *const f32) -> float32x4x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld3.v4f32.p0i8")]
+ fn vld3q_f32_(ptr: *const i8, size: i32) -> float32x4x3_t;
+ }
+vld3q_f32_(a as *const i8, 4)
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld3))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3q_f32(a: *const f32) -> float32x4x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld3.v4f32.p0v4f32")]
+ fn vld3q_f32_(ptr: *const float32x4_t) -> float32x4x3_t;
+ }
+vld3q_f32_(a as _)
+}
+
+/// Load single 3-element structure and replicate to all lanes of three registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld3))]
+pub unsafe fn vld3_dup_s8(a: *const i8) -> int8x8x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld3dup.v8i8.p0i8")]
+ fn vld3_dup_s8_(ptr: *const i8, size: i32) -> int8x8x3_t;
+ }
+vld3_dup_s8_(a as *const i8, 1)
+}
+
+/// Load single 3-element structure and replicate to all lanes of three registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld3r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3_dup_s8(a: *const i8) -> int8x8x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld3r.v8i8.p0i8")]
+ fn vld3_dup_s8_(ptr: *const i8) -> int8x8x3_t;
+ }
+vld3_dup_s8_(a as _)
+}
+
+/// Load single 3-element structure and replicate to all lanes of three registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld3))]
+pub unsafe fn vld3_dup_s16(a: *const i16) -> int16x4x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld3dup.v4i16.p0i8")]
+ fn vld3_dup_s16_(ptr: *const i8, size: i32) -> int16x4x3_t;
+ }
+vld3_dup_s16_(a as *const i8, 2)
+}
+
+/// Load single 3-element structure and replicate to all lanes of three registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld3r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3_dup_s16(a: *const i16) -> int16x4x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld3r.v4i16.p0i16")]
+ fn vld3_dup_s16_(ptr: *const i16) -> int16x4x3_t;
+ }
+vld3_dup_s16_(a as _)
+}
+
+/// Load single 3-element structure and replicate to all lanes of three registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld3))]
+pub unsafe fn vld3_dup_s32(a: *const i32) -> int32x2x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld3dup.v2i32.p0i8")]
+ fn vld3_dup_s32_(ptr: *const i8, size: i32) -> int32x2x3_t;
+ }
+vld3_dup_s32_(a as *const i8, 4)
+}
+
+/// Load single 3-element structure and replicate to all lanes of three registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld3r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3_dup_s32(a: *const i32) -> int32x2x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld3r.v2i32.p0i32")]
+ fn vld3_dup_s32_(ptr: *const i32) -> int32x2x3_t;
+ }
+vld3_dup_s32_(a as _)
+}
+
+/// Load single 3-element structure and replicate to all lanes of three registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld3))]
+pub unsafe fn vld3q_dup_s8(a: *const i8) -> int8x16x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld3dup.v16i8.p0i8")]
+ fn vld3q_dup_s8_(ptr: *const i8, size: i32) -> int8x16x3_t;
+ }
+vld3q_dup_s8_(a as *const i8, 1)
+}
+
+/// Load single 3-element structure and replicate to all lanes of three registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld3r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3q_dup_s8(a: *const i8) -> int8x16x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld3r.v16i8.p0i8")]
+ fn vld3q_dup_s8_(ptr: *const i8) -> int8x16x3_t;
+ }
+vld3q_dup_s8_(a as _)
+}
+
+/// Load single 3-element structure and replicate to all lanes of three registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld3))]
+pub unsafe fn vld3q_dup_s16(a: *const i16) -> int16x8x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld3dup.v8i16.p0i8")]
+ fn vld3q_dup_s16_(ptr: *const i8, size: i32) -> int16x8x3_t;
+ }
+vld3q_dup_s16_(a as *const i8, 2)
+}
+
+/// Load single 3-element structure and replicate to all lanes of three registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld3r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3q_dup_s16(a: *const i16) -> int16x8x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld3r.v8i16.p0i16")]
+ fn vld3q_dup_s16_(ptr: *const i16) -> int16x8x3_t;
+ }
+vld3q_dup_s16_(a as _)
+}
+
+/// Load single 3-element structure and replicate to all lanes of three registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld3))]
+pub unsafe fn vld3q_dup_s32(a: *const i32) -> int32x4x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld3dup.v4i32.p0i8")]
+ fn vld3q_dup_s32_(ptr: *const i8, size: i32) -> int32x4x3_t;
+ }
+vld3q_dup_s32_(a as *const i8, 4)
+}
+
+/// Load single 3-element structure and replicate to all lanes of three registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld3r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3q_dup_s32(a: *const i32) -> int32x4x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld3r.v4i32.p0i32")]
+ fn vld3q_dup_s32_(ptr: *const i32) -> int32x4x3_t;
+ }
+vld3q_dup_s32_(a as _)
+}
+
+/// Load single 3-element structure and replicate to all lanes of three registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(nop))]
+pub unsafe fn vld3_dup_s64(a: *const i64) -> int64x1x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld3dup.v1i64.p0i8")]
+ fn vld3_dup_s64_(ptr: *const i8, size: i32) -> int64x1x3_t;
+ }
+vld3_dup_s64_(a as *const i8, 8)
+}
+
+/// Load single 3-element structure and replicate to all lanes of three registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld3r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3_dup_s64(a: *const i64) -> int64x1x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld3r.v1i64.p0i64")]
+ fn vld3_dup_s64_(ptr: *const i64) -> int64x1x3_t;
+ }
+vld3_dup_s64_(a as _)
+}
+
+/// Load single 3-element structure and replicate to all lanes of three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld3))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld3r))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld3_dup_u8(a: *const u8) -> uint8x8x3_t {
+ transmute(vld3_dup_s8(transmute(a)))
+}
+
+/// Load single 3-element structure and replicate to all lanes of three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld3))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld3r))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld3_dup_u16(a: *const u16) -> uint16x4x3_t {
+ transmute(vld3_dup_s16(transmute(a)))
+}
+
+/// Load single 3-element structure and replicate to all lanes of three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld3))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld3r))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld3_dup_u32(a: *const u32) -> uint32x2x3_t {
+ transmute(vld3_dup_s32(transmute(a)))
+}
+
+/// Load single 3-element structure and replicate to all lanes of three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld3))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld3r))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld3q_dup_u8(a: *const u8) -> uint8x16x3_t {
+ transmute(vld3q_dup_s8(transmute(a)))
+}
+
+/// Load single 3-element structure and replicate to all lanes of three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld3))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld3r))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld3q_dup_u16(a: *const u16) -> uint16x8x3_t {
+ transmute(vld3q_dup_s16(transmute(a)))
+}
+
+/// Load single 3-element structure and replicate to all lanes of three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld3))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld3r))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld3q_dup_u32(a: *const u32) -> uint32x4x3_t {
+ transmute(vld3q_dup_s32(transmute(a)))
+}
+
+/// Load single 3-element structure and replicate to all lanes of three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld3))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld3r))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld3_dup_p8(a: *const p8) -> poly8x8x3_t {
+ transmute(vld3_dup_s8(transmute(a)))
+}
+
+/// Load single 3-element structure and replicate to all lanes of three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld3))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld3r))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld3_dup_p16(a: *const p16) -> poly16x4x3_t {
+ transmute(vld3_dup_s16(transmute(a)))
+}
+
+/// Load single 3-element structure and replicate to all lanes of three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld3))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld3r))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld3q_dup_p8(a: *const p8) -> poly8x16x3_t {
+ transmute(vld3q_dup_s8(transmute(a)))
+}
+
+/// Load single 3-element structure and replicate to all lanes of three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld3))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld3r))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld3q_dup_p16(a: *const p16) -> poly16x8x3_t {
+ transmute(vld3q_dup_s16(transmute(a)))
+}
+
+/// Load single 3-element structure and replicate to all lanes of three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld3r))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld3_dup_u64(a: *const u64) -> uint64x1x3_t {
+ transmute(vld3_dup_s64(transmute(a)))
+}
+
+/// Load single 3-element structure and replicate to all lanes of three registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld3r))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld3_dup_p64(a: *const p64) -> poly64x1x3_t {
+ transmute(vld3_dup_s64(transmute(a)))
+}
+
+/// Load single 3-element structure and replicate to all lanes of three registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld3))]
+pub unsafe fn vld3_dup_f32(a: *const f32) -> float32x2x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld3dup.v2f32.p0i8")]
+ fn vld3_dup_f32_(ptr: *const i8, size: i32) -> float32x2x3_t;
+ }
+vld3_dup_f32_(a as *const i8, 4)
+}
+
+/// Load single 3-element structure and replicate to all lanes of three registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld3r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3_dup_f32(a: *const f32) -> float32x2x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld3r.v2f32.p0f32")]
+ fn vld3_dup_f32_(ptr: *const f32) -> float32x2x3_t;
+ }
+vld3_dup_f32_(a as _)
+}
+
+/// Load single 3-element structure and replicate to all lanes of three registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld3))]
+pub unsafe fn vld3q_dup_f32(a: *const f32) -> float32x4x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld3dup.v4f32.p0i8")]
+ fn vld3q_dup_f32_(ptr: *const i8, size: i32) -> float32x4x3_t;
+ }
+vld3q_dup_f32_(a as *const i8, 4)
+}
+
+/// Load single 3-element structure and replicate to all lanes of three registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld3r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3q_dup_f32(a: *const f32) -> float32x4x3_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld3r.v4f32.p0f32")]
+ fn vld3q_dup_f32_(ptr: *const f32) -> float32x4x3_t;
+ }
+vld3q_dup_f32_(a as _)
+}
+
+/// Load multiple 3-element structures to two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vld3_lane_s8<const LANE: i32>(a: *const i8, b: int8x8x3_t) -> int8x8x3_t {
+ static_assert_imm3!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld3lane.v8i8.p0i8")]
+ fn vld3_lane_s8_(ptr: *const i8, a: int8x8_t, b: int8x8_t, c: int8x8_t, n: i32, size: i32) -> int8x8x3_t;
+ }
+vld3_lane_s8_(a as _, b.0, b.1, b.2, LANE, 1)
+}
+
+/// Load multiple 3-element structures to two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3_lane_s8<const LANE: i32>(a: *const i8, b: int8x8x3_t) -> int8x8x3_t {
+ static_assert_imm3!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld3lane.v8i8.p0i8")]
+ fn vld3_lane_s8_(a: int8x8_t, b: int8x8_t, c: int8x8_t, n: i64, ptr: *const i8) -> int8x8x3_t;
+ }
+vld3_lane_s8_(b.0, b.1, b.2, LANE as i64, a as _)
+}
+
+/// Load multiple 3-element structures to two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vld3_lane_s16<const LANE: i32>(a: *const i16, b: int16x4x3_t) -> int16x4x3_t {
+ static_assert_imm2!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld3lane.v4i16.p0i8")]
+ fn vld3_lane_s16_(ptr: *const i8, a: int16x4_t, b: int16x4_t, c: int16x4_t, n: i32, size: i32) -> int16x4x3_t;
+ }
+vld3_lane_s16_(a as _, b.0, b.1, b.2, LANE, 2)
+}
+
+/// Load multiple 3-element structures to two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3_lane_s16<const LANE: i32>(a: *const i16, b: int16x4x3_t) -> int16x4x3_t {
+ static_assert_imm2!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld3lane.v4i16.p0i8")]
+ fn vld3_lane_s16_(a: int16x4_t, b: int16x4_t, c: int16x4_t, n: i64, ptr: *const i8) -> int16x4x3_t;
+ }
+vld3_lane_s16_(b.0, b.1, b.2, LANE as i64, a as _)
+}
+
+/// Load multiple 3-element structures to two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vld3_lane_s32<const LANE: i32>(a: *const i32, b: int32x2x3_t) -> int32x2x3_t {
+ static_assert_imm1!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld3lane.v2i32.p0i8")]
+ fn vld3_lane_s32_(ptr: *const i8, a: int32x2_t, b: int32x2_t, c: int32x2_t, n: i32, size: i32) -> int32x2x3_t;
+ }
+vld3_lane_s32_(a as _, b.0, b.1, b.2, LANE, 4)
+}
+
+/// Load multiple 3-element structures to two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3_lane_s32<const LANE: i32>(a: *const i32, b: int32x2x3_t) -> int32x2x3_t {
+ static_assert_imm1!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld3lane.v2i32.p0i8")]
+ fn vld3_lane_s32_(a: int32x2_t, b: int32x2_t, c: int32x2_t, n: i64, ptr: *const i8) -> int32x2x3_t;
+ }
+vld3_lane_s32_(b.0, b.1, b.2, LANE as i64, a as _)
+}
+
+/// Load multiple 3-element structures to two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vld3q_lane_s16<const LANE: i32>(a: *const i16, b: int16x8x3_t) -> int16x8x3_t {
+ static_assert_imm3!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld3lane.v8i16.p0i8")]
+ fn vld3q_lane_s16_(ptr: *const i8, a: int16x8_t, b: int16x8_t, c: int16x8_t, n: i32, size: i32) -> int16x8x3_t;
+ }
+vld3q_lane_s16_(a as _, b.0, b.1, b.2, LANE, 2)
+}
+
+/// Load multiple 3-element structures to two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3q_lane_s16<const LANE: i32>(a: *const i16, b: int16x8x3_t) -> int16x8x3_t {
+ static_assert_imm3!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld3lane.v8i16.p0i8")]
+ fn vld3q_lane_s16_(a: int16x8_t, b: int16x8_t, c: int16x8_t, n: i64, ptr: *const i8) -> int16x8x3_t;
+ }
+vld3q_lane_s16_(b.0, b.1, b.2, LANE as i64, a as _)
+}
+
+/// Load multiple 3-element structures to two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vld3q_lane_s32<const LANE: i32>(a: *const i32, b: int32x4x3_t) -> int32x4x3_t {
+ static_assert_imm2!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld3lane.v4i32.p0i8")]
+ fn vld3q_lane_s32_(ptr: *const i8, a: int32x4_t, b: int32x4_t, c: int32x4_t, n: i32, size: i32) -> int32x4x3_t;
+ }
+vld3q_lane_s32_(a as _, b.0, b.1, b.2, LANE, 4)
+}
+
+/// Load multiple 3-element structures to two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3q_lane_s32<const LANE: i32>(a: *const i32, b: int32x4x3_t) -> int32x4x3_t {
+ static_assert_imm2!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld3lane.v4i32.p0i8")]
+ fn vld3q_lane_s32_(a: int32x4_t, b: int32x4_t, c: int32x4_t, n: i64, ptr: *const i8) -> int32x4x3_t;
+ }
+vld3q_lane_s32_(b.0, b.1, b.2, LANE as i64, a as _)
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld3, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld3_lane_u8<const LANE: i32>(a: *const u8, b: uint8x8x3_t) -> uint8x8x3_t {
+ static_assert_imm3!(LANE);
+ transmute(vld3_lane_s8::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld3, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld3_lane_u16<const LANE: i32>(a: *const u16, b: uint16x4x3_t) -> uint16x4x3_t {
+ static_assert_imm2!(LANE);
+ transmute(vld3_lane_s16::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld3, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld3_lane_u32<const LANE: i32>(a: *const u32, b: uint32x2x3_t) -> uint32x2x3_t {
+ static_assert_imm1!(LANE);
+ transmute(vld3_lane_s32::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld3, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld3q_lane_u16<const LANE: i32>(a: *const u16, b: uint16x8x3_t) -> uint16x8x3_t {
+ static_assert_imm3!(LANE);
+ transmute(vld3q_lane_s16::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld3, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld3q_lane_u32<const LANE: i32>(a: *const u32, b: uint32x4x3_t) -> uint32x4x3_t {
+ static_assert_imm2!(LANE);
+ transmute(vld3q_lane_s32::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld3, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld3_lane_p8<const LANE: i32>(a: *const p8, b: poly8x8x3_t) -> poly8x8x3_t {
+ static_assert_imm3!(LANE);
+ transmute(vld3_lane_s8::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld3, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld3_lane_p16<const LANE: i32>(a: *const p16, b: poly16x4x3_t) -> poly16x4x3_t {
+ static_assert_imm2!(LANE);
+ transmute(vld3_lane_s16::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld3, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld3q_lane_p16<const LANE: i32>(a: *const p16, b: poly16x8x3_t) -> poly16x8x3_t {
+ static_assert_imm3!(LANE);
+ transmute(vld3q_lane_s16::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vld3_lane_f32<const LANE: i32>(a: *const f32, b: float32x2x3_t) -> float32x2x3_t {
+ static_assert_imm1!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld3lane.v2f32.p0i8")]
+ fn vld3_lane_f32_(ptr: *const i8, a: float32x2_t, b: float32x2_t, c: float32x2_t, n: i32, size: i32) -> float32x2x3_t;
+ }
+vld3_lane_f32_(a as _, b.0, b.1, b.2, LANE, 4)
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3_lane_f32<const LANE: i32>(a: *const f32, b: float32x2x3_t) -> float32x2x3_t {
+ static_assert_imm1!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld3lane.v2f32.p0i8")]
+ fn vld3_lane_f32_(a: float32x2_t, b: float32x2_t, c: float32x2_t, n: i64, ptr: *const i8) -> float32x2x3_t;
+ }
+vld3_lane_f32_(b.0, b.1, b.2, LANE as i64, a as _)
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vld3q_lane_f32<const LANE: i32>(a: *const f32, b: float32x4x3_t) -> float32x4x3_t {
+ static_assert_imm2!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld3lane.v4f32.p0i8")]
+ fn vld3q_lane_f32_(ptr: *const i8, a: float32x4_t, b: float32x4_t, c: float32x4_t, n: i32, size: i32) -> float32x4x3_t;
+ }
+vld3q_lane_f32_(a as _, b.0, b.1, b.2, LANE, 4)
+}
+
+/// Load multiple 3-element structures to three registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld3q_lane_f32<const LANE: i32>(a: *const f32, b: float32x4x3_t) -> float32x4x3_t {
+ static_assert_imm2!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld3lane.v4f32.p0i8")]
+ fn vld3q_lane_f32_(a: float32x4_t, b: float32x4_t, c: float32x4_t, n: i64, ptr: *const i8) -> float32x4x3_t;
+ }
+vld3q_lane_f32_(b.0, b.1, b.2, LANE as i64, a as _)
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld4))]
+pub unsafe fn vld4_s8(a: *const i8) -> int8x8x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld4.v8i8.p0i8")]
+ fn vld4_s8_(ptr: *const i8, size: i32) -> int8x8x4_t;
+ }
+vld4_s8_(a as *const i8, 1)
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld4))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4_s8(a: *const i8) -> int8x8x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld4.v8i8.p0v8i8")]
+ fn vld4_s8_(ptr: *const int8x8_t) -> int8x8x4_t;
+ }
+vld4_s8_(a as _)
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld4))]
+pub unsafe fn vld4_s16(a: *const i16) -> int16x4x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld4.v4i16.p0i8")]
+ fn vld4_s16_(ptr: *const i8, size: i32) -> int16x4x4_t;
+ }
+vld4_s16_(a as *const i8, 2)
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld4))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4_s16(a: *const i16) -> int16x4x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld4.v4i16.p0v4i16")]
+ fn vld4_s16_(ptr: *const int16x4_t) -> int16x4x4_t;
+ }
+vld4_s16_(a as _)
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld4))]
+pub unsafe fn vld4_s32(a: *const i32) -> int32x2x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld4.v2i32.p0i8")]
+ fn vld4_s32_(ptr: *const i8, size: i32) -> int32x2x4_t;
+ }
+vld4_s32_(a as *const i8, 4)
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld4))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4_s32(a: *const i32) -> int32x2x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld4.v2i32.p0v2i32")]
+ fn vld4_s32_(ptr: *const int32x2_t) -> int32x2x4_t;
+ }
+vld4_s32_(a as _)
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld4))]
+pub unsafe fn vld4q_s8(a: *const i8) -> int8x16x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld4.v16i8.p0i8")]
+ fn vld4q_s8_(ptr: *const i8, size: i32) -> int8x16x4_t;
+ }
+vld4q_s8_(a as *const i8, 1)
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld4))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4q_s8(a: *const i8) -> int8x16x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld4.v16i8.p0v16i8")]
+ fn vld4q_s8_(ptr: *const int8x16_t) -> int8x16x4_t;
+ }
+vld4q_s8_(a as _)
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld4))]
+pub unsafe fn vld4q_s16(a: *const i16) -> int16x8x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld4.v8i16.p0i8")]
+ fn vld4q_s16_(ptr: *const i8, size: i32) -> int16x8x4_t;
+ }
+vld4q_s16_(a as *const i8, 2)
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld4))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4q_s16(a: *const i16) -> int16x8x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld4.v8i16.p0v8i16")]
+ fn vld4q_s16_(ptr: *const int16x8_t) -> int16x8x4_t;
+ }
+vld4q_s16_(a as _)
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld4))]
+pub unsafe fn vld4q_s32(a: *const i32) -> int32x4x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld4.v4i32.p0i8")]
+ fn vld4q_s32_(ptr: *const i8, size: i32) -> int32x4x4_t;
+ }
+vld4q_s32_(a as *const i8, 4)
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld4))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4q_s32(a: *const i32) -> int32x4x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld4.v4i32.p0v4i32")]
+ fn vld4q_s32_(ptr: *const int32x4_t) -> int32x4x4_t;
+ }
+vld4q_s32_(a as _)
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(nop))]
+pub unsafe fn vld4_s64(a: *const i64) -> int64x1x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld4.v1i64.p0i8")]
+ fn vld4_s64_(ptr: *const i8, size: i32) -> int64x1x4_t;
+ }
+vld4_s64_(a as *const i8, 8)
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4_s64(a: *const i64) -> int64x1x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld4.v1i64.p0v1i64")]
+ fn vld4_s64_(ptr: *const int64x1_t) -> int64x1x4_t;
+ }
+vld4_s64_(a as _)
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld4))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld4_u8(a: *const u8) -> uint8x8x4_t {
+ transmute(vld4_s8(transmute(a)))
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld4))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld4_u16(a: *const u16) -> uint16x4x4_t {
+ transmute(vld4_s16(transmute(a)))
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld4))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld4_u32(a: *const u32) -> uint32x2x4_t {
+ transmute(vld4_s32(transmute(a)))
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld4))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld4q_u8(a: *const u8) -> uint8x16x4_t {
+ transmute(vld4q_s8(transmute(a)))
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld4))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld4q_u16(a: *const u16) -> uint16x8x4_t {
+ transmute(vld4q_s16(transmute(a)))
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld4))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld4q_u32(a: *const u32) -> uint32x4x4_t {
+ transmute(vld4q_s32(transmute(a)))
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld4))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld4_p8(a: *const p8) -> poly8x8x4_t {
+ transmute(vld4_s8(transmute(a)))
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld4))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld4_p16(a: *const p16) -> poly16x4x4_t {
+ transmute(vld4_s16(transmute(a)))
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld4))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld4q_p8(a: *const p8) -> poly8x16x4_t {
+ transmute(vld4q_s8(transmute(a)))
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld4))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld4q_p16(a: *const p16) -> poly16x8x4_t {
+ transmute(vld4q_s16(transmute(a)))
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld4_u64(a: *const u64) -> uint64x1x4_t {
+ transmute(vld4_s64(transmute(a)))
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld4_p64(a: *const p64) -> poly64x1x4_t {
+ transmute(vld4_s64(transmute(a)))
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld4))]
+pub unsafe fn vld4_f32(a: *const f32) -> float32x2x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld4.v2f32.p0i8")]
+ fn vld4_f32_(ptr: *const i8, size: i32) -> float32x2x4_t;
+ }
+vld4_f32_(a as *const i8, 4)
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld4))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4_f32(a: *const f32) -> float32x2x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld4.v2f32.p0v2f32")]
+ fn vld4_f32_(ptr: *const float32x2_t) -> float32x2x4_t;
+ }
+vld4_f32_(a as _)
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld4))]
+pub unsafe fn vld4q_f32(a: *const f32) -> float32x4x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld4.v4f32.p0i8")]
+ fn vld4q_f32_(ptr: *const i8, size: i32) -> float32x4x4_t;
+ }
+vld4q_f32_(a as *const i8, 4)
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld4))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4q_f32(a: *const f32) -> float32x4x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld4.v4f32.p0v4f32")]
+ fn vld4q_f32_(ptr: *const float32x4_t) -> float32x4x4_t;
+ }
+vld4q_f32_(a as _)
+}
+
+/// Load single 4-element structure and replicate to all lanes of four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld4))]
+pub unsafe fn vld4_dup_s8(a: *const i8) -> int8x8x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld4dup.v8i8.p0i8")]
+ fn vld4_dup_s8_(ptr: *const i8, size: i32) -> int8x8x4_t;
+ }
+vld4_dup_s8_(a as *const i8, 1)
+}
+
+/// Load single 4-element structure and replicate to all lanes of four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld4r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4_dup_s8(a: *const i8) -> int8x8x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld4r.v8i8.p0i8")]
+ fn vld4_dup_s8_(ptr: *const i8) -> int8x8x4_t;
+ }
+vld4_dup_s8_(a as _)
+}
+
+/// Load single 4-element structure and replicate to all lanes of four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld4))]
+pub unsafe fn vld4_dup_s16(a: *const i16) -> int16x4x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld4dup.v4i16.p0i8")]
+ fn vld4_dup_s16_(ptr: *const i8, size: i32) -> int16x4x4_t;
+ }
+vld4_dup_s16_(a as *const i8, 2)
+}
+
+/// Load single 4-element structure and replicate to all lanes of four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld4r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4_dup_s16(a: *const i16) -> int16x4x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld4r.v4i16.p0i16")]
+ fn vld4_dup_s16_(ptr: *const i16) -> int16x4x4_t;
+ }
+vld4_dup_s16_(a as _)
+}
+
+/// Load single 4-element structure and replicate to all lanes of four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld4))]
+pub unsafe fn vld4_dup_s32(a: *const i32) -> int32x2x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld4dup.v2i32.p0i8")]
+ fn vld4_dup_s32_(ptr: *const i8, size: i32) -> int32x2x4_t;
+ }
+vld4_dup_s32_(a as *const i8, 4)
+}
+
+/// Load single 4-element structure and replicate to all lanes of four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld4r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4_dup_s32(a: *const i32) -> int32x2x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld4r.v2i32.p0i32")]
+ fn vld4_dup_s32_(ptr: *const i32) -> int32x2x4_t;
+ }
+vld4_dup_s32_(a as _)
+}
+
+/// Load single 4-element structure and replicate to all lanes of four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld4))]
+pub unsafe fn vld4q_dup_s8(a: *const i8) -> int8x16x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld4dup.v16i8.p0i8")]
+ fn vld4q_dup_s8_(ptr: *const i8, size: i32) -> int8x16x4_t;
+ }
+vld4q_dup_s8_(a as *const i8, 1)
+}
+
+/// Load single 4-element structure and replicate to all lanes of four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld4r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4q_dup_s8(a: *const i8) -> int8x16x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld4r.v16i8.p0i8")]
+ fn vld4q_dup_s8_(ptr: *const i8) -> int8x16x4_t;
+ }
+vld4q_dup_s8_(a as _)
+}
+
+/// Load single 4-element structure and replicate to all lanes of four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld4))]
+pub unsafe fn vld4q_dup_s16(a: *const i16) -> int16x8x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld4dup.v8i16.p0i8")]
+ fn vld4q_dup_s16_(ptr: *const i8, size: i32) -> int16x8x4_t;
+ }
+vld4q_dup_s16_(a as *const i8, 2)
+}
+
+/// Load single 4-element structure and replicate to all lanes of four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld4r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4q_dup_s16(a: *const i16) -> int16x8x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld4r.v8i16.p0i16")]
+ fn vld4q_dup_s16_(ptr: *const i16) -> int16x8x4_t;
+ }
+vld4q_dup_s16_(a as _)
+}
+
+/// Load single 4-element structure and replicate to all lanes of four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld4))]
+pub unsafe fn vld4q_dup_s32(a: *const i32) -> int32x4x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld4dup.v4i32.p0i8")]
+ fn vld4q_dup_s32_(ptr: *const i8, size: i32) -> int32x4x4_t;
+ }
+vld4q_dup_s32_(a as *const i8, 4)
+}
+
+/// Load single 4-element structure and replicate to all lanes of four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld4r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4q_dup_s32(a: *const i32) -> int32x4x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld4r.v4i32.p0i32")]
+ fn vld4q_dup_s32_(ptr: *const i32) -> int32x4x4_t;
+ }
+vld4q_dup_s32_(a as _)
+}
+
+/// Load single 4-element structure and replicate to all lanes of four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(nop))]
+pub unsafe fn vld4_dup_s64(a: *const i64) -> int64x1x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld4dup.v1i64.p0i8")]
+ fn vld4_dup_s64_(ptr: *const i8, size: i32) -> int64x1x4_t;
+ }
+vld4_dup_s64_(a as *const i8, 8)
+}
+
+/// Load single 4-element structure and replicate to all lanes of four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld4r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4_dup_s64(a: *const i64) -> int64x1x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld4r.v1i64.p0i64")]
+ fn vld4_dup_s64_(ptr: *const i64) -> int64x1x4_t;
+ }
+vld4_dup_s64_(a as _)
+}
+
+/// Load single 4-element structure and replicate to all lanes of four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld4r))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld4_dup_u8(a: *const u8) -> uint8x8x4_t {
+ transmute(vld4_dup_s8(transmute(a)))
+}
+
+/// Load single 4-element structure and replicate to all lanes of four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld4r))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld4_dup_u16(a: *const u16) -> uint16x4x4_t {
+ transmute(vld4_dup_s16(transmute(a)))
+}
+
+/// Load single 4-element structure and replicate to all lanes of four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld4r))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld4_dup_u32(a: *const u32) -> uint32x2x4_t {
+ transmute(vld4_dup_s32(transmute(a)))
+}
+
+/// Load single 4-element structure and replicate to all lanes of four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld4r))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld4q_dup_u8(a: *const u8) -> uint8x16x4_t {
+ transmute(vld4q_dup_s8(transmute(a)))
+}
+
+/// Load single 4-element structure and replicate to all lanes of four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld4r))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld4q_dup_u16(a: *const u16) -> uint16x8x4_t {
+ transmute(vld4q_dup_s16(transmute(a)))
+}
+
+/// Load single 4-element structure and replicate to all lanes of four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld4r))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld4q_dup_u32(a: *const u32) -> uint32x4x4_t {
+ transmute(vld4q_dup_s32(transmute(a)))
+}
+
+/// Load single 4-element structure and replicate to all lanes of four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld4r))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld4_dup_p8(a: *const p8) -> poly8x8x4_t {
+ transmute(vld4_dup_s8(transmute(a)))
+}
+
+/// Load single 4-element structure and replicate to all lanes of four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld4r))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld4_dup_p16(a: *const p16) -> poly16x4x4_t {
+ transmute(vld4_dup_s16(transmute(a)))
+}
+
+/// Load single 4-element structure and replicate to all lanes of four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld4r))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld4q_dup_p8(a: *const p8) -> poly8x16x4_t {
+ transmute(vld4q_dup_s8(transmute(a)))
+}
+
+/// Load single 4-element structure and replicate to all lanes of four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld4r))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld4q_dup_p16(a: *const p16) -> poly16x8x4_t {
+ transmute(vld4q_dup_s16(transmute(a)))
+}
+
+/// Load single 4-element structure and replicate to all lanes of four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld4r))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld4_dup_u64(a: *const u64) -> uint64x1x4_t {
+ transmute(vld4_dup_s64(transmute(a)))
+}
+
+/// Load single 4-element structure and replicate to all lanes of four registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld4r))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld4_dup_p64(a: *const p64) -> poly64x1x4_t {
+ transmute(vld4_dup_s64(transmute(a)))
+}
+
+/// Load single 4-element structure and replicate to all lanes of four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld4))]
+pub unsafe fn vld4_dup_f32(a: *const f32) -> float32x2x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld4dup.v2f32.p0i8")]
+ fn vld4_dup_f32_(ptr: *const i8, size: i32) -> float32x2x4_t;
+ }
+vld4_dup_f32_(a as *const i8, 4)
+}
+
+/// Load single 4-element structure and replicate to all lanes of four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld4r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4_dup_f32(a: *const f32) -> float32x2x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld4r.v2f32.p0f32")]
+ fn vld4_dup_f32_(ptr: *const f32) -> float32x2x4_t;
+ }
+vld4_dup_f32_(a as _)
+}
+
+/// Load single 4-element structure and replicate to all lanes of four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld4))]
+pub unsafe fn vld4q_dup_f32(a: *const f32) -> float32x4x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld4dup.v4f32.p0i8")]
+ fn vld4q_dup_f32_(ptr: *const i8, size: i32) -> float32x4x4_t;
+ }
+vld4q_dup_f32_(a as *const i8, 4)
+}
+
+/// Load single 4-element structure and replicate to all lanes of four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld4r))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4q_dup_f32(a: *const f32) -> float32x4x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld4r.v4f32.p0f32")]
+ fn vld4q_dup_f32_(ptr: *const f32) -> float32x4x4_t;
+ }
+vld4q_dup_f32_(a as _)
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vld4_lane_s8<const LANE: i32>(a: *const i8, b: int8x8x4_t) -> int8x8x4_t {
+ static_assert_imm3!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld4lane.v8i8.p0i8")]
+ fn vld4_lane_s8_(ptr: *const i8, a: int8x8_t, b: int8x8_t, c: int8x8_t, d: int8x8_t, n: i32, size: i32) -> int8x8x4_t;
+ }
+vld4_lane_s8_(a as _, b.0, b.1, b.2, b.3, LANE, 1)
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4_lane_s8<const LANE: i32>(a: *const i8, b: int8x8x4_t) -> int8x8x4_t {
+ static_assert_imm3!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld4lane.v8i8.p0i8")]
+ fn vld4_lane_s8_(a: int8x8_t, b: int8x8_t, c: int8x8_t, d: int8x8_t, n: i64, ptr: *const i8) -> int8x8x4_t;
+ }
+vld4_lane_s8_(b.0, b.1, b.2, b.3, LANE as i64, a as _)
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vld4_lane_s16<const LANE: i32>(a: *const i16, b: int16x4x4_t) -> int16x4x4_t {
+ static_assert_imm2!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld4lane.v4i16.p0i8")]
+ fn vld4_lane_s16_(ptr: *const i8, a: int16x4_t, b: int16x4_t, c: int16x4_t, d: int16x4_t, n: i32, size: i32) -> int16x4x4_t;
+ }
+vld4_lane_s16_(a as _, b.0, b.1, b.2, b.3, LANE, 2)
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4_lane_s16<const LANE: i32>(a: *const i16, b: int16x4x4_t) -> int16x4x4_t {
+ static_assert_imm2!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld4lane.v4i16.p0i8")]
+ fn vld4_lane_s16_(a: int16x4_t, b: int16x4_t, c: int16x4_t, d: int16x4_t, n: i64, ptr: *const i8) -> int16x4x4_t;
+ }
+vld4_lane_s16_(b.0, b.1, b.2, b.3, LANE as i64, a as _)
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vld4_lane_s32<const LANE: i32>(a: *const i32, b: int32x2x4_t) -> int32x2x4_t {
+ static_assert_imm1!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld4lane.v2i32.p0i8")]
+ fn vld4_lane_s32_(ptr: *const i8, a: int32x2_t, b: int32x2_t, c: int32x2_t, d: int32x2_t, n: i32, size: i32) -> int32x2x4_t;
+ }
+vld4_lane_s32_(a as _, b.0, b.1, b.2, b.3, LANE, 4)
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4_lane_s32<const LANE: i32>(a: *const i32, b: int32x2x4_t) -> int32x2x4_t {
+ static_assert_imm1!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld4lane.v2i32.p0i8")]
+ fn vld4_lane_s32_(a: int32x2_t, b: int32x2_t, c: int32x2_t, d: int32x2_t, n: i64, ptr: *const i8) -> int32x2x4_t;
+ }
+vld4_lane_s32_(b.0, b.1, b.2, b.3, LANE as i64, a as _)
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vld4q_lane_s16<const LANE: i32>(a: *const i16, b: int16x8x4_t) -> int16x8x4_t {
+ static_assert_imm3!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld4lane.v8i16.p0i8")]
+ fn vld4q_lane_s16_(ptr: *const i8, a: int16x8_t, b: int16x8_t, c: int16x8_t, d: int16x8_t, n: i32, size: i32) -> int16x8x4_t;
+ }
+vld4q_lane_s16_(a as _, b.0, b.1, b.2, b.3, LANE, 2)
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4q_lane_s16<const LANE: i32>(a: *const i16, b: int16x8x4_t) -> int16x8x4_t {
+ static_assert_imm3!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld4lane.v8i16.p0i8")]
+ fn vld4q_lane_s16_(a: int16x8_t, b: int16x8_t, c: int16x8_t, d: int16x8_t, n: i64, ptr: *const i8) -> int16x8x4_t;
+ }
+vld4q_lane_s16_(b.0, b.1, b.2, b.3, LANE as i64, a as _)
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vld4q_lane_s32<const LANE: i32>(a: *const i32, b: int32x4x4_t) -> int32x4x4_t {
+ static_assert_imm2!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld4lane.v4i32.p0i8")]
+ fn vld4q_lane_s32_(ptr: *const i8, a: int32x4_t, b: int32x4_t, c: int32x4_t, d: int32x4_t, n: i32, size: i32) -> int32x4x4_t;
+ }
+vld4q_lane_s32_(a as _, b.0, b.1, b.2, b.3, LANE, 4)
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4q_lane_s32<const LANE: i32>(a: *const i32, b: int32x4x4_t) -> int32x4x4_t {
+ static_assert_imm2!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld4lane.v4i32.p0i8")]
+ fn vld4q_lane_s32_(a: int32x4_t, b: int32x4_t, c: int32x4_t, d: int32x4_t, n: i64, ptr: *const i8) -> int32x4x4_t;
+ }
+vld4q_lane_s32_(b.0, b.1, b.2, b.3, LANE as i64, a as _)
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld4, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld4_lane_u8<const LANE: i32>(a: *const u8, b: uint8x8x4_t) -> uint8x8x4_t {
+ static_assert_imm3!(LANE);
+ transmute(vld4_lane_s8::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld4, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld4_lane_u16<const LANE: i32>(a: *const u16, b: uint16x4x4_t) -> uint16x4x4_t {
+ static_assert_imm2!(LANE);
+ transmute(vld4_lane_s16::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld4, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld4_lane_u32<const LANE: i32>(a: *const u32, b: uint32x2x4_t) -> uint32x2x4_t {
+ static_assert_imm1!(LANE);
+ transmute(vld4_lane_s32::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld4, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld4q_lane_u16<const LANE: i32>(a: *const u16, b: uint16x8x4_t) -> uint16x8x4_t {
+ static_assert_imm3!(LANE);
+ transmute(vld4q_lane_s16::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld4, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld4q_lane_u32<const LANE: i32>(a: *const u32, b: uint32x4x4_t) -> uint32x4x4_t {
+ static_assert_imm2!(LANE);
+ transmute(vld4q_lane_s32::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld4, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld4_lane_p8<const LANE: i32>(a: *const p8, b: poly8x8x4_t) -> poly8x8x4_t {
+ static_assert_imm3!(LANE);
+ transmute(vld4_lane_s8::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld4, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld4_lane_p16<const LANE: i32>(a: *const p16, b: poly16x4x4_t) -> poly16x4x4_t {
+ static_assert_imm2!(LANE);
+ transmute(vld4_lane_s16::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld4, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vld4q_lane_p16<const LANE: i32>(a: *const p16, b: poly16x8x4_t) -> poly16x8x4_t {
+ static_assert_imm3!(LANE);
+ transmute(vld4q_lane_s16::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vld4_lane_f32<const LANE: i32>(a: *const f32, b: float32x2x4_t) -> float32x2x4_t {
+ static_assert_imm1!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld4lane.v2f32.p0i8")]
+ fn vld4_lane_f32_(ptr: *const i8, a: float32x2_t, b: float32x2_t, c: float32x2_t, d: float32x2_t, n: i32, size: i32) -> float32x2x4_t;
+ }
+vld4_lane_f32_(a as _, b.0, b.1, b.2, b.3, LANE, 4)
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4_lane_f32<const LANE: i32>(a: *const f32, b: float32x2x4_t) -> float32x2x4_t {
+ static_assert_imm1!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld4lane.v2f32.p0i8")]
+ fn vld4_lane_f32_(a: float32x2_t, b: float32x2_t, c: float32x2_t, d: float32x2_t, n: i64, ptr: *const i8) -> float32x2x4_t;
+ }
+vld4_lane_f32_(b.0, b.1, b.2, b.3, LANE as i64, a as _)
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vld4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vld4q_lane_f32<const LANE: i32>(a: *const f32, b: float32x4x4_t) -> float32x4x4_t {
+ static_assert_imm2!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld4lane.v4f32.p0i8")]
+ fn vld4q_lane_f32_(ptr: *const i8, a: float32x4_t, b: float32x4_t, c: float32x4_t, d: float32x4_t, n: i32, size: i32) -> float32x4x4_t;
+ }
+vld4q_lane_f32_(a as _, b.0, b.1, b.2, b.3, LANE, 4)
+}
+
+/// Load multiple 4-element structures to four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(ld4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vld4q_lane_f32<const LANE: i32>(a: *const f32, b: float32x4x4_t) -> float32x4x4_t {
+ static_assert_imm2!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld4lane.v4f32.p0i8")]
+ fn vld4q_lane_f32_(a: float32x4_t, b: float32x4_t, c: float32x4_t, d: float32x4_t, n: i64, ptr: *const i8) -> float32x4x4_t;
+ }
+vld4q_lane_f32_(b.0, b.1, b.2, b.3, LANE as i64, a as _)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1_lane_s8<const LANE: i32>(a: *mut i8, b: int8x8_t) {
+ static_assert_imm3!(LANE);
+ *a = simd_extract(b, LANE as u32);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1_lane_s16<const LANE: i32>(a: *mut i16, b: int16x4_t) {
+ static_assert_imm2!(LANE);
+ *a = simd_extract(b, LANE as u32);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1_lane_s32<const LANE: i32>(a: *mut i32, b: int32x2_t) {
+ static_assert_imm1!(LANE);
+ *a = simd_extract(b, LANE as u32);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1_lane_s64<const LANE: i32>(a: *mut i64, b: int64x1_t) {
+ static_assert!(LANE : i32 where LANE == 0);
+ *a = simd_extract(b, LANE as u32);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1q_lane_s8<const LANE: i32>(a: *mut i8, b: int8x16_t) {
+ static_assert_imm4!(LANE);
+ *a = simd_extract(b, LANE as u32);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1q_lane_s16<const LANE: i32>(a: *mut i16, b: int16x8_t) {
+ static_assert_imm3!(LANE);
+ *a = simd_extract(b, LANE as u32);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1q_lane_s32<const LANE: i32>(a: *mut i32, b: int32x4_t) {
+ static_assert_imm2!(LANE);
+ *a = simd_extract(b, LANE as u32);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1q_lane_s64<const LANE: i32>(a: *mut i64, b: int64x2_t) {
+ static_assert_imm1!(LANE);
+ *a = simd_extract(b, LANE as u32);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1_lane_u8<const LANE: i32>(a: *mut u8, b: uint8x8_t) {
+ static_assert_imm3!(LANE);
+ *a = simd_extract(b, LANE as u32);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1_lane_u16<const LANE: i32>(a: *mut u16, b: uint16x4_t) {
+ static_assert_imm2!(LANE);
+ *a = simd_extract(b, LANE as u32);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1_lane_u32<const LANE: i32>(a: *mut u32, b: uint32x2_t) {
+ static_assert_imm1!(LANE);
+ *a = simd_extract(b, LANE as u32);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1_lane_u64<const LANE: i32>(a: *mut u64, b: uint64x1_t) {
+ static_assert!(LANE : i32 where LANE == 0);
+ *a = simd_extract(b, LANE as u32);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1q_lane_u8<const LANE: i32>(a: *mut u8, b: uint8x16_t) {
+ static_assert_imm4!(LANE);
+ *a = simd_extract(b, LANE as u32);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1q_lane_u16<const LANE: i32>(a: *mut u16, b: uint16x8_t) {
+ static_assert_imm3!(LANE);
+ *a = simd_extract(b, LANE as u32);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1q_lane_u32<const LANE: i32>(a: *mut u32, b: uint32x4_t) {
+ static_assert_imm2!(LANE);
+ *a = simd_extract(b, LANE as u32);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1q_lane_u64<const LANE: i32>(a: *mut u64, b: uint64x2_t) {
+ static_assert_imm1!(LANE);
+ *a = simd_extract(b, LANE as u32);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1_lane_p8<const LANE: i32>(a: *mut p8, b: poly8x8_t) {
+ static_assert_imm3!(LANE);
+ *a = simd_extract(b, LANE as u32);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1_lane_p16<const LANE: i32>(a: *mut p16, b: poly16x4_t) {
+ static_assert_imm2!(LANE);
+ *a = simd_extract(b, LANE as u32);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1q_lane_p8<const LANE: i32>(a: *mut p8, b: poly8x16_t) {
+ static_assert_imm4!(LANE);
+ *a = simd_extract(b, LANE as u32);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1q_lane_p16<const LANE: i32>(a: *mut p16, b: poly16x8_t) {
+ static_assert_imm3!(LANE);
+ *a = simd_extract(b, LANE as u32);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1_lane_p64<const LANE: i32>(a: *mut p64, b: poly64x1_t) {
+ static_assert!(LANE : i32 where LANE == 0);
+ *a = simd_extract(b, LANE as u32);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1q_lane_p64<const LANE: i32>(a: *mut p64, b: poly64x2_t) {
+ static_assert_imm1!(LANE);
+ *a = simd_extract(b, LANE as u32);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1_lane_f32<const LANE: i32>(a: *mut f32, b: float32x2_t) {
+ static_assert_imm1!(LANE);
+ *a = simd_extract(b, LANE as u32);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1q_lane_f32<const LANE: i32>(a: *mut f32, b: float32x4_t) {
+ static_assert_imm2!(LANE);
+ *a = simd_extract(b, LANE as u32);
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst1))]
+pub unsafe fn vst1_s8_x2(a: *mut i8, b: int8x8x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst1x2.p0i8.v8i8")]
+ fn vst1_s8_x2_(ptr: *mut i8, a: int8x8_t, b: int8x8_t);
+ }
+vst1_s8_x2_(a, b.0, b.1)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1_s8_x2(a: *mut i8, b: int8x8x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st1x2.v8i8.p0i8")]
+ fn vst1_s8_x2_(a: int8x8_t, b: int8x8_t, ptr: *mut i8);
+ }
+vst1_s8_x2_(b.0, b.1, a)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst1))]
+pub unsafe fn vst1_s16_x2(a: *mut i16, b: int16x4x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst1x2.p0i16.v4i16")]
+ fn vst1_s16_x2_(ptr: *mut i16, a: int16x4_t, b: int16x4_t);
+ }
+vst1_s16_x2_(a, b.0, b.1)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1_s16_x2(a: *mut i16, b: int16x4x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st1x2.v4i16.p0i16")]
+ fn vst1_s16_x2_(a: int16x4_t, b: int16x4_t, ptr: *mut i16);
+ }
+vst1_s16_x2_(b.0, b.1, a)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst1))]
+pub unsafe fn vst1_s32_x2(a: *mut i32, b: int32x2x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst1x2.p0i32.v2i32")]
+ fn vst1_s32_x2_(ptr: *mut i32, a: int32x2_t, b: int32x2_t);
+ }
+vst1_s32_x2_(a, b.0, b.1)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1_s32_x2(a: *mut i32, b: int32x2x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st1x2.v2i32.p0i32")]
+ fn vst1_s32_x2_(a: int32x2_t, b: int32x2_t, ptr: *mut i32);
+ }
+vst1_s32_x2_(b.0, b.1, a)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst1))]
+pub unsafe fn vst1_s64_x2(a: *mut i64, b: int64x1x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst1x2.p0i64.v1i64")]
+ fn vst1_s64_x2_(ptr: *mut i64, a: int64x1_t, b: int64x1_t);
+ }
+vst1_s64_x2_(a, b.0, b.1)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1_s64_x2(a: *mut i64, b: int64x1x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st1x2.v1i64.p0i64")]
+ fn vst1_s64_x2_(a: int64x1_t, b: int64x1_t, ptr: *mut i64);
+ }
+vst1_s64_x2_(b.0, b.1, a)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst1))]
+pub unsafe fn vst1q_s8_x2(a: *mut i8, b: int8x16x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst1x2.p0i8.v16i8")]
+ fn vst1q_s8_x2_(ptr: *mut i8, a: int8x16_t, b: int8x16_t);
+ }
+vst1q_s8_x2_(a, b.0, b.1)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1q_s8_x2(a: *mut i8, b: int8x16x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st1x2.v16i8.p0i8")]
+ fn vst1q_s8_x2_(a: int8x16_t, b: int8x16_t, ptr: *mut i8);
+ }
+vst1q_s8_x2_(b.0, b.1, a)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst1))]
+pub unsafe fn vst1q_s16_x2(a: *mut i16, b: int16x8x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst1x2.p0i16.v8i16")]
+ fn vst1q_s16_x2_(ptr: *mut i16, a: int16x8_t, b: int16x8_t);
+ }
+vst1q_s16_x2_(a, b.0, b.1)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1q_s16_x2(a: *mut i16, b: int16x8x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st1x2.v8i16.p0i16")]
+ fn vst1q_s16_x2_(a: int16x8_t, b: int16x8_t, ptr: *mut i16);
+ }
+vst1q_s16_x2_(b.0, b.1, a)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst1))]
+pub unsafe fn vst1q_s32_x2(a: *mut i32, b: int32x4x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst1x2.p0i32.v4i32")]
+ fn vst1q_s32_x2_(ptr: *mut i32, a: int32x4_t, b: int32x4_t);
+ }
+vst1q_s32_x2_(a, b.0, b.1)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1q_s32_x2(a: *mut i32, b: int32x4x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st1x2.v4i32.p0i32")]
+ fn vst1q_s32_x2_(a: int32x4_t, b: int32x4_t, ptr: *mut i32);
+ }
+vst1q_s32_x2_(b.0, b.1, a)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst1))]
+pub unsafe fn vst1q_s64_x2(a: *mut i64, b: int64x2x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst1x2.p0i64.v2i64")]
+ fn vst1q_s64_x2_(ptr: *mut i64, a: int64x2_t, b: int64x2_t);
+ }
+vst1q_s64_x2_(a, b.0, b.1)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1q_s64_x2(a: *mut i64, b: int64x2x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st1x2.v2i64.p0i64")]
+ fn vst1q_s64_x2_(a: int64x2_t, b: int64x2_t, ptr: *mut i64);
+ }
+vst1q_s64_x2_(b.0, b.1, a)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst1))]
+pub unsafe fn vst1_s8_x3(a: *mut i8, b: int8x8x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst1x3.p0i8.v8i8")]
+ fn vst1_s8_x3_(ptr: *mut i8, a: int8x8_t, b: int8x8_t, c: int8x8_t);
+ }
+vst1_s8_x3_(a, b.0, b.1, b.2)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1_s8_x3(a: *mut i8, b: int8x8x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st1x3.v8i8.p0i8")]
+ fn vst1_s8_x3_(a: int8x8_t, b: int8x8_t, c: int8x8_t, ptr: *mut i8);
+ }
+vst1_s8_x3_(b.0, b.1, b.2, a)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst1))]
+pub unsafe fn vst1_s16_x3(a: *mut i16, b: int16x4x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst1x3.p0i16.v4i16")]
+ fn vst1_s16_x3_(ptr: *mut i16, a: int16x4_t, b: int16x4_t, c: int16x4_t);
+ }
+vst1_s16_x3_(a, b.0, b.1, b.2)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1_s16_x3(a: *mut i16, b: int16x4x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st1x3.v4i16.p0i16")]
+ fn vst1_s16_x3_(a: int16x4_t, b: int16x4_t, c: int16x4_t, ptr: *mut i16);
+ }
+vst1_s16_x3_(b.0, b.1, b.2, a)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst1))]
+pub unsafe fn vst1_s32_x3(a: *mut i32, b: int32x2x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst1x3.p0i32.v2i32")]
+ fn vst1_s32_x3_(ptr: *mut i32, a: int32x2_t, b: int32x2_t, c: int32x2_t);
+ }
+vst1_s32_x3_(a, b.0, b.1, b.2)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1_s32_x3(a: *mut i32, b: int32x2x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st1x3.v2i32.p0i32")]
+ fn vst1_s32_x3_(a: int32x2_t, b: int32x2_t, c: int32x2_t, ptr: *mut i32);
+ }
+vst1_s32_x3_(b.0, b.1, b.2, a)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst1))]
+pub unsafe fn vst1_s64_x3(a: *mut i64, b: int64x1x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst1x3.p0i64.v1i64")]
+ fn vst1_s64_x3_(ptr: *mut i64, a: int64x1_t, b: int64x1_t, c: int64x1_t);
+ }
+vst1_s64_x3_(a, b.0, b.1, b.2)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1_s64_x3(a: *mut i64, b: int64x1x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st1x3.v1i64.p0i64")]
+ fn vst1_s64_x3_(a: int64x1_t, b: int64x1_t, c: int64x1_t, ptr: *mut i64);
+ }
+vst1_s64_x3_(b.0, b.1, b.2, a)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst1))]
+pub unsafe fn vst1q_s8_x3(a: *mut i8, b: int8x16x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst1x3.p0i8.v16i8")]
+ fn vst1q_s8_x3_(ptr: *mut i8, a: int8x16_t, b: int8x16_t, c: int8x16_t);
+ }
+vst1q_s8_x3_(a, b.0, b.1, b.2)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1q_s8_x3(a: *mut i8, b: int8x16x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st1x3.v16i8.p0i8")]
+ fn vst1q_s8_x3_(a: int8x16_t, b: int8x16_t, c: int8x16_t, ptr: *mut i8);
+ }
+vst1q_s8_x3_(b.0, b.1, b.2, a)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst1))]
+pub unsafe fn vst1q_s16_x3(a: *mut i16, b: int16x8x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst1x3.p0i16.v8i16")]
+ fn vst1q_s16_x3_(ptr: *mut i16, a: int16x8_t, b: int16x8_t, c: int16x8_t);
+ }
+vst1q_s16_x3_(a, b.0, b.1, b.2)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1q_s16_x3(a: *mut i16, b: int16x8x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st1x3.v8i16.p0i16")]
+ fn vst1q_s16_x3_(a: int16x8_t, b: int16x8_t, c: int16x8_t, ptr: *mut i16);
+ }
+vst1q_s16_x3_(b.0, b.1, b.2, a)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst1))]
+pub unsafe fn vst1q_s32_x3(a: *mut i32, b: int32x4x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst1x3.p0i32.v4i32")]
+ fn vst1q_s32_x3_(ptr: *mut i32, a: int32x4_t, b: int32x4_t, c: int32x4_t);
+ }
+vst1q_s32_x3_(a, b.0, b.1, b.2)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1q_s32_x3(a: *mut i32, b: int32x4x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st1x3.v4i32.p0i32")]
+ fn vst1q_s32_x3_(a: int32x4_t, b: int32x4_t, c: int32x4_t, ptr: *mut i32);
+ }
+vst1q_s32_x3_(b.0, b.1, b.2, a)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst1))]
+pub unsafe fn vst1q_s64_x3(a: *mut i64, b: int64x2x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst1x3.p0i64.v2i64")]
+ fn vst1q_s64_x3_(ptr: *mut i64, a: int64x2_t, b: int64x2_t, c: int64x2_t);
+ }
+vst1q_s64_x3_(a, b.0, b.1, b.2)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1q_s64_x3(a: *mut i64, b: int64x2x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st1x3.v2i64.p0i64")]
+ fn vst1q_s64_x3_(a: int64x2_t, b: int64x2_t, c: int64x2_t, ptr: *mut i64);
+ }
+vst1q_s64_x3_(b.0, b.1, b.2, a)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst1))]
+pub unsafe fn vst1_s8_x4(a: *mut i8, b: int8x8x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst1x4.p0i8.v8i8")]
+ fn vst1_s8_x4_(ptr: *mut i8, a: int8x8_t, b: int8x8_t, c: int8x8_t, d: int8x8_t);
+ }
+vst1_s8_x4_(a, b.0, b.1, b.2, b.3)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1_s8_x4(a: *mut i8, b: int8x8x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st1x4.v8i8.p0i8")]
+ fn vst1_s8_x4_(a: int8x8_t, b: int8x8_t, c: int8x8_t, d: int8x8_t, ptr: *mut i8);
+ }
+vst1_s8_x4_(b.0, b.1, b.2, b.3, a)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst1))]
+pub unsafe fn vst1_s16_x4(a: *mut i16, b: int16x4x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst1x4.p0i16.v4i16")]
+ fn vst1_s16_x4_(ptr: *mut i16, a: int16x4_t, b: int16x4_t, c: int16x4_t, d: int16x4_t);
+ }
+vst1_s16_x4_(a, b.0, b.1, b.2, b.3)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1_s16_x4(a: *mut i16, b: int16x4x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st1x4.v4i16.p0i16")]
+ fn vst1_s16_x4_(a: int16x4_t, b: int16x4_t, c: int16x4_t, d: int16x4_t, ptr: *mut i16);
+ }
+vst1_s16_x4_(b.0, b.1, b.2, b.3, a)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst1))]
+pub unsafe fn vst1_s32_x4(a: *mut i32, b: int32x2x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst1x4.p0i32.v2i32")]
+ fn vst1_s32_x4_(ptr: *mut i32, a: int32x2_t, b: int32x2_t, c: int32x2_t, d: int32x2_t);
+ }
+vst1_s32_x4_(a, b.0, b.1, b.2, b.3)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1_s32_x4(a: *mut i32, b: int32x2x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st1x4.v2i32.p0i32")]
+ fn vst1_s32_x4_(a: int32x2_t, b: int32x2_t, c: int32x2_t, d: int32x2_t, ptr: *mut i32);
+ }
+vst1_s32_x4_(b.0, b.1, b.2, b.3, a)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst1))]
+pub unsafe fn vst1_s64_x4(a: *mut i64, b: int64x1x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst1x4.p0i64.v1i64")]
+ fn vst1_s64_x4_(ptr: *mut i64, a: int64x1_t, b: int64x1_t, c: int64x1_t, d: int64x1_t);
+ }
+vst1_s64_x4_(a, b.0, b.1, b.2, b.3)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1_s64_x4(a: *mut i64, b: int64x1x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st1x4.v1i64.p0i64")]
+ fn vst1_s64_x4_(a: int64x1_t, b: int64x1_t, c: int64x1_t, d: int64x1_t, ptr: *mut i64);
+ }
+vst1_s64_x4_(b.0, b.1, b.2, b.3, a)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst1))]
+pub unsafe fn vst1q_s8_x4(a: *mut i8, b: int8x16x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst1x4.p0i8.v16i8")]
+ fn vst1q_s8_x4_(ptr: *mut i8, a: int8x16_t, b: int8x16_t, c: int8x16_t, d: int8x16_t);
+ }
+vst1q_s8_x4_(a, b.0, b.1, b.2, b.3)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1q_s8_x4(a: *mut i8, b: int8x16x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st1x4.v16i8.p0i8")]
+ fn vst1q_s8_x4_(a: int8x16_t, b: int8x16_t, c: int8x16_t, d: int8x16_t, ptr: *mut i8);
+ }
+vst1q_s8_x4_(b.0, b.1, b.2, b.3, a)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst1))]
+pub unsafe fn vst1q_s16_x4(a: *mut i16, b: int16x8x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst1x4.p0i16.v8i16")]
+ fn vst1q_s16_x4_(ptr: *mut i16, a: int16x8_t, b: int16x8_t, c: int16x8_t, d: int16x8_t);
+ }
+vst1q_s16_x4_(a, b.0, b.1, b.2, b.3)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1q_s16_x4(a: *mut i16, b: int16x8x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st1x4.v8i16.p0i16")]
+ fn vst1q_s16_x4_(a: int16x8_t, b: int16x8_t, c: int16x8_t, d: int16x8_t, ptr: *mut i16);
+ }
+vst1q_s16_x4_(b.0, b.1, b.2, b.3, a)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst1))]
+pub unsafe fn vst1q_s32_x4(a: *mut i32, b: int32x4x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst1x4.p0i32.v4i32")]
+ fn vst1q_s32_x4_(ptr: *mut i32, a: int32x4_t, b: int32x4_t, c: int32x4_t, d: int32x4_t);
+ }
+vst1q_s32_x4_(a, b.0, b.1, b.2, b.3)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1q_s32_x4(a: *mut i32, b: int32x4x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st1x4.v4i32.p0i32")]
+ fn vst1q_s32_x4_(a: int32x4_t, b: int32x4_t, c: int32x4_t, d: int32x4_t, ptr: *mut i32);
+ }
+vst1q_s32_x4_(b.0, b.1, b.2, b.3, a)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst1))]
+pub unsafe fn vst1q_s64_x4(a: *mut i64, b: int64x2x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst1x4.p0i64.v2i64")]
+ fn vst1q_s64_x4_(ptr: *mut i64, a: int64x2_t, b: int64x2_t, c: int64x2_t, d: int64x2_t);
+ }
+vst1q_s64_x4_(a, b.0, b.1, b.2, b.3)
+}
+
+/// Store multiple single-element structures from one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1q_s64_x4(a: *mut i64, b: int64x2x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st1x4.v2i64.p0i64")]
+ fn vst1q_s64_x4_(a: int64x2_t, b: int64x2_t, c: int64x2_t, d: int64x2_t, ptr: *mut i64);
+ }
+vst1q_s64_x4_(b.0, b.1, b.2, b.3, a)
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1_u8_x2(a: *mut u8, b: uint8x8x2_t) {
+ vst1_s8_x2(transmute(a), transmute(b))
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1_u16_x2(a: *mut u16, b: uint16x4x2_t) {
+ vst1_s16_x2(transmute(a), transmute(b))
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1_u32_x2(a: *mut u32, b: uint32x2x2_t) {
+ vst1_s32_x2(transmute(a), transmute(b))
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1_u64_x2(a: *mut u64, b: uint64x1x2_t) {
+ vst1_s64_x2(transmute(a), transmute(b))
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1q_u8_x2(a: *mut u8, b: uint8x16x2_t) {
+ vst1q_s8_x2(transmute(a), transmute(b))
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1q_u16_x2(a: *mut u16, b: uint16x8x2_t) {
+ vst1q_s16_x2(transmute(a), transmute(b))
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1q_u32_x2(a: *mut u32, b: uint32x4x2_t) {
+ vst1q_s32_x2(transmute(a), transmute(b))
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1q_u64_x2(a: *mut u64, b: uint64x2x2_t) {
+ vst1q_s64_x2(transmute(a), transmute(b))
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1_u8_x3(a: *mut u8, b: uint8x8x3_t) {
+ vst1_s8_x3(transmute(a), transmute(b))
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1_u16_x3(a: *mut u16, b: uint16x4x3_t) {
+ vst1_s16_x3(transmute(a), transmute(b))
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1_u32_x3(a: *mut u32, b: uint32x2x3_t) {
+ vst1_s32_x3(transmute(a), transmute(b))
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1_u64_x3(a: *mut u64, b: uint64x1x3_t) {
+ vst1_s64_x3(transmute(a), transmute(b))
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1q_u8_x3(a: *mut u8, b: uint8x16x3_t) {
+ vst1q_s8_x3(transmute(a), transmute(b))
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1q_u16_x3(a: *mut u16, b: uint16x8x3_t) {
+ vst1q_s16_x3(transmute(a), transmute(b))
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1q_u32_x3(a: *mut u32, b: uint32x4x3_t) {
+ vst1q_s32_x3(transmute(a), transmute(b))
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1q_u64_x3(a: *mut u64, b: uint64x2x3_t) {
+ vst1q_s64_x3(transmute(a), transmute(b))
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1_u8_x4(a: *mut u8, b: uint8x8x4_t) {
+ vst1_s8_x4(transmute(a), transmute(b))
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1_u16_x4(a: *mut u16, b: uint16x4x4_t) {
+ vst1_s16_x4(transmute(a), transmute(b))
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1_u32_x4(a: *mut u32, b: uint32x2x4_t) {
+ vst1_s32_x4(transmute(a), transmute(b))
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1_u64_x4(a: *mut u64, b: uint64x1x4_t) {
+ vst1_s64_x4(transmute(a), transmute(b))
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1q_u8_x4(a: *mut u8, b: uint8x16x4_t) {
+ vst1q_s8_x4(transmute(a), transmute(b))
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1q_u16_x4(a: *mut u16, b: uint16x8x4_t) {
+ vst1q_s16_x4(transmute(a), transmute(b))
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1q_u32_x4(a: *mut u32, b: uint32x4x4_t) {
+ vst1q_s32_x4(transmute(a), transmute(b))
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1q_u64_x4(a: *mut u64, b: uint64x2x4_t) {
+ vst1q_s64_x4(transmute(a), transmute(b))
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1_p8_x2(a: *mut p8, b: poly8x8x2_t) {
+ vst1_s8_x2(transmute(a), transmute(b))
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1_p8_x3(a: *mut p8, b: poly8x8x3_t) {
+ vst1_s8_x3(transmute(a), transmute(b))
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1_p8_x4(a: *mut p8, b: poly8x8x4_t) {
+ vst1_s8_x4(transmute(a), transmute(b))
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1q_p8_x2(a: *mut p8, b: poly8x16x2_t) {
+ vst1q_s8_x2(transmute(a), transmute(b))
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1q_p8_x3(a: *mut p8, b: poly8x16x3_t) {
+ vst1q_s8_x3(transmute(a), transmute(b))
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1q_p8_x4(a: *mut p8, b: poly8x16x4_t) {
+ vst1q_s8_x4(transmute(a), transmute(b))
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1_p16_x2(a: *mut p16, b: poly16x4x2_t) {
+ vst1_s16_x2(transmute(a), transmute(b))
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1_p16_x3(a: *mut p16, b: poly16x4x3_t) {
+ vst1_s16_x3(transmute(a), transmute(b))
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1_p16_x4(a: *mut p16, b: poly16x4x4_t) {
+ vst1_s16_x4(transmute(a), transmute(b))
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1q_p16_x2(a: *mut p16, b: poly16x8x2_t) {
+ vst1q_s16_x2(transmute(a), transmute(b))
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1q_p16_x3(a: *mut p16, b: poly16x8x3_t) {
+ vst1q_s16_x3(transmute(a), transmute(b))
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1q_p16_x4(a: *mut p16, b: poly16x8x4_t) {
+ vst1q_s16_x4(transmute(a), transmute(b))
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1_p64_x2(a: *mut p64, b: poly64x1x2_t) {
+ vst1_s64_x2(transmute(a), transmute(b))
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1_p64_x3(a: *mut p64, b: poly64x1x3_t) {
+ vst1_s64_x3(transmute(a), transmute(b))
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1_p64_x4(a: *mut p64, b: poly64x1x4_t) {
+ vst1_s64_x4(transmute(a), transmute(b))
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1q_p64_x2(a: *mut p64, b: poly64x2x2_t) {
+ vst1q_s64_x2(transmute(a), transmute(b))
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1q_p64_x3(a: *mut p64, b: poly64x2x3_t) {
+ vst1q_s64_x3(transmute(a), transmute(b))
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st1))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst1q_p64_x4(a: *mut p64, b: poly64x2x4_t) {
+ vst1q_s64_x4(transmute(a), transmute(b))
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst1))]
+pub unsafe fn vst1_f32_x2(a: *mut f32, b: float32x2x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst1x2.p0f32.v2f32")]
+ fn vst1_f32_x2_(ptr: *mut f32, a: float32x2_t, b: float32x2_t);
+ }
+vst1_f32_x2_(a, b.0, b.1)
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1_f32_x2(a: *mut f32, b: float32x2x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st1x2.v2f32.p0f32")]
+ fn vst1_f32_x2_(a: float32x2_t, b: float32x2_t, ptr: *mut f32);
+ }
+vst1_f32_x2_(b.0, b.1, a)
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst1))]
+pub unsafe fn vst1q_f32_x2(a: *mut f32, b: float32x4x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst1x2.p0f32.v4f32")]
+ fn vst1q_f32_x2_(ptr: *mut f32, a: float32x4_t, b: float32x4_t);
+ }
+vst1q_f32_x2_(a, b.0, b.1)
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1q_f32_x2(a: *mut f32, b: float32x4x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st1x2.v4f32.p0f32")]
+ fn vst1q_f32_x2_(a: float32x4_t, b: float32x4_t, ptr: *mut f32);
+ }
+vst1q_f32_x2_(b.0, b.1, a)
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst1))]
+pub unsafe fn vst1_f32_x3(a: *mut f32, b: float32x2x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst1x3.p0f32.v2f32")]
+ fn vst1_f32_x3_(ptr: *mut f32, a: float32x2_t, b: float32x2_t, c: float32x2_t);
+ }
+vst1_f32_x3_(a, b.0, b.1, b.2)
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1_f32_x3(a: *mut f32, b: float32x2x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st1x3.v2f32.p0f32")]
+ fn vst1_f32_x3_(a: float32x2_t, b: float32x2_t, c: float32x2_t, ptr: *mut f32);
+ }
+vst1_f32_x3_(b.0, b.1, b.2, a)
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst1))]
+pub unsafe fn vst1q_f32_x3(a: *mut f32, b: float32x4x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst1x3.p0f32.v4f32")]
+ fn vst1q_f32_x3_(ptr: *mut f32, a: float32x4_t, b: float32x4_t, c: float32x4_t);
+ }
+vst1q_f32_x3_(a, b.0, b.1, b.2)
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1q_f32_x3(a: *mut f32, b: float32x4x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st1x3.v4f32.p0f32")]
+ fn vst1q_f32_x3_(a: float32x4_t, b: float32x4_t, c: float32x4_t, ptr: *mut f32);
+ }
+vst1q_f32_x3_(b.0, b.1, b.2, a)
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst1))]
+pub unsafe fn vst1_f32_x4(a: *mut f32, b: float32x2x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst1x4.p0f32.v2f32")]
+ fn vst1_f32_x4_(ptr: *mut f32, a: float32x2_t, b: float32x2_t, c: float32x2_t, d: float32x2_t);
+ }
+vst1_f32_x4_(a, b.0, b.1, b.2, b.3)
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1_f32_x4(a: *mut f32, b: float32x2x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st1x4.v2f32.p0f32")]
+ fn vst1_f32_x4_(a: float32x2_t, b: float32x2_t, c: float32x2_t, d: float32x2_t, ptr: *mut f32);
+ }
+vst1_f32_x4_(b.0, b.1, b.2, b.3, a)
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst1))]
+pub unsafe fn vst1q_f32_x4(a: *mut f32, b: float32x4x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst1x4.p0f32.v4f32")]
+ fn vst1q_f32_x4_(ptr: *mut f32, a: float32x4_t, b: float32x4_t, c: float32x4_t, d: float32x4_t);
+ }
+vst1q_f32_x4_(a, b.0, b.1, b.2, b.3)
+}
+
+/// Store multiple single-element structures to one, two, three, or four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st1))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst1q_f32_x4(a: *mut f32, b: float32x4x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st1x4.v4f32.p0f32")]
+ fn vst1q_f32_x4_(a: float32x4_t, b: float32x4_t, c: float32x4_t, d: float32x4_t, ptr: *mut f32);
+ }
+vst1q_f32_x4_(b.0, b.1, b.2, b.3, a)
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst2))]
+pub unsafe fn vst2_s8(a: *mut i8, b: int8x8x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst2.p0i8.v8i8")]
+ fn vst2_s8_(ptr: *mut i8, a: int8x8_t, b: int8x8_t, size: i32);
+ }
+vst2_s8_(a as _, b.0, b.1, 1)
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst2_s8(a: *mut i8, b: int8x8x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st2.v8i8.p0i8")]
+ fn vst2_s8_(a: int8x8_t, b: int8x8_t, ptr: *mut i8);
+ }
+vst2_s8_(b.0, b.1, a as _)
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst2))]
+pub unsafe fn vst2_s16(a: *mut i16, b: int16x4x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst2.p0i8.v4i16")]
+ fn vst2_s16_(ptr: *mut i8, a: int16x4_t, b: int16x4_t, size: i32);
+ }
+vst2_s16_(a as _, b.0, b.1, 2)
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst2_s16(a: *mut i16, b: int16x4x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st2.v4i16.p0i8")]
+ fn vst2_s16_(a: int16x4_t, b: int16x4_t, ptr: *mut i8);
+ }
+vst2_s16_(b.0, b.1, a as _)
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst2))]
+pub unsafe fn vst2_s32(a: *mut i32, b: int32x2x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst2.p0i8.v2i32")]
+ fn vst2_s32_(ptr: *mut i8, a: int32x2_t, b: int32x2_t, size: i32);
+ }
+vst2_s32_(a as _, b.0, b.1, 4)
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst2_s32(a: *mut i32, b: int32x2x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st2.v2i32.p0i8")]
+ fn vst2_s32_(a: int32x2_t, b: int32x2_t, ptr: *mut i8);
+ }
+vst2_s32_(b.0, b.1, a as _)
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst2))]
+pub unsafe fn vst2q_s8(a: *mut i8, b: int8x16x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst2.p0i8.v16i8")]
+ fn vst2q_s8_(ptr: *mut i8, a: int8x16_t, b: int8x16_t, size: i32);
+ }
+vst2q_s8_(a as _, b.0, b.1, 1)
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst2q_s8(a: *mut i8, b: int8x16x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st2.v16i8.p0i8")]
+ fn vst2q_s8_(a: int8x16_t, b: int8x16_t, ptr: *mut i8);
+ }
+vst2q_s8_(b.0, b.1, a as _)
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst2))]
+pub unsafe fn vst2q_s16(a: *mut i16, b: int16x8x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst2.p0i8.v8i16")]
+ fn vst2q_s16_(ptr: *mut i8, a: int16x8_t, b: int16x8_t, size: i32);
+ }
+vst2q_s16_(a as _, b.0, b.1, 2)
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst2q_s16(a: *mut i16, b: int16x8x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st2.v8i16.p0i8")]
+ fn vst2q_s16_(a: int16x8_t, b: int16x8_t, ptr: *mut i8);
+ }
+vst2q_s16_(b.0, b.1, a as _)
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst2))]
+pub unsafe fn vst2q_s32(a: *mut i32, b: int32x4x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst2.p0i8.v4i32")]
+ fn vst2q_s32_(ptr: *mut i8, a: int32x4_t, b: int32x4_t, size: i32);
+ }
+vst2q_s32_(a as _, b.0, b.1, 4)
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst2q_s32(a: *mut i32, b: int32x4x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st2.v4i32.p0i8")]
+ fn vst2q_s32_(a: int32x4_t, b: int32x4_t, ptr: *mut i8);
+ }
+vst2q_s32_(b.0, b.1, a as _)
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(nop))]
+pub unsafe fn vst2_s64(a: *mut i64, b: int64x1x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst2.p0i8.v1i64")]
+ fn vst2_s64_(ptr: *mut i8, a: int64x1_t, b: int64x1_t, size: i32);
+ }
+vst2_s64_(a as _, b.0, b.1, 8)
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst2_s64(a: *mut i64, b: int64x1x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st2.v1i64.p0i8")]
+ fn vst2_s64_(a: int64x1_t, b: int64x1_t, ptr: *mut i8);
+ }
+vst2_s64_(b.0, b.1, a as _)
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st2))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst2_u8(a: *mut u8, b: uint8x8x2_t) {
+ transmute(vst2_s8(transmute(a), transmute(b)))
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st2))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst2_u16(a: *mut u16, b: uint16x4x2_t) {
+ transmute(vst2_s16(transmute(a), transmute(b)))
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st2))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst2_u32(a: *mut u32, b: uint32x2x2_t) {
+ transmute(vst2_s32(transmute(a), transmute(b)))
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st2))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst2q_u8(a: *mut u8, b: uint8x16x2_t) {
+ transmute(vst2q_s8(transmute(a), transmute(b)))
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st2))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst2q_u16(a: *mut u16, b: uint16x8x2_t) {
+ transmute(vst2q_s16(transmute(a), transmute(b)))
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st2))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst2q_u32(a: *mut u32, b: uint32x4x2_t) {
+ transmute(vst2q_s32(transmute(a), transmute(b)))
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st2))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst2_p8(a: *mut p8, b: poly8x8x2_t) {
+ transmute(vst2_s8(transmute(a), transmute(b)))
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st2))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst2_p16(a: *mut p16, b: poly16x4x2_t) {
+ transmute(vst2_s16(transmute(a), transmute(b)))
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st2))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst2q_p8(a: *mut p8, b: poly8x16x2_t) {
+ transmute(vst2q_s8(transmute(a), transmute(b)))
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st2))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst2q_p16(a: *mut p16, b: poly16x8x2_t) {
+ transmute(vst2q_s16(transmute(a), transmute(b)))
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst2_u64(a: *mut u64, b: uint64x1x2_t) {
+ transmute(vst2_s64(transmute(a), transmute(b)))
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst2_p64(a: *mut p64, b: poly64x1x2_t) {
+ transmute(vst2_s64(transmute(a), transmute(b)))
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst2))]
+pub unsafe fn vst2_f32(a: *mut f32, b: float32x2x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst2.p0i8.v2f32")]
+ fn vst2_f32_(ptr: *mut i8, a: float32x2_t, b: float32x2_t, size: i32);
+ }
+vst2_f32_(a as _, b.0, b.1, 4)
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst2_f32(a: *mut f32, b: float32x2x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st2.v2f32.p0i8")]
+ fn vst2_f32_(a: float32x2_t, b: float32x2_t, ptr: *mut i8);
+ }
+vst2_f32_(b.0, b.1, a as _)
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst2))]
+pub unsafe fn vst2q_f32(a: *mut f32, b: float32x4x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst2.p0i8.v4f32")]
+ fn vst2q_f32_(ptr: *mut i8, a: float32x4_t, b: float32x4_t, size: i32);
+ }
+vst2q_f32_(a as _, b.0, b.1, 4)
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st2))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst2q_f32(a: *mut f32, b: float32x4x2_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st2.v4f32.p0i8")]
+ fn vst2q_f32_(a: float32x4_t, b: float32x4_t, ptr: *mut i8);
+ }
+vst2q_f32_(b.0, b.1, a as _)
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vst2_lane_s8<const LANE: i32>(a: *mut i8, b: int8x8x2_t) {
+ static_assert_imm3!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst2lane.p0i8.v8i8")]
+ fn vst2_lane_s8_(ptr: *mut i8, a: int8x8_t, b: int8x8_t, n: i32, size: i32);
+ }
+vst2_lane_s8_(a as _, b.0, b.1, LANE, 1)
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst2_lane_s8<const LANE: i32>(a: *mut i8, b: int8x8x2_t) {
+ static_assert_imm3!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st2lane.v8i8.p0i8")]
+ fn vst2_lane_s8_(a: int8x8_t, b: int8x8_t, n: i64, ptr: *mut i8);
+ }
+vst2_lane_s8_(b.0, b.1, LANE as i64, a as _)
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vst2_lane_s16<const LANE: i32>(a: *mut i16, b: int16x4x2_t) {
+ static_assert_imm2!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst2lane.p0i8.v4i16")]
+ fn vst2_lane_s16_(ptr: *mut i8, a: int16x4_t, b: int16x4_t, n: i32, size: i32);
+ }
+vst2_lane_s16_(a as _, b.0, b.1, LANE, 2)
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst2_lane_s16<const LANE: i32>(a: *mut i16, b: int16x4x2_t) {
+ static_assert_imm2!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st2lane.v4i16.p0i8")]
+ fn vst2_lane_s16_(a: int16x4_t, b: int16x4_t, n: i64, ptr: *mut i8);
+ }
+vst2_lane_s16_(b.0, b.1, LANE as i64, a as _)
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vst2_lane_s32<const LANE: i32>(a: *mut i32, b: int32x2x2_t) {
+ static_assert_imm1!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst2lane.p0i8.v2i32")]
+ fn vst2_lane_s32_(ptr: *mut i8, a: int32x2_t, b: int32x2_t, n: i32, size: i32);
+ }
+vst2_lane_s32_(a as _, b.0, b.1, LANE, 4)
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst2_lane_s32<const LANE: i32>(a: *mut i32, b: int32x2x2_t) {
+ static_assert_imm1!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st2lane.v2i32.p0i8")]
+ fn vst2_lane_s32_(a: int32x2_t, b: int32x2_t, n: i64, ptr: *mut i8);
+ }
+vst2_lane_s32_(b.0, b.1, LANE as i64, a as _)
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vst2q_lane_s16<const LANE: i32>(a: *mut i16, b: int16x8x2_t) {
+ static_assert_imm3!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst2lane.p0i8.v8i16")]
+ fn vst2q_lane_s16_(ptr: *mut i8, a: int16x8_t, b: int16x8_t, n: i32, size: i32);
+ }
+vst2q_lane_s16_(a as _, b.0, b.1, LANE, 2)
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst2q_lane_s16<const LANE: i32>(a: *mut i16, b: int16x8x2_t) {
+ static_assert_imm3!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st2lane.v8i16.p0i8")]
+ fn vst2q_lane_s16_(a: int16x8_t, b: int16x8_t, n: i64, ptr: *mut i8);
+ }
+vst2q_lane_s16_(b.0, b.1, LANE as i64, a as _)
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vst2q_lane_s32<const LANE: i32>(a: *mut i32, b: int32x4x2_t) {
+ static_assert_imm2!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst2lane.p0i8.v4i32")]
+ fn vst2q_lane_s32_(ptr: *mut i8, a: int32x4_t, b: int32x4_t, n: i32, size: i32);
+ }
+vst2q_lane_s32_(a as _, b.0, b.1, LANE, 4)
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst2q_lane_s32<const LANE: i32>(a: *mut i32, b: int32x4x2_t) {
+ static_assert_imm2!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st2lane.v4i32.p0i8")]
+ fn vst2q_lane_s32_(a: int32x4_t, b: int32x4_t, n: i64, ptr: *mut i8);
+ }
+vst2q_lane_s32_(b.0, b.1, LANE as i64, a as _)
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst2, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst2_lane_u8<const LANE: i32>(a: *mut u8, b: uint8x8x2_t) {
+ static_assert_imm3!(LANE);
+ transmute(vst2_lane_s8::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst2, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst2_lane_u16<const LANE: i32>(a: *mut u16, b: uint16x4x2_t) {
+ static_assert_imm2!(LANE);
+ transmute(vst2_lane_s16::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst2, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst2_lane_u32<const LANE: i32>(a: *mut u32, b: uint32x2x2_t) {
+ static_assert_imm1!(LANE);
+ transmute(vst2_lane_s32::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst2, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst2q_lane_u16<const LANE: i32>(a: *mut u16, b: uint16x8x2_t) {
+ static_assert_imm3!(LANE);
+ transmute(vst2q_lane_s16::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst2, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst2q_lane_u32<const LANE: i32>(a: *mut u32, b: uint32x4x2_t) {
+ static_assert_imm2!(LANE);
+ transmute(vst2q_lane_s32::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst2, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst2_lane_p8<const LANE: i32>(a: *mut p8, b: poly8x8x2_t) {
+ static_assert_imm3!(LANE);
+ transmute(vst2_lane_s8::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst2, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst2_lane_p16<const LANE: i32>(a: *mut p16, b: poly16x4x2_t) {
+ static_assert_imm2!(LANE);
+ transmute(vst2_lane_s16::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst2, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst2q_lane_p16<const LANE: i32>(a: *mut p16, b: poly16x8x2_t) {
+ static_assert_imm3!(LANE);
+ transmute(vst2q_lane_s16::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vst2_lane_f32<const LANE: i32>(a: *mut f32, b: float32x2x2_t) {
+ static_assert_imm1!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst2lane.p0i8.v2f32")]
+ fn vst2_lane_f32_(ptr: *mut i8, a: float32x2_t, b: float32x2_t, n: i32, size: i32);
+ }
+vst2_lane_f32_(a as _, b.0, b.1, LANE, 4)
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst2_lane_f32<const LANE: i32>(a: *mut f32, b: float32x2x2_t) {
+ static_assert_imm1!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st2lane.v2f32.p0i8")]
+ fn vst2_lane_f32_(a: float32x2_t, b: float32x2_t, n: i64, ptr: *mut i8);
+ }
+vst2_lane_f32_(b.0, b.1, LANE as i64, a as _)
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vst2q_lane_f32<const LANE: i32>(a: *mut f32, b: float32x4x2_t) {
+ static_assert_imm2!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst2lane.p0i8.v4f32")]
+ fn vst2q_lane_f32_(ptr: *mut i8, a: float32x4_t, b: float32x4_t, n: i32, size: i32);
+ }
+vst2q_lane_f32_(a as _, b.0, b.1, LANE, 4)
+}
+
+/// Store multiple 2-element structures from two registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st2, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst2q_lane_f32<const LANE: i32>(a: *mut f32, b: float32x4x2_t) {
+ static_assert_imm2!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st2lane.v4f32.p0i8")]
+ fn vst2q_lane_f32_(a: float32x4_t, b: float32x4_t, n: i64, ptr: *mut i8);
+ }
+vst2q_lane_f32_(b.0, b.1, LANE as i64, a as _)
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst3))]
+pub unsafe fn vst3_s8(a: *mut i8, b: int8x8x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst3.p0i8.v8i8")]
+ fn vst3_s8_(ptr: *mut i8, a: int8x8_t, b: int8x8_t, c: int8x8_t, size: i32);
+ }
+vst3_s8_(a as _, b.0, b.1, b.2, 1)
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st3))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst3_s8(a: *mut i8, b: int8x8x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st3.v8i8.p0i8")]
+ fn vst3_s8_(a: int8x8_t, b: int8x8_t, c: int8x8_t, ptr: *mut i8);
+ }
+vst3_s8_(b.0, b.1, b.2, a as _)
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst3))]
+pub unsafe fn vst3_s16(a: *mut i16, b: int16x4x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst3.p0i8.v4i16")]
+ fn vst3_s16_(ptr: *mut i8, a: int16x4_t, b: int16x4_t, c: int16x4_t, size: i32);
+ }
+vst3_s16_(a as _, b.0, b.1, b.2, 2)
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st3))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst3_s16(a: *mut i16, b: int16x4x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st3.v4i16.p0i8")]
+ fn vst3_s16_(a: int16x4_t, b: int16x4_t, c: int16x4_t, ptr: *mut i8);
+ }
+vst3_s16_(b.0, b.1, b.2, a as _)
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst3))]
+pub unsafe fn vst3_s32(a: *mut i32, b: int32x2x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst3.p0i8.v2i32")]
+ fn vst3_s32_(ptr: *mut i8, a: int32x2_t, b: int32x2_t, c: int32x2_t, size: i32);
+ }
+vst3_s32_(a as _, b.0, b.1, b.2, 4)
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st3))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst3_s32(a: *mut i32, b: int32x2x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st3.v2i32.p0i8")]
+ fn vst3_s32_(a: int32x2_t, b: int32x2_t, c: int32x2_t, ptr: *mut i8);
+ }
+vst3_s32_(b.0, b.1, b.2, a as _)
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst3))]
+pub unsafe fn vst3q_s8(a: *mut i8, b: int8x16x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst3.p0i8.v16i8")]
+ fn vst3q_s8_(ptr: *mut i8, a: int8x16_t, b: int8x16_t, c: int8x16_t, size: i32);
+ }
+vst3q_s8_(a as _, b.0, b.1, b.2, 1)
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st3))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst3q_s8(a: *mut i8, b: int8x16x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st3.v16i8.p0i8")]
+ fn vst3q_s8_(a: int8x16_t, b: int8x16_t, c: int8x16_t, ptr: *mut i8);
+ }
+vst3q_s8_(b.0, b.1, b.2, a as _)
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst3))]
+pub unsafe fn vst3q_s16(a: *mut i16, b: int16x8x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst3.p0i8.v8i16")]
+ fn vst3q_s16_(ptr: *mut i8, a: int16x8_t, b: int16x8_t, c: int16x8_t, size: i32);
+ }
+vst3q_s16_(a as _, b.0, b.1, b.2, 2)
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st3))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst3q_s16(a: *mut i16, b: int16x8x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st3.v8i16.p0i8")]
+ fn vst3q_s16_(a: int16x8_t, b: int16x8_t, c: int16x8_t, ptr: *mut i8);
+ }
+vst3q_s16_(b.0, b.1, b.2, a as _)
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst3))]
+pub unsafe fn vst3q_s32(a: *mut i32, b: int32x4x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst3.p0i8.v4i32")]
+ fn vst3q_s32_(ptr: *mut i8, a: int32x4_t, b: int32x4_t, c: int32x4_t, size: i32);
+ }
+vst3q_s32_(a as _, b.0, b.1, b.2, 4)
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st3))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst3q_s32(a: *mut i32, b: int32x4x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st3.v4i32.p0i8")]
+ fn vst3q_s32_(a: int32x4_t, b: int32x4_t, c: int32x4_t, ptr: *mut i8);
+ }
+vst3q_s32_(b.0, b.1, b.2, a as _)
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(nop))]
+pub unsafe fn vst3_s64(a: *mut i64, b: int64x1x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst3.p0i8.v1i64")]
+ fn vst3_s64_(ptr: *mut i8, a: int64x1_t, b: int64x1_t, c: int64x1_t, size: i32);
+ }
+vst3_s64_(a as _, b.0, b.1, b.2, 8)
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst3_s64(a: *mut i64, b: int64x1x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st3.v1i64.p0i8")]
+ fn vst3_s64_(a: int64x1_t, b: int64x1_t, c: int64x1_t, ptr: *mut i8);
+ }
+vst3_s64_(b.0, b.1, b.2, a as _)
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst3))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st3))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst3_u8(a: *mut u8, b: uint8x8x3_t) {
+ transmute(vst3_s8(transmute(a), transmute(b)))
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst3))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st3))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst3_u16(a: *mut u16, b: uint16x4x3_t) {
+ transmute(vst3_s16(transmute(a), transmute(b)))
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst3))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st3))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst3_u32(a: *mut u32, b: uint32x2x3_t) {
+ transmute(vst3_s32(transmute(a), transmute(b)))
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst3))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st3))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst3q_u8(a: *mut u8, b: uint8x16x3_t) {
+ transmute(vst3q_s8(transmute(a), transmute(b)))
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst3))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st3))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst3q_u16(a: *mut u16, b: uint16x8x3_t) {
+ transmute(vst3q_s16(transmute(a), transmute(b)))
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst3))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st3))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst3q_u32(a: *mut u32, b: uint32x4x3_t) {
+ transmute(vst3q_s32(transmute(a), transmute(b)))
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst3))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st3))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst3_p8(a: *mut p8, b: poly8x8x3_t) {
+ transmute(vst3_s8(transmute(a), transmute(b)))
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst3))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st3))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst3_p16(a: *mut p16, b: poly16x4x3_t) {
+ transmute(vst3_s16(transmute(a), transmute(b)))
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst3))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st3))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst3q_p8(a: *mut p8, b: poly8x16x3_t) {
+ transmute(vst3q_s8(transmute(a), transmute(b)))
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst3))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st3))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst3q_p16(a: *mut p16, b: poly16x8x3_t) {
+ transmute(vst3q_s16(transmute(a), transmute(b)))
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst3_u64(a: *mut u64, b: uint64x1x3_t) {
+ transmute(vst3_s64(transmute(a), transmute(b)))
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst3_p64(a: *mut p64, b: poly64x1x3_t) {
+ transmute(vst3_s64(transmute(a), transmute(b)))
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst3))]
+pub unsafe fn vst3_f32(a: *mut f32, b: float32x2x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst3.p0i8.v2f32")]
+ fn vst3_f32_(ptr: *mut i8, a: float32x2_t, b: float32x2_t, c: float32x2_t, size: i32);
+ }
+vst3_f32_(a as _, b.0, b.1, b.2, 4)
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st3))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst3_f32(a: *mut f32, b: float32x2x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st3.v2f32.p0i8")]
+ fn vst3_f32_(a: float32x2_t, b: float32x2_t, c: float32x2_t, ptr: *mut i8);
+ }
+vst3_f32_(b.0, b.1, b.2, a as _)
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst3))]
+pub unsafe fn vst3q_f32(a: *mut f32, b: float32x4x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst3.p0i8.v4f32")]
+ fn vst3q_f32_(ptr: *mut i8, a: float32x4_t, b: float32x4_t, c: float32x4_t, size: i32);
+ }
+vst3q_f32_(a as _, b.0, b.1, b.2, 4)
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st3))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst3q_f32(a: *mut f32, b: float32x4x3_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st3.v4f32.p0i8")]
+ fn vst3q_f32_(a: float32x4_t, b: float32x4_t, c: float32x4_t, ptr: *mut i8);
+ }
+vst3q_f32_(b.0, b.1, b.2, a as _)
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vst3_lane_s8<const LANE: i32>(a: *mut i8, b: int8x8x3_t) {
+ static_assert_imm3!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst3lane.p0i8.v8i8")]
+ fn vst3_lane_s8_(ptr: *mut i8, a: int8x8_t, b: int8x8_t, c: int8x8_t, n: i32, size: i32);
+ }
+vst3_lane_s8_(a as _, b.0, b.1, b.2, LANE, 1)
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst3_lane_s8<const LANE: i32>(a: *mut i8, b: int8x8x3_t) {
+ static_assert_imm3!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st3lane.v8i8.p0i8")]
+ fn vst3_lane_s8_(a: int8x8_t, b: int8x8_t, c: int8x8_t, n: i64, ptr: *mut i8);
+ }
+vst3_lane_s8_(b.0, b.1, b.2, LANE as i64, a as _)
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vst3_lane_s16<const LANE: i32>(a: *mut i16, b: int16x4x3_t) {
+ static_assert_imm2!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst3lane.p0i8.v4i16")]
+ fn vst3_lane_s16_(ptr: *mut i8, a: int16x4_t, b: int16x4_t, c: int16x4_t, n: i32, size: i32);
+ }
+vst3_lane_s16_(a as _, b.0, b.1, b.2, LANE, 2)
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst3_lane_s16<const LANE: i32>(a: *mut i16, b: int16x4x3_t) {
+ static_assert_imm2!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st3lane.v4i16.p0i8")]
+ fn vst3_lane_s16_(a: int16x4_t, b: int16x4_t, c: int16x4_t, n: i64, ptr: *mut i8);
+ }
+vst3_lane_s16_(b.0, b.1, b.2, LANE as i64, a as _)
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vst3_lane_s32<const LANE: i32>(a: *mut i32, b: int32x2x3_t) {
+ static_assert_imm1!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst3lane.p0i8.v2i32")]
+ fn vst3_lane_s32_(ptr: *mut i8, a: int32x2_t, b: int32x2_t, c: int32x2_t, n: i32, size: i32);
+ }
+vst3_lane_s32_(a as _, b.0, b.1, b.2, LANE, 4)
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst3_lane_s32<const LANE: i32>(a: *mut i32, b: int32x2x3_t) {
+ static_assert_imm1!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st3lane.v2i32.p0i8")]
+ fn vst3_lane_s32_(a: int32x2_t, b: int32x2_t, c: int32x2_t, n: i64, ptr: *mut i8);
+ }
+vst3_lane_s32_(b.0, b.1, b.2, LANE as i64, a as _)
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vst3q_lane_s16<const LANE: i32>(a: *mut i16, b: int16x8x3_t) {
+ static_assert_imm3!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst3lane.p0i8.v8i16")]
+ fn vst3q_lane_s16_(ptr: *mut i8, a: int16x8_t, b: int16x8_t, c: int16x8_t, n: i32, size: i32);
+ }
+vst3q_lane_s16_(a as _, b.0, b.1, b.2, LANE, 2)
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst3q_lane_s16<const LANE: i32>(a: *mut i16, b: int16x8x3_t) {
+ static_assert_imm3!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st3lane.v8i16.p0i8")]
+ fn vst3q_lane_s16_(a: int16x8_t, b: int16x8_t, c: int16x8_t, n: i64, ptr: *mut i8);
+ }
+vst3q_lane_s16_(b.0, b.1, b.2, LANE as i64, a as _)
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vst3q_lane_s32<const LANE: i32>(a: *mut i32, b: int32x4x3_t) {
+ static_assert_imm2!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst3lane.p0i8.v4i32")]
+ fn vst3q_lane_s32_(ptr: *mut i8, a: int32x4_t, b: int32x4_t, c: int32x4_t, n: i32, size: i32);
+ }
+vst3q_lane_s32_(a as _, b.0, b.1, b.2, LANE, 4)
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst3q_lane_s32<const LANE: i32>(a: *mut i32, b: int32x4x3_t) {
+ static_assert_imm2!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st3lane.v4i32.p0i8")]
+ fn vst3q_lane_s32_(a: int32x4_t, b: int32x4_t, c: int32x4_t, n: i64, ptr: *mut i8);
+ }
+vst3q_lane_s32_(b.0, b.1, b.2, LANE as i64, a as _)
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst3, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst3_lane_u8<const LANE: i32>(a: *mut u8, b: uint8x8x3_t) {
+ static_assert_imm3!(LANE);
+ transmute(vst3_lane_s8::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst3, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst3_lane_u16<const LANE: i32>(a: *mut u16, b: uint16x4x3_t) {
+ static_assert_imm2!(LANE);
+ transmute(vst3_lane_s16::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst3, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst3_lane_u32<const LANE: i32>(a: *mut u32, b: uint32x2x3_t) {
+ static_assert_imm1!(LANE);
+ transmute(vst3_lane_s32::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst3, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst3q_lane_u16<const LANE: i32>(a: *mut u16, b: uint16x8x3_t) {
+ static_assert_imm3!(LANE);
+ transmute(vst3q_lane_s16::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst3, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst3q_lane_u32<const LANE: i32>(a: *mut u32, b: uint32x4x3_t) {
+ static_assert_imm2!(LANE);
+ transmute(vst3q_lane_s32::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst3, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst3_lane_p8<const LANE: i32>(a: *mut p8, b: poly8x8x3_t) {
+ static_assert_imm3!(LANE);
+ transmute(vst3_lane_s8::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst3, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst3_lane_p16<const LANE: i32>(a: *mut p16, b: poly16x4x3_t) {
+ static_assert_imm2!(LANE);
+ transmute(vst3_lane_s16::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst3, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst3q_lane_p16<const LANE: i32>(a: *mut p16, b: poly16x8x3_t) {
+ static_assert_imm3!(LANE);
+ transmute(vst3q_lane_s16::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vst3_lane_f32<const LANE: i32>(a: *mut f32, b: float32x2x3_t) {
+ static_assert_imm1!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst3lane.p0i8.v2f32")]
+ fn vst3_lane_f32_(ptr: *mut i8, a: float32x2_t, b: float32x2_t, c: float32x2_t, n: i32, size: i32);
+ }
+vst3_lane_f32_(a as _, b.0, b.1, b.2, LANE, 4)
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst3_lane_f32<const LANE: i32>(a: *mut f32, b: float32x2x3_t) {
+ static_assert_imm1!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st3lane.v2f32.p0i8")]
+ fn vst3_lane_f32_(a: float32x2_t, b: float32x2_t, c: float32x2_t, n: i64, ptr: *mut i8);
+ }
+vst3_lane_f32_(b.0, b.1, b.2, LANE as i64, a as _)
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vst3q_lane_f32<const LANE: i32>(a: *mut f32, b: float32x4x3_t) {
+ static_assert_imm2!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst3lane.p0i8.v4f32")]
+ fn vst3q_lane_f32_(ptr: *mut i8, a: float32x4_t, b: float32x4_t, c: float32x4_t, n: i32, size: i32);
+ }
+vst3q_lane_f32_(a as _, b.0, b.1, b.2, LANE, 4)
+}
+
+/// Store multiple 3-element structures from three registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st3, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst3q_lane_f32<const LANE: i32>(a: *mut f32, b: float32x4x3_t) {
+ static_assert_imm2!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st3lane.v4f32.p0i8")]
+ fn vst3q_lane_f32_(a: float32x4_t, b: float32x4_t, c: float32x4_t, n: i64, ptr: *mut i8);
+ }
+vst3q_lane_f32_(b.0, b.1, b.2, LANE as i64, a as _)
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst4))]
+pub unsafe fn vst4_s8(a: *mut i8, b: int8x8x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst4.p0i8.v8i8")]
+ fn vst4_s8_(ptr: *mut i8, a: int8x8_t, b: int8x8_t, c: int8x8_t, d: int8x8_t, size: i32);
+ }
+vst4_s8_(a as _, b.0, b.1, b.2, b.3, 1)
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st4))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst4_s8(a: *mut i8, b: int8x8x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st4.v8i8.p0i8")]
+ fn vst4_s8_(a: int8x8_t, b: int8x8_t, c: int8x8_t, d: int8x8_t, ptr: *mut i8);
+ }
+vst4_s8_(b.0, b.1, b.2, b.3, a as _)
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst4))]
+pub unsafe fn vst4_s16(a: *mut i16, b: int16x4x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst4.p0i8.v4i16")]
+ fn vst4_s16_(ptr: *mut i8, a: int16x4_t, b: int16x4_t, c: int16x4_t, d: int16x4_t, size: i32);
+ }
+vst4_s16_(a as _, b.0, b.1, b.2, b.3, 2)
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st4))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst4_s16(a: *mut i16, b: int16x4x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st4.v4i16.p0i8")]
+ fn vst4_s16_(a: int16x4_t, b: int16x4_t, c: int16x4_t, d: int16x4_t, ptr: *mut i8);
+ }
+vst4_s16_(b.0, b.1, b.2, b.3, a as _)
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst4))]
+pub unsafe fn vst4_s32(a: *mut i32, b: int32x2x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst4.p0i8.v2i32")]
+ fn vst4_s32_(ptr: *mut i8, a: int32x2_t, b: int32x2_t, c: int32x2_t, d: int32x2_t, size: i32);
+ }
+vst4_s32_(a as _, b.0, b.1, b.2, b.3, 4)
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st4))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst4_s32(a: *mut i32, b: int32x2x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st4.v2i32.p0i8")]
+ fn vst4_s32_(a: int32x2_t, b: int32x2_t, c: int32x2_t, d: int32x2_t, ptr: *mut i8);
+ }
+vst4_s32_(b.0, b.1, b.2, b.3, a as _)
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst4))]
+pub unsafe fn vst4q_s8(a: *mut i8, b: int8x16x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst4.p0i8.v16i8")]
+ fn vst4q_s8_(ptr: *mut i8, a: int8x16_t, b: int8x16_t, c: int8x16_t, d: int8x16_t, size: i32);
+ }
+vst4q_s8_(a as _, b.0, b.1, b.2, b.3, 1)
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st4))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst4q_s8(a: *mut i8, b: int8x16x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st4.v16i8.p0i8")]
+ fn vst4q_s8_(a: int8x16_t, b: int8x16_t, c: int8x16_t, d: int8x16_t, ptr: *mut i8);
+ }
+vst4q_s8_(b.0, b.1, b.2, b.3, a as _)
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst4))]
+pub unsafe fn vst4q_s16(a: *mut i16, b: int16x8x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst4.p0i8.v8i16")]
+ fn vst4q_s16_(ptr: *mut i8, a: int16x8_t, b: int16x8_t, c: int16x8_t, d: int16x8_t, size: i32);
+ }
+vst4q_s16_(a as _, b.0, b.1, b.2, b.3, 2)
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st4))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst4q_s16(a: *mut i16, b: int16x8x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st4.v8i16.p0i8")]
+ fn vst4q_s16_(a: int16x8_t, b: int16x8_t, c: int16x8_t, d: int16x8_t, ptr: *mut i8);
+ }
+vst4q_s16_(b.0, b.1, b.2, b.3, a as _)
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst4))]
+pub unsafe fn vst4q_s32(a: *mut i32, b: int32x4x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst4.p0i8.v4i32")]
+ fn vst4q_s32_(ptr: *mut i8, a: int32x4_t, b: int32x4_t, c: int32x4_t, d: int32x4_t, size: i32);
+ }
+vst4q_s32_(a as _, b.0, b.1, b.2, b.3, 4)
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st4))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst4q_s32(a: *mut i32, b: int32x4x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st4.v4i32.p0i8")]
+ fn vst4q_s32_(a: int32x4_t, b: int32x4_t, c: int32x4_t, d: int32x4_t, ptr: *mut i8);
+ }
+vst4q_s32_(b.0, b.1, b.2, b.3, a as _)
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(nop))]
+pub unsafe fn vst4_s64(a: *mut i64, b: int64x1x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst4.p0i8.v1i64")]
+ fn vst4_s64_(ptr: *mut i8, a: int64x1_t, b: int64x1_t, c: int64x1_t, d: int64x1_t, size: i32);
+ }
+vst4_s64_(a as _, b.0, b.1, b.2, b.3, 8)
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(nop))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst4_s64(a: *mut i64, b: int64x1x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st4.v1i64.p0i8")]
+ fn vst4_s64_(a: int64x1_t, b: int64x1_t, c: int64x1_t, d: int64x1_t, ptr: *mut i8);
+ }
+vst4_s64_(b.0, b.1, b.2, b.3, a as _)
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st4))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst4_u8(a: *mut u8, b: uint8x8x4_t) {
+ transmute(vst4_s8(transmute(a), transmute(b)))
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st4))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst4_u16(a: *mut u16, b: uint16x4x4_t) {
+ transmute(vst4_s16(transmute(a), transmute(b)))
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st4))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst4_u32(a: *mut u32, b: uint32x2x4_t) {
+ transmute(vst4_s32(transmute(a), transmute(b)))
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st4))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst4q_u8(a: *mut u8, b: uint8x16x4_t) {
+ transmute(vst4q_s8(transmute(a), transmute(b)))
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st4))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst4q_u16(a: *mut u16, b: uint16x8x4_t) {
+ transmute(vst4q_s16(transmute(a), transmute(b)))
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st4))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst4q_u32(a: *mut u32, b: uint32x4x4_t) {
+ transmute(vst4q_s32(transmute(a), transmute(b)))
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st4))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst4_p8(a: *mut p8, b: poly8x8x4_t) {
+ transmute(vst4_s8(transmute(a), transmute(b)))
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st4))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst4_p16(a: *mut p16, b: poly16x4x4_t) {
+ transmute(vst4_s16(transmute(a), transmute(b)))
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st4))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst4q_p8(a: *mut p8, b: poly8x16x4_t) {
+ transmute(vst4q_s8(transmute(a), transmute(b)))
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst4))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st4))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst4q_p16(a: *mut p16, b: poly16x8x4_t) {
+ transmute(vst4q_s16(transmute(a), transmute(b)))
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst4_u64(a: *mut u64, b: uint64x1x4_t) {
+ transmute(vst4_s64(transmute(a), transmute(b)))
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst4_p64(a: *mut p64, b: poly64x1x4_t) {
+ transmute(vst4_s64(transmute(a), transmute(b)))
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst4))]
+pub unsafe fn vst4_f32(a: *mut f32, b: float32x2x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst4.p0i8.v2f32")]
+ fn vst4_f32_(ptr: *mut i8, a: float32x2_t, b: float32x2_t, c: float32x2_t, d: float32x2_t, size: i32);
+ }
+vst4_f32_(a as _, b.0, b.1, b.2, b.3, 4)
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st4))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst4_f32(a: *mut f32, b: float32x2x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st4.v2f32.p0i8")]
+ fn vst4_f32_(a: float32x2_t, b: float32x2_t, c: float32x2_t, d: float32x2_t, ptr: *mut i8);
+ }
+vst4_f32_(b.0, b.1, b.2, b.3, a as _)
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst4))]
+pub unsafe fn vst4q_f32(a: *mut f32, b: float32x4x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst4.p0i8.v4f32")]
+ fn vst4q_f32_(ptr: *mut i8, a: float32x4_t, b: float32x4_t, c: float32x4_t, d: float32x4_t, size: i32);
+ }
+vst4q_f32_(a as _, b.0, b.1, b.2, b.3, 4)
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st4))]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst4q_f32(a: *mut f32, b: float32x4x4_t) {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st4.v4f32.p0i8")]
+ fn vst4q_f32_(a: float32x4_t, b: float32x4_t, c: float32x4_t, d: float32x4_t, ptr: *mut i8);
+ }
+vst4q_f32_(b.0, b.1, b.2, b.3, a as _)
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vst4_lane_s8<const LANE: i32>(a: *mut i8, b: int8x8x4_t) {
+ static_assert_imm3!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst4lane.p0i8.v8i8")]
+ fn vst4_lane_s8_(ptr: *mut i8, a: int8x8_t, b: int8x8_t, c: int8x8_t, d: int8x8_t, n: i32, size: i32);
+ }
+vst4_lane_s8_(a as _, b.0, b.1, b.2, b.3, LANE, 1)
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst4_lane_s8<const LANE: i32>(a: *mut i8, b: int8x8x4_t) {
+ static_assert_imm3!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st4lane.v8i8.p0i8")]
+ fn vst4_lane_s8_(a: int8x8_t, b: int8x8_t, c: int8x8_t, d: int8x8_t, n: i64, ptr: *mut i8);
+ }
+vst4_lane_s8_(b.0, b.1, b.2, b.3, LANE as i64, a as _)
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vst4_lane_s16<const LANE: i32>(a: *mut i16, b: int16x4x4_t) {
+ static_assert_imm2!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst4lane.p0i8.v4i16")]
+ fn vst4_lane_s16_(ptr: *mut i8, a: int16x4_t, b: int16x4_t, c: int16x4_t, d: int16x4_t, n: i32, size: i32);
+ }
+vst4_lane_s16_(a as _, b.0, b.1, b.2, b.3, LANE, 2)
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst4_lane_s16<const LANE: i32>(a: *mut i16, b: int16x4x4_t) {
+ static_assert_imm2!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st4lane.v4i16.p0i8")]
+ fn vst4_lane_s16_(a: int16x4_t, b: int16x4_t, c: int16x4_t, d: int16x4_t, n: i64, ptr: *mut i8);
+ }
+vst4_lane_s16_(b.0, b.1, b.2, b.3, LANE as i64, a as _)
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vst4_lane_s32<const LANE: i32>(a: *mut i32, b: int32x2x4_t) {
+ static_assert_imm1!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst4lane.p0i8.v2i32")]
+ fn vst4_lane_s32_(ptr: *mut i8, a: int32x2_t, b: int32x2_t, c: int32x2_t, d: int32x2_t, n: i32, size: i32);
+ }
+vst4_lane_s32_(a as _, b.0, b.1, b.2, b.3, LANE, 4)
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst4_lane_s32<const LANE: i32>(a: *mut i32, b: int32x2x4_t) {
+ static_assert_imm1!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st4lane.v2i32.p0i8")]
+ fn vst4_lane_s32_(a: int32x2_t, b: int32x2_t, c: int32x2_t, d: int32x2_t, n: i64, ptr: *mut i8);
+ }
+vst4_lane_s32_(b.0, b.1, b.2, b.3, LANE as i64, a as _)
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vst4q_lane_s16<const LANE: i32>(a: *mut i16, b: int16x8x4_t) {
+ static_assert_imm3!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst4lane.p0i8.v8i16")]
+ fn vst4q_lane_s16_(ptr: *mut i8, a: int16x8_t, b: int16x8_t, c: int16x8_t, d: int16x8_t, n: i32, size: i32);
+ }
+vst4q_lane_s16_(a as _, b.0, b.1, b.2, b.3, LANE, 2)
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst4q_lane_s16<const LANE: i32>(a: *mut i16, b: int16x8x4_t) {
+ static_assert_imm3!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st4lane.v8i16.p0i8")]
+ fn vst4q_lane_s16_(a: int16x8_t, b: int16x8_t, c: int16x8_t, d: int16x8_t, n: i64, ptr: *mut i8);
+ }
+vst4q_lane_s16_(b.0, b.1, b.2, b.3, LANE as i64, a as _)
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vst4q_lane_s32<const LANE: i32>(a: *mut i32, b: int32x4x4_t) {
+ static_assert_imm2!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst4lane.p0i8.v4i32")]
+ fn vst4q_lane_s32_(ptr: *mut i8, a: int32x4_t, b: int32x4_t, c: int32x4_t, d: int32x4_t, n: i32, size: i32);
+ }
+vst4q_lane_s32_(a as _, b.0, b.1, b.2, b.3, LANE, 4)
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst4q_lane_s32<const LANE: i32>(a: *mut i32, b: int32x4x4_t) {
+ static_assert_imm2!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st4lane.v4i32.p0i8")]
+ fn vst4q_lane_s32_(a: int32x4_t, b: int32x4_t, c: int32x4_t, d: int32x4_t, n: i64, ptr: *mut i8);
+ }
+vst4q_lane_s32_(b.0, b.1, b.2, b.3, LANE as i64, a as _)
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst4, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst4_lane_u8<const LANE: i32>(a: *mut u8, b: uint8x8x4_t) {
+ static_assert_imm3!(LANE);
+ transmute(vst4_lane_s8::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst4, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst4_lane_u16<const LANE: i32>(a: *mut u16, b: uint16x4x4_t) {
+ static_assert_imm2!(LANE);
+ transmute(vst4_lane_s16::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst4, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst4_lane_u32<const LANE: i32>(a: *mut u32, b: uint32x2x4_t) {
+ static_assert_imm1!(LANE);
+ transmute(vst4_lane_s32::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst4, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst4q_lane_u16<const LANE: i32>(a: *mut u16, b: uint16x8x4_t) {
+ static_assert_imm3!(LANE);
+ transmute(vst4q_lane_s16::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst4, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst4q_lane_u32<const LANE: i32>(a: *mut u32, b: uint32x4x4_t) {
+ static_assert_imm2!(LANE);
+ transmute(vst4q_lane_s32::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst4, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst4_lane_p8<const LANE: i32>(a: *mut p8, b: poly8x8x4_t) {
+ static_assert_imm3!(LANE);
+ transmute(vst4_lane_s8::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst4, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst4_lane_p16<const LANE: i32>(a: *mut p16, b: poly16x4x4_t) {
+ static_assert_imm2!(LANE);
+ transmute(vst4_lane_s16::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vst4, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(st4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vst4q_lane_p16<const LANE: i32>(a: *mut p16, b: poly16x8x4_t) {
+ static_assert_imm3!(LANE);
+ transmute(vst4q_lane_s16::<LANE>(transmute(a), transmute(b)))
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vst4_lane_f32<const LANE: i32>(a: *mut f32, b: float32x2x4_t) {
+ static_assert_imm1!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst4lane.p0i8.v2f32")]
+ fn vst4_lane_f32_(ptr: *mut i8, a: float32x2_t, b: float32x2_t, c: float32x2_t, d: float32x2_t, n: i32, size: i32);
+ }
+vst4_lane_f32_(a as _, b.0, b.1, b.2, b.3, LANE, 4)
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst4_lane_f32<const LANE: i32>(a: *mut f32, b: float32x2x4_t) {
+ static_assert_imm1!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st4lane.v2f32.p0i8")]
+ fn vst4_lane_f32_(a: float32x2_t, b: float32x2_t, c: float32x2_t, d: float32x2_t, n: i64, ptr: *mut i8);
+ }
+vst4_lane_f32_(b.0, b.1, b.2, b.3, LANE as i64, a as _)
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vst4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn vst4q_lane_f32<const LANE: i32>(a: *mut f32, b: float32x4x4_t) {
+ static_assert_imm2!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst4lane.p0i8.v4f32")]
+ fn vst4q_lane_f32_(ptr: *mut i8, a: float32x4_t, b: float32x4_t, c: float32x4_t, d: float32x4_t, n: i32, size: i32);
+ }
+vst4q_lane_f32_(a as _, b.0, b.1, b.2, b.3, LANE, 4)
+}
+
+/// Store multiple 4-element structures from four registers
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(st4, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vst4q_lane_f32<const LANE: i32>(a: *mut f32, b: float32x4x4_t) {
+ static_assert_imm2!(LANE);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.st4lane.v4f32.p0i8")]
+ fn vst4q_lane_f32_(a: float32x4_t, b: float32x4_t, c: float32x4_t, d: float32x4_t, n: i64, ptr: *mut i8);
+ }
+vst4q_lane_f32_(b.0, b.1, b.2, b.3, LANE as i64, a as _)
+}
+
+/// Multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmul.i8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mul))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmul_s8(a: int8x8_t, b: int8x8_t) -> int8x8_t {
+ simd_mul(a, b)
+}
+
+/// Multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmul.i8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mul))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmulq_s8(a: int8x16_t, b: int8x16_t) -> int8x16_t {
+ simd_mul(a, b)
+}
+
+/// Multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmul.i16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mul))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmul_s16(a: int16x4_t, b: int16x4_t) -> int16x4_t {
+ simd_mul(a, b)
+}
+
+/// Multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmul.i16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mul))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmulq_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t {
+ simd_mul(a, b)
+}
+
+/// Multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmul.i32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mul))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmul_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t {
+ simd_mul(a, b)
+}
+
+/// Multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmul.i32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mul))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmulq_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t {
+ simd_mul(a, b)
+}
+
+/// Multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmul.i8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mul))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmul_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t {
+ simd_mul(a, b)
+}
+
+/// Multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmul.i8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mul))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmulq_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t {
+ simd_mul(a, b)
+}
+
+/// Multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmul.i16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mul))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmul_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t {
+ simd_mul(a, b)
+}
+
+/// Multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmul.i16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mul))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmulq_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t {
+ simd_mul(a, b)
+}
+
+/// Multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmul.i32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mul))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmul_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t {
+ simd_mul(a, b)
+}
+
+/// Multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmul.i32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mul))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmulq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
+ simd_mul(a, b)
+}
+
+/// Polynomial multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmul))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(pmul))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmul_p8(a: poly8x8_t, b: poly8x8_t) -> poly8x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmulp.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.pmul.v8i8")]
+ fn vmul_p8_(a: poly8x8_t, b: poly8x8_t) -> poly8x8_t;
+ }
+vmul_p8_(a, b)
+}
+
+/// Polynomial multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmul))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(pmul))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmulq_p8(a: poly8x16_t, b: poly8x16_t) -> poly8x16_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmulp.v16i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.pmul.v16i8")]
+ fn vmulq_p8_(a: poly8x16_t, b: poly8x16_t) -> poly8x16_t;
+ }
+vmulq_p8_(a, b)
+}
+
+/// Multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmul.f32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmul))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmul_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t {
+ simd_mul(a, b)
+}
+
+/// Multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmul.f32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmul))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmulq_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t {
+ simd_mul(a, b)
+}
+
+/// Vector multiply by scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmul))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mul))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmul_n_s16(a: int16x4_t, b: i16) -> int16x4_t {
+ simd_mul(a, vdup_n_s16(b))
+}
+
+/// Vector multiply by scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmul))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mul))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmulq_n_s16(a: int16x8_t, b: i16) -> int16x8_t {
+ simd_mul(a, vdupq_n_s16(b))
+}
+
+/// Vector multiply by scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmul))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mul))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmul_n_s32(a: int32x2_t, b: i32) -> int32x2_t {
+ simd_mul(a, vdup_n_s32(b))
+}
+
+/// Vector multiply by scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmul))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mul))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmulq_n_s32(a: int32x4_t, b: i32) -> int32x4_t {
+ simd_mul(a, vdupq_n_s32(b))
+}
+
+/// Vector multiply by scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmul))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mul))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmul_n_u16(a: uint16x4_t, b: u16) -> uint16x4_t {
+ simd_mul(a, vdup_n_u16(b))
+}
+
+/// Vector multiply by scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmul))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mul))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmulq_n_u16(a: uint16x8_t, b: u16) -> uint16x8_t {
+ simd_mul(a, vdupq_n_u16(b))
+}
+
+/// Vector multiply by scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmul))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mul))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmul_n_u32(a: uint32x2_t, b: u32) -> uint32x2_t {
+ simd_mul(a, vdup_n_u32(b))
+}
+
+/// Vector multiply by scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmul))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mul))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmulq_n_u32(a: uint32x4_t, b: u32) -> uint32x4_t {
+ simd_mul(a, vdupq_n_u32(b))
+}
+
+/// Vector multiply by scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmul))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmul))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmul_n_f32(a: float32x2_t, b: f32) -> float32x2_t {
+ simd_mul(a, vdup_n_f32(b))
+}
+
+/// Vector multiply by scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmul))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmul))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmulq_n_f32(a: float32x4_t, b: f32) -> float32x4_t {
+ simd_mul(a, vdupq_n_f32(b))
+}
+
+/// Multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmul, LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mul, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmul_lane_s16<const LANE: i32>(a: int16x4_t, b: int16x4_t) -> int16x4_t {
+ static_assert_imm2!(LANE);
+ simd_mul(a, simd_shuffle4!(b, b, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmul, LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mul, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmul_laneq_s16<const LANE: i32>(a: int16x4_t, b: int16x8_t) -> int16x4_t {
+ static_assert_imm3!(LANE);
+ simd_mul(a, simd_shuffle4!(b, b, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmul, LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mul, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmulq_lane_s16<const LANE: i32>(a: int16x8_t, b: int16x4_t) -> int16x8_t {
+ static_assert_imm2!(LANE);
+ simd_mul(a, simd_shuffle8!(b, b, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmul, LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mul, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmulq_laneq_s16<const LANE: i32>(a: int16x8_t, b: int16x8_t) -> int16x8_t {
+ static_assert_imm3!(LANE);
+ simd_mul(a, simd_shuffle8!(b, b, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmul, LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mul, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmul_lane_s32<const LANE: i32>(a: int32x2_t, b: int32x2_t) -> int32x2_t {
+ static_assert_imm1!(LANE);
+ simd_mul(a, simd_shuffle2!(b, b, <const LANE: i32> [LANE as u32, LANE as u32]))
+}
+
+/// Multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmul, LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mul, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmul_laneq_s32<const LANE: i32>(a: int32x2_t, b: int32x4_t) -> int32x2_t {
+ static_assert_imm2!(LANE);
+ simd_mul(a, simd_shuffle2!(b, b, <const LANE: i32> [LANE as u32, LANE as u32]))
+}
+
+/// Multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmul, LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mul, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmulq_lane_s32<const LANE: i32>(a: int32x4_t, b: int32x2_t) -> int32x4_t {
+ static_assert_imm1!(LANE);
+ simd_mul(a, simd_shuffle4!(b, b, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmul, LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mul, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmulq_laneq_s32<const LANE: i32>(a: int32x4_t, b: int32x4_t) -> int32x4_t {
+ static_assert_imm2!(LANE);
+ simd_mul(a, simd_shuffle4!(b, b, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmul, LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mul, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmul_lane_u16<const LANE: i32>(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t {
+ static_assert_imm2!(LANE);
+ simd_mul(a, simd_shuffle4!(b, b, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmul, LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mul, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmul_laneq_u16<const LANE: i32>(a: uint16x4_t, b: uint16x8_t) -> uint16x4_t {
+ static_assert_imm3!(LANE);
+ simd_mul(a, simd_shuffle4!(b, b, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmul, LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mul, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmulq_lane_u16<const LANE: i32>(a: uint16x8_t, b: uint16x4_t) -> uint16x8_t {
+ static_assert_imm2!(LANE);
+ simd_mul(a, simd_shuffle8!(b, b, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmul, LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mul, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmulq_laneq_u16<const LANE: i32>(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t {
+ static_assert_imm3!(LANE);
+ simd_mul(a, simd_shuffle8!(b, b, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmul, LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mul, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmul_lane_u32<const LANE: i32>(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t {
+ static_assert_imm1!(LANE);
+ simd_mul(a, simd_shuffle2!(b, b, <const LANE: i32> [LANE as u32, LANE as u32]))
+}
+
+/// Multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmul, LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mul, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmul_laneq_u32<const LANE: i32>(a: uint32x2_t, b: uint32x4_t) -> uint32x2_t {
+ static_assert_imm2!(LANE);
+ simd_mul(a, simd_shuffle2!(b, b, <const LANE: i32> [LANE as u32, LANE as u32]))
+}
+
+/// Multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmul, LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mul, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmulq_lane_u32<const LANE: i32>(a: uint32x4_t, b: uint32x2_t) -> uint32x4_t {
+ static_assert_imm1!(LANE);
+ simd_mul(a, simd_shuffle4!(b, b, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmul, LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mul, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmulq_laneq_u32<const LANE: i32>(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
+ static_assert_imm2!(LANE);
+ simd_mul(a, simd_shuffle4!(b, b, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Floating-point multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmul, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmul, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmul_lane_f32<const LANE: i32>(a: float32x2_t, b: float32x2_t) -> float32x2_t {
+ static_assert_imm1!(LANE);
+ simd_mul(a, simd_shuffle2!(b, b, <const LANE: i32> [LANE as u32, LANE as u32]))
+}
+
+/// Floating-point multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmul, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmul, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmul_laneq_f32<const LANE: i32>(a: float32x2_t, b: float32x4_t) -> float32x2_t {
+ static_assert_imm2!(LANE);
+ simd_mul(a, simd_shuffle2!(b, b, <const LANE: i32> [LANE as u32, LANE as u32]))
+}
+
+/// Floating-point multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmul, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmul, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmulq_lane_f32<const LANE: i32>(a: float32x4_t, b: float32x2_t) -> float32x4_t {
+ static_assert_imm1!(LANE);
+ simd_mul(a, simd_shuffle4!(b, b, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Floating-point multiply
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmul, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmul, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmulq_laneq_f32<const LANE: i32>(a: float32x4_t, b: float32x4_t) -> float32x4_t {
+ static_assert_imm2!(LANE);
+ simd_mul(a, simd_shuffle4!(b, b, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Signed multiply long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmull.s8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smull))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmull_s8(a: int8x8_t, b: int8x8_t) -> int16x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmulls.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.smull.v8i8")]
+ fn vmull_s8_(a: int8x8_t, b: int8x8_t) -> int16x8_t;
+ }
+vmull_s8_(a, b)
+}
+
+/// Signed multiply long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmull.s16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smull))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmull_s16(a: int16x4_t, b: int16x4_t) -> int32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmulls.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.smull.v4i16")]
+ fn vmull_s16_(a: int16x4_t, b: int16x4_t) -> int32x4_t;
+ }
+vmull_s16_(a, b)
+}
+
+/// Signed multiply long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmull.s32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smull))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmull_s32(a: int32x2_t, b: int32x2_t) -> int64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmulls.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.smull.v2i32")]
+ fn vmull_s32_(a: int32x2_t, b: int32x2_t) -> int64x2_t;
+ }
+vmull_s32_(a, b)
+}
+
+/// Unsigned multiply long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmull.u8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(umull))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmull_u8(a: uint8x8_t, b: uint8x8_t) -> uint16x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmullu.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.umull.v8i8")]
+ fn vmull_u8_(a: uint8x8_t, b: uint8x8_t) -> uint16x8_t;
+ }
+vmull_u8_(a, b)
+}
+
+/// Unsigned multiply long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmull.u16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(umull))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmull_u16(a: uint16x4_t, b: uint16x4_t) -> uint32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmullu.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.umull.v4i16")]
+ fn vmull_u16_(a: uint16x4_t, b: uint16x4_t) -> uint32x4_t;
+ }
+vmull_u16_(a, b)
+}
+
+/// Unsigned multiply long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmull.u32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(umull))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmull_u32(a: uint32x2_t, b: uint32x2_t) -> uint64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmullu.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.umull.v2i32")]
+ fn vmull_u32_(a: uint32x2_t, b: uint32x2_t) -> uint64x2_t;
+ }
+vmull_u32_(a, b)
+}
+
+/// Polynomial multiply long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmull.p8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(pmull))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmull_p8(a: poly8x8_t, b: poly8x8_t) -> poly16x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmullp.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.pmull.v8i8")]
+ fn vmull_p8_(a: poly8x8_t, b: poly8x8_t) -> poly16x8_t;
+ }
+vmull_p8_(a, b)
+}
+
+/// Vector long multiply with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmull))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smull))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmull_n_s16(a: int16x4_t, b: i16) -> int32x4_t {
+ vmull_s16(a, vdup_n_s16(b))
+}
+
+/// Vector long multiply with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmull))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smull))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmull_n_s32(a: int32x2_t, b: i32) -> int64x2_t {
+ vmull_s32(a, vdup_n_s32(b))
+}
+
+/// Vector long multiply with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmull))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(umull))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmull_n_u16(a: uint16x4_t, b: u16) -> uint32x4_t {
+ vmull_u16(a, vdup_n_u16(b))
+}
+
+/// Vector long multiply with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmull))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(umull))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmull_n_u32(a: uint32x2_t, b: u32) -> uint64x2_t {
+ vmull_u32(a, vdup_n_u32(b))
+}
+
+/// Vector long multiply by scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmull, LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smull, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmull_lane_s16<const LANE: i32>(a: int16x4_t, b: int16x4_t) -> int32x4_t {
+ static_assert_imm2!(LANE);
+ vmull_s16(a, simd_shuffle4!(b, b, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Vector long multiply by scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmull, LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smull, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmull_laneq_s16<const LANE: i32>(a: int16x4_t, b: int16x8_t) -> int32x4_t {
+ static_assert_imm3!(LANE);
+ vmull_s16(a, simd_shuffle4!(b, b, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Vector long multiply by scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmull, LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smull, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmull_lane_s32<const LANE: i32>(a: int32x2_t, b: int32x2_t) -> int64x2_t {
+ static_assert_imm1!(LANE);
+ vmull_s32(a, simd_shuffle2!(b, b, <const LANE: i32> [LANE as u32, LANE as u32]))
+}
+
+/// Vector long multiply by scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmull, LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smull, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmull_laneq_s32<const LANE: i32>(a: int32x2_t, b: int32x4_t) -> int64x2_t {
+ static_assert_imm2!(LANE);
+ vmull_s32(a, simd_shuffle2!(b, b, <const LANE: i32> [LANE as u32, LANE as u32]))
+}
+
+/// Vector long multiply by scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmull, LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(umull, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmull_lane_u16<const LANE: i32>(a: uint16x4_t, b: uint16x4_t) -> uint32x4_t {
+ static_assert_imm2!(LANE);
+ vmull_u16(a, simd_shuffle4!(b, b, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Vector long multiply by scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmull, LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(umull, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmull_laneq_u16<const LANE: i32>(a: uint16x4_t, b: uint16x8_t) -> uint32x4_t {
+ static_assert_imm3!(LANE);
+ vmull_u16(a, simd_shuffle4!(b, b, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]))
+}
+
+/// Vector long multiply by scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmull, LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(umull, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmull_lane_u32<const LANE: i32>(a: uint32x2_t, b: uint32x2_t) -> uint64x2_t {
+ static_assert_imm1!(LANE);
+ vmull_u32(a, simd_shuffle2!(b, b, <const LANE: i32> [LANE as u32, LANE as u32]))
+}
+
+/// Vector long multiply by scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmull, LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(umull, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmull_laneq_u32<const LANE: i32>(a: uint32x2_t, b: uint32x4_t) -> uint64x2_t {
+ static_assert_imm2!(LANE);
+ vmull_u32(a, simd_shuffle2!(b, b, <const LANE: i32> [LANE as u32, LANE as u32]))
+}
+
+/// Floating-point fused Multiply-Add to accumulator(vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "vfp4"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vfma))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmla))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vfma_f32(a: float32x2_t, b: float32x2_t, c: float32x2_t) -> float32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.fma.v2f32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.fma.v2f32")]
+ fn vfma_f32_(a: float32x2_t, b: float32x2_t, c: float32x2_t) -> float32x2_t;
+ }
+vfma_f32_(b, c, a)
+}
+
+/// Floating-point fused Multiply-Add to accumulator(vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "vfp4"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vfma))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmla))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vfmaq_f32(a: float32x4_t, b: float32x4_t, c: float32x4_t) -> float32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.fma.v4f32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.fma.v4f32")]
+ fn vfmaq_f32_(a: float32x4_t, b: float32x4_t, c: float32x4_t) -> float32x4_t;
+ }
+vfmaq_f32_(b, c, a)
+}
+
+/// Floating-point fused Multiply-Add to accumulator(vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "vfp4"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vfma))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmla))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vfma_n_f32(a: float32x2_t, b: float32x2_t, c: f32) -> float32x2_t {
+ vfma_f32(a, b, vdup_n_f32_vfp4(c))
+}
+
+/// Floating-point fused Multiply-Add to accumulator(vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "vfp4"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vfma))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmla))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vfmaq_n_f32(a: float32x4_t, b: float32x4_t, c: f32) -> float32x4_t {
+ vfmaq_f32(a, b, vdupq_n_f32_vfp4(c))
+}
+
+/// Floating-point fused multiply-subtract from accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "vfp4"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vfms))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmls))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vfms_f32(a: float32x2_t, b: float32x2_t, c: float32x2_t) -> float32x2_t {
+ let b: float32x2_t = simd_neg(b);
+ vfma_f32(a, b, c)
+}
+
+/// Floating-point fused multiply-subtract from accumulator
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "vfp4"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vfms))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmls))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vfmsq_f32(a: float32x4_t, b: float32x4_t, c: float32x4_t) -> float32x4_t {
+ let b: float32x4_t = simd_neg(b);
+ vfmaq_f32(a, b, c)
+}
+
+/// Floating-point fused Multiply-subtract to accumulator(vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "vfp4"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vfms))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmls))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vfms_n_f32(a: float32x2_t, b: float32x2_t, c: f32) -> float32x2_t {
+ vfms_f32(a, b, vdup_n_f32_vfp4(c))
+}
+
+/// Floating-point fused Multiply-subtract to accumulator(vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "vfp4"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vfms))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmls))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vfmsq_n_f32(a: float32x4_t, b: float32x4_t, c: f32) -> float32x4_t {
+ vfmsq_f32(a, b, vdupq_n_f32_vfp4(c))
+}
+
+/// Subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vsub.i8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsub_s8(a: int8x8_t, b: int8x8_t) -> int8x8_t {
+ simd_sub(a, b)
+}
+
+/// Subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vsub.i8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsubq_s8(a: int8x16_t, b: int8x16_t) -> int8x16_t {
+ simd_sub(a, b)
+}
+
+/// Subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vsub.i16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsub_s16(a: int16x4_t, b: int16x4_t) -> int16x4_t {
+ simd_sub(a, b)
+}
+
+/// Subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vsub.i16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsubq_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t {
+ simd_sub(a, b)
+}
+
+/// Subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vsub.i32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsub_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t {
+ simd_sub(a, b)
+}
+
+/// Subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vsub.i32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsubq_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t {
+ simd_sub(a, b)
+}
+
+/// Subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vsub.i8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsub_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t {
+ simd_sub(a, b)
+}
+
+/// Subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vsub.i8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsubq_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t {
+ simd_sub(a, b)
+}
+
+/// Subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vsub.i16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsub_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t {
+ simd_sub(a, b)
+}
+
+/// Subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vsub.i16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsubq_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t {
+ simd_sub(a, b)
+}
+
+/// Subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vsub.i32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsub_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t {
+ simd_sub(a, b)
+}
+
+/// Subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vsub.i32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsubq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
+ simd_sub(a, b)
+}
+
+/// Subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vsub.i64"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsub_s64(a: int64x1_t, b: int64x1_t) -> int64x1_t {
+ simd_sub(a, b)
+}
+
+/// Subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vsub.i64"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsubq_s64(a: int64x2_t, b: int64x2_t) -> int64x2_t {
+ simd_sub(a, b)
+}
+
+/// Subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vsub.i64"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsub_u64(a: uint64x1_t, b: uint64x1_t) -> uint64x1_t {
+ simd_sub(a, b)
+}
+
+/// Subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vsub.i64"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsubq_u64(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t {
+ simd_sub(a, b)
+}
+
+/// Subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vsub.f32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fsub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsub_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t {
+ simd_sub(a, b)
+}
+
+/// Subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vsub.f32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fsub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsubq_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t {
+ simd_sub(a, b)
+}
+
+/// Bitwise exclusive OR
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vadd_p8(a: poly8x8_t, b: poly8x8_t) -> poly8x8_t {
+ simd_xor(a, b)
+}
+
+/// Bitwise exclusive OR
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vadd_p16(a: poly16x4_t, b: poly16x4_t) -> poly16x4_t {
+ simd_xor(a, b)
+}
+
+/// Bitwise exclusive OR
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vaddq_p8(a: poly8x16_t, b: poly8x16_t) -> poly8x16_t {
+ simd_xor(a, b)
+}
+
+/// Bitwise exclusive OR
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vaddq_p16(a: poly16x8_t, b: poly16x8_t) -> poly16x8_t {
+ simd_xor(a, b)
+}
+
+/// Bitwise exclusive OR
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vadd_p64(a: poly64x1_t, b: poly64x1_t) -> poly64x1_t {
+ simd_xor(a, b)
+}
+
+/// Bitwise exclusive OR
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vaddq_p64(a: poly64x2_t, b: poly64x2_t) -> poly64x2_t {
+ simd_xor(a, b)
+}
+
+/// Bitwise exclusive OR
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vaddq_p128(a: p128, b: p128) -> p128 {
+ a ^ b
+}
+
+/// Subtract returning high narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsubhn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(subhn))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsubhn_s16(a: int16x8_t, b: int16x8_t) -> int8x8_t {
+ let c: i16x8 = i16x8::new(8, 8, 8, 8, 8, 8, 8, 8);
+ simd_cast(simd_shr(simd_sub(a, b), transmute(c)))
+}
+
+/// Subtract returning high narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsubhn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(subhn))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsubhn_s32(a: int32x4_t, b: int32x4_t) -> int16x4_t {
+ let c: i32x4 = i32x4::new(16, 16, 16, 16);
+ simd_cast(simd_shr(simd_sub(a, b), transmute(c)))
+}
+
+/// Subtract returning high narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsubhn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(subhn))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsubhn_s64(a: int64x2_t, b: int64x2_t) -> int32x2_t {
+ let c: i64x2 = i64x2::new(32, 32);
+ simd_cast(simd_shr(simd_sub(a, b), transmute(c)))
+}
+
+/// Subtract returning high narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsubhn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(subhn))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsubhn_u16(a: uint16x8_t, b: uint16x8_t) -> uint8x8_t {
+ let c: u16x8 = u16x8::new(8, 8, 8, 8, 8, 8, 8, 8);
+ simd_cast(simd_shr(simd_sub(a, b), transmute(c)))
+}
+
+/// Subtract returning high narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsubhn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(subhn))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsubhn_u32(a: uint32x4_t, b: uint32x4_t) -> uint16x4_t {
+ let c: u32x4 = u32x4::new(16, 16, 16, 16);
+ simd_cast(simd_shr(simd_sub(a, b), transmute(c)))
+}
+
+/// Subtract returning high narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsubhn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(subhn))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsubhn_u64(a: uint64x2_t, b: uint64x2_t) -> uint32x2_t {
+ let c: u64x2 = u64x2::new(32, 32);
+ simd_cast(simd_shr(simd_sub(a, b), transmute(c)))
+}
+
+/// Subtract returning high narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsubhn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(subhn2))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsubhn_high_s16(a: int8x8_t, b: int16x8_t, c: int16x8_t) -> int8x16_t {
+ let d: int8x8_t = vsubhn_s16(b, c);
+ simd_shuffle16!(a, d, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15])
+}
+
+/// Subtract returning high narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsubhn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(subhn2))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsubhn_high_s32(a: int16x4_t, b: int32x4_t, c: int32x4_t) -> int16x8_t {
+ let d: int16x4_t = vsubhn_s32(b, c);
+ simd_shuffle8!(a, d, [0, 1, 2, 3, 4, 5, 6, 7])
+}
+
+/// Subtract returning high narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsubhn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(subhn2))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsubhn_high_s64(a: int32x2_t, b: int64x2_t, c: int64x2_t) -> int32x4_t {
+ let d: int32x2_t = vsubhn_s64(b, c);
+ simd_shuffle4!(a, d, [0, 1, 2, 3])
+}
+
+/// Subtract returning high narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsubhn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(subhn2))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsubhn_high_u16(a: uint8x8_t, b: uint16x8_t, c: uint16x8_t) -> uint8x16_t {
+ let d: uint8x8_t = vsubhn_u16(b, c);
+ simd_shuffle16!(a, d, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15])
+}
+
+/// Subtract returning high narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsubhn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(subhn2))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsubhn_high_u32(a: uint16x4_t, b: uint32x4_t, c: uint32x4_t) -> uint16x8_t {
+ let d: uint16x4_t = vsubhn_u32(b, c);
+ simd_shuffle8!(a, d, [0, 1, 2, 3, 4, 5, 6, 7])
+}
+
+/// Subtract returning high narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsubhn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(subhn2))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsubhn_high_u64(a: uint32x2_t, b: uint64x2_t, c: uint64x2_t) -> uint32x4_t {
+ let d: uint32x2_t = vsubhn_u64(b, c);
+ simd_shuffle4!(a, d, [0, 1, 2, 3])
+}
+
+/// Signed halving subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vhsub.u8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uhsub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vhsub_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vhsubu.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uhsub.v8i8")]
+ fn vhsub_u8_(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t;
+ }
+vhsub_u8_(a, b)
+}
+
+/// Signed halving subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vhsub.u8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uhsub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vhsubq_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vhsubu.v16i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uhsub.v16i8")]
+ fn vhsubq_u8_(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t;
+ }
+vhsubq_u8_(a, b)
+}
+
+/// Signed halving subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vhsub.u16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uhsub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vhsub_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vhsubu.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uhsub.v4i16")]
+ fn vhsub_u16_(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t;
+ }
+vhsub_u16_(a, b)
+}
+
+/// Signed halving subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vhsub.u16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uhsub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vhsubq_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vhsubu.v8i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uhsub.v8i16")]
+ fn vhsubq_u16_(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t;
+ }
+vhsubq_u16_(a, b)
+}
+
+/// Signed halving subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vhsub.u32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uhsub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vhsub_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vhsubu.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uhsub.v2i32")]
+ fn vhsub_u32_(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t;
+ }
+vhsub_u32_(a, b)
+}
+
+/// Signed halving subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vhsub.u32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uhsub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vhsubq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vhsubu.v4i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uhsub.v4i32")]
+ fn vhsubq_u32_(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t;
+ }
+vhsubq_u32_(a, b)
+}
+
+/// Signed halving subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vhsub.s8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(shsub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vhsub_s8(a: int8x8_t, b: int8x8_t) -> int8x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vhsubs.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.shsub.v8i8")]
+ fn vhsub_s8_(a: int8x8_t, b: int8x8_t) -> int8x8_t;
+ }
+vhsub_s8_(a, b)
+}
+
+/// Signed halving subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vhsub.s8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(shsub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vhsubq_s8(a: int8x16_t, b: int8x16_t) -> int8x16_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vhsubs.v16i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.shsub.v16i8")]
+ fn vhsubq_s8_(a: int8x16_t, b: int8x16_t) -> int8x16_t;
+ }
+vhsubq_s8_(a, b)
+}
+
+/// Signed halving subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vhsub.s16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(shsub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vhsub_s16(a: int16x4_t, b: int16x4_t) -> int16x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vhsubs.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.shsub.v4i16")]
+ fn vhsub_s16_(a: int16x4_t, b: int16x4_t) -> int16x4_t;
+ }
+vhsub_s16_(a, b)
+}
+
+/// Signed halving subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vhsub.s16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(shsub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vhsubq_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vhsubs.v8i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.shsub.v8i16")]
+ fn vhsubq_s16_(a: int16x8_t, b: int16x8_t) -> int16x8_t;
+ }
+vhsubq_s16_(a, b)
+}
+
+/// Signed halving subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vhsub.s32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(shsub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vhsub_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vhsubs.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.shsub.v2i32")]
+ fn vhsub_s32_(a: int32x2_t, b: int32x2_t) -> int32x2_t;
+ }
+vhsub_s32_(a, b)
+}
+
+/// Signed halving subtract
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vhsub.s32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(shsub))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vhsubq_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vhsubs.v4i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.shsub.v4i32")]
+ fn vhsubq_s32_(a: int32x4_t, b: int32x4_t) -> int32x4_t;
+ }
+vhsubq_s32_(a, b)
+}
+
+/// Signed Subtract Wide
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsubw))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ssubw))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsubw_s8(a: int16x8_t, b: int8x8_t) -> int16x8_t {
+ simd_sub(a, simd_cast(b))
+}
+
+/// Signed Subtract Wide
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsubw))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ssubw))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsubw_s16(a: int32x4_t, b: int16x4_t) -> int32x4_t {
+ simd_sub(a, simd_cast(b))
+}
+
+/// Signed Subtract Wide
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsubw))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ssubw))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsubw_s32(a: int64x2_t, b: int32x2_t) -> int64x2_t {
+ simd_sub(a, simd_cast(b))
+}
+
+/// Unsigned Subtract Wide
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsubw))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(usubw))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsubw_u8(a: uint16x8_t, b: uint8x8_t) -> uint16x8_t {
+ simd_sub(a, simd_cast(b))
+}
+
+/// Unsigned Subtract Wide
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsubw))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(usubw))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsubw_u16(a: uint32x4_t, b: uint16x4_t) -> uint32x4_t {
+ simd_sub(a, simd_cast(b))
+}
+
+/// Unsigned Subtract Wide
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsubw))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(usubw))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsubw_u32(a: uint64x2_t, b: uint32x2_t) -> uint64x2_t {
+ simd_sub(a, simd_cast(b))
+}
+
+/// Signed Subtract Long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsubl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ssubl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsubl_s8(a: int8x8_t, b: int8x8_t) -> int16x8_t {
+ let c: int16x8_t = simd_cast(a);
+ let d: int16x8_t = simd_cast(b);
+ simd_sub(c, d)
+}
+
+/// Signed Subtract Long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsubl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ssubl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsubl_s16(a: int16x4_t, b: int16x4_t) -> int32x4_t {
+ let c: int32x4_t = simd_cast(a);
+ let d: int32x4_t = simd_cast(b);
+ simd_sub(c, d)
+}
+
+/// Signed Subtract Long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsubl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ssubl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsubl_s32(a: int32x2_t, b: int32x2_t) -> int64x2_t {
+ let c: int64x2_t = simd_cast(a);
+ let d: int64x2_t = simd_cast(b);
+ simd_sub(c, d)
+}
+
+/// Unsigned Subtract Long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsubl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(usubl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsubl_u8(a: uint8x8_t, b: uint8x8_t) -> uint16x8_t {
+ let c: uint16x8_t = simd_cast(a);
+ let d: uint16x8_t = simd_cast(b);
+ simd_sub(c, d)
+}
+
+/// Unsigned Subtract Long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsubl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(usubl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsubl_u16(a: uint16x4_t, b: uint16x4_t) -> uint32x4_t {
+ let c: uint32x4_t = simd_cast(a);
+ let d: uint32x4_t = simd_cast(b);
+ simd_sub(c, d)
+}
+
+/// Unsigned Subtract Long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsubl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(usubl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsubl_u32(a: uint32x2_t, b: uint32x2_t) -> uint64x2_t {
+ let c: uint64x2_t = simd_cast(a);
+ let d: uint64x2_t = simd_cast(b);
+ simd_sub(c, d)
+}
+
+/// Maximum (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmax))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smax))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmax_s8(a: int8x8_t, b: int8x8_t) -> int8x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmaxs.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.smax.v8i8")]
+ fn vmax_s8_(a: int8x8_t, b: int8x8_t) -> int8x8_t;
+ }
+vmax_s8_(a, b)
+}
+
+/// Maximum (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmax))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smax))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmaxq_s8(a: int8x16_t, b: int8x16_t) -> int8x16_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmaxs.v16i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.smax.v16i8")]
+ fn vmaxq_s8_(a: int8x16_t, b: int8x16_t) -> int8x16_t;
+ }
+vmaxq_s8_(a, b)
+}
+
+/// Maximum (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmax))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smax))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmax_s16(a: int16x4_t, b: int16x4_t) -> int16x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmaxs.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.smax.v4i16")]
+ fn vmax_s16_(a: int16x4_t, b: int16x4_t) -> int16x4_t;
+ }
+vmax_s16_(a, b)
+}
+
+/// Maximum (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmax))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smax))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmaxq_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmaxs.v8i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.smax.v8i16")]
+ fn vmaxq_s16_(a: int16x8_t, b: int16x8_t) -> int16x8_t;
+ }
+vmaxq_s16_(a, b)
+}
+
+/// Maximum (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmax))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smax))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmax_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmaxs.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.smax.v2i32")]
+ fn vmax_s32_(a: int32x2_t, b: int32x2_t) -> int32x2_t;
+ }
+vmax_s32_(a, b)
+}
+
+/// Maximum (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmax))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smax))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmaxq_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmaxs.v4i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.smax.v4i32")]
+ fn vmaxq_s32_(a: int32x4_t, b: int32x4_t) -> int32x4_t;
+ }
+vmaxq_s32_(a, b)
+}
+
+/// Maximum (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmax))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(umax))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmax_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmaxu.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.umax.v8i8")]
+ fn vmax_u8_(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t;
+ }
+vmax_u8_(a, b)
+}
+
+/// Maximum (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmax))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(umax))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmaxq_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmaxu.v16i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.umax.v16i8")]
+ fn vmaxq_u8_(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t;
+ }
+vmaxq_u8_(a, b)
+}
+
+/// Maximum (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmax))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(umax))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmax_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmaxu.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.umax.v4i16")]
+ fn vmax_u16_(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t;
+ }
+vmax_u16_(a, b)
+}
+
+/// Maximum (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmax))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(umax))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmaxq_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmaxu.v8i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.umax.v8i16")]
+ fn vmaxq_u16_(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t;
+ }
+vmaxq_u16_(a, b)
+}
+
+/// Maximum (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmax))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(umax))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmax_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmaxu.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.umax.v2i32")]
+ fn vmax_u32_(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t;
+ }
+vmax_u32_(a, b)
+}
+
+/// Maximum (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmax))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(umax))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmaxq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmaxu.v4i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.umax.v4i32")]
+ fn vmaxq_u32_(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t;
+ }
+vmaxq_u32_(a, b)
+}
+
+/// Maximum (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmax))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmax))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmax_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmaxs.v2f32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fmax.v2f32")]
+ fn vmax_f32_(a: float32x2_t, b: float32x2_t) -> float32x2_t;
+ }
+vmax_f32_(a, b)
+}
+
+/// Maximum (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmax))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmax))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmaxq_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmaxs.v4f32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fmax.v4f32")]
+ fn vmaxq_f32_(a: float32x4_t, b: float32x4_t) -> float32x4_t;
+ }
+vmaxq_f32_(a, b)
+}
+
+/// Floating-point Maximum Number (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "fp-armv8,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmaxnm))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmaxnm))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmaxnm_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmaxnm.v2f32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fmaxnm.v2f32")]
+ fn vmaxnm_f32_(a: float32x2_t, b: float32x2_t) -> float32x2_t;
+ }
+vmaxnm_f32_(a, b)
+}
+
+/// Floating-point Maximum Number (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "fp-armv8,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmaxnm))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmaxnm))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmaxnmq_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmaxnm.v4f32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fmaxnm.v4f32")]
+ fn vmaxnmq_f32_(a: float32x4_t, b: float32x4_t) -> float32x4_t;
+ }
+vmaxnmq_f32_(a, b)
+}
+
+/// Minimum (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmin))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smin))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmin_s8(a: int8x8_t, b: int8x8_t) -> int8x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmins.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.smin.v8i8")]
+ fn vmin_s8_(a: int8x8_t, b: int8x8_t) -> int8x8_t;
+ }
+vmin_s8_(a, b)
+}
+
+/// Minimum (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmin))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smin))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vminq_s8(a: int8x16_t, b: int8x16_t) -> int8x16_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmins.v16i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.smin.v16i8")]
+ fn vminq_s8_(a: int8x16_t, b: int8x16_t) -> int8x16_t;
+ }
+vminq_s8_(a, b)
+}
+
+/// Minimum (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmin))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smin))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmin_s16(a: int16x4_t, b: int16x4_t) -> int16x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmins.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.smin.v4i16")]
+ fn vmin_s16_(a: int16x4_t, b: int16x4_t) -> int16x4_t;
+ }
+vmin_s16_(a, b)
+}
+
+/// Minimum (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmin))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smin))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vminq_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmins.v8i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.smin.v8i16")]
+ fn vminq_s16_(a: int16x8_t, b: int16x8_t) -> int16x8_t;
+ }
+vminq_s16_(a, b)
+}
+
+/// Minimum (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmin))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smin))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmin_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmins.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.smin.v2i32")]
+ fn vmin_s32_(a: int32x2_t, b: int32x2_t) -> int32x2_t;
+ }
+vmin_s32_(a, b)
+}
+
+/// Minimum (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmin))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smin))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vminq_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmins.v4i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.smin.v4i32")]
+ fn vminq_s32_(a: int32x4_t, b: int32x4_t) -> int32x4_t;
+ }
+vminq_s32_(a, b)
+}
+
+/// Minimum (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmin))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(umin))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmin_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vminu.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.umin.v8i8")]
+ fn vmin_u8_(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t;
+ }
+vmin_u8_(a, b)
+}
+
+/// Minimum (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmin))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(umin))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vminq_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vminu.v16i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.umin.v16i8")]
+ fn vminq_u8_(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t;
+ }
+vminq_u8_(a, b)
+}
+
+/// Minimum (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmin))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(umin))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmin_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vminu.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.umin.v4i16")]
+ fn vmin_u16_(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t;
+ }
+vmin_u16_(a, b)
+}
+
+/// Minimum (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmin))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(umin))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vminq_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vminu.v8i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.umin.v8i16")]
+ fn vminq_u16_(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t;
+ }
+vminq_u16_(a, b)
+}
+
+/// Minimum (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmin))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(umin))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmin_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vminu.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.umin.v2i32")]
+ fn vmin_u32_(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t;
+ }
+vmin_u32_(a, b)
+}
+
+/// Minimum (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmin))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(umin))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vminq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vminu.v4i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.umin.v4i32")]
+ fn vminq_u32_(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t;
+ }
+vminq_u32_(a, b)
+}
+
+/// Minimum (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmin))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmin))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vmin_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmins.v2f32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fmin.v2f32")]
+ fn vmin_f32_(a: float32x2_t, b: float32x2_t) -> float32x2_t;
+ }
+vmin_f32_(a, b)
+}
+
+/// Minimum (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmin))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmin))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vminq_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmins.v4f32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fmin.v4f32")]
+ fn vminq_f32_(a: float32x4_t, b: float32x4_t) -> float32x4_t;
+ }
+vminq_f32_(a, b)
+}
+
+/// Floating-point Minimum Number (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "fp-armv8,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vminnm))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fminnm))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vminnm_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vminnm.v2f32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fminnm.v2f32")]
+ fn vminnm_f32_(a: float32x2_t, b: float32x2_t) -> float32x2_t;
+ }
+vminnm_f32_(a, b)
+}
+
+/// Floating-point Minimum Number (vector)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "fp-armv8,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vminnm))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fminnm))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vminnmq_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vminnm.v4f32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fminnm.v4f32")]
+ fn vminnmq_f32_(a: float32x4_t, b: float32x4_t) -> float32x4_t;
+ }
+vminnmq_f32_(a, b)
+}
+
+/// Floating-point add pairwise
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpadd))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(faddp))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vpadd_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vpadd.v2f32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.faddp.v2f32")]
+ fn vpadd_f32_(a: float32x2_t, b: float32x2_t) -> float32x2_t;
+ }
+vpadd_f32_(a, b)
+}
+
+/// Signed saturating doubling multiply long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqdmull))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqdmull))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqdmull_s16(a: int16x4_t, b: int16x4_t) -> int32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqdmull.v4i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqdmull.v4i32")]
+ fn vqdmull_s16_(a: int16x4_t, b: int16x4_t) -> int32x4_t;
+ }
+vqdmull_s16_(a, b)
+}
+
+/// Signed saturating doubling multiply long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqdmull))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqdmull))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqdmull_s32(a: int32x2_t, b: int32x2_t) -> int64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqdmull.v2i64")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqdmull.v2i64")]
+ fn vqdmull_s32_(a: int32x2_t, b: int32x2_t) -> int64x2_t;
+ }
+vqdmull_s32_(a, b)
+}
+
+/// Vector saturating doubling long multiply with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqdmull))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqdmull))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqdmull_n_s16(a: int16x4_t, b: i16) -> int32x4_t {
+ vqdmull_s16(a, vdup_n_s16(b))
+}
+
+/// Vector saturating doubling long multiply with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqdmull))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqdmull))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqdmull_n_s32(a: int32x2_t, b: i32) -> int64x2_t {
+ vqdmull_s32(a, vdup_n_s32(b))
+}
+
+/// Vector saturating doubling long multiply by scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqdmull, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqdmull, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqdmull_lane_s16<const N: i32>(a: int16x4_t, b: int16x4_t) -> int32x4_t {
+ static_assert_imm2!(N);
+ let b: int16x4_t = simd_shuffle4!(b, b, <const N: i32> [N as u32, N as u32, N as u32, N as u32]);
+ vqdmull_s16(a, b)
+}
+
+/// Vector saturating doubling long multiply by scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqdmull, N = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqdmull, N = 1))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqdmull_lane_s32<const N: i32>(a: int32x2_t, b: int32x2_t) -> int64x2_t {
+ static_assert_imm1!(N);
+ let b: int32x2_t = simd_shuffle2!(b, b, <const N: i32> [N as u32, N as u32]);
+ vqdmull_s32(a, b)
+}
+
+/// Signed saturating doubling multiply-add long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqdmlal))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqdmlal))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqdmlal_s16(a: int32x4_t, b: int16x4_t, c: int16x4_t) -> int32x4_t {
+ vqaddq_s32(a, vqdmull_s16(b, c))
+}
+
+/// Signed saturating doubling multiply-add long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqdmlal))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqdmlal))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqdmlal_s32(a: int64x2_t, b: int32x2_t, c: int32x2_t) -> int64x2_t {
+ vqaddq_s64(a, vqdmull_s32(b, c))
+}
+
+/// Vector widening saturating doubling multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqdmlal))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqdmlal))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqdmlal_n_s16(a: int32x4_t, b: int16x4_t, c: i16) -> int32x4_t {
+ vqaddq_s32(a, vqdmull_n_s16(b, c))
+}
+
+/// Vector widening saturating doubling multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqdmlal))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqdmlal))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqdmlal_n_s32(a: int64x2_t, b: int32x2_t, c: i32) -> int64x2_t {
+ vqaddq_s64(a, vqdmull_n_s32(b, c))
+}
+
+/// Vector widening saturating doubling multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqdmlal, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqdmlal, N = 2))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqdmlal_lane_s16<const N: i32>(a: int32x4_t, b: int16x4_t, c: int16x4_t) -> int32x4_t {
+ static_assert_imm2!(N);
+ vqaddq_s32(a, vqdmull_lane_s16::<N>(b, c))
+}
+
+/// Vector widening saturating doubling multiply accumulate with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqdmlal, N = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqdmlal, N = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqdmlal_lane_s32<const N: i32>(a: int64x2_t, b: int32x2_t, c: int32x2_t) -> int64x2_t {
+ static_assert_imm1!(N);
+ vqaddq_s64(a, vqdmull_lane_s32::<N>(b, c))
+}
+
+/// Signed saturating doubling multiply-subtract long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqdmlsl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqdmlsl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqdmlsl_s16(a: int32x4_t, b: int16x4_t, c: int16x4_t) -> int32x4_t {
+ vqsubq_s32(a, vqdmull_s16(b, c))
+}
+
+/// Signed saturating doubling multiply-subtract long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqdmlsl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqdmlsl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqdmlsl_s32(a: int64x2_t, b: int32x2_t, c: int32x2_t) -> int64x2_t {
+ vqsubq_s64(a, vqdmull_s32(b, c))
+}
+
+/// Vector widening saturating doubling multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqdmlsl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqdmlsl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqdmlsl_n_s16(a: int32x4_t, b: int16x4_t, c: i16) -> int32x4_t {
+ vqsubq_s32(a, vqdmull_n_s16(b, c))
+}
+
+/// Vector widening saturating doubling multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqdmlsl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqdmlsl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqdmlsl_n_s32(a: int64x2_t, b: int32x2_t, c: i32) -> int64x2_t {
+ vqsubq_s64(a, vqdmull_n_s32(b, c))
+}
+
+/// Vector widening saturating doubling multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqdmlsl, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqdmlsl, N = 2))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqdmlsl_lane_s16<const N: i32>(a: int32x4_t, b: int16x4_t, c: int16x4_t) -> int32x4_t {
+ static_assert_imm2!(N);
+ vqsubq_s32(a, vqdmull_lane_s16::<N>(b, c))
+}
+
+/// Vector widening saturating doubling multiply subtract with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqdmlsl, N = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqdmlsl, N = 1))]
+#[rustc_legacy_const_generics(3)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqdmlsl_lane_s32<const N: i32>(a: int64x2_t, b: int32x2_t, c: int32x2_t) -> int64x2_t {
+ static_assert_imm1!(N);
+ vqsubq_s64(a, vqdmull_lane_s32::<N>(b, c))
+}
+
+/// Signed saturating doubling multiply returning high half
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqdmulh))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqdmulh))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqdmulh_s16(a: int16x4_t, b: int16x4_t) -> int16x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqdmulh.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqdmulh.v4i16")]
+ fn vqdmulh_s16_(a: int16x4_t, b: int16x4_t) -> int16x4_t;
+ }
+vqdmulh_s16_(a, b)
+}
+
+/// Signed saturating doubling multiply returning high half
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqdmulh))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqdmulh))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqdmulhq_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqdmulh.v8i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqdmulh.v8i16")]
+ fn vqdmulhq_s16_(a: int16x8_t, b: int16x8_t) -> int16x8_t;
+ }
+vqdmulhq_s16_(a, b)
+}
+
+/// Signed saturating doubling multiply returning high half
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqdmulh))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqdmulh))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqdmulh_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqdmulh.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqdmulh.v2i32")]
+ fn vqdmulh_s32_(a: int32x2_t, b: int32x2_t) -> int32x2_t;
+ }
+vqdmulh_s32_(a, b)
+}
+
+/// Signed saturating doubling multiply returning high half
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqdmulh))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqdmulh))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqdmulhq_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqdmulh.v4i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqdmulh.v4i32")]
+ fn vqdmulhq_s32_(a: int32x4_t, b: int32x4_t) -> int32x4_t;
+ }
+vqdmulhq_s32_(a, b)
+}
+
+/// Vector saturating doubling multiply high with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqdmulh))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqdmulh))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqdmulh_n_s16(a: int16x4_t, b: i16) -> int16x4_t {
+ let b: int16x4_t = vdup_n_s16(b);
+ vqdmulh_s16(a, b)
+}
+
+/// Vector saturating doubling multiply high with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqdmulh))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqdmulh))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqdmulh_n_s32(a: int32x2_t, b: i32) -> int32x2_t {
+ let b: int32x2_t = vdup_n_s32(b);
+ vqdmulh_s32(a, b)
+}
+
+/// Vector saturating doubling multiply high with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqdmulh))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqdmulh))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqdmulhq_n_s16(a: int16x8_t, b: i16) -> int16x8_t {
+ let b: int16x8_t = vdupq_n_s16(b);
+ vqdmulhq_s16(a, b)
+}
+
+/// Vector saturating doubling multiply high with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqdmulh))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqdmulh))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqdmulhq_n_s32(a: int32x4_t, b: i32) -> int32x4_t {
+ let b: int32x4_t = vdupq_n_s32(b);
+ vqdmulhq_s32(a, b)
+}
+
+/// Vector saturating doubling multiply high by scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqdmulh, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqdmulh, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqdmulhq_laneq_s16<const LANE: i32>(a: int16x8_t, b: int16x8_t) -> int16x8_t {
+ static_assert_imm3!(LANE);
+ vqdmulhq_s16(a, vdupq_n_s16(simd_extract(b, LANE as u32)))
+}
+
+/// Vector saturating doubling multiply high by scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqdmulh, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqdmulh, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqdmulh_laneq_s16<const LANE: i32>(a: int16x4_t, b: int16x8_t) -> int16x4_t {
+ static_assert_imm3!(LANE);
+ vqdmulh_s16(a, vdup_n_s16(simd_extract(b, LANE as u32)))
+}
+
+/// Vector saturating doubling multiply high by scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqdmulh, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqdmulh, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqdmulhq_laneq_s32<const LANE: i32>(a: int32x4_t, b: int32x4_t) -> int32x4_t {
+ static_assert_imm2!(LANE);
+ vqdmulhq_s32(a, vdupq_n_s32(simd_extract(b, LANE as u32)))
+}
+
+/// Vector saturating doubling multiply high by scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqdmulh, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqdmulh, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqdmulh_laneq_s32<const LANE: i32>(a: int32x2_t, b: int32x4_t) -> int32x2_t {
+ static_assert_imm2!(LANE);
+ vqdmulh_s32(a, vdup_n_s32(simd_extract(b, LANE as u32)))
+}
+
+/// Signed saturating extract narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqmovn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqxtn))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqmovn_s16(a: int16x8_t) -> int8x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqmovns.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqxtn.v8i8")]
+ fn vqmovn_s16_(a: int16x8_t) -> int8x8_t;
+ }
+vqmovn_s16_(a)
+}
+
+/// Signed saturating extract narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqmovn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqxtn))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqmovn_s32(a: int32x4_t) -> int16x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqmovns.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqxtn.v4i16")]
+ fn vqmovn_s32_(a: int32x4_t) -> int16x4_t;
+ }
+vqmovn_s32_(a)
+}
+
+/// Signed saturating extract narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqmovn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqxtn))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqmovn_s64(a: int64x2_t) -> int32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqmovns.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqxtn.v2i32")]
+ fn vqmovn_s64_(a: int64x2_t) -> int32x2_t;
+ }
+vqmovn_s64_(a)
+}
+
+/// Unsigned saturating extract narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqmovn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqxtn))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqmovn_u16(a: uint16x8_t) -> uint8x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqmovnu.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqxtn.v8i8")]
+ fn vqmovn_u16_(a: uint16x8_t) -> uint8x8_t;
+ }
+vqmovn_u16_(a)
+}
+
+/// Unsigned saturating extract narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqmovn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqxtn))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqmovn_u32(a: uint32x4_t) -> uint16x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqmovnu.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqxtn.v4i16")]
+ fn vqmovn_u32_(a: uint32x4_t) -> uint16x4_t;
+ }
+vqmovn_u32_(a)
+}
+
+/// Unsigned saturating extract narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqmovn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqxtn))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqmovn_u64(a: uint64x2_t) -> uint32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqmovnu.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqxtn.v2i32")]
+ fn vqmovn_u64_(a: uint64x2_t) -> uint32x2_t;
+ }
+vqmovn_u64_(a)
+}
+
+/// Signed saturating extract unsigned narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqmovun))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqxtun))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqmovun_s16(a: int16x8_t) -> uint8x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqmovnsu.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqxtun.v8i8")]
+ fn vqmovun_s16_(a: int16x8_t) -> uint8x8_t;
+ }
+vqmovun_s16_(a)
+}
+
+/// Signed saturating extract unsigned narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqmovun))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqxtun))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqmovun_s32(a: int32x4_t) -> uint16x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqmovnsu.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqxtun.v4i16")]
+ fn vqmovun_s32_(a: int32x4_t) -> uint16x4_t;
+ }
+vqmovun_s32_(a)
+}
+
+/// Signed saturating extract unsigned narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqmovun))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqxtun))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqmovun_s64(a: int64x2_t) -> uint32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqmovnsu.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqxtun.v2i32")]
+ fn vqmovun_s64_(a: int64x2_t) -> uint32x2_t;
+ }
+vqmovun_s64_(a)
+}
+
+/// Signed saturating rounding doubling multiply returning high half
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqrdmulh))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqrdmulh))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqrdmulh_s16(a: int16x4_t, b: int16x4_t) -> int16x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqrdmulh.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqrdmulh.v4i16")]
+ fn vqrdmulh_s16_(a: int16x4_t, b: int16x4_t) -> int16x4_t;
+ }
+vqrdmulh_s16_(a, b)
+}
+
+/// Signed saturating rounding doubling multiply returning high half
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqrdmulh))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqrdmulh))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqrdmulhq_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqrdmulh.v8i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqrdmulh.v8i16")]
+ fn vqrdmulhq_s16_(a: int16x8_t, b: int16x8_t) -> int16x8_t;
+ }
+vqrdmulhq_s16_(a, b)
+}
+
+/// Signed saturating rounding doubling multiply returning high half
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqrdmulh))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqrdmulh))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqrdmulh_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqrdmulh.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqrdmulh.v2i32")]
+ fn vqrdmulh_s32_(a: int32x2_t, b: int32x2_t) -> int32x2_t;
+ }
+vqrdmulh_s32_(a, b)
+}
+
+/// Signed saturating rounding doubling multiply returning high half
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqrdmulh))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqrdmulh))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqrdmulhq_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqrdmulh.v4i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqrdmulh.v4i32")]
+ fn vqrdmulhq_s32_(a: int32x4_t, b: int32x4_t) -> int32x4_t;
+ }
+vqrdmulhq_s32_(a, b)
+}
+
+/// Vector saturating rounding doubling multiply high with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqrdmulh))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqrdmulh))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqrdmulh_n_s16(a: int16x4_t, b: i16) -> int16x4_t {
+ vqrdmulh_s16(a, vdup_n_s16(b))
+}
+
+/// Vector saturating rounding doubling multiply high with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqrdmulh))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqrdmulh))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqrdmulhq_n_s16(a: int16x8_t, b: i16) -> int16x8_t {
+ vqrdmulhq_s16(a, vdupq_n_s16(b))
+}
+
+/// Vector saturating rounding doubling multiply high with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqrdmulh))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqrdmulh))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqrdmulh_n_s32(a: int32x2_t, b: i32) -> int32x2_t {
+ vqrdmulh_s32(a, vdup_n_s32(b))
+}
+
+/// Vector saturating rounding doubling multiply high with scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqrdmulh))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqrdmulh))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqrdmulhq_n_s32(a: int32x4_t, b: i32) -> int32x4_t {
+ vqrdmulhq_s32(a, vdupq_n_s32(b))
+}
+
+/// Vector rounding saturating doubling multiply high by scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqrdmulh, LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqrdmulh, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqrdmulh_lane_s16<const LANE: i32>(a: int16x4_t, b: int16x4_t) -> int16x4_t {
+ static_assert_imm2!(LANE);
+ let b: int16x4_t = simd_shuffle4!(b, b, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]);
+ vqrdmulh_s16(a, b)
+}
+
+/// Vector rounding saturating doubling multiply high by scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqrdmulh, LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqrdmulh, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqrdmulh_laneq_s16<const LANE: i32>(a: int16x4_t, b: int16x8_t) -> int16x4_t {
+ static_assert_imm3!(LANE);
+ let b: int16x4_t = simd_shuffle4!(b, b, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]);
+ vqrdmulh_s16(a, b)
+}
+
+/// Vector rounding saturating doubling multiply high by scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqrdmulh, LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqrdmulh, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqrdmulhq_lane_s16<const LANE: i32>(a: int16x8_t, b: int16x4_t) -> int16x8_t {
+ static_assert_imm2!(LANE);
+ let b: int16x8_t = simd_shuffle8!(b, b, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]);
+ vqrdmulhq_s16(a, b)
+}
+
+/// Vector rounding saturating doubling multiply high by scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqrdmulh, LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqrdmulh, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqrdmulhq_laneq_s16<const LANE: i32>(a: int16x8_t, b: int16x8_t) -> int16x8_t {
+ static_assert_imm3!(LANE);
+ let b: int16x8_t = simd_shuffle8!(b, b, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]);
+ vqrdmulhq_s16(a, b)
+}
+
+/// Vector rounding saturating doubling multiply high by scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqrdmulh, LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqrdmulh, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqrdmulh_lane_s32<const LANE: i32>(a: int32x2_t, b: int32x2_t) -> int32x2_t {
+ static_assert_imm1!(LANE);
+ let b: int32x2_t = simd_shuffle2!(b, b, <const LANE: i32> [LANE as u32, LANE as u32]);
+ vqrdmulh_s32(a, b)
+}
+
+/// Vector rounding saturating doubling multiply high by scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqrdmulh, LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqrdmulh, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqrdmulh_laneq_s32<const LANE: i32>(a: int32x2_t, b: int32x4_t) -> int32x2_t {
+ static_assert_imm2!(LANE);
+ let b: int32x2_t = simd_shuffle2!(b, b, <const LANE: i32> [LANE as u32, LANE as u32]);
+ vqrdmulh_s32(a, b)
+}
+
+/// Vector rounding saturating doubling multiply high by scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqrdmulh, LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqrdmulh, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqrdmulhq_lane_s32<const LANE: i32>(a: int32x4_t, b: int32x2_t) -> int32x4_t {
+ static_assert_imm1!(LANE);
+ let b: int32x4_t = simd_shuffle4!(b, b, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]);
+ vqrdmulhq_s32(a, b)
+}
+
+/// Vector rounding saturating doubling multiply high by scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqrdmulh, LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqrdmulh, LANE = 1))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqrdmulhq_laneq_s32<const LANE: i32>(a: int32x4_t, b: int32x4_t) -> int32x4_t {
+ static_assert_imm2!(LANE);
+ let b: int32x4_t = simd_shuffle4!(b, b, <const LANE: i32> [LANE as u32, LANE as u32, LANE as u32, LANE as u32]);
+ vqrdmulhq_s32(a, b)
+}
+
+/// Signed saturating rounding shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqrshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqrshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqrshl_s8(a: int8x8_t, b: int8x8_t) -> int8x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqrshifts.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqrshl.v8i8")]
+ fn vqrshl_s8_(a: int8x8_t, b: int8x8_t) -> int8x8_t;
+ }
+vqrshl_s8_(a, b)
+}
+
+/// Signed saturating rounding shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqrshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqrshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqrshlq_s8(a: int8x16_t, b: int8x16_t) -> int8x16_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqrshifts.v16i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqrshl.v16i8")]
+ fn vqrshlq_s8_(a: int8x16_t, b: int8x16_t) -> int8x16_t;
+ }
+vqrshlq_s8_(a, b)
+}
+
+/// Signed saturating rounding shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqrshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqrshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqrshl_s16(a: int16x4_t, b: int16x4_t) -> int16x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqrshifts.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqrshl.v4i16")]
+ fn vqrshl_s16_(a: int16x4_t, b: int16x4_t) -> int16x4_t;
+ }
+vqrshl_s16_(a, b)
+}
+
+/// Signed saturating rounding shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqrshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqrshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqrshlq_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqrshifts.v8i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqrshl.v8i16")]
+ fn vqrshlq_s16_(a: int16x8_t, b: int16x8_t) -> int16x8_t;
+ }
+vqrshlq_s16_(a, b)
+}
+
+/// Signed saturating rounding shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqrshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqrshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqrshl_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqrshifts.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqrshl.v2i32")]
+ fn vqrshl_s32_(a: int32x2_t, b: int32x2_t) -> int32x2_t;
+ }
+vqrshl_s32_(a, b)
+}
+
+/// Signed saturating rounding shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqrshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqrshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqrshlq_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqrshifts.v4i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqrshl.v4i32")]
+ fn vqrshlq_s32_(a: int32x4_t, b: int32x4_t) -> int32x4_t;
+ }
+vqrshlq_s32_(a, b)
+}
+
+/// Signed saturating rounding shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqrshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqrshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqrshl_s64(a: int64x1_t, b: int64x1_t) -> int64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqrshifts.v1i64")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqrshl.v1i64")]
+ fn vqrshl_s64_(a: int64x1_t, b: int64x1_t) -> int64x1_t;
+ }
+vqrshl_s64_(a, b)
+}
+
+/// Signed saturating rounding shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqrshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqrshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqrshlq_s64(a: int64x2_t, b: int64x2_t) -> int64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqrshifts.v2i64")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqrshl.v2i64")]
+ fn vqrshlq_s64_(a: int64x2_t, b: int64x2_t) -> int64x2_t;
+ }
+vqrshlq_s64_(a, b)
+}
+
+/// Unsigned signed saturating rounding shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqrshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqrshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqrshl_u8(a: uint8x8_t, b: int8x8_t) -> uint8x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqrshiftu.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqrshl.v8i8")]
+ fn vqrshl_u8_(a: uint8x8_t, b: int8x8_t) -> uint8x8_t;
+ }
+vqrshl_u8_(a, b)
+}
+
+/// Unsigned signed saturating rounding shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqrshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqrshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqrshlq_u8(a: uint8x16_t, b: int8x16_t) -> uint8x16_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqrshiftu.v16i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqrshl.v16i8")]
+ fn vqrshlq_u8_(a: uint8x16_t, b: int8x16_t) -> uint8x16_t;
+ }
+vqrshlq_u8_(a, b)
+}
+
+/// Unsigned signed saturating rounding shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqrshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqrshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqrshl_u16(a: uint16x4_t, b: int16x4_t) -> uint16x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqrshiftu.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqrshl.v4i16")]
+ fn vqrshl_u16_(a: uint16x4_t, b: int16x4_t) -> uint16x4_t;
+ }
+vqrshl_u16_(a, b)
+}
+
+/// Unsigned signed saturating rounding shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqrshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqrshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqrshlq_u16(a: uint16x8_t, b: int16x8_t) -> uint16x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqrshiftu.v8i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqrshl.v8i16")]
+ fn vqrshlq_u16_(a: uint16x8_t, b: int16x8_t) -> uint16x8_t;
+ }
+vqrshlq_u16_(a, b)
+}
+
+/// Unsigned signed saturating rounding shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqrshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqrshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqrshl_u32(a: uint32x2_t, b: int32x2_t) -> uint32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqrshiftu.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqrshl.v2i32")]
+ fn vqrshl_u32_(a: uint32x2_t, b: int32x2_t) -> uint32x2_t;
+ }
+vqrshl_u32_(a, b)
+}
+
+/// Unsigned signed saturating rounding shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqrshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqrshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqrshlq_u32(a: uint32x4_t, b: int32x4_t) -> uint32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqrshiftu.v4i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqrshl.v4i32")]
+ fn vqrshlq_u32_(a: uint32x4_t, b: int32x4_t) -> uint32x4_t;
+ }
+vqrshlq_u32_(a, b)
+}
+
+/// Unsigned signed saturating rounding shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqrshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqrshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqrshl_u64(a: uint64x1_t, b: int64x1_t) -> uint64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqrshiftu.v1i64")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqrshl.v1i64")]
+ fn vqrshl_u64_(a: uint64x1_t, b: int64x1_t) -> uint64x1_t;
+ }
+vqrshl_u64_(a, b)
+}
+
+/// Unsigned signed saturating rounding shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqrshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqrshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqrshlq_u64(a: uint64x2_t, b: int64x2_t) -> uint64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqrshiftu.v2i64")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqrshl.v2i64")]
+ fn vqrshlq_u64_(a: uint64x2_t, b: int64x2_t) -> uint64x2_t;
+ }
+vqrshlq_u64_(a, b)
+}
+
+/// Signed saturating rounded shift right narrow
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vqrshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn vqrshrn_n_s16<const N: i32>(a: int16x8_t) -> int8x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqrshiftns.v8i8")]
+ fn vqrshrn_n_s16_(a: int16x8_t, n: int16x8_t) -> int8x8_t;
+ }
+vqrshrn_n_s16_(a, int16x8_t(-N as i16, -N as i16, -N as i16, -N as i16, -N as i16, -N as i16, -N as i16, -N as i16))
+}
+
+/// Signed saturating rounded shift right narrow
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqrshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqrshrn_n_s16<const N: i32>(a: int16x8_t) -> int8x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqrshrn.v8i8")]
+ fn vqrshrn_n_s16_(a: int16x8_t, n: i32) -> int8x8_t;
+ }
+vqrshrn_n_s16_(a, N)
+}
+
+/// Signed saturating rounded shift right narrow
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vqrshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn vqrshrn_n_s32<const N: i32>(a: int32x4_t) -> int16x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqrshiftns.v4i16")]
+ fn vqrshrn_n_s32_(a: int32x4_t, n: int32x4_t) -> int16x4_t;
+ }
+vqrshrn_n_s32_(a, int32x4_t(-N as i32, -N as i32, -N as i32, -N as i32))
+}
+
+/// Signed saturating rounded shift right narrow
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqrshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqrshrn_n_s32<const N: i32>(a: int32x4_t) -> int16x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqrshrn.v4i16")]
+ fn vqrshrn_n_s32_(a: int32x4_t, n: i32) -> int16x4_t;
+ }
+vqrshrn_n_s32_(a, N)
+}
+
+/// Signed saturating rounded shift right narrow
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vqrshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn vqrshrn_n_s64<const N: i32>(a: int64x2_t) -> int32x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqrshiftns.v2i32")]
+ fn vqrshrn_n_s64_(a: int64x2_t, n: int64x2_t) -> int32x2_t;
+ }
+vqrshrn_n_s64_(a, int64x2_t(-N as i64, -N as i64))
+}
+
+/// Signed saturating rounded shift right narrow
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqrshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqrshrn_n_s64<const N: i32>(a: int64x2_t) -> int32x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqrshrn.v2i32")]
+ fn vqrshrn_n_s64_(a: int64x2_t, n: i32) -> int32x2_t;
+ }
+vqrshrn_n_s64_(a, N)
+}
+
+/// Unsigned signed saturating rounded shift right narrow
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vqrshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn vqrshrn_n_u16<const N: i32>(a: uint16x8_t) -> uint8x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqrshiftnu.v8i8")]
+ fn vqrshrn_n_u16_(a: uint16x8_t, n: uint16x8_t) -> uint8x8_t;
+ }
+vqrshrn_n_u16_(a, uint16x8_t(-N as u16, -N as u16, -N as u16, -N as u16, -N as u16, -N as u16, -N as u16, -N as u16))
+}
+
+/// Unsigned signed saturating rounded shift right narrow
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqrshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqrshrn_n_u16<const N: i32>(a: uint16x8_t) -> uint8x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqrshrn.v8i8")]
+ fn vqrshrn_n_u16_(a: uint16x8_t, n: i32) -> uint8x8_t;
+ }
+vqrshrn_n_u16_(a, N)
+}
+
+/// Unsigned signed saturating rounded shift right narrow
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vqrshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn vqrshrn_n_u32<const N: i32>(a: uint32x4_t) -> uint16x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqrshiftnu.v4i16")]
+ fn vqrshrn_n_u32_(a: uint32x4_t, n: uint32x4_t) -> uint16x4_t;
+ }
+vqrshrn_n_u32_(a, uint32x4_t(-N as u32, -N as u32, -N as u32, -N as u32))
+}
+
+/// Unsigned signed saturating rounded shift right narrow
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqrshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqrshrn_n_u32<const N: i32>(a: uint32x4_t) -> uint16x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqrshrn.v4i16")]
+ fn vqrshrn_n_u32_(a: uint32x4_t, n: i32) -> uint16x4_t;
+ }
+vqrshrn_n_u32_(a, N)
+}
+
+/// Unsigned signed saturating rounded shift right narrow
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vqrshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn vqrshrn_n_u64<const N: i32>(a: uint64x2_t) -> uint32x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqrshiftnu.v2i32")]
+ fn vqrshrn_n_u64_(a: uint64x2_t, n: uint64x2_t) -> uint32x2_t;
+ }
+vqrshrn_n_u64_(a, uint64x2_t(-N as u64, -N as u64))
+}
+
+/// Unsigned signed saturating rounded shift right narrow
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqrshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqrshrn_n_u64<const N: i32>(a: uint64x2_t) -> uint32x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqrshrn.v2i32")]
+ fn vqrshrn_n_u64_(a: uint64x2_t, n: i32) -> uint32x2_t;
+ }
+vqrshrn_n_u64_(a, N)
+}
+
+/// Signed saturating rounded shift right unsigned narrow
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vqrshrun, N = 2))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn vqrshrun_n_s16<const N: i32>(a: int16x8_t) -> uint8x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqrshiftnsu.v8i8")]
+ fn vqrshrun_n_s16_(a: int16x8_t, n: int16x8_t) -> uint8x8_t;
+ }
+vqrshrun_n_s16_(a, int16x8_t(-N as i16, -N as i16, -N as i16, -N as i16, -N as i16, -N as i16, -N as i16, -N as i16))
+}
+
+/// Signed saturating rounded shift right unsigned narrow
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqrshrun, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqrshrun_n_s16<const N: i32>(a: int16x8_t) -> uint8x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqrshrun.v8i8")]
+ fn vqrshrun_n_s16_(a: int16x8_t, n: i32) -> uint8x8_t;
+ }
+vqrshrun_n_s16_(a, N)
+}
+
+/// Signed saturating rounded shift right unsigned narrow
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vqrshrun, N = 2))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn vqrshrun_n_s32<const N: i32>(a: int32x4_t) -> uint16x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqrshiftnsu.v4i16")]
+ fn vqrshrun_n_s32_(a: int32x4_t, n: int32x4_t) -> uint16x4_t;
+ }
+vqrshrun_n_s32_(a, int32x4_t(-N as i32, -N as i32, -N as i32, -N as i32))
+}
+
+/// Signed saturating rounded shift right unsigned narrow
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqrshrun, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqrshrun_n_s32<const N: i32>(a: int32x4_t) -> uint16x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqrshrun.v4i16")]
+ fn vqrshrun_n_s32_(a: int32x4_t, n: i32) -> uint16x4_t;
+ }
+vqrshrun_n_s32_(a, N)
+}
+
+/// Signed saturating rounded shift right unsigned narrow
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vqrshrun, N = 2))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn vqrshrun_n_s64<const N: i32>(a: int64x2_t) -> uint32x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqrshiftnsu.v2i32")]
+ fn vqrshrun_n_s64_(a: int64x2_t, n: int64x2_t) -> uint32x2_t;
+ }
+vqrshrun_n_s64_(a, int64x2_t(-N as i64, -N as i64))
+}
+
+/// Signed saturating rounded shift right unsigned narrow
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqrshrun, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqrshrun_n_s64<const N: i32>(a: int64x2_t) -> uint32x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqrshrun.v2i32")]
+ fn vqrshrun_n_s64_(a: int64x2_t, n: i32) -> uint32x2_t;
+ }
+vqrshrun_n_s64_(a, N)
+}
+
+/// Signed saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqshl_s8(a: int8x8_t, b: int8x8_t) -> int8x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshifts.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqshl.v8i8")]
+ fn vqshl_s8_(a: int8x8_t, b: int8x8_t) -> int8x8_t;
+ }
+vqshl_s8_(a, b)
+}
+
+/// Signed saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqshlq_s8(a: int8x16_t, b: int8x16_t) -> int8x16_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshifts.v16i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqshl.v16i8")]
+ fn vqshlq_s8_(a: int8x16_t, b: int8x16_t) -> int8x16_t;
+ }
+vqshlq_s8_(a, b)
+}
+
+/// Signed saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqshl_s16(a: int16x4_t, b: int16x4_t) -> int16x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshifts.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqshl.v4i16")]
+ fn vqshl_s16_(a: int16x4_t, b: int16x4_t) -> int16x4_t;
+ }
+vqshl_s16_(a, b)
+}
+
+/// Signed saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqshlq_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshifts.v8i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqshl.v8i16")]
+ fn vqshlq_s16_(a: int16x8_t, b: int16x8_t) -> int16x8_t;
+ }
+vqshlq_s16_(a, b)
+}
+
+/// Signed saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqshl_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshifts.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqshl.v2i32")]
+ fn vqshl_s32_(a: int32x2_t, b: int32x2_t) -> int32x2_t;
+ }
+vqshl_s32_(a, b)
+}
+
+/// Signed saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqshlq_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshifts.v4i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqshl.v4i32")]
+ fn vqshlq_s32_(a: int32x4_t, b: int32x4_t) -> int32x4_t;
+ }
+vqshlq_s32_(a, b)
+}
+
+/// Signed saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqshl_s64(a: int64x1_t, b: int64x1_t) -> int64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshifts.v1i64")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqshl.v1i64")]
+ fn vqshl_s64_(a: int64x1_t, b: int64x1_t) -> int64x1_t;
+ }
+vqshl_s64_(a, b)
+}
+
+/// Signed saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqshlq_s64(a: int64x2_t, b: int64x2_t) -> int64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshifts.v2i64")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqshl.v2i64")]
+ fn vqshlq_s64_(a: int64x2_t, b: int64x2_t) -> int64x2_t;
+ }
+vqshlq_s64_(a, b)
+}
+
+/// Unsigned saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqshl_u8(a: uint8x8_t, b: int8x8_t) -> uint8x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshiftu.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqshl.v8i8")]
+ fn vqshl_u8_(a: uint8x8_t, b: int8x8_t) -> uint8x8_t;
+ }
+vqshl_u8_(a, b)
+}
+
+/// Unsigned saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqshlq_u8(a: uint8x16_t, b: int8x16_t) -> uint8x16_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshiftu.v16i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqshl.v16i8")]
+ fn vqshlq_u8_(a: uint8x16_t, b: int8x16_t) -> uint8x16_t;
+ }
+vqshlq_u8_(a, b)
+}
+
+/// Unsigned saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqshl_u16(a: uint16x4_t, b: int16x4_t) -> uint16x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshiftu.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqshl.v4i16")]
+ fn vqshl_u16_(a: uint16x4_t, b: int16x4_t) -> uint16x4_t;
+ }
+vqshl_u16_(a, b)
+}
+
+/// Unsigned saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqshlq_u16(a: uint16x8_t, b: int16x8_t) -> uint16x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshiftu.v8i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqshl.v8i16")]
+ fn vqshlq_u16_(a: uint16x8_t, b: int16x8_t) -> uint16x8_t;
+ }
+vqshlq_u16_(a, b)
+}
+
+/// Unsigned saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqshl_u32(a: uint32x2_t, b: int32x2_t) -> uint32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshiftu.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqshl.v2i32")]
+ fn vqshl_u32_(a: uint32x2_t, b: int32x2_t) -> uint32x2_t;
+ }
+vqshl_u32_(a, b)
+}
+
+/// Unsigned saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqshlq_u32(a: uint32x4_t, b: int32x4_t) -> uint32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshiftu.v4i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqshl.v4i32")]
+ fn vqshlq_u32_(a: uint32x4_t, b: int32x4_t) -> uint32x4_t;
+ }
+vqshlq_u32_(a, b)
+}
+
+/// Unsigned saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqshl_u64(a: uint64x1_t, b: int64x1_t) -> uint64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshiftu.v1i64")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqshl.v1i64")]
+ fn vqshl_u64_(a: uint64x1_t, b: int64x1_t) -> uint64x1_t;
+ }
+vqshl_u64_(a, b)
+}
+
+/// Unsigned saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqshlq_u64(a: uint64x2_t, b: int64x2_t) -> uint64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshiftu.v2i64")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqshl.v2i64")]
+ fn vqshlq_u64_(a: uint64x2_t, b: int64x2_t) -> uint64x2_t;
+ }
+vqshlq_u64_(a, b)
+}
+
+/// Signed saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqshl, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqshl, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqshl_n_s8<const N: i32>(a: int8x8_t) -> int8x8_t {
+ static_assert_imm3!(N);
+ vqshl_s8(a, vdup_n_s8(N as _))
+}
+
+/// Signed saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqshl, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqshl, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqshlq_n_s8<const N: i32>(a: int8x16_t) -> int8x16_t {
+ static_assert_imm3!(N);
+ vqshlq_s8(a, vdupq_n_s8(N as _))
+}
+
+/// Signed saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqshl, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqshl, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqshl_n_s16<const N: i32>(a: int16x4_t) -> int16x4_t {
+ static_assert_imm4!(N);
+ vqshl_s16(a, vdup_n_s16(N as _))
+}
+
+/// Signed saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqshl, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqshl, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqshlq_n_s16<const N: i32>(a: int16x8_t) -> int16x8_t {
+ static_assert_imm4!(N);
+ vqshlq_s16(a, vdupq_n_s16(N as _))
+}
+
+/// Signed saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqshl, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqshl, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqshl_n_s32<const N: i32>(a: int32x2_t) -> int32x2_t {
+ static_assert_imm5!(N);
+ vqshl_s32(a, vdup_n_s32(N as _))
+}
+
+/// Signed saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqshl, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqshl, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqshlq_n_s32<const N: i32>(a: int32x4_t) -> int32x4_t {
+ static_assert_imm5!(N);
+ vqshlq_s32(a, vdupq_n_s32(N as _))
+}
+
+/// Signed saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqshl, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqshl, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqshl_n_s64<const N: i32>(a: int64x1_t) -> int64x1_t {
+ static_assert_imm6!(N);
+ vqshl_s64(a, vdup_n_s64(N as _))
+}
+
+/// Signed saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqshl, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqshl, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqshlq_n_s64<const N: i32>(a: int64x2_t) -> int64x2_t {
+ static_assert_imm6!(N);
+ vqshlq_s64(a, vdupq_n_s64(N as _))
+}
+
+/// Unsigned saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqshl, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqshl, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqshl_n_u8<const N: i32>(a: uint8x8_t) -> uint8x8_t {
+ static_assert_imm3!(N);
+ vqshl_u8(a, vdup_n_s8(N as _))
+}
+
+/// Unsigned saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqshl, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqshl, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqshlq_n_u8<const N: i32>(a: uint8x16_t) -> uint8x16_t {
+ static_assert_imm3!(N);
+ vqshlq_u8(a, vdupq_n_s8(N as _))
+}
+
+/// Unsigned saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqshl, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqshl, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqshl_n_u16<const N: i32>(a: uint16x4_t) -> uint16x4_t {
+ static_assert_imm4!(N);
+ vqshl_u16(a, vdup_n_s16(N as _))
+}
+
+/// Unsigned saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqshl, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqshl, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqshlq_n_u16<const N: i32>(a: uint16x8_t) -> uint16x8_t {
+ static_assert_imm4!(N);
+ vqshlq_u16(a, vdupq_n_s16(N as _))
+}
+
+/// Unsigned saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqshl, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqshl, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqshl_n_u32<const N: i32>(a: uint32x2_t) -> uint32x2_t {
+ static_assert_imm5!(N);
+ vqshl_u32(a, vdup_n_s32(N as _))
+}
+
+/// Unsigned saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqshl, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqshl, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqshlq_n_u32<const N: i32>(a: uint32x4_t) -> uint32x4_t {
+ static_assert_imm5!(N);
+ vqshlq_u32(a, vdupq_n_s32(N as _))
+}
+
+/// Unsigned saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqshl, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqshl, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqshl_n_u64<const N: i32>(a: uint64x1_t) -> uint64x1_t {
+ static_assert_imm6!(N);
+ vqshl_u64(a, vdup_n_s64(N as _))
+}
+
+/// Unsigned saturating shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vqshl, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uqshl, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqshlq_n_u64<const N: i32>(a: uint64x2_t) -> uint64x2_t {
+ static_assert_imm6!(N);
+ vqshlq_u64(a, vdupq_n_s64(N as _))
+}
+
+/// Signed saturating shift left unsigned
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vqshlu, N = 2))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn vqshlu_n_s8<const N: i32>(a: int8x8_t) -> uint8x8_t {
+ static_assert_imm3!(N);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshiftsu.v8i8")]
+ fn vqshlu_n_s8_(a: int8x8_t, n: int8x8_t) -> uint8x8_t;
+ }
+vqshlu_n_s8_(a, int8x8_t(N as i8, N as i8, N as i8, N as i8, N as i8, N as i8, N as i8, N as i8))
+}
+
+/// Signed saturating shift left unsigned
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqshlu, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshlu_n_s8<const N: i32>(a: int8x8_t) -> uint8x8_t {
+ static_assert_imm3!(N);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqshlu.v8i8")]
+ fn vqshlu_n_s8_(a: int8x8_t, n: int8x8_t) -> uint8x8_t;
+ }
+vqshlu_n_s8_(a, int8x8_t(N as i8, N as i8, N as i8, N as i8, N as i8, N as i8, N as i8, N as i8))
+}
+
+/// Signed saturating shift left unsigned
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vqshlu, N = 2))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn vqshlu_n_s16<const N: i32>(a: int16x4_t) -> uint16x4_t {
+ static_assert_imm4!(N);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshiftsu.v4i16")]
+ fn vqshlu_n_s16_(a: int16x4_t, n: int16x4_t) -> uint16x4_t;
+ }
+vqshlu_n_s16_(a, int16x4_t(N as i16, N as i16, N as i16, N as i16))
+}
+
+/// Signed saturating shift left unsigned
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqshlu, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshlu_n_s16<const N: i32>(a: int16x4_t) -> uint16x4_t {
+ static_assert_imm4!(N);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqshlu.v4i16")]
+ fn vqshlu_n_s16_(a: int16x4_t, n: int16x4_t) -> uint16x4_t;
+ }
+vqshlu_n_s16_(a, int16x4_t(N as i16, N as i16, N as i16, N as i16))
+}
+
+/// Signed saturating shift left unsigned
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vqshlu, N = 2))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn vqshlu_n_s32<const N: i32>(a: int32x2_t) -> uint32x2_t {
+ static_assert_imm5!(N);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshiftsu.v2i32")]
+ fn vqshlu_n_s32_(a: int32x2_t, n: int32x2_t) -> uint32x2_t;
+ }
+vqshlu_n_s32_(a, int32x2_t(N as i32, N as i32))
+}
+
+/// Signed saturating shift left unsigned
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqshlu, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshlu_n_s32<const N: i32>(a: int32x2_t) -> uint32x2_t {
+ static_assert_imm5!(N);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqshlu.v2i32")]
+ fn vqshlu_n_s32_(a: int32x2_t, n: int32x2_t) -> uint32x2_t;
+ }
+vqshlu_n_s32_(a, int32x2_t(N as i32, N as i32))
+}
+
+/// Signed saturating shift left unsigned
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vqshlu, N = 2))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn vqshlu_n_s64<const N: i32>(a: int64x1_t) -> uint64x1_t {
+ static_assert_imm6!(N);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshiftsu.v1i64")]
+ fn vqshlu_n_s64_(a: int64x1_t, n: int64x1_t) -> uint64x1_t;
+ }
+vqshlu_n_s64_(a, int64x1_t(N as i64))
+}
+
+/// Signed saturating shift left unsigned
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqshlu, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshlu_n_s64<const N: i32>(a: int64x1_t) -> uint64x1_t {
+ static_assert_imm6!(N);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqshlu.v1i64")]
+ fn vqshlu_n_s64_(a: int64x1_t, n: int64x1_t) -> uint64x1_t;
+ }
+vqshlu_n_s64_(a, int64x1_t(N as i64))
+}
+
+/// Signed saturating shift left unsigned
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vqshlu, N = 2))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn vqshluq_n_s8<const N: i32>(a: int8x16_t) -> uint8x16_t {
+ static_assert_imm3!(N);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshiftsu.v16i8")]
+ fn vqshluq_n_s8_(a: int8x16_t, n: int8x16_t) -> uint8x16_t;
+ }
+vqshluq_n_s8_(a, int8x16_t(N as i8, N as i8, N as i8, N as i8, N as i8, N as i8, N as i8, N as i8, N as i8, N as i8, N as i8, N as i8, N as i8, N as i8, N as i8, N as i8))
+}
+
+/// Signed saturating shift left unsigned
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqshlu, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshluq_n_s8<const N: i32>(a: int8x16_t) -> uint8x16_t {
+ static_assert_imm3!(N);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqshlu.v16i8")]
+ fn vqshluq_n_s8_(a: int8x16_t, n: int8x16_t) -> uint8x16_t;
+ }
+vqshluq_n_s8_(a, int8x16_t(N as i8, N as i8, N as i8, N as i8, N as i8, N as i8, N as i8, N as i8, N as i8, N as i8, N as i8, N as i8, N as i8, N as i8, N as i8, N as i8))
+}
+
+/// Signed saturating shift left unsigned
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vqshlu, N = 2))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn vqshluq_n_s16<const N: i32>(a: int16x8_t) -> uint16x8_t {
+ static_assert_imm4!(N);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshiftsu.v8i16")]
+ fn vqshluq_n_s16_(a: int16x8_t, n: int16x8_t) -> uint16x8_t;
+ }
+vqshluq_n_s16_(a, int16x8_t(N as i16, N as i16, N as i16, N as i16, N as i16, N as i16, N as i16, N as i16))
+}
+
+/// Signed saturating shift left unsigned
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqshlu, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshluq_n_s16<const N: i32>(a: int16x8_t) -> uint16x8_t {
+ static_assert_imm4!(N);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqshlu.v8i16")]
+ fn vqshluq_n_s16_(a: int16x8_t, n: int16x8_t) -> uint16x8_t;
+ }
+vqshluq_n_s16_(a, int16x8_t(N as i16, N as i16, N as i16, N as i16, N as i16, N as i16, N as i16, N as i16))
+}
+
+/// Signed saturating shift left unsigned
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vqshlu, N = 2))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn vqshluq_n_s32<const N: i32>(a: int32x4_t) -> uint32x4_t {
+ static_assert_imm5!(N);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshiftsu.v4i32")]
+ fn vqshluq_n_s32_(a: int32x4_t, n: int32x4_t) -> uint32x4_t;
+ }
+vqshluq_n_s32_(a, int32x4_t(N as i32, N as i32, N as i32, N as i32))
+}
+
+/// Signed saturating shift left unsigned
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqshlu, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshluq_n_s32<const N: i32>(a: int32x4_t) -> uint32x4_t {
+ static_assert_imm5!(N);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqshlu.v4i32")]
+ fn vqshluq_n_s32_(a: int32x4_t, n: int32x4_t) -> uint32x4_t;
+ }
+vqshluq_n_s32_(a, int32x4_t(N as i32, N as i32, N as i32, N as i32))
+}
+
+/// Signed saturating shift left unsigned
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vqshlu, N = 2))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn vqshluq_n_s64<const N: i32>(a: int64x2_t) -> uint64x2_t {
+ static_assert_imm6!(N);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshiftsu.v2i64")]
+ fn vqshluq_n_s64_(a: int64x2_t, n: int64x2_t) -> uint64x2_t;
+ }
+vqshluq_n_s64_(a, int64x2_t(N as i64, N as i64))
+}
+
+/// Signed saturating shift left unsigned
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqshlu, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshluq_n_s64<const N: i32>(a: int64x2_t) -> uint64x2_t {
+ static_assert_imm6!(N);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqshlu.v2i64")]
+ fn vqshluq_n_s64_(a: int64x2_t, n: int64x2_t) -> uint64x2_t;
+ }
+vqshluq_n_s64_(a, int64x2_t(N as i64, N as i64))
+}
+
+/// Signed saturating shift right narrow
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vqshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn vqshrn_n_s16<const N: i32>(a: int16x8_t) -> int8x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshiftns.v8i8")]
+ fn vqshrn_n_s16_(a: int16x8_t, n: int16x8_t) -> int8x8_t;
+ }
+vqshrn_n_s16_(a, int16x8_t(-N as i16, -N as i16, -N as i16, -N as i16, -N as i16, -N as i16, -N as i16, -N as i16))
+}
+
+/// Signed saturating shift right narrow
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshrn_n_s16<const N: i32>(a: int16x8_t) -> int8x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqshrn.v8i8")]
+ fn vqshrn_n_s16_(a: int16x8_t, n: i32) -> int8x8_t;
+ }
+vqshrn_n_s16_(a, N)
+}
+
+/// Signed saturating shift right narrow
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vqshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn vqshrn_n_s32<const N: i32>(a: int32x4_t) -> int16x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshiftns.v4i16")]
+ fn vqshrn_n_s32_(a: int32x4_t, n: int32x4_t) -> int16x4_t;
+ }
+vqshrn_n_s32_(a, int32x4_t(-N as i32, -N as i32, -N as i32, -N as i32))
+}
+
+/// Signed saturating shift right narrow
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshrn_n_s32<const N: i32>(a: int32x4_t) -> int16x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqshrn.v4i16")]
+ fn vqshrn_n_s32_(a: int32x4_t, n: i32) -> int16x4_t;
+ }
+vqshrn_n_s32_(a, N)
+}
+
+/// Signed saturating shift right narrow
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vqshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn vqshrn_n_s64<const N: i32>(a: int64x2_t) -> int32x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshiftns.v2i32")]
+ fn vqshrn_n_s64_(a: int64x2_t, n: int64x2_t) -> int32x2_t;
+ }
+vqshrn_n_s64_(a, int64x2_t(-N as i64, -N as i64))
+}
+
+/// Signed saturating shift right narrow
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshrn_n_s64<const N: i32>(a: int64x2_t) -> int32x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqshrn.v2i32")]
+ fn vqshrn_n_s64_(a: int64x2_t, n: i32) -> int32x2_t;
+ }
+vqshrn_n_s64_(a, N)
+}
+
+/// Unsigned saturating shift right narrow
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vqshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn vqshrn_n_u16<const N: i32>(a: uint16x8_t) -> uint8x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshiftnu.v8i8")]
+ fn vqshrn_n_u16_(a: uint16x8_t, n: uint16x8_t) -> uint8x8_t;
+ }
+vqshrn_n_u16_(a, uint16x8_t(-N as u16, -N as u16, -N as u16, -N as u16, -N as u16, -N as u16, -N as u16, -N as u16))
+}
+
+/// Unsigned saturating shift right narrow
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshrn_n_u16<const N: i32>(a: uint16x8_t) -> uint8x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqshrn.v8i8")]
+ fn vqshrn_n_u16_(a: uint16x8_t, n: i32) -> uint8x8_t;
+ }
+vqshrn_n_u16_(a, N)
+}
+
+/// Unsigned saturating shift right narrow
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vqshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn vqshrn_n_u32<const N: i32>(a: uint32x4_t) -> uint16x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshiftnu.v4i16")]
+ fn vqshrn_n_u32_(a: uint32x4_t, n: uint32x4_t) -> uint16x4_t;
+ }
+vqshrn_n_u32_(a, uint32x4_t(-N as u32, -N as u32, -N as u32, -N as u32))
+}
+
+/// Unsigned saturating shift right narrow
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshrn_n_u32<const N: i32>(a: uint32x4_t) -> uint16x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqshrn.v4i16")]
+ fn vqshrn_n_u32_(a: uint32x4_t, n: i32) -> uint16x4_t;
+ }
+vqshrn_n_u32_(a, N)
+}
+
+/// Unsigned saturating shift right narrow
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vqshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn vqshrn_n_u64<const N: i32>(a: uint64x2_t) -> uint32x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshiftnu.v2i32")]
+ fn vqshrn_n_u64_(a: uint64x2_t, n: uint64x2_t) -> uint32x2_t;
+ }
+vqshrn_n_u64_(a, uint64x2_t(-N as u64, -N as u64))
+}
+
+/// Unsigned saturating shift right narrow
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(uqshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshrn_n_u64<const N: i32>(a: uint64x2_t) -> uint32x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uqshrn.v2i32")]
+ fn vqshrn_n_u64_(a: uint64x2_t, n: i32) -> uint32x2_t;
+ }
+vqshrn_n_u64_(a, N)
+}
+
+/// Signed saturating shift right unsigned narrow
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vqshrun, N = 2))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn vqshrun_n_s16<const N: i32>(a: int16x8_t) -> uint8x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshiftnsu.v8i8")]
+ fn vqshrun_n_s16_(a: int16x8_t, n: int16x8_t) -> uint8x8_t;
+ }
+vqshrun_n_s16_(a, int16x8_t(-N as i16, -N as i16, -N as i16, -N as i16, -N as i16, -N as i16, -N as i16, -N as i16))
+}
+
+/// Signed saturating shift right unsigned narrow
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqshrun, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshrun_n_s16<const N: i32>(a: int16x8_t) -> uint8x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqshrun.v8i8")]
+ fn vqshrun_n_s16_(a: int16x8_t, n: i32) -> uint8x8_t;
+ }
+vqshrun_n_s16_(a, N)
+}
+
+/// Signed saturating shift right unsigned narrow
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vqshrun, N = 2))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn vqshrun_n_s32<const N: i32>(a: int32x4_t) -> uint16x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshiftnsu.v4i16")]
+ fn vqshrun_n_s32_(a: int32x4_t, n: int32x4_t) -> uint16x4_t;
+ }
+vqshrun_n_s32_(a, int32x4_t(-N as i32, -N as i32, -N as i32, -N as i32))
+}
+
+/// Signed saturating shift right unsigned narrow
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqshrun, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshrun_n_s32<const N: i32>(a: int32x4_t) -> uint16x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqshrun.v4i16")]
+ fn vqshrun_n_s32_(a: int32x4_t, n: i32) -> uint16x4_t;
+ }
+vqshrun_n_s32_(a, N)
+}
+
+/// Signed saturating shift right unsigned narrow
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vqshrun, N = 2))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn vqshrun_n_s64<const N: i32>(a: int64x2_t) -> uint32x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshiftnsu.v2i32")]
+ fn vqshrun_n_s64_(a: int64x2_t, n: int64x2_t) -> uint32x2_t;
+ }
+vqshrun_n_s64_(a, int64x2_t(-N as i64, -N as i64))
+}
+
+/// Signed saturating shift right unsigned narrow
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(sqshrun, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vqshrun_n_s64<const N: i32>(a: int64x2_t) -> uint32x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqshrun.v2i32")]
+ fn vqshrun_n_s64_(a: int64x2_t, n: i32) -> uint32x2_t;
+ }
+vqshrun_n_s64_(a, N)
+}
+
+/// Reciprocal square-root estimate.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrsqrte))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(frsqrte))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrsqrte_f32(a: float32x2_t) -> float32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrsqrte.v2f32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.frsqrte.v2f32")]
+ fn vrsqrte_f32_(a: float32x2_t) -> float32x2_t;
+ }
+vrsqrte_f32_(a)
+}
+
+/// Reciprocal square-root estimate.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrsqrte))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(frsqrte))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrsqrteq_f32(a: float32x4_t) -> float32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrsqrte.v4f32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.frsqrte.v4f32")]
+ fn vrsqrteq_f32_(a: float32x4_t) -> float32x4_t;
+ }
+vrsqrteq_f32_(a)
+}
+
+/// Unsigned reciprocal square root estimate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrsqrte))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ursqrte))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrsqrte_u32(a: uint32x2_t) -> uint32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrsqrte.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ursqrte.v2i32")]
+ fn vrsqrte_u32_(a: uint32x2_t) -> uint32x2_t;
+ }
+vrsqrte_u32_(a)
+}
+
+/// Unsigned reciprocal square root estimate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrsqrte))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ursqrte))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrsqrteq_u32(a: uint32x4_t) -> uint32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrsqrte.v4i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ursqrte.v4i32")]
+ fn vrsqrteq_u32_(a: uint32x4_t) -> uint32x4_t;
+ }
+vrsqrteq_u32_(a)
+}
+
+/// Floating-point reciprocal square root step
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrsqrts))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(frsqrts))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrsqrts_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrsqrts.v2f32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.frsqrts.v2f32")]
+ fn vrsqrts_f32_(a: float32x2_t, b: float32x2_t) -> float32x2_t;
+ }
+vrsqrts_f32_(a, b)
+}
+
+/// Floating-point reciprocal square root step
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrsqrts))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(frsqrts))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrsqrtsq_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrsqrts.v4f32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.frsqrts.v4f32")]
+ fn vrsqrtsq_f32_(a: float32x4_t, b: float32x4_t) -> float32x4_t;
+ }
+vrsqrtsq_f32_(a, b)
+}
+
+/// Reciprocal estimate.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrecpe))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(frecpe))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrecpe_f32(a: float32x2_t) -> float32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrecpe.v2f32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.frecpe.v2f32")]
+ fn vrecpe_f32_(a: float32x2_t) -> float32x2_t;
+ }
+vrecpe_f32_(a)
+}
+
+/// Reciprocal estimate.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrecpe))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(frecpe))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrecpeq_f32(a: float32x4_t) -> float32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrecpe.v4f32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.frecpe.v4f32")]
+ fn vrecpeq_f32_(a: float32x4_t) -> float32x4_t;
+ }
+vrecpeq_f32_(a)
+}
+
+/// Unsigned reciprocal estimate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrecpe))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(urecpe))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrecpe_u32(a: uint32x2_t) -> uint32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrecpe.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.urecpe.v2i32")]
+ fn vrecpe_u32_(a: uint32x2_t) -> uint32x2_t;
+ }
+vrecpe_u32_(a)
+}
+
+/// Unsigned reciprocal estimate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrecpe))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(urecpe))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrecpeq_u32(a: uint32x4_t) -> uint32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrecpe.v4i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.urecpe.v4i32")]
+ fn vrecpeq_u32_(a: uint32x4_t) -> uint32x4_t;
+ }
+vrecpeq_u32_(a)
+}
+
+/// Floating-point reciprocal step
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrecps))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(frecps))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrecps_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrecps.v2f32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.frecps.v2f32")]
+ fn vrecps_f32_(a: float32x2_t, b: float32x2_t) -> float32x2_t;
+ }
+vrecps_f32_(a, b)
+}
+
+/// Floating-point reciprocal step
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrecps))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(frecps))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrecpsq_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrecps.v4f32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.frecps.v4f32")]
+ fn vrecpsq_f32_(a: float32x4_t, b: float32x4_t) -> float32x4_t;
+ }
+vrecpsq_f32_(a, b)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s8_u8(a: uint8x8_t) -> int8x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s8_p8(a: poly8x8_t) -> int8x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s16_p16(a: poly16x4_t) -> int16x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s16_u16(a: uint16x4_t) -> int16x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s32_u32(a: uint32x2_t) -> int32x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s64_u64(a: uint64x1_t) -> int64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s8_u8(a: uint8x16_t) -> int8x16_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s8_p8(a: poly8x16_t) -> int8x16_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s16_p16(a: poly16x8_t) -> int16x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s16_u16(a: uint16x8_t) -> int16x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s32_u32(a: uint32x4_t) -> int32x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s64_u64(a: uint64x2_t) -> int64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u8_p8(a: poly8x8_t) -> uint8x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u8_s8(a: int8x8_t) -> uint8x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u16_p16(a: poly16x4_t) -> uint16x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u16_s16(a: int16x4_t) -> uint16x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u32_s32(a: int32x2_t) -> uint32x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u64_s64(a: int64x1_t) -> uint64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u8_p8(a: poly8x16_t) -> uint8x16_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u8_s8(a: int8x16_t) -> uint8x16_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u16_p16(a: poly16x8_t) -> uint16x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u16_s16(a: int16x8_t) -> uint16x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u32_s32(a: int32x4_t) -> uint32x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u64_s64(a: int64x2_t) -> uint64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_p8_s8(a: int8x8_t) -> poly8x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_p8_u8(a: uint8x8_t) -> poly8x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_p16_s16(a: int16x4_t) -> poly16x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_p16_u16(a: uint16x4_t) -> poly16x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p8_s8(a: int8x16_t) -> poly8x16_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p8_u8(a: uint8x16_t) -> poly8x16_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p16_s16(a: int16x8_t) -> poly16x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p16_u16(a: uint16x8_t) -> poly16x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s8_s16(a: int16x4_t) -> int8x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s8_u16(a: uint16x4_t) -> int8x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s8_p16(a: poly16x4_t) -> int8x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s16_s32(a: int32x2_t) -> int16x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s16_u32(a: uint32x2_t) -> int16x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s32_s64(a: int64x1_t) -> int32x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s32_u64(a: uint64x1_t) -> int32x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s8_s16(a: int16x8_t) -> int8x16_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s8_u16(a: uint16x8_t) -> int8x16_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s8_p16(a: poly16x8_t) -> int8x16_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s16_s32(a: int32x4_t) -> int16x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s16_u32(a: uint32x4_t) -> int16x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s32_s64(a: int64x2_t) -> int32x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s32_u64(a: uint64x2_t) -> int32x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u8_p16(a: poly16x4_t) -> uint8x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u8_s16(a: int16x4_t) -> uint8x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u8_u16(a: uint16x4_t) -> uint8x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u16_s32(a: int32x2_t) -> uint16x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u16_u32(a: uint32x2_t) -> uint16x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u32_s64(a: int64x1_t) -> uint32x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u32_u64(a: uint64x1_t) -> uint32x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u8_p16(a: poly16x8_t) -> uint8x16_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u8_s16(a: int16x8_t) -> uint8x16_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u8_u16(a: uint16x8_t) -> uint8x16_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u16_s32(a: int32x4_t) -> uint16x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u16_u32(a: uint32x4_t) -> uint16x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u32_s64(a: int64x2_t) -> uint32x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u32_u64(a: uint64x2_t) -> uint32x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_p8_p16(a: poly16x4_t) -> poly8x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_p8_s16(a: int16x4_t) -> poly8x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_p8_u16(a: uint16x4_t) -> poly8x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_p16_s32(a: int32x2_t) -> poly16x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_p16_u32(a: uint32x2_t) -> poly16x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p8_p16(a: poly16x8_t) -> poly8x16_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p8_s16(a: int16x8_t) -> poly8x16_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p8_u16(a: uint16x8_t) -> poly8x16_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p16_s32(a: int32x4_t) -> poly16x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p16_u32(a: uint32x4_t) -> poly16x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s32_p64(a: poly64x1_t) -> int32x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u32_p64(a: poly64x1_t) -> uint32x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s32_p64(a: poly64x2_t) -> int32x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u32_p64(a: poly64x2_t) -> uint32x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s64_p128(a: p128) -> int64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u64_p128(a: p128) -> uint64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p64_p128(a: p128) -> poly64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s16_p8(a: poly8x8_t) -> int16x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s16_s8(a: int8x8_t) -> int16x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s16_u8(a: uint8x8_t) -> int16x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s32_p16(a: poly16x4_t) -> int32x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s32_s16(a: int16x4_t) -> int32x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s32_u16(a: uint16x4_t) -> int32x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s64_s32(a: int32x2_t) -> int64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s64_u32(a: uint32x2_t) -> int64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s16_p8(a: poly8x16_t) -> int16x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s16_s8(a: int8x16_t) -> int16x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s16_u8(a: uint8x16_t) -> int16x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s32_p16(a: poly16x8_t) -> int32x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s32_s16(a: int16x8_t) -> int32x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s32_u16(a: uint16x8_t) -> int32x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s64_s32(a: int32x4_t) -> int64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s64_u32(a: uint32x4_t) -> int64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u16_p8(a: poly8x8_t) -> uint16x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u16_s8(a: int8x8_t) -> uint16x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u16_u8(a: uint8x8_t) -> uint16x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u32_p16(a: poly16x4_t) -> uint32x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u32_s16(a: int16x4_t) -> uint32x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u32_u16(a: uint16x4_t) -> uint32x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u64_s32(a: int32x2_t) -> uint64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u64_u32(a: uint32x2_t) -> uint64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u16_p8(a: poly8x16_t) -> uint16x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u16_s8(a: int8x16_t) -> uint16x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u16_u8(a: uint8x16_t) -> uint16x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u32_p16(a: poly16x8_t) -> uint32x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u32_s16(a: int16x8_t) -> uint32x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u32_u16(a: uint16x8_t) -> uint32x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u64_s32(a: int32x4_t) -> uint64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u64_u32(a: uint32x4_t) -> uint64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_p16_p8(a: poly8x8_t) -> poly16x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_p16_s8(a: int8x8_t) -> poly16x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_p16_u8(a: uint8x8_t) -> poly16x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p16_p8(a: poly8x16_t) -> poly16x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p16_s8(a: int8x16_t) -> poly16x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p16_u8(a: uint8x16_t) -> poly16x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_p64_s32(a: int32x2_t) -> poly64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_p64_u32(a: uint32x2_t) -> poly64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p64_s32(a: int32x4_t) -> poly64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p64_u32(a: uint32x4_t) -> poly64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p128_s64(a: int64x2_t) -> p128 {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p128_u64(a: uint64x2_t) -> p128 {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p128_p64(a: poly64x2_t) -> p128 {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s8_s32(a: int32x2_t) -> int8x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s8_u32(a: uint32x2_t) -> int8x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s16_s64(a: int64x1_t) -> int16x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s16_u64(a: uint64x1_t) -> int16x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s8_s32(a: int32x4_t) -> int8x16_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s8_u32(a: uint32x4_t) -> int8x16_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s16_s64(a: int64x2_t) -> int16x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s16_u64(a: uint64x2_t) -> int16x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u8_s32(a: int32x2_t) -> uint8x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u8_u32(a: uint32x2_t) -> uint8x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u16_s64(a: int64x1_t) -> uint16x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u16_u64(a: uint64x1_t) -> uint16x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u8_s32(a: int32x4_t) -> uint8x16_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u8_u32(a: uint32x4_t) -> uint8x16_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u16_s64(a: int64x2_t) -> uint16x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u16_u64(a: uint64x2_t) -> uint16x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_p8_s32(a: int32x2_t) -> poly8x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_p8_u32(a: uint32x2_t) -> poly8x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_p16_s64(a: int64x1_t) -> poly16x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_p16_u64(a: uint64x1_t) -> poly16x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p8_s32(a: int32x4_t) -> poly8x16_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p8_u32(a: uint32x4_t) -> poly8x16_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p16_s64(a: int64x2_t) -> poly16x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p16_u64(a: uint64x2_t) -> poly16x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s16_p64(a: poly64x1_t) -> int16x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u16_p64(a: poly64x1_t) -> uint16x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_p16_p64(a: poly64x1_t) -> poly16x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s16_p64(a: poly64x2_t) -> int16x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u16_p64(a: poly64x2_t) -> uint16x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p16_p64(a: poly64x2_t) -> poly16x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s32_p128(a: p128) -> int32x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u32_p128(a: p128) -> uint32x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s32_p8(a: poly8x8_t) -> int32x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s32_s8(a: int8x8_t) -> int32x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s32_u8(a: uint8x8_t) -> int32x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s64_p16(a: poly16x4_t) -> int64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s64_s16(a: int16x4_t) -> int64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s64_u16(a: uint16x4_t) -> int64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s32_p8(a: poly8x16_t) -> int32x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s32_s8(a: int8x16_t) -> int32x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s32_u8(a: uint8x16_t) -> int32x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s64_p16(a: poly16x8_t) -> int64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s64_s16(a: int16x8_t) -> int64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s64_u16(a: uint16x8_t) -> int64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u32_p8(a: poly8x8_t) -> uint32x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u32_s8(a: int8x8_t) -> uint32x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u32_u8(a: uint8x8_t) -> uint32x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u64_p16(a: poly16x4_t) -> uint64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u64_s16(a: int16x4_t) -> uint64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u64_u16(a: uint16x4_t) -> uint64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u32_p8(a: poly8x16_t) -> uint32x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u32_s8(a: int8x16_t) -> uint32x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u32_u8(a: uint8x16_t) -> uint32x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u64_p16(a: poly16x8_t) -> uint64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u64_s16(a: int16x8_t) -> uint64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u64_u16(a: uint16x8_t) -> uint64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_p64_p16(a: poly16x4_t) -> poly64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_p64_s16(a: int16x4_t) -> poly64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_p64_u16(a: uint16x4_t) -> poly64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p64_p16(a: poly16x8_t) -> poly64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p64_s16(a: int16x8_t) -> poly64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p64_u16(a: uint16x8_t) -> poly64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p128_s32(a: int32x4_t) -> p128 {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p128_u32(a: uint32x4_t) -> p128 {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s8_s64(a: int64x1_t) -> int8x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s8_u64(a: uint64x1_t) -> int8x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u8_s64(a: int64x1_t) -> uint8x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u8_u64(a: uint64x1_t) -> uint8x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_p8_s64(a: int64x1_t) -> poly8x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_p8_u64(a: uint64x1_t) -> poly8x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s8_s64(a: int64x2_t) -> int8x16_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s8_u64(a: uint64x2_t) -> int8x16_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u8_s64(a: int64x2_t) -> uint8x16_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u8_u64(a: uint64x2_t) -> uint8x16_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p8_s64(a: int64x2_t) -> poly8x16_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p8_u64(a: uint64x2_t) -> poly8x16_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s8_p64(a: poly64x1_t) -> int8x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u8_p64(a: poly64x1_t) -> uint8x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_p8_p64(a: poly64x1_t) -> poly8x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s8_p64(a: poly64x2_t) -> int8x16_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u8_p64(a: poly64x2_t) -> uint8x16_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p8_p64(a: poly64x2_t) -> poly8x16_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s16_p128(a: p128) -> int16x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u16_p128(a: p128) -> uint16x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p16_p128(a: p128) -> poly16x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s64_p8(a: poly8x8_t) -> int64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s64_s8(a: int8x8_t) -> int64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s64_u8(a: uint8x8_t) -> int64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u64_p8(a: poly8x8_t) -> uint64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u64_s8(a: int8x8_t) -> uint64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u64_u8(a: uint8x8_t) -> uint64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s64_p8(a: poly8x16_t) -> int64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s64_s8(a: int8x16_t) -> int64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s64_u8(a: uint8x16_t) -> int64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u64_p8(a: poly8x16_t) -> uint64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u64_s8(a: int8x16_t) -> uint64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u64_u8(a: uint8x16_t) -> uint64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_p64_p8(a: poly8x8_t) -> poly64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_p64_s8(a: int8x8_t) -> poly64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_p64_u8(a: uint8x8_t) -> poly64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p64_p8(a: poly8x16_t) -> poly64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p64_s8(a: int8x16_t) -> poly64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p64_u8(a: uint8x16_t) -> poly64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p128_s16(a: int16x8_t) -> p128 {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p128_u16(a: uint16x8_t) -> p128 {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p128_p16(a: poly16x8_t) -> p128 {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p128_s8(a: int8x16_t) -> p128 {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p128_u8(a: uint8x16_t) -> p128 {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p128_p8(a: poly8x16_t) -> p128 {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s8_p128(a: p128) -> int8x16_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u8_p128(a: p128) -> uint8x16_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p8_p128(a: p128) -> poly8x16_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s8_f32(a: float32x2_t) -> int8x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s16_f32(a: float32x2_t) -> int16x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s32_f32(a: float32x2_t) -> int32x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_s64_f32(a: float32x2_t) -> int64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s8_f32(a: float32x4_t) -> int8x16_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s16_f32(a: float32x4_t) -> int16x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s32_f32(a: float32x4_t) -> int32x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_s64_f32(a: float32x4_t) -> int64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u8_f32(a: float32x2_t) -> uint8x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u16_f32(a: float32x2_t) -> uint16x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u32_f32(a: float32x2_t) -> uint32x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_u64_f32(a: float32x2_t) -> uint64x1_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u8_f32(a: float32x4_t) -> uint8x16_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u16_f32(a: float32x4_t) -> uint16x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u32_f32(a: float32x4_t) -> uint32x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_u64_f32(a: float32x4_t) -> uint64x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_p8_f32(a: float32x2_t) -> poly8x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_p16_f32(a: float32x2_t) -> poly16x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p8_f32(a: float32x4_t) -> poly8x16_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p16_f32(a: float32x4_t) -> poly16x8_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_p128_f32(a: float32x4_t) -> p128 {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_f32_s8(a: int8x8_t) -> float32x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_f32_s16(a: int16x4_t) -> float32x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_f32_s32(a: int32x2_t) -> float32x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_f32_s64(a: int64x1_t) -> float32x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_f32_s8(a: int8x16_t) -> float32x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_f32_s16(a: int16x8_t) -> float32x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_f32_s32(a: int32x4_t) -> float32x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_f32_s64(a: int64x2_t) -> float32x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_f32_u8(a: uint8x8_t) -> float32x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_f32_u16(a: uint16x4_t) -> float32x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_f32_u32(a: uint32x2_t) -> float32x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_f32_u64(a: uint64x1_t) -> float32x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_f32_u8(a: uint8x16_t) -> float32x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_f32_u16(a: uint16x8_t) -> float32x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_f32_u32(a: uint32x4_t) -> float32x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_f32_u64(a: uint64x2_t) -> float32x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_f32_p8(a: poly8x8_t) -> float32x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpret_f32_p16(a: poly16x4_t) -> float32x2_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_f32_p8(a: poly8x16_t) -> float32x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_f32_p16(a: poly16x8_t) -> float32x4_t {
+ transmute(a)
+}
+
+/// Vector reinterpret cast operation
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vreinterpretq_f32_p128(a: p128) -> float32x4_t {
+ transmute(a)
+}
+
+/// Signed rounding shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(srshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrshl_s8(a: int8x8_t, b: int8x8_t) -> int8x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrshifts.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.srshl.v8i8")]
+ fn vrshl_s8_(a: int8x8_t, b: int8x8_t) -> int8x8_t;
+ }
+vrshl_s8_(a, b)
+}
+
+/// Signed rounding shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(srshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrshlq_s8(a: int8x16_t, b: int8x16_t) -> int8x16_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrshifts.v16i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.srshl.v16i8")]
+ fn vrshlq_s8_(a: int8x16_t, b: int8x16_t) -> int8x16_t;
+ }
+vrshlq_s8_(a, b)
+}
+
+/// Signed rounding shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(srshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrshl_s16(a: int16x4_t, b: int16x4_t) -> int16x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrshifts.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.srshl.v4i16")]
+ fn vrshl_s16_(a: int16x4_t, b: int16x4_t) -> int16x4_t;
+ }
+vrshl_s16_(a, b)
+}
+
+/// Signed rounding shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(srshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrshlq_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrshifts.v8i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.srshl.v8i16")]
+ fn vrshlq_s16_(a: int16x8_t, b: int16x8_t) -> int16x8_t;
+ }
+vrshlq_s16_(a, b)
+}
+
+/// Signed rounding shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(srshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrshl_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrshifts.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.srshl.v2i32")]
+ fn vrshl_s32_(a: int32x2_t, b: int32x2_t) -> int32x2_t;
+ }
+vrshl_s32_(a, b)
+}
+
+/// Signed rounding shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(srshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrshlq_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrshifts.v4i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.srshl.v4i32")]
+ fn vrshlq_s32_(a: int32x4_t, b: int32x4_t) -> int32x4_t;
+ }
+vrshlq_s32_(a, b)
+}
+
+/// Signed rounding shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(srshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrshl_s64(a: int64x1_t, b: int64x1_t) -> int64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrshifts.v1i64")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.srshl.v1i64")]
+ fn vrshl_s64_(a: int64x1_t, b: int64x1_t) -> int64x1_t;
+ }
+vrshl_s64_(a, b)
+}
+
+/// Signed rounding shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(srshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrshlq_s64(a: int64x2_t, b: int64x2_t) -> int64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrshifts.v2i64")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.srshl.v2i64")]
+ fn vrshlq_s64_(a: int64x2_t, b: int64x2_t) -> int64x2_t;
+ }
+vrshlq_s64_(a, b)
+}
+
+/// Unsigned rounding shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(urshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrshl_u8(a: uint8x8_t, b: int8x8_t) -> uint8x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrshiftu.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.urshl.v8i8")]
+ fn vrshl_u8_(a: uint8x8_t, b: int8x8_t) -> uint8x8_t;
+ }
+vrshl_u8_(a, b)
+}
+
+/// Unsigned rounding shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(urshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrshlq_u8(a: uint8x16_t, b: int8x16_t) -> uint8x16_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrshiftu.v16i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.urshl.v16i8")]
+ fn vrshlq_u8_(a: uint8x16_t, b: int8x16_t) -> uint8x16_t;
+ }
+vrshlq_u8_(a, b)
+}
+
+/// Unsigned rounding shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(urshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrshl_u16(a: uint16x4_t, b: int16x4_t) -> uint16x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrshiftu.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.urshl.v4i16")]
+ fn vrshl_u16_(a: uint16x4_t, b: int16x4_t) -> uint16x4_t;
+ }
+vrshl_u16_(a, b)
+}
+
+/// Unsigned rounding shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(urshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrshlq_u16(a: uint16x8_t, b: int16x8_t) -> uint16x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrshiftu.v8i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.urshl.v8i16")]
+ fn vrshlq_u16_(a: uint16x8_t, b: int16x8_t) -> uint16x8_t;
+ }
+vrshlq_u16_(a, b)
+}
+
+/// Unsigned rounding shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(urshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrshl_u32(a: uint32x2_t, b: int32x2_t) -> uint32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrshiftu.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.urshl.v2i32")]
+ fn vrshl_u32_(a: uint32x2_t, b: int32x2_t) -> uint32x2_t;
+ }
+vrshl_u32_(a, b)
+}
+
+/// Unsigned rounding shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(urshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrshlq_u32(a: uint32x4_t, b: int32x4_t) -> uint32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrshiftu.v4i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.urshl.v4i32")]
+ fn vrshlq_u32_(a: uint32x4_t, b: int32x4_t) -> uint32x4_t;
+ }
+vrshlq_u32_(a, b)
+}
+
+/// Unsigned rounding shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(urshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrshl_u64(a: uint64x1_t, b: int64x1_t) -> uint64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrshiftu.v1i64")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.urshl.v1i64")]
+ fn vrshl_u64_(a: uint64x1_t, b: int64x1_t) -> uint64x1_t;
+ }
+vrshl_u64_(a, b)
+}
+
+/// Unsigned rounding shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(urshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrshlq_u64(a: uint64x2_t, b: int64x2_t) -> uint64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrshiftu.v2i64")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.urshl.v2i64")]
+ fn vrshlq_u64_(a: uint64x2_t, b: int64x2_t) -> uint64x2_t;
+ }
+vrshlq_u64_(a, b)
+}
+
+/// Signed rounding shift right
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrshr, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(srshr, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrshr_n_s8<const N: i32>(a: int8x8_t) -> int8x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ vrshl_s8(a, vdup_n_s8((-N) as _))
+}
+
+/// Signed rounding shift right
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrshr, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(srshr, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrshrq_n_s8<const N: i32>(a: int8x16_t) -> int8x16_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ vrshlq_s8(a, vdupq_n_s8((-N) as _))
+}
+
+/// Signed rounding shift right
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrshr, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(srshr, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrshr_n_s16<const N: i32>(a: int16x4_t) -> int16x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ vrshl_s16(a, vdup_n_s16((-N) as _))
+}
+
+/// Signed rounding shift right
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrshr, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(srshr, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrshrq_n_s16<const N: i32>(a: int16x8_t) -> int16x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ vrshlq_s16(a, vdupq_n_s16((-N) as _))
+}
+
+/// Signed rounding shift right
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrshr, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(srshr, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrshr_n_s32<const N: i32>(a: int32x2_t) -> int32x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ vrshl_s32(a, vdup_n_s32((-N) as _))
+}
+
+/// Signed rounding shift right
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrshr, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(srshr, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrshrq_n_s32<const N: i32>(a: int32x4_t) -> int32x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ vrshlq_s32(a, vdupq_n_s32((-N) as _))
+}
+
+/// Signed rounding shift right
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrshr, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(srshr, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrshr_n_s64<const N: i32>(a: int64x1_t) -> int64x1_t {
+ static_assert!(N : i32 where N >= 1 && N <= 64);
+ vrshl_s64(a, vdup_n_s64((-N) as _))
+}
+
+/// Signed rounding shift right
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrshr, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(srshr, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrshrq_n_s64<const N: i32>(a: int64x2_t) -> int64x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 64);
+ vrshlq_s64(a, vdupq_n_s64((-N) as _))
+}
+
+/// Unsigned rounding shift right
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrshr, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(urshr, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrshr_n_u8<const N: i32>(a: uint8x8_t) -> uint8x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ vrshl_u8(a, vdup_n_s8((-N) as _))
+}
+
+/// Unsigned rounding shift right
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrshr, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(urshr, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrshrq_n_u8<const N: i32>(a: uint8x16_t) -> uint8x16_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ vrshlq_u8(a, vdupq_n_s8((-N) as _))
+}
+
+/// Unsigned rounding shift right
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrshr, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(urshr, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrshr_n_u16<const N: i32>(a: uint16x4_t) -> uint16x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ vrshl_u16(a, vdup_n_s16((-N) as _))
+}
+
+/// Unsigned rounding shift right
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrshr, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(urshr, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrshrq_n_u16<const N: i32>(a: uint16x8_t) -> uint16x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ vrshlq_u16(a, vdupq_n_s16((-N) as _))
+}
+
+/// Unsigned rounding shift right
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrshr, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(urshr, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrshr_n_u32<const N: i32>(a: uint32x2_t) -> uint32x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ vrshl_u32(a, vdup_n_s32((-N) as _))
+}
+
+/// Unsigned rounding shift right
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrshr, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(urshr, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrshrq_n_u32<const N: i32>(a: uint32x4_t) -> uint32x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ vrshlq_u32(a, vdupq_n_s32((-N) as _))
+}
+
+/// Unsigned rounding shift right
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrshr, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(urshr, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrshr_n_u64<const N: i32>(a: uint64x1_t) -> uint64x1_t {
+ static_assert!(N : i32 where N >= 1 && N <= 64);
+ vrshl_u64(a, vdup_n_s64((-N) as _))
+}
+
+/// Unsigned rounding shift right
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrshr, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(urshr, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrshrq_n_u64<const N: i32>(a: uint64x2_t) -> uint64x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 64);
+ vrshlq_u64(a, vdupq_n_s64((-N) as _))
+}
+
+/// Rounding shift right narrow
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vrshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn vrshrn_n_s16<const N: i32>(a: int16x8_t) -> int8x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrshiftn.v8i8")]
+ fn vrshrn_n_s16_(a: int16x8_t, n: int16x8_t) -> int8x8_t;
+ }
+vrshrn_n_s16_(a, int16x8_t(-N as i16, -N as i16, -N as i16, -N as i16, -N as i16, -N as i16, -N as i16, -N as i16))
+}
+
+/// Rounding shift right narrow
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(rshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrshrn_n_s16<const N: i32>(a: int16x8_t) -> int8x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.rshrn.v8i8")]
+ fn vrshrn_n_s16_(a: int16x8_t, n: i32) -> int8x8_t;
+ }
+vrshrn_n_s16_(a, N)
+}
+
+/// Rounding shift right narrow
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vrshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn vrshrn_n_s32<const N: i32>(a: int32x4_t) -> int16x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrshiftn.v4i16")]
+ fn vrshrn_n_s32_(a: int32x4_t, n: int32x4_t) -> int16x4_t;
+ }
+vrshrn_n_s32_(a, int32x4_t(-N as i32, -N as i32, -N as i32, -N as i32))
+}
+
+/// Rounding shift right narrow
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(rshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrshrn_n_s32<const N: i32>(a: int32x4_t) -> int16x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.rshrn.v4i16")]
+ fn vrshrn_n_s32_(a: int32x4_t, n: i32) -> int16x4_t;
+ }
+vrshrn_n_s32_(a, N)
+}
+
+/// Rounding shift right narrow
+#[inline]
+#[cfg(target_arch = "arm")]
+#[target_feature(enable = "neon,v7")]
+#[cfg_attr(test, assert_instr(vrshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn vrshrn_n_s64<const N: i32>(a: int64x2_t) -> int32x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrshiftn.v2i32")]
+ fn vrshrn_n_s64_(a: int64x2_t, n: int64x2_t) -> int32x2_t;
+ }
+vrshrn_n_s64_(a, int64x2_t(-N as i64, -N as i64))
+}
+
+/// Rounding shift right narrow
+#[inline]
+#[cfg(target_arch = "aarch64")]
+#[target_feature(enable = "neon")]
+#[cfg_attr(test, assert_instr(rshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "neon_intrinsics", since = "1.59.0")]
+pub unsafe fn vrshrn_n_s64<const N: i32>(a: int64x2_t) -> int32x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.rshrn.v2i32")]
+ fn vrshrn_n_s64_(a: int64x2_t, n: i32) -> int32x2_t;
+ }
+vrshrn_n_s64_(a, N)
+}
+
+/// Rounding shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrshrn, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrshrn_n_u16<const N: i32>(a: uint16x8_t) -> uint8x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ transmute(vrshrn_n_s16::<N>(transmute(a)))
+}
+
+/// Rounding shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrshrn, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrshrn_n_u32<const N: i32>(a: uint32x4_t) -> uint16x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ transmute(vrshrn_n_s32::<N>(transmute(a)))
+}
+
+/// Rounding shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrshrn, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rshrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrshrn_n_u64<const N: i32>(a: uint64x2_t) -> uint32x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ transmute(vrshrn_n_s64::<N>(transmute(a)))
+}
+
+/// Signed rounding shift right and accumulate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrsra, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(srsra, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrsra_n_s8<const N: i32>(a: int8x8_t, b: int8x8_t) -> int8x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ simd_add(a, vrshr_n_s8::<N>(b))
+}
+
+/// Signed rounding shift right and accumulate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrsra, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(srsra, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrsraq_n_s8<const N: i32>(a: int8x16_t, b: int8x16_t) -> int8x16_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ simd_add(a, vrshrq_n_s8::<N>(b))
+}
+
+/// Signed rounding shift right and accumulate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrsra, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(srsra, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrsra_n_s16<const N: i32>(a: int16x4_t, b: int16x4_t) -> int16x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ simd_add(a, vrshr_n_s16::<N>(b))
+}
+
+/// Signed rounding shift right and accumulate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrsra, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(srsra, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrsraq_n_s16<const N: i32>(a: int16x8_t, b: int16x8_t) -> int16x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ simd_add(a, vrshrq_n_s16::<N>(b))
+}
+
+/// Signed rounding shift right and accumulate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrsra, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(srsra, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrsra_n_s32<const N: i32>(a: int32x2_t, b: int32x2_t) -> int32x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ simd_add(a, vrshr_n_s32::<N>(b))
+}
+
+/// Signed rounding shift right and accumulate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrsra, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(srsra, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrsraq_n_s32<const N: i32>(a: int32x4_t, b: int32x4_t) -> int32x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ simd_add(a, vrshrq_n_s32::<N>(b))
+}
+
+/// Signed rounding shift right and accumulate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrsra, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(srsra, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrsra_n_s64<const N: i32>(a: int64x1_t, b: int64x1_t) -> int64x1_t {
+ static_assert!(N : i32 where N >= 1 && N <= 64);
+ simd_add(a, vrshr_n_s64::<N>(b))
+}
+
+/// Signed rounding shift right and accumulate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrsra, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(srsra, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrsraq_n_s64<const N: i32>(a: int64x2_t, b: int64x2_t) -> int64x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 64);
+ simd_add(a, vrshrq_n_s64::<N>(b))
+}
+
+/// Unsigned rounding shift right and accumulate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrsra, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ursra, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrsra_n_u8<const N: i32>(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ simd_add(a, vrshr_n_u8::<N>(b))
+}
+
+/// Unsigned rounding shift right and accumulate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrsra, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ursra, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrsraq_n_u8<const N: i32>(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ simd_add(a, vrshrq_n_u8::<N>(b))
+}
+
+/// Unsigned rounding shift right and accumulate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrsra, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ursra, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrsra_n_u16<const N: i32>(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ simd_add(a, vrshr_n_u16::<N>(b))
+}
+
+/// Unsigned rounding shift right and accumulate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrsra, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ursra, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrsraq_n_u16<const N: i32>(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ simd_add(a, vrshrq_n_u16::<N>(b))
+}
+
+/// Unsigned rounding shift right and accumulate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrsra, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ursra, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrsra_n_u32<const N: i32>(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ simd_add(a, vrshr_n_u32::<N>(b))
+}
+
+/// Unsigned rounding shift right and accumulate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrsra, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ursra, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrsraq_n_u32<const N: i32>(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ simd_add(a, vrshrq_n_u32::<N>(b))
+}
+
+/// Unsigned rounding shift right and accumulate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrsra, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ursra, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrsra_n_u64<const N: i32>(a: uint64x1_t, b: uint64x1_t) -> uint64x1_t {
+ static_assert!(N : i32 where N >= 1 && N <= 64);
+ simd_add(a, vrshr_n_u64::<N>(b))
+}
+
+/// Unsigned rounding shift right and accumulate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrsra, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ursra, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrsraq_n_u64<const N: i32>(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 64);
+ simd_add(a, vrshrq_n_u64::<N>(b))
+}
+
+/// Rounding subtract returning high narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrsubhn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rsubhn))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrsubhn_s16(a: int16x8_t, b: int16x8_t) -> int8x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrsubhn.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.rsubhn.v8i8")]
+ fn vrsubhn_s16_(a: int16x8_t, b: int16x8_t) -> int8x8_t;
+ }
+vrsubhn_s16_(a, b)
+}
+
+/// Rounding subtract returning high narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrsubhn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rsubhn))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrsubhn_s32(a: int32x4_t, b: int32x4_t) -> int16x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrsubhn.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.rsubhn.v4i16")]
+ fn vrsubhn_s32_(a: int32x4_t, b: int32x4_t) -> int16x4_t;
+ }
+vrsubhn_s32_(a, b)
+}
+
+/// Rounding subtract returning high narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrsubhn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rsubhn))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrsubhn_s64(a: int64x2_t, b: int64x2_t) -> int32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vrsubhn.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.rsubhn.v2i32")]
+ fn vrsubhn_s64_(a: int64x2_t, b: int64x2_t) -> int32x2_t;
+ }
+vrsubhn_s64_(a, b)
+}
+
+/// Rounding subtract returning high narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrsubhn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rsubhn))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrsubhn_u16(a: uint16x8_t, b: uint16x8_t) -> uint8x8_t {
+ transmute(vrsubhn_s16(transmute(a), transmute(b)))
+}
+
+/// Rounding subtract returning high narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrsubhn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rsubhn))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrsubhn_u32(a: uint32x4_t, b: uint32x4_t) -> uint16x4_t {
+ transmute(vrsubhn_s32(transmute(a), transmute(b)))
+}
+
+/// Rounding subtract returning high narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vrsubhn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rsubhn))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vrsubhn_u64(a: uint64x2_t, b: uint64x2_t) -> uint32x2_t {
+ transmute(vrsubhn_s64(transmute(a), transmute(b)))
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vset_lane_s8<const LANE: i32>(a: i8, b: int8x8_t) -> int8x8_t {
+ static_assert_imm3!(LANE);
+ simd_insert(b, LANE as u32, a)
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vset_lane_s16<const LANE: i32>(a: i16, b: int16x4_t) -> int16x4_t {
+ static_assert_imm2!(LANE);
+ simd_insert(b, LANE as u32, a)
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vset_lane_s32<const LANE: i32>(a: i32, b: int32x2_t) -> int32x2_t {
+ static_assert_imm1!(LANE);
+ simd_insert(b, LANE as u32, a)
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vset_lane_s64<const LANE: i32>(a: i64, b: int64x1_t) -> int64x1_t {
+ static_assert!(LANE : i32 where LANE == 0);
+ simd_insert(b, LANE as u32, a)
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vset_lane_u8<const LANE: i32>(a: u8, b: uint8x8_t) -> uint8x8_t {
+ static_assert_imm3!(LANE);
+ simd_insert(b, LANE as u32, a)
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vset_lane_u16<const LANE: i32>(a: u16, b: uint16x4_t) -> uint16x4_t {
+ static_assert_imm2!(LANE);
+ simd_insert(b, LANE as u32, a)
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vset_lane_u32<const LANE: i32>(a: u32, b: uint32x2_t) -> uint32x2_t {
+ static_assert_imm1!(LANE);
+ simd_insert(b, LANE as u32, a)
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vset_lane_u64<const LANE: i32>(a: u64, b: uint64x1_t) -> uint64x1_t {
+ static_assert!(LANE : i32 where LANE == 0);
+ simd_insert(b, LANE as u32, a)
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vset_lane_p8<const LANE: i32>(a: p8, b: poly8x8_t) -> poly8x8_t {
+ static_assert_imm3!(LANE);
+ simd_insert(b, LANE as u32, a)
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vset_lane_p16<const LANE: i32>(a: p16, b: poly16x4_t) -> poly16x4_t {
+ static_assert_imm2!(LANE);
+ simd_insert(b, LANE as u32, a)
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vset_lane_p64<const LANE: i32>(a: p64, b: poly64x1_t) -> poly64x1_t {
+ static_assert!(LANE : i32 where LANE == 0);
+ simd_insert(b, LANE as u32, a)
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsetq_lane_s8<const LANE: i32>(a: i8, b: int8x16_t) -> int8x16_t {
+ static_assert_imm4!(LANE);
+ simd_insert(b, LANE as u32, a)
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsetq_lane_s16<const LANE: i32>(a: i16, b: int16x8_t) -> int16x8_t {
+ static_assert_imm3!(LANE);
+ simd_insert(b, LANE as u32, a)
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsetq_lane_s32<const LANE: i32>(a: i32, b: int32x4_t) -> int32x4_t {
+ static_assert_imm2!(LANE);
+ simd_insert(b, LANE as u32, a)
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsetq_lane_s64<const LANE: i32>(a: i64, b: int64x2_t) -> int64x2_t {
+ static_assert_imm1!(LANE);
+ simd_insert(b, LANE as u32, a)
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsetq_lane_u8<const LANE: i32>(a: u8, b: uint8x16_t) -> uint8x16_t {
+ static_assert_imm4!(LANE);
+ simd_insert(b, LANE as u32, a)
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsetq_lane_u16<const LANE: i32>(a: u16, b: uint16x8_t) -> uint16x8_t {
+ static_assert_imm3!(LANE);
+ simd_insert(b, LANE as u32, a)
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsetq_lane_u32<const LANE: i32>(a: u32, b: uint32x4_t) -> uint32x4_t {
+ static_assert_imm2!(LANE);
+ simd_insert(b, LANE as u32, a)
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsetq_lane_u64<const LANE: i32>(a: u64, b: uint64x2_t) -> uint64x2_t {
+ static_assert_imm1!(LANE);
+ simd_insert(b, LANE as u32, a)
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsetq_lane_p8<const LANE: i32>(a: p8, b: poly8x16_t) -> poly8x16_t {
+ static_assert_imm4!(LANE);
+ simd_insert(b, LANE as u32, a)
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsetq_lane_p16<const LANE: i32>(a: p16, b: poly16x8_t) -> poly16x8_t {
+ static_assert_imm3!(LANE);
+ simd_insert(b, LANE as u32, a)
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "aes,v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsetq_lane_p64<const LANE: i32>(a: p64, b: poly64x2_t) -> poly64x2_t {
+ static_assert_imm1!(LANE);
+ simd_insert(b, LANE as u32, a)
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vset_lane_f32<const LANE: i32>(a: f32, b: float32x2_t) -> float32x2_t {
+ static_assert_imm1!(LANE);
+ simd_insert(b, LANE as u32, a)
+}
+
+/// Insert vector element from another vector element
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsetq_lane_f32<const LANE: i32>(a: f32, b: float32x4_t) -> float32x4_t {
+ static_assert_imm2!(LANE);
+ simd_insert(b, LANE as u32, a)
+}
+
+/// Signed Shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshl_s8(a: int8x8_t, b: int8x8_t) -> int8x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vshifts.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sshl.v8i8")]
+ fn vshl_s8_(a: int8x8_t, b: int8x8_t) -> int8x8_t;
+ }
+vshl_s8_(a, b)
+}
+
+/// Signed Shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshlq_s8(a: int8x16_t, b: int8x16_t) -> int8x16_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vshifts.v16i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sshl.v16i8")]
+ fn vshlq_s8_(a: int8x16_t, b: int8x16_t) -> int8x16_t;
+ }
+vshlq_s8_(a, b)
+}
+
+/// Signed Shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshl_s16(a: int16x4_t, b: int16x4_t) -> int16x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vshifts.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sshl.v4i16")]
+ fn vshl_s16_(a: int16x4_t, b: int16x4_t) -> int16x4_t;
+ }
+vshl_s16_(a, b)
+}
+
+/// Signed Shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshlq_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vshifts.v8i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sshl.v8i16")]
+ fn vshlq_s16_(a: int16x8_t, b: int16x8_t) -> int16x8_t;
+ }
+vshlq_s16_(a, b)
+}
+
+/// Signed Shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshl_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vshifts.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sshl.v2i32")]
+ fn vshl_s32_(a: int32x2_t, b: int32x2_t) -> int32x2_t;
+ }
+vshl_s32_(a, b)
+}
+
+/// Signed Shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshlq_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vshifts.v4i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sshl.v4i32")]
+ fn vshlq_s32_(a: int32x4_t, b: int32x4_t) -> int32x4_t;
+ }
+vshlq_s32_(a, b)
+}
+
+/// Signed Shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshl_s64(a: int64x1_t, b: int64x1_t) -> int64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vshifts.v1i64")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sshl.v1i64")]
+ fn vshl_s64_(a: int64x1_t, b: int64x1_t) -> int64x1_t;
+ }
+vshl_s64_(a, b)
+}
+
+/// Signed Shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sshl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshlq_s64(a: int64x2_t, b: int64x2_t) -> int64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vshifts.v2i64")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sshl.v2i64")]
+ fn vshlq_s64_(a: int64x2_t, b: int64x2_t) -> int64x2_t;
+ }
+vshlq_s64_(a, b)
+}
+
+/// Unsigned Shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ushl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshl_u8(a: uint8x8_t, b: int8x8_t) -> uint8x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vshiftu.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ushl.v8i8")]
+ fn vshl_u8_(a: uint8x8_t, b: int8x8_t) -> uint8x8_t;
+ }
+vshl_u8_(a, b)
+}
+
+/// Unsigned Shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ushl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshlq_u8(a: uint8x16_t, b: int8x16_t) -> uint8x16_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vshiftu.v16i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ushl.v16i8")]
+ fn vshlq_u8_(a: uint8x16_t, b: int8x16_t) -> uint8x16_t;
+ }
+vshlq_u8_(a, b)
+}
+
+/// Unsigned Shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ushl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshl_u16(a: uint16x4_t, b: int16x4_t) -> uint16x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vshiftu.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ushl.v4i16")]
+ fn vshl_u16_(a: uint16x4_t, b: int16x4_t) -> uint16x4_t;
+ }
+vshl_u16_(a, b)
+}
+
+/// Unsigned Shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ushl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshlq_u16(a: uint16x8_t, b: int16x8_t) -> uint16x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vshiftu.v8i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ushl.v8i16")]
+ fn vshlq_u16_(a: uint16x8_t, b: int16x8_t) -> uint16x8_t;
+ }
+vshlq_u16_(a, b)
+}
+
+/// Unsigned Shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ushl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshl_u32(a: uint32x2_t, b: int32x2_t) -> uint32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vshiftu.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ushl.v2i32")]
+ fn vshl_u32_(a: uint32x2_t, b: int32x2_t) -> uint32x2_t;
+ }
+vshl_u32_(a, b)
+}
+
+/// Unsigned Shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ushl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshlq_u32(a: uint32x4_t, b: int32x4_t) -> uint32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vshiftu.v4i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ushl.v4i32")]
+ fn vshlq_u32_(a: uint32x4_t, b: int32x4_t) -> uint32x4_t;
+ }
+vshlq_u32_(a, b)
+}
+
+/// Unsigned Shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ushl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshl_u64(a: uint64x1_t, b: int64x1_t) -> uint64x1_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vshiftu.v1i64")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ushl.v1i64")]
+ fn vshl_u64_(a: uint64x1_t, b: int64x1_t) -> uint64x1_t;
+ }
+vshl_u64_(a, b)
+}
+
+/// Unsigned Shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vshl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ushl))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshlq_u64(a: uint64x2_t, b: int64x2_t) -> uint64x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vshiftu.v2i64")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ushl.v2i64")]
+ fn vshlq_u64_(a: uint64x2_t, b: int64x2_t) -> uint64x2_t;
+ }
+vshlq_u64_(a, b)
+}
+
+/// Shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vshl, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(shl, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshl_n_s8<const N: i32>(a: int8x8_t) -> int8x8_t {
+ static_assert_imm3!(N);
+ simd_shl(a, vdup_n_s8(N as _))
+}
+
+/// Shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vshl, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(shl, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshlq_n_s8<const N: i32>(a: int8x16_t) -> int8x16_t {
+ static_assert_imm3!(N);
+ simd_shl(a, vdupq_n_s8(N as _))
+}
+
+/// Shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vshl, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(shl, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshl_n_s16<const N: i32>(a: int16x4_t) -> int16x4_t {
+ static_assert_imm4!(N);
+ simd_shl(a, vdup_n_s16(N as _))
+}
+
+/// Shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vshl, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(shl, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshlq_n_s16<const N: i32>(a: int16x8_t) -> int16x8_t {
+ static_assert_imm4!(N);
+ simd_shl(a, vdupq_n_s16(N as _))
+}
+
+/// Shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vshl, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(shl, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshl_n_s32<const N: i32>(a: int32x2_t) -> int32x2_t {
+ static_assert_imm5!(N);
+ simd_shl(a, vdup_n_s32(N as _))
+}
+
+/// Shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vshl, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(shl, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshlq_n_s32<const N: i32>(a: int32x4_t) -> int32x4_t {
+ static_assert_imm5!(N);
+ simd_shl(a, vdupq_n_s32(N as _))
+}
+
+/// Shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vshl, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(shl, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshl_n_u8<const N: i32>(a: uint8x8_t) -> uint8x8_t {
+ static_assert_imm3!(N);
+ simd_shl(a, vdup_n_u8(N as _))
+}
+
+/// Shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vshl, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(shl, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshlq_n_u8<const N: i32>(a: uint8x16_t) -> uint8x16_t {
+ static_assert_imm3!(N);
+ simd_shl(a, vdupq_n_u8(N as _))
+}
+
+/// Shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vshl, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(shl, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshl_n_u16<const N: i32>(a: uint16x4_t) -> uint16x4_t {
+ static_assert_imm4!(N);
+ simd_shl(a, vdup_n_u16(N as _))
+}
+
+/// Shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vshl, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(shl, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshlq_n_u16<const N: i32>(a: uint16x8_t) -> uint16x8_t {
+ static_assert_imm4!(N);
+ simd_shl(a, vdupq_n_u16(N as _))
+}
+
+/// Shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vshl, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(shl, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshl_n_u32<const N: i32>(a: uint32x2_t) -> uint32x2_t {
+ static_assert_imm5!(N);
+ simd_shl(a, vdup_n_u32(N as _))
+}
+
+/// Shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vshl, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(shl, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshlq_n_u32<const N: i32>(a: uint32x4_t) -> uint32x4_t {
+ static_assert_imm5!(N);
+ simd_shl(a, vdupq_n_u32(N as _))
+}
+
+/// Shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vshl, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(shl, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshl_n_s64<const N: i32>(a: int64x1_t) -> int64x1_t {
+ static_assert_imm6!(N);
+ simd_shl(a, vdup_n_s64(N as _))
+}
+
+/// Shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vshl, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(shl, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshlq_n_s64<const N: i32>(a: int64x2_t) -> int64x2_t {
+ static_assert_imm6!(N);
+ simd_shl(a, vdupq_n_s64(N as _))
+}
+
+/// Shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vshl, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(shl, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshl_n_u64<const N: i32>(a: uint64x1_t) -> uint64x1_t {
+ static_assert_imm6!(N);
+ simd_shl(a, vdup_n_u64(N as _))
+}
+
+/// Shift left
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vshl, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(shl, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshlq_n_u64<const N: i32>(a: uint64x2_t) -> uint64x2_t {
+ static_assert_imm6!(N);
+ simd_shl(a, vdupq_n_u64(N as _))
+}
+
+/// Signed shift left long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vshll.s8", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sshll, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshll_n_s8<const N: i32>(a: int8x8_t) -> int16x8_t {
+ static_assert!(N : i32 where N >= 0 && N <= 8);
+ simd_shl(simd_cast(a), vdupq_n_s16(N as _))
+}
+
+/// Signed shift left long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vshll.s16", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sshll, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshll_n_s16<const N: i32>(a: int16x4_t) -> int32x4_t {
+ static_assert!(N : i32 where N >= 0 && N <= 16);
+ simd_shl(simd_cast(a), vdupq_n_s32(N as _))
+}
+
+/// Signed shift left long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vshll.s32", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sshll, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshll_n_s32<const N: i32>(a: int32x2_t) -> int64x2_t {
+ static_assert!(N : i32 where N >= 0 && N <= 32);
+ simd_shl(simd_cast(a), vdupq_n_s64(N as _))
+}
+
+/// Signed shift left long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vshll.u8", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ushll, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshll_n_u8<const N: i32>(a: uint8x8_t) -> uint16x8_t {
+ static_assert!(N : i32 where N >= 0 && N <= 8);
+ simd_shl(simd_cast(a), vdupq_n_u16(N as _))
+}
+
+/// Signed shift left long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vshll.u16", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ushll, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshll_n_u16<const N: i32>(a: uint16x4_t) -> uint32x4_t {
+ static_assert!(N : i32 where N >= 0 && N <= 16);
+ simd_shl(simd_cast(a), vdupq_n_u32(N as _))
+}
+
+/// Signed shift left long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vshll.u32", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ushll, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshll_n_u32<const N: i32>(a: uint32x2_t) -> uint64x2_t {
+ static_assert!(N : i32 where N >= 0 && N <= 32);
+ simd_shl(simd_cast(a), vdupq_n_u64(N as _))
+}
+
+/// Shift right
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vshr.s8", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sshr, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshr_n_s8<const N: i32>(a: int8x8_t) -> int8x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ let n: i32 = if N == 8 { 7 } else { N };
+ simd_shr(a, vdup_n_s8(n as _))
+}
+
+/// Shift right
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vshr.s8", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sshr, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshrq_n_s8<const N: i32>(a: int8x16_t) -> int8x16_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ let n: i32 = if N == 8 { 7 } else { N };
+ simd_shr(a, vdupq_n_s8(n as _))
+}
+
+/// Shift right
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vshr.s16", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sshr, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshr_n_s16<const N: i32>(a: int16x4_t) -> int16x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ let n: i32 = if N == 16 { 15 } else { N };
+ simd_shr(a, vdup_n_s16(n as _))
+}
+
+/// Shift right
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vshr.s16", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sshr, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshrq_n_s16<const N: i32>(a: int16x8_t) -> int16x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ let n: i32 = if N == 16 { 15 } else { N };
+ simd_shr(a, vdupq_n_s16(n as _))
+}
+
+/// Shift right
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vshr.s32", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sshr, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshr_n_s32<const N: i32>(a: int32x2_t) -> int32x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ let n: i32 = if N == 32 { 31 } else { N };
+ simd_shr(a, vdup_n_s32(n as _))
+}
+
+/// Shift right
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vshr.s32", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sshr, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshrq_n_s32<const N: i32>(a: int32x4_t) -> int32x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ let n: i32 = if N == 32 { 31 } else { N };
+ simd_shr(a, vdupq_n_s32(n as _))
+}
+
+/// Shift right
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vshr.s64", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sshr, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshr_n_s64<const N: i32>(a: int64x1_t) -> int64x1_t {
+ static_assert!(N : i32 where N >= 1 && N <= 64);
+ let n: i32 = if N == 64 { 63 } else { N };
+ simd_shr(a, vdup_n_s64(n as _))
+}
+
+/// Shift right
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vshr.s64", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sshr, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshrq_n_s64<const N: i32>(a: int64x2_t) -> int64x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 64);
+ let n: i32 = if N == 64 { 63 } else { N };
+ simd_shr(a, vdupq_n_s64(n as _))
+}
+
+/// Shift right
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vshr.u8", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ushr, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshr_n_u8<const N: i32>(a: uint8x8_t) -> uint8x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ let n: i32 = if N == 8 { return vdup_n_u8(0); } else { N };
+ simd_shr(a, vdup_n_u8(n as _))
+}
+
+/// Shift right
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vshr.u8", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ushr, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshrq_n_u8<const N: i32>(a: uint8x16_t) -> uint8x16_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ let n: i32 = if N == 8 { return vdupq_n_u8(0); } else { N };
+ simd_shr(a, vdupq_n_u8(n as _))
+}
+
+/// Shift right
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vshr.u16", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ushr, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshr_n_u16<const N: i32>(a: uint16x4_t) -> uint16x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ let n: i32 = if N == 16 { return vdup_n_u16(0); } else { N };
+ simd_shr(a, vdup_n_u16(n as _))
+}
+
+/// Shift right
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vshr.u16", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ushr, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshrq_n_u16<const N: i32>(a: uint16x8_t) -> uint16x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ let n: i32 = if N == 16 { return vdupq_n_u16(0); } else { N };
+ simd_shr(a, vdupq_n_u16(n as _))
+}
+
+/// Shift right
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vshr.u32", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ushr, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshr_n_u32<const N: i32>(a: uint32x2_t) -> uint32x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ let n: i32 = if N == 32 { return vdup_n_u32(0); } else { N };
+ simd_shr(a, vdup_n_u32(n as _))
+}
+
+/// Shift right
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vshr.u32", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ushr, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshrq_n_u32<const N: i32>(a: uint32x4_t) -> uint32x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ let n: i32 = if N == 32 { return vdupq_n_u32(0); } else { N };
+ simd_shr(a, vdupq_n_u32(n as _))
+}
+
+/// Shift right
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vshr.u64", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ushr, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshr_n_u64<const N: i32>(a: uint64x1_t) -> uint64x1_t {
+ static_assert!(N : i32 where N >= 1 && N <= 64);
+ let n: i32 = if N == 64 { return vdup_n_u64(0); } else { N };
+ simd_shr(a, vdup_n_u64(n as _))
+}
+
+/// Shift right
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vshr.u64", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ushr, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshrq_n_u64<const N: i32>(a: uint64x2_t) -> uint64x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 64);
+ let n: i32 = if N == 64 { return vdupq_n_u64(0); } else { N };
+ simd_shr(a, vdupq_n_u64(n as _))
+}
+
+/// Shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vshrn.i16", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(shrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshrn_n_s16<const N: i32>(a: int16x8_t) -> int8x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ simd_cast(simd_shr(a, vdupq_n_s16(N as _)))
+}
+
+/// Shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vshrn.i32", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(shrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshrn_n_s32<const N: i32>(a: int32x4_t) -> int16x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ simd_cast(simd_shr(a, vdupq_n_s32(N as _)))
+}
+
+/// Shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vshrn.i64", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(shrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshrn_n_s64<const N: i32>(a: int64x2_t) -> int32x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ simd_cast(simd_shr(a, vdupq_n_s64(N as _)))
+}
+
+/// Shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vshrn.i16", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(shrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshrn_n_u16<const N: i32>(a: uint16x8_t) -> uint8x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ simd_cast(simd_shr(a, vdupq_n_u16(N as _)))
+}
+
+/// Shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vshrn.i32", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(shrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshrn_n_u32<const N: i32>(a: uint32x4_t) -> uint16x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ simd_cast(simd_shr(a, vdupq_n_u32(N as _)))
+}
+
+/// Shift right narrow
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vshrn.i64", N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(shrn, N = 2))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vshrn_n_u64<const N: i32>(a: uint64x2_t) -> uint32x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ simd_cast(simd_shr(a, vdupq_n_u64(N as _)))
+}
+
+/// Signed shift right and accumulate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsra, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ssra, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsra_n_s8<const N: i32>(a: int8x8_t, b: int8x8_t) -> int8x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ simd_add(a, vshr_n_s8::<N>(b))
+}
+
+/// Signed shift right and accumulate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsra, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ssra, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsraq_n_s8<const N: i32>(a: int8x16_t, b: int8x16_t) -> int8x16_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ simd_add(a, vshrq_n_s8::<N>(b))
+}
+
+/// Signed shift right and accumulate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsra, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ssra, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsra_n_s16<const N: i32>(a: int16x4_t, b: int16x4_t) -> int16x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ simd_add(a, vshr_n_s16::<N>(b))
+}
+
+/// Signed shift right and accumulate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsra, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ssra, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsraq_n_s16<const N: i32>(a: int16x8_t, b: int16x8_t) -> int16x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ simd_add(a, vshrq_n_s16::<N>(b))
+}
+
+/// Signed shift right and accumulate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsra, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ssra, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsra_n_s32<const N: i32>(a: int32x2_t, b: int32x2_t) -> int32x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ simd_add(a, vshr_n_s32::<N>(b))
+}
+
+/// Signed shift right and accumulate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsra, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ssra, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsraq_n_s32<const N: i32>(a: int32x4_t, b: int32x4_t) -> int32x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ simd_add(a, vshrq_n_s32::<N>(b))
+}
+
+/// Signed shift right and accumulate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsra, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ssra, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsra_n_s64<const N: i32>(a: int64x1_t, b: int64x1_t) -> int64x1_t {
+ static_assert!(N : i32 where N >= 1 && N <= 64);
+ simd_add(a, vshr_n_s64::<N>(b))
+}
+
+/// Signed shift right and accumulate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsra, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ssra, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsraq_n_s64<const N: i32>(a: int64x2_t, b: int64x2_t) -> int64x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 64);
+ simd_add(a, vshrq_n_s64::<N>(b))
+}
+
+/// Unsigned shift right and accumulate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsra, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(usra, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsra_n_u8<const N: i32>(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ simd_add(a, vshr_n_u8::<N>(b))
+}
+
+/// Unsigned shift right and accumulate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsra, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(usra, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsraq_n_u8<const N: i32>(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t {
+ static_assert!(N : i32 where N >= 1 && N <= 8);
+ simd_add(a, vshrq_n_u8::<N>(b))
+}
+
+/// Unsigned shift right and accumulate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsra, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(usra, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsra_n_u16<const N: i32>(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ simd_add(a, vshr_n_u16::<N>(b))
+}
+
+/// Unsigned shift right and accumulate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsra, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(usra, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsraq_n_u16<const N: i32>(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t {
+ static_assert!(N : i32 where N >= 1 && N <= 16);
+ simd_add(a, vshrq_n_u16::<N>(b))
+}
+
+/// Unsigned shift right and accumulate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsra, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(usra, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsra_n_u32<const N: i32>(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ simd_add(a, vshr_n_u32::<N>(b))
+}
+
+/// Unsigned shift right and accumulate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsra, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(usra, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsraq_n_u32<const N: i32>(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
+ static_assert!(N : i32 where N >= 1 && N <= 32);
+ simd_add(a, vshrq_n_u32::<N>(b))
+}
+
+/// Unsigned shift right and accumulate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsra, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(usra, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsra_n_u64<const N: i32>(a: uint64x1_t, b: uint64x1_t) -> uint64x1_t {
+ static_assert!(N : i32 where N >= 1 && N <= 64);
+ simd_add(a, vshr_n_u64::<N>(b))
+}
+
+/// Unsigned shift right and accumulate
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsra, N = 2))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(usra, N = 2))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vsraq_n_u64<const N: i32>(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t {
+ static_assert!(N : i32 where N >= 1 && N <= 64);
+ simd_add(a, vshrq_n_u64::<N>(b))
+}
+
+/// Transpose elements
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(trn))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vtrn_s8(a: int8x8_t, b: int8x8_t) -> int8x8x2_t {
+ let a1: int8x8_t = simd_shuffle8!(a, b, [0, 8, 2, 10, 4, 12, 6, 14]);
+ let b1: int8x8_t = simd_shuffle8!(a, b, [1, 9, 3, 11, 5, 13, 7, 15]);
+ transmute((a1, b1))
+}
+
+/// Transpose elements
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(trn))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vtrn_s16(a: int16x4_t, b: int16x4_t) -> int16x4x2_t {
+ let a1: int16x4_t = simd_shuffle4!(a, b, [0, 4, 2, 6]);
+ let b1: int16x4_t = simd_shuffle4!(a, b, [1, 5, 3, 7]);
+ transmute((a1, b1))
+}
+
+/// Transpose elements
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(trn))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vtrnq_s8(a: int8x16_t, b: int8x16_t) -> int8x16x2_t {
+ let a1: int8x16_t = simd_shuffle16!(a, b, [0, 16, 2, 18, 4, 20, 6, 22, 8, 24, 10, 26, 12, 28, 14, 30]);
+ let b1: int8x16_t = simd_shuffle16!(a, b, [1, 17, 3, 19, 5, 21, 7, 23, 9, 25, 11, 27, 13, 29, 15, 31]);
+ transmute((a1, b1))
+}
+
+/// Transpose elements
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(trn))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vtrnq_s16(a: int16x8_t, b: int16x8_t) -> int16x8x2_t {
+ let a1: int16x8_t = simd_shuffle8!(a, b, [0, 8, 2, 10, 4, 12, 6, 14]);
+ let b1: int16x8_t = simd_shuffle8!(a, b, [1, 9, 3, 11, 5, 13, 7, 15]);
+ transmute((a1, b1))
+}
+
+/// Transpose elements
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(trn))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vtrnq_s32(a: int32x4_t, b: int32x4_t) -> int32x4x2_t {
+ let a1: int32x4_t = simd_shuffle4!(a, b, [0, 4, 2, 6]);
+ let b1: int32x4_t = simd_shuffle4!(a, b, [1, 5, 3, 7]);
+ transmute((a1, b1))
+}
+
+/// Transpose elements
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(trn))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vtrn_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8x2_t {
+ let a1: uint8x8_t = simd_shuffle8!(a, b, [0, 8, 2, 10, 4, 12, 6, 14]);
+ let b1: uint8x8_t = simd_shuffle8!(a, b, [1, 9, 3, 11, 5, 13, 7, 15]);
+ transmute((a1, b1))
+}
+
+/// Transpose elements
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(trn))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vtrn_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4x2_t {
+ let a1: uint16x4_t = simd_shuffle4!(a, b, [0, 4, 2, 6]);
+ let b1: uint16x4_t = simd_shuffle4!(a, b, [1, 5, 3, 7]);
+ transmute((a1, b1))
+}
+
+/// Transpose elements
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(trn))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vtrnq_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16x2_t {
+ let a1: uint8x16_t = simd_shuffle16!(a, b, [0, 16, 2, 18, 4, 20, 6, 22, 8, 24, 10, 26, 12, 28, 14, 30]);
+ let b1: uint8x16_t = simd_shuffle16!(a, b, [1, 17, 3, 19, 5, 21, 7, 23, 9, 25, 11, 27, 13, 29, 15, 31]);
+ transmute((a1, b1))
+}
+
+/// Transpose elements
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(trn))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vtrnq_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8x2_t {
+ let a1: uint16x8_t = simd_shuffle8!(a, b, [0, 8, 2, 10, 4, 12, 6, 14]);
+ let b1: uint16x8_t = simd_shuffle8!(a, b, [1, 9, 3, 11, 5, 13, 7, 15]);
+ transmute((a1, b1))
+}
+
+/// Transpose elements
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(trn))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vtrnq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4x2_t {
+ let a1: uint32x4_t = simd_shuffle4!(a, b, [0, 4, 2, 6]);
+ let b1: uint32x4_t = simd_shuffle4!(a, b, [1, 5, 3, 7]);
+ transmute((a1, b1))
+}
+
+/// Transpose elements
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(trn))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vtrn_p8(a: poly8x8_t, b: poly8x8_t) -> poly8x8x2_t {
+ let a1: poly8x8_t = simd_shuffle8!(a, b, [0, 8, 2, 10, 4, 12, 6, 14]);
+ let b1: poly8x8_t = simd_shuffle8!(a, b, [1, 9, 3, 11, 5, 13, 7, 15]);
+ transmute((a1, b1))
+}
+
+/// Transpose elements
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(trn))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vtrn_p16(a: poly16x4_t, b: poly16x4_t) -> poly16x4x2_t {
+ let a1: poly16x4_t = simd_shuffle4!(a, b, [0, 4, 2, 6]);
+ let b1: poly16x4_t = simd_shuffle4!(a, b, [1, 5, 3, 7]);
+ transmute((a1, b1))
+}
+
+/// Transpose elements
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(trn))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vtrnq_p8(a: poly8x16_t, b: poly8x16_t) -> poly8x16x2_t {
+ let a1: poly8x16_t = simd_shuffle16!(a, b, [0, 16, 2, 18, 4, 20, 6, 22, 8, 24, 10, 26, 12, 28, 14, 30]);
+ let b1: poly8x16_t = simd_shuffle16!(a, b, [1, 17, 3, 19, 5, 21, 7, 23, 9, 25, 11, 27, 13, 29, 15, 31]);
+ transmute((a1, b1))
+}
+
+/// Transpose elements
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(trn))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vtrnq_p16(a: poly16x8_t, b: poly16x8_t) -> poly16x8x2_t {
+ let a1: poly16x8_t = simd_shuffle8!(a, b, [0, 8, 2, 10, 4, 12, 6, 14]);
+ let b1: poly16x8_t = simd_shuffle8!(a, b, [1, 9, 3, 11, 5, 13, 7, 15]);
+ transmute((a1, b1))
+}
+
+/// Transpose elements
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(zip))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vtrn_s32(a: int32x2_t, b: int32x2_t) -> int32x2x2_t {
+ let a1: int32x2_t = simd_shuffle2!(a, b, [0, 2]);
+ let b1: int32x2_t = simd_shuffle2!(a, b, [1, 3]);
+ transmute((a1, b1))
+}
+
+/// Transpose elements
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(zip))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vtrn_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2x2_t {
+ let a1: uint32x2_t = simd_shuffle2!(a, b, [0, 2]);
+ let b1: uint32x2_t = simd_shuffle2!(a, b, [1, 3]);
+ transmute((a1, b1))
+}
+
+/// Transpose elements
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(zip))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vtrn_f32(a: float32x2_t, b: float32x2_t) -> float32x2x2_t {
+ let a1: float32x2_t = simd_shuffle2!(a, b, [0, 2]);
+ let b1: float32x2_t = simd_shuffle2!(a, b, [1, 3]);
+ transmute((a1, b1))
+}
+
+/// Transpose elements
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(trn))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vtrnq_f32(a: float32x4_t, b: float32x4_t) -> float32x4x2_t {
+ let a1: float32x4_t = simd_shuffle4!(a, b, [0, 4, 2, 6]);
+ let b1: float32x4_t = simd_shuffle4!(a, b, [1, 5, 3, 7]);
+ transmute((a1, b1))
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vzip))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(zip))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vzip_s8(a: int8x8_t, b: int8x8_t) -> int8x8x2_t {
+ let a0: int8x8_t = simd_shuffle8!(a, b, [0, 8, 1, 9, 2, 10, 3, 11]);
+ let b0: int8x8_t = simd_shuffle8!(a, b, [4, 12, 5, 13, 6, 14, 7, 15]);
+ transmute((a0, b0))
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vzip))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(zip))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vzip_s16(a: int16x4_t, b: int16x4_t) -> int16x4x2_t {
+ let a0: int16x4_t = simd_shuffle4!(a, b, [0, 4, 1, 5]);
+ let b0: int16x4_t = simd_shuffle4!(a, b, [2, 6, 3, 7]);
+ transmute((a0, b0))
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vzip))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(zip))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vzip_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8x2_t {
+ let a0: uint8x8_t = simd_shuffle8!(a, b, [0, 8, 1, 9, 2, 10, 3, 11]);
+ let b0: uint8x8_t = simd_shuffle8!(a, b, [4, 12, 5, 13, 6, 14, 7, 15]);
+ transmute((a0, b0))
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vzip))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(zip))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vzip_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4x2_t {
+ let a0: uint16x4_t = simd_shuffle4!(a, b, [0, 4, 1, 5]);
+ let b0: uint16x4_t = simd_shuffle4!(a, b, [2, 6, 3, 7]);
+ transmute((a0, b0))
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vzip))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(zip))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vzip_p8(a: poly8x8_t, b: poly8x8_t) -> poly8x8x2_t {
+ let a0: poly8x8_t = simd_shuffle8!(a, b, [0, 8, 1, 9, 2, 10, 3, 11]);
+ let b0: poly8x8_t = simd_shuffle8!(a, b, [4, 12, 5, 13, 6, 14, 7, 15]);
+ transmute((a0, b0))
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vzip))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(zip))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vzip_p16(a: poly16x4_t, b: poly16x4_t) -> poly16x4x2_t {
+ let a0: poly16x4_t = simd_shuffle4!(a, b, [0, 4, 1, 5]);
+ let b0: poly16x4_t = simd_shuffle4!(a, b, [2, 6, 3, 7]);
+ transmute((a0, b0))
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(zip))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vzip_s32(a: int32x2_t, b: int32x2_t) -> int32x2x2_t {
+ let a0: int32x2_t = simd_shuffle2!(a, b, [0, 2]);
+ let b0: int32x2_t = simd_shuffle2!(a, b, [1, 3]);
+ transmute((a0, b0))
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(zip))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vzip_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2x2_t {
+ let a0: uint32x2_t = simd_shuffle2!(a, b, [0, 2]);
+ let b0: uint32x2_t = simd_shuffle2!(a, b, [1, 3]);
+ transmute((a0, b0))
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorr))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ext))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vzipq_s8(a: int8x16_t, b: int8x16_t) -> int8x16x2_t {
+ let a0: int8x16_t = simd_shuffle16!(a, b, [0, 16, 1, 17, 2, 18, 3, 19, 4, 20, 5, 21, 6, 22, 7, 23]);
+ let b0: int8x16_t = simd_shuffle16!(a, b, [8, 24, 9, 25, 10, 26, 11, 27, 12, 28, 13, 29, 14, 30, 15, 31]);
+ transmute((a0, b0))
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorr))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ext))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vzipq_s16(a: int16x8_t, b: int16x8_t) -> int16x8x2_t {
+ let a0: int16x8_t = simd_shuffle8!(a, b, [0, 8, 1, 9, 2, 10, 3, 11]);
+ let b0: int16x8_t = simd_shuffle8!(a, b, [4, 12, 5, 13, 6, 14, 7, 15]);
+ transmute((a0, b0))
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorr))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ext))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vzipq_s32(a: int32x4_t, b: int32x4_t) -> int32x4x2_t {
+ let a0: int32x4_t = simd_shuffle4!(a, b, [0, 4, 1, 5]);
+ let b0: int32x4_t = simd_shuffle4!(a, b, [2, 6, 3, 7]);
+ transmute((a0, b0))
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorr))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ext))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vzipq_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16x2_t {
+ let a0: uint8x16_t = simd_shuffle16!(a, b, [0, 16, 1, 17, 2, 18, 3, 19, 4, 20, 5, 21, 6, 22, 7, 23]);
+ let b0: uint8x16_t = simd_shuffle16!(a, b, [8, 24, 9, 25, 10, 26, 11, 27, 12, 28, 13, 29, 14, 30, 15, 31]);
+ transmute((a0, b0))
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorr))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ext))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vzipq_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8x2_t {
+ let a0: uint16x8_t = simd_shuffle8!(a, b, [0, 8, 1, 9, 2, 10, 3, 11]);
+ let b0: uint16x8_t = simd_shuffle8!(a, b, [4, 12, 5, 13, 6, 14, 7, 15]);
+ transmute((a0, b0))
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorr))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ext))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vzipq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4x2_t {
+ let a0: uint32x4_t = simd_shuffle4!(a, b, [0, 4, 1, 5]);
+ let b0: uint32x4_t = simd_shuffle4!(a, b, [2, 6, 3, 7]);
+ transmute((a0, b0))
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorr))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ext))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vzipq_p8(a: poly8x16_t, b: poly8x16_t) -> poly8x16x2_t {
+ let a0: poly8x16_t = simd_shuffle16!(a, b, [0, 16, 1, 17, 2, 18, 3, 19, 4, 20, 5, 21, 6, 22, 7, 23]);
+ let b0: poly8x16_t = simd_shuffle16!(a, b, [8, 24, 9, 25, 10, 26, 11, 27, 12, 28, 13, 29, 14, 30, 15, 31]);
+ transmute((a0, b0))
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorr))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ext))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vzipq_p16(a: poly16x8_t, b: poly16x8_t) -> poly16x8x2_t {
+ let a0: poly16x8_t = simd_shuffle8!(a, b, [0, 8, 1, 9, 2, 10, 3, 11]);
+ let b0: poly16x8_t = simd_shuffle8!(a, b, [4, 12, 5, 13, 6, 14, 7, 15]);
+ transmute((a0, b0))
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(zip))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vzip_f32(a: float32x2_t, b: float32x2_t) -> float32x2x2_t {
+ let a0: float32x2_t = simd_shuffle2!(a, b, [0, 2]);
+ let b0: float32x2_t = simd_shuffle2!(a, b, [1, 3]);
+ transmute((a0, b0))
+}
+
+/// Zip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorr))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ext))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vzipq_f32(a: float32x4_t, b: float32x4_t) -> float32x4x2_t {
+ let a0: float32x4_t = simd_shuffle4!(a, b, [0, 4, 1, 5]);
+ let b0: float32x4_t = simd_shuffle4!(a, b, [2, 6, 3, 7]);
+ transmute((a0, b0))
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vuzp))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uzp))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vuzp_s8(a: int8x8_t, b: int8x8_t) -> int8x8x2_t {
+ let a0: int8x8_t = simd_shuffle8!(a, b, [0, 2, 4, 6, 8, 10, 12, 14]);
+ let b0: int8x8_t = simd_shuffle8!(a, b, [1, 3, 5, 7, 9, 11, 13, 15]);
+ transmute((a0, b0))
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vuzp))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uzp))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vuzp_s16(a: int16x4_t, b: int16x4_t) -> int16x4x2_t {
+ let a0: int16x4_t = simd_shuffle4!(a, b, [0, 2, 4, 6]);
+ let b0: int16x4_t = simd_shuffle4!(a, b, [1, 3, 5, 7]);
+ transmute((a0, b0))
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vuzp))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uzp))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vuzpq_s8(a: int8x16_t, b: int8x16_t) -> int8x16x2_t {
+ let a0: int8x16_t = simd_shuffle16!(a, b, [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30]);
+ let b0: int8x16_t = simd_shuffle16!(a, b, [1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31]);
+ transmute((a0, b0))
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vuzp))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uzp))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vuzpq_s16(a: int16x8_t, b: int16x8_t) -> int16x8x2_t {
+ let a0: int16x8_t = simd_shuffle8!(a, b, [0, 2, 4, 6, 8, 10, 12, 14]);
+ let b0: int16x8_t = simd_shuffle8!(a, b, [1, 3, 5, 7, 9, 11, 13, 15]);
+ transmute((a0, b0))
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vuzp))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uzp))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vuzpq_s32(a: int32x4_t, b: int32x4_t) -> int32x4x2_t {
+ let a0: int32x4_t = simd_shuffle4!(a, b, [0, 2, 4, 6]);
+ let b0: int32x4_t = simd_shuffle4!(a, b, [1, 3, 5, 7]);
+ transmute((a0, b0))
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vuzp))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uzp))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vuzp_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8x2_t {
+ let a0: uint8x8_t = simd_shuffle8!(a, b, [0, 2, 4, 6, 8, 10, 12, 14]);
+ let b0: uint8x8_t = simd_shuffle8!(a, b, [1, 3, 5, 7, 9, 11, 13, 15]);
+ transmute((a0, b0))
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vuzp))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uzp))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vuzp_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4x2_t {
+ let a0: uint16x4_t = simd_shuffle4!(a, b, [0, 2, 4, 6]);
+ let b0: uint16x4_t = simd_shuffle4!(a, b, [1, 3, 5, 7]);
+ transmute((a0, b0))
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vuzp))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uzp))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vuzpq_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16x2_t {
+ let a0: uint8x16_t = simd_shuffle16!(a, b, [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30]);
+ let b0: uint8x16_t = simd_shuffle16!(a, b, [1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31]);
+ transmute((a0, b0))
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vuzp))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uzp))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vuzpq_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8x2_t {
+ let a0: uint16x8_t = simd_shuffle8!(a, b, [0, 2, 4, 6, 8, 10, 12, 14]);
+ let b0: uint16x8_t = simd_shuffle8!(a, b, [1, 3, 5, 7, 9, 11, 13, 15]);
+ transmute((a0, b0))
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vuzp))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uzp))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vuzpq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4x2_t {
+ let a0: uint32x4_t = simd_shuffle4!(a, b, [0, 2, 4, 6]);
+ let b0: uint32x4_t = simd_shuffle4!(a, b, [1, 3, 5, 7]);
+ transmute((a0, b0))
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vuzp))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uzp))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vuzp_p8(a: poly8x8_t, b: poly8x8_t) -> poly8x8x2_t {
+ let a0: poly8x8_t = simd_shuffle8!(a, b, [0, 2, 4, 6, 8, 10, 12, 14]);
+ let b0: poly8x8_t = simd_shuffle8!(a, b, [1, 3, 5, 7, 9, 11, 13, 15]);
+ transmute((a0, b0))
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vuzp))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uzp))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vuzp_p16(a: poly16x4_t, b: poly16x4_t) -> poly16x4x2_t {
+ let a0: poly16x4_t = simd_shuffle4!(a, b, [0, 2, 4, 6]);
+ let b0: poly16x4_t = simd_shuffle4!(a, b, [1, 3, 5, 7]);
+ transmute((a0, b0))
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vuzp))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uzp))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vuzpq_p8(a: poly8x16_t, b: poly8x16_t) -> poly8x16x2_t {
+ let a0: poly8x16_t = simd_shuffle16!(a, b, [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30]);
+ let b0: poly8x16_t = simd_shuffle16!(a, b, [1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31]);
+ transmute((a0, b0))
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vuzp))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uzp))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vuzpq_p16(a: poly16x8_t, b: poly16x8_t) -> poly16x8x2_t {
+ let a0: poly16x8_t = simd_shuffle8!(a, b, [0, 2, 4, 6, 8, 10, 12, 14]);
+ let b0: poly16x8_t = simd_shuffle8!(a, b, [1, 3, 5, 7, 9, 11, 13, 15]);
+ transmute((a0, b0))
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(zip))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vuzp_s32(a: int32x2_t, b: int32x2_t) -> int32x2x2_t {
+ let a0: int32x2_t = simd_shuffle2!(a, b, [0, 2]);
+ let b0: int32x2_t = simd_shuffle2!(a, b, [1, 3]);
+ transmute((a0, b0))
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(zip))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vuzp_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2x2_t {
+ let a0: uint32x2_t = simd_shuffle2!(a, b, [0, 2]);
+ let b0: uint32x2_t = simd_shuffle2!(a, b, [1, 3]);
+ transmute((a0, b0))
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vtrn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(zip))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vuzp_f32(a: float32x2_t, b: float32x2_t) -> float32x2x2_t {
+ let a0: float32x2_t = simd_shuffle2!(a, b, [0, 2]);
+ let b0: float32x2_t = simd_shuffle2!(a, b, [1, 3]);
+ transmute((a0, b0))
+}
+
+/// Unzip vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vuzp))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uzp))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vuzpq_f32(a: float32x4_t, b: float32x4_t) -> float32x4x2_t {
+ let a0: float32x4_t = simd_shuffle4!(a, b, [0, 2, 4, 6]);
+ let b0: float32x4_t = simd_shuffle4!(a, b, [1, 3, 5, 7]);
+ transmute((a0, b0))
+}
+
+/// Unsigned Absolute difference and Accumulate Long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vabal.u8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uabal))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vabal_u8(a: uint16x8_t, b: uint8x8_t, c: uint8x8_t) -> uint16x8_t {
+ let d: uint8x8_t = vabd_u8(b, c);
+ simd_add(a, simd_cast(d))
+}
+
+/// Unsigned Absolute difference and Accumulate Long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vabal.u16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uabal))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vabal_u16(a: uint32x4_t, b: uint16x4_t, c: uint16x4_t) -> uint32x4_t {
+ let d: uint16x4_t = vabd_u16(b, c);
+ simd_add(a, simd_cast(d))
+}
+
+/// Unsigned Absolute difference and Accumulate Long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vabal.u32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uabal))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vabal_u32(a: uint64x2_t, b: uint32x2_t, c: uint32x2_t) -> uint64x2_t {
+ let d: uint32x2_t = vabd_u32(b, c);
+ simd_add(a, simd_cast(d))
+}
+
+/// Signed Absolute difference and Accumulate Long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vabal.s8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sabal))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vabal_s8(a: int16x8_t, b: int8x8_t, c: int8x8_t) -> int16x8_t {
+ let d: int8x8_t = vabd_s8(b, c);
+ let e: uint8x8_t = simd_cast(d);
+ simd_add(a, simd_cast(e))
+}
+
+/// Signed Absolute difference and Accumulate Long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vabal.s16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sabal))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vabal_s16(a: int32x4_t, b: int16x4_t, c: int16x4_t) -> int32x4_t {
+ let d: int16x4_t = vabd_s16(b, c);
+ let e: uint16x4_t = simd_cast(d);
+ simd_add(a, simd_cast(e))
+}
+
+/// Signed Absolute difference and Accumulate Long
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vabal.s32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sabal))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vabal_s32(a: int64x2_t, b: int32x2_t, c: int32x2_t) -> int64x2_t {
+ let d: int32x2_t = vabd_s32(b, c);
+ let e: uint32x2_t = simd_cast(d);
+ simd_add(a, simd_cast(e))
+}
+
+/// Singned saturating Absolute value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqabs.s8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqabs))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqabs_s8(a: int8x8_t) -> int8x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqabs.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqabs.v8i8")]
+ fn vqabs_s8_(a: int8x8_t) -> int8x8_t;
+ }
+vqabs_s8_(a)
+}
+
+/// Singned saturating Absolute value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqabs.s8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqabs))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqabsq_s8(a: int8x16_t) -> int8x16_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqabs.v16i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqabs.v16i8")]
+ fn vqabsq_s8_(a: int8x16_t) -> int8x16_t;
+ }
+vqabsq_s8_(a)
+}
+
+/// Singned saturating Absolute value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqabs.s16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqabs))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqabs_s16(a: int16x4_t) -> int16x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqabs.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqabs.v4i16")]
+ fn vqabs_s16_(a: int16x4_t) -> int16x4_t;
+ }
+vqabs_s16_(a)
+}
+
+/// Singned saturating Absolute value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqabs.s16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqabs))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqabsq_s16(a: int16x8_t) -> int16x8_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqabs.v8i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqabs.v8i16")]
+ fn vqabsq_s16_(a: int16x8_t) -> int16x8_t;
+ }
+vqabsq_s16_(a)
+}
+
+/// Singned saturating Absolute value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqabs.s32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqabs))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqabs_s32(a: int32x2_t) -> int32x2_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqabs.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqabs.v2i32")]
+ fn vqabs_s32_(a: int32x2_t) -> int32x2_t;
+ }
+vqabs_s32_(a)
+}
+
+/// Singned saturating Absolute value
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vqabs.s32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sqabs))]
+#[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+pub unsafe fn vqabsq_s32(a: int32x4_t) -> int32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqabs.v4i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sqabs.v4i32")]
+ fn vqabsq_s32_(a: int32x4_t) -> int32x4_t;
+ }
+vqabsq_s32_(a)
+}
+
+#[cfg(test)]
+#[allow(overflowing_literals)]
+mod test {
+ use super::*;
+ use crate::core_arch::simd::*;
+ use std::mem::transmute;
+ use stdarch_test::simd_test;
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vand_s8() {
+ let a: i8x8 = i8x8::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let b: i8x8 = i8x8::new(0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F);
+ let e: i8x8 = i8x8::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let r: i8x8 = transmute(vand_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+
+ let a: i8x8 = i8x8::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let b: i8x8 = i8x8::new(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
+ let e: i8x8 = i8x8::new(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
+ let r: i8x8 = transmute(vand_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vandq_s8() {
+ let a: i8x16 = i8x16::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x00);
+ let b: i8x16 = i8x16::new(0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F);
+ let e: i8x16 = i8x16::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x00);
+ let r: i8x16 = transmute(vandq_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+
+ let a: i8x16 = i8x16::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x00);
+ let b: i8x16 = i8x16::new(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
+ let e: i8x16 = i8x16::new(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
+ let r: i8x16 = transmute(vandq_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vand_s16() {
+ let a: i16x4 = i16x4::new(0x00, 0x01, 0x02, 0x03);
+ let b: i16x4 = i16x4::new(0x0F, 0x0F, 0x0F, 0x0F);
+ let e: i16x4 = i16x4::new(0x00, 0x01, 0x02, 0x03);
+ let r: i16x4 = transmute(vand_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+
+ let a: i16x4 = i16x4::new(0x00, 0x01, 0x02, 0x03);
+ let b: i16x4 = i16x4::new(0x00, 0x00, 0x00, 0x00);
+ let e: i16x4 = i16x4::new(0x00, 0x00, 0x00, 0x00);
+ let r: i16x4 = transmute(vand_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vandq_s16() {
+ let a: i16x8 = i16x8::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let b: i16x8 = i16x8::new(0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F);
+ let e: i16x8 = i16x8::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let r: i16x8 = transmute(vandq_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+
+ let a: i16x8 = i16x8::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let b: i16x8 = i16x8::new(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
+ let e: i16x8 = i16x8::new(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
+ let r: i16x8 = transmute(vandq_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vand_s32() {
+ let a: i32x2 = i32x2::new(0x00, 0x01);
+ let b: i32x2 = i32x2::new(0x0F, 0x0F);
+ let e: i32x2 = i32x2::new(0x00, 0x01);
+ let r: i32x2 = transmute(vand_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+
+ let a: i32x2 = i32x2::new(0x00, 0x01);
+ let b: i32x2 = i32x2::new(0x00, 0x00);
+ let e: i32x2 = i32x2::new(0x00, 0x00);
+ let r: i32x2 = transmute(vand_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vandq_s32() {
+ let a: i32x4 = i32x4::new(0x00, 0x01, 0x02, 0x03);
+ let b: i32x4 = i32x4::new(0x0F, 0x0F, 0x0F, 0x0F);
+ let e: i32x4 = i32x4::new(0x00, 0x01, 0x02, 0x03);
+ let r: i32x4 = transmute(vandq_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+
+ let a: i32x4 = i32x4::new(0x00, 0x01, 0x02, 0x03);
+ let b: i32x4 = i32x4::new(0x00, 0x00, 0x00, 0x00);
+ let e: i32x4 = i32x4::new(0x00, 0x00, 0x00, 0x00);
+ let r: i32x4 = transmute(vandq_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vand_u8() {
+ let a: u8x8 = u8x8::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let b: u8x8 = u8x8::new(0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F);
+ let e: u8x8 = u8x8::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let r: u8x8 = transmute(vand_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+
+ let a: u8x8 = u8x8::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let b: u8x8 = u8x8::new(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
+ let e: u8x8 = u8x8::new(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
+ let r: u8x8 = transmute(vand_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vandq_u8() {
+ let a: u8x16 = u8x16::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x00);
+ let b: u8x16 = u8x16::new(0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F);
+ let e: u8x16 = u8x16::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x00);
+ let r: u8x16 = transmute(vandq_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+
+ let a: u8x16 = u8x16::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x00);
+ let b: u8x16 = u8x16::new(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
+ let e: u8x16 = u8x16::new(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
+ let r: u8x16 = transmute(vandq_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vand_u16() {
+ let a: u16x4 = u16x4::new(0x00, 0x01, 0x02, 0x03);
+ let b: u16x4 = u16x4::new(0x0F, 0x0F, 0x0F, 0x0F);
+ let e: u16x4 = u16x4::new(0x00, 0x01, 0x02, 0x03);
+ let r: u16x4 = transmute(vand_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+
+ let a: u16x4 = u16x4::new(0x00, 0x01, 0x02, 0x03);
+ let b: u16x4 = u16x4::new(0x00, 0x00, 0x00, 0x00);
+ let e: u16x4 = u16x4::new(0x00, 0x00, 0x00, 0x00);
+ let r: u16x4 = transmute(vand_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vandq_u16() {
+ let a: u16x8 = u16x8::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let b: u16x8 = u16x8::new(0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F);
+ let e: u16x8 = u16x8::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let r: u16x8 = transmute(vandq_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+
+ let a: u16x8 = u16x8::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let b: u16x8 = u16x8::new(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
+ let e: u16x8 = u16x8::new(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
+ let r: u16x8 = transmute(vandq_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vand_u32() {
+ let a: u32x2 = u32x2::new(0x00, 0x01);
+ let b: u32x2 = u32x2::new(0x0F, 0x0F);
+ let e: u32x2 = u32x2::new(0x00, 0x01);
+ let r: u32x2 = transmute(vand_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+
+ let a: u32x2 = u32x2::new(0x00, 0x01);
+ let b: u32x2 = u32x2::new(0x00, 0x00);
+ let e: u32x2 = u32x2::new(0x00, 0x00);
+ let r: u32x2 = transmute(vand_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vandq_u32() {
+ let a: u32x4 = u32x4::new(0x00, 0x01, 0x02, 0x03);
+ let b: u32x4 = u32x4::new(0x0F, 0x0F, 0x0F, 0x0F);
+ let e: u32x4 = u32x4::new(0x00, 0x01, 0x02, 0x03);
+ let r: u32x4 = transmute(vandq_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+
+ let a: u32x4 = u32x4::new(0x00, 0x01, 0x02, 0x03);
+ let b: u32x4 = u32x4::new(0x00, 0x00, 0x00, 0x00);
+ let e: u32x4 = u32x4::new(0x00, 0x00, 0x00, 0x00);
+ let r: u32x4 = transmute(vandq_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vand_s64() {
+ let a: i64x1 = i64x1::new(0x00);
+ let b: i64x1 = i64x1::new(0x0F);
+ let e: i64x1 = i64x1::new(0x00);
+ let r: i64x1 = transmute(vand_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+
+ let a: i64x1 = i64x1::new(0x00);
+ let b: i64x1 = i64x1::new(0x00);
+ let e: i64x1 = i64x1::new(0x00);
+ let r: i64x1 = transmute(vand_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vandq_s64() {
+ let a: i64x2 = i64x2::new(0x00, 0x01);
+ let b: i64x2 = i64x2::new(0x0F, 0x0F);
+ let e: i64x2 = i64x2::new(0x00, 0x01);
+ let r: i64x2 = transmute(vandq_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+
+ let a: i64x2 = i64x2::new(0x00, 0x01);
+ let b: i64x2 = i64x2::new(0x00, 0x00);
+ let e: i64x2 = i64x2::new(0x00, 0x00);
+ let r: i64x2 = transmute(vandq_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vand_u64() {
+ let a: u64x1 = u64x1::new(0x00);
+ let b: u64x1 = u64x1::new(0x0F);
+ let e: u64x1 = u64x1::new(0x00);
+ let r: u64x1 = transmute(vand_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+
+ let a: u64x1 = u64x1::new(0x00);
+ let b: u64x1 = u64x1::new(0x00);
+ let e: u64x1 = u64x1::new(0x00);
+ let r: u64x1 = transmute(vand_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vandq_u64() {
+ let a: u64x2 = u64x2::new(0x00, 0x01);
+ let b: u64x2 = u64x2::new(0x0F, 0x0F);
+ let e: u64x2 = u64x2::new(0x00, 0x01);
+ let r: u64x2 = transmute(vandq_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+
+ let a: u64x2 = u64x2::new(0x00, 0x01);
+ let b: u64x2 = u64x2::new(0x00, 0x00);
+ let e: u64x2 = u64x2::new(0x00, 0x00);
+ let r: u64x2 = transmute(vandq_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vorr_s8() {
+ let a: i8x8 = i8x8::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let b: i8x8 = i8x8::new(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
+ let e: i8x8 = i8x8::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let r: i8x8 = transmute(vorr_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vorrq_s8() {
+ let a: i8x16 = i8x16::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F);
+ let b: i8x16 = i8x16::new(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
+ let e: i8x16 = i8x16::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F);
+ let r: i8x16 = transmute(vorrq_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vorr_s16() {
+ let a: i16x4 = i16x4::new(0x00, 0x01, 0x02, 0x03);
+ let b: i16x4 = i16x4::new(0x00, 0x00, 0x00, 0x00);
+ let e: i16x4 = i16x4::new(0x00, 0x01, 0x02, 0x03);
+ let r: i16x4 = transmute(vorr_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vorrq_s16() {
+ let a: i16x8 = i16x8::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let b: i16x8 = i16x8::new(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
+ let e: i16x8 = i16x8::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let r: i16x8 = transmute(vorrq_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vorr_s32() {
+ let a: i32x2 = i32x2::new(0x00, 0x01);
+ let b: i32x2 = i32x2::new(0x00, 0x00);
+ let e: i32x2 = i32x2::new(0x00, 0x01);
+ let r: i32x2 = transmute(vorr_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vorrq_s32() {
+ let a: i32x4 = i32x4::new(0x00, 0x01, 0x02, 0x03);
+ let b: i32x4 = i32x4::new(0x00, 0x00, 0x00, 0x00);
+ let e: i32x4 = i32x4::new(0x00, 0x01, 0x02, 0x03);
+ let r: i32x4 = transmute(vorrq_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vorr_u8() {
+ let a: u8x8 = u8x8::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let b: u8x8 = u8x8::new(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
+ let e: u8x8 = u8x8::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let r: u8x8 = transmute(vorr_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vorrq_u8() {
+ let a: u8x16 = u8x16::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F);
+ let b: u8x16 = u8x16::new(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
+ let e: u8x16 = u8x16::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F);
+ let r: u8x16 = transmute(vorrq_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vorr_u16() {
+ let a: u16x4 = u16x4::new(0x00, 0x01, 0x02, 0x03);
+ let b: u16x4 = u16x4::new(0x00, 0x00, 0x00, 0x00);
+ let e: u16x4 = u16x4::new(0x00, 0x01, 0x02, 0x03);
+ let r: u16x4 = transmute(vorr_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vorrq_u16() {
+ let a: u16x8 = u16x8::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let b: u16x8 = u16x8::new(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
+ let e: u16x8 = u16x8::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let r: u16x8 = transmute(vorrq_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vorr_u32() {
+ let a: u32x2 = u32x2::new(0x00, 0x01);
+ let b: u32x2 = u32x2::new(0x00, 0x00);
+ let e: u32x2 = u32x2::new(0x00, 0x01);
+ let r: u32x2 = transmute(vorr_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vorrq_u32() {
+ let a: u32x4 = u32x4::new(0x00, 0x01, 0x02, 0x03);
+ let b: u32x4 = u32x4::new(0x00, 0x00, 0x00, 0x00);
+ let e: u32x4 = u32x4::new(0x00, 0x01, 0x02, 0x03);
+ let r: u32x4 = transmute(vorrq_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vorr_s64() {
+ let a: i64x1 = i64x1::new(0x00);
+ let b: i64x1 = i64x1::new(0x00);
+ let e: i64x1 = i64x1::new(0x00);
+ let r: i64x1 = transmute(vorr_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vorrq_s64() {
+ let a: i64x2 = i64x2::new(0x00, 0x01);
+ let b: i64x2 = i64x2::new(0x00, 0x00);
+ let e: i64x2 = i64x2::new(0x00, 0x01);
+ let r: i64x2 = transmute(vorrq_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vorr_u64() {
+ let a: u64x1 = u64x1::new(0x00);
+ let b: u64x1 = u64x1::new(0x00);
+ let e: u64x1 = u64x1::new(0x00);
+ let r: u64x1 = transmute(vorr_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vorrq_u64() {
+ let a: u64x2 = u64x2::new(0x00, 0x01);
+ let b: u64x2 = u64x2::new(0x00, 0x00);
+ let e: u64x2 = u64x2::new(0x00, 0x01);
+ let r: u64x2 = transmute(vorrq_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_veor_s8() {
+ let a: i8x8 = i8x8::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let b: i8x8 = i8x8::new(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
+ let e: i8x8 = i8x8::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let r: i8x8 = transmute(veor_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_veorq_s8() {
+ let a: i8x16 = i8x16::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F);
+ let b: i8x16 = i8x16::new(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
+ let e: i8x16 = i8x16::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F);
+ let r: i8x16 = transmute(veorq_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_veor_s16() {
+ let a: i16x4 = i16x4::new(0x00, 0x01, 0x02, 0x03);
+ let b: i16x4 = i16x4::new(0x00, 0x00, 0x00, 0x00);
+ let e: i16x4 = i16x4::new(0x00, 0x01, 0x02, 0x03);
+ let r: i16x4 = transmute(veor_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_veorq_s16() {
+ let a: i16x8 = i16x8::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let b: i16x8 = i16x8::new(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
+ let e: i16x8 = i16x8::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let r: i16x8 = transmute(veorq_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_veor_s32() {
+ let a: i32x2 = i32x2::new(0x00, 0x01);
+ let b: i32x2 = i32x2::new(0x00, 0x00);
+ let e: i32x2 = i32x2::new(0x00, 0x01);
+ let r: i32x2 = transmute(veor_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_veorq_s32() {
+ let a: i32x4 = i32x4::new(0x00, 0x01, 0x02, 0x03);
+ let b: i32x4 = i32x4::new(0x00, 0x00, 0x00, 0x00);
+ let e: i32x4 = i32x4::new(0x00, 0x01, 0x02, 0x03);
+ let r: i32x4 = transmute(veorq_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_veor_u8() {
+ let a: u8x8 = u8x8::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let b: u8x8 = u8x8::new(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
+ let e: u8x8 = u8x8::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let r: u8x8 = transmute(veor_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_veorq_u8() {
+ let a: u8x16 = u8x16::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F);
+ let b: u8x16 = u8x16::new(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
+ let e: u8x16 = u8x16::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F);
+ let r: u8x16 = transmute(veorq_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_veor_u16() {
+ let a: u16x4 = u16x4::new(0x00, 0x01, 0x02, 0x03);
+ let b: u16x4 = u16x4::new(0x00, 0x00, 0x00, 0x00);
+ let e: u16x4 = u16x4::new(0x00, 0x01, 0x02, 0x03);
+ let r: u16x4 = transmute(veor_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_veorq_u16() {
+ let a: u16x8 = u16x8::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let b: u16x8 = u16x8::new(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
+ let e: u16x8 = u16x8::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let r: u16x8 = transmute(veorq_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_veor_u32() {
+ let a: u32x2 = u32x2::new(0x00, 0x01);
+ let b: u32x2 = u32x2::new(0x00, 0x00);
+ let e: u32x2 = u32x2::new(0x00, 0x01);
+ let r: u32x2 = transmute(veor_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_veorq_u32() {
+ let a: u32x4 = u32x4::new(0x00, 0x01, 0x02, 0x03);
+ let b: u32x4 = u32x4::new(0x00, 0x00, 0x00, 0x00);
+ let e: u32x4 = u32x4::new(0x00, 0x01, 0x02, 0x03);
+ let r: u32x4 = transmute(veorq_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_veor_s64() {
+ let a: i64x1 = i64x1::new(0x00);
+ let b: i64x1 = i64x1::new(0x00);
+ let e: i64x1 = i64x1::new(0x00);
+ let r: i64x1 = transmute(veor_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_veorq_s64() {
+ let a: i64x2 = i64x2::new(0x00, 0x01);
+ let b: i64x2 = i64x2::new(0x00, 0x00);
+ let e: i64x2 = i64x2::new(0x00, 0x01);
+ let r: i64x2 = transmute(veorq_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_veor_u64() {
+ let a: u64x1 = u64x1::new(0x00);
+ let b: u64x1 = u64x1::new(0x00);
+ let e: u64x1 = u64x1::new(0x00);
+ let r: u64x1 = transmute(veor_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_veorq_u64() {
+ let a: u64x2 = u64x2::new(0x00, 0x01);
+ let b: u64x2 = u64x2::new(0x00, 0x00);
+ let e: u64x2 = u64x2::new(0x00, 0x01);
+ let r: u64x2 = transmute(veorq_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabd_s8() {
+ let a: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: i8x8 = i8x8::new(16, 15, 14, 13, 12, 11, 10, 9);
+ let e: i8x8 = i8x8::new(15, 13, 11, 9, 7, 5, 3, 1);
+ let r: i8x8 = transmute(vabd_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabdq_s8() {
+ let a: i8x16 = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let b: i8x16 = i8x16::new(16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1);
+ let e: i8x16 = i8x16::new(15, 13, 11, 9, 7, 5, 3, 1, 1, 3, 5, 7, 9, 11, 13, 15);
+ let r: i8x16 = transmute(vabdq_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabd_s16() {
+ let a: i16x4 = i16x4::new(1, 2, 3, 4);
+ let b: i16x4 = i16x4::new(16, 15, 14, 13);
+ let e: i16x4 = i16x4::new(15, 13, 11, 9);
+ let r: i16x4 = transmute(vabd_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabdq_s16() {
+ let a: i16x8 = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: i16x8 = i16x8::new(16, 15, 14, 13, 12, 11, 10, 9);
+ let e: i16x8 = i16x8::new(15, 13, 11, 9, 7, 5, 3, 1);
+ let r: i16x8 = transmute(vabdq_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabd_s32() {
+ let a: i32x2 = i32x2::new(1, 2);
+ let b: i32x2 = i32x2::new(16, 15);
+ let e: i32x2 = i32x2::new(15, 13);
+ let r: i32x2 = transmute(vabd_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabdq_s32() {
+ let a: i32x4 = i32x4::new(1, 2, 3, 4);
+ let b: i32x4 = i32x4::new(16, 15, 14, 13);
+ let e: i32x4 = i32x4::new(15, 13, 11, 9);
+ let r: i32x4 = transmute(vabdq_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabd_u8() {
+ let a: u8x8 = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: u8x8 = u8x8::new(16, 15, 14, 13, 12, 11, 10, 9);
+ let e: u8x8 = u8x8::new(15, 13, 11, 9, 7, 5, 3, 1);
+ let r: u8x8 = transmute(vabd_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabdq_u8() {
+ let a: u8x16 = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let b: u8x16 = u8x16::new(16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1);
+ let e: u8x16 = u8x16::new(15, 13, 11, 9, 7, 5, 3, 1, 1, 3, 5, 7, 9, 11, 13, 15);
+ let r: u8x16 = transmute(vabdq_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabd_u16() {
+ let a: u16x4 = u16x4::new(1, 2, 3, 4);
+ let b: u16x4 = u16x4::new(16, 15, 14, 13);
+ let e: u16x4 = u16x4::new(15, 13, 11, 9);
+ let r: u16x4 = transmute(vabd_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabdq_u16() {
+ let a: u16x8 = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: u16x8 = u16x8::new(16, 15, 14, 13, 12, 11, 10, 9);
+ let e: u16x8 = u16x8::new(15, 13, 11, 9, 7, 5, 3, 1);
+ let r: u16x8 = transmute(vabdq_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabd_u32() {
+ let a: u32x2 = u32x2::new(1, 2);
+ let b: u32x2 = u32x2::new(16, 15);
+ let e: u32x2 = u32x2::new(15, 13);
+ let r: u32x2 = transmute(vabd_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabdq_u32() {
+ let a: u32x4 = u32x4::new(1, 2, 3, 4);
+ let b: u32x4 = u32x4::new(16, 15, 14, 13);
+ let e: u32x4 = u32x4::new(15, 13, 11, 9);
+ let r: u32x4 = transmute(vabdq_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabd_f32() {
+ let a: f32x2 = f32x2::new(1.0, 2.0);
+ let b: f32x2 = f32x2::new(9.0, 3.0);
+ let e: f32x2 = f32x2::new(8.0, 1.0);
+ let r: f32x2 = transmute(vabd_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabdq_f32() {
+ let a: f32x4 = f32x4::new(1.0, 2.0, 5.0, -4.0);
+ let b: f32x4 = f32x4::new(9.0, 3.0, 2.0, 8.0);
+ let e: f32x4 = f32x4::new(8.0, 1.0, 3.0, 12.0);
+ let r: f32x4 = transmute(vabdq_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabdl_u8() {
+ let a: u8x8 = u8x8::new(1, 2, 3, 4, 4, 3, 2, 1);
+ let b: u8x8 = u8x8::new(10, 10, 10, 10, 10, 10, 10, 10);
+ let e: u16x8 = u16x8::new(9, 8, 7, 6, 6, 7, 8, 9);
+ let r: u16x8 = transmute(vabdl_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabdl_u16() {
+ let a: u16x4 = u16x4::new(1, 2, 3, 4);
+ let b: u16x4 = u16x4::new(10, 10, 10, 10);
+ let e: u32x4 = u32x4::new(9, 8, 7, 6);
+ let r: u32x4 = transmute(vabdl_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabdl_u32() {
+ let a: u32x2 = u32x2::new(1, 2);
+ let b: u32x2 = u32x2::new(10, 10);
+ let e: u64x2 = u64x2::new(9, 8);
+ let r: u64x2 = transmute(vabdl_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabdl_s8() {
+ let a: i8x8 = i8x8::new(1, 2, 3, 4, 4, 3, 2, 1);
+ let b: i8x8 = i8x8::new(10, 10, 10, 10, 10, 10, 10, 10);
+ let e: i16x8 = i16x8::new(9, 8, 7, 6, 6, 7, 8, 9);
+ let r: i16x8 = transmute(vabdl_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabdl_s16() {
+ let a: i16x4 = i16x4::new(1, 2, 11, 12);
+ let b: i16x4 = i16x4::new(10, 10, 10, 10);
+ let e: i32x4 = i32x4::new(9, 8, 1, 2);
+ let r: i32x4 = transmute(vabdl_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabdl_s32() {
+ let a: i32x2 = i32x2::new(1, 11);
+ let b: i32x2 = i32x2::new(10, 10);
+ let e: i64x2 = i64x2::new(9, 1);
+ let r: i64x2 = transmute(vabdl_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceq_u8() {
+ let a: u8x8 = u8x8::new(0, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let b: u8x8 = u8x8::new(0, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let e: u8x8 = u8x8::new(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
+ let r: u8x8 = transmute(vceq_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+
+ let a: u8x8 = u8x8::new(0, 0, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let b: u8x8 = u8x8::new(0, 0xFF, 0x02, 0x04, 0x04, 0x00, 0x06, 0x08);
+ let e: u8x8 = u8x8::new(0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0);
+ let r: u8x8 = transmute(vceq_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqq_u8() {
+ let a: u8x16 = u8x16::new(0, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0xFF);
+ let b: u8x16 = u8x16::new(0, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0xFF);
+ let e: u8x16 = u8x16::new(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
+ let r: u8x16 = transmute(vceqq_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+
+ let a: u8x16 = u8x16::new(0, 0, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0xCC, 0x0D, 0xEE, 0xFF);
+ let b: u8x16 = u8x16::new(0, 0xFF, 0x02, 0x04, 0x04, 0x00, 0x06, 0x08, 0x08, 0x00, 0x0A, 0x0A, 0xCC, 0xD0, 0xEE, 0);
+ let e: u8x16 = u8x16::new(0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0);
+ let r: u8x16 = transmute(vceqq_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceq_u16() {
+ let a: u16x4 = u16x4::new(0, 0x01, 0x02, 0x03);
+ let b: u16x4 = u16x4::new(0, 0x01, 0x02, 0x03);
+ let e: u16x4 = u16x4::new(0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF);
+ let r: u16x4 = transmute(vceq_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+
+ let a: u16x4 = u16x4::new(0, 0, 0x02, 0x03);
+ let b: u16x4 = u16x4::new(0, 0xFF_FF, 0x02, 0x04);
+ let e: u16x4 = u16x4::new(0xFF_FF, 0, 0xFF_FF, 0);
+ let r: u16x4 = transmute(vceq_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqq_u16() {
+ let a: u16x8 = u16x8::new(0, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let b: u16x8 = u16x8::new(0, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let e: u16x8 = u16x8::new(0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF);
+ let r: u16x8 = transmute(vceqq_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+
+ let a: u16x8 = u16x8::new(0, 0, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let b: u16x8 = u16x8::new(0, 0xFF_FF, 0x02, 0x04, 0x04, 0x00, 0x06, 0x08);
+ let e: u16x8 = u16x8::new(0xFF_FF, 0, 0xFF_FF, 0, 0xFF_FF, 0, 0xFF_FF, 0);
+ let r: u16x8 = transmute(vceqq_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceq_u32() {
+ let a: u32x2 = u32x2::new(0, 0x01);
+ let b: u32x2 = u32x2::new(0, 0x01);
+ let e: u32x2 = u32x2::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let r: u32x2 = transmute(vceq_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+
+ let a: u32x2 = u32x2::new(0, 0);
+ let b: u32x2 = u32x2::new(0, 0xFF_FF_FF_FF);
+ let e: u32x2 = u32x2::new(0xFF_FF_FF_FF, 0);
+ let r: u32x2 = transmute(vceq_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqq_u32() {
+ let a: u32x4 = u32x4::new(0, 0x01, 0x02, 0x03);
+ let b: u32x4 = u32x4::new(0, 0x01, 0x02, 0x03);
+ let e: u32x4 = u32x4::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let r: u32x4 = transmute(vceqq_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+
+ let a: u32x4 = u32x4::new(0, 0, 0x02, 0x03);
+ let b: u32x4 = u32x4::new(0, 0xFF_FF_FF_FF, 0x02, 0x04);
+ let e: u32x4 = u32x4::new(0xFF_FF_FF_FF, 0, 0xFF_FF_FF_FF, 0);
+ let r: u32x4 = transmute(vceqq_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceq_s8() {
+ let a: i8x8 = i8x8::new(-128, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let b: i8x8 = i8x8::new(-128, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let e: u8x8 = u8x8::new(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
+ let r: u8x8 = transmute(vceq_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+
+ let a: i8x8 = i8x8::new(-128, -128, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let b: i8x8 = i8x8::new(-128, 0x7F, 0x02, 0x04, 0x04, 0x00, 0x06, 0x08);
+ let e: u8x8 = u8x8::new(0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0);
+ let r: u8x8 = transmute(vceq_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqq_s8() {
+ let a: i8x16 = i8x16::new(-128, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x7F);
+ let b: i8x16 = i8x16::new(-128, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x7F);
+ let e: u8x16 = u8x16::new(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
+ let r: u8x16 = transmute(vceqq_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+
+ let a: i8x16 = i8x16::new(-128, -128, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0xCC, 0x0D, 0xEE, 0x7F);
+ let b: i8x16 = i8x16::new(-128, 0x7F, 0x02, 0x04, 0x04, 0x00, 0x06, 0x08, 0x08, 0x00, 0x0A, 0x0A, 0xCC, 0xD0, 0xEE, -128);
+ let e: u8x16 = u8x16::new(0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0);
+ let r: u8x16 = transmute(vceqq_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceq_s16() {
+ let a: i16x4 = i16x4::new(-32768, 0x01, 0x02, 0x03);
+ let b: i16x4 = i16x4::new(-32768, 0x01, 0x02, 0x03);
+ let e: u16x4 = u16x4::new(0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF);
+ let r: u16x4 = transmute(vceq_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+
+ let a: i16x4 = i16x4::new(-32768, -32768, 0x02, 0x03);
+ let b: i16x4 = i16x4::new(-32768, 0x7F_FF, 0x02, 0x04);
+ let e: u16x4 = u16x4::new(0xFF_FF, 0, 0xFF_FF, 0);
+ let r: u16x4 = transmute(vceq_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqq_s16() {
+ let a: i16x8 = i16x8::new(-32768, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let b: i16x8 = i16x8::new(-32768, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let e: u16x8 = u16x8::new(0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF);
+ let r: u16x8 = transmute(vceqq_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+
+ let a: i16x8 = i16x8::new(-32768, -32768, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let b: i16x8 = i16x8::new(-32768, 0x7F_FF, 0x02, 0x04, 0x04, 0x00, 0x06, 0x08);
+ let e: u16x8 = u16x8::new(0xFF_FF, 0, 0xFF_FF, 0, 0xFF_FF, 0, 0xFF_FF, 0);
+ let r: u16x8 = transmute(vceqq_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceq_s32() {
+ let a: i32x2 = i32x2::new(-2147483648, 0x01);
+ let b: i32x2 = i32x2::new(-2147483648, 0x01);
+ let e: u32x2 = u32x2::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let r: u32x2 = transmute(vceq_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+
+ let a: i32x2 = i32x2::new(-2147483648, -2147483648);
+ let b: i32x2 = i32x2::new(-2147483648, 0x7F_FF_FF_FF);
+ let e: u32x2 = u32x2::new(0xFF_FF_FF_FF, 0);
+ let r: u32x2 = transmute(vceq_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqq_s32() {
+ let a: i32x4 = i32x4::new(-2147483648, 0x01, 0x02, 0x03);
+ let b: i32x4 = i32x4::new(-2147483648, 0x01, 0x02, 0x03);
+ let e: u32x4 = u32x4::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let r: u32x4 = transmute(vceqq_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+
+ let a: i32x4 = i32x4::new(-2147483648, -2147483648, 0x02, 0x03);
+ let b: i32x4 = i32x4::new(-2147483648, 0x7F_FF_FF_FF, 0x02, 0x04);
+ let e: u32x4 = u32x4::new(0xFF_FF_FF_FF, 0, 0xFF_FF_FF_FF, 0);
+ let r: u32x4 = transmute(vceqq_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceq_p8() {
+ let a: i8x8 = i8x8::new(-128, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let b: i8x8 = i8x8::new(-128, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let e: u8x8 = u8x8::new(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
+ let r: u8x8 = transmute(vceq_p8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+
+ let a: i8x8 = i8x8::new(-128, -128, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
+ let b: i8x8 = i8x8::new(-128, 0x7F, 0x02, 0x04, 0x04, 0x00, 0x06, 0x08);
+ let e: u8x8 = u8x8::new(0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0);
+ let r: u8x8 = transmute(vceq_p8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqq_p8() {
+ let a: i8x16 = i8x16::new(-128, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x7F);
+ let b: i8x16 = i8x16::new(-128, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x7F);
+ let e: u8x16 = u8x16::new(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
+ let r: u8x16 = transmute(vceqq_p8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+
+ let a: i8x16 = i8x16::new(-128, -128, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0xCC, 0x0D, 0xEE, 0x7F);
+ let b: i8x16 = i8x16::new(-128, 0x7F, 0x02, 0x04, 0x04, 0x00, 0x06, 0x08, 0x08, 0x00, 0x0A, 0x0A, 0xCC, 0xD0, 0xEE, -128);
+ let e: u8x16 = u8x16::new(0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0);
+ let r: u8x16 = transmute(vceqq_p8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceq_f32() {
+ let a: f32x2 = f32x2::new(1.2, 3.4);
+ let b: f32x2 = f32x2::new(1.2, 3.4);
+ let e: u32x2 = u32x2::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let r: u32x2 = transmute(vceq_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqq_f32() {
+ let a: f32x4 = f32x4::new(1.2, 3.4, 5.6, 7.8);
+ let b: f32x4 = f32x4::new(1.2, 3.4, 5.6, 7.8);
+ let e: u32x4 = u32x4::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let r: u32x4 = transmute(vceqq_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtst_s8() {
+ let a: i8x8 = i8x8::new(-128, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06);
+ let b: i8x8 = i8x8::new(-128, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06);
+ let e: u8x8 = u8x8::new(0xFF, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
+ let r: u8x8 = transmute(vtst_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtstq_s8() {
+ let a: i8x16 = i8x16::new(-128, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x7F);
+ let b: i8x16 = i8x16::new(-128, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x7F);
+ let e: u8x16 = u8x16::new(0xFF, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
+ let r: u8x16 = transmute(vtstq_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtst_s16() {
+ let a: i16x4 = i16x4::new(-32768, 0x00, 0x01, 0x02);
+ let b: i16x4 = i16x4::new(-32768, 0x00, 0x01, 0x02);
+ let e: u16x4 = u16x4::new(0xFF_FF, 0, 0xFF_FF, 0xFF_FF);
+ let r: u16x4 = transmute(vtst_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtstq_s16() {
+ let a: i16x8 = i16x8::new(-32768, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06);
+ let b: i16x8 = i16x8::new(-32768, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06);
+ let e: u16x8 = u16x8::new(0xFF_FF, 0, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF);
+ let r: u16x8 = transmute(vtstq_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtst_s32() {
+ let a: i32x2 = i32x2::new(-2147483648, 0x00);
+ let b: i32x2 = i32x2::new(-2147483648, 0x00);
+ let e: u32x2 = u32x2::new(0xFF_FF_FF_FF, 0);
+ let r: u32x2 = transmute(vtst_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtstq_s32() {
+ let a: i32x4 = i32x4::new(-2147483648, 0x00, 0x01, 0x02);
+ let b: i32x4 = i32x4::new(-2147483648, 0x00, 0x01, 0x02);
+ let e: u32x4 = u32x4::new(0xFF_FF_FF_FF, 0, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let r: u32x4 = transmute(vtstq_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtst_p8() {
+ let a: i8x8 = i8x8::new(-128, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06);
+ let b: i8x8 = i8x8::new(-128, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06);
+ let e: u8x8 = u8x8::new(0xFF, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
+ let r: u8x8 = transmute(vtst_p8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtstq_p8() {
+ let a: i8x16 = i8x16::new(-128, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x7F);
+ let b: i8x16 = i8x16::new(-128, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x7F);
+ let e: u8x16 = u8x16::new(0xFF, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
+ let r: u8x16 = transmute(vtstq_p8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtst_p16() {
+ let a: i16x4 = i16x4::new(-32768, 0x00, 0x01, 0x02);
+ let b: i16x4 = i16x4::new(-32768, 0x00, 0x01, 0x02);
+ let e: u16x4 = u16x4::new(0xFF_FF, 0, 0xFF_FF, 0xFF_FF);
+ let r: u16x4 = transmute(vtst_p16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtstq_p16() {
+ let a: i16x8 = i16x8::new(-32768, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06);
+ let b: i16x8 = i16x8::new(-32768, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06);
+ let e: u16x8 = u16x8::new(0xFF_FF, 0, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF);
+ let r: u16x8 = transmute(vtstq_p16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtst_u8() {
+ let a: u8x8 = u8x8::new(0, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06);
+ let b: u8x8 = u8x8::new(0, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06);
+ let e: u8x8 = u8x8::new(0, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
+ let r: u8x8 = transmute(vtst_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtstq_u8() {
+ let a: u8x16 = u8x16::new(0, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0xFF);
+ let b: u8x16 = u8x16::new(0, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0xFF);
+ let e: u8x16 = u8x16::new(0, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
+ let r: u8x16 = transmute(vtstq_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtst_u16() {
+ let a: u16x4 = u16x4::new(0, 0x00, 0x01, 0x02);
+ let b: u16x4 = u16x4::new(0, 0x00, 0x01, 0x02);
+ let e: u16x4 = u16x4::new(0, 0, 0xFF_FF, 0xFF_FF);
+ let r: u16x4 = transmute(vtst_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtstq_u16() {
+ let a: u16x8 = u16x8::new(0, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06);
+ let b: u16x8 = u16x8::new(0, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06);
+ let e: u16x8 = u16x8::new(0, 0, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF);
+ let r: u16x8 = transmute(vtstq_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtst_u32() {
+ let a: u32x2 = u32x2::new(0, 0x00);
+ let b: u32x2 = u32x2::new(0, 0x00);
+ let e: u32x2 = u32x2::new(0, 0);
+ let r: u32x2 = transmute(vtst_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtstq_u32() {
+ let a: u32x4 = u32x4::new(0, 0x00, 0x01, 0x02);
+ let b: u32x4 = u32x4::new(0, 0x00, 0x01, 0x02);
+ let e: u32x4 = u32x4::new(0, 0, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let r: u32x4 = transmute(vtstq_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabs_f32() {
+ let a: f32x2 = f32x2::new(-0.1, -2.2);
+ let e: f32x2 = f32x2::new(0.1, 2.2);
+ let r: f32x2 = transmute(vabs_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabsq_f32() {
+ let a: f32x4 = f32x4::new(-0.1, -2.2, -3.3, -6.6);
+ let e: f32x4 = f32x4::new(0.1, 2.2, 3.3, 6.6);
+ let r: f32x4 = transmute(vabsq_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgt_s8() {
+ let a: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: i8x8 = i8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: u8x8 = u8x8::new(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
+ let r: u8x8 = transmute(vcgt_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgtq_s8() {
+ let a: i8x16 = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let b: i8x16 = i8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let e: u8x16 = u8x16::new(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
+ let r: u8x16 = transmute(vcgtq_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgt_s16() {
+ let a: i16x4 = i16x4::new(1, 2, 3, 4);
+ let b: i16x4 = i16x4::new(0, 1, 2, 3);
+ let e: u16x4 = u16x4::new(0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF);
+ let r: u16x4 = transmute(vcgt_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgtq_s16() {
+ let a: i16x8 = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: i16x8 = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: u16x8 = u16x8::new(0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF);
+ let r: u16x8 = transmute(vcgtq_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgt_s32() {
+ let a: i32x2 = i32x2::new(1, 2);
+ let b: i32x2 = i32x2::new(0, 1);
+ let e: u32x2 = u32x2::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let r: u32x2 = transmute(vcgt_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgtq_s32() {
+ let a: i32x4 = i32x4::new(1, 2, 3, 4);
+ let b: i32x4 = i32x4::new(0, 1, 2, 3);
+ let e: u32x4 = u32x4::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let r: u32x4 = transmute(vcgtq_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgt_u8() {
+ let a: u8x8 = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: u8x8 = u8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: u8x8 = u8x8::new(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
+ let r: u8x8 = transmute(vcgt_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgtq_u8() {
+ let a: u8x16 = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let b: u8x16 = u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let e: u8x16 = u8x16::new(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
+ let r: u8x16 = transmute(vcgtq_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgt_u16() {
+ let a: u16x4 = u16x4::new(1, 2, 3, 4);
+ let b: u16x4 = u16x4::new(0, 1, 2, 3);
+ let e: u16x4 = u16x4::new(0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF);
+ let r: u16x4 = transmute(vcgt_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgtq_u16() {
+ let a: u16x8 = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: u16x8 = u16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: u16x8 = u16x8::new(0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF);
+ let r: u16x8 = transmute(vcgtq_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgt_u32() {
+ let a: u32x2 = u32x2::new(1, 2);
+ let b: u32x2 = u32x2::new(0, 1);
+ let e: u32x2 = u32x2::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let r: u32x2 = transmute(vcgt_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgtq_u32() {
+ let a: u32x4 = u32x4::new(1, 2, 3, 4);
+ let b: u32x4 = u32x4::new(0, 1, 2, 3);
+ let e: u32x4 = u32x4::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let r: u32x4 = transmute(vcgtq_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgt_f32() {
+ let a: f32x2 = f32x2::new(1.2, 2.3);
+ let b: f32x2 = f32x2::new(0.1, 1.2);
+ let e: u32x2 = u32x2::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let r: u32x2 = transmute(vcgt_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgtq_f32() {
+ let a: f32x4 = f32x4::new(1.2, 2.3, 3.4, 4.5);
+ let b: f32x4 = f32x4::new(0.1, 1.2, 2.3, 3.4);
+ let e: u32x4 = u32x4::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let r: u32x4 = transmute(vcgtq_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclt_s8() {
+ let a: i8x8 = i8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let b: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: u8x8 = u8x8::new(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
+ let r: u8x8 = transmute(vclt_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcltq_s8() {
+ let a: i8x16 = i8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let b: i8x16 = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let e: u8x16 = u8x16::new(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
+ let r: u8x16 = transmute(vcltq_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclt_s16() {
+ let a: i16x4 = i16x4::new(0, 1, 2, 3);
+ let b: i16x4 = i16x4::new(1, 2, 3, 4);
+ let e: u16x4 = u16x4::new(0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF);
+ let r: u16x4 = transmute(vclt_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcltq_s16() {
+ let a: i16x8 = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let b: i16x8 = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: u16x8 = u16x8::new(0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF);
+ let r: u16x8 = transmute(vcltq_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclt_s32() {
+ let a: i32x2 = i32x2::new(0, 1);
+ let b: i32x2 = i32x2::new(1, 2);
+ let e: u32x2 = u32x2::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let r: u32x2 = transmute(vclt_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcltq_s32() {
+ let a: i32x4 = i32x4::new(0, 1, 2, 3);
+ let b: i32x4 = i32x4::new(1, 2, 3, 4);
+ let e: u32x4 = u32x4::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let r: u32x4 = transmute(vcltq_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclt_u8() {
+ let a: u8x8 = u8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let b: u8x8 = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: u8x8 = u8x8::new(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
+ let r: u8x8 = transmute(vclt_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcltq_u8() {
+ let a: u8x16 = u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let b: u8x16 = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let e: u8x16 = u8x16::new(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
+ let r: u8x16 = transmute(vcltq_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclt_u16() {
+ let a: u16x4 = u16x4::new(0, 1, 2, 3);
+ let b: u16x4 = u16x4::new(1, 2, 3, 4);
+ let e: u16x4 = u16x4::new(0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF);
+ let r: u16x4 = transmute(vclt_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcltq_u16() {
+ let a: u16x8 = u16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let b: u16x8 = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: u16x8 = u16x8::new(0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF);
+ let r: u16x8 = transmute(vcltq_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclt_u32() {
+ let a: u32x2 = u32x2::new(0, 1);
+ let b: u32x2 = u32x2::new(1, 2);
+ let e: u32x2 = u32x2::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let r: u32x2 = transmute(vclt_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcltq_u32() {
+ let a: u32x4 = u32x4::new(0, 1, 2, 3);
+ let b: u32x4 = u32x4::new(1, 2, 3, 4);
+ let e: u32x4 = u32x4::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let r: u32x4 = transmute(vcltq_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclt_f32() {
+ let a: f32x2 = f32x2::new(0.1, 1.2);
+ let b: f32x2 = f32x2::new(1.2, 2.3);
+ let e: u32x2 = u32x2::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let r: u32x2 = transmute(vclt_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcltq_f32() {
+ let a: f32x4 = f32x4::new(0.1, 1.2, 2.3, 3.4);
+ let b: f32x4 = f32x4::new(1.2, 2.3, 3.4, 4.5);
+ let e: u32x4 = u32x4::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let r: u32x4 = transmute(vcltq_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcle_s8() {
+ let a: i8x8 = i8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let b: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: u8x8 = u8x8::new(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
+ let r: u8x8 = transmute(vcle_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcleq_s8() {
+ let a: i8x16 = i8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let b: i8x16 = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let e: u8x16 = u8x16::new(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
+ let r: u8x16 = transmute(vcleq_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcle_s16() {
+ let a: i16x4 = i16x4::new(0, 1, 2, 3);
+ let b: i16x4 = i16x4::new(1, 2, 3, 4);
+ let e: u16x4 = u16x4::new(0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF);
+ let r: u16x4 = transmute(vcle_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcleq_s16() {
+ let a: i16x8 = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let b: i16x8 = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: u16x8 = u16x8::new(0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF);
+ let r: u16x8 = transmute(vcleq_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcle_s32() {
+ let a: i32x2 = i32x2::new(0, 1);
+ let b: i32x2 = i32x2::new(1, 2);
+ let e: u32x2 = u32x2::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let r: u32x2 = transmute(vcle_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcleq_s32() {
+ let a: i32x4 = i32x4::new(0, 1, 2, 3);
+ let b: i32x4 = i32x4::new(1, 2, 3, 4);
+ let e: u32x4 = u32x4::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let r: u32x4 = transmute(vcleq_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcle_u8() {
+ let a: u8x8 = u8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let b: u8x8 = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: u8x8 = u8x8::new(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
+ let r: u8x8 = transmute(vcle_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcleq_u8() {
+ let a: u8x16 = u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let b: u8x16 = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let e: u8x16 = u8x16::new(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
+ let r: u8x16 = transmute(vcleq_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcle_u16() {
+ let a: u16x4 = u16x4::new(0, 1, 2, 3);
+ let b: u16x4 = u16x4::new(1, 2, 3, 4);
+ let e: u16x4 = u16x4::new(0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF);
+ let r: u16x4 = transmute(vcle_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcleq_u16() {
+ let a: u16x8 = u16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let b: u16x8 = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: u16x8 = u16x8::new(0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF);
+ let r: u16x8 = transmute(vcleq_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcle_u32() {
+ let a: u32x2 = u32x2::new(0, 1);
+ let b: u32x2 = u32x2::new(1, 2);
+ let e: u32x2 = u32x2::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let r: u32x2 = transmute(vcle_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcleq_u32() {
+ let a: u32x4 = u32x4::new(0, 1, 2, 3);
+ let b: u32x4 = u32x4::new(1, 2, 3, 4);
+ let e: u32x4 = u32x4::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let r: u32x4 = transmute(vcleq_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcle_f32() {
+ let a: f32x2 = f32x2::new(0.1, 1.2);
+ let b: f32x2 = f32x2::new(1.2, 2.3);
+ let e: u32x2 = u32x2::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let r: u32x2 = transmute(vcle_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcleq_f32() {
+ let a: f32x4 = f32x4::new(0.1, 1.2, 2.3, 3.4);
+ let b: f32x4 = f32x4::new(1.2, 2.3, 3.4, 4.5);
+ let e: u32x4 = u32x4::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let r: u32x4 = transmute(vcleq_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcge_s8() {
+ let a: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: i8x8 = i8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: u8x8 = u8x8::new(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
+ let r: u8x8 = transmute(vcge_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgeq_s8() {
+ let a: i8x16 = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let b: i8x16 = i8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let e: u8x16 = u8x16::new(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
+ let r: u8x16 = transmute(vcgeq_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcge_s16() {
+ let a: i16x4 = i16x4::new(1, 2, 3, 4);
+ let b: i16x4 = i16x4::new(0, 1, 2, 3);
+ let e: u16x4 = u16x4::new(0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF);
+ let r: u16x4 = transmute(vcge_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgeq_s16() {
+ let a: i16x8 = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: i16x8 = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: u16x8 = u16x8::new(0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF);
+ let r: u16x8 = transmute(vcgeq_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcge_s32() {
+ let a: i32x2 = i32x2::new(1, 2);
+ let b: i32x2 = i32x2::new(0, 1);
+ let e: u32x2 = u32x2::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let r: u32x2 = transmute(vcge_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgeq_s32() {
+ let a: i32x4 = i32x4::new(1, 2, 3, 4);
+ let b: i32x4 = i32x4::new(0, 1, 2, 3);
+ let e: u32x4 = u32x4::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let r: u32x4 = transmute(vcgeq_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcge_u8() {
+ let a: u8x8 = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: u8x8 = u8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: u8x8 = u8x8::new(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
+ let r: u8x8 = transmute(vcge_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgeq_u8() {
+ let a: u8x16 = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let b: u8x16 = u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let e: u8x16 = u8x16::new(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
+ let r: u8x16 = transmute(vcgeq_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcge_u16() {
+ let a: u16x4 = u16x4::new(1, 2, 3, 4);
+ let b: u16x4 = u16x4::new(0, 1, 2, 3);
+ let e: u16x4 = u16x4::new(0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF);
+ let r: u16x4 = transmute(vcge_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgeq_u16() {
+ let a: u16x8 = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: u16x8 = u16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: u16x8 = u16x8::new(0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF);
+ let r: u16x8 = transmute(vcgeq_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcge_u32() {
+ let a: u32x2 = u32x2::new(1, 2);
+ let b: u32x2 = u32x2::new(0, 1);
+ let e: u32x2 = u32x2::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let r: u32x2 = transmute(vcge_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgeq_u32() {
+ let a: u32x4 = u32x4::new(1, 2, 3, 4);
+ let b: u32x4 = u32x4::new(0, 1, 2, 3);
+ let e: u32x4 = u32x4::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let r: u32x4 = transmute(vcgeq_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcge_f32() {
+ let a: f32x2 = f32x2::new(1.2, 2.3);
+ let b: f32x2 = f32x2::new(0.1, 1.2);
+ let e: u32x2 = u32x2::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let r: u32x2 = transmute(vcge_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgeq_f32() {
+ let a: f32x4 = f32x4::new(1.2, 2.3, 3.4, 4.5);
+ let b: f32x4 = f32x4::new(0.1, 1.2, 2.3, 3.4);
+ let e: u32x4 = u32x4::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let r: u32x4 = transmute(vcgeq_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcls_s8() {
+ let a: i8x8 = i8x8::new(-128, -1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
+ let e: i8x8 = i8x8::new(0, 7, 7, 7, 7, 7, 7, 7);
+ let r: i8x8 = transmute(vcls_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclsq_s8() {
+ let a: i8x16 = i8x16::new(-128, -1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F);
+ let e: i8x16 = i8x16::new(0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0);
+ let r: i8x16 = transmute(vclsq_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcls_s16() {
+ let a: i16x4 = i16x4::new(-32768, -1, 0x00, 0x00);
+ let e: i16x4 = i16x4::new(0, 15, 15, 15);
+ let r: i16x4 = transmute(vcls_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclsq_s16() {
+ let a: i16x8 = i16x8::new(-32768, -1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
+ let e: i16x8 = i16x8::new(0, 15, 15, 15, 15, 15, 15, 15);
+ let r: i16x8 = transmute(vclsq_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcls_s32() {
+ let a: i32x2 = i32x2::new(-2147483648, -1);
+ let e: i32x2 = i32x2::new(0, 31);
+ let r: i32x2 = transmute(vcls_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclsq_s32() {
+ let a: i32x4 = i32x4::new(-2147483648, -1, 0x00, 0x00);
+ let e: i32x4 = i32x4::new(0, 31, 31, 31);
+ let r: i32x4 = transmute(vclsq_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcls_u8() {
+ let a: u8x8 = u8x8::new(0, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
+ let e: i8x8 = i8x8::new(7, 7, 7, 7, 7, 7, 7, 7);
+ let r: i8x8 = transmute(vcls_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclsq_u8() {
+ let a: u8x16 = u8x16::new(0, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF);
+ let e: i8x16 = i8x16::new(7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7);
+ let r: i8x16 = transmute(vclsq_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcls_u16() {
+ let a: u16x4 = u16x4::new(0, 0xFF_FF, 0x00, 0x00);
+ let e: i16x4 = i16x4::new(15, 15, 15, 15);
+ let r: i16x4 = transmute(vcls_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclsq_u16() {
+ let a: u16x8 = u16x8::new(0, 0xFF_FF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
+ let e: i16x8 = i16x8::new(15, 15, 15, 15, 15, 15, 15, 15);
+ let r: i16x8 = transmute(vclsq_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcls_u32() {
+ let a: u32x2 = u32x2::new(0, 0xFF_FF_FF_FF);
+ let e: i32x2 = i32x2::new(31, 31);
+ let r: i32x2 = transmute(vcls_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclsq_u32() {
+ let a: u32x4 = u32x4::new(0, 0xFF_FF_FF_FF, 0x00, 0x00);
+ let e: i32x4 = i32x4::new(31, 31, 31, 31);
+ let r: i32x4 = transmute(vclsq_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclz_s8() {
+ let a: i8x8 = i8x8::new(-128, -1, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01);
+ let e: i8x8 = i8x8::new(0, 0, 8, 7, 7, 7, 7, 7);
+ let r: i8x8 = transmute(vclz_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclzq_s8() {
+ let a: i8x16 = i8x16::new(-128, -1, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x7F);
+ let e: i8x16 = i8x16::new(0, 0, 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 1);
+ let r: i8x16 = transmute(vclzq_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclz_s16() {
+ let a: i16x4 = i16x4::new(-32768, -1, 0x00, 0x01);
+ let e: i16x4 = i16x4::new(0, 0, 16, 15);
+ let r: i16x4 = transmute(vclz_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclzq_s16() {
+ let a: i16x8 = i16x8::new(-32768, -1, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01);
+ let e: i16x8 = i16x8::new(0, 0, 16, 15, 15, 15, 15, 15);
+ let r: i16x8 = transmute(vclzq_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclz_s32() {
+ let a: i32x2 = i32x2::new(-2147483648, -1);
+ let e: i32x2 = i32x2::new(0, 0);
+ let r: i32x2 = transmute(vclz_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclzq_s32() {
+ let a: i32x4 = i32x4::new(-2147483648, -1, 0x00, 0x01);
+ let e: i32x4 = i32x4::new(0, 0, 32, 31);
+ let r: i32x4 = transmute(vclzq_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclz_u8() {
+ let a: u8x8 = u8x8::new(0, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01);
+ let e: u8x8 = u8x8::new(8, 8, 7, 7, 7, 7, 7, 7);
+ let r: u8x8 = transmute(vclz_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclzq_u8() {
+ let a: u8x16 = u8x16::new(0, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0xFF);
+ let e: u8x16 = u8x16::new(8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0);
+ let r: u8x16 = transmute(vclzq_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclz_u16() {
+ let a: u16x4 = u16x4::new(0, 0x00, 0x01, 0x01);
+ let e: u16x4 = u16x4::new(16, 16, 15, 15);
+ let r: u16x4 = transmute(vclz_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclzq_u16() {
+ let a: u16x8 = u16x8::new(0, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01);
+ let e: u16x8 = u16x8::new(16, 16, 15, 15, 15, 15, 15, 15);
+ let r: u16x8 = transmute(vclzq_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclz_u32() {
+ let a: u32x2 = u32x2::new(0, 0x00);
+ let e: u32x2 = u32x2::new(32, 32);
+ let r: u32x2 = transmute(vclz_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclzq_u32() {
+ let a: u32x4 = u32x4::new(0, 0x00, 0x01, 0x01);
+ let e: u32x4 = u32x4::new(32, 32, 31, 31);
+ let r: u32x4 = transmute(vclzq_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcagt_f32() {
+ let a: f32x2 = f32x2::new(-1.2, 0.0);
+ let b: f32x2 = f32x2::new(-1.1, 0.0);
+ let e: u32x2 = u32x2::new(!0, 0);
+ let r: u32x2 = transmute(vcagt_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcagtq_f32() {
+ let a: f32x4 = f32x4::new(-1.2, 0.0, 1.2, 2.3);
+ let b: f32x4 = f32x4::new(-1.1, 0.0, 1.1, 2.4);
+ let e: u32x4 = u32x4::new(!0, 0, 0xFF_FF_FF_FF, 0);
+ let r: u32x4 = transmute(vcagtq_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcage_f32() {
+ let a: f32x2 = f32x2::new(-1.2, 0.0);
+ let b: f32x2 = f32x2::new(-1.1, 0.0);
+ let e: u32x2 = u32x2::new(!0, 0xFF_FF_FF_FF);
+ let r: u32x2 = transmute(vcage_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcageq_f32() {
+ let a: f32x4 = f32x4::new(-1.2, 0.0, 1.2, 2.3);
+ let b: f32x4 = f32x4::new(-1.1, 0.0, 1.1, 2.4);
+ let e: u32x4 = u32x4::new(!0, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0);
+ let r: u32x4 = transmute(vcageq_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcalt_f32() {
+ let a: f32x2 = f32x2::new(-1.2, 0.0);
+ let b: f32x2 = f32x2::new(-1.1, 0.0);
+ let e: u32x2 = u32x2::new(0, 0);
+ let r: u32x2 = transmute(vcalt_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcaltq_f32() {
+ let a: f32x4 = f32x4::new(-1.2, 0.0, 1.2, 2.3);
+ let b: f32x4 = f32x4::new(-1.1, 0.0, 1.1, 2.4);
+ let e: u32x4 = u32x4::new(0, 0, 0, 0xFF_FF_FF_FF);
+ let r: u32x4 = transmute(vcaltq_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcale_f32() {
+ let a: f32x2 = f32x2::new(-1.2, 0.0);
+ let b: f32x2 = f32x2::new(-1.1, 0.0);
+ let e: u32x2 = u32x2::new(0, 0xFF_FF_FF_FF);
+ let r: u32x2 = transmute(vcale_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcaleq_f32() {
+ let a: f32x4 = f32x4::new(-1.2, 0.0, 1.2, 2.3);
+ let b: f32x4 = f32x4::new(-1.1, 0.0, 1.1, 2.4);
+ let e: u32x4 = u32x4::new(0, 0xFF_FF_FF_FF, 0, 0xFF_FF_FF_FF);
+ let r: u32x4 = transmute(vcaleq_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcreate_s8() {
+ let a: u64 = 1;
+ let e: i8x8 = i8x8::new(1, 0, 0, 0, 0, 0, 0, 0);
+ let r: i8x8 = transmute(vcreate_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcreate_s16() {
+ let a: u64 = 1;
+ let e: i16x4 = i16x4::new(1, 0, 0, 0);
+ let r: i16x4 = transmute(vcreate_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcreate_s32() {
+ let a: u64 = 1;
+ let e: i32x2 = i32x2::new(1, 0);
+ let r: i32x2 = transmute(vcreate_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcreate_s64() {
+ let a: u64 = 1;
+ let e: i64x1 = i64x1::new(1);
+ let r: i64x1 = transmute(vcreate_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcreate_u8() {
+ let a: u64 = 1;
+ let e: u8x8 = u8x8::new(1, 0, 0, 0, 0, 0, 0, 0);
+ let r: u8x8 = transmute(vcreate_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcreate_u16() {
+ let a: u64 = 1;
+ let e: u16x4 = u16x4::new(1, 0, 0, 0);
+ let r: u16x4 = transmute(vcreate_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcreate_u32() {
+ let a: u64 = 1;
+ let e: u32x2 = u32x2::new(1, 0);
+ let r: u32x2 = transmute(vcreate_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcreate_u64() {
+ let a: u64 = 1;
+ let e: u64x1 = u64x1::new(1);
+ let r: u64x1 = transmute(vcreate_u64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcreate_p8() {
+ let a: u64 = 1;
+ let e: i8x8 = i8x8::new(1, 0, 0, 0, 0, 0, 0, 0);
+ let r: i8x8 = transmute(vcreate_p8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcreate_p16() {
+ let a: u64 = 1;
+ let e: i16x4 = i16x4::new(1, 0, 0, 0);
+ let r: i16x4 = transmute(vcreate_p16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcreate_p64() {
+ let a: u64 = 1;
+ let e: i64x1 = i64x1::new(1);
+ let r: i64x1 = transmute(vcreate_p64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcreate_f32() {
+ let a: u64 = 0;
+ let e: f32x2 = f32x2::new(0., 0.);
+ let r: f32x2 = transmute(vcreate_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvt_f32_s32() {
+ let a: i32x2 = i32x2::new(1, 2);
+ let e: f32x2 = f32x2::new(1., 2.);
+ let r: f32x2 = transmute(vcvt_f32_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtq_f32_s32() {
+ let a: i32x4 = i32x4::new(1, 2, 3, 4);
+ let e: f32x4 = f32x4::new(1., 2., 3., 4.);
+ let r: f32x4 = transmute(vcvtq_f32_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvt_f32_u32() {
+ let a: u32x2 = u32x2::new(1, 2);
+ let e: f32x2 = f32x2::new(1., 2.);
+ let r: f32x2 = transmute(vcvt_f32_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtq_f32_u32() {
+ let a: u32x4 = u32x4::new(1, 2, 3, 4);
+ let e: f32x4 = f32x4::new(1., 2., 3., 4.);
+ let r: f32x4 = transmute(vcvtq_f32_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvt_n_f32_s32() {
+ let a: i32x2 = i32x2::new(1, 2);
+ let e: f32x2 = f32x2::new(0.25, 0.5);
+ let r: f32x2 = transmute(vcvt_n_f32_s32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtq_n_f32_s32() {
+ let a: i32x4 = i32x4::new(1, 2, 3, 4);
+ let e: f32x4 = f32x4::new(0.25, 0.5, 0.75, 1.);
+ let r: f32x4 = transmute(vcvtq_n_f32_s32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvt_n_f32_u32() {
+ let a: u32x2 = u32x2::new(1, 2);
+ let e: f32x2 = f32x2::new(0.25, 0.5);
+ let r: f32x2 = transmute(vcvt_n_f32_u32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtq_n_f32_u32() {
+ let a: u32x4 = u32x4::new(1, 2, 3, 4);
+ let e: f32x4 = f32x4::new(0.25, 0.5, 0.75, 1.);
+ let r: f32x4 = transmute(vcvtq_n_f32_u32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvt_n_s32_f32() {
+ let a: f32x2 = f32x2::new(0.25, 0.5);
+ let e: i32x2 = i32x2::new(1, 2);
+ let r: i32x2 = transmute(vcvt_n_s32_f32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtq_n_s32_f32() {
+ let a: f32x4 = f32x4::new(0.25, 0.5, 0.75, 1.);
+ let e: i32x4 = i32x4::new(1, 2, 3, 4);
+ let r: i32x4 = transmute(vcvtq_n_s32_f32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvt_n_u32_f32() {
+ let a: f32x2 = f32x2::new(0.25, 0.5);
+ let e: u32x2 = u32x2::new(1, 2);
+ let r: u32x2 = transmute(vcvt_n_u32_f32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtq_n_u32_f32() {
+ let a: f32x4 = f32x4::new(0.25, 0.5, 0.75, 1.);
+ let e: u32x4 = u32x4::new(1, 2, 3, 4);
+ let r: u32x4 = transmute(vcvtq_n_u32_f32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvt_s32_f32() {
+ let a: f32x2 = f32x2::new(-1.1, 2.1);
+ let e: i32x2 = i32x2::new(-1, 2);
+ let r: i32x2 = transmute(vcvt_s32_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtq_s32_f32() {
+ let a: f32x4 = f32x4::new(-1.1, 2.1, -2.9, 3.9);
+ let e: i32x4 = i32x4::new(-1, 2, -2, 3);
+ let r: i32x4 = transmute(vcvtq_s32_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvt_u32_f32() {
+ let a: f32x2 = f32x2::new(1.1, 2.1);
+ let e: u32x2 = u32x2::new(1, 2);
+ let r: u32x2 = transmute(vcvt_u32_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcvtq_u32_f32() {
+ let a: f32x4 = f32x4::new(1.1, 2.1, 2.9, 3.9);
+ let e: u32x4 = u32x4::new(1, 2, 2, 3);
+ let r: u32x4 = transmute(vcvtq_u32_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdup_lane_s8() {
+ let a: i8x8 = i8x8::new(1, 1, 1, 4, 1, 6, 7, 8);
+ let e: i8x8 = i8x8::new(1, 1, 1, 1, 1, 1, 1, 1);
+ let r: i8x8 = transmute(vdup_lane_s8::<4>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupq_laneq_s8() {
+ let a: i8x16 = i8x16::new(1, 1, 1, 4, 1, 6, 7, 8, 1, 10, 11, 12, 13, 14, 15, 16);
+ let e: i8x16 = i8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
+ let r: i8x16 = transmute(vdupq_laneq_s8::<8>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdup_lane_s16() {
+ let a: i16x4 = i16x4::new(1, 1, 1, 4);
+ let e: i16x4 = i16x4::new(1, 1, 1, 1);
+ let r: i16x4 = transmute(vdup_lane_s16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupq_laneq_s16() {
+ let a: i16x8 = i16x8::new(1, 1, 1, 4, 1, 6, 7, 8);
+ let e: i16x8 = i16x8::new(1, 1, 1, 1, 1, 1, 1, 1);
+ let r: i16x8 = transmute(vdupq_laneq_s16::<4>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdup_lane_s32() {
+ let a: i32x2 = i32x2::new(1, 1);
+ let e: i32x2 = i32x2::new(1, 1);
+ let r: i32x2 = transmute(vdup_lane_s32::<1>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupq_laneq_s32() {
+ let a: i32x4 = i32x4::new(1, 1, 1, 4);
+ let e: i32x4 = i32x4::new(1, 1, 1, 1);
+ let r: i32x4 = transmute(vdupq_laneq_s32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdup_laneq_s8() {
+ let a: i8x16 = i8x16::new(1, 1, 1, 4, 1, 6, 7, 8, 1, 10, 11, 12, 13, 14, 15, 16);
+ let e: i8x8 = i8x8::new(1, 1, 1, 1, 1, 1, 1, 1);
+ let r: i8x8 = transmute(vdup_laneq_s8::<8>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdup_laneq_s16() {
+ let a: i16x8 = i16x8::new(1, 1, 1, 4, 1, 6, 7, 8);
+ let e: i16x4 = i16x4::new(1, 1, 1, 1);
+ let r: i16x4 = transmute(vdup_laneq_s16::<4>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdup_laneq_s32() {
+ let a: i32x4 = i32x4::new(1, 1, 1, 4);
+ let e: i32x2 = i32x2::new(1, 1);
+ let r: i32x2 = transmute(vdup_laneq_s32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupq_lane_s8() {
+ let a: i8x8 = i8x8::new(1, 1, 1, 4, 1, 6, 7, 8);
+ let e: i8x16 = i8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
+ let r: i8x16 = transmute(vdupq_lane_s8::<4>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupq_lane_s16() {
+ let a: i16x4 = i16x4::new(1, 1, 1, 4);
+ let e: i16x8 = i16x8::new(1, 1, 1, 1, 1, 1, 1, 1);
+ let r: i16x8 = transmute(vdupq_lane_s16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupq_lane_s32() {
+ let a: i32x2 = i32x2::new(1, 1);
+ let e: i32x4 = i32x4::new(1, 1, 1, 1);
+ let r: i32x4 = transmute(vdupq_lane_s32::<1>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdup_lane_u8() {
+ let a: u8x8 = u8x8::new(1, 1, 1, 4, 1, 6, 7, 8);
+ let e: u8x8 = u8x8::new(1, 1, 1, 1, 1, 1, 1, 1);
+ let r: u8x8 = transmute(vdup_lane_u8::<4>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupq_laneq_u8() {
+ let a: u8x16 = u8x16::new(1, 1, 1, 4, 1, 6, 7, 8, 1, 10, 11, 12, 13, 14, 15, 16);
+ let e: u8x16 = u8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
+ let r: u8x16 = transmute(vdupq_laneq_u8::<8>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdup_lane_u16() {
+ let a: u16x4 = u16x4::new(1, 1, 1, 4);
+ let e: u16x4 = u16x4::new(1, 1, 1, 1);
+ let r: u16x4 = transmute(vdup_lane_u16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupq_laneq_u16() {
+ let a: u16x8 = u16x8::new(1, 1, 1, 4, 1, 6, 7, 8);
+ let e: u16x8 = u16x8::new(1, 1, 1, 1, 1, 1, 1, 1);
+ let r: u16x8 = transmute(vdupq_laneq_u16::<4>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdup_lane_u32() {
+ let a: u32x2 = u32x2::new(1, 1);
+ let e: u32x2 = u32x2::new(1, 1);
+ let r: u32x2 = transmute(vdup_lane_u32::<1>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupq_laneq_u32() {
+ let a: u32x4 = u32x4::new(1, 1, 1, 4);
+ let e: u32x4 = u32x4::new(1, 1, 1, 1);
+ let r: u32x4 = transmute(vdupq_laneq_u32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdup_laneq_u8() {
+ let a: u8x16 = u8x16::new(1, 1, 1, 4, 1, 6, 7, 8, 1, 10, 11, 12, 13, 14, 15, 16);
+ let e: u8x8 = u8x8::new(1, 1, 1, 1, 1, 1, 1, 1);
+ let r: u8x8 = transmute(vdup_laneq_u8::<8>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdup_laneq_u16() {
+ let a: u16x8 = u16x8::new(1, 1, 1, 4, 1, 6, 7, 8);
+ let e: u16x4 = u16x4::new(1, 1, 1, 1);
+ let r: u16x4 = transmute(vdup_laneq_u16::<4>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdup_laneq_u32() {
+ let a: u32x4 = u32x4::new(1, 1, 1, 4);
+ let e: u32x2 = u32x2::new(1, 1);
+ let r: u32x2 = transmute(vdup_laneq_u32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupq_lane_u8() {
+ let a: u8x8 = u8x8::new(1, 1, 1, 4, 1, 6, 7, 8);
+ let e: u8x16 = u8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
+ let r: u8x16 = transmute(vdupq_lane_u8::<4>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupq_lane_u16() {
+ let a: u16x4 = u16x4::new(1, 1, 1, 4);
+ let e: u16x8 = u16x8::new(1, 1, 1, 1, 1, 1, 1, 1);
+ let r: u16x8 = transmute(vdupq_lane_u16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupq_lane_u32() {
+ let a: u32x2 = u32x2::new(1, 1);
+ let e: u32x4 = u32x4::new(1, 1, 1, 1);
+ let r: u32x4 = transmute(vdupq_lane_u32::<1>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdup_lane_p8() {
+ let a: i8x8 = i8x8::new(1, 1, 1, 4, 1, 6, 7, 8);
+ let e: i8x8 = i8x8::new(1, 1, 1, 1, 1, 1, 1, 1);
+ let r: i8x8 = transmute(vdup_lane_p8::<4>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupq_laneq_p8() {
+ let a: i8x16 = i8x16::new(1, 1, 1, 4, 1, 6, 7, 8, 1, 10, 11, 12, 13, 14, 15, 16);
+ let e: i8x16 = i8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
+ let r: i8x16 = transmute(vdupq_laneq_p8::<8>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdup_lane_p16() {
+ let a: i16x4 = i16x4::new(1, 1, 1, 4);
+ let e: i16x4 = i16x4::new(1, 1, 1, 1);
+ let r: i16x4 = transmute(vdup_lane_p16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupq_laneq_p16() {
+ let a: i16x8 = i16x8::new(1, 1, 1, 4, 1, 6, 7, 8);
+ let e: i16x8 = i16x8::new(1, 1, 1, 1, 1, 1, 1, 1);
+ let r: i16x8 = transmute(vdupq_laneq_p16::<4>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdup_laneq_p8() {
+ let a: i8x16 = i8x16::new(1, 1, 1, 4, 1, 6, 7, 8, 1, 10, 11, 12, 13, 14, 15, 16);
+ let e: i8x8 = i8x8::new(1, 1, 1, 1, 1, 1, 1, 1);
+ let r: i8x8 = transmute(vdup_laneq_p8::<8>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdup_laneq_p16() {
+ let a: i16x8 = i16x8::new(1, 1, 1, 4, 1, 6, 7, 8);
+ let e: i16x4 = i16x4::new(1, 1, 1, 1);
+ let r: i16x4 = transmute(vdup_laneq_p16::<4>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupq_lane_p8() {
+ let a: i8x8 = i8x8::new(1, 1, 1, 4, 1, 6, 7, 8);
+ let e: i8x16 = i8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
+ let r: i8x16 = transmute(vdupq_lane_p8::<4>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupq_lane_p16() {
+ let a: i16x4 = i16x4::new(1, 1, 1, 4);
+ let e: i16x8 = i16x8::new(1, 1, 1, 1, 1, 1, 1, 1);
+ let r: i16x8 = transmute(vdupq_lane_p16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupq_laneq_s64() {
+ let a: i64x2 = i64x2::new(1, 1);
+ let e: i64x2 = i64x2::new(1, 1);
+ let r: i64x2 = transmute(vdupq_laneq_s64::<1>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupq_lane_s64() {
+ let a: i64x1 = i64x1::new(1);
+ let e: i64x2 = i64x2::new(1, 1);
+ let r: i64x2 = transmute(vdupq_lane_s64::<0>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupq_laneq_u64() {
+ let a: u64x2 = u64x2::new(1, 1);
+ let e: u64x2 = u64x2::new(1, 1);
+ let r: u64x2 = transmute(vdupq_laneq_u64::<1>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupq_lane_u64() {
+ let a: u64x1 = u64x1::new(1);
+ let e: u64x2 = u64x2::new(1, 1);
+ let r: u64x2 = transmute(vdupq_lane_u64::<0>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdup_lane_f32() {
+ let a: f32x2 = f32x2::new(1., 1.);
+ let e: f32x2 = f32x2::new(1., 1.);
+ let r: f32x2 = transmute(vdup_lane_f32::<1>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupq_laneq_f32() {
+ let a: f32x4 = f32x4::new(1., 1., 1., 4.);
+ let e: f32x4 = f32x4::new(1., 1., 1., 1.);
+ let r: f32x4 = transmute(vdupq_laneq_f32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdup_laneq_f32() {
+ let a: f32x4 = f32x4::new(1., 1., 1., 4.);
+ let e: f32x2 = f32x2::new(1., 1.);
+ let r: f32x2 = transmute(vdup_laneq_f32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupq_lane_f32() {
+ let a: f32x2 = f32x2::new(1., 1.);
+ let e: f32x4 = f32x4::new(1., 1., 1., 1.);
+ let r: f32x4 = transmute(vdupq_lane_f32::<1>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdup_lane_s64() {
+ let a: i64x1 = i64x1::new(0);
+ let e: i64x1 = i64x1::new(0);
+ let r: i64x1 = transmute(vdup_lane_s64::<0>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdup_lane_u64() {
+ let a: u64x1 = u64x1::new(0);
+ let e: u64x1 = u64x1::new(0);
+ let r: u64x1 = transmute(vdup_lane_u64::<0>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdup_laneq_s64() {
+ let a: i64x2 = i64x2::new(0, 1);
+ let e: i64x1 = i64x1::new(1);
+ let r: i64x1 = transmute(vdup_laneq_s64::<1>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdup_laneq_u64() {
+ let a: u64x2 = u64x2::new(0, 1);
+ let e: u64x1 = u64x1::new(1);
+ let r: u64x1 = transmute(vdup_laneq_u64::<1>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vext_s8() {
+ let a: i8x8 = i8x8::new(0, 8, 8, 9, 8, 9, 9, 11);
+ let b: i8x8 = i8x8::new(9, 11, 14, 15, 16, 17, 18, 19);
+ let e: i8x8 = i8x8::new(8, 9, 9, 11, 9, 11, 14, 15);
+ let r: i8x8 = transmute(vext_s8::<4>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vextq_s8() {
+ let a: i8x16 = i8x16::new(0, 8, 8, 9, 8, 9, 9, 11, 8, 9, 9, 11, 9, 11, 14, 15);
+ let b: i8x16 = i8x16::new(9, 11, 14, 15, 16, 17, 18, 19, 0, 8, 8, 9, 8, 9, 9, 11);
+ let e: i8x16 = i8x16::new(8, 9, 9, 11, 9, 11, 14, 15, 9, 11, 14, 15, 16, 17, 18, 19);
+ let r: i8x16 = transmute(vextq_s8::<8>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vext_s16() {
+ let a: i16x4 = i16x4::new(0, 8, 8, 9);
+ let b: i16x4 = i16x4::new(9, 11, 14, 15);
+ let e: i16x4 = i16x4::new(8, 9, 9, 11);
+ let r: i16x4 = transmute(vext_s16::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vextq_s16() {
+ let a: i16x8 = i16x8::new(0, 8, 8, 9, 8, 9, 9, 11);
+ let b: i16x8 = i16x8::new(9, 11, 14, 15, 16, 17, 18, 19);
+ let e: i16x8 = i16x8::new(8, 9, 9, 11, 9, 11, 14, 15);
+ let r: i16x8 = transmute(vextq_s16::<4>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vext_s32() {
+ let a: i32x2 = i32x2::new(0, 8);
+ let b: i32x2 = i32x2::new(9, 11);
+ let e: i32x2 = i32x2::new(8, 9);
+ let r: i32x2 = transmute(vext_s32::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vextq_s32() {
+ let a: i32x4 = i32x4::new(0, 8, 8, 9);
+ let b: i32x4 = i32x4::new(9, 11, 14, 15);
+ let e: i32x4 = i32x4::new(8, 9, 9, 11);
+ let r: i32x4 = transmute(vextq_s32::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vext_u8() {
+ let a: u8x8 = u8x8::new(0, 8, 8, 9, 8, 9, 9, 11);
+ let b: u8x8 = u8x8::new(9, 11, 14, 15, 16, 17, 18, 19);
+ let e: u8x8 = u8x8::new(8, 9, 9, 11, 9, 11, 14, 15);
+ let r: u8x8 = transmute(vext_u8::<4>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vextq_u8() {
+ let a: u8x16 = u8x16::new(0, 8, 8, 9, 8, 9, 9, 11, 8, 9, 9, 11, 9, 11, 14, 15);
+ let b: u8x16 = u8x16::new(9, 11, 14, 15, 16, 17, 18, 19, 0, 8, 8, 9, 8, 9, 9, 11);
+ let e: u8x16 = u8x16::new(8, 9, 9, 11, 9, 11, 14, 15, 9, 11, 14, 15, 16, 17, 18, 19);
+ let r: u8x16 = transmute(vextq_u8::<8>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vext_u16() {
+ let a: u16x4 = u16x4::new(0, 8, 8, 9);
+ let b: u16x4 = u16x4::new(9, 11, 14, 15);
+ let e: u16x4 = u16x4::new(8, 9, 9, 11);
+ let r: u16x4 = transmute(vext_u16::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vextq_u16() {
+ let a: u16x8 = u16x8::new(0, 8, 8, 9, 8, 9, 9, 11);
+ let b: u16x8 = u16x8::new(9, 11, 14, 15, 16, 17, 18, 19);
+ let e: u16x8 = u16x8::new(8, 9, 9, 11, 9, 11, 14, 15);
+ let r: u16x8 = transmute(vextq_u16::<4>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vext_u32() {
+ let a: u32x2 = u32x2::new(0, 8);
+ let b: u32x2 = u32x2::new(9, 11);
+ let e: u32x2 = u32x2::new(8, 9);
+ let r: u32x2 = transmute(vext_u32::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vextq_u32() {
+ let a: u32x4 = u32x4::new(0, 8, 8, 9);
+ let b: u32x4 = u32x4::new(9, 11, 14, 15);
+ let e: u32x4 = u32x4::new(8, 9, 9, 11);
+ let r: u32x4 = transmute(vextq_u32::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vext_p8() {
+ let a: i8x8 = i8x8::new(0, 8, 8, 9, 8, 9, 9, 11);
+ let b: i8x8 = i8x8::new(9, 11, 14, 15, 16, 17, 18, 19);
+ let e: i8x8 = i8x8::new(8, 9, 9, 11, 9, 11, 14, 15);
+ let r: i8x8 = transmute(vext_p8::<4>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vextq_p8() {
+ let a: i8x16 = i8x16::new(0, 8, 8, 9, 8, 9, 9, 11, 8, 9, 9, 11, 9, 11, 14, 15);
+ let b: i8x16 = i8x16::new(9, 11, 14, 15, 16, 17, 18, 19, 0, 8, 8, 9, 8, 9, 9, 11);
+ let e: i8x16 = i8x16::new(8, 9, 9, 11, 9, 11, 14, 15, 9, 11, 14, 15, 16, 17, 18, 19);
+ let r: i8x16 = transmute(vextq_p8::<8>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vext_p16() {
+ let a: i16x4 = i16x4::new(0, 8, 8, 9);
+ let b: i16x4 = i16x4::new(9, 11, 14, 15);
+ let e: i16x4 = i16x4::new(8, 9, 9, 11);
+ let r: i16x4 = transmute(vext_p16::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vextq_p16() {
+ let a: i16x8 = i16x8::new(0, 8, 8, 9, 8, 9, 9, 11);
+ let b: i16x8 = i16x8::new(9, 11, 14, 15, 16, 17, 18, 19);
+ let e: i16x8 = i16x8::new(8, 9, 9, 11, 9, 11, 14, 15);
+ let r: i16x8 = transmute(vextq_p16::<4>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vextq_s64() {
+ let a: i64x2 = i64x2::new(0, 8);
+ let b: i64x2 = i64x2::new(9, 11);
+ let e: i64x2 = i64x2::new(8, 9);
+ let r: i64x2 = transmute(vextq_s64::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vextq_u64() {
+ let a: u64x2 = u64x2::new(0, 8);
+ let b: u64x2 = u64x2::new(9, 11);
+ let e: u64x2 = u64x2::new(8, 9);
+ let r: u64x2 = transmute(vextq_u64::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vext_f32() {
+ let a: f32x2 = f32x2::new(0., 2.);
+ let b: f32x2 = f32x2::new(3., 4.);
+ let e: f32x2 = f32x2::new(2., 3.);
+ let r: f32x2 = transmute(vext_f32::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vextq_f32() {
+ let a: f32x4 = f32x4::new(0., 2., 2., 3.);
+ let b: f32x4 = f32x4::new(3., 4., 5., 6.);
+ let e: f32x4 = f32x4::new(2., 3., 3., 4.);
+ let r: f32x4 = transmute(vextq_f32::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmla_s8() {
+ let a: i8x8 = i8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let b: i8x8 = i8x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let c: i8x8 = i8x8::new(3, 3, 3, 3, 3, 3, 3, 3);
+ let e: i8x8 = i8x8::new(6, 7, 8, 9, 10, 11, 12, 13);
+ let r: i8x8 = transmute(vmla_s8(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlaq_s8() {
+ let a: i8x16 = i8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let b: i8x16 = i8x16::new(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
+ let c: i8x16 = i8x16::new(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
+ let e: i8x16 = i8x16::new(6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21);
+ let r: i8x16 = transmute(vmlaq_s8(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmla_s16() {
+ let a: i16x4 = i16x4::new(0, 1, 2, 3);
+ let b: i16x4 = i16x4::new(2, 2, 2, 2);
+ let c: i16x4 = i16x4::new(3, 3, 3, 3);
+ let e: i16x4 = i16x4::new(6, 7, 8, 9);
+ let r: i16x4 = transmute(vmla_s16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlaq_s16() {
+ let a: i16x8 = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let b: i16x8 = i16x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let c: i16x8 = i16x8::new(3, 3, 3, 3, 3, 3, 3, 3);
+ let e: i16x8 = i16x8::new(6, 7, 8, 9, 10, 11, 12, 13);
+ let r: i16x8 = transmute(vmlaq_s16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmla_s32() {
+ let a: i32x2 = i32x2::new(0, 1);
+ let b: i32x2 = i32x2::new(2, 2);
+ let c: i32x2 = i32x2::new(3, 3);
+ let e: i32x2 = i32x2::new(6, 7);
+ let r: i32x2 = transmute(vmla_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlaq_s32() {
+ let a: i32x4 = i32x4::new(0, 1, 2, 3);
+ let b: i32x4 = i32x4::new(2, 2, 2, 2);
+ let c: i32x4 = i32x4::new(3, 3, 3, 3);
+ let e: i32x4 = i32x4::new(6, 7, 8, 9);
+ let r: i32x4 = transmute(vmlaq_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmla_u8() {
+ let a: u8x8 = u8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let b: u8x8 = u8x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let c: u8x8 = u8x8::new(3, 3, 3, 3, 3, 3, 3, 3);
+ let e: u8x8 = u8x8::new(6, 7, 8, 9, 10, 11, 12, 13);
+ let r: u8x8 = transmute(vmla_u8(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlaq_u8() {
+ let a: u8x16 = u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let b: u8x16 = u8x16::new(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
+ let c: u8x16 = u8x16::new(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
+ let e: u8x16 = u8x16::new(6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21);
+ let r: u8x16 = transmute(vmlaq_u8(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmla_u16() {
+ let a: u16x4 = u16x4::new(0, 1, 2, 3);
+ let b: u16x4 = u16x4::new(2, 2, 2, 2);
+ let c: u16x4 = u16x4::new(3, 3, 3, 3);
+ let e: u16x4 = u16x4::new(6, 7, 8, 9);
+ let r: u16x4 = transmute(vmla_u16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlaq_u16() {
+ let a: u16x8 = u16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let b: u16x8 = u16x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let c: u16x8 = u16x8::new(3, 3, 3, 3, 3, 3, 3, 3);
+ let e: u16x8 = u16x8::new(6, 7, 8, 9, 10, 11, 12, 13);
+ let r: u16x8 = transmute(vmlaq_u16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmla_u32() {
+ let a: u32x2 = u32x2::new(0, 1);
+ let b: u32x2 = u32x2::new(2, 2);
+ let c: u32x2 = u32x2::new(3, 3);
+ let e: u32x2 = u32x2::new(6, 7);
+ let r: u32x2 = transmute(vmla_u32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlaq_u32() {
+ let a: u32x4 = u32x4::new(0, 1, 2, 3);
+ let b: u32x4 = u32x4::new(2, 2, 2, 2);
+ let c: u32x4 = u32x4::new(3, 3, 3, 3);
+ let e: u32x4 = u32x4::new(6, 7, 8, 9);
+ let r: u32x4 = transmute(vmlaq_u32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmla_f32() {
+ let a: f32x2 = f32x2::new(0., 1.);
+ let b: f32x2 = f32x2::new(2., 2.);
+ let c: f32x2 = f32x2::new(3., 3.);
+ let e: f32x2 = f32x2::new(6., 7.);
+ let r: f32x2 = transmute(vmla_f32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlaq_f32() {
+ let a: f32x4 = f32x4::new(0., 1., 2., 3.);
+ let b: f32x4 = f32x4::new(2., 2., 2., 2.);
+ let c: f32x4 = f32x4::new(3., 3., 3., 3.);
+ let e: f32x4 = f32x4::new(6., 7., 8., 9.);
+ let r: f32x4 = transmute(vmlaq_f32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmla_n_s16() {
+ let a: i16x4 = i16x4::new(0, 1, 2, 3);
+ let b: i16x4 = i16x4::new(2, 2, 2, 2);
+ let c: i16 = 3;
+ let e: i16x4 = i16x4::new(6, 7, 8, 9);
+ let r: i16x4 = transmute(vmla_n_s16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlaq_n_s16() {
+ let a: i16x8 = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let b: i16x8 = i16x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let c: i16 = 3;
+ let e: i16x8 = i16x8::new(6, 7, 8, 9, 10, 11, 12, 13);
+ let r: i16x8 = transmute(vmlaq_n_s16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmla_n_s32() {
+ let a: i32x2 = i32x2::new(0, 1);
+ let b: i32x2 = i32x2::new(2, 2);
+ let c: i32 = 3;
+ let e: i32x2 = i32x2::new(6, 7);
+ let r: i32x2 = transmute(vmla_n_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlaq_n_s32() {
+ let a: i32x4 = i32x4::new(0, 1, 2, 3);
+ let b: i32x4 = i32x4::new(2, 2, 2, 2);
+ let c: i32 = 3;
+ let e: i32x4 = i32x4::new(6, 7, 8, 9);
+ let r: i32x4 = transmute(vmlaq_n_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmla_n_u16() {
+ let a: u16x4 = u16x4::new(0, 1, 2, 3);
+ let b: u16x4 = u16x4::new(2, 2, 2, 2);
+ let c: u16 = 3;
+ let e: u16x4 = u16x4::new(6, 7, 8, 9);
+ let r: u16x4 = transmute(vmla_n_u16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlaq_n_u16() {
+ let a: u16x8 = u16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let b: u16x8 = u16x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let c: u16 = 3;
+ let e: u16x8 = u16x8::new(6, 7, 8, 9, 10, 11, 12, 13);
+ let r: u16x8 = transmute(vmlaq_n_u16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmla_n_u32() {
+ let a: u32x2 = u32x2::new(0, 1);
+ let b: u32x2 = u32x2::new(2, 2);
+ let c: u32 = 3;
+ let e: u32x2 = u32x2::new(6, 7);
+ let r: u32x2 = transmute(vmla_n_u32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlaq_n_u32() {
+ let a: u32x4 = u32x4::new(0, 1, 2, 3);
+ let b: u32x4 = u32x4::new(2, 2, 2, 2);
+ let c: u32 = 3;
+ let e: u32x4 = u32x4::new(6, 7, 8, 9);
+ let r: u32x4 = transmute(vmlaq_n_u32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmla_n_f32() {
+ let a: f32x2 = f32x2::new(0., 1.);
+ let b: f32x2 = f32x2::new(2., 2.);
+ let c: f32 = 3.;
+ let e: f32x2 = f32x2::new(6., 7.);
+ let r: f32x2 = transmute(vmla_n_f32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlaq_n_f32() {
+ let a: f32x4 = f32x4::new(0., 1., 2., 3.);
+ let b: f32x4 = f32x4::new(2., 2., 2., 2.);
+ let c: f32 = 3.;
+ let e: f32x4 = f32x4::new(6., 7., 8., 9.);
+ let r: f32x4 = transmute(vmlaq_n_f32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmla_lane_s16() {
+ let a: i16x4 = i16x4::new(0, 1, 2, 3);
+ let b: i16x4 = i16x4::new(2, 2, 2, 2);
+ let c: i16x4 = i16x4::new(0, 3, 0, 0);
+ let e: i16x4 = i16x4::new(6, 7, 8, 9);
+ let r: i16x4 = transmute(vmla_lane_s16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmla_laneq_s16() {
+ let a: i16x4 = i16x4::new(0, 1, 2, 3);
+ let b: i16x4 = i16x4::new(2, 2, 2, 2);
+ let c: i16x8 = i16x8::new(0, 3, 0, 0, 0, 0, 0, 0);
+ let e: i16x4 = i16x4::new(6, 7, 8, 9);
+ let r: i16x4 = transmute(vmla_laneq_s16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlaq_lane_s16() {
+ let a: i16x8 = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let b: i16x8 = i16x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let c: i16x4 = i16x4::new(0, 3, 0, 0);
+ let e: i16x8 = i16x8::new(6, 7, 8, 9, 10, 11, 12, 13);
+ let r: i16x8 = transmute(vmlaq_lane_s16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlaq_laneq_s16() {
+ let a: i16x8 = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let b: i16x8 = i16x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let c: i16x8 = i16x8::new(0, 3, 0, 0, 0, 0, 0, 0);
+ let e: i16x8 = i16x8::new(6, 7, 8, 9, 10, 11, 12, 13);
+ let r: i16x8 = transmute(vmlaq_laneq_s16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmla_lane_s32() {
+ let a: i32x2 = i32x2::new(0, 1);
+ let b: i32x2 = i32x2::new(2, 2);
+ let c: i32x2 = i32x2::new(0, 3);
+ let e: i32x2 = i32x2::new(6, 7);
+ let r: i32x2 = transmute(vmla_lane_s32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmla_laneq_s32() {
+ let a: i32x2 = i32x2::new(0, 1);
+ let b: i32x2 = i32x2::new(2, 2);
+ let c: i32x4 = i32x4::new(0, 3, 0, 0);
+ let e: i32x2 = i32x2::new(6, 7);
+ let r: i32x2 = transmute(vmla_laneq_s32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlaq_lane_s32() {
+ let a: i32x4 = i32x4::new(0, 1, 2, 3);
+ let b: i32x4 = i32x4::new(2, 2, 2, 2);
+ let c: i32x2 = i32x2::new(0, 3);
+ let e: i32x4 = i32x4::new(6, 7, 8, 9);
+ let r: i32x4 = transmute(vmlaq_lane_s32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlaq_laneq_s32() {
+ let a: i32x4 = i32x4::new(0, 1, 2, 3);
+ let b: i32x4 = i32x4::new(2, 2, 2, 2);
+ let c: i32x4 = i32x4::new(0, 3, 0, 0);
+ let e: i32x4 = i32x4::new(6, 7, 8, 9);
+ let r: i32x4 = transmute(vmlaq_laneq_s32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmla_lane_u16() {
+ let a: u16x4 = u16x4::new(0, 1, 2, 3);
+ let b: u16x4 = u16x4::new(2, 2, 2, 2);
+ let c: u16x4 = u16x4::new(0, 3, 0, 0);
+ let e: u16x4 = u16x4::new(6, 7, 8, 9);
+ let r: u16x4 = transmute(vmla_lane_u16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmla_laneq_u16() {
+ let a: u16x4 = u16x4::new(0, 1, 2, 3);
+ let b: u16x4 = u16x4::new(2, 2, 2, 2);
+ let c: u16x8 = u16x8::new(0, 3, 0, 0, 0, 0, 0, 0);
+ let e: u16x4 = u16x4::new(6, 7, 8, 9);
+ let r: u16x4 = transmute(vmla_laneq_u16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlaq_lane_u16() {
+ let a: u16x8 = u16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let b: u16x8 = u16x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let c: u16x4 = u16x4::new(0, 3, 0, 0);
+ let e: u16x8 = u16x8::new(6, 7, 8, 9, 10, 11, 12, 13);
+ let r: u16x8 = transmute(vmlaq_lane_u16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlaq_laneq_u16() {
+ let a: u16x8 = u16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let b: u16x8 = u16x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let c: u16x8 = u16x8::new(0, 3, 0, 0, 0, 0, 0, 0);
+ let e: u16x8 = u16x8::new(6, 7, 8, 9, 10, 11, 12, 13);
+ let r: u16x8 = transmute(vmlaq_laneq_u16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmla_lane_u32() {
+ let a: u32x2 = u32x2::new(0, 1);
+ let b: u32x2 = u32x2::new(2, 2);
+ let c: u32x2 = u32x2::new(0, 3);
+ let e: u32x2 = u32x2::new(6, 7);
+ let r: u32x2 = transmute(vmla_lane_u32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmla_laneq_u32() {
+ let a: u32x2 = u32x2::new(0, 1);
+ let b: u32x2 = u32x2::new(2, 2);
+ let c: u32x4 = u32x4::new(0, 3, 0, 0);
+ let e: u32x2 = u32x2::new(6, 7);
+ let r: u32x2 = transmute(vmla_laneq_u32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlaq_lane_u32() {
+ let a: u32x4 = u32x4::new(0, 1, 2, 3);
+ let b: u32x4 = u32x4::new(2, 2, 2, 2);
+ let c: u32x2 = u32x2::new(0, 3);
+ let e: u32x4 = u32x4::new(6, 7, 8, 9);
+ let r: u32x4 = transmute(vmlaq_lane_u32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlaq_laneq_u32() {
+ let a: u32x4 = u32x4::new(0, 1, 2, 3);
+ let b: u32x4 = u32x4::new(2, 2, 2, 2);
+ let c: u32x4 = u32x4::new(0, 3, 0, 0);
+ let e: u32x4 = u32x4::new(6, 7, 8, 9);
+ let r: u32x4 = transmute(vmlaq_laneq_u32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmla_lane_f32() {
+ let a: f32x2 = f32x2::new(0., 1.);
+ let b: f32x2 = f32x2::new(2., 2.);
+ let c: f32x2 = f32x2::new(0., 3.);
+ let e: f32x2 = f32x2::new(6., 7.);
+ let r: f32x2 = transmute(vmla_lane_f32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmla_laneq_f32() {
+ let a: f32x2 = f32x2::new(0., 1.);
+ let b: f32x2 = f32x2::new(2., 2.);
+ let c: f32x4 = f32x4::new(0., 3., 0., 0.);
+ let e: f32x2 = f32x2::new(6., 7.);
+ let r: f32x2 = transmute(vmla_laneq_f32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlaq_lane_f32() {
+ let a: f32x4 = f32x4::new(0., 1., 2., 3.);
+ let b: f32x4 = f32x4::new(2., 2., 2., 2.);
+ let c: f32x2 = f32x2::new(0., 3.);
+ let e: f32x4 = f32x4::new(6., 7., 8., 9.);
+ let r: f32x4 = transmute(vmlaq_lane_f32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlaq_laneq_f32() {
+ let a: f32x4 = f32x4::new(0., 1., 2., 3.);
+ let b: f32x4 = f32x4::new(2., 2., 2., 2.);
+ let c: f32x4 = f32x4::new(0., 3., 0., 0.);
+ let e: f32x4 = f32x4::new(6., 7., 8., 9.);
+ let r: f32x4 = transmute(vmlaq_laneq_f32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlal_s8() {
+ let a: i16x8 = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let b: i8x8 = i8x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let c: i8x8 = i8x8::new(3, 3, 3, 3, 3, 3, 3, 3);
+ let e: i16x8 = i16x8::new(6, 7, 8, 9, 10, 11, 12, 13);
+ let r: i16x8 = transmute(vmlal_s8(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlal_s16() {
+ let a: i32x4 = i32x4::new(0, 1, 2, 3);
+ let b: i16x4 = i16x4::new(2, 2, 2, 2);
+ let c: i16x4 = i16x4::new(3, 3, 3, 3);
+ let e: i32x4 = i32x4::new(6, 7, 8, 9);
+ let r: i32x4 = transmute(vmlal_s16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlal_s32() {
+ let a: i64x2 = i64x2::new(0, 1);
+ let b: i32x2 = i32x2::new(2, 2);
+ let c: i32x2 = i32x2::new(3, 3);
+ let e: i64x2 = i64x2::new(6, 7);
+ let r: i64x2 = transmute(vmlal_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlal_u8() {
+ let a: u16x8 = u16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let b: u8x8 = u8x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let c: u8x8 = u8x8::new(3, 3, 3, 3, 3, 3, 3, 3);
+ let e: u16x8 = u16x8::new(6, 7, 8, 9, 10, 11, 12, 13);
+ let r: u16x8 = transmute(vmlal_u8(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlal_u16() {
+ let a: u32x4 = u32x4::new(0, 1, 2, 3);
+ let b: u16x4 = u16x4::new(2, 2, 2, 2);
+ let c: u16x4 = u16x4::new(3, 3, 3, 3);
+ let e: u32x4 = u32x4::new(6, 7, 8, 9);
+ let r: u32x4 = transmute(vmlal_u16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlal_u32() {
+ let a: u64x2 = u64x2::new(0, 1);
+ let b: u32x2 = u32x2::new(2, 2);
+ let c: u32x2 = u32x2::new(3, 3);
+ let e: u64x2 = u64x2::new(6, 7);
+ let r: u64x2 = transmute(vmlal_u32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlal_n_s16() {
+ let a: i32x4 = i32x4::new(0, 1, 2, 3);
+ let b: i16x4 = i16x4::new(2, 2, 2, 2);
+ let c: i16 = 3;
+ let e: i32x4 = i32x4::new(6, 7, 8, 9);
+ let r: i32x4 = transmute(vmlal_n_s16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlal_n_s32() {
+ let a: i64x2 = i64x2::new(0, 1);
+ let b: i32x2 = i32x2::new(2, 2);
+ let c: i32 = 3;
+ let e: i64x2 = i64x2::new(6, 7);
+ let r: i64x2 = transmute(vmlal_n_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlal_n_u16() {
+ let a: u32x4 = u32x4::new(0, 1, 2, 3);
+ let b: u16x4 = u16x4::new(2, 2, 2, 2);
+ let c: u16 = 3;
+ let e: u32x4 = u32x4::new(6, 7, 8, 9);
+ let r: u32x4 = transmute(vmlal_n_u16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlal_n_u32() {
+ let a: u64x2 = u64x2::new(0, 1);
+ let b: u32x2 = u32x2::new(2, 2);
+ let c: u32 = 3;
+ let e: u64x2 = u64x2::new(6, 7);
+ let r: u64x2 = transmute(vmlal_n_u32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlal_lane_s16() {
+ let a: i32x4 = i32x4::new(0, 1, 2, 3);
+ let b: i16x4 = i16x4::new(2, 2, 2, 2);
+ let c: i16x4 = i16x4::new(0, 3, 0, 0);
+ let e: i32x4 = i32x4::new(6, 7, 8, 9);
+ let r: i32x4 = transmute(vmlal_lane_s16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlal_laneq_s16() {
+ let a: i32x4 = i32x4::new(0, 1, 2, 3);
+ let b: i16x4 = i16x4::new(2, 2, 2, 2);
+ let c: i16x8 = i16x8::new(0, 3, 0, 0, 0, 0, 0, 0);
+ let e: i32x4 = i32x4::new(6, 7, 8, 9);
+ let r: i32x4 = transmute(vmlal_laneq_s16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlal_lane_s32() {
+ let a: i64x2 = i64x2::new(0, 1);
+ let b: i32x2 = i32x2::new(2, 2);
+ let c: i32x2 = i32x2::new(0, 3);
+ let e: i64x2 = i64x2::new(6, 7);
+ let r: i64x2 = transmute(vmlal_lane_s32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlal_laneq_s32() {
+ let a: i64x2 = i64x2::new(0, 1);
+ let b: i32x2 = i32x2::new(2, 2);
+ let c: i32x4 = i32x4::new(0, 3, 0, 0);
+ let e: i64x2 = i64x2::new(6, 7);
+ let r: i64x2 = transmute(vmlal_laneq_s32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlal_lane_u16() {
+ let a: u32x4 = u32x4::new(0, 1, 2, 3);
+ let b: u16x4 = u16x4::new(2, 2, 2, 2);
+ let c: u16x4 = u16x4::new(0, 3, 0, 0);
+ let e: u32x4 = u32x4::new(6, 7, 8, 9);
+ let r: u32x4 = transmute(vmlal_lane_u16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlal_laneq_u16() {
+ let a: u32x4 = u32x4::new(0, 1, 2, 3);
+ let b: u16x4 = u16x4::new(2, 2, 2, 2);
+ let c: u16x8 = u16x8::new(0, 3, 0, 0, 0, 0, 0, 0);
+ let e: u32x4 = u32x4::new(6, 7, 8, 9);
+ let r: u32x4 = transmute(vmlal_laneq_u16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlal_lane_u32() {
+ let a: u64x2 = u64x2::new(0, 1);
+ let b: u32x2 = u32x2::new(2, 2);
+ let c: u32x2 = u32x2::new(0, 3);
+ let e: u64x2 = u64x2::new(6, 7);
+ let r: u64x2 = transmute(vmlal_lane_u32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlal_laneq_u32() {
+ let a: u64x2 = u64x2::new(0, 1);
+ let b: u32x2 = u32x2::new(2, 2);
+ let c: u32x4 = u32x4::new(0, 3, 0, 0);
+ let e: u64x2 = u64x2::new(6, 7);
+ let r: u64x2 = transmute(vmlal_laneq_u32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmls_s8() {
+ let a: i8x8 = i8x8::new(6, 7, 8, 9, 10, 11, 12, 13);
+ let b: i8x8 = i8x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let c: i8x8 = i8x8::new(3, 3, 3, 3, 3, 3, 3, 3);
+ let e: i8x8 = i8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: i8x8 = transmute(vmls_s8(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsq_s8() {
+ let a: i8x16 = i8x16::new(6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21);
+ let b: i8x16 = i8x16::new(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
+ let c: i8x16 = i8x16::new(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
+ let e: i8x16 = i8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r: i8x16 = transmute(vmlsq_s8(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmls_s16() {
+ let a: i16x4 = i16x4::new(6, 7, 8, 9);
+ let b: i16x4 = i16x4::new(2, 2, 2, 2);
+ let c: i16x4 = i16x4::new(3, 3, 3, 3);
+ let e: i16x4 = i16x4::new(0, 1, 2, 3);
+ let r: i16x4 = transmute(vmls_s16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsq_s16() {
+ let a: i16x8 = i16x8::new(6, 7, 8, 9, 10, 11, 12, 13);
+ let b: i16x8 = i16x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let c: i16x8 = i16x8::new(3, 3, 3, 3, 3, 3, 3, 3);
+ let e: i16x8 = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: i16x8 = transmute(vmlsq_s16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmls_s32() {
+ let a: i32x2 = i32x2::new(6, 7);
+ let b: i32x2 = i32x2::new(2, 2);
+ let c: i32x2 = i32x2::new(3, 3);
+ let e: i32x2 = i32x2::new(0, 1);
+ let r: i32x2 = transmute(vmls_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsq_s32() {
+ let a: i32x4 = i32x4::new(6, 7, 8, 9);
+ let b: i32x4 = i32x4::new(2, 2, 2, 2);
+ let c: i32x4 = i32x4::new(3, 3, 3, 3);
+ let e: i32x4 = i32x4::new(0, 1, 2, 3);
+ let r: i32x4 = transmute(vmlsq_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmls_u8() {
+ let a: u8x8 = u8x8::new(6, 7, 8, 9, 10, 11, 12, 13);
+ let b: u8x8 = u8x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let c: u8x8 = u8x8::new(3, 3, 3, 3, 3, 3, 3, 3);
+ let e: u8x8 = u8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: u8x8 = transmute(vmls_u8(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsq_u8() {
+ let a: u8x16 = u8x16::new(6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21);
+ let b: u8x16 = u8x16::new(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
+ let c: u8x16 = u8x16::new(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
+ let e: u8x16 = u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r: u8x16 = transmute(vmlsq_u8(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmls_u16() {
+ let a: u16x4 = u16x4::new(6, 7, 8, 9);
+ let b: u16x4 = u16x4::new(2, 2, 2, 2);
+ let c: u16x4 = u16x4::new(3, 3, 3, 3);
+ let e: u16x4 = u16x4::new(0, 1, 2, 3);
+ let r: u16x4 = transmute(vmls_u16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsq_u16() {
+ let a: u16x8 = u16x8::new(6, 7, 8, 9, 10, 11, 12, 13);
+ let b: u16x8 = u16x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let c: u16x8 = u16x8::new(3, 3, 3, 3, 3, 3, 3, 3);
+ let e: u16x8 = u16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: u16x8 = transmute(vmlsq_u16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmls_u32() {
+ let a: u32x2 = u32x2::new(6, 7);
+ let b: u32x2 = u32x2::new(2, 2);
+ let c: u32x2 = u32x2::new(3, 3);
+ let e: u32x2 = u32x2::new(0, 1);
+ let r: u32x2 = transmute(vmls_u32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsq_u32() {
+ let a: u32x4 = u32x4::new(6, 7, 8, 9);
+ let b: u32x4 = u32x4::new(2, 2, 2, 2);
+ let c: u32x4 = u32x4::new(3, 3, 3, 3);
+ let e: u32x4 = u32x4::new(0, 1, 2, 3);
+ let r: u32x4 = transmute(vmlsq_u32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmls_f32() {
+ let a: f32x2 = f32x2::new(6., 7.);
+ let b: f32x2 = f32x2::new(2., 2.);
+ let c: f32x2 = f32x2::new(3., 3.);
+ let e: f32x2 = f32x2::new(0., 1.);
+ let r: f32x2 = transmute(vmls_f32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsq_f32() {
+ let a: f32x4 = f32x4::new(6., 7., 8., 9.);
+ let b: f32x4 = f32x4::new(2., 2., 2., 2.);
+ let c: f32x4 = f32x4::new(3., 3., 3., 3.);
+ let e: f32x4 = f32x4::new(0., 1., 2., 3.);
+ let r: f32x4 = transmute(vmlsq_f32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmls_n_s16() {
+ let a: i16x4 = i16x4::new(6, 7, 8, 9);
+ let b: i16x4 = i16x4::new(2, 2, 2, 2);
+ let c: i16 = 3;
+ let e: i16x4 = i16x4::new(0, 1, 2, 3);
+ let r: i16x4 = transmute(vmls_n_s16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsq_n_s16() {
+ let a: i16x8 = i16x8::new(6, 7, 8, 9, 10, 11, 12, 13);
+ let b: i16x8 = i16x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let c: i16 = 3;
+ let e: i16x8 = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: i16x8 = transmute(vmlsq_n_s16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmls_n_s32() {
+ let a: i32x2 = i32x2::new(6, 7);
+ let b: i32x2 = i32x2::new(2, 2);
+ let c: i32 = 3;
+ let e: i32x2 = i32x2::new(0, 1);
+ let r: i32x2 = transmute(vmls_n_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsq_n_s32() {
+ let a: i32x4 = i32x4::new(6, 7, 8, 9);
+ let b: i32x4 = i32x4::new(2, 2, 2, 2);
+ let c: i32 = 3;
+ let e: i32x4 = i32x4::new(0, 1, 2, 3);
+ let r: i32x4 = transmute(vmlsq_n_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmls_n_u16() {
+ let a: u16x4 = u16x4::new(6, 7, 8, 9);
+ let b: u16x4 = u16x4::new(2, 2, 2, 2);
+ let c: u16 = 3;
+ let e: u16x4 = u16x4::new(0, 1, 2, 3);
+ let r: u16x4 = transmute(vmls_n_u16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsq_n_u16() {
+ let a: u16x8 = u16x8::new(6, 7, 8, 9, 10, 11, 12, 13);
+ let b: u16x8 = u16x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let c: u16 = 3;
+ let e: u16x8 = u16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: u16x8 = transmute(vmlsq_n_u16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmls_n_u32() {
+ let a: u32x2 = u32x2::new(6, 7);
+ let b: u32x2 = u32x2::new(2, 2);
+ let c: u32 = 3;
+ let e: u32x2 = u32x2::new(0, 1);
+ let r: u32x2 = transmute(vmls_n_u32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsq_n_u32() {
+ let a: u32x4 = u32x4::new(6, 7, 8, 9);
+ let b: u32x4 = u32x4::new(2, 2, 2, 2);
+ let c: u32 = 3;
+ let e: u32x4 = u32x4::new(0, 1, 2, 3);
+ let r: u32x4 = transmute(vmlsq_n_u32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmls_n_f32() {
+ let a: f32x2 = f32x2::new(6., 7.);
+ let b: f32x2 = f32x2::new(2., 2.);
+ let c: f32 = 3.;
+ let e: f32x2 = f32x2::new(0., 1.);
+ let r: f32x2 = transmute(vmls_n_f32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsq_n_f32() {
+ let a: f32x4 = f32x4::new(6., 7., 8., 9.);
+ let b: f32x4 = f32x4::new(2., 2., 2., 2.);
+ let c: f32 = 3.;
+ let e: f32x4 = f32x4::new(0., 1., 2., 3.);
+ let r: f32x4 = transmute(vmlsq_n_f32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmls_lane_s16() {
+ let a: i16x4 = i16x4::new(6, 7, 8, 9);
+ let b: i16x4 = i16x4::new(2, 2, 2, 2);
+ let c: i16x4 = i16x4::new(0, 3, 0, 0);
+ let e: i16x4 = i16x4::new(0, 1, 2, 3);
+ let r: i16x4 = transmute(vmls_lane_s16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmls_laneq_s16() {
+ let a: i16x4 = i16x4::new(6, 7, 8, 9);
+ let b: i16x4 = i16x4::new(2, 2, 2, 2);
+ let c: i16x8 = i16x8::new(0, 3, 0, 0, 0, 0, 0, 0);
+ let e: i16x4 = i16x4::new(0, 1, 2, 3);
+ let r: i16x4 = transmute(vmls_laneq_s16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsq_lane_s16() {
+ let a: i16x8 = i16x8::new(6, 7, 8, 9, 10, 11, 12, 13);
+ let b: i16x8 = i16x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let c: i16x4 = i16x4::new(0, 3, 0, 0);
+ let e: i16x8 = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: i16x8 = transmute(vmlsq_lane_s16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsq_laneq_s16() {
+ let a: i16x8 = i16x8::new(6, 7, 8, 9, 10, 11, 12, 13);
+ let b: i16x8 = i16x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let c: i16x8 = i16x8::new(0, 3, 0, 0, 0, 0, 0, 0);
+ let e: i16x8 = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: i16x8 = transmute(vmlsq_laneq_s16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmls_lane_s32() {
+ let a: i32x2 = i32x2::new(6, 7);
+ let b: i32x2 = i32x2::new(2, 2);
+ let c: i32x2 = i32x2::new(0, 3);
+ let e: i32x2 = i32x2::new(0, 1);
+ let r: i32x2 = transmute(vmls_lane_s32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmls_laneq_s32() {
+ let a: i32x2 = i32x2::new(6, 7);
+ let b: i32x2 = i32x2::new(2, 2);
+ let c: i32x4 = i32x4::new(0, 3, 0, 0);
+ let e: i32x2 = i32x2::new(0, 1);
+ let r: i32x2 = transmute(vmls_laneq_s32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsq_lane_s32() {
+ let a: i32x4 = i32x4::new(6, 7, 8, 9);
+ let b: i32x4 = i32x4::new(2, 2, 2, 2);
+ let c: i32x2 = i32x2::new(0, 3);
+ let e: i32x4 = i32x4::new(0, 1, 2, 3);
+ let r: i32x4 = transmute(vmlsq_lane_s32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsq_laneq_s32() {
+ let a: i32x4 = i32x4::new(6, 7, 8, 9);
+ let b: i32x4 = i32x4::new(2, 2, 2, 2);
+ let c: i32x4 = i32x4::new(0, 3, 0, 0);
+ let e: i32x4 = i32x4::new(0, 1, 2, 3);
+ let r: i32x4 = transmute(vmlsq_laneq_s32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmls_lane_u16() {
+ let a: u16x4 = u16x4::new(6, 7, 8, 9);
+ let b: u16x4 = u16x4::new(2, 2, 2, 2);
+ let c: u16x4 = u16x4::new(0, 3, 0, 0);
+ let e: u16x4 = u16x4::new(0, 1, 2, 3);
+ let r: u16x4 = transmute(vmls_lane_u16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmls_laneq_u16() {
+ let a: u16x4 = u16x4::new(6, 7, 8, 9);
+ let b: u16x4 = u16x4::new(2, 2, 2, 2);
+ let c: u16x8 = u16x8::new(0, 3, 0, 0, 0, 0, 0, 0);
+ let e: u16x4 = u16x4::new(0, 1, 2, 3);
+ let r: u16x4 = transmute(vmls_laneq_u16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsq_lane_u16() {
+ let a: u16x8 = u16x8::new(6, 7, 8, 9, 10, 11, 12, 13);
+ let b: u16x8 = u16x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let c: u16x4 = u16x4::new(0, 3, 0, 0);
+ let e: u16x8 = u16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: u16x8 = transmute(vmlsq_lane_u16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsq_laneq_u16() {
+ let a: u16x8 = u16x8::new(6, 7, 8, 9, 10, 11, 12, 13);
+ let b: u16x8 = u16x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let c: u16x8 = u16x8::new(0, 3, 0, 0, 0, 0, 0, 0);
+ let e: u16x8 = u16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: u16x8 = transmute(vmlsq_laneq_u16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmls_lane_u32() {
+ let a: u32x2 = u32x2::new(6, 7);
+ let b: u32x2 = u32x2::new(2, 2);
+ let c: u32x2 = u32x2::new(0, 3);
+ let e: u32x2 = u32x2::new(0, 1);
+ let r: u32x2 = transmute(vmls_lane_u32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmls_laneq_u32() {
+ let a: u32x2 = u32x2::new(6, 7);
+ let b: u32x2 = u32x2::new(2, 2);
+ let c: u32x4 = u32x4::new(0, 3, 0, 0);
+ let e: u32x2 = u32x2::new(0, 1);
+ let r: u32x2 = transmute(vmls_laneq_u32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsq_lane_u32() {
+ let a: u32x4 = u32x4::new(6, 7, 8, 9);
+ let b: u32x4 = u32x4::new(2, 2, 2, 2);
+ let c: u32x2 = u32x2::new(0, 3);
+ let e: u32x4 = u32x4::new(0, 1, 2, 3);
+ let r: u32x4 = transmute(vmlsq_lane_u32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsq_laneq_u32() {
+ let a: u32x4 = u32x4::new(6, 7, 8, 9);
+ let b: u32x4 = u32x4::new(2, 2, 2, 2);
+ let c: u32x4 = u32x4::new(0, 3, 0, 0);
+ let e: u32x4 = u32x4::new(0, 1, 2, 3);
+ let r: u32x4 = transmute(vmlsq_laneq_u32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmls_lane_f32() {
+ let a: f32x2 = f32x2::new(6., 7.);
+ let b: f32x2 = f32x2::new(2., 2.);
+ let c: f32x2 = f32x2::new(0., 3.);
+ let e: f32x2 = f32x2::new(0., 1.);
+ let r: f32x2 = transmute(vmls_lane_f32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmls_laneq_f32() {
+ let a: f32x2 = f32x2::new(6., 7.);
+ let b: f32x2 = f32x2::new(2., 2.);
+ let c: f32x4 = f32x4::new(0., 3., 0., 0.);
+ let e: f32x2 = f32x2::new(0., 1.);
+ let r: f32x2 = transmute(vmls_laneq_f32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsq_lane_f32() {
+ let a: f32x4 = f32x4::new(6., 7., 8., 9.);
+ let b: f32x4 = f32x4::new(2., 2., 2., 2.);
+ let c: f32x2 = f32x2::new(0., 3.);
+ let e: f32x4 = f32x4::new(0., 1., 2., 3.);
+ let r: f32x4 = transmute(vmlsq_lane_f32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsq_laneq_f32() {
+ let a: f32x4 = f32x4::new(6., 7., 8., 9.);
+ let b: f32x4 = f32x4::new(2., 2., 2., 2.);
+ let c: f32x4 = f32x4::new(0., 3., 0., 0.);
+ let e: f32x4 = f32x4::new(0., 1., 2., 3.);
+ let r: f32x4 = transmute(vmlsq_laneq_f32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsl_s8() {
+ let a: i16x8 = i16x8::new(6, 7, 8, 9, 10, 11, 12, 13);
+ let b: i8x8 = i8x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let c: i8x8 = i8x8::new(3, 3, 3, 3, 3, 3, 3, 3);
+ let e: i16x8 = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: i16x8 = transmute(vmlsl_s8(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsl_s16() {
+ let a: i32x4 = i32x4::new(6, 7, 8, 9);
+ let b: i16x4 = i16x4::new(2, 2, 2, 2);
+ let c: i16x4 = i16x4::new(3, 3, 3, 3);
+ let e: i32x4 = i32x4::new(0, 1, 2, 3);
+ let r: i32x4 = transmute(vmlsl_s16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsl_s32() {
+ let a: i64x2 = i64x2::new(6, 7);
+ let b: i32x2 = i32x2::new(2, 2);
+ let c: i32x2 = i32x2::new(3, 3);
+ let e: i64x2 = i64x2::new(0, 1);
+ let r: i64x2 = transmute(vmlsl_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsl_u8() {
+ let a: u16x8 = u16x8::new(6, 7, 8, 9, 10, 11, 12, 13);
+ let b: u8x8 = u8x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let c: u8x8 = u8x8::new(3, 3, 3, 3, 3, 3, 3, 3);
+ let e: u16x8 = u16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: u16x8 = transmute(vmlsl_u8(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsl_u16() {
+ let a: u32x4 = u32x4::new(6, 7, 8, 9);
+ let b: u16x4 = u16x4::new(2, 2, 2, 2);
+ let c: u16x4 = u16x4::new(3, 3, 3, 3);
+ let e: u32x4 = u32x4::new(0, 1, 2, 3);
+ let r: u32x4 = transmute(vmlsl_u16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsl_u32() {
+ let a: u64x2 = u64x2::new(6, 7);
+ let b: u32x2 = u32x2::new(2, 2);
+ let c: u32x2 = u32x2::new(3, 3);
+ let e: u64x2 = u64x2::new(0, 1);
+ let r: u64x2 = transmute(vmlsl_u32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsl_n_s16() {
+ let a: i32x4 = i32x4::new(6, 7, 8, 9);
+ let b: i16x4 = i16x4::new(2, 2, 2, 2);
+ let c: i16 = 3;
+ let e: i32x4 = i32x4::new(0, 1, 2, 3);
+ let r: i32x4 = transmute(vmlsl_n_s16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsl_n_s32() {
+ let a: i64x2 = i64x2::new(6, 7);
+ let b: i32x2 = i32x2::new(2, 2);
+ let c: i32 = 3;
+ let e: i64x2 = i64x2::new(0, 1);
+ let r: i64x2 = transmute(vmlsl_n_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsl_n_u16() {
+ let a: u32x4 = u32x4::new(6, 7, 8, 9);
+ let b: u16x4 = u16x4::new(2, 2, 2, 2);
+ let c: u16 = 3;
+ let e: u32x4 = u32x4::new(0, 1, 2, 3);
+ let r: u32x4 = transmute(vmlsl_n_u16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsl_n_u32() {
+ let a: u64x2 = u64x2::new(6, 7);
+ let b: u32x2 = u32x2::new(2, 2);
+ let c: u32 = 3;
+ let e: u64x2 = u64x2::new(0, 1);
+ let r: u64x2 = transmute(vmlsl_n_u32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsl_lane_s16() {
+ let a: i32x4 = i32x4::new(6, 7, 8, 9);
+ let b: i16x4 = i16x4::new(2, 2, 2, 2);
+ let c: i16x4 = i16x4::new(0, 3, 0, 0);
+ let e: i32x4 = i32x4::new(0, 1, 2, 3);
+ let r: i32x4 = transmute(vmlsl_lane_s16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsl_laneq_s16() {
+ let a: i32x4 = i32x4::new(6, 7, 8, 9);
+ let b: i16x4 = i16x4::new(2, 2, 2, 2);
+ let c: i16x8 = i16x8::new(0, 3, 0, 0, 0, 0, 0, 0);
+ let e: i32x4 = i32x4::new(0, 1, 2, 3);
+ let r: i32x4 = transmute(vmlsl_laneq_s16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsl_lane_s32() {
+ let a: i64x2 = i64x2::new(6, 7);
+ let b: i32x2 = i32x2::new(2, 2);
+ let c: i32x2 = i32x2::new(0, 3);
+ let e: i64x2 = i64x2::new(0, 1);
+ let r: i64x2 = transmute(vmlsl_lane_s32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsl_laneq_s32() {
+ let a: i64x2 = i64x2::new(6, 7);
+ let b: i32x2 = i32x2::new(2, 2);
+ let c: i32x4 = i32x4::new(0, 3, 0, 0);
+ let e: i64x2 = i64x2::new(0, 1);
+ let r: i64x2 = transmute(vmlsl_laneq_s32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsl_lane_u16() {
+ let a: u32x4 = u32x4::new(6, 7, 8, 9);
+ let b: u16x4 = u16x4::new(2, 2, 2, 2);
+ let c: u16x4 = u16x4::new(0, 3, 0, 0);
+ let e: u32x4 = u32x4::new(0, 1, 2, 3);
+ let r: u32x4 = transmute(vmlsl_lane_u16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsl_laneq_u16() {
+ let a: u32x4 = u32x4::new(6, 7, 8, 9);
+ let b: u16x4 = u16x4::new(2, 2, 2, 2);
+ let c: u16x8 = u16x8::new(0, 3, 0, 0, 0, 0, 0, 0);
+ let e: u32x4 = u32x4::new(0, 1, 2, 3);
+ let r: u32x4 = transmute(vmlsl_laneq_u16::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsl_lane_u32() {
+ let a: u64x2 = u64x2::new(6, 7);
+ let b: u32x2 = u32x2::new(2, 2);
+ let c: u32x2 = u32x2::new(0, 3);
+ let e: u64x2 = u64x2::new(0, 1);
+ let r: u64x2 = transmute(vmlsl_lane_u32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmlsl_laneq_u32() {
+ let a: u64x2 = u64x2::new(6, 7);
+ let b: u32x2 = u32x2::new(2, 2);
+ let c: u32x4 = u32x4::new(0, 3, 0, 0);
+ let e: u64x2 = u64x2::new(0, 1);
+ let r: u64x2 = transmute(vmlsl_laneq_u32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vneg_s8() {
+ let a: i8x8 = i8x8::new(0, 1, -1, 2, -2, 3, -3, 4);
+ let e: i8x8 = i8x8::new(0, -1, 1, -2, 2, -3, 3, -4);
+ let r: i8x8 = transmute(vneg_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vnegq_s8() {
+ let a: i8x16 = i8x16::new(0, 1, -1, 2, -2, 3, -3, 4, -4, 5, -5, 6, -6, 7, -7, 8);
+ let e: i8x16 = i8x16::new(0, -1, 1, -2, 2, -3, 3, -4, 4, -5, 5, -6, 6, -7, 7, -8);
+ let r: i8x16 = transmute(vnegq_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vneg_s16() {
+ let a: i16x4 = i16x4::new(0, 1, -1, 2);
+ let e: i16x4 = i16x4::new(0, -1, 1, -2);
+ let r: i16x4 = transmute(vneg_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vnegq_s16() {
+ let a: i16x8 = i16x8::new(0, 1, -1, 2, -2, 3, -3, 4);
+ let e: i16x8 = i16x8::new(0, -1, 1, -2, 2, -3, 3, -4);
+ let r: i16x8 = transmute(vnegq_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vneg_s32() {
+ let a: i32x2 = i32x2::new(0, 1);
+ let e: i32x2 = i32x2::new(0, -1);
+ let r: i32x2 = transmute(vneg_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vnegq_s32() {
+ let a: i32x4 = i32x4::new(0, 1, -1, 2);
+ let e: i32x4 = i32x4::new(0, -1, 1, -2);
+ let r: i32x4 = transmute(vnegq_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vneg_f32() {
+ let a: f32x2 = f32x2::new(0., 1.);
+ let e: f32x2 = f32x2::new(0., -1.);
+ let r: f32x2 = transmute(vneg_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vnegq_f32() {
+ let a: f32x4 = f32x4::new(0., 1., -1., 2.);
+ let e: f32x4 = f32x4::new(0., -1., 1., -2.);
+ let r: f32x4 = transmute(vnegq_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqneg_s8() {
+ let a: i8x8 = i8x8::new(-128, 0, 1, -1, 2, -2, 3, -3);
+ let e: i8x8 = i8x8::new(0x7F, 0, -1, 1, -2, 2, -3, 3);
+ let r: i8x8 = transmute(vqneg_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqnegq_s8() {
+ let a: i8x16 = i8x16::new(-128, 0, 1, -1, 2, -2, 3, -3, 4, -4, 5, -5, 6, -6, 7, -7);
+ let e: i8x16 = i8x16::new(0x7F, 0, -1, 1, -2, 2, -3, 3, -4, 4, -5, 5, -6, 6, -7, 7);
+ let r: i8x16 = transmute(vqnegq_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqneg_s16() {
+ let a: i16x4 = i16x4::new(-32768, 0, 1, -1);
+ let e: i16x4 = i16x4::new(0x7F_FF, 0, -1, 1);
+ let r: i16x4 = transmute(vqneg_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqnegq_s16() {
+ let a: i16x8 = i16x8::new(-32768, 0, 1, -1, 2, -2, 3, -3);
+ let e: i16x8 = i16x8::new(0x7F_FF, 0, -1, 1, -2, 2, -3, 3);
+ let r: i16x8 = transmute(vqnegq_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqneg_s32() {
+ let a: i32x2 = i32x2::new(-2147483648, 0);
+ let e: i32x2 = i32x2::new(0x7F_FF_FF_FF, 0);
+ let r: i32x2 = transmute(vqneg_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqnegq_s32() {
+ let a: i32x4 = i32x4::new(-2147483648, 0, 1, -1);
+ let e: i32x4 = i32x4::new(0x7F_FF_FF_FF, 0, -1, 1);
+ let r: i32x4 = transmute(vqnegq_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqsub_u8() {
+ let a: u8x8 = u8x8::new(42, 42, 42, 42, 42, 42, 42, 42);
+ let b: u8x8 = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: u8x8 = u8x8::new(41, 40, 39, 38, 37, 36, 35, 34);
+ let r: u8x8 = transmute(vqsub_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqsubq_u8() {
+ let a: u8x16 = u8x16::new(42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42);
+ let b: u8x16 = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let e: u8x16 = u8x16::new(41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26);
+ let r: u8x16 = transmute(vqsubq_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqsub_u16() {
+ let a: u16x4 = u16x4::new(42, 42, 42, 42);
+ let b: u16x4 = u16x4::new(1, 2, 3, 4);
+ let e: u16x4 = u16x4::new(41, 40, 39, 38);
+ let r: u16x4 = transmute(vqsub_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqsubq_u16() {
+ let a: u16x8 = u16x8::new(42, 42, 42, 42, 42, 42, 42, 42);
+ let b: u16x8 = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: u16x8 = u16x8::new(41, 40, 39, 38, 37, 36, 35, 34);
+ let r: u16x8 = transmute(vqsubq_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqsub_u32() {
+ let a: u32x2 = u32x2::new(42, 42);
+ let b: u32x2 = u32x2::new(1, 2);
+ let e: u32x2 = u32x2::new(41, 40);
+ let r: u32x2 = transmute(vqsub_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqsubq_u32() {
+ let a: u32x4 = u32x4::new(42, 42, 42, 42);
+ let b: u32x4 = u32x4::new(1, 2, 3, 4);
+ let e: u32x4 = u32x4::new(41, 40, 39, 38);
+ let r: u32x4 = transmute(vqsubq_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqsub_u64() {
+ let a: u64x1 = u64x1::new(42);
+ let b: u64x1 = u64x1::new(1);
+ let e: u64x1 = u64x1::new(41);
+ let r: u64x1 = transmute(vqsub_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqsubq_u64() {
+ let a: u64x2 = u64x2::new(42, 42);
+ let b: u64x2 = u64x2::new(1, 2);
+ let e: u64x2 = u64x2::new(41, 40);
+ let r: u64x2 = transmute(vqsubq_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqsub_s8() {
+ let a: i8x8 = i8x8::new(42, 42, 42, 42, 42, 42, 42, 42);
+ let b: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: i8x8 = i8x8::new(41, 40, 39, 38, 37, 36, 35, 34);
+ let r: i8x8 = transmute(vqsub_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqsubq_s8() {
+ let a: i8x16 = i8x16::new(42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42);
+ let b: i8x16 = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let e: i8x16 = i8x16::new(41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26);
+ let r: i8x16 = transmute(vqsubq_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqsub_s16() {
+ let a: i16x4 = i16x4::new(42, 42, 42, 42);
+ let b: i16x4 = i16x4::new(1, 2, 3, 4);
+ let e: i16x4 = i16x4::new(41, 40, 39, 38);
+ let r: i16x4 = transmute(vqsub_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqsubq_s16() {
+ let a: i16x8 = i16x8::new(42, 42, 42, 42, 42, 42, 42, 42);
+ let b: i16x8 = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: i16x8 = i16x8::new(41, 40, 39, 38, 37, 36, 35, 34);
+ let r: i16x8 = transmute(vqsubq_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqsub_s32() {
+ let a: i32x2 = i32x2::new(42, 42);
+ let b: i32x2 = i32x2::new(1, 2);
+ let e: i32x2 = i32x2::new(41, 40);
+ let r: i32x2 = transmute(vqsub_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqsubq_s32() {
+ let a: i32x4 = i32x4::new(42, 42, 42, 42);
+ let b: i32x4 = i32x4::new(1, 2, 3, 4);
+ let e: i32x4 = i32x4::new(41, 40, 39, 38);
+ let r: i32x4 = transmute(vqsubq_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqsub_s64() {
+ let a: i64x1 = i64x1::new(42);
+ let b: i64x1 = i64x1::new(1);
+ let e: i64x1 = i64x1::new(41);
+ let r: i64x1 = transmute(vqsub_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqsubq_s64() {
+ let a: i64x2 = i64x2::new(42, 42);
+ let b: i64x2 = i64x2::new(1, 2);
+ let e: i64x2 = i64x2::new(41, 40);
+ let r: i64x2 = transmute(vqsubq_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhadd_u8() {
+ let a: u8x8 = u8x8::new(42, 42, 42, 42, 42, 42, 42, 42);
+ let b: u8x8 = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: u8x8 = u8x8::new(21, 22, 22, 23, 23, 24, 24, 25);
+ let r: u8x8 = transmute(vhadd_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhaddq_u8() {
+ let a: u8x16 = u8x16::new(42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42);
+ let b: u8x16 = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let e: u8x16 = u8x16::new(21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29);
+ let r: u8x16 = transmute(vhaddq_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhadd_u16() {
+ let a: u16x4 = u16x4::new(42, 42, 42, 42);
+ let b: u16x4 = u16x4::new(1, 2, 3, 4);
+ let e: u16x4 = u16x4::new(21, 22, 22, 23);
+ let r: u16x4 = transmute(vhadd_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhaddq_u16() {
+ let a: u16x8 = u16x8::new(42, 42, 42, 42, 42, 42, 42, 42);
+ let b: u16x8 = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: u16x8 = u16x8::new(21, 22, 22, 23, 23, 24, 24, 25);
+ let r: u16x8 = transmute(vhaddq_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhadd_u32() {
+ let a: u32x2 = u32x2::new(42, 42);
+ let b: u32x2 = u32x2::new(1, 2);
+ let e: u32x2 = u32x2::new(21, 22);
+ let r: u32x2 = transmute(vhadd_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhaddq_u32() {
+ let a: u32x4 = u32x4::new(42, 42, 42, 42);
+ let b: u32x4 = u32x4::new(1, 2, 3, 4);
+ let e: u32x4 = u32x4::new(21, 22, 22, 23);
+ let r: u32x4 = transmute(vhaddq_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhadd_s8() {
+ let a: i8x8 = i8x8::new(42, 42, 42, 42, 42, 42, 42, 42);
+ let b: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: i8x8 = i8x8::new(21, 22, 22, 23, 23, 24, 24, 25);
+ let r: i8x8 = transmute(vhadd_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhaddq_s8() {
+ let a: i8x16 = i8x16::new(42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42);
+ let b: i8x16 = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let e: i8x16 = i8x16::new(21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29);
+ let r: i8x16 = transmute(vhaddq_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhadd_s16() {
+ let a: i16x4 = i16x4::new(42, 42, 42, 42);
+ let b: i16x4 = i16x4::new(1, 2, 3, 4);
+ let e: i16x4 = i16x4::new(21, 22, 22, 23);
+ let r: i16x4 = transmute(vhadd_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhaddq_s16() {
+ let a: i16x8 = i16x8::new(42, 42, 42, 42, 42, 42, 42, 42);
+ let b: i16x8 = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: i16x8 = i16x8::new(21, 22, 22, 23, 23, 24, 24, 25);
+ let r: i16x8 = transmute(vhaddq_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhadd_s32() {
+ let a: i32x2 = i32x2::new(42, 42);
+ let b: i32x2 = i32x2::new(1, 2);
+ let e: i32x2 = i32x2::new(21, 22);
+ let r: i32x2 = transmute(vhadd_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhaddq_s32() {
+ let a: i32x4 = i32x4::new(42, 42, 42, 42);
+ let b: i32x4 = i32x4::new(1, 2, 3, 4);
+ let e: i32x4 = i32x4::new(21, 22, 22, 23);
+ let r: i32x4 = transmute(vhaddq_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrhadd_u8() {
+ let a: u8x8 = u8x8::new(42, 42, 42, 42, 42, 42, 42, 42);
+ let b: u8x8 = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: u8x8 = u8x8::new(22, 22, 23, 23, 24, 24, 25, 25);
+ let r: u8x8 = transmute(vrhadd_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrhaddq_u8() {
+ let a: u8x16 = u8x16::new(42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42);
+ let b: u8x16 = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let e: u8x16 = u8x16::new(22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29);
+ let r: u8x16 = transmute(vrhaddq_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrhadd_u16() {
+ let a: u16x4 = u16x4::new(42, 42, 42, 42);
+ let b: u16x4 = u16x4::new(1, 2, 3, 4);
+ let e: u16x4 = u16x4::new(22, 22, 23, 23);
+ let r: u16x4 = transmute(vrhadd_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrhaddq_u16() {
+ let a: u16x8 = u16x8::new(42, 42, 42, 42, 42, 42, 42, 42);
+ let b: u16x8 = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: u16x8 = u16x8::new(22, 22, 23, 23, 24, 24, 25, 25);
+ let r: u16x8 = transmute(vrhaddq_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrhadd_u32() {
+ let a: u32x2 = u32x2::new(42, 42);
+ let b: u32x2 = u32x2::new(1, 2);
+ let e: u32x2 = u32x2::new(22, 22);
+ let r: u32x2 = transmute(vrhadd_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrhaddq_u32() {
+ let a: u32x4 = u32x4::new(42, 42, 42, 42);
+ let b: u32x4 = u32x4::new(1, 2, 3, 4);
+ let e: u32x4 = u32x4::new(22, 22, 23, 23);
+ let r: u32x4 = transmute(vrhaddq_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrhadd_s8() {
+ let a: i8x8 = i8x8::new(42, 42, 42, 42, 42, 42, 42, 42);
+ let b: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: i8x8 = i8x8::new(22, 22, 23, 23, 24, 24, 25, 25);
+ let r: i8x8 = transmute(vrhadd_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrhaddq_s8() {
+ let a: i8x16 = i8x16::new(42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42);
+ let b: i8x16 = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let e: i8x16 = i8x16::new(22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29);
+ let r: i8x16 = transmute(vrhaddq_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrhadd_s16() {
+ let a: i16x4 = i16x4::new(42, 42, 42, 42);
+ let b: i16x4 = i16x4::new(1, 2, 3, 4);
+ let e: i16x4 = i16x4::new(22, 22, 23, 23);
+ let r: i16x4 = transmute(vrhadd_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrhaddq_s16() {
+ let a: i16x8 = i16x8::new(42, 42, 42, 42, 42, 42, 42, 42);
+ let b: i16x8 = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: i16x8 = i16x8::new(22, 22, 23, 23, 24, 24, 25, 25);
+ let r: i16x8 = transmute(vrhaddq_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrhadd_s32() {
+ let a: i32x2 = i32x2::new(42, 42);
+ let b: i32x2 = i32x2::new(1, 2);
+ let e: i32x2 = i32x2::new(22, 22);
+ let r: i32x2 = transmute(vrhadd_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrhaddq_s32() {
+ let a: i32x4 = i32x4::new(42, 42, 42, 42);
+ let b: i32x4 = i32x4::new(1, 2, 3, 4);
+ let e: i32x4 = i32x4::new(22, 22, 23, 23);
+ let r: i32x4 = transmute(vrhaddq_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrndn_f32() {
+ let a: f32x2 = f32x2::new(-1.5, 0.5);
+ let e: f32x2 = f32x2::new(-2.0, 0.0);
+ let r: f32x2 = transmute(vrndn_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrndnq_f32() {
+ let a: f32x4 = f32x4::new(-1.5, 0.5, 1.5, 2.5);
+ let e: f32x4 = f32x4::new(-2.0, 0.0, 2.0, 2.0);
+ let r: f32x4 = transmute(vrndnq_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqadd_u8() {
+ let a: u8x8 = u8x8::new(42, 42, 42, 42, 42, 42, 42, 42);
+ let b: u8x8 = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: u8x8 = u8x8::new(43, 44, 45, 46, 47, 48, 49, 50);
+ let r: u8x8 = transmute(vqadd_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqaddq_u8() {
+ let a: u8x16 = u8x16::new(42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42);
+ let b: u8x16 = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let e: u8x16 = u8x16::new(43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58);
+ let r: u8x16 = transmute(vqaddq_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqadd_u16() {
+ let a: u16x4 = u16x4::new(42, 42, 42, 42);
+ let b: u16x4 = u16x4::new(1, 2, 3, 4);
+ let e: u16x4 = u16x4::new(43, 44, 45, 46);
+ let r: u16x4 = transmute(vqadd_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqaddq_u16() {
+ let a: u16x8 = u16x8::new(42, 42, 42, 42, 42, 42, 42, 42);
+ let b: u16x8 = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: u16x8 = u16x8::new(43, 44, 45, 46, 47, 48, 49, 50);
+ let r: u16x8 = transmute(vqaddq_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqadd_u32() {
+ let a: u32x2 = u32x2::new(42, 42);
+ let b: u32x2 = u32x2::new(1, 2);
+ let e: u32x2 = u32x2::new(43, 44);
+ let r: u32x2 = transmute(vqadd_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqaddq_u32() {
+ let a: u32x4 = u32x4::new(42, 42, 42, 42);
+ let b: u32x4 = u32x4::new(1, 2, 3, 4);
+ let e: u32x4 = u32x4::new(43, 44, 45, 46);
+ let r: u32x4 = transmute(vqaddq_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqadd_u64() {
+ let a: u64x1 = u64x1::new(42);
+ let b: u64x1 = u64x1::new(1);
+ let e: u64x1 = u64x1::new(43);
+ let r: u64x1 = transmute(vqadd_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqaddq_u64() {
+ let a: u64x2 = u64x2::new(42, 42);
+ let b: u64x2 = u64x2::new(1, 2);
+ let e: u64x2 = u64x2::new(43, 44);
+ let r: u64x2 = transmute(vqaddq_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqadd_s8() {
+ let a: i8x8 = i8x8::new(42, 42, 42, 42, 42, 42, 42, 42);
+ let b: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: i8x8 = i8x8::new(43, 44, 45, 46, 47, 48, 49, 50);
+ let r: i8x8 = transmute(vqadd_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqaddq_s8() {
+ let a: i8x16 = i8x16::new(42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42);
+ let b: i8x16 = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let e: i8x16 = i8x16::new(43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58);
+ let r: i8x16 = transmute(vqaddq_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqadd_s16() {
+ let a: i16x4 = i16x4::new(42, 42, 42, 42);
+ let b: i16x4 = i16x4::new(1, 2, 3, 4);
+ let e: i16x4 = i16x4::new(43, 44, 45, 46);
+ let r: i16x4 = transmute(vqadd_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqaddq_s16() {
+ let a: i16x8 = i16x8::new(42, 42, 42, 42, 42, 42, 42, 42);
+ let b: i16x8 = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: i16x8 = i16x8::new(43, 44, 45, 46, 47, 48, 49, 50);
+ let r: i16x8 = transmute(vqaddq_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqadd_s32() {
+ let a: i32x2 = i32x2::new(42, 42);
+ let b: i32x2 = i32x2::new(1, 2);
+ let e: i32x2 = i32x2::new(43, 44);
+ let r: i32x2 = transmute(vqadd_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqaddq_s32() {
+ let a: i32x4 = i32x4::new(42, 42, 42, 42);
+ let b: i32x4 = i32x4::new(1, 2, 3, 4);
+ let e: i32x4 = i32x4::new(43, 44, 45, 46);
+ let r: i32x4 = transmute(vqaddq_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqadd_s64() {
+ let a: i64x1 = i64x1::new(42);
+ let b: i64x1 = i64x1::new(1);
+ let e: i64x1 = i64x1::new(43);
+ let r: i64x1 = transmute(vqadd_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqaddq_s64() {
+ let a: i64x2 = i64x2::new(42, 42);
+ let b: i64x2 = i64x2::new(1, 2);
+ let e: i64x2 = i64x2::new(43, 44);
+ let r: i64x2 = transmute(vqaddq_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_s8_x2() {
+ let a: [i8; 17] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let e: [i8x8; 2] = [i8x8::new(1, 2, 3, 4, 5, 6, 7, 8), i8x8::new(9, 10, 11, 12, 13, 14, 15, 16)];
+ let r: [i8x8; 2] = transmute(vld1_s8_x2(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_s16_x2() {
+ let a: [i16; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
+ let e: [i16x4; 2] = [i16x4::new(1, 2, 3, 4), i16x4::new(5, 6, 7, 8)];
+ let r: [i16x4; 2] = transmute(vld1_s16_x2(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_s32_x2() {
+ let a: [i32; 5] = [0, 1, 2, 3, 4];
+ let e: [i32x2; 2] = [i32x2::new(1, 2), i32x2::new(3, 4)];
+ let r: [i32x2; 2] = transmute(vld1_s32_x2(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_s64_x2() {
+ let a: [i64; 3] = [0, 1, 2];
+ let e: [i64x1; 2] = [i64x1::new(1), i64x1::new(2)];
+ let r: [i64x1; 2] = transmute(vld1_s64_x2(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_s8_x2() {
+ let a: [i8; 33] = [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];
+ let e: [i8x16; 2] = [i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16), i8x16::new(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)];
+ let r: [i8x16; 2] = transmute(vld1q_s8_x2(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_s16_x2() {
+ let a: [i16; 17] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let e: [i16x8; 2] = [i16x8::new(1, 2, 3, 4, 5, 6, 7, 8), i16x8::new(9, 10, 11, 12, 13, 14, 15, 16)];
+ let r: [i16x8; 2] = transmute(vld1q_s16_x2(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_s32_x2() {
+ let a: [i32; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
+ let e: [i32x4; 2] = [i32x4::new(1, 2, 3, 4), i32x4::new(5, 6, 7, 8)];
+ let r: [i32x4; 2] = transmute(vld1q_s32_x2(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_s64_x2() {
+ let a: [i64; 5] = [0, 1, 2, 3, 4];
+ let e: [i64x2; 2] = [i64x2::new(1, 2), i64x2::new(3, 4)];
+ let r: [i64x2; 2] = transmute(vld1q_s64_x2(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_s8_x3() {
+ let a: [i8; 25] = [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];
+ let e: [i8x8; 3] = [i8x8::new(1, 2, 3, 4, 5, 6, 7, 8), i8x8::new(9, 10, 11, 12, 13, 14, 15, 16), i8x8::new(17, 18, 19, 20, 21, 22, 23, 24)];
+ let r: [i8x8; 3] = transmute(vld1_s8_x3(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_s16_x3() {
+ let a: [i16; 13] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
+ let e: [i16x4; 3] = [i16x4::new(1, 2, 3, 4), i16x4::new(5, 6, 7, 8), i16x4::new(9, 10, 11, 12)];
+ let r: [i16x4; 3] = transmute(vld1_s16_x3(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_s32_x3() {
+ let a: [i32; 7] = [0, 1, 2, 3, 4, 5, 6];
+ let e: [i32x2; 3] = [i32x2::new(1, 2), i32x2::new(3, 4), i32x2::new(5, 6)];
+ let r: [i32x2; 3] = transmute(vld1_s32_x3(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_s64_x3() {
+ let a: [i64; 4] = [0, 1, 2, 3];
+ let e: [i64x1; 3] = [i64x1::new(1), i64x1::new(2), i64x1::new(3)];
+ let r: [i64x1; 3] = transmute(vld1_s64_x3(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_s8_x3() {
+ let a: [i8; 49] = [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, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let e: [i8x16; 3] = [i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16), i8x16::new(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32), i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)];
+ let r: [i8x16; 3] = transmute(vld1q_s8_x3(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_s16_x3() {
+ let a: [i16; 25] = [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];
+ let e: [i16x8; 3] = [i16x8::new(1, 2, 3, 4, 5, 6, 7, 8), i16x8::new(9, 10, 11, 12, 13, 14, 15, 16), i16x8::new(17, 18, 19, 20, 21, 22, 23, 24)];
+ let r: [i16x8; 3] = transmute(vld1q_s16_x3(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_s32_x3() {
+ let a: [i32; 13] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
+ let e: [i32x4; 3] = [i32x4::new(1, 2, 3, 4), i32x4::new(5, 6, 7, 8), i32x4::new(9, 10, 11, 12)];
+ let r: [i32x4; 3] = transmute(vld1q_s32_x3(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_s64_x3() {
+ let a: [i64; 7] = [0, 1, 2, 3, 4, 5, 6];
+ let e: [i64x2; 3] = [i64x2::new(1, 2), i64x2::new(3, 4), i64x2::new(5, 6)];
+ let r: [i64x2; 3] = transmute(vld1q_s64_x3(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_s8_x4() {
+ let a: [i8; 33] = [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];
+ let e: [i8x8; 4] = [i8x8::new(1, 2, 3, 4, 5, 6, 7, 8), i8x8::new(9, 10, 11, 12, 13, 14, 15, 16), i8x8::new(17, 18, 19, 20, 21, 22, 23, 24), i8x8::new(25, 26, 27, 28, 29, 30, 31, 32)];
+ let r: [i8x8; 4] = transmute(vld1_s8_x4(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_s16_x4() {
+ let a: [i16; 17] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let e: [i16x4; 4] = [i16x4::new(1, 2, 3, 4), i16x4::new(5, 6, 7, 8), i16x4::new(9, 10, 11, 12), i16x4::new(13, 14, 15, 16)];
+ let r: [i16x4; 4] = transmute(vld1_s16_x4(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_s32_x4() {
+ let a: [i32; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
+ let e: [i32x2; 4] = [i32x2::new(1, 2), i32x2::new(3, 4), i32x2::new(5, 6), i32x2::new(7, 8)];
+ let r: [i32x2; 4] = transmute(vld1_s32_x4(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_s64_x4() {
+ let a: [i64; 5] = [0, 1, 2, 3, 4];
+ let e: [i64x1; 4] = [i64x1::new(1), i64x1::new(2), i64x1::new(3), i64x1::new(4)];
+ let r: [i64x1; 4] = transmute(vld1_s64_x4(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_s8_x4() {
+ let a: [i8; 65] = [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, 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 e: [i8x16; 4] = [i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16), i8x16::new(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32), i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16), i8x16::new(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)];
+ let r: [i8x16; 4] = transmute(vld1q_s8_x4(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_s16_x4() {
+ let a: [i16; 33] = [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];
+ let e: [i16x8; 4] = [i16x8::new(1, 2, 3, 4, 5, 6, 7, 8), i16x8::new(9, 10, 11, 12, 13, 14, 15, 16), i16x8::new(17, 18, 19, 20, 21, 22, 23, 24), i16x8::new(25, 26, 27, 28, 29, 30, 31, 32)];
+ let r: [i16x8; 4] = transmute(vld1q_s16_x4(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_s32_x4() {
+ let a: [i32; 17] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let e: [i32x4; 4] = [i32x4::new(1, 2, 3, 4), i32x4::new(5, 6, 7, 8), i32x4::new(9, 10, 11, 12), i32x4::new(13, 14, 15, 16)];
+ let r: [i32x4; 4] = transmute(vld1q_s32_x4(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_s64_x4() {
+ let a: [i64; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
+ let e: [i64x2; 4] = [i64x2::new(1, 2), i64x2::new(3, 4), i64x2::new(5, 6), i64x2::new(7, 8)];
+ let r: [i64x2; 4] = transmute(vld1q_s64_x4(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_u8_x2() {
+ let a: [u8; 17] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let e: [u8x8; 2] = [u8x8::new(1, 2, 3, 4, 5, 6, 7, 8), u8x8::new(9, 10, 11, 12, 13, 14, 15, 16)];
+ let r: [u8x8; 2] = transmute(vld1_u8_x2(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_u16_x2() {
+ let a: [u16; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
+ let e: [u16x4; 2] = [u16x4::new(1, 2, 3, 4), u16x4::new(5, 6, 7, 8)];
+ let r: [u16x4; 2] = transmute(vld1_u16_x2(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_u32_x2() {
+ let a: [u32; 5] = [0, 1, 2, 3, 4];
+ let e: [u32x2; 2] = [u32x2::new(1, 2), u32x2::new(3, 4)];
+ let r: [u32x2; 2] = transmute(vld1_u32_x2(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_u64_x2() {
+ let a: [u64; 3] = [0, 1, 2];
+ let e: [u64x1; 2] = [u64x1::new(1), u64x1::new(2)];
+ let r: [u64x1; 2] = transmute(vld1_u64_x2(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_u8_x2() {
+ let a: [u8; 33] = [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];
+ let e: [u8x16; 2] = [u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16), u8x16::new(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)];
+ let r: [u8x16; 2] = transmute(vld1q_u8_x2(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_u16_x2() {
+ let a: [u16; 17] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let e: [u16x8; 2] = [u16x8::new(1, 2, 3, 4, 5, 6, 7, 8), u16x8::new(9, 10, 11, 12, 13, 14, 15, 16)];
+ let r: [u16x8; 2] = transmute(vld1q_u16_x2(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_u32_x2() {
+ let a: [u32; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
+ let e: [u32x4; 2] = [u32x4::new(1, 2, 3, 4), u32x4::new(5, 6, 7, 8)];
+ let r: [u32x4; 2] = transmute(vld1q_u32_x2(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_u64_x2() {
+ let a: [u64; 5] = [0, 1, 2, 3, 4];
+ let e: [u64x2; 2] = [u64x2::new(1, 2), u64x2::new(3, 4)];
+ let r: [u64x2; 2] = transmute(vld1q_u64_x2(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_u8_x3() {
+ let a: [u8; 25] = [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];
+ let e: [u8x8; 3] = [u8x8::new(1, 2, 3, 4, 5, 6, 7, 8), u8x8::new(9, 10, 11, 12, 13, 14, 15, 16), u8x8::new(17, 18, 19, 20, 21, 22, 23, 24)];
+ let r: [u8x8; 3] = transmute(vld1_u8_x3(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_u16_x3() {
+ let a: [u16; 13] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
+ let e: [u16x4; 3] = [u16x4::new(1, 2, 3, 4), u16x4::new(5, 6, 7, 8), u16x4::new(9, 10, 11, 12)];
+ let r: [u16x4; 3] = transmute(vld1_u16_x3(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_u32_x3() {
+ let a: [u32; 7] = [0, 1, 2, 3, 4, 5, 6];
+ let e: [u32x2; 3] = [u32x2::new(1, 2), u32x2::new(3, 4), u32x2::new(5, 6)];
+ let r: [u32x2; 3] = transmute(vld1_u32_x3(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_u64_x3() {
+ let a: [u64; 4] = [0, 1, 2, 3];
+ let e: [u64x1; 3] = [u64x1::new(1), u64x1::new(2), u64x1::new(3)];
+ let r: [u64x1; 3] = transmute(vld1_u64_x3(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_u8_x3() {
+ let a: [u8; 49] = [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, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let e: [u8x16; 3] = [u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16), u8x16::new(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32), u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)];
+ let r: [u8x16; 3] = transmute(vld1q_u8_x3(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_u16_x3() {
+ let a: [u16; 25] = [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];
+ let e: [u16x8; 3] = [u16x8::new(1, 2, 3, 4, 5, 6, 7, 8), u16x8::new(9, 10, 11, 12, 13, 14, 15, 16), u16x8::new(17, 18, 19, 20, 21, 22, 23, 24)];
+ let r: [u16x8; 3] = transmute(vld1q_u16_x3(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_u32_x3() {
+ let a: [u32; 13] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
+ let e: [u32x4; 3] = [u32x4::new(1, 2, 3, 4), u32x4::new(5, 6, 7, 8), u32x4::new(9, 10, 11, 12)];
+ let r: [u32x4; 3] = transmute(vld1q_u32_x3(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_u64_x3() {
+ let a: [u64; 7] = [0, 1, 2, 3, 4, 5, 6];
+ let e: [u64x2; 3] = [u64x2::new(1, 2), u64x2::new(3, 4), u64x2::new(5, 6)];
+ let r: [u64x2; 3] = transmute(vld1q_u64_x3(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_u8_x4() {
+ let a: [u8; 33] = [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];
+ let e: [u8x8; 4] = [u8x8::new(1, 2, 3, 4, 5, 6, 7, 8), u8x8::new(9, 10, 11, 12, 13, 14, 15, 16), u8x8::new(17, 18, 19, 20, 21, 22, 23, 24), u8x8::new(25, 26, 27, 28, 29, 30, 31, 32)];
+ let r: [u8x8; 4] = transmute(vld1_u8_x4(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_u16_x4() {
+ let a: [u16; 17] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let e: [u16x4; 4] = [u16x4::new(1, 2, 3, 4), u16x4::new(5, 6, 7, 8), u16x4::new(9, 10, 11, 12), u16x4::new(13, 14, 15, 16)];
+ let r: [u16x4; 4] = transmute(vld1_u16_x4(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_u32_x4() {
+ let a: [u32; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
+ let e: [u32x2; 4] = [u32x2::new(1, 2), u32x2::new(3, 4), u32x2::new(5, 6), u32x2::new(7, 8)];
+ let r: [u32x2; 4] = transmute(vld1_u32_x4(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_u64_x4() {
+ let a: [u64; 5] = [0, 1, 2, 3, 4];
+ let e: [u64x1; 4] = [u64x1::new(1), u64x1::new(2), u64x1::new(3), u64x1::new(4)];
+ let r: [u64x1; 4] = transmute(vld1_u64_x4(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_u8_x4() {
+ let a: [u8; 65] = [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, 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 e: [u8x16; 4] = [u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16), u8x16::new(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32), u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16), u8x16::new(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)];
+ let r: [u8x16; 4] = transmute(vld1q_u8_x4(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_u16_x4() {
+ let a: [u16; 33] = [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];
+ let e: [u16x8; 4] = [u16x8::new(1, 2, 3, 4, 5, 6, 7, 8), u16x8::new(9, 10, 11, 12, 13, 14, 15, 16), u16x8::new(17, 18, 19, 20, 21, 22, 23, 24), u16x8::new(25, 26, 27, 28, 29, 30, 31, 32)];
+ let r: [u16x8; 4] = transmute(vld1q_u16_x4(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_u32_x4() {
+ let a: [u32; 17] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let e: [u32x4; 4] = [u32x4::new(1, 2, 3, 4), u32x4::new(5, 6, 7, 8), u32x4::new(9, 10, 11, 12), u32x4::new(13, 14, 15, 16)];
+ let r: [u32x4; 4] = transmute(vld1q_u32_x4(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_u64_x4() {
+ let a: [u64; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
+ let e: [u64x2; 4] = [u64x2::new(1, 2), u64x2::new(3, 4), u64x2::new(5, 6), u64x2::new(7, 8)];
+ let r: [u64x2; 4] = transmute(vld1q_u64_x4(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_p8_x2() {
+ let a: [u8; 17] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let e: [i8x8; 2] = [i8x8::new(1, 2, 3, 4, 5, 6, 7, 8), i8x8::new(9, 10, 11, 12, 13, 14, 15, 16)];
+ let r: [i8x8; 2] = transmute(vld1_p8_x2(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_p8_x3() {
+ let a: [u8; 25] = [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];
+ let e: [i8x8; 3] = [i8x8::new(1, 2, 3, 4, 5, 6, 7, 8), i8x8::new(9, 10, 11, 12, 13, 14, 15, 16), i8x8::new(17, 18, 19, 20, 21, 22, 23, 24)];
+ let r: [i8x8; 3] = transmute(vld1_p8_x3(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_p8_x4() {
+ let a: [u8; 33] = [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];
+ let e: [i8x8; 4] = [i8x8::new(1, 2, 3, 4, 5, 6, 7, 8), i8x8::new(9, 10, 11, 12, 13, 14, 15, 16), i8x8::new(17, 18, 19, 20, 21, 22, 23, 24), i8x8::new(25, 26, 27, 28, 29, 30, 31, 32)];
+ let r: [i8x8; 4] = transmute(vld1_p8_x4(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_p8_x2() {
+ let a: [u8; 33] = [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];
+ let e: [i8x16; 2] = [i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16), i8x16::new(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)];
+ let r: [i8x16; 2] = transmute(vld1q_p8_x2(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_p8_x3() {
+ let a: [u8; 49] = [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, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let e: [i8x16; 3] = [i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16), i8x16::new(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32), i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)];
+ let r: [i8x16; 3] = transmute(vld1q_p8_x3(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_p8_x4() {
+ let a: [u8; 65] = [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, 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 e: [i8x16; 4] = [i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16), i8x16::new(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32), i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16), i8x16::new(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)];
+ let r: [i8x16; 4] = transmute(vld1q_p8_x4(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_p16_x2() {
+ let a: [u16; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
+ let e: [i16x4; 2] = [i16x4::new(1, 2, 3, 4), i16x4::new(5, 6, 7, 8)];
+ let r: [i16x4; 2] = transmute(vld1_p16_x2(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_p16_x3() {
+ let a: [u16; 13] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
+ let e: [i16x4; 3] = [i16x4::new(1, 2, 3, 4), i16x4::new(5, 6, 7, 8), i16x4::new(9, 10, 11, 12)];
+ let r: [i16x4; 3] = transmute(vld1_p16_x3(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_p16_x4() {
+ let a: [u16; 17] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let e: [i16x4; 4] = [i16x4::new(1, 2, 3, 4), i16x4::new(5, 6, 7, 8), i16x4::new(9, 10, 11, 12), i16x4::new(13, 14, 15, 16)];
+ let r: [i16x4; 4] = transmute(vld1_p16_x4(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_p16_x2() {
+ let a: [u16; 17] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let e: [i16x8; 2] = [i16x8::new(1, 2, 3, 4, 5, 6, 7, 8), i16x8::new(9, 10, 11, 12, 13, 14, 15, 16)];
+ let r: [i16x8; 2] = transmute(vld1q_p16_x2(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_p16_x3() {
+ let a: [u16; 25] = [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];
+ let e: [i16x8; 3] = [i16x8::new(1, 2, 3, 4, 5, 6, 7, 8), i16x8::new(9, 10, 11, 12, 13, 14, 15, 16), i16x8::new(17, 18, 19, 20, 21, 22, 23, 24)];
+ let r: [i16x8; 3] = transmute(vld1q_p16_x3(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_p16_x4() {
+ let a: [u16; 33] = [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];
+ let e: [i16x8; 4] = [i16x8::new(1, 2, 3, 4, 5, 6, 7, 8), i16x8::new(9, 10, 11, 12, 13, 14, 15, 16), i16x8::new(17, 18, 19, 20, 21, 22, 23, 24), i16x8::new(25, 26, 27, 28, 29, 30, 31, 32)];
+ let r: [i16x8; 4] = transmute(vld1q_p16_x4(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_p64_x2() {
+ let a: [u64; 3] = [0, 1, 2];
+ let e: [i64x1; 2] = [i64x1::new(1), i64x1::new(2)];
+ let r: [i64x1; 2] = transmute(vld1_p64_x2(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_p64_x3() {
+ let a: [u64; 4] = [0, 1, 2, 3];
+ let e: [i64x1; 3] = [i64x1::new(1), i64x1::new(2), i64x1::new(3)];
+ let r: [i64x1; 3] = transmute(vld1_p64_x3(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_p64_x4() {
+ let a: [u64; 5] = [0, 1, 2, 3, 4];
+ let e: [i64x1; 4] = [i64x1::new(1), i64x1::new(2), i64x1::new(3), i64x1::new(4)];
+ let r: [i64x1; 4] = transmute(vld1_p64_x4(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_p64_x2() {
+ let a: [u64; 5] = [0, 1, 2, 3, 4];
+ let e: [i64x2; 2] = [i64x2::new(1, 2), i64x2::new(3, 4)];
+ let r: [i64x2; 2] = transmute(vld1q_p64_x2(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_p64_x3() {
+ let a: [u64; 7] = [0, 1, 2, 3, 4, 5, 6];
+ let e: [i64x2; 3] = [i64x2::new(1, 2), i64x2::new(3, 4), i64x2::new(5, 6)];
+ let r: [i64x2; 3] = transmute(vld1q_p64_x3(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_p64_x4() {
+ let a: [u64; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
+ let e: [i64x2; 4] = [i64x2::new(1, 2), i64x2::new(3, 4), i64x2::new(5, 6), i64x2::new(7, 8)];
+ let r: [i64x2; 4] = transmute(vld1q_p64_x4(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_f32_x2() {
+ let a: [f32; 5] = [0., 1., 2., 3., 4.];
+ let e: [f32x2; 2] = [f32x2::new(1., 2.), f32x2::new(3., 4.)];
+ let r: [f32x2; 2] = transmute(vld1_f32_x2(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_f32_x2() {
+ let a: [f32; 9] = [0., 1., 2., 3., 4., 5., 6., 7., 8.];
+ let e: [f32x4; 2] = [f32x4::new(1., 2., 3., 4.), f32x4::new(5., 6., 7., 8.)];
+ let r: [f32x4; 2] = transmute(vld1q_f32_x2(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_f32_x3() {
+ let a: [f32; 7] = [0., 1., 2., 3., 4., 5., 6.];
+ let e: [f32x2; 3] = [f32x2::new(1., 2.), f32x2::new(3., 4.), f32x2::new(5., 6.)];
+ let r: [f32x2; 3] = transmute(vld1_f32_x3(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_f32_x3() {
+ let a: [f32; 13] = [0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12.];
+ let e: [f32x4; 3] = [f32x4::new(1., 2., 3., 4.), f32x4::new(5., 6., 7., 8.), f32x4::new(9., 10., 11., 12.)];
+ let r: [f32x4; 3] = transmute(vld1q_f32_x3(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_f32_x4() {
+ let a: [f32; 9] = [0., 1., 2., 3., 4., 5., 6., 7., 8.];
+ let e: [f32x2; 4] = [f32x2::new(1., 2.), f32x2::new(3., 4.), f32x2::new(5., 6.), f32x2::new(7., 8.)];
+ let r: [f32x2; 4] = transmute(vld1_f32_x4(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_f32_x4() {
+ let a: [f32; 17] = [0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16.];
+ let e: [f32x4; 4] = [f32x4::new(1., 2., 3., 4.), f32x4::new(5., 6., 7., 8.), f32x4::new(9., 10., 11., 12.), f32x4::new(13., 14., 15., 16.)];
+ let r: [f32x4; 4] = transmute(vld1q_f32_x4(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2_s8() {
+ let a: [i8; 17] = [0, 1, 2, 2, 3, 2, 4, 3, 5, 2, 6, 3, 7, 4, 8, 5, 9];
+ let e: [i8x8; 2] = [i8x8::new(1, 2, 2, 3, 2, 3, 4, 5), i8x8::new(2, 3, 4, 5, 6, 7, 8, 9)];
+ let r: [i8x8; 2] = transmute(vld2_s8(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2_s16() {
+ let a: [i16; 9] = [0, 1, 2, 2, 3, 2, 4, 3, 5];
+ let e: [i16x4; 2] = [i16x4::new(1, 2, 2, 3), i16x4::new(2, 3, 4, 5)];
+ let r: [i16x4; 2] = transmute(vld2_s16(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2_s32() {
+ let a: [i32; 5] = [0, 1, 2, 2, 3];
+ let e: [i32x2; 2] = [i32x2::new(1, 2), i32x2::new(2, 3)];
+ let r: [i32x2; 2] = transmute(vld2_s32(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2q_s8() {
+ let a: [i8; 33] = [0, 1, 2, 2, 3, 2, 4, 3, 5, 2, 6, 3, 7, 4, 8, 5, 9, 2, 10, 3, 11, 4, 12, 5, 13, 6, 14, 7, 15, 8, 16, 9, 17];
+ let e: [i8x16; 2] = [i8x16::new(1, 2, 2, 3, 2, 3, 4, 5, 2, 3, 4, 5, 6, 7, 8, 9), i8x16::new(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17)];
+ let r: [i8x16; 2] = transmute(vld2q_s8(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2q_s16() {
+ let a: [i16; 17] = [0, 1, 2, 2, 3, 2, 4, 3, 5, 2, 6, 3, 7, 4, 8, 5, 9];
+ let e: [i16x8; 2] = [i16x8::new(1, 2, 2, 3, 2, 3, 4, 5), i16x8::new(2, 3, 4, 5, 6, 7, 8, 9)];
+ let r: [i16x8; 2] = transmute(vld2q_s16(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2q_s32() {
+ let a: [i32; 9] = [0, 1, 2, 2, 3, 2, 4, 3, 5];
+ let e: [i32x4; 2] = [i32x4::new(1, 2, 2, 3), i32x4::new(2, 3, 4, 5)];
+ let r: [i32x4; 2] = transmute(vld2q_s32(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2_s64() {
+ let a: [i64; 3] = [0, 1, 2];
+ let e: [i64x1; 2] = [i64x1::new(1), i64x1::new(2)];
+ let r: [i64x1; 2] = transmute(vld2_s64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2_u8() {
+ let a: [u8; 17] = [0, 1, 2, 2, 3, 2, 4, 3, 5, 2, 6, 3, 7, 4, 8, 5, 9];
+ let e: [u8x8; 2] = [u8x8::new(1, 2, 2, 3, 2, 3, 4, 5), u8x8::new(2, 3, 4, 5, 6, 7, 8, 9)];
+ let r: [u8x8; 2] = transmute(vld2_u8(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2_u16() {
+ let a: [u16; 9] = [0, 1, 2, 2, 3, 2, 4, 3, 5];
+ let e: [u16x4; 2] = [u16x4::new(1, 2, 2, 3), u16x4::new(2, 3, 4, 5)];
+ let r: [u16x4; 2] = transmute(vld2_u16(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2_u32() {
+ let a: [u32; 5] = [0, 1, 2, 2, 3];
+ let e: [u32x2; 2] = [u32x2::new(1, 2), u32x2::new(2, 3)];
+ let r: [u32x2; 2] = transmute(vld2_u32(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2q_u8() {
+ let a: [u8; 33] = [0, 1, 2, 2, 3, 2, 4, 3, 5, 2, 6, 3, 7, 4, 8, 5, 9, 2, 10, 3, 11, 4, 12, 5, 13, 6, 14, 7, 15, 8, 16, 9, 17];
+ let e: [u8x16; 2] = [u8x16::new(1, 2, 2, 3, 2, 3, 4, 5, 2, 3, 4, 5, 6, 7, 8, 9), u8x16::new(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17)];
+ let r: [u8x16; 2] = transmute(vld2q_u8(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2q_u16() {
+ let a: [u16; 17] = [0, 1, 2, 2, 3, 2, 4, 3, 5, 2, 6, 3, 7, 4, 8, 5, 9];
+ let e: [u16x8; 2] = [u16x8::new(1, 2, 2, 3, 2, 3, 4, 5), u16x8::new(2, 3, 4, 5, 6, 7, 8, 9)];
+ let r: [u16x8; 2] = transmute(vld2q_u16(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2q_u32() {
+ let a: [u32; 9] = [0, 1, 2, 2, 3, 2, 4, 3, 5];
+ let e: [u32x4; 2] = [u32x4::new(1, 2, 2, 3), u32x4::new(2, 3, 4, 5)];
+ let r: [u32x4; 2] = transmute(vld2q_u32(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2_p8() {
+ let a: [u8; 17] = [0, 1, 2, 2, 3, 2, 4, 3, 5, 2, 6, 3, 7, 4, 8, 5, 9];
+ let e: [i8x8; 2] = [i8x8::new(1, 2, 2, 3, 2, 3, 4, 5), i8x8::new(2, 3, 4, 5, 6, 7, 8, 9)];
+ let r: [i8x8; 2] = transmute(vld2_p8(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2_p16() {
+ let a: [u16; 9] = [0, 1, 2, 2, 3, 2, 4, 3, 5];
+ let e: [i16x4; 2] = [i16x4::new(1, 2, 2, 3), i16x4::new(2, 3, 4, 5)];
+ let r: [i16x4; 2] = transmute(vld2_p16(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2q_p8() {
+ let a: [u8; 33] = [0, 1, 2, 2, 3, 2, 4, 3, 5, 2, 6, 3, 7, 4, 8, 5, 9, 2, 10, 3, 11, 4, 12, 5, 13, 6, 14, 7, 15, 8, 16, 9, 17];
+ let e: [i8x16; 2] = [i8x16::new(1, 2, 2, 3, 2, 3, 4, 5, 2, 3, 4, 5, 6, 7, 8, 9), i8x16::new(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17)];
+ let r: [i8x16; 2] = transmute(vld2q_p8(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2q_p16() {
+ let a: [u16; 17] = [0, 1, 2, 2, 3, 2, 4, 3, 5, 2, 6, 3, 7, 4, 8, 5, 9];
+ let e: [i16x8; 2] = [i16x8::new(1, 2, 2, 3, 2, 3, 4, 5), i16x8::new(2, 3, 4, 5, 6, 7, 8, 9)];
+ let r: [i16x8; 2] = transmute(vld2q_p16(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2_u64() {
+ let a: [u64; 3] = [0, 1, 2];
+ let e: [u64x1; 2] = [u64x1::new(1), u64x1::new(2)];
+ let r: [u64x1; 2] = transmute(vld2_u64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2_p64() {
+ let a: [u64; 3] = [0, 1, 2];
+ let e: [i64x1; 2] = [i64x1::new(1), i64x1::new(2)];
+ let r: [i64x1; 2] = transmute(vld2_p64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2_f32() {
+ let a: [f32; 5] = [0., 1., 2., 2., 3.];
+ let e: [f32x2; 2] = [f32x2::new(1., 2.), f32x2::new(2., 3.)];
+ let r: [f32x2; 2] = transmute(vld2_f32(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2q_f32() {
+ let a: [f32; 9] = [0., 1., 2., 2., 3., 2., 4., 3., 5.];
+ let e: [f32x4; 2] = [f32x4::new(1., 2., 2., 3.), f32x4::new(2., 3., 4., 5.)];
+ let r: [f32x4; 2] = transmute(vld2q_f32(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2_dup_s8() {
+ let a: [i8; 17] = [0, 1, 1, 2, 3, 1, 4, 3, 5, 1, 6, 3, 7, 4, 8, 5, 9];
+ let e: [i8x8; 2] = [i8x8::new(1, 1, 1, 1, 1, 1, 1, 1), i8x8::new(1, 1, 1, 1, 1, 1, 1, 1)];
+ let r: [i8x8; 2] = transmute(vld2_dup_s8(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2_dup_s16() {
+ let a: [i16; 9] = [0, 1, 1, 2, 3, 1, 4, 3, 5];
+ let e: [i16x4; 2] = [i16x4::new(1, 1, 1, 1), i16x4::new(1, 1, 1, 1)];
+ let r: [i16x4; 2] = transmute(vld2_dup_s16(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2_dup_s32() {
+ let a: [i32; 5] = [0, 1, 1, 2, 3];
+ let e: [i32x2; 2] = [i32x2::new(1, 1), i32x2::new(1, 1)];
+ let r: [i32x2; 2] = transmute(vld2_dup_s32(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2q_dup_s8() {
+ let a: [i8; 33] = [0, 1, 1, 2, 3, 1, 4, 3, 5, 1, 6, 3, 7, 4, 8, 5, 9, 2, 10, 3, 11, 4, 12, 5, 13, 6, 14, 7, 15, 8, 16, 9, 17];
+ let e: [i8x16; 2] = [i8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), i8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)];
+ let r: [i8x16; 2] = transmute(vld2q_dup_s8(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2q_dup_s16() {
+ let a: [i16; 17] = [0, 1, 1, 2, 3, 1, 4, 3, 5, 1, 6, 3, 7, 4, 8, 5, 9];
+ let e: [i16x8; 2] = [i16x8::new(1, 1, 1, 1, 1, 1, 1, 1), i16x8::new(1, 1, 1, 1, 1, 1, 1, 1)];
+ let r: [i16x8; 2] = transmute(vld2q_dup_s16(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2q_dup_s32() {
+ let a: [i32; 9] = [0, 1, 1, 2, 3, 1, 4, 3, 5];
+ let e: [i32x4; 2] = [i32x4::new(1, 1, 1, 1), i32x4::new(1, 1, 1, 1)];
+ let r: [i32x4; 2] = transmute(vld2q_dup_s32(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2_dup_s64() {
+ let a: [i64; 3] = [0, 1, 1];
+ let e: [i64x1; 2] = [i64x1::new(1), i64x1::new(1)];
+ let r: [i64x1; 2] = transmute(vld2_dup_s64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2_dup_u8() {
+ let a: [u8; 17] = [0, 1, 1, 2, 3, 1, 4, 3, 5, 1, 6, 3, 7, 4, 8, 5, 9];
+ let e: [u8x8; 2] = [u8x8::new(1, 1, 1, 1, 1, 1, 1, 1), u8x8::new(1, 1, 1, 1, 1, 1, 1, 1)];
+ let r: [u8x8; 2] = transmute(vld2_dup_u8(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2_dup_u16() {
+ let a: [u16; 9] = [0, 1, 1, 2, 3, 1, 4, 3, 5];
+ let e: [u16x4; 2] = [u16x4::new(1, 1, 1, 1), u16x4::new(1, 1, 1, 1)];
+ let r: [u16x4; 2] = transmute(vld2_dup_u16(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2_dup_u32() {
+ let a: [u32; 5] = [0, 1, 1, 2, 3];
+ let e: [u32x2; 2] = [u32x2::new(1, 1), u32x2::new(1, 1)];
+ let r: [u32x2; 2] = transmute(vld2_dup_u32(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2q_dup_u8() {
+ let a: [u8; 33] = [0, 1, 1, 2, 3, 1, 4, 3, 5, 1, 6, 3, 7, 4, 8, 5, 9, 2, 10, 3, 11, 4, 12, 5, 13, 6, 14, 7, 15, 8, 16, 9, 17];
+ let e: [u8x16; 2] = [u8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), u8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)];
+ let r: [u8x16; 2] = transmute(vld2q_dup_u8(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2q_dup_u16() {
+ let a: [u16; 17] = [0, 1, 1, 2, 3, 1, 4, 3, 5, 1, 6, 3, 7, 4, 8, 5, 9];
+ let e: [u16x8; 2] = [u16x8::new(1, 1, 1, 1, 1, 1, 1, 1), u16x8::new(1, 1, 1, 1, 1, 1, 1, 1)];
+ let r: [u16x8; 2] = transmute(vld2q_dup_u16(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2q_dup_u32() {
+ let a: [u32; 9] = [0, 1, 1, 2, 3, 1, 4, 3, 5];
+ let e: [u32x4; 2] = [u32x4::new(1, 1, 1, 1), u32x4::new(1, 1, 1, 1)];
+ let r: [u32x4; 2] = transmute(vld2q_dup_u32(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2_dup_p8() {
+ let a: [u8; 17] = [0, 1, 1, 2, 3, 1, 4, 3, 5, 1, 6, 3, 7, 4, 8, 5, 9];
+ let e: [i8x8; 2] = [i8x8::new(1, 1, 1, 1, 1, 1, 1, 1), i8x8::new(1, 1, 1, 1, 1, 1, 1, 1)];
+ let r: [i8x8; 2] = transmute(vld2_dup_p8(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2_dup_p16() {
+ let a: [u16; 9] = [0, 1, 1, 2, 3, 1, 4, 3, 5];
+ let e: [i16x4; 2] = [i16x4::new(1, 1, 1, 1), i16x4::new(1, 1, 1, 1)];
+ let r: [i16x4; 2] = transmute(vld2_dup_p16(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2q_dup_p8() {
+ let a: [u8; 33] = [0, 1, 1, 2, 3, 1, 4, 3, 5, 1, 6, 3, 7, 4, 8, 5, 9, 2, 10, 3, 11, 4, 12, 5, 13, 6, 14, 7, 15, 8, 16, 9, 17];
+ let e: [i8x16; 2] = [i8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), i8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)];
+ let r: [i8x16; 2] = transmute(vld2q_dup_p8(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2q_dup_p16() {
+ let a: [u16; 17] = [0, 1, 1, 2, 3, 1, 4, 3, 5, 1, 6, 3, 7, 4, 8, 5, 9];
+ let e: [i16x8; 2] = [i16x8::new(1, 1, 1, 1, 1, 1, 1, 1), i16x8::new(1, 1, 1, 1, 1, 1, 1, 1)];
+ let r: [i16x8; 2] = transmute(vld2q_dup_p16(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2_dup_u64() {
+ let a: [u64; 3] = [0, 1, 1];
+ let e: [u64x1; 2] = [u64x1::new(1), u64x1::new(1)];
+ let r: [u64x1; 2] = transmute(vld2_dup_u64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2_dup_p64() {
+ let a: [u64; 3] = [0, 1, 1];
+ let e: [i64x1; 2] = [i64x1::new(1), i64x1::new(1)];
+ let r: [i64x1; 2] = transmute(vld2_dup_p64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2_dup_f32() {
+ let a: [f32; 5] = [0., 1., 1., 2., 3.];
+ let e: [f32x2; 2] = [f32x2::new(1., 1.), f32x2::new(1., 1.)];
+ let r: [f32x2; 2] = transmute(vld2_dup_f32(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2q_dup_f32() {
+ let a: [f32; 9] = [0., 1., 1., 2., 3., 1., 4., 3., 5.];
+ let e: [f32x4; 2] = [f32x4::new(1., 1., 1., 1.), f32x4::new(1., 1., 1., 1.)];
+ let r: [f32x4; 2] = transmute(vld2q_dup_f32(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2_lane_s8() {
+ let a: [i8; 17] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8];
+ let b: [i8x8; 2] = [i8x8::new(0, 2, 2, 14, 2, 16, 17, 18), i8x8::new(2, 20, 21, 22, 23, 24, 25, 26)];
+ let e: [i8x8; 2] = [i8x8::new(1, 2, 2, 14, 2, 16, 17, 18), i8x8::new(2, 20, 21, 22, 23, 24, 25, 26)];
+ let r: [i8x8; 2] = transmute(vld2_lane_s8::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2_lane_s16() {
+ let a: [i16; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
+ let b: [i16x4; 2] = [i16x4::new(0, 2, 2, 14), i16x4::new(2, 16, 17, 18)];
+ let e: [i16x4; 2] = [i16x4::new(1, 2, 2, 14), i16x4::new(2, 16, 17, 18)];
+ let r: [i16x4; 2] = transmute(vld2_lane_s16::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2_lane_s32() {
+ let a: [i32; 5] = [0, 1, 2, 3, 4];
+ let b: [i32x2; 2] = [i32x2::new(0, 2), i32x2::new(2, 14)];
+ let e: [i32x2; 2] = [i32x2::new(1, 2), i32x2::new(2, 14)];
+ let r: [i32x2; 2] = transmute(vld2_lane_s32::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2q_lane_s16() {
+ let a: [i16; 17] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8];
+ let b: [i16x8; 2] = [i16x8::new(0, 2, 2, 14, 2, 16, 17, 18), i16x8::new(2, 20, 21, 22, 23, 24, 25, 26)];
+ let e: [i16x8; 2] = [i16x8::new(1, 2, 2, 14, 2, 16, 17, 18), i16x8::new(2, 20, 21, 22, 23, 24, 25, 26)];
+ let r: [i16x8; 2] = transmute(vld2q_lane_s16::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2q_lane_s32() {
+ let a: [i32; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
+ let b: [i32x4; 2] = [i32x4::new(0, 2, 2, 14), i32x4::new(2, 16, 17, 18)];
+ let e: [i32x4; 2] = [i32x4::new(1, 2, 2, 14), i32x4::new(2, 16, 17, 18)];
+ let r: [i32x4; 2] = transmute(vld2q_lane_s32::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2_lane_u8() {
+ let a: [u8; 17] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8];
+ let b: [u8x8; 2] = [u8x8::new(0, 2, 2, 14, 2, 16, 17, 18), u8x8::new(2, 20, 21, 22, 23, 24, 25, 26)];
+ let e: [u8x8; 2] = [u8x8::new(1, 2, 2, 14, 2, 16, 17, 18), u8x8::new(2, 20, 21, 22, 23, 24, 25, 26)];
+ let r: [u8x8; 2] = transmute(vld2_lane_u8::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2_lane_u16() {
+ let a: [u16; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
+ let b: [u16x4; 2] = [u16x4::new(0, 2, 2, 14), u16x4::new(2, 16, 17, 18)];
+ let e: [u16x4; 2] = [u16x4::new(1, 2, 2, 14), u16x4::new(2, 16, 17, 18)];
+ let r: [u16x4; 2] = transmute(vld2_lane_u16::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2_lane_u32() {
+ let a: [u32; 5] = [0, 1, 2, 3, 4];
+ let b: [u32x2; 2] = [u32x2::new(0, 2), u32x2::new(2, 14)];
+ let e: [u32x2; 2] = [u32x2::new(1, 2), u32x2::new(2, 14)];
+ let r: [u32x2; 2] = transmute(vld2_lane_u32::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2q_lane_u16() {
+ let a: [u16; 17] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8];
+ let b: [u16x8; 2] = [u16x8::new(0, 2, 2, 14, 2, 16, 17, 18), u16x8::new(2, 20, 21, 22, 23, 24, 25, 26)];
+ let e: [u16x8; 2] = [u16x8::new(1, 2, 2, 14, 2, 16, 17, 18), u16x8::new(2, 20, 21, 22, 23, 24, 25, 26)];
+ let r: [u16x8; 2] = transmute(vld2q_lane_u16::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2q_lane_u32() {
+ let a: [u32; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
+ let b: [u32x4; 2] = [u32x4::new(0, 2, 2, 14), u32x4::new(2, 16, 17, 18)];
+ let e: [u32x4; 2] = [u32x4::new(1, 2, 2, 14), u32x4::new(2, 16, 17, 18)];
+ let r: [u32x4; 2] = transmute(vld2q_lane_u32::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2_lane_p8() {
+ let a: [u8; 17] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8];
+ let b: [i8x8; 2] = [i8x8::new(0, 2, 2, 14, 2, 16, 17, 18), i8x8::new(2, 20, 21, 22, 23, 24, 25, 26)];
+ let e: [i8x8; 2] = [i8x8::new(1, 2, 2, 14, 2, 16, 17, 18), i8x8::new(2, 20, 21, 22, 23, 24, 25, 26)];
+ let r: [i8x8; 2] = transmute(vld2_lane_p8::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2_lane_p16() {
+ let a: [u16; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
+ let b: [i16x4; 2] = [i16x4::new(0, 2, 2, 14), i16x4::new(2, 16, 17, 18)];
+ let e: [i16x4; 2] = [i16x4::new(1, 2, 2, 14), i16x4::new(2, 16, 17, 18)];
+ let r: [i16x4; 2] = transmute(vld2_lane_p16::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2q_lane_p16() {
+ let a: [u16; 17] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8];
+ let b: [i16x8; 2] = [i16x8::new(0, 2, 2, 14, 2, 16, 17, 18), i16x8::new(2, 20, 21, 22, 23, 24, 25, 26)];
+ let e: [i16x8; 2] = [i16x8::new(1, 2, 2, 14, 2, 16, 17, 18), i16x8::new(2, 20, 21, 22, 23, 24, 25, 26)];
+ let r: [i16x8; 2] = transmute(vld2q_lane_p16::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2_lane_f32() {
+ let a: [f32; 5] = [0., 1., 2., 3., 4.];
+ let b: [f32x2; 2] = [f32x2::new(0., 2.), f32x2::new(2., 14.)];
+ let e: [f32x2; 2] = [f32x2::new(1., 2.), f32x2::new(2., 14.)];
+ let r: [f32x2; 2] = transmute(vld2_lane_f32::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld2q_lane_f32() {
+ let a: [f32; 9] = [0., 1., 2., 3., 4., 5., 6., 7., 8.];
+ let b: [f32x4; 2] = [f32x4::new(0., 2., 2., 14.), f32x4::new(2., 16., 17., 18.)];
+ let e: [f32x4; 2] = [f32x4::new(1., 2., 2., 14.), f32x4::new(2., 16., 17., 18.)];
+ let r: [f32x4; 2] = transmute(vld2q_lane_f32::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3_s8() {
+ let a: [i8; 25] = [0, 1, 2, 2, 2, 4, 4, 2, 7, 7, 4, 8, 8, 2, 13, 13, 4, 14, 14, 7, 15, 15, 8, 16, 16];
+ let e: [i8x8; 3] = [i8x8::new(1, 2, 2, 4, 2, 4, 7, 8), i8x8::new(2, 4, 7, 8, 13, 14, 15, 16), i8x8::new(2, 4, 7, 8, 13, 14, 15, 16)];
+ let r: [i8x8; 3] = transmute(vld3_s8(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3_s16() {
+ let a: [i16; 13] = [0, 1, 2, 2, 2, 4, 4, 2, 7, 7, 4, 8, 8];
+ let e: [i16x4; 3] = [i16x4::new(1, 2, 2, 4), i16x4::new(2, 4, 7, 8), i16x4::new(2, 4, 7, 8)];
+ let r: [i16x4; 3] = transmute(vld3_s16(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3_s32() {
+ let a: [i32; 7] = [0, 1, 2, 2, 2, 4, 4];
+ let e: [i32x2; 3] = [i32x2::new(1, 2), i32x2::new(2, 4), i32x2::new(2, 4)];
+ let r: [i32x2; 3] = transmute(vld3_s32(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3q_s8() {
+ let a: [i8; 49] = [0, 1, 2, 2, 2, 4, 4, 2, 7, 7, 4, 8, 8, 2, 13, 13, 4, 14, 14, 7, 15, 15, 8, 16, 16, 2, 25, 41, 4, 26, 42, 7, 27, 43, 8, 28, 44, 13, 29, 45, 14, 30, 46, 15, 31, 47, 16, 32, 48];
+ let e: [i8x16; 3] = [i8x16::new(1, 2, 2, 4, 2, 4, 7, 8, 2, 4, 7, 8, 13, 14, 15, 16), i8x16::new(2, 4, 7, 8, 13, 14, 15, 16, 25, 26, 27, 28, 29, 30, 31, 32), i8x16::new(2, 4, 7, 8, 13, 14, 15, 16, 41, 42, 43, 44, 45, 46, 47, 48)];
+ let r: [i8x16; 3] = transmute(vld3q_s8(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3q_s16() {
+ let a: [i16; 25] = [0, 1, 2, 2, 2, 4, 4, 2, 7, 7, 4, 8, 8, 2, 13, 13, 4, 14, 14, 7, 15, 15, 8, 16, 16];
+ let e: [i16x8; 3] = [i16x8::new(1, 2, 2, 4, 2, 4, 7, 8), i16x8::new(2, 4, 7, 8, 13, 14, 15, 16), i16x8::new(2, 4, 7, 8, 13, 14, 15, 16)];
+ let r: [i16x8; 3] = transmute(vld3q_s16(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3q_s32() {
+ let a: [i32; 13] = [0, 1, 2, 2, 2, 4, 4, 2, 7, 7, 4, 8, 8];
+ let e: [i32x4; 3] = [i32x4::new(1, 2, 2, 4), i32x4::new(2, 4, 7, 8), i32x4::new(2, 4, 7, 8)];
+ let r: [i32x4; 3] = transmute(vld3q_s32(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3_s64() {
+ let a: [i64; 4] = [0, 1, 2, 2];
+ let e: [i64x1; 3] = [i64x1::new(1), i64x1::new(2), i64x1::new(2)];
+ let r: [i64x1; 3] = transmute(vld3_s64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3_u8() {
+ let a: [u8; 25] = [0, 1, 2, 2, 2, 4, 4, 2, 7, 7, 4, 8, 8, 2, 13, 13, 4, 14, 14, 7, 15, 15, 8, 16, 16];
+ let e: [u8x8; 3] = [u8x8::new(1, 2, 2, 4, 2, 4, 7, 8), u8x8::new(2, 4, 7, 8, 13, 14, 15, 16), u8x8::new(2, 4, 7, 8, 13, 14, 15, 16)];
+ let r: [u8x8; 3] = transmute(vld3_u8(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3_u16() {
+ let a: [u16; 13] = [0, 1, 2, 2, 2, 4, 4, 2, 7, 7, 4, 8, 8];
+ let e: [u16x4; 3] = [u16x4::new(1, 2, 2, 4), u16x4::new(2, 4, 7, 8), u16x4::new(2, 4, 7, 8)];
+ let r: [u16x4; 3] = transmute(vld3_u16(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3_u32() {
+ let a: [u32; 7] = [0, 1, 2, 2, 2, 4, 4];
+ let e: [u32x2; 3] = [u32x2::new(1, 2), u32x2::new(2, 4), u32x2::new(2, 4)];
+ let r: [u32x2; 3] = transmute(vld3_u32(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3q_u8() {
+ let a: [u8; 49] = [0, 1, 2, 2, 2, 4, 4, 2, 7, 7, 4, 8, 8, 2, 13, 13, 4, 14, 14, 7, 15, 15, 8, 16, 16, 2, 25, 41, 4, 26, 42, 7, 27, 43, 8, 28, 44, 13, 29, 45, 14, 30, 46, 15, 31, 47, 16, 32, 48];
+ let e: [u8x16; 3] = [u8x16::new(1, 2, 2, 4, 2, 4, 7, 8, 2, 4, 7, 8, 13, 14, 15, 16), u8x16::new(2, 4, 7, 8, 13, 14, 15, 16, 25, 26, 27, 28, 29, 30, 31, 32), u8x16::new(2, 4, 7, 8, 13, 14, 15, 16, 41, 42, 43, 44, 45, 46, 47, 48)];
+ let r: [u8x16; 3] = transmute(vld3q_u8(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3q_u16() {
+ let a: [u16; 25] = [0, 1, 2, 2, 2, 4, 4, 2, 7, 7, 4, 8, 8, 2, 13, 13, 4, 14, 14, 7, 15, 15, 8, 16, 16];
+ let e: [u16x8; 3] = [u16x8::new(1, 2, 2, 4, 2, 4, 7, 8), u16x8::new(2, 4, 7, 8, 13, 14, 15, 16), u16x8::new(2, 4, 7, 8, 13, 14, 15, 16)];
+ let r: [u16x8; 3] = transmute(vld3q_u16(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3q_u32() {
+ let a: [u32; 13] = [0, 1, 2, 2, 2, 4, 4, 2, 7, 7, 4, 8, 8];
+ let e: [u32x4; 3] = [u32x4::new(1, 2, 2, 4), u32x4::new(2, 4, 7, 8), u32x4::new(2, 4, 7, 8)];
+ let r: [u32x4; 3] = transmute(vld3q_u32(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3_p8() {
+ let a: [u8; 25] = [0, 1, 2, 2, 2, 4, 4, 2, 7, 7, 4, 8, 8, 2, 13, 13, 4, 14, 14, 7, 15, 15, 8, 16, 16];
+ let e: [i8x8; 3] = [i8x8::new(1, 2, 2, 4, 2, 4, 7, 8), i8x8::new(2, 4, 7, 8, 13, 14, 15, 16), i8x8::new(2, 4, 7, 8, 13, 14, 15, 16)];
+ let r: [i8x8; 3] = transmute(vld3_p8(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3_p16() {
+ let a: [u16; 13] = [0, 1, 2, 2, 2, 4, 4, 2, 7, 7, 4, 8, 8];
+ let e: [i16x4; 3] = [i16x4::new(1, 2, 2, 4), i16x4::new(2, 4, 7, 8), i16x4::new(2, 4, 7, 8)];
+ let r: [i16x4; 3] = transmute(vld3_p16(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3q_p8() {
+ let a: [u8; 49] = [0, 1, 2, 2, 2, 4, 4, 2, 7, 7, 4, 8, 8, 2, 13, 13, 4, 14, 14, 7, 15, 15, 8, 16, 16, 2, 25, 41, 4, 26, 42, 7, 27, 43, 8, 28, 44, 13, 29, 45, 14, 30, 46, 15, 31, 47, 16, 32, 48];
+ let e: [i8x16; 3] = [i8x16::new(1, 2, 2, 4, 2, 4, 7, 8, 2, 4, 7, 8, 13, 14, 15, 16), i8x16::new(2, 4, 7, 8, 13, 14, 15, 16, 25, 26, 27, 28, 29, 30, 31, 32), i8x16::new(2, 4, 7, 8, 13, 14, 15, 16, 41, 42, 43, 44, 45, 46, 47, 48)];
+ let r: [i8x16; 3] = transmute(vld3q_p8(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3q_p16() {
+ let a: [u16; 25] = [0, 1, 2, 2, 2, 4, 4, 2, 7, 7, 4, 8, 8, 2, 13, 13, 4, 14, 14, 7, 15, 15, 8, 16, 16];
+ let e: [i16x8; 3] = [i16x8::new(1, 2, 2, 4, 2, 4, 7, 8), i16x8::new(2, 4, 7, 8, 13, 14, 15, 16), i16x8::new(2, 4, 7, 8, 13, 14, 15, 16)];
+ let r: [i16x8; 3] = transmute(vld3q_p16(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3_u64() {
+ let a: [u64; 4] = [0, 1, 2, 2];
+ let e: [u64x1; 3] = [u64x1::new(1), u64x1::new(2), u64x1::new(2)];
+ let r: [u64x1; 3] = transmute(vld3_u64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3_p64() {
+ let a: [u64; 4] = [0, 1, 2, 2];
+ let e: [i64x1; 3] = [i64x1::new(1), i64x1::new(2), i64x1::new(2)];
+ let r: [i64x1; 3] = transmute(vld3_p64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3_f32() {
+ let a: [f32; 7] = [0., 1., 2., 2., 2., 4., 4.];
+ let e: [f32x2; 3] = [f32x2::new(1., 2.), f32x2::new(2., 4.), f32x2::new(2., 4.)];
+ let r: [f32x2; 3] = transmute(vld3_f32(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3q_f32() {
+ let a: [f32; 13] = [0., 1., 2., 2., 2., 4., 4., 2., 7., 7., 4., 8., 8.];
+ let e: [f32x4; 3] = [f32x4::new(1., 2., 2., 4.), f32x4::new(2., 4., 7., 8.), f32x4::new(2., 4., 7., 8.)];
+ let r: [f32x4; 3] = transmute(vld3q_f32(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3_dup_s8() {
+ let a: [i8; 25] = [0, 1, 1, 1, 3, 1, 4, 3, 5, 1, 6, 3, 7, 4, 8, 5, 9, 2, 10, 3, 11, 4, 12, 5, 13];
+ let e: [i8x8; 3] = [i8x8::new(1, 1, 1, 1, 1, 1, 1, 1), i8x8::new(1, 1, 1, 1, 1, 1, 1, 1), i8x8::new(1, 1, 1, 1, 1, 1, 1, 1)];
+ let r: [i8x8; 3] = transmute(vld3_dup_s8(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3_dup_s16() {
+ let a: [i16; 13] = [0, 1, 1, 1, 3, 1, 4, 3, 5, 1, 6, 3, 7];
+ let e: [i16x4; 3] = [i16x4::new(1, 1, 1, 1), i16x4::new(1, 1, 1, 1), i16x4::new(1, 1, 1, 1)];
+ let r: [i16x4; 3] = transmute(vld3_dup_s16(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3_dup_s32() {
+ let a: [i32; 7] = [0, 1, 1, 1, 3, 1, 4];
+ let e: [i32x2; 3] = [i32x2::new(1, 1), i32x2::new(1, 1), i32x2::new(1, 1)];
+ let r: [i32x2; 3] = transmute(vld3_dup_s32(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3q_dup_s8() {
+ let a: [i8; 49] = [0, 1, 1, 1, 3, 1, 4, 3, 5, 1, 6, 3, 7, 4, 8, 5, 9, 2, 10, 3, 11, 4, 12, 5, 13, 6, 14, 7, 15, 8, 16, 9, 17, 6, 14, 7, 15, 8, 16, 9, 17, 6, 14, 7, 15, 8, 16, 9, 17];
+ let e: [i8x16; 3] = [i8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), i8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), i8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)];
+ let r: [i8x16; 3] = transmute(vld3q_dup_s8(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3q_dup_s16() {
+ let a: [i16; 25] = [0, 1, 1, 1, 3, 1, 4, 3, 5, 1, 6, 3, 7, 4, 8, 5, 9, 2, 10, 3, 11, 4, 12, 5, 13];
+ let e: [i16x8; 3] = [i16x8::new(1, 1, 1, 1, 1, 1, 1, 1), i16x8::new(1, 1, 1, 1, 1, 1, 1, 1), i16x8::new(1, 1, 1, 1, 1, 1, 1, 1)];
+ let r: [i16x8; 3] = transmute(vld3q_dup_s16(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3q_dup_s32() {
+ let a: [i32; 13] = [0, 1, 1, 1, 3, 1, 4, 3, 5, 1, 6, 3, 7];
+ let e: [i32x4; 3] = [i32x4::new(1, 1, 1, 1), i32x4::new(1, 1, 1, 1), i32x4::new(1, 1, 1, 1)];
+ let r: [i32x4; 3] = transmute(vld3q_dup_s32(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3_dup_s64() {
+ let a: [i64; 4] = [0, 1, 1, 1];
+ let e: [i64x1; 3] = [i64x1::new(1), i64x1::new(1), i64x1::new(1)];
+ let r: [i64x1; 3] = transmute(vld3_dup_s64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3_dup_u8() {
+ let a: [u8; 25] = [0, 1, 1, 1, 3, 1, 4, 3, 5, 1, 6, 3, 7, 4, 8, 5, 9, 2, 10, 3, 11, 4, 12, 5, 13];
+ let e: [u8x8; 3] = [u8x8::new(1, 1, 1, 1, 1, 1, 1, 1), u8x8::new(1, 1, 1, 1, 1, 1, 1, 1), u8x8::new(1, 1, 1, 1, 1, 1, 1, 1)];
+ let r: [u8x8; 3] = transmute(vld3_dup_u8(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3_dup_u16() {
+ let a: [u16; 13] = [0, 1, 1, 1, 3, 1, 4, 3, 5, 1, 6, 3, 7];
+ let e: [u16x4; 3] = [u16x4::new(1, 1, 1, 1), u16x4::new(1, 1, 1, 1), u16x4::new(1, 1, 1, 1)];
+ let r: [u16x4; 3] = transmute(vld3_dup_u16(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3_dup_u32() {
+ let a: [u32; 7] = [0, 1, 1, 1, 3, 1, 4];
+ let e: [u32x2; 3] = [u32x2::new(1, 1), u32x2::new(1, 1), u32x2::new(1, 1)];
+ let r: [u32x2; 3] = transmute(vld3_dup_u32(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3q_dup_u8() {
+ let a: [u8; 49] = [0, 1, 1, 1, 3, 1, 4, 3, 5, 1, 6, 3, 7, 4, 8, 5, 9, 2, 10, 3, 11, 4, 12, 5, 13, 6, 14, 7, 15, 8, 16, 9, 17, 6, 14, 7, 15, 8, 16, 9, 17, 6, 14, 7, 15, 8, 16, 9, 17];
+ let e: [u8x16; 3] = [u8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), u8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), u8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)];
+ let r: [u8x16; 3] = transmute(vld3q_dup_u8(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3q_dup_u16() {
+ let a: [u16; 25] = [0, 1, 1, 1, 3, 1, 4, 3, 5, 1, 6, 3, 7, 4, 8, 5, 9, 2, 10, 3, 11, 4, 12, 5, 13];
+ let e: [u16x8; 3] = [u16x8::new(1, 1, 1, 1, 1, 1, 1, 1), u16x8::new(1, 1, 1, 1, 1, 1, 1, 1), u16x8::new(1, 1, 1, 1, 1, 1, 1, 1)];
+ let r: [u16x8; 3] = transmute(vld3q_dup_u16(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3q_dup_u32() {
+ let a: [u32; 13] = [0, 1, 1, 1, 3, 1, 4, 3, 5, 1, 6, 3, 7];
+ let e: [u32x4; 3] = [u32x4::new(1, 1, 1, 1), u32x4::new(1, 1, 1, 1), u32x4::new(1, 1, 1, 1)];
+ let r: [u32x4; 3] = transmute(vld3q_dup_u32(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3_dup_p8() {
+ let a: [u8; 25] = [0, 1, 1, 1, 3, 1, 4, 3, 5, 1, 6, 3, 7, 4, 8, 5, 9, 2, 10, 3, 11, 4, 12, 5, 13];
+ let e: [i8x8; 3] = [i8x8::new(1, 1, 1, 1, 1, 1, 1, 1), i8x8::new(1, 1, 1, 1, 1, 1, 1, 1), i8x8::new(1, 1, 1, 1, 1, 1, 1, 1)];
+ let r: [i8x8; 3] = transmute(vld3_dup_p8(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3_dup_p16() {
+ let a: [u16; 13] = [0, 1, 1, 1, 3, 1, 4, 3, 5, 1, 6, 3, 7];
+ let e: [i16x4; 3] = [i16x4::new(1, 1, 1, 1), i16x4::new(1, 1, 1, 1), i16x4::new(1, 1, 1, 1)];
+ let r: [i16x4; 3] = transmute(vld3_dup_p16(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3q_dup_p8() {
+ let a: [u8; 49] = [0, 1, 1, 1, 3, 1, 4, 3, 5, 1, 6, 3, 7, 4, 8, 5, 9, 2, 10, 3, 11, 4, 12, 5, 13, 6, 14, 7, 15, 8, 16, 9, 17, 6, 14, 7, 15, 8, 16, 9, 17, 6, 14, 7, 15, 8, 16, 9, 17];
+ let e: [i8x16; 3] = [i8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), i8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), i8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)];
+ let r: [i8x16; 3] = transmute(vld3q_dup_p8(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3q_dup_p16() {
+ let a: [u16; 25] = [0, 1, 1, 1, 3, 1, 4, 3, 5, 1, 6, 3, 7, 4, 8, 5, 9, 2, 10, 3, 11, 4, 12, 5, 13];
+ let e: [i16x8; 3] = [i16x8::new(1, 1, 1, 1, 1, 1, 1, 1), i16x8::new(1, 1, 1, 1, 1, 1, 1, 1), i16x8::new(1, 1, 1, 1, 1, 1, 1, 1)];
+ let r: [i16x8; 3] = transmute(vld3q_dup_p16(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3_dup_u64() {
+ let a: [u64; 4] = [0, 1, 1, 1];
+ let e: [u64x1; 3] = [u64x1::new(1), u64x1::new(1), u64x1::new(1)];
+ let r: [u64x1; 3] = transmute(vld3_dup_u64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3_dup_p64() {
+ let a: [u64; 4] = [0, 1, 1, 1];
+ let e: [i64x1; 3] = [i64x1::new(1), i64x1::new(1), i64x1::new(1)];
+ let r: [i64x1; 3] = transmute(vld3_dup_p64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3_dup_f32() {
+ let a: [f32; 7] = [0., 1., 1., 1., 3., 1., 4.];
+ let e: [f32x2; 3] = [f32x2::new(1., 1.), f32x2::new(1., 1.), f32x2::new(1., 1.)];
+ let r: [f32x2; 3] = transmute(vld3_dup_f32(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3q_dup_f32() {
+ let a: [f32; 13] = [0., 1., 1., 1., 3., 1., 4., 3., 5., 1., 4., 3., 5.];
+ let e: [f32x4; 3] = [f32x4::new(1., 1., 1., 1.), f32x4::new(1., 1., 1., 1.), f32x4::new(1., 1., 1., 1.)];
+ let r: [f32x4; 3] = transmute(vld3q_dup_f32(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3_lane_s8() {
+ let a: [i8; 25] = [0, 1, 2, 2, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8];
+ let b: [i8x8; 3] = [i8x8::new(0, 2, 2, 14, 2, 16, 17, 18), i8x8::new(2, 20, 21, 22, 23, 24, 25, 26), i8x8::new(11, 12, 13, 14, 15, 16, 17, 18)];
+ let e: [i8x8; 3] = [i8x8::new(1, 2, 2, 14, 2, 16, 17, 18), i8x8::new(2, 20, 21, 22, 23, 24, 25, 26), i8x8::new(2, 12, 13, 14, 15, 16, 17, 18)];
+ let r: [i8x8; 3] = transmute(vld3_lane_s8::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3_lane_s16() {
+ let a: [i16; 13] = [0, 1, 2, 2, 4, 5, 6, 7, 8, 1, 2, 3, 4];
+ let b: [i16x4; 3] = [i16x4::new(0, 2, 2, 14), i16x4::new(2, 16, 17, 18), i16x4::new(2, 20, 21, 22)];
+ let e: [i16x4; 3] = [i16x4::new(1, 2, 2, 14), i16x4::new(2, 16, 17, 18), i16x4::new(2, 20, 21, 22)];
+ let r: [i16x4; 3] = transmute(vld3_lane_s16::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3_lane_s32() {
+ let a: [i32; 7] = [0, 1, 2, 2, 4, 5, 6];
+ let b: [i32x2; 3] = [i32x2::new(0, 2), i32x2::new(2, 14), i32x2::new(2, 16)];
+ let e: [i32x2; 3] = [i32x2::new(1, 2), i32x2::new(2, 14), i32x2::new(2, 16)];
+ let r: [i32x2; 3] = transmute(vld3_lane_s32::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3q_lane_s16() {
+ let a: [i16; 25] = [0, 1, 2, 2, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8];
+ let b: [i16x8; 3] = [i16x8::new(0, 2, 2, 14, 2, 16, 17, 18), i16x8::new(2, 20, 21, 22, 23, 24, 25, 26), i16x8::new(11, 12, 13, 14, 15, 16, 17, 18)];
+ let e: [i16x8; 3] = [i16x8::new(1, 2, 2, 14, 2, 16, 17, 18), i16x8::new(2, 20, 21, 22, 23, 24, 25, 26), i16x8::new(2, 12, 13, 14, 15, 16, 17, 18)];
+ let r: [i16x8; 3] = transmute(vld3q_lane_s16::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3q_lane_s32() {
+ let a: [i32; 13] = [0, 1, 2, 2, 4, 5, 6, 7, 8, 1, 2, 3, 4];
+ let b: [i32x4; 3] = [i32x4::new(0, 2, 2, 14), i32x4::new(2, 16, 17, 18), i32x4::new(2, 20, 21, 22)];
+ let e: [i32x4; 3] = [i32x4::new(1, 2, 2, 14), i32x4::new(2, 16, 17, 18), i32x4::new(2, 20, 21, 22)];
+ let r: [i32x4; 3] = transmute(vld3q_lane_s32::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3_lane_u8() {
+ let a: [u8; 25] = [0, 1, 2, 2, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8];
+ let b: [u8x8; 3] = [u8x8::new(0, 2, 2, 14, 2, 16, 17, 18), u8x8::new(2, 20, 21, 22, 23, 24, 25, 26), u8x8::new(11, 12, 13, 14, 15, 16, 17, 18)];
+ let e: [u8x8; 3] = [u8x8::new(1, 2, 2, 14, 2, 16, 17, 18), u8x8::new(2, 20, 21, 22, 23, 24, 25, 26), u8x8::new(2, 12, 13, 14, 15, 16, 17, 18)];
+ let r: [u8x8; 3] = transmute(vld3_lane_u8::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3_lane_u16() {
+ let a: [u16; 13] = [0, 1, 2, 2, 4, 5, 6, 7, 8, 1, 2, 3, 4];
+ let b: [u16x4; 3] = [u16x4::new(0, 2, 2, 14), u16x4::new(2, 16, 17, 18), u16x4::new(2, 20, 21, 22)];
+ let e: [u16x4; 3] = [u16x4::new(1, 2, 2, 14), u16x4::new(2, 16, 17, 18), u16x4::new(2, 20, 21, 22)];
+ let r: [u16x4; 3] = transmute(vld3_lane_u16::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3_lane_u32() {
+ let a: [u32; 7] = [0, 1, 2, 2, 4, 5, 6];
+ let b: [u32x2; 3] = [u32x2::new(0, 2), u32x2::new(2, 14), u32x2::new(2, 16)];
+ let e: [u32x2; 3] = [u32x2::new(1, 2), u32x2::new(2, 14), u32x2::new(2, 16)];
+ let r: [u32x2; 3] = transmute(vld3_lane_u32::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3q_lane_u16() {
+ let a: [u16; 25] = [0, 1, 2, 2, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8];
+ let b: [u16x8; 3] = [u16x8::new(0, 2, 2, 14, 2, 16, 17, 18), u16x8::new(2, 20, 21, 22, 23, 24, 25, 26), u16x8::new(11, 12, 13, 14, 15, 16, 17, 18)];
+ let e: [u16x8; 3] = [u16x8::new(1, 2, 2, 14, 2, 16, 17, 18), u16x8::new(2, 20, 21, 22, 23, 24, 25, 26), u16x8::new(2, 12, 13, 14, 15, 16, 17, 18)];
+ let r: [u16x8; 3] = transmute(vld3q_lane_u16::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3q_lane_u32() {
+ let a: [u32; 13] = [0, 1, 2, 2, 4, 5, 6, 7, 8, 1, 2, 3, 4];
+ let b: [u32x4; 3] = [u32x4::new(0, 2, 2, 14), u32x4::new(2, 16, 17, 18), u32x4::new(2, 20, 21, 22)];
+ let e: [u32x4; 3] = [u32x4::new(1, 2, 2, 14), u32x4::new(2, 16, 17, 18), u32x4::new(2, 20, 21, 22)];
+ let r: [u32x4; 3] = transmute(vld3q_lane_u32::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3_lane_p8() {
+ let a: [u8; 25] = [0, 1, 2, 2, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8];
+ let b: [i8x8; 3] = [i8x8::new(0, 2, 2, 14, 2, 16, 17, 18), i8x8::new(2, 20, 21, 22, 23, 24, 25, 26), i8x8::new(11, 12, 13, 14, 15, 16, 17, 18)];
+ let e: [i8x8; 3] = [i8x8::new(1, 2, 2, 14, 2, 16, 17, 18), i8x8::new(2, 20, 21, 22, 23, 24, 25, 26), i8x8::new(2, 12, 13, 14, 15, 16, 17, 18)];
+ let r: [i8x8; 3] = transmute(vld3_lane_p8::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3_lane_p16() {
+ let a: [u16; 13] = [0, 1, 2, 2, 4, 5, 6, 7, 8, 1, 2, 3, 4];
+ let b: [i16x4; 3] = [i16x4::new(0, 2, 2, 14), i16x4::new(2, 16, 17, 18), i16x4::new(2, 20, 21, 22)];
+ let e: [i16x4; 3] = [i16x4::new(1, 2, 2, 14), i16x4::new(2, 16, 17, 18), i16x4::new(2, 20, 21, 22)];
+ let r: [i16x4; 3] = transmute(vld3_lane_p16::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3q_lane_p16() {
+ let a: [u16; 25] = [0, 1, 2, 2, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8];
+ let b: [i16x8; 3] = [i16x8::new(0, 2, 2, 14, 2, 16, 17, 18), i16x8::new(2, 20, 21, 22, 23, 24, 25, 26), i16x8::new(11, 12, 13, 14, 15, 16, 17, 18)];
+ let e: [i16x8; 3] = [i16x8::new(1, 2, 2, 14, 2, 16, 17, 18), i16x8::new(2, 20, 21, 22, 23, 24, 25, 26), i16x8::new(2, 12, 13, 14, 15, 16, 17, 18)];
+ let r: [i16x8; 3] = transmute(vld3q_lane_p16::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3_lane_f32() {
+ let a: [f32; 7] = [0., 1., 2., 2., 4., 5., 6.];
+ let b: [f32x2; 3] = [f32x2::new(0., 2.), f32x2::new(2., 14.), f32x2::new(9., 16.)];
+ let e: [f32x2; 3] = [f32x2::new(1., 2.), f32x2::new(2., 14.), f32x2::new(2., 16.)];
+ let r: [f32x2; 3] = transmute(vld3_lane_f32::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld3q_lane_f32() {
+ let a: [f32; 13] = [0., 1., 2., 2., 4., 5., 6., 7., 8., 5., 6., 7., 8.];
+ let b: [f32x4; 3] = [f32x4::new(0., 2., 2., 14.), f32x4::new(9., 16., 17., 18.), f32x4::new(5., 6., 7., 8.)];
+ let e: [f32x4; 3] = [f32x4::new(1., 2., 2., 14.), f32x4::new(2., 16., 17., 18.), f32x4::new(2., 6., 7., 8.)];
+ let r: [f32x4; 3] = transmute(vld3q_lane_f32::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4_s8() {
+ let a: [i8; 33] = [0, 1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 8, 16, 8, 16, 16, 32];
+ let e: [i8x8; 4] = [i8x8::new(1, 2, 2, 6, 2, 6, 6, 8), i8x8::new(2, 6, 6, 8, 6, 8, 8, 16), i8x8::new(2, 6, 6, 8, 6, 8, 8, 16), i8x8::new(6, 8, 8, 16, 8, 16, 16, 32)];
+ let r: [i8x8; 4] = transmute(vld4_s8(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4_s16() {
+ let a: [i16; 17] = [0, 1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16];
+ let e: [i16x4; 4] = [i16x4::new(1, 2, 2, 6), i16x4::new(2, 6, 6, 8), i16x4::new(2, 6, 6, 8), i16x4::new(6, 8, 8, 16)];
+ let r: [i16x4; 4] = transmute(vld4_s16(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4_s32() {
+ let a: [i32; 9] = [0, 1, 2, 2, 6, 2, 6, 6, 8];
+ let e: [i32x2; 4] = [i32x2::new(1, 2), i32x2::new(2, 6), i32x2::new(2, 6), i32x2::new(6, 8)];
+ let r: [i32x2; 4] = transmute(vld4_s32(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4q_s8() {
+ let a: [i8; 65] = [0, 1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 8, 16, 8, 16, 16, 32, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 43, 44, 8, 16, 44, 48, 6, 8, 8, 16, 8, 16, 16, 32, 8, 16, 44, 48, 16, 32, 48, 64];
+ let e: [i8x16; 4] = [i8x16::new(1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16), i8x16::new(2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 8, 16, 8, 16, 16, 32), i8x16::new(2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 43, 44, 8, 16, 44, 48), i8x16::new(6, 8, 8, 16, 8, 16, 16, 32, 8, 16, 44, 48, 16, 32, 48, 64)];
+ let r: [i8x16; 4] = transmute(vld4q_s8(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4q_s16() {
+ let a: [i16; 33] = [0, 1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 8, 16, 8, 16, 16, 32];
+ let e: [i16x8; 4] = [i16x8::new(1, 2, 2, 6, 2, 6, 6, 8), i16x8::new(2, 6, 6, 8, 6, 8, 8, 16), i16x8::new(2, 6, 6, 8, 6, 8, 8, 16), i16x8::new(6, 8, 8, 16, 8, 16, 16, 32)];
+ let r: [i16x8; 4] = transmute(vld4q_s16(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4q_s32() {
+ let a: [i32; 17] = [0, 1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16];
+ let e: [i32x4; 4] = [i32x4::new(1, 2, 2, 6), i32x4::new(2, 6, 6, 8), i32x4::new(2, 6, 6, 8), i32x4::new(6, 8, 8, 16)];
+ let r: [i32x4; 4] = transmute(vld4q_s32(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4_s64() {
+ let a: [i64; 5] = [0, 1, 2, 2, 6];
+ let e: [i64x1; 4] = [i64x1::new(1), i64x1::new(2), i64x1::new(2), i64x1::new(6)];
+ let r: [i64x1; 4] = transmute(vld4_s64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4_u8() {
+ let a: [u8; 33] = [0, 1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 8, 16, 8, 16, 16, 32];
+ let e: [u8x8; 4] = [u8x8::new(1, 2, 2, 6, 2, 6, 6, 8), u8x8::new(2, 6, 6, 8, 6, 8, 8, 16), u8x8::new(2, 6, 6, 8, 6, 8, 8, 16), u8x8::new(6, 8, 8, 16, 8, 16, 16, 32)];
+ let r: [u8x8; 4] = transmute(vld4_u8(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4_u16() {
+ let a: [u16; 17] = [0, 1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16];
+ let e: [u16x4; 4] = [u16x4::new(1, 2, 2, 6), u16x4::new(2, 6, 6, 8), u16x4::new(2, 6, 6, 8), u16x4::new(6, 8, 8, 16)];
+ let r: [u16x4; 4] = transmute(vld4_u16(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4_u32() {
+ let a: [u32; 9] = [0, 1, 2, 2, 6, 2, 6, 6, 8];
+ let e: [u32x2; 4] = [u32x2::new(1, 2), u32x2::new(2, 6), u32x2::new(2, 6), u32x2::new(6, 8)];
+ let r: [u32x2; 4] = transmute(vld4_u32(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4q_u8() {
+ let a: [u8; 65] = [0, 1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 8, 16, 8, 16, 16, 32, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 43, 44, 8, 16, 44, 48, 6, 8, 8, 16, 8, 16, 16, 32, 8, 16, 44, 48, 16, 32, 48, 64];
+ let e: [u8x16; 4] = [u8x16::new(1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16), u8x16::new(2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 8, 16, 8, 16, 16, 32), u8x16::new(2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 43, 44, 8, 16, 44, 48), u8x16::new(6, 8, 8, 16, 8, 16, 16, 32, 8, 16, 44, 48, 16, 32, 48, 64)];
+ let r: [u8x16; 4] = transmute(vld4q_u8(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4q_u16() {
+ let a: [u16; 33] = [0, 1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 8, 16, 8, 16, 16, 32];
+ let e: [u16x8; 4] = [u16x8::new(1, 2, 2, 6, 2, 6, 6, 8), u16x8::new(2, 6, 6, 8, 6, 8, 8, 16), u16x8::new(2, 6, 6, 8, 6, 8, 8, 16), u16x8::new(6, 8, 8, 16, 8, 16, 16, 32)];
+ let r: [u16x8; 4] = transmute(vld4q_u16(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4q_u32() {
+ let a: [u32; 17] = [0, 1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16];
+ let e: [u32x4; 4] = [u32x4::new(1, 2, 2, 6), u32x4::new(2, 6, 6, 8), u32x4::new(2, 6, 6, 8), u32x4::new(6, 8, 8, 16)];
+ let r: [u32x4; 4] = transmute(vld4q_u32(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4_p8() {
+ let a: [u8; 33] = [0, 1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 8, 16, 8, 16, 16, 32];
+ let e: [i8x8; 4] = [i8x8::new(1, 2, 2, 6, 2, 6, 6, 8), i8x8::new(2, 6, 6, 8, 6, 8, 8, 16), i8x8::new(2, 6, 6, 8, 6, 8, 8, 16), i8x8::new(6, 8, 8, 16, 8, 16, 16, 32)];
+ let r: [i8x8; 4] = transmute(vld4_p8(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4_p16() {
+ let a: [u16; 17] = [0, 1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16];
+ let e: [i16x4; 4] = [i16x4::new(1, 2, 2, 6), i16x4::new(2, 6, 6, 8), i16x4::new(2, 6, 6, 8), i16x4::new(6, 8, 8, 16)];
+ let r: [i16x4; 4] = transmute(vld4_p16(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4q_p8() {
+ let a: [u8; 65] = [0, 1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 8, 16, 8, 16, 16, 32, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 43, 44, 8, 16, 44, 48, 6, 8, 8, 16, 8, 16, 16, 32, 8, 16, 44, 48, 16, 32, 48, 64];
+ let e: [i8x16; 4] = [i8x16::new(1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16), i8x16::new(2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 8, 16, 8, 16, 16, 32), i8x16::new(2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 43, 44, 8, 16, 44, 48), i8x16::new(6, 8, 8, 16, 8, 16, 16, 32, 8, 16, 44, 48, 16, 32, 48, 64)];
+ let r: [i8x16; 4] = transmute(vld4q_p8(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4q_p16() {
+ let a: [u16; 33] = [0, 1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 8, 16, 8, 16, 16, 32];
+ let e: [i16x8; 4] = [i16x8::new(1, 2, 2, 6, 2, 6, 6, 8), i16x8::new(2, 6, 6, 8, 6, 8, 8, 16), i16x8::new(2, 6, 6, 8, 6, 8, 8, 16), i16x8::new(6, 8, 8, 16, 8, 16, 16, 32)];
+ let r: [i16x8; 4] = transmute(vld4q_p16(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4_u64() {
+ let a: [u64; 5] = [0, 1, 2, 2, 6];
+ let e: [u64x1; 4] = [u64x1::new(1), u64x1::new(2), u64x1::new(2), u64x1::new(6)];
+ let r: [u64x1; 4] = transmute(vld4_u64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4_p64() {
+ let a: [u64; 5] = [0, 1, 2, 2, 6];
+ let e: [i64x1; 4] = [i64x1::new(1), i64x1::new(2), i64x1::new(2), i64x1::new(6)];
+ let r: [i64x1; 4] = transmute(vld4_p64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4_f32() {
+ let a: [f32; 9] = [0., 1., 2., 2., 6., 2., 6., 6., 8.];
+ let e: [f32x2; 4] = [f32x2::new(1., 2.), f32x2::new(2., 6.), f32x2::new(2., 6.), f32x2::new(6., 8.)];
+ let r: [f32x2; 4] = transmute(vld4_f32(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4q_f32() {
+ let a: [f32; 17] = [0., 1., 2., 2., 6., 2., 6., 6., 8., 2., 6., 6., 8., 6., 8., 15., 16.];
+ let e: [f32x4; 4] = [f32x4::new(1., 2., 2., 6.), f32x4::new(2., 6., 6., 8.), f32x4::new(2., 6., 6., 15.), f32x4::new(6., 8., 8., 16.)];
+ let r: [f32x4; 4] = transmute(vld4q_f32(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4_dup_s8() {
+ let a: [i8; 33] = [0, 1, 1, 1, 1, 2, 4, 3, 5, 8, 6, 3, 7, 4, 8, 5, 9, 8, 6, 3, 7, 4, 8, 5, 9, 8, 6, 3, 7, 4, 8, 5, 9];
+ let e: [i8x8; 4] = [i8x8::new(1, 1, 1, 1, 1, 1, 1, 1), i8x8::new(1, 1, 1, 1, 1, 1, 1, 1), i8x8::new(1, 1, 1, 1, 1, 1, 1, 1), i8x8::new(1, 1, 1, 1, 1, 1, 1, 1)];
+ let r: [i8x8; 4] = transmute(vld4_dup_s8(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4_dup_s16() {
+ let a: [i16; 17] = [0, 1, 1, 1, 1, 2, 4, 3, 5, 8, 6, 3, 7, 4, 8, 5, 9];
+ let e: [i16x4; 4] = [i16x4::new(1, 1, 1, 1), i16x4::new(1, 1, 1, 1), i16x4::new(1, 1, 1, 1), i16x4::new(1, 1, 1, 1)];
+ let r: [i16x4; 4] = transmute(vld4_dup_s16(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4_dup_s32() {
+ let a: [i32; 9] = [0, 1, 1, 1, 1, 2, 4, 3, 5];
+ let e: [i32x2; 4] = [i32x2::new(1, 1), i32x2::new(1, 1), i32x2::new(1, 1), i32x2::new(1, 1)];
+ let r: [i32x2; 4] = transmute(vld4_dup_s32(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4q_dup_s8() {
+ let a: [i8; 65] = [0, 1, 1, 1, 1, 2, 4, 3, 5, 8, 6, 3, 7, 4, 8, 5, 9, 8, 6, 3, 7, 4, 8, 5, 9, 8, 6, 3, 7, 4, 8, 5, 9, 8, 6, 3, 7, 4, 8, 5, 9, 8, 6, 3, 7, 4, 8, 5, 9, 8, 6, 3, 7, 4, 8, 5, 9, 8, 6, 3, 7, 4, 8, 5, 9];
+ let e: [i8x16; 4] = [i8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), i8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), i8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), i8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)];
+ let r: [i8x16; 4] = transmute(vld4q_dup_s8(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4q_dup_s16() {
+ let a: [i16; 33] = [0, 1, 1, 1, 1, 2, 4, 3, 5, 8, 6, 3, 7, 4, 8, 5, 9, 8, 6, 3, 7, 4, 8, 5, 9, 8, 6, 3, 7, 4, 8, 5, 9];
+ let e: [i16x8; 4] = [i16x8::new(1, 1, 1, 1, 1, 1, 1, 1), i16x8::new(1, 1, 1, 1, 1, 1, 1, 1), i16x8::new(1, 1, 1, 1, 1, 1, 1, 1), i16x8::new(1, 1, 1, 1, 1, 1, 1, 1)];
+ let r: [i16x8; 4] = transmute(vld4q_dup_s16(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4q_dup_s32() {
+ let a: [i32; 17] = [0, 1, 1, 1, 1, 2, 4, 3, 5, 8, 6, 3, 7, 4, 8, 5, 9];
+ let e: [i32x4; 4] = [i32x4::new(1, 1, 1, 1), i32x4::new(1, 1, 1, 1), i32x4::new(1, 1, 1, 1), i32x4::new(1, 1, 1, 1)];
+ let r: [i32x4; 4] = transmute(vld4q_dup_s32(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4_dup_s64() {
+ let a: [i64; 5] = [0, 1, 1, 1, 1];
+ let e: [i64x1; 4] = [i64x1::new(1), i64x1::new(1), i64x1::new(1), i64x1::new(1)];
+ let r: [i64x1; 4] = transmute(vld4_dup_s64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4_dup_u8() {
+ let a: [u8; 33] = [0, 1, 1, 1, 1, 2, 4, 3, 5, 8, 6, 3, 7, 4, 8, 5, 9, 8, 6, 3, 7, 4, 8, 5, 9, 8, 6, 3, 7, 4, 8, 5, 9];
+ let e: [u8x8; 4] = [u8x8::new(1, 1, 1, 1, 1, 1, 1, 1), u8x8::new(1, 1, 1, 1, 1, 1, 1, 1), u8x8::new(1, 1, 1, 1, 1, 1, 1, 1), u8x8::new(1, 1, 1, 1, 1, 1, 1, 1)];
+ let r: [u8x8; 4] = transmute(vld4_dup_u8(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4_dup_u16() {
+ let a: [u16; 17] = [0, 1, 1, 1, 1, 2, 4, 3, 5, 8, 6, 3, 7, 4, 8, 5, 9];
+ let e: [u16x4; 4] = [u16x4::new(1, 1, 1, 1), u16x4::new(1, 1, 1, 1), u16x4::new(1, 1, 1, 1), u16x4::new(1, 1, 1, 1)];
+ let r: [u16x4; 4] = transmute(vld4_dup_u16(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4_dup_u32() {
+ let a: [u32; 9] = [0, 1, 1, 1, 1, 2, 4, 3, 5];
+ let e: [u32x2; 4] = [u32x2::new(1, 1), u32x2::new(1, 1), u32x2::new(1, 1), u32x2::new(1, 1)];
+ let r: [u32x2; 4] = transmute(vld4_dup_u32(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4q_dup_u8() {
+ let a: [u8; 65] = [0, 1, 1, 1, 1, 2, 4, 3, 5, 8, 6, 3, 7, 4, 8, 5, 9, 8, 6, 3, 7, 4, 8, 5, 9, 8, 6, 3, 7, 4, 8, 5, 9, 8, 6, 3, 7, 4, 8, 5, 9, 8, 6, 3, 7, 4, 8, 5, 9, 8, 6, 3, 7, 4, 8, 5, 9, 8, 6, 3, 7, 4, 8, 5, 9];
+ let e: [u8x16; 4] = [u8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), u8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), u8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), u8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)];
+ let r: [u8x16; 4] = transmute(vld4q_dup_u8(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4q_dup_u16() {
+ let a: [u16; 33] = [0, 1, 1, 1, 1, 2, 4, 3, 5, 8, 6, 3, 7, 4, 8, 5, 9, 8, 6, 3, 7, 4, 8, 5, 9, 8, 6, 3, 7, 4, 8, 5, 9];
+ let e: [u16x8; 4] = [u16x8::new(1, 1, 1, 1, 1, 1, 1, 1), u16x8::new(1, 1, 1, 1, 1, 1, 1, 1), u16x8::new(1, 1, 1, 1, 1, 1, 1, 1), u16x8::new(1, 1, 1, 1, 1, 1, 1, 1)];
+ let r: [u16x8; 4] = transmute(vld4q_dup_u16(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4q_dup_u32() {
+ let a: [u32; 17] = [0, 1, 1, 1, 1, 2, 4, 3, 5, 8, 6, 3, 7, 4, 8, 5, 9];
+ let e: [u32x4; 4] = [u32x4::new(1, 1, 1, 1), u32x4::new(1, 1, 1, 1), u32x4::new(1, 1, 1, 1), u32x4::new(1, 1, 1, 1)];
+ let r: [u32x4; 4] = transmute(vld4q_dup_u32(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4_dup_p8() {
+ let a: [u8; 33] = [0, 1, 1, 1, 1, 2, 4, 3, 5, 8, 6, 3, 7, 4, 8, 5, 9, 8, 6, 3, 7, 4, 8, 5, 9, 8, 6, 3, 7, 4, 8, 5, 9];
+ let e: [i8x8; 4] = [i8x8::new(1, 1, 1, 1, 1, 1, 1, 1), i8x8::new(1, 1, 1, 1, 1, 1, 1, 1), i8x8::new(1, 1, 1, 1, 1, 1, 1, 1), i8x8::new(1, 1, 1, 1, 1, 1, 1, 1)];
+ let r: [i8x8; 4] = transmute(vld4_dup_p8(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4_dup_p16() {
+ let a: [u16; 17] = [0, 1, 1, 1, 1, 2, 4, 3, 5, 8, 6, 3, 7, 4, 8, 5, 9];
+ let e: [i16x4; 4] = [i16x4::new(1, 1, 1, 1), i16x4::new(1, 1, 1, 1), i16x4::new(1, 1, 1, 1), i16x4::new(1, 1, 1, 1)];
+ let r: [i16x4; 4] = transmute(vld4_dup_p16(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4q_dup_p8() {
+ let a: [u8; 65] = [0, 1, 1, 1, 1, 2, 4, 3, 5, 8, 6, 3, 7, 4, 8, 5, 9, 8, 6, 3, 7, 4, 8, 5, 9, 8, 6, 3, 7, 4, 8, 5, 9, 8, 6, 3, 7, 4, 8, 5, 9, 8, 6, 3, 7, 4, 8, 5, 9, 8, 6, 3, 7, 4, 8, 5, 9, 8, 6, 3, 7, 4, 8, 5, 9];
+ let e: [i8x16; 4] = [i8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), i8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), i8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), i8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)];
+ let r: [i8x16; 4] = transmute(vld4q_dup_p8(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4q_dup_p16() {
+ let a: [u16; 33] = [0, 1, 1, 1, 1, 2, 4, 3, 5, 8, 6, 3, 7, 4, 8, 5, 9, 8, 6, 3, 7, 4, 8, 5, 9, 8, 6, 3, 7, 4, 8, 5, 9];
+ let e: [i16x8; 4] = [i16x8::new(1, 1, 1, 1, 1, 1, 1, 1), i16x8::new(1, 1, 1, 1, 1, 1, 1, 1), i16x8::new(1, 1, 1, 1, 1, 1, 1, 1), i16x8::new(1, 1, 1, 1, 1, 1, 1, 1)];
+ let r: [i16x8; 4] = transmute(vld4q_dup_p16(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4_dup_u64() {
+ let a: [u64; 5] = [0, 1, 1, 1, 1];
+ let e: [u64x1; 4] = [u64x1::new(1), u64x1::new(1), u64x1::new(1), u64x1::new(1)];
+ let r: [u64x1; 4] = transmute(vld4_dup_u64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4_dup_p64() {
+ let a: [u64; 5] = [0, 1, 1, 1, 1];
+ let e: [i64x1; 4] = [i64x1::new(1), i64x1::new(1), i64x1::new(1), i64x1::new(1)];
+ let r: [i64x1; 4] = transmute(vld4_dup_p64(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4_dup_f32() {
+ let a: [f32; 9] = [0., 1., 1., 1., 1., 6., 4., 3., 5.];
+ let e: [f32x2; 4] = [f32x2::new(1., 1.), f32x2::new(1., 1.), f32x2::new(1., 1.), f32x2::new(1., 1.)];
+ let r: [f32x2; 4] = transmute(vld4_dup_f32(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4q_dup_f32() {
+ let a: [f32; 17] = [0., 1., 1., 1., 1., 6., 4., 3., 5., 7., 4., 3., 5., 8., 4., 3., 5.];
+ let e: [f32x4; 4] = [f32x4::new(1., 1., 1., 1.), f32x4::new(1., 1., 1., 1.), f32x4::new(1., 1., 1., 1.), f32x4::new(1., 1., 1., 1.)];
+ let r: [f32x4; 4] = transmute(vld4q_dup_f32(a[1..].as_ptr()));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4_lane_s8() {
+ let a: [i8; 33] = [0, 1, 2, 2, 2, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8];
+ let b: [i8x8; 4] = [i8x8::new(0, 2, 2, 2, 2, 16, 2, 18), i8x8::new(2, 20, 21, 22, 2, 24, 25, 26), i8x8::new(11, 12, 13, 14, 15, 16, 2, 18), i8x8::new(2, 20, 21, 22, 23, 24, 25, 26)];
+ let e: [i8x8; 4] = [i8x8::new(1, 2, 2, 2, 2, 16, 2, 18), i8x8::new(2, 20, 21, 22, 2, 24, 25, 26), i8x8::new(2, 12, 13, 14, 15, 16, 2, 18), i8x8::new(2, 20, 21, 22, 23, 24, 25, 26)];
+ let r: [i8x8; 4] = transmute(vld4_lane_s8::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4_lane_s16() {
+ let a: [i16; 17] = [0, 1, 2, 2, 2, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8];
+ let b: [i16x4; 4] = [i16x4::new(0, 2, 2, 2), i16x4::new(2, 16, 2, 18), i16x4::new(2, 20, 21, 22), i16x4::new(2, 24, 25, 26)];
+ let e: [i16x4; 4] = [i16x4::new(1, 2, 2, 2), i16x4::new(2, 16, 2, 18), i16x4::new(2, 20, 21, 22), i16x4::new(2, 24, 25, 26)];
+ let r: [i16x4; 4] = transmute(vld4_lane_s16::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4_lane_s32() {
+ let a: [i32; 9] = [0, 1, 2, 2, 2, 5, 6, 7, 8];
+ let b: [i32x2; 4] = [i32x2::new(0, 2), i32x2::new(2, 2), i32x2::new(2, 16), i32x2::new(2, 18)];
+ let e: [i32x2; 4] = [i32x2::new(1, 2), i32x2::new(2, 2), i32x2::new(2, 16), i32x2::new(2, 18)];
+ let r: [i32x2; 4] = transmute(vld4_lane_s32::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4q_lane_s16() {
+ let a: [i16; 33] = [0, 1, 2, 2, 2, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8];
+ let b: [i16x8; 4] = [i16x8::new(0, 2, 2, 2, 2, 16, 2, 18), i16x8::new(2, 20, 21, 22, 2, 24, 25, 26), i16x8::new(11, 12, 13, 14, 15, 16, 2, 18), i16x8::new(2, 20, 21, 22, 23, 24, 25, 26)];
+ let e: [i16x8; 4] = [i16x8::new(1, 2, 2, 2, 2, 16, 2, 18), i16x8::new(2, 20, 21, 22, 2, 24, 25, 26), i16x8::new(2, 12, 13, 14, 15, 16, 2, 18), i16x8::new(2, 20, 21, 22, 23, 24, 25, 26)];
+ let r: [i16x8; 4] = transmute(vld4q_lane_s16::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4q_lane_s32() {
+ let a: [i32; 17] = [0, 1, 2, 2, 2, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8];
+ let b: [i32x4; 4] = [i32x4::new(0, 2, 2, 2), i32x4::new(2, 16, 2, 18), i32x4::new(2, 20, 21, 22), i32x4::new(2, 24, 25, 26)];
+ let e: [i32x4; 4] = [i32x4::new(1, 2, 2, 2), i32x4::new(2, 16, 2, 18), i32x4::new(2, 20, 21, 22), i32x4::new(2, 24, 25, 26)];
+ let r: [i32x4; 4] = transmute(vld4q_lane_s32::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4_lane_u8() {
+ let a: [u8; 33] = [0, 1, 2, 2, 2, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8];
+ let b: [u8x8; 4] = [u8x8::new(0, 2, 2, 2, 2, 16, 2, 18), u8x8::new(2, 20, 21, 22, 2, 24, 25, 26), u8x8::new(11, 12, 13, 14, 15, 16, 2, 18), u8x8::new(2, 20, 21, 22, 23, 24, 25, 26)];
+ let e: [u8x8; 4] = [u8x8::new(1, 2, 2, 2, 2, 16, 2, 18), u8x8::new(2, 20, 21, 22, 2, 24, 25, 26), u8x8::new(2, 12, 13, 14, 15, 16, 2, 18), u8x8::new(2, 20, 21, 22, 23, 24, 25, 26)];
+ let r: [u8x8; 4] = transmute(vld4_lane_u8::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4_lane_u16() {
+ let a: [u16; 17] = [0, 1, 2, 2, 2, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8];
+ let b: [u16x4; 4] = [u16x4::new(0, 2, 2, 2), u16x4::new(2, 16, 2, 18), u16x4::new(2, 20, 21, 22), u16x4::new(2, 24, 25, 26)];
+ let e: [u16x4; 4] = [u16x4::new(1, 2, 2, 2), u16x4::new(2, 16, 2, 18), u16x4::new(2, 20, 21, 22), u16x4::new(2, 24, 25, 26)];
+ let r: [u16x4; 4] = transmute(vld4_lane_u16::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4_lane_u32() {
+ let a: [u32; 9] = [0, 1, 2, 2, 2, 5, 6, 7, 8];
+ let b: [u32x2; 4] = [u32x2::new(0, 2), u32x2::new(2, 2), u32x2::new(2, 16), u32x2::new(2, 18)];
+ let e: [u32x2; 4] = [u32x2::new(1, 2), u32x2::new(2, 2), u32x2::new(2, 16), u32x2::new(2, 18)];
+ let r: [u32x2; 4] = transmute(vld4_lane_u32::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4q_lane_u16() {
+ let a: [u16; 33] = [0, 1, 2, 2, 2, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8];
+ let b: [u16x8; 4] = [u16x8::new(0, 2, 2, 2, 2, 16, 2, 18), u16x8::new(2, 20, 21, 22, 2, 24, 25, 26), u16x8::new(11, 12, 13, 14, 15, 16, 2, 18), u16x8::new(2, 20, 21, 22, 23, 24, 25, 26)];
+ let e: [u16x8; 4] = [u16x8::new(1, 2, 2, 2, 2, 16, 2, 18), u16x8::new(2, 20, 21, 22, 2, 24, 25, 26), u16x8::new(2, 12, 13, 14, 15, 16, 2, 18), u16x8::new(2, 20, 21, 22, 23, 24, 25, 26)];
+ let r: [u16x8; 4] = transmute(vld4q_lane_u16::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4q_lane_u32() {
+ let a: [u32; 17] = [0, 1, 2, 2, 2, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8];
+ let b: [u32x4; 4] = [u32x4::new(0, 2, 2, 2), u32x4::new(2, 16, 2, 18), u32x4::new(2, 20, 21, 22), u32x4::new(2, 24, 25, 26)];
+ let e: [u32x4; 4] = [u32x4::new(1, 2, 2, 2), u32x4::new(2, 16, 2, 18), u32x4::new(2, 20, 21, 22), u32x4::new(2, 24, 25, 26)];
+ let r: [u32x4; 4] = transmute(vld4q_lane_u32::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4_lane_p8() {
+ let a: [u8; 33] = [0, 1, 2, 2, 2, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8];
+ let b: [i8x8; 4] = [i8x8::new(0, 2, 2, 2, 2, 16, 2, 18), i8x8::new(2, 20, 21, 22, 2, 24, 25, 26), i8x8::new(11, 12, 13, 14, 15, 16, 2, 18), i8x8::new(2, 20, 21, 22, 23, 24, 25, 26)];
+ let e: [i8x8; 4] = [i8x8::new(1, 2, 2, 2, 2, 16, 2, 18), i8x8::new(2, 20, 21, 22, 2, 24, 25, 26), i8x8::new(2, 12, 13, 14, 15, 16, 2, 18), i8x8::new(2, 20, 21, 22, 23, 24, 25, 26)];
+ let r: [i8x8; 4] = transmute(vld4_lane_p8::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4_lane_p16() {
+ let a: [u16; 17] = [0, 1, 2, 2, 2, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8];
+ let b: [i16x4; 4] = [i16x4::new(0, 2, 2, 2), i16x4::new(2, 16, 2, 18), i16x4::new(2, 20, 21, 22), i16x4::new(2, 24, 25, 26)];
+ let e: [i16x4; 4] = [i16x4::new(1, 2, 2, 2), i16x4::new(2, 16, 2, 18), i16x4::new(2, 20, 21, 22), i16x4::new(2, 24, 25, 26)];
+ let r: [i16x4; 4] = transmute(vld4_lane_p16::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4q_lane_p16() {
+ let a: [u16; 33] = [0, 1, 2, 2, 2, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8];
+ let b: [i16x8; 4] = [i16x8::new(0, 2, 2, 2, 2, 16, 2, 18), i16x8::new(2, 20, 21, 22, 2, 24, 25, 26), i16x8::new(11, 12, 13, 14, 15, 16, 2, 18), i16x8::new(2, 20, 21, 22, 23, 24, 25, 26)];
+ let e: [i16x8; 4] = [i16x8::new(1, 2, 2, 2, 2, 16, 2, 18), i16x8::new(2, 20, 21, 22, 2, 24, 25, 26), i16x8::new(2, 12, 13, 14, 15, 16, 2, 18), i16x8::new(2, 20, 21, 22, 23, 24, 25, 26)];
+ let r: [i16x8; 4] = transmute(vld4q_lane_p16::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4_lane_f32() {
+ let a: [f32; 9] = [0., 1., 2., 2., 2., 5., 6., 7., 8.];
+ let b: [f32x2; 4] = [f32x2::new(0., 2.), f32x2::new(2., 2.), f32x2::new(2., 16.), f32x2::new(2., 18.)];
+ let e: [f32x2; 4] = [f32x2::new(1., 2.), f32x2::new(2., 2.), f32x2::new(2., 16.), f32x2::new(2., 18.)];
+ let r: [f32x2; 4] = transmute(vld4_lane_f32::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld4q_lane_f32() {
+ let a: [f32; 17] = [0., 1., 2., 2., 2., 5., 6., 7., 8., 5., 6., 7., 8., 1., 4., 3., 5.];
+ let b: [f32x4; 4] = [f32x4::new(0., 2., 2., 2.), f32x4::new(2., 16., 2., 18.), f32x4::new(5., 6., 7., 8.), f32x4::new(1., 4., 3., 5.)];
+ let e: [f32x4; 4] = [f32x4::new(1., 2., 2., 2.), f32x4::new(2., 16., 2., 18.), f32x4::new(2., 6., 7., 8.), f32x4::new(2., 4., 3., 5.)];
+ let r: [f32x4; 4] = transmute(vld4q_lane_f32::<0>(a[1..].as_ptr(), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_lane_s8() {
+ let a: [i8; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
+ let e: [i8; 8] = [1, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [i8; 8] = [0i8; 8];
+ vst1_lane_s8::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_lane_s16() {
+ let a: [i16; 5] = [0, 1, 2, 3, 4];
+ let e: [i16; 4] = [1, 0, 0, 0];
+ let mut r: [i16; 4] = [0i16; 4];
+ vst1_lane_s16::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_lane_s32() {
+ let a: [i32; 3] = [0, 1, 2];
+ let e: [i32; 2] = [1, 0];
+ let mut r: [i32; 2] = [0i32; 2];
+ vst1_lane_s32::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_lane_s64() {
+ let a: [i64; 2] = [0, 1];
+ let e: [i64; 1] = [1];
+ let mut r: [i64; 1] = [0i64; 1];
+ vst1_lane_s64::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_lane_s8() {
+ let a: [i8; 17] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let e: [i8; 16] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [i8; 16] = [0i8; 16];
+ vst1q_lane_s8::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_lane_s16() {
+ let a: [i16; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
+ let e: [i16; 8] = [1, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [i16; 8] = [0i16; 8];
+ vst1q_lane_s16::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_lane_s32() {
+ let a: [i32; 5] = [0, 1, 2, 3, 4];
+ let e: [i32; 4] = [1, 0, 0, 0];
+ let mut r: [i32; 4] = [0i32; 4];
+ vst1q_lane_s32::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_lane_s64() {
+ let a: [i64; 3] = [0, 1, 2];
+ let e: [i64; 2] = [1, 0];
+ let mut r: [i64; 2] = [0i64; 2];
+ vst1q_lane_s64::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_lane_u8() {
+ let a: [u8; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
+ let e: [u8; 8] = [1, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [u8; 8] = [0u8; 8];
+ vst1_lane_u8::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_lane_u16() {
+ let a: [u16; 5] = [0, 1, 2, 3, 4];
+ let e: [u16; 4] = [1, 0, 0, 0];
+ let mut r: [u16; 4] = [0u16; 4];
+ vst1_lane_u16::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_lane_u32() {
+ let a: [u32; 3] = [0, 1, 2];
+ let e: [u32; 2] = [1, 0];
+ let mut r: [u32; 2] = [0u32; 2];
+ vst1_lane_u32::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_lane_u64() {
+ let a: [u64; 2] = [0, 1];
+ let e: [u64; 1] = [1];
+ let mut r: [u64; 1] = [0u64; 1];
+ vst1_lane_u64::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_lane_u8() {
+ let a: [u8; 17] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let e: [u8; 16] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [u8; 16] = [0u8; 16];
+ vst1q_lane_u8::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_lane_u16() {
+ let a: [u16; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
+ let e: [u16; 8] = [1, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [u16; 8] = [0u16; 8];
+ vst1q_lane_u16::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_lane_u32() {
+ let a: [u32; 5] = [0, 1, 2, 3, 4];
+ let e: [u32; 4] = [1, 0, 0, 0];
+ let mut r: [u32; 4] = [0u32; 4];
+ vst1q_lane_u32::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_lane_u64() {
+ let a: [u64; 3] = [0, 1, 2];
+ let e: [u64; 2] = [1, 0];
+ let mut r: [u64; 2] = [0u64; 2];
+ vst1q_lane_u64::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_lane_p8() {
+ let a: [u8; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
+ let e: [u8; 8] = [1, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [u8; 8] = [0u8; 8];
+ vst1_lane_p8::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_lane_p16() {
+ let a: [u16; 5] = [0, 1, 2, 3, 4];
+ let e: [u16; 4] = [1, 0, 0, 0];
+ let mut r: [u16; 4] = [0u16; 4];
+ vst1_lane_p16::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_lane_p8() {
+ let a: [u8; 17] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let e: [u8; 16] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [u8; 16] = [0u8; 16];
+ vst1q_lane_p8::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_lane_p16() {
+ let a: [u16; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
+ let e: [u16; 8] = [1, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [u16; 8] = [0u16; 8];
+ vst1q_lane_p16::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_lane_p64() {
+ let a: [u64; 2] = [0, 1];
+ let e: [u64; 1] = [1];
+ let mut r: [u64; 1] = [0u64; 1];
+ vst1_lane_p64::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_lane_p64() {
+ let a: [u64; 3] = [0, 1, 2];
+ let e: [u64; 2] = [1, 0];
+ let mut r: [u64; 2] = [0u64; 2];
+ vst1q_lane_p64::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_lane_f32() {
+ let a: [f32; 3] = [0., 1., 2.];
+ let e: [f32; 2] = [1., 0.];
+ let mut r: [f32; 2] = [0f32; 2];
+ vst1_lane_f32::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_lane_f32() {
+ let a: [f32; 5] = [0., 1., 2., 3., 4.];
+ let e: [f32; 4] = [1., 0., 0., 0.];
+ let mut r: [f32; 4] = [0f32; 4];
+ vst1q_lane_f32::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_s8_x2() {
+ let a: [i8; 17] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let e: [i8; 16] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let mut r: [i8; 16] = [0i8; 16];
+ vst1_s8_x2(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_s16_x2() {
+ let a: [i16; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
+ let e: [i16; 8] = [1, 2, 3, 4, 5, 6, 7, 8];
+ let mut r: [i16; 8] = [0i16; 8];
+ vst1_s16_x2(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_s32_x2() {
+ let a: [i32; 5] = [0, 1, 2, 3, 4];
+ let e: [i32; 4] = [1, 2, 3, 4];
+ let mut r: [i32; 4] = [0i32; 4];
+ vst1_s32_x2(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_s64_x2() {
+ let a: [i64; 3] = [0, 1, 2];
+ let e: [i64; 2] = [1, 2];
+ let mut r: [i64; 2] = [0i64; 2];
+ vst1_s64_x2(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_s8_x2() {
+ let a: [i8; 33] = [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];
+ let e: [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 mut r: [i8; 32] = [0i8; 32];
+ vst1q_s8_x2(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_s16_x2() {
+ let a: [i16; 17] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let e: [i16; 16] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let mut r: [i16; 16] = [0i16; 16];
+ vst1q_s16_x2(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_s32_x2() {
+ let a: [i32; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
+ let e: [i32; 8] = [1, 2, 3, 4, 5, 6, 7, 8];
+ let mut r: [i32; 8] = [0i32; 8];
+ vst1q_s32_x2(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_s64_x2() {
+ let a: [i64; 5] = [0, 1, 2, 3, 4];
+ let e: [i64; 4] = [1, 2, 3, 4];
+ let mut r: [i64; 4] = [0i64; 4];
+ vst1q_s64_x2(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_s8_x3() {
+ let a: [i8; 25] = [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];
+ let e: [i8; 24] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24];
+ let mut r: [i8; 24] = [0i8; 24];
+ vst1_s8_x3(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_s16_x3() {
+ let a: [i16; 13] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
+ let e: [i16; 12] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
+ let mut r: [i16; 12] = [0i16; 12];
+ vst1_s16_x3(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_s32_x3() {
+ let a: [i32; 7] = [0, 1, 2, 3, 4, 5, 6];
+ let e: [i32; 6] = [1, 2, 3, 4, 5, 6];
+ let mut r: [i32; 6] = [0i32; 6];
+ vst1_s32_x3(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_s64_x3() {
+ let a: [i64; 4] = [0, 1, 2, 3];
+ let e: [i64; 3] = [1, 2, 3];
+ let mut r: [i64; 3] = [0i64; 3];
+ vst1_s64_x3(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_s8_x3() {
+ let a: [i8; 49] = [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, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let e: [i8; 48] = [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];
+ let mut r: [i8; 48] = [0i8; 48];
+ vst1q_s8_x3(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_s16_x3() {
+ let a: [i16; 25] = [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];
+ let e: [i16; 24] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24];
+ let mut r: [i16; 24] = [0i16; 24];
+ vst1q_s16_x3(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_s32_x3() {
+ let a: [i32; 13] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
+ let e: [i32; 12] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
+ let mut r: [i32; 12] = [0i32; 12];
+ vst1q_s32_x3(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_s64_x3() {
+ let a: [i64; 7] = [0, 1, 2, 3, 4, 5, 6];
+ let e: [i64; 6] = [1, 2, 3, 4, 5, 6];
+ let mut r: [i64; 6] = [0i64; 6];
+ vst1q_s64_x3(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_s8_x4() {
+ let a: [i8; 33] = [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];
+ let e: [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 mut r: [i8; 32] = [0i8; 32];
+ vst1_s8_x4(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_s16_x4() {
+ let a: [i16; 17] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let e: [i16; 16] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let mut r: [i16; 16] = [0i16; 16];
+ vst1_s16_x4(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_s32_x4() {
+ let a: [i32; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
+ let e: [i32; 8] = [1, 2, 3, 4, 5, 6, 7, 8];
+ let mut r: [i32; 8] = [0i32; 8];
+ vst1_s32_x4(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_s64_x4() {
+ let a: [i64; 5] = [0, 1, 2, 3, 4];
+ let e: [i64; 4] = [1, 2, 3, 4];
+ let mut r: [i64; 4] = [0i64; 4];
+ vst1_s64_x4(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_s8_x4() {
+ let a: [i8; 65] = [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, 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 e: [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 mut r: [i8; 64] = [0i8; 64];
+ vst1q_s8_x4(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_s16_x4() {
+ let a: [i16; 33] = [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];
+ let e: [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 mut r: [i16; 32] = [0i16; 32];
+ vst1q_s16_x4(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_s32_x4() {
+ let a: [i32; 17] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let e: [i32; 16] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let mut r: [i32; 16] = [0i32; 16];
+ vst1q_s32_x4(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_s64_x4() {
+ let a: [i64; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
+ let e: [i64; 8] = [1, 2, 3, 4, 5, 6, 7, 8];
+ let mut r: [i64; 8] = [0i64; 8];
+ vst1q_s64_x4(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_u8_x2() {
+ let a: [u8; 17] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let e: [u8; 16] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let mut r: [u8; 16] = [0u8; 16];
+ vst1_u8_x2(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_u16_x2() {
+ let a: [u16; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
+ let e: [u16; 8] = [1, 2, 3, 4, 5, 6, 7, 8];
+ let mut r: [u16; 8] = [0u16; 8];
+ vst1_u16_x2(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_u32_x2() {
+ let a: [u32; 5] = [0, 1, 2, 3, 4];
+ let e: [u32; 4] = [1, 2, 3, 4];
+ let mut r: [u32; 4] = [0u32; 4];
+ vst1_u32_x2(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_u64_x2() {
+ let a: [u64; 3] = [0, 1, 2];
+ let e: [u64; 2] = [1, 2];
+ let mut r: [u64; 2] = [0u64; 2];
+ vst1_u64_x2(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_u8_x2() {
+ let a: [u8; 33] = [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];
+ let e: [u8; 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 mut r: [u8; 32] = [0u8; 32];
+ vst1q_u8_x2(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_u16_x2() {
+ let a: [u16; 17] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let e: [u16; 16] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let mut r: [u16; 16] = [0u16; 16];
+ vst1q_u16_x2(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_u32_x2() {
+ let a: [u32; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
+ let e: [u32; 8] = [1, 2, 3, 4, 5, 6, 7, 8];
+ let mut r: [u32; 8] = [0u32; 8];
+ vst1q_u32_x2(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_u64_x2() {
+ let a: [u64; 5] = [0, 1, 2, 3, 4];
+ let e: [u64; 4] = [1, 2, 3, 4];
+ let mut r: [u64; 4] = [0u64; 4];
+ vst1q_u64_x2(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_u8_x3() {
+ let a: [u8; 25] = [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];
+ let e: [u8; 24] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24];
+ let mut r: [u8; 24] = [0u8; 24];
+ vst1_u8_x3(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_u16_x3() {
+ let a: [u16; 13] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
+ let e: [u16; 12] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
+ let mut r: [u16; 12] = [0u16; 12];
+ vst1_u16_x3(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_u32_x3() {
+ let a: [u32; 7] = [0, 1, 2, 3, 4, 5, 6];
+ let e: [u32; 6] = [1, 2, 3, 4, 5, 6];
+ let mut r: [u32; 6] = [0u32; 6];
+ vst1_u32_x3(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_u64_x3() {
+ let a: [u64; 4] = [0, 1, 2, 3];
+ let e: [u64; 3] = [1, 2, 3];
+ let mut r: [u64; 3] = [0u64; 3];
+ vst1_u64_x3(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_u8_x3() {
+ let a: [u8; 49] = [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, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let e: [u8; 48] = [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];
+ let mut r: [u8; 48] = [0u8; 48];
+ vst1q_u8_x3(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_u16_x3() {
+ let a: [u16; 25] = [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];
+ let e: [u16; 24] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24];
+ let mut r: [u16; 24] = [0u16; 24];
+ vst1q_u16_x3(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_u32_x3() {
+ let a: [u32; 13] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
+ let e: [u32; 12] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
+ let mut r: [u32; 12] = [0u32; 12];
+ vst1q_u32_x3(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_u64_x3() {
+ let a: [u64; 7] = [0, 1, 2, 3, 4, 5, 6];
+ let e: [u64; 6] = [1, 2, 3, 4, 5, 6];
+ let mut r: [u64; 6] = [0u64; 6];
+ vst1q_u64_x3(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_u8_x4() {
+ let a: [u8; 33] = [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];
+ let e: [u8; 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 mut r: [u8; 32] = [0u8; 32];
+ vst1_u8_x4(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_u16_x4() {
+ let a: [u16; 17] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let e: [u16; 16] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let mut r: [u16; 16] = [0u16; 16];
+ vst1_u16_x4(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_u32_x4() {
+ let a: [u32; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
+ let e: [u32; 8] = [1, 2, 3, 4, 5, 6, 7, 8];
+ let mut r: [u32; 8] = [0u32; 8];
+ vst1_u32_x4(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_u64_x4() {
+ let a: [u64; 5] = [0, 1, 2, 3, 4];
+ let e: [u64; 4] = [1, 2, 3, 4];
+ let mut r: [u64; 4] = [0u64; 4];
+ vst1_u64_x4(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_u8_x4() {
+ let a: [u8; 65] = [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, 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 e: [u8; 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 mut r: [u8; 64] = [0u8; 64];
+ vst1q_u8_x4(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_u16_x4() {
+ let a: [u16; 33] = [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];
+ let e: [u16; 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 mut r: [u16; 32] = [0u16; 32];
+ vst1q_u16_x4(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_u32_x4() {
+ let a: [u32; 17] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let e: [u32; 16] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let mut r: [u32; 16] = [0u32; 16];
+ vst1q_u32_x4(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_u64_x4() {
+ let a: [u64; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
+ let e: [u64; 8] = [1, 2, 3, 4, 5, 6, 7, 8];
+ let mut r: [u64; 8] = [0u64; 8];
+ vst1q_u64_x4(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_p8_x2() {
+ let a: [u8; 17] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let e: [u8; 16] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let mut r: [u8; 16] = [0u8; 16];
+ vst1_p8_x2(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_p8_x3() {
+ let a: [u8; 25] = [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];
+ let e: [u8; 24] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24];
+ let mut r: [u8; 24] = [0u8; 24];
+ vst1_p8_x3(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_p8_x4() {
+ let a: [u8; 33] = [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];
+ let e: [u8; 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 mut r: [u8; 32] = [0u8; 32];
+ vst1_p8_x4(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_p8_x2() {
+ let a: [u8; 33] = [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];
+ let e: [u8; 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 mut r: [u8; 32] = [0u8; 32];
+ vst1q_p8_x2(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_p8_x3() {
+ let a: [u8; 49] = [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, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let e: [u8; 48] = [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];
+ let mut r: [u8; 48] = [0u8; 48];
+ vst1q_p8_x3(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_p8_x4() {
+ let a: [u8; 65] = [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, 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 e: [u8; 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 mut r: [u8; 64] = [0u8; 64];
+ vst1q_p8_x4(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_p16_x2() {
+ let a: [u16; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
+ let e: [u16; 8] = [1, 2, 3, 4, 5, 6, 7, 8];
+ let mut r: [u16; 8] = [0u16; 8];
+ vst1_p16_x2(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_p16_x3() {
+ let a: [u16; 13] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
+ let e: [u16; 12] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
+ let mut r: [u16; 12] = [0u16; 12];
+ vst1_p16_x3(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_p16_x4() {
+ let a: [u16; 17] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let e: [u16; 16] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let mut r: [u16; 16] = [0u16; 16];
+ vst1_p16_x4(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_p16_x2() {
+ let a: [u16; 17] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let e: [u16; 16] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let mut r: [u16; 16] = [0u16; 16];
+ vst1q_p16_x2(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_p16_x3() {
+ let a: [u16; 25] = [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];
+ let e: [u16; 24] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24];
+ let mut r: [u16; 24] = [0u16; 24];
+ vst1q_p16_x3(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_p16_x4() {
+ let a: [u16; 33] = [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];
+ let e: [u16; 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 mut r: [u16; 32] = [0u16; 32];
+ vst1q_p16_x4(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_p64_x2() {
+ let a: [u64; 3] = [0, 1, 2];
+ let e: [u64; 2] = [1, 2];
+ let mut r: [u64; 2] = [0u64; 2];
+ vst1_p64_x2(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_p64_x3() {
+ let a: [u64; 4] = [0, 1, 2, 3];
+ let e: [u64; 3] = [1, 2, 3];
+ let mut r: [u64; 3] = [0u64; 3];
+ vst1_p64_x3(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_p64_x4() {
+ let a: [u64; 5] = [0, 1, 2, 3, 4];
+ let e: [u64; 4] = [1, 2, 3, 4];
+ let mut r: [u64; 4] = [0u64; 4];
+ vst1_p64_x4(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_p64_x2() {
+ let a: [u64; 5] = [0, 1, 2, 3, 4];
+ let e: [u64; 4] = [1, 2, 3, 4];
+ let mut r: [u64; 4] = [0u64; 4];
+ vst1q_p64_x2(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_p64_x3() {
+ let a: [u64; 7] = [0, 1, 2, 3, 4, 5, 6];
+ let e: [u64; 6] = [1, 2, 3, 4, 5, 6];
+ let mut r: [u64; 6] = [0u64; 6];
+ vst1q_p64_x3(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_p64_x4() {
+ let a: [u64; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
+ let e: [u64; 8] = [1, 2, 3, 4, 5, 6, 7, 8];
+ let mut r: [u64; 8] = [0u64; 8];
+ vst1q_p64_x4(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_f32_x2() {
+ let a: [f32; 5] = [0., 1., 2., 3., 4.];
+ let e: [f32; 4] = [1., 2., 3., 4.];
+ let mut r: [f32; 4] = [0f32; 4];
+ vst1_f32_x2(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_f32_x2() {
+ let a: [f32; 9] = [0., 1., 2., 3., 4., 5., 6., 7., 8.];
+ let e: [f32; 8] = [1., 2., 3., 4., 5., 6., 7., 8.];
+ let mut r: [f32; 8] = [0f32; 8];
+ vst1q_f32_x2(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_f32_x3() {
+ let a: [f32; 7] = [0., 1., 2., 3., 4., 5., 6.];
+ let e: [f32; 6] = [1., 2., 3., 4., 5., 6.];
+ let mut r: [f32; 6] = [0f32; 6];
+ vst1_f32_x3(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_f32_x3() {
+ let a: [f32; 13] = [0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12.];
+ let e: [f32; 12] = [1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12.];
+ let mut r: [f32; 12] = [0f32; 12];
+ vst1q_f32_x3(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1_f32_x4() {
+ let a: [f32; 9] = [0., 1., 2., 3., 4., 5., 6., 7., 8.];
+ let e: [f32; 8] = [1., 2., 3., 4., 5., 6., 7., 8.];
+ let mut r: [f32; 8] = [0f32; 8];
+ vst1_f32_x4(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst1q_f32_x4() {
+ let a: [f32; 17] = [0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16.];
+ let e: [f32; 16] = [1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16.];
+ let mut r: [f32; 16] = [0f32; 16];
+ vst1q_f32_x4(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2_s8() {
+ let a: [i8; 17] = [0, 1, 2, 2, 3, 2, 3, 4, 5, 2, 3, 4, 5, 6, 7, 8, 9];
+ let e: [i8; 16] = [1, 2, 2, 3, 2, 4, 3, 5, 2, 6, 3, 7, 4, 8, 5, 9];
+ let mut r: [i8; 16] = [0i8; 16];
+ vst2_s8(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2_s16() {
+ let a: [i16; 9] = [0, 1, 2, 2, 3, 2, 3, 4, 5];
+ let e: [i16; 8] = [1, 2, 2, 3, 2, 4, 3, 5];
+ let mut r: [i16; 8] = [0i16; 8];
+ vst2_s16(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2_s32() {
+ let a: [i32; 5] = [0, 1, 2, 2, 3];
+ let e: [i32; 4] = [1, 2, 2, 3];
+ let mut r: [i32; 4] = [0i32; 4];
+ vst2_s32(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2q_s8() {
+ let a: [i8; 33] = [0, 1, 2, 2, 3, 2, 3, 4, 5, 2, 3, 4, 5, 6, 7, 8, 9, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17];
+ let e: [i8; 32] = [1, 2, 2, 3, 2, 4, 3, 5, 2, 6, 3, 7, 4, 8, 5, 9, 2, 10, 3, 11, 4, 12, 5, 13, 6, 14, 7, 15, 8, 16, 9, 17];
+ let mut r: [i8; 32] = [0i8; 32];
+ vst2q_s8(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2q_s16() {
+ let a: [i16; 17] = [0, 1, 2, 2, 3, 2, 3, 4, 5, 2, 3, 4, 5, 6, 7, 8, 9];
+ let e: [i16; 16] = [1, 2, 2, 3, 2, 4, 3, 5, 2, 6, 3, 7, 4, 8, 5, 9];
+ let mut r: [i16; 16] = [0i16; 16];
+ vst2q_s16(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2q_s32() {
+ let a: [i32; 9] = [0, 1, 2, 2, 3, 2, 3, 4, 5];
+ let e: [i32; 8] = [1, 2, 2, 3, 2, 4, 3, 5];
+ let mut r: [i32; 8] = [0i32; 8];
+ vst2q_s32(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2_s64() {
+ let a: [i64; 3] = [0, 1, 2];
+ let e: [i64; 2] = [1, 2];
+ let mut r: [i64; 2] = [0i64; 2];
+ vst2_s64(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2_u8() {
+ let a: [u8; 17] = [0, 1, 2, 2, 3, 2, 3, 4, 5, 2, 3, 4, 5, 6, 7, 8, 9];
+ let e: [u8; 16] = [1, 2, 2, 3, 2, 4, 3, 5, 2, 6, 3, 7, 4, 8, 5, 9];
+ let mut r: [u8; 16] = [0u8; 16];
+ vst2_u8(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2_u16() {
+ let a: [u16; 9] = [0, 1, 2, 2, 3, 2, 3, 4, 5];
+ let e: [u16; 8] = [1, 2, 2, 3, 2, 4, 3, 5];
+ let mut r: [u16; 8] = [0u16; 8];
+ vst2_u16(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2_u32() {
+ let a: [u32; 5] = [0, 1, 2, 2, 3];
+ let e: [u32; 4] = [1, 2, 2, 3];
+ let mut r: [u32; 4] = [0u32; 4];
+ vst2_u32(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2q_u8() {
+ let a: [u8; 33] = [0, 1, 2, 2, 3, 2, 3, 4, 5, 2, 3, 4, 5, 6, 7, 8, 9, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17];
+ let e: [u8; 32] = [1, 2, 2, 3, 2, 4, 3, 5, 2, 6, 3, 7, 4, 8, 5, 9, 2, 10, 3, 11, 4, 12, 5, 13, 6, 14, 7, 15, 8, 16, 9, 17];
+ let mut r: [u8; 32] = [0u8; 32];
+ vst2q_u8(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2q_u16() {
+ let a: [u16; 17] = [0, 1, 2, 2, 3, 2, 3, 4, 5, 2, 3, 4, 5, 6, 7, 8, 9];
+ let e: [u16; 16] = [1, 2, 2, 3, 2, 4, 3, 5, 2, 6, 3, 7, 4, 8, 5, 9];
+ let mut r: [u16; 16] = [0u16; 16];
+ vst2q_u16(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2q_u32() {
+ let a: [u32; 9] = [0, 1, 2, 2, 3, 2, 3, 4, 5];
+ let e: [u32; 8] = [1, 2, 2, 3, 2, 4, 3, 5];
+ let mut r: [u32; 8] = [0u32; 8];
+ vst2q_u32(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2_p8() {
+ let a: [u8; 17] = [0, 1, 2, 2, 3, 2, 3, 4, 5, 2, 3, 4, 5, 6, 7, 8, 9];
+ let e: [u8; 16] = [1, 2, 2, 3, 2, 4, 3, 5, 2, 6, 3, 7, 4, 8, 5, 9];
+ let mut r: [u8; 16] = [0u8; 16];
+ vst2_p8(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2_p16() {
+ let a: [u16; 9] = [0, 1, 2, 2, 3, 2, 3, 4, 5];
+ let e: [u16; 8] = [1, 2, 2, 3, 2, 4, 3, 5];
+ let mut r: [u16; 8] = [0u16; 8];
+ vst2_p16(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2q_p8() {
+ let a: [u8; 33] = [0, 1, 2, 2, 3, 2, 3, 4, 5, 2, 3, 4, 5, 6, 7, 8, 9, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17];
+ let e: [u8; 32] = [1, 2, 2, 3, 2, 4, 3, 5, 2, 6, 3, 7, 4, 8, 5, 9, 2, 10, 3, 11, 4, 12, 5, 13, 6, 14, 7, 15, 8, 16, 9, 17];
+ let mut r: [u8; 32] = [0u8; 32];
+ vst2q_p8(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2q_p16() {
+ let a: [u16; 17] = [0, 1, 2, 2, 3, 2, 3, 4, 5, 2, 3, 4, 5, 6, 7, 8, 9];
+ let e: [u16; 16] = [1, 2, 2, 3, 2, 4, 3, 5, 2, 6, 3, 7, 4, 8, 5, 9];
+ let mut r: [u16; 16] = [0u16; 16];
+ vst2q_p16(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2_u64() {
+ let a: [u64; 3] = [0, 1, 2];
+ let e: [u64; 2] = [1, 2];
+ let mut r: [u64; 2] = [0u64; 2];
+ vst2_u64(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2_p64() {
+ let a: [u64; 3] = [0, 1, 2];
+ let e: [u64; 2] = [1, 2];
+ let mut r: [u64; 2] = [0u64; 2];
+ vst2_p64(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2_f32() {
+ let a: [f32; 5] = [0., 1., 2., 2., 3.];
+ let e: [f32; 4] = [1., 2., 2., 3.];
+ let mut r: [f32; 4] = [0f32; 4];
+ vst2_f32(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2q_f32() {
+ let a: [f32; 9] = [0., 1., 2., 2., 3., 2., 3., 4., 5.];
+ let e: [f32; 8] = [1., 2., 2., 3., 2., 4., 3., 5.];
+ let mut r: [f32; 8] = [0f32; 8];
+ vst2q_f32(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2_lane_s8() {
+ let a: [i8; 17] = [0, 1, 2, 2, 3, 2, 3, 4, 5, 2, 3, 4, 5, 6, 7, 8, 9];
+ let e: [i8; 16] = [1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [i8; 16] = [0i8; 16];
+ vst2_lane_s8::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2_lane_s16() {
+ let a: [i16; 9] = [0, 1, 2, 2, 3, 2, 3, 4, 5];
+ let e: [i16; 8] = [1, 2, 0, 0, 0, 0, 0, 0];
+ let mut r: [i16; 8] = [0i16; 8];
+ vst2_lane_s16::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2_lane_s32() {
+ let a: [i32; 5] = [0, 1, 2, 2, 3];
+ let e: [i32; 4] = [1, 2, 0, 0];
+ let mut r: [i32; 4] = [0i32; 4];
+ vst2_lane_s32::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2q_lane_s16() {
+ let a: [i16; 17] = [0, 1, 2, 2, 3, 2, 3, 4, 5, 2, 3, 4, 5, 6, 7, 8, 9];
+ let e: [i16; 16] = [1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [i16; 16] = [0i16; 16];
+ vst2q_lane_s16::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2q_lane_s32() {
+ let a: [i32; 9] = [0, 1, 2, 2, 3, 2, 3, 4, 5];
+ let e: [i32; 8] = [1, 2, 0, 0, 0, 0, 0, 0];
+ let mut r: [i32; 8] = [0i32; 8];
+ vst2q_lane_s32::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2_lane_u8() {
+ let a: [u8; 17] = [0, 1, 2, 2, 3, 2, 3, 4, 5, 2, 3, 4, 5, 6, 7, 8, 9];
+ let e: [u8; 16] = [1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [u8; 16] = [0u8; 16];
+ vst2_lane_u8::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2_lane_u16() {
+ let a: [u16; 9] = [0, 1, 2, 2, 3, 2, 3, 4, 5];
+ let e: [u16; 8] = [1, 2, 0, 0, 0, 0, 0, 0];
+ let mut r: [u16; 8] = [0u16; 8];
+ vst2_lane_u16::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2_lane_u32() {
+ let a: [u32; 5] = [0, 1, 2, 2, 3];
+ let e: [u32; 4] = [1, 2, 0, 0];
+ let mut r: [u32; 4] = [0u32; 4];
+ vst2_lane_u32::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2q_lane_u16() {
+ let a: [u16; 17] = [0, 1, 2, 2, 3, 2, 3, 4, 5, 2, 3, 4, 5, 6, 7, 8, 9];
+ let e: [u16; 16] = [1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [u16; 16] = [0u16; 16];
+ vst2q_lane_u16::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2q_lane_u32() {
+ let a: [u32; 9] = [0, 1, 2, 2, 3, 2, 3, 4, 5];
+ let e: [u32; 8] = [1, 2, 0, 0, 0, 0, 0, 0];
+ let mut r: [u32; 8] = [0u32; 8];
+ vst2q_lane_u32::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2_lane_p8() {
+ let a: [u8; 17] = [0, 1, 2, 2, 3, 2, 3, 4, 5, 2, 3, 4, 5, 6, 7, 8, 9];
+ let e: [u8; 16] = [1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [u8; 16] = [0u8; 16];
+ vst2_lane_p8::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2_lane_p16() {
+ let a: [u16; 9] = [0, 1, 2, 2, 3, 2, 3, 4, 5];
+ let e: [u16; 8] = [1, 2, 0, 0, 0, 0, 0, 0];
+ let mut r: [u16; 8] = [0u16; 8];
+ vst2_lane_p16::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2q_lane_p16() {
+ let a: [u16; 17] = [0, 1, 2, 2, 3, 2, 3, 4, 5, 2, 3, 4, 5, 6, 7, 8, 9];
+ let e: [u16; 16] = [1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [u16; 16] = [0u16; 16];
+ vst2q_lane_p16::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2_lane_f32() {
+ let a: [f32; 5] = [0., 1., 2., 2., 3.];
+ let e: [f32; 4] = [1., 2., 0., 0.];
+ let mut r: [f32; 4] = [0f32; 4];
+ vst2_lane_f32::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst2q_lane_f32() {
+ let a: [f32; 9] = [0., 1., 2., 2., 3., 2., 3., 4., 5.];
+ let e: [f32; 8] = [1., 2., 0., 0., 0., 0., 0., 0.];
+ let mut r: [f32; 8] = [0f32; 8];
+ vst2q_lane_f32::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3_s8() {
+ let a: [i8; 25] = [0, 1, 2, 2, 4, 2, 4, 7, 8, 2, 4, 7, 8, 13, 14, 15, 16, 2, 4, 7, 8, 13, 14, 15, 16];
+ let e: [i8; 24] = [1, 2, 2, 2, 4, 4, 2, 7, 7, 4, 8, 8, 2, 13, 13, 4, 14, 14, 7, 15, 15, 8, 16, 16];
+ let mut r: [i8; 24] = [0i8; 24];
+ vst3_s8(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3_s16() {
+ let a: [i16; 13] = [0, 1, 2, 2, 4, 2, 4, 7, 8, 2, 4, 7, 8];
+ let e: [i16; 12] = [1, 2, 2, 2, 4, 4, 2, 7, 7, 4, 8, 8];
+ let mut r: [i16; 12] = [0i16; 12];
+ vst3_s16(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3_s32() {
+ let a: [i32; 7] = [0, 1, 2, 2, 4, 2, 4];
+ let e: [i32; 6] = [1, 2, 2, 2, 4, 4];
+ let mut r: [i32; 6] = [0i32; 6];
+ vst3_s32(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3q_s8() {
+ let a: [i8; 49] = [0, 1, 2, 2, 4, 2, 4, 7, 8, 2, 4, 7, 8, 13, 14, 15, 16, 2, 4, 7, 8, 13, 14, 15, 16, 25, 26, 27, 28, 29, 30, 31, 32, 2, 4, 7, 8, 13, 14, 15, 16, 41, 42, 43, 44, 45, 46, 47, 48];
+ let e: [i8; 48] = [1, 2, 2, 2, 4, 4, 2, 7, 7, 4, 8, 8, 2, 13, 13, 4, 14, 14, 7, 15, 15, 8, 16, 16, 2, 25, 41, 4, 26, 42, 7, 27, 43, 8, 28, 44, 13, 29, 45, 14, 30, 46, 15, 31, 47, 16, 32, 48];
+ let mut r: [i8; 48] = [0i8; 48];
+ vst3q_s8(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3q_s16() {
+ let a: [i16; 25] = [0, 1, 2, 2, 4, 2, 4, 7, 8, 2, 4, 7, 8, 13, 14, 15, 16, 2, 4, 7, 8, 13, 14, 15, 16];
+ let e: [i16; 24] = [1, 2, 2, 2, 4, 4, 2, 7, 7, 4, 8, 8, 2, 13, 13, 4, 14, 14, 7, 15, 15, 8, 16, 16];
+ let mut r: [i16; 24] = [0i16; 24];
+ vst3q_s16(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3q_s32() {
+ let a: [i32; 13] = [0, 1, 2, 2, 4, 2, 4, 7, 8, 2, 4, 7, 8];
+ let e: [i32; 12] = [1, 2, 2, 2, 4, 4, 2, 7, 7, 4, 8, 8];
+ let mut r: [i32; 12] = [0i32; 12];
+ vst3q_s32(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3_s64() {
+ let a: [i64; 4] = [0, 1, 2, 2];
+ let e: [i64; 3] = [1, 2, 2];
+ let mut r: [i64; 3] = [0i64; 3];
+ vst3_s64(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3_u8() {
+ let a: [u8; 25] = [0, 1, 2, 2, 4, 2, 4, 7, 8, 2, 4, 7, 8, 13, 14, 15, 16, 2, 4, 7, 8, 13, 14, 15, 16];
+ let e: [u8; 24] = [1, 2, 2, 2, 4, 4, 2, 7, 7, 4, 8, 8, 2, 13, 13, 4, 14, 14, 7, 15, 15, 8, 16, 16];
+ let mut r: [u8; 24] = [0u8; 24];
+ vst3_u8(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3_u16() {
+ let a: [u16; 13] = [0, 1, 2, 2, 4, 2, 4, 7, 8, 2, 4, 7, 8];
+ let e: [u16; 12] = [1, 2, 2, 2, 4, 4, 2, 7, 7, 4, 8, 8];
+ let mut r: [u16; 12] = [0u16; 12];
+ vst3_u16(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3_u32() {
+ let a: [u32; 7] = [0, 1, 2, 2, 4, 2, 4];
+ let e: [u32; 6] = [1, 2, 2, 2, 4, 4];
+ let mut r: [u32; 6] = [0u32; 6];
+ vst3_u32(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3q_u8() {
+ let a: [u8; 49] = [0, 1, 2, 2, 4, 2, 4, 7, 8, 2, 4, 7, 8, 13, 14, 15, 16, 2, 4, 7, 8, 13, 14, 15, 16, 25, 26, 27, 28, 29, 30, 31, 32, 2, 4, 7, 8, 13, 14, 15, 16, 41, 42, 43, 44, 45, 46, 47, 48];
+ let e: [u8; 48] = [1, 2, 2, 2, 4, 4, 2, 7, 7, 4, 8, 8, 2, 13, 13, 4, 14, 14, 7, 15, 15, 8, 16, 16, 2, 25, 41, 4, 26, 42, 7, 27, 43, 8, 28, 44, 13, 29, 45, 14, 30, 46, 15, 31, 47, 16, 32, 48];
+ let mut r: [u8; 48] = [0u8; 48];
+ vst3q_u8(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3q_u16() {
+ let a: [u16; 25] = [0, 1, 2, 2, 4, 2, 4, 7, 8, 2, 4, 7, 8, 13, 14, 15, 16, 2, 4, 7, 8, 13, 14, 15, 16];
+ let e: [u16; 24] = [1, 2, 2, 2, 4, 4, 2, 7, 7, 4, 8, 8, 2, 13, 13, 4, 14, 14, 7, 15, 15, 8, 16, 16];
+ let mut r: [u16; 24] = [0u16; 24];
+ vst3q_u16(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3q_u32() {
+ let a: [u32; 13] = [0, 1, 2, 2, 4, 2, 4, 7, 8, 2, 4, 7, 8];
+ let e: [u32; 12] = [1, 2, 2, 2, 4, 4, 2, 7, 7, 4, 8, 8];
+ let mut r: [u32; 12] = [0u32; 12];
+ vst3q_u32(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3_p8() {
+ let a: [u8; 25] = [0, 1, 2, 2, 4, 2, 4, 7, 8, 2, 4, 7, 8, 13, 14, 15, 16, 2, 4, 7, 8, 13, 14, 15, 16];
+ let e: [u8; 24] = [1, 2, 2, 2, 4, 4, 2, 7, 7, 4, 8, 8, 2, 13, 13, 4, 14, 14, 7, 15, 15, 8, 16, 16];
+ let mut r: [u8; 24] = [0u8; 24];
+ vst3_p8(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3_p16() {
+ let a: [u16; 13] = [0, 1, 2, 2, 4, 2, 4, 7, 8, 2, 4, 7, 8];
+ let e: [u16; 12] = [1, 2, 2, 2, 4, 4, 2, 7, 7, 4, 8, 8];
+ let mut r: [u16; 12] = [0u16; 12];
+ vst3_p16(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3q_p8() {
+ let a: [u8; 49] = [0, 1, 2, 2, 4, 2, 4, 7, 8, 2, 4, 7, 8, 13, 14, 15, 16, 2, 4, 7, 8, 13, 14, 15, 16, 25, 26, 27, 28, 29, 30, 31, 32, 2, 4, 7, 8, 13, 14, 15, 16, 41, 42, 43, 44, 45, 46, 47, 48];
+ let e: [u8; 48] = [1, 2, 2, 2, 4, 4, 2, 7, 7, 4, 8, 8, 2, 13, 13, 4, 14, 14, 7, 15, 15, 8, 16, 16, 2, 25, 41, 4, 26, 42, 7, 27, 43, 8, 28, 44, 13, 29, 45, 14, 30, 46, 15, 31, 47, 16, 32, 48];
+ let mut r: [u8; 48] = [0u8; 48];
+ vst3q_p8(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3q_p16() {
+ let a: [u16; 25] = [0, 1, 2, 2, 4, 2, 4, 7, 8, 2, 4, 7, 8, 13, 14, 15, 16, 2, 4, 7, 8, 13, 14, 15, 16];
+ let e: [u16; 24] = [1, 2, 2, 2, 4, 4, 2, 7, 7, 4, 8, 8, 2, 13, 13, 4, 14, 14, 7, 15, 15, 8, 16, 16];
+ let mut r: [u16; 24] = [0u16; 24];
+ vst3q_p16(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3_u64() {
+ let a: [u64; 4] = [0, 1, 2, 2];
+ let e: [u64; 3] = [1, 2, 2];
+ let mut r: [u64; 3] = [0u64; 3];
+ vst3_u64(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3_p64() {
+ let a: [u64; 4] = [0, 1, 2, 2];
+ let e: [u64; 3] = [1, 2, 2];
+ let mut r: [u64; 3] = [0u64; 3];
+ vst3_p64(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3_f32() {
+ let a: [f32; 7] = [0., 1., 2., 2., 4., 2., 4.];
+ let e: [f32; 6] = [1., 2., 2., 2., 4., 4.];
+ let mut r: [f32; 6] = [0f32; 6];
+ vst3_f32(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3q_f32() {
+ let a: [f32; 13] = [0., 1., 2., 2., 4., 2., 4., 7., 8., 2., 4., 7., 8.];
+ let e: [f32; 12] = [1., 2., 2., 2., 4., 4., 2., 7., 7., 4., 8., 8.];
+ let mut r: [f32; 12] = [0f32; 12];
+ vst3q_f32(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3_lane_s8() {
+ let a: [i8; 25] = [0, 1, 2, 2, 4, 2, 4, 7, 8, 2, 4, 7, 8, 13, 14, 15, 16, 2, 4, 7, 8, 13, 14, 15, 16];
+ let e: [i8; 24] = [1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [i8; 24] = [0i8; 24];
+ vst3_lane_s8::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3_lane_s16() {
+ let a: [i16; 13] = [0, 1, 2, 2, 4, 2, 4, 7, 8, 2, 4, 7, 8];
+ let e: [i16; 12] = [1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [i16; 12] = [0i16; 12];
+ vst3_lane_s16::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3_lane_s32() {
+ let a: [i32; 7] = [0, 1, 2, 2, 4, 2, 4];
+ let e: [i32; 6] = [1, 2, 2, 0, 0, 0];
+ let mut r: [i32; 6] = [0i32; 6];
+ vst3_lane_s32::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3q_lane_s16() {
+ let a: [i16; 25] = [0, 1, 2, 2, 4, 2, 4, 7, 8, 2, 4, 7, 8, 13, 14, 15, 16, 2, 4, 7, 8, 13, 14, 15, 16];
+ let e: [i16; 24] = [1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [i16; 24] = [0i16; 24];
+ vst3q_lane_s16::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3q_lane_s32() {
+ let a: [i32; 13] = [0, 1, 2, 2, 4, 2, 4, 7, 8, 2, 4, 7, 8];
+ let e: [i32; 12] = [1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [i32; 12] = [0i32; 12];
+ vst3q_lane_s32::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3_lane_u8() {
+ let a: [u8; 25] = [0, 1, 2, 2, 4, 2, 4, 7, 8, 2, 4, 7, 8, 13, 14, 15, 16, 2, 4, 7, 8, 13, 14, 15, 16];
+ let e: [u8; 24] = [1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [u8; 24] = [0u8; 24];
+ vst3_lane_u8::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3_lane_u16() {
+ let a: [u16; 13] = [0, 1, 2, 2, 4, 2, 4, 7, 8, 2, 4, 7, 8];
+ let e: [u16; 12] = [1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [u16; 12] = [0u16; 12];
+ vst3_lane_u16::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3_lane_u32() {
+ let a: [u32; 7] = [0, 1, 2, 2, 4, 2, 4];
+ let e: [u32; 6] = [1, 2, 2, 0, 0, 0];
+ let mut r: [u32; 6] = [0u32; 6];
+ vst3_lane_u32::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3q_lane_u16() {
+ let a: [u16; 25] = [0, 1, 2, 2, 4, 2, 4, 7, 8, 2, 4, 7, 8, 13, 14, 15, 16, 2, 4, 7, 8, 13, 14, 15, 16];
+ let e: [u16; 24] = [1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [u16; 24] = [0u16; 24];
+ vst3q_lane_u16::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3q_lane_u32() {
+ let a: [u32; 13] = [0, 1, 2, 2, 4, 2, 4, 7, 8, 2, 4, 7, 8];
+ let e: [u32; 12] = [1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [u32; 12] = [0u32; 12];
+ vst3q_lane_u32::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3_lane_p8() {
+ let a: [u8; 25] = [0, 1, 2, 2, 4, 2, 4, 7, 8, 2, 4, 7, 8, 13, 14, 15, 16, 2, 4, 7, 8, 13, 14, 15, 16];
+ let e: [u8; 24] = [1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [u8; 24] = [0u8; 24];
+ vst3_lane_p8::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3_lane_p16() {
+ let a: [u16; 13] = [0, 1, 2, 2, 4, 2, 4, 7, 8, 2, 4, 7, 8];
+ let e: [u16; 12] = [1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [u16; 12] = [0u16; 12];
+ vst3_lane_p16::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3q_lane_p16() {
+ let a: [u16; 25] = [0, 1, 2, 2, 4, 2, 4, 7, 8, 2, 4, 7, 8, 13, 14, 15, 16, 2, 4, 7, 8, 13, 14, 15, 16];
+ let e: [u16; 24] = [1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [u16; 24] = [0u16; 24];
+ vst3q_lane_p16::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3_lane_f32() {
+ let a: [f32; 7] = [0., 1., 2., 2., 3., 2., 3.];
+ let e: [f32; 6] = [1., 2., 2., 0., 0., 0.];
+ let mut r: [f32; 6] = [0f32; 6];
+ vst3_lane_f32::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst3q_lane_f32() {
+ let a: [f32; 13] = [0., 1., 2., 2., 3., 2., 3., 4., 5., 2., 3., 4., 5.];
+ let e: [f32; 12] = [1., 2., 2., 0., 0., 0., 0., 0., 0., 0., 0., 0.];
+ let mut r: [f32; 12] = [0f32; 12];
+ vst3q_lane_f32::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4_s8() {
+ let a: [i8; 33] = [0, 1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 8, 16, 8, 16, 16, 32];
+ let e: [i8; 32] = [1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 8, 16, 8, 16, 16, 32];
+ let mut r: [i8; 32] = [0i8; 32];
+ vst4_s8(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4_s16() {
+ let a: [i16; 17] = [0, 1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16];
+ let e: [i16; 16] = [1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16];
+ let mut r: [i16; 16] = [0i16; 16];
+ vst4_s16(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4_s32() {
+ let a: [i32; 9] = [0, 1, 2, 2, 6, 2, 6, 6, 8];
+ let e: [i32; 8] = [1, 2, 2, 6, 2, 6, 6, 8];
+ let mut r: [i32; 8] = [0i32; 8];
+ vst4_s32(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4q_s8() {
+ let a: [i8; 65] = [0, 1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 8, 16, 8, 16, 16, 32, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 43, 44, 8, 16, 44, 48, 6, 8, 8, 16, 8, 16, 16, 32, 8, 16, 44, 48, 16, 32, 48, 64];
+ let e: [i8; 64] = [1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 8, 16, 8, 16, 16, 32, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 43, 44, 8, 16, 44, 48, 6, 8, 8, 16, 8, 16, 16, 32, 8, 16, 44, 48, 16, 32, 48, 64];
+ let mut r: [i8; 64] = [0i8; 64];
+ vst4q_s8(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4q_s16() {
+ let a: [i16; 33] = [0, 1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 8, 16, 8, 16, 16, 32];
+ let e: [i16; 32] = [1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 8, 16, 8, 16, 16, 32];
+ let mut r: [i16; 32] = [0i16; 32];
+ vst4q_s16(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4q_s32() {
+ let a: [i32; 17] = [0, 1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16];
+ let e: [i32; 16] = [1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16];
+ let mut r: [i32; 16] = [0i32; 16];
+ vst4q_s32(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4_s64() {
+ let a: [i64; 5] = [0, 1, 2, 2, 6];
+ let e: [i64; 4] = [1, 2, 2, 6];
+ let mut r: [i64; 4] = [0i64; 4];
+ vst4_s64(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4_u8() {
+ let a: [u8; 33] = [0, 1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 8, 16, 8, 16, 16, 32];
+ let e: [u8; 32] = [1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 8, 16, 8, 16, 16, 32];
+ let mut r: [u8; 32] = [0u8; 32];
+ vst4_u8(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4_u16() {
+ let a: [u16; 17] = [0, 1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16];
+ let e: [u16; 16] = [1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16];
+ let mut r: [u16; 16] = [0u16; 16];
+ vst4_u16(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4_u32() {
+ let a: [u32; 9] = [0, 1, 2, 2, 6, 2, 6, 6, 8];
+ let e: [u32; 8] = [1, 2, 2, 6, 2, 6, 6, 8];
+ let mut r: [u32; 8] = [0u32; 8];
+ vst4_u32(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4q_u8() {
+ let a: [u8; 65] = [0, 1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 8, 16, 8, 16, 16, 32, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 43, 44, 8, 16, 44, 48, 6, 8, 8, 16, 8, 16, 16, 32, 8, 16, 44, 48, 16, 32, 48, 64];
+ let e: [u8; 64] = [1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 8, 16, 8, 16, 16, 32, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 43, 44, 8, 16, 44, 48, 6, 8, 8, 16, 8, 16, 16, 32, 8, 16, 44, 48, 16, 32, 48, 64];
+ let mut r: [u8; 64] = [0u8; 64];
+ vst4q_u8(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4q_u16() {
+ let a: [u16; 33] = [0, 1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 8, 16, 8, 16, 16, 32];
+ let e: [u16; 32] = [1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 8, 16, 8, 16, 16, 32];
+ let mut r: [u16; 32] = [0u16; 32];
+ vst4q_u16(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4q_u32() {
+ let a: [u32; 17] = [0, 1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16];
+ let e: [u32; 16] = [1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16];
+ let mut r: [u32; 16] = [0u32; 16];
+ vst4q_u32(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4_p8() {
+ let a: [u8; 33] = [0, 1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 8, 16, 8, 16, 16, 32];
+ let e: [u8; 32] = [1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 8, 16, 8, 16, 16, 32];
+ let mut r: [u8; 32] = [0u8; 32];
+ vst4_p8(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4_p16() {
+ let a: [u16; 17] = [0, 1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16];
+ let e: [u16; 16] = [1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16];
+ let mut r: [u16; 16] = [0u16; 16];
+ vst4_p16(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4q_p8() {
+ let a: [u8; 65] = [0, 1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 8, 16, 8, 16, 16, 32, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 43, 44, 8, 16, 44, 48, 6, 8, 8, 16, 8, 16, 16, 32, 8, 16, 44, 48, 16, 32, 48, 64];
+ let e: [u8; 64] = [1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 8, 16, 8, 16, 16, 32, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 43, 44, 8, 16, 44, 48, 6, 8, 8, 16, 8, 16, 16, 32, 8, 16, 44, 48, 16, 32, 48, 64];
+ let mut r: [u8; 64] = [0u8; 64];
+ vst4q_p8(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4q_p16() {
+ let a: [u16; 33] = [0, 1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 8, 16, 8, 16, 16, 32];
+ let e: [u16; 32] = [1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 8, 16, 8, 16, 16, 32];
+ let mut r: [u16; 32] = [0u16; 32];
+ vst4q_p16(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4_u64() {
+ let a: [u64; 5] = [0, 1, 2, 2, 6];
+ let e: [u64; 4] = [1, 2, 2, 6];
+ let mut r: [u64; 4] = [0u64; 4];
+ vst4_u64(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4_p64() {
+ let a: [u64; 5] = [0, 1, 2, 2, 6];
+ let e: [u64; 4] = [1, 2, 2, 6];
+ let mut r: [u64; 4] = [0u64; 4];
+ vst4_p64(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4_f32() {
+ let a: [f32; 9] = [0., 1., 2., 2., 6., 2., 6., 6., 8.];
+ let e: [f32; 8] = [1., 2., 2., 6., 2., 6., 6., 8.];
+ let mut r: [f32; 8] = [0f32; 8];
+ vst4_f32(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4q_f32() {
+ let a: [f32; 17] = [0., 1., 2., 2., 6., 2., 6., 6., 8., 2., 6., 6., 8., 6., 8., 8., 16.];
+ let e: [f32; 16] = [1., 2., 2., 6., 2., 6., 6., 8., 2., 6., 6., 8., 6., 8., 8., 16.];
+ let mut r: [f32; 16] = [0f32; 16];
+ vst4q_f32(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4_lane_s8() {
+ let a: [i8; 33] = [0, 1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 8, 16, 8, 16, 16, 32];
+ let e: [i8; 32] = [1, 2, 2, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [i8; 32] = [0i8; 32];
+ vst4_lane_s8::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4_lane_s16() {
+ let a: [i16; 17] = [0, 1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16];
+ let e: [i16; 16] = [1, 2, 2, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [i16; 16] = [0i16; 16];
+ vst4_lane_s16::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4_lane_s32() {
+ let a: [i32; 9] = [0, 1, 2, 2, 6, 2, 6, 6, 8];
+ let e: [i32; 8] = [1, 2, 2, 6, 0, 0, 0, 0];
+ let mut r: [i32; 8] = [0i32; 8];
+ vst4_lane_s32::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4q_lane_s16() {
+ let a: [i16; 33] = [0, 1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 8, 16, 8, 16, 16, 32];
+ let e: [i16; 32] = [1, 2, 2, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [i16; 32] = [0i16; 32];
+ vst4q_lane_s16::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4q_lane_s32() {
+ let a: [i32; 17] = [0, 1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16];
+ let e: [i32; 16] = [1, 2, 2, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [i32; 16] = [0i32; 16];
+ vst4q_lane_s32::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4_lane_u8() {
+ let a: [u8; 33] = [0, 1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 8, 16, 8, 16, 16, 32];
+ let e: [u8; 32] = [1, 2, 2, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [u8; 32] = [0u8; 32];
+ vst4_lane_u8::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4_lane_u16() {
+ let a: [u16; 17] = [0, 1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16];
+ let e: [u16; 16] = [1, 2, 2, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [u16; 16] = [0u16; 16];
+ vst4_lane_u16::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4_lane_u32() {
+ let a: [u32; 9] = [0, 1, 2, 2, 6, 2, 6, 6, 8];
+ let e: [u32; 8] = [1, 2, 2, 6, 0, 0, 0, 0];
+ let mut r: [u32; 8] = [0u32; 8];
+ vst4_lane_u32::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4q_lane_u16() {
+ let a: [u16; 33] = [0, 1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 8, 16, 8, 16, 16, 32];
+ let e: [u16; 32] = [1, 2, 2, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [u16; 32] = [0u16; 32];
+ vst4q_lane_u16::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4q_lane_u32() {
+ let a: [u32; 17] = [0, 1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16];
+ let e: [u32; 16] = [1, 2, 2, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [u32; 16] = [0u32; 16];
+ vst4q_lane_u32::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4_lane_p8() {
+ let a: [u8; 33] = [0, 1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 8, 16, 8, 16, 16, 32];
+ let e: [u8; 32] = [1, 2, 2, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [u8; 32] = [0u8; 32];
+ vst4_lane_p8::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4_lane_p16() {
+ let a: [u16; 17] = [0, 1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16];
+ let e: [u16; 16] = [1, 2, 2, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [u16; 16] = [0u16; 16];
+ vst4_lane_p16::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4q_lane_p16() {
+ let a: [u16; 33] = [0, 1, 2, 2, 6, 2, 6, 6, 8, 2, 6, 6, 8, 6, 8, 8, 16, 2, 6, 6, 8, 6, 8, 8, 16, 6, 8, 8, 16, 8, 16, 16, 32];
+ let e: [u16; 32] = [1, 2, 2, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ let mut r: [u16; 32] = [0u16; 32];
+ vst4q_lane_p16::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4_lane_f32() {
+ let a: [f32; 9] = [0., 1., 2., 2., 6., 2., 6., 6., 8.];
+ let e: [f32; 8] = [1., 2., 2., 6., 0., 0., 0., 0.];
+ let mut r: [f32; 8] = [0f32; 8];
+ vst4_lane_f32::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vst4q_lane_f32() {
+ let a: [f32; 17] = [0., 1., 2., 2., 6., 2., 6., 6., 8., 2., 6., 6., 8., 6., 8., 8., 16.];
+ let e: [f32; 16] = [1., 2., 2., 6., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.];
+ let mut r: [f32; 16] = [0f32; 16];
+ vst4q_lane_f32::<0>(r.as_mut_ptr(), core::ptr::read_unaligned(a[1..].as_ptr() as _));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmul_s8() {
+ let a: i8x8 = i8x8::new(1, 2, 1, 2, 1, 2, 1, 2);
+ let b: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: i8x8 = i8x8::new(1, 4, 3, 8, 5, 12, 7, 16);
+ let r: i8x8 = transmute(vmul_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulq_s8() {
+ let a: i8x16 = i8x16::new(1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2);
+ let b: i8x16 = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let e: i8x16 = i8x16::new(1, 4, 3, 8, 5, 12, 7, 16, 9, 20, 11, 24, 13, 28, 15, 32);
+ let r: i8x16 = transmute(vmulq_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmul_s16() {
+ let a: i16x4 = i16x4::new(1, 2, 1, 2);
+ let b: i16x4 = i16x4::new(1, 2, 3, 4);
+ let e: i16x4 = i16x4::new(1, 4, 3, 8);
+ let r: i16x4 = transmute(vmul_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulq_s16() {
+ let a: i16x8 = i16x8::new(1, 2, 1, 2, 1, 2, 1, 2);
+ let b: i16x8 = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: i16x8 = i16x8::new(1, 4, 3, 8, 5, 12, 7, 16);
+ let r: i16x8 = transmute(vmulq_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmul_s32() {
+ let a: i32x2 = i32x2::new(1, 2);
+ let b: i32x2 = i32x2::new(1, 2);
+ let e: i32x2 = i32x2::new(1, 4);
+ let r: i32x2 = transmute(vmul_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulq_s32() {
+ let a: i32x4 = i32x4::new(1, 2, 1, 2);
+ let b: i32x4 = i32x4::new(1, 2, 3, 4);
+ let e: i32x4 = i32x4::new(1, 4, 3, 8);
+ let r: i32x4 = transmute(vmulq_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmul_u8() {
+ let a: u8x8 = u8x8::new(1, 2, 1, 2, 1, 2, 1, 2);
+ let b: u8x8 = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: u8x8 = u8x8::new(1, 4, 3, 8, 5, 12, 7, 16);
+ let r: u8x8 = transmute(vmul_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulq_u8() {
+ let a: u8x16 = u8x16::new(1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2);
+ let b: u8x16 = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let e: u8x16 = u8x16::new(1, 4, 3, 8, 5, 12, 7, 16, 9, 20, 11, 24, 13, 28, 15, 32);
+ let r: u8x16 = transmute(vmulq_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmul_u16() {
+ let a: u16x4 = u16x4::new(1, 2, 1, 2);
+ let b: u16x4 = u16x4::new(1, 2, 3, 4);
+ let e: u16x4 = u16x4::new(1, 4, 3, 8);
+ let r: u16x4 = transmute(vmul_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulq_u16() {
+ let a: u16x8 = u16x8::new(1, 2, 1, 2, 1, 2, 1, 2);
+ let b: u16x8 = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: u16x8 = u16x8::new(1, 4, 3, 8, 5, 12, 7, 16);
+ let r: u16x8 = transmute(vmulq_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmul_u32() {
+ let a: u32x2 = u32x2::new(1, 2);
+ let b: u32x2 = u32x2::new(1, 2);
+ let e: u32x2 = u32x2::new(1, 4);
+ let r: u32x2 = transmute(vmul_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulq_u32() {
+ let a: u32x4 = u32x4::new(1, 2, 1, 2);
+ let b: u32x4 = u32x4::new(1, 2, 3, 4);
+ let e: u32x4 = u32x4::new(1, 4, 3, 8);
+ let r: u32x4 = transmute(vmulq_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmul_p8() {
+ let a: i8x8 = i8x8::new(1, 3, 1, 3, 1, 3, 1, 3);
+ let b: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: i8x8 = i8x8::new(1, 6, 3, 12, 5, 10, 7, 24);
+ let r: i8x8 = transmute(vmul_p8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulq_p8() {
+ let a: i8x16 = i8x16::new(1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3);
+ let b: i8x16 = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let e: i8x16 = i8x16::new(1, 6, 3, 12, 5, 10, 7, 24, 9, 30, 11, 20, 13, 18, 15, 48);
+ let r: i8x16 = transmute(vmulq_p8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmul_f32() {
+ let a: f32x2 = f32x2::new(1.0, 2.0);
+ let b: f32x2 = f32x2::new(2.0, 3.0);
+ let e: f32x2 = f32x2::new(2.0, 6.0);
+ let r: f32x2 = transmute(vmul_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulq_f32() {
+ let a: f32x4 = f32x4::new(1.0, 2.0, 1.0, 2.0);
+ let b: f32x4 = f32x4::new(2.0, 3.0, 4.0, 5.0);
+ let e: f32x4 = f32x4::new(2.0, 6.0, 4.0, 10.0);
+ let r: f32x4 = transmute(vmulq_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmul_n_s16() {
+ let a: i16x4 = i16x4::new(1, 2, 3, 4);
+ let b: i16 = 2;
+ let e: i16x4 = i16x4::new(2, 4, 6, 8);
+ let r: i16x4 = transmute(vmul_n_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulq_n_s16() {
+ let a: i16x8 = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: i16 = 2;
+ let e: i16x8 = i16x8::new(2, 4, 6, 8, 10, 12, 14, 16);
+ let r: i16x8 = transmute(vmulq_n_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmul_n_s32() {
+ let a: i32x2 = i32x2::new(1, 2);
+ let b: i32 = 2;
+ let e: i32x2 = i32x2::new(2, 4);
+ let r: i32x2 = transmute(vmul_n_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulq_n_s32() {
+ let a: i32x4 = i32x4::new(1, 2, 3, 4);
+ let b: i32 = 2;
+ let e: i32x4 = i32x4::new(2, 4, 6, 8);
+ let r: i32x4 = transmute(vmulq_n_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmul_n_u16() {
+ let a: u16x4 = u16x4::new(1, 2, 3, 4);
+ let b: u16 = 2;
+ let e: u16x4 = u16x4::new(2, 4, 6, 8);
+ let r: u16x4 = transmute(vmul_n_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulq_n_u16() {
+ let a: u16x8 = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: u16 = 2;
+ let e: u16x8 = u16x8::new(2, 4, 6, 8, 10, 12, 14, 16);
+ let r: u16x8 = transmute(vmulq_n_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmul_n_u32() {
+ let a: u32x2 = u32x2::new(1, 2);
+ let b: u32 = 2;
+ let e: u32x2 = u32x2::new(2, 4);
+ let r: u32x2 = transmute(vmul_n_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulq_n_u32() {
+ let a: u32x4 = u32x4::new(1, 2, 3, 4);
+ let b: u32 = 2;
+ let e: u32x4 = u32x4::new(2, 4, 6, 8);
+ let r: u32x4 = transmute(vmulq_n_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmul_n_f32() {
+ let a: f32x2 = f32x2::new(1., 2.);
+ let b: f32 = 2.;
+ let e: f32x2 = f32x2::new(2., 4.);
+ let r: f32x2 = transmute(vmul_n_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulq_n_f32() {
+ let a: f32x4 = f32x4::new(1., 2., 3., 4.);
+ let b: f32 = 2.;
+ let e: f32x4 = f32x4::new(2., 4., 6., 8.);
+ let r: f32x4 = transmute(vmulq_n_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmul_lane_s16() {
+ let a: i16x4 = i16x4::new(1, 2, 3, 4);
+ let b: i16x4 = i16x4::new(0, 2, 0, 0);
+ let e: i16x4 = i16x4::new(2, 4, 6, 8);
+ let r: i16x4 = transmute(vmul_lane_s16::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmul_laneq_s16() {
+ let a: i16x4 = i16x4::new(1, 2, 3, 4);
+ let b: i16x8 = i16x8::new(0, 2, 0, 0, 0, 0, 0, 0);
+ let e: i16x4 = i16x4::new(2, 4, 6, 8);
+ let r: i16x4 = transmute(vmul_laneq_s16::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulq_lane_s16() {
+ let a: i16x8 = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: i16x4 = i16x4::new(0, 2, 0, 0);
+ let e: i16x8 = i16x8::new(2, 4, 6, 8, 10, 12, 14, 16);
+ let r: i16x8 = transmute(vmulq_lane_s16::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulq_laneq_s16() {
+ let a: i16x8 = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: i16x8 = i16x8::new(0, 2, 0, 0, 0, 0, 0, 0);
+ let e: i16x8 = i16x8::new(2, 4, 6, 8, 10, 12, 14, 16);
+ let r: i16x8 = transmute(vmulq_laneq_s16::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmul_lane_s32() {
+ let a: i32x2 = i32x2::new(1, 2);
+ let b: i32x2 = i32x2::new(0, 2);
+ let e: i32x2 = i32x2::new(2, 4);
+ let r: i32x2 = transmute(vmul_lane_s32::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmul_laneq_s32() {
+ let a: i32x2 = i32x2::new(1, 2);
+ let b: i32x4 = i32x4::new(0, 2, 0, 0);
+ let e: i32x2 = i32x2::new(2, 4);
+ let r: i32x2 = transmute(vmul_laneq_s32::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulq_lane_s32() {
+ let a: i32x4 = i32x4::new(1, 2, 3, 4);
+ let b: i32x2 = i32x2::new(0, 2);
+ let e: i32x4 = i32x4::new(2, 4, 6, 8);
+ let r: i32x4 = transmute(vmulq_lane_s32::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulq_laneq_s32() {
+ let a: i32x4 = i32x4::new(1, 2, 3, 4);
+ let b: i32x4 = i32x4::new(0, 2, 0, 0);
+ let e: i32x4 = i32x4::new(2, 4, 6, 8);
+ let r: i32x4 = transmute(vmulq_laneq_s32::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmul_lane_u16() {
+ let a: u16x4 = u16x4::new(1, 2, 3, 4);
+ let b: u16x4 = u16x4::new(0, 2, 0, 0);
+ let e: u16x4 = u16x4::new(2, 4, 6, 8);
+ let r: u16x4 = transmute(vmul_lane_u16::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmul_laneq_u16() {
+ let a: u16x4 = u16x4::new(1, 2, 3, 4);
+ let b: u16x8 = u16x8::new(0, 2, 0, 0, 0, 0, 0, 0);
+ let e: u16x4 = u16x4::new(2, 4, 6, 8);
+ let r: u16x4 = transmute(vmul_laneq_u16::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulq_lane_u16() {
+ let a: u16x8 = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: u16x4 = u16x4::new(0, 2, 0, 0);
+ let e: u16x8 = u16x8::new(2, 4, 6, 8, 10, 12, 14, 16);
+ let r: u16x8 = transmute(vmulq_lane_u16::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulq_laneq_u16() {
+ let a: u16x8 = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: u16x8 = u16x8::new(0, 2, 0, 0, 0, 0, 0, 0);
+ let e: u16x8 = u16x8::new(2, 4, 6, 8, 10, 12, 14, 16);
+ let r: u16x8 = transmute(vmulq_laneq_u16::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmul_lane_u32() {
+ let a: u32x2 = u32x2::new(1, 2);
+ let b: u32x2 = u32x2::new(0, 2);
+ let e: u32x2 = u32x2::new(2, 4);
+ let r: u32x2 = transmute(vmul_lane_u32::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmul_laneq_u32() {
+ let a: u32x2 = u32x2::new(1, 2);
+ let b: u32x4 = u32x4::new(0, 2, 0, 0);
+ let e: u32x2 = u32x2::new(2, 4);
+ let r: u32x2 = transmute(vmul_laneq_u32::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulq_lane_u32() {
+ let a: u32x4 = u32x4::new(1, 2, 3, 4);
+ let b: u32x2 = u32x2::new(0, 2);
+ let e: u32x4 = u32x4::new(2, 4, 6, 8);
+ let r: u32x4 = transmute(vmulq_lane_u32::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulq_laneq_u32() {
+ let a: u32x4 = u32x4::new(1, 2, 3, 4);
+ let b: u32x4 = u32x4::new(0, 2, 0, 0);
+ let e: u32x4 = u32x4::new(2, 4, 6, 8);
+ let r: u32x4 = transmute(vmulq_laneq_u32::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmul_lane_f32() {
+ let a: f32x2 = f32x2::new(1., 2.);
+ let b: f32x2 = f32x2::new(2., 0.);
+ let e: f32x2 = f32x2::new(2., 4.);
+ let r: f32x2 = transmute(vmul_lane_f32::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmul_laneq_f32() {
+ let a: f32x2 = f32x2::new(1., 2.);
+ let b: f32x4 = f32x4::new(2., 0., 0., 0.);
+ let e: f32x2 = f32x2::new(2., 4.);
+ let r: f32x2 = transmute(vmul_laneq_f32::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulq_lane_f32() {
+ let a: f32x4 = f32x4::new(1., 2., 3., 4.);
+ let b: f32x2 = f32x2::new(2., 0.);
+ let e: f32x4 = f32x4::new(2., 4., 6., 8.);
+ let r: f32x4 = transmute(vmulq_lane_f32::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulq_laneq_f32() {
+ let a: f32x4 = f32x4::new(1., 2., 3., 4.);
+ let b: f32x4 = f32x4::new(2., 0., 0., 0.);
+ let e: f32x4 = f32x4::new(2., 4., 6., 8.);
+ let r: f32x4 = transmute(vmulq_laneq_f32::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmull_s8() {
+ let a: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: i8x8 = i8x8::new(1, 2, 1, 2, 1, 2, 1, 2);
+ let e: i16x8 = i16x8::new(1, 4, 3, 8, 5, 12, 7, 16);
+ let r: i16x8 = transmute(vmull_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmull_s16() {
+ let a: i16x4 = i16x4::new(1, 2, 3, 4);
+ let b: i16x4 = i16x4::new(1, 2, 1, 2);
+ let e: i32x4 = i32x4::new(1, 4, 3, 8);
+ let r: i32x4 = transmute(vmull_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmull_s32() {
+ let a: i32x2 = i32x2::new(1, 2);
+ let b: i32x2 = i32x2::new(1, 2);
+ let e: i64x2 = i64x2::new(1, 4);
+ let r: i64x2 = transmute(vmull_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmull_u8() {
+ let a: u8x8 = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: u8x8 = u8x8::new(1, 2, 1, 2, 1, 2, 1, 2);
+ let e: u16x8 = u16x8::new(1, 4, 3, 8, 5, 12, 7, 16);
+ let r: u16x8 = transmute(vmull_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmull_u16() {
+ let a: u16x4 = u16x4::new(1, 2, 3, 4);
+ let b: u16x4 = u16x4::new(1, 2, 1, 2);
+ let e: u32x4 = u32x4::new(1, 4, 3, 8);
+ let r: u32x4 = transmute(vmull_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmull_u32() {
+ let a: u32x2 = u32x2::new(1, 2);
+ let b: u32x2 = u32x2::new(1, 2);
+ let e: u64x2 = u64x2::new(1, 4);
+ let r: u64x2 = transmute(vmull_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmull_p8() {
+ let a: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: i8x8 = i8x8::new(1, 3, 1, 3, 1, 3, 1, 3);
+ let e: i16x8 = i16x8::new(1, 6, 3, 12, 5, 10, 7, 24);
+ let r: i16x8 = transmute(vmull_p8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmull_n_s16() {
+ let a: i16x4 = i16x4::new(1, 2, 3, 4);
+ let b: i16 = 2;
+ let e: i32x4 = i32x4::new(2, 4, 6, 8);
+ let r: i32x4 = transmute(vmull_n_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmull_n_s32() {
+ let a: i32x2 = i32x2::new(1, 2);
+ let b: i32 = 2;
+ let e: i64x2 = i64x2::new(2, 4);
+ let r: i64x2 = transmute(vmull_n_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmull_n_u16() {
+ let a: u16x4 = u16x4::new(1, 2, 3, 4);
+ let b: u16 = 2;
+ let e: u32x4 = u32x4::new(2, 4, 6, 8);
+ let r: u32x4 = transmute(vmull_n_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmull_n_u32() {
+ let a: u32x2 = u32x2::new(1, 2);
+ let b: u32 = 2;
+ let e: u64x2 = u64x2::new(2, 4);
+ let r: u64x2 = transmute(vmull_n_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmull_lane_s16() {
+ let a: i16x4 = i16x4::new(1, 2, 3, 4);
+ let b: i16x4 = i16x4::new(0, 2, 0, 0);
+ let e: i32x4 = i32x4::new(2, 4, 6, 8);
+ let r: i32x4 = transmute(vmull_lane_s16::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmull_laneq_s16() {
+ let a: i16x4 = i16x4::new(1, 2, 3, 4);
+ let b: i16x8 = i16x8::new(0, 2, 0, 0, 0, 0, 0, 0);
+ let e: i32x4 = i32x4::new(2, 4, 6, 8);
+ let r: i32x4 = transmute(vmull_laneq_s16::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmull_lane_s32() {
+ let a: i32x2 = i32x2::new(1, 2);
+ let b: i32x2 = i32x2::new(0, 2);
+ let e: i64x2 = i64x2::new(2, 4);
+ let r: i64x2 = transmute(vmull_lane_s32::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmull_laneq_s32() {
+ let a: i32x2 = i32x2::new(1, 2);
+ let b: i32x4 = i32x4::new(0, 2, 0, 0);
+ let e: i64x2 = i64x2::new(2, 4);
+ let r: i64x2 = transmute(vmull_laneq_s32::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmull_lane_u16() {
+ let a: u16x4 = u16x4::new(1, 2, 3, 4);
+ let b: u16x4 = u16x4::new(0, 2, 0, 0);
+ let e: u32x4 = u32x4::new(2, 4, 6, 8);
+ let r: u32x4 = transmute(vmull_lane_u16::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmull_laneq_u16() {
+ let a: u16x4 = u16x4::new(1, 2, 3, 4);
+ let b: u16x8 = u16x8::new(0, 2, 0, 0, 0, 0, 0, 0);
+ let e: u32x4 = u32x4::new(2, 4, 6, 8);
+ let r: u32x4 = transmute(vmull_laneq_u16::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmull_lane_u32() {
+ let a: u32x2 = u32x2::new(1, 2);
+ let b: u32x2 = u32x2::new(0, 2);
+ let e: u64x2 = u64x2::new(2, 4);
+ let r: u64x2 = transmute(vmull_lane_u32::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmull_laneq_u32() {
+ let a: u32x2 = u32x2::new(1, 2);
+ let b: u32x4 = u32x4::new(0, 2, 0, 0);
+ let e: u64x2 = u64x2::new(2, 4);
+ let r: u64x2 = transmute(vmull_laneq_u32::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vfma_f32() {
+ let a: f32x2 = f32x2::new(8.0, 18.0);
+ let b: f32x2 = f32x2::new(6.0, 4.0);
+ let c: f32x2 = f32x2::new(2.0, 3.0);
+ let e: f32x2 = f32x2::new(20.0, 30.0);
+ let r: f32x2 = transmute(vfma_f32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vfmaq_f32() {
+ let a: f32x4 = f32x4::new(8.0, 18.0, 12.0, 10.0);
+ let b: f32x4 = f32x4::new(6.0, 4.0, 7.0, 8.0);
+ let c: f32x4 = f32x4::new(2.0, 3.0, 4.0, 5.0);
+ let e: f32x4 = f32x4::new(20.0, 30.0, 40.0, 50.0);
+ let r: f32x4 = transmute(vfmaq_f32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vfma_n_f32() {
+ let a: f32x2 = f32x2::new(2.0, 3.0);
+ let b: f32x2 = f32x2::new(6.0, 4.0);
+ let c: f32 = 8.0;
+ let e: f32x2 = f32x2::new(50.0, 35.0);
+ let r: f32x2 = transmute(vfma_n_f32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vfmaq_n_f32() {
+ let a: f32x4 = f32x4::new(2.0, 3.0, 4.0, 5.0);
+ let b: f32x4 = f32x4::new(6.0, 4.0, 7.0, 8.0);
+ let c: f32 = 8.0;
+ let e: f32x4 = f32x4::new(50.0, 35.0, 60.0, 69.0);
+ let r: f32x4 = transmute(vfmaq_n_f32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vfms_f32() {
+ let a: f32x2 = f32x2::new(20.0, 30.0);
+ let b: f32x2 = f32x2::new(6.0, 4.0);
+ let c: f32x2 = f32x2::new(2.0, 3.0);
+ let e: f32x2 = f32x2::new(8.0, 18.0);
+ let r: f32x2 = transmute(vfms_f32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vfmsq_f32() {
+ let a: f32x4 = f32x4::new(20.0, 30.0, 40.0, 50.0);
+ let b: f32x4 = f32x4::new(6.0, 4.0, 7.0, 8.0);
+ let c: f32x4 = f32x4::new(2.0, 3.0, 4.0, 5.0);
+ let e: f32x4 = f32x4::new(8.0, 18.0, 12.0, 10.0);
+ let r: f32x4 = transmute(vfmsq_f32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vfms_n_f32() {
+ let a: f32x2 = f32x2::new(50.0, 35.0);
+ let b: f32x2 = f32x2::new(6.0, 4.0);
+ let c: f32 = 8.0;
+ let e: f32x2 = f32x2::new(2.0, 3.0);
+ let r: f32x2 = transmute(vfms_n_f32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vfmsq_n_f32() {
+ let a: f32x4 = f32x4::new(50.0, 35.0, 60.0, 69.0);
+ let b: f32x4 = f32x4::new(6.0, 4.0, 7.0, 8.0);
+ let c: f32 = 8.0;
+ let e: f32x4 = f32x4::new(2.0, 3.0, 4.0, 5.0);
+ let r: f32x4 = transmute(vfmsq_n_f32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsub_s8() {
+ let a: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: i8x8 = i8x8::new(1, 2, 1, 2, 1, 2, 1, 2);
+ let e: i8x8 = i8x8::new(0, 0, 2, 2, 4, 4, 6, 6);
+ let r: i8x8 = transmute(vsub_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubq_s8() {
+ let a: i8x16 = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let b: i8x16 = i8x16::new(1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2);
+ let e: i8x16 = i8x16::new(0, 0, 2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12, 14, 14);
+ let r: i8x16 = transmute(vsubq_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsub_s16() {
+ let a: i16x4 = i16x4::new(1, 2, 3, 4);
+ let b: i16x4 = i16x4::new(1, 2, 1, 2);
+ let e: i16x4 = i16x4::new(0, 0, 2, 2);
+ let r: i16x4 = transmute(vsub_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubq_s16() {
+ let a: i16x8 = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: i16x8 = i16x8::new(1, 2, 1, 2, 1, 2, 1, 2);
+ let e: i16x8 = i16x8::new(0, 0, 2, 2, 4, 4, 6, 6);
+ let r: i16x8 = transmute(vsubq_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsub_s32() {
+ let a: i32x2 = i32x2::new(1, 2);
+ let b: i32x2 = i32x2::new(1, 2);
+ let e: i32x2 = i32x2::new(0, 0);
+ let r: i32x2 = transmute(vsub_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubq_s32() {
+ let a: i32x4 = i32x4::new(1, 2, 3, 4);
+ let b: i32x4 = i32x4::new(1, 2, 1, 2);
+ let e: i32x4 = i32x4::new(0, 0, 2, 2);
+ let r: i32x4 = transmute(vsubq_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsub_u8() {
+ let a: u8x8 = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: u8x8 = u8x8::new(1, 2, 1, 2, 1, 2, 1, 2);
+ let e: u8x8 = u8x8::new(0, 0, 2, 2, 4, 4, 6, 6);
+ let r: u8x8 = transmute(vsub_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubq_u8() {
+ let a: u8x16 = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let b: u8x16 = u8x16::new(1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2);
+ let e: u8x16 = u8x16::new(0, 0, 2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12, 14, 14);
+ let r: u8x16 = transmute(vsubq_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsub_u16() {
+ let a: u16x4 = u16x4::new(1, 2, 3, 4);
+ let b: u16x4 = u16x4::new(1, 2, 1, 2);
+ let e: u16x4 = u16x4::new(0, 0, 2, 2);
+ let r: u16x4 = transmute(vsub_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubq_u16() {
+ let a: u16x8 = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: u16x8 = u16x8::new(1, 2, 1, 2, 1, 2, 1, 2);
+ let e: u16x8 = u16x8::new(0, 0, 2, 2, 4, 4, 6, 6);
+ let r: u16x8 = transmute(vsubq_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsub_u32() {
+ let a: u32x2 = u32x2::new(1, 2);
+ let b: u32x2 = u32x2::new(1, 2);
+ let e: u32x2 = u32x2::new(0, 0);
+ let r: u32x2 = transmute(vsub_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubq_u32() {
+ let a: u32x4 = u32x4::new(1, 2, 3, 4);
+ let b: u32x4 = u32x4::new(1, 2, 1, 2);
+ let e: u32x4 = u32x4::new(0, 0, 2, 2);
+ let r: u32x4 = transmute(vsubq_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsub_s64() {
+ let a: i64x1 = i64x1::new(1);
+ let b: i64x1 = i64x1::new(1);
+ let e: i64x1 = i64x1::new(0);
+ let r: i64x1 = transmute(vsub_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubq_s64() {
+ let a: i64x2 = i64x2::new(1, 2);
+ let b: i64x2 = i64x2::new(1, 2);
+ let e: i64x2 = i64x2::new(0, 0);
+ let r: i64x2 = transmute(vsubq_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsub_u64() {
+ let a: u64x1 = u64x1::new(1);
+ let b: u64x1 = u64x1::new(1);
+ let e: u64x1 = u64x1::new(0);
+ let r: u64x1 = transmute(vsub_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubq_u64() {
+ let a: u64x2 = u64x2::new(1, 2);
+ let b: u64x2 = u64x2::new(1, 2);
+ let e: u64x2 = u64x2::new(0, 0);
+ let r: u64x2 = transmute(vsubq_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsub_f32() {
+ let a: f32x2 = f32x2::new(1.0, 4.0);
+ let b: f32x2 = f32x2::new(1.0, 2.0);
+ let e: f32x2 = f32x2::new(0.0, 2.0);
+ let r: f32x2 = transmute(vsub_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubq_f32() {
+ let a: f32x4 = f32x4::new(1.0, 4.0, 3.0, 8.0);
+ let b: f32x4 = f32x4::new(1.0, 2.0, 3.0, 4.0);
+ let e: f32x4 = f32x4::new(0.0, 2.0, 0.0, 4.0);
+ let r: f32x4 = transmute(vsubq_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vadd_p8() {
+ let a: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: i8x8 = i8x8::new(1, 1, 1, 1, 1, 1, 1, 1);
+ let e: i8x8 = i8x8::new(0, 3, 2, 5, 4, 7, 6, 9);
+ let r: i8x8 = transmute(vadd_p8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vadd_p16() {
+ let a: i16x4 = i16x4::new(1, 2, 3, 4);
+ let b: i16x4 = i16x4::new(1, 1, 1, 1);
+ let e: i16x4 = i16x4::new(0, 3, 2, 5);
+ let r: i16x4 = transmute(vadd_p16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddq_p8() {
+ let a: i8x16 = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let b: i8x16 = i8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
+ let e: i8x16 = i8x16::new(0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14, 17);
+ let r: i8x16 = transmute(vaddq_p8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddq_p16() {
+ let a: i16x8 = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: i16x8 = i16x8::new(1, 1, 1, 1, 1, 1, 1, 1);
+ let e: i16x8 = i16x8::new(0, 3, 2, 5, 4, 7, 6, 9);
+ let r: i16x8 = transmute(vaddq_p16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vadd_p64() {
+ let a: i64x1 = i64x1::new(1);
+ let b: i64x1 = i64x1::new(1);
+ let e: i64x1 = i64x1::new(0);
+ let r: i64x1 = transmute(vadd_p64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddq_p64() {
+ let a: i64x2 = i64x2::new(1, 2);
+ let b: i64x2 = i64x2::new(1, 1);
+ let e: i64x2 = i64x2::new(0, 3);
+ let r: i64x2 = transmute(vaddq_p64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddq_p128() {
+ let a: p128 = 16;
+ let b: p128 = 1;
+ let e: p128 = 17;
+ let r: p128 = transmute(vaddq_p128(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubhn_s16() {
+ let a: i16x8 = i16x8::new(0x7F_FF, -32768, 1, 1, 0x7F_FF, -32768, 1, 1);
+ let b: i16x8 = i16x8::new(1, 0, 0, 0, 1, 0, 0, 0);
+ let e: i8x8 = i8x8::new(0x7F, -128, 0, 0, 0x7F, -128, 0, 0);
+ let r: i8x8 = transmute(vsubhn_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubhn_s32() {
+ let a: i32x4 = i32x4::new(0x7F_FF_FF_FF, -2147483648, 1, 1);
+ let b: i32x4 = i32x4::new(1, 0, 0, 0);
+ let e: i16x4 = i16x4::new(0x7F_FF, -32768, 0, 0);
+ let r: i16x4 = transmute(vsubhn_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubhn_s64() {
+ let a: i64x2 = i64x2::new(0x7F_FF_FF_FF_FF_FF_FF_FF, -9223372036854775808);
+ let b: i64x2 = i64x2::new(1, 0);
+ let e: i32x2 = i32x2::new(0x7F_FF_FF_FF, -2147483648);
+ let r: i32x2 = transmute(vsubhn_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubhn_u16() {
+ let a: u16x8 = u16x8::new(0xFF_FF, 0, 1, 1, 0xFF_FF, 0, 1, 1);
+ let b: u16x8 = u16x8::new(1, 0, 0, 0, 1, 0, 0, 0);
+ let e: u8x8 = u8x8::new(0xFF, 0, 0, 0, 0xFF, 0, 0, 0);
+ let r: u8x8 = transmute(vsubhn_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubhn_u32() {
+ let a: u32x4 = u32x4::new(0xFF_FF_FF_FF, 0, 1, 1);
+ let b: u32x4 = u32x4::new(1, 0, 0, 0);
+ let e: u16x4 = u16x4::new(0xFF_FF, 0, 0, 0);
+ let r: u16x4 = transmute(vsubhn_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubhn_u64() {
+ let a: u64x2 = u64x2::new(0xFF_FF_FF_FF_FF_FF_FF_FF, 0);
+ let b: u64x2 = u64x2::new(1, 0);
+ let e: u32x2 = u32x2::new(0xFF_FF_FF_FF, 0);
+ let r: u32x2 = transmute(vsubhn_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubhn_high_s16() {
+ let a: i8x8 = i8x8::new(0x7F, 0, 0x7F, 0, 0x7F, 0, 0x7F, 0);
+ let b: i16x8 = i16x8::new(0x7F_FF, 1, 0x7F_FF, 1, 0x7F_FF, 1, 0x7F_FF, 1);
+ let c: i16x8 = i16x8::new(1, 0, 1, 0, 1, 0, 1, 0);
+ let e: i8x16 = i8x16::new(0x7F, 0, 0x7F, 0, 0x7F, 0, 0x7F, 0, 0x7F, 0, 0x7F, 0, 0x7F, 0, 0x7F, 0);
+ let r: i8x16 = transmute(vsubhn_high_s16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubhn_high_s32() {
+ let a: i16x4 = i16x4::new(0x7F_FF, 0, 0x7F_FF, 0);
+ let b: i32x4 = i32x4::new(0x7F_FF_FF_FF, 1, 0x7F_FF_FF_FF, 1);
+ let c: i32x4 = i32x4::new(1, 0, 1, 0);
+ let e: i16x8 = i16x8::new(0x7F_FF, 0, 0x7F_FF, 0, 0x7F_FF, 0, 0x7F_FF, 0);
+ let r: i16x8 = transmute(vsubhn_high_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubhn_high_s64() {
+ let a: i32x2 = i32x2::new(0x7F_FF_FF_FF, 0);
+ let b: i64x2 = i64x2::new(0x7F_FF_FF_FF_FF_FF_FF_FF, 1);
+ let c: i64x2 = i64x2::new(1, 0);
+ let e: i32x4 = i32x4::new(0x7F_FF_FF_FF, 0, 0x7F_FF_FF_FF, 0);
+ let r: i32x4 = transmute(vsubhn_high_s64(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubhn_high_u16() {
+ let a: u8x8 = u8x8::new(0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0);
+ let b: u16x8 = u16x8::new(0xFF_FF, 1, 0xFF_FF, 1, 0xFF_FF, 1, 0xFF_FF, 1);
+ let c: u16x8 = u16x8::new(1, 0, 1, 0, 1, 0, 1, 0);
+ let e: u8x16 = u8x16::new(0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0);
+ let r: u8x16 = transmute(vsubhn_high_u16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubhn_high_u32() {
+ let a: u16x4 = u16x4::new(0xFF_FF, 0, 0xFF_FF, 0);
+ let b: u32x4 = u32x4::new(0xFF_FF_FF_FF, 1, 0xFF_FF_FF_FF, 1);
+ let c: u32x4 = u32x4::new(1, 0, 1, 0);
+ let e: u16x8 = u16x8::new(0xFF_FF, 0, 0xFF_FF, 0, 0xFF_FF, 0, 0xFF_FF, 0);
+ let r: u16x8 = transmute(vsubhn_high_u32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubhn_high_u64() {
+ let a: u32x2 = u32x2::new(0xFF_FF_FF_FF, 0);
+ let b: u64x2 = u64x2::new(0xFF_FF_FF_FF_FF_FF_FF_FF, 1);
+ let c: u64x2 = u64x2::new(1, 0);
+ let e: u32x4 = u32x4::new(0xFF_FF_FF_FF, 0, 0xFF_FF_FF_FF, 0);
+ let r: u32x4 = transmute(vsubhn_high_u64(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhsub_u8() {
+ let a: u8x8 = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: u8x8 = u8x8::new(1, 2, 1, 2, 1, 2, 1, 2);
+ let e: u8x8 = u8x8::new(0, 0, 1, 1, 2, 2, 3, 3);
+ let r: u8x8 = transmute(vhsub_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhsubq_u8() {
+ let a: u8x16 = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let b: u8x16 = u8x16::new(1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2);
+ let e: u8x16 = u8x16::new(0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7);
+ let r: u8x16 = transmute(vhsubq_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhsub_u16() {
+ let a: u16x4 = u16x4::new(1, 2, 3, 4);
+ let b: u16x4 = u16x4::new(1, 2, 1, 2);
+ let e: u16x4 = u16x4::new(0, 0, 1, 1);
+ let r: u16x4 = transmute(vhsub_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhsubq_u16() {
+ let a: u16x8 = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: u16x8 = u16x8::new(1, 2, 1, 2, 1, 2, 1, 2);
+ let e: u16x8 = u16x8::new(0, 0, 1, 1, 2, 2, 3, 3);
+ let r: u16x8 = transmute(vhsubq_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhsub_u32() {
+ let a: u32x2 = u32x2::new(1, 2);
+ let b: u32x2 = u32x2::new(1, 2);
+ let e: u32x2 = u32x2::new(0, 0);
+ let r: u32x2 = transmute(vhsub_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhsubq_u32() {
+ let a: u32x4 = u32x4::new(1, 2, 3, 4);
+ let b: u32x4 = u32x4::new(1, 2, 1, 2);
+ let e: u32x4 = u32x4::new(0, 0, 1, 1);
+ let r: u32x4 = transmute(vhsubq_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhsub_s8() {
+ let a: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: i8x8 = i8x8::new(1, 2, 1, 2, 1, 2, 1, 2);
+ let e: i8x8 = i8x8::new(0, 0, 1, 1, 2, 2, 3, 3);
+ let r: i8x8 = transmute(vhsub_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhsubq_s8() {
+ let a: i8x16 = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let b: i8x16 = i8x16::new(1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2);
+ let e: i8x16 = i8x16::new(0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7);
+ let r: i8x16 = transmute(vhsubq_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhsub_s16() {
+ let a: i16x4 = i16x4::new(1, 2, 3, 4);
+ let b: i16x4 = i16x4::new(1, 2, 1, 2);
+ let e: i16x4 = i16x4::new(0, 0, 1, 1);
+ let r: i16x4 = transmute(vhsub_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhsubq_s16() {
+ let a: i16x8 = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: i16x8 = i16x8::new(1, 2, 1, 2, 1, 2, 1, 2);
+ let e: i16x8 = i16x8::new(0, 0, 1, 1, 2, 2, 3, 3);
+ let r: i16x8 = transmute(vhsubq_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhsub_s32() {
+ let a: i32x2 = i32x2::new(1, 2);
+ let b: i32x2 = i32x2::new(1, 2);
+ let e: i32x2 = i32x2::new(0, 0);
+ let r: i32x2 = transmute(vhsub_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhsubq_s32() {
+ let a: i32x4 = i32x4::new(1, 2, 3, 4);
+ let b: i32x4 = i32x4::new(1, 2, 1, 2);
+ let e: i32x4 = i32x4::new(0, 0, 1, 1);
+ let r: i32x4 = transmute(vhsubq_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubw_s8() {
+ let a: i16x8 = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let b: i8x8 = i8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: i16x8 = i16x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let r: i16x8 = transmute(vsubw_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubw_s16() {
+ let a: i32x4 = i32x4::new(0, 1, 2, 3);
+ let b: i16x4 = i16x4::new(0, 1, 2, 3);
+ let e: i32x4 = i32x4::new(0, 0, 0, 0);
+ let r: i32x4 = transmute(vsubw_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubw_s32() {
+ let a: i64x2 = i64x2::new(0, 1);
+ let b: i32x2 = i32x2::new(0, 1);
+ let e: i64x2 = i64x2::new(0, 0);
+ let r: i64x2 = transmute(vsubw_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubw_u8() {
+ let a: u16x8 = u16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let b: u8x8 = u8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: u16x8 = u16x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let r: u16x8 = transmute(vsubw_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubw_u16() {
+ let a: u32x4 = u32x4::new(0, 1, 2, 3);
+ let b: u16x4 = u16x4::new(0, 1, 2, 3);
+ let e: u32x4 = u32x4::new(0, 0, 0, 0);
+ let r: u32x4 = transmute(vsubw_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubw_u32() {
+ let a: u64x2 = u64x2::new(0, 1);
+ let b: u32x2 = u32x2::new(0, 1);
+ let e: u64x2 = u64x2::new(0, 0);
+ let r: u64x2 = transmute(vsubw_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubl_s8() {
+ let a: i8x8 = i8x8::new(0x7F, -128, 2, 3, 4, 5, 6, 7);
+ let b: i8x8 = i8x8::new(0x7F, -128, 2, 3, 4, 5, 6, 7);
+ let e: i16x8 = i16x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let r: i16x8 = transmute(vsubl_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubl_s16() {
+ let a: i16x4 = i16x4::new(0x7F_FF, -32768, 2, 3);
+ let b: i16x4 = i16x4::new(0x7F_FF, -32768, 2, 3);
+ let e: i32x4 = i32x4::new(0, 0, 0, 0);
+ let r: i32x4 = transmute(vsubl_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubl_s32() {
+ let a: i32x2 = i32x2::new(0x7F_FF_FF_FF, -2147483648);
+ let b: i32x2 = i32x2::new(0x7F_FF_FF_FF, -2147483648);
+ let e: i64x2 = i64x2::new(0, 0);
+ let r: i64x2 = transmute(vsubl_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubl_u8() {
+ let a: u8x8 = u8x8::new(0xFF, 0, 2, 3, 4, 5, 6, 7);
+ let b: u8x8 = u8x8::new(0xFF, 0, 2, 3, 4, 5, 6, 7);
+ let e: u16x8 = u16x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let r: u16x8 = transmute(vsubl_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubl_u16() {
+ let a: u16x4 = u16x4::new(0xFF_FF, 0, 2, 3);
+ let b: u16x4 = u16x4::new(0xFF_FF, 0, 2, 3);
+ let e: u32x4 = u32x4::new(0, 0, 0, 0);
+ let r: u32x4 = transmute(vsubl_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubl_u32() {
+ let a: u32x2 = u32x2::new(0xFF_FF_FF_FF, 0);
+ let b: u32x2 = u32x2::new(0xFF_FF_FF_FF, 0);
+ let e: u64x2 = u64x2::new(0, 0);
+ let r: u64x2 = transmute(vsubl_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmax_s8() {
+ let a: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: i8x8 = i8x8::new(16, 15, 14, 13, 12, 11, 10, 9);
+ let e: i8x8 = i8x8::new(16, 15, 14, 13, 12, 11, 10, 9);
+ let r: i8x8 = transmute(vmax_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmaxq_s8() {
+ let a: i8x16 = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let b: i8x16 = i8x16::new(16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1);
+ let e: i8x16 = i8x16::new(16, 15, 14, 13, 12, 11, 10, 9, 9, 10, 11, 12, 13, 14, 15, 16);
+ let r: i8x16 = transmute(vmaxq_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmax_s16() {
+ let a: i16x4 = i16x4::new(1, 2, 3, 4);
+ let b: i16x4 = i16x4::new(16, 15, 14, 13);
+ let e: i16x4 = i16x4::new(16, 15, 14, 13);
+ let r: i16x4 = transmute(vmax_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmaxq_s16() {
+ let a: i16x8 = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: i16x8 = i16x8::new(16, 15, 14, 13, 12, 11, 10, 9);
+ let e: i16x8 = i16x8::new(16, 15, 14, 13, 12, 11, 10, 9);
+ let r: i16x8 = transmute(vmaxq_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmax_s32() {
+ let a: i32x2 = i32x2::new(1, 2);
+ let b: i32x2 = i32x2::new(16, 15);
+ let e: i32x2 = i32x2::new(16, 15);
+ let r: i32x2 = transmute(vmax_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmaxq_s32() {
+ let a: i32x4 = i32x4::new(1, 2, 3, 4);
+ let b: i32x4 = i32x4::new(16, 15, 14, 13);
+ let e: i32x4 = i32x4::new(16, 15, 14, 13);
+ let r: i32x4 = transmute(vmaxq_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmax_u8() {
+ let a: u8x8 = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: u8x8 = u8x8::new(16, 15, 14, 13, 12, 11, 10, 9);
+ let e: u8x8 = u8x8::new(16, 15, 14, 13, 12, 11, 10, 9);
+ let r: u8x8 = transmute(vmax_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmaxq_u8() {
+ let a: u8x16 = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let b: u8x16 = u8x16::new(16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1);
+ let e: u8x16 = u8x16::new(16, 15, 14, 13, 12, 11, 10, 9, 9, 10, 11, 12, 13, 14, 15, 16);
+ let r: u8x16 = transmute(vmaxq_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmax_u16() {
+ let a: u16x4 = u16x4::new(1, 2, 3, 4);
+ let b: u16x4 = u16x4::new(16, 15, 14, 13);
+ let e: u16x4 = u16x4::new(16, 15, 14, 13);
+ let r: u16x4 = transmute(vmax_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmaxq_u16() {
+ let a: u16x8 = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: u16x8 = u16x8::new(16, 15, 14, 13, 12, 11, 10, 9);
+ let e: u16x8 = u16x8::new(16, 15, 14, 13, 12, 11, 10, 9);
+ let r: u16x8 = transmute(vmaxq_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmax_u32() {
+ let a: u32x2 = u32x2::new(1, 2);
+ let b: u32x2 = u32x2::new(16, 15);
+ let e: u32x2 = u32x2::new(16, 15);
+ let r: u32x2 = transmute(vmax_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmaxq_u32() {
+ let a: u32x4 = u32x4::new(1, 2, 3, 4);
+ let b: u32x4 = u32x4::new(16, 15, 14, 13);
+ let e: u32x4 = u32x4::new(16, 15, 14, 13);
+ let r: u32x4 = transmute(vmaxq_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmax_f32() {
+ let a: f32x2 = f32x2::new(1.0, -2.0);
+ let b: f32x2 = f32x2::new(0.0, 3.0);
+ let e: f32x2 = f32x2::new(1.0, 3.0);
+ let r: f32x2 = transmute(vmax_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmaxq_f32() {
+ let a: f32x4 = f32x4::new(1.0, -2.0, 3.0, -4.0);
+ let b: f32x4 = f32x4::new(0.0, 3.0, 2.0, 8.0);
+ let e: f32x4 = f32x4::new(1.0, 3.0, 3.0, 8.0);
+ let r: f32x4 = transmute(vmaxq_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmaxnm_f32() {
+ let a: f32x2 = f32x2::new(1.0, 2.0);
+ let b: f32x2 = f32x2::new(8.0, 16.0);
+ let e: f32x2 = f32x2::new(8.0, 16.0);
+ let r: f32x2 = transmute(vmaxnm_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmaxnmq_f32() {
+ let a: f32x4 = f32x4::new(1.0, 2.0, 3.0, -4.0);
+ let b: f32x4 = f32x4::new(8.0, 16.0, -1.0, 6.0);
+ let e: f32x4 = f32x4::new(8.0, 16.0, 3.0, 6.0);
+ let r: f32x4 = transmute(vmaxnmq_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmin_s8() {
+ let a: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: i8x8 = i8x8::new(16, 15, 14, 13, 12, 11, 10, 9);
+ let e: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let r: i8x8 = transmute(vmin_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vminq_s8() {
+ let a: i8x16 = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let b: i8x16 = i8x16::new(16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1);
+ let e: i8x16 = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 1);
+ let r: i8x16 = transmute(vminq_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmin_s16() {
+ let a: i16x4 = i16x4::new(1, 2, 3, 4);
+ let b: i16x4 = i16x4::new(16, 15, 14, 13);
+ let e: i16x4 = i16x4::new(1, 2, 3, 4);
+ let r: i16x4 = transmute(vmin_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vminq_s16() {
+ let a: i16x8 = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: i16x8 = i16x8::new(16, 15, 14, 13, 12, 11, 10, 9);
+ let e: i16x8 = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let r: i16x8 = transmute(vminq_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmin_s32() {
+ let a: i32x2 = i32x2::new(1, 2);
+ let b: i32x2 = i32x2::new(16, 15);
+ let e: i32x2 = i32x2::new(1, 2);
+ let r: i32x2 = transmute(vmin_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vminq_s32() {
+ let a: i32x4 = i32x4::new(1, 2, 3, 4);
+ let b: i32x4 = i32x4::new(16, 15, 14, 13);
+ let e: i32x4 = i32x4::new(1, 2, 3, 4);
+ let r: i32x4 = transmute(vminq_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmin_u8() {
+ let a: u8x8 = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: u8x8 = u8x8::new(16, 15, 14, 13, 12, 11, 10, 9);
+ let e: u8x8 = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let r: u8x8 = transmute(vmin_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vminq_u8() {
+ let a: u8x16 = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let b: u8x16 = u8x16::new(16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1);
+ let e: u8x16 = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 1);
+ let r: u8x16 = transmute(vminq_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmin_u16() {
+ let a: u16x4 = u16x4::new(1, 2, 3, 4);
+ let b: u16x4 = u16x4::new(16, 15, 14, 13);
+ let e: u16x4 = u16x4::new(1, 2, 3, 4);
+ let r: u16x4 = transmute(vmin_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vminq_u16() {
+ let a: u16x8 = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: u16x8 = u16x8::new(16, 15, 14, 13, 12, 11, 10, 9);
+ let e: u16x8 = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let r: u16x8 = transmute(vminq_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmin_u32() {
+ let a: u32x2 = u32x2::new(1, 2);
+ let b: u32x2 = u32x2::new(16, 15);
+ let e: u32x2 = u32x2::new(1, 2);
+ let r: u32x2 = transmute(vmin_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vminq_u32() {
+ let a: u32x4 = u32x4::new(1, 2, 3, 4);
+ let b: u32x4 = u32x4::new(16, 15, 14, 13);
+ let e: u32x4 = u32x4::new(1, 2, 3, 4);
+ let r: u32x4 = transmute(vminq_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmin_f32() {
+ let a: f32x2 = f32x2::new(1.0, -2.0);
+ let b: f32x2 = f32x2::new(0.0, 3.0);
+ let e: f32x2 = f32x2::new(0.0, -2.0);
+ let r: f32x2 = transmute(vmin_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vminq_f32() {
+ let a: f32x4 = f32x4::new(1.0, -2.0, 3.0, -4.0);
+ let b: f32x4 = f32x4::new(0.0, 3.0, 2.0, 8.0);
+ let e: f32x4 = f32x4::new(0.0, -2.0, 2.0, -4.0);
+ let r: f32x4 = transmute(vminq_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vminnm_f32() {
+ let a: f32x2 = f32x2::new(1.0, 2.0);
+ let b: f32x2 = f32x2::new(8.0, 16.0);
+ let e: f32x2 = f32x2::new(1.0, 2.0);
+ let r: f32x2 = transmute(vminnm_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vminnmq_f32() {
+ let a: f32x4 = f32x4::new(1.0, 2.0, 3.0, -4.0);
+ let b: f32x4 = f32x4::new(8.0, 16.0, -1.0, 6.0);
+ let e: f32x4 = f32x4::new(1.0, 2.0, -1.0, -4.0);
+ let r: f32x4 = transmute(vminnmq_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpadd_f32() {
+ let a: f32x2 = f32x2::new(1., 2.);
+ let b: f32x2 = f32x2::new(3., 4.);
+ let e: f32x2 = f32x2::new(3., 7.);
+ let r: f32x2 = transmute(vpadd_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmull_s16() {
+ let a: i16x4 = i16x4::new(0, 1, 2, 3);
+ let b: i16x4 = i16x4::new(1, 2, 3, 4);
+ let e: i32x4 = i32x4::new(0, 4, 12, 24);
+ let r: i32x4 = transmute(vqdmull_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmull_s32() {
+ let a: i32x2 = i32x2::new(0, 1);
+ let b: i32x2 = i32x2::new(1, 2);
+ let e: i64x2 = i64x2::new(0, 4);
+ let r: i64x2 = transmute(vqdmull_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmull_n_s16() {
+ let a: i16x4 = i16x4::new(2, 4, 6, 8);
+ let b: i16 = 2;
+ let e: i32x4 = i32x4::new(8, 16, 24, 32);
+ let r: i32x4 = transmute(vqdmull_n_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmull_n_s32() {
+ let a: i32x2 = i32x2::new(2, 4);
+ let b: i32 = 2;
+ let e: i64x2 = i64x2::new(8, 16);
+ let r: i64x2 = transmute(vqdmull_n_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmull_lane_s16() {
+ let a: i16x4 = i16x4::new(1, 2, 3, 4);
+ let b: i16x4 = i16x4::new(0, 2, 2, 0);
+ let e: i32x4 = i32x4::new(4, 8, 12, 16);
+ let r: i32x4 = transmute(vqdmull_lane_s16::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmull_lane_s32() {
+ let a: i32x2 = i32x2::new(1, 2);
+ let b: i32x2 = i32x2::new(0, 2);
+ let e: i64x2 = i64x2::new(4, 8);
+ let r: i64x2 = transmute(vqdmull_lane_s32::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlal_s16() {
+ let a: i32x4 = i32x4::new(1, 1, 1, 1);
+ let b: i16x4 = i16x4::new(1, 2, 3, 4);
+ let c: i16x4 = i16x4::new(2, 2, 2, 2);
+ let e: i32x4 = i32x4::new(5, 9, 13, 17);
+ let r: i32x4 = transmute(vqdmlal_s16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlal_s32() {
+ let a: i64x2 = i64x2::new(1, 1);
+ let b: i32x2 = i32x2::new(1, 2);
+ let c: i32x2 = i32x2::new(2, 2);
+ let e: i64x2 = i64x2::new(5, 9);
+ let r: i64x2 = transmute(vqdmlal_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlal_n_s16() {
+ let a: i32x4 = i32x4::new(1, 1, 1, 1);
+ let b: i16x4 = i16x4::new(1, 2, 3, 4);
+ let c: i16 = 2;
+ let e: i32x4 = i32x4::new(5, 9, 13, 17);
+ let r: i32x4 = transmute(vqdmlal_n_s16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlal_n_s32() {
+ let a: i64x2 = i64x2::new(1, 1);
+ let b: i32x2 = i32x2::new(1, 2);
+ let c: i32 = 2;
+ let e: i64x2 = i64x2::new(5, 9);
+ let r: i64x2 = transmute(vqdmlal_n_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlal_lane_s16() {
+ let a: i32x4 = i32x4::new(1, 2, 3, 4);
+ let b: i16x4 = i16x4::new(1, 2, 3, 4);
+ let c: i16x4 = i16x4::new(0, 2, 2, 0);
+ let e: i32x4 = i32x4::new(5, 10, 15, 20);
+ let r: i32x4 = transmute(vqdmlal_lane_s16::<2>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlal_lane_s32() {
+ let a: i64x2 = i64x2::new(1, 2);
+ let b: i32x2 = i32x2::new(1, 2);
+ let c: i32x2 = i32x2::new(0, 2);
+ let e: i64x2 = i64x2::new(5, 10);
+ let r: i64x2 = transmute(vqdmlal_lane_s32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlsl_s16() {
+ let a: i32x4 = i32x4::new(3, 7, 11, 15);
+ let b: i16x4 = i16x4::new(1, 2, 3, 4);
+ let c: i16x4 = i16x4::new(2, 2, 2, 2);
+ let e: i32x4 = i32x4::new(-1, -1, -1, -1);
+ let r: i32x4 = transmute(vqdmlsl_s16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlsl_s32() {
+ let a: i64x2 = i64x2::new(3, 7);
+ let b: i32x2 = i32x2::new(1, 2);
+ let c: i32x2 = i32x2::new(2, 2);
+ let e: i64x2 = i64x2::new(-1, -1);
+ let r: i64x2 = transmute(vqdmlsl_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlsl_n_s16() {
+ let a: i32x4 = i32x4::new(3, 7, 11, 15);
+ let b: i16x4 = i16x4::new(1, 2, 3, 4);
+ let c: i16 = 2;
+ let e: i32x4 = i32x4::new(-1, -1, -1, -1);
+ let r: i32x4 = transmute(vqdmlsl_n_s16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlsl_n_s32() {
+ let a: i64x2 = i64x2::new(3, 7);
+ let b: i32x2 = i32x2::new(1, 2);
+ let c: i32 = 2;
+ let e: i64x2 = i64x2::new(-1, -1);
+ let r: i64x2 = transmute(vqdmlsl_n_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlsl_lane_s16() {
+ let a: i32x4 = i32x4::new(3, 6, 9, 12);
+ let b: i16x4 = i16x4::new(1, 2, 3, 4);
+ let c: i16x4 = i16x4::new(0, 2, 2, 0);
+ let e: i32x4 = i32x4::new(-1, -2, -3, -4);
+ let r: i32x4 = transmute(vqdmlsl_lane_s16::<2>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmlsl_lane_s32() {
+ let a: i64x2 = i64x2::new(3, 6);
+ let b: i32x2 = i32x2::new(1, 2);
+ let c: i32x2 = i32x2::new(0, 2);
+ let e: i64x2 = i64x2::new(-1, -2);
+ let r: i64x2 = transmute(vqdmlsl_lane_s32::<1>(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmulh_s16() {
+ let a: i16x4 = i16x4::new(0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF);
+ let b: i16x4 = i16x4::new(2, 2, 2, 2);
+ let e: i16x4 = i16x4::new(1, 1, 1, 1);
+ let r: i16x4 = transmute(vqdmulh_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmulhq_s16() {
+ let a: i16x8 = i16x8::new(0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF);
+ let b: i16x8 = i16x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let e: i16x8 = i16x8::new(1, 1, 1, 1, 1, 1, 1, 1);
+ let r: i16x8 = transmute(vqdmulhq_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmulh_s32() {
+ let a: i32x2 = i32x2::new(0x7F_FF_FF_FF, 0x7F_FF_FF_FF);
+ let b: i32x2 = i32x2::new(2, 2);
+ let e: i32x2 = i32x2::new(1, 1);
+ let r: i32x2 = transmute(vqdmulh_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmulhq_s32() {
+ let a: i32x4 = i32x4::new(0x7F_FF_FF_FF, 0x7F_FF_FF_FF, 0x7F_FF_FF_FF, 0x7F_FF_FF_FF);
+ let b: i32x4 = i32x4::new(2, 2, 2, 2);
+ let e: i32x4 = i32x4::new(1, 1, 1, 1);
+ let r: i32x4 = transmute(vqdmulhq_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmulh_n_s16() {
+ let a: i16x4 = i16x4::new(0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF);
+ let b: i16 = 2;
+ let e: i16x4 = i16x4::new(1, 1, 1, 1);
+ let r: i16x4 = transmute(vqdmulh_n_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmulh_n_s32() {
+ let a: i32x2 = i32x2::new(0x7F_FF_FF_FF, 0x7F_FF_FF_FF);
+ let b: i32 = 2;
+ let e: i32x2 = i32x2::new(1, 1);
+ let r: i32x2 = transmute(vqdmulh_n_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmulhq_n_s16() {
+ let a: i16x8 = i16x8::new(0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF);
+ let b: i16 = 2;
+ let e: i16x8 = i16x8::new(1, 1, 1, 1, 1, 1, 1, 1);
+ let r: i16x8 = transmute(vqdmulhq_n_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmulhq_n_s32() {
+ let a: i32x4 = i32x4::new(0x7F_FF_FF_FF, 0x7F_FF_FF_FF, 0x7F_FF_FF_FF, 0x7F_FF_FF_FF);
+ let b: i32 = 2;
+ let e: i32x4 = i32x4::new(1, 1, 1, 1);
+ let r: i32x4 = transmute(vqdmulhq_n_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmulhq_laneq_s16() {
+ let a: i16x8 = i16x8::new(0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF);
+ let b: i16x8 = i16x8::new(2, 1, 1, 1, 1, 1, 1, 1);
+ let e: i16x8 = i16x8::new(1, 1, 1, 1, 1, 1, 1, 1);
+ let r: i16x8 = transmute(vqdmulhq_laneq_s16::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmulh_laneq_s16() {
+ let a: i16x4 = i16x4::new(0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF);
+ let b: i16x8 = i16x8::new(2, 1, 1, 1, 1, 1, 1, 1);
+ let e: i16x4 = i16x4::new(1, 1, 1, 1);
+ let r: i16x4 = transmute(vqdmulh_laneq_s16::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmulhq_laneq_s32() {
+ let a: i32x4 = i32x4::new(0x7F_FF_FF_FF, 0x7F_FF_FF_FF, 0x7F_FF_FF_FF, 0x7F_FF_FF_FF);
+ let b: i32x4 = i32x4::new(2, 1, 1, 1);
+ let e: i32x4 = i32x4::new(1, 1, 1, 1);
+ let r: i32x4 = transmute(vqdmulhq_laneq_s32::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqdmulh_laneq_s32() {
+ let a: i32x2 = i32x2::new(0x7F_FF_FF_FF, 0x7F_FF_FF_FF);
+ let b: i32x4 = i32x4::new(2, 1, 1, 1);
+ let e: i32x2 = i32x2::new(1, 1);
+ let r: i32x2 = transmute(vqdmulh_laneq_s32::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqmovn_s16() {
+ let a: i16x8 = i16x8::new(0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF);
+ let e: i8x8 = i8x8::new(0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F);
+ let r: i8x8 = transmute(vqmovn_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqmovn_s32() {
+ let a: i32x4 = i32x4::new(0x7F_FF_FF_FF, 0x7F_FF_FF_FF, 0x7F_FF_FF_FF, 0x7F_FF_FF_FF);
+ let e: i16x4 = i16x4::new(0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF);
+ let r: i16x4 = transmute(vqmovn_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqmovn_s64() {
+ let a: i64x2 = i64x2::new(0x7F_FF_FF_FF_FF_FF_FF_FF, 0x7F_FF_FF_FF_FF_FF_FF_FF);
+ let e: i32x2 = i32x2::new(0x7F_FF_FF_FF, 0x7F_FF_FF_FF);
+ let r: i32x2 = transmute(vqmovn_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqmovn_u16() {
+ let a: u16x8 = u16x8::new(0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF);
+ let e: u8x8 = u8x8::new(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
+ let r: u8x8 = transmute(vqmovn_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqmovn_u32() {
+ let a: u32x4 = u32x4::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let e: u16x4 = u16x4::new(0xFF_FF, 0xFF_FF, 0xFF_FF, 0xFF_FF);
+ let r: u16x4 = transmute(vqmovn_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqmovn_u64() {
+ let a: u64x2 = u64x2::new(0xFF_FF_FF_FF_FF_FF_FF_FF, 0xFF_FF_FF_FF_FF_FF_FF_FF);
+ let e: u32x2 = u32x2::new(0xFF_FF_FF_FF, 0xFF_FF_FF_FF);
+ let r: u32x2 = transmute(vqmovn_u64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqmovun_s16() {
+ let a: i16x8 = i16x8::new(-1, -1, -1, -1, -1, -1, -1, -1);
+ let e: u8x8 = u8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let r: u8x8 = transmute(vqmovun_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqmovun_s32() {
+ let a: i32x4 = i32x4::new(-1, -1, -1, -1);
+ let e: u16x4 = u16x4::new(0, 0, 0, 0);
+ let r: u16x4 = transmute(vqmovun_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqmovun_s64() {
+ let a: i64x2 = i64x2::new(-1, -1);
+ let e: u32x2 = u32x2::new(0, 0);
+ let r: u32x2 = transmute(vqmovun_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmulh_s16() {
+ let a: i16x4 = i16x4::new(0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF);
+ let b: i16x4 = i16x4::new(2, 2, 2, 2);
+ let e: i16x4 = i16x4::new(2, 2, 2, 2);
+ let r: i16x4 = transmute(vqrdmulh_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmulhq_s16() {
+ let a: i16x8 = i16x8::new(0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF);
+ let b: i16x8 = i16x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let e: i16x8 = i16x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let r: i16x8 = transmute(vqrdmulhq_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmulh_s32() {
+ let a: i32x2 = i32x2::new(0x7F_FF_FF_FF, 0x7F_FF_FF_FF);
+ let b: i32x2 = i32x2::new(2, 2);
+ let e: i32x2 = i32x2::new(2, 2);
+ let r: i32x2 = transmute(vqrdmulh_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmulhq_s32() {
+ let a: i32x4 = i32x4::new(0x7F_FF_FF_FF, 0x7F_FF_FF_FF, 0x7F_FF_FF_FF, 0x7F_FF_FF_FF);
+ let b: i32x4 = i32x4::new(2, 2, 2, 2);
+ let e: i32x4 = i32x4::new(2, 2, 2, 2);
+ let r: i32x4 = transmute(vqrdmulhq_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmulh_n_s16() {
+ let a: i16x4 = i16x4::new(0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF);
+ let b: i16 = 2;
+ let e: i16x4 = i16x4::new(2, 2, 2, 2);
+ let r: i16x4 = transmute(vqrdmulh_n_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmulhq_n_s16() {
+ let a: i16x8 = i16x8::new(0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF);
+ let b: i16 = 2;
+ let e: i16x8 = i16x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let r: i16x8 = transmute(vqrdmulhq_n_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmulh_n_s32() {
+ let a: i32x2 = i32x2::new(0x7F_FF_FF_FF, 0x7F_FF_FF_FF);
+ let b: i32 = 2;
+ let e: i32x2 = i32x2::new(2, 2);
+ let r: i32x2 = transmute(vqrdmulh_n_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmulhq_n_s32() {
+ let a: i32x4 = i32x4::new(0x7F_FF_FF_FF, 0x7F_FF_FF_FF, 0x7F_FF_FF_FF, 0x7F_FF_FF_FF);
+ let b: i32 = 2;
+ let e: i32x4 = i32x4::new(2, 2, 2, 2);
+ let r: i32x4 = transmute(vqrdmulhq_n_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmulh_lane_s16() {
+ let a: i16x4 = i16x4::new(0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF);
+ let b: i16x4 = i16x4::new(0, 2, 0, 0);
+ let e: i16x4 = i16x4::new(2, 2, 2, 2);
+ let r: i16x4 = transmute(vqrdmulh_lane_s16::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmulh_laneq_s16() {
+ let a: i16x4 = i16x4::new(0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF);
+ let b: i16x8 = i16x8::new(0, 2, 0, 0, 0, 0, 0, 0);
+ let e: i16x4 = i16x4::new(2, 2, 2, 2);
+ let r: i16x4 = transmute(vqrdmulh_laneq_s16::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmulhq_lane_s16() {
+ let a: i16x8 = i16x8::new(0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF);
+ let b: i16x4 = i16x4::new(0, 2, 0, 0);
+ let e: i16x8 = i16x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let r: i16x8 = transmute(vqrdmulhq_lane_s16::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmulhq_laneq_s16() {
+ let a: i16x8 = i16x8::new(0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF, 0x7F_FF);
+ let b: i16x8 = i16x8::new(0, 2, 0, 0, 0, 0, 0, 0);
+ let e: i16x8 = i16x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let r: i16x8 = transmute(vqrdmulhq_laneq_s16::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmulh_lane_s32() {
+ let a: i32x2 = i32x2::new(0x7F_FF_FF_FF, 0x7F_FF_FF_FF);
+ let b: i32x2 = i32x2::new(0, 2);
+ let e: i32x2 = i32x2::new(2, 2);
+ let r: i32x2 = transmute(vqrdmulh_lane_s32::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmulh_laneq_s32() {
+ let a: i32x2 = i32x2::new(0x7F_FF_FF_FF, 0x7F_FF_FF_FF);
+ let b: i32x4 = i32x4::new(0, 2, 0, 0);
+ let e: i32x2 = i32x2::new(2, 2);
+ let r: i32x2 = transmute(vqrdmulh_laneq_s32::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmulhq_lane_s32() {
+ let a: i32x4 = i32x4::new(0x7F_FF_FF_FF, 0x7F_FF_FF_FF, 0x7F_FF_FF_FF, 0x7F_FF_FF_FF);
+ let b: i32x2 = i32x2::new(0, 2);
+ let e: i32x4 = i32x4::new(2, 2, 2, 2);
+ let r: i32x4 = transmute(vqrdmulhq_lane_s32::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrdmulhq_laneq_s32() {
+ let a: i32x4 = i32x4::new(0x7F_FF_FF_FF, 0x7F_FF_FF_FF, 0x7F_FF_FF_FF, 0x7F_FF_FF_FF);
+ let b: i32x4 = i32x4::new(0, 2, 0, 0);
+ let e: i32x4 = i32x4::new(2, 2, 2, 2);
+ let r: i32x4 = transmute(vqrdmulhq_laneq_s32::<1>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshl_s8() {
+ let a: i8x8 = i8x8::new(2, -128, 0x7F, 3, 4, 5, 6, 7);
+ let b: i8x8 = i8x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let e: i8x8 = i8x8::new(8, -128, 0x7F, 12, 16, 20, 24, 28);
+ let r: i8x8 = transmute(vqrshl_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshlq_s8() {
+ let a: i8x16 = i8x16::new(2, -128, 0x7F, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let b: i8x16 = i8x16::new(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
+ let e: i8x16 = i8x16::new(8, -128, 0x7F, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60);
+ let r: i8x16 = transmute(vqrshlq_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshl_s16() {
+ let a: i16x4 = i16x4::new(2, -32768, 0x7F_FF, 3);
+ let b: i16x4 = i16x4::new(2, 2, 2, 2);
+ let e: i16x4 = i16x4::new(8, -32768, 0x7F_FF, 12);
+ let r: i16x4 = transmute(vqrshl_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshlq_s16() {
+ let a: i16x8 = i16x8::new(2, -32768, 0x7F_FF, 3, 4, 5, 6, 7);
+ let b: i16x8 = i16x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let e: i16x8 = i16x8::new(8, -32768, 0x7F_FF, 12, 16, 20, 24, 28);
+ let r: i16x8 = transmute(vqrshlq_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshl_s32() {
+ let a: i32x2 = i32x2::new(2, -2147483648);
+ let b: i32x2 = i32x2::new(2, 2);
+ let e: i32x2 = i32x2::new(8, -2147483648);
+ let r: i32x2 = transmute(vqrshl_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshlq_s32() {
+ let a: i32x4 = i32x4::new(2, -2147483648, 0x7F_FF_FF_FF, 3);
+ let b: i32x4 = i32x4::new(2, 2, 2, 2);
+ let e: i32x4 = i32x4::new(8, -2147483648, 0x7F_FF_FF_FF, 12);
+ let r: i32x4 = transmute(vqrshlq_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshl_s64() {
+ let a: i64x1 = i64x1::new(2);
+ let b: i64x1 = i64x1::new(2);
+ let e: i64x1 = i64x1::new(8);
+ let r: i64x1 = transmute(vqrshl_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshlq_s64() {
+ let a: i64x2 = i64x2::new(2, -9223372036854775808);
+ let b: i64x2 = i64x2::new(2, 2);
+ let e: i64x2 = i64x2::new(8, -9223372036854775808);
+ let r: i64x2 = transmute(vqrshlq_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshl_u8() {
+ let a: u8x8 = u8x8::new(2, 0, 0xFF, 3, 4, 5, 6, 7);
+ let b: i8x8 = i8x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let e: u8x8 = u8x8::new(8, 0, 0xFF, 12, 16, 20, 24, 28);
+ let r: u8x8 = transmute(vqrshl_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshlq_u8() {
+ let a: u8x16 = u8x16::new(2, 0, 0xFF, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let b: i8x16 = i8x16::new(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
+ let e: u8x16 = u8x16::new(8, 0, 0xFF, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60);
+ let r: u8x16 = transmute(vqrshlq_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshl_u16() {
+ let a: u16x4 = u16x4::new(2, 0, 0xFF_FF, 3);
+ let b: i16x4 = i16x4::new(2, 2, 2, 2);
+ let e: u16x4 = u16x4::new(8, 0, 0xFF_FF, 12);
+ let r: u16x4 = transmute(vqrshl_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshlq_u16() {
+ let a: u16x8 = u16x8::new(2, 0, 0xFF_FF, 3, 4, 5, 6, 7);
+ let b: i16x8 = i16x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let e: u16x8 = u16x8::new(8, 0, 0xFF_FF, 12, 16, 20, 24, 28);
+ let r: u16x8 = transmute(vqrshlq_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshl_u32() {
+ let a: u32x2 = u32x2::new(2, 0);
+ let b: i32x2 = i32x2::new(2, 2);
+ let e: u32x2 = u32x2::new(8, 0);
+ let r: u32x2 = transmute(vqrshl_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshlq_u32() {
+ let a: u32x4 = u32x4::new(2, 0, 0xFF_FF_FF_FF, 3);
+ let b: i32x4 = i32x4::new(2, 2, 2, 2);
+ let e: u32x4 = u32x4::new(8, 0, 0xFF_FF_FF_FF, 12);
+ let r: u32x4 = transmute(vqrshlq_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshl_u64() {
+ let a: u64x1 = u64x1::new(2);
+ let b: i64x1 = i64x1::new(2);
+ let e: u64x1 = u64x1::new(8);
+ let r: u64x1 = transmute(vqrshl_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshlq_u64() {
+ let a: u64x2 = u64x2::new(2, 0);
+ let b: i64x2 = i64x2::new(2, 2);
+ let e: u64x2 = u64x2::new(8, 0);
+ let r: u64x2 = transmute(vqrshlq_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshrn_n_s16() {
+ let a: i16x8 = i16x8::new(-32768, 4, 8, 12, 16, 20, 24, 28);
+ let e: i8x8 = i8x8::new(-128, 1, 2, 3, 4, 5, 6, 7);
+ let r: i8x8 = transmute(vqrshrn_n_s16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshrn_n_s32() {
+ let a: i32x4 = i32x4::new(-2147483648, 4, 8, 12);
+ let e: i16x4 = i16x4::new(-32768, 1, 2, 3);
+ let r: i16x4 = transmute(vqrshrn_n_s32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshrn_n_s64() {
+ let a: i64x2 = i64x2::new(-9223372036854775808, 4);
+ let e: i32x2 = i32x2::new(-2147483648, 1);
+ let r: i32x2 = transmute(vqrshrn_n_s64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshrn_n_u16() {
+ let a: u16x8 = u16x8::new(0, 4, 8, 12, 16, 20, 24, 28);
+ let e: u8x8 = u8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: u8x8 = transmute(vqrshrn_n_u16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshrn_n_u32() {
+ let a: u32x4 = u32x4::new(0, 4, 8, 12);
+ let e: u16x4 = u16x4::new(0, 1, 2, 3);
+ let r: u16x4 = transmute(vqrshrn_n_u32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshrn_n_u64() {
+ let a: u64x2 = u64x2::new(0, 4);
+ let e: u32x2 = u32x2::new(0, 1);
+ let r: u32x2 = transmute(vqrshrn_n_u64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshrun_n_s16() {
+ let a: i16x8 = i16x8::new(0, 4, 8, 12, 16, 20, 24, 28);
+ let e: u8x8 = u8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: u8x8 = transmute(vqrshrun_n_s16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshrun_n_s32() {
+ let a: i32x4 = i32x4::new(0, 4, 8, 12);
+ let e: u16x4 = u16x4::new(0, 1, 2, 3);
+ let r: u16x4 = transmute(vqrshrun_n_s32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqrshrun_n_s64() {
+ let a: i64x2 = i64x2::new(0, 4);
+ let e: u32x2 = u32x2::new(0, 1);
+ let r: u32x2 = transmute(vqrshrun_n_s64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshl_s8() {
+ let a: i8x8 = i8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let b: i8x8 = i8x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let e: i8x8 = i8x8::new(0, 4, 8, 12, 16, 20, 24, 28);
+ let r: i8x8 = transmute(vqshl_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshlq_s8() {
+ let a: i8x16 = i8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let b: i8x16 = i8x16::new(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
+ let e: i8x16 = i8x16::new(0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60);
+ let r: i8x16 = transmute(vqshlq_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshl_s16() {
+ let a: i16x4 = i16x4::new(0, 1, 2, 3);
+ let b: i16x4 = i16x4::new(2, 2, 2, 2);
+ let e: i16x4 = i16x4::new(0, 4, 8, 12);
+ let r: i16x4 = transmute(vqshl_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshlq_s16() {
+ let a: i16x8 = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let b: i16x8 = i16x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let e: i16x8 = i16x8::new(0, 4, 8, 12, 16, 20, 24, 28);
+ let r: i16x8 = transmute(vqshlq_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshl_s32() {
+ let a: i32x2 = i32x2::new(0, 1);
+ let b: i32x2 = i32x2::new(2, 2);
+ let e: i32x2 = i32x2::new(0, 4);
+ let r: i32x2 = transmute(vqshl_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshlq_s32() {
+ let a: i32x4 = i32x4::new(0, 1, 2, 3);
+ let b: i32x4 = i32x4::new(2, 2, 2, 2);
+ let e: i32x4 = i32x4::new(0, 4, 8, 12);
+ let r: i32x4 = transmute(vqshlq_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshl_s64() {
+ let a: i64x1 = i64x1::new(0);
+ let b: i64x1 = i64x1::new(2);
+ let e: i64x1 = i64x1::new(0);
+ let r: i64x1 = transmute(vqshl_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshlq_s64() {
+ let a: i64x2 = i64x2::new(0, 1);
+ let b: i64x2 = i64x2::new(2, 2);
+ let e: i64x2 = i64x2::new(0, 4);
+ let r: i64x2 = transmute(vqshlq_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshl_u8() {
+ let a: u8x8 = u8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let b: i8x8 = i8x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let e: u8x8 = u8x8::new(0, 4, 8, 12, 16, 20, 24, 28);
+ let r: u8x8 = transmute(vqshl_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshlq_u8() {
+ let a: u8x16 = u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let b: i8x16 = i8x16::new(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
+ let e: u8x16 = u8x16::new(0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60);
+ let r: u8x16 = transmute(vqshlq_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshl_u16() {
+ let a: u16x4 = u16x4::new(0, 1, 2, 3);
+ let b: i16x4 = i16x4::new(2, 2, 2, 2);
+ let e: u16x4 = u16x4::new(0, 4, 8, 12);
+ let r: u16x4 = transmute(vqshl_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshlq_u16() {
+ let a: u16x8 = u16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let b: i16x8 = i16x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let e: u16x8 = u16x8::new(0, 4, 8, 12, 16, 20, 24, 28);
+ let r: u16x8 = transmute(vqshlq_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshl_u32() {
+ let a: u32x2 = u32x2::new(0, 1);
+ let b: i32x2 = i32x2::new(2, 2);
+ let e: u32x2 = u32x2::new(0, 4);
+ let r: u32x2 = transmute(vqshl_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshlq_u32() {
+ let a: u32x4 = u32x4::new(0, 1, 2, 3);
+ let b: i32x4 = i32x4::new(2, 2, 2, 2);
+ let e: u32x4 = u32x4::new(0, 4, 8, 12);
+ let r: u32x4 = transmute(vqshlq_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshl_u64() {
+ let a: u64x1 = u64x1::new(0);
+ let b: i64x1 = i64x1::new(2);
+ let e: u64x1 = u64x1::new(0);
+ let r: u64x1 = transmute(vqshl_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshlq_u64() {
+ let a: u64x2 = u64x2::new(0, 1);
+ let b: i64x2 = i64x2::new(2, 2);
+ let e: u64x2 = u64x2::new(0, 4);
+ let r: u64x2 = transmute(vqshlq_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshl_n_s8() {
+ let a: i8x8 = i8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: i8x8 = i8x8::new(0, 4, 8, 12, 16, 20, 24, 28);
+ let r: i8x8 = transmute(vqshl_n_s8::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshlq_n_s8() {
+ let a: i8x16 = i8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let e: i8x16 = i8x16::new(0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60);
+ let r: i8x16 = transmute(vqshlq_n_s8::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshl_n_s16() {
+ let a: i16x4 = i16x4::new(0, 1, 2, 3);
+ let e: i16x4 = i16x4::new(0, 4, 8, 12);
+ let r: i16x4 = transmute(vqshl_n_s16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshlq_n_s16() {
+ let a: i16x8 = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: i16x8 = i16x8::new(0, 4, 8, 12, 16, 20, 24, 28);
+ let r: i16x8 = transmute(vqshlq_n_s16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshl_n_s32() {
+ let a: i32x2 = i32x2::new(0, 1);
+ let e: i32x2 = i32x2::new(0, 4);
+ let r: i32x2 = transmute(vqshl_n_s32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshlq_n_s32() {
+ let a: i32x4 = i32x4::new(0, 1, 2, 3);
+ let e: i32x4 = i32x4::new(0, 4, 8, 12);
+ let r: i32x4 = transmute(vqshlq_n_s32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshl_n_s64() {
+ let a: i64x1 = i64x1::new(0);
+ let e: i64x1 = i64x1::new(0);
+ let r: i64x1 = transmute(vqshl_n_s64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshlq_n_s64() {
+ let a: i64x2 = i64x2::new(0, 1);
+ let e: i64x2 = i64x2::new(0, 4);
+ let r: i64x2 = transmute(vqshlq_n_s64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshl_n_u8() {
+ let a: u8x8 = u8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: u8x8 = u8x8::new(0, 4, 8, 12, 16, 20, 24, 28);
+ let r: u8x8 = transmute(vqshl_n_u8::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshlq_n_u8() {
+ let a: u8x16 = u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let e: u8x16 = u8x16::new(0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60);
+ let r: u8x16 = transmute(vqshlq_n_u8::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshl_n_u16() {
+ let a: u16x4 = u16x4::new(0, 1, 2, 3);
+ let e: u16x4 = u16x4::new(0, 4, 8, 12);
+ let r: u16x4 = transmute(vqshl_n_u16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshlq_n_u16() {
+ let a: u16x8 = u16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: u16x8 = u16x8::new(0, 4, 8, 12, 16, 20, 24, 28);
+ let r: u16x8 = transmute(vqshlq_n_u16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshl_n_u32() {
+ let a: u32x2 = u32x2::new(0, 1);
+ let e: u32x2 = u32x2::new(0, 4);
+ let r: u32x2 = transmute(vqshl_n_u32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshlq_n_u32() {
+ let a: u32x4 = u32x4::new(0, 1, 2, 3);
+ let e: u32x4 = u32x4::new(0, 4, 8, 12);
+ let r: u32x4 = transmute(vqshlq_n_u32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshl_n_u64() {
+ let a: u64x1 = u64x1::new(0);
+ let e: u64x1 = u64x1::new(0);
+ let r: u64x1 = transmute(vqshl_n_u64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshlq_n_u64() {
+ let a: u64x2 = u64x2::new(0, 1);
+ let e: u64x2 = u64x2::new(0, 4);
+ let r: u64x2 = transmute(vqshlq_n_u64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshlu_n_s8() {
+ let a: i8x8 = i8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: u8x8 = u8x8::new(0, 4, 8, 12, 16, 20, 24, 28);
+ let r: u8x8 = transmute(vqshlu_n_s8::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshlu_n_s16() {
+ let a: i16x4 = i16x4::new(0, 1, 2, 3);
+ let e: u16x4 = u16x4::new(0, 4, 8, 12);
+ let r: u16x4 = transmute(vqshlu_n_s16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshlu_n_s32() {
+ let a: i32x2 = i32x2::new(0, 1);
+ let e: u32x2 = u32x2::new(0, 4);
+ let r: u32x2 = transmute(vqshlu_n_s32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshlu_n_s64() {
+ let a: i64x1 = i64x1::new(0);
+ let e: u64x1 = u64x1::new(0);
+ let r: u64x1 = transmute(vqshlu_n_s64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshluq_n_s8() {
+ let a: i8x16 = i8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let e: u8x16 = u8x16::new(0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60);
+ let r: u8x16 = transmute(vqshluq_n_s8::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshluq_n_s16() {
+ let a: i16x8 = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: u16x8 = u16x8::new(0, 4, 8, 12, 16, 20, 24, 28);
+ let r: u16x8 = transmute(vqshluq_n_s16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshluq_n_s32() {
+ let a: i32x4 = i32x4::new(0, 1, 2, 3);
+ let e: u32x4 = u32x4::new(0, 4, 8, 12);
+ let r: u32x4 = transmute(vqshluq_n_s32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshluq_n_s64() {
+ let a: i64x2 = i64x2::new(0, 1);
+ let e: u64x2 = u64x2::new(0, 4);
+ let r: u64x2 = transmute(vqshluq_n_s64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshrn_n_s16() {
+ let a: i16x8 = i16x8::new(0, 4, 8, 12, 16, 20, 24, 28);
+ let e: i8x8 = i8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: i8x8 = transmute(vqshrn_n_s16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshrn_n_s32() {
+ let a: i32x4 = i32x4::new(0, 4, 8, 12);
+ let e: i16x4 = i16x4::new(0, 1, 2, 3);
+ let r: i16x4 = transmute(vqshrn_n_s32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshrn_n_s64() {
+ let a: i64x2 = i64x2::new(0, 4);
+ let e: i32x2 = i32x2::new(0, 1);
+ let r: i32x2 = transmute(vqshrn_n_s64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshrn_n_u16() {
+ let a: u16x8 = u16x8::new(0, 4, 8, 12, 16, 20, 24, 28);
+ let e: u8x8 = u8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: u8x8 = transmute(vqshrn_n_u16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshrn_n_u32() {
+ let a: u32x4 = u32x4::new(0, 4, 8, 12);
+ let e: u16x4 = u16x4::new(0, 1, 2, 3);
+ let r: u16x4 = transmute(vqshrn_n_u32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshrn_n_u64() {
+ let a: u64x2 = u64x2::new(0, 4);
+ let e: u32x2 = u32x2::new(0, 1);
+ let r: u32x2 = transmute(vqshrn_n_u64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshrun_n_s16() {
+ let a: i16x8 = i16x8::new(0, 4, 8, 12, 16, 20, 24, 28);
+ let e: u8x8 = u8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: u8x8 = transmute(vqshrun_n_s16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshrun_n_s32() {
+ let a: i32x4 = i32x4::new(0, 4, 8, 12);
+ let e: u16x4 = u16x4::new(0, 1, 2, 3);
+ let r: u16x4 = transmute(vqshrun_n_s32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqshrun_n_s64() {
+ let a: i64x2 = i64x2::new(0, 4);
+ let e: u32x2 = u32x2::new(0, 1);
+ let r: u32x2 = transmute(vqshrun_n_s64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsqrte_f32() {
+ let a: f32x2 = f32x2::new(1.0, 2.0);
+ let e: f32x2 = f32x2::new(0.998046875, 0.705078125);
+ let r: f32x2 = transmute(vrsqrte_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsqrteq_f32() {
+ let a: f32x4 = f32x4::new(1.0, 2.0, 3.0, 4.0);
+ let e: f32x4 = f32x4::new(0.998046875, 0.705078125, 0.576171875, 0.4990234375);
+ let r: f32x4 = transmute(vrsqrteq_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsqrte_u32() {
+ let a: u32x2 = u32x2::new(1, 2);
+ let e: u32x2 = u32x2::new(4294967295, 4294967295);
+ let r: u32x2 = transmute(vrsqrte_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsqrteq_u32() {
+ let a: u32x4 = u32x4::new(1, 2, 3, 4);
+ let e: u32x4 = u32x4::new(4294967295, 4294967295, 4294967295, 4294967295);
+ let r: u32x4 = transmute(vrsqrteq_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsqrts_f32() {
+ let a: f32x2 = f32x2::new(1.0, 2.0);
+ let b: f32x2 = f32x2::new(1.0, 2.0);
+ let e: f32x2 = f32x2::new(1., -0.5);
+ let r: f32x2 = transmute(vrsqrts_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsqrtsq_f32() {
+ let a: f32x4 = f32x4::new(1.0, 2.0, 3.0, 4.0);
+ let b: f32x4 = f32x4::new(1.0, 2.0, 3.0, 4.0);
+ let e: f32x4 = f32x4::new(1., -0.5, -3.0, -6.5);
+ let r: f32x4 = transmute(vrsqrtsq_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrecpe_f32() {
+ let a: f32x2 = f32x2::new(4.0, 3.0);
+ let e: f32x2 = f32x2::new(0.24951171875, 0.3330078125);
+ let r: f32x2 = transmute(vrecpe_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrecpeq_f32() {
+ let a: f32x4 = f32x4::new(4.0, 3.0, 2.0, 1.0);
+ let e: f32x4 = f32x4::new(0.24951171875, 0.3330078125, 0.4990234375, 0.998046875);
+ let r: f32x4 = transmute(vrecpeq_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrecpe_u32() {
+ let a: u32x2 = u32x2::new(4, 3);
+ let e: u32x2 = u32x2::new(4294967295, 4294967295);
+ let r: u32x2 = transmute(vrecpe_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrecpeq_u32() {
+ let a: u32x4 = u32x4::new(4, 3, 2, 1);
+ let e: u32x4 = u32x4::new(4294967295, 4294967295, 4294967295, 4294967295);
+ let r: u32x4 = transmute(vrecpeq_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrecps_f32() {
+ let a: f32x2 = f32x2::new(4.0, 3.0);
+ let b: f32x2 = f32x2::new(4.0, 3.0);
+ let e: f32x2 = f32x2::new(-14., -7.);
+ let r: f32x2 = transmute(vrecps_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrecpsq_f32() {
+ let a: f32x4 = f32x4::new(4.0, 3.0, 2.0, 1.0);
+ let b: f32x4 = f32x4::new(4.0, 3.0, 2.0, 1.0);
+ let e: f32x4 = f32x4::new(-14., -7., -2., 1.);
+ let r: f32x4 = transmute(vrecpsq_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s8_u8() {
+ let a: u8x8 = u8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: i8x8 = i8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: i8x8 = transmute(vreinterpret_s8_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s8_p8() {
+ let a: i8x8 = i8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: i8x8 = i8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: i8x8 = transmute(vreinterpret_s8_p8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s16_p16() {
+ let a: i16x4 = i16x4::new(0, 1, 2, 3);
+ let e: i16x4 = i16x4::new(0, 1, 2, 3);
+ let r: i16x4 = transmute(vreinterpret_s16_p16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s16_u16() {
+ let a: u16x4 = u16x4::new(0, 1, 2, 3);
+ let e: i16x4 = i16x4::new(0, 1, 2, 3);
+ let r: i16x4 = transmute(vreinterpret_s16_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s32_u32() {
+ let a: u32x2 = u32x2::new(0, 1);
+ let e: i32x2 = i32x2::new(0, 1);
+ let r: i32x2 = transmute(vreinterpret_s32_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s64_u64() {
+ let a: u64x1 = u64x1::new(0);
+ let e: i64x1 = i64x1::new(0);
+ let r: i64x1 = transmute(vreinterpret_s64_u64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s8_u8() {
+ let a: u8x16 = u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let e: i8x16 = i8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r: i8x16 = transmute(vreinterpretq_s8_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s8_p8() {
+ let a: i8x16 = i8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let e: i8x16 = i8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r: i8x16 = transmute(vreinterpretq_s8_p8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s16_p16() {
+ let a: i16x8 = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: i16x8 = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: i16x8 = transmute(vreinterpretq_s16_p16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s16_u16() {
+ let a: u16x8 = u16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: i16x8 = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: i16x8 = transmute(vreinterpretq_s16_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s32_u32() {
+ let a: u32x4 = u32x4::new(0, 1, 2, 3);
+ let e: i32x4 = i32x4::new(0, 1, 2, 3);
+ let r: i32x4 = transmute(vreinterpretq_s32_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s64_u64() {
+ let a: u64x2 = u64x2::new(0, 1);
+ let e: i64x2 = i64x2::new(0, 1);
+ let r: i64x2 = transmute(vreinterpretq_s64_u64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u8_p8() {
+ let a: i8x8 = i8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: u8x8 = u8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: u8x8 = transmute(vreinterpret_u8_p8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u8_s8() {
+ let a: i8x8 = i8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: u8x8 = u8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: u8x8 = transmute(vreinterpret_u8_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u16_p16() {
+ let a: i16x4 = i16x4::new(0, 1, 2, 3);
+ let e: u16x4 = u16x4::new(0, 1, 2, 3);
+ let r: u16x4 = transmute(vreinterpret_u16_p16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u16_s16() {
+ let a: i16x4 = i16x4::new(0, 1, 2, 3);
+ let e: u16x4 = u16x4::new(0, 1, 2, 3);
+ let r: u16x4 = transmute(vreinterpret_u16_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u32_s32() {
+ let a: i32x2 = i32x2::new(0, 1);
+ let e: u32x2 = u32x2::new(0, 1);
+ let r: u32x2 = transmute(vreinterpret_u32_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u64_s64() {
+ let a: i64x1 = i64x1::new(0);
+ let e: u64x1 = u64x1::new(0);
+ let r: u64x1 = transmute(vreinterpret_u64_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u8_p8() {
+ let a: i8x16 = i8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let e: u8x16 = u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r: u8x16 = transmute(vreinterpretq_u8_p8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u8_s8() {
+ let a: i8x16 = i8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let e: u8x16 = u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r: u8x16 = transmute(vreinterpretq_u8_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u16_p16() {
+ let a: i16x8 = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: u16x8 = u16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: u16x8 = transmute(vreinterpretq_u16_p16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u16_s16() {
+ let a: i16x8 = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: u16x8 = u16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: u16x8 = transmute(vreinterpretq_u16_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u32_s32() {
+ let a: i32x4 = i32x4::new(0, 1, 2, 3);
+ let e: u32x4 = u32x4::new(0, 1, 2, 3);
+ let r: u32x4 = transmute(vreinterpretq_u32_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u64_s64() {
+ let a: i64x2 = i64x2::new(0, 1);
+ let e: u64x2 = u64x2::new(0, 1);
+ let r: u64x2 = transmute(vreinterpretq_u64_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_p8_s8() {
+ let a: i8x8 = i8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: i8x8 = i8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: i8x8 = transmute(vreinterpret_p8_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_p8_u8() {
+ let a: u8x8 = u8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: i8x8 = i8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: i8x8 = transmute(vreinterpret_p8_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_p16_s16() {
+ let a: i16x4 = i16x4::new(0, 1, 2, 3);
+ let e: i16x4 = i16x4::new(0, 1, 2, 3);
+ let r: i16x4 = transmute(vreinterpret_p16_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_p16_u16() {
+ let a: u16x4 = u16x4::new(0, 1, 2, 3);
+ let e: i16x4 = i16x4::new(0, 1, 2, 3);
+ let r: i16x4 = transmute(vreinterpret_p16_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p8_s8() {
+ let a: i8x16 = i8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let e: i8x16 = i8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r: i8x16 = transmute(vreinterpretq_p8_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p8_u8() {
+ let a: u8x16 = u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let e: i8x16 = i8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r: i8x16 = transmute(vreinterpretq_p8_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p16_s16() {
+ let a: i16x8 = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: i16x8 = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: i16x8 = transmute(vreinterpretq_p16_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p16_u16() {
+ let a: u16x8 = u16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: i16x8 = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: i16x8 = transmute(vreinterpretq_p16_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s8_s16() {
+ let a: i16x4 = i16x4::new(0, 1, 2, 3);
+ let e: i8x8 = i8x8::new(0, 0, 1, 0, 2, 0, 3, 0);
+ let r: i8x8 = transmute(vreinterpret_s8_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s8_u16() {
+ let a: u16x4 = u16x4::new(0, 1, 2, 3);
+ let e: i8x8 = i8x8::new(0, 0, 1, 0, 2, 0, 3, 0);
+ let r: i8x8 = transmute(vreinterpret_s8_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s8_p16() {
+ let a: i16x4 = i16x4::new(0, 1, 2, 3);
+ let e: i8x8 = i8x8::new(0, 0, 1, 0, 2, 0, 3, 0);
+ let r: i8x8 = transmute(vreinterpret_s8_p16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s16_s32() {
+ let a: i32x2 = i32x2::new(0, 1);
+ let e: i16x4 = i16x4::new(0, 0, 1, 0);
+ let r: i16x4 = transmute(vreinterpret_s16_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s16_u32() {
+ let a: u32x2 = u32x2::new(0, 1);
+ let e: i16x4 = i16x4::new(0, 0, 1, 0);
+ let r: i16x4 = transmute(vreinterpret_s16_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s32_s64() {
+ let a: i64x1 = i64x1::new(0);
+ let e: i32x2 = i32x2::new(0, 0);
+ let r: i32x2 = transmute(vreinterpret_s32_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s32_u64() {
+ let a: u64x1 = u64x1::new(0);
+ let e: i32x2 = i32x2::new(0, 0);
+ let r: i32x2 = transmute(vreinterpret_s32_u64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s8_s16() {
+ let a: i16x8 = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: i8x16 = i8x16::new(0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0);
+ let r: i8x16 = transmute(vreinterpretq_s8_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s8_u16() {
+ let a: u16x8 = u16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: i8x16 = i8x16::new(0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0);
+ let r: i8x16 = transmute(vreinterpretq_s8_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s8_p16() {
+ let a: i16x8 = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: i8x16 = i8x16::new(0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0);
+ let r: i8x16 = transmute(vreinterpretq_s8_p16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s16_s32() {
+ let a: i32x4 = i32x4::new(0, 1, 2, 3);
+ let e: i16x8 = i16x8::new(0, 0, 1, 0, 2, 0, 3, 0);
+ let r: i16x8 = transmute(vreinterpretq_s16_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s16_u32() {
+ let a: u32x4 = u32x4::new(0, 1, 2, 3);
+ let e: i16x8 = i16x8::new(0, 0, 1, 0, 2, 0, 3, 0);
+ let r: i16x8 = transmute(vreinterpretq_s16_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s32_s64() {
+ let a: i64x2 = i64x2::new(0, 1);
+ let e: i32x4 = i32x4::new(0, 0, 1, 0);
+ let r: i32x4 = transmute(vreinterpretq_s32_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s32_u64() {
+ let a: u64x2 = u64x2::new(0, 1);
+ let e: i32x4 = i32x4::new(0, 0, 1, 0);
+ let r: i32x4 = transmute(vreinterpretq_s32_u64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u8_p16() {
+ let a: i16x4 = i16x4::new(0, 1, 2, 3);
+ let e: u8x8 = u8x8::new(0, 0, 1, 0, 2, 0, 3, 0);
+ let r: u8x8 = transmute(vreinterpret_u8_p16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u8_s16() {
+ let a: i16x4 = i16x4::new(0, 1, 2, 3);
+ let e: u8x8 = u8x8::new(0, 0, 1, 0, 2, 0, 3, 0);
+ let r: u8x8 = transmute(vreinterpret_u8_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u8_u16() {
+ let a: u16x4 = u16x4::new(0, 1, 2, 3);
+ let e: u8x8 = u8x8::new(0, 0, 1, 0, 2, 0, 3, 0);
+ let r: u8x8 = transmute(vreinterpret_u8_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u16_s32() {
+ let a: i32x2 = i32x2::new(0, 1);
+ let e: u16x4 = u16x4::new(0, 0, 1, 0);
+ let r: u16x4 = transmute(vreinterpret_u16_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u16_u32() {
+ let a: u32x2 = u32x2::new(0, 1);
+ let e: u16x4 = u16x4::new(0, 0, 1, 0);
+ let r: u16x4 = transmute(vreinterpret_u16_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u32_s64() {
+ let a: i64x1 = i64x1::new(0);
+ let e: u32x2 = u32x2::new(0, 0);
+ let r: u32x2 = transmute(vreinterpret_u32_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u32_u64() {
+ let a: u64x1 = u64x1::new(0);
+ let e: u32x2 = u32x2::new(0, 0);
+ let r: u32x2 = transmute(vreinterpret_u32_u64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u8_p16() {
+ let a: i16x8 = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: u8x16 = u8x16::new(0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0);
+ let r: u8x16 = transmute(vreinterpretq_u8_p16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u8_s16() {
+ let a: i16x8 = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: u8x16 = u8x16::new(0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0);
+ let r: u8x16 = transmute(vreinterpretq_u8_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u8_u16() {
+ let a: u16x8 = u16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: u8x16 = u8x16::new(0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0);
+ let r: u8x16 = transmute(vreinterpretq_u8_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u16_s32() {
+ let a: i32x4 = i32x4::new(0, 1, 2, 3);
+ let e: u16x8 = u16x8::new(0, 0, 1, 0, 2, 0, 3, 0);
+ let r: u16x8 = transmute(vreinterpretq_u16_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u16_u32() {
+ let a: u32x4 = u32x4::new(0, 1, 2, 3);
+ let e: u16x8 = u16x8::new(0, 0, 1, 0, 2, 0, 3, 0);
+ let r: u16x8 = transmute(vreinterpretq_u16_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u32_s64() {
+ let a: i64x2 = i64x2::new(0, 1);
+ let e: u32x4 = u32x4::new(0, 0, 1, 0);
+ let r: u32x4 = transmute(vreinterpretq_u32_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u32_u64() {
+ let a: u64x2 = u64x2::new(0, 1);
+ let e: u32x4 = u32x4::new(0, 0, 1, 0);
+ let r: u32x4 = transmute(vreinterpretq_u32_u64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_p8_p16() {
+ let a: i16x4 = i16x4::new(0, 1, 2, 3);
+ let e: i8x8 = i8x8::new(0, 0, 1, 0, 2, 0, 3, 0);
+ let r: i8x8 = transmute(vreinterpret_p8_p16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_p8_s16() {
+ let a: i16x4 = i16x4::new(0, 1, 2, 3);
+ let e: i8x8 = i8x8::new(0, 0, 1, 0, 2, 0, 3, 0);
+ let r: i8x8 = transmute(vreinterpret_p8_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_p8_u16() {
+ let a: u16x4 = u16x4::new(0, 1, 2, 3);
+ let e: i8x8 = i8x8::new(0, 0, 1, 0, 2, 0, 3, 0);
+ let r: i8x8 = transmute(vreinterpret_p8_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_p16_s32() {
+ let a: i32x2 = i32x2::new(0, 1);
+ let e: i16x4 = i16x4::new(0, 0, 1, 0);
+ let r: i16x4 = transmute(vreinterpret_p16_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_p16_u32() {
+ let a: u32x2 = u32x2::new(0, 1);
+ let e: i16x4 = i16x4::new(0, 0, 1, 0);
+ let r: i16x4 = transmute(vreinterpret_p16_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p8_p16() {
+ let a: i16x8 = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: i8x16 = i8x16::new(0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0);
+ let r: i8x16 = transmute(vreinterpretq_p8_p16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p8_s16() {
+ let a: i16x8 = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: i8x16 = i8x16::new(0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0);
+ let r: i8x16 = transmute(vreinterpretq_p8_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p8_u16() {
+ let a: u16x8 = u16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: i8x16 = i8x16::new(0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0);
+ let r: i8x16 = transmute(vreinterpretq_p8_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p16_s32() {
+ let a: i32x4 = i32x4::new(0, 1, 2, 3);
+ let e: i16x8 = i16x8::new(0, 0, 1, 0, 2, 0, 3, 0);
+ let r: i16x8 = transmute(vreinterpretq_p16_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p16_u32() {
+ let a: u32x4 = u32x4::new(0, 1, 2, 3);
+ let e: i16x8 = i16x8::new(0, 0, 1, 0, 2, 0, 3, 0);
+ let r: i16x8 = transmute(vreinterpretq_p16_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s32_p64() {
+ let a: i64x1 = i64x1::new(0);
+ let e: i32x2 = i32x2::new(0, 0);
+ let r: i32x2 = transmute(vreinterpret_s32_p64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u32_p64() {
+ let a: i64x1 = i64x1::new(0);
+ let e: u32x2 = u32x2::new(0, 0);
+ let r: u32x2 = transmute(vreinterpret_u32_p64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s32_p64() {
+ let a: i64x2 = i64x2::new(0, 1);
+ let e: i32x4 = i32x4::new(0, 0, 1, 0);
+ let r: i32x4 = transmute(vreinterpretq_s32_p64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u32_p64() {
+ let a: i64x2 = i64x2::new(0, 1);
+ let e: u32x4 = u32x4::new(0, 0, 1, 0);
+ let r: u32x4 = transmute(vreinterpretq_u32_p64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s64_p128() {
+ let a: p128 = 0;
+ let e: i64x2 = i64x2::new(0, 0);
+ let r: i64x2 = transmute(vreinterpretq_s64_p128(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u64_p128() {
+ let a: p128 = 0;
+ let e: u64x2 = u64x2::new(0, 0);
+ let r: u64x2 = transmute(vreinterpretq_u64_p128(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p64_p128() {
+ let a: p128 = 0;
+ let e: i64x2 = i64x2::new(0, 0);
+ let r: i64x2 = transmute(vreinterpretq_p64_p128(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s16_p8() {
+ let a: i8x8 = i8x8::new(0, 0, 1, 0, 2, 0, 3, 0);
+ let e: i16x4 = i16x4::new(0, 1, 2, 3);
+ let r: i16x4 = transmute(vreinterpret_s16_p8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s16_s8() {
+ let a: i8x8 = i8x8::new(0, 0, 1, 0, 2, 0, 3, 0);
+ let e: i16x4 = i16x4::new(0, 1, 2, 3);
+ let r: i16x4 = transmute(vreinterpret_s16_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s16_u8() {
+ let a: u8x8 = u8x8::new(0, 0, 1, 0, 2, 0, 3, 0);
+ let e: i16x4 = i16x4::new(0, 1, 2, 3);
+ let r: i16x4 = transmute(vreinterpret_s16_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s32_p16() {
+ let a: i16x4 = i16x4::new(0, 0, 1, 0);
+ let e: i32x2 = i32x2::new(0, 1);
+ let r: i32x2 = transmute(vreinterpret_s32_p16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s32_s16() {
+ let a: i16x4 = i16x4::new(0, 0, 1, 0);
+ let e: i32x2 = i32x2::new(0, 1);
+ let r: i32x2 = transmute(vreinterpret_s32_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s32_u16() {
+ let a: u16x4 = u16x4::new(0, 0, 1, 0);
+ let e: i32x2 = i32x2::new(0, 1);
+ let r: i32x2 = transmute(vreinterpret_s32_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s64_s32() {
+ let a: i32x2 = i32x2::new(0, 0);
+ let e: i64x1 = i64x1::new(0);
+ let r: i64x1 = transmute(vreinterpret_s64_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s64_u32() {
+ let a: u32x2 = u32x2::new(0, 0);
+ let e: i64x1 = i64x1::new(0);
+ let r: i64x1 = transmute(vreinterpret_s64_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s16_p8() {
+ let a: i8x16 = i8x16::new(0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0);
+ let e: i16x8 = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: i16x8 = transmute(vreinterpretq_s16_p8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s16_s8() {
+ let a: i8x16 = i8x16::new(0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0);
+ let e: i16x8 = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: i16x8 = transmute(vreinterpretq_s16_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s16_u8() {
+ let a: u8x16 = u8x16::new(0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0);
+ let e: i16x8 = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: i16x8 = transmute(vreinterpretq_s16_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s32_p16() {
+ let a: i16x8 = i16x8::new(0, 0, 1, 0, 2, 0, 3, 0);
+ let e: i32x4 = i32x4::new(0, 1, 2, 3);
+ let r: i32x4 = transmute(vreinterpretq_s32_p16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s32_s16() {
+ let a: i16x8 = i16x8::new(0, 0, 1, 0, 2, 0, 3, 0);
+ let e: i32x4 = i32x4::new(0, 1, 2, 3);
+ let r: i32x4 = transmute(vreinterpretq_s32_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s32_u16() {
+ let a: u16x8 = u16x8::new(0, 0, 1, 0, 2, 0, 3, 0);
+ let e: i32x4 = i32x4::new(0, 1, 2, 3);
+ let r: i32x4 = transmute(vreinterpretq_s32_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s64_s32() {
+ let a: i32x4 = i32x4::new(0, 0, 1, 0);
+ let e: i64x2 = i64x2::new(0, 1);
+ let r: i64x2 = transmute(vreinterpretq_s64_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s64_u32() {
+ let a: u32x4 = u32x4::new(0, 0, 1, 0);
+ let e: i64x2 = i64x2::new(0, 1);
+ let r: i64x2 = transmute(vreinterpretq_s64_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u16_p8() {
+ let a: i8x8 = i8x8::new(0, 0, 1, 0, 2, 0, 3, 0);
+ let e: u16x4 = u16x4::new(0, 1, 2, 3);
+ let r: u16x4 = transmute(vreinterpret_u16_p8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u16_s8() {
+ let a: i8x8 = i8x8::new(0, 0, 1, 0, 2, 0, 3, 0);
+ let e: u16x4 = u16x4::new(0, 1, 2, 3);
+ let r: u16x4 = transmute(vreinterpret_u16_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u16_u8() {
+ let a: u8x8 = u8x8::new(0, 0, 1, 0, 2, 0, 3, 0);
+ let e: u16x4 = u16x4::new(0, 1, 2, 3);
+ let r: u16x4 = transmute(vreinterpret_u16_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u32_p16() {
+ let a: i16x4 = i16x4::new(0, 0, 1, 0);
+ let e: u32x2 = u32x2::new(0, 1);
+ let r: u32x2 = transmute(vreinterpret_u32_p16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u32_s16() {
+ let a: i16x4 = i16x4::new(0, 0, 1, 0);
+ let e: u32x2 = u32x2::new(0, 1);
+ let r: u32x2 = transmute(vreinterpret_u32_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u32_u16() {
+ let a: u16x4 = u16x4::new(0, 0, 1, 0);
+ let e: u32x2 = u32x2::new(0, 1);
+ let r: u32x2 = transmute(vreinterpret_u32_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u64_s32() {
+ let a: i32x2 = i32x2::new(0, 0);
+ let e: u64x1 = u64x1::new(0);
+ let r: u64x1 = transmute(vreinterpret_u64_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u64_u32() {
+ let a: u32x2 = u32x2::new(0, 0);
+ let e: u64x1 = u64x1::new(0);
+ let r: u64x1 = transmute(vreinterpret_u64_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u16_p8() {
+ let a: i8x16 = i8x16::new(0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0);
+ let e: u16x8 = u16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: u16x8 = transmute(vreinterpretq_u16_p8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u16_s8() {
+ let a: i8x16 = i8x16::new(0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0);
+ let e: u16x8 = u16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: u16x8 = transmute(vreinterpretq_u16_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u16_u8() {
+ let a: u8x16 = u8x16::new(0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0);
+ let e: u16x8 = u16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: u16x8 = transmute(vreinterpretq_u16_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u32_p16() {
+ let a: i16x8 = i16x8::new(0, 0, 1, 0, 2, 0, 3, 0);
+ let e: u32x4 = u32x4::new(0, 1, 2, 3);
+ let r: u32x4 = transmute(vreinterpretq_u32_p16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u32_s16() {
+ let a: i16x8 = i16x8::new(0, 0, 1, 0, 2, 0, 3, 0);
+ let e: u32x4 = u32x4::new(0, 1, 2, 3);
+ let r: u32x4 = transmute(vreinterpretq_u32_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u32_u16() {
+ let a: u16x8 = u16x8::new(0, 0, 1, 0, 2, 0, 3, 0);
+ let e: u32x4 = u32x4::new(0, 1, 2, 3);
+ let r: u32x4 = transmute(vreinterpretq_u32_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u64_s32() {
+ let a: i32x4 = i32x4::new(0, 0, 1, 0);
+ let e: u64x2 = u64x2::new(0, 1);
+ let r: u64x2 = transmute(vreinterpretq_u64_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u64_u32() {
+ let a: u32x4 = u32x4::new(0, 0, 1, 0);
+ let e: u64x2 = u64x2::new(0, 1);
+ let r: u64x2 = transmute(vreinterpretq_u64_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_p16_p8() {
+ let a: i8x8 = i8x8::new(0, 0, 1, 0, 2, 0, 3, 0);
+ let e: i16x4 = i16x4::new(0, 1, 2, 3);
+ let r: i16x4 = transmute(vreinterpret_p16_p8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_p16_s8() {
+ let a: i8x8 = i8x8::new(0, 0, 1, 0, 2, 0, 3, 0);
+ let e: i16x4 = i16x4::new(0, 1, 2, 3);
+ let r: i16x4 = transmute(vreinterpret_p16_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_p16_u8() {
+ let a: u8x8 = u8x8::new(0, 0, 1, 0, 2, 0, 3, 0);
+ let e: i16x4 = i16x4::new(0, 1, 2, 3);
+ let r: i16x4 = transmute(vreinterpret_p16_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p16_p8() {
+ let a: i8x16 = i8x16::new(0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0);
+ let e: i16x8 = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: i16x8 = transmute(vreinterpretq_p16_p8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p16_s8() {
+ let a: i8x16 = i8x16::new(0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0);
+ let e: i16x8 = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: i16x8 = transmute(vreinterpretq_p16_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p16_u8() {
+ let a: u8x16 = u8x16::new(0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0);
+ let e: i16x8 = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r: i16x8 = transmute(vreinterpretq_p16_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_p64_s32() {
+ let a: i32x2 = i32x2::new(0, 0);
+ let e: i64x1 = i64x1::new(0);
+ let r: i64x1 = transmute(vreinterpret_p64_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_p64_u32() {
+ let a: u32x2 = u32x2::new(0, 0);
+ let e: i64x1 = i64x1::new(0);
+ let r: i64x1 = transmute(vreinterpret_p64_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p64_s32() {
+ let a: i32x4 = i32x4::new(0, 0, 1, 0);
+ let e: i64x2 = i64x2::new(0, 1);
+ let r: i64x2 = transmute(vreinterpretq_p64_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p64_u32() {
+ let a: u32x4 = u32x4::new(0, 0, 1, 0);
+ let e: i64x2 = i64x2::new(0, 1);
+ let r: i64x2 = transmute(vreinterpretq_p64_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p128_s64() {
+ let a: i64x2 = i64x2::new(0, 0);
+ let e: p128 = 0;
+ let r: p128 = transmute(vreinterpretq_p128_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p128_u64() {
+ let a: u64x2 = u64x2::new(0, 0);
+ let e: p128 = 0;
+ let r: p128 = transmute(vreinterpretq_p128_u64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p128_p64() {
+ let a: i64x2 = i64x2::new(0, 0);
+ let e: p128 = 0;
+ let r: p128 = transmute(vreinterpretq_p128_p64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s8_s32() {
+ let a: i32x2 = i32x2::new(0, 1);
+ let e: i8x8 = i8x8::new(0, 0, 0, 0, 1, 0, 0, 0);
+ let r: i8x8 = transmute(vreinterpret_s8_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s8_u32() {
+ let a: u32x2 = u32x2::new(0, 1);
+ let e: i8x8 = i8x8::new(0, 0, 0, 0, 1, 0, 0, 0);
+ let r: i8x8 = transmute(vreinterpret_s8_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s16_s64() {
+ let a: i64x1 = i64x1::new(0);
+ let e: i16x4 = i16x4::new(0, 0, 0, 0);
+ let r: i16x4 = transmute(vreinterpret_s16_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s16_u64() {
+ let a: u64x1 = u64x1::new(0);
+ let e: i16x4 = i16x4::new(0, 0, 0, 0);
+ let r: i16x4 = transmute(vreinterpret_s16_u64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s8_s32() {
+ let a: i32x4 = i32x4::new(0, 1, 2, 3);
+ let e: i8x16 = i8x16::new(0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0);
+ let r: i8x16 = transmute(vreinterpretq_s8_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s8_u32() {
+ let a: u32x4 = u32x4::new(0, 1, 2, 3);
+ let e: i8x16 = i8x16::new(0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0);
+ let r: i8x16 = transmute(vreinterpretq_s8_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s16_s64() {
+ let a: i64x2 = i64x2::new(0, 1);
+ let e: i16x8 = i16x8::new(0, 0, 0, 0, 1, 0, 0, 0);
+ let r: i16x8 = transmute(vreinterpretq_s16_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s16_u64() {
+ let a: u64x2 = u64x2::new(0, 1);
+ let e: i16x8 = i16x8::new(0, 0, 0, 0, 1, 0, 0, 0);
+ let r: i16x8 = transmute(vreinterpretq_s16_u64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u8_s32() {
+ let a: i32x2 = i32x2::new(0, 1);
+ let e: u8x8 = u8x8::new(0, 0, 0, 0, 1, 0, 0, 0);
+ let r: u8x8 = transmute(vreinterpret_u8_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u8_u32() {
+ let a: u32x2 = u32x2::new(0, 1);
+ let e: u8x8 = u8x8::new(0, 0, 0, 0, 1, 0, 0, 0);
+ let r: u8x8 = transmute(vreinterpret_u8_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u16_s64() {
+ let a: i64x1 = i64x1::new(0);
+ let e: u16x4 = u16x4::new(0, 0, 0, 0);
+ let r: u16x4 = transmute(vreinterpret_u16_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u16_u64() {
+ let a: u64x1 = u64x1::new(0);
+ let e: u16x4 = u16x4::new(0, 0, 0, 0);
+ let r: u16x4 = transmute(vreinterpret_u16_u64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u8_s32() {
+ let a: i32x4 = i32x4::new(0, 1, 2, 3);
+ let e: u8x16 = u8x16::new(0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0);
+ let r: u8x16 = transmute(vreinterpretq_u8_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u8_u32() {
+ let a: u32x4 = u32x4::new(0, 1, 2, 3);
+ let e: u8x16 = u8x16::new(0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0);
+ let r: u8x16 = transmute(vreinterpretq_u8_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u16_s64() {
+ let a: i64x2 = i64x2::new(0, 1);
+ let e: u16x8 = u16x8::new(0, 0, 0, 0, 1, 0, 0, 0);
+ let r: u16x8 = transmute(vreinterpretq_u16_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u16_u64() {
+ let a: u64x2 = u64x2::new(0, 1);
+ let e: u16x8 = u16x8::new(0, 0, 0, 0, 1, 0, 0, 0);
+ let r: u16x8 = transmute(vreinterpretq_u16_u64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_p8_s32() {
+ let a: i32x2 = i32x2::new(0, 1);
+ let e: i8x8 = i8x8::new(0, 0, 0, 0, 1, 0, 0, 0);
+ let r: i8x8 = transmute(vreinterpret_p8_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_p8_u32() {
+ let a: u32x2 = u32x2::new(0, 1);
+ let e: i8x8 = i8x8::new(0, 0, 0, 0, 1, 0, 0, 0);
+ let r: i8x8 = transmute(vreinterpret_p8_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_p16_s64() {
+ let a: i64x1 = i64x1::new(0);
+ let e: i16x4 = i16x4::new(0, 0, 0, 0);
+ let r: i16x4 = transmute(vreinterpret_p16_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_p16_u64() {
+ let a: u64x1 = u64x1::new(0);
+ let e: i16x4 = i16x4::new(0, 0, 0, 0);
+ let r: i16x4 = transmute(vreinterpret_p16_u64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p8_s32() {
+ let a: i32x4 = i32x4::new(0, 1, 2, 3);
+ let e: i8x16 = i8x16::new(0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0);
+ let r: i8x16 = transmute(vreinterpretq_p8_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p8_u32() {
+ let a: u32x4 = u32x4::new(0, 1, 2, 3);
+ let e: i8x16 = i8x16::new(0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0);
+ let r: i8x16 = transmute(vreinterpretq_p8_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p16_s64() {
+ let a: i64x2 = i64x2::new(0, 1);
+ let e: i16x8 = i16x8::new(0, 0, 0, 0, 1, 0, 0, 0);
+ let r: i16x8 = transmute(vreinterpretq_p16_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p16_u64() {
+ let a: u64x2 = u64x2::new(0, 1);
+ let e: i16x8 = i16x8::new(0, 0, 0, 0, 1, 0, 0, 0);
+ let r: i16x8 = transmute(vreinterpretq_p16_u64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s16_p64() {
+ let a: i64x1 = i64x1::new(0);
+ let e: i16x4 = i16x4::new(0, 0, 0, 0);
+ let r: i16x4 = transmute(vreinterpret_s16_p64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u16_p64() {
+ let a: i64x1 = i64x1::new(0);
+ let e: u16x4 = u16x4::new(0, 0, 0, 0);
+ let r: u16x4 = transmute(vreinterpret_u16_p64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_p16_p64() {
+ let a: i64x1 = i64x1::new(0);
+ let e: i16x4 = i16x4::new(0, 0, 0, 0);
+ let r: i16x4 = transmute(vreinterpret_p16_p64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s16_p64() {
+ let a: i64x2 = i64x2::new(0, 1);
+ let e: i16x8 = i16x8::new(0, 0, 0, 0, 1, 0, 0, 0);
+ let r: i16x8 = transmute(vreinterpretq_s16_p64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u16_p64() {
+ let a: i64x2 = i64x2::new(0, 1);
+ let e: u16x8 = u16x8::new(0, 0, 0, 0, 1, 0, 0, 0);
+ let r: u16x8 = transmute(vreinterpretq_u16_p64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p16_p64() {
+ let a: i64x2 = i64x2::new(0, 1);
+ let e: i16x8 = i16x8::new(0, 0, 0, 0, 1, 0, 0, 0);
+ let r: i16x8 = transmute(vreinterpretq_p16_p64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s32_p128() {
+ let a: p128 = 0;
+ let e: i32x4 = i32x4::new(0, 0, 0, 0);
+ let r: i32x4 = transmute(vreinterpretq_s32_p128(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u32_p128() {
+ let a: p128 = 0;
+ let e: u32x4 = u32x4::new(0, 0, 0, 0);
+ let r: u32x4 = transmute(vreinterpretq_u32_p128(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s32_p8() {
+ let a: i8x8 = i8x8::new(0, 0, 0, 0, 1, 0, 0, 0);
+ let e: i32x2 = i32x2::new(0, 1);
+ let r: i32x2 = transmute(vreinterpret_s32_p8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s32_s8() {
+ let a: i8x8 = i8x8::new(0, 0, 0, 0, 1, 0, 0, 0);
+ let e: i32x2 = i32x2::new(0, 1);
+ let r: i32x2 = transmute(vreinterpret_s32_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s32_u8() {
+ let a: u8x8 = u8x8::new(0, 0, 0, 0, 1, 0, 0, 0);
+ let e: i32x2 = i32x2::new(0, 1);
+ let r: i32x2 = transmute(vreinterpret_s32_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s64_p16() {
+ let a: i16x4 = i16x4::new(0, 0, 0, 0);
+ let e: i64x1 = i64x1::new(0);
+ let r: i64x1 = transmute(vreinterpret_s64_p16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s64_s16() {
+ let a: i16x4 = i16x4::new(0, 0, 0, 0);
+ let e: i64x1 = i64x1::new(0);
+ let r: i64x1 = transmute(vreinterpret_s64_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s64_u16() {
+ let a: u16x4 = u16x4::new(0, 0, 0, 0);
+ let e: i64x1 = i64x1::new(0);
+ let r: i64x1 = transmute(vreinterpret_s64_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s32_p8() {
+ let a: i8x16 = i8x16::new(0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0);
+ let e: i32x4 = i32x4::new(0, 1, 2, 3);
+ let r: i32x4 = transmute(vreinterpretq_s32_p8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s32_s8() {
+ let a: i8x16 = i8x16::new(0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0);
+ let e: i32x4 = i32x4::new(0, 1, 2, 3);
+ let r: i32x4 = transmute(vreinterpretq_s32_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s32_u8() {
+ let a: u8x16 = u8x16::new(0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0);
+ let e: i32x4 = i32x4::new(0, 1, 2, 3);
+ let r: i32x4 = transmute(vreinterpretq_s32_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s64_p16() {
+ let a: i16x8 = i16x8::new(0, 0, 0, 0, 1, 0, 0, 0);
+ let e: i64x2 = i64x2::new(0, 1);
+ let r: i64x2 = transmute(vreinterpretq_s64_p16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s64_s16() {
+ let a: i16x8 = i16x8::new(0, 0, 0, 0, 1, 0, 0, 0);
+ let e: i64x2 = i64x2::new(0, 1);
+ let r: i64x2 = transmute(vreinterpretq_s64_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s64_u16() {
+ let a: u16x8 = u16x8::new(0, 0, 0, 0, 1, 0, 0, 0);
+ let e: i64x2 = i64x2::new(0, 1);
+ let r: i64x2 = transmute(vreinterpretq_s64_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u32_p8() {
+ let a: i8x8 = i8x8::new(0, 0, 0, 0, 1, 0, 0, 0);
+ let e: u32x2 = u32x2::new(0, 1);
+ let r: u32x2 = transmute(vreinterpret_u32_p8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u32_s8() {
+ let a: i8x8 = i8x8::new(0, 0, 0, 0, 1, 0, 0, 0);
+ let e: u32x2 = u32x2::new(0, 1);
+ let r: u32x2 = transmute(vreinterpret_u32_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u32_u8() {
+ let a: u8x8 = u8x8::new(0, 0, 0, 0, 1, 0, 0, 0);
+ let e: u32x2 = u32x2::new(0, 1);
+ let r: u32x2 = transmute(vreinterpret_u32_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u64_p16() {
+ let a: i16x4 = i16x4::new(0, 0, 0, 0);
+ let e: u64x1 = u64x1::new(0);
+ let r: u64x1 = transmute(vreinterpret_u64_p16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u64_s16() {
+ let a: i16x4 = i16x4::new(0, 0, 0, 0);
+ let e: u64x1 = u64x1::new(0);
+ let r: u64x1 = transmute(vreinterpret_u64_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u64_u16() {
+ let a: u16x4 = u16x4::new(0, 0, 0, 0);
+ let e: u64x1 = u64x1::new(0);
+ let r: u64x1 = transmute(vreinterpret_u64_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u32_p8() {
+ let a: i8x16 = i8x16::new(0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0);
+ let e: u32x4 = u32x4::new(0, 1, 2, 3);
+ let r: u32x4 = transmute(vreinterpretq_u32_p8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u32_s8() {
+ let a: i8x16 = i8x16::new(0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0);
+ let e: u32x4 = u32x4::new(0, 1, 2, 3);
+ let r: u32x4 = transmute(vreinterpretq_u32_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u32_u8() {
+ let a: u8x16 = u8x16::new(0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0);
+ let e: u32x4 = u32x4::new(0, 1, 2, 3);
+ let r: u32x4 = transmute(vreinterpretq_u32_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u64_p16() {
+ let a: i16x8 = i16x8::new(0, 0, 0, 0, 1, 0, 0, 0);
+ let e: u64x2 = u64x2::new(0, 1);
+ let r: u64x2 = transmute(vreinterpretq_u64_p16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u64_s16() {
+ let a: i16x8 = i16x8::new(0, 0, 0, 0, 1, 0, 0, 0);
+ let e: u64x2 = u64x2::new(0, 1);
+ let r: u64x2 = transmute(vreinterpretq_u64_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u64_u16() {
+ let a: u16x8 = u16x8::new(0, 0, 0, 0, 1, 0, 0, 0);
+ let e: u64x2 = u64x2::new(0, 1);
+ let r: u64x2 = transmute(vreinterpretq_u64_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_p64_p16() {
+ let a: i16x4 = i16x4::new(0, 0, 0, 0);
+ let e: i64x1 = i64x1::new(0);
+ let r: i64x1 = transmute(vreinterpret_p64_p16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_p64_s16() {
+ let a: i16x4 = i16x4::new(0, 0, 0, 0);
+ let e: i64x1 = i64x1::new(0);
+ let r: i64x1 = transmute(vreinterpret_p64_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_p64_u16() {
+ let a: u16x4 = u16x4::new(0, 0, 0, 0);
+ let e: i64x1 = i64x1::new(0);
+ let r: i64x1 = transmute(vreinterpret_p64_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p64_p16() {
+ let a: i16x8 = i16x8::new(0, 0, 0, 0, 1, 0, 0, 0);
+ let e: i64x2 = i64x2::new(0, 1);
+ let r: i64x2 = transmute(vreinterpretq_p64_p16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p64_s16() {
+ let a: i16x8 = i16x8::new(0, 0, 0, 0, 1, 0, 0, 0);
+ let e: i64x2 = i64x2::new(0, 1);
+ let r: i64x2 = transmute(vreinterpretq_p64_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p64_u16() {
+ let a: u16x8 = u16x8::new(0, 0, 0, 0, 1, 0, 0, 0);
+ let e: i64x2 = i64x2::new(0, 1);
+ let r: i64x2 = transmute(vreinterpretq_p64_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p128_s32() {
+ let a: i32x4 = i32x4::new(0, 0, 0, 0);
+ let e: p128 = 0;
+ let r: p128 = transmute(vreinterpretq_p128_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p128_u32() {
+ let a: u32x4 = u32x4::new(0, 0, 0, 0);
+ let e: p128 = 0;
+ let r: p128 = transmute(vreinterpretq_p128_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s8_s64() {
+ let a: i64x1 = i64x1::new(0);
+ let e: i8x8 = i8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let r: i8x8 = transmute(vreinterpret_s8_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s8_u64() {
+ let a: u64x1 = u64x1::new(0);
+ let e: i8x8 = i8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let r: i8x8 = transmute(vreinterpret_s8_u64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u8_s64() {
+ let a: i64x1 = i64x1::new(0);
+ let e: u8x8 = u8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let r: u8x8 = transmute(vreinterpret_u8_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u8_u64() {
+ let a: u64x1 = u64x1::new(0);
+ let e: u8x8 = u8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let r: u8x8 = transmute(vreinterpret_u8_u64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_p8_s64() {
+ let a: i64x1 = i64x1::new(0);
+ let e: i8x8 = i8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let r: i8x8 = transmute(vreinterpret_p8_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_p8_u64() {
+ let a: u64x1 = u64x1::new(0);
+ let e: i8x8 = i8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let r: i8x8 = transmute(vreinterpret_p8_u64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s8_s64() {
+ let a: i64x2 = i64x2::new(0, 1);
+ let e: i8x16 = i8x16::new(0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0);
+ let r: i8x16 = transmute(vreinterpretq_s8_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s8_u64() {
+ let a: u64x2 = u64x2::new(0, 1);
+ let e: i8x16 = i8x16::new(0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0);
+ let r: i8x16 = transmute(vreinterpretq_s8_u64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u8_s64() {
+ let a: i64x2 = i64x2::new(0, 1);
+ let e: u8x16 = u8x16::new(0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0);
+ let r: u8x16 = transmute(vreinterpretq_u8_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u8_u64() {
+ let a: u64x2 = u64x2::new(0, 1);
+ let e: u8x16 = u8x16::new(0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0);
+ let r: u8x16 = transmute(vreinterpretq_u8_u64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p8_s64() {
+ let a: i64x2 = i64x2::new(0, 1);
+ let e: i8x16 = i8x16::new(0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0);
+ let r: i8x16 = transmute(vreinterpretq_p8_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p8_u64() {
+ let a: u64x2 = u64x2::new(0, 1);
+ let e: i8x16 = i8x16::new(0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0);
+ let r: i8x16 = transmute(vreinterpretq_p8_u64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s8_p64() {
+ let a: i64x1 = i64x1::new(0);
+ let e: i8x8 = i8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let r: i8x8 = transmute(vreinterpret_s8_p64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u8_p64() {
+ let a: i64x1 = i64x1::new(0);
+ let e: u8x8 = u8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let r: u8x8 = transmute(vreinterpret_u8_p64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_p8_p64() {
+ let a: i64x1 = i64x1::new(0);
+ let e: i8x8 = i8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let r: i8x8 = transmute(vreinterpret_p8_p64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s8_p64() {
+ let a: i64x2 = i64x2::new(0, 1);
+ let e: i8x16 = i8x16::new(0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0);
+ let r: i8x16 = transmute(vreinterpretq_s8_p64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u8_p64() {
+ let a: i64x2 = i64x2::new(0, 1);
+ let e: u8x16 = u8x16::new(0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0);
+ let r: u8x16 = transmute(vreinterpretq_u8_p64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p8_p64() {
+ let a: i64x2 = i64x2::new(0, 1);
+ let e: i8x16 = i8x16::new(0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0);
+ let r: i8x16 = transmute(vreinterpretq_p8_p64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s16_p128() {
+ let a: p128 = 0;
+ let e: i16x8 = i16x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let r: i16x8 = transmute(vreinterpretq_s16_p128(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u16_p128() {
+ let a: p128 = 0;
+ let e: u16x8 = u16x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let r: u16x8 = transmute(vreinterpretq_u16_p128(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p16_p128() {
+ let a: p128 = 0;
+ let e: i16x8 = i16x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let r: i16x8 = transmute(vreinterpretq_p16_p128(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s64_p8() {
+ let a: i8x8 = i8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let e: i64x1 = i64x1::new(0);
+ let r: i64x1 = transmute(vreinterpret_s64_p8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s64_s8() {
+ let a: i8x8 = i8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let e: i64x1 = i64x1::new(0);
+ let r: i64x1 = transmute(vreinterpret_s64_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s64_u8() {
+ let a: u8x8 = u8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let e: i64x1 = i64x1::new(0);
+ let r: i64x1 = transmute(vreinterpret_s64_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u64_p8() {
+ let a: i8x8 = i8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let e: u64x1 = u64x1::new(0);
+ let r: u64x1 = transmute(vreinterpret_u64_p8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u64_s8() {
+ let a: i8x8 = i8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let e: u64x1 = u64x1::new(0);
+ let r: u64x1 = transmute(vreinterpret_u64_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u64_u8() {
+ let a: u8x8 = u8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let e: u64x1 = u64x1::new(0);
+ let r: u64x1 = transmute(vreinterpret_u64_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s64_p8() {
+ let a: i8x16 = i8x16::new(0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0);
+ let e: i64x2 = i64x2::new(0, 1);
+ let r: i64x2 = transmute(vreinterpretq_s64_p8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s64_s8() {
+ let a: i8x16 = i8x16::new(0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0);
+ let e: i64x2 = i64x2::new(0, 1);
+ let r: i64x2 = transmute(vreinterpretq_s64_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s64_u8() {
+ let a: u8x16 = u8x16::new(0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0);
+ let e: i64x2 = i64x2::new(0, 1);
+ let r: i64x2 = transmute(vreinterpretq_s64_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u64_p8() {
+ let a: i8x16 = i8x16::new(0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0);
+ let e: u64x2 = u64x2::new(0, 1);
+ let r: u64x2 = transmute(vreinterpretq_u64_p8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u64_s8() {
+ let a: i8x16 = i8x16::new(0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0);
+ let e: u64x2 = u64x2::new(0, 1);
+ let r: u64x2 = transmute(vreinterpretq_u64_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u64_u8() {
+ let a: u8x16 = u8x16::new(0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0);
+ let e: u64x2 = u64x2::new(0, 1);
+ let r: u64x2 = transmute(vreinterpretq_u64_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_p64_p8() {
+ let a: i8x8 = i8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let e: i64x1 = i64x1::new(0);
+ let r: i64x1 = transmute(vreinterpret_p64_p8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_p64_s8() {
+ let a: i8x8 = i8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let e: i64x1 = i64x1::new(0);
+ let r: i64x1 = transmute(vreinterpret_p64_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_p64_u8() {
+ let a: u8x8 = u8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let e: i64x1 = i64x1::new(0);
+ let r: i64x1 = transmute(vreinterpret_p64_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p64_p8() {
+ let a: i8x16 = i8x16::new(0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0);
+ let e: i64x2 = i64x2::new(0, 1);
+ let r: i64x2 = transmute(vreinterpretq_p64_p8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p64_s8() {
+ let a: i8x16 = i8x16::new(0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0);
+ let e: i64x2 = i64x2::new(0, 1);
+ let r: i64x2 = transmute(vreinterpretq_p64_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p64_u8() {
+ let a: u8x16 = u8x16::new(0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0);
+ let e: i64x2 = i64x2::new(0, 1);
+ let r: i64x2 = transmute(vreinterpretq_p64_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p128_s16() {
+ let a: i16x8 = i16x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let e: p128 = 0;
+ let r: p128 = transmute(vreinterpretq_p128_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p128_u16() {
+ let a: u16x8 = u16x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let e: p128 = 0;
+ let r: p128 = transmute(vreinterpretq_p128_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p128_p16() {
+ let a: i16x8 = i16x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let e: p128 = 0;
+ let r: p128 = transmute(vreinterpretq_p128_p16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p128_s8() {
+ let a: i8x16 = i8x16::new(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ let e: p128 = 1;
+ let r: p128 = transmute(vreinterpretq_p128_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p128_u8() {
+ let a: u8x16 = u8x16::new(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ let e: p128 = 1;
+ let r: p128 = transmute(vreinterpretq_p128_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p128_p8() {
+ let a: i8x16 = i8x16::new(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ let e: p128 = 1;
+ let r: p128 = transmute(vreinterpretq_p128_p8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s8_p128() {
+ let a: p128 = 1;
+ let e: i8x16 = i8x16::new(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ let r: i8x16 = transmute(vreinterpretq_s8_p128(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u8_p128() {
+ let a: p128 = 1;
+ let e: u8x16 = u8x16::new(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ let r: u8x16 = transmute(vreinterpretq_u8_p128(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p8_p128() {
+ let a: p128 = 1;
+ let e: i8x16 = i8x16::new(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ let r: i8x16 = transmute(vreinterpretq_p8_p128(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s8_f32() {
+ let a: f32x2 = f32x2::new(0., 0.);
+ let e: i8x8 = i8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let r: i8x8 = transmute(vreinterpret_s8_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s16_f32() {
+ let a: f32x2 = f32x2::new(0., 0.);
+ let e: i16x4 = i16x4::new(0, 0, 0, 0);
+ let r: i16x4 = transmute(vreinterpret_s16_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s32_f32() {
+ let a: f32x2 = f32x2::new(0., 0.);
+ let e: i32x2 = i32x2::new(0, 0);
+ let r: i32x2 = transmute(vreinterpret_s32_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_s64_f32() {
+ let a: f32x2 = f32x2::new(0., 0.);
+ let e: i64x1 = i64x1::new(0);
+ let r: i64x1 = transmute(vreinterpret_s64_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s8_f32() {
+ let a: f32x4 = f32x4::new(0., 0., 0., 0.);
+ let e: i8x16 = i8x16::new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ let r: i8x16 = transmute(vreinterpretq_s8_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s16_f32() {
+ let a: f32x4 = f32x4::new(0., 0., 0., 0.);
+ let e: i16x8 = i16x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let r: i16x8 = transmute(vreinterpretq_s16_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s32_f32() {
+ let a: f32x4 = f32x4::new(0., 0., 0., 0.);
+ let e: i32x4 = i32x4::new(0, 0, 0, 0);
+ let r: i32x4 = transmute(vreinterpretq_s32_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_s64_f32() {
+ let a: f32x4 = f32x4::new(0., 0., 0., 0.);
+ let e: i64x2 = i64x2::new(0, 0);
+ let r: i64x2 = transmute(vreinterpretq_s64_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u8_f32() {
+ let a: f32x2 = f32x2::new(0., 0.);
+ let e: u8x8 = u8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let r: u8x8 = transmute(vreinterpret_u8_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u16_f32() {
+ let a: f32x2 = f32x2::new(0., 0.);
+ let e: u16x4 = u16x4::new(0, 0, 0, 0);
+ let r: u16x4 = transmute(vreinterpret_u16_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u32_f32() {
+ let a: f32x2 = f32x2::new(0., 0.);
+ let e: u32x2 = u32x2::new(0, 0);
+ let r: u32x2 = transmute(vreinterpret_u32_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_u64_f32() {
+ let a: f32x2 = f32x2::new(0., 0.);
+ let e: u64x1 = u64x1::new(0);
+ let r: u64x1 = transmute(vreinterpret_u64_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u8_f32() {
+ let a: f32x4 = f32x4::new(0., 0., 0., 0.);
+ let e: u8x16 = u8x16::new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ let r: u8x16 = transmute(vreinterpretq_u8_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u16_f32() {
+ let a: f32x4 = f32x4::new(0., 0., 0., 0.);
+ let e: u16x8 = u16x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let r: u16x8 = transmute(vreinterpretq_u16_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u32_f32() {
+ let a: f32x4 = f32x4::new(0., 0., 0., 0.);
+ let e: u32x4 = u32x4::new(0, 0, 0, 0);
+ let r: u32x4 = transmute(vreinterpretq_u32_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_u64_f32() {
+ let a: f32x4 = f32x4::new(0., 0., 0., 0.);
+ let e: u64x2 = u64x2::new(0, 0);
+ let r: u64x2 = transmute(vreinterpretq_u64_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_p8_f32() {
+ let a: f32x2 = f32x2::new(0., 0.);
+ let e: i8x8 = i8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let r: i8x8 = transmute(vreinterpret_p8_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_p16_f32() {
+ let a: f32x2 = f32x2::new(0., 0.);
+ let e: i16x4 = i16x4::new(0, 0, 0, 0);
+ let r: i16x4 = transmute(vreinterpret_p16_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p8_f32() {
+ let a: f32x4 = f32x4::new(0., 0., 0., 0.);
+ let e: i8x16 = i8x16::new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ let r: i8x16 = transmute(vreinterpretq_p8_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p16_f32() {
+ let a: f32x4 = f32x4::new(0., 0., 0., 0.);
+ let e: i16x8 = i16x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let r: i16x8 = transmute(vreinterpretq_p16_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_p128_f32() {
+ let a: f32x4 = f32x4::new(0., 0., 0., 0.);
+ let e: p128 = 0;
+ let r: p128 = transmute(vreinterpretq_p128_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_f32_s8() {
+ let a: i8x8 = i8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let e: f32x2 = f32x2::new(0., 0.);
+ let r: f32x2 = transmute(vreinterpret_f32_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_f32_s16() {
+ let a: i16x4 = i16x4::new(0, 0, 0, 0);
+ let e: f32x2 = f32x2::new(0., 0.);
+ let r: f32x2 = transmute(vreinterpret_f32_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_f32_s32() {
+ let a: i32x2 = i32x2::new(0, 0);
+ let e: f32x2 = f32x2::new(0., 0.);
+ let r: f32x2 = transmute(vreinterpret_f32_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_f32_s64() {
+ let a: i64x1 = i64x1::new(0);
+ let e: f32x2 = f32x2::new(0., 0.);
+ let r: f32x2 = transmute(vreinterpret_f32_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_f32_s8() {
+ let a: i8x16 = i8x16::new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ let e: f32x4 = f32x4::new(0., 0., 0., 0.);
+ let r: f32x4 = transmute(vreinterpretq_f32_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_f32_s16() {
+ let a: i16x8 = i16x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let e: f32x4 = f32x4::new(0., 0., 0., 0.);
+ let r: f32x4 = transmute(vreinterpretq_f32_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_f32_s32() {
+ let a: i32x4 = i32x4::new(0, 0, 0, 0);
+ let e: f32x4 = f32x4::new(0., 0., 0., 0.);
+ let r: f32x4 = transmute(vreinterpretq_f32_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_f32_s64() {
+ let a: i64x2 = i64x2::new(0, 0);
+ let e: f32x4 = f32x4::new(0., 0., 0., 0.);
+ let r: f32x4 = transmute(vreinterpretq_f32_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_f32_u8() {
+ let a: u8x8 = u8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let e: f32x2 = f32x2::new(0., 0.);
+ let r: f32x2 = transmute(vreinterpret_f32_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_f32_u16() {
+ let a: u16x4 = u16x4::new(0, 0, 0, 0);
+ let e: f32x2 = f32x2::new(0., 0.);
+ let r: f32x2 = transmute(vreinterpret_f32_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_f32_u32() {
+ let a: u32x2 = u32x2::new(0, 0);
+ let e: f32x2 = f32x2::new(0., 0.);
+ let r: f32x2 = transmute(vreinterpret_f32_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_f32_u64() {
+ let a: u64x1 = u64x1::new(0);
+ let e: f32x2 = f32x2::new(0., 0.);
+ let r: f32x2 = transmute(vreinterpret_f32_u64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_f32_u8() {
+ let a: u8x16 = u8x16::new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ let e: f32x4 = f32x4::new(0., 0., 0., 0.);
+ let r: f32x4 = transmute(vreinterpretq_f32_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_f32_u16() {
+ let a: u16x8 = u16x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let e: f32x4 = f32x4::new(0., 0., 0., 0.);
+ let r: f32x4 = transmute(vreinterpretq_f32_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_f32_u32() {
+ let a: u32x4 = u32x4::new(0, 0, 0, 0);
+ let e: f32x4 = f32x4::new(0., 0., 0., 0.);
+ let r: f32x4 = transmute(vreinterpretq_f32_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_f32_u64() {
+ let a: u64x2 = u64x2::new(0, 0);
+ let e: f32x4 = f32x4::new(0., 0., 0., 0.);
+ let r: f32x4 = transmute(vreinterpretq_f32_u64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_f32_p8() {
+ let a: i8x8 = i8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let e: f32x2 = f32x2::new(0., 0.);
+ let r: f32x2 = transmute(vreinterpret_f32_p8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpret_f32_p16() {
+ let a: i16x4 = i16x4::new(0, 0, 0, 0);
+ let e: f32x2 = f32x2::new(0., 0.);
+ let r: f32x2 = transmute(vreinterpret_f32_p16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_f32_p8() {
+ let a: i8x16 = i8x16::new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ let e: f32x4 = f32x4::new(0., 0., 0., 0.);
+ let r: f32x4 = transmute(vreinterpretq_f32_p8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_f32_p16() {
+ let a: i16x8 = i16x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let e: f32x4 = f32x4::new(0., 0., 0., 0.);
+ let r: f32x4 = transmute(vreinterpretq_f32_p16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vreinterpretq_f32_p128() {
+ let a: p128 = 0;
+ let e: f32x4 = f32x4::new(0., 0., 0., 0.);
+ let r: f32x4 = transmute(vreinterpretq_f32_p128(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshl_s8() {
+ let a: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: i8x8 = i8x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let e: i8x8 = i8x8::new(4, 8, 12, 16, 20, 24, 28, 32);
+ let r: i8x8 = transmute(vrshl_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshlq_s8() {
+ let a: i8x16 = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let b: i8x16 = i8x16::new(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
+ let e: i8x16 = i8x16::new(4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64);
+ let r: i8x16 = transmute(vrshlq_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshl_s16() {
+ let a: i16x4 = i16x4::new(1, 2, 3, 4);
+ let b: i16x4 = i16x4::new(2, 2, 2, 2);
+ let e: i16x4 = i16x4::new(4, 8, 12, 16);
+ let r: i16x4 = transmute(vrshl_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshlq_s16() {
+ let a: i16x8 = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: i16x8 = i16x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let e: i16x8 = i16x8::new(4, 8, 12, 16, 20, 24, 28, 32);
+ let r: i16x8 = transmute(vrshlq_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshl_s32() {
+ let a: i32x2 = i32x2::new(1, 2);
+ let b: i32x2 = i32x2::new(2, 2);
+ let e: i32x2 = i32x2::new(4, 8);
+ let r: i32x2 = transmute(vrshl_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshlq_s32() {
+ let a: i32x4 = i32x4::new(1, 2, 3, 4);
+ let b: i32x4 = i32x4::new(2, 2, 2, 2);
+ let e: i32x4 = i32x4::new(4, 8, 12, 16);
+ let r: i32x4 = transmute(vrshlq_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshl_s64() {
+ let a: i64x1 = i64x1::new(1);
+ let b: i64x1 = i64x1::new(2);
+ let e: i64x1 = i64x1::new(4);
+ let r: i64x1 = transmute(vrshl_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshlq_s64() {
+ let a: i64x2 = i64x2::new(1, 2);
+ let b: i64x2 = i64x2::new(2, 2);
+ let e: i64x2 = i64x2::new(4, 8);
+ let r: i64x2 = transmute(vrshlq_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshl_u8() {
+ let a: u8x8 = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: i8x8 = i8x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let e: u8x8 = u8x8::new(4, 8, 12, 16, 20, 24, 28, 32);
+ let r: u8x8 = transmute(vrshl_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshlq_u8() {
+ let a: u8x16 = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let b: i8x16 = i8x16::new(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
+ let e: u8x16 = u8x16::new(4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64);
+ let r: u8x16 = transmute(vrshlq_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshl_u16() {
+ let a: u16x4 = u16x4::new(1, 2, 3, 4);
+ let b: i16x4 = i16x4::new(2, 2, 2, 2);
+ let e: u16x4 = u16x4::new(4, 8, 12, 16);
+ let r: u16x4 = transmute(vrshl_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshlq_u16() {
+ let a: u16x8 = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: i16x8 = i16x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let e: u16x8 = u16x8::new(4, 8, 12, 16, 20, 24, 28, 32);
+ let r: u16x8 = transmute(vrshlq_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshl_u32() {
+ let a: u32x2 = u32x2::new(1, 2);
+ let b: i32x2 = i32x2::new(2, 2);
+ let e: u32x2 = u32x2::new(4, 8);
+ let r: u32x2 = transmute(vrshl_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshlq_u32() {
+ let a: u32x4 = u32x4::new(1, 2, 3, 4);
+ let b: i32x4 = i32x4::new(2, 2, 2, 2);
+ let e: u32x4 = u32x4::new(4, 8, 12, 16);
+ let r: u32x4 = transmute(vrshlq_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshl_u64() {
+ let a: u64x1 = u64x1::new(1);
+ let b: i64x1 = i64x1::new(2);
+ let e: u64x1 = u64x1::new(4);
+ let r: u64x1 = transmute(vrshl_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshlq_u64() {
+ let a: u64x2 = u64x2::new(1, 2);
+ let b: i64x2 = i64x2::new(2, 2);
+ let e: u64x2 = u64x2::new(4, 8);
+ let r: u64x2 = transmute(vrshlq_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshr_n_s8() {
+ let a: i8x8 = i8x8::new(4, 8, 12, 16, 20, 24, 28, 32);
+ let e: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let r: i8x8 = transmute(vrshr_n_s8::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshrq_n_s8() {
+ let a: i8x16 = i8x16::new(4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64);
+ let e: i8x16 = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let r: i8x16 = transmute(vrshrq_n_s8::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshr_n_s16() {
+ let a: i16x4 = i16x4::new(4, 8, 12, 16);
+ let e: i16x4 = i16x4::new(1, 2, 3, 4);
+ let r: i16x4 = transmute(vrshr_n_s16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshrq_n_s16() {
+ let a: i16x8 = i16x8::new(4, 8, 12, 16, 20, 24, 28, 32);
+ let e: i16x8 = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let r: i16x8 = transmute(vrshrq_n_s16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshr_n_s32() {
+ let a: i32x2 = i32x2::new(4, 8);
+ let e: i32x2 = i32x2::new(1, 2);
+ let r: i32x2 = transmute(vrshr_n_s32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshrq_n_s32() {
+ let a: i32x4 = i32x4::new(4, 8, 12, 16);
+ let e: i32x4 = i32x4::new(1, 2, 3, 4);
+ let r: i32x4 = transmute(vrshrq_n_s32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshr_n_s64() {
+ let a: i64x1 = i64x1::new(4);
+ let e: i64x1 = i64x1::new(1);
+ let r: i64x1 = transmute(vrshr_n_s64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshrq_n_s64() {
+ let a: i64x2 = i64x2::new(4, 8);
+ let e: i64x2 = i64x2::new(1, 2);
+ let r: i64x2 = transmute(vrshrq_n_s64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshr_n_u8() {
+ let a: u8x8 = u8x8::new(4, 8, 12, 16, 20, 24, 28, 32);
+ let e: u8x8 = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let r: u8x8 = transmute(vrshr_n_u8::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshrq_n_u8() {
+ let a: u8x16 = u8x16::new(4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64);
+ let e: u8x16 = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let r: u8x16 = transmute(vrshrq_n_u8::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshr_n_u16() {
+ let a: u16x4 = u16x4::new(4, 8, 12, 16);
+ let e: u16x4 = u16x4::new(1, 2, 3, 4);
+ let r: u16x4 = transmute(vrshr_n_u16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshrq_n_u16() {
+ let a: u16x8 = u16x8::new(4, 8, 12, 16, 20, 24, 28, 32);
+ let e: u16x8 = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let r: u16x8 = transmute(vrshrq_n_u16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshr_n_u32() {
+ let a: u32x2 = u32x2::new(4, 8);
+ let e: u32x2 = u32x2::new(1, 2);
+ let r: u32x2 = transmute(vrshr_n_u32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshrq_n_u32() {
+ let a: u32x4 = u32x4::new(4, 8, 12, 16);
+ let e: u32x4 = u32x4::new(1, 2, 3, 4);
+ let r: u32x4 = transmute(vrshrq_n_u32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshr_n_u64() {
+ let a: u64x1 = u64x1::new(4);
+ let e: u64x1 = u64x1::new(1);
+ let r: u64x1 = transmute(vrshr_n_u64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshrq_n_u64() {
+ let a: u64x2 = u64x2::new(4, 8);
+ let e: u64x2 = u64x2::new(1, 2);
+ let r: u64x2 = transmute(vrshrq_n_u64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshrn_n_s16() {
+ let a: i16x8 = i16x8::new(4, 8, 12, 16, 20, 24, 28, 32);
+ let e: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let r: i8x8 = transmute(vrshrn_n_s16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshrn_n_s32() {
+ let a: i32x4 = i32x4::new(4, 8, 12, 16);
+ let e: i16x4 = i16x4::new(1, 2, 3, 4);
+ let r: i16x4 = transmute(vrshrn_n_s32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshrn_n_s64() {
+ let a: i64x2 = i64x2::new(4, 8);
+ let e: i32x2 = i32x2::new(1, 2);
+ let r: i32x2 = transmute(vrshrn_n_s64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshrn_n_u16() {
+ let a: u16x8 = u16x8::new(4, 8, 12, 16, 20, 24, 28, 32);
+ let e: u8x8 = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let r: u8x8 = transmute(vrshrn_n_u16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshrn_n_u32() {
+ let a: u32x4 = u32x4::new(4, 8, 12, 16);
+ let e: u16x4 = u16x4::new(1, 2, 3, 4);
+ let r: u16x4 = transmute(vrshrn_n_u32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrshrn_n_u64() {
+ let a: u64x2 = u64x2::new(4, 8);
+ let e: u32x2 = u32x2::new(1, 2);
+ let r: u32x2 = transmute(vrshrn_n_u64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsra_n_s8() {
+ let a: i8x8 = i8x8::new(1, 1, 1, 1, 1, 1, 1, 1);
+ let b: i8x8 = i8x8::new(4, 8, 12, 16, 20, 24, 28, 32);
+ let e: i8x8 = i8x8::new(2, 3, 4, 5, 6, 7, 8, 9);
+ let r: i8x8 = transmute(vrsra_n_s8::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsraq_n_s8() {
+ let a: i8x16 = i8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
+ let b: i8x16 = i8x16::new(4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64);
+ let e: i8x16 = i8x16::new(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17);
+ let r: i8x16 = transmute(vrsraq_n_s8::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsra_n_s16() {
+ let a: i16x4 = i16x4::new(1, 1, 1, 1);
+ let b: i16x4 = i16x4::new(4, 8, 12, 16);
+ let e: i16x4 = i16x4::new(2, 3, 4, 5);
+ let r: i16x4 = transmute(vrsra_n_s16::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsraq_n_s16() {
+ let a: i16x8 = i16x8::new(1, 1, 1, 1, 1, 1, 1, 1);
+ let b: i16x8 = i16x8::new(4, 8, 12, 16, 20, 24, 28, 32);
+ let e: i16x8 = i16x8::new(2, 3, 4, 5, 6, 7, 8, 9);
+ let r: i16x8 = transmute(vrsraq_n_s16::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsra_n_s32() {
+ let a: i32x2 = i32x2::new(1, 1);
+ let b: i32x2 = i32x2::new(4, 8);
+ let e: i32x2 = i32x2::new(2, 3);
+ let r: i32x2 = transmute(vrsra_n_s32::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsraq_n_s32() {
+ let a: i32x4 = i32x4::new(1, 1, 1, 1);
+ let b: i32x4 = i32x4::new(4, 8, 12, 16);
+ let e: i32x4 = i32x4::new(2, 3, 4, 5);
+ let r: i32x4 = transmute(vrsraq_n_s32::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsra_n_s64() {
+ let a: i64x1 = i64x1::new(1);
+ let b: i64x1 = i64x1::new(4);
+ let e: i64x1 = i64x1::new(2);
+ let r: i64x1 = transmute(vrsra_n_s64::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsraq_n_s64() {
+ let a: i64x2 = i64x2::new(1, 1);
+ let b: i64x2 = i64x2::new(4, 8);
+ let e: i64x2 = i64x2::new(2, 3);
+ let r: i64x2 = transmute(vrsraq_n_s64::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsra_n_u8() {
+ let a: u8x8 = u8x8::new(1, 1, 1, 1, 1, 1, 1, 1);
+ let b: u8x8 = u8x8::new(4, 8, 12, 16, 20, 24, 28, 32);
+ let e: u8x8 = u8x8::new(2, 3, 4, 5, 6, 7, 8, 9);
+ let r: u8x8 = transmute(vrsra_n_u8::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsraq_n_u8() {
+ let a: u8x16 = u8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
+ let b: u8x16 = u8x16::new(4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64);
+ let e: u8x16 = u8x16::new(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17);
+ let r: u8x16 = transmute(vrsraq_n_u8::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsra_n_u16() {
+ let a: u16x4 = u16x4::new(1, 1, 1, 1);
+ let b: u16x4 = u16x4::new(4, 8, 12, 16);
+ let e: u16x4 = u16x4::new(2, 3, 4, 5);
+ let r: u16x4 = transmute(vrsra_n_u16::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsraq_n_u16() {
+ let a: u16x8 = u16x8::new(1, 1, 1, 1, 1, 1, 1, 1);
+ let b: u16x8 = u16x8::new(4, 8, 12, 16, 20, 24, 28, 32);
+ let e: u16x8 = u16x8::new(2, 3, 4, 5, 6, 7, 8, 9);
+ let r: u16x8 = transmute(vrsraq_n_u16::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsra_n_u32() {
+ let a: u32x2 = u32x2::new(1, 1);
+ let b: u32x2 = u32x2::new(4, 8);
+ let e: u32x2 = u32x2::new(2, 3);
+ let r: u32x2 = transmute(vrsra_n_u32::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsraq_n_u32() {
+ let a: u32x4 = u32x4::new(1, 1, 1, 1);
+ let b: u32x4 = u32x4::new(4, 8, 12, 16);
+ let e: u32x4 = u32x4::new(2, 3, 4, 5);
+ let r: u32x4 = transmute(vrsraq_n_u32::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsra_n_u64() {
+ let a: u64x1 = u64x1::new(1);
+ let b: u64x1 = u64x1::new(4);
+ let e: u64x1 = u64x1::new(2);
+ let r: u64x1 = transmute(vrsra_n_u64::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsraq_n_u64() {
+ let a: u64x2 = u64x2::new(1, 1);
+ let b: u64x2 = u64x2::new(4, 8);
+ let e: u64x2 = u64x2::new(2, 3);
+ let r: u64x2 = transmute(vrsraq_n_u64::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsubhn_s16() {
+ let a: i16x8 = i16x8::new(0x7F_FF, -32768, 0, 4, 5, 6, 7, 8);
+ let b: i16x8 = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: i8x8 = i8x8::new(-128, -128, 0, 0, 0, 0, 0, 0);
+ let r: i8x8 = transmute(vrsubhn_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsubhn_s32() {
+ let a: i32x4 = i32x4::new(0x7F_FF_FF_FF, -2147483648, 0, 4);
+ let b: i32x4 = i32x4::new(1, 2, 3, 4);
+ let e: i16x4 = i16x4::new(-32768, -32768, 0, 0);
+ let r: i16x4 = transmute(vrsubhn_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsubhn_s64() {
+ let a: i64x2 = i64x2::new(0x7F_FF_FF_FF_FF_FF_FF_FF, -9223372036854775808);
+ let b: i64x2 = i64x2::new(1, 2);
+ let e: i32x2 = i32x2::new(-2147483648, -2147483648);
+ let r: i32x2 = transmute(vrsubhn_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsubhn_u16() {
+ let a: u16x8 = u16x8::new(0xFF_FF, 0, 3, 4, 5, 6, 7, 8);
+ let b: u16x8 = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: u8x8 = u8x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let r: u8x8 = transmute(vrsubhn_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsubhn_u32() {
+ let a: u32x4 = u32x4::new(0xFF_FF_FF_FF, 0, 3, 4);
+ let b: u32x4 = u32x4::new(1, 2, 3, 4);
+ let e: u16x4 = u16x4::new(0, 0, 0, 0);
+ let r: u16x4 = transmute(vrsubhn_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrsubhn_u64() {
+ let a: u64x2 = u64x2::new(0xFF_FF_FF_FF_FF_FF_FF_FF, 0);
+ let b: u64x2 = u64x2::new(1, 2);
+ let e: u32x2 = u32x2::new(0, 0);
+ let r: u32x2 = transmute(vrsubhn_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vset_lane_s8() {
+ let a: i8 = 1;
+ let b: i8x8 = i8x8::new(0, 2, 3, 4, 5, 6, 7, 8);
+ let e: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let r: i8x8 = transmute(vset_lane_s8::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vset_lane_s16() {
+ let a: i16 = 1;
+ let b: i16x4 = i16x4::new(0, 2, 3, 4);
+ let e: i16x4 = i16x4::new(1, 2, 3, 4);
+ let r: i16x4 = transmute(vset_lane_s16::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vset_lane_s32() {
+ let a: i32 = 1;
+ let b: i32x2 = i32x2::new(0, 2);
+ let e: i32x2 = i32x2::new(1, 2);
+ let r: i32x2 = transmute(vset_lane_s32::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vset_lane_s64() {
+ let a: i64 = 1;
+ let b: i64x1 = i64x1::new(0);
+ let e: i64x1 = i64x1::new(1);
+ let r: i64x1 = transmute(vset_lane_s64::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vset_lane_u8() {
+ let a: u8 = 1;
+ let b: u8x8 = u8x8::new(0, 2, 3, 4, 5, 6, 7, 8);
+ let e: u8x8 = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let r: u8x8 = transmute(vset_lane_u8::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vset_lane_u16() {
+ let a: u16 = 1;
+ let b: u16x4 = u16x4::new(0, 2, 3, 4);
+ let e: u16x4 = u16x4::new(1, 2, 3, 4);
+ let r: u16x4 = transmute(vset_lane_u16::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vset_lane_u32() {
+ let a: u32 = 1;
+ let b: u32x2 = u32x2::new(0, 2);
+ let e: u32x2 = u32x2::new(1, 2);
+ let r: u32x2 = transmute(vset_lane_u32::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vset_lane_u64() {
+ let a: u64 = 1;
+ let b: u64x1 = u64x1::new(0);
+ let e: u64x1 = u64x1::new(1);
+ let r: u64x1 = transmute(vset_lane_u64::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vset_lane_p8() {
+ let a: p8 = 1;
+ let b: i8x8 = i8x8::new(0, 2, 3, 4, 5, 6, 7, 8);
+ let e: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let r: i8x8 = transmute(vset_lane_p8::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vset_lane_p16() {
+ let a: p16 = 1;
+ let b: i16x4 = i16x4::new(0, 2, 3, 4);
+ let e: i16x4 = i16x4::new(1, 2, 3, 4);
+ let r: i16x4 = transmute(vset_lane_p16::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vset_lane_p64() {
+ let a: p64 = 1;
+ let b: i64x1 = i64x1::new(0);
+ let e: i64x1 = i64x1::new(1);
+ let r: i64x1 = transmute(vset_lane_p64::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsetq_lane_s8() {
+ let a: i8 = 1;
+ let b: i8x16 = i8x16::new(0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let e: i8x16 = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let r: i8x16 = transmute(vsetq_lane_s8::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsetq_lane_s16() {
+ let a: i16 = 1;
+ let b: i16x8 = i16x8::new(0, 2, 3, 4, 5, 6, 7, 8);
+ let e: i16x8 = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let r: i16x8 = transmute(vsetq_lane_s16::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsetq_lane_s32() {
+ let a: i32 = 1;
+ let b: i32x4 = i32x4::new(0, 2, 3, 4);
+ let e: i32x4 = i32x4::new(1, 2, 3, 4);
+ let r: i32x4 = transmute(vsetq_lane_s32::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsetq_lane_s64() {
+ let a: i64 = 1;
+ let b: i64x2 = i64x2::new(0, 2);
+ let e: i64x2 = i64x2::new(1, 2);
+ let r: i64x2 = transmute(vsetq_lane_s64::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsetq_lane_u8() {
+ let a: u8 = 1;
+ let b: u8x16 = u8x16::new(0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let e: u8x16 = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let r: u8x16 = transmute(vsetq_lane_u8::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsetq_lane_u16() {
+ let a: u16 = 1;
+ let b: u16x8 = u16x8::new(0, 2, 3, 4, 5, 6, 7, 8);
+ let e: u16x8 = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let r: u16x8 = transmute(vsetq_lane_u16::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsetq_lane_u32() {
+ let a: u32 = 1;
+ let b: u32x4 = u32x4::new(0, 2, 3, 4);
+ let e: u32x4 = u32x4::new(1, 2, 3, 4);
+ let r: u32x4 = transmute(vsetq_lane_u32::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsetq_lane_u64() {
+ let a: u64 = 1;
+ let b: u64x2 = u64x2::new(0, 2);
+ let e: u64x2 = u64x2::new(1, 2);
+ let r: u64x2 = transmute(vsetq_lane_u64::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsetq_lane_p8() {
+ let a: p8 = 1;
+ let b: i8x16 = i8x16::new(0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let e: i8x16 = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let r: i8x16 = transmute(vsetq_lane_p8::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsetq_lane_p16() {
+ let a: p16 = 1;
+ let b: i16x8 = i16x8::new(0, 2, 3, 4, 5, 6, 7, 8);
+ let e: i16x8 = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let r: i16x8 = transmute(vsetq_lane_p16::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsetq_lane_p64() {
+ let a: p64 = 1;
+ let b: i64x2 = i64x2::new(0, 2);
+ let e: i64x2 = i64x2::new(1, 2);
+ let r: i64x2 = transmute(vsetq_lane_p64::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vset_lane_f32() {
+ let a: f32 = 1.;
+ let b: f32x2 = f32x2::new(0., 2.);
+ let e: f32x2 = f32x2::new(1., 2.);
+ let r: f32x2 = transmute(vset_lane_f32::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsetq_lane_f32() {
+ let a: f32 = 1.;
+ let b: f32x4 = f32x4::new(0., 2., 3., 4.);
+ let e: f32x4 = f32x4::new(1., 2., 3., 4.);
+ let r: f32x4 = transmute(vsetq_lane_f32::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshl_s8() {
+ let a: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: i8x8 = i8x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let e: i8x8 = i8x8::new(4, 8, 12, 16, 20, 24, 28, 32);
+ let r: i8x8 = transmute(vshl_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshlq_s8() {
+ let a: i8x16 = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let b: i8x16 = i8x16::new(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
+ let e: i8x16 = i8x16::new(4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64);
+ let r: i8x16 = transmute(vshlq_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshl_s16() {
+ let a: i16x4 = i16x4::new(1, 2, 3, 4);
+ let b: i16x4 = i16x4::new(2, 2, 2, 2);
+ let e: i16x4 = i16x4::new(4, 8, 12, 16);
+ let r: i16x4 = transmute(vshl_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshlq_s16() {
+ let a: i16x8 = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: i16x8 = i16x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let e: i16x8 = i16x8::new(4, 8, 12, 16, 20, 24, 28, 32);
+ let r: i16x8 = transmute(vshlq_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshl_s32() {
+ let a: i32x2 = i32x2::new(1, 2);
+ let b: i32x2 = i32x2::new(2, 2);
+ let e: i32x2 = i32x2::new(4, 8);
+ let r: i32x2 = transmute(vshl_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshlq_s32() {
+ let a: i32x4 = i32x4::new(1, 2, 3, 4);
+ let b: i32x4 = i32x4::new(2, 2, 2, 2);
+ let e: i32x4 = i32x4::new(4, 8, 12, 16);
+ let r: i32x4 = transmute(vshlq_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshl_s64() {
+ let a: i64x1 = i64x1::new(1);
+ let b: i64x1 = i64x1::new(2);
+ let e: i64x1 = i64x1::new(4);
+ let r: i64x1 = transmute(vshl_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshlq_s64() {
+ let a: i64x2 = i64x2::new(1, 2);
+ let b: i64x2 = i64x2::new(2, 2);
+ let e: i64x2 = i64x2::new(4, 8);
+ let r: i64x2 = transmute(vshlq_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshl_u8() {
+ let a: u8x8 = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: i8x8 = i8x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let e: u8x8 = u8x8::new(4, 8, 12, 16, 20, 24, 28, 32);
+ let r: u8x8 = transmute(vshl_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshlq_u8() {
+ let a: u8x16 = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let b: i8x16 = i8x16::new(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
+ let e: u8x16 = u8x16::new(4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64);
+ let r: u8x16 = transmute(vshlq_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshl_u16() {
+ let a: u16x4 = u16x4::new(1, 2, 3, 4);
+ let b: i16x4 = i16x4::new(2, 2, 2, 2);
+ let e: u16x4 = u16x4::new(4, 8, 12, 16);
+ let r: u16x4 = transmute(vshl_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshlq_u16() {
+ let a: u16x8 = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: i16x8 = i16x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+ let e: u16x8 = u16x8::new(4, 8, 12, 16, 20, 24, 28, 32);
+ let r: u16x8 = transmute(vshlq_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshl_u32() {
+ let a: u32x2 = u32x2::new(1, 2);
+ let b: i32x2 = i32x2::new(2, 2);
+ let e: u32x2 = u32x2::new(4, 8);
+ let r: u32x2 = transmute(vshl_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshlq_u32() {
+ let a: u32x4 = u32x4::new(1, 2, 3, 4);
+ let b: i32x4 = i32x4::new(2, 2, 2, 2);
+ let e: u32x4 = u32x4::new(4, 8, 12, 16);
+ let r: u32x4 = transmute(vshlq_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshl_u64() {
+ let a: u64x1 = u64x1::new(1);
+ let b: i64x1 = i64x1::new(2);
+ let e: u64x1 = u64x1::new(4);
+ let r: u64x1 = transmute(vshl_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshlq_u64() {
+ let a: u64x2 = u64x2::new(1, 2);
+ let b: i64x2 = i64x2::new(2, 2);
+ let e: u64x2 = u64x2::new(4, 8);
+ let r: u64x2 = transmute(vshlq_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshl_n_s8() {
+ let a: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: i8x8 = i8x8::new(4, 8, 12, 16, 20, 24, 28, 32);
+ let r: i8x8 = transmute(vshl_n_s8::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshlq_n_s8() {
+ let a: i8x16 = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let e: i8x16 = i8x16::new(4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64);
+ let r: i8x16 = transmute(vshlq_n_s8::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshl_n_s16() {
+ let a: i16x4 = i16x4::new(1, 2, 3, 4);
+ let e: i16x4 = i16x4::new(4, 8, 12, 16);
+ let r: i16x4 = transmute(vshl_n_s16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshlq_n_s16() {
+ let a: i16x8 = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: i16x8 = i16x8::new(4, 8, 12, 16, 20, 24, 28, 32);
+ let r: i16x8 = transmute(vshlq_n_s16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshl_n_s32() {
+ let a: i32x2 = i32x2::new(1, 2);
+ let e: i32x2 = i32x2::new(4, 8);
+ let r: i32x2 = transmute(vshl_n_s32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshlq_n_s32() {
+ let a: i32x4 = i32x4::new(1, 2, 3, 4);
+ let e: i32x4 = i32x4::new(4, 8, 12, 16);
+ let r: i32x4 = transmute(vshlq_n_s32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshl_n_u8() {
+ let a: u8x8 = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: u8x8 = u8x8::new(4, 8, 12, 16, 20, 24, 28, 32);
+ let r: u8x8 = transmute(vshl_n_u8::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshlq_n_u8() {
+ let a: u8x16 = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let e: u8x16 = u8x16::new(4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64);
+ let r: u8x16 = transmute(vshlq_n_u8::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshl_n_u16() {
+ let a: u16x4 = u16x4::new(1, 2, 3, 4);
+ let e: u16x4 = u16x4::new(4, 8, 12, 16);
+ let r: u16x4 = transmute(vshl_n_u16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshlq_n_u16() {
+ let a: u16x8 = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: u16x8 = u16x8::new(4, 8, 12, 16, 20, 24, 28, 32);
+ let r: u16x8 = transmute(vshlq_n_u16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshl_n_u32() {
+ let a: u32x2 = u32x2::new(1, 2);
+ let e: u32x2 = u32x2::new(4, 8);
+ let r: u32x2 = transmute(vshl_n_u32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshlq_n_u32() {
+ let a: u32x4 = u32x4::new(1, 2, 3, 4);
+ let e: u32x4 = u32x4::new(4, 8, 12, 16);
+ let r: u32x4 = transmute(vshlq_n_u32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshl_n_s64() {
+ let a: i64x1 = i64x1::new(1);
+ let e: i64x1 = i64x1::new(4);
+ let r: i64x1 = transmute(vshl_n_s64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshlq_n_s64() {
+ let a: i64x2 = i64x2::new(1, 2);
+ let e: i64x2 = i64x2::new(4, 8);
+ let r: i64x2 = transmute(vshlq_n_s64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshl_n_u64() {
+ let a: u64x1 = u64x1::new(1);
+ let e: u64x1 = u64x1::new(4);
+ let r: u64x1 = transmute(vshl_n_u64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshlq_n_u64() {
+ let a: u64x2 = u64x2::new(1, 2);
+ let e: u64x2 = u64x2::new(4, 8);
+ let r: u64x2 = transmute(vshlq_n_u64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshll_n_s8() {
+ let a: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: i16x8 = i16x8::new(4, 8, 12, 16, 20, 24, 28, 32);
+ let r: i16x8 = transmute(vshll_n_s8::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshll_n_s16() {
+ let a: i16x4 = i16x4::new(1, 2, 3, 4);
+ let e: i32x4 = i32x4::new(4, 8, 12, 16);
+ let r: i32x4 = transmute(vshll_n_s16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshll_n_s32() {
+ let a: i32x2 = i32x2::new(1, 2);
+ let e: i64x2 = i64x2::new(4, 8);
+ let r: i64x2 = transmute(vshll_n_s32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshll_n_u8() {
+ let a: u8x8 = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e: u16x8 = u16x8::new(4, 8, 12, 16, 20, 24, 28, 32);
+ let r: u16x8 = transmute(vshll_n_u8::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshll_n_u16() {
+ let a: u16x4 = u16x4::new(1, 2, 3, 4);
+ let e: u32x4 = u32x4::new(4, 8, 12, 16);
+ let r: u32x4 = transmute(vshll_n_u16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshll_n_u32() {
+ let a: u32x2 = u32x2::new(1, 2);
+ let e: u64x2 = u64x2::new(4, 8);
+ let r: u64x2 = transmute(vshll_n_u32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshr_n_s8() {
+ let a: i8x8 = i8x8::new(4, 8, 12, 16, 20, 24, 28, 32);
+ let e: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let r: i8x8 = transmute(vshr_n_s8::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshrq_n_s8() {
+ let a: i8x16 = i8x16::new(4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64);
+ let e: i8x16 = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let r: i8x16 = transmute(vshrq_n_s8::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshr_n_s16() {
+ let a: i16x4 = i16x4::new(4, 8, 12, 16);
+ let e: i16x4 = i16x4::new(1, 2, 3, 4);
+ let r: i16x4 = transmute(vshr_n_s16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshrq_n_s16() {
+ let a: i16x8 = i16x8::new(4, 8, 12, 16, 20, 24, 28, 32);
+ let e: i16x8 = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let r: i16x8 = transmute(vshrq_n_s16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshr_n_s32() {
+ let a: i32x2 = i32x2::new(4, 8);
+ let e: i32x2 = i32x2::new(1, 2);
+ let r: i32x2 = transmute(vshr_n_s32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshrq_n_s32() {
+ let a: i32x4 = i32x4::new(4, 8, 12, 16);
+ let e: i32x4 = i32x4::new(1, 2, 3, 4);
+ let r: i32x4 = transmute(vshrq_n_s32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshr_n_s64() {
+ let a: i64x1 = i64x1::new(4);
+ let e: i64x1 = i64x1::new(1);
+ let r: i64x1 = transmute(vshr_n_s64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshrq_n_s64() {
+ let a: i64x2 = i64x2::new(4, 8);
+ let e: i64x2 = i64x2::new(1, 2);
+ let r: i64x2 = transmute(vshrq_n_s64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshr_n_u8() {
+ let a: u8x8 = u8x8::new(4, 8, 12, 16, 20, 24, 28, 32);
+ let e: u8x8 = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let r: u8x8 = transmute(vshr_n_u8::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshrq_n_u8() {
+ let a: u8x16 = u8x16::new(4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64);
+ let e: u8x16 = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let r: u8x16 = transmute(vshrq_n_u8::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshr_n_u16() {
+ let a: u16x4 = u16x4::new(4, 8, 12, 16);
+ let e: u16x4 = u16x4::new(1, 2, 3, 4);
+ let r: u16x4 = transmute(vshr_n_u16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshrq_n_u16() {
+ let a: u16x8 = u16x8::new(4, 8, 12, 16, 20, 24, 28, 32);
+ let e: u16x8 = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let r: u16x8 = transmute(vshrq_n_u16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshr_n_u32() {
+ let a: u32x2 = u32x2::new(4, 8);
+ let e: u32x2 = u32x2::new(1, 2);
+ let r: u32x2 = transmute(vshr_n_u32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshrq_n_u32() {
+ let a: u32x4 = u32x4::new(4, 8, 12, 16);
+ let e: u32x4 = u32x4::new(1, 2, 3, 4);
+ let r: u32x4 = transmute(vshrq_n_u32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshr_n_u64() {
+ let a: u64x1 = u64x1::new(4);
+ let e: u64x1 = u64x1::new(1);
+ let r: u64x1 = transmute(vshr_n_u64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshrq_n_u64() {
+ let a: u64x2 = u64x2::new(4, 8);
+ let e: u64x2 = u64x2::new(1, 2);
+ let r: u64x2 = transmute(vshrq_n_u64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshrn_n_s16() {
+ let a: i16x8 = i16x8::new(4, 8, 12, 16, 20, 24, 28, 32);
+ let e: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let r: i8x8 = transmute(vshrn_n_s16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshrn_n_s32() {
+ let a: i32x4 = i32x4::new(4, 8, 12, 16);
+ let e: i16x4 = i16x4::new(1, 2, 3, 4);
+ let r: i16x4 = transmute(vshrn_n_s32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshrn_n_s64() {
+ let a: i64x2 = i64x2::new(4, 8);
+ let e: i32x2 = i32x2::new(1, 2);
+ let r: i32x2 = transmute(vshrn_n_s64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshrn_n_u16() {
+ let a: u16x8 = u16x8::new(4, 8, 12, 16, 20, 24, 28, 32);
+ let e: u8x8 = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let r: u8x8 = transmute(vshrn_n_u16::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshrn_n_u32() {
+ let a: u32x4 = u32x4::new(4, 8, 12, 16);
+ let e: u16x4 = u16x4::new(1, 2, 3, 4);
+ let r: u16x4 = transmute(vshrn_n_u32::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vshrn_n_u64() {
+ let a: u64x2 = u64x2::new(4, 8);
+ let e: u32x2 = u32x2::new(1, 2);
+ let r: u32x2 = transmute(vshrn_n_u64::<2>(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsra_n_s8() {
+ let a: i8x8 = i8x8::new(1, 1, 1, 1, 1, 1, 1, 1);
+ let b: i8x8 = i8x8::new(4, 8, 12, 16, 20, 24, 28, 32);
+ let e: i8x8 = i8x8::new(2, 3, 4, 5, 6, 7, 8, 9);
+ let r: i8x8 = transmute(vsra_n_s8::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsraq_n_s8() {
+ let a: i8x16 = i8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
+ let b: i8x16 = i8x16::new(4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64);
+ let e: i8x16 = i8x16::new(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17);
+ let r: i8x16 = transmute(vsraq_n_s8::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsra_n_s16() {
+ let a: i16x4 = i16x4::new(1, 1, 1, 1);
+ let b: i16x4 = i16x4::new(4, 8, 12, 16);
+ let e: i16x4 = i16x4::new(2, 3, 4, 5);
+ let r: i16x4 = transmute(vsra_n_s16::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsraq_n_s16() {
+ let a: i16x8 = i16x8::new(1, 1, 1, 1, 1, 1, 1, 1);
+ let b: i16x8 = i16x8::new(4, 8, 12, 16, 20, 24, 28, 32);
+ let e: i16x8 = i16x8::new(2, 3, 4, 5, 6, 7, 8, 9);
+ let r: i16x8 = transmute(vsraq_n_s16::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsra_n_s32() {
+ let a: i32x2 = i32x2::new(1, 1);
+ let b: i32x2 = i32x2::new(4, 8);
+ let e: i32x2 = i32x2::new(2, 3);
+ let r: i32x2 = transmute(vsra_n_s32::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsraq_n_s32() {
+ let a: i32x4 = i32x4::new(1, 1, 1, 1);
+ let b: i32x4 = i32x4::new(4, 8, 12, 16);
+ let e: i32x4 = i32x4::new(2, 3, 4, 5);
+ let r: i32x4 = transmute(vsraq_n_s32::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsra_n_s64() {
+ let a: i64x1 = i64x1::new(1);
+ let b: i64x1 = i64x1::new(4);
+ let e: i64x1 = i64x1::new(2);
+ let r: i64x1 = transmute(vsra_n_s64::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsraq_n_s64() {
+ let a: i64x2 = i64x2::new(1, 1);
+ let b: i64x2 = i64x2::new(4, 8);
+ let e: i64x2 = i64x2::new(2, 3);
+ let r: i64x2 = transmute(vsraq_n_s64::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsra_n_u8() {
+ let a: u8x8 = u8x8::new(1, 1, 1, 1, 1, 1, 1, 1);
+ let b: u8x8 = u8x8::new(4, 8, 12, 16, 20, 24, 28, 32);
+ let e: u8x8 = u8x8::new(2, 3, 4, 5, 6, 7, 8, 9);
+ let r: u8x8 = transmute(vsra_n_u8::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsraq_n_u8() {
+ let a: u8x16 = u8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
+ let b: u8x16 = u8x16::new(4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64);
+ let e: u8x16 = u8x16::new(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17);
+ let r: u8x16 = transmute(vsraq_n_u8::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsra_n_u16() {
+ let a: u16x4 = u16x4::new(1, 1, 1, 1);
+ let b: u16x4 = u16x4::new(4, 8, 12, 16);
+ let e: u16x4 = u16x4::new(2, 3, 4, 5);
+ let r: u16x4 = transmute(vsra_n_u16::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsraq_n_u16() {
+ let a: u16x8 = u16x8::new(1, 1, 1, 1, 1, 1, 1, 1);
+ let b: u16x8 = u16x8::new(4, 8, 12, 16, 20, 24, 28, 32);
+ let e: u16x8 = u16x8::new(2, 3, 4, 5, 6, 7, 8, 9);
+ let r: u16x8 = transmute(vsraq_n_u16::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsra_n_u32() {
+ let a: u32x2 = u32x2::new(1, 1);
+ let b: u32x2 = u32x2::new(4, 8);
+ let e: u32x2 = u32x2::new(2, 3);
+ let r: u32x2 = transmute(vsra_n_u32::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsraq_n_u32() {
+ let a: u32x4 = u32x4::new(1, 1, 1, 1);
+ let b: u32x4 = u32x4::new(4, 8, 12, 16);
+ let e: u32x4 = u32x4::new(2, 3, 4, 5);
+ let r: u32x4 = transmute(vsraq_n_u32::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsra_n_u64() {
+ let a: u64x1 = u64x1::new(1);
+ let b: u64x1 = u64x1::new(4);
+ let e: u64x1 = u64x1::new(2);
+ let r: u64x1 = transmute(vsra_n_u64::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsraq_n_u64() {
+ let a: u64x2 = u64x2::new(1, 1);
+ let b: u64x2 = u64x2::new(4, 8);
+ let e: u64x2 = u64x2::new(2, 3);
+ let r: u64x2 = transmute(vsraq_n_u64::<2>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn_s8() {
+ let a: i8x8 = i8x8::new(0, 2, 2, 6, 2, 10, 6, 14);
+ let b: i8x8 = i8x8::new(1, 3, 3, 7, 3, 1, 7, 15);
+ let e: [i8; 16] = [0, 1, 2, 3, 2, 3, 6, 7, 2, 3, 6, 7, 10, 1, 14, 15];
+ let r: [i8; 16] = transmute(vtrn_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn_s16() {
+ let a: i16x4 = i16x4::new(0, 2, 2, 6);
+ let b: i16x4 = i16x4::new(1, 3, 3, 7);
+ let e: [i16; 8] = [0, 1, 2, 3, 2, 3, 6, 7];
+ let r: [i16; 8] = transmute(vtrn_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrnq_s8() {
+ let a: i8x16 = i8x16::new(0, 2, 2, 6, 2, 10, 6, 14, 2, 18, 6, 22, 10, 26, 14, 30);
+ let b: i8x16 = i8x16::new(1, 3, 3, 7, 3, 1, 7, 15, 3, 19, 7, 23, 1, 27, 15, 31);
+ let e: [i8; 32] = [0, 1, 2, 3, 2, 3, 6, 7, 2, 3, 6, 7, 10, 1, 14, 15, 2, 3, 6, 7, 10, 1, 14, 15, 18, 19, 22, 23, 26, 27, 30, 31];
+ let r: [i8; 32] = transmute(vtrnq_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrnq_s16() {
+ let a: i16x8 = i16x8::new(0, 2, 2, 6, 2, 10, 6, 14);
+ let b: i16x8 = i16x8::new(1, 3, 3, 7, 3, 1, 7, 15);
+ let e: [i16; 16] = [0, 1, 2, 3, 2, 3, 6, 7, 2, 3, 6, 7, 10, 1, 14, 15];
+ let r: [i16; 16] = transmute(vtrnq_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrnq_s32() {
+ let a: i32x4 = i32x4::new(0, 2, 2, 6);
+ let b: i32x4 = i32x4::new(1, 3, 3, 7);
+ let e: [i32; 8] = [0, 1, 2, 3, 2, 3, 6, 7];
+ let r: [i32; 8] = transmute(vtrnq_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn_u8() {
+ let a: u8x8 = u8x8::new(0, 2, 2, 6, 2, 10, 6, 14);
+ let b: u8x8 = u8x8::new(1, 3, 3, 7, 3, 1, 7, 15);
+ let e: [u8; 16] = [0, 1, 2, 3, 2, 3, 6, 7, 2, 3, 6, 7, 10, 1, 14, 15];
+ let r: [u8; 16] = transmute(vtrn_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn_u16() {
+ let a: u16x4 = u16x4::new(0, 2, 2, 6);
+ let b: u16x4 = u16x4::new(1, 3, 3, 7);
+ let e: [u16; 8] = [0, 1, 2, 3, 2, 3, 6, 7];
+ let r: [u16; 8] = transmute(vtrn_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrnq_u8() {
+ let a: u8x16 = u8x16::new(0, 2, 2, 6, 2, 10, 6, 14, 2, 18, 6, 22, 10, 26, 14, 30);
+ let b: u8x16 = u8x16::new(1, 3, 3, 7, 3, 1, 7, 15, 3, 19, 7, 23, 1, 27, 15, 31);
+ let e: [u8; 32] = [0, 1, 2, 3, 2, 3, 6, 7, 2, 3, 6, 7, 10, 1, 14, 15, 2, 3, 6, 7, 10, 1, 14, 15, 18, 19, 22, 23, 26, 27, 30, 31];
+ let r: [u8; 32] = transmute(vtrnq_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrnq_u16() {
+ let a: u16x8 = u16x8::new(0, 2, 2, 6, 2, 10, 6, 14);
+ let b: u16x8 = u16x8::new(1, 3, 3, 7, 3, 1, 7, 15);
+ let e: [u16; 16] = [0, 1, 2, 3, 2, 3, 6, 7, 2, 3, 6, 7, 10, 1, 14, 15];
+ let r: [u16; 16] = transmute(vtrnq_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrnq_u32() {
+ let a: u32x4 = u32x4::new(0, 2, 2, 6);
+ let b: u32x4 = u32x4::new(1, 3, 3, 7);
+ let e: [u32; 8] = [0, 1, 2, 3, 2, 3, 6, 7];
+ let r: [u32; 8] = transmute(vtrnq_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn_p8() {
+ let a: i8x8 = i8x8::new(0, 2, 2, 6, 2, 10, 6, 14);
+ let b: i8x8 = i8x8::new(1, 3, 3, 7, 3, 1, 7, 15);
+ let e: [u8; 16] = [0, 1, 2, 3, 2, 3, 6, 7, 2, 3, 6, 7, 10, 1, 14, 15];
+ let r: [u8; 16] = transmute(vtrn_p8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn_p16() {
+ let a: i16x4 = i16x4::new(0, 2, 2, 6);
+ let b: i16x4 = i16x4::new(1, 3, 3, 7);
+ let e: [u16; 8] = [0, 1, 2, 3, 2, 3, 6, 7];
+ let r: [u16; 8] = transmute(vtrn_p16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrnq_p8() {
+ let a: i8x16 = i8x16::new(0, 2, 2, 6, 2, 10, 6, 14, 2, 18, 6, 22, 10, 26, 14, 30);
+ let b: i8x16 = i8x16::new(1, 3, 3, 7, 3, 1, 7, 15, 3, 19, 7, 23, 1, 27, 15, 31);
+ let e: [u8; 32] = [0, 1, 2, 3, 2, 3, 6, 7, 2, 3, 6, 7, 10, 1, 14, 15, 2, 3, 6, 7, 10, 1, 14, 15, 18, 19, 22, 23, 26, 27, 30, 31];
+ let r: [u8; 32] = transmute(vtrnq_p8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrnq_p16() {
+ let a: i16x8 = i16x8::new(0, 2, 2, 6, 2, 10, 6, 14);
+ let b: i16x8 = i16x8::new(1, 3, 3, 7, 3, 1, 7, 15);
+ let e: [u16; 16] = [0, 1, 2, 3, 2, 3, 6, 7, 2, 3, 6, 7, 10, 1, 14, 15];
+ let r: [u16; 16] = transmute(vtrnq_p16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn_s32() {
+ let a: i32x2 = i32x2::new(0, 2);
+ let b: i32x2 = i32x2::new(1, 3);
+ let e: [i32; 4] = [0, 1, 2, 3];
+ let r: [i32; 4] = transmute(vtrn_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn_u32() {
+ let a: u32x2 = u32x2::new(0, 2);
+ let b: u32x2 = u32x2::new(1, 3);
+ let e: [u32; 4] = [0, 1, 2, 3];
+ let r: [u32; 4] = transmute(vtrn_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrn_f32() {
+ let a: f32x2 = f32x2::new(0., 2.);
+ let b: f32x2 = f32x2::new(1., 3.);
+ let e: [f32; 4] = [0., 1., 2., 3.];
+ let r: [f32; 4] = transmute(vtrn_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vtrnq_f32() {
+ let a: f32x4 = f32x4::new(0., 2., 2., 6.);
+ let b: f32x4 = f32x4::new(1., 3., 3., 7.);
+ let e: [f32; 8] = [0., 1., 2., 3., 2., 3., 6., 7.];
+ let r: [f32; 8] = transmute(vtrnq_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip_s8() {
+ let a: i8x8 = i8x8::new(0, 2, 4, 6, 8, 10, 12, 14);
+ let b: i8x8 = i8x8::new(1, 3, 5, 7, 9, 11, 13, 15);
+ let e: [i8; 16] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
+ let r: [i8; 16] = transmute(vzip_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip_s16() {
+ let a: i16x4 = i16x4::new(0, 2, 4, 6);
+ let b: i16x4 = i16x4::new(1, 3, 5, 7);
+ let e: [i16; 8] = [0, 1, 2, 3, 4, 5, 6, 7];
+ let r: [i16; 8] = transmute(vzip_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip_u8() {
+ let a: u8x8 = u8x8::new(0, 2, 4, 6, 8, 10, 12, 14);
+ let b: u8x8 = u8x8::new(1, 3, 5, 7, 9, 11, 13, 15);
+ let e: [u8; 16] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
+ let r: [u8; 16] = transmute(vzip_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip_u16() {
+ let a: u16x4 = u16x4::new(0, 2, 4, 6);
+ let b: u16x4 = u16x4::new(1, 3, 5, 7);
+ let e: [u16; 8] = [0, 1, 2, 3, 4, 5, 6, 7];
+ let r: [u16; 8] = transmute(vzip_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip_p8() {
+ let a: i8x8 = i8x8::new(0, 2, 4, 6, 8, 10, 12, 14);
+ let b: i8x8 = i8x8::new(1, 3, 5, 7, 9, 11, 13, 15);
+ let e: [u8; 16] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
+ let r: [u8; 16] = transmute(vzip_p8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip_p16() {
+ let a: i16x4 = i16x4::new(0, 2, 4, 6);
+ let b: i16x4 = i16x4::new(1, 3, 5, 7);
+ let e: [u16; 8] = [0, 1, 2, 3, 4, 5, 6, 7];
+ let r: [u16; 8] = transmute(vzip_p16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip_s32() {
+ let a: i32x2 = i32x2::new(0, 2);
+ let b: i32x2 = i32x2::new(1, 3);
+ let e: [i32; 4] = [0, 1, 2, 3];
+ let r: [i32; 4] = transmute(vzip_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip_u32() {
+ let a: u32x2 = u32x2::new(0, 2);
+ let b: u32x2 = u32x2::new(1, 3);
+ let e: [u32; 4] = [0, 1, 2, 3];
+ let r: [u32; 4] = transmute(vzip_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzipq_s8() {
+ let a: i8x16 = i8x16::new(0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30);
+ let b: i8x16 = i8x16::new(1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31);
+ let e: [i8; 32] = [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: [i8; 32] = transmute(vzipq_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzipq_s16() {
+ let a: i16x8 = i16x8::new(0, 2, 4, 6, 8, 10, 12, 14);
+ let b: i16x8 = i16x8::new(1, 3, 5, 7, 9, 11, 13, 15);
+ let e: [i16; 16] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
+ let r: [i16; 16] = transmute(vzipq_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzipq_s32() {
+ let a: i32x4 = i32x4::new(0, 2, 4, 6);
+ let b: i32x4 = i32x4::new(1, 3, 5, 7);
+ let e: [i32; 8] = [0, 1, 2, 3, 4, 5, 6, 7];
+ let r: [i32; 8] = transmute(vzipq_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzipq_u8() {
+ let a: u8x16 = u8x16::new(0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30);
+ let b: u8x16 = u8x16::new(1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31);
+ let e: [u8; 32] = [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: [u8; 32] = transmute(vzipq_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzipq_u16() {
+ let a: u16x8 = u16x8::new(0, 2, 4, 6, 8, 10, 12, 14);
+ let b: u16x8 = u16x8::new(1, 3, 5, 7, 9, 11, 13, 15);
+ let e: [u16; 16] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
+ let r: [u16; 16] = transmute(vzipq_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzipq_u32() {
+ let a: u32x4 = u32x4::new(0, 2, 4, 6);
+ let b: u32x4 = u32x4::new(1, 3, 5, 7);
+ let e: [u32; 8] = [0, 1, 2, 3, 4, 5, 6, 7];
+ let r: [u32; 8] = transmute(vzipq_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzipq_p8() {
+ let a: i8x16 = i8x16::new(0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30);
+ let b: i8x16 = i8x16::new(1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31);
+ let e: [u8; 32] = [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: [u8; 32] = transmute(vzipq_p8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzipq_p16() {
+ let a: i16x8 = i16x8::new(0, 2, 4, 6, 8, 10, 12, 14);
+ let b: i16x8 = i16x8::new(1, 3, 5, 7, 9, 11, 13, 15);
+ let e: [u16; 16] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
+ let r: [u16; 16] = transmute(vzipq_p16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzip_f32() {
+ let a: f32x2 = f32x2::new(1., 2.);
+ let b: f32x2 = f32x2::new(5., 6.);
+ let e: [f32; 4] = [1., 5., 2., 6.];
+ let r: [f32; 4] = transmute(vzip_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vzipq_f32() {
+ let a: f32x4 = f32x4::new(1., 2., 3., 4.);
+ let b: f32x4 = f32x4::new(5., 6., 7., 8.);
+ let e: [f32; 8] = [1., 5., 2., 6., 3., 7., 4., 8.];
+ let r: [f32; 8] = transmute(vzipq_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp_s8() {
+ let a: i8x8 = i8x8::new(1, 2, 2, 3, 2, 3, 3, 8);
+ let b: i8x8 = i8x8::new(2, 3, 3, 8, 3, 15, 8, 16);
+ let e: [i8; 16] = [1, 2, 2, 3, 2, 3, 3, 8, 2, 3, 3, 8, 3, 8, 15, 16];
+ let r: [i8; 16] = transmute(vuzp_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp_s16() {
+ let a: i16x4 = i16x4::new(1, 2, 2, 3);
+ let b: i16x4 = i16x4::new(2, 3, 3, 8);
+ let e: [i16; 8] = [1, 2, 2, 3, 2, 3, 3, 8];
+ let r: [i16; 8] = transmute(vuzp_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzpq_s8() {
+ let a: i8x16 = i8x16::new(1, 2, 2, 3, 2, 3, 3, 8, 2, 3, 3, 8, 3, 15, 8, 16);
+ let b: i8x16 = i8x16::new(2, 3, 3, 8, 3, 15, 8, 16, 3, 29, 8, 30, 15, 31, 16, 32);
+ let e: [i8; 32] = [1, 2, 2, 3, 2, 3, 3, 8, 2, 3, 3, 8, 3, 8, 15, 16, 2, 3, 3, 8, 3, 8, 15, 16, 3, 8, 15, 16, 29, 30, 31, 32];
+ let r: [i8; 32] = transmute(vuzpq_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzpq_s16() {
+ let a: i16x8 = i16x8::new(1, 2, 2, 3, 2, 3, 3, 8);
+ let b: i16x8 = i16x8::new(2, 3, 3, 8, 3, 15, 8, 16);
+ let e: [i16; 16] = [1, 2, 2, 3, 2, 3, 3, 8, 2, 3, 3, 8, 3, 8, 15, 16];
+ let r: [i16; 16] = transmute(vuzpq_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzpq_s32() {
+ let a: i32x4 = i32x4::new(1, 2, 2, 3);
+ let b: i32x4 = i32x4::new(2, 3, 3, 8);
+ let e: [i32; 8] = [1, 2, 2, 3, 2, 3, 3, 8];
+ let r: [i32; 8] = transmute(vuzpq_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp_u8() {
+ let a: u8x8 = u8x8::new(1, 2, 2, 3, 2, 3, 3, 8);
+ let b: u8x8 = u8x8::new(2, 3, 3, 8, 3, 15, 8, 16);
+ let e: [u8; 16] = [1, 2, 2, 3, 2, 3, 3, 8, 2, 3, 3, 8, 3, 8, 15, 16];
+ let r: [u8; 16] = transmute(vuzp_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp_u16() {
+ let a: u16x4 = u16x4::new(1, 2, 2, 3);
+ let b: u16x4 = u16x4::new(2, 3, 3, 8);
+ let e: [u16; 8] = [1, 2, 2, 3, 2, 3, 3, 8];
+ let r: [u16; 8] = transmute(vuzp_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzpq_u8() {
+ let a: u8x16 = u8x16::new(1, 2, 2, 3, 2, 3, 3, 8, 2, 3, 3, 8, 3, 15, 8, 16);
+ let b: u8x16 = u8x16::new(2, 3, 3, 8, 3, 15, 8, 16, 3, 29, 8, 30, 15, 31, 16, 32);
+ let e: [u8; 32] = [1, 2, 2, 3, 2, 3, 3, 8, 2, 3, 3, 8, 3, 8, 15, 16, 2, 3, 3, 8, 3, 8, 15, 16, 3, 8, 15, 16, 29, 30, 31, 32];
+ let r: [u8; 32] = transmute(vuzpq_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzpq_u16() {
+ let a: u16x8 = u16x8::new(1, 2, 2, 3, 2, 3, 3, 8);
+ let b: u16x8 = u16x8::new(2, 3, 3, 8, 3, 15, 8, 16);
+ let e: [u16; 16] = [1, 2, 2, 3, 2, 3, 3, 8, 2, 3, 3, 8, 3, 8, 15, 16];
+ let r: [u16; 16] = transmute(vuzpq_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzpq_u32() {
+ let a: u32x4 = u32x4::new(1, 2, 2, 3);
+ let b: u32x4 = u32x4::new(2, 3, 3, 8);
+ let e: [u32; 8] = [1, 2, 2, 3, 2, 3, 3, 8];
+ let r: [u32; 8] = transmute(vuzpq_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp_p8() {
+ let a: i8x8 = i8x8::new(1, 2, 2, 3, 2, 3, 3, 8);
+ let b: i8x8 = i8x8::new(2, 3, 3, 8, 3, 15, 8, 16);
+ let e: [u8; 16] = [1, 2, 2, 3, 2, 3, 3, 8, 2, 3, 3, 8, 3, 8, 15, 16];
+ let r: [u8; 16] = transmute(vuzp_p8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp_p16() {
+ let a: i16x4 = i16x4::new(1, 2, 2, 3);
+ let b: i16x4 = i16x4::new(2, 3, 3, 8);
+ let e: [u16; 8] = [1, 2, 2, 3, 2, 3, 3, 8];
+ let r: [u16; 8] = transmute(vuzp_p16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzpq_p8() {
+ let a: i8x16 = i8x16::new(1, 2, 2, 3, 2, 3, 3, 8, 2, 3, 3, 8, 3, 15, 8, 16);
+ let b: i8x16 = i8x16::new(2, 3, 3, 8, 3, 15, 8, 16, 3, 29, 8, 30, 15, 31, 16, 32);
+ let e: [u8; 32] = [1, 2, 2, 3, 2, 3, 3, 8, 2, 3, 3, 8, 3, 8, 15, 16, 2, 3, 3, 8, 3, 8, 15, 16, 3, 8, 15, 16, 29, 30, 31, 32];
+ let r: [u8; 32] = transmute(vuzpq_p8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzpq_p16() {
+ let a: i16x8 = i16x8::new(1, 2, 2, 3, 2, 3, 3, 8);
+ let b: i16x8 = i16x8::new(2, 3, 3, 8, 3, 15, 8, 16);
+ let e: [u16; 16] = [1, 2, 2, 3, 2, 3, 3, 8, 2, 3, 3, 8, 3, 8, 15, 16];
+ let r: [u16; 16] = transmute(vuzpq_p16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp_s32() {
+ let a: i32x2 = i32x2::new(1, 2);
+ let b: i32x2 = i32x2::new(2, 3);
+ let e: [i32; 4] = [1, 2, 2, 3];
+ let r: [i32; 4] = transmute(vuzp_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp_u32() {
+ let a: u32x2 = u32x2::new(1, 2);
+ let b: u32x2 = u32x2::new(2, 3);
+ let e: [u32; 4] = [1, 2, 2, 3];
+ let r: [u32; 4] = transmute(vuzp_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzp_f32() {
+ let a: f32x2 = f32x2::new(1., 2.);
+ let b: f32x2 = f32x2::new(2., 6.);
+ let e: [f32; 4] = [1., 2., 2., 6.];
+ let r: [f32; 4] = transmute(vuzp_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vuzpq_f32() {
+ let a: f32x4 = f32x4::new(1., 2., 2., 4.);
+ let b: f32x4 = f32x4::new(2., 6., 6., 8.);
+ let e: [f32; 8] = [1., 2., 2., 6., 2., 4., 6., 8.];
+ let r: [f32; 8] = transmute(vuzpq_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabal_u8() {
+ let a: u16x8 = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: u8x8 = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let c: u8x8 = u8x8::new(10, 10, 10, 10, 10, 10, 10, 10);
+ let e: u16x8 = u16x8::new(10, 10, 10, 10, 10, 10, 10, 10);
+ let r: u16x8 = transmute(vabal_u8(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabal_u16() {
+ let a: u32x4 = u32x4::new(1, 2, 3, 4);
+ let b: u16x4 = u16x4::new(1, 2, 3, 4);
+ let c: u16x4 = u16x4::new(10, 10, 10, 10);
+ let e: u32x4 = u32x4::new(10, 10, 10, 10);
+ let r: u32x4 = transmute(vabal_u16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabal_u32() {
+ let a: u64x2 = u64x2::new(1, 2);
+ let b: u32x2 = u32x2::new(1, 2);
+ let c: u32x2 = u32x2::new(10, 10);
+ let e: u64x2 = u64x2::new(10, 10);
+ let r: u64x2 = transmute(vabal_u32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabal_s8() {
+ let a: i16x8 = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let c: i8x8 = i8x8::new(10, 10, 10, 10, 10, 10, 10, 10);
+ let e: i16x8 = i16x8::new(10, 10, 10, 10, 10, 10, 10, 10);
+ let r: i16x8 = transmute(vabal_s8(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabal_s16() {
+ let a: i32x4 = i32x4::new(1, 2, 3, 4);
+ let b: i16x4 = i16x4::new(1, 2, 3, 4);
+ let c: i16x4 = i16x4::new(10, 10, 10, 10);
+ let e: i32x4 = i32x4::new(10, 10, 10, 10);
+ let r: i32x4 = transmute(vabal_s16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabal_s32() {
+ let a: i64x2 = i64x2::new(1, 2);
+ let b: i32x2 = i32x2::new(1, 2);
+ let c: i32x2 = i32x2::new(10, 10);
+ let e: i64x2 = i64x2::new(10, 10);
+ let r: i64x2 = transmute(vabal_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqabs_s8() {
+ let a: i8x8 = i8x8::new(-128, 0x7F, -6, -5, -4, -3, -2, -1);
+ let e: i8x8 = i8x8::new(0x7F, 0x7F, 6, 5, 4, 3, 2, 1);
+ let r: i8x8 = transmute(vqabs_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqabsq_s8() {
+ let a: i8x16 = i8x16::new(-128, 0x7F, -6, -5, -4, -3, -2, -1, 0, -127, 127, 1, 2, 3, 4, 5);
+ let e: i8x16 = i8x16::new(0x7F, 0x7F, 6, 5, 4, 3, 2, 1, 0, 127, 127, 1, 2, 3, 4, 5);
+ let r: i8x16 = transmute(vqabsq_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqabs_s16() {
+ let a: i16x4 = i16x4::new(-32768, 0x7F_FF, -6, -5);
+ let e: i16x4 = i16x4::new(0x7F_FF, 0x7F_FF, 6, 5);
+ let r: i16x4 = transmute(vqabs_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqabsq_s16() {
+ let a: i16x8 = i16x8::new(-32768, 0x7F_FF, -6, -5, -4, -3, -2, -1);
+ let e: i16x8 = i16x8::new(0x7F_FF, 0x7F_FF, 6, 5, 4, 3, 2, 1);
+ let r: i16x8 = transmute(vqabsq_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqabs_s32() {
+ let a: i32x2 = i32x2::new(-2147483648, 0x7F_FF_FF_FF);
+ let e: i32x2 = i32x2::new(0x7F_FF_FF_FF, 0x7F_FF_FF_FF);
+ let r: i32x2 = transmute(vqabs_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqabsq_s32() {
+ let a: i32x4 = i32x4::new(-2147483648, 0x7F_FF_FF_FF, -6, -5);
+ let e: i32x4 = i32x4::new(0x7F_FF_FF_FF, 0x7F_FF_FF_FF, 6, 5);
+ let r: i32x4 = transmute(vqabsq_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/arm_shared/neon/load_tests.rs b/library/stdarch/crates/core_arch/src/arm_shared/neon/load_tests.rs
new file mode 100644
index 000000000..bbee29ae7
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/arm_shared/neon/load_tests.rs
@@ -0,0 +1,206 @@
+//! Tests for ARM+v7+neon load (vld1) intrinsics.
+//!
+//! These are included in `{arm, aarch64}::neon`.
+
+use super::*;
+
+#[cfg(target_arch = "arm")]
+use crate::core_arch::arm::*;
+
+#[cfg(target_arch = "aarch64")]
+use crate::core_arch::aarch64::*;
+
+use crate::core_arch::simd::*;
+use std::mem;
+use stdarch_test::simd_test;
+#[simd_test(enable = "neon")]
+unsafe fn test_vld1_s8() {
+ let a: [i8; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
+ let e = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let r: i8x8 = transmute(vld1_s8(a[1..].as_ptr()));
+ assert_eq!(r, e)
+}
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vld1q_s8() {
+ let a: [i8; 17] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let e = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let r: i8x16 = transmute(vld1q_s8(a[1..].as_ptr()));
+ assert_eq!(r, e)
+}
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vld1_s16() {
+ let a: [i16; 5] = [0, 1, 2, 3, 4];
+ let e = i16x4::new(1, 2, 3, 4);
+ let r: i16x4 = transmute(vld1_s16(a[1..].as_ptr()));
+ assert_eq!(r, e)
+}
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vld1q_s16() {
+ let a: [i16; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
+ let e = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let r: i16x8 = transmute(vld1q_s16(a[1..].as_ptr()));
+ assert_eq!(r, e)
+}
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vld1_s32() {
+ let a: [i32; 3] = [0, 1, 2];
+ let e = i32x2::new(1, 2);
+ let r: i32x2 = transmute(vld1_s32(a[1..].as_ptr()));
+ assert_eq!(r, e)
+}
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vld1q_s32() {
+ let a: [i32; 5] = [0, 1, 2, 3, 4];
+ let e = i32x4::new(1, 2, 3, 4);
+ let r: i32x4 = transmute(vld1q_s32(a[1..].as_ptr()));
+ assert_eq!(r, e)
+}
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vld1_s64() {
+ let a: [i64; 2] = [0, 1];
+ let e = i64x1::new(1);
+ let r: i64x1 = transmute(vld1_s64(a[1..].as_ptr()));
+ assert_eq!(r, e)
+}
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vld1q_s64() {
+ let a: [i64; 3] = [0, 1, 2];
+ let e = i64x2::new(1, 2);
+ let r: i64x2 = transmute(vld1q_s64(a[1..].as_ptr()));
+ assert_eq!(r, e)
+}
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vld1_u8() {
+ let a: [u8; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
+ let e = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let r: u8x8 = transmute(vld1_u8(a[1..].as_ptr()));
+ assert_eq!(r, e)
+}
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vld1q_u8() {
+ let a: [u8; 17] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let e = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let r: u8x16 = transmute(vld1q_u8(a[1..].as_ptr()));
+ assert_eq!(r, e)
+}
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vld1_u16() {
+ let a: [u16; 5] = [0, 1, 2, 3, 4];
+ let e = u16x4::new(1, 2, 3, 4);
+ let r: u16x4 = transmute(vld1_u16(a[1..].as_ptr()));
+ assert_eq!(r, e)
+}
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vld1q_u16() {
+ let a: [u16; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
+ let e = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let r: u16x8 = transmute(vld1q_u16(a[1..].as_ptr()));
+ assert_eq!(r, e)
+}
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vld1_u32() {
+ let a: [u32; 3] = [0, 1, 2];
+ let e = u32x2::new(1, 2);
+ let r: u32x2 = transmute(vld1_u32(a[1..].as_ptr()));
+ assert_eq!(r, e)
+}
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vld1q_u32() {
+ let a: [u32; 5] = [0, 1, 2, 3, 4];
+ let e = u32x4::new(1, 2, 3, 4);
+ let r: u32x4 = transmute(vld1q_u32(a[1..].as_ptr()));
+ assert_eq!(r, e)
+}
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vld1_u64() {
+ let a: [u64; 2] = [0, 1];
+ let e = u64x1::new(1);
+ let r: u64x1 = transmute(vld1_u64(a[1..].as_ptr()));
+ assert_eq!(r, e)
+}
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vld1q_u64() {
+ let a: [u64; 3] = [0, 1, 2];
+ let e = u64x2::new(1, 2);
+ let r: u64x2 = transmute(vld1q_u64(a[1..].as_ptr()));
+ assert_eq!(r, e)
+}
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vld1_p8() {
+ let a: [p8; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
+ let e = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let r: u8x8 = transmute(vld1_p8(a[1..].as_ptr()));
+ assert_eq!(r, e)
+}
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vld1q_p8() {
+ let a: [p8; 17] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+ let e = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let r: u8x16 = transmute(vld1q_p8(a[1..].as_ptr()));
+ assert_eq!(r, e)
+}
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vld1_p16() {
+ let a: [p16; 5] = [0, 1, 2, 3, 4];
+ let e = u16x4::new(1, 2, 3, 4);
+ let r: u16x4 = transmute(vld1_p16(a[1..].as_ptr()));
+ assert_eq!(r, e)
+}
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vld1q_p16() {
+ let a: [p16; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
+ let e = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let r: u16x8 = transmute(vld1q_p16(a[1..].as_ptr()));
+ assert_eq!(r, e)
+}
+
+#[simd_test(enable = "neon,aes")]
+unsafe fn test_vld1_p64() {
+ let a: [p64; 2] = [0, 1];
+ let e = u64x1::new(1);
+ let r: u64x1 = transmute(vld1_p64(a[1..].as_ptr()));
+ assert_eq!(r, e)
+}
+
+#[simd_test(enable = "neon,aes")]
+unsafe fn test_vld1q_p64() {
+ let a: [p64; 3] = [0, 1, 2];
+ let e = u64x2::new(1, 2);
+ let r: u64x2 = transmute(vld1q_p64(a[1..].as_ptr()));
+ assert_eq!(r, e)
+}
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vld1_f32() {
+ let a: [f32; 3] = [0., 1., 2.];
+ let e = f32x2::new(1., 2.);
+ let r: f32x2 = transmute(vld1_f32(a[1..].as_ptr()));
+ assert_eq!(r, e)
+}
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vld1q_f32() {
+ let a: [f32; 5] = [0., 1., 2., 3., 4.];
+ let e = f32x4::new(1., 2., 3., 4.);
+ let r: f32x4 = transmute(vld1q_f32(a[1..].as_ptr()));
+ assert_eq!(r, e)
+}
diff --git a/library/stdarch/crates/core_arch/src/arm_shared/neon/mod.rs b/library/stdarch/crates/core_arch/src/arm_shared/neon/mod.rs
new file mode 100644
index 000000000..952d1ca2e
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/arm_shared/neon/mod.rs
@@ -0,0 +1,12347 @@
+//! ARMv7 NEON intrinsics
+
+#[rustfmt::skip]
+mod generated;
+#[rustfmt::skip]
+pub use self::generated::*;
+
+use crate::{
+ core_arch::simd::*, core_arch::simd_llvm::*, hint::unreachable_unchecked, mem::transmute,
+};
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+pub(crate) type p8 = u8;
+pub(crate) type p16 = u16;
+pub(crate) type p64 = u64;
+pub(crate) type p128 = u128;
+
+types! {
+ /// ARM-specific 64-bit wide vector of eight packed `i8`.
+ #[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+ pub struct int8x8_t(pub(crate) i8, pub(crate) i8, pub(crate) i8, pub(crate) i8, pub(crate) i8, pub(crate) i8, pub(crate) i8, pub(crate) i8);
+ /// ARM-specific 64-bit wide vector of eight packed `u8`.
+ #[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+ pub struct uint8x8_t(pub(crate) u8, pub(crate) u8, pub(crate) u8, pub(crate) u8, pub(crate) u8, pub(crate) u8, pub(crate) u8, pub(crate) u8);
+ /// ARM-specific 64-bit wide polynomial vector of eight packed `p8`.
+ #[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+ pub struct poly8x8_t(pub(crate) p8, pub(crate) p8, pub(crate) p8, pub(crate) p8, pub(crate) p8, pub(crate) p8, pub(crate) p8, pub(crate) p8);
+ /// ARM-specific 64-bit wide vector of four packed `i16`.
+ #[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+ pub struct int16x4_t(pub(crate) i16, pub(crate) i16, pub(crate) i16, pub(crate) i16);
+ /// ARM-specific 64-bit wide vector of four packed `u16`.
+ #[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+ pub struct uint16x4_t(pub(crate) u16, pub(crate) u16, pub(crate) u16, pub(crate) u16);
+ // FIXME: ARM-specific 64-bit wide vector of four packed `f16`.
+ // pub struct float16x4_t(f16, f16, f16, f16);
+ /// ARM-specific 64-bit wide vector of four packed `p16`.
+ #[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+ pub struct poly16x4_t(pub(crate) p16, pub(crate) p16, pub(crate) p16, pub(crate) p16);
+ /// ARM-specific 64-bit wide vector of two packed `i32`.
+ #[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+ pub struct int32x2_t(pub(crate) i32, pub(crate) i32);
+ /// ARM-specific 64-bit wide vector of two packed `u32`.
+ #[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+ pub struct uint32x2_t(pub(crate) u32, pub(crate) u32);
+ /// ARM-specific 64-bit wide vector of two packed `f32`.
+ #[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+ pub struct float32x2_t(pub(crate) f32, pub(crate) f32);
+ /// ARM-specific 64-bit wide vector of one packed `i64`.
+ #[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+ pub struct int64x1_t(pub(crate) i64);
+ /// ARM-specific 64-bit wide vector of one packed `u64`.
+ #[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+ pub struct uint64x1_t(pub(crate) u64);
+ /// ARM-specific 64-bit wide vector of one packed `p64`.
+ #[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+ pub struct poly64x1_t(pub(crate) p64);
+
+ /// ARM-specific 128-bit wide vector of sixteen packed `i8`.
+ #[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+ pub struct int8x16_t(
+ pub(crate) i8, pub(crate) i8, pub(crate) i8, pub(crate) i8, pub(crate) i8, pub(crate) i8 , pub(crate) i8, pub(crate) i8,
+ pub(crate) i8, pub(crate) i8, pub(crate) i8, pub(crate) i8, pub(crate) i8, pub(crate) i8 , pub(crate) i8, pub(crate) i8,
+ );
+ /// ARM-specific 128-bit wide vector of sixteen packed `u8`.
+ #[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+ pub struct uint8x16_t(
+ pub(crate) u8, pub(crate) u8 , pub(crate) u8, pub(crate) u8, pub(crate) u8, pub(crate) u8 , pub(crate) u8, pub(crate) u8,
+ pub(crate) u8, pub(crate) u8 , pub(crate) u8, pub(crate) u8, pub(crate) u8, pub(crate) u8 , pub(crate) u8, pub(crate) u8,
+ );
+ /// ARM-specific 128-bit wide vector of sixteen packed `p8`.
+ #[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+ pub struct poly8x16_t(
+ pub(crate) p8, pub(crate) p8, pub(crate) p8, pub(crate) p8, pub(crate) p8, pub(crate) p8, pub(crate) p8, pub(crate) p8,
+ pub(crate) p8, pub(crate) p8, pub(crate) p8, pub(crate) p8, pub(crate) p8, pub(crate) p8, pub(crate) p8, pub(crate) p8,
+ );
+ /// ARM-specific 128-bit wide vector of eight packed `i16`.
+ #[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+ pub struct int16x8_t(pub(crate) i16, pub(crate) i16, pub(crate) i16, pub(crate) i16, pub(crate) i16, pub(crate) i16, pub(crate) i16, pub(crate) i16);
+ /// ARM-specific 128-bit wide vector of eight packed `u16`.
+ #[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+ pub struct uint16x8_t(pub(crate) u16, pub(crate) u16, pub(crate) u16, pub(crate) u16, pub(crate) u16, pub(crate) u16, pub(crate) u16, pub(crate) u16);
+ // FIXME: ARM-specific 128-bit wide vector of eight packed `f16`.
+ // pub struct float16x8_t(f16, f16, f16, f16, f16, f16, f16);
+ /// ARM-specific 128-bit wide vector of eight packed `p16`.
+ #[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+ pub struct poly16x8_t(pub(crate) p16, pub(crate) p16, pub(crate) p16, pub(crate) p16, pub(crate) p16, pub(crate) p16, pub(crate) p16, pub(crate) p16);
+ /// ARM-specific 128-bit wide vector of four packed `i32`.
+ #[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+ pub struct int32x4_t(pub(crate) i32, pub(crate) i32, pub(crate) i32, pub(crate) i32);
+ /// ARM-specific 128-bit wide vector of four packed `u32`.
+ #[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+ pub struct uint32x4_t(pub(crate) u32, pub(crate) u32, pub(crate) u32, pub(crate) u32);
+ /// ARM-specific 128-bit wide vector of four packed `f32`.
+ #[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+ pub struct float32x4_t(pub(crate) f32, pub(crate) f32, pub(crate) f32, pub(crate) f32);
+ /// ARM-specific 128-bit wide vector of two packed `i64`.
+ #[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+ pub struct int64x2_t(pub(crate) i64, pub(crate) i64);
+ /// ARM-specific 128-bit wide vector of two packed `u64`.
+ #[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+ pub struct uint64x2_t(pub(crate) u64, pub(crate) u64);
+ /// ARM-specific 128-bit wide vector of two packed `p64`.
+ #[cfg_attr(target_arch = "aarch64", stable(feature = "neon_intrinsics", since = "1.59.0"))]
+ pub struct poly64x2_t(pub(crate) p64, pub(crate) p64);
+}
+
+/// ARM-specific type containing two `int8x8_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct int8x8x2_t(pub int8x8_t, pub int8x8_t);
+/// ARM-specific type containing three `int8x8_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct int8x8x3_t(pub int8x8_t, pub int8x8_t, pub int8x8_t);
+/// ARM-specific type containing four `int8x8_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct int8x8x4_t(pub int8x8_t, pub int8x8_t, pub int8x8_t, pub int8x8_t);
+
+/// ARM-specific type containing two `int8x16_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct int8x16x2_t(pub int8x16_t, pub int8x16_t);
+/// ARM-specific type containing three `int8x16_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct int8x16x3_t(pub int8x16_t, pub int8x16_t, pub int8x16_t);
+/// ARM-specific type containing four `int8x16_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct int8x16x4_t(pub int8x16_t, pub int8x16_t, pub int8x16_t, pub int8x16_t);
+
+/// ARM-specific type containing two `uint8x8_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct uint8x8x2_t(pub uint8x8_t, pub uint8x8_t);
+/// ARM-specific type containing three `uint8x8_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct uint8x8x3_t(pub uint8x8_t, pub uint8x8_t, pub uint8x8_t);
+/// ARM-specific type containing four `uint8x8_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct uint8x8x4_t(pub uint8x8_t, pub uint8x8_t, pub uint8x8_t, pub uint8x8_t);
+
+/// ARM-specific type containing two `uint8x16_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct uint8x16x2_t(pub uint8x16_t, pub uint8x16_t);
+/// ARM-specific type containing three `uint8x16_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct uint8x16x3_t(pub uint8x16_t, pub uint8x16_t, pub uint8x16_t);
+/// ARM-specific type containing four `uint8x16_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct uint8x16x4_t(
+ pub uint8x16_t,
+ pub uint8x16_t,
+ pub uint8x16_t,
+ pub uint8x16_t,
+);
+
+/// ARM-specific type containing two `poly8x8_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct poly8x8x2_t(pub poly8x8_t, pub poly8x8_t);
+/// ARM-specific type containing three `poly8x8_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct poly8x8x3_t(pub poly8x8_t, pub poly8x8_t, pub poly8x8_t);
+/// ARM-specific type containing four `poly8x8_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct poly8x8x4_t(pub poly8x8_t, pub poly8x8_t, pub poly8x8_t, pub poly8x8_t);
+
+/// ARM-specific type containing two `poly8x16_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct poly8x16x2_t(pub poly8x16_t, pub poly8x16_t);
+/// ARM-specific type containing three `poly8x16_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct poly8x16x3_t(pub poly8x16_t, pub poly8x16_t, pub poly8x16_t);
+/// ARM-specific type containing four `poly8x16_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct poly8x16x4_t(
+ pub poly8x16_t,
+ pub poly8x16_t,
+ pub poly8x16_t,
+ pub poly8x16_t,
+);
+
+/// ARM-specific type containing two `int16x4_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct int16x4x2_t(pub int16x4_t, pub int16x4_t);
+/// ARM-specific type containing three `int16x4_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct int16x4x3_t(pub int16x4_t, pub int16x4_t, pub int16x4_t);
+/// ARM-specific type containing four `int16x4_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct int16x4x4_t(pub int16x4_t, pub int16x4_t, pub int16x4_t, pub int16x4_t);
+
+/// ARM-specific type containing two `int16x8_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct int16x8x2_t(pub int16x8_t, pub int16x8_t);
+/// ARM-specific type containing three `int16x8_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct int16x8x3_t(pub int16x8_t, pub int16x8_t, pub int16x8_t);
+/// ARM-specific type containing four `int16x8_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct int16x8x4_t(pub int16x8_t, pub int16x8_t, pub int16x8_t, pub int16x8_t);
+
+/// ARM-specific type containing two `uint16x4_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct uint16x4x2_t(pub uint16x4_t, pub uint16x4_t);
+/// ARM-specific type containing three `uint16x4_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct uint16x4x3_t(pub uint16x4_t, pub uint16x4_t, pub uint16x4_t);
+/// ARM-specific type containing four `uint16x4_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct uint16x4x4_t(
+ pub uint16x4_t,
+ pub uint16x4_t,
+ pub uint16x4_t,
+ pub uint16x4_t,
+);
+
+/// ARM-specific type containing two `uint16x8_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct uint16x8x2_t(pub uint16x8_t, pub uint16x8_t);
+/// ARM-specific type containing three `uint16x8_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct uint16x8x3_t(pub uint16x8_t, pub uint16x8_t, pub uint16x8_t);
+/// ARM-specific type containing four `uint16x8_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct uint16x8x4_t(
+ pub uint16x8_t,
+ pub uint16x8_t,
+ pub uint16x8_t,
+ pub uint16x8_t,
+);
+
+/// ARM-specific type containing two `poly16x4_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct poly16x4x2_t(pub poly16x4_t, pub poly16x4_t);
+/// ARM-specific type containing three `poly16x4_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct poly16x4x3_t(pub poly16x4_t, pub poly16x4_t, pub poly16x4_t);
+/// ARM-specific type containing four `poly16x4_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct poly16x4x4_t(
+ pub poly16x4_t,
+ pub poly16x4_t,
+ pub poly16x4_t,
+ pub poly16x4_t,
+);
+
+/// ARM-specific type containing two `poly16x8_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct poly16x8x2_t(pub poly16x8_t, pub poly16x8_t);
+/// ARM-specific type containing three `poly16x8_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct poly16x8x3_t(pub poly16x8_t, pub poly16x8_t, pub poly16x8_t);
+/// ARM-specific type containing four `poly16x8_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct poly16x8x4_t(
+ pub poly16x8_t,
+ pub poly16x8_t,
+ pub poly16x8_t,
+ pub poly16x8_t,
+);
+
+/// ARM-specific type containing two `int32x2_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct int32x2x2_t(pub int32x2_t, pub int32x2_t);
+/// ARM-specific type containing three `int32x2_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct int32x2x3_t(pub int32x2_t, pub int32x2_t, pub int32x2_t);
+/// ARM-specific type containing four `int32x2_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct int32x2x4_t(pub int32x2_t, pub int32x2_t, pub int32x2_t, pub int32x2_t);
+
+/// ARM-specific type containing two `int32x4_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct int32x4x2_t(pub int32x4_t, pub int32x4_t);
+/// ARM-specific type containing three `int32x4_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct int32x4x3_t(pub int32x4_t, pub int32x4_t, pub int32x4_t);
+/// ARM-specific type containing four `int32x4_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct int32x4x4_t(pub int32x4_t, pub int32x4_t, pub int32x4_t, pub int32x4_t);
+
+/// ARM-specific type containing two `uint32x2_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct uint32x2x2_t(pub uint32x2_t, pub uint32x2_t);
+/// ARM-specific type containing three `uint32x2_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct uint32x2x3_t(pub uint32x2_t, pub uint32x2_t, pub uint32x2_t);
+/// ARM-specific type containing four `uint32x2_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct uint32x2x4_t(
+ pub uint32x2_t,
+ pub uint32x2_t,
+ pub uint32x2_t,
+ pub uint32x2_t,
+);
+
+/// ARM-specific type containing two `uint32x4_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct uint32x4x2_t(pub uint32x4_t, pub uint32x4_t);
+/// ARM-specific type containing three `uint32x4_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct uint32x4x3_t(pub uint32x4_t, pub uint32x4_t, pub uint32x4_t);
+/// ARM-specific type containing four `uint32x4_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct uint32x4x4_t(
+ pub uint32x4_t,
+ pub uint32x4_t,
+ pub uint32x4_t,
+ pub uint32x4_t,
+);
+
+/// ARM-specific type containing two `float32x2_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct float32x2x2_t(pub float32x2_t, pub float32x2_t);
+/// ARM-specific type containing three `float32x2_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct float32x2x3_t(pub float32x2_t, pub float32x2_t, pub float32x2_t);
+/// ARM-specific type containing four `float32x2_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct float32x2x4_t(
+ pub float32x2_t,
+ pub float32x2_t,
+ pub float32x2_t,
+ pub float32x2_t,
+);
+
+/// ARM-specific type containing two `float32x4_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct float32x4x2_t(pub float32x4_t, pub float32x4_t);
+/// ARM-specific type containing three `float32x4_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct float32x4x3_t(pub float32x4_t, pub float32x4_t, pub float32x4_t);
+/// ARM-specific type containing four `float32x4_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct float32x4x4_t(
+ pub float32x4_t,
+ pub float32x4_t,
+ pub float32x4_t,
+ pub float32x4_t,
+);
+
+/// ARM-specific type containing four `int64x1_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct int64x1x2_t(pub int64x1_t, pub int64x1_t);
+/// ARM-specific type containing four `int64x1_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct int64x1x3_t(pub int64x1_t, pub int64x1_t, pub int64x1_t);
+/// ARM-specific type containing four `int64x1_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct int64x1x4_t(pub int64x1_t, pub int64x1_t, pub int64x1_t, pub int64x1_t);
+
+/// ARM-specific type containing four `int64x2_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct int64x2x2_t(pub int64x2_t, pub int64x2_t);
+/// ARM-specific type containing four `int64x2_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct int64x2x3_t(pub int64x2_t, pub int64x2_t, pub int64x2_t);
+/// ARM-specific type containing four `int64x2_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct int64x2x4_t(pub int64x2_t, pub int64x2_t, pub int64x2_t, pub int64x2_t);
+
+/// ARM-specific type containing four `uint64x1_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct uint64x1x2_t(pub uint64x1_t, pub uint64x1_t);
+/// ARM-specific type containing four `uint64x1_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct uint64x1x3_t(pub uint64x1_t, pub uint64x1_t, pub uint64x1_t);
+/// ARM-specific type containing four `uint64x1_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct uint64x1x4_t(
+ pub uint64x1_t,
+ pub uint64x1_t,
+ pub uint64x1_t,
+ pub uint64x1_t,
+);
+
+/// ARM-specific type containing four `uint64x2_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct uint64x2x2_t(pub uint64x2_t, pub uint64x2_t);
+/// ARM-specific type containing four `uint64x2_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct uint64x2x3_t(pub uint64x2_t, pub uint64x2_t, pub uint64x2_t);
+/// ARM-specific type containing four `uint64x2_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct uint64x2x4_t(
+ pub uint64x2_t,
+ pub uint64x2_t,
+ pub uint64x2_t,
+ pub uint64x2_t,
+);
+
+/// ARM-specific type containing four `poly64x1_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct poly64x1x2_t(pub poly64x1_t, pub poly64x1_t);
+/// ARM-specific type containing four `poly64x1_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct poly64x1x3_t(pub poly64x1_t, pub poly64x1_t, pub poly64x1_t);
+/// ARM-specific type containing four `poly64x1_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct poly64x1x4_t(
+ pub poly64x1_t,
+ pub poly64x1_t,
+ pub poly64x1_t,
+ pub poly64x1_t,
+);
+
+/// ARM-specific type containing four `poly64x2_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct poly64x2x2_t(pub poly64x2_t, pub poly64x2_t);
+/// ARM-specific type containing four `poly64x2_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct poly64x2x3_t(pub poly64x2_t, pub poly64x2_t, pub poly64x2_t);
+/// ARM-specific type containing four `poly64x2_t` vectors.
+#[derive(Copy, Clone, Debug)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub struct poly64x2x4_t(
+ pub poly64x2_t,
+ pub poly64x2_t,
+ pub poly64x2_t,
+ pub poly64x2_t,
+);
+
+#[allow(improper_ctypes)]
+extern "unadjusted" {
+ // absolute value (64-bit)
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vabs.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.abs.v8i8")]
+ fn vabs_s8_(a: int8x8_t) -> int8x8_t;
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vabs.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.abs.v4i16")]
+ fn vabs_s16_(a: int16x4_t) -> int16x4_t;
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vabs.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.abs.v2i32")]
+ fn vabs_s32_(a: int32x2_t) -> int32x2_t;
+ // absolute value (128-bit)
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vabs.v16i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.abs.v16i8")]
+ fn vabsq_s8_(a: int8x16_t) -> int8x16_t;
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vabs.v8i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.abs.v8i16")]
+ fn vabsq_s16_(a: int16x8_t) -> int16x8_t;
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vabs.v4i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.abs.v4i32")]
+ fn vabsq_s32_(a: int32x4_t) -> int32x4_t;
+
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vpmins.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sminp.v8i8")]
+ fn vpmins_v8i8(a: int8x8_t, b: int8x8_t) -> int8x8_t;
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vpmins.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sminp.v4i16")]
+ fn vpmins_v4i16(a: int16x4_t, b: int16x4_t) -> int16x4_t;
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vpmins.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sminp.v2i32")]
+ fn vpmins_v2i32(a: int32x2_t, b: int32x2_t) -> int32x2_t;
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vpminu.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uminp.v8i8")]
+ fn vpminu_v8i8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t;
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vpminu.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uminp.v4i16")]
+ fn vpminu_v4i16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t;
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vpminu.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uminp.v2i32")]
+ fn vpminu_v2i32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t;
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vpmins.v2f32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fminp.v2f32")]
+ fn vpminf_v2f32(a: float32x2_t, b: float32x2_t) -> float32x2_t;
+
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vpmaxs.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.smaxp.v8i8")]
+ fn vpmaxs_v8i8(a: int8x8_t, b: int8x8_t) -> int8x8_t;
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vpmaxs.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.smaxp.v4i16")]
+ fn vpmaxs_v4i16(a: int16x4_t, b: int16x4_t) -> int16x4_t;
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vpmaxs.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.smaxp.v2i32")]
+ fn vpmaxs_v2i32(a: int32x2_t, b: int32x2_t) -> int32x2_t;
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vpmaxu.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.umaxp.v8i8")]
+ fn vpmaxu_v8i8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t;
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vpmaxu.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.umaxp.v4i16")]
+ fn vpmaxu_v4i16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t;
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vpmaxu.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.umaxp.v2i32")]
+ fn vpmaxu_v2i32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t;
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vpmaxs.v2f32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fmaxp.v2f32")]
+ fn vpmaxf_v2f32(a: float32x2_t, b: float32x2_t) -> float32x2_t;
+
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vraddhn.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.raddhn.v8i8")]
+ fn vraddhn_s16_(a: int16x8_t, b: int16x8_t) -> int8x8_t;
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vraddhn.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.raddhn.v4i16")]
+ fn vraddhn_s32_(a: int32x4_t, b: int32x4_t) -> int16x4_t;
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vraddhn.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.raddhn.v2i32")]
+ fn vraddhn_s64_(a: int64x2_t, b: int64x2_t) -> int32x2_t;
+
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vpadd.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.addp.v4i16")]
+ fn vpadd_s16_(a: int16x4_t, b: int16x4_t) -> int16x4_t;
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vpadd.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.addp.v2i32")]
+ fn vpadd_s32_(a: int32x2_t, b: int32x2_t) -> int32x2_t;
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vpadd.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.addp.v8i8")]
+ fn vpadd_s8_(a: int8x8_t, b: int8x8_t) -> int8x8_t;
+
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vpaddls.v4i16.v8i8")]
+ #[cfg_attr(
+ target_arch = "aarch64",
+ link_name = "llvm.aarch64.neon.saddlp.v4i16.v8i8"
+ )]
+ pub(crate) fn vpaddl_s8_(a: int8x8_t) -> int16x4_t;
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vpaddls.v2i32.v4i16")]
+ #[cfg_attr(
+ target_arch = "aarch64",
+ link_name = "llvm.aarch64.neon.saddlp.v2i32.v4i16"
+ )]
+ pub(crate) fn vpaddl_s16_(a: int16x4_t) -> int32x2_t;
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vpaddls.v1i64.v2i32")]
+ #[cfg_attr(
+ target_arch = "aarch64",
+ link_name = "llvm.aarch64.neon.saddlp.v1i64.v2i32"
+ )]
+ pub(crate) fn vpaddl_s32_(a: int32x2_t) -> int64x1_t;
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vpaddls.v8i16.v16i8")]
+ #[cfg_attr(
+ target_arch = "aarch64",
+ link_name = "llvm.aarch64.neon.saddlp.v8i16.v16i8"
+ )]
+ pub(crate) fn vpaddlq_s8_(a: int8x16_t) -> int16x8_t;
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vpaddls.v4i32.v8i16")]
+ #[cfg_attr(
+ target_arch = "aarch64",
+ link_name = "llvm.aarch64.neon.saddlp.v4i32.v8i16"
+ )]
+ pub(crate) fn vpaddlq_s16_(a: int16x8_t) -> int32x4_t;
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vpaddls.v2i64.v4i32")]
+ #[cfg_attr(
+ target_arch = "aarch64",
+ link_name = "llvm.aarch64.neon.saddlp.v2i64.v4i32"
+ )]
+ pub(crate) fn vpaddlq_s32_(a: int32x4_t) -> int64x2_t;
+
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vpaddlu.v4i16.v8i8")]
+ #[cfg_attr(
+ target_arch = "aarch64",
+ link_name = "llvm.aarch64.neon.uaddlp.v4i16.v8i8"
+ )]
+ pub(crate) fn vpaddl_u8_(a: uint8x8_t) -> uint16x4_t;
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vpaddlu.v2i32.v4i16")]
+ #[cfg_attr(
+ target_arch = "aarch64",
+ link_name = "llvm.aarch64.neon.uaddlp.v2i32.v4i16"
+ )]
+ pub(crate) fn vpaddl_u16_(a: uint16x4_t) -> uint32x2_t;
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vpaddlu.v1i64.v2i32")]
+ #[cfg_attr(
+ target_arch = "aarch64",
+ link_name = "llvm.aarch64.neon.uaddlp.v1i64.v2i32"
+ )]
+ pub(crate) fn vpaddl_u32_(a: uint32x2_t) -> uint64x1_t;
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vpaddlu.v8i16.v16i8")]
+ #[cfg_attr(
+ target_arch = "aarch64",
+ link_name = "llvm.aarch64.neon.uaddlp.v8i16.v16i8"
+ )]
+ pub(crate) fn vpaddlq_u8_(a: uint8x16_t) -> uint16x8_t;
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vpaddlu.v4i32.v8i16")]
+ #[cfg_attr(
+ target_arch = "aarch64",
+ link_name = "llvm.aarch64.neon.uaddlp.v4i32.v8i16"
+ )]
+ pub(crate) fn vpaddlq_u16_(a: uint16x8_t) -> uint32x4_t;
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vpaddlu.v2i64.v4i32")]
+ #[cfg_attr(
+ target_arch = "aarch64",
+ link_name = "llvm.aarch64.neon.uaddlp.v2i64.v4i32"
+ )]
+ pub(crate) fn vpaddlq_u32_(a: uint32x4_t) -> uint64x2_t;
+
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.ctpop.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.ctpop.v8i8")]
+ fn vcnt_s8_(a: int8x8_t) -> int8x8_t;
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.ctpop.v16i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.ctpop.v16i8")]
+ fn vcntq_s8_(a: int8x16_t) -> int8x16_t;
+
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.ctlz.v8i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.ctlz.v8i8")]
+ fn vclz_s8_(a: int8x8_t) -> int8x8_t;
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.ctlz.v16i8")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.ctlz.v16i8")]
+ fn vclzq_s8_(a: int8x16_t) -> int8x16_t;
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.ctlz.v4i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.ctlz.v4i16")]
+ fn vclz_s16_(a: int16x4_t) -> int16x4_t;
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.ctlz.v8i16")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.ctlz.v8i16")]
+ fn vclzq_s16_(a: int16x8_t) -> int16x8_t;
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.ctlz.v2i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.ctlz.v2i32")]
+ fn vclz_s32_(a: int32x2_t) -> int32x2_t;
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.ctlz.v4i32")]
+ #[cfg_attr(target_arch = "aarch64", link_name = "llvm.ctlz.v4i32")]
+ fn vclzq_s32_(a: int32x4_t) -> int32x4_t;
+}
+
+/// Load one single-element structure to one lane of one register.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.8", LANE = 7))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1, LANE = 7))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1_lane_s8<const LANE: i32>(ptr: *const i8, src: int8x8_t) -> int8x8_t {
+ static_assert_imm3!(LANE);
+ simd_insert(src, LANE as u32, *ptr)
+}
+
+/// Load one single-element structure to one lane of one register.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.8", LANE = 15))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1, LANE = 15))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1q_lane_s8<const LANE: i32>(ptr: *const i8, src: int8x16_t) -> int8x16_t {
+ static_assert_imm4!(LANE);
+ simd_insert(src, LANE as u32, *ptr)
+}
+
+/// Load one single-element structure to one lane of one register.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.16", LANE = 3))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1, LANE = 3))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1_lane_s16<const LANE: i32>(ptr: *const i16, src: int16x4_t) -> int16x4_t {
+ static_assert_imm2!(LANE);
+ simd_insert(src, LANE as u32, *ptr)
+}
+
+/// Load one single-element structure to one lane of one register.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.16", LANE = 7))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1, LANE = 7))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1q_lane_s16<const LANE: i32>(ptr: *const i16, src: int16x8_t) -> int16x8_t {
+ static_assert_imm3!(LANE);
+ simd_insert(src, LANE as u32, *ptr)
+}
+
+/// Load one single-element structure to one lane of one register.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.32", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1, LANE = 1))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1_lane_s32<const LANE: i32>(ptr: *const i32, src: int32x2_t) -> int32x2_t {
+ static_assert_imm1!(LANE);
+ simd_insert(src, LANE as u32, *ptr)
+}
+
+/// Load one single-element structure to one lane of one register.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.32", LANE = 3))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1, LANE = 3))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1q_lane_s32<const LANE: i32>(ptr: *const i32, src: int32x4_t) -> int32x4_t {
+ static_assert_imm2!(LANE);
+ simd_insert(src, LANE as u32, *ptr)
+}
+
+/// Load one single-element structure to one lane of one register.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vldr", LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ldr, LANE = 0))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1_lane_s64<const LANE: i32>(ptr: *const i64, src: int64x1_t) -> int64x1_t {
+ static_assert!(LANE : i32 where LANE == 0);
+ simd_insert(src, LANE as u32, *ptr)
+}
+
+/// Load one single-element structure to one lane of one register.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vldr", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1, LANE = 1))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1q_lane_s64<const LANE: i32>(ptr: *const i64, src: int64x2_t) -> int64x2_t {
+ static_assert_imm1!(LANE);
+ simd_insert(src, LANE as u32, *ptr)
+}
+
+/// Load one single-element structure to one lane of one register.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.8", LANE = 7))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1, LANE = 7))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1_lane_u8<const LANE: i32>(ptr: *const u8, src: uint8x8_t) -> uint8x8_t {
+ static_assert_imm3!(LANE);
+ simd_insert(src, LANE as u32, *ptr)
+}
+
+/// Load one single-element structure to one lane of one register.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.8", LANE = 15))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1, LANE = 15))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1q_lane_u8<const LANE: i32>(ptr: *const u8, src: uint8x16_t) -> uint8x16_t {
+ static_assert_imm4!(LANE);
+ simd_insert(src, LANE as u32, *ptr)
+}
+
+/// Load one single-element structure to one lane of one register.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.16", LANE = 3))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1, LANE = 3))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1_lane_u16<const LANE: i32>(ptr: *const u16, src: uint16x4_t) -> uint16x4_t {
+ static_assert_imm2!(LANE);
+ simd_insert(src, LANE as u32, *ptr)
+}
+
+/// Load one single-element structure to one lane of one register.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.16", LANE = 7))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1, LANE = 7))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1q_lane_u16<const LANE: i32>(ptr: *const u16, src: uint16x8_t) -> uint16x8_t {
+ static_assert_imm3!(LANE);
+ simd_insert(src, LANE as u32, *ptr)
+}
+
+/// Load one single-element structure to one lane of one register.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.32", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1, LANE = 1))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1_lane_u32<const LANE: i32>(ptr: *const u32, src: uint32x2_t) -> uint32x2_t {
+ static_assert_imm1!(LANE);
+ simd_insert(src, LANE as u32, *ptr)
+}
+
+/// Load one single-element structure to one lane of one register.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.32", LANE = 3))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1, LANE = 3))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1q_lane_u32<const LANE: i32>(ptr: *const u32, src: uint32x4_t) -> uint32x4_t {
+ static_assert_imm2!(LANE);
+ simd_insert(src, LANE as u32, *ptr)
+}
+
+/// Load one single-element structure to one lane of one register.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vldr", LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ldr, LANE = 0))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1_lane_u64<const LANE: i32>(ptr: *const u64, src: uint64x1_t) -> uint64x1_t {
+ static_assert!(LANE : i32 where LANE == 0);
+ simd_insert(src, LANE as u32, *ptr)
+}
+
+/// Load one single-element structure to one lane of one register.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vldr", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1, LANE = 1))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1q_lane_u64<const LANE: i32>(ptr: *const u64, src: uint64x2_t) -> uint64x2_t {
+ static_assert_imm1!(LANE);
+ simd_insert(src, LANE as u32, *ptr)
+}
+
+/// Load one single-element structure to one lane of one register.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.8", LANE = 7))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1, LANE = 7))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1_lane_p8<const LANE: i32>(ptr: *const p8, src: poly8x8_t) -> poly8x8_t {
+ static_assert_imm3!(LANE);
+ simd_insert(src, LANE as u32, *ptr)
+}
+
+/// Load one single-element structure to one lane of one register.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.8", LANE = 15))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1, LANE = 15))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1q_lane_p8<const LANE: i32>(ptr: *const p8, src: poly8x16_t) -> poly8x16_t {
+ static_assert_imm4!(LANE);
+ simd_insert(src, LANE as u32, *ptr)
+}
+
+/// Load one single-element structure to one lane of one register.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.16", LANE = 3))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1, LANE = 3))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1_lane_p16<const LANE: i32>(ptr: *const p16, src: poly16x4_t) -> poly16x4_t {
+ static_assert_imm2!(LANE);
+ simd_insert(src, LANE as u32, *ptr)
+}
+
+/// Load one single-element structure to one lane of one register.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.16", LANE = 7))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1, LANE = 7))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1q_lane_p16<const LANE: i32>(ptr: *const p16, src: poly16x8_t) -> poly16x8_t {
+ static_assert_imm3!(LANE);
+ simd_insert(src, LANE as u32, *ptr)
+}
+
+/// Load one single-element structure to one lane of one register.
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vldr", LANE = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ldr, LANE = 0))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1_lane_p64<const LANE: i32>(ptr: *const p64, src: poly64x1_t) -> poly64x1_t {
+ static_assert!(LANE : i32 where LANE == 0);
+ simd_insert(src, LANE as u32, *ptr)
+}
+
+/// Load one single-element structure to one lane of one register.
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vldr", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1, LANE = 1))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1q_lane_p64<const LANE: i32>(ptr: *const p64, src: poly64x2_t) -> poly64x2_t {
+ static_assert_imm1!(LANE);
+ simd_insert(src, LANE as u32, *ptr)
+}
+
+/// Load one single-element structure to one lane of one register.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.32", LANE = 1))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1, LANE = 1))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1_lane_f32<const LANE: i32>(ptr: *const f32, src: float32x2_t) -> float32x2_t {
+ static_assert_imm1!(LANE);
+ simd_insert(src, LANE as u32, *ptr)
+}
+
+/// Load one single-element structure to one lane of one register.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.32", LANE = 3))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1, LANE = 3))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1q_lane_f32<const LANE: i32>(ptr: *const f32, src: float32x4_t) -> float32x4_t {
+ static_assert_imm2!(LANE);
+ simd_insert(src, LANE as u32, *ptr)
+}
+
+/// Load one single-element structure and Replicate to all lanes (of one register).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1r))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1_dup_s8(ptr: *const i8) -> int8x8_t {
+ let x = vld1_lane_s8::<0>(ptr, transmute(i8x8::splat(0)));
+ simd_shuffle8!(x, x, [0, 0, 0, 0, 0, 0, 0, 0])
+}
+
+/// Load one single-element structure and Replicate to all lanes (of one register).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1r))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1q_dup_s8(ptr: *const i8) -> int8x16_t {
+ let x = vld1q_lane_s8::<0>(ptr, transmute(i8x16::splat(0)));
+ simd_shuffle16!(x, x, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
+}
+
+/// Load one single-element structure and Replicate to all lanes (of one register).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1r))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1_dup_s16(ptr: *const i16) -> int16x4_t {
+ let x = vld1_lane_s16::<0>(ptr, transmute(i16x4::splat(0)));
+ simd_shuffle4!(x, x, [0, 0, 0, 0])
+}
+
+/// Load one single-element structure and Replicate to all lanes (of one register).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1r))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1q_dup_s16(ptr: *const i16) -> int16x8_t {
+ let x = vld1q_lane_s16::<0>(ptr, transmute(i16x8::splat(0)));
+ simd_shuffle8!(x, x, [0, 0, 0, 0, 0, 0, 0, 0])
+}
+
+/// Load one single-element structure and Replicate to all lanes (of one register).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1r))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1_dup_s32(ptr: *const i32) -> int32x2_t {
+ let x = vld1_lane_s32::<0>(ptr, transmute(i32x2::splat(0)));
+ simd_shuffle2!(x, x, [0, 0])
+}
+
+/// Load one single-element structure and Replicate to all lanes (of one register).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1r))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1q_dup_s32(ptr: *const i32) -> int32x4_t {
+ let x = vld1q_lane_s32::<0>(ptr, transmute(i32x4::splat(0)));
+ simd_shuffle4!(x, x, [0, 0, 0, 0])
+}
+
+/// Load one single-element structure and Replicate to all lanes (of one register).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vldr"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ldr))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1_dup_s64(ptr: *const i64) -> int64x1_t {
+ #[cfg(target_arch = "aarch64")]
+ {
+ crate::core_arch::aarch64::vld1_s64(ptr)
+ }
+ #[cfg(target_arch = "arm")]
+ {
+ crate::core_arch::arm::vld1_s64(ptr)
+ }
+}
+
+/// Load one single-element structure and Replicate to all lanes (of one register).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vldr"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1r))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1q_dup_s64(ptr: *const i64) -> int64x2_t {
+ let x = vld1q_lane_s64::<0>(ptr, transmute(i64x2::splat(0)));
+ simd_shuffle2!(x, x, [0, 0])
+}
+
+/// Load one single-element structure and Replicate to all lanes (of one register).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1r))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1_dup_u8(ptr: *const u8) -> uint8x8_t {
+ let x = vld1_lane_u8::<0>(ptr, transmute(u8x8::splat(0)));
+ simd_shuffle8!(x, x, [0, 0, 0, 0, 0, 0, 0, 0])
+}
+
+/// Load one single-element structure and Replicate to all lanes (of one register).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1r))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1q_dup_u8(ptr: *const u8) -> uint8x16_t {
+ let x = vld1q_lane_u8::<0>(ptr, transmute(u8x16::splat(0)));
+ simd_shuffle16!(x, x, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
+}
+
+/// Load one single-element structure and Replicate to all lanes (of one register).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1r))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1_dup_u16(ptr: *const u16) -> uint16x4_t {
+ let x = vld1_lane_u16::<0>(ptr, transmute(u16x4::splat(0)));
+ simd_shuffle4!(x, x, [0, 0, 0, 0])
+}
+
+/// Load one single-element structure and Replicate to all lanes (of one register).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1r))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1q_dup_u16(ptr: *const u16) -> uint16x8_t {
+ let x = vld1q_lane_u16::<0>(ptr, transmute(u16x8::splat(0)));
+ simd_shuffle8!(x, x, [0, 0, 0, 0, 0, 0, 0, 0])
+}
+
+/// Load one single-element structure and Replicate to all lanes (of one register).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1r))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1_dup_u32(ptr: *const u32) -> uint32x2_t {
+ let x = vld1_lane_u32::<0>(ptr, transmute(u32x2::splat(0)));
+ simd_shuffle2!(x, x, [0, 0])
+}
+
+/// Load one single-element structure and Replicate to all lanes (of one register).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1r))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1q_dup_u32(ptr: *const u32) -> uint32x4_t {
+ let x = vld1q_lane_u32::<0>(ptr, transmute(u32x4::splat(0)));
+ simd_shuffle4!(x, x, [0, 0, 0, 0])
+}
+
+/// Load one single-element structure and Replicate to all lanes (of one register).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vldr"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ldr))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1_dup_u64(ptr: *const u64) -> uint64x1_t {
+ #[cfg(target_arch = "aarch64")]
+ {
+ crate::core_arch::aarch64::vld1_u64(ptr)
+ }
+ #[cfg(target_arch = "arm")]
+ {
+ crate::core_arch::arm::vld1_u64(ptr)
+ }
+}
+
+/// Load one single-element structure and Replicate to all lanes (of one register).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vldr"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1r))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1q_dup_u64(ptr: *const u64) -> uint64x2_t {
+ let x = vld1q_lane_u64::<0>(ptr, transmute(u64x2::splat(0)));
+ simd_shuffle2!(x, x, [0, 0])
+}
+
+/// Load one single-element structure and Replicate to all lanes (of one register).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1r))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1_dup_p8(ptr: *const p8) -> poly8x8_t {
+ let x = vld1_lane_p8::<0>(ptr, transmute(u8x8::splat(0)));
+ simd_shuffle8!(x, x, [0, 0, 0, 0, 0, 0, 0, 0])
+}
+
+/// Load one single-element structure and Replicate to all lanes (of one register).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1r))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1q_dup_p8(ptr: *const p8) -> poly8x16_t {
+ let x = vld1q_lane_p8::<0>(ptr, transmute(u8x16::splat(0)));
+ simd_shuffle16!(x, x, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
+}
+
+/// Load one single-element structure and Replicate to all lanes (of one register).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1r))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1_dup_p16(ptr: *const p16) -> poly16x4_t {
+ let x = vld1_lane_p16::<0>(ptr, transmute(u16x4::splat(0)));
+ simd_shuffle4!(x, x, [0, 0, 0, 0])
+}
+
+/// Load one single-element structure and Replicate to all lanes (of one register).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1r))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1q_dup_p16(ptr: *const p16) -> poly16x8_t {
+ let x = vld1q_lane_p16::<0>(ptr, transmute(u16x8::splat(0)));
+ simd_shuffle8!(x, x, [0, 0, 0, 0, 0, 0, 0, 0])
+}
+
+/// Load one single-element structure and Replicate to all lanes (of one register).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1r))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1_dup_f32(ptr: *const f32) -> float32x2_t {
+ let x = vld1_lane_f32::<0>(ptr, transmute(f32x2::splat(0.)));
+ simd_shuffle2!(x, x, [0, 0])
+}
+
+/// Load one single-element structure and Replicate to all lanes (of one register).
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vldr"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ldr))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1_dup_p64(ptr: *const p64) -> poly64x1_t {
+ #[cfg(target_arch = "aarch64")]
+ {
+ crate::core_arch::aarch64::vld1_p64(ptr)
+ }
+ #[cfg(target_arch = "arm")]
+ {
+ crate::core_arch::arm::vld1_p64(ptr)
+ }
+}
+
+/// Load one single-element structure and Replicate to all lanes (of one register).
+#[inline]
+#[target_feature(enable = "neon,aes")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vldr"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1r))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1q_dup_p64(ptr: *const p64) -> poly64x2_t {
+ let x = vld1q_lane_p64::<0>(ptr, transmute(u64x2::splat(0)));
+ simd_shuffle2!(x, x, [0, 0])
+}
+
+/// Load one single-element structure and Replicate to all lanes (of one register).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ld1r))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vld1q_dup_f32(ptr: *const f32) -> float32x4_t {
+ let x = vld1q_lane_f32::<0>(ptr, transmute(f32x4::splat(0.)));
+ simd_shuffle4!(x, x, [0, 0, 0, 0])
+}
+
+// signed absolute difference and accumulate (64-bit)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vaba.s8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr("saba"))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaba_s8(a: int8x8_t, b: int8x8_t, c: int8x8_t) -> int8x8_t {
+ simd_add(a, vabd_s8(b, c))
+}
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vaba.s16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr("saba"))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaba_s16(a: int16x4_t, b: int16x4_t, c: int16x4_t) -> int16x4_t {
+ simd_add(a, vabd_s16(b, c))
+}
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vaba.s32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr("saba"))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaba_s32(a: int32x2_t, b: int32x2_t, c: int32x2_t) -> int32x2_t {
+ simd_add(a, vabd_s32(b, c))
+}
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vaba.u8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr("uaba"))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaba_u8(a: uint8x8_t, b: uint8x8_t, c: uint8x8_t) -> uint8x8_t {
+ simd_add(a, vabd_u8(b, c))
+}
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vaba.u16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr("uaba"))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaba_u16(a: uint16x4_t, b: uint16x4_t, c: uint16x4_t) -> uint16x4_t {
+ simd_add(a, vabd_u16(b, c))
+}
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vaba.u32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr("uaba"))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaba_u32(a: uint32x2_t, b: uint32x2_t, c: uint32x2_t) -> uint32x2_t {
+ simd_add(a, vabd_u32(b, c))
+}
+// signed absolute difference and accumulate (128-bit)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vaba.s8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr("saba"))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vabaq_s8(a: int8x16_t, b: int8x16_t, c: int8x16_t) -> int8x16_t {
+ simd_add(a, vabdq_s8(b, c))
+}
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vaba.s16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr("saba"))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vabaq_s16(a: int16x8_t, b: int16x8_t, c: int16x8_t) -> int16x8_t {
+ simd_add(a, vabdq_s16(b, c))
+}
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vaba.s32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr("saba"))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vabaq_s32(a: int32x4_t, b: int32x4_t, c: int32x4_t) -> int32x4_t {
+ simd_add(a, vabdq_s32(b, c))
+}
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vaba.u8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr("uaba"))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vabaq_u8(a: uint8x16_t, b: uint8x16_t, c: uint8x16_t) -> uint8x16_t {
+ simd_add(a, vabdq_u8(b, c))
+}
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vaba.u16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr("uaba"))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vabaq_u16(a: uint16x8_t, b: uint16x8_t, c: uint16x8_t) -> uint16x8_t {
+ simd_add(a, vabdq_u16(b, c))
+}
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vaba.u32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr("uaba"))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vabaq_u32(a: uint32x4_t, b: uint32x4_t, c: uint32x4_t) -> uint32x4_t {
+ simd_add(a, vabdq_u32(b, c))
+}
+
+/// Absolute value (wrapping).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vabs))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(abs))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vabs_s8(a: int8x8_t) -> int8x8_t {
+ vabs_s8_(a)
+}
+/// Absolute value (wrapping).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vabs))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(abs))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vabs_s16(a: int16x4_t) -> int16x4_t {
+ vabs_s16_(a)
+}
+/// Absolute value (wrapping).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vabs))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(abs))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vabs_s32(a: int32x2_t) -> int32x2_t {
+ vabs_s32_(a)
+}
+/// Absolute value (wrapping).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vabs))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(abs))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vabsq_s8(a: int8x16_t) -> int8x16_t {
+ vabsq_s8_(a)
+}
+/// Absolute value (wrapping).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vabs))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(abs))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vabsq_s16(a: int16x8_t) -> int16x8_t {
+ vabsq_s16_(a)
+}
+/// Absolute value (wrapping).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vabs))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(abs))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vabsq_s32(a: int32x4_t) -> int32x4_t {
+ vabsq_s32_(a)
+}
+
+/// Add pairwise.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpadd))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(addp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpadd_s16(a: int16x4_t, b: int16x4_t) -> int16x4_t {
+ vpadd_s16_(a, b)
+}
+/// Add pairwise.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpadd))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(addp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpadd_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t {
+ vpadd_s32_(a, b)
+}
+/// Add pairwise.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpadd))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(addp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpadd_s8(a: int8x8_t, b: int8x8_t) -> int8x8_t {
+ vpadd_s8_(a, b)
+}
+/// Add pairwise.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpadd))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(addp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpadd_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t {
+ transmute(vpadd_s16_(transmute(a), transmute(b)))
+}
+/// Add pairwise.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpadd))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(addp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpadd_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t {
+ transmute(vpadd_s32_(transmute(a), transmute(b)))
+}
+/// Add pairwise.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpadd))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(addp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpadd_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t {
+ transmute(vpadd_s8_(transmute(a), transmute(b)))
+}
+
+/// Vector add.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vadd))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(add))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vadd_s8(a: int8x8_t, b: int8x8_t) -> int8x8_t {
+ simd_add(a, b)
+}
+
+/// Vector add.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vadd))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(add))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddq_s8(a: int8x16_t, b: int8x16_t) -> int8x16_t {
+ simd_add(a, b)
+}
+
+/// Vector add.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vadd))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(add))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vadd_s16(a: int16x4_t, b: int16x4_t) -> int16x4_t {
+ simd_add(a, b)
+}
+
+/// Vector add.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vadd))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(add))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddq_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t {
+ simd_add(a, b)
+}
+
+/// Vector add.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vadd))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(add))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vadd_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t {
+ simd_add(a, b)
+}
+
+/// Vector add.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vadd))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(add))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddq_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t {
+ simd_add(a, b)
+}
+
+/// Vector add.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vadd))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(add))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddq_s64(a: int64x2_t, b: int64x2_t) -> int64x2_t {
+ simd_add(a, b)
+}
+
+/// Vector add.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vadd))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(add))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vadd_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t {
+ simd_add(a, b)
+}
+
+/// Vector add.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vadd))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(add))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddq_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t {
+ simd_add(a, b)
+}
+
+/// Vector add.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vadd))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(add))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vadd_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t {
+ simd_add(a, b)
+}
+
+/// Vector add.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vadd))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(add))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddq_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t {
+ simd_add(a, b)
+}
+
+/// Vector add.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vadd))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(add))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vadd_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t {
+ simd_add(a, b)
+}
+
+/// Vector add.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vadd))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(add))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
+ simd_add(a, b)
+}
+
+/// Vector add.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vadd))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(add))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddq_u64(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t {
+ simd_add(a, b)
+}
+
+/// Vector add.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vadd))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fadd))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vadd_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t {
+ simd_add(a, b)
+}
+
+/// Vector add.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vadd))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fadd))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddq_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t {
+ simd_add(a, b)
+}
+
+/// Signed Add Long (vector).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vaddl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(saddl))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddl_s8(a: int8x8_t, b: int8x8_t) -> int16x8_t {
+ let a: int16x8_t = simd_cast(a);
+ let b: int16x8_t = simd_cast(b);
+ simd_add(a, b)
+}
+
+/// Signed Add Long (vector).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vaddl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(saddl))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddl_s16(a: int16x4_t, b: int16x4_t) -> int32x4_t {
+ let a: int32x4_t = simd_cast(a);
+ let b: int32x4_t = simd_cast(b);
+ simd_add(a, b)
+}
+
+/// Signed Add Long (vector).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vaddl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(saddl))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddl_s32(a: int32x2_t, b: int32x2_t) -> int64x2_t {
+ let a: int64x2_t = simd_cast(a);
+ let b: int64x2_t = simd_cast(b);
+ simd_add(a, b)
+}
+
+/// Unsigned Add Long (vector).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vaddl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uaddl))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddl_u8(a: uint8x8_t, b: uint8x8_t) -> uint16x8_t {
+ let a: uint16x8_t = simd_cast(a);
+ let b: uint16x8_t = simd_cast(b);
+ simd_add(a, b)
+}
+
+/// Unsigned Add Long (vector).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vaddl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uaddl))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddl_u16(a: uint16x4_t, b: uint16x4_t) -> uint32x4_t {
+ let a: uint32x4_t = simd_cast(a);
+ let b: uint32x4_t = simd_cast(b);
+ simd_add(a, b)
+}
+
+/// Unsigned Add Long (vector).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vaddl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uaddl))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddl_u32(a: uint32x2_t, b: uint32x2_t) -> uint64x2_t {
+ let a: uint64x2_t = simd_cast(a);
+ let b: uint64x2_t = simd_cast(b);
+ simd_add(a, b)
+}
+
+/// Signed Add Long (vector, high half).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vaddl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(saddl2))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddl_high_s8(a: int8x16_t, b: int8x16_t) -> int16x8_t {
+ let a: int8x8_t = simd_shuffle8!(a, a, [8, 9, 10, 11, 12, 13, 14, 15]);
+ let b: int8x8_t = simd_shuffle8!(b, b, [8, 9, 10, 11, 12, 13, 14, 15]);
+ let a: int16x8_t = simd_cast(a);
+ let b: int16x8_t = simd_cast(b);
+ simd_add(a, b)
+}
+
+/// Signed Add Long (vector, high half).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vaddl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(saddl2))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddl_high_s16(a: int16x8_t, b: int16x8_t) -> int32x4_t {
+ let a: int16x4_t = simd_shuffle4!(a, a, [4, 5, 6, 7]);
+ let b: int16x4_t = simd_shuffle4!(b, b, [4, 5, 6, 7]);
+ let a: int32x4_t = simd_cast(a);
+ let b: int32x4_t = simd_cast(b);
+ simd_add(a, b)
+}
+
+/// Signed Add Long (vector, high half).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vaddl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(saddl2))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddl_high_s32(a: int32x4_t, b: int32x4_t) -> int64x2_t {
+ let a: int32x2_t = simd_shuffle2!(a, a, [2, 3]);
+ let b: int32x2_t = simd_shuffle2!(b, b, [2, 3]);
+ let a: int64x2_t = simd_cast(a);
+ let b: int64x2_t = simd_cast(b);
+ simd_add(a, b)
+}
+
+/// Unsigned Add Long (vector, high half).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vaddl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uaddl2))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddl_high_u8(a: uint8x16_t, b: uint8x16_t) -> uint16x8_t {
+ let a: uint8x8_t = simd_shuffle8!(a, a, [8, 9, 10, 11, 12, 13, 14, 15]);
+ let b: uint8x8_t = simd_shuffle8!(b, b, [8, 9, 10, 11, 12, 13, 14, 15]);
+ let a: uint16x8_t = simd_cast(a);
+ let b: uint16x8_t = simd_cast(b);
+ simd_add(a, b)
+}
+
+/// Unsigned Add Long (vector, high half).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vaddl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uaddl2))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddl_high_u16(a: uint16x8_t, b: uint16x8_t) -> uint32x4_t {
+ let a: uint16x4_t = simd_shuffle4!(a, a, [4, 5, 6, 7]);
+ let b: uint16x4_t = simd_shuffle4!(b, b, [4, 5, 6, 7]);
+ let a: uint32x4_t = simd_cast(a);
+ let b: uint32x4_t = simd_cast(b);
+ simd_add(a, b)
+}
+
+/// Unsigned Add Long (vector, high half).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vaddl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uaddl2))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddl_high_u32(a: uint32x4_t, b: uint32x4_t) -> uint64x2_t {
+ let a: uint32x2_t = simd_shuffle2!(a, a, [2, 3]);
+ let b: uint32x2_t = simd_shuffle2!(b, b, [2, 3]);
+ let a: uint64x2_t = simd_cast(a);
+ let b: uint64x2_t = simd_cast(b);
+ simd_add(a, b)
+}
+
+/// Signed Add Wide.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vaddw))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(saddw))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddw_s8(a: int16x8_t, b: int8x8_t) -> int16x8_t {
+ let b: int16x8_t = simd_cast(b);
+ simd_add(a, b)
+}
+
+/// Signed Add Wide.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vaddw))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(saddw))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddw_s16(a: int32x4_t, b: int16x4_t) -> int32x4_t {
+ let b: int32x4_t = simd_cast(b);
+ simd_add(a, b)
+}
+
+/// Signed Add Wide.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vaddw))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(saddw))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddw_s32(a: int64x2_t, b: int32x2_t) -> int64x2_t {
+ let b: int64x2_t = simd_cast(b);
+ simd_add(a, b)
+}
+
+/// Unsigned Add Wide.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vaddw))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uaddw))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddw_u8(a: uint16x8_t, b: uint8x8_t) -> uint16x8_t {
+ let b: uint16x8_t = simd_cast(b);
+ simd_add(a, b)
+}
+
+/// Unsigned Add Wide.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vaddw))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uaddw))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddw_u16(a: uint32x4_t, b: uint16x4_t) -> uint32x4_t {
+ let b: uint32x4_t = simd_cast(b);
+ simd_add(a, b)
+}
+
+/// Unsigned Add Wide.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vaddw))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uaddw))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddw_u32(a: uint64x2_t, b: uint32x2_t) -> uint64x2_t {
+ let b: uint64x2_t = simd_cast(b);
+ simd_add(a, b)
+}
+
+/// Signed Add Wide (high half).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vaddw))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(saddw2))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddw_high_s8(a: int16x8_t, b: int8x16_t) -> int16x8_t {
+ let b: int8x8_t = simd_shuffle8!(b, b, [8, 9, 10, 11, 12, 13, 14, 15]);
+ let b: int16x8_t = simd_cast(b);
+ simd_add(a, b)
+}
+
+/// Signed Add Wide (high half).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vaddw))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(saddw2))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddw_high_s16(a: int32x4_t, b: int16x8_t) -> int32x4_t {
+ let b: int16x4_t = simd_shuffle4!(b, b, [4, 5, 6, 7]);
+ let b: int32x4_t = simd_cast(b);
+ simd_add(a, b)
+}
+
+/// Signed Add Wide (high half).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vaddw))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(saddw2))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddw_high_s32(a: int64x2_t, b: int32x4_t) -> int64x2_t {
+ let b: int32x2_t = simd_shuffle2!(b, b, [2, 3]);
+ let b: int64x2_t = simd_cast(b);
+ simd_add(a, b)
+}
+
+/// Unsigned Add Wide (high half).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vaddw))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uaddw2))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddw_high_u8(a: uint16x8_t, b: uint8x16_t) -> uint16x8_t {
+ let b: uint8x8_t = simd_shuffle8!(b, b, [8, 9, 10, 11, 12, 13, 14, 15]);
+ let b: uint16x8_t = simd_cast(b);
+ simd_add(a, b)
+}
+
+/// Unsigned Add Wide (high half).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vaddw))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uaddw2))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddw_high_u16(a: uint32x4_t, b: uint16x8_t) -> uint32x4_t {
+ let b: uint16x4_t = simd_shuffle4!(b, b, [4, 5, 6, 7]);
+ let b: uint32x4_t = simd_cast(b);
+ simd_add(a, b)
+}
+
+/// Unsigned Add Wide (high half).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vaddw))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uaddw2))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddw_high_u32(a: uint64x2_t, b: uint32x4_t) -> uint64x2_t {
+ let b: uint32x2_t = simd_shuffle2!(b, b, [2, 3]);
+ let b: uint64x2_t = simd_cast(b);
+ simd_add(a, b)
+}
+
+/// Add returning High Narrow.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vaddhn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(addhn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddhn_s16(a: int16x8_t, b: int16x8_t) -> int8x8_t {
+ simd_cast(simd_shr(simd_add(a, b), int16x8_t(8, 8, 8, 8, 8, 8, 8, 8)))
+}
+
+/// Add returning High Narrow.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vaddhn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(addhn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddhn_s32(a: int32x4_t, b: int32x4_t) -> int16x4_t {
+ simd_cast(simd_shr(simd_add(a, b), int32x4_t(16, 16, 16, 16)))
+}
+
+/// Add returning High Narrow.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vaddhn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(addhn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddhn_s64(a: int64x2_t, b: int64x2_t) -> int32x2_t {
+ simd_cast(simd_shr(simd_add(a, b), int64x2_t(32, 32)))
+}
+
+/// Add returning High Narrow.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vaddhn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(addhn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddhn_u16(a: uint16x8_t, b: uint16x8_t) -> uint8x8_t {
+ simd_cast(simd_shr(simd_add(a, b), uint16x8_t(8, 8, 8, 8, 8, 8, 8, 8)))
+}
+
+/// Add returning High Narrow.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vaddhn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(addhn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddhn_u32(a: uint32x4_t, b: uint32x4_t) -> uint16x4_t {
+ simd_cast(simd_shr(simd_add(a, b), uint32x4_t(16, 16, 16, 16)))
+}
+
+/// Add returning High Narrow.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vaddhn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(addhn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddhn_u64(a: uint64x2_t, b: uint64x2_t) -> uint32x2_t {
+ simd_cast(simd_shr(simd_add(a, b), uint64x2_t(32, 32)))
+}
+
+/// Add returning High Narrow (high half).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vaddhn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(addhn2))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddhn_high_s16(r: int8x8_t, a: int16x8_t, b: int16x8_t) -> int8x16_t {
+ let x = simd_cast(simd_shr(simd_add(a, b), int16x8_t(8, 8, 8, 8, 8, 8, 8, 8)));
+ simd_shuffle16!(r, x, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15])
+}
+
+/// Add returning High Narrow (high half).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vaddhn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(addhn2))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddhn_high_s32(r: int16x4_t, a: int32x4_t, b: int32x4_t) -> int16x8_t {
+ let x = simd_cast(simd_shr(simd_add(a, b), int32x4_t(16, 16, 16, 16)));
+ simd_shuffle8!(r, x, [0, 1, 2, 3, 4, 5, 6, 7])
+}
+
+/// Add returning High Narrow (high half).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vaddhn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(addhn2))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddhn_high_s64(r: int32x2_t, a: int64x2_t, b: int64x2_t) -> int32x4_t {
+ let x = simd_cast(simd_shr(simd_add(a, b), int64x2_t(32, 32)));
+ simd_shuffle4!(r, x, [0, 1, 2, 3])
+}
+
+/// Add returning High Narrow (high half).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vaddhn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(addhn2))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddhn_high_u16(r: uint8x8_t, a: uint16x8_t, b: uint16x8_t) -> uint8x16_t {
+ let x = simd_cast(simd_shr(simd_add(a, b), uint16x8_t(8, 8, 8, 8, 8, 8, 8, 8)));
+ simd_shuffle16!(r, x, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15])
+}
+
+/// Add returning High Narrow (high half).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vaddhn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(addhn2))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddhn_high_u32(r: uint16x4_t, a: uint32x4_t, b: uint32x4_t) -> uint16x8_t {
+ let x = simd_cast(simd_shr(simd_add(a, b), uint32x4_t(16, 16, 16, 16)));
+ simd_shuffle8!(r, x, [0, 1, 2, 3, 4, 5, 6, 7])
+}
+
+/// Add returning High Narrow (high half).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vaddhn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(addhn2))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vaddhn_high_u64(r: uint32x2_t, a: uint64x2_t, b: uint64x2_t) -> uint32x4_t {
+ let x = simd_cast(simd_shr(simd_add(a, b), uint64x2_t(32, 32)));
+ simd_shuffle4!(r, x, [0, 1, 2, 3])
+}
+
+/// Rounding Add returning High Narrow.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vraddhn.i16))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(raddhn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vraddhn_s16(a: int16x8_t, b: int16x8_t) -> int8x8_t {
+ vraddhn_s16_(a, b)
+}
+
+/// Rounding Add returning High Narrow.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vraddhn.i32))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(raddhn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vraddhn_s32(a: int32x4_t, b: int32x4_t) -> int16x4_t {
+ vraddhn_s32_(a, b)
+}
+
+/// Rounding Add returning High Narrow.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vraddhn.i64))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(raddhn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vraddhn_s64(a: int64x2_t, b: int64x2_t) -> int32x2_t {
+ vraddhn_s64_(a, b)
+}
+
+/// Rounding Add returning High Narrow.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vraddhn.i16))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(raddhn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vraddhn_u16(a: uint16x8_t, b: uint16x8_t) -> uint8x8_t {
+ transmute(vraddhn_s16_(transmute(a), transmute(b)))
+}
+
+/// Rounding Add returning High Narrow.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vraddhn.i32))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(raddhn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vraddhn_u32(a: uint32x4_t, b: uint32x4_t) -> uint16x4_t {
+ transmute(vraddhn_s32_(transmute(a), transmute(b)))
+}
+
+/// Rounding Add returning High Narrow.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vraddhn.i64))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(raddhn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vraddhn_u64(a: uint64x2_t, b: uint64x2_t) -> uint32x2_t {
+ transmute(vraddhn_s64_(transmute(a), transmute(b)))
+}
+
+/// Rounding Add returning High Narrow (high half).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vraddhn.i16))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(raddhn2))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vraddhn_high_s16(r: int8x8_t, a: int16x8_t, b: int16x8_t) -> int8x16_t {
+ let x = vraddhn_s16_(a, b);
+ simd_shuffle16!(r, x, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15])
+}
+
+/// Rounding Add returning High Narrow (high half).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vraddhn.i32))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(raddhn2))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vraddhn_high_s32(r: int16x4_t, a: int32x4_t, b: int32x4_t) -> int16x8_t {
+ let x = vraddhn_s32_(a, b);
+ simd_shuffle8!(r, x, [0, 1, 2, 3, 4, 5, 6, 7])
+}
+
+/// Rounding Add returning High Narrow (high half).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vraddhn.i64))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(raddhn2))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vraddhn_high_s64(r: int32x2_t, a: int64x2_t, b: int64x2_t) -> int32x4_t {
+ let x = vraddhn_s64_(a, b);
+ simd_shuffle4!(r, x, [0, 1, 2, 3])
+}
+
+/// Rounding Add returning High Narrow (high half).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vraddhn.i16))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(raddhn2))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vraddhn_high_u16(r: uint8x8_t, a: uint16x8_t, b: uint16x8_t) -> uint8x16_t {
+ let x: uint8x8_t = transmute(vraddhn_s16_(transmute(a), transmute(b)));
+ simd_shuffle16!(r, x, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15])
+}
+
+/// Rounding Add returning High Narrow (high half).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vraddhn.i32))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(raddhn2))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vraddhn_high_u32(r: uint16x4_t, a: uint32x4_t, b: uint32x4_t) -> uint16x8_t {
+ let x: uint16x4_t = transmute(vraddhn_s32_(transmute(a), transmute(b)));
+ simd_shuffle8!(r, x, [0, 1, 2, 3, 4, 5, 6, 7])
+}
+
+/// Rounding Add returning High Narrow (high half).
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vraddhn.i64))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(raddhn2))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vraddhn_high_u64(r: uint32x2_t, a: uint64x2_t, b: uint64x2_t) -> uint32x4_t {
+ let x: uint32x2_t = transmute(vraddhn_s64_(transmute(a), transmute(b)));
+ simd_shuffle4!(r, x, [0, 1, 2, 3])
+}
+
+/// Signed Add Long Pairwise.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpaddl.s8))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(saddlp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpaddl_s8(a: int8x8_t) -> int16x4_t {
+ vpaddl_s8_(a)
+}
+
+/// Signed Add Long Pairwise.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpaddl.s16))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(saddlp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpaddl_s16(a: int16x4_t) -> int32x2_t {
+ vpaddl_s16_(a)
+}
+
+/// Signed Add Long Pairwise.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpaddl.s32))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(saddlp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpaddl_s32(a: int32x2_t) -> int64x1_t {
+ vpaddl_s32_(a)
+}
+
+/// Signed Add Long Pairwise.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpaddl.s8))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(saddlp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpaddlq_s8(a: int8x16_t) -> int16x8_t {
+ vpaddlq_s8_(a)
+}
+
+/// Signed Add Long Pairwise.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpaddl.s16))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(saddlp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpaddlq_s16(a: int16x8_t) -> int32x4_t {
+ vpaddlq_s16_(a)
+}
+
+/// Signed Add Long Pairwise.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpaddl.s32))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(saddlp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpaddlq_s32(a: int32x4_t) -> int64x2_t {
+ vpaddlq_s32_(a)
+}
+
+/// Unsigned Add Long Pairwise.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpaddl.u8))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uaddlp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpaddl_u8(a: uint8x8_t) -> uint16x4_t {
+ vpaddl_u8_(a)
+}
+
+/// Unsigned Add Long Pairwise.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpaddl.u16))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uaddlp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpaddl_u16(a: uint16x4_t) -> uint32x2_t {
+ vpaddl_u16_(a)
+}
+
+/// Unsigned Add Long Pairwise.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpaddl.u32))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uaddlp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpaddl_u32(a: uint32x2_t) -> uint64x1_t {
+ vpaddl_u32_(a)
+}
+
+/// Unsigned Add Long Pairwise.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpaddl.u8))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uaddlp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpaddlq_u8(a: uint8x16_t) -> uint16x8_t {
+ vpaddlq_u8_(a)
+}
+
+/// Unsigned Add Long Pairwise.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpaddl.u16))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uaddlp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpaddlq_u16(a: uint16x8_t) -> uint32x4_t {
+ vpaddlq_u16_(a)
+}
+
+/// Unsigned Add Long Pairwise.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpaddl.u32))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uaddlp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpaddlq_u32(a: uint32x4_t) -> uint64x2_t {
+ vpaddlq_u32_(a)
+}
+
+/// Vector narrow integer.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmovn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(xtn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmovn_s16(a: int16x8_t) -> int8x8_t {
+ simd_cast(a)
+}
+
+/// Vector narrow integer.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmovn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(xtn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmovn_s32(a: int32x4_t) -> int16x4_t {
+ simd_cast(a)
+}
+
+/// Vector narrow integer.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmovn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(xtn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmovn_s64(a: int64x2_t) -> int32x2_t {
+ simd_cast(a)
+}
+
+/// Vector narrow integer.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmovn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(xtn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmovn_u16(a: uint16x8_t) -> uint8x8_t {
+ simd_cast(a)
+}
+
+/// Vector narrow integer.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmovn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(xtn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmovn_u32(a: uint32x4_t) -> uint16x4_t {
+ simd_cast(a)
+}
+
+/// Vector narrow integer.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmovn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(xtn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmovn_u64(a: uint64x2_t) -> uint32x2_t {
+ simd_cast(a)
+}
+
+/// Vector long move.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmovl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sxtl))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmovl_s8(a: int8x8_t) -> int16x8_t {
+ simd_cast(a)
+}
+
+/// Vector long move.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmovl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sxtl))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmovl_s16(a: int16x4_t) -> int32x4_t {
+ simd_cast(a)
+}
+
+/// Vector long move.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmovl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sxtl))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmovl_s32(a: int32x2_t) -> int64x2_t {
+ simd_cast(a)
+}
+
+/// Vector long move.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmovl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uxtl))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmovl_u8(a: uint8x8_t) -> uint16x8_t {
+ simd_cast(a)
+}
+
+/// Vector long move.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmovl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uxtl))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmovl_u16(a: uint16x4_t) -> uint32x4_t {
+ simd_cast(a)
+}
+
+/// Vector long move.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmovl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uxtl))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmovl_u32(a: uint32x2_t) -> uint64x2_t {
+ simd_cast(a)
+}
+
+/// Vector bitwise not.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmvn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mvn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmvn_s8(a: int8x8_t) -> int8x8_t {
+ let b = int8x8_t(-1, -1, -1, -1, -1, -1, -1, -1);
+ simd_xor(a, b)
+}
+
+/// Vector bitwise not.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmvn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mvn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmvnq_s8(a: int8x16_t) -> int8x16_t {
+ let b = int8x16_t(
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ );
+ simd_xor(a, b)
+}
+
+/// Vector bitwise not.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmvn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mvn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmvn_s16(a: int16x4_t) -> int16x4_t {
+ let b = int16x4_t(-1, -1, -1, -1);
+ simd_xor(a, b)
+}
+
+/// Vector bitwise not.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmvn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mvn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmvnq_s16(a: int16x8_t) -> int16x8_t {
+ let b = int16x8_t(-1, -1, -1, -1, -1, -1, -1, -1);
+ simd_xor(a, b)
+}
+
+/// Vector bitwise not.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmvn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mvn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmvn_s32(a: int32x2_t) -> int32x2_t {
+ let b = int32x2_t(-1, -1);
+ simd_xor(a, b)
+}
+
+/// Vector bitwise not.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmvn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mvn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmvnq_s32(a: int32x4_t) -> int32x4_t {
+ let b = int32x4_t(-1, -1, -1, -1);
+ simd_xor(a, b)
+}
+
+/// Vector bitwise not.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmvn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mvn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmvn_u8(a: uint8x8_t) -> uint8x8_t {
+ let b = uint8x8_t(255, 255, 255, 255, 255, 255, 255, 255);
+ simd_xor(a, b)
+}
+
+/// Vector bitwise not.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmvn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mvn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmvnq_u8(a: uint8x16_t) -> uint8x16_t {
+ let b = uint8x16_t(
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ );
+ simd_xor(a, b)
+}
+
+/// Vector bitwise not.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmvn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mvn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmvn_u16(a: uint16x4_t) -> uint16x4_t {
+ let b = uint16x4_t(65_535, 65_535, 65_535, 65_535);
+ simd_xor(a, b)
+}
+
+/// Vector bitwise not.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmvn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mvn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmvnq_u16(a: uint16x8_t) -> uint16x8_t {
+ let b = uint16x8_t(
+ 65_535, 65_535, 65_535, 65_535, 65_535, 65_535, 65_535, 65_535,
+ );
+ simd_xor(a, b)
+}
+
+/// Vector bitwise not.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmvn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mvn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmvn_u32(a: uint32x2_t) -> uint32x2_t {
+ let b = uint32x2_t(4_294_967_295, 4_294_967_295);
+ simd_xor(a, b)
+}
+
+/// Vector bitwise not.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmvn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mvn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmvnq_u32(a: uint32x4_t) -> uint32x4_t {
+ let b = uint32x4_t(4_294_967_295, 4_294_967_295, 4_294_967_295, 4_294_967_295);
+ simd_xor(a, b)
+}
+
+/// Vector bitwise not.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmvn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mvn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmvn_p8(a: poly8x8_t) -> poly8x8_t {
+ let b = poly8x8_t(255, 255, 255, 255, 255, 255, 255, 255);
+ simd_xor(a, b)
+}
+
+/// Vector bitwise not.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmvn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(mvn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmvnq_p8(a: poly8x16_t) -> poly8x16_t {
+ let b = poly8x16_t(
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ );
+ simd_xor(a, b)
+}
+
+/// Vector bitwise bit clear
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vbic))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(bic))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vbic_s8(a: int8x8_t, b: int8x8_t) -> int8x8_t {
+ let c = int8x8_t(-1, -1, -1, -1, -1, -1, -1, -1);
+ simd_and(simd_xor(b, c), a)
+}
+
+/// Vector bitwise bit clear
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vbic))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(bic))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vbicq_s8(a: int8x16_t, b: int8x16_t) -> int8x16_t {
+ let c = int8x16_t(
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ );
+ simd_and(simd_xor(b, c), a)
+}
+
+/// Vector bitwise bit clear
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vbic))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(bic))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vbic_s16(a: int16x4_t, b: int16x4_t) -> int16x4_t {
+ let c = int16x4_t(-1, -1, -1, -1);
+ simd_and(simd_xor(b, c), a)
+}
+
+/// Vector bitwise bit clear
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vbic))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(bic))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vbicq_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t {
+ let c = int16x8_t(-1, -1, -1, -1, -1, -1, -1, -1);
+ simd_and(simd_xor(b, c), a)
+}
+
+/// Vector bitwise bit clear
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vbic))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(bic))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vbic_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t {
+ let c = int32x2_t(-1, -1);
+ simd_and(simd_xor(b, c), a)
+}
+
+/// Vector bitwise bit clear
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vbic))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(bic))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vbicq_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t {
+ let c = int32x4_t(-1, -1, -1, -1);
+ simd_and(simd_xor(b, c), a)
+}
+
+/// Vector bitwise bit clear
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vbic))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(bic))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vbic_s64(a: int64x1_t, b: int64x1_t) -> int64x1_t {
+ let c = int64x1_t(-1);
+ simd_and(simd_xor(b, c), a)
+}
+
+/// Vector bitwise bit clear
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vbic))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(bic))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vbicq_s64(a: int64x2_t, b: int64x2_t) -> int64x2_t {
+ let c = int64x2_t(-1, -1);
+ simd_and(simd_xor(b, c), a)
+}
+
+/// Vector bitwise bit clear
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vbic))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(bic))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vbic_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t {
+ let c = int8x8_t(-1, -1, -1, -1, -1, -1, -1, -1);
+ simd_and(simd_xor(b, transmute(c)), a)
+}
+
+/// Vector bitwise bit clear
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vbic))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(bic))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vbicq_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t {
+ let c = int8x16_t(
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ );
+ simd_and(simd_xor(b, transmute(c)), a)
+}
+
+/// Vector bitwise bit clear
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vbic))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(bic))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vbic_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t {
+ let c = int16x4_t(-1, -1, -1, -1);
+ simd_and(simd_xor(b, transmute(c)), a)
+}
+
+/// Vector bitwise bit clear
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vbic))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(bic))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vbicq_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t {
+ let c = int16x8_t(-1, -1, -1, -1, -1, -1, -1, -1);
+ simd_and(simd_xor(b, transmute(c)), a)
+}
+
+/// Vector bitwise bit clear
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vbic))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(bic))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vbic_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t {
+ let c = int32x2_t(-1, -1);
+ simd_and(simd_xor(b, transmute(c)), a)
+}
+
+/// Vector bitwise bit clear
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vbic))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(bic))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vbicq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
+ let c = int32x4_t(-1, -1, -1, -1);
+ simd_and(simd_xor(b, transmute(c)), a)
+}
+
+/// Vector bitwise bit clear
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vbic))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(bic))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vbic_u64(a: uint64x1_t, b: uint64x1_t) -> uint64x1_t {
+ let c = int64x1_t(-1);
+ simd_and(simd_xor(b, transmute(c)), a)
+}
+
+/// Vector bitwise bit clear
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vbic))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(bic))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vbicq_u64(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t {
+ let c = int64x2_t(-1, -1);
+ simd_and(simd_xor(b, transmute(c)), a)
+}
+
+/// Bitwise Select instructions. This instruction sets each bit in the destination SIMD&FP register
+/// to the corresponding bit from the first source SIMD&FP register when the original
+/// destination bit was 1, otherwise from the second source SIMD&FP register.
+
+/// Bitwise Select.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vbsl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(bsl))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vbsl_s8(a: uint8x8_t, b: int8x8_t, c: int8x8_t) -> int8x8_t {
+ simd_select(transmute::<_, int8x8_t>(a), b, c)
+}
+
+/// Bitwise Select.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vbsl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(bsl))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vbsl_s16(a: uint16x4_t, b: int16x4_t, c: int16x4_t) -> int16x4_t {
+ simd_select(transmute::<_, int16x4_t>(a), b, c)
+}
+
+/// Bitwise Select.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vbsl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(bsl))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vbsl_s32(a: uint32x2_t, b: int32x2_t, c: int32x2_t) -> int32x2_t {
+ simd_select(transmute::<_, int32x2_t>(a), b, c)
+}
+
+/// Bitwise Select.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vbsl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(bsl))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vbsl_s64(a: uint64x1_t, b: int64x1_t, c: int64x1_t) -> int64x1_t {
+ simd_select(transmute::<_, int64x1_t>(a), b, c)
+}
+
+/// Bitwise Select.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vbsl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(bsl))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vbsl_u8(a: uint8x8_t, b: uint8x8_t, c: uint8x8_t) -> uint8x8_t {
+ simd_select(transmute::<_, int8x8_t>(a), b, c)
+}
+
+/// Bitwise Select.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vbsl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(bsl))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vbsl_u16(a: uint16x4_t, b: uint16x4_t, c: uint16x4_t) -> uint16x4_t {
+ simd_select(transmute::<_, int16x4_t>(a), b, c)
+}
+
+/// Bitwise Select.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vbsl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(bsl))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vbsl_u32(a: uint32x2_t, b: uint32x2_t, c: uint32x2_t) -> uint32x2_t {
+ simd_select(transmute::<_, int32x2_t>(a), b, c)
+}
+
+/// Bitwise Select.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vbsl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(bsl))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vbsl_u64(a: uint64x1_t, b: uint64x1_t, c: uint64x1_t) -> uint64x1_t {
+ simd_select(transmute::<_, int64x1_t>(a), b, c)
+}
+
+/// Bitwise Select.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vbsl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(bsl))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vbsl_f32(a: uint32x2_t, b: float32x2_t, c: float32x2_t) -> float32x2_t {
+ simd_select(transmute::<_, int32x2_t>(a), b, c)
+}
+
+/// Bitwise Select.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vbsl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(bsl))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vbsl_p8(a: uint8x8_t, b: poly8x8_t, c: poly8x8_t) -> poly8x8_t {
+ simd_select(transmute::<_, int8x8_t>(a), b, c)
+}
+
+/// Bitwise Select.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vbsl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(bsl))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vbsl_p16(a: uint16x4_t, b: poly16x4_t, c: poly16x4_t) -> poly16x4_t {
+ simd_select(transmute::<_, int16x4_t>(a), b, c)
+}
+
+/// Bitwise Select. (128-bit)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vbsl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(bsl))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vbslq_s8(a: uint8x16_t, b: int8x16_t, c: int8x16_t) -> int8x16_t {
+ simd_select(transmute::<_, int8x16_t>(a), b, c)
+}
+
+/// Bitwise Select. (128-bit)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vbsl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(bsl))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vbslq_s16(a: uint16x8_t, b: int16x8_t, c: int16x8_t) -> int16x8_t {
+ simd_select(transmute::<_, int16x8_t>(a), b, c)
+}
+
+/// Bitwise Select. (128-bit)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vbsl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(bsl))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vbslq_s32(a: uint32x4_t, b: int32x4_t, c: int32x4_t) -> int32x4_t {
+ simd_select(transmute::<_, int32x4_t>(a), b, c)
+}
+
+/// Bitwise Select. (128-bit)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vbsl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(bsl))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vbslq_s64(a: uint64x2_t, b: int64x2_t, c: int64x2_t) -> int64x2_t {
+ simd_select(transmute::<_, int64x2_t>(a), b, c)
+}
+
+/// Bitwise Select. (128-bit)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vbsl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(bsl))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vbslq_u8(a: uint8x16_t, b: uint8x16_t, c: uint8x16_t) -> uint8x16_t {
+ simd_select(transmute::<_, int8x16_t>(a), b, c)
+}
+
+/// Bitwise Select. (128-bit)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vbsl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(bsl))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vbslq_u16(a: uint16x8_t, b: uint16x8_t, c: uint16x8_t) -> uint16x8_t {
+ simd_select(transmute::<_, int16x8_t>(a), b, c)
+}
+
+/// Bitwise Select. (128-bit)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vbsl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(bsl))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vbslq_u32(a: uint32x4_t, b: uint32x4_t, c: uint32x4_t) -> uint32x4_t {
+ simd_select(transmute::<_, int32x4_t>(a), b, c)
+}
+
+/// Bitwise Select. (128-bit)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vbsl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(bsl))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vbslq_u64(a: uint64x2_t, b: uint64x2_t, c: uint64x2_t) -> uint64x2_t {
+ simd_select(transmute::<_, int64x2_t>(a), b, c)
+}
+
+/// Bitwise Select. (128-bit)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vbsl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(bsl))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vbslq_p8(a: uint8x16_t, b: poly8x16_t, c: poly8x16_t) -> poly8x16_t {
+ simd_select(transmute::<_, int8x16_t>(a), b, c)
+}
+
+/// Bitwise Select. (128-bit)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vbsl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(bsl))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vbslq_p16(a: uint16x8_t, b: poly16x8_t, c: poly16x8_t) -> poly16x8_t {
+ simd_select(transmute::<_, int16x8_t>(a), b, c)
+}
+
+/// Bitwise Select. (128-bit)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vbsl))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(bsl))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vbslq_f32(a: uint32x4_t, b: float32x4_t, c: float32x4_t) -> float32x4_t {
+ simd_select(transmute::<_, int32x4_t>(a), b, c)
+}
+
+/// Vector bitwise inclusive OR NOT
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(orn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vorn_s8(a: int8x8_t, b: int8x8_t) -> int8x8_t {
+ let c = int8x8_t(-1, -1, -1, -1, -1, -1, -1, -1);
+ simd_or(simd_xor(b, c), a)
+}
+
+/// Vector bitwise inclusive OR NOT
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(orn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vornq_s8(a: int8x16_t, b: int8x16_t) -> int8x16_t {
+ let c = int8x16_t(
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ );
+ simd_or(simd_xor(b, c), a)
+}
+
+/// Vector bitwise inclusive OR NOT
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(orn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vorn_s16(a: int16x4_t, b: int16x4_t) -> int16x4_t {
+ let c = int16x4_t(-1, -1, -1, -1);
+ simd_or(simd_xor(b, c), a)
+}
+
+/// Vector bitwise inclusive OR NOT
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(orn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vornq_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t {
+ let c = int16x8_t(-1, -1, -1, -1, -1, -1, -1, -1);
+ simd_or(simd_xor(b, c), a)
+}
+
+/// Vector bitwise inclusive OR NOT
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(orn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vorn_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t {
+ let c = int32x2_t(-1, -1);
+ simd_or(simd_xor(b, c), a)
+}
+
+/// Vector bitwise inclusive OR NOT
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(orn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vornq_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t {
+ let c = int32x4_t(-1, -1, -1, -1);
+ simd_or(simd_xor(b, c), a)
+}
+
+/// Vector bitwise inclusive OR NOT
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(orn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vorn_s64(a: int64x1_t, b: int64x1_t) -> int64x1_t {
+ let c = int64x1_t(-1);
+ simd_or(simd_xor(b, c), a)
+}
+
+/// Vector bitwise inclusive OR NOT
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(orn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vornq_s64(a: int64x2_t, b: int64x2_t) -> int64x2_t {
+ let c = int64x2_t(-1, -1);
+ simd_or(simd_xor(b, c), a)
+}
+
+/// Vector bitwise inclusive OR NOT
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(orn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vorn_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t {
+ let c = int8x8_t(-1, -1, -1, -1, -1, -1, -1, -1);
+ simd_or(simd_xor(b, transmute(c)), a)
+}
+
+/// Vector bitwise inclusive OR NOT
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(orn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vornq_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t {
+ let c = int8x16_t(
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ );
+ simd_or(simd_xor(b, transmute(c)), a)
+}
+
+/// Vector bitwise inclusive OR NOT
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(orn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vorn_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t {
+ let c = int16x4_t(-1, -1, -1, -1);
+ simd_or(simd_xor(b, transmute(c)), a)
+}
+
+/// Vector bitwise inclusive OR NOT
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(orn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vornq_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t {
+ let c = int16x8_t(-1, -1, -1, -1, -1, -1, -1, -1);
+ simd_or(simd_xor(b, transmute(c)), a)
+}
+
+/// Vector bitwise inclusive OR NOT
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(orn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vorn_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t {
+ let c = int32x2_t(-1, -1);
+ simd_or(simd_xor(b, transmute(c)), a)
+}
+
+/// Vector bitwise inclusive OR NOT
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(orn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vornq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
+ let c = int32x4_t(-1, -1, -1, -1);
+ simd_or(simd_xor(b, transmute(c)), a)
+}
+
+/// Vector bitwise inclusive OR NOT
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(orn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vorn_u64(a: uint64x1_t, b: uint64x1_t) -> uint64x1_t {
+ let c = int64x1_t(-1);
+ simd_or(simd_xor(b, transmute(c)), a)
+}
+
+/// Vector bitwise inclusive OR NOT
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vorn))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(orn))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vornq_u64(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t {
+ let c = int64x2_t(-1, -1);
+ simd_or(simd_xor(b, transmute(c)), a)
+}
+
+/// Folding minimum of adjacent pairs
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpmin))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sminp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpmin_s8(a: int8x8_t, b: int8x8_t) -> int8x8_t {
+ vpmins_v8i8(a, b)
+}
+
+/// Folding minimum of adjacent pairs
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpmin))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sminp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpmin_s16(a: int16x4_t, b: int16x4_t) -> int16x4_t {
+ vpmins_v4i16(a, b)
+}
+
+/// Folding minimum of adjacent pairs
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpmin))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sminp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpmin_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t {
+ vpmins_v2i32(a, b)
+}
+
+/// Folding minimum of adjacent pairs
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpmin))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uminp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpmin_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t {
+ vpminu_v8i8(a, b)
+}
+
+/// Folding minimum of adjacent pairs
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpmin))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uminp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpmin_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t {
+ vpminu_v4i16(a, b)
+}
+
+/// Folding minimum of adjacent pairs
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpmin))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uminp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpmin_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t {
+ vpminu_v2i32(a, b)
+}
+
+/// Folding minimum of adjacent pairs
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpmin))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fminp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpmin_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t {
+ vpminf_v2f32(a, b)
+}
+
+/// Folding maximum of adjacent pairs
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpmax))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smaxp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpmax_s8(a: int8x8_t, b: int8x8_t) -> int8x8_t {
+ vpmaxs_v8i8(a, b)
+}
+
+/// Folding maximum of adjacent pairs
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpmax))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smaxp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpmax_s16(a: int16x4_t, b: int16x4_t) -> int16x4_t {
+ vpmaxs_v4i16(a, b)
+}
+
+/// Folding maximum of adjacent pairs
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpmax))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smaxp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpmax_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t {
+ vpmaxs_v2i32(a, b)
+}
+
+/// Folding maximum of adjacent pairs
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpmax))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(umaxp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpmax_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t {
+ vpmaxu_v8i8(a, b)
+}
+
+/// Folding maximum of adjacent pairs
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpmax))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(umaxp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpmax_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t {
+ vpmaxu_v4i16(a, b)
+}
+
+/// Folding maximum of adjacent pairs
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpmax))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(umaxp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpmax_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t {
+ vpmaxu_v2i32(a, b)
+}
+
+/// Folding maximum of adjacent pairs
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpmax))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmaxp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpmax_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t {
+ vpmaxf_v2f32(a, b)
+}
+
+/// Move vector element to general-purpose register
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(test, assert_instr(nop, IMM5 = 1))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vgetq_lane_u64<const IMM5: i32>(v: uint64x2_t) -> u64 {
+ static_assert_imm1!(IMM5);
+ simd_extract(v, IMM5 as u32)
+}
+
+/// Move vector element to general-purpose register
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(test, assert_instr(nop, IMM5 = 0))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vget_lane_u64<const IMM5: i32>(v: uint64x1_t) -> u64 {
+ static_assert!(IMM5 : i32 where IMM5 == 0);
+ simd_extract(v, 0)
+}
+
+/// Move vector element to general-purpose register
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(test, assert_instr(nop, IMM5 = 2))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vget_lane_u16<const IMM5: i32>(v: uint16x4_t) -> u16 {
+ static_assert_imm2!(IMM5);
+ simd_extract(v, IMM5 as u32)
+}
+
+/// Move vector element to general-purpose register
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(test, assert_instr(nop, IMM5 = 2))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vget_lane_s16<const IMM5: i32>(v: int16x4_t) -> i16 {
+ static_assert_imm2!(IMM5);
+ simd_extract(v, IMM5 as u32)
+}
+
+/// Move vector element to general-purpose register
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(test, assert_instr(nop, IMM5 = 2))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vget_lane_p16<const IMM5: i32>(v: poly16x4_t) -> p16 {
+ static_assert_imm2!(IMM5);
+ simd_extract(v, IMM5 as u32)
+}
+
+/// Move vector element to general-purpose register
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(test, assert_instr(nop, IMM5 = 1))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vget_lane_u32<const IMM5: i32>(v: uint32x2_t) -> u32 {
+ static_assert_imm1!(IMM5);
+ simd_extract(v, IMM5 as u32)
+}
+
+/// Move vector element to general-purpose register
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(test, assert_instr(nop, IMM5 = 1))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vget_lane_s32<const IMM5: i32>(v: int32x2_t) -> i32 {
+ static_assert_imm1!(IMM5);
+ simd_extract(v, IMM5 as u32)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(test, assert_instr(nop, IMM5 = 1))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vget_lane_f32<const IMM5: i32>(v: float32x2_t) -> f32 {
+ static_assert_imm1!(IMM5);
+ simd_extract(v, IMM5 as u32)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(test, assert_instr(nop, IMM5 = 1))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vgetq_lane_f32<const IMM5: i32>(v: float32x4_t) -> f32 {
+ static_assert_imm2!(IMM5);
+ simd_extract(v, IMM5 as u32)
+}
+
+/// Move vector element to general-purpose register
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(test, assert_instr(nop, IMM5 = 0))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vget_lane_p64<const IMM5: i32>(v: poly64x1_t) -> p64 {
+ static_assert!(IMM5 : i32 where IMM5 == 0);
+ simd_extract(v, IMM5 as u32)
+}
+
+/// Move vector element to general-purpose register
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(test, assert_instr(nop, IMM5 = 0))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vgetq_lane_p64<const IMM5: i32>(v: poly64x2_t) -> p64 {
+ static_assert_imm1!(IMM5);
+ simd_extract(v, IMM5 as u32)
+}
+
+/// Move vector element to general-purpose register
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(test, assert_instr(nop, IMM5 = 0))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vget_lane_s64<const IMM5: i32>(v: int64x1_t) -> i64 {
+ static_assert!(IMM5 : i32 where IMM5 == 0);
+ simd_extract(v, IMM5 as u32)
+}
+
+/// Move vector element to general-purpose register
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(test, assert_instr(nop, IMM5 = 0))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vgetq_lane_s64<const IMM5: i32>(v: int64x2_t) -> i64 {
+ static_assert_imm1!(IMM5);
+ simd_extract(v, IMM5 as u32)
+}
+
+/// Move vector element to general-purpose register
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(test, assert_instr(nop, IMM5 = 2))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vgetq_lane_u16<const IMM5: i32>(v: uint16x8_t) -> u16 {
+ static_assert_imm3!(IMM5);
+ simd_extract(v, IMM5 as u32)
+}
+
+/// Move vector element to general-purpose register
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(test, assert_instr(nop, IMM5 = 2))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vgetq_lane_u32<const IMM5: i32>(v: uint32x4_t) -> u32 {
+ static_assert_imm2!(IMM5);
+ simd_extract(v, IMM5 as u32)
+}
+
+/// Move vector element to general-purpose register
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(test, assert_instr(nop, IMM5 = 2))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vgetq_lane_s16<const IMM5: i32>(v: int16x8_t) -> i16 {
+ static_assert_imm3!(IMM5);
+ simd_extract(v, IMM5 as u32)
+}
+
+/// Move vector element to general-purpose register
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(test, assert_instr(nop, IMM5 = 2))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vgetq_lane_p16<const IMM5: i32>(v: poly16x8_t) -> p16 {
+ static_assert_imm3!(IMM5);
+ simd_extract(v, IMM5 as u32)
+}
+
+/// Move vector element to general-purpose register
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(test, assert_instr(nop, IMM5 = 2))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vgetq_lane_s32<const IMM5: i32>(v: int32x4_t) -> i32 {
+ static_assert_imm2!(IMM5);
+ simd_extract(v, IMM5 as u32)
+}
+
+/// Move vector element to general-purpose register
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(test, assert_instr(nop, IMM5 = 2))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vget_lane_u8<const IMM5: i32>(v: uint8x8_t) -> u8 {
+ static_assert_imm3!(IMM5);
+ simd_extract(v, IMM5 as u32)
+}
+
+/// Move vector element to general-purpose register
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(test, assert_instr(nop, IMM5 = 2))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vget_lane_s8<const IMM5: i32>(v: int8x8_t) -> i8 {
+ static_assert_imm3!(IMM5);
+ simd_extract(v, IMM5 as u32)
+}
+
+/// Move vector element to general-purpose register
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(test, assert_instr(nop, IMM5 = 2))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vget_lane_p8<const IMM5: i32>(v: poly8x8_t) -> p8 {
+ static_assert_imm3!(IMM5);
+ simd_extract(v, IMM5 as u32)
+}
+
+/// Move vector element to general-purpose register
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(test, assert_instr(nop, IMM5 = 2))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vgetq_lane_u8<const IMM5: i32>(v: uint8x16_t) -> u8 {
+ static_assert_imm4!(IMM5);
+ simd_extract(v, IMM5 as u32)
+}
+
+/// Move vector element to general-purpose register
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(test, assert_instr(nop, IMM5 = 2))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vgetq_lane_s8<const IMM5: i32>(v: int8x16_t) -> i8 {
+ static_assert_imm4!(IMM5);
+ simd_extract(v, IMM5 as u32)
+}
+
+/// Move vector element to general-purpose register
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[rustc_legacy_const_generics(1)]
+#[cfg_attr(test, assert_instr(nop, IMM5 = 2))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vgetq_lane_p8<const IMM5: i32>(v: poly8x16_t) -> p8 {
+ static_assert_imm4!(IMM5);
+ simd_extract(v, IMM5 as u32)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmov"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ext))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vget_high_s8(a: int8x16_t) -> int8x8_t {
+ simd_shuffle8!(a, a, [8, 9, 10, 11, 12, 13, 14, 15])
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmov"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ext))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vget_high_s16(a: int16x8_t) -> int16x4_t {
+ simd_shuffle4!(a, a, [4, 5, 6, 7])
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmov"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ext))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vget_high_s32(a: int32x4_t) -> int32x2_t {
+ simd_shuffle2!(a, a, [2, 3])
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmov"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ext))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vget_high_s64(a: int64x2_t) -> int64x1_t {
+ int64x1_t(simd_extract(a, 1))
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmov"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ext))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vget_high_u8(a: uint8x16_t) -> uint8x8_t {
+ simd_shuffle8!(a, a, [8, 9, 10, 11, 12, 13, 14, 15])
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmov"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ext))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vget_high_u16(a: uint16x8_t) -> uint16x4_t {
+ simd_shuffle4!(a, a, [4, 5, 6, 7])
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmov"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ext))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vget_high_u32(a: uint32x4_t) -> uint32x2_t {
+ simd_shuffle2!(a, a, [2, 3])
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmov"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ext))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vget_high_u64(a: uint64x2_t) -> uint64x1_t {
+ uint64x1_t(simd_extract(a, 1))
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmov"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ext))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vget_high_p8(a: poly8x16_t) -> poly8x8_t {
+ simd_shuffle8!(a, a, [8, 9, 10, 11, 12, 13, 14, 15])
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmov"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ext))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vget_high_p16(a: poly16x8_t) -> poly16x4_t {
+ simd_shuffle4!(a, a, [4, 5, 6, 7])
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmov"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ext))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vget_high_f32(a: float32x4_t) -> float32x2_t {
+ simd_shuffle2!(a, a, [2, 3])
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(test, assert_instr(nop))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "vget_low_s8", since = "1.60.0")
+)]
+pub unsafe fn vget_low_s8(a: int8x16_t) -> int8x8_t {
+ simd_shuffle8!(a, a, [0, 1, 2, 3, 4, 5, 6, 7])
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(test, assert_instr(nop))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vget_low_s16(a: int16x8_t) -> int16x4_t {
+ simd_shuffle4!(a, a, [0, 1, 2, 3])
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(test, assert_instr(nop))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vget_low_s32(a: int32x4_t) -> int32x2_t {
+ simd_shuffle2!(a, a, [0, 1])
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(test, assert_instr(nop))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vget_low_s64(a: int64x2_t) -> int64x1_t {
+ int64x1_t(simd_extract(a, 0))
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(test, assert_instr(nop))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vget_low_u8(a: uint8x16_t) -> uint8x8_t {
+ simd_shuffle8!(a, a, [0, 1, 2, 3, 4, 5, 6, 7])
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(test, assert_instr(nop))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vget_low_u16(a: uint16x8_t) -> uint16x4_t {
+ simd_shuffle4!(a, a, [0, 1, 2, 3])
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(test, assert_instr(nop))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vget_low_u32(a: uint32x4_t) -> uint32x2_t {
+ simd_shuffle2!(a, a, [0, 1])
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(test, assert_instr(nop))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vget_low_u64(a: uint64x2_t) -> uint64x1_t {
+ uint64x1_t(simd_extract(a, 0))
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(test, assert_instr(nop))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vget_low_p8(a: poly8x16_t) -> poly8x8_t {
+ simd_shuffle8!(a, a, [0, 1, 2, 3, 4, 5, 6, 7])
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(test, assert_instr(nop))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vget_low_p16(a: poly16x8_t) -> poly16x4_t {
+ simd_shuffle4!(a, a, [0, 1, 2, 3])
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(test, assert_instr(nop))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vget_low_f32(a: float32x4_t) -> float32x2_t {
+ simd_shuffle2!(a, a, [0, 1])
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vdupq_n_s8(value: i8) -> int8x16_t {
+ int8x16_t(
+ value, value, value, value, value, value, value, value, value, value, value, value, value,
+ value, value, value,
+ )
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vdupq_n_s16(value: i16) -> int16x8_t {
+ int16x8_t(value, value, value, value, value, value, value, value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vdupq_n_s32(value: i32) -> int32x4_t {
+ int32x4_t(value, value, value, value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmov"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vdupq_n_s64(value: i64) -> int64x2_t {
+ int64x2_t(value, value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vdupq_n_u8(value: u8) -> uint8x16_t {
+ uint8x16_t(
+ value, value, value, value, value, value, value, value, value, value, value, value, value,
+ value, value, value,
+ )
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vdupq_n_u16(value: u16) -> uint16x8_t {
+ uint16x8_t(value, value, value, value, value, value, value, value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vdupq_n_u32(value: u32) -> uint32x4_t {
+ uint32x4_t(value, value, value, value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmov"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vdupq_n_u64(value: u64) -> uint64x2_t {
+ uint64x2_t(value, value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vdupq_n_p8(value: p8) -> poly8x16_t {
+ poly8x16_t(
+ value, value, value, value, value, value, value, value, value, value, value, value, value,
+ value, value, value,
+ )
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vdupq_n_p16(value: p16) -> poly16x8_t {
+ poly16x8_t(value, value, value, value, value, value, value, value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vdupq_n_f32(value: f32) -> float32x4_t {
+ float32x4_t(value, value, value, value)
+}
+
+/// Duplicate vector element to vector or scalar
+///
+/// Private vfp4 version used by FMA intriniscs because LLVM does
+/// not inline the non-vfp4 version in vfp4 functions.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "vfp4"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+unsafe fn vdupq_n_f32_vfp4(value: f32) -> float32x4_t {
+ float32x4_t(value, value, value, value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vdup_n_s8(value: i8) -> int8x8_t {
+ int8x8_t(value, value, value, value, value, value, value, value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vdup_n_s16(value: i16) -> int16x4_t {
+ int16x4_t(value, value, value, value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vdup_n_s32(value: i32) -> int32x2_t {
+ int32x2_t(value, value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmov"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmov))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vdup_n_s64(value: i64) -> int64x1_t {
+ int64x1_t(value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vdup_n_u8(value: u8) -> uint8x8_t {
+ uint8x8_t(value, value, value, value, value, value, value, value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vdup_n_u16(value: u16) -> uint16x4_t {
+ uint16x4_t(value, value, value, value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vdup_n_u32(value: u32) -> uint32x2_t {
+ uint32x2_t(value, value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmov"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmov))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vdup_n_u64(value: u64) -> uint64x1_t {
+ uint64x1_t(value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vdup_n_p8(value: p8) -> poly8x8_t {
+ poly8x8_t(value, value, value, value, value, value, value, value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vdup_n_p16(value: p16) -> poly16x4_t {
+ poly16x4_t(value, value, value, value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vdup_n_f32(value: f32) -> float32x2_t {
+ float32x2_t(value, value)
+}
+
+/// Duplicate vector element to vector or scalar
+///
+/// Private vfp4 version used by FMA intriniscs because LLVM does
+/// not inline the non-vfp4 version in vfp4 functions.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "vfp4"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+unsafe fn vdup_n_f32_vfp4(value: f32) -> float32x2_t {
+ float32x2_t(value, value)
+}
+
+/// Load SIMD&FP register (immediate offset)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vldrq_p128(a: *const p128) -> p128 {
+ *a
+}
+
+/// Store SIMD&FP register (immediate offset)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vstrq_p128(a: *mut p128, b: p128) {
+ *a = b;
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmov_n_s8(value: i8) -> int8x8_t {
+ vdup_n_s8(value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmov_n_s16(value: i16) -> int16x4_t {
+ vdup_n_s16(value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmov_n_s32(value: i32) -> int32x2_t {
+ vdup_n_s32(value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmov"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmov))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmov_n_s64(value: i64) -> int64x1_t {
+ vdup_n_s64(value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmov_n_u8(value: u8) -> uint8x8_t {
+ vdup_n_u8(value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmov_n_u16(value: u16) -> uint16x4_t {
+ vdup_n_u16(value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmov_n_u32(value: u32) -> uint32x2_t {
+ vdup_n_u32(value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmov"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmov))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmov_n_u64(value: u64) -> uint64x1_t {
+ vdup_n_u64(value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmov_n_p8(value: p8) -> poly8x8_t {
+ vdup_n_p8(value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmov_n_p16(value: p16) -> poly16x4_t {
+ vdup_n_p16(value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmov_n_f32(value: f32) -> float32x2_t {
+ vdup_n_f32(value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmovq_n_s8(value: i8) -> int8x16_t {
+ vdupq_n_s8(value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmovq_n_s16(value: i16) -> int16x8_t {
+ vdupq_n_s16(value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmovq_n_s32(value: i32) -> int32x4_t {
+ vdupq_n_s32(value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmov"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmovq_n_s64(value: i64) -> int64x2_t {
+ vdupq_n_s64(value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmovq_n_u8(value: u8) -> uint8x16_t {
+ vdupq_n_u8(value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmovq_n_u16(value: u16) -> uint16x8_t {
+ vdupq_n_u16(value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmovq_n_u32(value: u32) -> uint32x4_t {
+ vdupq_n_u32(value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vmov"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmovq_n_u64(value: u64) -> uint64x2_t {
+ vdupq_n_u64(value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmovq_n_p8(value: p8) -> poly8x16_t {
+ vdupq_n_p8(value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmovq_n_p16(value: p16) -> poly16x8_t {
+ vdupq_n_p16(value)
+}
+
+/// Duplicate vector element to vector or scalar
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(dup))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vmovq_n_f32(value: f32) -> float32x4_t {
+ vdupq_n_f32(value)
+}
+
+/// Extract vector from pair of vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("nop", N = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr("nop", N = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vext_s64<const N: i32>(a: int64x1_t, _b: int64x1_t) -> int64x1_t {
+ static_assert!(N : i32 where N == 0);
+ a
+}
+
+/// Extract vector from pair of vectors
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("nop", N = 0))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr("nop", N = 0))]
+#[rustc_legacy_const_generics(2)]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vext_u64<const N: i32>(a: uint64x1_t, _b: uint64x1_t) -> uint64x1_t {
+ static_assert!(N : i32 where N == 0);
+ a
+}
+
+/// Population count per byte.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vcnt))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cnt))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vcnt_s8(a: int8x8_t) -> int8x8_t {
+ vcnt_s8_(a)
+}
+/// Population count per byte.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vcnt))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cnt))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vcntq_s8(a: int8x16_t) -> int8x16_t {
+ vcntq_s8_(a)
+}
+/// Population count per byte.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vcnt))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cnt))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vcnt_u8(a: uint8x8_t) -> uint8x8_t {
+ transmute(vcnt_s8_(transmute(a)))
+}
+/// Population count per byte.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vcnt))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cnt))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vcntq_u8(a: uint8x16_t) -> uint8x16_t {
+ transmute(vcntq_s8_(transmute(a)))
+}
+/// Population count per byte.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vcnt))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cnt))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vcnt_p8(a: poly8x8_t) -> poly8x8_t {
+ transmute(vcnt_s8_(transmute(a)))
+}
+/// Population count per byte.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vcnt))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cnt))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vcntq_p8(a: poly8x16_t) -> poly8x16_t {
+ transmute(vcntq_s8_(transmute(a)))
+}
+
+/// Reversing vector elements (swap endianness)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrev16.8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rev16))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vrev16_s8(a: int8x8_t) -> int8x8_t {
+ simd_shuffle8!(a, a, [1, 0, 3, 2, 5, 4, 7, 6])
+}
+
+/// Reversing vector elements (swap endianness)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrev16.8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rev16))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vrev16q_s8(a: int8x16_t) -> int8x16_t {
+ simd_shuffle16!(a, a, [1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14])
+}
+
+/// Reversing vector elements (swap endianness)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrev16.8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rev16))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vrev16_u8(a: uint8x8_t) -> uint8x8_t {
+ simd_shuffle8!(a, a, [1, 0, 3, 2, 5, 4, 7, 6])
+}
+
+/// Reversing vector elements (swap endianness)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrev16.8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rev16))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vrev16q_u8(a: uint8x16_t) -> uint8x16_t {
+ simd_shuffle16!(a, a, [1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14])
+}
+
+/// Reversing vector elements (swap endianness)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrev16.8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rev16))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vrev16_p8(a: poly8x8_t) -> poly8x8_t {
+ simd_shuffle8!(a, a, [1, 0, 3, 2, 5, 4, 7, 6])
+}
+
+/// Reversing vector elements (swap endianness)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrev16.8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rev16))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vrev16q_p8(a: poly8x16_t) -> poly8x16_t {
+ simd_shuffle16!(a, a, [1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14])
+}
+
+/// Reversing vector elements (swap endianness)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrev32.8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rev32))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vrev32_s8(a: int8x8_t) -> int8x8_t {
+ simd_shuffle8!(a, a, [3, 2, 1, 0, 7, 6, 5, 4])
+}
+
+/// Reversing vector elements (swap endianness)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrev32.8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rev32))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vrev32q_s8(a: int8x16_t) -> int8x16_t {
+ simd_shuffle16!(a, a, [3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12])
+}
+
+/// Reversing vector elements (swap endianness)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrev32.8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rev32))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vrev32_u8(a: uint8x8_t) -> uint8x8_t {
+ simd_shuffle8!(a, a, [3, 2, 1, 0, 7, 6, 5, 4])
+}
+
+/// Reversing vector elements (swap endianness)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrev32.8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rev32))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vrev32q_u8(a: uint8x16_t) -> uint8x16_t {
+ simd_shuffle16!(a, a, [3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12])
+}
+
+/// Reversing vector elements (swap endianness)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrev32.16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rev32))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vrev32_s16(a: int16x4_t) -> int16x4_t {
+ simd_shuffle4!(a, a, [1, 0, 3, 2])
+}
+
+/// Reversing vector elements (swap endianness)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrev32.16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rev32))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vrev32q_s16(a: int16x8_t) -> int16x8_t {
+ simd_shuffle8!(a, a, [1, 0, 3, 2, 5, 4, 7, 6])
+}
+
+/// Reversing vector elements (swap endianness)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrev32.16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rev32))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vrev32_p16(a: poly16x4_t) -> poly16x4_t {
+ simd_shuffle4!(a, a, [1, 0, 3, 2])
+}
+
+/// Reversing vector elements (swap endianness)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrev32.16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rev32))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vrev32q_p16(a: poly16x8_t) -> poly16x8_t {
+ simd_shuffle8!(a, a, [1, 0, 3, 2, 5, 4, 7, 6])
+}
+
+/// Reversing vector elements (swap endianness)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrev32.16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rev32))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vrev32_u16(a: uint16x4_t) -> uint16x4_t {
+ simd_shuffle4!(a, a, [1, 0, 3, 2])
+}
+
+/// Reversing vector elements (swap endianness)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrev32.16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rev32))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vrev32q_u16(a: uint16x8_t) -> uint16x8_t {
+ simd_shuffle8!(a, a, [1, 0, 3, 2, 5, 4, 7, 6])
+}
+
+/// Reversing vector elements (swap endianness)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrev32.8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rev32))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vrev32_p8(a: poly8x8_t) -> poly8x8_t {
+ simd_shuffle8!(a, a, [3, 2, 1, 0, 7, 6, 5, 4])
+}
+
+/// Reversing vector elements (swap endianness)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrev32.8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rev32))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vrev32q_p8(a: poly8x16_t) -> poly8x16_t {
+ simd_shuffle16!(a, a, [3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12])
+}
+
+/// Reversing vector elements (swap endianness)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrev64.8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rev64))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vrev64_s8(a: int8x8_t) -> int8x8_t {
+ simd_shuffle8!(a, a, [7, 6, 5, 4, 3, 2, 1, 0])
+}
+
+/// Reversing vector elements (swap endianness)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrev64.8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rev64))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vrev64q_s8(a: int8x16_t) -> int8x16_t {
+ simd_shuffle16!(a, a, [7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8])
+}
+
+/// Reversing vector elements (swap endianness)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrev64.16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rev64))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vrev64_s16(a: int16x4_t) -> int16x4_t {
+ simd_shuffle4!(a, a, [3, 2, 1, 0])
+}
+
+/// Reversing vector elements (swap endianness)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrev64.16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rev64))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vrev64q_s16(a: int16x8_t) -> int16x8_t {
+ simd_shuffle8!(a, a, [3, 2, 1, 0, 7, 6, 5, 4])
+}
+
+/// Reversing vector elements (swap endianness)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrev64.32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rev64))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vrev64_s32(a: int32x2_t) -> int32x2_t {
+ simd_shuffle2!(a, a, [1, 0])
+}
+
+/// Reversing vector elements (swap endianness)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrev64.32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rev64))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vrev64q_s32(a: int32x4_t) -> int32x4_t {
+ simd_shuffle4!(a, a, [1, 0, 3, 2])
+}
+
+/// Reversing vector elements (swap endianness)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrev64.8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rev64))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vrev64_u8(a: uint8x8_t) -> uint8x8_t {
+ simd_shuffle8!(a, a, [7, 6, 5, 4, 3, 2, 1, 0])
+}
+
+/// Reversing vector elements (swap endianness)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrev64.8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rev64))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vrev64q_u8(a: uint8x16_t) -> uint8x16_t {
+ simd_shuffle16!(a, a, [7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8])
+}
+
+/// Reversing vector elements (swap endianness)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrev64.16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rev64))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vrev64_u16(a: uint16x4_t) -> uint16x4_t {
+ simd_shuffle4!(a, a, [3, 2, 1, 0])
+}
+
+/// Reversing vector elements (swap endianness)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrev64.16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rev64))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vrev64q_u16(a: uint16x8_t) -> uint16x8_t {
+ simd_shuffle8!(a, a, [3, 2, 1, 0, 7, 6, 5, 4])
+}
+
+/// Reversing vector elements (swap endianness)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrev64.32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rev64))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vrev64_u32(a: uint32x2_t) -> uint32x2_t {
+ simd_shuffle2!(a, a, [1, 0])
+}
+
+/// Reversing vector elements (swap endianness)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrev64.32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rev64))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vrev64q_u32(a: uint32x4_t) -> uint32x4_t {
+ simd_shuffle4!(a, a, [1, 0, 3, 2])
+}
+
+/// Reversing vector elements (swap endianness)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrev64.32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rev64))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vrev64_f32(a: float32x2_t) -> float32x2_t {
+ simd_shuffle2!(a, a, [1, 0])
+}
+
+/// Reversing vector elements (swap endianness)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrev64.32"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rev64))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vrev64q_f32(a: float32x4_t) -> float32x4_t {
+ simd_shuffle4!(a, a, [1, 0, 3, 2])
+}
+
+/// Reversing vector elements (swap endianness)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrev64.8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rev64))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vrev64_p8(a: poly8x8_t) -> poly8x8_t {
+ simd_shuffle8!(a, a, [7, 6, 5, 4, 3, 2, 1, 0])
+}
+
+/// Reversing vector elements (swap endianness)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrev64.8"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rev64))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vrev64q_p8(a: poly8x16_t) -> poly8x16_t {
+ simd_shuffle16!(a, a, [7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8])
+}
+
+/// Reversing vector elements (swap endianness)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrev64.16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rev64))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vrev64_p16(a: poly16x4_t) -> poly16x4_t {
+ simd_shuffle4!(a, a, [3, 2, 1, 0])
+}
+
+/// Reversing vector elements (swap endianness)
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrev64.16"))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(rev64))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vrev64q_p16(a: poly16x8_t) -> poly16x8_t {
+ simd_shuffle8!(a, a, [3, 2, 1, 0, 7, 6, 5, 4])
+}
+
+/// Signed Add and Accumulate Long Pairwise.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpadal.s8))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sadalp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpadal_s8(a: int16x4_t, b: int8x8_t) -> int16x4_t {
+ #[cfg(target_arch = "arm")]
+ {
+ crate::core_arch::arm::neon::vpadal_s8_(a, b)
+ }
+ #[cfg(target_arch = "aarch64")]
+ {
+ simd_add(vpaddl_s8_(b), a)
+ }
+}
+
+/// Signed Add and Accumulate Long Pairwise.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpadal.s16))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sadalp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpadal_s16(a: int32x2_t, b: int16x4_t) -> int32x2_t {
+ #[cfg(target_arch = "arm")]
+ {
+ crate::core_arch::arm::neon::vpadal_s16_(a, b)
+ }
+ #[cfg(target_arch = "aarch64")]
+ {
+ simd_add(vpaddl_s16_(b), a)
+ }
+}
+
+/// Signed Add and Accumulate Long Pairwise.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpadal.s32))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sadalp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpadal_s32(a: int64x1_t, b: int32x2_t) -> int64x1_t {
+ #[cfg(target_arch = "arm")]
+ {
+ crate::core_arch::arm::neon::vpadal_s32_(a, b)
+ }
+ #[cfg(target_arch = "aarch64")]
+ {
+ simd_add(vpaddl_s32_(b), a)
+ }
+}
+
+/// Signed Add and Accumulate Long Pairwise.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpadal.s8))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sadalp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpadalq_s8(a: int16x8_t, b: int8x16_t) -> int16x8_t {
+ #[cfg(target_arch = "arm")]
+ {
+ crate::core_arch::arm::neon::vpadalq_s8_(a, b)
+ }
+ #[cfg(target_arch = "aarch64")]
+ {
+ simd_add(vpaddlq_s8_(b), a)
+ }
+}
+
+/// Signed Add and Accumulate Long Pairwise.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpadal.s16))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sadalp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpadalq_s16(a: int32x4_t, b: int16x8_t) -> int32x4_t {
+ #[cfg(target_arch = "arm")]
+ {
+ crate::core_arch::arm::neon::vpadalq_s16_(a, b)
+ }
+ #[cfg(target_arch = "aarch64")]
+ {
+ simd_add(vpaddlq_s16_(b), a)
+ }
+}
+
+/// Signed Add and Accumulate Long Pairwise.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpadal.s32))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(sadalp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpadalq_s32(a: int64x2_t, b: int32x4_t) -> int64x2_t {
+ #[cfg(target_arch = "arm")]
+ {
+ crate::core_arch::arm::neon::vpadalq_s32_(a, b)
+ }
+ #[cfg(target_arch = "aarch64")]
+ {
+ simd_add(vpaddlq_s32_(b), a)
+ }
+}
+
+/// Unsigned Add and Accumulate Long Pairwise.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpadal.u8))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uadalp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpadal_u8(a: uint16x4_t, b: uint8x8_t) -> uint16x4_t {
+ #[cfg(target_arch = "arm")]
+ {
+ crate::core_arch::arm::neon::vpadal_u8_(a, b)
+ }
+ #[cfg(target_arch = "aarch64")]
+ {
+ simd_add(vpaddl_u8_(b), a)
+ }
+}
+
+/// Unsigned Add and Accumulate Long Pairwise.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpadal.u16))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uadalp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpadal_u16(a: uint32x2_t, b: uint16x4_t) -> uint32x2_t {
+ #[cfg(target_arch = "arm")]
+ {
+ crate::core_arch::arm::neon::vpadal_u16_(a, b)
+ }
+ #[cfg(target_arch = "aarch64")]
+ {
+ simd_add(vpaddl_u16_(b), a)
+ }
+}
+
+/// Unsigned Add and Accumulate Long Pairwise.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpadal.u32))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uadalp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpadal_u32(a: uint64x1_t, b: uint32x2_t) -> uint64x1_t {
+ #[cfg(target_arch = "arm")]
+ {
+ crate::core_arch::arm::neon::vpadal_u32_(a, b)
+ }
+ #[cfg(target_arch = "aarch64")]
+ {
+ simd_add(vpaddl_u32_(b), a)
+ }
+}
+
+/// Unsigned Add and Accumulate Long Pairwise.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpadal.u8))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uadalp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpadalq_u8(a: uint16x8_t, b: uint8x16_t) -> uint16x8_t {
+ #[cfg(target_arch = "arm")]
+ {
+ crate::core_arch::arm::neon::vpadalq_u8_(a, b)
+ }
+ #[cfg(target_arch = "aarch64")]
+ {
+ simd_add(vpaddlq_u8_(b), a)
+ }
+}
+
+/// Unsigned Add and Accumulate Long Pairwise.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpadal.u16))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uadalp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpadalq_u16(a: uint32x4_t, b: uint16x8_t) -> uint32x4_t {
+ #[cfg(target_arch = "arm")]
+ {
+ crate::core_arch::arm::neon::vpadalq_u16_(a, b)
+ }
+ #[cfg(target_arch = "aarch64")]
+ {
+ simd_add(vpaddlq_u16_(b), a)
+ }
+}
+
+/// Unsigned Add and Accumulate Long Pairwise.
+#[inline]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vpadal.u32))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(uadalp))]
+#[cfg_attr(
+ target_arch = "aarch64",
+ stable(feature = "neon_intrinsics", since = "1.59.0")
+)]
+pub unsafe fn vpadalq_u32(a: uint64x2_t, b: uint32x4_t) -> uint64x2_t {
+ #[cfg(target_arch = "arm")]
+ {
+ crate::core_arch::arm::neon::vpadalq_u32_(a, b)
+ }
+ #[cfg(target_arch = "aarch64")]
+ {
+ simd_add(vpaddlq_u32_(b), a)
+ }
+}
+
+/// 8-bit integer matrix multiply-accumulate
+#[inline]
+#[cfg_attr(not(bootstrap), target_feature(enable = "i8mm"))]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(smmla))]
+pub unsafe fn vmmlaq_s32(a: int32x4_t, b: int8x16_t, c: int8x16_t) -> int32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.smmla.v4i32.v16i8")]
+ #[cfg_attr(
+ target_arch = "aarch64",
+ link_name = "llvm.aarch64.neon.smmla.v4i32.v16i8"
+ )]
+ fn vmmlaq_s32_(a: int32x4_t, b: int8x16_t, c: int8x16_t) -> int32x4_t;
+ }
+ vmmlaq_s32_(a, b, c)
+}
+
+/// 8-bit integer matrix multiply-accumulate
+#[inline]
+#[cfg_attr(not(bootstrap), target_feature(enable = "i8mm"))]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(ummla))]
+pub unsafe fn vmmlaq_u32(a: uint32x4_t, b: uint8x16_t, c: uint8x16_t) -> uint32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.ummla.v4i32.v16i8")]
+ #[cfg_attr(
+ target_arch = "aarch64",
+ link_name = "llvm.aarch64.neon.ummla.v4i32.v16i8"
+ )]
+ fn vmmlaq_u32_(a: uint32x4_t, b: uint8x16_t, c: uint8x16_t) -> uint32x4_t;
+ }
+ vmmlaq_u32_(a, b, c)
+}
+
+/// Unsigned and signed 8-bit integer matrix multiply-accumulate
+#[inline]
+#[cfg_attr(not(bootstrap), target_feature(enable = "i8mm"))]
+#[target_feature(enable = "neon")]
+#[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))]
+#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
+#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(usmmla))]
+pub unsafe fn vusmmlaq_s32(a: int32x4_t, b: uint8x16_t, c: int8x16_t) -> int32x4_t {
+ #[allow(improper_ctypes)]
+ extern "unadjusted" {
+ #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.usmmla.v4i32.v16i8")]
+ #[cfg_attr(
+ target_arch = "aarch64",
+ link_name = "llvm.aarch64.neon.usmmla.v4i32.v16i8"
+ )]
+ fn vusmmlaq_s32_(a: int32x4_t, b: uint8x16_t, c: int8x16_t) -> int32x4_t;
+ }
+ vusmmlaq_s32_(a, b, c)
+}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+ #[cfg(target_arch = "aarch64")]
+ use crate::core_arch::aarch64::*;
+ #[cfg(target_arch = "arm")]
+ use crate::core_arch::arm::*;
+ use crate::core_arch::arm_shared::test_support::*;
+ use crate::core_arch::simd::*;
+ use std::{i16, i32, i8, mem::transmute, u16, u32, u8, vec::Vec};
+ use stdarch_test::simd_test;
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_lane_s8() {
+ let a = i8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let elem: i8 = 42;
+ let e = i8x8::new(0, 1, 2, 3, 4, 5, 6, 42);
+ let r: i8x8 = transmute(vld1_lane_s8::<7>(&elem, transmute(a)));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_lane_s8() {
+ let a = i8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let elem: i8 = 42;
+ let e = i8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 42);
+ let r: i8x16 = transmute(vld1q_lane_s8::<15>(&elem, transmute(a)));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_lane_s16() {
+ let a = i16x4::new(0, 1, 2, 3);
+ let elem: i16 = 42;
+ let e = i16x4::new(0, 1, 2, 42);
+ let r: i16x4 = transmute(vld1_lane_s16::<3>(&elem, transmute(a)));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_lane_s16() {
+ let a = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let elem: i16 = 42;
+ let e = i16x8::new(0, 1, 2, 3, 4, 5, 6, 42);
+ let r: i16x8 = transmute(vld1q_lane_s16::<7>(&elem, transmute(a)));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_lane_s32() {
+ let a = i32x2::new(0, 1);
+ let elem: i32 = 42;
+ let e = i32x2::new(0, 42);
+ let r: i32x2 = transmute(vld1_lane_s32::<1>(&elem, transmute(a)));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_lane_s32() {
+ let a = i32x4::new(0, 1, 2, 3);
+ let elem: i32 = 42;
+ let e = i32x4::new(0, 1, 2, 42);
+ let r: i32x4 = transmute(vld1q_lane_s32::<3>(&elem, transmute(a)));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_lane_s64() {
+ let a = i64x1::new(0);
+ let elem: i64 = 42;
+ let e = i64x1::new(42);
+ let r: i64x1 = transmute(vld1_lane_s64::<0>(&elem, transmute(a)));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_lane_s64() {
+ let a = i64x2::new(0, 1);
+ let elem: i64 = 42;
+ let e = i64x2::new(0, 42);
+ let r: i64x2 = transmute(vld1q_lane_s64::<1>(&elem, transmute(a)));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_lane_u8() {
+ let a = u8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let elem: u8 = 42;
+ let e = u8x8::new(0, 1, 2, 3, 4, 5, 6, 42);
+ let r: u8x8 = transmute(vld1_lane_u8::<7>(&elem, transmute(a)));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_lane_u8() {
+ let a = u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let elem: u8 = 42;
+ let e = u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 42);
+ let r: u8x16 = transmute(vld1q_lane_u8::<15>(&elem, transmute(a)));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_lane_u16() {
+ let a = u16x4::new(0, 1, 2, 3);
+ let elem: u16 = 42;
+ let e = u16x4::new(0, 1, 2, 42);
+ let r: u16x4 = transmute(vld1_lane_u16::<3>(&elem, transmute(a)));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_lane_u16() {
+ let a = u16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let elem: u16 = 42;
+ let e = u16x8::new(0, 1, 2, 3, 4, 5, 6, 42);
+ let r: u16x8 = transmute(vld1q_lane_u16::<7>(&elem, transmute(a)));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_lane_u32() {
+ let a = u32x2::new(0, 1);
+ let elem: u32 = 42;
+ let e = u32x2::new(0, 42);
+ let r: u32x2 = transmute(vld1_lane_u32::<1>(&elem, transmute(a)));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_lane_u32() {
+ let a = u32x4::new(0, 1, 2, 3);
+ let elem: u32 = 42;
+ let e = u32x4::new(0, 1, 2, 42);
+ let r: u32x4 = transmute(vld1q_lane_u32::<3>(&elem, transmute(a)));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_lane_u64() {
+ let a = u64x1::new(0);
+ let elem: u64 = 42;
+ let e = u64x1::new(42);
+ let r: u64x1 = transmute(vld1_lane_u64::<0>(&elem, transmute(a)));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_lane_u64() {
+ let a = u64x2::new(0, 1);
+ let elem: u64 = 42;
+ let e = u64x2::new(0, 42);
+ let r: u64x2 = transmute(vld1q_lane_u64::<1>(&elem, transmute(a)));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_lane_p8() {
+ let a = u8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let elem: p8 = 42;
+ let e = u8x8::new(0, 1, 2, 3, 4, 5, 6, 42);
+ let r: u8x8 = transmute(vld1_lane_p8::<7>(&elem, transmute(a)));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_lane_p8() {
+ let a = u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let elem: p8 = 42;
+ let e = u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 42);
+ let r: u8x16 = transmute(vld1q_lane_p8::<15>(&elem, transmute(a)));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_lane_p16() {
+ let a = u16x4::new(0, 1, 2, 3);
+ let elem: p16 = 42;
+ let e = u16x4::new(0, 1, 2, 42);
+ let r: u16x4 = transmute(vld1_lane_p16::<3>(&elem, transmute(a)));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_lane_p16() {
+ let a = u16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let elem: p16 = 42;
+ let e = u16x8::new(0, 1, 2, 3, 4, 5, 6, 42);
+ let r: u16x8 = transmute(vld1q_lane_p16::<7>(&elem, transmute(a)));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon,aes")]
+ unsafe fn test_vld1_lane_p64() {
+ let a = u64x1::new(0);
+ let elem: u64 = 42;
+ let e = u64x1::new(42);
+ let r: u64x1 = transmute(vld1_lane_p64::<0>(&elem, transmute(a)));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon,aes")]
+ unsafe fn test_vld1q_lane_p64() {
+ let a = u64x2::new(0, 1);
+ let elem: u64 = 42;
+ let e = u64x2::new(0, 42);
+ let r: u64x2 = transmute(vld1q_lane_p64::<1>(&elem, transmute(a)));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_lane_f32() {
+ let a = f32x2::new(0., 1.);
+ let elem: f32 = 42.;
+ let e = f32x2::new(0., 42.);
+ let r: f32x2 = transmute(vld1_lane_f32::<1>(&elem, transmute(a)));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_lane_f32() {
+ let a = f32x4::new(0., 1., 2., 3.);
+ let elem: f32 = 42.;
+ let e = f32x4::new(0., 1., 2., 42.);
+ let r: f32x4 = transmute(vld1q_lane_f32::<3>(&elem, transmute(a)));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_dup_s8() {
+ let elem: i8 = 42;
+ let e = i8x8::new(42, 42, 42, 42, 42, 42, 42, 42);
+ let r: i8x8 = transmute(vld1_dup_s8(&elem));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_dup_s8() {
+ let elem: i8 = 42;
+ let e = i8x16::new(
+ 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
+ );
+ let r: i8x16 = transmute(vld1q_dup_s8(&elem));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_dup_s16() {
+ let elem: i16 = 42;
+ let e = i16x4::new(42, 42, 42, 42);
+ let r: i16x4 = transmute(vld1_dup_s16(&elem));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_dup_s16() {
+ let elem: i16 = 42;
+ let e = i16x8::new(42, 42, 42, 42, 42, 42, 42, 42);
+ let r: i16x8 = transmute(vld1q_dup_s16(&elem));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_dup_s32() {
+ let elem: i32 = 42;
+ let e = i32x2::new(42, 42);
+ let r: i32x2 = transmute(vld1_dup_s32(&elem));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_dup_s32() {
+ let elem: i32 = 42;
+ let e = i32x4::new(42, 42, 42, 42);
+ let r: i32x4 = transmute(vld1q_dup_s32(&elem));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_dup_s64() {
+ let elem: i64 = 42;
+ let e = i64x1::new(42);
+ let r: i64x1 = transmute(vld1_dup_s64(&elem));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_dup_s64() {
+ let elem: i64 = 42;
+ let e = i64x2::new(42, 42);
+ let r: i64x2 = transmute(vld1q_dup_s64(&elem));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_dup_u8() {
+ let elem: u8 = 42;
+ let e = u8x8::new(42, 42, 42, 42, 42, 42, 42, 42);
+ let r: u8x8 = transmute(vld1_dup_u8(&elem));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_dup_u8() {
+ let elem: u8 = 42;
+ let e = u8x16::new(
+ 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
+ );
+ let r: u8x16 = transmute(vld1q_dup_u8(&elem));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_dup_u16() {
+ let elem: u16 = 42;
+ let e = u16x4::new(42, 42, 42, 42);
+ let r: u16x4 = transmute(vld1_dup_u16(&elem));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_dup_u16() {
+ let elem: u16 = 42;
+ let e = u16x8::new(42, 42, 42, 42, 42, 42, 42, 42);
+ let r: u16x8 = transmute(vld1q_dup_u16(&elem));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_dup_u32() {
+ let elem: u32 = 42;
+ let e = u32x2::new(42, 42);
+ let r: u32x2 = transmute(vld1_dup_u32(&elem));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_dup_u32() {
+ let elem: u32 = 42;
+ let e = u32x4::new(42, 42, 42, 42);
+ let r: u32x4 = transmute(vld1q_dup_u32(&elem));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_dup_u64() {
+ let elem: u64 = 42;
+ let e = u64x1::new(42);
+ let r: u64x1 = transmute(vld1_dup_u64(&elem));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_dup_u64() {
+ let elem: u64 = 42;
+ let e = u64x2::new(42, 42);
+ let r: u64x2 = transmute(vld1q_dup_u64(&elem));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_dup_p8() {
+ let elem: p8 = 42;
+ let e = u8x8::new(42, 42, 42, 42, 42, 42, 42, 42);
+ let r: u8x8 = transmute(vld1_dup_p8(&elem));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_dup_p8() {
+ let elem: p8 = 42;
+ let e = u8x16::new(
+ 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
+ );
+ let r: u8x16 = transmute(vld1q_dup_p8(&elem));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_dup_p16() {
+ let elem: p16 = 42;
+ let e = u16x4::new(42, 42, 42, 42);
+ let r: u16x4 = transmute(vld1_dup_p16(&elem));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_dup_p16() {
+ let elem: p16 = 42;
+ let e = u16x8::new(42, 42, 42, 42, 42, 42, 42, 42);
+ let r: u16x8 = transmute(vld1q_dup_p16(&elem));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon,aes")]
+ unsafe fn test_vld1_dup_p64() {
+ let elem: u64 = 42;
+ let e = u64x1::new(42);
+ let r: u64x1 = transmute(vld1_dup_p64(&elem));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon,aes")]
+ unsafe fn test_vld1q_dup_p64() {
+ let elem: u64 = 42;
+ let e = u64x2::new(42, 42);
+ let r: u64x2 = transmute(vld1q_dup_p64(&elem));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1_dup_f32() {
+ let elem: f32 = 42.;
+ let e = f32x2::new(42., 42.);
+ let r: f32x2 = transmute(vld1_dup_f32(&elem));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vld1q_dup_f32() {
+ let elem: f32 = 42.;
+ let e = f32x4::new(42., 42., 42., 42.);
+ let r: f32x4 = transmute(vld1q_dup_f32(&elem));
+ assert_eq!(r, e)
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vget_lane_u8() {
+ let v = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let r = vget_lane_u8::<1>(transmute(v));
+ assert_eq!(r, 2);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vgetq_lane_u32() {
+ let v = i32x4::new(1, 2, 3, 4);
+ let r = vgetq_lane_u32::<1>(transmute(v));
+ assert_eq!(r, 2);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vgetq_lane_s32() {
+ let v = i32x4::new(1, 2, 3, 4);
+ let r = vgetq_lane_s32::<1>(transmute(v));
+ assert_eq!(r, 2);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vget_lane_u64() {
+ let v: u64 = 1;
+ let r = vget_lane_u64::<0>(transmute(v));
+ assert_eq!(r, 1);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vgetq_lane_u16() {
+ let v = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let r = vgetq_lane_u16::<1>(transmute(v));
+ assert_eq!(r, 2);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vget_lane_s8() {
+ let v = i8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = vget_lane_s8::<2>(transmute(v));
+ assert_eq!(r, 2);
+ let r = vget_lane_s8::<4>(transmute(v));
+ assert_eq!(r, 4);
+ let r = vget_lane_s8::<5>(transmute(v));
+ assert_eq!(r, 5);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vget_lane_p8() {
+ let v = u8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = vget_lane_p8::<2>(transmute(v));
+ assert_eq!(r, 2);
+ let r = vget_lane_p8::<3>(transmute(v));
+ assert_eq!(r, 3);
+ let r = vget_lane_p8::<5>(transmute(v));
+ assert_eq!(r, 5);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vget_lane_p16() {
+ let v = u16x4::new(0, 1, 2, 3);
+ let r = vget_lane_p16::<2>(transmute(v));
+ assert_eq!(r, 2);
+ let r = vget_lane_p16::<3>(transmute(v));
+ assert_eq!(r, 3);
+ let r = vget_lane_p16::<0>(transmute(v));
+ assert_eq!(r, 0);
+ let r = vget_lane_p16::<1>(transmute(v));
+ assert_eq!(r, 1);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vget_lane_s16() {
+ let v = i16x4::new(0, 1, 2, 3);
+ let r = vget_lane_s16::<2>(transmute(v));
+ assert_eq!(r, 2);
+ let r = vget_lane_s16::<3>(transmute(v));
+ assert_eq!(r, 3);
+ let r = vget_lane_s16::<0>(transmute(v));
+ assert_eq!(r, 0);
+ let r = vget_lane_s16::<1>(transmute(v));
+ assert_eq!(r, 1);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vget_lane_u16() {
+ let v = u16x4::new(0, 1, 2, 3);
+ let r = vget_lane_u16::<2>(transmute(v));
+ assert_eq!(r, 2);
+ let r = vget_lane_u16::<3>(transmute(v));
+ assert_eq!(r, 3);
+ let r = vget_lane_u16::<0>(transmute(v));
+ assert_eq!(r, 0);
+ let r = vget_lane_u16::<1>(transmute(v));
+ assert_eq!(r, 1);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vget_lane_f32() {
+ let v = f32x2::new(0.0, 1.0);
+ let r = vget_lane_f32::<1>(transmute(v));
+ assert_eq!(r, 1.0);
+ let r = vget_lane_f32::<0>(transmute(v));
+ assert_eq!(r, 0.0);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vget_lane_s32() {
+ let v = i32x2::new(0, 1);
+ let r = vget_lane_s32::<1>(transmute(v));
+ assert_eq!(r, 1);
+ let r = vget_lane_s32::<0>(transmute(v));
+ assert_eq!(r, 0);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vget_lane_u32() {
+ let v = u32x2::new(0, 1);
+ let r = vget_lane_u32::<1>(transmute(v));
+ assert_eq!(r, 1);
+ let r = vget_lane_u32::<0>(transmute(v));
+ assert_eq!(r, 0);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vget_lane_s64() {
+ let v = i64x1::new(1);
+ let r = vget_lane_s64::<0>(transmute(v));
+ assert_eq!(r, 1);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vget_lane_p64() {
+ let v = u64x1::new(1);
+ let r = vget_lane_p64::<0>(transmute(v));
+ assert_eq!(r, 1);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vgetq_lane_s8() {
+ let v = i8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = vgetq_lane_s8::<7>(transmute(v));
+ assert_eq!(r, 7);
+ let r = vgetq_lane_s8::<13>(transmute(v));
+ assert_eq!(r, 13);
+ let r = vgetq_lane_s8::<3>(transmute(v));
+ assert_eq!(r, 3);
+ let r = vgetq_lane_s8::<0>(transmute(v));
+ assert_eq!(r, 0);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vgetq_lane_p8() {
+ let v = u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = vgetq_lane_p8::<7>(transmute(v));
+ assert_eq!(r, 7);
+ let r = vgetq_lane_p8::<13>(transmute(v));
+ assert_eq!(r, 13);
+ let r = vgetq_lane_p8::<3>(transmute(v));
+ assert_eq!(r, 3);
+ let r = vgetq_lane_p8::<0>(transmute(v));
+ assert_eq!(r, 0);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vgetq_lane_u8() {
+ let v = u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = vgetq_lane_u8::<7>(transmute(v));
+ assert_eq!(r, 7);
+ let r = vgetq_lane_u8::<13>(transmute(v));
+ assert_eq!(r, 13);
+ let r = vgetq_lane_u8::<3>(transmute(v));
+ assert_eq!(r, 3);
+ let r = vgetq_lane_u8::<0>(transmute(v));
+ assert_eq!(r, 0);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vgetq_lane_s16() {
+ let v = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = vgetq_lane_s16::<3>(transmute(v));
+ assert_eq!(r, 3);
+ let r = vgetq_lane_s16::<6>(transmute(v));
+ assert_eq!(r, 6);
+ let r = vgetq_lane_s16::<0>(transmute(v));
+ assert_eq!(r, 0);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vgetq_lane_p16() {
+ let v = u16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = vgetq_lane_p16::<3>(transmute(v));
+ assert_eq!(r, 3);
+ let r = vgetq_lane_p16::<7>(transmute(v));
+ assert_eq!(r, 7);
+ let r = vgetq_lane_p16::<1>(transmute(v));
+ assert_eq!(r, 1);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vgetq_lane_f32() {
+ let v = f32x4::new(0.0, 1.0, 2.0, 3.0);
+ let r = vgetq_lane_f32::<3>(transmute(v));
+ assert_eq!(r, 3.0);
+ let r = vgetq_lane_f32::<0>(transmute(v));
+ assert_eq!(r, 0.0);
+ let r = vgetq_lane_f32::<2>(transmute(v));
+ assert_eq!(r, 2.0);
+ let r = vgetq_lane_f32::<1>(transmute(v));
+ assert_eq!(r, 1.0);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vgetq_lane_s64() {
+ let v = i64x2::new(0, 1);
+ let r = vgetq_lane_s64::<1>(transmute(v));
+ assert_eq!(r, 1);
+ let r = vgetq_lane_s64::<0>(transmute(v));
+ assert_eq!(r, 0);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vgetq_lane_p64() {
+ let v = u64x2::new(0, 1);
+ let r = vgetq_lane_p64::<1>(transmute(v));
+ assert_eq!(r, 1);
+ let r = vgetq_lane_p64::<0>(transmute(v));
+ assert_eq!(r, 0);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vext_s64() {
+ let a: i64x1 = i64x1::new(0);
+ let b: i64x1 = i64x1::new(1);
+ let e: i64x1 = i64x1::new(0);
+ let r: i64x1 = transmute(vext_s64::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vext_u64() {
+ let a: u64x1 = u64x1::new(0);
+ let b: u64x1 = u64x1::new(1);
+ let e: u64x1 = u64x1::new(0);
+ let r: u64x1 = transmute(vext_u64::<0>(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vget_high_s8() {
+ let a = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let e = i8x8::new(9, 10, 11, 12, 13, 14, 15, 16);
+ let r: i8x8 = transmute(vget_high_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vget_high_s16() {
+ let a = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e = i16x4::new(5, 6, 7, 8);
+ let r: i16x4 = transmute(vget_high_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vget_high_s32() {
+ let a = i32x4::new(1, 2, 3, 4);
+ let e = i32x2::new(3, 4);
+ let r: i32x2 = transmute(vget_high_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vget_high_s64() {
+ let a = i64x2::new(1, 2);
+ let e = i64x1::new(2);
+ let r: i64x1 = transmute(vget_high_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vget_high_u8() {
+ let a = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let e = u8x8::new(9, 10, 11, 12, 13, 14, 15, 16);
+ let r: u8x8 = transmute(vget_high_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vget_high_u16() {
+ let a = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e = u16x4::new(5, 6, 7, 8);
+ let r: u16x4 = transmute(vget_high_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vget_high_u32() {
+ let a = u32x4::new(1, 2, 3, 4);
+ let e = u32x2::new(3, 4);
+ let r: u32x2 = transmute(vget_high_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vget_high_u64() {
+ let a = u64x2::new(1, 2);
+ let e = u64x1::new(2);
+ let r: u64x1 = transmute(vget_high_u64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vget_high_p8() {
+ let a = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let e = u8x8::new(9, 10, 11, 12, 13, 14, 15, 16);
+ let r: u8x8 = transmute(vget_high_p8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vget_high_p16() {
+ let a = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e = u16x4::new(5, 6, 7, 8);
+ let r: u16x4 = transmute(vget_high_p16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vget_high_f32() {
+ let a = f32x4::new(1.0, 2.0, 3.0, 4.0);
+ let e = f32x2::new(3.0, 4.0);
+ let r: f32x2 = transmute(vget_high_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vget_low_s8() {
+ let a = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let e = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let r: i8x8 = transmute(vget_low_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vget_low_s16() {
+ let a = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e = i16x4::new(1, 2, 3, 4);
+ let r: i16x4 = transmute(vget_low_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vget_low_s32() {
+ let a = i32x4::new(1, 2, 3, 4);
+ let e = i32x2::new(1, 2);
+ let r: i32x2 = transmute(vget_low_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vget_low_s64() {
+ let a = i64x2::new(1, 2);
+ let e = i64x1::new(1);
+ let r: i64x1 = transmute(vget_low_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vget_low_u8() {
+ let a = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let e = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let r: u8x8 = transmute(vget_low_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vget_low_u16() {
+ let a = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e = u16x4::new(1, 2, 3, 4);
+ let r: u16x4 = transmute(vget_low_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vget_low_u32() {
+ let a = u32x4::new(1, 2, 3, 4);
+ let e = u32x2::new(1, 2);
+ let r: u32x2 = transmute(vget_low_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vget_low_u64() {
+ let a = u64x2::new(1, 2);
+ let e = u64x1::new(1);
+ let r: u64x1 = transmute(vget_low_u64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vget_low_p8() {
+ let a = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let e = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let r: u8x8 = transmute(vget_low_p8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vget_low_p16() {
+ let a = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e = u16x4::new(1, 2, 3, 4);
+ let r: u16x4 = transmute(vget_low_p16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vget_low_f32() {
+ let a = f32x4::new(1.0, 2.0, 3.0, 4.0);
+ let e = f32x2::new(1.0, 2.0);
+ let r: f32x2 = transmute(vget_low_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupq_n_s8() {
+ let v: i8 = 42;
+ let e = i8x16::new(
+ 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
+ );
+ let r: i8x16 = transmute(vdupq_n_s8(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupq_n_s16() {
+ let v: i16 = 64;
+ let e = i16x8::new(64, 64, 64, 64, 64, 64, 64, 64);
+ let r: i16x8 = transmute(vdupq_n_s16(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupq_n_s32() {
+ let v: i32 = 64;
+ let e = i32x4::new(64, 64, 64, 64);
+ let r: i32x4 = transmute(vdupq_n_s32(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupq_n_s64() {
+ let v: i64 = 64;
+ let e = i64x2::new(64, 64);
+ let r: i64x2 = transmute(vdupq_n_s64(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupq_n_u8() {
+ let v: u8 = 64;
+ let e = u8x16::new(
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ );
+ let r: u8x16 = transmute(vdupq_n_u8(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupq_n_u16() {
+ let v: u16 = 64;
+ let e = u16x8::new(64, 64, 64, 64, 64, 64, 64, 64);
+ let r: u16x8 = transmute(vdupq_n_u16(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupq_n_u32() {
+ let v: u32 = 64;
+ let e = u32x4::new(64, 64, 64, 64);
+ let r: u32x4 = transmute(vdupq_n_u32(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupq_n_u64() {
+ let v: u64 = 64;
+ let e = u64x2::new(64, 64);
+ let r: u64x2 = transmute(vdupq_n_u64(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupq_n_p8() {
+ let v: p8 = 64;
+ let e = u8x16::new(
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ );
+ let r: u8x16 = transmute(vdupq_n_p8(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupq_n_p16() {
+ let v: p16 = 64;
+ let e = u16x8::new(64, 64, 64, 64, 64, 64, 64, 64);
+ let r: u16x8 = transmute(vdupq_n_p16(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdupq_n_f32() {
+ let v: f32 = 64.0;
+ let e = f32x4::new(64.0, 64.0, 64.0, 64.0);
+ let r: f32x4 = transmute(vdupq_n_f32(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdup_n_s8() {
+ let v: i8 = 64;
+ let e = i8x8::new(64, 64, 64, 64, 64, 64, 64, 64);
+ let r: i8x8 = transmute(vdup_n_s8(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdup_n_s16() {
+ let v: i16 = 64;
+ let e = i16x4::new(64, 64, 64, 64);
+ let r: i16x4 = transmute(vdup_n_s16(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdup_n_s32() {
+ let v: i32 = 64;
+ let e = i32x2::new(64, 64);
+ let r: i32x2 = transmute(vdup_n_s32(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdup_n_s64() {
+ let v: i64 = 64;
+ let e = i64x1::new(64);
+ let r: i64x1 = transmute(vdup_n_s64(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdup_n_u8() {
+ let v: u8 = 64;
+ let e = u8x8::new(64, 64, 64, 64, 64, 64, 64, 64);
+ let r: u8x8 = transmute(vdup_n_u8(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdup_n_u16() {
+ let v: u16 = 64;
+ let e = u16x4::new(64, 64, 64, 64);
+ let r: u16x4 = transmute(vdup_n_u16(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdup_n_u32() {
+ let v: u32 = 64;
+ let e = u32x2::new(64, 64);
+ let r: u32x2 = transmute(vdup_n_u32(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdup_n_u64() {
+ let v: u64 = 64;
+ let e = u64x1::new(64);
+ let r: u64x1 = transmute(vdup_n_u64(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdup_n_p8() {
+ let v: p8 = 64;
+ let e = u8x8::new(64, 64, 64, 64, 64, 64, 64, 64);
+ let r: u8x8 = transmute(vdup_n_p8(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdup_n_p16() {
+ let v: p16 = 64;
+ let e = u16x4::new(64, 64, 64, 64);
+ let r: u16x4 = transmute(vdup_n_p16(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vdup_n_f32() {
+ let v: f32 = 64.0;
+ let e = f32x2::new(64.0, 64.0);
+ let r: f32x2 = transmute(vdup_n_f32(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vldrq_p128() {
+ let v: [p128; 2] = [1, 2];
+ let e: p128 = 2;
+ let r: p128 = vldrq_p128(v[1..].as_ptr());
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vstrq_p128() {
+ let v: [p128; 2] = [1, 2];
+ let e: p128 = 2;
+ let mut r: p128 = 1;
+ vstrq_p128(&mut r, v[1]);
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmov_n_s8() {
+ let v: i8 = 64;
+ let e = i8x8::new(64, 64, 64, 64, 64, 64, 64, 64);
+ let r: i8x8 = transmute(vmov_n_s8(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmov_n_s16() {
+ let v: i16 = 64;
+ let e = i16x4::new(64, 64, 64, 64);
+ let r: i16x4 = transmute(vmov_n_s16(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmov_n_s32() {
+ let v: i32 = 64;
+ let e = i32x2::new(64, 64);
+ let r: i32x2 = transmute(vmov_n_s32(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmov_n_s64() {
+ let v: i64 = 64;
+ let e = i64x1::new(64);
+ let r: i64x1 = transmute(vmov_n_s64(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmov_n_u8() {
+ let v: u8 = 64;
+ let e = u8x8::new(64, 64, 64, 64, 64, 64, 64, 64);
+ let r: u8x8 = transmute(vmov_n_u8(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmov_n_u16() {
+ let v: u16 = 64;
+ let e = u16x4::new(64, 64, 64, 64);
+ let r: u16x4 = transmute(vmov_n_u16(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmov_n_u32() {
+ let v: u32 = 64;
+ let e = u32x2::new(64, 64);
+ let r: u32x2 = transmute(vmov_n_u32(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmov_n_u64() {
+ let v: u64 = 64;
+ let e = u64x1::new(64);
+ let r: u64x1 = transmute(vmov_n_u64(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmov_n_p8() {
+ let v: p8 = 64;
+ let e = u8x8::new(64, 64, 64, 64, 64, 64, 64, 64);
+ let r: u8x8 = transmute(vmov_n_p8(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmov_n_p16() {
+ let v: p16 = 64;
+ let e = u16x4::new(64, 64, 64, 64);
+ let r: u16x4 = transmute(vmov_n_p16(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmov_n_f32() {
+ let v: f32 = 64.0;
+ let e = f32x2::new(64.0, 64.0);
+ let r: f32x2 = transmute(vmov_n_f32(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmovq_n_s8() {
+ let v: i8 = 64;
+ let e = i8x16::new(
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ );
+ let r: i8x16 = transmute(vmovq_n_s8(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmovq_n_s16() {
+ let v: i16 = 64;
+ let e = i16x8::new(64, 64, 64, 64, 64, 64, 64, 64);
+ let r: i16x8 = transmute(vmovq_n_s16(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmovq_n_s32() {
+ let v: i32 = 64;
+ let e = i32x4::new(64, 64, 64, 64);
+ let r: i32x4 = transmute(vmovq_n_s32(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmovq_n_s64() {
+ let v: i64 = 64;
+ let e = i64x2::new(64, 64);
+ let r: i64x2 = transmute(vmovq_n_s64(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmovq_n_u8() {
+ let v: u8 = 64;
+ let e = u8x16::new(
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ );
+ let r: u8x16 = transmute(vmovq_n_u8(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmovq_n_u16() {
+ let v: u16 = 64;
+ let e = u16x8::new(64, 64, 64, 64, 64, 64, 64, 64);
+ let r: u16x8 = transmute(vmovq_n_u16(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmovq_n_u32() {
+ let v: u32 = 64;
+ let e = u32x4::new(64, 64, 64, 64);
+ let r: u32x4 = transmute(vmovq_n_u32(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmovq_n_u64() {
+ let v: u64 = 64;
+ let e = u64x2::new(64, 64);
+ let r: u64x2 = transmute(vmovq_n_u64(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmovq_n_p8() {
+ let v: p8 = 64;
+ let e = u8x16::new(
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ );
+ let r: u8x16 = transmute(vmovq_n_p8(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmovq_n_p16() {
+ let v: p16 = 64;
+ let e = u16x8::new(64, 64, 64, 64, 64, 64, 64, 64);
+ let r: u16x8 = transmute(vmovq_n_p16(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmovq_n_f32() {
+ let v: f32 = 64.0;
+ let e = f32x4::new(64.0, 64.0, 64.0, 64.0);
+ let r: f32x4 = transmute(vmovq_n_f32(v));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vgetq_lane_u64() {
+ let v = i64x2::new(1, 2);
+ let r = vgetq_lane_u64::<1>(transmute(v));
+ assert_eq!(r, 2);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vadd_s8() {
+ test_ari_s8(
+ |i, j| vadd_s8(i, j),
+ |a: i8, b: i8| -> i8 { a.overflowing_add(b).0 },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddq_s8() {
+ testq_ari_s8(
+ |i, j| vaddq_s8(i, j),
+ |a: i8, b: i8| -> i8 { a.overflowing_add(b).0 },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vadd_s16() {
+ test_ari_s16(
+ |i, j| vadd_s16(i, j),
+ |a: i16, b: i16| -> i16 { a.overflowing_add(b).0 },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddq_s16() {
+ testq_ari_s16(
+ |i, j| vaddq_s16(i, j),
+ |a: i16, b: i16| -> i16 { a.overflowing_add(b).0 },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vadd_s32() {
+ test_ari_s32(
+ |i, j| vadd_s32(i, j),
+ |a: i32, b: i32| -> i32 { a.overflowing_add(b).0 },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddq_s32() {
+ testq_ari_s32(
+ |i, j| vaddq_s32(i, j),
+ |a: i32, b: i32| -> i32 { a.overflowing_add(b).0 },
+ );
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vadd_u8() {
+ test_ari_u8(
+ |i, j| vadd_u8(i, j),
+ |a: u8, b: u8| -> u8 { a.overflowing_add(b).0 },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddq_u8() {
+ testq_ari_u8(
+ |i, j| vaddq_u8(i, j),
+ |a: u8, b: u8| -> u8 { a.overflowing_add(b).0 },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vadd_u16() {
+ test_ari_u16(
+ |i, j| vadd_u16(i, j),
+ |a: u16, b: u16| -> u16 { a.overflowing_add(b).0 },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddq_u16() {
+ testq_ari_u16(
+ |i, j| vaddq_u16(i, j),
+ |a: u16, b: u16| -> u16 { a.overflowing_add(b).0 },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vadd_u32() {
+ test_ari_u32(
+ |i, j| vadd_u32(i, j),
+ |a: u32, b: u32| -> u32 { a.overflowing_add(b).0 },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddq_u32() {
+ testq_ari_u32(
+ |i, j| vaddq_u32(i, j),
+ |a: u32, b: u32| -> u32 { a.overflowing_add(b).0 },
+ );
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vadd_f32() {
+ test_ari_f32(|i, j| vadd_f32(i, j), |a: f32, b: f32| -> f32 { a + b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddq_f32() {
+ testq_ari_f32(|i, j| vaddq_f32(i, j), |a: f32, b: f32| -> f32 { a + b });
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddl_s8() {
+ let v = i8::MAX;
+ let a = i8x8::new(v, v, v, v, v, v, v, v);
+ let v = 2 * (v as i16);
+ let e = i16x8::new(v, v, v, v, v, v, v, v);
+ let r: i16x8 = transmute(vaddl_s8(transmute(a), transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddl_s16() {
+ let v = i16::MAX;
+ let a = i16x4::new(v, v, v, v);
+ let v = 2 * (v as i32);
+ let e = i32x4::new(v, v, v, v);
+ let r: i32x4 = transmute(vaddl_s16(transmute(a), transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddl_s32() {
+ let v = i32::MAX;
+ let a = i32x2::new(v, v);
+ let v = 2 * (v as i64);
+ let e = i64x2::new(v, v);
+ let r: i64x2 = transmute(vaddl_s32(transmute(a), transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddl_u8() {
+ let v = u8::MAX;
+ let a = u8x8::new(v, v, v, v, v, v, v, v);
+ let v = 2 * (v as u16);
+ let e = u16x8::new(v, v, v, v, v, v, v, v);
+ let r: u16x8 = transmute(vaddl_u8(transmute(a), transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddl_u16() {
+ let v = u16::MAX;
+ let a = u16x4::new(v, v, v, v);
+ let v = 2 * (v as u32);
+ let e = u32x4::new(v, v, v, v);
+ let r: u32x4 = transmute(vaddl_u16(transmute(a), transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddl_u32() {
+ let v = u32::MAX;
+ let a = u32x2::new(v, v);
+ let v = 2 * (v as u64);
+ let e = u64x2::new(v, v);
+ let r: u64x2 = transmute(vaddl_u32(transmute(a), transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddl_high_s8() {
+ let a = i8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let x = i8::MAX;
+ let b = i8x16::new(x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x);
+ let x = x as i16;
+ let e = i16x8::new(x + 8, x + 9, x + 10, x + 11, x + 12, x + 13, x + 14, x + 15);
+ let r: i16x8 = transmute(vaddl_high_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddl_high_s16() {
+ let a = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let x = i16::MAX;
+ let b = i16x8::new(x, x, x, x, x, x, x, x);
+ let x = x as i32;
+ let e = i32x4::new(x + 4, x + 5, x + 6, x + 7);
+ let r: i32x4 = transmute(vaddl_high_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddl_high_s32() {
+ let a = i32x4::new(0, 1, 2, 3);
+ let x = i32::MAX;
+ let b = i32x4::new(x, x, x, x);
+ let x = x as i64;
+ let e = i64x2::new(x + 2, x + 3);
+ let r: i64x2 = transmute(vaddl_high_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddl_high_u8() {
+ let a = u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let x = u8::MAX;
+ let b = u8x16::new(x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x);
+ let x = x as u16;
+ let e = u16x8::new(x + 8, x + 9, x + 10, x + 11, x + 12, x + 13, x + 14, x + 15);
+ let r: u16x8 = transmute(vaddl_high_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddl_high_u16() {
+ let a = u16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let x = u16::MAX;
+ let b = u16x8::new(x, x, x, x, x, x, x, x);
+ let x = x as u32;
+ let e = u32x4::new(x + 4, x + 5, x + 6, x + 7);
+ let r: u32x4 = transmute(vaddl_high_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddl_high_u32() {
+ let a = u32x4::new(0, 1, 2, 3);
+ let x = u32::MAX;
+ let b = u32x4::new(x, x, x, x);
+ let x = x as u64;
+ let e = u64x2::new(x + 2, x + 3);
+ let r: u64x2 = transmute(vaddl_high_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddw_s8() {
+ let x = i16::MAX;
+ let a = i16x8::new(x, 1, 2, 3, 4, 5, 6, 7);
+ let y = i8::MAX;
+ let b = i8x8::new(y, y, y, y, y, y, y, y);
+ let y = y as i16;
+ let e = i16x8::new(
+ x.wrapping_add(y),
+ 1 + y,
+ 2 + y,
+ 3 + y,
+ 4 + y,
+ 5 + y,
+ 6 + y,
+ 7 + y,
+ );
+ let r: i16x8 = transmute(vaddw_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddw_s16() {
+ let x = i32::MAX;
+ let a = i32x4::new(x, 1, 2, 3);
+ let y = i16::MAX;
+ let b = i16x4::new(y, y, y, y);
+ let y = y as i32;
+ let e = i32x4::new(x.wrapping_add(y), 1 + y, 2 + y, 3 + y);
+ let r: i32x4 = transmute(vaddw_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddw_s32() {
+ let x = i64::MAX;
+ let a = i64x2::new(x, 1);
+ let y = i32::MAX;
+ let b = i32x2::new(y, y);
+ let y = y as i64;
+ let e = i64x2::new(x.wrapping_add(y), 1 + y);
+ let r: i64x2 = transmute(vaddw_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddw_u8() {
+ let x = u16::MAX;
+ let a = u16x8::new(x, 1, 2, 3, 4, 5, 6, 7);
+ let y = u8::MAX;
+ let b = u8x8::new(y, y, y, y, y, y, y, y);
+ let y = y as u16;
+ let e = u16x8::new(
+ x.wrapping_add(y),
+ 1 + y,
+ 2 + y,
+ 3 + y,
+ 4 + y,
+ 5 + y,
+ 6 + y,
+ 7 + y,
+ );
+ let r: u16x8 = transmute(vaddw_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddw_u16() {
+ let x = u32::MAX;
+ let a = u32x4::new(x, 1, 2, 3);
+ let y = u16::MAX;
+ let b = u16x4::new(y, y, y, y);
+ let y = y as u32;
+ let e = u32x4::new(x.wrapping_add(y), 1 + y, 2 + y, 3 + y);
+ let r: u32x4 = transmute(vaddw_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddw_u32() {
+ let x = u64::MAX;
+ let a = u64x2::new(x, 1);
+ let y = u32::MAX;
+ let b = u32x2::new(y, y);
+ let y = y as u64;
+ let e = u64x2::new(x.wrapping_add(y), 1 + y);
+ let r: u64x2 = transmute(vaddw_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddw_high_s8() {
+ let x = i16::MAX;
+ let a = i16x8::new(x, 1, 2, 3, 4, 5, 6, 7);
+ let y = i8::MAX;
+ let b = i8x16::new(0, 0, 0, 0, 0, 0, 0, 0, y, y, y, y, y, y, y, y);
+ let y = y as i16;
+ let e = i16x8::new(
+ x.wrapping_add(y),
+ 1 + y,
+ 2 + y,
+ 3 + y,
+ 4 + y,
+ 5 + y,
+ 6 + y,
+ 7 + y,
+ );
+ let r: i16x8 = transmute(vaddw_high_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddw_high_s16() {
+ let x = i32::MAX;
+ let a = i32x4::new(x, 1, 2, 3);
+ let y = i16::MAX;
+ let b = i16x8::new(0, 0, 0, 0, y, y, y, y);
+ let y = y as i32;
+ let e = i32x4::new(x.wrapping_add(y), 1 + y, 2 + y, 3 + y);
+ let r: i32x4 = transmute(vaddw_high_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddw_high_s32() {
+ let x = i64::MAX;
+ let a = i64x2::new(x, 1);
+ let y = i32::MAX;
+ let b = i32x4::new(0, 0, y, y);
+ let y = y as i64;
+ let e = i64x2::new(x.wrapping_add(y), 1 + y);
+ let r: i64x2 = transmute(vaddw_high_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddw_high_u8() {
+ let x = u16::MAX;
+ let a = u16x8::new(x, 1, 2, 3, 4, 5, 6, 7);
+ let y = u8::MAX;
+ let b = u8x16::new(0, 0, 0, 0, 0, 0, 0, 0, y, y, y, y, y, y, y, y);
+ let y = y as u16;
+ let e = u16x8::new(
+ x.wrapping_add(y),
+ 1 + y,
+ 2 + y,
+ 3 + y,
+ 4 + y,
+ 5 + y,
+ 6 + y,
+ 7 + y,
+ );
+ let r: u16x8 = transmute(vaddw_high_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddw_high_u16() {
+ let x = u32::MAX;
+ let a = u32x4::new(x, 1, 2, 3);
+ let y = u16::MAX;
+ let b = u16x8::new(0, 0, 0, 0, y, y, y, y);
+ let y = y as u32;
+ let e = u32x4::new(x.wrapping_add(y), 1 + y, 2 + y, 3 + y);
+ let r: u32x4 = transmute(vaddw_high_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddw_high_u32() {
+ let x = u64::MAX;
+ let a = u64x2::new(x, 1);
+ let y = u32::MAX;
+ let b = u32x4::new(0, 0, y, y);
+ let y = y as u64;
+ let e = u64x2::new(x.wrapping_add(y), 1 + y);
+ let r: u64x2 = transmute(vaddw_high_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddhn_s16() {
+ let a = i16x8::new(
+ (0 << 8) + 1,
+ (1 << 8) + 1,
+ (2 << 8) + 1,
+ (3 << 8) + 1,
+ (4 << 8) + 1,
+ (5 << 8) + 1,
+ (6 << 8) + 1,
+ (7 << 8) + 1,
+ );
+ let e = i8x8::new(0, 2, 4, 6, 8, 10, 12, 14);
+ let r: i8x8 = transmute(vaddhn_s16(transmute(a), transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddhn_s32() {
+ let a = i32x4::new((0 << 16) + 1, (1 << 16) + 1, (2 << 16) + 1, (3 << 16) + 1);
+ let e = i16x4::new(0, 2, 4, 6);
+ let r: i16x4 = transmute(vaddhn_s32(transmute(a), transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddhn_s64() {
+ let a = i64x2::new((0 << 32) + 1, (1 << 32) + 1);
+ let e = i32x2::new(0, 2);
+ let r: i32x2 = transmute(vaddhn_s64(transmute(a), transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddhn_u16() {
+ let a = u16x8::new(
+ (0 << 8) + 1,
+ (1 << 8) + 1,
+ (2 << 8) + 1,
+ (3 << 8) + 1,
+ (4 << 8) + 1,
+ (5 << 8) + 1,
+ (6 << 8) + 1,
+ (7 << 8) + 1,
+ );
+ let e = u8x8::new(0, 2, 4, 6, 8, 10, 12, 14);
+ let r: u8x8 = transmute(vaddhn_u16(transmute(a), transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddhn_u32() {
+ let a = u32x4::new((0 << 16) + 1, (1 << 16) + 1, (2 << 16) + 1, (3 << 16) + 1);
+ let e = u16x4::new(0, 2, 4, 6);
+ let r: u16x4 = transmute(vaddhn_u32(transmute(a), transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddhn_u64() {
+ let a = u64x2::new((0 << 32) + 1, (1 << 32) + 1);
+ let e = u32x2::new(0, 2);
+ let r: u32x2 = transmute(vaddhn_u64(transmute(a), transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddhn_high_s16() {
+ let r = i8x8::splat(42);
+ let a = i16x8::new(
+ (0 << 8) + 1,
+ (1 << 8) + 1,
+ (2 << 8) + 1,
+ (3 << 8) + 1,
+ (4 << 8) + 1,
+ (5 << 8) + 1,
+ (6 << 8) + 1,
+ (7 << 8) + 1,
+ );
+ let e = i8x16::new(42, 42, 42, 42, 42, 42, 42, 42, 0, 2, 4, 6, 8, 10, 12, 14);
+ let r: i8x16 = transmute(vaddhn_high_s16(transmute(r), transmute(a), transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddhn_high_s32() {
+ let r = i16x4::splat(42);
+ let a = i32x4::new((0 << 16) + 1, (1 << 16) + 1, (2 << 16) + 1, (3 << 16) + 1);
+ let e = i16x8::new(42, 42, 42, 42, 0, 2, 4, 6);
+ let r: i16x8 = transmute(vaddhn_high_s32(transmute(r), transmute(a), transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddhn_high_s64() {
+ let r = i32x2::splat(42);
+ let a = i64x2::new((0 << 32) + 1, (1 << 32) + 1);
+ let e = i32x4::new(42, 42, 0, 2);
+ let r: i32x4 = transmute(vaddhn_high_s64(transmute(r), transmute(a), transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddhn_high_u16() {
+ let r = u8x8::splat(42);
+ let a = u16x8::new(
+ (0 << 8) + 1,
+ (1 << 8) + 1,
+ (2 << 8) + 1,
+ (3 << 8) + 1,
+ (4 << 8) + 1,
+ (5 << 8) + 1,
+ (6 << 8) + 1,
+ (7 << 8) + 1,
+ );
+ let e = u8x16::new(42, 42, 42, 42, 42, 42, 42, 42, 0, 2, 4, 6, 8, 10, 12, 14);
+ let r: u8x16 = transmute(vaddhn_high_u16(transmute(r), transmute(a), transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddhn_high_u32() {
+ let r = u16x4::splat(42);
+ let a = u32x4::new((0 << 16) + 1, (1 << 16) + 1, (2 << 16) + 1, (3 << 16) + 1);
+ let e = u16x8::new(42, 42, 42, 42, 0, 2, 4, 6);
+ let r: u16x8 = transmute(vaddhn_high_u32(transmute(r), transmute(a), transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaddhn_high_u64() {
+ let r = u32x2::splat(42);
+ let a = u64x2::new((0 << 32) + 1, (1 << 32) + 1);
+ let e = u32x4::new(42, 42, 0, 2);
+ let r: u32x4 = transmute(vaddhn_high_u64(transmute(r), transmute(a), transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vraddhn_s16() {
+ let round_constant: i16 = (1 << 8) - 1;
+ let a = i16x8::new(
+ 0 << 8,
+ 1 << 8,
+ 2 << 8,
+ 3 << 8,
+ 4 << 8,
+ 5 << 8,
+ 6 << 8,
+ 7 << 8,
+ );
+ let b = i16x8::new(
+ 0 << 8,
+ (1 << 8) + round_constant,
+ 2 << 8,
+ (3 << 8) + round_constant,
+ 4 << 8,
+ (5 << 8) + round_constant,
+ 6 << 8,
+ (7 << 8) + round_constant,
+ );
+ let e = i8x8::new(0, 3, 4, 7, 8, 11, 12, 15);
+ let r: i8x8 = transmute(vraddhn_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vraddhn_s32() {
+ let round_constant: i32 = (1 << 16) - 1;
+ let a = i32x4::new(0 << 16, 1 << 16, 2 << 16, 3 << 16);
+ let b = i32x4::new(
+ 0 << 16,
+ (1 << 16) + round_constant,
+ 2 << 16,
+ (3 << 16) + round_constant,
+ );
+ let e = i16x4::new(0, 3, 4, 7);
+ let r: i16x4 = transmute(vraddhn_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vraddhn_s64() {
+ let round_constant: i64 = (1 << 32) - 1;
+ let a = i64x2::new(0 << 32, 1 << 32);
+ let b = i64x2::new(0 << 32, (1 << 32) + round_constant);
+ let e = i32x2::new(0, 3);
+ let r: i32x2 = transmute(vraddhn_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vraddhn_u16() {
+ let round_constant: u16 = (1 << 8) - 1;
+ let a = u16x8::new(
+ 0 << 8,
+ 1 << 8,
+ 2 << 8,
+ 3 << 8,
+ 4 << 8,
+ 5 << 8,
+ 6 << 8,
+ 7 << 8,
+ );
+ let b = u16x8::new(
+ 0 << 8,
+ (1 << 8) + round_constant,
+ 2 << 8,
+ (3 << 8) + round_constant,
+ 4 << 8,
+ (5 << 8) + round_constant,
+ 6 << 8,
+ (7 << 8) + round_constant,
+ );
+ let e = u8x8::new(0, 3, 4, 7, 8, 11, 12, 15);
+ let r: u8x8 = transmute(vraddhn_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vraddhn_u32() {
+ let round_constant: u32 = (1 << 16) - 1;
+ let a = u32x4::new(0 << 16, 1 << 16, 2 << 16, 3 << 16);
+ let b = u32x4::new(
+ 0 << 16,
+ (1 << 16) + round_constant,
+ 2 << 16,
+ (3 << 16) + round_constant,
+ );
+ let e = u16x4::new(0, 3, 4, 7);
+ let r: u16x4 = transmute(vraddhn_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vraddhn_u64() {
+ let round_constant: u64 = (1 << 32) - 1;
+ let a = u64x2::new(0 << 32, 1 << 32);
+ let b = u64x2::new(0 << 32, (1 << 32) + round_constant);
+ let e = u32x2::new(0, 3);
+ let r: u32x2 = transmute(vraddhn_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vraddhn_high_s16() {
+ let r = i8x8::splat(42);
+ let round_constant: i16 = (1 << 8) - 1;
+ let a = i16x8::new(
+ 0 << 8,
+ 1 << 8,
+ 2 << 8,
+ 3 << 8,
+ 4 << 8,
+ 5 << 8,
+ 6 << 8,
+ 7 << 8,
+ );
+ let b = i16x8::new(
+ 0 << 8,
+ (1 << 8) + round_constant,
+ 2 << 8,
+ (3 << 8) + round_constant,
+ 4 << 8,
+ (5 << 8) + round_constant,
+ 6 << 8,
+ (7 << 8) + round_constant,
+ );
+ let e = i8x16::new(42, 42, 42, 42, 42, 42, 42, 42, 0, 3, 4, 7, 8, 11, 12, 15);
+ let r: i8x16 = transmute(vraddhn_high_s16(transmute(r), transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vraddhn_high_s32() {
+ let r = i16x4::splat(42);
+ let round_constant: i32 = (1 << 16) - 1;
+ let a = i32x4::new(0 << 16, 1 << 16, 2 << 16, 3 << 16);
+ let b = i32x4::new(
+ 0 << 16,
+ (1 << 16) + round_constant,
+ 2 << 16,
+ (3 << 16) + round_constant,
+ );
+ let e = i16x8::new(42, 42, 42, 42, 0, 3, 4, 7);
+ let r: i16x8 = transmute(vraddhn_high_s32(transmute(r), transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vraddhn_high_s64() {
+ let r = i32x2::splat(42);
+ let round_constant: i64 = (1 << 32) - 1;
+ let a = i64x2::new(0 << 32, 1 << 32);
+ let b = i64x2::new(0 << 32, (1 << 32) + round_constant);
+ let e = i32x4::new(42, 42, 0, 3);
+ let r: i32x4 = transmute(vraddhn_high_s64(transmute(r), transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vraddhn_high_u16() {
+ let r = u8x8::splat(42);
+ let round_constant: u16 = (1 << 8) - 1;
+ let a = u16x8::new(
+ 0 << 8,
+ 1 << 8,
+ 2 << 8,
+ 3 << 8,
+ 4 << 8,
+ 5 << 8,
+ 6 << 8,
+ 7 << 8,
+ );
+ let b = u16x8::new(
+ 0 << 8,
+ (1 << 8) + round_constant,
+ 2 << 8,
+ (3 << 8) + round_constant,
+ 4 << 8,
+ (5 << 8) + round_constant,
+ 6 << 8,
+ (7 << 8) + round_constant,
+ );
+ let e = u8x16::new(42, 42, 42, 42, 42, 42, 42, 42, 0, 3, 4, 7, 8, 11, 12, 15);
+ let r: u8x16 = transmute(vraddhn_high_u16(transmute(r), transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vraddhn_high_u32() {
+ let r = u16x4::splat(42);
+ let round_constant: u32 = (1 << 16) - 1;
+ let a = u32x4::new(0 << 16, 1 << 16, 2 << 16, 3 << 16);
+ let b = u32x4::new(
+ 0 << 16,
+ (1 << 16) + round_constant,
+ 2 << 16,
+ (3 << 16) + round_constant,
+ );
+ let e = u16x8::new(42, 42, 42, 42, 0, 3, 4, 7);
+ let r: u16x8 = transmute(vraddhn_high_s32(transmute(r), transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vraddhn_high_u64() {
+ let r = u32x2::splat(42);
+ let round_constant: u64 = (1 << 32) - 1;
+ let a = u64x2::new(0 << 32, 1 << 32);
+ let b = u64x2::new(0 << 32, (1 << 32) + round_constant);
+ let e = u32x4::new(42, 42, 0, 3);
+ let r: u32x4 = transmute(vraddhn_high_s64(transmute(r), transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpaddl_s8() {
+ let a = i8x8::new(-4, -3, -2, -1, 0, 1, 2, 3);
+ let r: i16x4 = transmute(vpaddl_s8(transmute(a)));
+ let e = i16x4::new(-7, -3, 1, 5);
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpaddl_s16() {
+ let a = i16x4::new(-2, -1, 0, 1);
+ let r: i32x2 = transmute(vpaddl_s16(transmute(a)));
+ let e = i32x2::new(-3, 1);
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpaddl_s32() {
+ let a = i32x2::new(-1, 0);
+ let r: i64x1 = transmute(vpaddl_s32(transmute(a)));
+ let e = i64x1::new(-1);
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpaddlq_s8() {
+ let a = i8x16::new(-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7);
+ let r: i16x8 = transmute(vpaddlq_s8(transmute(a)));
+ let e = i16x8::new(-15, -11, -7, -3, 1, 5, 9, 13);
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpaddlq_s16() {
+ let a = i16x8::new(-4, -3, -2, -1, 0, 1, 2, 3);
+ let r: i32x4 = transmute(vpaddlq_s16(transmute(a)));
+ let e = i32x4::new(-7, -3, 1, 5);
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpaddlq_s32() {
+ let a = i32x4::new(-2, -1, 0, 1);
+ let r: i64x2 = transmute(vpaddlq_s32(transmute(a)));
+ let e = i64x2::new(-3, 1);
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpaddl_u8() {
+ let a = u8x8::new(0, 1, 2, 3, 4, 5, 6, u8::MAX);
+ let r: u16x4 = transmute(vpaddl_u8(transmute(a)));
+ let e = u16x4::new(1, 5, 9, u8::MAX as u16 + 6);
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpaddl_u16() {
+ let a = u16x4::new(0, 1, 2, u16::MAX);
+ let r: u32x2 = transmute(vpaddl_u16(transmute(a)));
+ let e = u32x2::new(1, u16::MAX as u32 + 2);
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpaddl_u32() {
+ let a = u32x2::new(1, u32::MAX);
+ let r: u64x1 = transmute(vpaddl_u32(transmute(a)));
+ let e = u64x1::new(u32::MAX as u64 + 1);
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpaddlq_u8() {
+ let a = u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, u8::MAX);
+ let r: u16x8 = transmute(vpaddlq_u8(transmute(a)));
+ let e = u16x8::new(1, 5, 9, 13, 17, 21, 25, u8::MAX as u16 + 14);
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpaddlq_u16() {
+ let a = u16x8::new(0, 1, 2, 3, 4, 5, 6, u16::MAX);
+ let r: u32x4 = transmute(vpaddlq_u16(transmute(a)));
+ let e = u32x4::new(1, 5, 9, u16::MAX as u32 + 6);
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpaddlq_u32() {
+ let a = u32x4::new(0, 1, 2, u32::MAX);
+ let r: u64x2 = transmute(vpaddlq_u32(transmute(a)));
+ let e = u64x2::new(1, u32::MAX as u64 + 2);
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpadal_s8() {
+ let a = i16x4::new(42, 42, 42, 42);
+ let b = i8x8::new(-4, -3, -2, -1, 0, 1, 2, 3);
+ let r: i16x4 = transmute(vpadal_s8(transmute(a), transmute(b)));
+ let e = i16x4::new(35, 39, 43, 47);
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpadal_s16() {
+ let a = i32x2::new(42, 42);
+ let b = i16x4::new(-2, -1, 0, 1);
+ let r: i32x2 = transmute(vpadal_s16(transmute(a), transmute(b)));
+ let e = i32x2::new(39, 43);
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpadal_s32() {
+ let a = i64x1::new(42);
+ let b = i32x2::new(-1, 0);
+ let r: i64x1 = transmute(vpadal_s32(transmute(a), transmute(b)));
+ let e = i64x1::new(41);
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpadalq_s8() {
+ let a = i16x8::new(42, 42, 42, 42, 42, 42, 42, 42);
+ let b = i8x16::new(-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7);
+ let r: i16x8 = transmute(vpadalq_s8(transmute(a), transmute(b)));
+ let e = i16x8::new(27, 31, 35, 39, 43, 47, 51, 55);
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpadalq_s16() {
+ let a = i32x4::new(42, 42, 42, 42);
+ let b = i16x8::new(-4, -3, -2, -1, 0, 1, 2, 3);
+ let r: i32x4 = transmute(vpadalq_s16(transmute(a), transmute(b)));
+ let e = i32x4::new(35, 39, 43, 47);
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpadalq_s32() {
+ let a = i64x2::new(42, 42);
+ let b = i32x4::new(-2, -1, 0, 1);
+ let r: i64x2 = transmute(vpadalq_s32(transmute(a), transmute(b)));
+ let e = i64x2::new(39, 43);
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpadal_u8() {
+ let a = u16x4::new(42, 42, 42, 42);
+ let b = u8x8::new(0, 1, 2, 3, 4, 5, 6, u8::MAX);
+ let r: u16x4 = transmute(vpadal_u8(transmute(a), transmute(b)));
+ let e = u16x4::new(43, 47, 51, u8::MAX as u16 + 48);
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpadal_u16() {
+ let a = u32x2::new(42, 42);
+ let b = u16x4::new(0, 1, 2, u16::MAX);
+ let r: u32x2 = transmute(vpadal_u16(transmute(a), transmute(b)));
+ let e = u32x2::new(43, u16::MAX as u32 + 44);
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpadal_u32() {
+ let a = u64x1::new(42);
+ let b = u32x2::new(1, u32::MAX);
+ let r: u64x1 = transmute(vpadal_u32(transmute(a), transmute(b)));
+ let e = u64x1::new(u32::MAX as u64 + 43);
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpadalq_u8() {
+ let a = u16x8::new(42, 42, 42, 42, 42, 42, 42, 42);
+ let b = u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, u8::MAX);
+ let r: u16x8 = transmute(vpadalq_u8(transmute(a), transmute(b)));
+ let e = u16x8::new(43, 47, 51, 55, 59, 63, 67, u8::MAX as u16 + 56);
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpadalq_u16() {
+ let a = u32x4::new(42, 42, 42, 42);
+ let b = u16x8::new(0, 1, 2, 3, 4, 5, 6, u16::MAX);
+ let r: u32x4 = transmute(vpadalq_u16(transmute(a), transmute(b)));
+ let e = u32x4::new(43, 47, 51, u16::MAX as u32 + 48);
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpadalq_u32() {
+ let a = u64x2::new(42, 42);
+ let b = u32x4::new(0, 1, 2, u32::MAX);
+ let r: u64x2 = transmute(vpadalq_u32(transmute(a), transmute(b)));
+ let e = u64x2::new(43, u32::MAX as u64 + 44);
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmvn_s8() {
+ let a = i8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let e = i8x8::new(-1, -2, -3, -4, -5, -6, -7, -8);
+ let r: i8x8 = transmute(vmvn_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmvnq_s8() {
+ let a = i8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let e = i8x16::new(
+ -1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -16,
+ );
+ let r: i8x16 = transmute(vmvnq_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmvn_s16() {
+ let a = i16x4::new(0, 1, 2, 3);
+ let e = i16x4::new(-1, -2, -3, -4);
+ let r: i16x4 = transmute(vmvn_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmvnq_s16() {
+ let a = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let e = i16x8::new(-1, -2, -3, -4, -5, -6, -7, -8);
+ let r: i16x8 = transmute(vmvnq_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmvn_s32() {
+ let a = i32x2::new(0, 1);
+ let e = i32x2::new(-1, -2);
+ let r: i32x2 = transmute(vmvn_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmvnq_s32() {
+ let a = i32x4::new(0, 1, 2, 3);
+ let e = i32x4::new(-1, -2, -3, -4);
+ let r: i32x4 = transmute(vmvnq_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmvn_u8() {
+ let a = u8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let e = u8x8::new(255, 254, 253, 252, 251, 250, 249, 248);
+ let r: u8x8 = transmute(vmvn_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmvnq_u8() {
+ let a = u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let e = u8x16::new(
+ 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240,
+ );
+ let r: u8x16 = transmute(vmvnq_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmvn_u16() {
+ let a = u16x4::new(0, 1, 2, 3);
+ let e = u16x4::new(65_535, 65_534, 65_533, 65_532);
+ let r: u16x4 = transmute(vmvn_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmvnq_u16() {
+ let a = u16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let e = u16x8::new(
+ 65_535, 65_534, 65_533, 65_532, 65_531, 65_530, 65_529, 65_528,
+ );
+ let r: u16x8 = transmute(vmvnq_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmvn_u32() {
+ let a = u32x2::new(0, 1);
+ let e = u32x2::new(4_294_967_295, 4_294_967_294);
+ let r: u32x2 = transmute(vmvn_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmvnq_u32() {
+ let a = u32x4::new(0, 1, 2, 3);
+ let e = u32x4::new(4_294_967_295, 4_294_967_294, 4_294_967_293, 4_294_967_292);
+ let r: u32x4 = transmute(vmvnq_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmvn_p8() {
+ let a = u8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let e = u8x8::new(255, 254, 253, 252, 251, 250, 249, 248);
+ let r: u8x8 = transmute(vmvn_p8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmvnq_p8() {
+ let a = u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let e = u8x16::new(
+ 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240,
+ );
+ let r: u8x16 = transmute(vmvnq_p8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vbic_s8() {
+ let a = i8x8::new(0, -1, -2, -3, -4, -5, -6, -7);
+ let b = i8x8::new(1, 1, 1, 1, 1, 1, 1, 1);
+ let e = i8x8::new(0, -2, -2, -4, -4, -6, -6, -8);
+ let r: i8x8 = transmute(vbic_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vbicq_s8() {
+ let a = i8x16::new(
+ 0, -1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15,
+ );
+ let b = i8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
+ let e = i8x16::new(
+ 0, -2, -2, -4, -4, -6, -6, -8, -8, -10, -10, -12, -12, -14, -14, -16,
+ );
+ let r: i8x16 = transmute(vbicq_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vbic_s16() {
+ let a = i16x4::new(0, -1, -2, -3);
+ let b = i16x4::new(1, 1, 1, 1);
+ let e = i16x4::new(0, -2, -2, -4);
+ let r: i16x4 = transmute(vbic_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vbicq_s16() {
+ let a = i16x8::new(0, -1, -2, -3, -4, -5, -6, -7);
+ let b = i16x8::new(1, 1, 1, 1, 1, 1, 1, 1);
+ let e = i16x8::new(0, -2, -2, -4, -4, -6, -6, -8);
+ let r: i16x8 = transmute(vbicq_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vbic_s32() {
+ let a = i32x2::new(0, -1);
+ let b = i32x2::new(1, 1);
+ let e = i32x2::new(0, -2);
+ let r: i32x2 = transmute(vbic_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vbicq_s32() {
+ let a = i32x4::new(0, -1, -2, -3);
+ let b = i32x4::new(1, 1, 1, 1);
+ let e = i32x4::new(0, -2, -2, -4);
+ let r: i32x4 = transmute(vbicq_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vbic_s64() {
+ let a = i64x1::new(-1);
+ let b = i64x1::new(1);
+ let e = i64x1::new(-2);
+ let r: i64x1 = transmute(vbic_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vbicq_s64() {
+ let a = i64x2::new(0, -1);
+ let b = i64x2::new(1, 1);
+ let e = i64x2::new(0, -2);
+ let r: i64x2 = transmute(vbicq_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vbic_u8() {
+ let a = u8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let b = u8x8::new(1, 1, 1, 1, 1, 1, 1, 1);
+ let e = u8x8::new(0, 0, 2, 2, 4, 4, 6, 6);
+ let r: u8x8 = transmute(vbic_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vbicq_u8() {
+ let a = u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let b = u8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
+ let e = u8x16::new(0, 0, 2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12, 14, 14);
+ let r: u8x16 = transmute(vbicq_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vbic_u16() {
+ let a = u16x4::new(0, 1, 2, 3);
+ let b = u16x4::new(1, 1, 1, 1);
+ let e = u16x4::new(0, 0, 2, 2);
+ let r: u16x4 = transmute(vbic_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vbicq_u16() {
+ let a = u16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let b = u16x8::new(1, 1, 1, 1, 1, 1, 1, 1);
+ let e = u16x8::new(0, 0, 2, 2, 4, 4, 6, 6);
+ let r: u16x8 = transmute(vbicq_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vbic_u32() {
+ let a = u32x2::new(0, 1);
+ let b = u32x2::new(1, 1);
+ let e = u32x2::new(0, 0);
+ let r: u32x2 = transmute(vbic_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vbicq_u32() {
+ let a = u32x4::new(0, 1, 2, 3);
+ let b = u32x4::new(1, 1, 1, 1);
+ let e = u32x4::new(0, 0, 2, 2);
+ let r: u32x4 = transmute(vbicq_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vbic_u64() {
+ let a = u64x1::new(1);
+ let b = u64x1::new(1);
+ let e = u64x1::new(0);
+ let r: u64x1 = transmute(vbic_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vbicq_u64() {
+ let a = u64x2::new(0, 1);
+ let b = u64x2::new(1, 1);
+ let e = u64x2::new(0, 0);
+ let r: u64x2 = transmute(vbicq_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vbsl_s8() {
+ let a = u8x8::new(u8::MAX, 0, u8::MAX, 0, u8::MAX, 0, u8::MAX, 0);
+ let b = i8x8::new(
+ i8::MAX,
+ i8::MAX,
+ i8::MAX,
+ i8::MAX,
+ i8::MAX,
+ i8::MAX,
+ i8::MAX,
+ i8::MAX,
+ );
+ let c = i8x8::new(
+ i8::MIN,
+ i8::MIN,
+ i8::MIN,
+ i8::MIN,
+ i8::MIN,
+ i8::MIN,
+ i8::MIN,
+ i8::MIN,
+ );
+ let e = i8x8::new(
+ i8::MAX,
+ i8::MIN,
+ i8::MAX,
+ i8::MIN,
+ i8::MAX,
+ i8::MIN,
+ i8::MAX,
+ i8::MIN,
+ );
+ let r: i8x8 = transmute(vbsl_s8(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vbsl_s16() {
+ let a = u16x4::new(u16::MAX, 0, u16::MAX, 0);
+ let b = i16x4::new(i16::MAX, i16::MAX, i16::MAX, i16::MAX);
+ let c = i16x4::new(i16::MIN, i16::MIN, i16::MIN, i16::MIN);
+ let e = i16x4::new(i16::MAX, i16::MIN, i16::MAX, i16::MIN);
+ let r: i16x4 = transmute(vbsl_s16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vbsl_s32() {
+ let a = u32x2::new(u32::MAX, u32::MIN);
+ let b = i32x2::new(i32::MAX, i32::MAX);
+ let c = i32x2::new(i32::MIN, i32::MIN);
+ let e = i32x2::new(i32::MAX, i32::MIN);
+ let r: i32x2 = transmute(vbsl_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vbsl_s64() {
+ let a = u64x1::new(u64::MAX);
+ let b = i64x1::new(i64::MAX);
+ let c = i64x1::new(i64::MIN);
+ let e = i64x1::new(i64::MAX);
+ let r: i64x1 = transmute(vbsl_s64(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vbsl_u8() {
+ let a = u8x8::new(u8::MAX, 0, u8::MAX, 0, u8::MAX, 0, u8::MAX, 0);
+ let b = u8x8::new(
+ u8::MAX,
+ u8::MAX,
+ u8::MAX,
+ u8::MAX,
+ u8::MAX,
+ u8::MAX,
+ u8::MAX,
+ u8::MAX,
+ );
+ let c = u8x8::new(
+ u8::MIN,
+ u8::MIN,
+ u8::MIN,
+ u8::MIN,
+ u8::MIN,
+ u8::MIN,
+ u8::MIN,
+ u8::MIN,
+ );
+ let e = u8x8::new(
+ u8::MAX,
+ u8::MIN,
+ u8::MAX,
+ u8::MIN,
+ u8::MAX,
+ u8::MIN,
+ u8::MAX,
+ u8::MIN,
+ );
+ let r: u8x8 = transmute(vbsl_u8(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vbsl_u16() {
+ let a = u16x4::new(u16::MAX, 0, u16::MAX, 0);
+ let b = u16x4::new(u16::MAX, u16::MAX, u16::MAX, u16::MAX);
+ let c = u16x4::new(u16::MIN, u16::MIN, u16::MIN, u16::MIN);
+ let e = u16x4::new(u16::MAX, u16::MIN, u16::MAX, u16::MIN);
+ let r: u16x4 = transmute(vbsl_u16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vbsl_u32() {
+ let a = u32x2::new(u32::MAX, 0);
+ let b = u32x2::new(u32::MAX, u32::MAX);
+ let c = u32x2::new(u32::MIN, u32::MIN);
+ let e = u32x2::new(u32::MAX, u32::MIN);
+ let r: u32x2 = transmute(vbsl_u32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vbsl_u64() {
+ let a = u64x1::new(u64::MAX);
+ let b = u64x1::new(u64::MAX);
+ let c = u64x1::new(u64::MIN);
+ let e = u64x1::new(u64::MAX);
+ let r: u64x1 = transmute(vbsl_u64(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vbsl_f32() {
+ let a = u32x2::new(u32::MAX, 0);
+ let b = f32x2::new(f32::MAX, f32::MAX);
+ let c = f32x2::new(f32::MIN, f32::MIN);
+ let e = f32x2::new(f32::MAX, f32::MIN);
+ let r: f32x2 = transmute(vbsl_f32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vbsl_p8() {
+ let a = u8x8::new(u8::MAX, 0, u8::MAX, 0, u8::MAX, 0, u8::MAX, 0);
+ let b = u8x8::new(
+ u8::MAX,
+ u8::MAX,
+ u8::MAX,
+ u8::MAX,
+ u8::MAX,
+ u8::MAX,
+ u8::MAX,
+ u8::MAX,
+ );
+ let c = u8x8::new(
+ u8::MIN,
+ u8::MIN,
+ u8::MIN,
+ u8::MIN,
+ u8::MIN,
+ u8::MIN,
+ u8::MIN,
+ u8::MIN,
+ );
+ let e = u8x8::new(
+ u8::MAX,
+ u8::MIN,
+ u8::MAX,
+ u8::MIN,
+ u8::MAX,
+ u8::MIN,
+ u8::MAX,
+ u8::MIN,
+ );
+ let r: u8x8 = transmute(vbsl_p8(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vbsl_p16() {
+ let a = u16x4::new(u16::MAX, 0, u16::MAX, 0);
+ let b = u16x4::new(u16::MAX, u16::MAX, u16::MAX, u16::MAX);
+ let c = u16x4::new(u16::MIN, u16::MIN, u16::MIN, u16::MIN);
+ let e = u16x4::new(u16::MAX, u16::MIN, u16::MAX, u16::MIN);
+ let r: u16x4 = transmute(vbsl_p16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vbslq_s8() {
+ let a = u8x16::new(
+ u8::MAX,
+ 0,
+ u8::MAX,
+ 0,
+ u8::MAX,
+ 0,
+ u8::MAX,
+ 0,
+ u8::MAX,
+ 0,
+ u8::MAX,
+ 0,
+ u8::MAX,
+ 0,
+ u8::MAX,
+ 0,
+ );
+ let b = i8x16::new(
+ i8::MAX,
+ i8::MAX,
+ i8::MAX,
+ i8::MAX,
+ i8::MAX,
+ i8::MAX,
+ i8::MAX,
+ i8::MAX,
+ i8::MAX,
+ i8::MAX,
+ i8::MAX,
+ i8::MAX,
+ i8::MAX,
+ i8::MAX,
+ i8::MAX,
+ i8::MAX,
+ );
+ let c = i8x16::new(
+ i8::MIN,
+ i8::MIN,
+ i8::MIN,
+ i8::MIN,
+ i8::MIN,
+ i8::MIN,
+ i8::MIN,
+ i8::MIN,
+ i8::MIN,
+ i8::MIN,
+ i8::MIN,
+ i8::MIN,
+ i8::MIN,
+ i8::MIN,
+ i8::MIN,
+ i8::MIN,
+ );
+ let e = i8x16::new(
+ i8::MAX,
+ i8::MIN,
+ i8::MAX,
+ i8::MIN,
+ i8::MAX,
+ i8::MIN,
+ i8::MAX,
+ i8::MIN,
+ i8::MAX,
+ i8::MIN,
+ i8::MAX,
+ i8::MIN,
+ i8::MAX,
+ i8::MIN,
+ i8::MAX,
+ i8::MIN,
+ );
+ let r: i8x16 = transmute(vbslq_s8(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vbslq_s16() {
+ let a = u16x8::new(u16::MAX, 0, u16::MAX, 0, u16::MAX, 0, u16::MAX, 0);
+ let b = i16x8::new(
+ i16::MAX,
+ i16::MAX,
+ i16::MAX,
+ i16::MAX,
+ i16::MAX,
+ i16::MAX,
+ i16::MAX,
+ i16::MAX,
+ );
+ let c = i16x8::new(
+ i16::MIN,
+ i16::MIN,
+ i16::MIN,
+ i16::MIN,
+ i16::MIN,
+ i16::MIN,
+ i16::MIN,
+ i16::MIN,
+ );
+ let e = i16x8::new(
+ i16::MAX,
+ i16::MIN,
+ i16::MAX,
+ i16::MIN,
+ i16::MAX,
+ i16::MIN,
+ i16::MAX,
+ i16::MIN,
+ );
+ let r: i16x8 = transmute(vbslq_s16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vbslq_s32() {
+ let a = u32x4::new(u32::MAX, 0, u32::MAX, 0);
+ let b = i32x4::new(i32::MAX, i32::MAX, i32::MAX, i32::MAX);
+ let c = i32x4::new(i32::MIN, i32::MIN, i32::MIN, i32::MIN);
+ let e = i32x4::new(i32::MAX, i32::MIN, i32::MAX, i32::MIN);
+ let r: i32x4 = transmute(vbslq_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vbslq_s64() {
+ let a = u64x2::new(u64::MAX, 0);
+ let b = i64x2::new(i64::MAX, i64::MAX);
+ let c = i64x2::new(i64::MIN, i64::MIN);
+ let e = i64x2::new(i64::MAX, i64::MIN);
+ let r: i64x2 = transmute(vbslq_s64(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vbslq_u8() {
+ let a = u8x16::new(
+ u8::MAX,
+ 0,
+ u8::MAX,
+ 0,
+ u8::MAX,
+ 0,
+ u8::MAX,
+ 0,
+ u8::MAX,
+ 0,
+ u8::MAX,
+ 0,
+ u8::MAX,
+ 0,
+ u8::MAX,
+ 0,
+ );
+ let b = u8x16::new(
+ u8::MAX,
+ u8::MAX,
+ u8::MAX,
+ u8::MAX,
+ u8::MAX,
+ u8::MAX,
+ u8::MAX,
+ u8::MAX,
+ u8::MAX,
+ u8::MAX,
+ u8::MAX,
+ u8::MAX,
+ u8::MAX,
+ u8::MAX,
+ u8::MAX,
+ u8::MAX,
+ );
+ let c = u8x16::new(
+ u8::MIN,
+ u8::MIN,
+ u8::MIN,
+ u8::MIN,
+ u8::MIN,
+ u8::MIN,
+ u8::MIN,
+ u8::MIN,
+ u8::MIN,
+ u8::MIN,
+ u8::MIN,
+ u8::MIN,
+ u8::MIN,
+ u8::MIN,
+ u8::MIN,
+ u8::MIN,
+ );
+ let e = u8x16::new(
+ u8::MAX,
+ u8::MIN,
+ u8::MAX,
+ u8::MIN,
+ u8::MAX,
+ u8::MIN,
+ u8::MAX,
+ u8::MIN,
+ u8::MAX,
+ u8::MIN,
+ u8::MAX,
+ u8::MIN,
+ u8::MAX,
+ u8::MIN,
+ u8::MAX,
+ u8::MIN,
+ );
+ let r: u8x16 = transmute(vbslq_u8(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vbslq_u16() {
+ let a = u16x8::new(u16::MAX, 0, u16::MAX, 0, u16::MAX, 0, u16::MAX, 0);
+ let b = u16x8::new(
+ u16::MAX,
+ u16::MAX,
+ u16::MAX,
+ u16::MAX,
+ u16::MAX,
+ u16::MAX,
+ u16::MAX,
+ u16::MAX,
+ );
+ let c = u16x8::new(
+ u16::MIN,
+ u16::MIN,
+ u16::MIN,
+ u16::MIN,
+ u16::MIN,
+ u16::MIN,
+ u16::MIN,
+ u16::MIN,
+ );
+ let e = u16x8::new(
+ u16::MAX,
+ u16::MIN,
+ u16::MAX,
+ u16::MIN,
+ u16::MAX,
+ u16::MIN,
+ u16::MAX,
+ u16::MIN,
+ );
+ let r: u16x8 = transmute(vbslq_u16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vbslq_u32() {
+ let a = u32x4::new(u32::MAX, 0, u32::MAX, 0);
+ let b = u32x4::new(u32::MAX, u32::MAX, u32::MAX, u32::MAX);
+ let c = u32x4::new(u32::MIN, u32::MIN, u32::MIN, u32::MIN);
+ let e = u32x4::new(u32::MAX, u32::MIN, u32::MAX, u32::MIN);
+ let r: u32x4 = transmute(vbslq_u32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vbslq_u64() {
+ let a = u64x2::new(u64::MAX, 0);
+ let b = u64x2::new(u64::MAX, u64::MAX);
+ let c = u64x2::new(u64::MIN, u64::MIN);
+ let e = u64x2::new(u64::MAX, u64::MIN);
+ let r: u64x2 = transmute(vbslq_u64(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vbslq_f32() {
+ let a = u32x4::new(u32::MAX, 0, u32::MAX, 0);
+ let b = f32x4::new(f32::MAX, f32::MAX, f32::MAX, f32::MAX);
+ let c = f32x4::new(f32::MIN, f32::MIN, f32::MIN, f32::MIN);
+ let e = f32x4::new(f32::MAX, f32::MIN, f32::MAX, f32::MIN);
+ let r: f32x4 = transmute(vbslq_f32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vbslq_p8() {
+ let a = u8x16::new(
+ u8::MAX,
+ 0,
+ u8::MAX,
+ 0,
+ u8::MAX,
+ 0,
+ u8::MAX,
+ 0,
+ u8::MAX,
+ 0,
+ u8::MAX,
+ 0,
+ u8::MAX,
+ 0,
+ u8::MAX,
+ 0,
+ );
+ let b = u8x16::new(
+ u8::MAX,
+ u8::MAX,
+ u8::MAX,
+ u8::MAX,
+ u8::MAX,
+ u8::MAX,
+ u8::MAX,
+ u8::MAX,
+ u8::MAX,
+ u8::MAX,
+ u8::MAX,
+ u8::MAX,
+ u8::MAX,
+ u8::MAX,
+ u8::MAX,
+ u8::MAX,
+ );
+ let c = u8x16::new(
+ u8::MIN,
+ u8::MIN,
+ u8::MIN,
+ u8::MIN,
+ u8::MIN,
+ u8::MIN,
+ u8::MIN,
+ u8::MIN,
+ u8::MIN,
+ u8::MIN,
+ u8::MIN,
+ u8::MIN,
+ u8::MIN,
+ u8::MIN,
+ u8::MIN,
+ u8::MIN,
+ );
+ let e = u8x16::new(
+ u8::MAX,
+ u8::MIN,
+ u8::MAX,
+ u8::MIN,
+ u8::MAX,
+ u8::MIN,
+ u8::MAX,
+ u8::MIN,
+ u8::MAX,
+ u8::MIN,
+ u8::MAX,
+ u8::MIN,
+ u8::MAX,
+ u8::MIN,
+ u8::MAX,
+ u8::MIN,
+ );
+ let r: u8x16 = transmute(vbslq_p8(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vbslq_p16() {
+ let a = u16x8::new(u16::MAX, 0, u16::MAX, 0, u16::MAX, 0, u16::MAX, 0);
+ let b = u16x8::new(
+ u16::MAX,
+ u16::MAX,
+ u16::MAX,
+ u16::MAX,
+ u16::MAX,
+ u16::MAX,
+ u16::MAX,
+ u16::MAX,
+ );
+ let c = u16x8::new(
+ u16::MIN,
+ u16::MIN,
+ u16::MIN,
+ u16::MIN,
+ u16::MIN,
+ u16::MIN,
+ u16::MIN,
+ u16::MIN,
+ );
+ let e = u16x8::new(
+ u16::MAX,
+ u16::MIN,
+ u16::MAX,
+ u16::MIN,
+ u16::MAX,
+ u16::MIN,
+ u16::MAX,
+ u16::MIN,
+ );
+ let r: u16x8 = transmute(vbslq_p16(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vorn_s8() {
+ let a = i8x8::new(0, -1, -2, -3, -4, -5, -6, -7);
+ let b = i8x8::new(-2, -2, -2, -2, -2, -2, -2, -2);
+ let e = i8x8::new(1, -1, -1, -3, -3, -5, -5, -7);
+ let r: i8x8 = transmute(vorn_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vornq_s8() {
+ let a = i8x16::new(
+ 0, -1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15,
+ );
+ let b = i8x16::new(
+ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
+ );
+ let e = i8x16::new(
+ 1, -1, -1, -3, -3, -5, -5, -7, -7, -9, -9, -11, -11, -13, -13, -15,
+ );
+ let r: i8x16 = transmute(vornq_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vorn_s16() {
+ let a = i16x4::new(0, -1, -2, -3);
+ let b = i16x4::new(-2, -2, -2, -2);
+ let e = i16x4::new(1, -1, -1, -3);
+ let r: i16x4 = transmute(vorn_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vornq_s16() {
+ let a = i16x8::new(0, -1, -2, -3, -4, -5, -6, -7);
+ let b = i16x8::new(-2, -2, -2, -2, -2, -2, -2, -2);
+ let e = i16x8::new(1, -1, -1, -3, -3, -5, -5, -7);
+ let r: i16x8 = transmute(vornq_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vorn_s32() {
+ let a = i32x2::new(0, -1);
+ let b = i32x2::new(-2, -2);
+ let e = i32x2::new(1, -1);
+ let r: i32x2 = transmute(vorn_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vornq_s32() {
+ let a = i32x4::new(0, -1, -2, -3);
+ let b = i32x4::new(-2, -2, -2, -2);
+ let e = i32x4::new(1, -1, -1, -3);
+ let r: i32x4 = transmute(vornq_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vorn_s64() {
+ let a = i64x1::new(0);
+ let b = i64x1::new(-2);
+ let e = i64x1::new(1);
+ let r: i64x1 = transmute(vorn_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vornq_s64() {
+ let a = i64x2::new(0, -1);
+ let b = i64x2::new(-2, -2);
+ let e = i64x2::new(1, -1);
+ let r: i64x2 = transmute(vornq_s64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vorn_u8() {
+ let a = u8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let t = u8::MAX - 1;
+ let b = u8x8::new(t, t, t, t, t, t, t, t);
+ let e = u8x8::new(1, 1, 3, 3, 5, 5, 7, 7);
+ let r: u8x8 = transmute(vorn_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vornq_u8() {
+ let a = u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let t = u8::MAX - 1;
+ let b = u8x16::new(t, t, t, t, t, t, t, t, t, t, t, t, t, t, t, t);
+ let e = u8x16::new(1, 1, 3, 3, 5, 5, 7, 7, 9, 9, 11, 11, 13, 13, 15, 15);
+ let r: u8x16 = transmute(vornq_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vorn_u16() {
+ let a = u16x4::new(0, 1, 2, 3);
+ let t = u16::MAX - 1;
+ let b = u16x4::new(t, t, t, t);
+ let e = u16x4::new(1, 1, 3, 3);
+ let r: u16x4 = transmute(vorn_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vornq_u16() {
+ let a = u16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let t = u16::MAX - 1;
+ let b = u16x8::new(t, t, t, t, t, t, t, t);
+ let e = u16x8::new(1, 1, 3, 3, 5, 5, 7, 7);
+ let r: u16x8 = transmute(vornq_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vorn_u32() {
+ let a = u32x2::new(0, 1);
+ let t = u32::MAX - 1;
+ let b = u32x2::new(t, t);
+ let e = u32x2::new(1, 1);
+ let r: u32x2 = transmute(vorn_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vornq_u32() {
+ let a = u32x4::new(0, 1, 2, 3);
+ let t = u32::MAX - 1;
+ let b = u32x4::new(t, t, t, t);
+ let e = u32x4::new(1, 1, 3, 3);
+ let r: u32x4 = transmute(vornq_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vorn_u64() {
+ let a = u64x1::new(0);
+ let t = u64::MAX - 1;
+ let b = u64x1::new(t);
+ let e = u64x1::new(1);
+ let r: u64x1 = transmute(vorn_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vornq_u64() {
+ let a = u64x2::new(0, 1);
+ let t = u64::MAX - 1;
+ let b = u64x2::new(t, t);
+ let e = u64x2::new(1, 1);
+ let r: u64x2 = transmute(vornq_u64(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmovn_s16() {
+ let a = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let r: i8x8 = transmute(vmovn_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmovn_s32() {
+ let a = i32x4::new(1, 2, 3, 4);
+ let e = i16x4::new(1, 2, 3, 4);
+ let r: i16x4 = transmute(vmovn_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmovn_s64() {
+ let a = i64x2::new(1, 2);
+ let e = i32x2::new(1, 2);
+ let r: i32x2 = transmute(vmovn_s64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmovn_u16() {
+ let a = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let e = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let r: u8x8 = transmute(vmovn_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmovn_u32() {
+ let a = u32x4::new(1, 2, 3, 4);
+ let e = u16x4::new(1, 2, 3, 4);
+ let r: u16x4 = transmute(vmovn_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmovn_u64() {
+ let a = u64x2::new(1, 2);
+ let e = u32x2::new(1, 2);
+ let r: u32x2 = transmute(vmovn_u64(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmovl_s8() {
+ let e = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let a = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let r: i16x8 = transmute(vmovl_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmovl_s16() {
+ let e = i32x4::new(1, 2, 3, 4);
+ let a = i16x4::new(1, 2, 3, 4);
+ let r: i32x4 = transmute(vmovl_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmovl_s32() {
+ let e = i64x2::new(1, 2);
+ let a = i32x2::new(1, 2);
+ let r: i64x2 = transmute(vmovl_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmovl_u8() {
+ let e = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let a = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let r: u16x8 = transmute(vmovl_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmovl_u16() {
+ let e = u32x4::new(1, 2, 3, 4);
+ let a = u16x4::new(1, 2, 3, 4);
+ let r: u32x4 = transmute(vmovl_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmovl_u32() {
+ let e = u64x2::new(1, 2);
+ let a = u32x2::new(1, 2);
+ let r: u64x2 = transmute(vmovl_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpmin_s8() {
+ let a = i8x8::new(1, -2, 3, -4, 5, 6, 7, 8);
+ let b = i8x8::new(0, 3, 2, 5, 4, 7, 6, 9);
+ let e = i8x8::new(-2, -4, 5, 7, 0, 2, 4, 6);
+ let r: i8x8 = transmute(vpmin_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpmin_s16() {
+ let a = i16x4::new(1, 2, 3, -4);
+ let b = i16x4::new(0, 3, 2, 5);
+ let e = i16x4::new(1, -4, 0, 2);
+ let r: i16x4 = transmute(vpmin_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpmin_s32() {
+ let a = i32x2::new(1, -2);
+ let b = i32x2::new(0, 3);
+ let e = i32x2::new(-2, 0);
+ let r: i32x2 = transmute(vpmin_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpmin_u8() {
+ let a = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b = u8x8::new(0, 3, 2, 5, 4, 7, 6, 9);
+ let e = u8x8::new(1, 3, 5, 7, 0, 2, 4, 6);
+ let r: u8x8 = transmute(vpmin_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpmin_u16() {
+ let a = u16x4::new(1, 2, 3, 4);
+ let b = u16x4::new(0, 3, 2, 5);
+ let e = u16x4::new(1, 3, 0, 2);
+ let r: u16x4 = transmute(vpmin_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpmin_u32() {
+ let a = u32x2::new(1, 2);
+ let b = u32x2::new(0, 3);
+ let e = u32x2::new(1, 0);
+ let r: u32x2 = transmute(vpmin_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpmin_f32() {
+ let a = f32x2::new(1., -2.);
+ let b = f32x2::new(0., 3.);
+ let e = f32x2::new(-2., 0.);
+ let r: f32x2 = transmute(vpmin_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpmax_s8() {
+ let a = i8x8::new(1, -2, 3, -4, 5, 6, 7, 8);
+ let b = i8x8::new(0, 3, 2, 5, 4, 7, 6, 9);
+ let e = i8x8::new(1, 3, 6, 8, 3, 5, 7, 9);
+ let r: i8x8 = transmute(vpmax_s8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpmax_s16() {
+ let a = i16x4::new(1, 2, 3, -4);
+ let b = i16x4::new(0, 3, 2, 5);
+ let e = i16x4::new(2, 3, 3, 5);
+ let r: i16x4 = transmute(vpmax_s16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpmax_s32() {
+ let a = i32x2::new(1, -2);
+ let b = i32x2::new(0, 3);
+ let e = i32x2::new(1, 3);
+ let r: i32x2 = transmute(vpmax_s32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpmax_u8() {
+ let a = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b = u8x8::new(0, 3, 2, 5, 4, 7, 6, 9);
+ let e = u8x8::new(2, 4, 6, 8, 3, 5, 7, 9);
+ let r: u8x8 = transmute(vpmax_u8(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpmax_u16() {
+ let a = u16x4::new(1, 2, 3, 4);
+ let b = u16x4::new(0, 3, 2, 5);
+ let e = u16x4::new(2, 4, 3, 5);
+ let r: u16x4 = transmute(vpmax_u16(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpmax_u32() {
+ let a = u32x2::new(1, 2);
+ let b = u32x2::new(0, 3);
+ let e = u32x2::new(2, 3);
+ let r: u32x2 = transmute(vpmax_u32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpmax_f32() {
+ let a = f32x2::new(1., -2.);
+ let b = f32x2::new(0., 3.);
+ let e = f32x2::new(1., 3.);
+ let r: f32x2 = transmute(vpmax_f32(transmute(a), transmute(b)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vand_s8() {
+ test_bit_s8(|i, j| vand_s8(i, j), |a: i8, b: i8| -> i8 { a & b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vandq_s8() {
+ testq_bit_s8(|i, j| vandq_s8(i, j), |a: i8, b: i8| -> i8 { a & b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vand_s16() {
+ test_bit_s16(|i, j| vand_s16(i, j), |a: i16, b: i16| -> i16 { a & b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vandq_s16() {
+ testq_bit_s16(|i, j| vandq_s16(i, j), |a: i16, b: i16| -> i16 { a & b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vand_s32() {
+ test_bit_s32(|i, j| vand_s32(i, j), |a: i32, b: i32| -> i32 { a & b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vandq_s32() {
+ testq_bit_s32(|i, j| vandq_s32(i, j), |a: i32, b: i32| -> i32 { a & b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vand_s64() {
+ test_bit_s64(|i, j| vand_s64(i, j), |a: i64, b: i64| -> i64 { a & b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vandq_s64() {
+ testq_bit_s64(|i, j| vandq_s64(i, j), |a: i64, b: i64| -> i64 { a & b });
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vand_u8() {
+ test_bit_u8(|i, j| vand_u8(i, j), |a: u8, b: u8| -> u8 { a & b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vandq_u8() {
+ testq_bit_u8(|i, j| vandq_u8(i, j), |a: u8, b: u8| -> u8 { a & b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vand_u16() {
+ test_bit_u16(|i, j| vand_u16(i, j), |a: u16, b: u16| -> u16 { a & b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vandq_u16() {
+ testq_bit_u16(|i, j| vandq_u16(i, j), |a: u16, b: u16| -> u16 { a & b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vand_u32() {
+ test_bit_u32(|i, j| vand_u32(i, j), |a: u32, b: u32| -> u32 { a & b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vandq_u32() {
+ testq_bit_u32(|i, j| vandq_u32(i, j), |a: u32, b: u32| -> u32 { a & b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vand_u64() {
+ test_bit_u64(|i, j| vand_u64(i, j), |a: u64, b: u64| -> u64 { a & b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vandq_u64() {
+ testq_bit_u64(|i, j| vandq_u64(i, j), |a: u64, b: u64| -> u64 { a & b });
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vorr_s8() {
+ test_bit_s8(|i, j| vorr_s8(i, j), |a: i8, b: i8| -> i8 { a | b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vorrq_s8() {
+ testq_bit_s8(|i, j| vorrq_s8(i, j), |a: i8, b: i8| -> i8 { a | b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vorr_s16() {
+ test_bit_s16(|i, j| vorr_s16(i, j), |a: i16, b: i16| -> i16 { a | b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vorrq_s16() {
+ testq_bit_s16(|i, j| vorrq_s16(i, j), |a: i16, b: i16| -> i16 { a | b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vorr_s32() {
+ test_bit_s32(|i, j| vorr_s32(i, j), |a: i32, b: i32| -> i32 { a | b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vorrq_s32() {
+ testq_bit_s32(|i, j| vorrq_s32(i, j), |a: i32, b: i32| -> i32 { a | b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vorr_s64() {
+ test_bit_s64(|i, j| vorr_s64(i, j), |a: i64, b: i64| -> i64 { a | b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vorrq_s64() {
+ testq_bit_s64(|i, j| vorrq_s64(i, j), |a: i64, b: i64| -> i64 { a | b });
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vorr_u8() {
+ test_bit_u8(|i, j| vorr_u8(i, j), |a: u8, b: u8| -> u8 { a | b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vorrq_u8() {
+ testq_bit_u8(|i, j| vorrq_u8(i, j), |a: u8, b: u8| -> u8 { a | b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vorr_u16() {
+ test_bit_u16(|i, j| vorr_u16(i, j), |a: u16, b: u16| -> u16 { a | b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vorrq_u16() {
+ testq_bit_u16(|i, j| vorrq_u16(i, j), |a: u16, b: u16| -> u16 { a | b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vorr_u32() {
+ test_bit_u32(|i, j| vorr_u32(i, j), |a: u32, b: u32| -> u32 { a | b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vorrq_u32() {
+ testq_bit_u32(|i, j| vorrq_u32(i, j), |a: u32, b: u32| -> u32 { a | b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vorr_u64() {
+ test_bit_u64(|i, j| vorr_u64(i, j), |a: u64, b: u64| -> u64 { a | b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vorrq_u64() {
+ testq_bit_u64(|i, j| vorrq_u64(i, j), |a: u64, b: u64| -> u64 { a | b });
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_veor_s8() {
+ test_bit_s8(|i, j| veor_s8(i, j), |a: i8, b: i8| -> i8 { a ^ b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_veorq_s8() {
+ testq_bit_s8(|i, j| veorq_s8(i, j), |a: i8, b: i8| -> i8 { a ^ b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_veor_s16() {
+ test_bit_s16(|i, j| veor_s16(i, j), |a: i16, b: i16| -> i16 { a ^ b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_veorq_s16() {
+ testq_bit_s16(|i, j| veorq_s16(i, j), |a: i16, b: i16| -> i16 { a ^ b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_veor_s32() {
+ test_bit_s32(|i, j| veor_s32(i, j), |a: i32, b: i32| -> i32 { a ^ b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_veorq_s32() {
+ testq_bit_s32(|i, j| veorq_s32(i, j), |a: i32, b: i32| -> i32 { a ^ b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_veor_s64() {
+ test_bit_s64(|i, j| veor_s64(i, j), |a: i64, b: i64| -> i64 { a ^ b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_veorq_s64() {
+ testq_bit_s64(|i, j| veorq_s64(i, j), |a: i64, b: i64| -> i64 { a ^ b });
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_veor_u8() {
+ test_bit_u8(|i, j| veor_u8(i, j), |a: u8, b: u8| -> u8 { a ^ b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_veorq_u8() {
+ testq_bit_u8(|i, j| veorq_u8(i, j), |a: u8, b: u8| -> u8 { a ^ b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_veor_u16() {
+ test_bit_u16(|i, j| veor_u16(i, j), |a: u16, b: u16| -> u16 { a ^ b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_veorq_u16() {
+ testq_bit_u16(|i, j| veorq_u16(i, j), |a: u16, b: u16| -> u16 { a ^ b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_veor_u32() {
+ test_bit_u32(|i, j| veor_u32(i, j), |a: u32, b: u32| -> u32 { a ^ b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_veorq_u32() {
+ testq_bit_u32(|i, j| veorq_u32(i, j), |a: u32, b: u32| -> u32 { a ^ b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_veor_u64() {
+ test_bit_u64(|i, j| veor_u64(i, j), |a: u64, b: u64| -> u64 { a ^ b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_veorq_u64() {
+ testq_bit_u64(|i, j| veorq_u64(i, j), |a: u64, b: u64| -> u64 { a ^ b });
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceq_s8() {
+ test_cmp_s8(
+ |i, j| vceq_s8(i, j),
+ |a: i8, b: i8| -> u8 {
+ if a == b {
+ 0xFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqq_s8() {
+ testq_cmp_s8(
+ |i, j| vceqq_s8(i, j),
+ |a: i8, b: i8| -> u8 {
+ if a == b {
+ 0xFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceq_s16() {
+ test_cmp_s16(
+ |i, j| vceq_s16(i, j),
+ |a: i16, b: i16| -> u16 {
+ if a == b {
+ 0xFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqq_s16() {
+ testq_cmp_s16(
+ |i, j| vceqq_s16(i, j),
+ |a: i16, b: i16| -> u16 {
+ if a == b {
+ 0xFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceq_s32() {
+ test_cmp_s32(
+ |i, j| vceq_s32(i, j),
+ |a: i32, b: i32| -> u32 {
+ if a == b {
+ 0xFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqq_s32() {
+ testq_cmp_s32(
+ |i, j| vceqq_s32(i, j),
+ |a: i32, b: i32| -> u32 {
+ if a == b {
+ 0xFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceq_u8() {
+ test_cmp_u8(
+ |i, j| vceq_u8(i, j),
+ |a: u8, b: u8| -> u8 {
+ if a == b {
+ 0xFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqq_u8() {
+ testq_cmp_u8(
+ |i, j| vceqq_u8(i, j),
+ |a: u8, b: u8| -> u8 {
+ if a == b {
+ 0xFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceq_u16() {
+ test_cmp_u16(
+ |i, j| vceq_u16(i, j),
+ |a: u16, b: u16| -> u16 {
+ if a == b {
+ 0xFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqq_u16() {
+ testq_cmp_u16(
+ |i, j| vceqq_u16(i, j),
+ |a: u16, b: u16| -> u16 {
+ if a == b {
+ 0xFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceq_u32() {
+ test_cmp_u32(
+ |i, j| vceq_u32(i, j),
+ |a: u32, b: u32| -> u32 {
+ if a == b {
+ 0xFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqq_u32() {
+ testq_cmp_u32(
+ |i, j| vceqq_u32(i, j),
+ |a: u32, b: u32| -> u32 {
+ if a == b {
+ 0xFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceq_f32() {
+ test_cmp_f32(
+ |i, j| vcge_f32(i, j),
+ |a: f32, b: f32| -> u32 {
+ if a == b {
+ 0xFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vceqq_f32() {
+ testq_cmp_f32(
+ |i, j| vcgeq_f32(i, j),
+ |a: f32, b: f32| -> u32 {
+ if a == b {
+ 0xFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgt_s8() {
+ test_cmp_s8(
+ |i, j| vcgt_s8(i, j),
+ |a: i8, b: i8| -> u8 {
+ if a > b {
+ 0xFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgtq_s8() {
+ testq_cmp_s8(
+ |i, j| vcgtq_s8(i, j),
+ |a: i8, b: i8| -> u8 {
+ if a > b {
+ 0xFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgt_s16() {
+ test_cmp_s16(
+ |i, j| vcgt_s16(i, j),
+ |a: i16, b: i16| -> u16 {
+ if a > b {
+ 0xFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgtq_s16() {
+ testq_cmp_s16(
+ |i, j| vcgtq_s16(i, j),
+ |a: i16, b: i16| -> u16 {
+ if a > b {
+ 0xFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgt_s32() {
+ test_cmp_s32(
+ |i, j| vcgt_s32(i, j),
+ |a: i32, b: i32| -> u32 {
+ if a > b {
+ 0xFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgtq_s32() {
+ testq_cmp_s32(
+ |i, j| vcgtq_s32(i, j),
+ |a: i32, b: i32| -> u32 {
+ if a > b {
+ 0xFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgt_u8() {
+ test_cmp_u8(
+ |i, j| vcgt_u8(i, j),
+ |a: u8, b: u8| -> u8 {
+ if a > b {
+ 0xFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgtq_u8() {
+ testq_cmp_u8(
+ |i, j| vcgtq_u8(i, j),
+ |a: u8, b: u8| -> u8 {
+ if a > b {
+ 0xFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgt_u16() {
+ test_cmp_u16(
+ |i, j| vcgt_u16(i, j),
+ |a: u16, b: u16| -> u16 {
+ if a > b {
+ 0xFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgtq_u16() {
+ testq_cmp_u16(
+ |i, j| vcgtq_u16(i, j),
+ |a: u16, b: u16| -> u16 {
+ if a > b {
+ 0xFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgt_u32() {
+ test_cmp_u32(
+ |i, j| vcgt_u32(i, j),
+ |a: u32, b: u32| -> u32 {
+ if a > b {
+ 0xFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgtq_u32() {
+ testq_cmp_u32(
+ |i, j| vcgtq_u32(i, j),
+ |a: u32, b: u32| -> u32 {
+ if a > b {
+ 0xFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgt_f32() {
+ test_cmp_f32(
+ |i, j| vcgt_f32(i, j),
+ |a: f32, b: f32| -> u32 {
+ if a > b {
+ 0xFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgtq_f32() {
+ testq_cmp_f32(
+ |i, j| vcgtq_f32(i, j),
+ |a: f32, b: f32| -> u32 {
+ if a > b {
+ 0xFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclt_s8() {
+ test_cmp_s8(
+ |i, j| vclt_s8(i, j),
+ |a: i8, b: i8| -> u8 {
+ if a < b {
+ 0xFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcltq_s8() {
+ testq_cmp_s8(
+ |i, j| vcltq_s8(i, j),
+ |a: i8, b: i8| -> u8 {
+ if a < b {
+ 0xFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclt_s16() {
+ test_cmp_s16(
+ |i, j| vclt_s16(i, j),
+ |a: i16, b: i16| -> u16 {
+ if a < b {
+ 0xFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcltq_s16() {
+ testq_cmp_s16(
+ |i, j| vcltq_s16(i, j),
+ |a: i16, b: i16| -> u16 {
+ if a < b {
+ 0xFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclt_s32() {
+ test_cmp_s32(
+ |i, j| vclt_s32(i, j),
+ |a: i32, b: i32| -> u32 {
+ if a < b {
+ 0xFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcltq_s32() {
+ testq_cmp_s32(
+ |i, j| vcltq_s32(i, j),
+ |a: i32, b: i32| -> u32 {
+ if a < b {
+ 0xFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclt_u8() {
+ test_cmp_u8(
+ |i, j| vclt_u8(i, j),
+ |a: u8, b: u8| -> u8 {
+ if a < b {
+ 0xFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcltq_u8() {
+ testq_cmp_u8(
+ |i, j| vcltq_u8(i, j),
+ |a: u8, b: u8| -> u8 {
+ if a < b {
+ 0xFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclt_u16() {
+ test_cmp_u16(
+ |i, j| vclt_u16(i, j),
+ |a: u16, b: u16| -> u16 {
+ if a < b {
+ 0xFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcltq_u16() {
+ testq_cmp_u16(
+ |i, j| vcltq_u16(i, j),
+ |a: u16, b: u16| -> u16 {
+ if a < b {
+ 0xFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclt_u32() {
+ test_cmp_u32(
+ |i, j| vclt_u32(i, j),
+ |a: u32, b: u32| -> u32 {
+ if a < b {
+ 0xFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcltq_u32() {
+ testq_cmp_u32(
+ |i, j| vcltq_u32(i, j),
+ |a: u32, b: u32| -> u32 {
+ if a < b {
+ 0xFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vclt_f32() {
+ test_cmp_f32(
+ |i, j| vclt_f32(i, j),
+ |a: f32, b: f32| -> u32 {
+ if a < b {
+ 0xFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcltq_f32() {
+ testq_cmp_f32(
+ |i, j| vcltq_f32(i, j),
+ |a: f32, b: f32| -> u32 {
+ if a < b {
+ 0xFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcle_s8() {
+ test_cmp_s8(
+ |i, j| vcle_s8(i, j),
+ |a: i8, b: i8| -> u8 {
+ if a <= b {
+ 0xFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcleq_s8() {
+ testq_cmp_s8(
+ |i, j| vcleq_s8(i, j),
+ |a: i8, b: i8| -> u8 {
+ if a <= b {
+ 0xFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcle_s16() {
+ test_cmp_s16(
+ |i, j| vcle_s16(i, j),
+ |a: i16, b: i16| -> u16 {
+ if a <= b {
+ 0xFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcleq_s16() {
+ testq_cmp_s16(
+ |i, j| vcleq_s16(i, j),
+ |a: i16, b: i16| -> u16 {
+ if a <= b {
+ 0xFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcle_s32() {
+ test_cmp_s32(
+ |i, j| vcle_s32(i, j),
+ |a: i32, b: i32| -> u32 {
+ if a <= b {
+ 0xFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcleq_s32() {
+ testq_cmp_s32(
+ |i, j| vcleq_s32(i, j),
+ |a: i32, b: i32| -> u32 {
+ if a <= b {
+ 0xFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcle_u8() {
+ test_cmp_u8(
+ |i, j| vcle_u8(i, j),
+ |a: u8, b: u8| -> u8 {
+ if a <= b {
+ 0xFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcleq_u8() {
+ testq_cmp_u8(
+ |i, j| vcleq_u8(i, j),
+ |a: u8, b: u8| -> u8 {
+ if a <= b {
+ 0xFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcle_u16() {
+ test_cmp_u16(
+ |i, j| vcle_u16(i, j),
+ |a: u16, b: u16| -> u16 {
+ if a <= b {
+ 0xFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcleq_u16() {
+ testq_cmp_u16(
+ |i, j| vcleq_u16(i, j),
+ |a: u16, b: u16| -> u16 {
+ if a <= b {
+ 0xFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcle_u32() {
+ test_cmp_u32(
+ |i, j| vcle_u32(i, j),
+ |a: u32, b: u32| -> u32 {
+ if a <= b {
+ 0xFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcleq_u32() {
+ testq_cmp_u32(
+ |i, j| vcleq_u32(i, j),
+ |a: u32, b: u32| -> u32 {
+ if a <= b {
+ 0xFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcle_f32() {
+ test_cmp_f32(
+ |i, j| vcle_f32(i, j),
+ |a: f32, b: f32| -> u32 {
+ if a <= b {
+ 0xFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcleq_f32() {
+ testq_cmp_f32(
+ |i, j| vcleq_f32(i, j),
+ |a: f32, b: f32| -> u32 {
+ if a <= b {
+ 0xFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcge_s8() {
+ test_cmp_s8(
+ |i, j| vcge_s8(i, j),
+ |a: i8, b: i8| -> u8 {
+ if a >= b {
+ 0xFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgeq_s8() {
+ testq_cmp_s8(
+ |i, j| vcgeq_s8(i, j),
+ |a: i8, b: i8| -> u8 {
+ if a >= b {
+ 0xFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcge_s16() {
+ test_cmp_s16(
+ |i, j| vcge_s16(i, j),
+ |a: i16, b: i16| -> u16 {
+ if a >= b {
+ 0xFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgeq_s16() {
+ testq_cmp_s16(
+ |i, j| vcgeq_s16(i, j),
+ |a: i16, b: i16| -> u16 {
+ if a >= b {
+ 0xFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcge_s32() {
+ test_cmp_s32(
+ |i, j| vcge_s32(i, j),
+ |a: i32, b: i32| -> u32 {
+ if a >= b {
+ 0xFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgeq_s32() {
+ testq_cmp_s32(
+ |i, j| vcgeq_s32(i, j),
+ |a: i32, b: i32| -> u32 {
+ if a >= b {
+ 0xFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcge_u8() {
+ test_cmp_u8(
+ |i, j| vcge_u8(i, j),
+ |a: u8, b: u8| -> u8 {
+ if a >= b {
+ 0xFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgeq_u8() {
+ testq_cmp_u8(
+ |i, j| vcgeq_u8(i, j),
+ |a: u8, b: u8| -> u8 {
+ if a >= b {
+ 0xFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcge_u16() {
+ test_cmp_u16(
+ |i, j| vcge_u16(i, j),
+ |a: u16, b: u16| -> u16 {
+ if a >= b {
+ 0xFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgeq_u16() {
+ testq_cmp_u16(
+ |i, j| vcgeq_u16(i, j),
+ |a: u16, b: u16| -> u16 {
+ if a >= b {
+ 0xFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcge_u32() {
+ test_cmp_u32(
+ |i, j| vcge_u32(i, j),
+ |a: u32, b: u32| -> u32 {
+ if a >= b {
+ 0xFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgeq_u32() {
+ testq_cmp_u32(
+ |i, j| vcgeq_u32(i, j),
+ |a: u32, b: u32| -> u32 {
+ if a >= b {
+ 0xFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcge_f32() {
+ test_cmp_f32(
+ |i, j| vcge_f32(i, j),
+ |a: f32, b: f32| -> u32 {
+ if a >= b {
+ 0xFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcgeq_f32() {
+ testq_cmp_f32(
+ |i, j| vcgeq_f32(i, j),
+ |a: f32, b: f32| -> u32 {
+ if a >= b {
+ 0xFFFFFFFF
+ } else {
+ 0
+ }
+ },
+ );
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqsub_s8() {
+ test_ari_s8(
+ |i, j| vqsub_s8(i, j),
+ |a: i8, b: i8| -> i8 { a.saturating_sub(b) },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqsubq_s8() {
+ testq_ari_s8(
+ |i, j| vqsubq_s8(i, j),
+ |a: i8, b: i8| -> i8 { a.saturating_sub(b) },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqsub_s16() {
+ test_ari_s16(
+ |i, j| vqsub_s16(i, j),
+ |a: i16, b: i16| -> i16 { a.saturating_sub(b) },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqsubq_s16() {
+ testq_ari_s16(
+ |i, j| vqsubq_s16(i, j),
+ |a: i16, b: i16| -> i16 { a.saturating_sub(b) },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqsub_s32() {
+ test_ari_s32(
+ |i, j| vqsub_s32(i, j),
+ |a: i32, b: i32| -> i32 { a.saturating_sub(b) },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqsubq_s32() {
+ testq_ari_s32(
+ |i, j| vqsubq_s32(i, j),
+ |a: i32, b: i32| -> i32 { a.saturating_sub(b) },
+ );
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqsub_u8() {
+ test_ari_u8(
+ |i, j| vqsub_u8(i, j),
+ |a: u8, b: u8| -> u8 { a.saturating_sub(b) },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqsubq_u8() {
+ testq_ari_u8(
+ |i, j| vqsubq_u8(i, j),
+ |a: u8, b: u8| -> u8 { a.saturating_sub(b) },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqsub_u16() {
+ test_ari_u16(
+ |i, j| vqsub_u16(i, j),
+ |a: u16, b: u16| -> u16 { a.saturating_sub(b) },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqsubq_u16() {
+ testq_ari_u16(
+ |i, j| vqsubq_u16(i, j),
+ |a: u16, b: u16| -> u16 { a.saturating_sub(b) },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqsub_u32() {
+ test_ari_u32(
+ |i, j| vqsub_u32(i, j),
+ |a: u32, b: u32| -> u32 { a.saturating_sub(b) },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqsubq_u32() {
+ testq_ari_u32(
+ |i, j| vqsubq_u32(i, j),
+ |a: u32, b: u32| -> u32 { a.saturating_sub(b) },
+ );
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhadd_s8() {
+ test_ari_s8(|i, j| vhadd_s8(i, j), |a: i8, b: i8| -> i8 { a & b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhaddq_s8() {
+ testq_ari_s8(|i, j| vhaddq_s8(i, j), |a: i8, b: i8| -> i8 { a & b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhadd_s16() {
+ test_ari_s16(|i, j| vhadd_s16(i, j), |a: i16, b: i16| -> i16 { a & b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhaddq_s16() {
+ testq_ari_s16(|i, j| vhaddq_s16(i, j), |a: i16, b: i16| -> i16 { a & b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhadd_s32() {
+ test_ari_s32(|i, j| vhadd_s32(i, j), |a: i32, b: i32| -> i32 { a & b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhaddq_s32() {
+ testq_ari_s32(|i, j| vhaddq_s32(i, j), |a: i32, b: i32| -> i32 { a & b });
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhadd_u8() {
+ test_ari_u8(|i, j| vhadd_u8(i, j), |a: u8, b: u8| -> u8 { a & b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhaddq_u8() {
+ testq_ari_u8(|i, j| vhaddq_u8(i, j), |a: u8, b: u8| -> u8 { a & b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhadd_u16() {
+ test_ari_u16(|i, j| vhadd_u16(i, j), |a: u16, b: u16| -> u16 { a & b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhaddq_u16() {
+ testq_ari_u16(|i, j| vhaddq_u16(i, j), |a: u16, b: u16| -> u16 { a & b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhadd_u32() {
+ test_ari_u32(|i, j| vhadd_u32(i, j), |a: u32, b: u32| -> u32 { a & b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhaddq_u32() {
+ testq_ari_u32(|i, j| vhaddq_u32(i, j), |a: u32, b: u32| -> u32 { a & b });
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrhadd_s8() {
+ test_ari_s8(|i, j| vrhadd_s8(i, j), |a: i8, b: i8| -> i8 { a & b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrhaddq_s8() {
+ testq_ari_s8(|i, j| vrhaddq_s8(i, j), |a: i8, b: i8| -> i8 { a & b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrhadd_s16() {
+ test_ari_s16(|i, j| vrhadd_s16(i, j), |a: i16, b: i16| -> i16 { a & b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrhaddq_s16() {
+ testq_ari_s16(|i, j| vrhaddq_s16(i, j), |a: i16, b: i16| -> i16 { a & b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrhadd_s32() {
+ test_ari_s32(|i, j| vrhadd_s32(i, j), |a: i32, b: i32| -> i32 { a & b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrhaddq_s32() {
+ testq_ari_s32(|i, j| vrhaddq_s32(i, j), |a: i32, b: i32| -> i32 { a & b });
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrhadd_u8() {
+ test_ari_u8(|i, j| vrhadd_u8(i, j), |a: u8, b: u8| -> u8 { a & b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrhaddq_u8() {
+ testq_ari_u8(|i, j| vrhaddq_u8(i, j), |a: u8, b: u8| -> u8 { a & b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrhadd_u16() {
+ test_ari_u16(|i, j| vrhadd_u16(i, j), |a: u16, b: u16| -> u16 { a & b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrhaddq_u16() {
+ testq_ari_u16(|i, j| vrhaddq_u16(i, j), |a: u16, b: u16| -> u16 { a & b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrhadd_u32() {
+ test_ari_u32(|i, j| vrhadd_u32(i, j), |a: u32, b: u32| -> u32 { a & b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrhaddq_u32() {
+ testq_ari_u32(|i, j| vrhaddq_u32(i, j), |a: u32, b: u32| -> u32 { a & b });
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqadd_s8() {
+ test_ari_s8(
+ |i, j| vqadd_s8(i, j),
+ |a: i8, b: i8| -> i8 { a.saturating_add(b) },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqaddq_s8() {
+ testq_ari_s8(
+ |i, j| vqaddq_s8(i, j),
+ |a: i8, b: i8| -> i8 { a.saturating_add(b) },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqadd_s16() {
+ test_ari_s16(
+ |i, j| vqadd_s16(i, j),
+ |a: i16, b: i16| -> i16 { a.saturating_add(b) },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqaddq_s16() {
+ testq_ari_s16(
+ |i, j| vqaddq_s16(i, j),
+ |a: i16, b: i16| -> i16 { a.saturating_add(b) },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqadd_s32() {
+ test_ari_s32(
+ |i, j| vqadd_s32(i, j),
+ |a: i32, b: i32| -> i32 { a.saturating_add(b) },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqaddq_s32() {
+ testq_ari_s32(
+ |i, j| vqaddq_s32(i, j),
+ |a: i32, b: i32| -> i32 { a.saturating_add(b) },
+ );
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqadd_u8() {
+ test_ari_u8(
+ |i, j| vqadd_u8(i, j),
+ |a: u8, b: u8| -> u8 { a.saturating_add(b) },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqaddq_u8() {
+ testq_ari_u8(
+ |i, j| vqaddq_u8(i, j),
+ |a: u8, b: u8| -> u8 { a.saturating_add(b) },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqadd_u16() {
+ test_ari_u16(
+ |i, j| vqadd_u16(i, j),
+ |a: u16, b: u16| -> u16 { a.saturating_add(b) },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqaddq_u16() {
+ testq_ari_u16(
+ |i, j| vqaddq_u16(i, j),
+ |a: u16, b: u16| -> u16 { a.saturating_add(b) },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqadd_u32() {
+ test_ari_u32(
+ |i, j| vqadd_u32(i, j),
+ |a: u32, b: u32| -> u32 { a.saturating_add(b) },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vqaddq_u32() {
+ testq_ari_u32(
+ |i, j| vqaddq_u32(i, j),
+ |a: u32, b: u32| -> u32 { a.saturating_add(b) },
+ );
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmul_s8() {
+ test_ari_s8(
+ |i, j| vmul_s8(i, j),
+ |a: i8, b: i8| -> i8 { a.overflowing_mul(b).0 },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulq_s8() {
+ testq_ari_s8(
+ |i, j| vmulq_s8(i, j),
+ |a: i8, b: i8| -> i8 { a.overflowing_mul(b).0 },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmul_s16() {
+ test_ari_s16(
+ |i, j| vmul_s16(i, j),
+ |a: i16, b: i16| -> i16 { a.overflowing_mul(b).0 },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulq_s16() {
+ testq_ari_s16(
+ |i, j| vmulq_s16(i, j),
+ |a: i16, b: i16| -> i16 { a.overflowing_mul(b).0 },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmul_s32() {
+ test_ari_s32(
+ |i, j| vmul_s32(i, j),
+ |a: i32, b: i32| -> i32 { a.overflowing_mul(b).0 },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulq_s32() {
+ testq_ari_s32(
+ |i, j| vmulq_s32(i, j),
+ |a: i32, b: i32| -> i32 { a.overflowing_mul(b).0 },
+ );
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmul_u8() {
+ test_ari_u8(
+ |i, j| vmul_u8(i, j),
+ |a: u8, b: u8| -> u8 { a.overflowing_mul(b).0 },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulq_u8() {
+ testq_ari_u8(
+ |i, j| vmulq_u8(i, j),
+ |a: u8, b: u8| -> u8 { a.overflowing_mul(b).0 },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmul_u16() {
+ test_ari_u16(
+ |i, j| vmul_u16(i, j),
+ |a: u16, b: u16| -> u16 { a.overflowing_mul(b).0 },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulq_u16() {
+ testq_ari_u16(
+ |i, j| vmulq_u16(i, j),
+ |a: u16, b: u16| -> u16 { a.overflowing_mul(b).0 },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmul_u32() {
+ test_ari_u32(
+ |i, j| vmul_u32(i, j),
+ |a: u32, b: u32| -> u32 { a.overflowing_mul(b).0 },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulq_u32() {
+ testq_ari_u32(
+ |i, j| vmulq_u32(i, j),
+ |a: u32, b: u32| -> u32 { a.overflowing_mul(b).0 },
+ );
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmul_f32() {
+ test_ari_f32(|i, j| vmul_f32(i, j), |a: f32, b: f32| -> f32 { a * b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vmulq_f32() {
+ testq_ari_f32(|i, j| vmulq_f32(i, j), |a: f32, b: f32| -> f32 { a * b });
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsub_s8() {
+ test_ari_s8(|i, j| vsub_s8(i, j), |a: i8, b: i8| -> i8 { a - b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubq_s8() {
+ testq_ari_s8(|i, j| vsubq_s8(i, j), |a: i8, b: i8| -> i8 { a - b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsub_s16() {
+ test_ari_s16(|i, j| vsub_s16(i, j), |a: i16, b: i16| -> i16 { a - b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubq_s16() {
+ testq_ari_s16(|i, j| vsubq_s16(i, j), |a: i16, b: i16| -> i16 { a - b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsub_s32() {
+ test_ari_s32(|i, j| vsub_s32(i, j), |a: i32, b: i32| -> i32 { a - b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubq_s32() {
+ testq_ari_s32(|i, j| vsubq_s32(i, j), |a: i32, b: i32| -> i32 { a - b });
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsub_u8() {
+ test_ari_u8(|i, j| vsub_u8(i, j), |a: u8, b: u8| -> u8 { a - b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubq_u8() {
+ testq_ari_u8(|i, j| vsubq_u8(i, j), |a: u8, b: u8| -> u8 { a - b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsub_u16() {
+ test_ari_u16(|i, j| vsub_u16(i, j), |a: u16, b: u16| -> u16 { a - b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubq_u16() {
+ testq_ari_u16(|i, j| vsubq_u16(i, j), |a: u16, b: u16| -> u16 { a - b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsub_u32() {
+ test_ari_u32(|i, j| vsub_u32(i, j), |a: u32, b: u32| -> u32 { a - b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubq_u32() {
+ testq_ari_u32(|i, j| vsubq_u32(i, j), |a: u32, b: u32| -> u32 { a - b });
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsub_f32() {
+ test_ari_f32(|i, j| vsub_f32(i, j), |a: f32, b: f32| -> f32 { a - b });
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vsubq_f32() {
+ testq_ari_f32(|i, j| vsubq_f32(i, j), |a: f32, b: f32| -> f32 { a - b });
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhsub_s8() {
+ test_ari_s8(
+ |i, j| vhsub_s8(i, j),
+ |a: i8, b: i8| -> i8 { (((a as i16) - (b as i16)) / 2) as i8 },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhsubq_s8() {
+ testq_ari_s8(
+ |i, j| vhsubq_s8(i, j),
+ |a: i8, b: i8| -> i8 { (((a as i16) - (b as i16)) / 2) as i8 },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhsub_s16() {
+ test_ari_s16(
+ |i, j| vhsub_s16(i, j),
+ |a: i16, b: i16| -> i16 { (((a as i32) - (b as i32)) / 2) as i16 },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhsubq_s16() {
+ testq_ari_s16(
+ |i, j| vhsubq_s16(i, j),
+ |a: i16, b: i16| -> i16 { (((a as i32) - (b as i32)) / 2) as i16 },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhsub_s32() {
+ test_ari_s32(
+ |i, j| vhsub_s32(i, j),
+ |a: i32, b: i32| -> i32 { (((a as i64) - (b as i64)) / 2) as i32 },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhsubq_s32() {
+ testq_ari_s32(
+ |i, j| vhsubq_s32(i, j),
+ |a: i32, b: i32| -> i32 { (((a as i64) - (b as i64)) / 2) as i32 },
+ );
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhsub_u8() {
+ test_ari_u8(
+ |i, j| vhsub_u8(i, j),
+ |a: u8, b: u8| -> u8 { (((a as u16) - (b as u16)) / 2) as u8 },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhsubq_u8() {
+ testq_ari_u8(
+ |i, j| vhsubq_u8(i, j),
+ |a: u8, b: u8| -> u8 { (((a as u16) - (b as u16)) / 2) as u8 },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhsub_u16() {
+ test_ari_u16(
+ |i, j| vhsub_u16(i, j),
+ |a: u16, b: u16| -> u16 { (((a as u16) - (b as u16)) / 2) as u16 },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhsubq_u16() {
+ testq_ari_u16(
+ |i, j| vhsubq_u16(i, j),
+ |a: u16, b: u16| -> u16 { (((a as u16) - (b as u16)) / 2) as u16 },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhsub_u32() {
+ test_ari_u32(
+ |i, j| vhsub_u32(i, j),
+ |a: u32, b: u32| -> u32 { (((a as u64) - (b as u64)) / 2) as u32 },
+ );
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vhsubq_u32() {
+ testq_ari_u32(
+ |i, j| vhsubq_u32(i, j),
+ |a: u32, b: u32| -> u32 { (((a as u64) - (b as u64)) / 2) as u32 },
+ );
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabs_s8() {
+ let a = i8x8::new(-1, 0, 1, -2, 0, 2, -128, 127);
+ let r: i8x8 = transmute(vabs_s8(transmute(a)));
+ let e = i8x8::new(1, 0, 1, 2, 0, 2, -128, 127);
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabsq_s8() {
+ let a = i8x16::new(-1, 0, 1, -2, 0, 2, -128, 127, -1, 0, 1, -2, 0, 2, -128, 127);
+ let r: i8x16 = transmute(vabsq_s8(transmute(a)));
+ let e = i8x16::new(1, 0, 1, 2, 0, 2, -128, 127, 1, 0, 1, 2, 0, 2, -128, 127);
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabs_s16() {
+ let a = i16x4::new(-1, 0, i16::MIN, i16::MAX);
+ let r: i16x4 = transmute(vabs_s16(transmute(a)));
+ let e = i16x4::new(1, 0, i16::MIN, i16::MAX);
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabsq_s16() {
+ let a = i16x8::new(-1, 0, i16::MIN, i16::MAX, -1, 0, i16::MIN, i16::MAX);
+ let r: i16x8 = transmute(vabsq_s16(transmute(a)));
+ let e = i16x8::new(1, 0, i16::MIN, i16::MAX, 1, 0, i16::MIN, i16::MAX);
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabs_s32() {
+ let a = i32x2::new(i32::MIN, i32::MIN + 1);
+ let r: i32x2 = transmute(vabs_s32(transmute(a)));
+ let e = i32x2::new(i32::MIN, i32::MAX);
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabsq_s32() {
+ let a = i32x4::new(i32::MIN, i32::MIN + 1, 0, -1);
+ let r: i32x4 = transmute(vabsq_s32(transmute(a)));
+ let e = i32x4::new(i32::MIN, i32::MAX, 0, 1);
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaba_s8() {
+ let a = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b = i8x8::new(1, 1, 1, 1, 1, 1, 1, 1);
+ let c = i8x8::new(10, 9, 8, 7, 6, 5, 4, 3);
+ let r: i8x8 = transmute(vaba_s8(transmute(a), transmute(b), transmute(c)));
+ let e = i8x8::new(10, 10, 10, 10, 10, 10, 10, 10);
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaba_s16() {
+ let a = i16x4::new(1, 2, 3, 4);
+ let b = i16x4::new(1, 1, 1, 1);
+ let c = i16x4::new(10, 9, 8, 7);
+ let r: i16x4 = transmute(vaba_s16(transmute(a), transmute(b), transmute(c)));
+ let e = i16x4::new(10, 10, 10, 10);
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaba_s32() {
+ let a = i32x2::new(1, 2);
+ let b = i32x2::new(1, 1);
+ let c = i32x2::new(10, 9);
+ let r: i32x2 = transmute(vaba_s32(transmute(a), transmute(b), transmute(c)));
+ let e = i32x2::new(10, 10);
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaba_u8() {
+ let a = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b = u8x8::new(1, 1, 1, 1, 1, 1, 1, 1);
+ let c = u8x8::new(10, 9, 8, 7, 6, 5, 4, 3);
+ let r: u8x8 = transmute(vaba_u8(transmute(a), transmute(b), transmute(c)));
+ let e = u8x8::new(10, 10, 10, 10, 10, 10, 10, 10);
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaba_u16() {
+ let a = u16x4::new(1, 2, 3, 4);
+ let b = u16x4::new(1, 1, 1, 1);
+ let c = u16x4::new(10, 9, 8, 7);
+ let r: u16x4 = transmute(vaba_u16(transmute(a), transmute(b), transmute(c)));
+ let e = u16x4::new(10, 10, 10, 10);
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vaba_u32() {
+ let a = u32x2::new(1, 2);
+ let b = u32x2::new(1, 1);
+ let c = u32x2::new(10, 9);
+ let r: u32x2 = transmute(vaba_u32(transmute(a), transmute(b), transmute(c)));
+ let e = u32x2::new(10, 10);
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabaq_s8() {
+ let a = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 2);
+ let b = i8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
+ let c = i8x16::new(10, 9, 8, 7, 6, 5, 4, 3, 12, 13, 14, 15, 16, 17, 18, 19);
+ let r: i8x16 = transmute(vabaq_s8(transmute(a), transmute(b), transmute(c)));
+ let e = i8x16::new(
+ 10, 10, 10, 10, 10, 10, 10, 10, 20, 20, 20, 20, 20, 20, 20, 20,
+ );
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabaq_s16() {
+ let a = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b = i16x8::new(1, 1, 1, 1, 1, 1, 1, 1);
+ let c = i16x8::new(10, 9, 8, 7, 6, 5, 4, 3);
+ let r: i16x8 = transmute(vabaq_s16(transmute(a), transmute(b), transmute(c)));
+ let e = i16x8::new(10, 10, 10, 10, 10, 10, 10, 10);
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabaq_s32() {
+ let a = i32x4::new(1, 2, 3, 4);
+ let b = i32x4::new(1, 1, 1, 1);
+ let c = i32x4::new(10, 9, 8, 7);
+ let r: i32x4 = transmute(vabaq_s32(transmute(a), transmute(b), transmute(c)));
+ let e = i32x4::new(10, 10, 10, 10);
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabaq_u8() {
+ let a = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 2);
+ let b = u8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
+ let c = u8x16::new(10, 9, 8, 7, 6, 5, 4, 3, 12, 13, 14, 15, 16, 17, 18, 19);
+ let r: u8x16 = transmute(vabaq_u8(transmute(a), transmute(b), transmute(c)));
+ let e = u8x16::new(
+ 10, 10, 10, 10, 10, 10, 10, 10, 20, 20, 20, 20, 20, 20, 20, 20,
+ );
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabaq_u16() {
+ let a = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b = u16x8::new(1, 1, 1, 1, 1, 1, 1, 1);
+ let c = u16x8::new(10, 9, 8, 7, 6, 5, 4, 3);
+ let r: u16x8 = transmute(vabaq_u16(transmute(a), transmute(b), transmute(c)));
+ let e = u16x8::new(10, 10, 10, 10, 10, 10, 10, 10);
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vabaq_u32() {
+ let a = u32x4::new(1, 2, 3, 4);
+ let b = u32x4::new(1, 1, 1, 1);
+ let c = u32x4::new(10, 9, 8, 7);
+ let r: u32x4 = transmute(vabaq_u32(transmute(a), transmute(b), transmute(c)));
+ let e = u32x4::new(10, 10, 10, 10);
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpadd_s16() {
+ let a = i16x4::new(1, 2, 3, 4);
+ let b = i16x4::new(0, -1, -2, -3);
+ let r: i16x4 = transmute(vpadd_s16(transmute(a), transmute(b)));
+ let e = i16x4::new(3, 7, -1, -5);
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpadd_s32() {
+ let a = i32x2::new(1, 2);
+ let b = i32x2::new(0, -1);
+ let r: i32x2 = transmute(vpadd_s32(transmute(a), transmute(b)));
+ let e = i32x2::new(3, -1);
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpadd_s8() {
+ let a = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b = i8x8::new(0, -1, -2, -3, -4, -5, -6, -7);
+ let r: i8x8 = transmute(vpadd_s8(transmute(a), transmute(b)));
+ let e = i8x8::new(3, 7, 11, 15, -1, -5, -9, -13);
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpadd_u16() {
+ let a = u16x4::new(1, 2, 3, 4);
+ let b = u16x4::new(30, 31, 32, 33);
+ let r: u16x4 = transmute(vpadd_u16(transmute(a), transmute(b)));
+ let e = u16x4::new(3, 7, 61, 65);
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpadd_u32() {
+ let a = u32x2::new(1, 2);
+ let b = u32x2::new(30, 31);
+ let r: u32x2 = transmute(vpadd_u32(transmute(a), transmute(b)));
+ let e = u32x2::new(3, 61);
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vpadd_u8() {
+ let a = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+ let b = u8x8::new(30, 31, 32, 33, 34, 35, 36, 37);
+ let r: u8x8 = transmute(vpadd_u8(transmute(a), transmute(b)));
+ let e = u8x8::new(3, 7, 11, 15, 61, 65, 69, 73);
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcnt_s8() {
+ let a: i8x8 = transmute(u8x8::new(
+ 0b11001000, 0b11111111, 0b00000000, 0b11011111, 0b10000001, 0b10101001, 0b00001000,
+ 0b00111111,
+ ));
+ let e = i8x8::new(3, 8, 0, 7, 2, 4, 1, 6);
+ let r: i8x8 = transmute(vcnt_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcntq_s8() {
+ let a: i8x16 = transmute(u8x16::new(
+ 0b11001000, 0b11111111, 0b00000000, 0b11011111, 0b10000001, 0b10101001, 0b00001000,
+ 0b00111111, 0b11101110, 0b00000000, 0b11111111, 0b00100001, 0b11111111, 0b10010111,
+ 0b11100000, 0b00010000,
+ ));
+ let e = i8x16::new(3, 8, 0, 7, 2, 4, 1, 6, 6, 0, 8, 2, 8, 5, 3, 1);
+ let r: i8x16 = transmute(vcntq_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcnt_u8() {
+ let a = u8x8::new(
+ 0b11001000, 0b11111111, 0b00000000, 0b11011111, 0b10000001, 0b10101001, 0b00001000,
+ 0b00111111,
+ );
+ let e = u8x8::new(3, 8, 0, 7, 2, 4, 1, 6);
+ let r: u8x8 = transmute(vcnt_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcntq_u8() {
+ let a = u8x16::new(
+ 0b11001000, 0b11111111, 0b00000000, 0b11011111, 0b10000001, 0b10101001, 0b00001000,
+ 0b00111111, 0b11101110, 0b00000000, 0b11111111, 0b00100001, 0b11111111, 0b10010111,
+ 0b11100000, 0b00010000,
+ );
+ let e = u8x16::new(3, 8, 0, 7, 2, 4, 1, 6, 6, 0, 8, 2, 8, 5, 3, 1);
+ let r: u8x16 = transmute(vcntq_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcnt_p8() {
+ let a = u8x8::new(
+ 0b11001000, 0b11111111, 0b00000000, 0b11011111, 0b10000001, 0b10101001, 0b00001000,
+ 0b00111111,
+ );
+ let e = u8x8::new(3, 8, 0, 7, 2, 4, 1, 6);
+ let r: u8x8 = transmute(vcnt_p8(transmute(a)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vcntq_p8() {
+ let a = u8x16::new(
+ 0b11001000, 0b11111111, 0b00000000, 0b11011111, 0b10000001, 0b10101001, 0b00001000,
+ 0b00111111, 0b11101110, 0b00000000, 0b11111111, 0b00100001, 0b11111111, 0b10010111,
+ 0b11100000, 0b00010000,
+ );
+ let e = u8x16::new(3, 8, 0, 7, 2, 4, 1, 6, 6, 0, 8, 2, 8, 5, 3, 1);
+ let r: u8x16 = transmute(vcntq_p8(transmute(a)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrev16_s8() {
+ let a = i8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = i8x8::new(1, 0, 3, 2, 5, 4, 7, 6);
+ let e: i8x8 = transmute(vrev16_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrev16q_s8() {
+ let a = i8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = i8x16::new(1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14);
+ let e: i8x16 = transmute(vrev16q_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrev16_u8() {
+ let a = u8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = u8x8::new(1, 0, 3, 2, 5, 4, 7, 6);
+ let e: u8x8 = transmute(vrev16_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrev16q_u8() {
+ let a = u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = u8x16::new(1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14);
+ let e: u8x16 = transmute(vrev16q_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrev16_p8() {
+ let a = i8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = i8x8::new(1, 0, 3, 2, 5, 4, 7, 6);
+ let e: i8x8 = transmute(vrev16_p8(transmute(a)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrev16q_p8() {
+ let a = u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = u8x16::new(1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14);
+ let e: u8x16 = transmute(vrev16q_p8(transmute(a)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrev32_s8() {
+ let a = i8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = i8x8::new(3, 2, 1, 0, 7, 6, 5, 4);
+ let e: i8x8 = transmute(vrev32_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrev32q_s8() {
+ let a = i8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = i8x16::new(3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12);
+ let e: i8x16 = transmute(vrev32q_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrev32_u8() {
+ let a = u8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = u8x8::new(3, 2, 1, 0, 7, 6, 5, 4);
+ let e: u8x8 = transmute(vrev32_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrev32q_u8() {
+ let a = u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = u8x16::new(3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12);
+ let e: u8x16 = transmute(vrev32q_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrev32_s16() {
+ let a = i16x4::new(0, 1, 2, 3);
+ let r = i16x4::new(1, 0, 3, 2);
+ let e: i16x4 = transmute(vrev32_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrev32q_s16() {
+ let a = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = i16x8::new(1, 0, 3, 2, 5, 4, 7, 6);
+ let e: i16x8 = transmute(vrev32q_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrev32_p16() {
+ let a = i16x4::new(0, 1, 2, 3);
+ let r = i16x4::new(1, 0, 3, 2);
+ let e: i16x4 = transmute(vrev32_p16(transmute(a)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrev32q_p16() {
+ let a = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = i16x8::new(1, 0, 3, 2, 5, 4, 7, 6);
+ let e: i16x8 = transmute(vrev32q_p16(transmute(a)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrev32_u16() {
+ let a = u16x4::new(0, 1, 2, 3);
+ let r = u16x4::new(1, 0, 3, 2);
+ let e: u16x4 = transmute(vrev32_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrev32q_u16() {
+ let a = u16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = u16x8::new(1, 0, 3, 2, 5, 4, 7, 6);
+ let e: u16x8 = transmute(vrev32q_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrev32_p8() {
+ let a = u8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = u8x8::new(3, 2, 1, 0, 7, 6, 5, 4);
+ let e: u8x8 = transmute(vrev32_p8(transmute(a)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrev32q_p8() {
+ let a = u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = u8x16::new(3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12);
+ let e: u8x16 = transmute(vrev32q_p8(transmute(a)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrev64_s8() {
+ let a = i8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = i8x8::new(7, 6, 5, 4, 3, 2, 1, 0);
+ let e: i8x8 = transmute(vrev64_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrev64q_s8() {
+ let a = i8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = i8x16::new(7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8);
+ let e: i8x16 = transmute(vrev64q_s8(transmute(a)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrev64_s16() {
+ let a = i16x4::new(0, 1, 2, 3);
+ let r = i16x4::new(3, 2, 1, 0);
+ let e: i16x4 = transmute(vrev64_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrev64q_s16() {
+ let a = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = i16x8::new(3, 2, 1, 0, 7, 6, 5, 4);
+ let e: i16x8 = transmute(vrev64q_s16(transmute(a)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrev64_s32() {
+ let a = i32x2::new(0, 1);
+ let r = i32x2::new(1, 0);
+ let e: i32x2 = transmute(vrev64_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrev64q_s32() {
+ let a = i32x4::new(0, 1, 2, 3);
+ let r = i32x4::new(1, 0, 3, 2);
+ let e: i32x4 = transmute(vrev64q_s32(transmute(a)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrev64_u8() {
+ let a = u8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = u8x8::new(7, 6, 5, 4, 3, 2, 1, 0);
+ let e: u8x8 = transmute(vrev64_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrev64q_u8() {
+ let a = u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = u8x16::new(7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8);
+ let e: u8x16 = transmute(vrev64q_u8(transmute(a)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrev64_u16() {
+ let a = u16x4::new(0, 1, 2, 3);
+ let r = u16x4::new(3, 2, 1, 0);
+ let e: u16x4 = transmute(vrev64_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrev64q_u16() {
+ let a = u16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = u16x8::new(3, 2, 1, 0, 7, 6, 5, 4);
+ let e: u16x8 = transmute(vrev64q_u16(transmute(a)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrev64_u32() {
+ let a = u32x2::new(0, 1);
+ let r = u32x2::new(1, 0);
+ let e: u32x2 = transmute(vrev64_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrev64q_u32() {
+ let a = u32x4::new(0, 1, 2, 3);
+ let r = u32x4::new(1, 0, 3, 2);
+ let e: u32x4 = transmute(vrev64q_u32(transmute(a)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrev64_f32() {
+ let a = f32x2::new(1.0, 2.0);
+ let r = f32x2::new(2.0, 1.0);
+ let e: f32x2 = transmute(vrev64_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrev64q_f32() {
+ let a = f32x4::new(1.0, 2.0, -2.0, -1.0);
+ let r = f32x4::new(2.0, 1.0, -1.0, -2.0);
+ let e: f32x4 = transmute(vrev64q_f32(transmute(a)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrev64_p8() {
+ let a = u8x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = u8x8::new(7, 6, 5, 4, 3, 2, 1, 0);
+ let e: u8x8 = transmute(vrev64_p8(transmute(a)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrev64q_p8() {
+ let a = u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = u8x16::new(7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8);
+ let e: u8x16 = transmute(vrev64q_p8(transmute(a)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrev64_p16() {
+ let a = u16x4::new(0, 1, 2, 3);
+ let r = u16x4::new(3, 2, 1, 0);
+ let e: u16x4 = transmute(vrev64_p16(transmute(a)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon")]
+ unsafe fn test_vrev64q_p16() {
+ let a = u16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = u16x8::new(3, 2, 1, 0, 7, 6, 5, 4);
+ let e: u16x8 = transmute(vrev64q_p16(transmute(a)));
+ assert_eq!(r, e);
+ }
+ #[simd_test(enable = "neon,i8mm")]
+ unsafe fn test_vmmlaq_s32() {
+ let a: i32x4 = i32x4::new(1, 3, 4, 9);
+ let b: i8x16 = i8x16::new(1, 21, 31, 14, 5, 6, 17, 8, 9, 13, 15, 12, 13, 19, 20, 16);
+ let c: i8x16 = i8x16::new(12, 22, 3, 4, 5, 56, 7, 8, 91, 10, 11, 15, 13, 14, 17, 16);
+ let e: i32x4 = i32x4::new(1, 2, 3, 4);
+ let r: i32x4 = transmute(vmmlaq_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon,i8mm")]
+ unsafe fn test_vmmlaq_u32() {
+ let a: u32x4 = u32x4::new(1, 3, 4, 9);
+ let b: i8x16 = i8x16::new(1, 21, 31, 14, 5, 6, 17, 8, 9, 13, 15, 12, 13, 19, 20, 16);
+ let c: i8x16 = i8x16::new(12, 22, 3, 4, 5, 56, 7, 8, 91, 10, 11, 15, 13, 14, 17, 16);
+ let e: u32x4 = u32x4::new(1, 2, 3, 4);
+ let r: u32x4 = transmute(vmmlaq_u32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "neon,i8mm")]
+ unsafe fn test_vusmmlaq_s32() {
+ let a: i32x4 = i32x4::new(1, 3, 4, 9);
+ let b: i8x16 = i8x16::new(1, 21, 31, 14, 5, 6, 17, 8, 9, 13, 15, 12, 13, 19, 20, 16);
+ let c: i8x16 = i8x16::new(12, 22, 3, 4, 5, 56, 7, 8, 91, 10, 11, 15, 13, 14, 17, 16);
+ let e: i32x4 = i32x4::new(1, 2, 3, 4);
+ let r: i32x4 = transmute(vusmmlaq_s32(transmute(a), transmute(b), transmute(c)));
+ assert_eq!(r, e);
+ }
+}
+
+#[cfg(all(test, target_arch = "arm", target_endian = "little"))]
+mod table_lookup_tests;
+
+#[cfg(all(test, target_arch = "arm"))]
+mod shift_and_insert_tests;
+
+#[cfg(all(test, target_arch = "arm"))]
+mod load_tests;
+
+#[cfg(all(test, target_arch = "arm"))]
+mod store_tests;
diff --git a/library/stdarch/crates/core_arch/src/arm_shared/neon/shift_and_insert_tests.rs b/library/stdarch/crates/core_arch/src/arm_shared/neon/shift_and_insert_tests.rs
new file mode 100644
index 000000000..ebb8b7b9e
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/arm_shared/neon/shift_and_insert_tests.rs
@@ -0,0 +1,93 @@
+//! Tests for ARM+v7+neon shift and insert (vsli[q]_n, vsri[q]_n) intrinsics.
+//!
+//! These are included in `{arm, aarch64}::neon`.
+
+use super::*;
+
+#[cfg(target_arch = "aarch64")]
+use crate::core_arch::aarch64::*;
+
+#[cfg(target_arch = "arm")]
+use crate::core_arch::arm::*;
+
+use crate::core_arch::simd::*;
+use std::mem::transmute;
+use stdarch_test::simd_test;
+
+macro_rules! test_vsli {
+ ($test_id:ident, $t:ty => $fn_id:ident ([$($a:expr),*], [$($b:expr),*], $n:expr)) => {
+ #[simd_test(enable = "neon")]
+ #[allow(unused_assignments)]
+ unsafe fn $test_id() {
+ let a = [$($a as $t),*];
+ let b = [$($b as $t),*];
+ let n_bit_mask: $t = (1 << $n) - 1;
+ let e = [$(($a as $t & n_bit_mask) | ($b as $t << $n)),*];
+ let r = $fn_id::<$n>(transmute(a), transmute(b));
+ let mut d = e;
+ d = transmute(r);
+ assert_eq!(d, e);
+ }
+ }
+}
+test_vsli!(test_vsli_n_s8, i8 => vsli_n_s8([3, -44, 127, -56, 0, 24, -97, 10], [-128, -14, 125, -77, 27, 8, -1, 110], 5));
+test_vsli!(test_vsliq_n_s8, i8 => vsliq_n_s8([3, -44, 127, -56, 0, 24, -97, 10, -33, 1, -6, -39, 15, 101, -80, -1], [-128, -14, 125, -77, 27, 8, -1, 110, -4, -92, 111, 32, 1, -4, -29, 99], 2));
+test_vsli!(test_vsli_n_s16, i16 => vsli_n_s16([3304, -44, 2300, -546], [-1208, -140, 1225, -707], 7));
+test_vsli!(test_vsliq_n_s16, i16 => vsliq_n_s16([3304, -44, 2300, -20046, 0, 9924, -907, 1190], [-1208, -140, 4225, -707, 2701, 804, -71, 2110], 14));
+test_vsli!(test_vsli_n_s32, i32 => vsli_n_s32([125683, -78901], [-128, -112944], 23));
+test_vsli!(test_vsliq_n_s32, i32 => vsliq_n_s32([125683, -78901, 127, -12009], [-128, -112944, 125, -707], 15));
+test_vsli!(test_vsli_n_s64, i64 => vsli_n_s64([-333333], [1028], 45));
+test_vsli!(test_vsliq_n_s64, i64 => vsliq_n_s64([-333333, -52023], [1028, -99814], 33));
+test_vsli!(test_vsli_n_u8, u8 => vsli_n_u8([3, 44, 127, 56, 0, 24, 97, 10], [127, 14, 125, 77, 27, 8, 1, 110], 5));
+test_vsli!(test_vsliq_n_u8, u8 => vsliq_n_u8([3, 44, 127, 56, 0, 24, 97, 10, 33, 1, 6, 39, 15, 101, 80, 1], [127, 14, 125, 77, 27, 8, 1, 110, 4, 92, 111, 32, 1, 4, 29, 99], 2));
+test_vsli!(test_vsli_n_u16, u16 => vsli_n_u16([3304, 44, 2300, 546], [1208, 140, 1225, 707], 7));
+test_vsli!(test_vsliq_n_u16, u16 => vsliq_n_u16([3304, 44, 2300, 20046, 0, 9924, 907, 1190], [1208, 140, 4225, 707, 2701, 804, 71, 2110], 14));
+test_vsli!(test_vsli_n_u32, u32 => vsli_n_u32([125683, 78901], [128, 112944], 23));
+test_vsli!(test_vsliq_n_u32, u32 => vsliq_n_u32([125683, 78901, 127, 12009], [128, 112944, 125, 707], 15));
+test_vsli!(test_vsli_n_u64, u64 => vsli_n_u64([333333], [1028], 45));
+test_vsli!(test_vsliq_n_u64, u64 => vsliq_n_u64([333333, 52023], [1028, 99814], 33));
+test_vsli!(test_vsli_n_p8, i8 => vsli_n_p8([3, 44, 127, 56, 0, 24, 97, 10], [127, 14, 125, 77, 27, 8, 1, 110], 5));
+test_vsli!(test_vsliq_n_p8, i8 => vsliq_n_p8([3, 44, 127, 56, 0, 24, 97, 10, 33, 1, 6, 39, 15, 101, 80, 1], [127, 14, 125, 77, 27, 8, 1, 110, 4, 92, 111, 32, 1, 4, 29, 99], 2));
+test_vsli!(test_vsli_n_p16, i16 => vsli_n_p16([3304, 44, 2300, 546], [1208, 140, 1225, 707], 7));
+test_vsli!(test_vsliq_n_p16, i16 => vsliq_n_p16([3304, 44, 2300, 20046, 0, 9924, 907, 1190], [1208, 140, 4225, 707, 2701, 804, 71, 2110], 14));
+test_vsli!(test_vsli_n_p64, i64 => vsli_n_p64([333333], [1028], 45));
+test_vsli!(test_vsliq_n_p64, i64 => vsliq_n_p64([333333, 52023], [1028, 99814], 33));
+
+macro_rules! test_vsri {
+ ($test_id:ident, $t:ty => $fn_id:ident ([$($a:expr),*], [$($b:expr),*], $n:expr)) => {
+ #[simd_test(enable = "neon")]
+ #[allow(unused_assignments)]
+ unsafe fn $test_id() {
+ let a = [$($a as $t),*];
+ let b = [$($b as $t),*];
+ let n_bit_mask = ((1 as $t << $n) - 1).rotate_right($n);
+ let e = [$(($a as $t & n_bit_mask) | (($b as $t >> $n) & !n_bit_mask)),*];
+ let r = $fn_id::<$n>(transmute(a), transmute(b));
+ let mut d = e;
+ d = transmute(r);
+ assert_eq!(d, e);
+ }
+ }
+}
+test_vsri!(test_vsri_n_s8, i8 => vsri_n_s8([3, -44, 127, -56, 0, 24, -97, 10], [-128, -14, 125, -77, 27, 8, -1, 110], 5));
+test_vsri!(test_vsriq_n_s8, i8 => vsriq_n_s8([3, -44, 127, -56, 0, 24, -97, 10, -33, 1, -6, -39, 15, 101, -80, -1], [-128, -14, 125, -77, 27, 8, -1, 110, -4, -92, 111, 32, 1, -4, -29, 99], 2));
+test_vsri!(test_vsri_n_s16, i16 => vsri_n_s16([3304, -44, 2300, -546], [-1208, -140, 1225, -707], 7));
+test_vsri!(test_vsriq_n_s16, i16 => vsriq_n_s16([3304, -44, 2300, -20046, 0, 9924, -907, 1190], [-1208, -140, 4225, -707, 2701, 804, -71, 2110], 14));
+test_vsri!(test_vsri_n_s32, i32 => vsri_n_s32([125683, -78901], [-128, -112944], 23));
+test_vsri!(test_vsriq_n_s32, i32 => vsriq_n_s32([125683, -78901, 127, -12009], [-128, -112944, 125, -707], 15));
+test_vsri!(test_vsri_n_s64, i64 => vsri_n_s64([-333333], [1028], 45));
+test_vsri!(test_vsriq_n_s64, i64 => vsriq_n_s64([-333333, -52023], [1028, -99814], 33));
+test_vsri!(test_vsri_n_u8, u8 => vsri_n_u8([3, 44, 127, 56, 0, 24, 97, 10], [127, 14, 125, 77, 27, 8, 1, 110], 5));
+test_vsri!(test_vsriq_n_u8, u8 => vsriq_n_u8([3, 44, 127, 56, 0, 24, 97, 10, 33, 1, 6, 39, 15, 101, 80, 1], [127, 14, 125, 77, 27, 8, 1, 110, 4, 92, 111, 32, 1, 4, 29, 99], 2));
+test_vsri!(test_vsri_n_u16, u16 => vsri_n_u16([3304, 44, 2300, 546], [1208, 140, 1225, 707], 7));
+test_vsri!(test_vsriq_n_u16, u16 => vsriq_n_u16([3304, 44, 2300, 20046, 0, 9924, 907, 1190], [1208, 140, 4225, 707, 2701, 804, 71, 2110], 14));
+test_vsri!(test_vsri_n_u32, u32 => vsri_n_u32([125683, 78901], [128, 112944], 23));
+test_vsri!(test_vsriq_n_u32, u32 => vsriq_n_u32([125683, 78901, 127, 12009], [128, 112944, 125, 707], 15));
+test_vsri!(test_vsri_n_u64, u64 => vsri_n_u64([333333], [1028], 45));
+test_vsri!(test_vsriq_n_u64, u64 => vsriq_n_u64([333333, 52023], [1028, 99814], 33));
+test_vsri!(test_vsri_n_p8, i8 => vsri_n_p8([3, 44, 127, 56, 0, 24, 97, 10], [127, 14, 125, 77, 27, 8, 1, 110], 5));
+test_vsri!(test_vsriq_n_p8, i8 => vsriq_n_p8([3, 44, 127, 56, 0, 24, 97, 10, 33, 1, 6, 39, 15, 101, 80, 1], [127, 14, 125, 77, 27, 8, 1, 110, 4, 92, 111, 32, 1, 4, 29, 99], 2));
+test_vsri!(test_vsri_n_p16, i16 => vsri_n_p16([3304, 44, 2300, 546], [1208, 140, 1225, 707], 7));
+test_vsri!(test_vsriq_n_p16, i16 => vsriq_n_p16([3304, 44, 2300, 20046, 0, 9924, 907, 1190], [1208, 140, 4225, 707, 2701, 804, 71, 2110], 14));
+test_vsri!(test_vsri_n_p64, i64 => vsri_n_p64([333333], [1028], 45));
+test_vsri!(test_vsriq_n_p64, i64 => vsriq_n_p64([333333, 52023], [1028, 99814], 33));
diff --git a/library/stdarch/crates/core_arch/src/arm_shared/neon/store_tests.rs b/library/stdarch/crates/core_arch/src/arm_shared/neon/store_tests.rs
new file mode 100644
index 000000000..cad660e87
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/arm_shared/neon/store_tests.rs
@@ -0,0 +1,389 @@
+//! Tests for ARM+v7+neon store (vst1) intrinsics.
+//!
+//! These are included in `{arm, aarch64}::neon`.
+
+use super::*;
+
+#[cfg(target_arch = "arm")]
+use crate::core_arch::arm::*;
+
+#[cfg(target_arch = "aarch64")]
+use crate::core_arch::aarch64::*;
+
+use crate::core_arch::simd::*;
+use stdarch_test::simd_test;
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vst1_s8() {
+ let mut vals = [0_i8; 9];
+ let a = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+
+ vst1_s8(vals[1..].as_mut_ptr(), transmute(a));
+
+ assert_eq!(vals[0], 0);
+ assert_eq!(vals[1], 1);
+ assert_eq!(vals[2], 2);
+ assert_eq!(vals[3], 3);
+ assert_eq!(vals[4], 4);
+ assert_eq!(vals[5], 5);
+ assert_eq!(vals[6], 6);
+ assert_eq!(vals[7], 7);
+ assert_eq!(vals[8], 8);
+}
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vst1q_s8() {
+ let mut vals = [0_i8; 17];
+ let a = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+
+ vst1q_s8(vals[1..].as_mut_ptr(), transmute(a));
+
+ assert_eq!(vals[0], 0);
+ assert_eq!(vals[1], 1);
+ assert_eq!(vals[2], 2);
+ assert_eq!(vals[3], 3);
+ assert_eq!(vals[4], 4);
+ assert_eq!(vals[5], 5);
+ assert_eq!(vals[6], 6);
+ assert_eq!(vals[7], 7);
+ assert_eq!(vals[8], 8);
+ assert_eq!(vals[9], 9);
+ assert_eq!(vals[10], 10);
+ assert_eq!(vals[11], 11);
+ assert_eq!(vals[12], 12);
+ assert_eq!(vals[13], 13);
+ assert_eq!(vals[14], 14);
+ assert_eq!(vals[15], 15);
+ assert_eq!(vals[16], 16);
+}
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vst1_s16() {
+ let mut vals = [0_i16; 5];
+ let a = i16x4::new(1, 2, 3, 4);
+
+ vst1_s16(vals[1..].as_mut_ptr(), transmute(a));
+
+ assert_eq!(vals[0], 0);
+ assert_eq!(vals[1], 1);
+ assert_eq!(vals[2], 2);
+ assert_eq!(vals[3], 3);
+ assert_eq!(vals[4], 4);
+}
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vst1q_s16() {
+ let mut vals = [0_i16; 9];
+ let a = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+
+ vst1q_s16(vals[1..].as_mut_ptr(), transmute(a));
+
+ assert_eq!(vals[0], 0);
+ assert_eq!(vals[1], 1);
+ assert_eq!(vals[2], 2);
+ assert_eq!(vals[3], 3);
+ assert_eq!(vals[4], 4);
+ assert_eq!(vals[5], 5);
+ assert_eq!(vals[6], 6);
+ assert_eq!(vals[7], 7);
+ assert_eq!(vals[8], 8);
+}
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vst1_s32() {
+ let mut vals = [0_i32; 3];
+ let a = i32x2::new(1, 2);
+
+ vst1_s32(vals[1..].as_mut_ptr(), transmute(a));
+
+ assert_eq!(vals[0], 0);
+ assert_eq!(vals[1], 1);
+ assert_eq!(vals[2], 2);
+}
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vst1q_s32() {
+ let mut vals = [0_i32; 5];
+ let a = i32x4::new(1, 2, 3, 4);
+
+ vst1q_s32(vals[1..].as_mut_ptr(), transmute(a));
+
+ assert_eq!(vals[0], 0);
+ assert_eq!(vals[1], 1);
+ assert_eq!(vals[2], 2);
+ assert_eq!(vals[3], 3);
+ assert_eq!(vals[4], 4);
+}
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vst1_s64() {
+ let mut vals = [0_i64; 2];
+ let a = i64x1::new(1);
+
+ vst1_s64(vals[1..].as_mut_ptr(), transmute(a));
+
+ assert_eq!(vals[0], 0);
+ assert_eq!(vals[1], 1);
+}
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vst1q_s64() {
+ let mut vals = [0_i64; 3];
+ let a = i64x2::new(1, 2);
+
+ vst1q_s64(vals[1..].as_mut_ptr(), transmute(a));
+
+ assert_eq!(vals[0], 0);
+ assert_eq!(vals[1], 1);
+ assert_eq!(vals[2], 2);
+}
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vst1_u8() {
+ let mut vals = [0_u8; 9];
+ let a = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+
+ vst1_u8(vals[1..].as_mut_ptr(), transmute(a));
+
+ assert_eq!(vals[0], 0);
+ assert_eq!(vals[1], 1);
+ assert_eq!(vals[2], 2);
+ assert_eq!(vals[3], 3);
+ assert_eq!(vals[4], 4);
+ assert_eq!(vals[5], 5);
+ assert_eq!(vals[6], 6);
+ assert_eq!(vals[7], 7);
+ assert_eq!(vals[8], 8);
+}
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vst1q_u8() {
+ let mut vals = [0_u8; 17];
+ let a = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+
+ vst1q_u8(vals[1..].as_mut_ptr(), transmute(a));
+
+ assert_eq!(vals[0], 0);
+ assert_eq!(vals[1], 1);
+ assert_eq!(vals[2], 2);
+ assert_eq!(vals[3], 3);
+ assert_eq!(vals[4], 4);
+ assert_eq!(vals[5], 5);
+ assert_eq!(vals[6], 6);
+ assert_eq!(vals[7], 7);
+ assert_eq!(vals[8], 8);
+ assert_eq!(vals[9], 9);
+ assert_eq!(vals[10], 10);
+ assert_eq!(vals[11], 11);
+ assert_eq!(vals[12], 12);
+ assert_eq!(vals[13], 13);
+ assert_eq!(vals[14], 14);
+ assert_eq!(vals[15], 15);
+ assert_eq!(vals[16], 16);
+}
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vst1_u16() {
+ let mut vals = [0_u16; 5];
+ let a = u16x4::new(1, 2, 3, 4);
+
+ vst1_u16(vals[1..].as_mut_ptr(), transmute(a));
+
+ assert_eq!(vals[0], 0);
+ assert_eq!(vals[1], 1);
+ assert_eq!(vals[2], 2);
+ assert_eq!(vals[3], 3);
+ assert_eq!(vals[4], 4);
+}
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vst1q_u16() {
+ let mut vals = [0_u16; 9];
+ let a = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+
+ vst1q_u16(vals[1..].as_mut_ptr(), transmute(a));
+
+ assert_eq!(vals[0], 0);
+ assert_eq!(vals[1], 1);
+ assert_eq!(vals[2], 2);
+ assert_eq!(vals[3], 3);
+ assert_eq!(vals[4], 4);
+ assert_eq!(vals[5], 5);
+ assert_eq!(vals[6], 6);
+ assert_eq!(vals[7], 7);
+ assert_eq!(vals[8], 8);
+}
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vst1_u32() {
+ let mut vals = [0_u32; 3];
+ let a = u32x2::new(1, 2);
+
+ vst1_u32(vals[1..].as_mut_ptr(), transmute(a));
+
+ assert_eq!(vals[0], 0);
+ assert_eq!(vals[1], 1);
+ assert_eq!(vals[2], 2);
+}
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vst1q_u32() {
+ let mut vals = [0_u32; 5];
+ let a = u32x4::new(1, 2, 3, 4);
+
+ vst1q_u32(vals[1..].as_mut_ptr(), transmute(a));
+
+ assert_eq!(vals[0], 0);
+ assert_eq!(vals[1], 1);
+ assert_eq!(vals[2], 2);
+ assert_eq!(vals[3], 3);
+ assert_eq!(vals[4], 4);
+}
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vst1_u64() {
+ let mut vals = [0_u64; 2];
+ let a = u64x1::new(1);
+
+ vst1_u64(vals[1..].as_mut_ptr(), transmute(a));
+
+ assert_eq!(vals[0], 0);
+ assert_eq!(vals[1], 1);
+}
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vst1q_u64() {
+ let mut vals = [0_u64; 3];
+ let a = u64x2::new(1, 2);
+
+ vst1q_u64(vals[1..].as_mut_ptr(), transmute(a));
+
+ assert_eq!(vals[0], 0);
+ assert_eq!(vals[1], 1);
+ assert_eq!(vals[2], 2);
+}
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vst1_p8() {
+ let mut vals = [0_u8; 9];
+ let a = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+
+ vst1_p8(vals[1..].as_mut_ptr(), transmute(a));
+
+ assert_eq!(vals[0], 0);
+ assert_eq!(vals[1], 1);
+ assert_eq!(vals[2], 2);
+ assert_eq!(vals[3], 3);
+ assert_eq!(vals[4], 4);
+ assert_eq!(vals[5], 5);
+ assert_eq!(vals[6], 6);
+ assert_eq!(vals[7], 7);
+ assert_eq!(vals[8], 8);
+}
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vst1q_p8() {
+ let mut vals = [0_u8; 17];
+ let a = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+
+ vst1q_p8(vals[1..].as_mut_ptr(), transmute(a));
+
+ assert_eq!(vals[0], 0);
+ assert_eq!(vals[1], 1);
+ assert_eq!(vals[2], 2);
+ assert_eq!(vals[3], 3);
+ assert_eq!(vals[4], 4);
+ assert_eq!(vals[5], 5);
+ assert_eq!(vals[6], 6);
+ assert_eq!(vals[7], 7);
+ assert_eq!(vals[8], 8);
+ assert_eq!(vals[9], 9);
+ assert_eq!(vals[10], 10);
+ assert_eq!(vals[11], 11);
+ assert_eq!(vals[12], 12);
+ assert_eq!(vals[13], 13);
+ assert_eq!(vals[14], 14);
+ assert_eq!(vals[15], 15);
+ assert_eq!(vals[16], 16);
+}
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vst1_p16() {
+ let mut vals = [0_u16; 5];
+ let a = u16x4::new(1, 2, 3, 4);
+
+ vst1_p16(vals[1..].as_mut_ptr(), transmute(a));
+
+ assert_eq!(vals[0], 0);
+ assert_eq!(vals[1], 1);
+ assert_eq!(vals[2], 2);
+ assert_eq!(vals[3], 3);
+ assert_eq!(vals[4], 4);
+}
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vst1q_p16() {
+ let mut vals = [0_u16; 9];
+ let a = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
+
+ vst1q_p16(vals[1..].as_mut_ptr(), transmute(a));
+
+ assert_eq!(vals[0], 0);
+ assert_eq!(vals[1], 1);
+ assert_eq!(vals[2], 2);
+ assert_eq!(vals[3], 3);
+ assert_eq!(vals[4], 4);
+ assert_eq!(vals[5], 5);
+ assert_eq!(vals[6], 6);
+ assert_eq!(vals[7], 7);
+ assert_eq!(vals[8], 8);
+}
+
+#[simd_test(enable = "neon,aes")]
+unsafe fn test_vst1_p64() {
+ let mut vals = [0_u64; 2];
+ let a = u64x1::new(1);
+
+ vst1_p64(vals[1..].as_mut_ptr(), transmute(a));
+
+ assert_eq!(vals[0], 0);
+ assert_eq!(vals[1], 1);
+}
+
+#[simd_test(enable = "neon,aes")]
+unsafe fn test_vst1q_p64() {
+ let mut vals = [0_u64; 3];
+ let a = u64x2::new(1, 2);
+
+ vst1q_p64(vals[1..].as_mut_ptr(), transmute(a));
+
+ assert_eq!(vals[0], 0);
+ assert_eq!(vals[1], 1);
+ assert_eq!(vals[2], 2);
+}
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vst1_f32() {
+ let mut vals = [0_f32; 3];
+ let a = f32x2::new(1., 2.);
+
+ vst1_f32(vals[1..].as_mut_ptr(), transmute(a));
+
+ assert_eq!(vals[0], 0.);
+ assert_eq!(vals[1], 1.);
+ assert_eq!(vals[2], 2.);
+}
+
+#[simd_test(enable = "neon")]
+unsafe fn test_vst1q_f32() {
+ let mut vals = [0_f32; 5];
+ let a = f32x4::new(1., 2., 3., 4.);
+
+ vst1q_f32(vals[1..].as_mut_ptr(), transmute(a));
+
+ assert_eq!(vals[0], 0.);
+ assert_eq!(vals[1], 1.);
+ assert_eq!(vals[2], 2.);
+ assert_eq!(vals[3], 3.);
+ assert_eq!(vals[4], 4.);
+}
diff --git a/library/stdarch/crates/core_arch/src/arm_shared/neon/table_lookup_tests.rs b/library/stdarch/crates/core_arch/src/arm_shared/neon/table_lookup_tests.rs
new file mode 100644
index 000000000..15aa2f269
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/arm_shared/neon/table_lookup_tests.rs
@@ -0,0 +1,1042 @@
+//! Tests for ARM+v7+neon table lookup (vtbl, vtbx) intrinsics.
+//!
+//! These are included in `{arm, aarch64}::neon`.
+
+use super::*;
+
+#[cfg(target_arch = "aarch64")]
+use crate::core_arch::aarch64::*;
+
+#[cfg(target_arch = "arm")]
+use crate::core_arch::arm::*;
+
+use crate::core_arch::simd::*;
+use std::mem;
+use stdarch_test::simd_test;
+
+macro_rules! test_vtbl {
+ ($test_name:ident => $fn_id:ident:
+ - table[$table_t:ident]: [$($table_v:expr),*] |
+ $(- ctrl[$ctrl_t:ident]: [$($ctrl_v:expr),*] => [$($exp_v:expr),*])|*
+ ) => {
+ #[simd_test(enable = "neon")]
+ unsafe fn $test_name() {
+ // create table as array, and transmute it to
+ // arm's table type
+ let table: $table_t = mem::transmute([$($table_v),*]);
+
+ // For each control vector, perform a table lookup and
+ // verify the result:
+ $(
+ {
+ let ctrl: $ctrl_t = mem::transmute([$($ctrl_v),*]);
+ let result = $fn_id(table, mem::transmute(ctrl));
+ let result: $ctrl_t = mem::transmute(result);
+ let expected: $ctrl_t = mem::transmute([$($exp_v),*]);
+ assert_eq!(result, expected);
+ }
+ )*
+ }
+ }
+}
+
+// ARM+v7+neon and AArch64+neon tests
+
+test_vtbl!(
+ test_vtbl1_s8 => vtbl1_s8:
+ - table[int8x8_t]: [0_i8, -11, 2, 3, 4, 5, 6, 7] |
+ - ctrl[i8x8]: [3_i8, 4, 1, 6, 0, 2, 7, 5] => [3_i8, 4, -11, 6, 0, 2, 7, 5] |
+ - ctrl[i8x8]: [3_i8, 8, 1, -9, 10, 2, 15, 5] => [3_i8, 0, -11, 0, 0, 2, 0, 5]
+);
+
+test_vtbl!(
+ test_vtbl1_u8 => vtbl1_u8:
+ - table[uint8x8_t]: [0_u8, 1, 2, 3, 4, 5, 6, 7] |
+ - ctrl[u8x8]: [3_u8, 4, 1, 6, 0, 2, 7, 5] => [3_u8, 4, 1, 6, 0, 2, 7, 5] |
+ - ctrl[u8x8]: [3_u8, 8, 1, 9, 10, 2, 15, 5] => [3_u8, 0, 1, 0, 0, 2, 0, 5]
+);
+
+test_vtbl!(
+ test_vtbl1_p8 => vtbl1_p8:
+ - table[poly8x8_t]: [0_u8, 1, 2, 3, 4, 5, 6, 7] |
+ - ctrl[u8x8]: [3_u8, 4, 1, 6, 0, 2, 7, 5] => [3_u8, 4, 1, 6, 0, 2, 7, 5] |
+ - ctrl[u8x8]: [3_u8, 8, 1, 9, 10, 2, 15, 5] => [3_u8, 0, 1, 0, 0, 2, 0, 5]
+);
+
+test_vtbl!(
+ test_vtbl2_s8 => vtbl2_s8:
+ - table[int8x8x2_t]: [
+ 0_i8, -17, 34, 51, 68, 85, 102, 119,
+ -106, -93, -84, -117, -104, -116, -72, -121
+ ] |
+ - ctrl[i8x8]: [127_i8, 15, 1, 14, 2, 13, 3, 12] => [0_i8, -121, -17, -72, 34, -116, 51, -104] |
+ - ctrl[i8x8]: [4_i8, 11, 16, 10, 6, -19, 7, 18] => [68_i8, -117, 0, -84, 102, 0, 119, 0]
+);
+
+test_vtbl!(
+ test_vtbl2_u8 => vtbl2_u8:
+ - table[uint8x8x2_t]: [
+ 0_u8, 17, 34, 51, 68, 85, 102, 119,
+ 136, 153, 170, 187, 204, 221, 238, 255
+ ] |
+ - ctrl[u8x8]: [127_u8, 15, 1, 14, 2, 13, 3, 12] => [0_u8, 255, 17, 238, 34, 221, 51, 204] |
+ - ctrl[u8x8]: [4_u8, 11, 16, 10, 6, 19, 7, 18] => [68_u8, 187, 0, 170, 102, 0, 119, 0]
+);
+
+test_vtbl!(
+ test_vtbl2_p8 => vtbl2_p8:
+ - table[poly8x8x2_t]: [
+ 0_u8, 17, 34, 51, 68, 85, 102, 119,
+ 136, 153, 170, 187, 204, 221, 238, 255
+ ] |
+ - ctrl[u8x8]: [127_u8, 15, 1, 14, 2, 13, 3, 12] => [0_u8, 255, 17, 238, 34, 221, 51, 204] |
+ - ctrl[u8x8]: [4_u8, 11, 16, 10, 6, 19, 7, 18] => [68_u8, 187, 0, 170, 102, 0, 119, 0]
+);
+
+test_vtbl!(
+ test_vtbl3_s8 => vtbl3_s8:
+ - table[int8x8x3_t]: [
+ 0_i8, -17, 34, 51, 68, 85, 102, 119,
+ -106, -93, -84, -117, -104, -116, -72, -121,
+ 0, 1, -2, 3, 4, -5, 6, 7
+ ] |
+ - ctrl[i8x8]: [127_i8, 15, 1, 19, 2, 13, 21, 12] => [0_i8, -121, -17, 3, 34, -116, -5, -104] |
+ - ctrl[i8x8]: [4_i8, 11, 16, 10, 6, -27, 7, 18] => [68_i8, -117, 0, -84, 102, 0, 119, -2]
+);
+
+test_vtbl!(
+ test_vtbl3_u8 => vtbl3_u8:
+ - table[uint8x8x3_t]: [
+ 0_u8, 17, 34, 51, 68, 85, 102, 119,
+ 136, 153, 170, 187, 204, 221, 238, 255,
+ 0, 1, 2, 3, 4, 5, 6, 7
+ ] |
+ - ctrl[u8x8]: [127_u8, 15, 1, 19, 2, 13, 21, 12] => [0_u8, 255, 17, 3, 34, 221, 5, 204] |
+ - ctrl[u8x8]: [4_u8, 11, 16, 10, 6, 27, 7, 18] => [68_u8, 187, 0, 170, 102, 0, 119, 2]
+);
+
+test_vtbl!(
+ test_vtbl3_p8 => vtbl3_p8:
+ - table[poly8x8x3_t]: [
+ 0_u8, 17, 34, 51, 68, 85, 102, 119,
+ 136, 153, 170, 187, 204, 221, 238, 255,
+ 0, 1, 2, 3, 4, 5, 6, 7
+ ] |
+ - ctrl[u8x8]: [127_u8, 15, 1, 19, 2, 13, 21, 12] => [0_u8, 255, 17, 3, 34, 221, 5, 204] |
+ - ctrl[u8x8]: [4_u8, 11, 16, 10, 6, 27, 7, 18] => [68_u8, 187, 0, 170, 102, 0, 119, 2]
+);
+
+test_vtbl!(
+ test_vtbl4_s8 => vtbl4_s8:
+ - table[int8x8x4_t]: [
+ 0_i8, -17, 34, 51, 68, 85, 102, 119,
+ -106, -93, -84, -117, -104, -116, -72, -121,
+ 0, 1, -2, 3, 4, -5, 6, 7,
+ 8, -9, 10, 11, 12, -13, 14, 15
+ ] |
+ - ctrl[i8x8]: [127_i8, 15, 1, 19, 2, 13, 25, 12] => [0_i8, -121, -17, 3, 34, -116, -9, -104] |
+ - ctrl[i8x8]: [4_i8, 11, 32, 10, -33, 27, 7, 18] => [68_i8, -117, 0, -84, 0, 11, 119, -2]
+);
+
+test_vtbl!(
+ test_vtbl4_u8 => vtbl4_u8:
+ - table[uint8x8x4_t]: [
+ 0_u8, 17, 34, 51, 68, 85, 102, 119,
+ 136, 153, 170, 187, 204, 221, 238, 255,
+ 0, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15
+ ] |
+ - ctrl[u8x8]: [127_u8, 15, 1, 19, 2, 13, 21, 12] => [0_u8, 255, 17, 3, 34, 221, 5, 204] |
+ - ctrl[u8x8]: [4_u8, 11, 16, 10, 6, 27, 7, 18] => [68_u8, 187, 0, 170, 102, 11, 119, 2]
+);
+
+test_vtbl!(
+ test_vtbl4_p8 => vtbl4_p8:
+ - table[poly8x8x4_t]: [
+ 0_u8, 17, 34, 51, 68, 85, 102, 119,
+ 136, 153, 170, 187, 204, 221, 238, 255,
+ 0, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15
+ ] |
+ - ctrl[u8x8]: [127_u8, 15, 1, 19, 2, 13, 21, 12] => [0_u8, 255, 17, 3, 34, 221, 5, 204] |
+ - ctrl[u8x8]: [4_u8, 11, 16, 10, 6, 27, 7, 18] => [68_u8, 187, 0, 170, 102, 11, 119, 2]
+);
+
+macro_rules! test_vtbx {
+ ($test_name:ident => $fn_id:ident:
+ - table[$table_t:ident]: [$($table_v:expr),*] |
+ - ext[$ext_t:ident]: [$($ext_v:expr),*] |
+ $(- ctrl[$ctrl_t:ident]: [$($ctrl_v:expr),*] => [$($exp_v:expr),*])|*
+ ) => {
+ #[simd_test(enable = "neon")]
+ unsafe fn $test_name() {
+ // create table as array, and transmute it to
+ // arm's table type
+ let table: $table_t = mem::transmute([$($table_v),*]);
+ let ext: $ext_t = mem::transmute([$($ext_v),*]);
+
+ // For each control vector, perform a table lookup and
+ // verify the result:
+ $(
+ {
+ let ctrl: $ctrl_t = mem::transmute([$($ctrl_v),*]);
+ let result = $fn_id(ext, table, mem::transmute(ctrl));
+ let result: $ctrl_t = mem::transmute(result);
+ let expected: $ctrl_t = mem::transmute([$($exp_v),*]);
+ assert_eq!(result, expected);
+ }
+ )*
+ }
+ }
+}
+
+test_vtbx!(
+ test_vtbx1_s8 => vtbx1_s8:
+ - table[int8x8_t]: [0_i8, 1, 2, -3, 4, 5, 6, 7] |
+ - ext[int8x8_t]: [50_i8, 51, 52, 53, 54, 55, 56, 57] |
+ - ctrl[i8x8]: [3_i8, 4, 1, 6, 0, 2, 7, 5] => [-3_i8, 4, 1, 6, 0, 2, 7, 5] |
+ - ctrl[i8x8]: [3_i8, 8, 1, 9, 10, 2, -15, 5] => [-3_i8, 51, 1, 53, 54, 2, 56, 5]
+);
+
+test_vtbx!(
+ test_vtbx1_u8 => vtbx1_u8:
+ - table[uint8x8_t]: [0_u8, 1, 2, 3, 4, 5, 6, 7] |
+ - ext[uint8x8_t]: [50_u8, 51, 52, 53, 54, 55, 56, 57] |
+ - ctrl[u8x8]: [3_u8, 4, 1, 6, 0, 2, 7, 5] => [3_u8, 4, 1, 6, 0, 2, 7, 5] |
+ - ctrl[u8x8]: [3_u8, 8, 1, 9, 10, 2, 15, 5] => [3_u8, 51, 1, 53, 54, 2, 56, 5]
+);
+
+test_vtbx!(
+ test_vtbx1_p8 => vtbx1_p8:
+ - table[poly8x8_t]: [0_u8, 1, 2, 3, 4, 5, 6, 7] |
+ - ext[poly8x8_t]: [50_u8, 51, 52, 53, 54, 55, 56, 57] |
+ - ctrl[u8x8]: [3_u8, 4, 1, 6, 0, 2, 7, 5] => [3_u8, 4, 1, 6, 0, 2, 7, 5] |
+ - ctrl[u8x8]: [3_u8, 8, 1, 9, 10, 2, 15, 5] => [3_u8, 51, 1, 53, 54, 2, 56, 5]
+);
+
+test_vtbx!(
+ test_vtbx2_s8 => vtbx2_s8:
+ - table[int8x8x2_t]: [0_i8, 1, 2, -3, 4, 5, 6, 7, 8, 9, -10, 11, 12, -13, 14, 15] |
+ - ext[int8x8_t]: [50_i8, 51, 52, 53, 54, 55, 56, 57] |
+ - ctrl[i8x8]: [3_i8, 4, 1, 6, 10, 2, 7, 15] => [-3_i8, 4, 1, 6, -10, 2, 7, 15] |
+ - ctrl[i8x8]: [3_i8, 8, 1, 10, 17, 2, 15, -19] => [-3_i8, 8, 1, -10, 54, 2, 15, 57]
+);
+
+test_vtbx!(
+ test_vtbx2_u8 => vtbx2_u8:
+ - table[uint8x8x2_t]: [0_i8, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] |
+ - ext[uint8x8_t]: [50_i8, 51, 52, 53, 54, 55, 56, 57] |
+ - ctrl[u8x8]: [3_u8, 4, 1, 6, 10, 2, 7, 15] => [3_i8, 4, 1, 6, 10, 2, 7, 15] |
+ - ctrl[u8x8]: [3_u8, 8, 1, 10, 17, 2, 15, 19] => [3_i8, 8, 1, 10, 54, 2, 15, 57]
+);
+
+test_vtbx!(
+ test_vtbx2_p8 => vtbx2_p8:
+ - table[poly8x8x2_t]: [0_i8, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] |
+ - ext[poly8x8_t]: [50_i8, 51, 52, 53, 54, 55, 56, 57] |
+ - ctrl[u8x8]: [3_u8, 4, 1, 6, 10, 2, 7, 15] => [3_i8, 4, 1, 6, 10, 2, 7, 15] |
+ - ctrl[u8x8]: [3_u8, 8, 1, 10, 17, 2, 15, 19] => [3_i8, 8, 1, 10, 54, 2, 15, 57]
+);
+
+test_vtbx!(
+ test_vtbx3_s8 => vtbx3_s8:
+ - table[int8x8x3_t]: [
+ 0_i8, 1, 2, -3, 4, 5, 6, 7,
+ 8, 9, -10, 11, 12, -13, 14, 15,
+ 16, -17, 18, 19, 20, 21, 22, 23 ] |
+ - ext[int8x8_t]: [50_i8, 51, 52, 53, 54, 55, 56, 57] |
+ - ctrl[i8x8]: [3_i8, 4, 17, 22, 10, 2, 7, 15] => [-3_i8, 4, -17, 22, -10, 2, 7, 15] |
+ - ctrl[i8x8]: [3_i8, 8, 17, 10, 37, 2, 19, -29] => [-3_i8, 8, -17, -10, 54, 2, 19, 57]
+);
+
+test_vtbx!(
+ test_vtbx3_u8 => vtbx3_u8:
+ - table[uint8x8x3_t]: [
+ 0_i8, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15,
+ 16, 17, 18, 19, 20, 21, 22, 23 ] |
+ - ext[uint8x8_t]: [50_i8, 51, 52, 53, 54, 55, 56, 57] |
+ - ctrl[u8x8]: [3_u8, 4, 17, 22, 10, 2, 7, 15] => [3_i8, 4, 17, 22, 10, 2, 7, 15] |
+ - ctrl[u8x8]: [3_u8, 8, 17, 10, 37, 2, 19, 29] => [3_i8, 8, 17, 10, 54, 2, 19, 57]
+);
+
+test_vtbx!(
+ test_vtbx3_p8 => vtbx3_p8:
+ - table[poly8x8x3_t]: [
+ 0_i8, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15,
+ 16, 17, 18, 19, 20, 21, 22, 23 ] |
+ - ext[poly8x8_t]: [50_i8, 51, 52, 53, 54, 55, 56, 57] |
+ - ctrl[u8x8]: [3_u8, 4, 17, 22, 10, 2, 7, 15] => [3_i8, 4, 17, 22, 10, 2, 7, 15] |
+ - ctrl[u8x8]: [3_u8, 8, 17, 10, 37, 2, 19, 29] => [3_i8, 8, 17, 10, 54, 2, 19, 57]
+);
+
+test_vtbx!(
+ test_vtbx4_s8 => vtbx4_s8:
+ - table[int8x8x4_t]: [
+ 0_i8, 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] |
+ - ext[int8x8_t]: [50_i8, 51, 52, 53, 54, 55, 56, 57] |
+ - ctrl[i8x8]: [3_i8, 31, 17, 22, 10, 29, 7, 15] => [-3_i8, 31, -17, 22, -10, -29, 7, 15] |
+ - ctrl[i8x8]: [3_i8, 8, 17, 10, 37, 2, 19, -42] => [-3_i8, 8, -17, -10, 54, 2, 19, 57]
+);
+
+test_vtbx!(
+ test_vtbx4_u8 => vtbx4_u8:
+ - table[uint8x8x4_t]: [
+ 0_i8, 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] |
+ - ext[uint8x8_t]: [50_i8, 51, 52, 53, 54, 55, 56, 57] |
+ - ctrl[u8x8]: [3_u8, 31, 17, 22, 10, 29, 7, 15] => [3_i8, 31, 17, 22, 10, 29, 7, 15] |
+ - ctrl[u8x8]: [3_u8, 8, 17, 10, 37, 2, 19, 42] => [3_i8, 8, 17, 10, 54, 2, 19, 57]
+);
+
+test_vtbx!(
+ test_vtbx4_p8 => vtbx4_p8:
+ - table[poly8x8x4_t]: [
+ 0_i8, 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] |
+ - ext[poly8x8_t]: [50_i8, 51, 52, 53, 54, 55, 56, 57] |
+ - ctrl[u8x8]: [3_u8, 31, 17, 22, 10, 29, 7, 15] => [3_i8, 31, 17, 22, 10, 29, 7, 15] |
+ - ctrl[u8x8]: [3_u8, 8, 17, 10, 37, 2, 19, 42] => [3_i8, 8, 17, 10, 54, 2, 19, 57]
+);
+
+// Aarch64 tests
+
+#[cfg(target_arch = "aarch64")]
+test_vtbl!(
+ test_vqtbl1_s8 => vqtbl1_s8:
+ - table[int8x16_t]: [
+ 0_i8, -17, 34, 51, 68, 85, 102, 119,
+ -106, -93, -84, -117, -104, -116, -72, -121
+ ] |
+ - ctrl[i8x8]: [127_i8, 15, 1, 14, 2, 13, 3, 12] => [0_i8, -121, -17, -72, 34, -116, 51, -104] |
+ - ctrl[i8x8]: [4_i8, 11, 16, 10, 6, 19, 7, 18] => [68_i8, -117, 0, -84, 102, 0, 119, 0]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbl!(
+ test_vqtbl1q_s8 => vqtbl1q_s8:
+ - table[int8x16_t]: [
+ 0_i8, -17, 34, 51, 68, 85, 102, 119,
+ -106, -93, -84, -117, -104, -116, -72, -121
+ ] |
+ - ctrl[i8x16]: [127_i8, 15, 1, 14, 2, 13, 3, 12, 4_i8, 11, 16, 10, 6, 19, 7, 18]
+ => [0_i8, -121, -17, -72, 34, -116, 51, -104, 68, -117, 0, -84, 102, 0, 119, 0]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbl!(
+ test_vqtbl1_u8 => vqtbl1_u8:
+ - table[uint8x16_t]: [
+ 0_u8, 17, 34, 51, 68, 85, 102, 119,
+ 106, 93, 84, 117, 104, 116, 72, 121
+ ] |
+ - ctrl[u8x8]: [127_u8, 15, 1, 14, 2, 13, 3, 12] => [0_u8, 121, 17, 72, 34, 116, 51, 104] |
+ - ctrl[u8x8]: [4_u8, 11, 16, 10, 6, 19, 7, 18] => [68_u8, 117, 0, 84, 102, 0, 119, 0]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbl!(
+ test_vqtbl1q_u8 => vqtbl1q_u8:
+ - table[uint8x16_t]: [
+ 0_u8, 17, 34, 51, 68, 85, 102, 119,
+ 106, 93, 84, 117, 104, 116, 72, 121
+ ] |
+ - ctrl[u8x16]: [127_u8, 15, 1, 14, 2, 13, 3, 12, 4_u8, 11, 16, 10, 6, 19, 7, 18]
+ => [0_u8, 121, 17, 72, 34, 116, 51, 104, 68, 117, 0, 84, 102, 0, 119, 0]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbl!(
+ test_vqtbl1_p8 => vqtbl1_p8:
+ - table[poly8x16_t]: [
+ 0_u8, 17, 34, 51, 68, 85, 102, 119,
+ 106, 93, 84, 117, 104, 116, 72, 121
+ ] |
+ - ctrl[u8x8]: [127_u8, 15, 1, 14, 2, 13, 3, 12] => [0_u8, 121, 17, 72, 34, 116, 51, 104] |
+ - ctrl[u8x8]: [4_u8, 11, 16, 10, 6, 19, 7, 18] => [68_u8, 117, 0, 84, 102, 0, 119, 0]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbl!(
+ test_vqtbl1q_p8 => vqtbl1q_p8:
+ - table[poly8x16_t]: [
+ 0_u8, 17, 34, 51, 68, 85, 102, 119,
+ 106, 93, 84, 117, 104, 116, 72, 121
+ ] |
+ - ctrl[u8x16]: [127_u8, 15, 1, 14, 2, 13, 3, 12, 4_u8, 11, 16, 10, 6, 19, 7, 18]
+ => [0_u8, 121, 17, 72, 34, 116, 51, 104, 68, 117, 0, 84, 102, 0, 119, 0]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbl!(
+ test_vqtbl2_s8 => vqtbl2_s8:
+ - table[int8x16x2_t]: [
+ 0_i8, -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
+ ] |
+ - ctrl[i8x8]: [80_i8, 15, 1, 24, 2, 13, 3, 29] => [0_i8, -15, -1, 24, 2, -13, -3, -29] |
+ - ctrl[i8x8]: [4_i8, 31, 32, 10, 6, 49, 7, 18] => [4_i8, -31, 0, 10, 6, 0, -7, 18]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbl!(
+ test_vqtbl2q_s8 => vqtbl2q_s8:
+ - table[int8x16x2_t]: [
+ 0_i8, -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
+ ] |
+ - ctrl[i8x16]: [80_i8, 15, 1, 24, 2, 13, 3, 29, 4_i8, 31, 32, 10, 6, 49, 7, 18]
+ => [0_i8, -15, -1, 24, 2, -13, -3, -29, 4, -31, 0, 10, 6, 0, -7, 18]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbl!(
+ test_vqtbl2_u8 => vqtbl2_u8:
+ - table[uint8x16x2_t]: [
+ 0_u8, 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
+ ] |
+ - ctrl[u8x8]: [80_u8, 15, 1, 24, 2, 13, 3, 29] => [0_u8, 15, 1, 24, 2, 13, 3, 29] |
+ - ctrl[u8x8]: [4_u8, 31, 32, 10, 6, 49, 7, 18] => [4_u8, 31, 0, 10, 6, 0, 7, 18]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbl!(
+ test_vqtbl2q_u8 => vqtbl2q_u8:
+ - table[uint8x16x2_t]: [
+ 0_u8, 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
+ ] |
+ - ctrl[u8x16]: [80_u8, 15, 1, 24, 2, 13, 3, 29, 4_u8, 31, 32, 10, 6, 49, 7, 18]
+ => [0_u8, 15, 1, 24, 2, 13, 3, 29, 4, 31, 0, 10, 6, 0, 7, 18]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbl!(
+ test_vqtbl2_p8 => vqtbl2_p8:
+ - table[poly8x16x2_t]: [
+ 0_u8, 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
+ ] |
+ - ctrl[u8x8]: [80_u8, 15, 1, 24, 2, 13, 3, 29] => [0_u8, 15, 1, 24, 2, 13, 3, 29] |
+ - ctrl[u8x8]: [4_u8, 31, 32, 10, 6, 49, 7, 18] => [4_u8, 31, 0, 10, 6, 0, 7, 18]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbl!(
+ test_vqtbl2q_p8 => vqtbl2q_p8:
+ - table[poly8x16x2_t]: [
+ 0_u8, 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
+ ] |
+ - ctrl[u8x16]: [80_u8, 15, 1, 24, 2, 13, 3, 29, 4_u8, 31, 32, 10, 6, 49, 7, 18]
+ => [0_u8, 15, 1, 24, 2, 13, 3, 29, 4, 31, 0, 10, 6, 0, 7, 18]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbl!(
+ test_vqtbl3_s8 => vqtbl3_s8:
+ - table[int8x16x3_t]: [
+ 0_i8, -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
+ ] |
+ - ctrl[i8x8]: [80_i8, 15, 1, 24, 2, 13, 3, 29] => [0_i8, -15, -1, 24, 2, -13, -3, -29] |
+ - ctrl[i8x8]: [4_i8, 32, 46, 51, 6, 49, 7, 18] => [4_i8, 32, 46, 0, 6, 0, -7, 18]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbl!(
+ test_vqtbl3q_s8 => vqtbl3q_s8:
+ - table[int8x16x3_t]: [
+ 0_i8, -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
+ ] |
+ - ctrl[i8x16]: [80_i8, 15, 1, 24, 2, 13, 3, 29, 4_i8, 32, 46, 51, 6, 49, 7, 18]
+ => [0_i8, -15, -1, 24, 2, -13, -3, -29, 4, 32, 46, 0, 6, 0, -7, 18]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbl!(
+ test_vqtbl3_u8 => vqtbl3_u8:
+ - table[uint8x16x3_t]: [
+ 0_u8, 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
+ ] |
+ - ctrl[u8x8]: [80_u8, 15, 1, 24, 2, 13, 3, 29] => [0_u8, 15, 1, 24, 2, 13, 3, 29] |
+ - ctrl[u8x8]: [4_u8, 32, 46, 51, 6, 49, 7, 18] => [4_u8, 32, 46, 0, 6, 0, 7, 18]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbl!(
+ test_vqtbl3q_u8 => vqtbl3q_u8:
+ - table[uint8x16x3_t]: [
+ 0_u8, 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
+ ] |
+ - ctrl[u8x16]: [80_u8, 15, 1, 24, 2, 13, 3, 29, 4_u8, 32, 46, 51, 6, 49, 7, 18]
+ => [0_u8, 15, 1, 24, 2, 13, 3, 29, 4, 32, 46, 0, 6, 0, 7, 18]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbl!(
+ test_vqtbl3_p8 => vqtbl3_p8:
+ - table[poly8x16x3_t]: [
+ 0_u8, 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
+ ] |
+ - ctrl[u8x8]: [80_u8, 15, 1, 24, 2, 13, 3, 29] => [0_u8, 15, 1, 24, 2, 13, 3, 29] |
+ - ctrl[u8x8]: [4_u8, 32, 46, 51, 6, 49, 7, 18] => [4_u8, 32, 46, 0, 6, 0, 7, 18]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbl!(
+ test_vqtbl3q_p8 => vqtbl3q_p8:
+ - table[poly8x16x3_t]: [
+ 0_u8, 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
+ ] |
+ - ctrl[u8x16]: [80_u8, 15, 1, 24, 2, 13, 3, 29, 4_u8, 32, 46, 51, 6, 49, 7, 18]
+ => [0_u8, 15, 1, 24, 2, 13, 3, 29, 4, 32, 46, 0, 6, 0, 7, 18]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbl!(
+ test_vqtbl4_s8 => vqtbl4_s8:
+ - table[int8x16x4_t]: [
+ 0_i8, -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
+ ] |
+ - ctrl[i8x8]: [80_i8, 15, 1, 24, 2, 13, 3, 29] => [0_i8, -15, -1, 24, 2, -13, -3, -29] |
+ - ctrl[i8x8]: [4_i8, 46, 64, 51, 6, 71, 7, 18] => [4_i8, 46, 0, -51, 6, 0, -7, 18]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbl!(
+ test_vqtbl4q_s8 => vqtbl4q_s8:
+ - table[int8x16x4_t]: [
+ 0_i8, -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
+ ] |
+ - ctrl[i8x16]: [80_i8, 15, 1, 24, 2, 13, 3, 29, 4_i8, 46, 64, 51, 6, 71, 7, 18]
+ => [0_i8, -15, -1, 24, 2, -13, -3, -29, 4, 46, 0, -51, 6, 0, -7, 18]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbl!(
+ test_vqtbl4_u8 => vqtbl4_u8:
+ - table[uint8x16x4_t]: [
+ 0_u8, 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
+ ] |
+ - ctrl[u8x8]: [80_u8, 15, 1, 24, 2, 13, 3, 29] => [0_u8, 15, 1, 24, 2, 13, 3, 29] |
+ - ctrl[u8x8]: [4_u8, 46, 64, 51, 6, 71, 7, 18] => [4_u8, 46, 0, 51, 6, 0, 7, 18]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbl!(
+ test_vqtbl4q_u8 => vqtbl4q_u8:
+ - table[uint8x16x4_t]: [
+ 0_u8, 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
+ ] |
+ - ctrl[u8x16]: [80_u8, 15, 1, 24, 2, 13, 3, 29, 4_u8, 46, 64, 51, 6, 71, 7, 18]
+ => [0_u8, 15, 1, 24, 2, 13, 3, 29, 4, 46, 0, 51, 6, 0, 7, 18]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbl!(
+ test_vqtbl4_p8 => vqtbl4_p8:
+ - table[poly8x16x4_t]: [
+ 0_u8, 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
+ ] |
+ - ctrl[u8x8]: [80_u8, 15, 1, 24, 2, 13, 3, 29] => [0_u8, 15, 1, 24, 2, 13, 3, 29] |
+ - ctrl[u8x8]: [4_u8, 46, 64, 51, 6, 71, 7, 18] => [4_u8, 46, 0, 51, 6, 0, 7, 18]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbl!(
+ test_vqtbl4q_p8 => vqtbl4q_p8:
+ - table[poly8x16x4_t]: [
+ 0_u8, 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
+ ] |
+ - ctrl[u8x16]: [80_u8, 15, 1, 24, 2, 13, 3, 29, 4_u8, 46, 64, 51, 6, 71, 7, 18]
+ => [0_u8, 15, 1, 24, 2, 13, 3, 29, 4, 46, 0, 51, 6, 0, 7, 18]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbx!(
+ test_vqtbx1_s8 => vqtbx1_s8:
+ - table[int8x16_t]: [
+ 0_i8, -17, 34, 51, 68, 85, 102, 119,
+ -106, -93, -84, -117, -104, -116, -72, -121
+ ] |
+ - ext[int8x8_t]: [100_i8, -101, 102, -103, 104, -105, 106, -107] |
+ - ctrl[i8x8]: [127_i8, 15, 1, 14, 2, 13, 3, 12] => [100_i8, -121, -17, -72, 34, -116, 51, -104] |
+ - ctrl[i8x8]: [4_i8, 11, 16, 10, 6, 19, 7, 18] => [68_i8, -117, 102, -84, 102, -105, 119, -107]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbx!(
+ test_vqtbx1q_s8 => vqtbx1q_s8:
+ - table[int8x16_t]: [
+ 0_i8, -17, 34, 51, 68, 85, 102, 119,
+ -106, -93, -84, -117, -104, -116, -72, -121
+ ] |
+ - ext[int8x16_t]: [
+ 100_i8, -101, 102, -103, 104, -105, 106, -107,
+ 108, -109, 110, -111, 112, -113, 114, -115
+ ] |
+ - ctrl[i8x16]: [127_i8, 15, 1, 14, 2, 13, 3, 12, 4_i8, 11, 16, 10, 6, 19, 7, 18]
+ => [100_i8, -121, -17, -72, 34, -116, 51, -104, 68, -117, 110, -84, 102, -113, 119, -115]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbx!(
+ test_vqtbx1_u8 => vqtbx1_u8:
+ - table[uint8x16_t]: [
+ 0_u8, 17, 34, 51, 68, 85, 102, 119,
+ 106, 93, 84, 117, 104, 116, 72, 121
+ ] |
+ - ext[uint8x8_t]: [100_u8, 101, 102, 103, 104, 105, 106, 107] |
+ - ctrl[u8x8]: [127_u8, 15, 1, 14, 2, 13, 3, 12] => [100_u8, 121, 17, 72, 34, 116, 51, 104] |
+ - ctrl[u8x8]: [4_u8, 11, 16, 10, 6, 19, 7, 18] => [68_u8, 117, 102, 84, 102, 105, 119, 107]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbx!(
+ test_vqtbx1q_u8 => vqtbx1q_u8:
+ - table[uint8x16_t]: [
+ 0_u8, 17, 34, 51, 68, 85, 102, 119,
+ 106, 93, 84, 117, 104, 116, 72, 121
+ ] |
+ - ext[uint8x16_t]: [
+ 100_u8, 101, 102, 103, 104, 105, 106, 107,
+ 108, 109, 110, 111, 112, 113, 114, 115
+ ] |
+ - ctrl[u8x16]: [127_u8, 15, 1, 14, 2, 13, 3, 12, 4_u8, 11, 16, 10, 6, 19, 7, 18]
+ => [100_u8, 121, 17, 72, 34, 116, 51, 104, 68, 117, 110, 84, 102, 113, 119, 115]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbx!(
+ test_vqtbx1_p8 => vqtbx1_p8:
+ - table[poly8x16_t]: [
+ 0_u8, 17, 34, 51, 68, 85, 102, 119,
+ 106, 93, 84, 117, 104, 116, 72, 121
+ ] |
+ - ext[poly8x8_t]: [100_u8, 101, 102, 103, 104, 105, 106, 107] |
+ - ctrl[u8x8]: [127_u8, 15, 1, 14, 2, 13, 3, 12] => [100_u8, 121, 17, 72, 34, 116, 51, 104] |
+ - ctrl[u8x8]: [4_u8, 11, 16, 10, 6, 19, 7, 18] => [68_u8, 117, 102, 84, 102, 105, 119, 107]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbx!(
+ test_vqtbx1q_p8 => vqtbx1q_p8:
+ - table[poly8x16_t]: [
+ 0_u8, 17, 34, 51, 68, 85, 102, 119,
+ 106, 93, 84, 117, 104, 116, 72, 121
+ ] |
+ - ext[poly8x16_t]: [
+ 100_u8, 101, 102, 103, 104, 105, 106, 107,
+ 108, 109, 110, 111, 112, 113, 114, 115
+ ] |
+ - ctrl[u8x16]: [127_u8, 15, 1, 14, 2, 13, 3, 12, 4_u8, 11, 16, 10, 6, 19, 7, 18]
+ => [100_u8, 121, 17, 72, 34, 116, 51, 104, 68, 117, 110, 84, 102, 113, 119, 115]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbx!(
+ test_vqtbx2_s8 => vqtbx2_s8:
+ - table[int8x16x2_t]: [
+ 0_i8, -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
+ ] |
+ - ext[int8x8_t]: [100_i8, -101, 102, -103, 104, -105, 106, -107] |
+ - ctrl[i8x8]: [80_i8, 15, 1, 24, 2, 13, 3, 29] => [100_i8, -15, -1, 24, 2, -13, -3, -29] |
+ - ctrl[i8x8]: [4_i8, 31, 32, 10, 6, 49, 7, 18] => [4_i8, -31, 102, 10, 6, -105, -7, 18]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbx!(
+ test_vqtbx2q_s8 => vqtbx2q_s8:
+ - table[int8x16x2_t]: [
+ 0_i8, -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
+ ] |
+ - ext[int8x16_t]: [
+ 100_i8, -101, 102, -103, 104, -105, 106, -107,
+ 108, -109, 110, -111, 112, -113, 114, -115
+ ] |
+ - ctrl[i8x16]: [80_i8, 15, 1, 24, 2, 13, 3, 29, 4_i8, 31, 32, 10, 6, 49, 7, 18]
+ => [100_i8, -15, -1, 24, 2, -13, -3, -29, 4, -31, 110, 10, 6, -113, -7, 18]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbx!(
+ test_vqtbx2_u8 => vqtbx2_u8:
+ - table[uint8x16x2_t]: [
+ 0_u8, 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
+ ] |
+ - ext[uint8x8_t]: [100_u8, 101, 102, 103, 104, 105, 106, 107] |
+ - ctrl[u8x8]: [80_u8, 15, 1, 24, 2, 13, 3, 29] => [100_u8, 15, 1, 24, 2, 13, 3, 29] |
+ - ctrl[u8x8]: [4_u8, 31, 32, 10, 6, 49, 7, 18] => [4_u8, 31, 102, 10, 6, 105, 7, 18]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbx!(
+ test_vqtbx2q_u8 => vqtbx2q_u8:
+ - table[uint8x16x2_t]: [
+ 0_u8, 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
+ ] |
+ - ext[uint8x16_t]: [
+ 100_u8, 101, 102, 103, 104, 105, 106, 107,
+ 108, 109, 110, 111, 112, 113, 114, 115
+ ] |
+ - ctrl[u8x16]: [80_u8, 15, 1, 24, 2, 13, 3, 29, 4_u8, 31, 32, 10, 6, 49, 7, 18]
+ => [100_u8, 15, 1, 24, 2, 13, 3, 29, 4, 31, 110, 10, 6, 113, 7, 18]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbx!(
+ test_vqtbx2_p8 => vqtbx2_p8:
+ - table[poly8x16x2_t]: [
+ 0_u8, 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
+ ] |
+ - ext[poly8x8_t]: [100_u8, 101, 102, 103, 104, 105, 106, 107] |
+ - ctrl[u8x8]: [80_u8, 15, 1, 24, 2, 13, 3, 29] => [100_u8, 15, 1, 24, 2, 13, 3, 29] |
+ - ctrl[u8x8]: [4_u8, 31, 32, 10, 6, 49, 7, 18] => [4_u8, 31, 102, 10, 6, 105, 7, 18]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbx!(
+ test_vqtbx2q_p8 => vqtbx2q_p8:
+ - table[poly8x16x2_t]: [
+ 0_u8, 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
+ ] |
+ - ext[poly8x16_t]: [
+ 100_u8, 101, 102, 103, 104, 105, 106, 107,
+ 108, 109, 110, 111, 112, 113, 114, 115
+ ] |
+ - ctrl[u8x16]: [80_u8, 15, 1, 24, 2, 13, 3, 29, 4_u8, 31, 32, 10, 6, 49, 7, 18]
+ => [100_u8, 15, 1, 24, 2, 13, 3, 29, 4, 31, 110, 10, 6, 113, 7, 18]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbx!(
+ test_vqtbx3_s8 => vqtbx3_s8:
+ - table[int8x16x3_t]: [
+ 0_i8, -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
+ ] |
+ - ext[int8x8_t]: [100_i8, -101, 102, -103, 104, -105, 106, -107] |
+ - ctrl[i8x8]: [80_i8, 15, 1, 24, 2, 13, 3, 29] => [100_i8, -15, -1, 24, 2, -13, -3, -29] |
+ - ctrl[i8x8]: [4_i8, 32, 46, 51, 6, 49, 7, 18] => [4_i8, 32, 46, -103, 6, -105, -7, 18]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbx!(
+ test_vqtbx3q_s8 => vqtbx3q_s8:
+ - table[int8x16x3_t]: [
+ 0_i8, -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
+ ] |
+ - ext[int8x16_t]: [
+ 100_i8, -101, 102, -103, 104, -105, 106, -107,
+ 108, -109, 110, -111, 112, -113, 114, -115
+ ] |
+ - ctrl[i8x16]: [80_i8, 15, 1, 24, 2, 13, 3, 29, 4_i8, 32, 46, 51, 6, 49, 7, 18]
+ => [100_i8, -15, -1, 24, 2, -13, -3, -29, 4, 32, 46, -111, 6, -113, -7, 18]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbx!(
+ test_vqtbx3_u8 => vqtbx3_u8:
+ - table[uint8x16x3_t]: [
+ 0_u8, 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
+ ] |
+ - ext[uint8x8_t]: [100_u8, 101, 102, 103, 104, 105, 106, 107] |
+ - ctrl[u8x8]: [80_u8, 15, 1, 24, 2, 13, 3, 29] => [100_u8, 15, 1, 24, 2, 13, 3, 29] |
+ - ctrl[u8x8]: [4_u8, 32, 46, 51, 6, 49, 7, 18] => [4_u8, 32, 46, 103, 6, 105, 7, 18]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbx!(
+ test_vqtbx3q_u8 => vqtbx3q_u8:
+ - table[uint8x16x3_t]: [
+ 0_u8, 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
+ ] |
+ - ext[uint8x16_t]: [
+ 100_u8, 101, 102, 103, 104, 105, 106, 107,
+ 108, 109, 110, 111, 112, 113, 114, 115
+ ] |
+ - ctrl[u8x16]: [80_u8, 15, 1, 24, 2, 13, 3, 29, 4_u8, 32, 46, 51, 6, 49, 7, 18]
+ => [100_u8, 15, 1, 24, 2, 13, 3, 29, 4, 32, 46, 111, 6, 113, 7, 18]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbx!(
+ test_vqtbx3_p8 => vqtbx3_p8:
+ - table[poly8x16x3_t]: [
+ 0_u8, 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
+ ] |
+ - ext[poly8x8_t]: [100_u8, 101, 102, 103, 104, 105, 106, 107] |
+ - ctrl[u8x8]: [80_u8, 15, 1, 24, 2, 13, 3, 29] => [100_u8, 15, 1, 24, 2, 13, 3, 29] |
+ - ctrl[u8x8]: [4_u8, 32, 46, 51, 6, 49, 7, 18] => [4_u8, 32, 46, 103, 6, 105, 7, 18]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbx!(
+ test_vqtbx3q_p8 => vqtbx3q_p8:
+ - table[poly8x16x3_t]: [
+ 0_u8, 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
+ ] |
+ - ext[poly8x16_t]: [
+ 100_u8, 101, 102, 103, 104, 105, 106, 107,
+ 108, 109, 110, 111, 112, 113, 114, 115
+ ] |
+ - ctrl[u8x16]: [80_u8, 15, 1, 24, 2, 13, 3, 29, 4_u8, 32, 46, 51, 6, 49, 7, 18]
+ => [100_u8, 15, 1, 24, 2, 13, 3, 29, 4, 32, 46, 111, 6, 113, 7, 18]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbx!(
+ test_vqtbx4_s8 => vqtbx4_s8:
+ - table[int8x16x4_t]: [
+ 0_i8, -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
+ ] |
+ - ext[int8x8_t]: [100_i8, -101, 102, -103, 104, -105, 106, -107] |
+ - ctrl[i8x8]: [80_i8, 15, 1, 24, 2, 13, 3, 29] => [100_i8, -15, -1, 24, 2, -13, -3, -29] |
+ - ctrl[i8x8]: [4_i8, 46, 64, 51, 6, 71, 7, 18] => [4_i8, 46, 102, -51, 6, -105, -7, 18]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbx!(
+ test_vqtbx4q_s8 => vqtbx4q_s8:
+ - table[int8x16x4_t]: [
+ 0_i8, -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
+ ] |
+ - ext[int8x16_t]: [
+ 100_i8, -101, 102, -103, 104, -105, 106, -107,
+ 108, -109, 110, -111, 112, -113, 114, -115
+ ] |
+ - ctrl[i8x16]: [80_i8, 15, 1, 24, 2, 13, 3, 29, 4_i8, 46, 64, 51, 6, 71, 7, 18]
+ => [100_i8, -15, -1, 24, 2, -13, -3, -29, 4, 46, 110, -51, 6, -113, -7, 18]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbx!(
+ test_vqtbx4_u8 => vqtbx4_u8:
+ - table[uint8x16x4_t]: [
+ 0_u8, 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
+ ] |
+ - ext[uint8x8_t]: [100_u8, 101, 102, 103, 104, 105, 106, 107] |
+ - ctrl[u8x8]: [80_u8, 15, 1, 24, 2, 13, 3, 29] => [100_u8, 15, 1, 24, 2, 13, 3, 29] |
+ - ctrl[u8x8]: [4_u8, 46, 64, 51, 6, 71, 7, 18] => [4_u8, 46, 102, 51, 6, 105, 7, 18]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbx!(
+ test_vqtbx4q_u8 => vqtbx4q_u8:
+ - table[uint8x16x4_t]: [
+ 0_u8, 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
+ ] |
+ - ext[uint8x16_t]: [
+ 100_u8, 101, 102, 103, 104, 105, 106, 107,
+ 108, 109, 110, 111, 112, 113, 114, 115
+ ] |
+ - ctrl[u8x16]: [80_u8, 15, 1, 24, 2, 13, 3, 29, 4_u8, 46, 64, 51, 6, 71, 7, 18]
+ => [100_u8, 15, 1, 24, 2, 13, 3, 29, 4, 46, 110, 51, 6, 113, 7, 18]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbx!(
+ test_vqtbx4_p8 => vqtbx4_p8:
+ - table[poly8x16x4_t]: [
+ 0_u8, 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
+ ] |
+ - ext[poly8x8_t]: [100_u8, 101, 102, 103, 104, 105, 106, 107] |
+ - ctrl[u8x8]: [80_u8, 15, 1, 24, 2, 13, 3, 29] => [100_u8, 15, 1, 24, 2, 13, 3, 29] |
+ - ctrl[u8x8]: [4_u8, 46, 64, 51, 6, 71, 7, 18] => [4_u8, 46, 102, 51, 6, 105, 7, 18]
+);
+
+#[cfg(target_arch = "aarch64")]
+test_vtbx!(
+ test_vqtbx4q_p8 => vqtbx4q_p8:
+ - table[poly8x16x4_t]: [
+ 0_u8, 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
+ ] |
+ - ext[poly8x16_t]: [
+ 100_u8, 101, 102, 103, 104, 105, 106, 107,
+ 108, 109, 110, 111, 112, 113, 114, 115
+ ] |
+ - ctrl[u8x16]: [80_u8, 15, 1, 24, 2, 13, 3, 29, 4_u8, 46, 64, 51, 6, 71, 7, 18]
+ => [100_u8, 15, 1, 24, 2, 13, 3, 29, 4, 46, 110, 51, 6, 113, 7, 18]
+);
diff --git a/library/stdarch/crates/core_arch/src/arm_shared/registers/aarch32.rs b/library/stdarch/crates/core_arch/src/arm_shared/registers/aarch32.rs
new file mode 100644
index 000000000..e0b71218a
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/arm_shared/registers/aarch32.rs
@@ -0,0 +1,9 @@
+/// Application Program Status Register
+pub struct APSR;
+
+// Note (@Lokathor): Because this breaks the use of Rust on the Game Boy
+// Advance, this change must be reverted until Rust learns to handle cpu state
+// properly. See also: https://github.com/rust-lang/stdarch/issues/702
+
+//#[cfg(any(not(target_feature = "thumb-state"), target_feature = "v6t2"))]
+//rsr!(APSR);
diff --git a/library/stdarch/crates/core_arch/src/arm_shared/registers/mod.rs b/library/stdarch/crates/core_arch/src/arm_shared/registers/mod.rs
new file mode 100644
index 000000000..621efe2f5
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/arm_shared/registers/mod.rs
@@ -0,0 +1,121 @@
+#[allow(unused_macros)]
+macro_rules! rsr {
+ ($R:ident) => {
+ impl super::super::sealed::Rsr for $R {
+ unsafe fn __rsr(&self) -> u32 {
+ let r: u32;
+ crate::arch::asm!(concat!("mrs {},", stringify!($R)), out(reg) r, options(nomem, nostack));
+ r
+ }
+ }
+ };
+}
+
+#[allow(unused_macros)]
+macro_rules! rsrp {
+ ($R:ident) => {
+ impl super::super::sealed::Rsrp for $R {
+ unsafe fn __rsrp(&self) -> *const u8 {
+ let r: *const u8;
+ crate::arch::asm!(concat!("mrs {},", stringify!($R)), out(reg) r, options(nomem, nostack));
+ r
+ }
+ }
+ };
+}
+
+#[allow(unused_macros)]
+macro_rules! wsr {
+ ($R:ident) => {
+ impl super::super::sealed::Wsr for $R {
+ unsafe fn __wsr(&self, value: u32) {
+ crate::arch::asm!(concat!("msr ", stringify!($R), ", {}"), in(reg) value, options(nomem, nostack));
+ }
+ }
+ };
+}
+
+#[allow(unused_macros)]
+macro_rules! wsrp {
+ ($R:ident) => {
+ impl super::super::sealed::Wsrp for $R {
+ unsafe fn __wsrp(&self, value: *const u8) {
+ crate::arch::asm!(concat!("msr ", stringify!($R), ", {}"), in(reg) value, options(nomem, nostack));
+ }
+ }
+ };
+}
+
+#[cfg(target_feature = "mclass")]
+mod v6m;
+
+#[cfg(target_feature = "mclass")]
+pub use self::v6m::*;
+
+#[cfg(all(target_feature = "v7", target_feature = "mclass"))]
+mod v7m;
+
+#[cfg(all(target_feature = "v7", target_feature = "mclass"))]
+pub use self::v7m::*;
+
+#[cfg(not(target_arch = "aarch64"))]
+mod aarch32;
+
+#[cfg(not(target_arch = "aarch64"))]
+pub use self::aarch32::*;
+
+/// Reads a 32-bit system register
+#[inline(always)]
+pub unsafe fn __rsr<R>(reg: R) -> u32
+where
+ R: super::sealed::Rsr,
+{
+ reg.__rsr()
+}
+
+/// Reads a 64-bit system register
+#[cfg(target_arch = "aarch64")]
+#[inline(always)]
+pub unsafe fn __rsr64<R>(reg: R) -> u64
+where
+ R: super::sealed::Rsr64,
+{
+ reg.__rsr64()
+}
+
+/// Reads a system register containing an address
+#[inline(always)]
+pub unsafe fn __rsrp<R>(reg: R) -> *const u8
+where
+ R: super::sealed::Rsrp,
+{
+ reg.__rsrp()
+}
+
+/// Writes a 32-bit system register
+#[inline(always)]
+pub unsafe fn __wsr<R>(reg: R, value: u32)
+where
+ R: super::sealed::Wsr,
+{
+ reg.__wsr(value)
+}
+
+/// Writes a 64-bit system register
+#[cfg(target_arch = "aarch64")]
+#[inline(always)]
+pub unsafe fn __wsr64<R>(reg: R, value: u64)
+where
+ R: super::sealed::Wsr64,
+{
+ reg.__wsr64(value)
+}
+
+/// Writes a system register containing an address
+#[inline(always)]
+pub unsafe fn __wsrp<R>(reg: R, value: *const u8)
+where
+ R: super::sealed::Wsrp,
+{
+ reg.__wsrp(value)
+}
diff --git a/library/stdarch/crates/core_arch/src/arm_shared/registers/v6m.rs b/library/stdarch/crates/core_arch/src/arm_shared/registers/v6m.rs
new file mode 100644
index 000000000..7acc63b6d
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/arm_shared/registers/v6m.rs
@@ -0,0 +1,39 @@
+/// CONTROL register
+pub struct CONTROL;
+
+rsr!(CONTROL);
+wsr!(CONTROL);
+
+/// Execution Program Status Register
+pub struct EPSR;
+
+rsr!(EPSR);
+
+/// Interrupt Program Status Register
+pub struct IPSR;
+
+rsr!(IPSR);
+
+/// Main Stack Pointer
+pub struct MSP;
+
+rsrp!(MSP);
+wsrp!(MSP);
+
+/// Priority Mask Register
+pub struct PRIMASK;
+
+rsr!(PRIMASK);
+wsr!(PRIMASK);
+
+/// Process Stack Pointer
+pub struct PSP;
+
+rsrp!(PSP);
+wsrp!(PSP);
+
+/// Program Status Register
+#[allow(non_camel_case_types)]
+pub struct xPSR;
+
+rsr!(xPSR);
diff --git a/library/stdarch/crates/core_arch/src/arm_shared/registers/v7m.rs b/library/stdarch/crates/core_arch/src/arm_shared/registers/v7m.rs
new file mode 100644
index 000000000..d1b1d474f
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/arm_shared/registers/v7m.rs
@@ -0,0 +1,17 @@
+/// Base Priority Mask Register
+pub struct BASEPRI;
+
+rsr!(BASEPRI);
+wsr!(BASEPRI);
+
+/// Base Priority Mask Register (conditional write)
+#[allow(non_camel_case_types)]
+pub struct BASEPRI_MAX;
+
+wsr!(BASEPRI_MAX);
+
+/// Fault Mask Register
+pub struct FAULTMASK;
+
+rsr!(FAULTMASK);
+wsr!(FAULTMASK);
diff --git a/library/stdarch/crates/core_arch/src/arm_shared/test_support.rs b/library/stdarch/crates/core_arch/src/arm_shared/test_support.rs
new file mode 100644
index 000000000..ff752f25b
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/arm_shared/test_support.rs
@@ -0,0 +1,836 @@
+#[cfg(target_arch = "arm")]
+use crate::core_arch::arm::*;
+
+#[cfg(target_arch = "aarch64")]
+use crate::core_arch::aarch64::*;
+
+use crate::core_arch::simd::*;
+use std::{i16, i32, i8, mem::transmute, u16, u32, u8, vec::Vec};
+
+macro_rules! V_u8 {
+ () => {
+ vec![0x00u8, 0x01u8, 0x02u8, 0x0Fu8, 0x80u8, 0xF0u8, 0xFFu8]
+ };
+}
+macro_rules! V_u16 {
+ () => {
+ vec![
+ 0x0000u16, 0x0101u16, 0x0202u16, 0x0F0Fu16, 0x8000u16, 0xF0F0u16, 0xFFFFu16,
+ ]
+ };
+}
+macro_rules! V_u32 {
+ () => {
+ vec![
+ 0x00000000u32,
+ 0x01010101u32,
+ 0x02020202u32,
+ 0x0F0F0F0Fu32,
+ 0x80000000u32,
+ 0xF0F0F0F0u32,
+ 0xFFFFFFFFu32,
+ ]
+ };
+}
+macro_rules! V_u64 {
+ () => {
+ vec![
+ 0x0000000000000000u64,
+ 0x0101010101010101u64,
+ 0x0202020202020202u64,
+ 0x0F0F0F0F0F0F0F0Fu64,
+ 0x8080808080808080u64,
+ 0xF0F0F0F0F0F0F0F0u64,
+ 0xFFFFFFFFFFFFFFFFu64,
+ ]
+ };
+}
+
+macro_rules! V_i8 {
+ () => {
+ vec![
+ 0x00i8, 0x01i8, 0x02i8, 0x0Fi8, -128i8, /* 0x80 */
+ -16i8, /* 0xF0 */
+ -1i8, /* 0xFF */
+ ]
+ };
+}
+macro_rules! V_i16 {
+ () => {
+ vec![
+ 0x0000i16, 0x0101i16, 0x0202i16, 0x0F0Fi16, -32768i16, /* 0x8000 */
+ -3856i16, /* 0xF0F0 */
+ -1i16, /* 0xFFF */
+ ]
+ };
+}
+macro_rules! V_i32 {
+ () => {
+ vec![
+ 0x00000000i32,
+ 0x01010101i32,
+ 0x02020202i32,
+ 0x0F0F0F0Fi32,
+ -2139062144i32, /* 0x80000000 */
+ -252645136i32, /* 0xF0F0F0F0 */
+ -1i32, /* 0xFFFFFFFF */
+ ]
+ };
+}
+
+macro_rules! V_i64 {
+ () => {
+ vec![
+ 0x0000000000000000i64,
+ 0x0101010101010101i64,
+ 0x0202020202020202i64,
+ 0x0F0F0F0F0F0F0F0Fi64,
+ -9223372036854775808i64, /* 0x8000000000000000 */
+ -1152921504606846976i64, /* 0xF000000000000000 */
+ -1i64, /* 0xFFFFFFFFFFFFFFFF */
+ ]
+ };
+}
+
+macro_rules! V_f32 {
+ () => {
+ vec![
+ 0.0f32,
+ 1.0f32,
+ -1.0f32,
+ 1.2f32,
+ 2.4f32,
+ std::f32::MAX,
+ std::f32::MIN,
+ std::f32::INFINITY,
+ std::f32::NEG_INFINITY,
+ std::f32::NAN,
+ ]
+ };
+}
+
+macro_rules! to64 {
+ ($t : ident) => {
+ |v: $t| -> u64 { transmute(v) }
+ };
+}
+
+macro_rules! to128 {
+ ($t : ident) => {
+ |v: $t| -> u128 { transmute(v) }
+ };
+}
+
+pub(crate) fn test<T, U, V, W, X>(
+ vals: Vec<T>,
+ fill1: fn(T) -> V,
+ fill2: fn(U) -> W,
+ cast: fn(W) -> X,
+ test_fun: fn(V, V) -> W,
+ verify_fun: fn(T, T) -> U,
+) where
+ T: Copy + core::fmt::Debug + std::cmp::PartialEq,
+ U: Copy + core::fmt::Debug + std::cmp::PartialEq,
+ V: Copy + core::fmt::Debug,
+ W: Copy + core::fmt::Debug,
+ X: Copy + core::fmt::Debug + std::cmp::PartialEq,
+{
+ let pairs = vals.iter().zip(vals.iter());
+
+ for (i, j) in pairs {
+ let a: V = fill1(*i);
+ let b: V = fill1(*j);
+
+ let actual_pre: W = test_fun(a, b);
+ let expected_pre: W = fill2(verify_fun(*i, *j));
+
+ let actual: X = cast(actual_pre);
+ let expected: X = cast(expected_pre);
+
+ assert_eq!(
+ actual, expected,
+ "[{:?}:{:?}] :\nf({:?}, {:?}) = {:?}\ng({:?}, {:?}) = {:?}\n",
+ *i, *j, &a, &b, actual_pre, &a, &b, expected_pre
+ );
+ }
+}
+
+macro_rules! gen_test_fn {
+ ($n: ident, $t: ident, $u: ident, $v: ident, $w: ident, $x: ident, $vals: expr, $fill1: expr, $fill2: expr, $cast: expr) => {
+ pub(crate) fn $n(test_fun: fn($v, $v) -> $w, verify_fun: fn($t, $t) -> $u) {
+ unsafe {
+ test::<$t, $u, $v, $w, $x>($vals, $fill1, $fill2, $cast, test_fun, verify_fun)
+ };
+ }
+ };
+}
+
+macro_rules! gen_fill_fn {
+ ($id: ident, $el_width: expr, $num_els: expr, $in_t : ident, $out_t: ident, $cmp_t: ident) => {
+ pub(crate) fn $id(val: $in_t) -> $out_t {
+ let initial: [$in_t; $num_els] = [val; $num_els];
+ let result: $cmp_t = unsafe { transmute(initial) };
+ let result_out: $out_t = unsafe { transmute(result) };
+
+ // println!("FILL: {:016x} as {} x {}: {:016x}", val.reverse_bits(), $el_width, $num_els, (result as u64).reverse_bits());
+
+ result_out
+ }
+ };
+}
+
+gen_fill_fn!(fill_u8, 8, 8, u8, uint8x8_t, u64);
+gen_fill_fn!(fill_s8, 8, 8, i8, int8x8_t, u64);
+gen_fill_fn!(fillq_u8, 8, 16, u8, uint8x16_t, u128);
+gen_fill_fn!(fillq_s8, 8, 16, i8, int8x16_t, u128);
+
+gen_fill_fn!(fill_u16, 16, 4, u16, uint16x4_t, u64);
+gen_fill_fn!(fill_s16, 16, 4, i16, int16x4_t, u64);
+gen_fill_fn!(fillq_u16, 16, 8, u16, uint16x8_t, u128);
+gen_fill_fn!(fillq_s16, 16, 8, i16, int16x8_t, u128);
+
+gen_fill_fn!(fill_u32, 32, 2, u32, uint32x2_t, u64);
+gen_fill_fn!(fill_s32, 32, 2, i32, int32x2_t, u64);
+gen_fill_fn!(fillq_u32, 32, 4, u32, uint32x4_t, u128);
+gen_fill_fn!(fillq_s32, 32, 4, i32, int32x4_t, u128);
+
+gen_fill_fn!(fill_u64, 64, 1, u64, uint64x1_t, u64);
+gen_fill_fn!(fill_s64, 64, 1, i64, int64x1_t, u64);
+gen_fill_fn!(fillq_u64, 64, 2, u64, uint64x2_t, u128);
+gen_fill_fn!(fillq_s64, 64, 2, i64, int64x2_t, u128);
+
+gen_fill_fn!(fill_f32, 32, 2, f32, float32x2_t, u64);
+gen_fill_fn!(fillq_f32, 32, 4, f32, float32x4_t, u128);
+
+gen_test_fn!(
+ test_ari_u8,
+ u8,
+ u8,
+ uint8x8_t,
+ uint8x8_t,
+ u64,
+ V_u8!(),
+ fill_u8,
+ fill_u8,
+ to64!(uint8x8_t)
+);
+gen_test_fn!(
+ test_bit_u8,
+ u8,
+ u8,
+ uint8x8_t,
+ uint8x8_t,
+ u64,
+ V_u8!(),
+ fill_u8,
+ fill_u8,
+ to64!(uint8x8_t)
+);
+gen_test_fn!(
+ test_cmp_u8,
+ u8,
+ u8,
+ uint8x8_t,
+ uint8x8_t,
+ u64,
+ V_u8!(),
+ fill_u8,
+ fill_u8,
+ to64!(uint8x8_t)
+);
+gen_test_fn!(
+ testq_ari_u8,
+ u8,
+ u8,
+ uint8x16_t,
+ uint8x16_t,
+ u128,
+ V_u8!(),
+ fillq_u8,
+ fillq_u8,
+ to128!(uint8x16_t)
+);
+gen_test_fn!(
+ testq_bit_u8,
+ u8,
+ u8,
+ uint8x16_t,
+ uint8x16_t,
+ u128,
+ V_u8!(),
+ fillq_u8,
+ fillq_u8,
+ to128!(uint8x16_t)
+);
+gen_test_fn!(
+ testq_cmp_u8,
+ u8,
+ u8,
+ uint8x16_t,
+ uint8x16_t,
+ u128,
+ V_u8!(),
+ fillq_u8,
+ fillq_u8,
+ to128!(uint8x16_t)
+);
+
+gen_test_fn!(
+ test_ari_s8,
+ i8,
+ i8,
+ int8x8_t,
+ int8x8_t,
+ u64,
+ V_i8!(),
+ fill_s8,
+ fill_s8,
+ to64!(int8x8_t)
+);
+gen_test_fn!(
+ test_bit_s8,
+ i8,
+ i8,
+ int8x8_t,
+ int8x8_t,
+ u64,
+ V_i8!(),
+ fill_s8,
+ fill_s8,
+ to64!(int8x8_t)
+);
+gen_test_fn!(
+ test_cmp_s8,
+ i8,
+ u8,
+ int8x8_t,
+ uint8x8_t,
+ u64,
+ V_i8!(),
+ fill_s8,
+ fill_u8,
+ to64!(uint8x8_t)
+);
+gen_test_fn!(
+ testq_ari_s8,
+ i8,
+ i8,
+ int8x16_t,
+ int8x16_t,
+ u128,
+ V_i8!(),
+ fillq_s8,
+ fillq_s8,
+ to128!(int8x16_t)
+);
+gen_test_fn!(
+ testq_bit_s8,
+ i8,
+ i8,
+ int8x16_t,
+ int8x16_t,
+ u128,
+ V_i8!(),
+ fillq_s8,
+ fillq_s8,
+ to128!(int8x16_t)
+);
+gen_test_fn!(
+ testq_cmp_s8,
+ i8,
+ u8,
+ int8x16_t,
+ uint8x16_t,
+ u128,
+ V_i8!(),
+ fillq_s8,
+ fillq_u8,
+ to128!(uint8x16_t)
+);
+
+gen_test_fn!(
+ test_ari_u16,
+ u16,
+ u16,
+ uint16x4_t,
+ uint16x4_t,
+ u64,
+ V_u16!(),
+ fill_u16,
+ fill_u16,
+ to64!(uint16x4_t)
+);
+gen_test_fn!(
+ test_bit_u16,
+ u16,
+ u16,
+ uint16x4_t,
+ uint16x4_t,
+ u64,
+ V_u16!(),
+ fill_u16,
+ fill_u16,
+ to64!(uint16x4_t)
+);
+gen_test_fn!(
+ test_cmp_u16,
+ u16,
+ u16,
+ uint16x4_t,
+ uint16x4_t,
+ u64,
+ V_u16!(),
+ fill_u16,
+ fill_u16,
+ to64!(uint16x4_t)
+);
+gen_test_fn!(
+ testq_ari_u16,
+ u16,
+ u16,
+ uint16x8_t,
+ uint16x8_t,
+ u128,
+ V_u16!(),
+ fillq_u16,
+ fillq_u16,
+ to128!(uint16x8_t)
+);
+gen_test_fn!(
+ testq_bit_u16,
+ u16,
+ u16,
+ uint16x8_t,
+ uint16x8_t,
+ u128,
+ V_u16!(),
+ fillq_u16,
+ fillq_u16,
+ to128!(uint16x8_t)
+);
+gen_test_fn!(
+ testq_cmp_u16,
+ u16,
+ u16,
+ uint16x8_t,
+ uint16x8_t,
+ u128,
+ V_u16!(),
+ fillq_u16,
+ fillq_u16,
+ to128!(uint16x8_t)
+);
+
+gen_test_fn!(
+ test_ari_s16,
+ i16,
+ i16,
+ int16x4_t,
+ int16x4_t,
+ u64,
+ V_i16!(),
+ fill_s16,
+ fill_s16,
+ to64!(int16x4_t)
+);
+gen_test_fn!(
+ test_bit_s16,
+ i16,
+ i16,
+ int16x4_t,
+ int16x4_t,
+ u64,
+ V_i16!(),
+ fill_s16,
+ fill_s16,
+ to64!(int16x4_t)
+);
+gen_test_fn!(
+ test_cmp_s16,
+ i16,
+ u16,
+ int16x4_t,
+ uint16x4_t,
+ u64,
+ V_i16!(),
+ fill_s16,
+ fill_u16,
+ to64!(uint16x4_t)
+);
+gen_test_fn!(
+ testq_ari_s16,
+ i16,
+ i16,
+ int16x8_t,
+ int16x8_t,
+ u128,
+ V_i16!(),
+ fillq_s16,
+ fillq_s16,
+ to128!(int16x8_t)
+);
+gen_test_fn!(
+ testq_bit_s16,
+ i16,
+ i16,
+ int16x8_t,
+ int16x8_t,
+ u128,
+ V_i16!(),
+ fillq_s16,
+ fillq_s16,
+ to128!(int16x8_t)
+);
+gen_test_fn!(
+ testq_cmp_s16,
+ i16,
+ u16,
+ int16x8_t,
+ uint16x8_t,
+ u128,
+ V_i16!(),
+ fillq_s16,
+ fillq_u16,
+ to128!(uint16x8_t)
+);
+
+gen_test_fn!(
+ test_ari_u32,
+ u32,
+ u32,
+ uint32x2_t,
+ uint32x2_t,
+ u64,
+ V_u32!(),
+ fill_u32,
+ fill_u32,
+ to64!(uint32x2_t)
+);
+gen_test_fn!(
+ test_bit_u32,
+ u32,
+ u32,
+ uint32x2_t,
+ uint32x2_t,
+ u64,
+ V_u32!(),
+ fill_u32,
+ fill_u32,
+ to64!(uint32x2_t)
+);
+gen_test_fn!(
+ test_cmp_u32,
+ u32,
+ u32,
+ uint32x2_t,
+ uint32x2_t,
+ u64,
+ V_u32!(),
+ fill_u32,
+ fill_u32,
+ to64!(uint32x2_t)
+);
+gen_test_fn!(
+ testq_ari_u32,
+ u32,
+ u32,
+ uint32x4_t,
+ uint32x4_t,
+ u128,
+ V_u32!(),
+ fillq_u32,
+ fillq_u32,
+ to128!(uint32x4_t)
+);
+gen_test_fn!(
+ testq_bit_u32,
+ u32,
+ u32,
+ uint32x4_t,
+ uint32x4_t,
+ u128,
+ V_u32!(),
+ fillq_u32,
+ fillq_u32,
+ to128!(uint32x4_t)
+);
+gen_test_fn!(
+ testq_cmp_u32,
+ u32,
+ u32,
+ uint32x4_t,
+ uint32x4_t,
+ u128,
+ V_u32!(),
+ fillq_u32,
+ fillq_u32,
+ to128!(uint32x4_t)
+);
+
+gen_test_fn!(
+ test_ari_s32,
+ i32,
+ i32,
+ int32x2_t,
+ int32x2_t,
+ u64,
+ V_i32!(),
+ fill_s32,
+ fill_s32,
+ to64!(int32x2_t)
+);
+gen_test_fn!(
+ test_bit_s32,
+ i32,
+ i32,
+ int32x2_t,
+ int32x2_t,
+ u64,
+ V_i32!(),
+ fill_s32,
+ fill_s32,
+ to64!(int32x2_t)
+);
+gen_test_fn!(
+ test_cmp_s32,
+ i32,
+ u32,
+ int32x2_t,
+ uint32x2_t,
+ u64,
+ V_i32!(),
+ fill_s32,
+ fill_u32,
+ to64!(uint32x2_t)
+);
+gen_test_fn!(
+ testq_ari_s32,
+ i32,
+ i32,
+ int32x4_t,
+ int32x4_t,
+ u128,
+ V_i32!(),
+ fillq_s32,
+ fillq_s32,
+ to128!(int32x4_t)
+);
+gen_test_fn!(
+ testq_bit_s32,
+ i32,
+ i32,
+ int32x4_t,
+ int32x4_t,
+ u128,
+ V_i32!(),
+ fillq_s32,
+ fillq_s32,
+ to128!(int32x4_t)
+);
+gen_test_fn!(
+ testq_cmp_s32,
+ i32,
+ u32,
+ int32x4_t,
+ uint32x4_t,
+ u128,
+ V_i32!(),
+ fillq_s32,
+ fillq_u32,
+ to128!(uint32x4_t)
+);
+
+gen_test_fn!(
+ test_ari_u64,
+ u64,
+ u64,
+ uint64x1_t,
+ uint64x1_t,
+ u64,
+ V_u64!(),
+ fill_u64,
+ fill_u64,
+ to64!(uint64x1_t)
+);
+gen_test_fn!(
+ test_bit_u64,
+ u64,
+ u64,
+ uint64x1_t,
+ uint64x1_t,
+ u64,
+ V_u64!(),
+ fill_u64,
+ fill_u64,
+ to64!(uint64x1_t)
+);
+gen_test_fn!(
+ test_cmp_u64,
+ u64,
+ u64,
+ uint64x1_t,
+ uint64x1_t,
+ u64,
+ V_u64!(),
+ fill_u64,
+ fill_u64,
+ to64!(uint64x1_t)
+);
+gen_test_fn!(
+ testq_ari_u64,
+ u64,
+ u64,
+ uint64x2_t,
+ uint64x2_t,
+ u128,
+ V_u64!(),
+ fillq_u64,
+ fillq_u64,
+ to128!(uint64x2_t)
+);
+gen_test_fn!(
+ testq_bit_u64,
+ u64,
+ u64,
+ uint64x2_t,
+ uint64x2_t,
+ u128,
+ V_u64!(),
+ fillq_u64,
+ fillq_u64,
+ to128!(uint64x2_t)
+);
+gen_test_fn!(
+ testq_cmp_u64,
+ u64,
+ u64,
+ uint64x2_t,
+ uint64x2_t,
+ u128,
+ V_u64!(),
+ fillq_u64,
+ fillq_u64,
+ to128!(uint64x2_t)
+);
+
+gen_test_fn!(
+ test_ari_s64,
+ i64,
+ i64,
+ int64x1_t,
+ int64x1_t,
+ u64,
+ V_i64!(),
+ fill_s64,
+ fill_s64,
+ to64!(int64x1_t)
+);
+gen_test_fn!(
+ test_bit_s64,
+ i64,
+ i64,
+ int64x1_t,
+ int64x1_t,
+ u64,
+ V_i64!(),
+ fill_s64,
+ fill_s64,
+ to64!(int64x1_t)
+);
+gen_test_fn!(
+ test_cmp_s64,
+ i64,
+ u64,
+ int64x1_t,
+ uint64x1_t,
+ u64,
+ V_i64!(),
+ fill_s64,
+ fill_u64,
+ to64!(uint64x1_t)
+);
+gen_test_fn!(
+ testq_ari_s64,
+ i64,
+ i64,
+ int64x2_t,
+ int64x2_t,
+ u128,
+ V_i64!(),
+ fillq_s64,
+ fillq_s64,
+ to128!(int64x2_t)
+);
+gen_test_fn!(
+ testq_bit_s64,
+ i64,
+ i64,
+ int64x2_t,
+ int64x2_t,
+ u128,
+ V_i64!(),
+ fillq_s64,
+ fillq_s64,
+ to128!(int64x2_t)
+);
+gen_test_fn!(
+ testq_cmp_s64,
+ i64,
+ u64,
+ int64x2_t,
+ uint64x2_t,
+ u128,
+ V_i64!(),
+ fillq_s64,
+ fillq_u64,
+ to128!(uint64x2_t)
+);
+
+gen_test_fn!(
+ test_ari_f32,
+ f32,
+ f32,
+ float32x2_t,
+ float32x2_t,
+ u64,
+ V_f32!(),
+ fill_f32,
+ fill_f32,
+ to64!(float32x2_t)
+);
+gen_test_fn!(
+ test_cmp_f32,
+ f32,
+ u32,
+ float32x2_t,
+ uint32x2_t,
+ u64,
+ V_f32!(),
+ fill_f32,
+ fill_u32,
+ to64!(uint32x2_t)
+);
+gen_test_fn!(
+ testq_ari_f32,
+ f32,
+ f32,
+ float32x4_t,
+ float32x4_t,
+ u128,
+ V_f32!(),
+ fillq_f32,
+ fillq_f32,
+ to128!(float32x4_t)
+);
+gen_test_fn!(
+ testq_cmp_f32,
+ f32,
+ u32,
+ float32x4_t,
+ uint32x4_t,
+ u128,
+ V_f32!(),
+ fillq_f32,
+ fillq_u32,
+ to128!(uint32x4_t)
+);
diff --git a/library/stdarch/crates/core_arch/src/core_arch_docs.md b/library/stdarch/crates/core_arch/src/core_arch_docs.md
new file mode 100644
index 000000000..eddd1fc0c
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/core_arch_docs.md
@@ -0,0 +1,344 @@
+SIMD and vendor intrinsics module.
+
+This module is intended to be the gateway to architecture-specific
+intrinsic functions, typically related to SIMD (but not always!). Each
+architecture that Rust compiles to may contain a submodule here, which
+means that this is not a portable module! If you're writing a portable
+library take care when using these APIs!
+
+Under this module you'll find an architecture-named module, such as
+`x86_64`. Each `#[cfg(target_arch)]` that Rust can compile to may have a
+module entry here, only present on that particular target. For example the
+`i686-pc-windows-msvc` target will have an `x86` module here, whereas
+`x86_64-pc-windows-msvc` has `x86_64`.
+
+[rfc]: https://github.com/rust-lang/rfcs/pull/2325
+[tracked]: https://github.com/rust-lang/rust/issues/48556
+
+# Overview
+
+This module exposes vendor-specific intrinsics that typically correspond to
+a single machine instruction. These intrinsics are not portable: their
+availability is architecture-dependent, and not all machines of that
+architecture might provide the intrinsic.
+
+The `arch` module is intended to be a low-level implementation detail for
+higher-level APIs. Using it correctly can be quite tricky as you need to
+ensure at least a few guarantees are upheld:
+
+* The correct architecture's module is used. For example the `arm` module
+ isn't available on the `x86_64-unknown-linux-gnu` target. This is
+ typically done by ensuring that `#[cfg]` is used appropriately when using
+ this module.
+* The CPU the program is currently running on supports the function being
+ called. For example it is unsafe to call an AVX2 function on a CPU that
+ doesn't actually support AVX2.
+
+As a result of the latter of these guarantees all intrinsics in this module
+are `unsafe` and extra care needs to be taken when calling them!
+
+# CPU Feature Detection
+
+In order to call these APIs in a safe fashion there's a number of
+mechanisms available to ensure that the correct CPU feature is available
+to call an intrinsic. Let's consider, for example, the `_mm256_add_epi64`
+intrinsics on the `x86` and `x86_64` architectures. This function requires
+the AVX2 feature as [documented by Intel][intel-dox] so to correctly call
+this function we need to (a) guarantee we only call it on `x86`/`x86_64`
+and (b) ensure that the CPU feature is available
+
+[intel-dox]: https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_add_epi64&expand=100
+
+## Static CPU Feature Detection
+
+The first option available to us is to conditionally compile code via the
+`#[cfg]` attribute. CPU features correspond to the `target_feature` cfg
+available, and can be used like so:
+
+```ignore
+#[cfg(
+ all(
+ any(target_arch = "x86", target_arch = "x86_64"),
+ target_feature = "avx2"
+ )
+)]
+fn foo() {
+ #[cfg(target_arch = "x86")]
+ use std::arch::x86::_mm256_add_epi64;
+ #[cfg(target_arch = "x86_64")]
+ use std::arch::x86_64::_mm256_add_epi64;
+
+ unsafe {
+ _mm256_add_epi64(...);
+ }
+}
+```
+
+Here we're using `#[cfg(target_feature = "avx2")]` to conditionally compile
+this function into our module. This means that if the `avx2` feature is
+*enabled statically* then we'll use the `_mm256_add_epi64` function at
+runtime. The `unsafe` block here can be justified through the usage of
+`#[cfg]` to only compile the code in situations where the safety guarantees
+are upheld.
+
+Statically enabling a feature is typically done with the `-C
+target-feature` or `-C target-cpu` flags to the compiler. For example if
+your local CPU supports AVX2 then you can compile the above function with:
+
+```sh
+$ RUSTFLAGS='-C target-cpu=native' cargo build
+```
+
+Or otherwise you can specifically enable just the AVX2 feature:
+
+```sh
+$ RUSTFLAGS='-C target-feature=+avx2' cargo build
+```
+
+Note that when you compile a binary with a particular feature enabled it's
+important to ensure that you only run the binary on systems which satisfy
+the required feature set.
+
+## Dynamic CPU Feature Detection
+
+Sometimes statically dispatching isn't quite what you want. Instead you
+might want to build a portable binary that runs across a variety of CPUs,
+but at runtime it selects the most optimized implementation available. This
+allows you to build a "least common denominator" binary which has certain
+sections more optimized for different CPUs.
+
+Taking our previous example from before, we're going to compile our binary
+*without* AVX2 support, but we'd like to enable it for just one function.
+We can do that in a manner like:
+
+```ignore
+fn foo() {
+ #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
+ {
+ if is_x86_feature_detected!("avx2") {
+ return unsafe { foo_avx2() };
+ }
+ }
+
+ // fallback implementation without using AVX2
+}
+
+#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
+#[target_feature(enable = "avx2")]
+unsafe fn foo_avx2() {
+ #[cfg(target_arch = "x86")]
+ use std::arch::x86::_mm256_add_epi64;
+ #[cfg(target_arch = "x86_64")]
+ use std::arch::x86_64::_mm256_add_epi64;
+
+ _mm256_add_epi64(...);
+}
+```
+
+There's a couple of components in play here, so let's go through them in
+detail!
+
+* First up we notice the `is_x86_feature_detected!` macro. Provided by
+ the standard library, this macro will perform necessary runtime detection
+ to determine whether the CPU the program is running on supports the
+ specified feature. In this case the macro will expand to a boolean
+expression evaluating to whether the local CPU has the AVX2 feature or
+not.
+
+ Note that this macro, like the `arch` module, is platform-specific. For
+ example calling `is_x86_feature_detected!("avx2")` on ARM will be a
+ compile time error. To ensure we don't hit this error a statement level
+ `#[cfg]` is used to only compile usage of the macro on `x86`/`x86_64`.
+
+* Next up we see our AVX2-enabled function, `foo_avx2`. This function is
+ decorated with the `#[target_feature]` attribute which enables a CPU
+ feature for just this one function. Using a compiler flag like `-C
+ target-feature=+avx2` will enable AVX2 for the entire program, but using
+ an attribute will only enable it for the one function. Usage of the
+ `#[target_feature]` attribute currently requires the function to also be
+ `unsafe`, as we see here. This is because the function can only be
+ correctly called on systems which have the AVX2 (like the intrinsics
+ themselves).
+
+And with all that we should have a working program! This program will run
+across all machines and it'll use the optimized AVX2 implementation on
+machines where support is detected.
+
+# Ergonomics
+
+It's important to note that using the `arch` module is not the easiest
+thing in the world, so if you're curious to try it out you may want to
+brace yourself for some wordiness!
+
+The primary purpose of this module is to enable stable crates on crates.io
+to build up much more ergonomic abstractions which end up using SIMD under
+the hood. Over time these abstractions may also move into the standard
+library itself, but for now this module is tasked with providing the bare
+minimum necessary to use vendor intrinsics on stable Rust.
+
+# Other architectures
+
+This documentation is only for one particular architecture, you can find
+others at:
+
+* [`x86`]
+* [`x86_64`]
+* [`arm`]
+* [`aarch64`]
+* [`riscv32`]
+* [`riscv64`]
+* [`mips`]
+* [`mips64`]
+* [`powerpc`]
+* [`powerpc64`]
+* [`nvptx`]
+* [`wasm32`]
+
+[`x86`]: ../../core/arch/x86/index.html
+[`x86_64`]: ../../core/arch/x86_64/index.html
+[`arm`]: ../../core/arch/arm/index.html
+[`aarch64`]: ../../core/arch/aarch64/index.html
+[`riscv32`]: ../../core/arch/riscv32/index.html
+[`riscv64`]: ../../core/arch/riscv64/index.html
+[`mips`]: ../../core/arch/mips/index.html
+[`mips64`]: ../../core/arch/mips64/index.html
+[`powerpc`]: ../../core/arch/powerpc/index.html
+[`powerpc64`]: ../../core/arch/powerpc64/index.html
+[`nvptx`]: ../../core/arch/nvptx/index.html
+[`wasm32`]: ../../core/arch/wasm32/index.html
+
+# Examples
+
+First let's take a look at not actually using any intrinsics but instead
+using LLVM's auto-vectorization to produce optimized vectorized code for
+AVX2 and also for the default platform.
+
+```rust
+fn main() {
+ let mut dst = [0];
+ add_quickly(&[1], &[2], &mut dst);
+ assert_eq!(dst[0], 3);
+}
+
+fn add_quickly(a: &[u8], b: &[u8], c: &mut [u8]) {
+ #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
+ {
+ // Note that this `unsafe` block is safe because we're testing
+ // that the `avx2` feature is indeed available on our CPU.
+ if is_x86_feature_detected!("avx2") {
+ return unsafe { add_quickly_avx2(a, b, c) };
+ }
+ }
+
+ add_quickly_fallback(a, b, c)
+}
+
+#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
+#[target_feature(enable = "avx2")]
+unsafe fn add_quickly_avx2(a: &[u8], b: &[u8], c: &mut [u8]) {
+ add_quickly_fallback(a, b, c) // the function below is inlined here
+}
+
+fn add_quickly_fallback(a: &[u8], b: &[u8], c: &mut [u8]) {
+ for ((a, b), c) in a.iter().zip(b).zip(c) {
+ *c = *a + *b;
+ }
+}
+```
+
+Next up let's take a look at an example of manually using intrinsics. Here
+we'll be using SSE4.1 features to implement hex encoding.
+
+```
+fn main() {
+ let mut dst = [0; 32];
+ hex_encode(b"\x01\x02\x03", &mut dst);
+ assert_eq!(&dst[..6], b"010203");
+
+ let mut src = [0; 16];
+ for i in 0..16 {
+ src[i] = (i + 1) as u8;
+ }
+ hex_encode(&src, &mut dst);
+ assert_eq!(&dst, b"0102030405060708090a0b0c0d0e0f10");
+}
+
+pub fn hex_encode(src: &[u8], dst: &mut [u8]) {
+ let len = src.len().checked_mul(2).unwrap();
+ assert!(dst.len() >= len);
+
+ #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
+ {
+ if is_x86_feature_detected!("sse4.1") {
+ return unsafe { hex_encode_sse41(src, dst) };
+ }
+ }
+
+ hex_encode_fallback(src, dst)
+}
+
+// translated from
+// <https://github.com/Matherunner/bin2hex-sse/blob/master/base16_sse4.cpp>
+#[target_feature(enable = "sse4.1")]
+#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
+unsafe fn hex_encode_sse41(mut src: &[u8], dst: &mut [u8]) {
+ #[cfg(target_arch = "x86")]
+ use std::arch::x86::*;
+ #[cfg(target_arch = "x86_64")]
+ use std::arch::x86_64::*;
+
+ let ascii_zero = _mm_set1_epi8(b'0' as i8);
+ let nines = _mm_set1_epi8(9);
+ let ascii_a = _mm_set1_epi8((b'a' - 9 - 1) as i8);
+ let and4bits = _mm_set1_epi8(0xf);
+
+ let mut i = 0_isize;
+ while src.len() >= 16 {
+ let invec = _mm_loadu_si128(src.as_ptr() as *const _);
+
+ let masked1 = _mm_and_si128(invec, and4bits);
+ let masked2 = _mm_and_si128(_mm_srli_epi64(invec, 4), and4bits);
+
+ // return 0xff corresponding to the elements > 9, or 0x00 otherwise
+ let cmpmask1 = _mm_cmpgt_epi8(masked1, nines);
+ let cmpmask2 = _mm_cmpgt_epi8(masked2, nines);
+
+ // add '0' or the offset depending on the masks
+ let masked1 = _mm_add_epi8(
+ masked1,
+ _mm_blendv_epi8(ascii_zero, ascii_a, cmpmask1),
+ );
+ let masked2 = _mm_add_epi8(
+ masked2,
+ _mm_blendv_epi8(ascii_zero, ascii_a, cmpmask2),
+ );
+
+ // interleave masked1 and masked2 bytes
+ let res1 = _mm_unpacklo_epi8(masked2, masked1);
+ let res2 = _mm_unpackhi_epi8(masked2, masked1);
+
+ _mm_storeu_si128(dst.as_mut_ptr().offset(i * 2) as *mut _, res1);
+ _mm_storeu_si128(
+ dst.as_mut_ptr().offset(i * 2 + 16) as *mut _,
+ res2,
+ );
+ src = &src[16..];
+ i += 16;
+ }
+
+ let i = i as usize;
+ hex_encode_fallback(src, &mut dst[i * 2..]);
+}
+
+fn hex_encode_fallback(src: &[u8], dst: &mut [u8]) {
+ fn hex(byte: u8) -> u8 {
+ static TABLE: &[u8] = b"0123456789abcdef";
+ TABLE[byte as usize]
+ }
+
+ for (byte, slots) in src.iter().zip(dst.chunks_mut(2)) {
+ slots[0] = hex((*byte >> 4) & 0xf);
+ slots[1] = hex(*byte & 0xf);
+ }
+}
+```
diff --git a/library/stdarch/crates/core_arch/src/lib.rs b/library/stdarch/crates/core_arch/src/lib.rs
new file mode 100644
index 000000000..9240d0e84
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/lib.rs
@@ -0,0 +1,74 @@
+#![doc = include_str!("core_arch_docs.md")]
+#![allow(improper_ctypes_definitions)]
+#![allow(dead_code)]
+#![allow(unused_features)]
+#![deny(rust_2018_idioms)]
+#![feature(
+ custom_inner_attributes,
+ link_llvm_intrinsics,
+ platform_intrinsics,
+ repr_simd,
+ simd_ffi,
+ proc_macro_hygiene,
+ stmt_expr_attributes,
+ core_intrinsics,
+ no_core,
+ rustc_attrs,
+ stdsimd,
+ staged_api,
+ doc_cfg,
+ tbm_target_feature,
+ sse4a_target_feature,
+ arm_target_feature,
+ cmpxchg16b_target_feature,
+ avx512_target_feature,
+ mips_target_feature,
+ powerpc_target_feature,
+ wasm_target_feature,
+ abi_unadjusted,
+ rtm_target_feature,
+ f16c_target_feature,
+ allow_internal_unstable,
+ decl_macro,
+ bench_black_box,
+ asm_const
+)]
+#![cfg_attr(test, feature(test, abi_vectorcall))]
+#![deny(clippy::missing_inline_in_public_items)]
+#![allow(
+ clippy::inline_always,
+ clippy::too_many_arguments,
+ clippy::cast_sign_loss,
+ clippy::cast_lossless,
+ clippy::cast_possible_wrap,
+ clippy::cast_possible_truncation,
+ clippy::cast_precision_loss,
+ clippy::shadow_reuse,
+ clippy::cognitive_complexity,
+ clippy::similar_names,
+ clippy::many_single_char_names
+)]
+#![cfg_attr(test, allow(unused_imports))]
+#![no_std]
+#![unstable(feature = "stdsimd", issue = "27731")]
+#![doc(
+ test(attr(deny(warnings))),
+ test(attr(allow(dead_code, deprecated, unused_variables, unused_mut)))
+)]
+
+#[cfg(test)]
+#[macro_use]
+extern crate std;
+#[cfg(test)]
+#[macro_use]
+extern crate std_detect;
+#[path = "mod.rs"]
+mod core_arch;
+
+pub mod arch {
+ pub use crate::core_arch::arch::*;
+ pub use core::arch::asm;
+}
+
+#[allow(unused_imports)]
+use core::{convert, ffi, hint, intrinsics, marker, mem, ops, ptr, sync};
diff --git a/library/stdarch/crates/core_arch/src/macros.rs b/library/stdarch/crates/core_arch/src/macros.rs
new file mode 100644
index 000000000..1e6a3f405
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/macros.rs
@@ -0,0 +1,190 @@
+//! Utility macros.
+
+// Helper struct used to trigger const eval errors when the const generic immediate value `IMM` is
+// out of `[MIN-MAX]` range.
+pub(crate) struct ValidateConstImm<const IMM: i32, const MIN: i32, const MAX: i32>;
+impl<const IMM: i32, const MIN: i32, const MAX: i32> ValidateConstImm<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_imm1 {
+ ($imm:ident) => {
+ let _ = $crate::core_arch::macros::ValidateConstImm::<$imm, 0, { (1 << 1) - 1 }>::VALID;
+ };
+}
+
+#[allow(unused_macros)]
+macro_rules! static_assert_imm2 {
+ ($imm:ident) => {
+ let _ = $crate::core_arch::macros::ValidateConstImm::<$imm, 0, { (1 << 2) - 1 }>::VALID;
+ };
+}
+
+#[allow(unused_macros)]
+macro_rules! static_assert_imm3 {
+ ($imm:ident) => {
+ let _ = $crate::core_arch::macros::ValidateConstImm::<$imm, 0, { (1 << 3) - 1 }>::VALID;
+ };
+}
+
+#[allow(unused_macros)]
+macro_rules! static_assert_imm4 {
+ ($imm:ident) => {
+ let _ = $crate::core_arch::macros::ValidateConstImm::<$imm, 0, { (1 << 4) - 1 }>::VALID;
+ };
+}
+
+#[allow(unused_macros)]
+macro_rules! static_assert_imm5 {
+ ($imm:ident) => {
+ let _ = $crate::core_arch::macros::ValidateConstImm::<$imm, 0, { (1 << 5) - 1 }>::VALID;
+ };
+}
+
+#[allow(unused_macros)]
+macro_rules! static_assert_imm6 {
+ ($imm:ident) => {
+ let _ = $crate::core_arch::macros::ValidateConstImm::<$imm, 0, { (1 << 6) - 1 }>::VALID;
+ };
+}
+
+#[allow(unused_macros)]
+macro_rules! static_assert_imm8 {
+ ($imm:ident) => {
+ let _ = $crate::core_arch::macros::ValidateConstImm::<$imm, 0, { (1 << 8) - 1 }>::VALID;
+ };
+}
+
+#[allow(unused_macros)]
+macro_rules! static_assert_imm16 {
+ ($imm:ident) => {
+ let _ = $crate::core_arch::macros::ValidateConstImm::<$imm, 0, { (1 << 16) - 1 }>::VALID;
+ };
+}
+
+#[allow(unused)]
+macro_rules! static_assert {
+ ($imm:ident : $ty:ty where $e:expr) => {{
+ struct Validate<const $imm: $ty>();
+ impl<const $imm: $ty> Validate<$imm> {
+ const VALID: () = {
+ assert!($e, concat!("Assertion failed: ", stringify!($e)));
+ };
+ }
+ let _ = Validate::<$imm>::VALID;
+ }};
+}
+
+#[allow(unused)]
+macro_rules! types {
+ ($(
+ $(#[$doc:meta])*
+ pub struct $name:ident($($fields:tt)*);
+ )*) => ($(
+ $(#[$doc])*
+ #[derive(Copy, Clone, Debug)]
+ #[allow(non_camel_case_types)]
+ #[repr(simd)]
+ #[allow(clippy::missing_inline_in_public_items)]
+ pub struct $name($($fields)*);
+ )*)
+}
+
+#[allow(unused)]
+macro_rules! simd_shuffle2 {
+ ($x:expr, $y:expr, <$(const $imm:ident : $ty:ty),+ $(,)?> $idx:expr $(,)?) => {{
+ struct ConstParam<$(const $imm: $ty),+>;
+ impl<$(const $imm: $ty),+> ConstParam<$($imm),+> {
+ const IDX: [u32; 2] = $idx;
+ }
+
+ simd_shuffle2($x, $y, ConstParam::<$($imm),+>::IDX)
+ }};
+ ($x:expr, $y:expr, $idx:expr $(,)?) => {{
+ const IDX: [u32; 2] = $idx;
+ simd_shuffle2($x, $y, IDX)
+ }};
+}
+
+#[allow(unused_macros)]
+macro_rules! simd_shuffle4 {
+ ($x:expr, $y:expr, <$(const $imm:ident : $ty:ty),+ $(,)?> $idx:expr $(,)?) => {{
+ struct ConstParam<$(const $imm: $ty),+>;
+ impl<$(const $imm: $ty),+> ConstParam<$($imm),+> {
+ const IDX: [u32; 4] = $idx;
+ }
+
+ simd_shuffle4($x, $y, ConstParam::<$($imm),+>::IDX)
+ }};
+ ($x:expr, $y:expr, $idx:expr $(,)?) => {{
+ const IDX: [u32; 4] = $idx;
+ simd_shuffle4($x, $y, IDX)
+ }};
+}
+
+#[allow(unused_macros)]
+macro_rules! simd_shuffle8 {
+ ($x:expr, $y:expr, <$(const $imm:ident : $ty:ty),+ $(,)?> $idx:expr $(,)?) => {{
+ struct ConstParam<$(const $imm: $ty),+>;
+ impl<$(const $imm: $ty),+> ConstParam<$($imm),+> {
+ const IDX: [u32; 8] = $idx;
+ }
+
+ simd_shuffle8($x, $y, ConstParam::<$($imm),+>::IDX)
+ }};
+ ($x:expr, $y:expr, $idx:expr $(,)?) => {{
+ const IDX: [u32; 8] = $idx;
+ simd_shuffle8($x, $y, IDX)
+ }};
+}
+
+#[allow(unused)]
+macro_rules! simd_shuffle16 {
+ ($x:expr, $y:expr, <$(const $imm:ident : $ty:ty),+ $(,)?> $idx:expr $(,)?) => {{
+ struct ConstParam<$(const $imm: $ty),+>;
+ impl<$(const $imm: $ty),+> ConstParam<$($imm),+> {
+ const IDX: [u32; 16] = $idx;
+ }
+
+ simd_shuffle16($x, $y, ConstParam::<$($imm),+>::IDX)
+ }};
+ ($x:expr, $y:expr, $idx:expr $(,)?) => {{
+ const IDX: [u32; 16] = $idx;
+ simd_shuffle16($x, $y, IDX)
+ }};
+}
+
+#[allow(unused_macros)]
+macro_rules! simd_shuffle32 {
+ ($x:expr, $y:expr, <$(const $imm:ident : $ty:ty),+> $(,)? $idx:expr $(,)?) => {{
+ struct ConstParam<$(const $imm: $ty),+>;
+ impl<$(const $imm: $ty),+> ConstParam<$($imm),+> {
+ const IDX: [u32; 32] = $idx;
+ }
+
+ simd_shuffle32($x, $y, ConstParam::<$($imm),+>::IDX)
+ }};
+ ($x:expr, $y:expr, $idx:expr $(,)?) => {{
+ const IDX: [u32; 32] = $idx;
+ simd_shuffle32($x, $y, IDX)
+ }};
+}
+
+#[allow(unused_macros)]
+macro_rules! simd_shuffle64 {
+ ($x:expr, $y:expr, <$(const $imm:ident : $ty:ty),+ $(,)?> $idx:expr $(,)?) => {{
+ struct ConstParam<$(const $imm: $ty),+>;
+ impl<$(const $imm: $ty),+> ConstParam<$($imm),+> {
+ const IDX: [u32; 64] = $idx;
+ }
+
+ simd_shuffle64($x, $y, ConstParam::<$($imm),+>::IDX)
+ }};
+ ($x:expr, $y:expr, $idx:expr $(,)?) => {{
+ const IDX: [u32; 64] = $idx;
+ simd_shuffle64($x, $y, IDX)
+ }};
+}
diff --git a/library/stdarch/crates/core_arch/src/mips/mod.rs b/library/stdarch/crates/core_arch/src/mips/mod.rs
new file mode 100644
index 000000000..96905aedc
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/mips/mod.rs
@@ -0,0 +1,18 @@
+//! MIPS
+
+// Building this module (even if unused) for non-fp64 targets fails with an LLVM
+// error.
+#[cfg(target_feature = "fp64")]
+mod msa;
+#[cfg(target_feature = "fp64")]
+pub use self::msa::*;
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+/// Generates the trap instruction `BREAK`
+#[cfg_attr(test, assert_instr(break))]
+#[inline]
+pub unsafe fn break_() -> ! {
+ crate::intrinsics::abort()
+}
diff --git a/library/stdarch/crates/core_arch/src/mips/msa.rs b/library/stdarch/crates/core_arch/src/mips/msa.rs
new file mode 100644
index 000000000..85ed30d18
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/mips/msa.rs
@@ -0,0 +1,17894 @@
+//! MIPS SIMD Architecture intrinsics
+//!
+//! The reference is [MIPS Architecture for Programmers Volume IV-j: The
+//! MIPS32 SIMD Architecture Module Revision 1.12][msa_ref].
+//!
+//! [msa_ref]: http://cdn2.imgtec.com/documentation/MD00866-2B-MSA32-AFP-01.12.pdf
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+use crate::mem;
+
+#[macro_use]
+mod macros;
+
+types! {
+ // / MIPS-specific 128-bit wide vector of 16 packed `i8`.
+ pub struct v16i8(
+ i8, i8, i8, i8, i8, i8, i8, i8,
+ i8, i8, i8, i8, i8, i8, i8, i8,
+ );
+
+ // / MIPS-specific 128-bit wide vector of 8 packed `i16`.
+ pub struct v8i16(
+ i16, i16, i16, i16, i16, i16, i16, i16,
+ );
+
+ // / MIPS-specific 128-bit wide vector of 4 packed `i32`.
+ pub struct v4i32(
+ i32, i32, i32, i32,
+ );
+
+ // / MIPS-specific 128-bit wide vector of 2 packed `i64`.
+ pub struct v2i64(
+ i64, i64,
+ );
+
+ // / MIPS-specific 128-bit wide vector of 16 packed `u8`.
+ pub struct v16u8(
+ u8, u8, u8, u8, u8, u8, u8, u8,
+ u8, u8, u8, u8, u8, u8, u8, u8,
+ );
+
+ // / MIPS-specific 128-bit wide vector of 8 packed `u16`.
+ pub struct v8u16(
+ u16, u16, u16, u16, u16, u16, u16, u16,
+ );
+
+ // / MIPS-specific 128-bit wide vector of 4 packed `u32`.
+ pub struct v4u32(
+ u32, u32, u32, u32,
+ );
+
+ // / MIPS-specific 128-bit wide vector of 2 packed `u64`.
+ pub struct v2u64(
+ u64, u64,
+ );
+
+ // / MIPS-specific 128-bit wide vector of 4 packed `f32`.
+ pub struct v4f32(
+ f32, f32, f32, f32,
+ );
+
+ // / MIPS-specific 128-bit wide vector of 2 packed `f64`.
+ pub struct v2f64(
+ f64, f64,
+ );
+}
+
+#[allow(improper_ctypes)]
+extern "C" {
+ #[link_name = "llvm.mips.add.a.b"]
+ fn msa_add_a_b(a: v16i8, b: v16i8) -> v16i8;
+ #[link_name = "llvm.mips.add.a.h"]
+ fn msa_add_a_h(a: v8i16, b: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.add.a.w"]
+ fn msa_add_a_w(a: v4i32, b: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.add.a.d"]
+ fn msa_add_a_d(a: v2i64, b: v2i64) -> v2i64;
+ #[link_name = "llvm.mips.adds.a.b"]
+ fn msa_adds_a_b(a: v16i8, b: v16i8) -> v16i8;
+ #[link_name = "llvm.mips.adds.a.h"]
+ fn msa_adds_a_h(a: v8i16, b: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.adds.a.w"]
+ fn msa_adds_a_w(a: v4i32, b: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.adds.a.d"]
+ fn msa_adds_a_d(a: v2i64, b: v2i64) -> v2i64;
+ #[link_name = "llvm.mips.adds.s.b"]
+ fn msa_adds_s_b(a: v16i8, b: v16i8) -> v16i8;
+ #[link_name = "llvm.mips.adds.s.h"]
+ fn msa_adds_s_h(a: v8i16, b: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.adds.s.w"]
+ fn msa_adds_s_w(a: v4i32, b: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.adds.s.d"]
+ fn msa_adds_s_d(a: v2i64, b: v2i64) -> v2i64;
+ #[link_name = "llvm.mips.adds.u.b"]
+ fn msa_adds_u_b(a: v16u8, b: v16u8) -> v16u8;
+ #[link_name = "llvm.mips.adds.u.h"]
+ fn msa_adds_u_h(a: v8u16, b: v8u16) -> v8u16;
+ #[link_name = "llvm.mips.adds.u.w"]
+ fn msa_adds_u_w(a: v4u32, b: v4u32) -> v4u32;
+ #[link_name = "llvm.mips.adds.u.d"]
+ fn msa_adds_u_d(a: v2u64, b: v2u64) -> v2u64;
+ #[link_name = "llvm.mips.addv.b"]
+ fn msa_addv_b(a: v16i8, b: v16i8) -> v16i8;
+ #[link_name = "llvm.mips.addv.h"]
+ fn msa_addv_h(a: v8i16, b: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.addv.w"]
+ fn msa_addv_w(a: v4i32, b: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.addv.d"]
+ fn msa_addv_d(a: v2i64, b: v2i64) -> v2i64;
+ #[link_name = "llvm.mips.addvi.b"]
+ fn msa_addvi_b(a: v16i8, b: i32) -> v16i8;
+ #[link_name = "llvm.mips.addvi.h"]
+ fn msa_addvi_h(a: v8i16, b: i32) -> v8i16;
+ #[link_name = "llvm.mips.addvi.w"]
+ fn msa_addvi_w(a: v4i32, b: i32) -> v4i32;
+ #[link_name = "llvm.mips.addvi.d"]
+ fn msa_addvi_d(a: v2i64, b: i32) -> v2i64;
+ #[link_name = "llvm.mips.and.v"]
+ fn msa_and_v(a: v16u8, b: v16u8) -> v16u8;
+ #[link_name = "llvm.mips.andi.b"]
+ fn msa_andi_b(a: v16u8, b: i32) -> v16u8;
+ #[link_name = "llvm.mips.asub.s.b"]
+ fn msa_asub_s_b(a: v16i8, b: v16i8) -> v16i8;
+ #[link_name = "llvm.mips.asub.s.h"]
+ fn msa_asub_s_h(a: v8i16, b: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.asub.s.w"]
+ fn msa_asub_s_w(a: v4i32, b: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.asub.s.d"]
+ fn msa_asub_s_d(a: v2i64, b: v2i64) -> v2i64;
+ #[link_name = "llvm.mips.asub.u.b"]
+ fn msa_asub_u_b(a: v16u8, b: v16u8) -> v16u8;
+ #[link_name = "llvm.mips.asub.u.h"]
+ fn msa_asub_u_h(a: v8u16, b: v8u16) -> v8u16;
+ #[link_name = "llvm.mips.asub.u.w"]
+ fn msa_asub_u_w(a: v4u32, b: v4u32) -> v4u32;
+ #[link_name = "llvm.mips.asub.u.d"]
+ fn msa_asub_u_d(a: v2u64, b: v2u64) -> v2u64;
+ #[link_name = "llvm.mips.ave.s.b"]
+ fn msa_ave_s_b(a: v16i8, b: v16i8) -> v16i8;
+ #[link_name = "llvm.mips.ave.s.h"]
+ fn msa_ave_s_h(a: v8i16, b: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.ave.s.w"]
+ fn msa_ave_s_w(a: v4i32, b: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.ave.s.d"]
+ fn msa_ave_s_d(a: v2i64, b: v2i64) -> v2i64;
+ #[link_name = "llvm.mips.ave.u.b"]
+ fn msa_ave_u_b(a: v16u8, b: v16u8) -> v16u8;
+ #[link_name = "llvm.mips.ave.u.h"]
+ fn msa_ave_u_h(a: v8u16, b: v8u16) -> v8u16;
+ #[link_name = "llvm.mips.ave.u.w"]
+ fn msa_ave_u_w(a: v4u32, b: v4u32) -> v4u32;
+ #[link_name = "llvm.mips.ave.u.d"]
+ fn msa_ave_u_d(a: v2u64, b: v2u64) -> v2u64;
+ #[link_name = "llvm.mips.aver.s.b"]
+ fn msa_aver_s_b(a: v16i8, b: v16i8) -> v16i8;
+ #[link_name = "llvm.mips.aver.s.h"]
+ fn msa_aver_s_h(a: v8i16, b: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.aver.s.w"]
+ fn msa_aver_s_w(a: v4i32, b: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.aver.s.d"]
+ fn msa_aver_s_d(a: v2i64, b: v2i64) -> v2i64;
+ #[link_name = "llvm.mips.aver.u.b"]
+ fn msa_aver_u_b(a: v16u8, b: v16u8) -> v16u8;
+ #[link_name = "llvm.mips.aver.u.h"]
+ fn msa_aver_u_h(a: v8u16, b: v8u16) -> v8u16;
+ #[link_name = "llvm.mips.aver.u.w"]
+ fn msa_aver_u_w(a: v4u32, b: v4u32) -> v4u32;
+ #[link_name = "llvm.mips.aver.u.d"]
+ fn msa_aver_u_d(a: v2u64, b: v2u64) -> v2u64;
+ #[link_name = "llvm.mips.bclr.b"]
+ fn msa_bclr_b(a: v16u8, b: v16u8) -> v16u8;
+ #[link_name = "llvm.mips.bclr.h"]
+ fn msa_bclr_h(a: v8u16, b: v8u16) -> v8u16;
+ #[link_name = "llvm.mips.bclr.w"]
+ fn msa_bclr_w(a: v4u32, b: v4u32) -> v4u32;
+ #[link_name = "llvm.mips.bclr.d"]
+ fn msa_bclr_d(a: v2u64, b: v2u64) -> v2u64;
+ #[link_name = "llvm.mips.bclri.b"]
+ fn msa_bclri_b(a: v16u8, b: i32) -> v16u8;
+ #[link_name = "llvm.mips.bclri.h"]
+ fn msa_bclri_h(a: v8u16, b: i32) -> v8u16;
+ #[link_name = "llvm.mips.bclri.w"]
+ fn msa_bclri_w(a: v4u32, b: i32) -> v4u32;
+ #[link_name = "llvm.mips.bclri.d"]
+ fn msa_bclri_d(a: v2u64, b: i32) -> v2u64;
+ #[link_name = "llvm.mips.binsl.b"]
+ fn msa_binsl_b(a: v16u8, b: v16u8, c: v16u8) -> v16u8;
+ #[link_name = "llvm.mips.binsl.h"]
+ fn msa_binsl_h(a: v8u16, b: v8u16, c: v8u16) -> v8u16;
+ #[link_name = "llvm.mips.binsl.w"]
+ fn msa_binsl_w(a: v4u32, b: v4u32, c: v4u32) -> v4u32;
+ #[link_name = "llvm.mips.binsl.d"]
+ fn msa_binsl_d(a: v2u64, b: v2u64, c: v2u64) -> v2u64;
+ #[link_name = "llvm.mips.binsli.b"]
+ fn msa_binsli_b(a: v16u8, b: v16u8, c: i32) -> v16u8;
+ #[link_name = "llvm.mips.binsli.h"]
+ fn msa_binsli_h(a: v8u16, b: v8u16, c: i32) -> v8u16;
+ #[link_name = "llvm.mips.binsli.w"]
+ fn msa_binsli_w(a: v4u32, b: v4u32, c: i32) -> v4u32;
+ #[link_name = "llvm.mips.binsli.d"]
+ fn msa_binsli_d(a: v2u64, b: v2u64, c: i32) -> v2u64;
+ #[link_name = "llvm.mips.binsr.b"]
+ fn msa_binsr_b(a: v16u8, b: v16u8, c: v16u8) -> v16u8;
+ #[link_name = "llvm.mips.binsr.h"]
+ fn msa_binsr_h(a: v8u16, b: v8u16, c: v8u16) -> v8u16;
+ #[link_name = "llvm.mips.binsr.w"]
+ fn msa_binsr_w(a: v4u32, b: v4u32, c: v4u32) -> v4u32;
+ #[link_name = "llvm.mips.binsr.d"]
+ fn msa_binsr_d(a: v2u64, b: v2u64, c: v2u64) -> v2u64;
+ #[link_name = "llvm.mips.binsri.b"]
+ fn msa_binsri_b(a: v16u8, b: v16u8, c: i32) -> v16u8;
+ #[link_name = "llvm.mips.binsri.h"]
+ fn msa_binsri_h(a: v8u16, b: v8u16, c: i32) -> v8u16;
+ #[link_name = "llvm.mips.binsri.w"]
+ fn msa_binsri_w(a: v4u32, b: v4u32, c: i32) -> v4u32;
+ #[link_name = "llvm.mips.binsri.d"]
+ fn msa_binsri_d(a: v2u64, b: v2u64, c: i32) -> v2u64;
+ #[link_name = "llvm.mips.bmnz.v"]
+ fn msa_bmnz_v(a: v16u8, b: v16u8, c: v16u8) -> v16u8;
+ #[link_name = "llvm.mips.bmnzi.b"]
+ fn msa_bmnzi_b(a: v16u8, b: v16u8, c: i32) -> v16u8;
+ #[link_name = "llvm.mips.bmz.v"]
+ fn msa_bmz_v(a: v16u8, b: v16u8, c: v16u8) -> v16u8;
+ #[link_name = "llvm.mips.bmzi.b"]
+ fn msa_bmzi_b(a: v16u8, b: v16u8, c: i32) -> v16u8;
+ #[link_name = "llvm.mips.bneg.b"]
+ fn msa_bneg_b(a: v16u8, b: v16u8) -> v16u8;
+ #[link_name = "llvm.mips.bneg.h"]
+ fn msa_bneg_h(a: v8u16, b: v8u16) -> v8u16;
+ #[link_name = "llvm.mips.bneg.w"]
+ fn msa_bneg_w(a: v4u32, b: v4u32) -> v4u32;
+ #[link_name = "llvm.mips.bneg.d"]
+ fn msa_bneg_d(a: v2u64, b: v2u64) -> v2u64;
+ #[link_name = "llvm.mips.bnegi.b"]
+ fn msa_bnegi_b(a: v16u8, b: i32) -> v16u8;
+ #[link_name = "llvm.mips.bnegi.h"]
+ fn msa_bnegi_h(a: v8u16, b: i32) -> v8u16;
+ #[link_name = "llvm.mips.bnegi.w"]
+ fn msa_bnegi_w(a: v4u32, b: i32) -> v4u32;
+ #[link_name = "llvm.mips.bnegi.d"]
+ fn msa_bnegi_d(a: v2u64, b: i32) -> v2u64;
+ #[link_name = "llvm.mips.bnz.b"]
+ fn msa_bnz_b(a: v16u8) -> i32;
+ #[link_name = "llvm.mips.bnz.h"]
+ fn msa_bnz_h(a: v8u16) -> i32;
+ #[link_name = "llvm.mips.bnz.w"]
+ fn msa_bnz_w(a: v4u32) -> i32;
+ #[link_name = "llvm.mips.bnz.d"]
+ fn msa_bnz_d(a: v2u64) -> i32;
+ #[link_name = "llvm.mips.bnz.v"]
+ fn msa_bnz_v(a: v16u8) -> i32;
+ #[link_name = "llvm.mips.bsel.v"]
+ fn msa_bsel_v(a: v16u8, b: v16u8, c: v16u8) -> v16u8;
+ #[link_name = "llvm.mips.bseli.b"]
+ fn msa_bseli_b(a: v16u8, b: v16u8, c: i32) -> v16u8;
+ #[link_name = "llvm.mips.bset.b"]
+ fn msa_bset_b(a: v16u8, b: v16u8) -> v16u8;
+ #[link_name = "llvm.mips.bset.h"]
+ fn msa_bset_h(a: v8u16, b: v8u16) -> v8u16;
+ #[link_name = "llvm.mips.bset.w"]
+ fn msa_bset_w(a: v4u32, b: v4u32) -> v4u32;
+ #[link_name = "llvm.mips.bset.d"]
+ fn msa_bset_d(a: v2u64, b: v2u64) -> v2u64;
+ #[link_name = "llvm.mips.bseti.b"]
+ fn msa_bseti_b(a: v16u8, b: i32) -> v16u8;
+ #[link_name = "llvm.mips.bseti.h"]
+ fn msa_bseti_h(a: v8u16, b: i32) -> v8u16;
+ #[link_name = "llvm.mips.bseti.w"]
+ fn msa_bseti_w(a: v4u32, b: i32) -> v4u32;
+ #[link_name = "llvm.mips.bseti.d"]
+ fn msa_bseti_d(a: v2u64, b: i32) -> v2u64;
+ #[link_name = "llvm.mips.bz.b"]
+ fn msa_bz_b(a: v16u8) -> i32;
+ #[link_name = "llvm.mips.bz.h"]
+ fn msa_bz_h(a: v8u16) -> i32;
+ #[link_name = "llvm.mips.bz.w"]
+ fn msa_bz_w(a: v4u32) -> i32;
+ #[link_name = "llvm.mips.bz.d"]
+ fn msa_bz_d(a: v2u64) -> i32;
+ #[link_name = "llvm.mips.bz.v"]
+ fn msa_bz_v(a: v16u8) -> i32;
+ #[link_name = "llvm.mips.ceq.b"]
+ fn msa_ceq_b(a: v16i8, b: v16i8) -> v16i8;
+ #[link_name = "llvm.mips.ceq.h"]
+ fn msa_ceq_h(a: v8i16, b: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.ceq.w"]
+ fn msa_ceq_w(a: v4i32, b: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.ceq.d"]
+ fn msa_ceq_d(a: v2i64, b: v2i64) -> v2i64;
+ #[link_name = "llvm.mips.ceqi.b"]
+ fn msa_ceqi_b(a: v16i8, b: i32) -> v16i8;
+ #[link_name = "llvm.mips.ceqi.h"]
+ fn msa_ceqi_h(a: v8i16, b: i32) -> v8i16;
+ #[link_name = "llvm.mips.ceqi.w"]
+ fn msa_ceqi_w(a: v4i32, b: i32) -> v4i32;
+ #[link_name = "llvm.mips.ceqi.d"]
+ fn msa_ceqi_d(a: v2i64, b: i32) -> v2i64;
+ #[link_name = "llvm.mips.cfcmsa"]
+ fn msa_cfcmsa(a: i32) -> i32;
+ #[link_name = "llvm.mips.cle.s.b"]
+ fn msa_cle_s_b(a: v16i8, b: v16i8) -> v16i8;
+ #[link_name = "llvm.mips.cle.s.h"]
+ fn msa_cle_s_h(a: v8i16, b: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.cle.s.w"]
+ fn msa_cle_s_w(a: v4i32, b: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.cle.s.d"]
+ fn msa_cle_s_d(a: v2i64, b: v2i64) -> v2i64;
+ #[link_name = "llvm.mips.cle.u.b"]
+ fn msa_cle_u_b(a: v16u8, b: v16u8) -> v16i8;
+ #[link_name = "llvm.mips.cle.u.h"]
+ fn msa_cle_u_h(a: v8u16, b: v8u16) -> v8i16;
+ #[link_name = "llvm.mips.cle.u.w"]
+ fn msa_cle_u_w(a: v4u32, b: v4u32) -> v4i32;
+ #[link_name = "llvm.mips.cle.u.d"]
+ fn msa_cle_u_d(a: v2u64, b: v2u64) -> v2i64;
+ #[link_name = "llvm.mips.clei.s.b"]
+ fn msa_clei_s_b(a: v16i8, b: i32) -> v16i8;
+ #[link_name = "llvm.mips.clei.s.h"]
+ fn msa_clei_s_h(a: v8i16, b: i32) -> v8i16;
+ #[link_name = "llvm.mips.clei.s.w"]
+ fn msa_clei_s_w(a: v4i32, b: i32) -> v4i32;
+ #[link_name = "llvm.mips.clei.s.d"]
+ fn msa_clei_s_d(a: v2i64, b: i32) -> v2i64;
+ #[link_name = "llvm.mips.clei.u.b"]
+ fn msa_clei_u_b(a: v16u8, b: i32) -> v16i8;
+ #[link_name = "llvm.mips.clei.u.h"]
+ fn msa_clei_u_h(a: v8u16, b: i32) -> v8i16;
+ #[link_name = "llvm.mips.clei.u.w"]
+ fn msa_clei_u_w(a: v4u32, b: i32) -> v4i32;
+ #[link_name = "llvm.mips.clei.u.d"]
+ fn msa_clei_u_d(a: v2u64, b: i32) -> v2i64;
+ #[link_name = "llvm.mips.clt.s.b"]
+ fn msa_clt_s_b(a: v16i8, b: v16i8) -> v16i8;
+ #[link_name = "llvm.mips.clt.s.h"]
+ fn msa_clt_s_h(a: v8i16, b: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.clt.s.w"]
+ fn msa_clt_s_w(a: v4i32, b: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.clt.s.d"]
+ fn msa_clt_s_d(a: v2i64, b: v2i64) -> v2i64;
+ #[link_name = "llvm.mips.clt.u.b"]
+ fn msa_clt_u_b(a: v16u8, b: v16u8) -> v16i8;
+ #[link_name = "llvm.mips.clt.u.h"]
+ fn msa_clt_u_h(a: v8u16, b: v8u16) -> v8i16;
+ #[link_name = "llvm.mips.clt.u.w"]
+ fn msa_clt_u_w(a: v4u32, b: v4u32) -> v4i32;
+ #[link_name = "llvm.mips.clt.u.d"]
+ fn msa_clt_u_d(a: v2u64, b: v2u64) -> v2i64;
+ #[link_name = "llvm.mips.clti.s.b"]
+ fn msa_clti_s_b(a: v16i8, b: i32) -> v16i8;
+ #[link_name = "llvm.mips.clti.s.h"]
+ fn msa_clti_s_h(a: v8i16, b: i32) -> v8i16;
+ #[link_name = "llvm.mips.clti.s.w"]
+ fn msa_clti_s_w(a: v4i32, b: i32) -> v4i32;
+ #[link_name = "llvm.mips.clti.s.d"]
+ fn msa_clti_s_d(a: v2i64, b: i32) -> v2i64;
+ #[link_name = "llvm.mips.clti.u.b"]
+ fn msa_clti_u_b(a: v16u8, b: i32) -> v16i8;
+ #[link_name = "llvm.mips.clti.u.h"]
+ fn msa_clti_u_h(a: v8u16, b: i32) -> v8i16;
+ #[link_name = "llvm.mips.clti.u.w"]
+ fn msa_clti_u_w(a: v4u32, b: i32) -> v4i32;
+ #[link_name = "llvm.mips.clti.u.d"]
+ fn msa_clti_u_d(a: v2u64, b: i32) -> v2i64;
+ #[link_name = "llvm.mips.copy.s.b"]
+ fn msa_copy_s_b(a: v16i8, b: i32) -> i32;
+ #[link_name = "llvm.mips.copy.s.h"]
+ fn msa_copy_s_h(a: v8i16, b: i32) -> i32;
+ #[link_name = "llvm.mips.copy.s.w"]
+ fn msa_copy_s_w(a: v4i32, b: i32) -> i32;
+ #[link_name = "llvm.mips.copy.s.d"]
+ fn msa_copy_s_d(a: v2i64, b: i32) -> i64;
+ #[link_name = "llvm.mips.copy.u.b"]
+ fn msa_copy_u_b(a: v16i8, b: i32) -> u32;
+ #[link_name = "llvm.mips.copy.u.h"]
+ fn msa_copy_u_h(a: v8i16, b: i32) -> u32;
+ #[link_name = "llvm.mips.copy.u.w"]
+ fn msa_copy_u_w(a: v4i32, b: i32) -> u32;
+ #[link_name = "llvm.mips.copy.u.d"]
+ fn msa_copy_u_d(a: v2i64, b: i32) -> u64;
+ #[link_name = "llvm.mips.ctcmsa"]
+ fn msa_ctcmsa(imm5: i32, a: i32) -> ();
+ #[link_name = "llvm.mips.div.s.b"]
+ fn msa_div_s_b(a: v16i8, b: v16i8) -> v16i8;
+ #[link_name = "llvm.mips.div.s.h"]
+ fn msa_div_s_h(a: v8i16, b: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.div.s.w"]
+ fn msa_div_s_w(a: v4i32, b: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.div.s.d"]
+ fn msa_div_s_d(a: v2i64, b: v2i64) -> v2i64;
+ #[link_name = "llvm.mips.div.u.b"]
+ fn msa_div_u_b(a: v16u8, b: v16u8) -> v16u8;
+ #[link_name = "llvm.mips.div.u.h"]
+ fn msa_div_u_h(a: v8u16, b: v8u16) -> v8u16;
+ #[link_name = "llvm.mips.div.u.w"]
+ fn msa_div_u_w(a: v4u32, b: v4u32) -> v4u32;
+ #[link_name = "llvm.mips.div.u.d"]
+ fn msa_div_u_d(a: v2u64, b: v2u64) -> v2u64;
+ #[link_name = "llvm.mips.dotp.s.h"]
+ fn msa_dotp_s_h(a: v16i8, b: v16i8) -> v8i16;
+ #[link_name = "llvm.mips.dotp.s.w"]
+ fn msa_dotp_s_w(a: v8i16, b: v8i16) -> v4i32;
+ #[link_name = "llvm.mips.dotp.s.d"]
+ fn msa_dotp_s_d(a: v4i32, b: v4i32) -> v2i64;
+ #[link_name = "llvm.mips.dotp.u.h"]
+ fn msa_dotp_u_h(a: v16u8, b: v16u8) -> v8u16;
+ #[link_name = "llvm.mips.dotp.u.w"]
+ fn msa_dotp_u_w(a: v8u16, b: v8u16) -> v4u32;
+ #[link_name = "llvm.mips.dotp.u.d"]
+ fn msa_dotp_u_d(a: v4u32, b: v4u32) -> v2u64;
+ #[link_name = "llvm.mips.dpadd.s.h"]
+ fn msa_dpadd_s_h(a: v8i16, b: v16i8, c: v16i8) -> v8i16;
+ #[link_name = "llvm.mips.dpadd.s.w"]
+ fn msa_dpadd_s_w(a: v4i32, b: v8i16, c: v8i16) -> v4i32;
+ #[link_name = "llvm.mips.dpadd.s.d"]
+ fn msa_dpadd_s_d(a: v2i64, b: v4i32, c: v4i32) -> v2i64;
+ #[link_name = "llvm.mips.dpadd.u.h"]
+ fn msa_dpadd_u_h(a: v8u16, b: v16u8, c: v16u8) -> v8u16;
+ #[link_name = "llvm.mips.dpadd.u.w"]
+ fn msa_dpadd_u_w(a: v4u32, b: v8u16, c: v8u16) -> v4u32;
+ #[link_name = "llvm.mips.dpadd.u.d"]
+ fn msa_dpadd_u_d(a: v2u64, b: v4u32, c: v4u32) -> v2u64;
+ #[link_name = "llvm.mips.dpsub.s.h"]
+ fn msa_dpsub_s_h(a: v8i16, b: v16i8, c: v16i8) -> v8i16;
+ #[link_name = "llvm.mips.dpsub.s.w"]
+ fn msa_dpsub_s_w(a: v4i32, b: v8i16, c: v8i16) -> v4i32;
+ #[link_name = "llvm.mips.dpsub.s.d"]
+ fn msa_dpsub_s_d(a: v2i64, b: v4i32, c: v4i32) -> v2i64;
+ #[link_name = "llvm.mips.dpsub.u.h"]
+ fn msa_dpsub_u_h(a: v8i16, b: v16u8, c: v16u8) -> v8i16;
+ #[link_name = "llvm.mips.dpsub.u.w"]
+ fn msa_dpsub_u_w(a: v4i32, b: v8u16, c: v8u16) -> v4i32;
+ #[link_name = "llvm.mips.dpsub.u.d"]
+ fn msa_dpsub_u_d(a: v2i64, b: v4u32, c: v4u32) -> v2i64;
+ #[link_name = "llvm.mips.fadd.w"]
+ fn msa_fadd_w(a: v4f32, b: v4f32) -> v4f32;
+ #[link_name = "llvm.mips.fadd.d"]
+ fn msa_fadd_d(a: v2f64, b: v2f64) -> v2f64;
+ #[link_name = "llvm.mips.fcaf.w"]
+ fn msa_fcaf_w(a: v4f32, b: v4f32) -> v4i32;
+ #[link_name = "llvm.mips.fcaf.d"]
+ fn msa_fcaf_d(a: v2f64, b: v2f64) -> v2i64;
+ #[link_name = "llvm.mips.fceq.w"]
+ fn msa_fceq_w(a: v4f32, b: v4f32) -> v4i32;
+ #[link_name = "llvm.mips.fceq.d"]
+ fn msa_fceq_d(a: v2f64, b: v2f64) -> v2i64;
+ #[link_name = "llvm.mips.fclass.w"]
+ fn msa_fclass_w(a: v4f32) -> v4i32;
+ #[link_name = "llvm.mips.fclass.d"]
+ fn msa_fclass_d(a: v2f64) -> v2i64;
+ #[link_name = "llvm.mips.fcle.w"]
+ fn msa_fcle_w(a: v4f32, b: v4f32) -> v4i32;
+ #[link_name = "llvm.mips.fcle.d"]
+ fn msa_fcle_d(a: v2f64, b: v2f64) -> v2i64;
+ #[link_name = "llvm.mips.fclt.w"]
+ fn msa_fclt_w(a: v4f32, b: v4f32) -> v4i32;
+ #[link_name = "llvm.mips.fclt.d"]
+ fn msa_fclt_d(a: v2f64, b: v2f64) -> v2i64;
+ #[link_name = "llvm.mips.fcne.w"]
+ fn msa_fcne_w(a: v4f32, b: v4f32) -> v4i32;
+ #[link_name = "llvm.mips.fcne.d"]
+ fn msa_fcne_d(a: v2f64, b: v2f64) -> v2i64;
+ #[link_name = "llvm.mips.fcor.w"]
+ fn msa_fcor_w(a: v4f32, b: v4f32) -> v4i32;
+ #[link_name = "llvm.mips.fcor.d"]
+ fn msa_fcor_d(a: v2f64, b: v2f64) -> v2i64;
+ #[link_name = "llvm.mips.fcueq.w"]
+ fn msa_fcueq_w(a: v4f32, b: v4f32) -> v4i32;
+ #[link_name = "llvm.mips.fcueq.d"]
+ fn msa_fcueq_d(a: v2f64, b: v2f64) -> v2i64;
+ #[link_name = "llvm.mips.fcule.w"]
+ fn msa_fcule_w(a: v4f32, b: v4f32) -> v4i32;
+ #[link_name = "llvm.mips.fcule.d"]
+ fn msa_fcule_d(a: v2f64, b: v2f64) -> v2i64;
+ #[link_name = "llvm.mips.fcult.w"]
+ fn msa_fcult_w(a: v4f32, b: v4f32) -> v4i32;
+ #[link_name = "llvm.mips.fcult.d"]
+ fn msa_fcult_d(a: v2f64, b: v2f64) -> v2i64;
+ #[link_name = "llvm.mips.fcun.w"]
+ fn msa_fcun_w(a: v4f32, b: v4f32) -> v4i32;
+ #[link_name = "llvm.mips.fcun.d"]
+ fn msa_fcun_d(a: v2f64, b: v2f64) -> v2i64;
+ #[link_name = "llvm.mips.fcune.w"]
+ fn msa_fcune_w(a: v4f32, b: v4f32) -> v4i32;
+ #[link_name = "llvm.mips.fcune.d"]
+ fn msa_fcune_d(a: v2f64, b: v2f64) -> v2i64;
+ #[link_name = "llvm.mips.fdiv.w"]
+ fn msa_fdiv_w(a: v4f32, b: v4f32) -> v4f32;
+ #[link_name = "llvm.mips.fdiv.d"]
+ fn msa_fdiv_d(a: v2f64, b: v2f64) -> v2f64;
+ // FIXME: 16-bit floats
+ // #[link_name = "llvm.mips.fexdo.h"]
+ // fn msa_fexdo_h(a: v4f32, b: v4f32) -> f16x8;
+ #[link_name = "llvm.mips.fexdo.w"]
+ fn msa_fexdo_w(a: v2f64, b: v2f64) -> v4f32;
+ #[link_name = "llvm.mips.fexp2.w"]
+ fn msa_fexp2_w(a: v4f32, b: v4i32) -> v4f32;
+ #[link_name = "llvm.mips.fexp2.d"]
+ fn msa_fexp2_d(a: v2f64, b: v2i64) -> v2f64;
+ // FIXME: 16-bit floats
+ // #[link_name = "llvm.mips.fexupl.w"]
+ // fn msa_fexupl_w(a: f16x8) -> v4f32;
+ #[link_name = "llvm.mips.fexupl.d"]
+ fn msa_fexupl_d(a: v4f32) -> v2f64;
+ // FIXME: 16-bit floats
+ // #[link_name = "llvm.mips.fexupr.w"]
+ // fn msa_fexupr_w(a: f16x8) -> v4f32;
+ #[link_name = "llvm.mips.fexupr.d"]
+ fn msa_fexupr_d(a: v4f32) -> v2f64;
+ #[link_name = "llvm.mips.ffint.s.w"]
+ fn msa_ffint_s_w(a: v4i32) -> v4f32;
+ #[link_name = "llvm.mips.ffint.s.d"]
+ fn msa_ffint_s_d(a: v2i64) -> v2f64;
+ #[link_name = "llvm.mips.ffint.u.w"]
+ fn msa_ffint_u_w(a: v4u32) -> v4f32;
+ #[link_name = "llvm.mips.ffint.u.d"]
+ fn msa_ffint_u_d(a: v2u64) -> v2f64;
+ #[link_name = "llvm.mips.ffql.w"]
+ fn msa_ffql_w(a: v8i16) -> v4f32;
+ #[link_name = "llvm.mips.ffql.d"]
+ fn msa_ffql_d(a: v4i32) -> v2f64;
+ #[link_name = "llvm.mips.ffqr.w"]
+ fn msa_ffqr_w(a: v8i16) -> v4f32;
+ #[link_name = "llvm.mips.ffqr.d"]
+ fn msa_ffqr_d(a: v4i32) -> v2f64;
+ #[link_name = "llvm.mips.fill.b"]
+ fn msa_fill_b(a: i32) -> v16i8;
+ #[link_name = "llvm.mips.fill.h"]
+ fn msa_fill_h(a: i32) -> v8i16;
+ #[link_name = "llvm.mips.fill.w"]
+ fn msa_fill_w(a: i32) -> v4i32;
+ #[link_name = "llvm.mips.fill.d"]
+ fn msa_fill_d(a: i64) -> v2i64;
+ #[link_name = "llvm.mips.flog2.w"]
+ fn msa_flog2_w(a: v4f32) -> v4f32;
+ #[link_name = "llvm.mips.flog2.d"]
+ fn msa_flog2_d(a: v2f64) -> v2f64;
+ #[link_name = "llvm.mips.fmadd.w"]
+ fn msa_fmadd_w(a: v4f32, b: v4f32, c: v4f32) -> v4f32;
+ #[link_name = "llvm.mips.fmadd.d"]
+ fn msa_fmadd_d(a: v2f64, b: v2f64, c: v2f64) -> v2f64;
+ #[link_name = "llvm.mips.fmax.w"]
+ fn msa_fmax_w(a: v4f32, b: v4f32) -> v4f32;
+ #[link_name = "llvm.mips.fmax.d"]
+ fn msa_fmax_d(a: v2f64, b: v2f64) -> v2f64;
+ #[link_name = "llvm.mips.fmax.a.w"]
+ fn msa_fmax_a_w(a: v4f32, b: v4f32) -> v4f32;
+ #[link_name = "llvm.mips.fmax.a.d"]
+ fn msa_fmax_a_d(a: v2f64, b: v2f64) -> v2f64;
+ #[link_name = "llvm.mips.fmin.w"]
+ fn msa_fmin_w(a: v4f32, b: v4f32) -> v4f32;
+ #[link_name = "llvm.mips.fmin.d"]
+ fn msa_fmin_d(a: v2f64, b: v2f64) -> v2f64;
+ #[link_name = "llvm.mips.fmin.a.w"]
+ fn msa_fmin_a_w(a: v4f32, b: v4f32) -> v4f32;
+ #[link_name = "llvm.mips.fmin.a.d"]
+ fn msa_fmin_a_d(a: v2f64, b: v2f64) -> v2f64;
+ #[link_name = "llvm.mips.fmsub.w"]
+ fn msa_fmsub_w(a: v4f32, b: v4f32, c: v4f32) -> v4f32;
+ #[link_name = "llvm.mips.fmsub.d"]
+ fn msa_fmsub_d(a: v2f64, b: v2f64, c: v2f64) -> v2f64;
+ #[link_name = "llvm.mips.fmul.w"]
+ fn msa_fmul_w(a: v4f32, b: v4f32) -> v4f32;
+ #[link_name = "llvm.mips.fmul.d"]
+ fn msa_fmul_d(a: v2f64, b: v2f64) -> v2f64;
+ #[link_name = "llvm.mips.frint.w"]
+ fn msa_frint_w(a: v4f32) -> v4f32;
+ #[link_name = "llvm.mips.frint.d"]
+ fn msa_frint_d(a: v2f64) -> v2f64;
+ #[link_name = "llvm.mips.frcp.w"]
+ fn msa_frcp_w(a: v4f32) -> v4f32;
+ #[link_name = "llvm.mips.frcp.d"]
+ fn msa_frcp_d(a: v2f64) -> v2f64;
+ #[link_name = "llvm.mips.frsqrt.w"]
+ fn msa_frsqrt_w(a: v4f32) -> v4f32;
+ #[link_name = "llvm.mips.frsqrt.d"]
+ fn msa_frsqrt_d(a: v2f64) -> v2f64;
+ #[link_name = "llvm.mips.fsaf.w"]
+ fn msa_fsaf_w(a: v4f32, b: v4f32) -> v4i32;
+ #[link_name = "llvm.mips.fsaf.d"]
+ fn msa_fsaf_d(a: v2f64, b: v2f64) -> v2i64;
+ #[link_name = "llvm.mips.fseq.w"]
+ fn msa_fseq_w(a: v4f32, b: v4f32) -> v4i32;
+ #[link_name = "llvm.mips.fseq.d"]
+ fn msa_fseq_d(a: v2f64, b: v2f64) -> v2i64;
+ #[link_name = "llvm.mips.fsle.w"]
+ fn msa_fsle_w(a: v4f32, b: v4f32) -> v4i32;
+ #[link_name = "llvm.mips.fsle.d"]
+ fn msa_fsle_d(a: v2f64, b: v2f64) -> v2i64;
+ #[link_name = "llvm.mips.fslt.w"]
+ fn msa_fslt_w(a: v4f32, b: v4f32) -> v4i32;
+ #[link_name = "llvm.mips.fslt.d"]
+ fn msa_fslt_d(a: v2f64, b: v2f64) -> v2i64;
+ #[link_name = "llvm.mips.fsne.w"]
+ fn msa_fsne_w(a: v4f32, b: v4f32) -> v4i32;
+ #[link_name = "llvm.mips.fsne.d"]
+ fn msa_fsne_d(a: v2f64, b: v2f64) -> v2i64;
+ #[link_name = "llvm.mips.fsor.w"]
+ fn msa_fsor_w(a: v4f32, b: v4f32) -> v4i32;
+ #[link_name = "llvm.mips.fsor.d"]
+ fn msa_fsor_d(a: v2f64, b: v2f64) -> v2i64;
+ #[link_name = "llvm.mips.fsqrt.w"]
+ fn msa_fsqrt_w(a: v4f32) -> v4f32;
+ #[link_name = "llvm.mips.fsqrt.d"]
+ fn msa_fsqrt_d(a: v2f64) -> v2f64;
+ #[link_name = "llvm.mips.fsub.w"]
+ fn msa_fsub_w(a: v4f32, b: v4f32) -> v4f32;
+ #[link_name = "llvm.mips.fsub.d"]
+ fn msa_fsub_d(a: v2f64, b: v2f64) -> v2f64;
+ #[link_name = "llvm.mips.fsueq.w"]
+ fn msa_fsueq_w(a: v4f32, b: v4f32) -> v4i32;
+ #[link_name = "llvm.mips.fsueq.d"]
+ fn msa_fsueq_d(a: v2f64, b: v2f64) -> v2i64;
+ #[link_name = "llvm.mips.fsule.w"]
+ fn msa_fsule_w(a: v4f32, b: v4f32) -> v4i32;
+ #[link_name = "llvm.mips.fsule.d"]
+ fn msa_fsule_d(a: v2f64, b: v2f64) -> v2i64;
+ #[link_name = "llvm.mips.fsult.w"]
+ fn msa_fsult_w(a: v4f32, b: v4f32) -> v4i32;
+ #[link_name = "llvm.mips.fsult.d"]
+ fn msa_fsult_d(a: v2f64, b: v2f64) -> v2i64;
+ #[link_name = "llvm.mips.fsun.w"]
+ fn msa_fsun_w(a: v4f32, b: v4f32) -> v4i32;
+ #[link_name = "llvm.mips.fsun.d"]
+ fn msa_fsun_d(a: v2f64, b: v2f64) -> v2i64;
+ #[link_name = "llvm.mips.fsune.w"]
+ fn msa_fsune_w(a: v4f32, b: v4f32) -> v4i32;
+ #[link_name = "llvm.mips.fsune.d"]
+ fn msa_fsune_d(a: v2f64, b: v2f64) -> v2i64;
+ #[link_name = "llvm.mips.ftint.s.w"]
+ fn msa_ftint_s_w(a: v4f32) -> v4i32;
+ #[link_name = "llvm.mips.ftint.s.d"]
+ fn msa_ftint_s_d(a: v2f64) -> v2i64;
+ #[link_name = "llvm.mips.ftint.u.w"]
+ fn msa_ftint_u_w(a: v4f32) -> v4u32;
+ #[link_name = "llvm.mips.ftint.u.d"]
+ fn msa_ftint_u_d(a: v2f64) -> v2u64;
+ #[link_name = "llvm.mips.ftq.h"]
+ fn msa_ftq_h(a: v4f32, b: v4f32) -> v8i16;
+ #[link_name = "llvm.mips.ftq.w"]
+ fn msa_ftq_w(a: v2f64, b: v2f64) -> v4i32;
+ #[link_name = "llvm.mips.ftrunc.s.w"]
+ fn msa_ftrunc_s_w(a: v4f32) -> v4i32;
+ #[link_name = "llvm.mips.ftrunc.s.d"]
+ fn msa_ftrunc_s_d(a: v2f64) -> v2i64;
+ #[link_name = "llvm.mips.ftrunc.u.w"]
+ fn msa_ftrunc_u_w(a: v4f32) -> v4u32;
+ #[link_name = "llvm.mips.ftrunc.u.d"]
+ fn msa_ftrunc_u_d(a: v2f64) -> v2u64;
+ #[link_name = "llvm.mips.hadd.s.h"]
+ fn msa_hadd_s_h(a: v16i8, b: v16i8) -> v8i16;
+ #[link_name = "llvm.mips.hadd.s.w"]
+ fn msa_hadd_s_w(a: v8i16, b: v8i16) -> v4i32;
+ #[link_name = "llvm.mips.hadd.s.d"]
+ fn msa_hadd_s_d(a: v4i32, b: v4i32) -> v2i64;
+ #[link_name = "llvm.mips.hadd.u.h"]
+ fn msa_hadd_u_h(a: v16u8, b: v16u8) -> v8u16;
+ #[link_name = "llvm.mips.hadd.u.w"]
+ fn msa_hadd_u_w(a: v8u16, b: v8u16) -> v4u32;
+ #[link_name = "llvm.mips.hadd.u.d"]
+ fn msa_hadd_u_d(a: v4u32, b: v4u32) -> v2u64;
+ #[link_name = "llvm.mips.hsub.s.h"]
+ fn msa_hsub_s_h(a: v16i8, b: v16i8) -> v8i16;
+ #[link_name = "llvm.mips.hsub.s.w"]
+ fn msa_hsub_s_w(a: v8i16, b: v8i16) -> v4i32;
+ #[link_name = "llvm.mips.hsub.s.d"]
+ fn msa_hsub_s_d(a: v4i32, b: v4i32) -> v2i64;
+ #[link_name = "llvm.mips.hsub.u.h"]
+ fn msa_hsub_u_h(a: v16u8, b: v16u8) -> v8i16;
+ #[link_name = "llvm.mips.hsub.u.w"]
+ fn msa_hsub_u_w(a: v8u16, b: v8u16) -> v4i32;
+ #[link_name = "llvm.mips.hsub.u.d"]
+ fn msa_hsub_u_d(a: v4u32, b: v4u32) -> v2i64;
+ #[link_name = "llvm.mips.ilvev.b"]
+ fn msa_ilvev_b(a: v16i8, b: v16i8) -> v16i8;
+ #[link_name = "llvm.mips.ilvev.h"]
+ fn msa_ilvev_h(a: v8i16, b: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.ilvev.w"]
+ fn msa_ilvev_w(a: v4i32, b: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.ilvev.d"]
+ fn msa_ilvev_d(a: v2i64, b: v2i64) -> v2i64;
+ #[link_name = "llvm.mips.ilvl.b"]
+ fn msa_ilvl_b(a: v16i8, b: v16i8) -> v16i8;
+ #[link_name = "llvm.mips.ilvl.h"]
+ fn msa_ilvl_h(a: v8i16, b: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.ilvl.w"]
+ fn msa_ilvl_w(a: v4i32, b: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.ilvl.d"]
+ fn msa_ilvl_d(a: v2i64, b: v2i64) -> v2i64;
+ #[link_name = "llvm.mips.ilvod.b"]
+ fn msa_ilvod_b(a: v16i8, b: v16i8) -> v16i8;
+ #[link_name = "llvm.mips.ilvod.h"]
+ fn msa_ilvod_h(a: v8i16, b: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.ilvod.w"]
+ fn msa_ilvod_w(a: v4i32, b: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.ilvod.d"]
+ fn msa_ilvod_d(a: v2i64, b: v2i64) -> v2i64;
+ #[link_name = "llvm.mips.ilvr.b"]
+ fn msa_ilvr_b(a: v16i8, b: v16i8) -> v16i8;
+ #[link_name = "llvm.mips.ilvr.h"]
+ fn msa_ilvr_h(a: v8i16, b: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.ilvr.w"]
+ fn msa_ilvr_w(a: v4i32, b: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.ilvr.d"]
+ fn msa_ilvr_d(a: v2i64, b: v2i64) -> v2i64;
+ #[link_name = "llvm.mips.insert.b"]
+ fn msa_insert_b(a: v16i8, b: i32, c: i32) -> v16i8;
+ #[link_name = "llvm.mips.insert.h"]
+ fn msa_insert_h(a: v8i16, b: i32, c: i32) -> v8i16;
+ #[link_name = "llvm.mips.insert.w"]
+ fn msa_insert_w(a: v4i32, b: i32, c: i32) -> v4i32;
+ #[link_name = "llvm.mips.insert.d"]
+ fn msa_insert_d(a: v2i64, b: i32, c: i64) -> v2i64;
+ #[link_name = "llvm.mips.insve.b"]
+ fn msa_insve_b(a: v16i8, b: i32, c: v16i8) -> v16i8;
+ #[link_name = "llvm.mips.insve.h"]
+ fn msa_insve_h(a: v8i16, b: i32, c: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.insve.w"]
+ fn msa_insve_w(a: v4i32, b: i32, c: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.insve.d"]
+ fn msa_insve_d(a: v2i64, b: i32, c: v2i64) -> v2i64;
+ #[link_name = "llvm.mips.ld.b"]
+ fn msa_ld_b(mem_addr: *mut u8, b: i32) -> v16i8;
+ #[link_name = "llvm.mips.ld.h"]
+ fn msa_ld_h(mem_addr: *mut u8, b: i32) -> v8i16;
+ #[link_name = "llvm.mips.ld.w"]
+ fn msa_ld_w(mem_addr: *mut u8, b: i32) -> v4i32;
+ #[link_name = "llvm.mips.ld.d"]
+ fn msa_ld_d(mem_addr: *mut u8, b: i32) -> v2i64;
+ #[link_name = "llvm.mips.ldi.b"]
+ fn msa_ldi_b(a: i32) -> v16i8;
+ #[link_name = "llvm.mips.ldi.h"]
+ fn msa_ldi_h(a: i32) -> v8i16;
+ #[link_name = "llvm.mips.ldi.w"]
+ fn msa_ldi_w(a: i32) -> v4i32;
+ #[link_name = "llvm.mips.ldi.d"]
+ fn msa_ldi_d(a: i32) -> v2i64;
+ #[link_name = "llvm.mips.madd.q.h"]
+ fn msa_madd_q_h(a: v8i16, b: v8i16, c: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.madd.q.w"]
+ fn msa_madd_q_w(a: v4i32, b: v4i32, c: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.maddr.q.h"]
+ fn msa_maddr_q_h(a: v8i16, b: v8i16, c: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.maddr.q.w"]
+ fn msa_maddr_q_w(a: v4i32, b: v4i32, c: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.maddv.b"]
+ fn msa_maddv_b(a: v16i8, b: v16i8, c: v16i8) -> v16i8;
+ #[link_name = "llvm.mips.maddv.h"]
+ fn msa_maddv_h(a: v8i16, b: v8i16, c: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.maddv.w"]
+ fn msa_maddv_w(a: v4i32, b: v4i32, c: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.maddv.d"]
+ fn msa_maddv_d(a: v2i64, b: v2i64, c: v2i64) -> v2i64;
+ #[link_name = "llvm.mips.max.a.b"]
+ fn msa_max_a_b(a: v16i8, b: v16i8) -> v16i8;
+ #[link_name = "llvm.mips.max.a.h"]
+ fn msa_max_a_h(a: v8i16, b: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.max.a.w"]
+ fn msa_max_a_w(a: v4i32, b: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.max.a.d"]
+ fn msa_max_a_d(a: v2i64, b: v2i64) -> v2i64;
+ #[link_name = "llvm.mips.max.s.b"]
+ fn msa_max_s_b(a: v16i8, b: v16i8) -> v16i8;
+ #[link_name = "llvm.mips.max.s.h"]
+ fn msa_max_s_h(a: v8i16, b: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.max.s.w"]
+ fn msa_max_s_w(a: v4i32, b: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.max.s.d"]
+ fn msa_max_s_d(a: v2i64, b: v2i64) -> v2i64;
+ #[link_name = "llvm.mips.max.u.b"]
+ fn msa_max_u_b(a: v16u8, b: v16u8) -> v16u8;
+ #[link_name = "llvm.mips.max.u.h"]
+ fn msa_max_u_h(a: v8u16, b: v8u16) -> v8u16;
+ #[link_name = "llvm.mips.max.u.w"]
+ fn msa_max_u_w(a: v4u32, b: v4u32) -> v4u32;
+ #[link_name = "llvm.mips.max.u.d"]
+ fn msa_max_u_d(a: v2u64, b: v2u64) -> v2u64;
+ #[link_name = "llvm.mips.maxi.s.b"]
+ fn msa_maxi_s_b(a: v16i8, b: i32) -> v16i8;
+ #[link_name = "llvm.mips.maxi.s.h"]
+ fn msa_maxi_s_h(a: v8i16, b: i32) -> v8i16;
+ #[link_name = "llvm.mips.maxi.s.w"]
+ fn msa_maxi_s_w(a: v4i32, b: i32) -> v4i32;
+ #[link_name = "llvm.mips.maxi.s.d"]
+ fn msa_maxi_s_d(a: v2i64, b: i32) -> v2i64;
+ #[link_name = "llvm.mips.maxi.u.b"]
+ fn msa_maxi_u_b(a: v16u8, b: i32) -> v16u8;
+ #[link_name = "llvm.mips.maxi.u.h"]
+ fn msa_maxi_u_h(a: v8u16, b: i32) -> v8u16;
+ #[link_name = "llvm.mips.maxi.u.w"]
+ fn msa_maxi_u_w(a: v4u32, b: i32) -> v4u32;
+ #[link_name = "llvm.mips.maxi.u.d"]
+ fn msa_maxi_u_d(a: v2u64, b: i32) -> v2u64;
+ #[link_name = "llvm.mips.min.a.b"]
+ fn msa_min_a_b(a: v16i8, b: v16i8) -> v16i8;
+ #[link_name = "llvm.mips.min.a.h"]
+ fn msa_min_a_h(a: v8i16, b: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.min.a.w"]
+ fn msa_min_a_w(a: v4i32, b: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.min.a.d"]
+ fn msa_min_a_d(a: v2i64, b: v2i64) -> v2i64;
+ #[link_name = "llvm.mips.min.s.b"]
+ fn msa_min_s_b(a: v16i8, b: v16i8) -> v16i8;
+ #[link_name = "llvm.mips.min.s.h"]
+ fn msa_min_s_h(a: v8i16, b: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.min.s.w"]
+ fn msa_min_s_w(a: v4i32, b: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.min.s.d"]
+ fn msa_min_s_d(a: v2i64, b: v2i64) -> v2i64;
+ #[link_name = "llvm.mips.min.u.b"]
+ fn msa_min_u_b(a: v16u8, b: v16u8) -> v16u8;
+ #[link_name = "llvm.mips.min.u.h"]
+ fn msa_min_u_h(a: v8u16, b: v8u16) -> v8u16;
+ #[link_name = "llvm.mips.min.u.w"]
+ fn msa_min_u_w(a: v4u32, b: v4u32) -> v4u32;
+ #[link_name = "llvm.mips.min.u.d"]
+ fn msa_min_u_d(a: v2u64, b: v2u64) -> v2u64;
+ #[link_name = "llvm.mips.mini.s.b"]
+ fn msa_mini_s_b(a: v16i8, b: i32) -> v16i8;
+ #[link_name = "llvm.mips.mini.s.h"]
+ fn msa_mini_s_h(a: v8i16, b: i32) -> v8i16;
+ #[link_name = "llvm.mips.mini.s.w"]
+ fn msa_mini_s_w(a: v4i32, b: i32) -> v4i32;
+ #[link_name = "llvm.mips.mini.s.d"]
+ fn msa_mini_s_d(a: v2i64, b: i32) -> v2i64;
+ #[link_name = "llvm.mips.mini.u.b"]
+ fn msa_mini_u_b(a: v16u8, b: i32) -> v16u8;
+ #[link_name = "llvm.mips.mini.u.h"]
+ fn msa_mini_u_h(a: v8u16, b: i32) -> v8u16;
+ #[link_name = "llvm.mips.mini.u.w"]
+ fn msa_mini_u_w(a: v4u32, b: i32) -> v4u32;
+ #[link_name = "llvm.mips.mini.u.d"]
+ fn msa_mini_u_d(a: v2u64, b: i32) -> v2u64;
+ #[link_name = "llvm.mips.mod.s.b"]
+ fn msa_mod_s_b(a: v16i8, b: v16i8) -> v16i8;
+ #[link_name = "llvm.mips.mod.s.h"]
+ fn msa_mod_s_h(a: v8i16, b: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.mod.s.w"]
+ fn msa_mod_s_w(a: v4i32, b: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.mod.s.d"]
+ fn msa_mod_s_d(a: v2i64, b: v2i64) -> v2i64;
+ #[link_name = "llvm.mips.mod.u.b"]
+ fn msa_mod_u_b(a: v16u8, b: v16u8) -> v16u8;
+ #[link_name = "llvm.mips.mod.u.h"]
+ fn msa_mod_u_h(a: v8u16, b: v8u16) -> v8u16;
+ #[link_name = "llvm.mips.mod.u.w"]
+ fn msa_mod_u_w(a: v4u32, b: v4u32) -> v4u32;
+ #[link_name = "llvm.mips.mod.u.d"]
+ fn msa_mod_u_d(a: v2u64, b: v2u64) -> v2u64;
+ #[link_name = "llvm.mips.move.v"]
+ fn msa_move_v(a: v16i8) -> v16i8;
+ #[link_name = "llvm.mips.msub.q.h"]
+ fn msa_msub_q_h(a: v8i16, b: v8i16, c: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.msub.q.w"]
+ fn msa_msub_q_w(a: v4i32, b: v4i32, c: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.msubr.q.h"]
+ fn msa_msubr_q_h(a: v8i16, b: v8i16, c: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.msubr.q.w"]
+ fn msa_msubr_q_w(a: v4i32, b: v4i32, c: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.msubv.b"]
+ fn msa_msubv_b(a: v16i8, b: v16i8, c: v16i8) -> v16i8;
+ #[link_name = "llvm.mips.msubv.h"]
+ fn msa_msubv_h(a: v8i16, b: v8i16, c: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.msubv.w"]
+ fn msa_msubv_w(a: v4i32, b: v4i32, c: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.msubv.d"]
+ fn msa_msubv_d(a: v2i64, b: v2i64, c: v2i64) -> v2i64;
+ #[link_name = "llvm.mips.mul.q.h"]
+ fn msa_mul_q_h(a: v8i16, b: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.mul.q.w"]
+ fn msa_mul_q_w(a: v4i32, b: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.mulr.q.h"]
+ fn msa_mulr_q_h(a: v8i16, b: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.mulr.q.w"]
+ fn msa_mulr_q_w(a: v4i32, b: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.mulv.b"]
+ fn msa_mulv_b(a: v16i8, b: v16i8) -> v16i8;
+ #[link_name = "llvm.mips.mulv.h"]
+ fn msa_mulv_h(a: v8i16, b: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.mulv.w"]
+ fn msa_mulv_w(a: v4i32, b: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.mulv.d"]
+ fn msa_mulv_d(a: v2i64, b: v2i64) -> v2i64;
+ #[link_name = "llvm.mips.nloc.b"]
+ fn msa_nloc_b(a: v16i8) -> v16i8;
+ #[link_name = "llvm.mips.nloc.h"]
+ fn msa_nloc_h(a: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.nloc.w"]
+ fn msa_nloc_w(a: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.nloc.d"]
+ fn msa_nloc_d(a: v2i64) -> v2i64;
+ #[link_name = "llvm.mips.nlzc.b"]
+ fn msa_nlzc_b(a: v16i8) -> v16i8;
+ #[link_name = "llvm.mips.nlzc.h"]
+ fn msa_nlzc_h(a: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.nlzc.w"]
+ fn msa_nlzc_w(a: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.nlzc.d"]
+ fn msa_nlzc_d(a: v2i64) -> v2i64;
+ #[link_name = "llvm.mips.nor.v"]
+ fn msa_nor_v(a: v16u8, b: v16u8) -> v16u8;
+ #[link_name = "llvm.mips.nori.b"]
+ fn msa_nori_b(a: v16u8, b: i32) -> v16u8;
+ #[link_name = "llvm.mips.or.v"]
+ fn msa_or_v(a: v16u8, b: v16u8) -> v16u8;
+ #[link_name = "llvm.mips.ori.b"]
+ fn msa_ori_b(a: v16u8, b: i32) -> v16u8;
+ #[link_name = "llvm.mips.pckev.b"]
+ fn msa_pckev_b(a: v16i8, b: v16i8) -> v16i8;
+ #[link_name = "llvm.mips.pckev.h"]
+ fn msa_pckev_h(a: v8i16, b: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.pckev.w"]
+ fn msa_pckev_w(a: v4i32, b: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.pckev.d"]
+ fn msa_pckev_d(a: v2i64, b: v2i64) -> v2i64;
+ #[link_name = "llvm.mips.pckod.b"]
+ fn msa_pckod_b(a: v16i8, b: v16i8) -> v16i8;
+ #[link_name = "llvm.mips.pckod.h"]
+ fn msa_pckod_h(a: v8i16, b: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.pckod.w"]
+ fn msa_pckod_w(a: v4i32, b: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.pckod.d"]
+ fn msa_pckod_d(a: v2i64, b: v2i64) -> v2i64;
+ #[link_name = "llvm.mips.pcnt.b"]
+ fn msa_pcnt_b(a: v16i8) -> v16i8;
+ #[link_name = "llvm.mips.pcnt.h"]
+ fn msa_pcnt_h(a: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.pcnt.w"]
+ fn msa_pcnt_w(a: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.pcnt.d"]
+ fn msa_pcnt_d(a: v2i64) -> v2i64;
+ #[link_name = "llvm.mips.sat.s.b"]
+ fn msa_sat_s_b(a: v16i8, b: i32) -> v16i8;
+ #[link_name = "llvm.mips.sat.s.h"]
+ fn msa_sat_s_h(a: v8i16, b: i32) -> v8i16;
+ #[link_name = "llvm.mips.sat.s.w"]
+ fn msa_sat_s_w(a: v4i32, b: i32) -> v4i32;
+ #[link_name = "llvm.mips.sat.s.d"]
+ fn msa_sat_s_d(a: v2i64, b: i32) -> v2i64;
+ #[link_name = "llvm.mips.sat.u.b"]
+ fn msa_sat_u_b(a: v16u8, b: i32) -> v16u8;
+ #[link_name = "llvm.mips.sat.u.h"]
+ fn msa_sat_u_h(a: v8u16, b: i32) -> v8u16;
+ #[link_name = "llvm.mips.sat.u.w"]
+ fn msa_sat_u_w(a: v4u32, b: i32) -> v4u32;
+ #[link_name = "llvm.mips.sat.u.d"]
+ fn msa_sat_u_d(a: v2u64, b: i32) -> v2u64;
+ #[link_name = "llvm.mips.shf.b"]
+ fn msa_shf_b(a: v16i8, b: i32) -> v16i8;
+ #[link_name = "llvm.mips.shf.h"]
+ fn msa_shf_h(a: v8i16, b: i32) -> v8i16;
+ #[link_name = "llvm.mips.shf.w"]
+ fn msa_shf_w(a: v4i32, b: i32) -> v4i32;
+ #[link_name = "llvm.mips.sld.b"]
+ fn msa_sld_b(a: v16i8, b: v16i8, c: i32) -> v16i8;
+ #[link_name = "llvm.mips.sld.h"]
+ fn msa_sld_h(a: v8i16, b: v8i16, c: i32) -> v8i16;
+ #[link_name = "llvm.mips.sld.w"]
+ fn msa_sld_w(a: v4i32, b: v4i32, c: i32) -> v4i32;
+ #[link_name = "llvm.mips.sld.d"]
+ fn msa_sld_d(a: v2i64, b: v2i64, c: i32) -> v2i64;
+ #[link_name = "llvm.mips.sldi.b"]
+ fn msa_sldi_b(a: v16i8, b: v16i8, c: i32) -> v16i8;
+ #[link_name = "llvm.mips.sldi.h"]
+ fn msa_sldi_h(a: v8i16, b: v8i16, c: i32) -> v8i16;
+ #[link_name = "llvm.mips.sldi.w"]
+ fn msa_sldi_w(a: v4i32, b: v4i32, c: i32) -> v4i32;
+ #[link_name = "llvm.mips.sldi.d"]
+ fn msa_sldi_d(a: v2i64, b: v2i64, c: i32) -> v2i64;
+ #[link_name = "llvm.mips.sll.b"]
+ fn msa_sll_b(a: v16i8, b: v16i8) -> v16i8;
+ #[link_name = "llvm.mips.sll.h"]
+ fn msa_sll_h(a: v8i16, b: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.sll.w"]
+ fn msa_sll_w(a: v4i32, b: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.sll.d"]
+ fn msa_sll_d(a: v2i64, b: v2i64) -> v2i64;
+ #[link_name = "llvm.mips.slli.b"]
+ fn msa_slli_b(a: v16i8, b: i32) -> v16i8;
+ #[link_name = "llvm.mips.slli.h"]
+ fn msa_slli_h(a: v8i16, b: i32) -> v8i16;
+ #[link_name = "llvm.mips.slli.w"]
+ fn msa_slli_w(a: v4i32, b: i32) -> v4i32;
+ #[link_name = "llvm.mips.slli.d"]
+ fn msa_slli_d(a: v2i64, b: i32) -> v2i64;
+ #[link_name = "llvm.mips.splat.b"]
+ fn msa_splat_b(a: v16i8, c: i32) -> v16i8;
+ #[link_name = "llvm.mips.splat.h"]
+ fn msa_splat_h(a: v8i16, c: i32) -> v8i16;
+ #[link_name = "llvm.mips.splat.w"]
+ fn msa_splat_w(a: v4i32, w: i32) -> v4i32;
+ #[link_name = "llvm.mips.splat.d"]
+ fn msa_splat_d(a: v2i64, c: i32) -> v2i64;
+ #[link_name = "llvm.mips.splati.b"]
+ fn msa_splati_b(a: v16i8, b: i32) -> v16i8;
+ #[link_name = "llvm.mips.splati.h"]
+ fn msa_splati_h(a: v8i16, b: i32) -> v8i16;
+ #[link_name = "llvm.mips.splati.w"]
+ fn msa_splati_w(a: v4i32, b: i32) -> v4i32;
+ #[link_name = "llvm.mips.splati.d"]
+ fn msa_splati_d(a: v2i64, b: i32) -> v2i64;
+ #[link_name = "llvm.mips.sra.b"]
+ fn msa_sra_b(a: v16i8, b: v16i8) -> v16i8;
+ #[link_name = "llvm.mips.sra.h"]
+ fn msa_sra_h(a: v8i16, b: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.sra.w"]
+ fn msa_sra_w(a: v4i32, b: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.sra.d"]
+ fn msa_sra_d(a: v2i64, b: v2i64) -> v2i64;
+ #[link_name = "llvm.mips.srai.b"]
+ fn msa_srai_b(a: v16i8, b: i32) -> v16i8;
+ #[link_name = "llvm.mips.srai.h"]
+ fn msa_srai_h(a: v8i16, b: i32) -> v8i16;
+ #[link_name = "llvm.mips.srai.w"]
+ fn msa_srai_w(a: v4i32, b: i32) -> v4i32;
+ #[link_name = "llvm.mips.srai.d"]
+ fn msa_srai_d(a: v2i64, b: i32) -> v2i64;
+ #[link_name = "llvm.mips.srar.b"]
+ fn msa_srar_b(a: v16i8, b: v16i8) -> v16i8;
+ #[link_name = "llvm.mips.srar.h"]
+ fn msa_srar_h(a: v8i16, b: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.srar.w"]
+ fn msa_srar_w(a: v4i32, b: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.srar.d"]
+ fn msa_srar_d(a: v2i64, b: v2i64) -> v2i64;
+ #[link_name = "llvm.mips.srari.b"]
+ fn msa_srari_b(a: v16i8, b: i32) -> v16i8;
+ #[link_name = "llvm.mips.srari.h"]
+ fn msa_srari_h(a: v8i16, b: i32) -> v8i16;
+ #[link_name = "llvm.mips.srari.w"]
+ fn msa_srari_w(a: v4i32, b: i32) -> v4i32;
+ #[link_name = "llvm.mips.srari.d"]
+ fn msa_srari_d(a: v2i64, b: i32) -> v2i64;
+ #[link_name = "llvm.mips.srl.b"]
+ fn msa_srl_b(a: v16i8, b: v16i8) -> v16i8;
+ #[link_name = "llvm.mips.srl.h"]
+ fn msa_srl_h(a: v8i16, b: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.srl.w"]
+ fn msa_srl_w(a: v4i32, b: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.srl.d"]
+ fn msa_srl_d(a: v2i64, b: v2i64) -> v2i64;
+ #[link_name = "llvm.mips.srli.b"]
+ fn msa_srli_b(a: v16i8, b: i32) -> v16i8;
+ #[link_name = "llvm.mips.srli.h"]
+ fn msa_srli_h(a: v8i16, b: i32) -> v8i16;
+ #[link_name = "llvm.mips.srli.w"]
+ fn msa_srli_w(a: v4i32, b: i32) -> v4i32;
+ #[link_name = "llvm.mips.srli.d"]
+ fn msa_srli_d(a: v2i64, b: i32) -> v2i64;
+ #[link_name = "llvm.mips.srlr.b"]
+ fn msa_srlr_b(a: v16i8, b: v16i8) -> v16i8;
+ #[link_name = "llvm.mips.srlr.h"]
+ fn msa_srlr_h(a: v8i16, b: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.srlr.w"]
+ fn msa_srlr_w(a: v4i32, b: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.srlr.d"]
+ fn msa_srlr_d(a: v2i64, b: v2i64) -> v2i64;
+ #[link_name = "llvm.mips.srlri.b"]
+ fn msa_srlri_b(a: v16i8, b: i32) -> v16i8;
+ #[link_name = "llvm.mips.srlri.h"]
+ fn msa_srlri_h(a: v8i16, b: i32) -> v8i16;
+ #[link_name = "llvm.mips.srlri.w"]
+ fn msa_srlri_w(a: v4i32, b: i32) -> v4i32;
+ #[link_name = "llvm.mips.srlri.d"]
+ fn msa_srlri_d(a: v2i64, b: i32) -> v2i64;
+ #[link_name = "llvm.mips.st.b"]
+ fn msa_st_b(a: v16i8, mem_addr: *mut u8, imm_s10: i32) -> ();
+ #[link_name = "llvm.mips.st.h"]
+ fn msa_st_h(a: v8i16, mem_addr: *mut u8, imm_s11: i32) -> ();
+ #[link_name = "llvm.mips.st.w"]
+ fn msa_st_w(a: v4i32, mem_addr: *mut u8, imm_s12: i32) -> ();
+ #[link_name = "llvm.mips.st.d"]
+ fn msa_st_d(a: v2i64, mem_addr: *mut u8, imm_s13: i32) -> ();
+ #[link_name = "llvm.mips.subs.s.b"]
+ fn msa_subs_s_b(a: v16i8, b: v16i8) -> v16i8;
+ #[link_name = "llvm.mips.subs.s.h"]
+ fn msa_subs_s_h(a: v8i16, b: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.subs.s.w"]
+ fn msa_subs_s_w(a: v4i32, b: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.subs.s.d"]
+ fn msa_subs_s_d(a: v2i64, b: v2i64) -> v2i64;
+ #[link_name = "llvm.mips.subs.u.b"]
+ fn msa_subs_u_b(a: v16u8, b: v16u8) -> v16u8;
+ #[link_name = "llvm.mips.subs.u.h"]
+ fn msa_subs_u_h(a: v8u16, b: v8u16) -> v8u16;
+ #[link_name = "llvm.mips.subs.u.w"]
+ fn msa_subs_u_w(a: v4u32, b: v4u32) -> v4u32;
+ #[link_name = "llvm.mips.subs.u.d"]
+ fn msa_subs_u_d(a: v2u64, b: v2u64) -> v2u64;
+ #[link_name = "llvm.mips.subsus.u.b"]
+ fn msa_subsus_u_b(a: v16u8, b: v16i8) -> v16u8;
+ #[link_name = "llvm.mips.subsus.u.h"]
+ fn msa_subsus_u_h(a: v8u16, b: v8i16) -> v8u16;
+ #[link_name = "llvm.mips.subsus.u.w"]
+ fn msa_subsus_u_w(a: v4u32, b: v4i32) -> v4u32;
+ #[link_name = "llvm.mips.subsus.u.d"]
+ fn msa_subsus_u_d(a: v2u64, b: v2i64) -> v2u64;
+ #[link_name = "llvm.mips.subsuu.s.b"]
+ fn msa_subsuu_s_b(a: v16u8, b: v16u8) -> v16i8;
+ #[link_name = "llvm.mips.subsuu.s.h"]
+ fn msa_subsuu_s_h(a: v8u16, b: v8u16) -> v8i16;
+ #[link_name = "llvm.mips.subsuu.s.w"]
+ fn msa_subsuu_s_w(a: v4u32, b: v4u32) -> v4i32;
+ #[link_name = "llvm.mips.subsuu.s.d"]
+ fn msa_subsuu_s_d(a: v2u64, b: v2u64) -> v2i64;
+ #[link_name = "llvm.mips.subv.b"]
+ fn msa_subv_b(a: v16i8, b: v16i8) -> v16i8;
+ #[link_name = "llvm.mips.subv.h"]
+ fn msa_subv_h(a: v8i16, b: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.subv.w"]
+ fn msa_subv_w(a: v4i32, b: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.subv.d"]
+ fn msa_subv_d(a: v2i64, b: v2i64) -> v2i64;
+ #[link_name = "llvm.mips.subvi.b"]
+ fn msa_subvi_b(a: v16i8, b: i32) -> v16i8;
+ #[link_name = "llvm.mips.subvi.h"]
+ fn msa_subvi_h(a: v8i16, b: i32) -> v8i16;
+ #[link_name = "llvm.mips.subvi.w"]
+ fn msa_subvi_w(a: v4i32, b: i32) -> v4i32;
+ #[link_name = "llvm.mips.subvi.d"]
+ fn msa_subvi_d(a: v2i64, b: i32) -> v2i64;
+ #[link_name = "llvm.mips.vshf.b"]
+ fn msa_vshf_b(a: v16i8, b: v16i8, c: v16i8) -> v16i8;
+ #[link_name = "llvm.mips.vshf.h"]
+ fn msa_vshf_h(a: v8i16, b: v8i16, c: v8i16) -> v8i16;
+ #[link_name = "llvm.mips.vshf.w"]
+ fn msa_vshf_w(a: v4i32, b: v4i32, c: v4i32) -> v4i32;
+ #[link_name = "llvm.mips.vshf.d"]
+ fn msa_vshf_d(a: v2i64, b: v2i64, c: v2i64) -> v2i64;
+ #[link_name = "llvm.mips.xor.v"]
+ fn msa_xor_v(a: v16u8, b: v16u8) -> v16u8;
+ #[link_name = "llvm.mips.xori.b"]
+ fn msa_xori_b(a: v16u8, b: i32) -> v16u8;
+}
+
+/// Vector Add Absolute Values.
+///
+/// The absolute values of the elements in vector in `a` (sixteen signed 8-bit integer numbers)
+/// are added to the absolute values of the elements in vector `b` (sixteen signed 8-bit integer numbers).
+/// The result is written to vector (sixteen signed 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(add_a.b))]
+pub unsafe fn __msa_add_a_b(a: v16i8, b: v16i8) -> v16i8 {
+ msa_add_a_b(a, mem::transmute(b))
+}
+
+/// Vector Add Absolute Values
+///
+/// The absolute values of the elements in vector in `a` (eight signed 16-bit integer numbers)
+/// are added to the absolute values of the elements in vector `b` (eight signed 16-bit integer numbers).
+/// The result is written to vector (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(add_a.h))]
+pub unsafe fn __msa_add_a_h(a: v8i16, b: v8i16) -> v8i16 {
+ msa_add_a_h(a, mem::transmute(b))
+}
+
+/// Vector Add Absolute Values
+///
+/// The absolute values of the elements in vector in `a` (four signed 32-bit integer numbers)
+/// are added to the absolute values of the elements in vector `b` (four signed 32-bit integer numbers).
+/// The result is written to vector (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(add_a.w))]
+pub unsafe fn __msa_add_a_w(a: v4i32, b: v4i32) -> v4i32 {
+ msa_add_a_w(a, mem::transmute(b))
+}
+
+/// Vector Add Absolute Values
+///
+/// The absolute values of the elements in vector in `a` (two signed 64-bit integer numbers)
+/// are added to the absolute values of the elements in vector `b` (two signed 64-bit integer numbers).
+/// The result is written to vector (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(add_a.d))]
+pub unsafe fn __msa_add_a_d(a: v2i64, b: v2i64) -> v2i64 {
+ msa_add_a_d(a, mem::transmute(b))
+}
+
+/// Signed Saturated Vector Saturated Add of Absolute Values
+///
+/// The absolute values of the elements in vector in `a` (sixteen signed 8-bit integer numbers)
+/// are added to the absolute values of the elements in vector `b` (sixteen signed 8-bit integer numbers).
+/// The saturated signed result is written to vector (sixteen signed 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(adds_a.b))]
+pub unsafe fn __msa_adds_a_b(a: v16i8, b: v16i8) -> v16i8 {
+ msa_adds_a_b(a, mem::transmute(b))
+}
+
+/// Vector Saturated Add of Absolute Values
+///
+/// The absolute values of the elements in vector in `a` (eight signed 16-bit integer numbers)
+/// are added to the absolute values of the elements in vector `b` (eight signed 16-bit integer numbers).
+/// The saturated signed result is written to vector (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(adds_a.h))]
+pub unsafe fn __msa_adds_a_h(a: v8i16, b: v8i16) -> v8i16 {
+ msa_adds_a_h(a, mem::transmute(b))
+}
+
+/// Vector Saturated Add of Absolute Values
+///
+/// The absolute values of the elements in vector in `a` (four signed 32-bit integer numbers)
+/// are added to the absolute values of the elements in vector `b` (four signed 32-bit integer numbers).
+/// The saturated signed result is written to vector (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(adds_a.w))]
+pub unsafe fn __msa_adds_a_w(a: v4i32, b: v4i32) -> v4i32 {
+ msa_adds_a_w(a, mem::transmute(b))
+}
+
+/// Vector Saturated Add of Absolute Values
+///
+/// The absolute values of the elements in vector in `a` (two signed 64-bit integer numbers)
+/// are added to the absolute values of the elements in vector `b` (two signed 64-bit integer numbers).
+/// The saturated signed result is written to vector (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(adds_a.d))]
+pub unsafe fn __msa_adds_a_d(a: v2i64, b: v2i64) -> v2i64 {
+ msa_adds_a_d(a, mem::transmute(b))
+}
+
+/// Vector Signed Saturated Add of Signed Values
+///
+/// The elements in vector in `a` (sixteen signed 8-bit integer numbers)
+/// are added to the elements in vector `b` (sixteen signed 8-bit integer numbers).
+/// Signed arithmetic is performed and overflows clamp to the largest and/or smallest
+/// representable signed values before writing the result to vector (sixteen signed 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(adds_s.b))]
+pub unsafe fn __msa_adds_s_b(a: v16i8, b: v16i8) -> v16i8 {
+ msa_adds_s_b(a, mem::transmute(b))
+}
+
+/// Vector Signed Saturated Add of Signed Values
+///
+/// The elements in vector in `a` (eight signed 16-bit integer numbers)
+/// are added to the elements in vector `b` (eight signed 16-bit integer numbers).
+/// Signed arithmetic is performed and overflows clamp to the largest and/or smallest
+/// representable signed values before writing the result to vector (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(adds_s.h))]
+pub unsafe fn __msa_adds_s_h(a: v8i16, b: v8i16) -> v8i16 {
+ msa_adds_s_h(a, mem::transmute(b))
+}
+
+/// Vector Signed Saturated Add of Signed Values
+///
+/// The elements in vector in `a` (four signed 32-bit integer numbers)
+/// are added to the elements in vector `b` (four signed 32-bit integer numbers).
+/// Signed arithmetic is performed and overflows clamp to the largest and/or smallest
+/// representable signed values before writing the result to vector (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(adds_s.w))]
+pub unsafe fn __msa_adds_s_w(a: v4i32, b: v4i32) -> v4i32 {
+ msa_adds_s_w(a, mem::transmute(b))
+}
+
+/// Vector Signed Saturated Add of Signed Values
+///
+/// The elements in vector in `a` (two signed 64-bit integer numbers)
+/// are added to the elements in vector `b` (two signed 64-bit integer numbers).
+/// Signed arithmetic is performed and overflows clamp to the largest and/or smallest
+/// representable signed values before writing the result to vector (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(adds_s.d))]
+pub unsafe fn __msa_adds_s_d(a: v2i64, b: v2i64) -> v2i64 {
+ msa_adds_s_d(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Saturated Add of Unsigned Values
+///
+/// The elements in vector in `a` (sixteen unsigned 8-bit integer numbers)
+/// are added to the elements in vector `b` (sixteen unsigned 8-bit integer numbers).
+/// Signed arithmetic is performed and overflows clamp to the largest and/or smallest
+/// representable signed values before writing the result to vector (sixteen unsigned 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(adds_u.b))]
+pub unsafe fn __msa_adds_u_b(a: v16u8, b: v16u8) -> v16u8 {
+ msa_adds_u_b(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Saturated Add of Unsigned Values
+///
+/// The elements in vector in `a` (eight unsigned 16-bit integer numbers)
+/// are added to the elements in vector `b` (eight unsigned 16-bit integer numbers).
+/// Signed arithmetic is performed and overflows clamp to the largest and/or smallest
+/// representable signed values before writing the result to vector (eight unsigned 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(adds_u.h))]
+pub unsafe fn __msa_adds_u_h(a: v8u16, b: v8u16) -> v8u16 {
+ msa_adds_u_h(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Saturated Add of Unsigned Values
+///
+/// The elements in vector in `a` (four unsigned 32-bit integer numbers)
+/// are added to the elements in vector `b` (four unsigned 32-bit integer numbers).
+/// Signed arithmetic is performed and overflows clamp to the largest and/or smallest
+/// representable signed values before writing the result to vector (four unsigned 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(adds_u.w))]
+pub unsafe fn __msa_adds_u_w(a: v4u32, b: v4u32) -> v4u32 {
+ msa_adds_u_w(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Saturated Add of Unsigned Values
+///
+/// The elements in vector in `a` (two unsigned 64-bit integer numbers)
+/// are added to the elements in vector `b` (two unsigned 64-bit integer numbers).
+/// Signed arithmetic is performed and overflows clamp to the largest and/or smallest
+/// representable signed values before writing the result to vector (two unsigned 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(adds_u.d))]
+pub unsafe fn __msa_adds_u_d(a: v2u64, b: v2u64) -> v2u64 {
+ msa_adds_u_d(a, mem::transmute(b))
+}
+
+/// Vector Add
+///
+/// The elements in vector in `a` (sixteen signed 8-bit integer numbers)
+/// are added to the elements in vector `b` (sixteen signed 8-bit integer numbers).
+/// The result is written to vector (sixteen signed 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(addv.b))]
+pub unsafe fn __msa_addv_b(a: v16i8, b: v16i8) -> v16i8 {
+ msa_addv_b(a, mem::transmute(b))
+}
+
+/// Vector Add
+///
+/// The elements in vector in `a` (eight signed 16-bit integer numbers)
+/// are added to the elements in vector `b` (eight signed 16-bit integer numbers).
+/// The result is written to vector (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(addv.h))]
+pub unsafe fn __msa_addv_h(a: v8i16, b: v8i16) -> v8i16 {
+ msa_addv_h(a, mem::transmute(b))
+}
+
+/// Vector Add
+///
+/// The elements in vector in `a` (four signed 32-bit integer numbers)
+/// are added to the elements in vector `b` (four signed 32-bit integer numbers).
+/// The result is written to vector (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(addv.w))]
+pub unsafe fn __msa_addv_w(a: v4i32, b: v4i32) -> v4i32 {
+ msa_addv_w(a, mem::transmute(b))
+}
+
+/// Vector Add
+///
+/// The elements in vector in `a` (two signed 64-bit integer numbers)
+/// are added to the elements in vector `b` (two signed 64-bit integer numbers).
+/// The result is written to vector (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(addv.d))]
+pub unsafe fn __msa_addv_d(a: v2i64, b: v2i64) -> v2i64 {
+ msa_addv_d(a, mem::transmute(b))
+}
+
+/// Immediate Add
+///
+/// The 5-bit immediate unsigned value `imm5` is added to the elements
+/// vector in `a` (sixteen signed 8-bit integer numbers).
+/// The result is written to vector (sixteen signed 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(addvi.b, imm5 = 0b10111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_addvi_b<const IMM5: i32>(a: v16i8) -> v16i8 {
+ static_assert_imm5!(IMM5);
+ msa_addvi_b(a, IMM5)
+}
+
+/// Immediate Add
+///
+/// The 5-bit immediate unsigned value `imm5` is added to the elements
+/// vector in `a` (eight signed 16-bit integer numbers).
+/// The result is written to vector (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(addvi.h, imm5 = 0b10111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_addvi_h<const IMM5: i32>(a: v8i16) -> v8i16 {
+ static_assert_imm5!(IMM5);
+ msa_addvi_h(a, IMM5)
+}
+
+/// Immediate Add
+///
+/// The 5-bit immediate unsigned value `imm5` is added to the elements
+/// vector in `a` (four signed 32-bit integer numbers).
+/// The result is written to vector (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(addvi.w, imm5 = 0b10111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_addvi_w<const IMM5: i32>(a: v4i32) -> v4i32 {
+ static_assert_imm5!(IMM5);
+ msa_addvi_w(a, IMM5)
+}
+
+/// Immediate Add
+///
+/// The 5-bit immediate unsigned value `imm5` is added to the elements
+/// vector in `a` (two signed 64-bit integer numbers).
+/// The result is written to vector (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(addvi.d, imm5 = 0b10111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_addvi_d<const IMM5: i32>(a: v2i64) -> v2i64 {
+ static_assert_imm5!(IMM5);
+ msa_addvi_d(a, IMM5)
+}
+
+/// Vector Logical And
+///
+/// Each bit of vector `a` (sixteen unsigned 8-bit integer numbers)
+/// is combined with the corresponding bit of vector `b` (sixteen unsigned 8-bit integer numbers)
+/// in a bitwise logical AND operation.
+/// The result is written to vector (sixteen unsigned 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(and.v))]
+pub unsafe fn __msa_and_v(a: v16u8, b: v16u8) -> v16u8 {
+ msa_and_v(a, mem::transmute(b))
+}
+
+/// Immediate Logical And
+///
+/// Each byte element of vector `a` (sixteen unsigned 8-bit integer numbers)
+/// is combined with the 8-bit immediate i8 (signed 8-bit integer number) in a bitwise logical AND operation.
+/// The result is written to vector (sixteen unsigned 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(andi.b, imm8 = 0b10010111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_andi_b<const IMM8: i32>(a: v16u8) -> v16u8 {
+ static_assert_imm8!(IMM8);
+ msa_andi_b(a, IMM8)
+}
+
+/// Vector Absolute Values of Signed Subtract
+///
+/// The signed elements in vector `a` (sixteen signed 8-bit integer numbers)
+/// are subtracted from the signed elements in vector `b` (sixteen signed 8-bit integer numbers).
+/// The absolute value of the signed result is written to vector (sixteen signed 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(asub_s.b))]
+pub unsafe fn __msa_asub_s_b(a: v16i8, b: v16i8) -> v16i8 {
+ msa_asub_s_b(a, mem::transmute(b))
+}
+
+/// Vector Absolute Values of Signed Subtract
+///
+/// The signed elements in vector `a` (eight signed 16-bit integer numbers)
+/// are subtracted from the signed elements in vector `b` (eight signed 16-bit integer numbers).
+/// The absolute value of the signed result is written to vector (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(asub_s.h))]
+pub unsafe fn __msa_asub_s_h(a: v8i16, b: v8i16) -> v8i16 {
+ msa_asub_s_h(a, mem::transmute(b))
+}
+
+/// Vector Absolute Values of Signed Subtract
+///
+/// The signed elements in vector `a` (four signed 32-bit integer numbers)
+/// are subtracted from the signed elements in vector `b` (four signed 32-bit integer numbers).
+/// The absolute value of the signed result is written to vector (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(asub_s.w))]
+pub unsafe fn __msa_asub_s_w(a: v4i32, b: v4i32) -> v4i32 {
+ msa_asub_s_w(a, mem::transmute(b))
+}
+
+/// Vector Absolute Values of Signed Subtract
+///
+/// The signed elements in vector `a` (two signed 64-bit integer numbers)
+/// are subtracted from the signed elements in vector `b` (two signed 64-bit integer numbers).
+/// The absolute value of the signed result is written to vector (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(asub_s.d))]
+pub unsafe fn __msa_asub_s_d(a: v2i64, b: v2i64) -> v2i64 {
+ msa_asub_s_d(a, mem::transmute(b))
+}
+
+/// Vector Absolute Values of Unsigned Subtract
+///
+/// The unsigned elements in vector `a` (sixteen unsigned 8-bit integer numbers)
+/// are subtracted from the unsigned elements in vector `b` (sixteen unsigned 8-bit integer numbers).
+/// The absolute value of the unsigned result is written to vector (sixteen unsigned 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(asub_u.b))]
+pub unsafe fn __msa_asub_u_b(a: v16u8, b: v16u8) -> v16u8 {
+ msa_asub_u_b(a, mem::transmute(b))
+}
+
+/// Vector Absolute Values of Unsigned Subtract
+///
+/// The unsigned elements in vector `a` (eight unsigned 16-bit integer numbers)
+/// are subtracted from the unsigned elements in vector `b` (eight unsigned 16-bit integer numbers).
+/// The absolute value of the unsigned result is written to vector (eight unsigned 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(asub_u.h))]
+pub unsafe fn __msa_asub_u_h(a: v8u16, b: v8u16) -> v8u16 {
+ msa_asub_u_h(a, mem::transmute(b))
+}
+
+/// Vector Absolute Values of Unsigned Subtract
+///
+/// The unsigned elements in vector `a` (four unsigned 32-bit integer numbers)
+/// are subtracted from the unsigned elements in vector `b` (four unsigned 32-bit integer numbers).
+/// The absolute value of the unsigned result is written to vector (four unsigned 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(asub_u.w))]
+pub unsafe fn __msa_asub_u_w(a: v4u32, b: v4u32) -> v4u32 {
+ msa_asub_u_w(a, mem::transmute(b))
+}
+
+/// Vector Absolute Values of Unsigned Subtract
+///
+/// The unsigned elements in vector `a` (two unsigned 64-bit integer numbers)
+/// are subtracted from the unsigned elements in vector `b` (two unsigned 64-bit integer numbers).
+/// The absolute value of the unsigned result is written to vector (two unsigned 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(asub_u.d))]
+pub unsafe fn __msa_asub_u_d(a: v2u64, b: v2u64) -> v2u64 {
+ msa_asub_u_d(a, mem::transmute(b))
+}
+
+/// Vector Signed Average
+///
+/// The elements in vector `a` (sixteen signed 8-bit integer numbers)
+/// are added to the elements in vector `b` (sixteen signed 8-bit integer numbers).
+/// The addition is done signed with full precision, i.e. the result has one extra bit.
+/// Signed division by 2 (or arithmetic shift right by one bit) is performed before
+/// writing the result to vector (sixteen signed 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ave_s.b))]
+pub unsafe fn __msa_ave_s_b(a: v16i8, b: v16i8) -> v16i8 {
+ msa_ave_s_b(a, mem::transmute(b))
+}
+
+/// Vector Signed Average
+///
+/// The elements in vector `a` (eight signed 16-bit integer numbers)
+/// are added to the elements in vector `b` (eight signed 16-bit integer numbers).
+/// The addition is done signed with full precision, i.e. the result has one extra bit.
+/// Signed division by 2 (or arithmetic shift right by one bit) is performed before
+/// writing the result to vector (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ave_s.h))]
+pub unsafe fn __msa_ave_s_h(a: v8i16, b: v8i16) -> v8i16 {
+ msa_ave_s_h(a, mem::transmute(b))
+}
+
+/// Vector Signed Average
+///
+/// The elements in vector `a` (four signed 32-bit integer numbers)
+/// are added to the elements in vector `b` (four signed 32-bit integer numbers).
+/// The addition is done signed with full precision, i.e. the result has one extra bit.
+/// Signed division by 2 (or arithmetic shift right by one bit) is performed before
+/// writing the result to vector (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ave_s.w))]
+pub unsafe fn __msa_ave_s_w(a: v4i32, b: v4i32) -> v4i32 {
+ msa_ave_s_w(a, mem::transmute(b))
+}
+
+/// Vector Signed Average
+///
+/// The elements in vector `a` (two signed 64-bit integer numbers)
+/// are added to the elements in vector `b` (two signed 64-bit integer numbers).
+/// The addition is done signed with full precision, i.e. the result has one extra bit.
+/// Signed division by 2 (or arithmetic shift right by one bit) is performed before
+/// writing the result to vector (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ave_s.d))]
+pub unsafe fn __msa_ave_s_d(a: v2i64, b: v2i64) -> v2i64 {
+ msa_ave_s_d(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Average
+///
+/// The elements in vector `a` (sixteen unsigned 8-bit integer numbers)
+/// are added to the elements in vector `b` (sixteen unsigned 8-bit integer numbers).
+/// The addition is done unsigned with full precision, i.e. the result has one extra bit.
+/// Unsigned division by 2 (or logical shift right by one bit) is performed before
+/// writing the result to vector (sixteen unsigned 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ave_u.b))]
+pub unsafe fn __msa_ave_u_b(a: v16u8, b: v16u8) -> v16u8 {
+ msa_ave_u_b(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Average
+///
+/// The elements in vector `a` (eight unsigned 16-bit integer numbers)
+/// are added to the elements in vector `b` (eight unsigned 16-bit integer numbers).
+/// The addition is done unsigned with full precision, i.e. the result has one extra bit.
+/// Unsigned division by 2 (or logical shift right by one bit) is performed before
+/// writing the result to vector (eight unsigned 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ave_u.h))]
+pub unsafe fn __msa_ave_u_h(a: v8u16, b: v8u16) -> v8u16 {
+ msa_ave_u_h(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Average
+///
+/// The elements in vector `a` (four unsigned 32-bit integer numbers)
+/// are added to the elements in vector `b` (four unsigned 32-bit integer numbers).
+/// The addition is done unsigned with full precision, i.e. the result has one extra bit.
+/// Unsigned division by 2 (or logical shift right by one bit) is performed before
+/// writing the result to vector (four unsigned 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ave_u.w))]
+pub unsafe fn __msa_ave_u_w(a: v4u32, b: v4u32) -> v4u32 {
+ msa_ave_u_w(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Average
+///
+/// The elements in vector `a` (two unsigned 64-bit integer numbers)
+/// are added to the elements in vector `b` (two unsigned 64-bit integer numbers).
+/// The addition is done unsigned with full precision, i.e. the result has one extra bit.
+/// Unsigned division by 2 (or logical shift right by one bit) is performed before
+/// writing the result to vector (two unsigned 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ave_u.d))]
+pub unsafe fn __msa_ave_u_d(a: v2u64, b: v2u64) -> v2u64 {
+ msa_ave_u_d(a, mem::transmute(b))
+}
+
+/// Vector Signed Average Rounded
+///
+/// The elements in vector `a` (sixteen signed 8-bit integer numbers)
+/// are added to the elements in vector `b` (sixteen signed 8-bit integer numbers).
+/// The addition of the elements plus 1 (for rounding) is done signed with full precision,
+/// i.e. the result has one extra bit.
+/// Signed division by 2 (or arithmetic shift right by one bit) is performed before
+/// writing the result to vector (sixteen signed 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(aver_s.b))]
+pub unsafe fn __msa_aver_s_b(a: v16i8, b: v16i8) -> v16i8 {
+ msa_aver_s_b(a, mem::transmute(b))
+}
+
+/// Vector Signed Average Rounded
+///
+/// The elements in vector `a` (eight signed 16-bit integer numbers)
+/// are added to the elements in vector `b` (eight signed 16-bit integer numbers).
+/// The addition of the elements plus 1 (for rounding) is done signed with full precision,
+/// i.e. the result has one extra bit.
+/// Signed division by 2 (or arithmetic shift right by one bit) is performed before
+/// writing the result to vector (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(aver_s.h))]
+pub unsafe fn __msa_aver_s_h(a: v8i16, b: v8i16) -> v8i16 {
+ msa_aver_s_h(a, mem::transmute(b))
+}
+
+/// Vector Signed Average Rounded
+///
+/// The elements in vector `a` (four signed 32-bit integer numbers)
+/// are added to the elements in vector `b` (four signed 32-bit integer numbers).
+/// The addition of the elements plus 1 (for rounding) is done signed with full precision,
+/// i.e. the result has one extra bit.
+/// Signed division by 2 (or arithmetic shift right by one bit) is performed before
+/// writing the result to vector (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(aver_s.w))]
+pub unsafe fn __msa_aver_s_w(a: v4i32, b: v4i32) -> v4i32 {
+ msa_aver_s_w(a, mem::transmute(b))
+}
+
+/// Vector Signed Average Rounded
+///
+/// The elements in vector `a` (two signed 64-bit integer numbers)
+/// are added to the elements in vector `b` (two signed 64-bit integer numbers).
+/// The addition of the elements plus 1 (for rounding) is done signed with full precision,
+/// i.e. the result has one extra bit.
+/// Signed division by 2 (or arithmetic shift right by one bit) is performed before
+/// writing the result to vector (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(aver_s.d))]
+pub unsafe fn __msa_aver_s_d(a: v2i64, b: v2i64) -> v2i64 {
+ msa_aver_s_d(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Average Rounded
+///
+/// The elements in vector `a` (sixteen unsigned 8-bit integer numbers)
+/// are added to the elements in vector `b` (sixteen unsigned 8-bit integer numbers).
+/// The addition of the elements plus 1 (for rounding) is done unsigned with full precision,
+/// i.e. the result has one extra bit.
+/// Unsigned division by 2 (or logical shift right by one bit) is performed before
+/// writing the result to vector (sixteen unsigned 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(aver_u.b))]
+pub unsafe fn __msa_aver_u_b(a: v16u8, b: v16u8) -> v16u8 {
+ msa_aver_u_b(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Average Rounded
+///
+/// The elements in vector `a` (eight unsigned 16-bit integer numbers)
+/// are added to the elements in vector `b` (eight unsigned 16-bit integer numbers).
+/// The addition of the elements plus 1 (for rounding) is done unsigned with full precision,
+/// i.e. the result has one extra bit.
+/// Unsigned division by 2 (or logical shift right by one bit) is performed before
+/// writing the result to vector (eight unsigned 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(aver_u.h))]
+pub unsafe fn __msa_aver_u_h(a: v8u16, b: v8u16) -> v8u16 {
+ msa_aver_u_h(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Average Rounded
+///
+/// The elements in vector `a` (four unsigned 32-bit integer numbers)
+/// are added to the elements in vector `b` (four unsigned 32-bit integer numbers).
+/// The addition of the elements plus 1 (for rounding) is done unsigned with full precision,
+/// i.e. the result has one extra bit.
+/// Unsigned division by 2 (or logical shift right by one bit) is performed before
+/// writing the result to vector (four unsigned 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(aver_u.w))]
+pub unsafe fn __msa_aver_u_w(a: v4u32, b: v4u32) -> v4u32 {
+ msa_aver_u_w(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Average Rounded
+///
+/// The elements in vector `a` (two unsigned 64-bit integer numbers)
+/// are added to the elements in vector `b` (two unsigned 64-bit integer numbers).
+/// The addition of the elements plus 1 (for rounding) is done unsigned with full precision,
+/// i.e. the result has one extra bit.
+/// Unsigned division by 2 (or logical shift right by one bit) is performed before
+/// writing the result to vector (two unsigned 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(aver_u.d))]
+pub unsafe fn __msa_aver_u_d(a: v2u64, b: v2u64) -> v2u64 {
+ msa_aver_u_d(a, mem::transmute(b))
+}
+
+/// Vector Bit Clear
+///
+/// Clear (set to 0) one bit in each element of vector `a` (sixteen unsigned 8-bit integer numbers).
+/// The bit position is given by the elements in `b` (sixteen unsigned 8-bit integer numbers)
+/// modulo the size of the element in bits.
+/// The result is written to vector (sixteen unsigned 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(bclr.b))]
+pub unsafe fn __msa_bclr_b(a: v16u8, b: v16u8) -> v16u8 {
+ msa_bclr_b(a, mem::transmute(b))
+}
+
+/// Vector Bit Clear
+///
+/// Clear (set to 0) one bit in each element of vector `a` (eight unsigned 16-bit integer numbers).
+/// The bit position is given by the elements in `b` (eight unsigned 16-bit integer numbers)
+/// modulo the size of the element in bits.
+/// The result is written to vector (eight unsigned 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(bclr.h))]
+pub unsafe fn __msa_bclr_h(a: v8u16, b: v8u16) -> v8u16 {
+ msa_bclr_h(a, mem::transmute(b))
+}
+
+/// Vector Bit Clear
+///
+/// Clear (set to 0) one bit in each element of vector `a` (four unsigned 32-bit integer numbers).
+/// The bit position is given by the elements in `b` (four unsigned 32-bit integer numbers)
+/// modulo the size of the element in bits.
+/// The result is written to vector (four unsigned 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(bclr.w))]
+pub unsafe fn __msa_bclr_w(a: v4u32, b: v4u32) -> v4u32 {
+ msa_bclr_w(a, mem::transmute(b))
+}
+
+/// Vector Bit Clear
+///
+/// Clear (set to 0) one bit in each element of vector `a` (two unsigned 64-bit integer numbers).
+/// The bit position is given by the elements in `b` (two unsigned 64-bit integer numbers)
+/// modulo the size of the element in bits.
+/// The result is written to vector (two unsigned 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(bclr.d))]
+pub unsafe fn __msa_bclr_d(a: v2u64, b: v2u64) -> v2u64 {
+ msa_bclr_d(a, mem::transmute(b))
+}
+
+/// Immediate Bit Clear
+///
+/// Clear (set to 0) one bit in each element of vector `a` (sixteen unsigned 8-bit integer numbers).
+/// The bit position is given by the immediate `m` modulo the size of the element in bits.
+/// The result is written to vector (sixteen unsigned 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(bclri.b, imm3 = 0b111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_bclri_b<const IMM3: i32>(a: v16u8) -> v16u8 {
+ static_assert_imm3!(IMM3);
+ msa_bclri_b(a, IMM3)
+}
+
+/// Immediate Bit Clear
+///
+/// Clear (set to 0) one bit in each element of vector `a` (eight unsigned 16-bit integer numbers).
+/// The bit position is given by the immediate `m` modulo the size of the element in bits.
+/// The result is written to vector (eight unsigned 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(bclri.h, imm4 = 0b1111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_bclri_h<const IMM4: i32>(a: v8u16) -> v8u16 {
+ static_assert_imm4!(IMM4);
+ msa_bclri_h(a, IMM4)
+}
+
+/// Immediate Bit Clear
+///
+/// Clear (set to 0) one bit in each element of vector `a` (four unsigned 32-bit integer numbers).
+/// The bit position is given by the immediate `m` modulo the size of the element in bits.
+/// The result is written to vector (four unsigned 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(bclri.w, imm5 = 0b11111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_bclri_w<const IMM5: i32>(a: v4u32) -> v4u32 {
+ static_assert_imm5!(IMM5);
+ msa_bclri_w(a, IMM5)
+}
+
+/// Immediate Bit Clear
+///
+/// Clear (set to 0) one bit in each element of vector `a` (two unsigned 64-bit integer numbers).
+/// The bit position is given by the immediate `m` modulo the size of the element in bits.
+/// The result is written to vector (two unsigned 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(bclri.d, imm6 = 0b111111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_bclri_d<const IMM6: i32>(a: v2u64) -> v2u64 {
+ static_assert_imm6!(IMM6);
+ msa_bclri_d(a, IMM6)
+}
+
+/// Vector Bit Insert Left
+///
+/// Copy most significant (left) bits in each element of vector `b` (sixteen unsigned 8-bit integer numbers)
+/// to elements in vector `a` (sixteen unsigned 8-bit integer numbers) while preserving the least significant (right) bits.
+/// The number of bits to copy is given by the elements in vector `c` (sixteen unsigned 8-bit integer numbers)
+/// modulo the size of the element in bits plus 1.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(binsl.b))]
+pub unsafe fn __msa_binsl_b(a: v16u8, b: v16u8, c: v16u8) -> v16u8 {
+ msa_binsl_b(a, mem::transmute(b), c)
+}
+
+/// Vector Bit Insert Left
+///
+/// Copy most significant (left) bits in each element of vector `b` (eight unsigned 16-bit integer numbers)
+/// to elements in vector `a` (eight unsigned 16-bit integer numbers) while preserving the least significant (right) bits.
+/// The number of bits to copy is given by the elements in vector `c` (eight unsigned 16-bit integer numbers)
+/// modulo the size of the element in bits plus 1.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(binsl.h))]
+pub unsafe fn __msa_binsl_h(a: v8u16, b: v8u16, c: v8u16) -> v8u16 {
+ msa_binsl_h(a, mem::transmute(b), c)
+}
+
+/// Vector Bit Insert Left
+///
+/// Copy most significant (left) bits in each element of vector `b` (four unsigned 32-bit integer numbers)
+/// to elements in vector `a` (four unsigned 32-bit integer numbers) while preserving the least significant (right) bits.
+/// The number of bits to copy is given by the elements in vector `c` (four unsigned 32-bit integer numbers)
+/// modulo the size of the element in bits plus 1.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(binsl.w))]
+pub unsafe fn __msa_binsl_w(a: v4u32, b: v4u32, c: v4u32) -> v4u32 {
+ msa_binsl_w(a, mem::transmute(b), c)
+}
+
+/// Vector Bit Insert Left
+///
+/// Copy most significant (left) bits in each element of vector `b` (two unsigned 64-bit integer numbers)
+/// to elements in vector `a` (two unsigned 64-bit integer numbers) while preserving the least significant (right) bits.
+/// The number of bits to copy is given by the elements in vector `c` (two unsigned 64-bit integer numbers)
+/// modulo the size of the element in bits plus 1.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(binsl.d))]
+pub unsafe fn __msa_binsl_d(a: v2u64, b: v2u64, c: v2u64) -> v2u64 {
+ msa_binsl_d(a, mem::transmute(b), c)
+}
+
+/// Immediate Bit Insert Left
+///
+/// Copy most significant (left) bits in each element of vector `b` (sixteen unsigned 8-bit integer numbers)
+/// to elements in vector `a` (sixteen unsigned 8-bit integer numbers) while preserving the least significant (right) bits.
+/// The number of bits to copy is given by the immediate `imm3` modulo the size of the element in bits plus 1.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(binsli.b, imm3 = 0b111))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn __msa_binsli_b<const IMM3: i32>(a: v16u8, b: v16u8) -> v16u8 {
+ static_assert_imm3!(IMM3);
+ msa_binsli_b(a, mem::transmute(b), IMM3)
+}
+
+/// Immediate Bit Insert Left
+///
+/// Copy most significant (left) bits in each element of vector `b` (eight unsigned 16-bit integer numbers)
+/// to elements in vector `a` (eight unsigned 16-bit integer numbers) while preserving the least significant (right) bits.
+/// The number of bits to copy is given by the immediate `imm4` modulo the size of the element in bits plus 1.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(binsli.h, imm4 = 0b1111))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn __msa_binsli_h<const IMM4: i32>(a: v8u16, b: v8u16) -> v8u16 {
+ static_assert_imm4!(IMM4);
+ msa_binsli_h(a, mem::transmute(b), IMM4)
+}
+
+/// Immediate Bit Insert Left
+///
+/// Copy most significant (left) bits in each element of vector `b` (four unsigned 32-bit integer numbers)
+/// to elements in vector `a` (four unsigned 32-bit integer numbers) while preserving the least significant (right) bits.
+/// The number of bits to copy is given by the immediate `imm5` modulo the size of the element in bits plus 1.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(binsli.w, imm5 = 0b11111))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn __msa_binsli_w<const IMM5: i32>(a: v4u32, b: v4u32) -> v4u32 {
+ static_assert_imm5!(IMM5);
+ msa_binsli_w(a, mem::transmute(b), IMM5)
+}
+
+/// Immediate Bit Insert Left
+///
+/// Copy most significant (left) bits in each element of vector `b` (two unsigned 64-bit integer numbers)
+/// to elements in vector `a` (two unsigned 64-bit integer numbers) while preserving the least significant (right) bits.
+/// The number of bits to copy is given by the immediate `imm6` modulo the size of the element in bits plus 1.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(binsli.d, imm6 = 0b111111))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn __msa_binsli_d<const IMM6: i32>(a: v2u64, b: v2u64) -> v2u64 {
+ static_assert_imm6!(IMM6);
+ msa_binsli_d(a, mem::transmute(b), IMM6)
+}
+
+/// Vector Bit Insert Right
+///
+/// Copy most significant (right) bits in each element of vector `b` (sixteen unsigned 8-bit integer numbers)
+/// to elements in vector `a` (sixteen unsigned 8-bit integer numbers) while preserving the least significant (left) bits.
+/// The number of bits to copy is given by the elements in vector `c` (sixteen unsigned 8-bit integer numbers)
+/// modulo the size of the element in bits plus 1.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(binsr.b))]
+pub unsafe fn __msa_binsr_b(a: v16u8, b: v16u8, c: v16u8) -> v16u8 {
+ msa_binsr_b(a, mem::transmute(b), c)
+}
+
+/// Vector Bit Insert Right
+///
+/// Copy most significant (right) bits in each element of vector `b` (eight unsigned 16-bit integer numbers)
+/// to elements in vector `a` (eight unsigned 16-bit integer numbers) while preserving the least significant (left) bits.
+/// The number of bits to copy is given by the elements in vector `c` (eight unsigned 16-bit integer numbers)
+/// modulo the size of the element in bits plus 1.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(binsr.h))]
+pub unsafe fn __msa_binsr_h(a: v8u16, b: v8u16, c: v8u16) -> v8u16 {
+ msa_binsr_h(a, mem::transmute(b), c)
+}
+
+/// Vector Bit Insert Right
+///
+/// Copy most significant (right) bits in each element of vector `b` (four unsigned 32-bit integer numbers)
+/// to elements in vector `a` (four unsigned 32-bit integer numbers) while preserving the least significant (left) bits.
+/// The number of bits to copy is given by the elements in vector `c` (four unsigned 32-bit integer numbers)
+/// modulo the size of the element in bits plus 1.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(binsr.w))]
+pub unsafe fn __msa_binsr_w(a: v4u32, b: v4u32, c: v4u32) -> v4u32 {
+ msa_binsr_w(a, mem::transmute(b), c)
+}
+
+/// Vector Bit Insert Right
+///
+/// Copy most significant (right) bits in each element of vector `b` (two unsigned 64-bit integer numbers)
+/// to elements in vector `a` (two unsigned 64-bit integer numbers) while preserving the least significant (left) bits.
+/// The number of bits to copy is given by the elements in vector `c` (two unsigned 64-bit integer numbers)
+/// modulo the size of the element in bits plus 1.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(binsr.d))]
+pub unsafe fn __msa_binsr_d(a: v2u64, b: v2u64, c: v2u64) -> v2u64 {
+ msa_binsr_d(a, mem::transmute(b), c)
+}
+
+/// Immediate Bit Insert Right
+///
+/// Copy most significant (right) bits in each element of vector `b` (sixteen unsigned 8-bit integer numbers)
+/// to elements in vector `a` (sixteen unsigned 8-bit integer numbers) while preserving the least significant (left) bits.
+/// The number of bits to copy is given by the immediate `imm3` modulo the size of the element in bits plus 1.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(binsri.b, imm3 = 0b111))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn __msa_binsri_b<const IMM3: i32>(a: v16u8, b: v16u8) -> v16u8 {
+ static_assert_imm3!(IMM3);
+ msa_binsri_b(a, mem::transmute(b), IMM3)
+}
+
+/// Immediate Bit Insert Right
+///
+/// Copy most significant (right) bits in each element of vector `b` (eight unsigned 16-bit integer numbers)
+/// to elements in vector `a` (eight unsigned 16-bit integer numbers) while preserving the least significant (left) bits.
+/// The number of bits to copy is given by the immediate `imm4` modulo the size of the element in bits plus 1.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(binsri.h, imm4 = 0b1111))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn __msa_binsri_h<const IMM4: i32>(a: v8u16, b: v8u16) -> v8u16 {
+ static_assert_imm4!(IMM4);
+ msa_binsri_h(a, mem::transmute(b), IMM4)
+}
+
+/// Immediate Bit Insert Right
+///
+/// Copy most significant (right) bits in each element of vector `b` (four unsigned 32-bit integer numbers)
+/// to elements in vector `a` (four unsigned 32-bit integer numbers) while preserving the least significant (left) bits.
+/// The number of bits to copy is given by the immediate `imm5` modulo the size of the element in bits plus 1.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(binsri.w, imm5 = 0b11111))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn __msa_binsri_w<const IMM5: i32>(a: v4u32, b: v4u32) -> v4u32 {
+ static_assert_imm5!(IMM5);
+ msa_binsri_w(a, mem::transmute(b), IMM5)
+}
+
+/// Immediate Bit Insert Right
+///
+/// Copy most significant (right) bits in each element of vector `b` (two unsigned 64-bit integer numbers)
+/// to elements in vector `a` (two unsigned 64-bit integer numbers) while preserving the least significant (left) bits.
+/// The number of bits to copy is given by the immediate `imm6` modulo the size of the element in bits plus 1.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(binsri.d, imm6 = 0b111111))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn __msa_binsri_d<const IMM6: i32>(a: v2u64, b: v2u64) -> v2u64 {
+ static_assert_imm6!(IMM6);
+ msa_binsri_d(a, mem::transmute(b), IMM6)
+}
+
+/// Vector Bit Move If Not Zero
+///
+/// Copy to destination vector `a` (sixteen unsigned 8-bit integer numbers) all bits from source vector
+/// `b` (sixteen unsigned 8-bit integer numbers) for which the corresponding bits from target vector `c`
+/// (sixteen unsigned 8-bit integer numbers) are 1 and leaves unchanged all destination bits
+/// for which the corresponding target bits are 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(bmnz.v))]
+pub unsafe fn __msa_bmnz_v(a: v16u8, b: v16u8, c: v16u8) -> v16u8 {
+ msa_bmnz_v(a, mem::transmute(b), c)
+}
+
+/// Immediate Bit Move If Not Zero
+///
+/// Copy to destination vector `a` (sixteen unsigned 8-bit integer numbers) all bits from source vector
+/// `b` (sixteen unsigned 8-bit integer numbers) for which the corresponding bits from from immediate `imm8`
+/// are 1 and leaves unchanged all destination bits for which the corresponding target bits are 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(bmnzi.b, imm8 = 0b11111111))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn __msa_bmnzi_b<const IMM8: i32>(a: v16u8, b: v16u8) -> v16u8 {
+ static_assert_imm8!(IMM8);
+ msa_bmnzi_b(a, mem::transmute(b), IMM8)
+}
+
+/// Vector Bit Move If Zero
+///
+/// Copy to destination vector `a` (sixteen unsigned 8-bit integer numbers) all bits from source vector
+/// `b` (sixteen unsigned 8-bit integer numbers) for which the corresponding bits from target vector `c`
+/// (sixteen unsigned 8-bit integer numbers) are 0 and leaves unchanged all destination bits
+/// for which the corresponding target bits are 1.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(bmz.v))]
+pub unsafe fn __msa_bmz_v(a: v16u8, b: v16u8, c: v16u8) -> v16u8 {
+ msa_bmz_v(a, mem::transmute(b), c)
+}
+
+/// Immediate Bit Move If Zero
+///
+/// Copy to destination vector `a` (sixteen unsigned 8-bit integer numbers) all bits from source vector
+/// `b` (sixteen unsigned 8-bit integer numbers) for which the corresponding bits from from immediate `imm8`
+/// are 0 and leaves unchanged all destination bits for which the corresponding immediate bits are 1.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(bmzi.b, imm8 = 0b11111111))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn __msa_bmzi_b<const IMM8: i32>(a: v16u8, b: v16u8) -> v16u8 {
+ static_assert_imm8!(IMM8);
+ msa_bmzi_b(a, mem::transmute(b), IMM8)
+}
+
+/// Vector Bit Negate
+///
+/// Negate (complement) one bit in each element of vector `a` (sixteen unsigned 8-bit integer numbers).
+/// The bit position is given by the elements in vector `b` (sixteen unsigned 8-bit integer numbers)
+/// modulo the size of the element in bits.
+/// The result is written to vector (sixteen unsigned 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(bneg.b))]
+pub unsafe fn __msa_bneg_b(a: v16u8, b: v16u8) -> v16u8 {
+ msa_bneg_b(a, mem::transmute(b))
+}
+
+/// Vector Bit Negate
+///
+/// Negate (complement) one bit in each element of vector `a` (eight unsigned 16-bit integer numbers).
+/// The bit position is given by the elements in vector `b` (eight unsigned 16-bit integer numbers)
+/// modulo the size of the element in bits.
+/// The result is written to vector (eight unsigned 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(bneg.h))]
+pub unsafe fn __msa_bneg_h(a: v8u16, b: v8u16) -> v8u16 {
+ msa_bneg_h(a, mem::transmute(b))
+}
+
+/// Vector Bit Negate
+///
+/// Negate (complement) one bit in each element of vector `a` (four unsigned 32-bit integer numbers).
+/// The bit position is given by the elements in vector `b` (four unsigned 32-bit integer numbers)
+/// modulo the size of the element in bits.
+/// The result is written to vector (four unsigned 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(bneg.w))]
+pub unsafe fn __msa_bneg_w(a: v4u32, b: v4u32) -> v4u32 {
+ msa_bneg_w(a, mem::transmute(b))
+}
+
+/// Vector Bit Negate
+///
+/// Negate (complement) one bit in each element of vector `a` (two unsigned 64-bit integer numbers).
+/// The bit position is given by the elements in vector `b` (two unsigned 64-bit integer numbers)
+/// modulo the size of the element in bits.
+/// The result is written to vector (two unsigned 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(bneg.d))]
+pub unsafe fn __msa_bneg_d(a: v2u64, b: v2u64) -> v2u64 {
+ msa_bneg_d(a, mem::transmute(b))
+}
+
+/// Immediate Bit Negate
+///
+/// Negate (complement) one bit in each element of vector `a` (sixteen unsigned 8-bit integer numbers).
+/// The bit position is given by immediate `imm3` modulo the size of the element in bits.
+/// The result is written to vector (sixteen unsigned 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(bnegi.b, imm3 = 0b111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_bnegi_b<const IMM3: i32>(a: v16u8) -> v16u8 {
+ static_assert_imm3!(IMM3);
+ msa_bnegi_b(a, IMM3)
+}
+
+/// Immediate Bit Negate
+///
+/// Negate (complement) one bit in each element of vector `a` (eight unsigned 16-bit integer numbers).
+/// The bit position is given by immediate `imm4` modulo the size of the element in bits.
+/// The result is written to vector (eight unsigned 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(bnegi.h, imm4 = 0b1111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_bnegi_h<const IMM4: i32>(a: v8u16) -> v8u16 {
+ static_assert_imm4!(IMM4);
+ msa_bnegi_h(a, IMM4)
+}
+
+/// Immediate Bit Negate
+///
+/// Negate (complement) one bit in each element of vector `a` (four unsigned 32-bit integer numbers).
+/// The bit position is given by immediate `imm5` modulo the size of the element in bits.
+/// The result is written to vector (four unsigned 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(bnegi.w, imm5 = 0b11111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_bnegi_w<const IMM5: i32>(a: v4u32) -> v4u32 {
+ static_assert_imm5!(IMM5);
+ msa_bnegi_w(a, IMM5)
+}
+
+/// Immediate Bit Negate
+///
+/// Negate (complement) one bit in each element of vector `a` (two unsigned 64-bit integer numbers).
+/// The bit position is given by immediate `imm6` modulo the size of the element in bits.
+/// The result is written to vector (two unsigned 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(bnegi.d, imm6 = 0b111111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_bnegi_d<const IMM6: i32>(a: v2u64) -> v2u64 {
+ static_assert_imm6!(IMM6);
+ msa_bnegi_d(a, IMM6)
+}
+
+/// Immediate Branch If All Elements Are Not Zero
+///
+/// PC-relative branch if all elements in `a` (sixteen unsigned 8-bit integer numbers) are not zero.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(bnz.b))]
+pub unsafe fn __msa_bnz_b(a: v16u8) -> i32 {
+ msa_bnz_b(a)
+}
+
+/// Immediate Branch If All Elements Are Not Zero
+///
+/// PC-relative branch if all elements in `a` (eight unsigned 16-bit integer numbers) are not zero.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(bnz.h))]
+pub unsafe fn __msa_bnz_h(a: v8u16) -> i32 {
+ msa_bnz_h(a)
+}
+
+/// Immediate Branch If All Elements Are Not Zero
+///
+/// PC-relative branch if all elements in `a` (four unsigned 32-bit integer numbers) are not zero.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(bnz.w))]
+pub unsafe fn __msa_bnz_w(a: v4u32) -> i32 {
+ msa_bnz_w(a)
+}
+
+/// Immediate Branch If All Elements Are Not Zero
+///
+/// PC-relative branch if all elements in `a` (two unsigned 64-bit integer numbers) are not zero.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(bnz.d))]
+pub unsafe fn __msa_bnz_d(a: v2u64) -> i32 {
+ msa_bnz_d(a)
+}
+
+/// Immediate Branch If Not Zero (At Least One Element of Any Format Is Not Zero)
+///
+/// PC-relative branch if at least one bit in `a` (four unsigned 32-bit integer numbers) are not zero.
+/// i.e at least one element is not zero regardless of the data format.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(bnz.v))]
+pub unsafe fn __msa_bnz_v(a: v16u8) -> i32 {
+ msa_bnz_v(a)
+}
+
+/// Vector Bit Select
+///
+/// Selectively copy bits from the source vectors `b` (eight unsigned 16-bit integer numbers)
+/// and `c` (eight unsigned 16-bit integer numbers)
+/// into destination vector `a` (eight unsigned 16-bit integer numbers) based on the corresponding bit in `a`:
+/// if 0 copies the bit from `b`, if 1 copies the bit from `c`.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(bsel.v))]
+pub unsafe fn __msa_bsel_v(a: v16u8, b: v16u8, c: v16u8) -> v16u8 {
+ msa_bsel_v(a, mem::transmute(b), c)
+}
+
+/// Immediate Bit Select
+///
+/// Selectively copy bits from the 8-bit immediate `imm8` and `c` (eight unsigned 16-bit integer numbers)
+/// into destination vector `a` (eight unsigned 16-bit integer numbers) based on the corresponding bit in `a`:
+/// if 0 copies the bit from `b`, if 1 copies the bit from `c`.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(bseli.b, imm8 = 0b11111111))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn __msa_bseli_b<const IMM8: i32>(a: v16u8, b: v16u8) -> v16u8 {
+ static_assert_imm8!(IMM8);
+ msa_bseli_b(a, mem::transmute(b), IMM8)
+}
+
+/// Vector Bit Set
+///
+/// Set to 1 one bit in each element of vector `a` (sixteen unsigned 8-bit integer numbers).
+/// The bit position is given by the elements in vector `b` (sixteen unsigned 8-bit integer numbers)
+/// modulo the size of the element in bits.
+/// The result is written to vector (sixteen unsigned 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(bset.b))]
+pub unsafe fn __msa_bset_b(a: v16u8, b: v16u8) -> v16u8 {
+ msa_bset_b(a, mem::transmute(b))
+}
+
+/// Vector Bit Set
+///
+/// Set to 1 one bit in each element of vector `a` (eight unsigned 16-bit integer numbers).
+/// The bit position is given by the elements in vector `b` (eight unsigned 16-bit integer numbers)
+/// modulo the size of the element in bits.
+/// The result is written to vector (eight unsigned 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(bset.h))]
+pub unsafe fn __msa_bset_h(a: v8u16, b: v8u16) -> v8u16 {
+ msa_bset_h(a, mem::transmute(b))
+}
+
+/// Vector Bit Set
+///
+/// Set to 1 one bit in each element of vector `a` (four unsigned 32-bit integer numbers).
+/// The bit position is given by the elements in vector `b` (four unsigned 32-bit integer numbers)
+/// modulo the size of the element in bits.
+/// The result is written to vector (four unsigned 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(bset.w))]
+pub unsafe fn __msa_bset_w(a: v4u32, b: v4u32) -> v4u32 {
+ msa_bset_w(a, mem::transmute(b))
+}
+
+/// Vector Bit Set
+///
+/// Set to 1 one bit in each element of vector `a` (two unsigned 64-bit integer numbers).
+/// The bit position is given by the elements in vector `b` (two unsigned 64-bit integer numbers)
+/// modulo the size of the element in bits.
+/// The result is written to vector (two unsigned 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(bset.d))]
+pub unsafe fn __msa_bset_d(a: v2u64, b: v2u64) -> v2u64 {
+ msa_bset_d(a, mem::transmute(b))
+}
+
+/// Immediate Bit Set
+///
+/// Set to 1 one bit in each element of vector `a` (sixteen unsigned 8-bit integer numbers).
+/// The bit position is given by immediate `imm3`.
+/// The result is written to vector `a` (sixteen unsigned 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(bseti.b, imm3 = 0b111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_bseti_b<const IMM3: i32>(a: v16u8) -> v16u8 {
+ static_assert_imm3!(IMM3);
+ msa_bseti_b(a, IMM3)
+}
+
+/// Immediate Bit Set
+///
+/// Set to 1 one bit in each element of vector `a` (eight unsigned 16-bit integer numbers).
+/// The bit position is given by immediate `imm4`.
+/// The result is written to vector `a` (eight unsigned 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(bseti.h, imm4 = 0b1111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_bseti_h<const IMM4: i32>(a: v8u16) -> v8u16 {
+ static_assert_imm4!(IMM4);
+ msa_bseti_h(a, IMM4)
+}
+
+/// Immediate Bit Set
+///
+/// Set to 1 one bit in each element of vector `a` (four unsigned 32-bit integer numbers).
+/// The bit position is given by immediate `imm5`.
+/// The result is written to vector `a` (four unsigned 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(bseti.w, imm5 = 0b11111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_bseti_w<const IMM5: i32>(a: v4u32) -> v4u32 {
+ static_assert_imm5!(IMM5);
+ msa_bseti_w(a, IMM5)
+}
+
+/// Immediate Bit Set
+///
+/// Set to 1 one bit in each element of vector `a` (two unsigned 64-bit integer numbers).
+/// The bit position is given by immediate `imm6`.
+/// The result is written to vector `a` (two unsigned 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(bseti.d, imm6 = 0b111111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_bseti_d<const IMM6: i32>(a: v2u64) -> v2u64 {
+ static_assert_imm6!(IMM6);
+ msa_bseti_d(a, IMM6)
+}
+
+/// Immediate Branch If At Least One Element Is Zero
+///
+/// PC-relative branch if at least one element in `a` (sixteen unsigned 8-bit integer numbers) is zero.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(bz.b))]
+pub unsafe fn __msa_bz_b(a: v16u8) -> i32 {
+ msa_bz_b(a)
+}
+
+/// Immediate Branch If At Least One Element Is Zero
+///
+/// PC-relative branch if at least one element in `a` (eight unsigned 16-bit integer numbers) is zero.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(bz.h))]
+pub unsafe fn __msa_bz_h(a: v8u16) -> i32 {
+ msa_bz_h(a)
+}
+
+/// Immediate Branch If At Least One Element Is Zero
+///
+/// PC-relative branch if at least one element in `a` (four unsigned 32-bit integer numbers) is zero.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(bz.w))]
+pub unsafe fn __msa_bz_w(a: v4u32) -> i32 {
+ msa_bz_w(a)
+}
+
+/// Immediate Branch If At Least One Element Is Zero
+///
+/// PC-relative branch if at least one element in `a` (two unsigned 64-bit integer numbers) is zero.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(bz.d))]
+pub unsafe fn __msa_bz_d(a: v2u64) -> i32 {
+ msa_bz_d(a)
+}
+
+/// Immediate Branch If Zero (All Elements of Any Format Are Zero)
+///
+/// PC-relative branch if all elements in `a` (sixteen unsigned 8-bit integer numbers) bits are zero,
+/// i.e. all elements are zero regardless of the data format.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(bz.v))]
+pub unsafe fn __msa_bz_v(a: v16u8) -> i32 {
+ msa_bz_v(a)
+}
+
+/// Vector Compare Equal
+///
+/// Set all bits to 1 in vector (sixteen signed 8-bit integer numbers) elements
+/// if the corresponding `a` (sixteen signed 8-bit integer numbers) and `b` (sixteen signed 8-bit integer numbers)
+/// elements are equal, otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ceq.b))]
+pub unsafe fn __msa_ceq_b(a: v16i8, b: v16i8) -> v16i8 {
+ msa_ceq_b(a, mem::transmute(b))
+}
+
+/// Vector Compare Equal
+///
+/// Set all bits to 1 in vector (eight signed 16-bit integer numbers) elements
+/// if the corresponding `a` (eight signed 16-bit integer numbers) and `b` (eight signed 16-bit integer numbers)
+/// elements are equal, otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ceq.h))]
+pub unsafe fn __msa_ceq_h(a: v8i16, b: v8i16) -> v8i16 {
+ msa_ceq_h(a, mem::transmute(b))
+}
+
+/// Vector Compare Equal
+///
+/// Set all bits to 1 in vector (four signed 32-bit integer numbers) elements
+/// if the corresponding `a` (four signed 32-bit integer numbers) and `b` (four signed 32-bit integer numbers)
+/// elements are equal, otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ceq.w))]
+pub unsafe fn __msa_ceq_w(a: v4i32, b: v4i32) -> v4i32 {
+ msa_ceq_w(a, mem::transmute(b))
+}
+
+/// Vector Compare Equal
+///
+/// Set all bits to 1 in vector (two signed 64-bit integer numbers) elements
+/// if the corresponding `a` (two signed 64-bit integer numbers) and `b` (two signed 64-bit integer numbers)
+/// elements are equal, otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ceq.d))]
+pub unsafe fn __msa_ceq_d(a: v2i64, b: v2i64) -> v2i64 {
+ msa_ceq_d(a, mem::transmute(b))
+}
+
+/// Immediate Compare Equal
+///
+/// Set all bits to 1 in vector (sixteen signed 8-bit integer numbers) elements
+/// if the corresponding `a` (sixteen signed 8-bit integer numbers) the 5-bit signed immediate imm_s5
+/// are equal, otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ceqi.b, imm_s5 = 0b11111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_ceqi_b<const IMM_S5: i32>(a: v16i8) -> v16i8 {
+ static_assert_imm_s5!(IMM_S5);
+ msa_ceqi_b(a, IMM_S5)
+}
+
+/// Immediate Compare Equal
+///
+/// Set all bits to 1 in vector (eight signed 16-bit integer numbers) elements
+/// if the corresponding `a` (eight signed 16-bit integer numbers) the 5-bit signed immediate imm_s5
+/// are equal, otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ceqi.h, imm_s5 = 0b11111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_ceqi_h<const IMM_S5: i32>(a: v8i16) -> v8i16 {
+ static_assert_imm_s5!(IMM_S5);
+ msa_ceqi_h(a, IMM_S5)
+}
+
+/// Immediate Compare Equal
+///
+/// Set all bits to 1 in vector (four signed 32-bit integer numbers) elements
+/// if the corresponding `a` (four signed 32-bit integer numbers) the 5-bit signed immediate imm_s5
+/// are equal, otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ceqi.w, imm_s5 = 0b11111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_ceqi_w<const IMM_S5: i32>(a: v4i32) -> v4i32 {
+ static_assert_imm_s5!(IMM_S5);
+ msa_ceqi_w(a, IMM_S5)
+}
+
+/// Immediate Compare Equal
+///
+/// Set all bits to 1 in vector (two signed 64-bit integer numbers) elements
+/// if the corresponding `a` (two signed 64-bit integer numbers) the 5-bit signed immediate imm_s5
+/// are equal, otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ceqi.d, imm_s5 = 0b11111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_ceqi_d<const IMM_S5: i32>(a: v2i64) -> v2i64 {
+ static_assert_imm_s5!(IMM_S5);
+ msa_ceqi_d(a, IMM_S5)
+}
+
+/// GPR Copy from MSA Control Register
+///
+/// The sign extended content of MSA control register cs is copied to GPR rd.
+///
+/// Can not be tested in user mode
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(cfcmsa, imm5 = 0b11111))]
+#[rustc_legacy_const_generics(0)]
+pub unsafe fn __msa_cfcmsa<const IMM5: i32>() -> i32 {
+ static_assert_imm5!(IMM5);
+ msa_cfcmsa(IMM5)
+}
+
+/// Vector Compare Signed Less Than or Equal
+///
+/// Set all bits to 1 in vector (sixteen signed 8-bit integer numbers) elements
+/// if the corresponding `a` (sixteen signed 8-bit integer numbers) element
+/// are signed less than or equal to `b` (sixteen signed 8-bit integer numbers) element.
+/// Otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(cle_s.b))]
+pub unsafe fn __msa_cle_s_b(a: v16i8, b: v16i8) -> v16i8 {
+ msa_cle_s_b(a, mem::transmute(b))
+}
+
+/// Vector Compare Signed Less Than or Equal
+///
+/// Set all bits to 1 in vector (eight signed 16-bit integer numbers) elements
+/// if the corresponding `a` (eight signed 16-bit integer numbers) element
+/// are signed less than or equal to `b` (eight signed 16-bit integer numbers) element.
+/// Otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(cle_s.h))]
+pub unsafe fn __msa_cle_s_h(a: v8i16, b: v8i16) -> v8i16 {
+ msa_cle_s_h(a, mem::transmute(b))
+}
+
+/// Vector Compare Signed Less Than or Equal
+///
+/// Set all bits to 1 in vector (four signed 32-bit integer numbers) elements
+/// if the corresponding `a` (four signed 32-bit integer numbers) element
+/// are signed less than or equal to `b` (four signed 32-bit integer numbers) element.
+/// Otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(cle_s.w))]
+pub unsafe fn __msa_cle_s_w(a: v4i32, b: v4i32) -> v4i32 {
+ msa_cle_s_w(a, mem::transmute(b))
+}
+
+/// Vector Compare Signed Less Than or Equal
+///
+/// Set all bits to 1 in vector (two signed 64-bit integer numbers) elements
+/// if the corresponding `a` (two signed 64-bit integer numbers) element
+/// are signed less than or equal to `b` (two signed 64-bit integer numbers) element.
+/// Otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(cle_s.d))]
+pub unsafe fn __msa_cle_s_d(a: v2i64, b: v2i64) -> v2i64 {
+ msa_cle_s_d(a, mem::transmute(b))
+}
+
+/// Vector Compare Unsigned Less Than or Equal
+///
+/// Set all bits to 1 in vector (sixteen signed 8-bit integer numbers) elements
+/// if the corresponding `a` (sixteen unsigned 8-bit integer numbers) element
+/// are unsigned less than or equal to `b` (sixteen unsigned 8-bit integer numbers) element.
+/// Otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(cle_u.b))]
+pub unsafe fn __msa_cle_u_b(a: v16u8, b: v16u8) -> v16i8 {
+ msa_cle_u_b(a, mem::transmute(b))
+}
+
+/// Vector Compare Unsigned Less Than or Equal
+///
+/// Set all bits to 1 in vector (eight signed 16-bit integer numbers) elements
+/// if the corresponding `a` (eight unsigned 16-bit integer numbers) element
+/// are unsigned less than or equal to `b` (eight unsigned 16-bit integer numbers) element.
+/// Otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(cle_u.h))]
+pub unsafe fn __msa_cle_u_h(a: v8u16, b: v8u16) -> v8i16 {
+ msa_cle_u_h(a, mem::transmute(b))
+}
+
+/// Vector Compare Unsigned Less Than or Equal
+///
+/// Set all bits to 1 in vector (four signed 32-bit integer numbers) elements
+/// if the corresponding `a` (four unsigned 32-bit integer numbers) element
+/// are unsigned less than or equal to `b` (four unsigned 32-bit integer numbers) element.
+/// Otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(cle_u.w))]
+pub unsafe fn __msa_cle_u_w(a: v4u32, b: v4u32) -> v4i32 {
+ msa_cle_u_w(a, mem::transmute(b))
+}
+
+/// Vector Compare Unsigned Less Than or Equal
+///
+/// Set all bits to 1 in vector (two signed 64-bit integer numbers) elements
+/// if the corresponding `a` (two unsigned 64-bit integer numbers) element
+/// are unsigned less than or equal to `b` (two unsigned 64-bit integer numbers) element.
+/// Otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(cle_u.d))]
+pub unsafe fn __msa_cle_u_d(a: v2u64, b: v2u64) -> v2i64 {
+ msa_cle_u_d(a, mem::transmute(b))
+}
+
+/// Immediate Compare Signed Less Than or Equal
+///
+/// Set all bits to 1 in vector (sixteen signed 8-bit integer numbers) elements
+/// if the corresponding `a` (sixteen signed 8-bit integer numbers) element
+/// is less than or equal to the 5-bit signed immediate imm_s5,
+/// otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(clei_s.b, imm_s5 = 0b11111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_clei_s_b<const IMM_S5: i32>(a: v16i8) -> v16i8 {
+ static_assert_imm_s5!(IMM_S5);
+ msa_clei_s_b(a, IMM_S5)
+}
+
+/// Immediate Compare Signed Less Than or Equal
+///
+/// Set all bits to 1 in vector (eight signed 16-bit integer numbers) elements
+/// if the corresponding `a` (eight signed 16-bit integer numbers) element
+/// is less than or equal to the 5-bit signed immediate imm_s5,
+/// otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(clei_s.h, imm_s5 = 0b11111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_clei_s_h<const IMM_S5: i32>(a: v8i16) -> v8i16 {
+ static_assert_imm_s5!(IMM_S5);
+ msa_clei_s_h(a, IMM_S5)
+}
+
+/// Immediate Compare Signed Less Than or Equal
+///
+/// Set all bits to 1 in vector (four signed 32-bit integer numbers) elements
+/// if the corresponding `a` (four signed 32-bit integer numbers) element
+/// is less than or equal to the 5-bit signed immediate imm_s5,
+/// otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(clei_s.w, imm_s5 = 0b11111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_clei_s_w<const IMM_S5: i32>(a: v4i32) -> v4i32 {
+ static_assert_imm_s5!(IMM_S5);
+ msa_clei_s_w(a, IMM_S5)
+}
+
+/// Immediate Compare Signed Less Than or Equal
+///
+/// Set all bits to 1 in vector (two signed 64-bit integer numbers) elements
+/// if the corresponding `a` (two signed 64-bit integer numbers) element
+/// is less than or equal to the 5-bit signed immediate imm_s5,
+/// otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(clei_s.d, imm_s5 = 0b11111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_clei_s_d<const IMM_S5: i32>(a: v2i64) -> v2i64 {
+ static_assert_imm_s5!(IMM_S5);
+ msa_clei_s_d(a, IMM_S5)
+}
+
+/// Immediate Compare Unsigned Less Than or Equal
+///
+/// Set all bits to 1 in vector (sixteen signed 8-bit integer numbers) elements
+/// if the corresponding `a` (sixteen unsigned 8-bit integer numbers) element
+/// is unsigned less than or equal to the 5-bit unsigned immediate `imm5`,
+/// otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(clei_u.b, imm5 = 0b111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_clei_u_b<const IMM5: i32>(a: v16u8) -> v16i8 {
+ static_assert_imm5!(IMM5);
+ msa_clei_u_b(a, IMM5)
+}
+
+/// Immediate Compare Unsigned Less Than or Equal
+///
+/// Set all bits to 1 in vector (eight signed 16-bit integer numbers) elements
+/// if the corresponding `a` (eight unsigned 16-bit integer numbers) element
+/// is unsigned less than or equal to the 5-bit unsigned immediate `imm5`,
+/// otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(clei_u.h, imm5 = 0b11111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_clei_u_h<const IMM5: i32>(a: v8u16) -> v8i16 {
+ static_assert_imm5!(IMM5);
+ msa_clei_u_h(a, IMM5)
+}
+
+/// Immediate Compare Unsigned Less Than or Equal
+///
+/// Set all bits to 1 in vector (four signed 32-bit integer numbers) elements
+/// if the corresponding `a` (four unsigned 32-bit integer numbers) element
+/// is unsigned less than or equal to the 5-bit unsigned immediate `imm5`,
+/// otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(clei_u.w, imm5 = 0b11111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_clei_u_w<const IMM5: i32>(a: v4u32) -> v4i32 {
+ static_assert_imm5!(IMM5);
+ msa_clei_u_w(a, IMM5)
+}
+
+/// Immediate Compare Unsigned Less Than or Equal
+///
+/// Set all bits to 1 in vector (two signed 64-bit integer numbers) elements
+/// if the corresponding `a` (two unsigned 64-bit integer numbers) element
+/// is unsigned less than or equal to the 5-bit unsigned immediate `imm5`,
+/// otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(clei_u.d, imm5 = 0b11111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_clei_u_d<const IMM5: i32>(a: v2u64) -> v2i64 {
+ static_assert_imm5!(IMM5);
+ msa_clei_u_d(a, IMM5)
+}
+
+/// Vector Compare Signed Less Than
+///
+/// Set all bits to 1 in vector (sixteen signed 8-bit integer numbers) elements
+/// if the corresponding `a` (sixteen signed 8-bit integer numbers) element
+/// are signed less than `b` (sixteen signed 8-bit integer numbers) element.
+/// Otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(clt_s.b))]
+pub unsafe fn __msa_clt_s_b(a: v16i8, b: v16i8) -> v16i8 {
+ msa_clt_s_b(a, mem::transmute(b))
+}
+
+/// Vector Compare Signed Less Than
+///
+/// Set all bits to 1 in vector (eight signed 16-bit integer numbers) elements
+/// if the corresponding `a` (eight signed 16-bit integer numbers) element
+/// are signed less than `b` (eight signed 16-bit integer numbers) element.
+/// Otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(clt_s.h))]
+pub unsafe fn __msa_clt_s_h(a: v8i16, b: v8i16) -> v8i16 {
+ msa_clt_s_h(a, mem::transmute(b))
+}
+
+/// Vector Compare Signed Less Than
+///
+/// Set all bits to 1 in vector (four signed 32-bit integer numbers) elements
+/// if the corresponding `a` (four signed 32-bit integer numbers) element
+/// are signed less than `b` (four signed 32-bit integer numbers) element.
+/// Otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(clt_s.w))]
+pub unsafe fn __msa_clt_s_w(a: v4i32, b: v4i32) -> v4i32 {
+ msa_clt_s_w(a, mem::transmute(b))
+}
+
+/// Vector Compare Signed Less Than
+///
+/// Set all bits to 1 in vector (two signed 64-bit integer numbers) elements
+/// if the corresponding `a` (two signed 64-bit integer numbers) element
+/// are signed less than `b` (two signed 64-bit integer numbers) element.
+/// Otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(clt_s.d))]
+pub unsafe fn __msa_clt_s_d(a: v2i64, b: v2i64) -> v2i64 {
+ msa_clt_s_d(a, mem::transmute(b))
+}
+
+/// Vector Compare Unsigned Less Than
+///
+/// Set all bits to 1 in vector (sixteen signed 8-bit integer numbers) elements
+/// if the corresponding `a` (sixteen unsigned 8-bit integer numbers) element
+/// are unsigned less than `b` (sixteen unsigned 8-bit integer numbers) element.
+/// Otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(clt_u.b))]
+pub unsafe fn __msa_clt_u_b(a: v16u8, b: v16u8) -> v16i8 {
+ msa_clt_u_b(a, mem::transmute(b))
+}
+
+/// Vector Compare Unsigned Less Than
+///
+/// Set all bits to 1 in vector (eight signed 16-bit integer numbers) elements
+/// if the corresponding `a` (eight unsigned 16-bit integer numbers) element
+/// are unsigned less than `b` (eight unsigned 16-bit integer numbers) element.
+/// Otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(clt_u.h))]
+pub unsafe fn __msa_clt_u_h(a: v8u16, b: v8u16) -> v8i16 {
+ msa_clt_u_h(a, mem::transmute(b))
+}
+
+/// Vector Compare Unsigned Less Than
+///
+/// Set all bits to 1 in vector (four signed 32-bit integer numbers) elements
+/// if the corresponding `a` (four unsigned 32-bit integer numbers) element
+/// are unsigned less than `b` (four unsigned 32-bit integer numbers) element.
+/// Otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(clt_u.w))]
+pub unsafe fn __msa_clt_u_w(a: v4u32, b: v4u32) -> v4i32 {
+ msa_clt_u_w(a, mem::transmute(b))
+}
+
+/// Vector Compare Unsigned Less Than
+///
+/// Set all bits to 1 in vector (two signed 64-bit integer numbers) elements
+/// if the corresponding `a` (two unsigned 64-bit integer numbers) element
+/// are unsigned less than `b` (two unsigned 64-bit integer numbers) element.
+/// Otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(clt_u.d))]
+pub unsafe fn __msa_clt_u_d(a: v2u64, b: v2u64) -> v2i64 {
+ msa_clt_u_d(a, mem::transmute(b))
+}
+
+/// Immediate Compare Signed Less Than
+///
+/// Set all bits to 1 in vector (sixteen signed 8-bit integer numbers) elements
+/// if the corresponding `a` (sixteen signed 8-bit integer numbers) element
+/// is less than the 5-bit signed immediate imm_s5,
+/// otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(clti_s.b, imm_s5 = 0b111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_clti_s_b<const IMM_S5: i32>(a: v16i8) -> v16i8 {
+ static_assert_imm_s5!(IMM_S5);
+ msa_clti_s_b(a, IMM_S5)
+}
+
+/// Immediate Compare Signed Less Than
+///
+/// Set all bits to 1 in vector (eight signed 16-bit integer numbers) elements
+/// if the corresponding `a` (eight signed 16-bit integer numbers) element
+/// is less than the 5-bit signed immediate imm_s5,
+/// otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(clti_s.h, imm_s5 = 0b11111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_clti_s_h<const IMM_S5: i32>(a: v8i16) -> v8i16 {
+ static_assert_imm_s5!(IMM_S5);
+ msa_clti_s_h(a, IMM_S5)
+}
+
+/// Immediate Compare Signed Less Than
+///
+/// Set all bits to 1 in vector (four signed 32-bit integer numbers) elements
+/// if the corresponding `a` (four signed 32-bit integer numbers) element
+/// is less than the 5-bit signed immediate imm_s5,
+/// otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(clti_s.w, imm_s5 = 0b11111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_clti_s_w<const IMM_S5: i32>(a: v4i32) -> v4i32 {
+ static_assert_imm_s5!(IMM_S5);
+ msa_clti_s_w(a, IMM_S5)
+}
+
+/// Immediate Compare Signed Less Than
+///
+/// Set all bits to 1 in vector (two signed 64-bit integer numbers) elements
+/// if the corresponding `a` (two signed 64-bit integer numbers) element
+/// is less than the 5-bit signed immediate imm_s5,
+/// otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(clti_s.d, imm_s5 = 0b11111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_clti_s_d<const IMM_S5: i32>(a: v2i64) -> v2i64 {
+ static_assert_imm_s5!(IMM_S5);
+ msa_clti_s_d(a, IMM_S5)
+}
+
+/// Immediate Compare Unsigned Less Than
+///
+/// Set all bits to 1 in vector (sixteen signed 8-bit integer numbers) elements
+/// if the corresponding `a` (sixteen unsigned 8-bit integer numbers) element
+/// is unsigned less than the 5-bit unsigned immediate `imm5`,
+/// otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(clti_u.b, imm5 = 0b111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_clti_u_b<const IMM5: i32>(a: v16u8) -> v16i8 {
+ static_assert_imm5!(IMM5);
+ msa_clti_u_b(a, IMM5)
+}
+
+/// Immediate Compare Unsigned Less Than
+///
+/// Set all bits to 1 in vector (eight signed 16-bit integer numbers) elements
+/// if the corresponding `a` (eight unsigned 16-bit integer numbers) element
+/// is unsigned less than the 5-bit unsigned immediate `imm5`,
+/// otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(clti_u.h, imm5 = 0b11111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_clti_u_h<const IMM5: i32>(a: v8u16) -> v8i16 {
+ static_assert_imm5!(IMM5);
+ msa_clti_u_h(a, IMM5)
+}
+
+/// Immediate Compare Unsigned Less Than
+///
+/// Set all bits to 1 in vector (four signed 32-bit integer numbers) elements
+/// if the corresponding `a` (four unsigned 32-bit integer numbers) element
+/// is unsigned less than the 5-bit unsigned immediate `imm5`,
+/// otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(clti_u.w, imm5 = 0b11111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_clti_u_w<const IMM5: i32>(a: v4u32) -> v4i32 {
+ static_assert_imm5!(IMM5);
+ msa_clti_u_w(a, IMM5)
+}
+
+/// Immediate Compare Unsigned Less Than
+///
+/// Set all bits to 1 in vector (two signed 64-bit integer numbers) elements
+/// if the corresponding `a` (two unsigned 64-bit integer numbers) element
+/// is unsigned less than the 5-bit unsigned immediate `imm5`,
+/// otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(clti_u.d, imm5 = 0b11111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_clti_u_d<const IMM5: i32>(a: v2u64) -> v2i64 {
+ static_assert_imm5!(IMM5);
+ msa_clti_u_d(a, IMM5)
+}
+
+/// Element Copy to GPR Signed
+///
+/// Sign-extend element `imm4` of vector `a` (sixteen signed 8-bit integer numbers)
+/// and copy the result to GPR rd.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(copy_s.b, imm4 = 0b1111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_copy_s_b<const IMM4: i32>(a: v16i8) -> i32 {
+ static_assert_imm4!(IMM4);
+ msa_copy_s_b(a, IMM4)
+}
+
+/// Element Copy to GPR Signed
+///
+/// Sign-extend element `imm3` of vector `a` (eight signed 16-bit integer numbers)
+/// and copy the result to GPR rd.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(copy_s.h, imm3 = 0b111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_copy_s_h<const IMM3: i32>(a: v8i16) -> i32 {
+ static_assert_imm3!(IMM3);
+ msa_copy_s_h(a, IMM3)
+}
+
+/// Element Copy to GPR Signed
+///
+/// Sign-extend element `imm2` of vector `a` (four signed 32-bit integer numbers)
+/// and copy the result to GPR rd.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(copy_s.w, imm2 = 0b11))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_copy_s_w<const IMM2: i32>(a: v4i32) -> i32 {
+ static_assert_imm2!(IMM2);
+ msa_copy_s_w(a, IMM2)
+}
+
+/// Element Copy to GPR Signed
+///
+/// Sign-extend element `imm1` of vector `a` (two signed 64-bit integer numbers)
+/// and copy the result to GPR rd.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(copy_s.d, imm1 = 0b1))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_copy_s_d<const IMM1: i32>(a: v2i64) -> i64 {
+ static_assert_imm1!(IMM1);
+ msa_copy_s_d(a, IMM1)
+}
+
+/// Element Copy to GPR Unsigned
+///
+/// Zero-extend element `imm4` of vector `a` (sixteen signed 8-bit integer numbers)
+/// and copy the result to GPR rd.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(copy_u.b, imm4 = 0b1111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_copy_u_b<const IMM4: i32>(a: v16i8) -> u32 {
+ static_assert_imm4!(IMM4);
+ msa_copy_u_b(a, IMM4)
+}
+
+/// Element Copy to GPR Unsigned
+///
+/// Zero-extend element `imm3` of vector `a` (eight signed 16-bit integer numbers)
+/// and copy the result to GPR rd.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(copy_u.h, imm3 = 0b111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_copy_u_h<const IMM3: i32>(a: v8i16) -> u32 {
+ static_assert_imm3!(IMM3);
+ msa_copy_u_h(a, IMM3)
+}
+
+/// Element Copy to GPR Unsigned
+///
+/// Zero-extend element `imm2` of vector `a` (four signed 32-bit integer numbers)
+/// and copy the result to GPR rd.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(copy_u.w, imm2 = 0b11))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_copy_u_w<const IMM2: i32>(a: v4i32) -> u32 {
+ static_assert_imm2!(IMM2);
+ msa_copy_u_w(a, IMM2)
+}
+
+/// Element Copy to GPR Unsigned
+///
+/// Zero-extend element `imm1` of vector `a` (two signed 64-bit integer numbers)
+/// and copy the result to GPR rd.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(copy_u.d, imm1 = 0b1))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_copy_u_d<const IMM1: i32>(a: v2i64) -> u64 {
+ static_assert_imm1!(IMM1);
+ msa_copy_u_d(a, IMM1)
+}
+
+/// GPR Copy to MSA Control Register
+///
+/// The content of the least significant 31 bits of GPR `imm1` is copied to
+/// MSA control register cd.
+///
+/// Can not be tested in user mode
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ctcmsa, imm1 = 0b1))]
+#[rustc_legacy_const_generics(0)]
+pub unsafe fn __msa_ctcmsa<const IMM5: i32>(a: i32) -> () {
+ static_assert_imm5!(IMM5);
+ msa_ctcmsa(IMM5, a)
+}
+
+/// Vector Signed Divide
+///
+/// The signed integer elements in vector `a` (sixteen signed 8-bit integer numbers)
+/// are divided by signed integer elements in vector `b` (sixteen signed 8-bit integer numbers).
+/// The result is written to vector (sixteen signed 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(div_s.b))]
+pub unsafe fn __msa_div_s_b(a: v16i8, b: v16i8) -> v16i8 {
+ msa_div_s_b(a, mem::transmute(b))
+}
+
+/// Vector Signed Divide
+///
+/// The signed integer elements in vector `a` (eight signed 16-bit integer numbers)
+/// are divided by signed integer elements in vector `b` (eight signed 16-bit integer numbers).
+/// The result is written to vector (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(div_s.h))]
+pub unsafe fn __msa_div_s_h(a: v8i16, b: v8i16) -> v8i16 {
+ msa_div_s_h(a, mem::transmute(b))
+}
+
+/// Vector Signed Divide
+///
+/// The signed integer elements in vector `a` (four signed 32-bit integer numbers)
+/// are divided by signed integer elements in vector `b` (four signed 32-bit integer numbers).
+/// The result is written to vector (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(div_s.w))]
+pub unsafe fn __msa_div_s_w(a: v4i32, b: v4i32) -> v4i32 {
+ msa_div_s_w(a, mem::transmute(b))
+}
+
+/// Vector Signed Divide
+///
+/// The signed integer elements in vector `a` (two signed 64-bit integer numbers)
+/// are divided by signed integer elements in vector `b` (two signed 64-bit integer numbers).
+/// The result is written to vector (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(div_s.d))]
+pub unsafe fn __msa_div_s_d(a: v2i64, b: v2i64) -> v2i64 {
+ msa_div_s_d(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Divide
+///
+/// The unsigned integer elements in vector `a` (sixteen unsigned 8-bit integer numbers)
+/// are divided by unsigned integer elements in vector `b` (sixteen unsigned 8-bit integer numbers).
+/// The result is written to vector (sixteen unsigned 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(div_u.b))]
+pub unsafe fn __msa_div_u_b(a: v16u8, b: v16u8) -> v16u8 {
+ msa_div_u_b(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Divide
+///
+/// The unsigned integer elements in vector `a` (eight unsigned 16-bit integer numbers)
+/// are divided by unsigned integer elements in vector `b` (eight unsigned 16-bit integer numbers).
+/// The result is written to vector (eight unsigned 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(div_u.h))]
+pub unsafe fn __msa_div_u_h(a: v8u16, b: v8u16) -> v8u16 {
+ msa_div_u_h(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Divide
+///
+/// The unsigned integer elements in vector `a` (four unsigned 32-bit integer numbers)
+/// are divided by unsigned integer elements in vector `b` (four unsigned 32-bit integer numbers).
+/// The result is written to vector (four unsigned 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(div_u.w))]
+pub unsafe fn __msa_div_u_w(a: v4u32, b: v4u32) -> v4u32 {
+ msa_div_u_w(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Divide
+///
+/// The unsigned integer elements in vector `a` (two unsigned 64-bit integer numbers)
+/// are divided by unsigned integer elements in vector `b` (two unsigned 64-bit integer numbers).
+/// The result is written to vector (two unsigned 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(div_u.d))]
+pub unsafe fn __msa_div_u_d(a: v2u64, b: v2u64) -> v2u64 {
+ msa_div_u_d(a, mem::transmute(b))
+}
+
+/// Vector Signed Dot Product
+///
+/// The signed integer elements in vector `a` (sixteen signed 8-bit integer numbers)
+/// are multiplied by signed integer elements in vector `b` (sixteen signed 8-bit integer numbers)
+/// producing a result the size of the input operands. The multiplication results of
+/// adjacent odd/even elements are added and stored to the destination
+/// vector (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(dotp_s.h))]
+pub unsafe fn __msa_dotp_s_h(a: v16i8, b: v16i8) -> v8i16 {
+ msa_dotp_s_h(a, mem::transmute(b))
+}
+
+/// Vector Signed Dot Product
+///
+/// The signed integer elements in vector `a` (eight signed 16-bit integer numbers)
+/// are multiplied by signed integer elements in vector `b` (eight signed 16-bit integer numbers)
+/// producing a result the size of the input operands. The multiplication results of
+/// adjacent odd/even elements are added and stored to the destination
+/// vector (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(dotp_s.w))]
+pub unsafe fn __msa_dotp_s_w(a: v8i16, b: v8i16) -> v4i32 {
+ msa_dotp_s_w(a, mem::transmute(b))
+}
+
+/// Vector Signed Dot Product
+///
+/// The signed integer elements in vector `a` (four signed 32-bit integer numbers)
+/// are multiplied by signed integer elements in vector `b` (four signed 32-bit integer numbers)
+/// producing a result the size of the input operands. The multiplication results of
+/// adjacent odd/even elements are added and stored to the destination
+/// vector (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(dotp_s.d))]
+pub unsafe fn __msa_dotp_s_d(a: v4i32, b: v4i32) -> v2i64 {
+ msa_dotp_s_d(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Dot Product
+///
+/// The unsigned integer elements in vector `a` (sixteen unsigned 8-bit integer numbers)
+/// are multiplied by unsigned integer elements in vector `b` (sixteen unsigned 8-bit integer numbers)
+/// producing a result the size of the input operands. The multiplication results of
+/// adjacent odd/even elements are added and stored to the destination
+/// vector (eight unsigned 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(dotp_u.h))]
+pub unsafe fn __msa_dotp_u_h(a: v16u8, b: v16u8) -> v8u16 {
+ msa_dotp_u_h(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Dot Product
+///
+/// The unsigned integer elements in vector `a` (eight unsigned 16-bit integer numbers)
+/// are multiplied by unsigned integer elements in vector `b` (eight unsigned 16-bit integer numbers)
+/// producing a result the size of the input operands. The multiplication results of
+/// adjacent odd/even elements are added and stored to the destination
+/// vector (four unsigned 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(dotp_u.w))]
+pub unsafe fn __msa_dotp_u_w(a: v8u16, b: v8u16) -> v4u32 {
+ msa_dotp_u_w(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Dot Product
+///
+/// The unsigned integer elements in vector `a` (four unsigned 32-bit integer numbers)
+/// are multiplied by unsigned integer elements in vector `b` (four unsigned 32-bit integer numbers)
+/// producing a result the size of the input operands. The multiplication results of
+/// adjacent odd/even elements are added and stored to the destination
+/// vector (two unsigned 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(dotp_u.d))]
+pub unsafe fn __msa_dotp_u_d(a: v4u32, b: v4u32) -> v2u64 {
+ msa_dotp_u_d(a, mem::transmute(b))
+}
+
+/// Vector Signed Dot Product and Add
+///
+/// The signed integer elements in vector `b` (sixteen signed 8-bit integer numbers)
+/// are multiplied by signed integer elements in vector `c` (sixteen signed 8-bit integer numbers)
+/// producing a result twice the size of the input operands. The multiplication results
+/// of adjacent odd/even elements are added to the vector `a` (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(dpadd_s.h))]
+pub unsafe fn __msa_dpadd_s_h(a: v8i16, b: v16i8, c: v16i8) -> v8i16 {
+ msa_dpadd_s_h(a, mem::transmute(b), c)
+}
+
+/// Vector Signed Dot Product and Add
+///
+/// The signed integer elements in vector `b` (eight signed 16-bit integer numbers)
+/// are multiplied by signed integer elements in vector `c` (eight signed 16-bit integer numbers)
+/// producing a result twice the size of the input operands. The multiplication results
+/// of adjacent odd/even elements are added to the vector `a` (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(dpadd_s.w))]
+pub unsafe fn __msa_dpadd_s_w(a: v4i32, b: v8i16, c: v8i16) -> v4i32 {
+ msa_dpadd_s_w(a, mem::transmute(b), c)
+}
+
+/// Vector Signed Dot Product and Add
+///
+/// The signed integer elements in vector `b` (four signed 32-bit integer numbers)
+/// are multiplied by signed integer elements in vector `c` (four signed 32-bit integer numbers)
+/// producing a result twice the size of the input operands. The multiplication results
+/// of adjacent odd/even elements are added to the vector `a` (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(dpadd_s.d))]
+pub unsafe fn __msa_dpadd_s_d(a: v2i64, b: v4i32, c: v4i32) -> v2i64 {
+ msa_dpadd_s_d(a, mem::transmute(b), c)
+}
+
+/// Vector Unsigned Dot Product and Add
+///
+/// The unsigned integer elements in vector `b` (sixteen unsigned 8-bit integer numbers)
+/// are multiplied by unsigned integer elements in vector `c` (sixteen unsigned 8-bit integer numbers)
+/// producing a result twice the size of the input operands. The multiplication results
+/// of adjacent odd/even elements are added to the vector `a` (eight unsigned 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(dpadd_u.h))]
+pub unsafe fn __msa_dpadd_u_h(a: v8u16, b: v16u8, c: v16u8) -> v8u16 {
+ msa_dpadd_u_h(a, mem::transmute(b), c)
+}
+
+/// Vector Unsigned Dot Product and Add
+///
+/// The unsigned integer elements in vector `b` (eight unsigned 16-bit integer numbers)
+/// are multiplied by unsigned integer elements in vector `c` (eight unsigned 16-bit integer numbers)
+/// producing a result twice the size of the input operands. The multiplication results
+/// of adjacent odd/even elements are added to the vector `a` (four unsigned 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(dpadd_u.w))]
+pub unsafe fn __msa_dpadd_u_w(a: v4u32, b: v8u16, c: v8u16) -> v4u32 {
+ msa_dpadd_u_w(a, mem::transmute(b), c)
+}
+
+/// Vector Unsigned Dot Product and Add
+///
+/// The unsigned integer elements in vector `b` (four unsigned 32-bit integer numbers)
+/// are multiplied by unsigned integer elements in vector `c` (four unsigned 32-bit integer numbers)
+/// producing a result twice the size of the input operands. The multiplication results
+/// of adjacent odd/even elements are added to the vector `a` (two unsigned 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(dpadd_u.d))]
+pub unsafe fn __msa_dpadd_u_d(a: v2u64, b: v4u32, c: v4u32) -> v2u64 {
+ msa_dpadd_u_d(a, mem::transmute(b), c)
+}
+
+/// Vector Signed Dot Product and Add
+///
+/// The signed integer elements in vector `b` (sixteen signed 8-bit integer numbers)
+/// are multiplied by signed integer elements in vector `c` (sixteen signed 8-bit integer numbers)
+/// producing a result twice the size of the input operands. The multiplication results
+/// of adjacent odd/even elements are subtracted from the integer elements in vector `a`
+/// (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(dpsub_s.h))]
+pub unsafe fn __msa_dpsub_s_h(a: v8i16, b: v16i8, c: v16i8) -> v8i16 {
+ msa_dpsub_s_h(a, mem::transmute(b), c)
+}
+
+/// Vector Signed Dot Product and Add
+///
+/// The signed integer elements in vector `b` (eight signed 16-bit integer numbers)
+/// are multiplied by signed integer elements in vector `c` (eight signed 16-bit integer numbers)
+/// producing a result twice the size of the input operands. The multiplication results
+/// of adjacent odd/even elements are subtracted from the integer elements in vector `a`
+/// (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(dpsub_s.w))]
+pub unsafe fn __msa_dpsub_s_w(a: v4i32, b: v8i16, c: v8i16) -> v4i32 {
+ msa_dpsub_s_w(a, mem::transmute(b), c)
+}
+
+/// Vector Signed Dot Product and Add
+///
+/// The signed integer elements in vector `b` (four signed 32-bit integer numbers)
+/// are multiplied by signed integer elements in vector `c` (four signed 32-bit integer numbers)
+/// producing a result twice the size of the input operands. The multiplication results
+/// of adjacent odd/even elements are subtracted from the integer elements in vector `a`
+/// (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(dpsub_s.d))]
+pub unsafe fn __msa_dpsub_s_d(a: v2i64, b: v4i32, c: v4i32) -> v2i64 {
+ msa_dpsub_s_d(a, mem::transmute(b), c)
+}
+
+/// Vector Unsigned Dot Product and Add
+///
+/// The unsigned integer elements in vector `b` (sixteen unsigned 8-bit integer numbers)
+/// are multiplied by unsigned integer elements in vector `c` (sixteen unsigned 8-bit integer numbers)
+/// producing a result twice the size of the input operands. The multiplication results
+/// of adjacent odd/even elements are subtracted from the integer elements in vector `a`
+/// (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(dpsub_u.h))]
+pub unsafe fn __msa_dpsub_u_h(a: v8i16, b: v16u8, c: v16u8) -> v8i16 {
+ msa_dpsub_u_h(a, mem::transmute(b), c)
+}
+
+/// Vector Unsigned Dot Product and Add
+///
+/// The unsigned integer elements in vector `b` (eight unsigned 16-bit integer numbers)
+/// are multiplied by unsigned integer elements in vector `c` (eight unsigned 16-bit integer numbers)
+/// producing a result twice the size of the input operands. The multiplication results
+/// of adjacent odd/even elements are subtracted from the integer elements in vector `a`
+/// (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(dpsub_u.w))]
+pub unsafe fn __msa_dpsub_u_w(a: v4i32, b: v8u16, c: v8u16) -> v4i32 {
+ msa_dpsub_u_w(a, mem::transmute(b), c)
+}
+
+/// Vector Unsigned Dot Product and Add
+///
+/// The unsigned integer elements in vector `b` (four unsigned 32-bit integer numbers)
+/// are multiplied by unsigned integer elements in vector `c` (four unsigned 32-bit integer numbers)
+/// producing a result twice the size of the input operands. The multiplication results
+/// of adjacent odd/even elements are subtracted from the integer elements in vector `a`
+/// (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(dpsub_u.d))]
+pub unsafe fn __msa_dpsub_u_d(a: v2i64, b: v4u32, c: v4u32) -> v2i64 {
+ msa_dpsub_u_d(a, mem::transmute(b), c)
+}
+
+/// Vector Floating-Point Addition
+///
+/// The floating-point elements in vector `a` (four 32-bit floating point numbers)
+/// are added to the floating-point elements in `bc` (four 32-bit floating point numbers).
+/// The result is written to vector (four 32-bit floating point numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fadd.w))]
+pub unsafe fn __msa_fadd_w(a: v4f32, b: v4f32) -> v4f32 {
+ msa_fadd_w(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Addition
+///
+/// The floating-point elements in vector `a` (two 64-bit floating point numbers)
+/// are added to the floating-point elements in `bc` (two 64-bit floating point numbers).
+/// The result is written to vector (two 64-bit floating point numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fadd.d))]
+pub unsafe fn __msa_fadd_d(a: v2f64, b: v2f64) -> v2f64 {
+ msa_fadd_d(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Quiet Compare Always False
+///
+/// Set all bits to 0 in vector (four signed 32-bit integer numbers).
+/// Signaling NaN elements in `a` (four 32-bit floating point numbers)
+/// or `b` (four 32-bit floating point numbers) signal Invalid Operation exception.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fcaf.w))]
+pub unsafe fn __msa_fcaf_w(a: v4f32, b: v4f32) -> v4i32 {
+ msa_fcaf_w(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Quiet Compare Always False
+///
+/// Set all bits to 0 in vector (two signed 64-bit integer numbers).
+/// Signaling NaN elements in `a` (two 64-bit floating point numbers)
+/// or `b` (two 64-bit floating point numbers) signal Invalid Operation exception.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fcaf.d))]
+pub unsafe fn __msa_fcaf_d(a: v2f64, b: v2f64) -> v2i64 {
+ msa_fcaf_d(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Quiet Compare Equal
+///
+/// Set all bits to 1 in vector (four signed 32-bit integer numbers)
+/// elements if the corresponding in `a` (four 32-bit floating point numbers)
+/// and `b` (four 32-bit floating point numbers) elements are ordered and equal,
+/// otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fceq.w))]
+pub unsafe fn __msa_fceq_w(a: v4f32, b: v4f32) -> v4i32 {
+ msa_fceq_w(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Quiet Compare Equal
+///
+/// Set all bits to 1 in vector (two signed 64-bit integer numbers)
+/// elements if the corresponding in `a` (two 64-bit floating point numbers)
+/// and `b` (two 64-bit floating point numbers) elements are ordered and equal,
+/// otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fceq.d))]
+pub unsafe fn __msa_fceq_d(a: v2f64, b: v2f64) -> v2i64 {
+ msa_fceq_d(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Class Mask
+///
+/// Store in each element of vector (four signed 32-bit integer numbers)
+/// a bit mask reflecting the floating-point class of the corresponding element of vector
+/// `a` (four 32-bit floating point numbers).
+/// The mask has 10 bits as follows. Bits 0 and 1 indicate NaN values: signaling NaN (bit 0) and quiet NaN (bit 1).
+/// Bits 2, 3, 4, 5 classify negative values: infinity (bit 2), normal (bit 3), subnormal (bit 4), and zero (bit 5).
+/// Bits 6, 7, 8, 9 classify positive values: infinity (bit 6), normal (bit 7), subnormal (bit 8), and zero (bit 9).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fclass.w))]
+pub unsafe fn __msa_fclass_w(a: v4f32) -> v4i32 {
+ msa_fclass_w(a)
+}
+
+/// Vector Floating-Point Class Mask
+///
+/// Store in each element of vector (two signed 64-bit integer numbers)
+/// a bit mask reflecting the floating-point class of the corresponding element of vector
+/// `a` (two 64-bit floating point numbers).
+/// The mask has 10 bits as follows. Bits 0 and 1 indicate NaN values: signaling NaN (bit 0) and quiet NaN (bit 1).
+/// Bits 2, 3, 4, 5 classify negative values: infinity (bit 2), normal (bit 3), subnormal (bit 4), and zero (bit 5).
+/// Bits 6, 7, 8, 9 classify positive values: infinity (bit 6), normal (bit 7), subnormal (bit 8), and zero (bit 9).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fclass.d))]
+pub unsafe fn __msa_fclass_d(a: v2f64) -> v2i64 {
+ msa_fclass_d(a)
+}
+
+/// Vector Floating-Point Quiet Compare Less or Equal
+///
+/// Set all bits to 1 in vector (four signed 32-bit integer numbers)
+/// elements if the corresponding `a` (four 32-bit floating point numbers) elements are ordered
+/// and either less than or equal to `b` (four 32-bit floating point numbers) elements,
+/// otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fcle.w))]
+pub unsafe fn __msa_fcle_w(a: v4f32, b: v4f32) -> v4i32 {
+ msa_fcle_w(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Quiet Compare Less or Equal
+///
+/// Set all bits to 1 in vector (two signed 64-bit integer numbers)
+/// elements if the corresponding `a` (two 64-bit floating point numbers) elements are ordered
+/// and either less than or equal to `b` (two 64-bit floating point numbers) elements,
+/// otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fcle.d))]
+pub unsafe fn __msa_fcle_d(a: v2f64, b: v2f64) -> v2i64 {
+ msa_fcle_d(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Quiet Compare Less Than
+///
+/// Set all bits to 1 in vector (four signed 32-bit integer numbers)
+/// elements if the corresponding `a` (four 32-bit floating point numbers) elements are ordered
+/// and less than `b` (four 32-bit floating point numbers) elements,
+/// otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fclt.w))]
+pub unsafe fn __msa_fclt_w(a: v4f32, b: v4f32) -> v4i32 {
+ msa_fclt_w(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Quiet Compare Less Than
+///
+/// Set all bits to 1 in vector (two signed 64-bit integer numbers)
+/// elements if the corresponding `a` (two 64-bit floating point numbers) elements are ordered
+/// and less than `b` (two 64-bit floating point numbers) elements,
+/// otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fclt.d))]
+pub unsafe fn __msa_fclt_d(a: v2f64, b: v2f64) -> v2i64 {
+ msa_fclt_d(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Quiet Compare Not Equal
+///
+/// Set all bits to 1 in vector (four signed 32-bit integer numbers)
+/// elements if the corresponding `a` (four 32-bit floating point numbers) and
+/// `b` (four 32-bit floating point numbers) elements are ordered and not equal,
+/// otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fcne.w))]
+pub unsafe fn __msa_fcne_w(a: v4f32, b: v4f32) -> v4i32 {
+ msa_fcne_w(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Quiet Compare Not Equal
+///
+/// Set all bits to 1 in vector (two signed 64-bit integer numbers)
+/// elements if the corresponding `a` (two 64-bit floating point numbers) and
+/// `b` (two 64-bit floating point numbers) elements are ordered and not equal,
+/// otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fcne.d))]
+pub unsafe fn __msa_fcne_d(a: v2f64, b: v2f64) -> v2i64 {
+ msa_fcne_d(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Quiet Compare Ordered
+///
+/// Set all bits to 1 in vector (four signed 32-bit integer numbers)
+/// elements if the corresponding `a` (four 32-bit floating point numbers) and
+/// `b` (four 32-bit floating point numbers) elements are ordered, i.e. both elements are not NaN values,
+/// otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fcor.w))]
+pub unsafe fn __msa_fcor_w(a: v4f32, b: v4f32) -> v4i32 {
+ msa_fcor_w(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Quiet Compare Ordered
+///
+/// Set all bits to 1 in vector (two signed 64-bit integer numbers)
+/// elements if the corresponding `a` (two 64-bit floating point numbers) and
+/// `b` (two 64-bit floating point numbers) elements are ordered, i.e. both elements are not NaN values,
+/// otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fcor.d))]
+pub unsafe fn __msa_fcor_d(a: v2f64, b: v2f64) -> v2i64 {
+ msa_fcor_d(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Quiet Compare Unordered or Equal
+///
+/// Set all bits to 1 in vector (four signed 32-bit integer numbers)
+/// elements if the corresponding `a` (four 32-bit floating point numbers) and
+/// `b` (four 32-bit floating point numbers) elements are unordered or equal,
+/// otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fcueq.w))]
+pub unsafe fn __msa_fcueq_w(a: v4f32, b: v4f32) -> v4i32 {
+ msa_fcueq_w(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Quiet Compare Unordered or Equal
+///
+/// Set all bits to 1 in vector (two signed 64-bit integer numbers)
+/// elements if the corresponding `a` (two 64-bit floating point numbers) and
+/// `b` (two 64-bit floating point numbers) elements are unordered or equal,
+/// otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fcueq.d))]
+pub unsafe fn __msa_fcueq_d(a: v2f64, b: v2f64) -> v2i64 {
+ msa_fcueq_d(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Quiet Compare Unordered or Less or Equal
+///
+/// Set all bits to 1 in vector (four signed 32-bit integer numbers)
+/// elements if the corresponding elements in `a` (four 32-bit floating point numbers)
+/// are unordered or less than or equal to `b` (four 32-bit floating point numbers) elements,
+/// otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fcule.w))]
+pub unsafe fn __msa_fcule_w(a: v4f32, b: v4f32) -> v4i32 {
+ msa_fcule_w(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Quiet Compare Unordered or Less or Equal
+///
+/// Set all bits to 1 in vector (two signed 64-bit integer numbers)
+/// elements if the corresponding elements in `a` (two 64-bit floating point numbers)
+/// are unordered or less than or equal to `b` (two 64-bit floating point numbers) elements,
+/// otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fcule.d))]
+pub unsafe fn __msa_fcule_d(a: v2f64, b: v2f64) -> v2i64 {
+ msa_fcule_d(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Quiet Compare Unordered or Less Than
+///
+/// Set all bits to 1 in vector (four signed 32-bit integer numbers)
+/// elements if the corresponding elements in `a` (four 32-bit floating point numbers)
+/// are unordered or less than `b` (four 32-bit floating point numbers) elements,
+/// otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fcult.w))]
+pub unsafe fn __msa_fcult_w(a: v4f32, b: v4f32) -> v4i32 {
+ msa_fcult_w(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Quiet Compare Unordered or Less Than
+///
+/// Set all bits to 1 in vector (two signed 64-bit integer numbers)
+/// elements if the corresponding elements in `a` (two 64-bit floating point numbers)
+/// are unordered or less than `b` (two 64-bit floating point numbers) elements,
+/// otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fcult.d))]
+pub unsafe fn __msa_fcult_d(a: v2f64, b: v2f64) -> v2i64 {
+ msa_fcult_d(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Quiet Compare Unordered
+///
+/// Set all bits to 1 in vector (four signed 32-bit integer numbers)
+/// elements if the corresponding `a` (four 32-bit floating point numbers)
+/// and `b` (four 32-bit floating point numbers) elements are unordered,
+/// i.e. at least one element is a NaN value, otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fcun.w))]
+pub unsafe fn __msa_fcun_w(a: v4f32, b: v4f32) -> v4i32 {
+ msa_fcun_w(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Quiet Compare Unordered
+///
+/// Set all bits to 1 in vector (two signed 64-bit integer numbers)
+/// elements if the corresponding `a` (two 64-bit floating point numbers)
+/// and `b` (two 64-bit floating point numbers) elements are unordered,
+/// i.e. at least one element is a NaN value, otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fcun.d))]
+pub unsafe fn __msa_fcun_d(a: v2f64, b: v2f64) -> v2i64 {
+ msa_fcun_d(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Quiet Compare Unordered or Not Equal
+///
+/// Set all bits to 1 in vector (four signed 32-bit integer numbers)
+/// elements if the corresponding `a` (four 32-bit floating point numbers)
+/// and `b` (four 32-bit floating point numbers) elements are unordered or not equal,
+/// otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fcune.w))]
+pub unsafe fn __msa_fcune_w(a: v4f32, b: v4f32) -> v4i32 {
+ msa_fcune_w(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Quiet Compare Unordered or Not Equal
+///
+/// Set all bits to 1 in vector (two signed 64-bit integer numbers)
+/// elements if the corresponding `a` (two 64-bit floating point numbers)
+/// and `b` (two 64-bit floating point numbers) elements are unordered or not equal,
+/// otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fcune.d))]
+pub unsafe fn __msa_fcune_d(a: v2f64, b: v2f64) -> v2i64 {
+ msa_fcune_d(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Division
+///
+/// The floating-point elements in vector `a` (four 32-bit floating point numbers)
+/// are divided by the floating-point elements in vector `b` (four 32-bit floating point numbers).
+/// The result is written to vector (four 32-bit floating point numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fdiv.w))]
+pub unsafe fn __msa_fdiv_w(a: v4f32, b: v4f32) -> v4f32 {
+ msa_fdiv_w(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Division
+///
+/// The floating-point elements in vector `a` (two 64-bit floating point numbers)
+/// are divided by the floating-point elements in vector `b` (two 64-bit floating point numbers).
+/// The result is written to vector (two 64-bit floating point numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fdiv.d))]
+pub unsafe fn __msa_fdiv_d(a: v2f64, b: v2f64) -> v2f64 {
+ msa_fdiv_d(a, mem::transmute(b))
+}
+
+/* FIXME: 16-bit float
+/// Vector Floating-Point Down-Convert Interchange Format
+///
+/// The floating-point elements in vector `a` (four 64-bit floating point numbers)
+/// and vector `b` (four 64-bit floating point numbers) are down-converted
+/// to a smaller interchange format, i.e. from 64-bit to 32-bit, or from 32-bit to 16-bit.
+/// The result is written to vector (8 16-bit floating point numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fexdo.h))]
+pub unsafe fn __msa_fexdo_h(a: v4f32, b: v4f32) -> f16x8 {
+ msa_fexdo_h(a, mem::transmute(b))
+}*/
+
+/// Vector Floating-Point Down-Convert Interchange Format
+///
+/// The floating-point elements in vector `a` (two 64-bit floating point numbers)
+/// and vector `b` (two 64-bit floating point numbers) are down-converted
+/// to a smaller interchange format, i.e. from 64-bit to 32-bit, or from 32-bit to 16-bit.
+/// The result is written to vector (four 32-bit floating point numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fexdo.w))]
+pub unsafe fn __msa_fexdo_w(a: v2f64, b: v2f64) -> v4f32 {
+ msa_fexdo_w(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Down-Convert Interchange Format
+///
+/// The floating-point elements in vector `a` (four 32-bit floating point numbers)
+/// are scaled, i.e. multiplied, by 2 to the power of integer elements in vector `b`
+/// (four signed 32-bit integer numbers).
+/// The result is written to vector (four 32-bit floating point numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fexp2.w))]
+pub unsafe fn __msa_fexp2_w(a: v4f32, b: v4i32) -> v4f32 {
+ msa_fexp2_w(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Down-Convert Interchange Format
+///
+/// The floating-point elements in vector `a` (two 64-bit floating point numbers)
+/// are scaled, i.e. multiplied, by 2 to the power of integer elements in vector `b`
+/// (two signed 64-bit integer numbers).
+/// The result is written to vector (two 64-bit floating point numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fexp2.d))]
+pub unsafe fn __msa_fexp2_d(a: v2f64, b: v2i64) -> v2f64 {
+ msa_fexp2_d(a, mem::transmute(b))
+}
+
+/* FIXME: 16-bit float
+/// Vector Floating-Point Up-Convert Interchange Format Left
+///
+/// The left half floating-point elements in vector `a` (two 16-bit floating point numbers)
+/// are up-converted to a larger interchange format,
+/// i.e. from 16-bit to 32-bit, or from 32-bit to 64-bit.
+/// The result is written to vector (four 32-bit floating point numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fexupl.w))]
+pub unsafe fn __msa_fexupl_w(a: f16x8) -> v4f32 {
+ msa_fexupl_w(a)
+}*/
+
+/// Vector Floating-Point Up-Convert Interchange Format Left
+///
+/// The left half floating-point elements in vector `a` (four 32-bit floating point numbers)
+/// are up-converted to a larger interchange format,
+/// i.e. from 16-bit to 32-bit, or from 32-bit to 64-bit.
+/// The result is written to vector (two 64-bit floating point numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fexupl.d))]
+pub unsafe fn __msa_fexupl_d(a: v4f32) -> v2f64 {
+ msa_fexupl_d(a)
+}
+
+/* FIXME: 16-bit float
+/// Vector Floating-Point Up-Convert Interchange Format Left
+///
+/// The right half floating-point elements in vector `a` (two 16-bit floating point numbers)
+/// are up-converted to a larger interchange format,
+/// i.e. from 16-bit to 32-bit, or from 32-bit to 64-bit.
+/// The result is written to vector (four 32-bit floating point numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fexupr.w))]
+pub unsafe fn __msa_fexupr_w(a: f16x8) -> v4f32 {
+ msa_fexupr_w(a)
+} */
+
+/// Vector Floating-Point Up-Convert Interchange Format Left
+///
+/// The right half floating-point elements in vector `a` (four 32-bit floating point numbers)
+/// are up-converted to a larger interchange format,
+/// i.e. from 16-bit to 32-bit, or from 32-bit to 64-bit.
+/// The result is written to vector (two 64-bit floating point numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fexupr.d))]
+pub unsafe fn __msa_fexupr_d(a: v4f32) -> v2f64 {
+ msa_fexupr_d(a)
+}
+
+/// Vector Floating-Point Round and Convert from Signed Integer
+///
+/// The signed integer elements in vector `a` (four signed 32-bit integer numbers)
+/// are converted to floating-point values.
+/// The result is written to vector (four 32-bit floating point numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ffint_s.w))]
+pub unsafe fn __msa_ffint_s_w(a: v4i32) -> v4f32 {
+ msa_ffint_s_w(a)
+}
+
+/// Vector Floating-Point Round and Convert from Signed Integer
+///
+/// The signed integer elements in vector `a` (two signed 64-bit integer numbers)
+/// are converted to floating-point values.
+/// The result is written to vector (two 64-bit floating point numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ffint_s.d))]
+pub unsafe fn __msa_ffint_s_d(a: v2i64) -> v2f64 {
+ msa_ffint_s_d(a)
+}
+
+/// Vector Floating-Point Round and Convert from Unsigned Integer
+///
+/// The unsigned integer elements in vector `a` (four unsigned 32-bit integer numbers)
+/// are converted to floating-point values.
+/// The result is written to vector (four 32-bit floating point numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ffint_u.w))]
+pub unsafe fn __msa_ffint_u_w(a: v4u32) -> v4f32 {
+ msa_ffint_u_w(a)
+}
+
+/// Vector Floating-Point Round and Convert from Unsigned Integer
+///
+/// The unsigned integer elements in vector `a` (two unsigned 64-bit integer numbers)
+/// are converted to floating-point values.
+/// The result is written to vector (two 64-bit floating point numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ffint_u.d))]
+pub unsafe fn __msa_ffint_u_d(a: v2u64) -> v2f64 {
+ msa_ffint_u_d(a)
+}
+
+/// Vector Floating-Point Convert from Fixed-Point Left
+///
+/// The left half fixed-point elements in vector `a` (eight signed 16-bit integer numbers)
+/// are up-converted to floating-point data format.
+/// i.e. from 16-bit Q15 to 32-bit floating-point, or from 32-bit Q31 to 64-bit floating-point.
+/// The result is written to vector (four 32-bit floating point numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ffql.w))]
+pub unsafe fn __msa_ffql_w(a: v8i16) -> v4f32 {
+ msa_ffql_w(a)
+}
+
+/// Vector Floating-Point Convert from Fixed-Point Left
+///
+/// The left half fixed-point elements in vector `a` (four signed 32-bit integer numbers)
+/// are up-converted to floating-point data format.
+/// i.e. from 16-bit Q15 to 32-bit floating-point, or from 32-bit Q31 to 64-bit floating-point.
+/// The result is written to vector (two 64-bit floating point numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ffql.d))]
+pub unsafe fn __msa_ffql_d(a: v4i32) -> v2f64 {
+ msa_ffql_d(a)
+}
+
+/// Vector Floating-Point Convert from Fixed-Point Left
+///
+/// The right half fixed-point elements in vector `a` (eight signed 16-bit integer numbers)
+/// are up-converted to floating-point data format.
+/// i.e. from 16-bit Q15 to 32-bit floating-point, or from 32-bit Q31 to 64-bit floating-point.
+/// The result is written to vector (four 32-bit floating point numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ffqr.w))]
+pub unsafe fn __msa_ffqr_w(a: v8i16) -> v4f32 {
+ msa_ffqr_w(a)
+}
+
+/// Vector Floating-Point Convert from Fixed-Point Left
+///
+/// The right half fixed-point elements in vector `a` (four signed 32-bit integer numbers)
+/// are up-converted to floating-point data format.
+/// i.e. from 16-bit Q15 to 32-bit floating-point, or from 32-bit Q31 to 64-bit floating-point.
+/// The result is written to vector (two 64-bit floating point numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ffqr.d))]
+pub unsafe fn __msa_ffqr_d(a: v4i32) -> v2f64 {
+ msa_ffqr_d(a)
+}
+
+/// Vector Fill from GPR
+///
+/// Replicate GPR rs value to all elements in vector (sixteen signed 8-bit integer numbers).
+/// If the source GPR is wider than the destination data format, the destination's elements
+/// will be set to the least significant bits of the GPR.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fill.b))]
+pub unsafe fn __msa_fill_b(a: i32) -> v16i8 {
+ msa_fill_b(a)
+}
+
+/// Vector Fill from GPR
+///
+/// Replicate GPR rs value to all elements in vector (eight signed 16-bit integer numbers).
+/// If the source GPR is wider than the destination data format, the destination's elements
+/// will be set to the least significant bits of the GPR.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fill.h))]
+pub unsafe fn __msa_fill_h(a: i32) -> v8i16 {
+ msa_fill_h(a)
+}
+
+/// Vector Fill from GPR
+///
+/// Replicate GPR rs value to all elements in vector (four signed 32-bit integer numbers).
+/// If the source GPR is wider than the destination data format, the destination's elements
+/// will be set to the least significant bits of the GPR.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fill.w))]
+pub unsafe fn __msa_fill_w(a: i32) -> v4i32 {
+ msa_fill_w(a)
+}
+
+/// Vector Fill from GPR
+///
+/// Replicate GPR rs value to all elements in vector (two signed 64-bit integer numbers).
+/// If the source GPR is wider than the destination data format, the destination's elements
+/// will be set to the least significant bits of the GPR.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fill.d))]
+pub unsafe fn __msa_fill_d(a: i64) -> v2i64 {
+ msa_fill_d(a)
+}
+
+/// Vector Floating-Point Base 2 Logarithm
+///
+/// The signed integral base 2 exponents of floating-point elements in vector `a`
+/// (four 32-bit floating point numbers) are written as floating-point values to vector elements
+/// (four 32-bit floating point numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(flog2.w))]
+pub unsafe fn __msa_flog2_w(a: v4f32) -> v4f32 {
+ msa_flog2_w(a)
+}
+
+/// Vector Floating-Point Base 2 Logarithm
+///
+/// The signed integral base 2 exponents of floating-point elements in vector `a`
+/// (two 64-bit floating point numbers) are written as floating-point values to vector elements
+/// (two 64-bit floating point numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(flog2.d))]
+pub unsafe fn __msa_flog2_d(a: v2f64) -> v2f64 {
+ msa_flog2_d(a)
+}
+
+/// Vector Floating-Point Multiply-Add
+///
+/// The floating-point elements in vector `b` (four 32-bit floating point numbers)
+/// multiplied by floating-point elements in vector `c` (four 32-bit floating point numbers)
+/// are added to the floating-point elements in vector `a` (four 32-bit floating point numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fmadd.w))]
+pub unsafe fn __msa_fmadd_w(a: v4f32, b: v4f32, c: v4f32) -> v4f32 {
+ msa_fmadd_w(a, mem::transmute(b), c)
+}
+
+/// Vector Floating-Point Multiply-Add
+///
+/// The floating-point elements in vector `b` (two 64-bit floating point numbers)
+/// multiplied by floating-point elements in vector `c` (two 64-bit floating point numbers)
+/// are added to the floating-point elements in vector `a` (two 64-bit floating point numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fmadd.d))]
+pub unsafe fn __msa_fmadd_d(a: v2f64, b: v2f64, c: v2f64) -> v2f64 {
+ msa_fmadd_d(a, mem::transmute(b), c)
+}
+
+/// Vector Floating-Point Maximum
+///
+/// The largest values between corresponding floating-point elements in vector `a`
+/// (four 32-bit floating point numbers) and vector `b` (four 32-bit floating point numbers)
+/// are written to vector (four 32-bit floating point numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fmax.w))]
+pub unsafe fn __msa_fmax_w(a: v4f32, b: v4f32) -> v4f32 {
+ msa_fmax_w(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Maximum
+///
+/// The largest values between corresponding floating-point elements in vector `a`
+/// (two 64-bit floating point numbers) and vector `b` (two 64-bit floating point numbers)
+/// are written to vector (two 64-bit floating point numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fmax.d))]
+pub unsafe fn __msa_fmax_d(a: v2f64, b: v2f64) -> v2f64 {
+ msa_fmax_d(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Maximum Based on Absolute Values
+///
+/// The value with the largest magnitude, i.e. absolute value, between corresponding
+/// floating-point elements in vector `a` (four 32-bit floating point numbers)
+/// and vector `b` (four 32-bit floating point numbers)
+/// are written to vector (four 32-bit floating point numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fmax_a.w))]
+pub unsafe fn __msa_fmax_a_w(a: v4f32, b: v4f32) -> v4f32 {
+ msa_fmax_a_w(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Maximum Based on Absolute Values
+///
+/// The value with the largest magnitude, i.e. absolute value, between corresponding
+/// floating-point elements in vector `a` (two 64-bit floating point numbers)
+/// and vector `b` (two 64-bit floating point numbers)
+/// are written to vector (two 64-bit floating point numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fmax_a.d))]
+pub unsafe fn __msa_fmax_a_d(a: v2f64, b: v2f64) -> v2f64 {
+ msa_fmax_a_d(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Minimum
+///
+/// The smallest values between corresponding floating-point elements in vector `a`
+/// (four 32-bit floating point numbers) and vector `b` (four 32-bit floating point numbers)
+/// are written to vector (four 32-bit floating point numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fmin.w))]
+pub unsafe fn __msa_fmin_w(a: v4f32, b: v4f32) -> v4f32 {
+ msa_fmin_w(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Minimum
+///
+/// The smallest values between corresponding floating-point elements in vector `a`
+/// (two 64-bit floating point numbers) and vector `b` (two 64-bit floating point numbers)
+/// are written to vector (two 64-bit floating point numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fmin.d))]
+pub unsafe fn __msa_fmin_d(a: v2f64, b: v2f64) -> v2f64 {
+ msa_fmin_d(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Minimum Based on Absolute Values
+///
+/// The value with the smallest magnitude, i.e. absolute value, between corresponding
+/// floating-point elements in vector `a` (four 32-bit floating point numbers)
+/// and vector `b` (four 32-bit floating point numbers)
+/// are written to vector (four 32-bit floating point numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fmin_a.w))]
+pub unsafe fn __msa_fmin_a_w(a: v4f32, b: v4f32) -> v4f32 {
+ msa_fmin_a_w(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Minimum Based on Absolute Values
+///
+/// The value with the smallest magnitude, i.e. absolute value, between corresponding
+/// floating-point elements in vector `a` (two 64-bit floating point numbers)
+/// and vector `b` (two 64-bit floating point numbers)
+/// are written to vector (two 64-bit floating point numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fmin_a.d))]
+pub unsafe fn __msa_fmin_a_d(a: v2f64, b: v2f64) -> v2f64 {
+ msa_fmin_a_d(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Multiply-Sub
+///
+/// The floating-point elements in vector `b` (four 32-bit floating point numbers)
+/// multiplied by floating-point elements in vector `c` (four 32-bit floating point numbers)
+/// are subtracted from the floating-point elements in vector `a` (four 32-bit floating point numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fmsub.w))]
+pub unsafe fn __msa_fmsub_w(a: v4f32, b: v4f32, c: v4f32) -> v4f32 {
+ msa_fmsub_w(a, mem::transmute(b), c)
+}
+
+/// Vector Floating-Point Multiply-Sub
+///
+/// The floating-point elements in vector `b` (two 64-bit floating point numbers)
+/// multiplied by floating-point elements in vector `c` (two 64-bit floating point numbers)
+/// are subtracted from the floating-point elements in vector `a` (two 64-bit floating point numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fmsub.d))]
+pub unsafe fn __msa_fmsub_d(a: v2f64, b: v2f64, c: v2f64) -> v2f64 {
+ msa_fmsub_d(a, mem::transmute(b), c)
+}
+
+/// Vector Floating-Point Multiplication
+///
+/// The floating-point elements in vector `a` (four 32-bit floating point numbers) are
+/// multiplied by floating-point elements in vector `b` (four 32-bit floating point numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fmul.w))]
+pub unsafe fn __msa_fmul_w(a: v4f32, b: v4f32) -> v4f32 {
+ msa_fmul_w(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Multiplication
+///
+/// The floating-point elements in vector `a` (two 64-bit floating point numbers) are
+/// multiplied by floating-point elements in vector `b` (two 64-bit floating point numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fmul.d))]
+pub unsafe fn __msa_fmul_d(a: v2f64, b: v2f64) -> v2f64 {
+ msa_fmul_d(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Round to Integer
+///
+/// The floating-point elements in vector `a` (four 32-bit floating point numbers)
+/// are rounded to an integral valued floating-point number in the same format based
+/// on the rounding mode bits RM in MSA Control and Status Register MSACSR.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(frint.w))]
+pub unsafe fn __msa_frint_w(a: v4f32) -> v4f32 {
+ msa_frint_w(a)
+}
+
+/// Vector Floating-Point Round to Integer
+///
+/// The floating-point elements in vector `a` (two 64-bit floating point numbers)
+/// are rounded to an integral valued floating-point number in the same format based
+/// on the rounding mode bits RM in MSA Control and Status Register MSACSR.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(frint.d))]
+pub unsafe fn __msa_frint_d(a: v2f64) -> v2f64 {
+ msa_frint_d(a)
+}
+
+/// Vector Approximate Floating-Point Reciprocal
+///
+/// The reciprocals of floating-point elements in vector `a` (four 32-bit floating point numbers)
+/// are calculated and the result is written to vector (four 32-bit floating point numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(frcp.w))]
+pub unsafe fn __msa_frcp_w(a: v4f32) -> v4f32 {
+ msa_frcp_w(a)
+}
+
+/// Vector Approximate Floating-Point Reciprocal
+///
+/// The reciprocals of floating-point elements in vector `a` (two 64-bit floating point numbers)
+/// are calculated and the result is written to vector (two 64-bit floating point numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(frcp.d))]
+pub unsafe fn __msa_frcp_d(a: v2f64) -> v2f64 {
+ msa_frcp_d(a)
+}
+
+/// Vector Approximate Floating-Point Reciprocal of Square Root
+///
+/// The reciprocals of the square roots of floating-point elements in vector `a` (four 32-bit floating point numbers)
+/// are calculated and the result is written to vector (four 32-bit floating point numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(frsqrt.w))]
+pub unsafe fn __msa_frsqrt_w(a: v4f32) -> v4f32 {
+ msa_frsqrt_w(a)
+}
+
+/// Vector Approximate Floating-Point Reciprocal of Square Root
+///
+/// The reciprocals of the square roots of floating-point elements in vector `a` (two 64-bit floating point numbers)
+/// are calculated and the result is written to vector (two 64-bit floating point numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(frsqrt.d))]
+pub unsafe fn __msa_frsqrt_d(a: v2f64) -> v2f64 {
+ msa_frsqrt_d(a)
+}
+
+/// Vector Floating-Point Signaling Compare Always False
+///
+/// Set all bits to 0 in vector (four signed 32-bit integer numbers) elements.
+/// Signaling and quiet NaN elements in vector `a` (four 32-bit floating point numbers)
+/// or `b` (four 32-bit floating point numbers) signal Invalid Operation exception.
+/// In case of a floating-point exception, the default result has all bits set to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fsaf.w))]
+pub unsafe fn __msa_fsaf_w(a: v4f32, b: v4f32) -> v4i32 {
+ msa_fsaf_w(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Signaling Compare Always False
+///
+/// Set all bits to 0 in vector (two signed 64-bit integer numbers) elements.
+/// Signaling and quiet NaN elements in vector `a` (two 64-bit floating point numbers)
+/// or `b` (two 64-bit floating point numbers) signal Invalid Operation exception.
+/// In case of a floating-point exception, the default result has all bits set to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fsaf.d))]
+pub unsafe fn __msa_fsaf_d(a: v2f64, b: v2f64) -> v2i64 {
+ msa_fsaf_d(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Signaling Compare Equal
+///
+/// Set all bits to 1 in vector (four signed 32-bit integer numbers) elements
+/// if the corresponding `a` (four 32-bit floating point numbers)
+/// and `b` (four 32-bit floating point numbers) elements are equal, otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fseq.w))]
+pub unsafe fn __msa_fseq_w(a: v4f32, b: v4f32) -> v4i32 {
+ msa_fseq_w(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Signaling Compare Equal
+///
+/// Set all bits to 1 in vector (two signed 64-bit integer numbers) elements
+/// if the corresponding `a` (two 64-bit floating point numbers)
+/// and `b` (two 64-bit floating point numbers) elements are equal, otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fseq.d))]
+pub unsafe fn __msa_fseq_d(a: v2f64, b: v2f64) -> v2i64 {
+ msa_fseq_d(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Signaling Compare Less or Equal
+///
+/// Set all bits to 1 in vector (four signed 32-bit integer numbers) elements
+/// if the corresponding `a` (four 32-bit floating point numbers) elements
+/// are less than or equal to `b` (four 32-bit floating point numbers) elements, otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fsle.w))]
+pub unsafe fn __msa_fsle_w(a: v4f32, b: v4f32) -> v4i32 {
+ msa_fsle_w(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Signaling Compare Less or Equal
+///
+/// Set all bits to 1 in vector (two signed 64-bit integer numbers) elements
+/// if the corresponding `a` (two 64-bit floating point numbers) elements
+/// are less than or equal to `b` (two 64-bit floating point numbers) elements, otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fsle.d))]
+pub unsafe fn __msa_fsle_d(a: v2f64, b: v2f64) -> v2i64 {
+ msa_fsle_d(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Signaling Compare Less Than
+///
+/// Set all bits to 1 in vector (four signed 32-bit integer numbers) elements
+/// if the corresponding `a` (four 32-bit floating point numbers) elements
+/// are less than `b` (four 32-bit floating point numbers) elements, otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fslt.w))]
+pub unsafe fn __msa_fslt_w(a: v4f32, b: v4f32) -> v4i32 {
+ msa_fslt_w(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Signaling Compare Less Than
+///
+/// Set all bits to 1 in vector (two signed 64-bit integer numbers) elements
+/// if the corresponding `a` (two 64-bit floating point numbers) elements
+/// are less than `b` (two 64-bit floating point numbers) elements, otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fslt.d))]
+pub unsafe fn __msa_fslt_d(a: v2f64, b: v2f64) -> v2i64 {
+ msa_fslt_d(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Signaling Compare Not Equal
+///
+/// Set all bits to 1 in vector (four signed 32-bit integer numbers) elements
+/// if the corresponding `a` (four 32-bit floating point numbers) and
+/// `b` (four 32-bit floating point numbers) elements are not equal, otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fsne.w))]
+pub unsafe fn __msa_fsne_w(a: v4f32, b: v4f32) -> v4i32 {
+ msa_fsne_w(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Signaling Compare Not Equal
+///
+/// Set all bits to 1 in vector (two signed 64-bit integer numbers) elements
+/// if the corresponding `a` (two 64-bit floating point numbers) and
+/// `b` (two 64-bit floating point numbers) elements are not equal, otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fsne.d))]
+pub unsafe fn __msa_fsne_d(a: v2f64, b: v2f64) -> v2i64 {
+ msa_fsne_d(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Signaling Compare Ordered
+///
+/// Set all bits to 1 in vector (four signed 32-bit integer numbers) elements
+/// if the corresponding `a` (four 32-bit floating point numbers) and
+/// `b` (four 32-bit floating point numbers) elements are ordered,
+/// i.e. both elements are not NaN values, otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fsor.w))]
+pub unsafe fn __msa_fsor_w(a: v4f32, b: v4f32) -> v4i32 {
+ msa_fsor_w(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Signaling Compare Ordered
+///
+/// Set all bits to 1 in vector (two signed 64-bit integer numbers) elements
+/// if the corresponding `a` (two 64-bit floating point numbers) and
+/// `b` (two 64-bit floating point numbers) elements are ordered,
+/// i.e. both elements are not NaN values, otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fsor.d))]
+pub unsafe fn __msa_fsor_d(a: v2f64, b: v2f64) -> v2i64 {
+ msa_fsor_d(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Square Root
+///
+/// The square roots of floating-point elements in vector `a`
+/// (four 32-bit floating point numbers) are written to vector
+/// (four 32-bit floating point numbers) elements are ordered,.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fsqrt.w))]
+pub unsafe fn __msa_fsqrt_w(a: v4f32) -> v4f32 {
+ msa_fsqrt_w(a)
+}
+
+/// Vector Floating-Point Square Root
+///
+/// The square roots of floating-point elements in vector `a`
+/// (two 64-bit floating point numbers) are written to vector
+/// (two 64-bit floating point numbers) elements are ordered,.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fsqrt.d))]
+pub unsafe fn __msa_fsqrt_d(a: v2f64) -> v2f64 {
+ msa_fsqrt_d(a)
+}
+
+/// Vector Floating-Point Subtraction
+///
+/// The floating-point elements in vector `b` (four 32-bit floating point numbers)
+/// are subtracted from the floating-point elements in vector `a`
+/// (four 32-bit floating point numbers).
+/// The result is written to vector (four 32-bit floating point numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fsub.w))]
+pub unsafe fn __msa_fsub_w(a: v4f32, b: v4f32) -> v4f32 {
+ msa_fsub_w(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Subtraction
+///
+/// The floating-point elements in vector `b` (two 64-bit floating point numbers)
+/// are subtracted from the floating-point elements in vector `a`
+/// (two 64-bit floating point numbers).
+/// The result is written to vector (two 64-bit floating point numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fsub.d))]
+pub unsafe fn __msa_fsub_d(a: v2f64, b: v2f64) -> v2f64 {
+ msa_fsub_d(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Signaling Compare Ordered
+///
+/// Set all bits to 1 in vector (four signed 32-bit integer numbers) elements
+/// if the corresponding `a` (four 32-bit floating point numbers) and
+/// `b` (four 32-bit floating point numbers) elements are unordered or equal,
+/// otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fsueq.w))]
+pub unsafe fn __msa_fsueq_w(a: v4f32, b: v4f32) -> v4i32 {
+ msa_fsueq_w(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Signaling Compare Ordered
+///
+/// Set all bits to 1 in vector (two signed 64-bit integer numbers) elements
+/// if the corresponding `a` (two 64-bit floating point numbers) and
+/// `b` (two 64-bit floating point numbers) elements are unordered or equal,
+/// otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fsueq.d))]
+pub unsafe fn __msa_fsueq_d(a: v2f64, b: v2f64) -> v2i64 {
+ msa_fsueq_d(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Signaling Compare Unordered or Less or Equal
+///
+/// Set all bits to 1 in vector (four signed 32-bit integer numbers) elements
+/// if the corresponding `a` (four 32-bit floating point numbers) elements are
+/// unordered or less than or equal to `b` (four 32-bit floating point numbers) elements,
+/// otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fsule.w))]
+pub unsafe fn __msa_fsule_w(a: v4f32, b: v4f32) -> v4i32 {
+ msa_fsule_w(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Signaling Compare Unordered or Less or Equal
+///
+/// Set all bits to 1 in vector (two signed 64-bit integer numbers) elements
+/// if the corresponding `a` (two 64-bit floating point numbers) elements are
+/// unordered or less than or equal to `b` (two 64-bit floating point numbers) elements,
+/// otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fsule.d))]
+pub unsafe fn __msa_fsule_d(a: v2f64, b: v2f64) -> v2i64 {
+ msa_fsule_d(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Signaling Compare Unordered or Less Than
+///
+/// Set all bits to 1 in vector (four signed 32-bit integer numbers) elements
+/// if the corresponding `a` (four 32-bit floating point numbers) elements
+/// are unordered or less than `b` (four 32-bit floating point numbers) elements,
+/// otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fsult.w))]
+pub unsafe fn __msa_fsult_w(a: v4f32, b: v4f32) -> v4i32 {
+ msa_fsult_w(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Signaling Compare Unordered or Less Than
+///
+/// Set all bits to 1 in vector (two signed 64-bit integer numbers) elements
+/// if the corresponding `a` (two 64-bit floating point numbers) elements
+/// are unordered or less than `b` (two 64-bit floating point numbers) elements,
+/// otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fsult.d))]
+pub unsafe fn __msa_fsult_d(a: v2f64, b: v2f64) -> v2i64 {
+ msa_fsult_d(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Signaling Compare Unordered
+///
+/// Set all bits to 1 in vector (four signed 32-bit integer numbers) elements
+/// if the corresponding `a` (four 32-bit floating point numbers) and
+/// `b` (four 32-bit floating point numbers) elements are unordered,
+/// i.e. at least one element is a NaN value, otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fsun.w))]
+pub unsafe fn __msa_fsun_w(a: v4f32, b: v4f32) -> v4i32 {
+ msa_fsun_w(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Signaling Compare Unordered
+///
+/// Set all bits to 1 in vector (two signed 64-bit integer numbers) elements
+/// if the corresponding `a` (two 64-bit floating point numbers) and
+/// `b` (two 64-bit floating point numbers) elements are unordered,
+/// i.e. at least one element is a NaN value, otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fsun.d))]
+pub unsafe fn __msa_fsun_d(a: v2f64, b: v2f64) -> v2i64 {
+ msa_fsun_d(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Signaling Compare Unordered or Not Equal
+///
+/// Set all bits to 1 in vector (four signed 32-bit integer numbers) elements
+/// if the corresponding `a` (four 32-bit floating point numbers) and
+/// `b` (four 32-bit floating point numbers) elements are unordered or not equal,
+/// otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fsune.w))]
+pub unsafe fn __msa_fsune_w(a: v4f32, b: v4f32) -> v4i32 {
+ msa_fsune_w(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Signaling Compare Unordered or Not Equal
+///
+/// Set all bits to 1 in vector (two signed 64-bit integer numbers) elements
+/// if the corresponding `a` (two 64-bit floating point numbers) and
+/// `b` (two 64-bit floating point numbers) elements are unordered or not equal,
+/// otherwise set all bits to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(fsune.d))]
+pub unsafe fn __msa_fsune_d(a: v2f64, b: v2f64) -> v2i64 {
+ msa_fsune_d(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Convert to Signed Integer
+///
+///The elements in vector `a` (four 32-bit floating point numbers)
+/// are rounded and converted to signed integer values based on the
+/// rounding mode bits RM in MSA Control and Status Register MSACSR.
+/// The result is written to vector (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ftint_s.w))]
+pub unsafe fn __msa_ftint_s_w(a: v4f32) -> v4i32 {
+ msa_ftint_s_w(a)
+}
+
+/// Vector Floating-Point Convert to Signed Integer
+///
+///The elements in vector `a` (two 64-bit floating point numbers)
+/// are rounded and converted to signed integer values based on the
+/// rounding mode bits RM in MSA Control and Status Register MSACSR.
+/// The result is written to vector (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ftint_s.d))]
+pub unsafe fn __msa_ftint_s_d(a: v2f64) -> v2i64 {
+ msa_ftint_s_d(a)
+}
+
+/// Vector Floating-Point Convert to Unsigned Integer
+///
+/// The elements in vector `a` (four 32-bit floating point numbers)
+/// are rounded and converted to signed integer values based on the
+/// rounding mode bits RM in MSA Control and Status Register MSACSR.
+/// The result is written to vector (four unsigned 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ftint_u.w))]
+pub unsafe fn __msa_ftint_u_w(a: v4f32) -> v4u32 {
+ msa_ftint_u_w(a)
+}
+
+/// Vector Floating-Point Convert to Unsigned Integer
+///
+/// The elements in vector `a` (two 64-bit floating point numbers)
+/// are rounded and converted to signed integer values based on the
+/// rounding mode bits RM in MSA Control and Status Register MSACSR.
+/// The result is written to vector (two unsigned 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ftint_u.d))]
+pub unsafe fn __msa_ftint_u_d(a: v2f64) -> v2u64 {
+ msa_ftint_u_d(a)
+}
+
+/// Vector Floating-Point Convert to Fixed-Point
+///
+/// The elements in vector `a` (four 32-bit floating point numbers)
+/// and `b` (four 32-bit floating point numbers) are down-converted to a fixed-point
+/// representation, i.e. from 64-bit floating-point to 32-bit Q31 fixed-point
+/// representation, or from 32-bit floating-point to 16-bit Q15 fixed-point representation.
+/// The result is written to vector (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ftq.h))]
+pub unsafe fn __msa_ftq_h(a: v4f32, b: v4f32) -> v8i16 {
+ msa_ftq_h(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Convert to Fixed-Point
+///
+/// The elements in vector `a` (two 64-bit floating point numbers)
+/// and `b` (two 64-bit floating point numbers) are down-converted to a fixed-point
+/// representation, i.e. from 64-bit floating-point to 32-bit Q31 fixed-point
+/// representation, or from 32-bit floating-point to 16-bit Q15 fixed-point representation.
+/// The result is written to vector (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ftq.w))]
+pub unsafe fn __msa_ftq_w(a: v2f64, b: v2f64) -> v4i32 {
+ msa_ftq_w(a, mem::transmute(b))
+}
+
+/// Vector Floating-Point Truncate and Convert to Signed Integer
+///
+/// The elements in vector `a` (four 32-bit floating point numbers)
+/// are truncated, i.e. rounded toward zero, to signed integer values.
+/// The result is written to vector (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ftrunc_s.w))]
+pub unsafe fn __msa_ftrunc_s_w(a: v4f32) -> v4i32 {
+ msa_ftrunc_s_w(a)
+}
+
+/// Vector Floating-Point Truncate and Convert to Signed Integer
+///
+/// The elements in vector `a` (two 64-bit floating point numbers)
+/// are truncated, i.e. rounded toward zero, to signed integer values.
+/// The result is written to vector (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ftrunc_s.d))]
+pub unsafe fn __msa_ftrunc_s_d(a: v2f64) -> v2i64 {
+ msa_ftrunc_s_d(a)
+}
+
+/// Vector Floating-Point Truncate and Convert to Unsigned Integer
+///
+/// The elements in vector `a` (four 32-bit floating point numbers)
+/// are truncated, i.e. rounded toward zero, to unsigned integer values.
+/// The result is written to vector (four unsigned 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ftrunc_u.w))]
+pub unsafe fn __msa_ftrunc_u_w(a: v4f32) -> v4u32 {
+ msa_ftrunc_u_w(a)
+}
+
+/// Vector Floating-Point Truncate and Convert to Unsigned Integer
+///
+/// The elements in vector `a` (two 64-bit floating point numbers)
+/// are truncated, i.e. rounded toward zero, to unsigned integer values.
+/// The result is written to vector (two unsigned 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ftrunc_u.d))]
+pub unsafe fn __msa_ftrunc_u_d(a: v2f64) -> v2u64 {
+ msa_ftrunc_u_d(a)
+}
+
+/// Vector Signed Horizontal Add
+///
+/// The sign-extended odd elements in vector `a` (sixteen signed 8-bit integer numbers)
+/// are added to the sign-extended even elements in vector `b` (sixteen signed 8-bit integer numbers)
+/// producing a result twice the size of the input operands.
+/// The result is written to vector (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(hadd_s.h))]
+pub unsafe fn __msa_hadd_s_h(a: v16i8, b: v16i8) -> v8i16 {
+ msa_hadd_s_h(a, mem::transmute(b))
+}
+
+/// Vector Signed Horizontal Add
+///
+/// The sign-extended odd elements in vector `a` (eight signed 16-bit integer numbers)
+/// are added to the sign-extended even elements in vector `b` (eight signed 16-bit integer numbers)
+/// producing a result twice the size of the input operands.
+/// The result is written to vector (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(hadd_s.w))]
+pub unsafe fn __msa_hadd_s_w(a: v8i16, b: v8i16) -> v4i32 {
+ msa_hadd_s_w(a, mem::transmute(b))
+}
+
+/// Vector Signed Horizontal Add
+///
+/// The sign-extended odd elements in vector `a` (four signed 32-bit integer numbers)
+/// are added to the sign-extended even elements in vector `b` (four signed 32-bit integer numbers)
+/// producing a result twice the size of the input operands.
+/// The result is written to vector (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(hadd_s.d))]
+pub unsafe fn __msa_hadd_s_d(a: v4i32, b: v4i32) -> v2i64 {
+ msa_hadd_s_d(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Horizontal Add
+///
+/// The zero-extended odd elements in vector `a` (sixteen unsigned 8-bit integer numbers)
+/// are added to the zero-extended even elements in vector `b` (sixteen unsigned 8-bit integer numbers)
+/// producing a result twice the size of the input operands.
+/// The result is written to vector (eight unsigned 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(hadd_u.h))]
+pub unsafe fn __msa_hadd_u_h(a: v16u8, b: v16u8) -> v8u16 {
+ msa_hadd_u_h(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Horizontal Add
+///
+/// The zero-extended odd elements in vector `a` (eight unsigned 16-bit integer numbers)
+/// are added to the zero-extended even elements in vector `b` (eight unsigned 16-bit integer numbers)
+/// producing a result twice the size of the input operands.
+/// The result is written to vector (four unsigned 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(hadd_u.w))]
+pub unsafe fn __msa_hadd_u_w(a: v8u16, b: v8u16) -> v4u32 {
+ msa_hadd_u_w(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Horizontal Add
+///
+/// The zero-extended odd elements in vector `a` (four unsigned 32-bit integer numbers)
+/// are added to the zero-extended even elements in vector `b` (four unsigned 32-bit integer numbers)
+/// producing a result twice the size of the input operands.
+/// The result is written to vector (two unsigned 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(hadd_u.d))]
+pub unsafe fn __msa_hadd_u_d(a: v4u32, b: v4u32) -> v2u64 {
+ msa_hadd_u_d(a, mem::transmute(b))
+}
+
+/// Vector Signed Horizontal Subtract
+///
+/// The sign-extended odd elements in vector `b` (sixteen signed 8-bit integer numbers)
+/// are subtracted from the sign-extended elements in vector `a` (sixteen signed 8-bit integer numbers)
+/// producing a result twice the size of the input operands.
+/// The result is written to vector (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(hsub_s.h))]
+pub unsafe fn __msa_hsub_s_h(a: v16i8, b: v16i8) -> v8i16 {
+ msa_hsub_s_h(a, mem::transmute(b))
+}
+
+/// Vector Signed Horizontal Subtract
+///
+/// The sign-extended odd elements in vector `b` (eight signed 16-bit integer numbers)
+/// are subtracted from the sign-extended elements in vector `a` (eight signed 16-bit integer numbers)
+/// producing a result twice the size of the input operands.
+/// The result is written to vector (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(hsub_s.w))]
+pub unsafe fn __msa_hsub_s_w(a: v8i16, b: v8i16) -> v4i32 {
+ msa_hsub_s_w(a, mem::transmute(b))
+}
+
+/// Vector Signed Horizontal Subtract
+///
+/// The sign-extended odd elements in vector `b` (four signed 32-bit integer numbers)
+/// are subtracted from the sign-extended elements in vector `a` (four signed 32-bit integer numbers)
+/// producing a result twice the size of the input operands.
+/// The result is written to vector (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(hsub_s.d))]
+pub unsafe fn __msa_hsub_s_d(a: v4i32, b: v4i32) -> v2i64 {
+ msa_hsub_s_d(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Horizontal Subtract
+///
+/// The zero-extended odd elements in vector `b` (sixteen unsigned 8-bit integer numbers)
+/// are subtracted from the zero-extended elements in vector `a` (sixteen unsigned 8-bit integer numbers)
+/// producing a result twice the size of the input operands.
+/// The result is written to vector (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(hsub_u.h))]
+pub unsafe fn __msa_hsub_u_h(a: v16u8, b: v16u8) -> v8i16 {
+ msa_hsub_u_h(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Horizontal Subtract
+///
+/// The zero-extended odd elements in vector `b` (eight unsigned 16-bit integer numbers)
+/// are subtracted from the zero-extended elements in vector `a` (eight unsigned 16-bit integer numbers)
+/// producing a result twice the size of the input operands.
+/// The result is written to vector (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(hsub_u.w))]
+pub unsafe fn __msa_hsub_u_w(a: v8u16, b: v8u16) -> v4i32 {
+ msa_hsub_u_w(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Horizontal Subtract
+///
+/// The zero-extended odd elements in vector `b` (four unsigned 32-bit integer numbers)
+/// are subtracted from the zero-extended elements in vector `a` (four unsigned 32-bit integer numbers)
+/// producing a result twice the size of the input operands.
+/// The result is written to vector (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(hsub_u.d))]
+pub unsafe fn __msa_hsub_u_d(a: v4u32, b: v4u32) -> v2i64 {
+ msa_hsub_u_d(a, mem::transmute(b))
+}
+
+/// Vector Interleave Even
+///
+/// Even elements in vectors `a` (sixteen signed 8-bit integer numbers)
+/// and vector `b` (sixteen signed 8-bit integer numbers) are copied to the result
+/// (sixteen signed 8-bit integer numbers)
+/// alternating one element from `a` with one element from `b`.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ilvev.b))]
+pub unsafe fn __msa_ilvev_b(a: v16i8, b: v16i8) -> v16i8 {
+ msa_ilvev_b(a, mem::transmute(b))
+}
+
+/// Vector Interleave Even
+///
+/// Even elements in vectors `a` (eight signed 16-bit integer numbers)
+/// and vector `b` (eight signed 16-bit integer numbers) are copied to the result
+/// (eight signed 16-bit integer numbers)
+/// alternating one element from `a` with one element from `b`.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ilvev.h))]
+pub unsafe fn __msa_ilvev_h(a: v8i16, b: v8i16) -> v8i16 {
+ msa_ilvev_h(a, mem::transmute(b))
+}
+
+/// Vector Interleave Even
+///
+/// Even elements in vectors `a` (four signed 32-bit integer numbers)
+/// and vector `b` (four signed 32-bit integer numbers) are copied to the result
+/// (four signed 32-bit integer numbers)
+/// alternating one element from `a` with one element from `b`.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ilvev.w))]
+pub unsafe fn __msa_ilvev_w(a: v4i32, b: v4i32) -> v4i32 {
+ msa_ilvev_w(a, mem::transmute(b))
+}
+
+/// Vector Interleave Even
+///
+/// Even elements in vectors `a` (two signed 64-bit integer numbers)
+/// and vector `b` (two signed 64-bit integer numbers) are copied to the result
+/// (two signed 64-bit integer numbers)
+/// alternating one element from `a` with one element from `b`.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ilvev.d))]
+pub unsafe fn __msa_ilvev_d(a: v2i64, b: v2i64) -> v2i64 {
+ msa_ilvev_d(a, mem::transmute(b))
+}
+
+/// Vector Interleave Left
+///
+/// The left half elements in vectors `a` (sixteen signed 8-bit integer numbers)
+/// and vector `b` (sixteen signed 8-bit integer numbers) are copied to the result
+/// (sixteen signed 8-bit integer numbers)
+/// alternating one element from `a` with one element from `b`.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ilvl.b))]
+pub unsafe fn __msa_ilvl_b(a: v16i8, b: v16i8) -> v16i8 {
+ msa_ilvl_b(a, mem::transmute(b))
+}
+
+/// Vector Interleave Left
+///
+/// The left half elements in vectors `a` (eight signed 16-bit integer numbers)
+/// and vector `b` (eight signed 16-bit integer numbers) are copied to the result
+/// (eight signed 16-bit integer numbers)
+/// alternating one element from `a` with one element from `b`.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ilvl.h))]
+pub unsafe fn __msa_ilvl_h(a: v8i16, b: v8i16) -> v8i16 {
+ msa_ilvl_h(a, mem::transmute(b))
+}
+
+/// Vector Interleave Left
+///
+/// The left half elements in vectors `a` (four signed 32-bit integer numbers)
+/// and vector `b` (four signed 32-bit integer numbers) are copied to the result
+/// (four signed 32-bit integer numbers)
+/// alternating one element from `a` with one element from `b`.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ilvl.w))]
+pub unsafe fn __msa_ilvl_w(a: v4i32, b: v4i32) -> v4i32 {
+ msa_ilvl_w(a, mem::transmute(b))
+}
+
+/// Vector Interleave Left
+///
+/// The left half elements in vectors `a` (two signed 64-bit integer numbers)
+/// and vector `b` (two signed 64-bit integer numbers) are copied to the result
+/// (two signed 64-bit integer numbers)
+/// alternating one element from `a` with one element from `b`.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ilvl.d))]
+pub unsafe fn __msa_ilvl_d(a: v2i64, b: v2i64) -> v2i64 {
+ msa_ilvl_d(a, mem::transmute(b))
+}
+
+/// Vector Interleave Odd
+///
+/// Odd elements in vectors `a` (sixteen signed 8-bit integer numbers)
+/// and vector `b` (sixteen signed 8-bit integer numbers) are copied to the result
+/// (sixteen signed 8-bit integer numbers)
+/// alternating one element from `a` with one element from `b`.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ilvod.b))]
+pub unsafe fn __msa_ilvod_b(a: v16i8, b: v16i8) -> v16i8 {
+ msa_ilvod_b(a, mem::transmute(b))
+}
+
+/// Vector Interleave Odd
+///
+/// Odd elements in vectors `a` (eight signed 16-bit integer numbers)
+/// and vector `b` (eight signed 16-bit integer numbers) are copied to the result
+/// (eight signed 16-bit integer numbers)
+/// alternating one element from `a` with one element from `b`.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ilvod.h))]
+pub unsafe fn __msa_ilvod_h(a: v8i16, b: v8i16) -> v8i16 {
+ msa_ilvod_h(a, mem::transmute(b))
+}
+
+/// Vector Interleave Odd
+///
+/// Odd elements in vectors `a` (four signed 32-bit integer numbers)
+/// and vector `b` (four signed 32-bit integer numbers) are copied to the result
+/// (four signed 32-bit integer numbers)
+/// alternating one element from `a` with one element from `b`.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ilvod.w))]
+pub unsafe fn __msa_ilvod_w(a: v4i32, b: v4i32) -> v4i32 {
+ msa_ilvod_w(a, mem::transmute(b))
+}
+
+/// Vector Interleave Odd
+///
+/// Odd elements in vectors `a` (two signed 64-bit integer numbers)
+/// and vector `b` (two signed 64-bit integer numbers) are copied to the result
+/// (two signed 64-bit integer numbers)
+/// alternating one element from `a` with one element from `b`.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ilvod.d))]
+pub unsafe fn __msa_ilvod_d(a: v2i64, b: v2i64) -> v2i64 {
+ msa_ilvod_d(a, mem::transmute(b))
+}
+
+/// Vector Interleave Right
+///
+/// The right half elements in vectors `a` (sixteen signed 8-bit integer numbers)
+/// and vector `b` (sixteen signed 8-bit integer numbers) are copied to the result
+/// (sixteen signed 8-bit integer numbers)
+/// alternating one element from `a` with one element from `b`.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ilvr.b))]
+pub unsafe fn __msa_ilvr_b(a: v16i8, b: v16i8) -> v16i8 {
+ msa_ilvr_b(a, mem::transmute(b))
+}
+
+/// Vector Interleave Right
+///
+/// The right half elements in vectors `a` (eight signed 16-bit integer numbers)
+/// and vector `b` (eight signed 16-bit integer numbers) are copied to the result
+/// (eight signed 16-bit integer numbers)
+/// alternating one element from `a` with one element from `b`.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ilvr.h))]
+pub unsafe fn __msa_ilvr_h(a: v8i16, b: v8i16) -> v8i16 {
+ msa_ilvr_h(a, mem::transmute(b))
+}
+
+/// Vector Interleave Right
+///
+/// The right half elements in vectors `a` (four signed 32-bit integer numbers)
+/// and vector `b` (four signed 32-bit integer numbers) are copied to the result
+/// (four signed 32-bit integer numbers)
+/// alternating one element from `a` with one element from `b`.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ilvr.w))]
+pub unsafe fn __msa_ilvr_w(a: v4i32, b: v4i32) -> v4i32 {
+ msa_ilvr_w(a, mem::transmute(b))
+}
+
+/// Vector Interleave Right
+///
+/// The right half elements in vectors `a` (two signed 64-bit integer numbers)
+/// and vector `b` (two signed 64-bit integer numbers) are copied to the result
+/// (two signed 64-bit integer numbers)
+/// alternating one element from `a` with one element from `b`.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ilvr.d))]
+pub unsafe fn __msa_ilvr_d(a: v2i64, b: v2i64) -> v2i64 {
+ msa_ilvr_d(a, mem::transmute(b))
+}
+
+/// GPR Insert Element
+///
+/// Set element `imm4` in vector `a` (sixteen signed 8-bit integer numbers) to GPR `c` value.
+/// All other elements in vector `a` are unchanged. If the source GPR is wider than the
+/// destination data format, the destination's elements will be set to the least significant bits of the GPR.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(insert.b, imm4 = 0b1111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_insert_b<const IMM4: i32>(a: v16i8, c: i32) -> v16i8 {
+ static_assert_imm4!(IMM4);
+ msa_insert_b(a, IMM4, c)
+}
+
+/// GPR Insert Element
+///
+/// Set element `imm3` in vector `a` (eight signed 16-bit integer numbers) to GPR `c` value.
+/// All other elements in vector `a` are unchanged. If the source GPR is wider than the
+/// destination data format, the destination's elements will be set to the least significant bits of the GPR.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(insert.h, imm3 = 0b111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_insert_h<const IMM3: i32>(a: v8i16, c: i32) -> v8i16 {
+ static_assert_imm3!(IMM3);
+ msa_insert_h(a, IMM3, c)
+}
+
+/// GPR Insert Element
+///
+/// Set element `imm2` in vector `a` (four signed 32-bit integer numbers) to GPR `c` value.
+/// All other elements in vector `a` are unchanged. If the source GPR is wider than the
+/// destination data format, the destination's elements will be set to the least significant bits of the GPR.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(insert.w, imm2 = 0b11))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_insert_w<const IMM2: i32>(a: v4i32, c: i32) -> v4i32 {
+ static_assert_imm2!(IMM2);
+ msa_insert_w(a, IMM2, c)
+}
+
+/// GPR Insert Element
+///
+/// Set element `imm1` in vector `a` (two signed 64-bit integer numbers) to GPR `c` value.
+/// All other elements in vector `a` are unchanged. If the source GPR is wider than the
+/// destination data format, the destination's elements will be set to the least significant bits of the GPR.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(insert.d, imm1 = 0b1))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_insert_d<const IMM1: i32>(a: v2i64, c: i64) -> v2i64 {
+ static_assert_imm1!(IMM1);
+ msa_insert_d(a, IMM1, c)
+}
+
+/// Element Insert Element
+///
+/// Set element `imm1` in the result vector `a` (sixteen signed 8-bit integer numbers) to element 0
+/// in vector `c` (sixteen signed 8-bit integer numbers) value.
+/// All other elements in vector `a` are unchanged.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(insve.b, imm4 = 0b1111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_insve_b<const IMM4: i32>(a: v16i8, c: v16i8) -> v16i8 {
+ static_assert_imm4!(IMM4);
+ msa_insve_b(a, IMM4, c)
+}
+
+/// Element Insert Element
+///
+/// Set element `imm1` in the result vector `a` (eight signed 16-bit integer numbers) to element 0
+/// in vector `c` (eight signed 16-bit integer numbers) value.
+/// All other elements in vector `a` are unchanged.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(insve.h, imm3 = 0b111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_insve_h<const IMM3: i32>(a: v8i16, c: v8i16) -> v8i16 {
+ static_assert_imm3!(IMM3);
+ msa_insve_h(a, IMM3, c)
+}
+
+/// Element Insert Element
+///
+/// Set element `imm1` in the result vector `a` (four signed 32-bit integer numbers) to element 0
+/// in vector `c` (four signed 32-bit integer numbers) value.
+/// All other elements in vector `a` are unchanged.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(insve.w, imm2 = 0b11))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_insve_w<const IMM2: i32>(a: v4i32, c: v4i32) -> v4i32 {
+ static_assert_imm2!(IMM2);
+ msa_insve_w(a, IMM2, c)
+}
+
+/// Element Insert Element
+///
+/// Set element `imm1` in the result vector `a` (two signed 64-bit integer numbers) to element 0
+/// in vector `c` (two signed 64-bit integer numbers) value.
+/// All other elements in vector `a` are unchanged.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(insve.d, imm1 = 0b1))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_insve_d<const IMM1: i32>(a: v2i64, c: v2i64) -> v2i64 {
+ static_assert_imm1!(IMM1);
+ msa_insve_d(a, IMM1, c)
+}
+
+/// Vector Load
+///
+/// The WRLEN / 8 bytes at the effective memory location addressed by the base
+/// `mem_addr` and the 10-bit signed immediate offset `imm_s10` are fetched and placed in
+/// the vector (sixteen signed 8-bit integer numbers) value.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ld.b, imm_s10 = 0b1111111111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_ld_b<const IMM_S10: i32>(mem_addr: *mut u8) -> v16i8 {
+ static_assert_imm_s10!(IMM_S10);
+ msa_ld_b(mem_addr, IMM_S10)
+}
+
+/// Vector Load
+///
+/// The WRLEN / 8 bytes at the effective memory location addressed by the base
+/// `mem_addr` and the 10-bit signed immediate offset `imm_s11` are fetched and placed in
+/// the vector (eight signed 16-bit integer numbers) value.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ld.h, imm_s11 = 0b11111111111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_ld_h<const IMM_S11: i32>(mem_addr: *mut u8) -> v8i16 {
+ static_assert_imm_s11!(IMM_S11);
+ static_assert!(IMM_S11: i32 where IMM_S11 % 2 == 0);
+ msa_ld_h(mem_addr, IMM_S11)
+}
+
+/// Vector Load
+///
+/// The WRLEN / 8 bytes at the effective memory location addressed by the base
+/// `mem_addr` and the 10-bit signed immediate offset `imm_s12` are fetched and placed in
+/// the vector (four signed 32-bit integer numbers) value.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ld.w, imm_s12 = 0b111111111111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_ld_w<const IMM_S12: i32>(mem_addr: *mut u8) -> v4i32 {
+ static_assert_imm_s12!(IMM_S12);
+ static_assert!(IMM_S12: i32 where IMM_S12 % 4 == 0);
+ msa_ld_w(mem_addr, IMM_S12)
+}
+
+/// Vector Load
+///
+/// The WRLEN / 8 bytes at the effective memory location addressed by the base
+/// `mem_addr` and the 10-bit signed immediate offset `imm_s13` are fetched and placed in
+/// the vector (two signed 64-bit integer numbers) value.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ld.d, imm_s13 = 0b1111111111111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_ld_d<const IMM_S13: i32>(mem_addr: *mut u8) -> v2i64 {
+ static_assert_imm_s13!(IMM_S13);
+ static_assert!(IMM_S13: i32 where IMM_S13 % 8 == 0);
+ msa_ld_d(mem_addr, IMM_S13)
+}
+
+/// Immediate Load
+///
+/// The signed immediate imm_s10 is replicated in all vector
+/// (sixteen signed 8-bit integer numbers) elements. For byte elements,
+/// only the least significant 8 bits of imm_s10 will be used.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ldi.b, imm_s10 = 0b1111111111))]
+#[rustc_legacy_const_generics(0)]
+pub unsafe fn __msa_ldi_b<const IMM_S10: i32>() -> v16i8 {
+ static_assert_imm_s10!(IMM_S10);
+ msa_ldi_b(IMM_S10)
+}
+
+/// Immediate Load
+///
+/// The signed immediate imm_s10 is replicated in all vector
+/// (eight signed 16-bit integer numbers) elements. For byte elements,
+/// only the least significant 8 bits of imm_s10 will be used.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ldi.h, imm_s10 = 0b1111111111))]
+#[rustc_legacy_const_generics(0)]
+pub unsafe fn __msa_ldi_h<const IMM_S10: i32>() -> v8i16 {
+ static_assert_imm_s10!(IMM_S10);
+ msa_ldi_h(IMM_S10)
+}
+
+/// Immediate Load
+///
+/// The signed immediate imm_s10 is replicated in all vector
+/// (four signed 32-bit integer numbers) elements. For byte elements,
+/// only the least significant 8 bits of imm_s10 will be used.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ldi.w, imm_s10 = 0b1111111111))]
+#[rustc_legacy_const_generics(0)]
+pub unsafe fn __msa_ldi_w<const IMM_S10: i32>() -> v4i32 {
+ static_assert_imm_s10!(IMM_S10);
+ msa_ldi_w(IMM_S10)
+}
+
+/// Immediate Load
+///
+/// The signed immediate imm_s10 is replicated in all vector
+/// (two signed 64-bit integer numbers) elements. For byte elements,
+/// only the least significant 8 bits of imm_s10 will be used.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ldi.d, imm_s10 = 0b1111111111))]
+#[rustc_legacy_const_generics(0)]
+pub unsafe fn __msa_ldi_d<const IMM_S10: i32>() -> v2i64 {
+ static_assert_imm_s10!(IMM_S10);
+ msa_ldi_d(IMM_S10)
+}
+
+/// Vector Fixed-Point Multiply and Add
+///
+/// The products of fixed-point elements in `b` (eight signed 16-bit integer numbers)
+/// by fixed-point elements in vector `c` (eight signed 16-bit integer numbers)
+/// are added to the fixed-point elements in vector `a` (eight signed 16-bit integer numbers).
+/// The multiplication result is not saturated, i.e. exact (-1) * (-1) = 1 is added to the destination.
+/// The saturated fixed-point results are stored to vector `a`.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(madd_q.h))]
+pub unsafe fn __msa_madd_q_h(a: v8i16, b: v8i16, c: v8i16) -> v8i16 {
+ msa_madd_q_h(a, mem::transmute(b), c)
+}
+
+/// Vector Fixed-Point Multiply and Add
+///
+/// The products of fixed-point elements in `b` (four signed 32-bit integer numbers)
+/// by fixed-point elements in vector `c` (four signed 32-bit integer numbers)
+/// are added to the fixed-point elements in vector `a` (four signed 32-bit integer numbers).
+/// The multiplication result is not saturated, i.e. exact (-1) * (-1) = 1 is added to the destination.
+/// The saturated fixed-point results are stored to vector `a`.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(madd_q.w))]
+pub unsafe fn __msa_madd_q_w(a: v4i32, b: v4i32, c: v4i32) -> v4i32 {
+ msa_madd_q_w(a, mem::transmute(b), c)
+}
+
+/// Vector Fixed-Point Multiply and Add Rounded
+///
+/// The products of fixed-point elements in `b` (eight signed 16-bit integer numbers)
+/// by fixed-point elements in vector `c` (eight signed 16-bit integer numbers)
+/// are added to the fixed-point elements in vector `a` (eight signed 16-bit integer numbers).
+/// The multiplication result is not saturated, i.e. exact (-1) * (-1) = 1 is added to the destination.
+/// The rounded and saturated fixed-point results are stored to vector `a`.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(maddr_q.h))]
+pub unsafe fn __msa_maddr_q_h(a: v8i16, b: v8i16, c: v8i16) -> v8i16 {
+ msa_maddr_q_h(a, mem::transmute(b), c)
+}
+
+/// Vector Fixed-Point Multiply and Add Rounded
+///
+/// The products of fixed-point elements in `b` (four signed 32-bit integer numbers)
+/// by fixed-point elements in vector `c` (four signed 32-bit integer numbers)
+/// are added to the fixed-point elements in vector `a` (four signed 32-bit integer numbers).
+/// The multiplication result is not saturated, i.e. exact (-1) * (-1) = 1 is added to the destination.
+/// The rounded and saturated fixed-point results are stored to vector `a`.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(maddr_q.w))]
+pub unsafe fn __msa_maddr_q_w(a: v4i32, b: v4i32, c: v4i32) -> v4i32 {
+ msa_maddr_q_w(a, mem::transmute(b), c)
+}
+
+/// Vector Multiply and Add
+///
+/// The integer elements in vector `b` (sixteen signed 8-bit integer numbers)
+/// are multiplied by integer elements in vector `c` (sixteen signed 8-bit integer numbers)
+/// and added to the integer elements in vector `a` (sixteen signed 8-bit integer numbers).
+/// The most significant half of the multiplication result is discarded.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(maddv.b))]
+pub unsafe fn __msa_maddv_b(a: v16i8, b: v16i8, c: v16i8) -> v16i8 {
+ msa_maddv_b(a, mem::transmute(b), c)
+}
+
+/// Vector Multiply and Add
+///
+/// The integer elements in vector `b` (eight signed 16-bit integer numbers)
+/// are multiplied by integer elements in vector `c` (eight signed 16-bit integer numbers)
+/// and added to the integer elements in vector `a` (eight signed 16-bit integer numbers).
+/// The most significant half of the multiplication result is discarded.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(maddv.h))]
+pub unsafe fn __msa_maddv_h(a: v8i16, b: v8i16, c: v8i16) -> v8i16 {
+ msa_maddv_h(a, mem::transmute(b), c)
+}
+
+/// Vector Multiply and Add
+///
+/// The integer elements in vector `b` (four signed 32-bit integer numbers)
+/// are multiplied by integer elements in vector `c` (four signed 32-bit integer numbers)
+/// and added to the integer elements in vector `a` (four signed 32-bit integer numbers).
+/// The most significant half of the multiplication result is discarded.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(maddv.w))]
+pub unsafe fn __msa_maddv_w(a: v4i32, b: v4i32, c: v4i32) -> v4i32 {
+ msa_maddv_w(a, mem::transmute(b), c)
+}
+
+/// Vector Multiply and Add
+///
+/// The integer elements in vector `b` (two signed 64-bit integer numbers)
+/// are multiplied by integer elements in vector `c` (two signed 64-bit integer numbers)
+/// and added to the integer elements in vector `a` (two signed 64-bit integer numbers).
+/// The most significant half of the multiplication result is discarded.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(maddv.d))]
+pub unsafe fn __msa_maddv_d(a: v2i64, b: v2i64, c: v2i64) -> v2i64 {
+ msa_maddv_d(a, mem::transmute(b), c)
+}
+
+/// Vector Maximum Based on Absolute Values
+///
+/// The value with the largest magnitude, i.e. absolute value, between corresponding
+/// signed elements in vector `a` (sixteen signed 8-bit integer numbers) and
+/// `b` (sixteen signed 8-bit integer numbers) are written to vector
+/// (sixteen signed 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(max_a.b))]
+pub unsafe fn __msa_max_a_b(a: v16i8, b: v16i8) -> v16i8 {
+ msa_max_a_b(a, mem::transmute(b))
+}
+
+/// Vector Maximum Based on Absolute Values
+///
+/// The value with the largest magnitude, i.e. absolute value, between corresponding
+/// signed elements in vector `a` (eight signed 16-bit integer numbers) and
+/// `b` (eight signed 16-bit integer numbers) are written to vector
+/// (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(max_a.h))]
+pub unsafe fn __msa_max_a_h(a: v8i16, b: v8i16) -> v8i16 {
+ msa_max_a_h(a, mem::transmute(b))
+}
+
+/// Vector Maximum Based on Absolute Values
+///
+/// The value with the largest magnitude, i.e. absolute value, between corresponding
+/// signed elements in vector `a` (four signed 32-bit integer numbers) and
+/// `b` (four signed 32-bit integer numbers) are written to vector
+/// (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(max_a.w))]
+pub unsafe fn __msa_max_a_w(a: v4i32, b: v4i32) -> v4i32 {
+ msa_max_a_w(a, mem::transmute(b))
+}
+
+/// Vector Maximum Based on Absolute Values
+///
+/// The value with the largest magnitude, i.e. absolute value, between corresponding
+/// signed elements in vector `a` (two signed 64-bit integer numbers) and
+/// `b` (two signed 64-bit integer numbers) are written to vector
+/// (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(max_a.d))]
+pub unsafe fn __msa_max_a_d(a: v2i64, b: v2i64) -> v2i64 {
+ msa_max_a_d(a, mem::transmute(b))
+}
+
+/// Vector Signed Maximum
+///
+/// Maximum values between signed elements in vector `a` (sixteen signed 8-bit integer numbers)
+/// and signed elements in vector `b` (sixteen signed 8-bit integer numbers) are written to vector
+/// (sixteen signed 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(max_s.b))]
+pub unsafe fn __msa_max_s_b(a: v16i8, b: v16i8) -> v16i8 {
+ msa_max_s_b(a, mem::transmute(b))
+}
+
+/// Vector Signed Maximum
+///
+/// Maximum values between signed elements in vector `a` (eight signed 16-bit integer numbers)
+/// and signed elements in vector `b` (eight signed 16-bit integer numbers) are written to vector
+/// (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(max_s.h))]
+pub unsafe fn __msa_max_s_h(a: v8i16, b: v8i16) -> v8i16 {
+ msa_max_s_h(a, mem::transmute(b))
+}
+
+/// Vector Signed Maximum
+///
+/// Maximum values between signed elements in vector `a` (four signed 32-bit integer numbers)
+/// and signed elements in vector `b` (four signed 32-bit integer numbers) are written to vector
+/// (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(max_s.w))]
+pub unsafe fn __msa_max_s_w(a: v4i32, b: v4i32) -> v4i32 {
+ msa_max_s_w(a, mem::transmute(b))
+}
+
+/// Vector Signed Maximum
+///
+/// Maximum values between signed elements in vector `a` (two signed 64-bit integer numbers)
+/// and signed elements in vector `b` (two signed 64-bit integer numbers) are written to vector
+/// (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(max_s.d))]
+pub unsafe fn __msa_max_s_d(a: v2i64, b: v2i64) -> v2i64 {
+ msa_max_s_d(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Maximum
+///
+/// Maximum values between unsigned elements in vector `a` (sixteen unsigned 8-bit integer numbers)
+/// and unsigned elements in vector `b` (sixteen unsigned 8-bit integer numbers) are written to vector
+/// (sixteen unsigned 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(max_u.b))]
+pub unsafe fn __msa_max_u_b(a: v16u8, b: v16u8) -> v16u8 {
+ msa_max_u_b(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Maximum
+///
+/// Maximum values between unsigned elements in vector `a` (eight unsigned 16-bit integer numbers)
+/// and unsigned elements in vector `b` (eight unsigned 16-bit integer numbers) are written to vector
+/// (eight unsigned 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(max_u.h))]
+pub unsafe fn __msa_max_u_h(a: v8u16, b: v8u16) -> v8u16 {
+ msa_max_u_h(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Maximum
+///
+/// Maximum values between unsigned elements in vector `a` (four unsigned 32-bit integer numbers)
+/// and unsigned elements in vector `b` (four unsigned 32-bit integer numbers) are written to vector
+/// (four unsigned 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(max_u.w))]
+pub unsafe fn __msa_max_u_w(a: v4u32, b: v4u32) -> v4u32 {
+ msa_max_u_w(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Maximum
+///
+/// Maximum values between unsigned elements in vector `a` (two unsigned 64-bit integer numbers)
+/// and unsigned elements in vector `b` (two unsigned 64-bit integer numbers) are written to vector
+/// (two unsigned 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(max_u.d))]
+pub unsafe fn __msa_max_u_d(a: v2u64, b: v2u64) -> v2u64 {
+ msa_max_u_d(a, mem::transmute(b))
+}
+
+/// Immediate Signed Maximum
+///
+/// Maximum values between signed elements in vector `a` (sixteen signed 8-bit integer numbers)
+/// and the 5-bit signed immediate imm_s5 are written to vector
+/// (sixteen signed 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(maxi_s.b, imm5 = 0b11111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_maxi_s_b<const IMM_S5: i32>(a: v16i8) -> v16i8 {
+ static_assert_imm_s5!(IMM_S5);
+ msa_maxi_s_b(a, IMM_S5)
+}
+
+/// Immediate Signed Maximum
+///
+/// Maximum values between signed elements in vector `a` (eight signed 16-bit integer numbers)
+/// and the 5-bit signed immediate imm_s5 are written to vector
+/// (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(maxi_s.h, imm_s5 = 0b11111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_maxi_s_h<const IMM_S5: i32>(a: v8i16) -> v8i16 {
+ static_assert_imm_s5!(IMM_S5);
+ msa_maxi_s_h(a, IMM_S5)
+}
+
+/// Immediate Signed Maximum
+///
+/// Maximum values between signed elements in vector `a` (four signed 32-bit integer numbers)
+/// and the 5-bit signed immediate imm_s5 are written to vector
+/// (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(maxi_s.w, imm_s5 = 0b11111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_maxi_s_w<const IMM_S5: i32>(a: v4i32) -> v4i32 {
+ static_assert_imm_s5!(IMM_S5);
+ msa_maxi_s_w(a, IMM_S5)
+}
+
+/// Immediate Signed Maximum
+///
+/// Maximum values between signed elements in vector `a` (two signed 64-bit integer numbers)
+/// and the 5-bit signed immediate imm_s5 are written to vector
+/// (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(maxi_s.d, imm_s5 = 0b11111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_maxi_s_d<const IMM_S5: i32>(a: v2i64) -> v2i64 {
+ static_assert_imm_s5!(IMM_S5);
+ msa_maxi_s_d(a, IMM_S5)
+}
+
+/// Immediate Unsigned Maximum
+///
+/// Maximum values between unsigned elements in vector `a` (sixteen unsigned 8-bit integer numbers)
+/// and the 5-bit unsigned immediate `imm5` are written to vector
+/// (sixteen unsigned 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(maxi_u.b, imm5 = 0b11111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_maxi_u_b<const IMM5: i32>(a: v16u8) -> v16u8 {
+ static_assert_imm5!(IMM5);
+ msa_maxi_u_b(a, IMM5)
+}
+
+/// Immediate Unsigned Maximum
+///
+/// Maximum values between unsigned elements in vector `a` (eight unsigned 16-bit integer numbers)
+/// and the 5-bit unsigned immediate `imm5` are written to vector
+/// (eight unsigned 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(maxi_u.h, imm5 = 0b11111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_maxi_u_h<const IMM5: i32>(a: v8u16) -> v8u16 {
+ static_assert_imm5!(IMM5);
+ msa_maxi_u_h(a, IMM5)
+}
+
+/// Immediate Unsigned Maximum
+///
+/// Maximum values between unsigned elements in vector `a` (four unsigned 32-bit integer numbers)
+/// and the 5-bit unsigned immediate `imm5` are written to vector
+/// (four unsigned 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(maxi_u.w, imm5 = 0b11111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_maxi_u_w<const IMM5: i32>(a: v4u32) -> v4u32 {
+ static_assert_imm5!(IMM5);
+ msa_maxi_u_w(a, IMM5)
+}
+
+/// Immediate Unsigned Maximum
+///
+/// Maximum values between unsigned elements in vector `a` (two unsigned 64-bit integer numbers)
+/// and the 5-bit unsigned immediate `imm5` are written to vector
+/// (two unsigned 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(maxi_u.d, imm5 = 0b11111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_maxi_u_d<const IMM5: i32>(a: v2u64) -> v2u64 {
+ static_assert_imm5!(IMM5);
+ msa_maxi_u_d(a, IMM5)
+}
+
+/// Vector Minimum Based on Absolute Value
+///
+/// The value with the smallest magnitude, i.e. absolute value, between corresponding
+/// signed elements in vector `a` (sixteen signed 8-bit integer numbers) and
+/// `b` (sixteen signed 8-bit integer numbers) are written to vector
+/// (sixteen signed 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(min_a.b))]
+pub unsafe fn __msa_min_a_b(a: v16i8, b: v16i8) -> v16i8 {
+ msa_min_a_b(a, mem::transmute(b))
+}
+
+/// Vector Minimum Based on Absolute Value
+///
+/// The value with the smallest magnitude, i.e. absolute value, between corresponding
+/// signed elements in vector `a` (eight signed 16-bit integer numbers) and
+/// `b` (eight signed 16-bit integer numbers) are written to vector
+/// (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(min_a.h))]
+pub unsafe fn __msa_min_a_h(a: v8i16, b: v8i16) -> v8i16 {
+ msa_min_a_h(a, mem::transmute(b))
+}
+
+/// Vector Minimum Based on Absolute Value
+///
+/// The value with the smallest magnitude, i.e. absolute value, between corresponding
+/// signed elements in vector `a` (four signed 32-bit integer numbers) and
+/// `b` (four signed 32-bit integer numbers) are written to vector
+/// (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(min_a.w))]
+pub unsafe fn __msa_min_a_w(a: v4i32, b: v4i32) -> v4i32 {
+ msa_min_a_w(a, mem::transmute(b))
+}
+
+/// Vector Minimum Based on Absolute Value
+///
+/// The value with the smallest magnitude, i.e. absolute value, between corresponding
+/// signed elements in vector `a` (two signed 64-bit integer numbers) and
+/// `b` (two signed 64-bit integer numbers) are written to vector
+/// (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(min_a.d))]
+pub unsafe fn __msa_min_a_d(a: v2i64, b: v2i64) -> v2i64 {
+ msa_min_a_d(a, mem::transmute(b))
+}
+
+/// Vector Signed Minimum
+///
+/// Minimum values between signed elements in vector `a` (sixteen signed 8-bit integer numbers)
+/// and signed elements in vector `b` (sixteen signed 8-bit integer numbers) are written to vector
+/// (sixteen signed 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(min_s.b))]
+pub unsafe fn __msa_min_s_b(a: v16i8, b: v16i8) -> v16i8 {
+ msa_min_s_b(a, mem::transmute(b))
+}
+
+/// Vector Signed Minimum
+///
+/// Minimum values between signed elements in vector `a` (eight signed 16-bit integer numbers)
+/// and signed elements in vector `b` (eight signed 16-bit integer numbers) are written to vector
+/// (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(min_s.h))]
+pub unsafe fn __msa_min_s_h(a: v8i16, b: v8i16) -> v8i16 {
+ msa_min_s_h(a, mem::transmute(b))
+}
+
+/// Vector Signed Minimum
+///
+/// Minimum values between signed elements in vector `a` (four signed 32-bit integer numbers)
+/// and signed elements in vector `b` (four signed 32-bit integer numbers) are written to vector
+/// (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(min_s.w))]
+pub unsafe fn __msa_min_s_w(a: v4i32, b: v4i32) -> v4i32 {
+ msa_min_s_w(a, mem::transmute(b))
+}
+
+/// Vector Signed Minimum
+///
+/// Minimum values between signed elements in vector `a` (two signed 64-bit integer numbers)
+/// and signed elements in vector `b` (two signed 64-bit integer numbers) are written to vector
+/// (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(min_s.d))]
+pub unsafe fn __msa_min_s_d(a: v2i64, b: v2i64) -> v2i64 {
+ msa_min_s_d(a, mem::transmute(b))
+}
+
+/// Immediate Signed Minimum
+///
+/// Minimum values between signed elements in vector `a` (sixteen signed 8-bit integer numbers)
+/// and the 5-bit signed immediate imm_s5 are written to vector
+/// (sixteen signed 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(mini_s.b, imm_s5 = 0b11111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_mini_s_b<const IMM_S5: i32>(a: v16i8) -> v16i8 {
+ static_assert_imm_s5!(IMM_S5);
+ msa_mini_s_b(a, IMM_S5)
+}
+
+/// Immediate Signed Minimum
+///
+/// Minimum values between signed elements in vector `a` (eight signed 16-bit integer numbers)
+/// and the 5-bit signed immediate imm_s5 are written to vector
+/// (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(mini_s.h, imm_s5 = 0b11111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_mini_s_h<const IMM_S5: i32>(a: v8i16) -> v8i16 {
+ static_assert_imm_s5!(IMM_S5);
+ msa_mini_s_h(a, IMM_S5)
+}
+
+/// Immediate Signed Minimum
+///
+/// Minimum values between signed elements in vector `a` (four signed 32-bit integer numbers)
+/// and the 5-bit signed immediate imm_s5 are written to vector
+/// (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(mini_s.w, imm_s5 = 0b11111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_mini_s_w<const IMM_S5: i32>(a: v4i32) -> v4i32 {
+ static_assert_imm_s5!(IMM_S5);
+ msa_mini_s_w(a, IMM_S5)
+}
+
+/// Immediate Signed Minimum
+///
+/// Minimum values between signed elements in vector `a` (two signed 64-bit integer numbers)
+/// and the 5-bit signed immediate imm_s5 are written to vector
+/// (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(mini_s.d, imm_s5 = 0b11111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_mini_s_d<const IMM_S5: i32>(a: v2i64) -> v2i64 {
+ static_assert_imm_s5!(IMM_S5);
+ msa_mini_s_d(a, IMM_S5)
+}
+
+/// Vector Unsigned Minimum
+///
+/// Minimum values between unsigned elements in vector `a` (sixteen unsigned 8-bit integer numbers)
+/// and unsigned elements in vector `b` (sixteen unsigned 8-bit integer numbers) are written to vector
+/// (sixteen unsigned 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(min_u.b))]
+pub unsafe fn __msa_min_u_b(a: v16u8, b: v16u8) -> v16u8 {
+ msa_min_u_b(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Minimum
+///
+/// Minimum values between unsigned elements in vector `a` (eight unsigned 16-bit integer numbers)
+/// and unsigned elements in vector `b` (eight unsigned 16-bit integer numbers) are written to vector
+/// (eight unsigned 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(min_u.h))]
+pub unsafe fn __msa_min_u_h(a: v8u16, b: v8u16) -> v8u16 {
+ msa_min_u_h(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Minimum
+///
+/// Minimum values between unsigned elements in vector `a` (four unsigned 32-bit integer numbers)
+/// and unsigned elements in vector `b` (four unsigned 32-bit integer numbers) are written to vector
+/// (four unsigned 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(min_u.w))]
+pub unsafe fn __msa_min_u_w(a: v4u32, b: v4u32) -> v4u32 {
+ msa_min_u_w(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Minimum
+///
+/// Minimum values between unsigned elements in vector `a` (two unsigned 64-bit integer numbers)
+/// and unsigned elements in vector `b` (two unsigned 64-bit integer numbers) are written to vector
+/// (two unsigned 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(min_u.d))]
+pub unsafe fn __msa_min_u_d(a: v2u64, b: v2u64) -> v2u64 {
+ msa_min_u_d(a, mem::transmute(b))
+}
+
+/// Immediate Unsigned Minimum
+///
+/// Minimum values between unsigned elements in vector `a` (sixteen unsigned 8-bit integer numbers)
+/// and the 5-bit unsigned immediate `imm5` are written to vector
+/// (sixteen unsigned 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(mini_u.b, imm5 = 0b11111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_mini_u_b<const IMM5: i32>(a: v16u8) -> v16u8 {
+ static_assert_imm5!(IMM5);
+ msa_mini_u_b(a, IMM5)
+}
+
+/// Immediate Unsigned Minimum
+///
+/// Minimum values between unsigned elements in vector `a` (eight unsigned 16-bit integer numbers)
+/// and the 5-bit unsigned immediate `imm5` are written to vector
+/// (eight unsigned 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(mini_u.h, imm5 = 0b11111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_mini_u_h<const IMM5: i32>(a: v8u16) -> v8u16 {
+ static_assert_imm5!(IMM5);
+ msa_mini_u_h(a, IMM5)
+}
+
+/// Immediate Unsigned Minimum
+///
+/// Minimum values between unsigned elements in vector `a` (four unsigned 32-bit integer numbers)
+/// and the 5-bit unsigned immediate `imm5` are written to vector
+/// (four unsigned 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(mini_u.w, imm5 = 0b11111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_mini_u_w<const IMM5: i32>(a: v4u32) -> v4u32 {
+ static_assert_imm5!(IMM5);
+ msa_mini_u_w(a, IMM5)
+}
+
+/// Immediate Unsigned Minimum
+///
+/// Minimum values between unsigned elements in vector `a` (two unsigned 64-bit integer numbers)
+/// and the 5-bit unsigned immediate `imm5` are written to vector
+/// (two unsigned 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(mini_u.d, imm5 = 0b11111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_mini_u_d<const IMM5: i32>(a: v2u64) -> v2u64 {
+ static_assert_imm5!(IMM5);
+ msa_mini_u_d(a, IMM5)
+}
+
+/// Vector Signed Modulo
+///
+/// The signed integer elements in vector `a` (sixteen signed 8-bit integer numbers)
+/// are divided by signed integer elements in vector `b` (sixteen signed 8-bit integer numbers).
+/// The remainder of the same sign as the dividend is written to vector
+/// (sixteen signed 8-bit integer numbers). If a divisor element vector `b` is zero,
+/// the result value is UNPREDICTABLE.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(mod_s.b))]
+pub unsafe fn __msa_mod_s_b(a: v16i8, b: v16i8) -> v16i8 {
+ msa_mod_s_b(a, mem::transmute(b))
+}
+
+/// Vector Signed Modulo
+///
+/// The signed integer elements in vector `a` (eight signed 16-bit integer numbers)
+/// are divided by signed integer elements in vector `b` (eight signed 16-bit integer numbers).
+/// The remainder of the same sign as the dividend is written to vector
+/// (eight signed 16-bit integer numbers). If a divisor element vector `b` is zero,
+/// the result value is UNPREDICTABLE.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(mod_s.h))]
+pub unsafe fn __msa_mod_s_h(a: v8i16, b: v8i16) -> v8i16 {
+ msa_mod_s_h(a, mem::transmute(b))
+}
+
+/// Vector Signed Modulo
+///
+/// The signed integer elements in vector `a` (four signed 32-bit integer numbers)
+/// are divided by signed integer elements in vector `b` (four signed 32-bit integer numbers).
+/// The remainder of the same sign as the dividend is written to vector
+/// (four signed 32-bit integer numbers). If a divisor element vector `b` is zero,
+/// the result value is UNPREDICTABLE.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(mod_s.w))]
+pub unsafe fn __msa_mod_s_w(a: v4i32, b: v4i32) -> v4i32 {
+ msa_mod_s_w(a, mem::transmute(b))
+}
+
+/// Vector Signed Modulo
+///
+/// The signed integer elements in vector `a` (two signed 64-bit integer numbers)
+/// are divided by signed integer elements in vector `b` (two signed 64-bit integer numbers).
+/// The remainder of the same sign as the dividend is written to vector
+/// (two signed 64-bit integer numbers). If a divisor element vector `b` is zero,
+/// the result value is UNPREDICTABLE.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(mod_s.d))]
+pub unsafe fn __msa_mod_s_d(a: v2i64, b: v2i64) -> v2i64 {
+ msa_mod_s_d(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Modulo
+///
+/// The unsigned integer elements in vector `a` (sixteen unsigned 8-bit integer numbers)
+/// are divided by unsigned integer elements in vector `b` (sixteen unsigned 8-bit integer numbers).
+/// The remainder of the same sign as the dividend is written to vector
+/// (sixteen unsigned 8-bit integer numbers). If a divisor element vector `b` is zero,
+/// the result value is UNPREDICTABLE.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(mod_u.b))]
+pub unsafe fn __msa_mod_u_b(a: v16u8, b: v16u8) -> v16u8 {
+ msa_mod_u_b(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Modulo
+///
+/// The unsigned integer elements in vector `a` (eight unsigned 16-bit integer numbers)
+/// are divided by unsigned integer elements in vector `b` (eight unsigned 16-bit integer numbers).
+/// The remainder of the same sign as the dividend is written to vector
+/// (eight unsigned 16-bit integer numbers). If a divisor element vector `b` is zero,
+/// the result value is UNPREDICTABLE.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(mod_u.h))]
+pub unsafe fn __msa_mod_u_h(a: v8u16, b: v8u16) -> v8u16 {
+ msa_mod_u_h(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Modulo
+///
+/// The unsigned integer elements in vector `a` (four unsigned 32-bit integer numbers)
+/// are divided by unsigned integer elements in vector `b` (four unsigned 32-bit integer numbers).
+/// The remainder of the same sign as the dividend is written to vector
+/// (four unsigned 32-bit integer numbers). If a divisor element vector `b` is zero,
+/// the result value is UNPREDICTABLE.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(mod_u.w))]
+pub unsafe fn __msa_mod_u_w(a: v4u32, b: v4u32) -> v4u32 {
+ msa_mod_u_w(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Modulo
+///
+/// The unsigned integer elements in vector `a` (two unsigned 64-bit integer numbers)
+/// are divided by unsigned integer elements in vector `b` (two unsigned 64-bit integer numbers).
+/// The remainder of the same sign as the dividend is written to vector
+/// (two unsigned 64-bit integer numbers). If a divisor element vector `b` is zero,
+/// the result value is UNPREDICTABLE.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(mod_u.d))]
+pub unsafe fn __msa_mod_u_d(a: v2u64, b: v2u64) -> v2u64 {
+ msa_mod_u_d(a, mem::transmute(b))
+}
+
+/// Vector Move
+///
+/// Copy all WRLEN bits in vector `a` (eight signed 16-bit integer numbers)
+/// to vector (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(move.v))]
+pub unsafe fn __msa_move_v(a: v16i8) -> v16i8 {
+ msa_move_v(a)
+}
+
+/// Vector Fixed-Point Multiply and Subtract
+///
+/// The product of fixed-point elements in vector `c` (eight signed 16-bit integer numbers)
+/// by fixed-point elements in vector `b` (eight signed 16-bit integer numbers)
+/// are subtracted from the fixed-point elements in vector `a`
+/// (eight signed 16-bit integer numbers). The multiplication result is not saturated,
+/// i.e. exact (-1) * (-1) = 1 is subtracted from the destination.
+/// The saturated fixed-point results are stored back to vector `a`.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(msub_q.h))]
+pub unsafe fn __msa_msub_q_h(a: v8i16, b: v8i16, c: v8i16) -> v8i16 {
+ msa_msub_q_h(a, mem::transmute(b), c)
+}
+
+/// Vector Fixed-Point Multiply and Subtract
+///
+/// The product of fixed-point elements in vector `c` (four signed 32-bit integer numbers)
+/// by fixed-point elements in vector `b` (four signed 32-bit integer numbers)
+/// are subtracted from the fixed-point elements in vector `a`
+/// (four signed 32-bit integer numbers). The multiplication result is not saturated,
+/// i.e. exact (-1) * (-1) = 1 is subtracted from the destination.
+/// The saturated fixed-point results are stored back to vector `a`.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(msub_q.w))]
+pub unsafe fn __msa_msub_q_w(a: v4i32, b: v4i32, c: v4i32) -> v4i32 {
+ msa_msub_q_w(a, mem::transmute(b), c)
+}
+
+/// Vector Fixed-Point Multiply and Subtract Rounded
+///
+/// The product of fixed-point elements in vector `c` (eight signed 16-bit integer numbers)
+/// by fixed-point elements in vector `b` (eight signed 16-bit integer numbers)
+/// are subtracted from the fixed-point elements in vector `a`
+/// (eight signed 16-bit integer numbers). The multiplication result is not saturated,
+/// i.e. exact (-1) * (-1) = 1 is subtracted from the destination.
+/// The rounded and saturated fixed-point results are stored back to vector `a`.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(msubr_q.h))]
+pub unsafe fn __msa_msubr_q_h(a: v8i16, b: v8i16, c: v8i16) -> v8i16 {
+ msa_msubr_q_h(a, mem::transmute(b), c)
+}
+
+/// Vector Fixed-Point Multiply and Subtract Rounded
+///
+/// The product of fixed-point elements in vector `c` (four signed 32-bit integer numbers)
+/// by fixed-point elements in vector `b` (four signed 32-bit integer numbers)
+/// are subtracted from the fixed-point elements in vector `a`
+/// (four signed 32-bit integer numbers). The multiplication result is not saturated,
+/// i.e. exact (-1) * (-1) = 1 is subtracted from the destination.
+/// The rounded and saturated fixed-point results are stored back to vector `a`.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(msubr_q.w))]
+pub unsafe fn __msa_msubr_q_w(a: v4i32, b: v4i32, c: v4i32) -> v4i32 {
+ msa_msubr_q_w(a, mem::transmute(b), c)
+}
+
+/// Vector Multiply and Subtract
+///
+/// The integer elements in vector `c` (sixteen signed 8-bit integer numbers)
+/// are multiplied by integer elements in vector `b` (sixteen signed 8-bit integer numbers)
+/// and subtracted from the integer elements in vector `a` (sixteen signed 8-bit integer numbers).
+/// The most significant half of the multiplication result is discarded.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(msubv.b))]
+pub unsafe fn __msa_msubv_b(a: v16i8, b: v16i8, c: v16i8) -> v16i8 {
+ msa_msubv_b(a, mem::transmute(b), c)
+}
+
+/// Vector Multiply and Subtract
+///
+/// The integer elements in vector `c` (eight signed 16-bit integer numbers)
+/// are multiplied by integer elements in vector `b` (eight signed 16-bit integer numbers)
+/// and subtracted from the integer elements in vector `a` (eight signed 16-bit integer numbers).
+/// The most significant half of the multiplication result is discarded.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(msubv.h))]
+pub unsafe fn __msa_msubv_h(a: v8i16, b: v8i16, c: v8i16) -> v8i16 {
+ msa_msubv_h(a, mem::transmute(b), c)
+}
+
+/// Vector Multiply and Subtract
+///
+/// The integer elements in vector `c` (four signed 32-bit integer numbers)
+/// are multiplied by integer elements in vector `b` (four signed 32-bit integer numbers)
+/// and subtracted from the integer elements in vector `a` (four signed 32-bit integer numbers).
+/// The most significant half of the multiplication result is discarded.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(msubv.w))]
+pub unsafe fn __msa_msubv_w(a: v4i32, b: v4i32, c: v4i32) -> v4i32 {
+ msa_msubv_w(a, mem::transmute(b), c)
+}
+
+/// Vector Multiply and Subtract
+///
+/// The integer elements in vector `c` (two signed 64-bit integer numbers)
+/// are multiplied by integer elements in vector `b` (two signed 64-bit integer numbers)
+/// and subtracted from the integer elements in vector `a` (two signed 64-bit integer numbers).
+/// The most significant half of the multiplication result is discarded.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(msubv.d))]
+pub unsafe fn __msa_msubv_d(a: v2i64, b: v2i64, c: v2i64) -> v2i64 {
+ msa_msubv_d(a, mem::transmute(b), c)
+}
+
+/// Vector Fixed-Point Multiply
+///
+/// The fixed-point elements in vector `a` (eight signed 16-bit integer numbers)
+/// multiplied by fixed-point elements in vector `b` (eight signed 16-bit integer numbers).
+/// The result is written to vector (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(mul_q.h))]
+pub unsafe fn __msa_mul_q_h(a: v8i16, b: v8i16) -> v8i16 {
+ msa_mul_q_h(a, mem::transmute(b))
+}
+
+/// Vector Fixed-Point Multiply
+///
+/// The fixed-point elements in vector `a` (four signed 32-bit integer numbers)
+/// multiplied by fixed-point elements in vector `b` (four signed 32-bit integer numbers).
+/// The result is written to vector (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(mul_q.w))]
+pub unsafe fn __msa_mul_q_w(a: v4i32, b: v4i32) -> v4i32 {
+ msa_mul_q_w(a, mem::transmute(b))
+}
+
+/// Vector Fixed-Point Multiply Rounded
+///
+/// The fixed-point elements in vector `a` (eight signed 16-bit integer numbers)
+/// multiplied by fixed-point elements in vector `b` (eight signed 16-bit integer numbers).
+/// The rounded result is written to vector (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(mulr_q.h))]
+pub unsafe fn __msa_mulr_q_h(a: v8i16, b: v8i16) -> v8i16 {
+ msa_mulr_q_h(a, mem::transmute(b))
+}
+
+/// Vector Fixed-Point Multiply Rounded
+///
+/// The fixed-point elements in vector `a` (four signed 32-bit integer numbers)
+/// multiplied by fixed-point elements in vector `b` (four signed 32-bit integer numbers).
+/// The rounded result is written to vector (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(mulr_q.w))]
+pub unsafe fn __msa_mulr_q_w(a: v4i32, b: v4i32) -> v4i32 {
+ msa_mulr_q_w(a, mem::transmute(b))
+}
+
+/// Vector Multiply
+///
+/// The integer elements in vector `a` (sixteen signed 8-bit integer numbers)
+/// are multiplied by integer elements in vector `b` (sixteen signed 8-bit integer numbers).
+/// The result is written to vector (sixteen signed 8-bit integer numbers).
+/// The most significant half of the multiplication result is discarded.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(mulv.b))]
+pub unsafe fn __msa_mulv_b(a: v16i8, b: v16i8) -> v16i8 {
+ msa_mulv_b(a, mem::transmute(b))
+}
+
+/// Vector Multiply
+///
+/// The integer elements in vector `a` (eight signed 16-bit integer numbers)
+/// are multiplied by integer elements in vector `b` (eight signed 16-bit integer numbers).
+/// The result is written to vector (eight signed 16-bit integer numbers).
+/// The most significant half of the multiplication result is discarded.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(mulv.h))]
+pub unsafe fn __msa_mulv_h(a: v8i16, b: v8i16) -> v8i16 {
+ msa_mulv_h(a, mem::transmute(b))
+}
+
+/// Vector Multiply
+///
+/// The integer elements in vector `a` (four signed 32-bit integer numbers)
+/// are multiplied by integer elements in vector `b` (four signed 32-bit integer numbers).
+/// The result is written to vector (four signed 32-bit integer numbers).
+/// The most significant half of the multiplication result is discarded.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(mulv.w))]
+pub unsafe fn __msa_mulv_w(a: v4i32, b: v4i32) -> v4i32 {
+ msa_mulv_w(a, mem::transmute(b))
+}
+
+/// Vector Multiply
+///
+/// The integer elements in vector `a` (two signed 64-bit integer numbers)
+/// are multiplied by integer elements in vector `b` (two signed 64-bit integer numbers).
+/// The result is written to vector (two signed 64-bit integer numbers).
+/// The most significant half of the multiplication result is discarded.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(mulv.d))]
+pub unsafe fn __msa_mulv_d(a: v2i64, b: v2i64) -> v2i64 {
+ msa_mulv_d(a, mem::transmute(b))
+}
+
+/// Vector Leading Ones Count
+///
+/// The number of leading ones for elements in vector `a` (sixteen signed 8-bit integer numbers)
+/// is stored to the elements in vector (sixteen signed 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(nloc.b))]
+pub unsafe fn __msa_nloc_b(a: v16i8) -> v16i8 {
+ msa_nloc_b(a)
+}
+
+/// Vector Leading Ones Count
+///
+/// The number of leading ones for elements in vector `a` (eight signed 16-bit integer numbers)
+/// is stored to the elements in vector (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(nloc.h))]
+pub unsafe fn __msa_nloc_h(a: v8i16) -> v8i16 {
+ msa_nloc_h(a)
+}
+
+/// Vector Leading Ones Count
+///
+/// The number of leading ones for elements in vector `a` (four signed 32-bit integer numbers)
+/// is stored to the elements in vector (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(nloc.w))]
+pub unsafe fn __msa_nloc_w(a: v4i32) -> v4i32 {
+ msa_nloc_w(a)
+}
+
+/// Vector Leading Ones Count
+///
+/// The number of leading ones for elements in vector `a` (two signed 64-bit integer numbers)
+/// is stored to the elements in vector (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(nloc.d))]
+pub unsafe fn __msa_nloc_d(a: v2i64) -> v2i64 {
+ msa_nloc_d(a)
+}
+
+/// Vector Leading Zeros Count
+///
+/// The number of leading zeros for elements in vector `a` (sixteen signed 8-bit integer numbers)
+/// is stored to the elements in vector (sixteen signed 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(nlzc.b))]
+pub unsafe fn __msa_nlzc_b(a: v16i8) -> v16i8 {
+ msa_nlzc_b(a)
+}
+
+/// Vector Leading Zeros Count
+///
+/// The number of leading zeros for elements in vector `a` (eight signed 16-bit integer numbers)
+/// is stored to the elements in vector (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(nlzc.h))]
+pub unsafe fn __msa_nlzc_h(a: v8i16) -> v8i16 {
+ msa_nlzc_h(a)
+}
+
+/// Vector Leading Zeros Count
+///
+/// The number of leading zeros for elements in vector `a` (four signed 32-bit integer numbers)
+/// is stored to the elements in vector (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(nlzc.w))]
+pub unsafe fn __msa_nlzc_w(a: v4i32) -> v4i32 {
+ msa_nlzc_w(a)
+}
+
+/// Vector Leading Zeros Count
+///
+/// The number of leading zeros for elements in vector `a` (two signed 64-bit integer numbers)
+/// is stored to the elements in vector (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(nlzc.d))]
+pub unsafe fn __msa_nlzc_d(a: v2i64) -> v2i64 {
+ msa_nlzc_d(a)
+}
+
+/// Vector Logical Negated Or
+///
+/// Each bit of vector `a` (sixteen unsigned 8-bit integer numbers)
+/// is combined with the corresponding bit of vector `b` (sixteen unsigned 8-bit integer numbers)
+/// in a bitwise logical NOR operation. The result is written to vector
+/// (sixteen unsigned 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(nor.v))]
+pub unsafe fn __msa_nor_v(a: v16u8, b: v16u8) -> v16u8 {
+ msa_nor_v(a, mem::transmute(b))
+}
+
+/// Immediate Logical Negated Or
+///
+/// Each bit of vector `a` (sixteen unsigned 8-bit integer numbers)
+/// is combined with the 8-bit immediate `imm8`
+/// in a bitwise logical NOR operation. The result is written to vector
+/// (sixteen unsigned 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(nori.b, imm8 = 0b11111111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_nori_b<const IMM8: i32>(a: v16u8) -> v16u8 {
+ static_assert_imm8!(IMM8);
+ msa_nori_b(a, IMM8)
+}
+
+/// Vector Logical Or
+///
+/// Each bit of vector `a` (sixteen unsigned 8-bit integer numbers)
+/// is combined with the corresponding bit of vector `b` (sixteen unsigned 8-bit integer numbers)
+/// in a bitwise logical OR operation. The result is written to vector
+/// (sixteen unsigned 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(or.v))]
+pub unsafe fn __msa_or_v(a: v16u8, b: v16u8) -> v16u8 {
+ msa_or_v(a, mem::transmute(b))
+}
+
+/// Immediate Logical Or
+///
+/// Each bit of vector `a` (sixteen unsigned 8-bit integer numbers)
+/// is combined with the 8-bit immediate `imm8`
+/// in a bitwise logical OR operation. The result is written to vector
+/// (sixteen unsigned 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(ori.b, imm8 = 0b11111111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_ori_b<const IMM8: i32>(a: v16u8) -> v16u8 {
+ static_assert_imm8!(IMM8);
+ msa_ori_b(a, IMM8)
+}
+
+/// Vector Pack Even
+///
+/// Even elements in vectors `a` (sixteen signed 8-bit integer numbers)
+/// are copied to the left half of the result vector and even elements in vector `b`
+/// (sixteen signed 8-bit integer numbers) are copied to the right half of the result vector.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(pckev.b))]
+pub unsafe fn __msa_pckev_b(a: v16i8, b: v16i8) -> v16i8 {
+ msa_pckev_b(a, mem::transmute(b))
+}
+
+/// Vector Pack Even
+///
+/// Even elements in vectors `a` (eight signed 16-bit integer numbers)
+/// are copied to the left half of the result vector and even elements in vector `b`
+/// (eight signed 16-bit integer numbers) are copied to the right half of the result vector.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(pckev.h))]
+pub unsafe fn __msa_pckev_h(a: v8i16, b: v8i16) -> v8i16 {
+ msa_pckev_h(a, mem::transmute(b))
+}
+
+/// Vector Pack Even
+///
+/// Even elements in vectors `a` (four signed 32-bit integer numbers)
+/// are copied to the left half of the result vector and even elements in vector `b`
+/// (four signed 32-bit integer numbers) are copied to the right half of the result vector.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(pckev.w))]
+pub unsafe fn __msa_pckev_w(a: v4i32, b: v4i32) -> v4i32 {
+ msa_pckev_w(a, mem::transmute(b))
+}
+
+/// Vector Pack Even
+///
+/// Even elements in vectors `a` (two signed 64-bit integer numbers)
+/// are copied to the left half of the result vector and even elements in vector `b`
+/// (two signed 64-bit integer numbers) are copied to the right half of the result vector.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(pckev.d))]
+pub unsafe fn __msa_pckev_d(a: v2i64, b: v2i64) -> v2i64 {
+ msa_pckev_d(a, mem::transmute(b))
+}
+
+/// Vector Pack Odd
+///
+/// Odd elements in vectors `a` (sixteen signed 8-bit integer numbers)
+/// are copied to the left half of the result vector and odd elements in vector `b`
+/// (sixteen signed 8-bit integer numbers) are copied to the right half of the result vector.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(pckod.b))]
+pub unsafe fn __msa_pckod_b(a: v16i8, b: v16i8) -> v16i8 {
+ msa_pckod_b(a, mem::transmute(b))
+}
+
+/// Vector Pack Odd
+///
+/// Odd elements in vectors `a` (eight signed 16-bit integer numbers)
+/// are copied to the left half of the result vector and odd elements in vector `b`
+/// (eight signed 16-bit integer numbers) are copied to the right half of the result vector.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(pckod.h))]
+pub unsafe fn __msa_pckod_h(a: v8i16, b: v8i16) -> v8i16 {
+ msa_pckod_h(a, mem::transmute(b))
+}
+
+/// Vector Pack Odd
+///
+/// Odd elements in vectors `a` (four signed 32-bit integer numbers)
+/// are copied to the left half of the result vector and odd elements in vector `b`
+/// (four signed 32-bit integer numbers) are copied to the right half of the result vector.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(pckod.w))]
+pub unsafe fn __msa_pckod_w(a: v4i32, b: v4i32) -> v4i32 {
+ msa_pckod_w(a, mem::transmute(b))
+}
+
+/// Vector Pack Odd
+///
+/// Odd elements in vectors `a` (two signed 64-bit integer numbers)
+/// are copied to the left half of the result vector and odd elements in vector `b`
+/// (two signed 64-bit integer numbers) are copied to the right half of the result vector.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(pckod.d))]
+pub unsafe fn __msa_pckod_d(a: v2i64, b: v2i64) -> v2i64 {
+ msa_pckod_d(a, mem::transmute(b))
+}
+
+/// Vector Population Count
+///
+/// The number of bits set to 1 for elements in vector `a` (sixteen signed 8-bit integer numbers)
+/// is stored to the elements in the result vector (sixteen signed 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(pcnt.b))]
+pub unsafe fn __msa_pcnt_b(a: v16i8) -> v16i8 {
+ msa_pcnt_b(a)
+}
+
+/// Vector Population Count
+///
+/// The number of bits set to 1 for elements in vector `a` (eight signed 16-bit integer numbers)
+/// is stored to the elements in the result vector (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(pcnt.h))]
+pub unsafe fn __msa_pcnt_h(a: v8i16) -> v8i16 {
+ msa_pcnt_h(a)
+}
+
+/// Vector Population Count
+///
+/// The number of bits set to 1 for elements in vector `a` (four signed 32-bit integer numbers)
+/// is stored to the elements in the result vector (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(pcnt.w))]
+pub unsafe fn __msa_pcnt_w(a: v4i32) -> v4i32 {
+ msa_pcnt_w(a)
+}
+
+/// Vector Population Count
+///
+/// The number of bits set to 1 for elements in vector `a` (two signed 64-bit integer numbers)
+/// is stored to the elements in the result vector (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(pcnt.d))]
+pub unsafe fn __msa_pcnt_d(a: v2i64) -> v2i64 {
+ msa_pcnt_d(a)
+}
+
+/// Immediate Signed Saturate
+///
+/// Signed elements in vector `a` (sixteen signed 8-bit integer numbers)
+/// are saturated to signed values of `imm3+1` bits without changing the data width.
+/// The result is stored in the vector (sixteen signed 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(sat_s.b, imm4 = 0b111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_sat_s_b<const IMM3: i32>(a: v16i8) -> v16i8 {
+ static_assert_imm3!(IMM3);
+ msa_sat_s_b(a, IMM3)
+}
+
+/// Immediate Signed Saturate
+///
+/// Signed elements in vector `a` (eight signed 16-bit integer numbers)
+/// are saturated to signed values of `imm4+1` bits without changing the data width.
+/// The result is stored in the vector (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(sat_s.h, imm3 = 0b1111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_sat_s_h<const IMM4: i32>(a: v8i16) -> v8i16 {
+ static_assert_imm4!(IMM4);
+ msa_sat_s_h(a, IMM4)
+}
+
+/// Immediate Signed Saturate
+///
+/// Signed elements in vector `a` (four signed 32-bit integer numbers)
+/// are saturated to signed values of `imm5+1` bits without changing the data width.
+/// The result is stored in the vector (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(sat_s.w, imm2 = 0b11111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_sat_s_w<const IMM5: i32>(a: v4i32) -> v4i32 {
+ static_assert_imm5!(IMM5);
+ msa_sat_s_w(a, IMM5)
+}
+
+/// Immediate Signed Saturate
+///
+/// Signed elements in vector `a` (two signed 64-bit integer numbers)
+/// are saturated to signed values of `imm6+1` bits without changing the data width.
+/// The result is stored in the vector (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(sat_s.d, imm1 = 0b111111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_sat_s_d<const IMM6: i32>(a: v2i64) -> v2i64 {
+ static_assert_imm6!(IMM6);
+ msa_sat_s_d(a, IMM6)
+}
+
+/// Immediate Unsigned Saturate
+///
+/// Unsigned elements in vector `a` (sixteen unsigned 8-bit integer numbers)
+/// are saturated to unsigned values of `imm3+1` bits without changing the data width.
+/// The result is stored in the vector (sixteen unsigned 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(sat_u.b, imm4 = 0b111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_sat_u_b<const IMM3: i32>(a: v16u8) -> v16u8 {
+ static_assert_imm3!(IMM3);
+ msa_sat_u_b(a, IMM3)
+}
+
+/// Immediate Unsigned Saturate
+///
+/// Unsigned elements in vector `a` (eight unsigned 16-bit integer numbers)
+/// are saturated to unsigned values of `imm4+1` bits without changing the data width.
+/// The result is stored in the vector (eight unsigned 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(sat_u.h, imm3 = 0b1111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_sat_u_h<const IMM4: i32>(a: v8u16) -> v8u16 {
+ static_assert_imm4!(IMM4);
+ msa_sat_u_h(a, IMM4)
+}
+
+/// Immediate Unsigned Saturate
+///
+/// Unsigned elements in vector `a` (four unsigned 32-bit integer numbers)
+/// are saturated to unsigned values of `imm5+1` bits without changing the data width.
+/// The result is stored in the vector (four unsigned 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(sat_u.w, imm2 = 0b11111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_sat_u_w<const IMM5: i32>(a: v4u32) -> v4u32 {
+ static_assert_imm5!(IMM5);
+ msa_sat_u_w(a, IMM5)
+}
+
+/// Immediate Unsigned Saturate
+///
+/// Unsigned elements in vector `a` (two unsigned 64-bit integer numbers)
+/// are saturated to unsigned values of `imm6+1` bits without changing the data width.
+/// The result is stored in the vector (two unsigned 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(sat_u.d, imm1 = 0b111111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_sat_u_d<const IMM6: i32>(a: v2u64) -> v2u64 {
+ static_assert_imm6!(IMM6);
+ msa_sat_u_d(a, IMM6)
+}
+
+/// Immediate Set Shuffle Elements
+///
+/// The set shuffle instruction works on 4-element sets.
+/// All sets are shuffled in the same way: the element i82i+1..2i in `a`
+/// (sixteen signed 8-bit integer numbers) is copied over the element i in result vector
+/// (sixteen signed 8-bit integer numbers), where i is 0, 1, 2, 3.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(shf.b, imm8 = 0b11111111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_shf_b<const IMM8: i32>(a: v16i8) -> v16i8 {
+ static_assert_imm8!(IMM8);
+ msa_shf_b(a, IMM8)
+}
+
+/// Immediate Set Shuffle Elements
+///
+/// The set shuffle instruction works on 4-element sets.
+/// All sets are shuffled in the same way: the element i82i+1..2i in `a`
+/// (eight signed 16-bit integer numbers) is copied over the element i in result vector
+/// (eight signed 16-bit integer numbers), where i is 0, 1, 2, 3.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(shf.h, imm8 = 0b11111111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_shf_h<const IMM8: i32>(a: v8i16) -> v8i16 {
+ static_assert_imm8!(IMM8);
+ msa_shf_h(a, IMM8)
+}
+
+/// Immediate Set Shuffle Elements
+///
+/// The set shuffle instruction works on 4-element sets.
+/// All sets are shuffled in the same way: the element i82i+1..2i in `a`
+/// (four signed 32-bit integer numbers) is copied over the element i in result vector
+/// (four signed 32-bit integer numbers), where i is 0, 1, 2, 3.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(shf.w, imm8 = 0b11111111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_shf_w<const IMM8: i32>(a: v4i32) -> v4i32 {
+ static_assert_imm8!(IMM8);
+ msa_shf_w(a, IMM8)
+}
+
+/// GPR Columns Slide
+///
+/// Vector registers `a` (sixteen signed 8-bit integer numbers) and `b`
+/// (sixteen signed 8-bit integer numbers) contain 2-dimensional byte arrays (rectangles)
+/// stored row-wise with as many rows as bytes in integer data format df.
+/// The two source rectangles `b` and `a` are concatenated horizontally in the order
+/// they appear in the syntax, i.e. first `a` and then `b`. Place a new destination
+/// rectangle over `b` and then slide it to the left over the concatenation of `a` and `b`
+/// by the number of columns given in GPR `c`.
+/// The result is written to vector (sixteen signed 8-bit integer numbers).
+/// GPR `c` value is interpreted modulo the number of columns in destination rectangle,
+/// or equivalently, the number of data format df elements in the destination vector.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(sld.b))]
+pub unsafe fn __msa_sld_b(a: v16i8, b: v16i8, c: i32) -> v16i8 {
+ msa_sld_b(a, mem::transmute(b), c)
+}
+
+/// GPR Columns Slide
+///
+/// Vector registers `a` (eight signed 16-bit integer numbers) and `b`
+/// (eight signed 16-bit integer numbers) contain 2-dimensional byte arrays (rectangles)
+/// stored row-wise with as many rows as bytes in integer data format df.
+/// The two source rectangles `b` and `a` are concatenated horizontally in the order
+/// they appear in the syntax, i.e. first `a` and then `b`. Place a new destination
+/// rectangle over `b` and then slide it to the left over the concatenation of `a` and `b`
+/// by the number of columns given in GPR `c`.
+/// The result is written to vector (eight signed 16-bit integer numbers).
+/// GPR `c` value is interpreted modulo the number of columns in destination rectangle,
+/// or equivalently, the number of data format df elements in the destination vector.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(sld.h))]
+pub unsafe fn __msa_sld_h(a: v8i16, b: v8i16, c: i32) -> v8i16 {
+ msa_sld_h(a, mem::transmute(b), c)
+}
+
+/// GPR Columns Slide
+///
+/// Vector registers `a` (four signed 32-bit integer numbers) and `b`
+/// (four signed 32-bit integer numbers) contain 2-dimensional byte arrays (rectangles)
+/// stored row-wise with as many rows as bytes in integer data format df.
+/// The two source rectangles `b` and `a` are concatenated horizontally in the order
+/// they appear in the syntax, i.e. first `a` and then `b`. Place a new destination
+/// rectangle over `b` and then slide it to the left over the concatenation of `a` and `b`
+/// by the number of columns given in GPR `c`.
+/// The result is written to vector (four signed 32-bit integer numbers).
+/// GPR `c` value is interpreted modulo the number of columns in destination rectangle,
+/// or equivalently, the number of data format df elements in the destination vector.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(sld.w))]
+pub unsafe fn __msa_sld_w(a: v4i32, b: v4i32, c: i32) -> v4i32 {
+ msa_sld_w(a, mem::transmute(b), c)
+}
+
+/// GPR Columns Slide
+///
+/// Vector registers `a` (two signed 64-bit integer numbers) and `b`
+/// (two signed 64-bit integer numbers) contain 2-dimensional byte arrays (rectangles)
+/// stored row-wise with as many rows as bytes in integer data format df.
+/// The two source rectangles `b` and `a` are concatenated horizontally in the order
+/// they appear in the syntax, i.e. first `a` and then `b`. Place a new destination
+/// rectangle over `b` and then slide it to the left over the concatenation of `a` and `b`
+/// by the number of columns given in GPR `c`.
+/// The result is written to vector (two signed 64-bit integer numbers).
+/// GPR `c` value is interpreted modulo the number of columns in destination rectangle,
+/// or equivalently, the number of data format df elements in the destination vector.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(sld.d))]
+pub unsafe fn __msa_sld_d(a: v2i64, b: v2i64, c: i32) -> v2i64 {
+ msa_sld_d(a, mem::transmute(b), c)
+}
+
+/// Immediate Columns Slide
+///
+/// Vector registers `a` (sixteen signed 8-bit integer numbers) and `b`
+/// (sixteen signed 8-bit integer numbers) contain 2-dimensional byte arrays (rectangles)
+/// stored row-wise with as many rows as bytes in integer data format df.
+/// The two source rectangles `b` and `a` are concatenated horizontally in the order
+/// they appear in the syntax, i.e. first `a` and then `b`. Place a new destination
+/// rectangle over `b` and then slide it to the left over the concatenation of `a` and `b`
+/// by `imm1` columns.
+/// The result is written to vector (sixteen signed 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(sldi.b, imm4 = 0b1111))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn __msa_sldi_b<const IMM4: i32>(a: v16i8, b: v16i8) -> v16i8 {
+ static_assert_imm4!(IMM4);
+ msa_sldi_b(a, mem::transmute(b), IMM4)
+}
+
+/// Immediate Columns Slide
+///
+/// Vector registers `a` (eight signed 16-bit integer numbers) and `b`
+/// (eight signed 16-bit integer numbers) contain 2-dimensional byte arrays (rectangles)
+/// stored row-wise with as many rows as bytes in integer data format df.
+/// The two source rectangles `b` and `a` are concatenated horizontally in the order
+/// they appear in the syntax, i.e. first `a` and then `b`. Place a new destination
+/// rectangle over `b` and then slide it to the left over the concatenation of `a` and `b`
+/// by `imm1` columns.
+/// The result is written to vector (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(sldi.h, imm3 = 0b111))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn __msa_sldi_h<const IMM3: i32>(a: v8i16, b: v8i16) -> v8i16 {
+ static_assert_imm3!(IMM3);
+ msa_sldi_h(a, mem::transmute(b), IMM3)
+}
+
+/// Immediate Columns Slide
+///
+/// Vector registers `a` (four signed 32-bit integer numbers) and `b`
+/// (four signed 32-bit integer numbers) contain 2-dimensional byte arrays (rectangles)
+/// stored row-wise with as many rows as bytes in integer data format df.
+/// The two source rectangles `b` and `a` are concatenated horizontally in the order
+/// they appear in the syntax, i.e. first `a` and then `b`. Place a new destination
+/// rectangle over `b` and then slide it to the left over the concatenation of `a` and `b`
+/// by `imm1` columns.
+/// The result is written to vector (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(sldi.w, imm2 = 0b11))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn __msa_sldi_w<const IMM2: i32>(a: v4i32, b: v4i32) -> v4i32 {
+ static_assert_imm2!(IMM2);
+ msa_sldi_w(a, mem::transmute(b), IMM2)
+}
+
+/// Immediate Columns Slide
+///
+/// Vector registers `a` (two signed 64-bit integer numbers) and `b`
+/// (two signed 64-bit integer numbers) contain 2-dimensional byte arrays (rectangles)
+/// stored row-wise with as many rows as bytes in integer data format df.
+/// The two source rectangles `b` and `a` are concatenated horizontally in the order
+/// they appear in the syntax, i.e. first `a` and then `b`. Place a new destination
+/// rectangle over `b` and then slide it to the left over the concatenation of `a` and `b`
+/// by `imm1` columns.
+/// The result is written to vector (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(sldi.d, imm1 = 0b1))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn __msa_sldi_d<const IMM1: i32>(a: v2i64, b: v2i64) -> v2i64 {
+ static_assert_imm1!(IMM1);
+ msa_sldi_d(a, mem::transmute(b), IMM1)
+}
+
+/// Vector Shift Left
+///
+/// The elements in vector `a` (sixteen signed 8-bit integer numbers)
+/// are shifted left by the number of bits the elements in vector `b`
+/// (sixteen signed 8-bit integer numbers) specify modulo the size of the
+/// element in bits. The result is written to vector (sixteen signed 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(sll.b))]
+pub unsafe fn __msa_sll_b(a: v16i8, b: v16i8) -> v16i8 {
+ msa_sll_b(a, mem::transmute(b))
+}
+
+/// Vector Shift Left
+///
+/// The elements in vector `a` (eight signed 16-bit integer numbers)
+/// are shifted left by the number of bits the elements in vector `b`
+/// (eight signed 16-bit integer numbers) specify modulo the size of the
+/// element in bits. The result is written to vector (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(sll.h))]
+pub unsafe fn __msa_sll_h(a: v8i16, b: v8i16) -> v8i16 {
+ msa_sll_h(a, mem::transmute(b))
+}
+
+/// Vector Shift Left
+///
+/// The elements in vector `a` (four signed 32-bit integer numbers)
+/// are shifted left by the number of bits the elements in vector `b`
+/// (four signed 32-bit integer numbers) specify modulo the size of the
+/// element in bits. The result is written to vector (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(sll.w))]
+pub unsafe fn __msa_sll_w(a: v4i32, b: v4i32) -> v4i32 {
+ msa_sll_w(a, mem::transmute(b))
+}
+
+/// Vector Shift Left
+///
+/// The elements in vector `a` (two signed 64-bit integer numbers)
+/// are shifted left by the number of bits the elements in vector `b`
+/// (two signed 64-bit integer numbers) specify modulo the size of the
+/// element in bits. The result is written to vector (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(sll.d))]
+pub unsafe fn __msa_sll_d(a: v2i64, b: v2i64) -> v2i64 {
+ msa_sll_d(a, mem::transmute(b))
+}
+
+/// Immediate Shift Left
+///
+/// The elements in vector `a` (sixteen signed 8-bit integer numbers)
+/// are shifted left by `imm4` bits.
+/// The result is written to vector (sixteen signed 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(slli.b, imm4 = 0b1111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_slli_b<const IMM4: i32>(a: v16i8) -> v16i8 {
+ static_assert_imm4!(IMM4);
+ msa_slli_b(a, IMM4)
+}
+
+/// Immediate Shift Left
+///
+/// The elements in vector `a` (eight signed 16-bit integer numbers)
+/// are shifted left by `imm3` bits.
+/// The result is written to vector (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(slli.h, imm3 = 0b111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_slli_h<const IMM3: i32>(a: v8i16) -> v8i16 {
+ static_assert_imm3!(IMM3);
+ msa_slli_h(a, IMM3)
+}
+
+/// Immediate Shift Left
+///
+/// The elements in vector `a` (four signed 32-bit integer numbers)
+/// are shifted left by `imm2` bits.
+/// The result is written to vector (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(slli.w, imm2 = 0b11))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_slli_w<const IMM2: i32>(a: v4i32) -> v4i32 {
+ static_assert_imm2!(IMM2);
+ msa_slli_w(a, IMM2)
+}
+
+/// Immediate Shift Left
+///
+/// The elements in vector `a` (two signed 64-bit integer numbers)
+/// are shifted left by `imm1` bits.
+/// The result is written to vector (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(slli.d, imm1 = 0b1))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_slli_d<const IMM1: i32>(a: v2i64) -> v2i64 {
+ static_assert_imm1!(IMM1);
+ msa_slli_d(a, IMM1)
+}
+
+/// GPR Element Splat
+///
+/// Replicate vector `a` (sixteen signed 8-bit integer numbers)
+/// element with index given by GPR `b` to all elements in vector
+/// (sixteen signed 8-bit integer numbers) GPR `b` value is interpreted
+/// modulo the number of data format df elements in the destination vector.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(splat.b))]
+pub unsafe fn __msa_splat_b(a: v16i8, b: i32) -> v16i8 {
+ msa_splat_b(a, mem::transmute(b))
+}
+
+/// GPR Element Splat
+///
+/// Replicate vector `a` (eight signed 16-bit integer numbers)
+/// element with index given by GPR `b` to all elements in vector
+/// (eight signed 16-bit integer numbers) GPR `b` value is interpreted
+/// modulo the number of data format df elements in the destination vector.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(splat.h))]
+pub unsafe fn __msa_splat_h(a: v8i16, b: i32) -> v8i16 {
+ msa_splat_h(a, mem::transmute(b))
+}
+
+/// GPR Element Splat
+///
+/// Replicate vector `a` (four signed 32-bit integer numbers)
+/// element with index given by GPR `b` to all elements in vector
+/// (four signed 32-bit integer numbers) GPR `b` value is interpreted
+/// modulo the number of data format df elements in the destination vector.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(splat.w))]
+pub unsafe fn __msa_splat_w(a: v4i32, b: i32) -> v4i32 {
+ msa_splat_w(a, mem::transmute(b))
+}
+
+/// GPR Element Splat
+///
+/// Replicate vector `a` (two signed 64-bit integer numbers)
+/// element with index given by GPR `b` to all elements in vector
+/// (two signed 64-bit integer numbers) GPR `b` value is interpreted
+/// modulo the number of data format df elements in the destination vector.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(splat.d))]
+pub unsafe fn __msa_splat_d(a: v2i64, b: i32) -> v2i64 {
+ msa_splat_d(a, mem::transmute(b))
+}
+
+/// Immediate Element Splat
+///
+/// Replicate element `imm4` in vector `a` (sixteen signed 8-bit integer numbers)
+/// to all elements in vector (sixteen signed 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(splati.b, imm4 = 0b1111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_splati_b<const IMM4: i32>(a: v16i8) -> v16i8 {
+ static_assert_imm4!(IMM4);
+ msa_splati_b(a, IMM4)
+}
+
+/// Immediate Element Splat
+///
+/// Replicate element `imm3` in vector `a` (eight signed 16-bit integer numbers)
+/// to all elements in vector (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(splati.h, imm3 = 0b111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_splati_h<const IMM3: i32>(a: v8i16) -> v8i16 {
+ static_assert_imm3!(IMM3);
+ msa_splati_h(a, IMM3)
+}
+
+/// Immediate Element Splat
+///
+/// Replicate element `imm2` in vector `a` (four signed 32-bit integer numbers)
+/// to all elements in vector (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(splati.w, imm2 = 0b11))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_splati_w<const IMM2: i32>(a: v4i32) -> v4i32 {
+ static_assert_imm2!(IMM2);
+ msa_splati_w(a, IMM2)
+}
+
+/// Immediate Element Splat
+///
+/// Replicate element `imm1` in vector `a` (two signed 64-bit integer numbers)
+/// to all elements in vector (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(splati.d, imm1 = 0b1))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_splati_d<const IMM1: i32>(a: v2i64) -> v2i64 {
+ static_assert_imm1!(IMM1);
+ msa_splati_d(a, IMM1)
+}
+
+/// Vector Shift Right Arithmetic
+///
+/// The elements in vector `a` (sixteen signed 8-bit integer numbers)
+/// are shifted right arithmetic by the number of bits the elements in vector `b`
+/// (sixteen signed 8-bit integer numbers) specify modulo the size of the
+/// element in bits.The result is written to vector (sixteen signed 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(sra.b))]
+pub unsafe fn __msa_sra_b(a: v16i8, b: v16i8) -> v16i8 {
+ msa_sra_b(a, mem::transmute(b))
+}
+
+/// Vector Shift Right Arithmetic
+///
+/// The elements in vector `a` (eight signed 16-bit integer numbers)
+/// are shifted right arithmetic by the number of bits the elements in vector `b`
+/// (eight signed 16-bit integer numbers) specify modulo the size of the
+/// element in bits.The result is written to vector (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(sra.h))]
+pub unsafe fn __msa_sra_h(a: v8i16, b: v8i16) -> v8i16 {
+ msa_sra_h(a, mem::transmute(b))
+}
+
+/// Vector Shift Right Arithmetic
+///
+/// The elements in vector `a` (four signed 32-bit integer numbers)
+/// are shifted right arithmetic by the number of bits the elements in vector `b`
+/// (four signed 32-bit integer numbers) specify modulo the size of the
+/// element in bits.The result is written to vector (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(sra.w))]
+pub unsafe fn __msa_sra_w(a: v4i32, b: v4i32) -> v4i32 {
+ msa_sra_w(a, mem::transmute(b))
+}
+
+/// Vector Shift Right Arithmetic
+///
+/// The elements in vector `a` (two signed 64-bit integer numbers)
+/// are shifted right arithmetic by the number of bits the elements in vector `b`
+/// (two signed 64-bit integer numbers) specify modulo the size of the
+/// element in bits.The result is written to vector (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(sra.d))]
+pub unsafe fn __msa_sra_d(a: v2i64, b: v2i64) -> v2i64 {
+ msa_sra_d(a, mem::transmute(b))
+}
+
+/// Immediate Shift Right Arithmetic
+///
+/// The elements in vector `a` (sixteen signed 8-bit integer numbers)
+/// are shifted right arithmetic by `imm3` bits.
+/// The result is written to vector (sixteen signed 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(srai.b, imm3 = 0b111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_srai_b<const IMM3: i32>(a: v16i8) -> v16i8 {
+ static_assert_imm3!(IMM3);
+ msa_srai_b(a, IMM3)
+}
+
+/// Immediate Shift Right Arithmetic
+///
+/// The elements in vector `a` (eight signed 16-bit integer numbers)
+/// are shifted right arithmetic by `imm4` bits.
+/// The result is written to vector (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(srai.h, imm4 = 0b1111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_srai_h<const IMM4: i32>(a: v8i16) -> v8i16 {
+ static_assert_imm4!(IMM4);
+ msa_srai_h(a, IMM4)
+}
+
+/// Immediate Shift Right Arithmetic
+///
+/// The elements in vector `a` (four signed 32-bit integer numbers)
+/// are shifted right arithmetic by `imm5` bits.
+/// The result is written to vector (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(srai.w, imm5 = 0b11111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_srai_w<const IMM5: i32>(a: v4i32) -> v4i32 {
+ static_assert_imm5!(IMM5);
+ msa_srai_w(a, IMM5)
+}
+
+/// Immediate Shift Right Arithmetic
+///
+/// The elements in vector `a` (two signed 64-bit integer numbers)
+/// are shifted right arithmetic by `imm6` bits.
+/// The result is written to vector (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(srai.d, imm6 = 0b111111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_srai_d<const IMM6: i32>(a: v2i64) -> v2i64 {
+ static_assert_imm6!(IMM6);
+ msa_srai_d(a, IMM6)
+}
+
+/// Vector Shift Right Arithmetic Rounded
+///
+/// The elements in vector `a` (sixteen signed 8-bit integer numbers)
+/// are shifted right arithmetic by the number of bits the elements in vector `b`
+/// (sixteen signed 8-bit integer numbers) specify modulo the size of the
+/// element in bits.The most significant discarded bit is added to the shifted
+/// value (for rounding) and the result is written to vector (sixteen signed 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(srar.b))]
+pub unsafe fn __msa_srar_b(a: v16i8, b: v16i8) -> v16i8 {
+ msa_srar_b(a, mem::transmute(b))
+}
+
+/// Vector Shift Right Arithmetic Rounded
+///
+/// The elements in vector `a` (eight signed 16-bit integer numbers)
+/// are shifted right arithmetic by the number of bits the elements in vector `b`
+/// (eight signed 16-bit integer numbers) specify modulo the size of the
+/// element in bits.The most significant discarded bit is added to the shifted
+/// value (for rounding) and the result is written to vector (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(srar.h))]
+pub unsafe fn __msa_srar_h(a: v8i16, b: v8i16) -> v8i16 {
+ msa_srar_h(a, mem::transmute(b))
+}
+
+/// Vector Shift Right Arithmetic Rounded
+///
+/// The elements in vector `a` (four signed 32-bit integer numbers)
+/// are shifted right arithmetic by the number of bits the elements in vector `b`
+/// (four signed 32-bit integer numbers) specify modulo the size of the
+/// element in bits.The most significant discarded bit is added to the shifted
+/// value (for rounding) and the result is written to vector (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(srar.w))]
+pub unsafe fn __msa_srar_w(a: v4i32, b: v4i32) -> v4i32 {
+ msa_srar_w(a, mem::transmute(b))
+}
+
+/// Vector Shift Right Arithmetic Rounded
+///
+/// The elements in vector `a` (two signed 64-bit integer numbers)
+/// are shifted right arithmetic by the number of bits the elements in vector `b`
+/// (two signed 64-bit integer numbers) specify modulo the size of the
+/// element in bits.The most significant discarded bit is added to the shifted
+/// value (for rounding) and the result is written to vector (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(srar.d))]
+pub unsafe fn __msa_srar_d(a: v2i64, b: v2i64) -> v2i64 {
+ msa_srar_d(a, mem::transmute(b))
+}
+
+/// Immediate Shift Right Arithmetic Rounded
+///
+/// The elements in vector `a` (sixteen signed 8-bit integer numbers)
+/// are shifted right arithmetic by `imm3` bits.The most significant
+/// discarded bit is added to the shifted value (for rounding) and
+/// the result is written to vector (sixteen signed 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(srari.b, imm3 = 0b111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_srari_b<const IMM3: i32>(a: v16i8) -> v16i8 {
+ static_assert_imm3!(IMM3);
+ msa_srari_b(a, IMM3)
+}
+
+/// Immediate Shift Right Arithmetic Rounded
+///
+/// The elements in vector `a` (eight signed 16-bit integer numbers)
+/// are shifted right arithmetic by `imm4` bits.The most significant
+/// discarded bit is added to the shifted value (for rounding) and
+/// the result is written to vector (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(srari.h, imm4 = 0b1111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_srari_h<const IMM4: i32>(a: v8i16) -> v8i16 {
+ static_assert_imm4!(IMM4);
+ msa_srari_h(a, IMM4)
+}
+
+/// Immediate Shift Right Arithmetic Rounded
+///
+/// The elements in vector `a` (four signed 32-bit integer numbers)
+/// are shifted right arithmetic by `imm5` bits.The most significant
+/// discarded bit is added to the shifted value (for rounding) and
+/// the result is written to vector (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(srari.w, imm5 = 0b11111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_srari_w<const IMM5: i32>(a: v4i32) -> v4i32 {
+ static_assert_imm5!(IMM5);
+ msa_srari_w(a, IMM5)
+}
+
+/// Immediate Shift Right Arithmetic Rounded
+///
+/// The elements in vector `a` (two signed 64-bit integer numbers)
+/// are shifted right arithmetic by `imm6` bits.The most significant
+/// discarded bit is added to the shifted value (for rounding) and
+/// the result is written to vector (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(srari.d, imm6 = 0b111111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_srari_d<const IMM6: i32>(a: v2i64) -> v2i64 {
+ static_assert_imm6!(IMM6);
+ msa_srari_d(a, IMM6)
+}
+
+/// Vector Shift Right Logical
+///
+/// The elements in vector `a` (sixteen signed 8-bit integer numbers)
+/// are shifted right logical by the number of bits the elements in vector `b`
+/// (sixteen signed 8-bit integer numbers) specify modulo the size of the
+/// element in bits.The result is written to vector (sixteen signed 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(srl.b))]
+pub unsafe fn __msa_srl_b(a: v16i8, b: v16i8) -> v16i8 {
+ msa_srl_b(a, mem::transmute(b))
+}
+
+/// Vector Shift Right Logical
+///
+/// The elements in vector `a` (eight signed 16-bit integer numbers)
+/// are shifted right logical by the number of bits the elements in vector `b`
+/// (eight signed 16-bit integer numbers) specify modulo the size of the
+/// element in bits.The result is written to vector (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(srl.h))]
+pub unsafe fn __msa_srl_h(a: v8i16, b: v8i16) -> v8i16 {
+ msa_srl_h(a, mem::transmute(b))
+}
+
+/// Vector Shift Right Logical
+///
+/// The elements in vector `a` (four signed 32-bit integer numbers)
+/// are shifted right logical by the number of bits the elements in vector `b`
+/// (four signed 32-bit integer numbers) specify modulo the size of the
+/// element in bits.The result is written to vector (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(srl.w))]
+pub unsafe fn __msa_srl_w(a: v4i32, b: v4i32) -> v4i32 {
+ msa_srl_w(a, mem::transmute(b))
+}
+
+/// Vector Shift Right Logical
+///
+/// The elements in vector `a` (two signed 64-bit integer numbers)
+/// are shifted right logical by the number of bits the elements in vector `b`
+/// (two signed 64-bit integer numbers) specify modulo the size of the
+/// element in bits.The result is written to vector (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(srl.d))]
+pub unsafe fn __msa_srl_d(a: v2i64, b: v2i64) -> v2i64 {
+ msa_srl_d(a, mem::transmute(b))
+}
+
+/// Immediate Shift Right Logical
+///
+/// The elements in vector `a` (sixteen signed 8-bit integer numbers)
+/// are shifted right logical by `imm4` bits.
+/// The result is written to vector (sixteen signed 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(srli.b, imm4 = 0b1111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_srli_b<const IMM4: i32>(a: v16i8) -> v16i8 {
+ static_assert_imm4!(IMM4);
+ msa_srli_b(a, IMM4)
+}
+
+/// Immediate Shift Right Logical
+///
+/// The elements in vector `a` (eight signed 16-bit integer numbers)
+/// are shifted right logical by `imm3` bits.
+/// The result is written to vector (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(srli.h, imm3 = 0b111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_srli_h<const IMM3: i32>(a: v8i16) -> v8i16 {
+ static_assert_imm3!(IMM3);
+ msa_srli_h(a, IMM3)
+}
+
+/// Immediate Shift Right Logical
+///
+/// The elements in vector `a` (four signed 32-bit integer numbers)
+/// are shifted right logical by `imm2` bits.
+/// The result is written to vector (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(srli.w, imm2 = 0b11))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_srli_w<const IMM2: i32>(a: v4i32) -> v4i32 {
+ static_assert_imm2!(IMM2);
+ msa_srli_w(a, IMM2)
+}
+
+/// Immediate Shift Right Logical
+///
+/// The elements in vector `a` (two signed 64-bit integer numbers)
+/// are shifted right logical by `imm1` bits.
+/// The result is written to vector (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(srli.d, imm1 = 0b1))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_srli_d<const IMM1: i32>(a: v2i64) -> v2i64 {
+ static_assert_imm1!(IMM1);
+ msa_srli_d(a, IMM1)
+}
+
+/// Vector Shift Right Logical Rounded
+///
+/// The elements in vector `a` (sixteen signed 8-bit integer numbers)
+/// are shifted right logical by the number of bits the elements in vector `b`
+/// (sixteen signed 8-bit integer numbers) specify modulo the size of the
+/// element in bits.The most significant discarded bit is added to the shifted
+/// value (for rounding) and the result is written to vector (sixteen signed 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(srlr.b))]
+pub unsafe fn __msa_srlr_b(a: v16i8, b: v16i8) -> v16i8 {
+ msa_srlr_b(a, mem::transmute(b))
+}
+
+/// Vector Shift Right Logical Rounded
+///
+/// The elements in vector `a` (eight signed 16-bit integer numbers)
+/// are shifted right logical by the number of bits the elements in vector `b`
+/// (eight signed 16-bit integer numbers) specify modulo the size of the
+/// element in bits.The most significant discarded bit is added to the shifted
+/// value (for rounding) and the result is written to vector (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(srlr.h))]
+pub unsafe fn __msa_srlr_h(a: v8i16, b: v8i16) -> v8i16 {
+ msa_srlr_h(a, mem::transmute(b))
+}
+
+/// Vector Shift Right Logical Rounded
+///
+/// The elements in vector `a` (four signed 32-bit integer numbers)
+/// are shifted right logical by the number of bits the elements in vector `b`
+/// (four signed 32-bit integer numbers) specify modulo the size of the
+/// element in bits.The most significant discarded bit is added to the shifted
+/// value (for rounding) and the result is written to vector (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(srlr.w))]
+pub unsafe fn __msa_srlr_w(a: v4i32, b: v4i32) -> v4i32 {
+ msa_srlr_w(a, mem::transmute(b))
+}
+
+/// Vector Shift Right Logical Rounded
+///
+/// The elements in vector `a` (two signed 64-bit integer numbers)
+/// are shifted right logical by the number of bits the elements in vector `b`
+/// (two signed 64-bit integer numbers) specify modulo the size of the
+/// element in bits.The most significant discarded bit is added to the shifted
+/// value (for rounding) and the result is written to vector (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(srlr.d))]
+pub unsafe fn __msa_srlr_d(a: v2i64, b: v2i64) -> v2i64 {
+ msa_srlr_d(a, mem::transmute(b))
+}
+
+/// Immediate Shift Right Logical Rounded
+///
+/// The elements in vector `a` (sixteen signed 8-bit integer numbers)
+/// are shifted right logical by `imm6` bits.The most significant
+/// discarded bit is added to the shifted value (for rounding) and
+/// the result is written to vector (sixteen signed 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(srlri.b, imm3 = 0b111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_srlri_b<const IMM3: i32>(a: v16i8) -> v16i8 {
+ static_assert_imm3!(IMM3);
+ msa_srlri_b(a, IMM3)
+}
+
+/// Immediate Shift Right Logical Rounded
+///
+/// The elements in vector `a` (eight signed 16-bit integer numbers)
+/// are shifted right logical by `imm6` bits.The most significant
+/// discarded bit is added to the shifted value (for rounding) and
+/// the result is written to vector (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(srlri.h, imm4 = 0b1111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_srlri_h<const IMM4: i32>(a: v8i16) -> v8i16 {
+ static_assert_imm4!(IMM4);
+ msa_srlri_h(a, IMM4)
+}
+
+/// Immediate Shift Right Logical Rounded
+///
+/// The elements in vector `a` (four signed 32-bit integer numbers)
+/// are shifted right logical by `imm6` bits.The most significant
+/// discarded bit is added to the shifted value (for rounding) and
+/// the result is written to vector (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(srlri.w, imm5 = 0b11111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_srlri_w<const IMM5: i32>(a: v4i32) -> v4i32 {
+ static_assert_imm5!(IMM5);
+ msa_srlri_w(a, IMM5)
+}
+
+/// Immediate Shift Right Logical Rounded
+///
+/// The elements in vector `a` (two signed 64-bit integer numbers)
+/// are shifted right logical by `imm6` bits.The most significant
+/// discarded bit is added to the shifted value (for rounding) and
+/// the result is written to vector (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(srlri.d, imm6 = 0b111111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_srlri_d<const IMM6: i32>(a: v2i64) -> v2i64 {
+ static_assert_imm6!(IMM6);
+ msa_srlri_d(a, IMM6)
+}
+
+/// Vector Store
+///
+/// The WRLEN / 8 bytes in vector `a` (sixteen signed 8-bit integer numbers)
+/// are stored as elements of data format df at the effective memory location
+/// addressed by the base `mem_addr` and the 10-bit signed immediate offset `imm_s10`.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(st.b, imm_s10 = 0b1111111111))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn __msa_st_b<const IMM_S10: i32>(a: v16i8, mem_addr: *mut u8) -> () {
+ static_assert_imm_s10!(IMM_S10);
+ msa_st_b(a, mem_addr, IMM_S10)
+}
+
+/// Vector Store
+///
+/// The WRLEN / 8 bytes in vector `a` (eight signed 16-bit integer numbers)
+/// are stored as elements of data format df at the effective memory location
+/// addressed by the base `mem_addr` and the 11-bit signed immediate offset `imm_s11`.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(st.h, imm_s11 = 0b11111111111))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn __msa_st_h<const IMM_S11: i32>(a: v8i16, mem_addr: *mut u8) -> () {
+ static_assert_imm_s11!(IMM_S11);
+ static_assert!(IMM_S11: i32 where IMM_S11 % 2 == 0);
+ msa_st_h(a, mem_addr, IMM_S11)
+}
+
+/// Vector Store
+///
+/// The WRLEN / 8 bytes in vector `a` (four signed 32-bit integer numbers)
+/// are stored as elements of data format df at the effective memory location
+/// addressed by the base `mem_addr` and the 12-bit signed immediate offset `imm_s12`.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(st.w, imm_s12 = 0b111111111111))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn __msa_st_w<const IMM_S12: i32>(a: v4i32, mem_addr: *mut u8) -> () {
+ static_assert_imm_s12!(IMM_S12);
+ static_assert!(IMM_S12: i32 where IMM_S12 % 4 == 0);
+ msa_st_w(a, mem_addr, IMM_S12)
+}
+
+/// Vector Store
+///
+/// The WRLEN / 8 bytes in vector `a` (two signed 64-bit integer numbers)
+/// are stored as elements of data format df at the effective memory location
+/// addressed by the base `mem_addr` and the 13-bit signed immediate offset `imm_s13`.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(st.d, imm_s13 = 0b1111111111111))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn __msa_st_d<const IMM_S13: i32>(a: v2i64, mem_addr: *mut u8) -> () {
+ static_assert_imm_s13!(IMM_S13);
+ static_assert!(IMM_S13: i32 where IMM_S13 % 8 == 0);
+ msa_st_d(a, mem_addr, IMM_S13)
+}
+
+/// Vector Signed Saturated Subtract of Signed Values
+///
+/// The elements in vector `b` (sixteen signed 8-bit integer numbers)
+/// are subtracted from the elements in vector `a` (sixteen signed 8-bit integer numbers).
+/// Signed arithmetic is performed and overflows clamp to the largest and/or smallest
+/// representable signed values before writing the result to vector (sixteen signed 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(subs_s.b))]
+pub unsafe fn __msa_subs_s_b(a: v16i8, b: v16i8) -> v16i8 {
+ msa_subs_s_b(a, mem::transmute(b))
+}
+
+/// Vector Signed Saturated Subtract of Signed Values
+///
+/// The elements in vector `b` (eight signed 16-bit integer numbers)
+/// are subtracted from the elements in vector `a` (eight signed 16-bit integer numbers).
+/// Signed arithmetic is performed and overflows clamp to the largest and/or smallest
+/// representable signed values before writing the result to vector (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(subs_s.h))]
+pub unsafe fn __msa_subs_s_h(a: v8i16, b: v8i16) -> v8i16 {
+ msa_subs_s_h(a, mem::transmute(b))
+}
+
+/// Vector Signed Saturated Subtract of Signed Values
+///
+/// The elements in vector `b` (four signed 32-bit integer numbers)
+/// are subtracted from the elements in vector `a` (four signed 32-bit integer numbers).
+/// Signed arithmetic is performed and overflows clamp to the largest and/or smallest
+/// representable signed values before writing the result to vector (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(subs_s.w))]
+pub unsafe fn __msa_subs_s_w(a: v4i32, b: v4i32) -> v4i32 {
+ msa_subs_s_w(a, mem::transmute(b))
+}
+
+/// Vector Signed Saturated Subtract of Signed Values
+///
+/// The elements in vector `b` (two signed 64-bit integer numbers)
+/// are subtracted from the elements in vector `a` (two signed 64-bit integer numbers).
+/// Signed arithmetic is performed and overflows clamp to the largest and/or smallest
+/// representable signed values before writing the result to vector (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(subs_s.d))]
+pub unsafe fn __msa_subs_s_d(a: v2i64, b: v2i64) -> v2i64 {
+ msa_subs_s_d(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Saturated Subtract of Unsigned Values
+///
+/// The elements in vector `b` (sixteen unsigned 8-bit integer numbers)
+/// are subtracted from the elements in vector `a` (sixteen unsigned 8-bit integer numbers).
+/// Unsigned arithmetic is performed and under-flows clamp to 0 before writing
+/// the result to vector (sixteen unsigned 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(subs_u.b))]
+pub unsafe fn __msa_subs_u_b(a: v16u8, b: v16u8) -> v16u8 {
+ msa_subs_u_b(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Saturated Subtract of Unsigned Values
+///
+/// The elements in vector `b` (eight unsigned 16-bit integer numbers)
+/// are subtracted from the elements in vector `a` (eight unsigned 16-bit integer numbers).
+/// Unsigned arithmetic is performed and under-flows clamp to 0 before writing
+/// the result to vector (eight unsigned 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(subs_u.h))]
+pub unsafe fn __msa_subs_u_h(a: v8u16, b: v8u16) -> v8u16 {
+ msa_subs_u_h(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Saturated Subtract of Unsigned Values
+///
+/// The elements in vector `b` (four unsigned 32-bit integer numbers)
+/// are subtracted from the elements in vector `a` (four unsigned 32-bit integer numbers).
+/// Unsigned arithmetic is performed and under-flows clamp to 0 before writing
+/// the result to vector (four unsigned 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(subs_u.w))]
+pub unsafe fn __msa_subs_u_w(a: v4u32, b: v4u32) -> v4u32 {
+ msa_subs_u_w(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Saturated Subtract of Unsigned Values
+///
+/// The elements in vector `b` (two unsigned 64-bit integer numbers)
+/// are subtracted from the elements in vector `a` (two unsigned 64-bit integer numbers).
+/// Unsigned arithmetic is performed and under-flows clamp to 0 before writing
+/// the result to vector (two unsigned 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(subs_u.d))]
+pub unsafe fn __msa_subs_u_d(a: v2u64, b: v2u64) -> v2u64 {
+ msa_subs_u_d(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Saturated Subtract of Signed from Unsigned
+///
+/// The signed elements in vector `b` (sixteen signed 8-bit integer numbers)
+/// are subtracted from the unsigned elements in vector `a` (sixteen unsigned 8-bit integer numbers).
+/// The signed result is unsigned saturated and written to
+/// to vector (sixteen unsigned 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(subsus_u.b))]
+pub unsafe fn __msa_subsus_u_b(a: v16u8, b: v16i8) -> v16u8 {
+ msa_subsus_u_b(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Saturated Subtract of Signed from Unsigned
+///
+/// The signed elements in vector `b` (eight signed 16-bit integer numbers)
+/// are subtracted from the unsigned elements in vector `a` (eight unsigned 16-bit integer numbers).
+/// The signed result is unsigned saturated and written to
+/// to vector (eight unsigned 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(subsus_u.h))]
+pub unsafe fn __msa_subsus_u_h(a: v8u16, b: v8i16) -> v8u16 {
+ msa_subsus_u_h(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Saturated Subtract of Signed from Unsigned
+///
+/// The signed elements in vector `b` (four signed 6432it integer numbers)
+/// are subtracted from the unsigned elements in vector `a` (four unsigned 32-bit integer numbers).
+/// The signed result is unsigned saturated and written to
+/// to vector (four unsigned 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(subsus_u.w))]
+pub unsafe fn __msa_subsus_u_w(a: v4u32, b: v4i32) -> v4u32 {
+ msa_subsus_u_w(a, mem::transmute(b))
+}
+
+/// Vector Unsigned Saturated Subtract of Signed from Unsigned
+///
+/// The signed elements in vector `b` (two signed 64-bit integer numbers)
+/// are subtracted from the unsigned elements in vector `a` (two unsigned 64-bit integer numbers).
+/// The signed result is unsigned saturated and written to
+/// to vector (two unsigned 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(subsus_u.d))]
+pub unsafe fn __msa_subsus_u_d(a: v2u64, b: v2i64) -> v2u64 {
+ msa_subsus_u_d(a, mem::transmute(b))
+}
+
+/// Vector Signed Saturated Subtract of Unsigned Values
+///
+/// The unsigned elements in vector `b` (sixteen unsigned 8-bit integer numbers)
+/// are subtracted from the unsigned elements in vector `a` (sixteen unsigned 8-bit integer numbers).
+/// The signed result is signed saturated and written to
+/// to vector (sixteen unsigned 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(subsuu_s.b))]
+pub unsafe fn __msa_subsuu_s_b(a: v16u8, b: v16u8) -> v16i8 {
+ msa_subsuu_s_b(a, mem::transmute(b))
+}
+
+/// Vector Signed Saturated Subtract of Unsigned Values
+///
+/// The unsigned elements in vector `b` (eight unsigned 16-bit integer numbers)
+/// are subtracted from the unsigned elements in vector `a` (eight unsigned 16-bit integer numbers).
+/// The signed result is signed saturated and written to
+/// to vector (eight unsigned 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(subsuu_s.h))]
+pub unsafe fn __msa_subsuu_s_h(a: v8u16, b: v8u16) -> v8i16 {
+ msa_subsuu_s_h(a, mem::transmute(b))
+}
+
+/// Vector Signed Saturated Subtract of Unsigned Values
+///
+/// The unsigned elements in vector `b` (four unsigned 32-bit integer numbers)
+/// are subtracted from the unsigned elements in vector `a` (four unsigned 32-bit integer numbers).
+/// The signed result is signed saturated and written to
+/// to vector (four unsigned 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(subsuu_s.w))]
+pub unsafe fn __msa_subsuu_s_w(a: v4u32, b: v4u32) -> v4i32 {
+ msa_subsuu_s_w(a, mem::transmute(b))
+}
+
+/// Vector Signed Saturated Subtract of Unsigned Values
+///
+/// The unsigned elements in vector `b` (two unsigned 64-bit integer numbers)
+/// are subtracted from the unsigned elements in vector `a` (two unsigned 64-bit integer numbers).
+/// The signed result is signed saturated and written to
+/// to vector (two unsigned 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(subsuu_s.d))]
+pub unsafe fn __msa_subsuu_s_d(a: v2u64, b: v2u64) -> v2i64 {
+ msa_subsuu_s_d(a, mem::transmute(b))
+}
+
+/// Vector Subtract
+///
+/// The elements in vector `b` (sixteen signed 8-bit integer numbers)
+/// are subtracted from the elements in vector `a` (sixteen signed 8-bit integer numbers).
+/// The result is written to vector (sixteen signed 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(subv.b))]
+pub unsafe fn __msa_subv_b(a: v16i8, b: v16i8) -> v16i8 {
+ msa_subv_b(a, mem::transmute(b))
+}
+
+/// Vector Subtract
+///
+/// The elements in vector `b` (eight signed 16-bit integer numbers)
+/// are subtracted from the elements in vector `a` (eight signed 16-bit integer numbers).
+/// The result is written to vector (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(subv.h))]
+pub unsafe fn __msa_subv_h(a: v8i16, b: v8i16) -> v8i16 {
+ msa_subv_h(a, mem::transmute(b))
+}
+
+/// Vector Subtract
+///
+/// The elements in vector `b` (four signed 32-bit integer numbers)
+/// are subtracted from the elements in vector `a` (four signed 32-bit integer numbers).
+/// The result is written to vector (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(subv.w))]
+pub unsafe fn __msa_subv_w(a: v4i32, b: v4i32) -> v4i32 {
+ msa_subv_w(a, mem::transmute(b))
+}
+
+/// Vector Subtract
+///
+/// The elements in vector `b` (two signed 64-bit integer numbers)
+/// are subtracted from the elements in vector `a` (two signed 64-bit integer numbers).
+/// The result is written to vector (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(subv.d))]
+pub unsafe fn __msa_subv_d(a: v2i64, b: v2i64) -> v2i64 {
+ msa_subv_d(a, mem::transmute(b))
+}
+
+/// Immediate Subtract
+///
+/// The 5-bit immediate unsigned value `imm5`
+/// are subtracted from the elements in vector `a` (sixteen signed 8-bit integer numbers).
+/// The result is written to vector (sixteen signed 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(subvi.b, imm5 = 0b10111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_subvi_b<const IMM5: i32>(a: v16i8) -> v16i8 {
+ static_assert_imm5!(IMM5);
+ msa_subvi_b(a, IMM5)
+}
+
+/// Immediate Subtract
+///
+/// The 5-bit immediate unsigned value `imm5`
+/// are subtracted from the elements in vector `a` (eight signed 16-bit integer numbers).
+/// The result is written to vector (eight signed 16-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(subvi.h, imm5 = 0b10111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_subvi_h<const IMM5: i32>(a: v8i16) -> v8i16 {
+ static_assert_imm5!(IMM5);
+ msa_subvi_h(a, IMM5)
+}
+
+/// Immediate Subtract
+///
+/// The 5-bit immediate unsigned value `imm5`
+/// are subtracted from the elements in vector `a` (four signed 32-bit integer numbers).
+/// The result is written to vector (four signed 32-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(subvi.w, imm5 = 0b10111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_subvi_w<const IMM5: i32>(a: v4i32) -> v4i32 {
+ static_assert_imm5!(IMM5);
+ msa_subvi_w(a, IMM5)
+}
+
+/// Immediate Subtract
+///
+/// The 5-bit immediate unsigned value `imm5`
+/// are subtracted from the elements in vector `a` (two signed 64-bit integer numbers).
+/// The result is written to vector (two signed 64-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(subvi.d, imm5 = 0b10111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_subvi_d<const IMM5: i32>(a: v2i64) -> v2i64 {
+ static_assert_imm5!(IMM5);
+ msa_subvi_d(a, IMM5)
+}
+
+/// Vector Data Preserving Shuffle
+///
+/// The vector shuffle instructions selectively copy data elements from the
+/// concatenation of vectors `b` (sixteen signed 8-bit integer numbers)
+/// and `c` (sixteen signed 8-bit integer numbers) in to vector `a`
+/// (sixteen signed 8-bit integer numbers) based on the corresponding control element in `a`.
+/// The least significant 6 bits in `a` control elements modulo the number of elements in
+/// the concatenated vectors `b`, `a` specify the index of the source element.
+/// If bit 6 or bit 7 is 1, there will be no copy, but rather the destination element is set to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(vshf.b))]
+pub unsafe fn __msa_vshf_b(a: v16i8, b: v16i8, c: v16i8) -> v16i8 {
+ msa_vshf_b(a, mem::transmute(b), c)
+}
+
+/// Vector Data Preserving Shuffle
+///
+/// The vector shuffle instructions selectively copy data elements from the
+/// concatenation of vectors `b` (eight signed 16-bit integer numbers)
+/// and `c` (eight signed 16-bit integer numbers) in to vector `a`
+/// (eight signed 16-bit integer numbers) based on the corresponding control element in `a`.
+/// The least significant 6 bits in `a` control elements modulo the number of elements in
+/// the concatenated vectors `b`, `a` specify the index of the source element.
+/// If bit 6 or bit 7 is 1, there will be no copy, but rather the destination element is set to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(vshf.h))]
+pub unsafe fn __msa_vshf_h(a: v8i16, b: v8i16, c: v8i16) -> v8i16 {
+ msa_vshf_h(a, mem::transmute(b), c)
+}
+
+/// Vector Data Preserving Shuffle
+///
+/// The vector shuffle instructions selectively copy data elements from the
+/// concatenation of vectors `b` (four signed 32-bit integer numbers)
+/// and `c` (four signed 32-bit integer numbers) in to vector `a`
+/// (four signed 32-bit integer numbers) based on the corresponding control element in `a`.
+/// The least significant 6 bits in `a` control elements modulo the number of elements in
+/// the concatenated vectors `b`, `a` specify the index of the source element.
+/// If bit 6 or bit 7 is 1, there will be no copy, but rather the destination element is set to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(vshf.w))]
+pub unsafe fn __msa_vshf_w(a: v4i32, b: v4i32, c: v4i32) -> v4i32 {
+ msa_vshf_w(a, mem::transmute(b), c)
+}
+
+/// Vector Data Preserving Shuffle
+///
+/// The vector shuffle instructions selectively copy data elements from the
+/// concatenation of vectors `b` (two signed 64-bit integer numbers)
+/// and `c` (two signed 64-bit integer numbers) in to vector `a`
+/// (two signed 64-bit integer numbers) based on the corresponding control element in `a`.
+/// The least significant 6 bits in `a` control elements modulo the number of elements in
+/// the concatenated vectors `b`, `a` specify the index of the source element.
+/// If bit 6 or bit 7 is 1, there will be no copy, but rather the destination element is set to 0.
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(vshf.d))]
+pub unsafe fn __msa_vshf_d(a: v2i64, b: v2i64, c: v2i64) -> v2i64 {
+ msa_vshf_d(a, mem::transmute(b), c)
+}
+
+/// Vector Logical Exclusive Or
+///
+/// Each bit of vector `a` (sixteen unsigned 8-bit integer numbers)
+/// is combined with the corresponding bit of vector `b` (sixteen unsigned 8-bit integer numbers)
+/// in a bitwise logical XOR operation. The result is written to vector
+/// (sixteen unsigned 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(xor.v))]
+pub unsafe fn __msa_xor_v(a: v16u8, b: v16u8) -> v16u8 {
+ msa_xor_v(a, mem::transmute(b))
+}
+
+/// Immediate Logical Exclusive Or
+///
+/// Each byte of vector `a` (sixteen unsigned 8-bit integer numbers)
+/// is combined with the 8-bit immediate `imm8`
+/// in a bitwise logical XOR operation. The result is written to vector
+/// (sixteen unsigned 8-bit integer numbers).
+///
+#[inline]
+#[target_feature(enable = "msa")]
+#[cfg_attr(test, assert_instr(xori.b, imm8 = 0b11111111))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn __msa_xori_b<const IMM8: i32>(a: v16u8) -> v16u8 {
+ static_assert_imm8!(IMM8);
+ msa_xori_b(a, IMM8)
+}
+
+#[cfg(test)]
+mod tests {
+ use crate::{
+ core_arch::{mips::msa::*, simd::*},
+ mem,
+ };
+ use std::{f32, f64};
+ use stdarch_test::simd_test;
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_add_a_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let b = i8x16::new(
+ -4, -3, -2, -1,
+ -4, -3, -2, -1,
+ -4, -3, -2, -1,
+ -4, -3, -2, -1
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 5, 5, 5, 5,
+ 5, 5, 5, 5,
+ 5, 5, 5, 5,
+ 5, 5, 5, 5
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_add_a_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_add_a_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(1, 2, 3, 4, 1, 2, 3, 4);
+ #[rustfmt::skip]
+ let b = i16x8::new(-4, -3, -2, -1, -4, -3, -2, -1);
+ #[rustfmt::skip]
+ let r = i16x8::new(5, 5, 5, 5, 5, 5, 5, 5);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_add_a_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_add_a_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(1, 2, 3, 4);
+ #[rustfmt::skip]
+ let b = i32x4::new(-4, -3, -2, -1);
+ #[rustfmt::skip]
+ let r = i32x4::new(5, 5, 5, 5);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_add_a_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_add_a_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(1, 2);
+ #[rustfmt::skip]
+ let b = i64x2::new(-4, -3);
+ #[rustfmt::skip]
+ let r = i64x2::new(5, 5);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_add_a_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_adds_a_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ 100, i8::MAX, 100, i8::MAX,
+ 100, i8::MAX, 100, i8::MAX,
+ 100, i8::MAX, 100, i8::MAX,
+ 100, i8::MAX, 100, i8::MAX
+ );
+ #[rustfmt::skip]
+ let b = i8x16::new(
+ -4, -3, -2, -100,
+ -4, -3, -2, -100,
+ -4, -3, -2, -100,
+ -4, -3, -2, -100
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 104, 127, 102, 127,
+ 104, 127, 102, 127,
+ 104, 127, 102, 127,
+ 104, 127, 102, 127
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_adds_a_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_adds_a_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ 100, i16::MAX, 100, i16::MAX,
+ 100, i16::MAX, 100, i16::MAX
+ );
+ #[rustfmt::skip]
+ let b = i16x8::new(-4, -3, -2, -1, -4, -3, -2, -1);
+ #[rustfmt::skip]
+ let r = i16x8::new(
+ 104, i16::MAX, 102, i16::MAX,
+ 104, i16::MAX, 102, i16::MAX
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_adds_a_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_adds_a_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(100, i32::MAX, 100, i32::MAX);
+ #[rustfmt::skip]
+ let b = i32x4::new(-4, -3, -2, -1);
+ #[rustfmt::skip]
+ let r = i32x4::new(104, i32::MAX, 102, i32::MAX);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_adds_a_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_adds_a_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(100, i64::MAX);
+ #[rustfmt::skip]
+ let b = i64x2::new(-4, -3);
+ #[rustfmt::skip]
+ let r = i64x2::new(104, i64::MAX);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_adds_a_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_adds_s_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ 100, i8::MIN, 100, i8::MAX,
+ 100, i8::MIN, 100, i8::MAX,
+ 100, i8::MIN, 100, i8::MAX,
+ 100, i8::MIN, 100, i8::MAX
+ );
+ #[rustfmt::skip]
+ let b = i8x16::new(
+ -4, -3, -2, 100,
+ -4, -3, -2, 100,
+ -4, -3, -2, 100,
+ -4, -3, -2, 100
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 96, i8::MIN, 98, i8::MAX,
+ 96, i8::MIN, 98, i8::MAX,
+ 96, i8::MIN, 98, i8::MAX,
+ 96, i8::MIN, 98, i8::MAX
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_adds_s_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_adds_s_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ 100, i16::MIN, 100, i16::MAX,
+ 100, i16::MIN, 100, i16::MAX
+ );
+ #[rustfmt::skip]
+ let b = i16x8::new(-4, -3, -2, 1, -4, -3, -2, 1);
+ #[rustfmt::skip]
+ let r = i16x8::new(
+ 96, i16::MIN, 98, i16::MAX,
+ 96, i16::MIN, 98, i16::MAX
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_adds_s_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_adds_s_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(100, i32::MAX, 100, i32::MIN);
+ #[rustfmt::skip]
+ let b = i32x4::new(-4, 3, -2, -1);
+ #[rustfmt::skip]
+ let r = i32x4::new(96, i32::MAX, 98, i32::MIN);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_adds_s_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_adds_s_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(100, i64::MIN);
+ #[rustfmt::skip]
+ let b = i64x2::new(-4, -3);
+ #[rustfmt::skip]
+ let r = i64x2::new(96, i64::MIN);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_adds_s_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_adds_u_b() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ 100, u8::MAX, 100, u8::MAX,
+ 100, u8::MAX, 100, u8::MAX,
+ 100, u8::MAX, 100, u8::MAX,
+ 100, u8::MAX, 100, u8::MAX
+ );
+ #[rustfmt::skip]
+ let b = u8x16::new(
+ 4, 3, 2, 100,
+ 4, 3, 2, 100,
+ 4, 3, 2, 100,
+ 4, 3, 2, 100
+ );
+ #[rustfmt::skip]
+ let r = u8x16::new(
+ 104, u8::MAX, 102, u8::MAX,
+ 104, u8::MAX, 102, u8::MAX,
+ 104, u8::MAX, 102, u8::MAX,
+ 104, u8::MAX, 102, u8::MAX
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_adds_u_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_adds_u_h() {
+ #[rustfmt::skip]
+ let a = u16x8::new(
+ 100, u16::MAX, 100, u16::MAX,
+ 100, u16::MAX, 100, u16::MAX
+ );
+ #[rustfmt::skip]
+ let b = u16x8::new(4, 3, 2, 1, 4, 3, 2, 1);
+ #[rustfmt::skip]
+ let r = u16x8::new(
+ 104, u16::MAX, 102, u16::MAX,
+ 104, u16::MAX, 102, u16::MAX
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_adds_u_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_adds_u_w() {
+ #[rustfmt::skip]
+ let a = u32x4::new(100, u32::MAX, 100, u32::MAX);
+ #[rustfmt::skip]
+ let b = u32x4::new(4, 3, 2, 1);
+ #[rustfmt::skip]
+ let r = u32x4::new(104, u32::MAX, 102, u32::MAX);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_adds_u_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_adds_u_d() {
+ #[rustfmt::skip]
+ let a = u64x2::new(100, u64::MAX);
+ #[rustfmt::skip]
+ let b = u64x2::new(4, 3);
+ #[rustfmt::skip]
+ let r = u64x2::new(104, u64::MAX);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_adds_u_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_addv_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ 100, i8::MIN, 100, i8::MAX,
+ 100, i8::MIN, 100, i8::MAX,
+ 100, i8::MIN, 100, i8::MAX,
+ 100, i8::MIN, 100, i8::MAX
+ );
+ #[rustfmt::skip]
+ let b = i8x16::new(
+ -4, -3, -2, 100,
+ -4, -3, -2, 100,
+ -4, -3, -2, 100,
+ -4, -3, -2, 100
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 96, 125, 98, -29,
+ 96, 125, 98, -29,
+ 96, 125, 98, -29,
+ 96, 125, 98, -29
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_addv_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_addv_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ 100, i16::MIN, 100, i16::MAX,
+ 100, i16::MIN, 100, i16::MAX
+ );
+ #[rustfmt::skip]
+ let b = i16x8::new(-4, -3, -2, 1, -4, -3, -2, 1);
+ #[rustfmt::skip]
+ let r = i16x8::new(96, 32765, 98, -32768, 96, 32765, 98, -32768);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_addv_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_addv_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(100, i32::MAX, 100, i32::MIN);
+ #[rustfmt::skip]
+ let b = i32x4::new(-4, 3, -2, -1);
+ #[rustfmt::skip]
+ let r = i32x4::new(96, -2147483646, 98, 2147483647);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_addv_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_addv_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(100, i64::MIN);
+ #[rustfmt::skip]
+ let b = i64x2::new(-4, -3);
+ #[rustfmt::skip]
+ let r = i64x2::new(96, 9223372036854775805);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_addv_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_addvi_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ 100, i8::MAX, 100, i8::MAX,
+ 100, i8::MAX, 100, i8::MAX,
+ 100, i8::MAX, 100, i8::MAX,
+ 100, i8::MAX, 100, i8::MAX
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 103, -126, 103, -126,
+ 103, -126, 103, -126,
+ 103, -126, 103, -126,
+ 103, -126, 103, -126
+ );
+
+ assert_eq!(r, mem::transmute(__msa_addvi_b(mem::transmute(a), 67)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_addvi_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ i16::MAX, 3276, -100, -127,
+ i16::MAX, 3276, -100, -127
+ );
+ #[rustfmt::skip]
+ let r = i16x8::new(
+ -32766, 3279, -97, -124,
+ -32766, 3279, -97, -124
+ );
+
+ assert_eq!(r, mem::transmute(__msa_addvi_h(mem::transmute(a), 67)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_addvi_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(100, i32::MAX, 100, i32::MIN);
+ #[rustfmt::skip]
+ let r = i32x4::new(103, -2147483646, 103, -2147483645);
+
+ assert_eq!(r, mem::transmute(__msa_addvi_w(mem::transmute(a), 67)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_addvi_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(100, i64::MIN);
+ #[rustfmt::skip]
+ let r = i64x2::new(117, -9223372036854775791);
+
+ assert_eq!(r, mem::transmute(__msa_addvi_d(mem::transmute(a), 17)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_and_v() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ 100, u8::MAX, 100, u8::MAX,
+ 100, u8::MAX, 100, u8::MAX,
+ 100, u8::MAX, 100, u8::MAX,
+ 100, u8::MAX, 100, u8::MAX
+ );
+ #[rustfmt::skip]
+ let b = u8x16::new(
+ 4, 3, 2, 100,
+ 4, 3, 2, 100,
+ 4, 3, 2, 100,
+ 4, 3, 2, 100
+ );
+ #[rustfmt::skip]
+ let r = u8x16::new(
+ 4, 3, 0, 100,
+ 4, 3, 0, 100,
+ 4, 3, 0, 100,
+ 4, 3, 0, 100
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_and_v(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_andi_b() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ 100, u8::MAX, 100, u8::MAX,
+ 100, u8::MAX, 100, u8::MAX,
+ 100, u8::MAX, 100, u8::MAX,
+ 100, u8::MAX, 100, u8::MAX
+ );
+ #[rustfmt::skip]
+ let r = u8x16::new(
+ 4, 5, 4, 5,
+ 4, 5, 4, 5,
+ 4, 5, 4, 5,
+ 4, 5, 4, 5
+ );
+
+ assert_eq!(r, mem::transmute(__msa_andi_b(mem::transmute(a), 5)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_asub_s_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ -1, -2, -3, -4,
+ -1, -2, -3, -4,
+ -1, -2, -3, -4,
+ -1, -2, -3, -4
+ );
+ #[rustfmt::skip]
+ let b = i8x16::new(
+ -6, -7, -8, -9,
+ -6, -7, -8, -9,
+ -6, -7, -8, -9,
+ -6, -7, -8, -9
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 5, 5, 5, 5,
+ 5, 5, 5, 5,
+ 5, 5, 5, 5,
+ 5, 5, 5, 5
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_asub_s_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_asub_s_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(-1, -2, -3, -4, -1, -2, -3, -4);
+ #[rustfmt::skip]
+ let b = i16x8::new(-6, -7, -8, -9, -6, -7, -8, -9);
+ #[rustfmt::skip]
+ let r = i16x8::new(5, 5, 5, 5, 5, 5, 5, 5);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_asub_s_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_asub_s_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(-1, -2, -3, -4);
+ #[rustfmt::skip]
+ let b = i32x4::new(-6, -7, -8, -9);
+ #[rustfmt::skip]
+ let r = i32x4::new(5, 5, 5, 5);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_asub_s_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_asub_s_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(-1, -2);
+ #[rustfmt::skip]
+ let b = i64x2::new(-6, -7);
+ #[rustfmt::skip]
+ let r = i64x2::new(5, 5);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_asub_s_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_asub_u_b() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let b = u8x16::new(
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9
+ );
+ #[rustfmt::skip]
+ let r = u8x16::new(
+ 5, 5, 5, 5,
+ 5, 5, 5, 5,
+ 5, 5, 5, 5,
+ 5, 5, 5, 5
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_asub_u_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_asub_u_h() {
+ #[rustfmt::skip]
+ let a = u16x8::new(1, 2, 3, 4, 1, 2, 3, 4);
+ #[rustfmt::skip]
+ let b = u16x8::new(6, 7, 8, 9, 6, 7, 8, 9);
+ #[rustfmt::skip]
+ let r = u16x8::new(5, 5, 5, 5, 5, 5, 5, 5);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_asub_u_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_asub_u_w() {
+ #[rustfmt::skip]
+ let a = u32x4::new(1, 2, 3, 4);
+ #[rustfmt::skip]
+ let b = u32x4::new(6, 7, 8, 9);
+ #[rustfmt::skip]
+ let r = u32x4::new(5, 5, 5, 5);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_asub_u_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_asub_u_d() {
+ #[rustfmt::skip]
+ let a = u64x2::new(1, 2);
+ #[rustfmt::skip]
+ let b = u64x2::new(6, 7);
+ #[rustfmt::skip]
+ let r = u64x2::new(5, 5);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_asub_u_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ave_s_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ -1, -2, -3, -4,
+ -1, -2, -3, -4,
+ -1, -2, -3, -4,
+ -1, -2, -3, -4
+ );
+ #[rustfmt::skip]
+ let b = i8x16::new(
+ 6, -7, 8, -9,
+ 6, -7, 8, -9,
+ 6, -7, 8, -9,
+ 6, -7, 8, -9
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 2, -5, 2, -7,
+ 2, -5, 2, -7,
+ 2, -5, 2, -7,
+ 2, -5, 2, -7
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_ave_s_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ave_s_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(-1, -2, -3, -4, -1, -2, -3, -4);
+ #[rustfmt::skip]
+ let b = i16x8::new(6, -7, 8, -9, 6, -7, 8, -9);
+ #[rustfmt::skip]
+ let r = i16x8::new(2, -5, 2, -7, 2, -5, 2, -7);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_ave_s_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ave_s_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(-1, -2, -3, -4);
+ #[rustfmt::skip]
+ let b = i32x4::new(6, -7, 8, -9);
+ #[rustfmt::skip]
+ let r = i32x4::new(2, -5, 2, -7);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_ave_s_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ave_s_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(-1, -2);
+ #[rustfmt::skip]
+ let b = i64x2::new(-6, -7);
+ #[rustfmt::skip]
+ let r = i64x2::new(-4, -5);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_ave_s_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ave_u_b() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let b = u8x16::new(
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9
+ );
+ #[rustfmt::skip]
+ let r = u8x16::new(
+ 3, 4, 5, 6,
+ 3, 4, 5, 6,
+ 3, 4, 5, 6,
+ 3, 4, 5, 6
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_ave_u_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ave_u_h() {
+ #[rustfmt::skip]
+ let a = u16x8::new(1, 2, 3, 4, 1, 2, 3, 4);
+ #[rustfmt::skip]
+ let b = u16x8::new(6, 7, 8, 9, 6, 7, 8, 9);
+ #[rustfmt::skip]
+ let r = u16x8::new(3, 4, 5, 6, 3, 4, 5, 6);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_ave_u_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ave_u_w() {
+ #[rustfmt::skip]
+ let a = u32x4::new(1, 2, 3, 4);
+ #[rustfmt::skip]
+ let b = u32x4::new(6, 7, 8, 9);
+ #[rustfmt::skip]
+ let r = u32x4::new(3, 4, 5, 6);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_ave_u_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ave_u_d() {
+ #[rustfmt::skip]
+ let a = u64x2::new(1, 2);
+ #[rustfmt::skip]
+ let b = u64x2::new(6, 7);
+ #[rustfmt::skip]
+ let r = u64x2::new(3, 4);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_ave_u_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_aver_s_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ -1, -2, 3, -4,
+ -1, -2, 3, -4,
+ -1, -2, 3, -4,
+ -1, -2, 3, -4
+ );
+ #[rustfmt::skip]
+ let b = i8x16::new(
+ -6, 7, -8, -9,
+ -6, 7, -8, -9,
+ -6, 7, -8, -9,
+ -6, 7, -8, -9
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ -3, 3, -2, -6,
+ -3, 3, -2, -6,
+ -3, 3, -2, -6,
+ -3, 3, -2, -6
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_aver_s_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_aver_s_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(-1, -2, 3, -4, -1, -2, 3, -4);
+ #[rustfmt::skip]
+ let b = i16x8::new(-6, 7, -8, -9, -6, 7, -8, -9);
+ #[rustfmt::skip]
+ let r = i16x8::new(-3, 3, -2, -6, -3, 3, -2, -6);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_aver_s_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_aver_s_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(-1, -2, 3, -4);
+ #[rustfmt::skip]
+ let b = i32x4::new(-6, 7, -8, -9);
+ #[rustfmt::skip]
+ let r = i32x4::new(-3, 3, -2, -6);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_aver_s_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_aver_s_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(-1, -2);
+ #[rustfmt::skip]
+ let b = i64x2::new(-6, -7);
+ #[rustfmt::skip]
+ let r = i64x2::new(-3, -4);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_aver_s_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_aver_u_b() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let b = u8x16::new(
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9
+ );
+ #[rustfmt::skip]
+ let r = u8x16::new(
+ 4, 5, 6, 7,
+ 4, 5, 6, 7,
+ 4, 5, 6, 7,
+ 4, 5, 6, 7
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_aver_u_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_aver_u_h() {
+ #[rustfmt::skip]
+ let a = u16x8::new(1, 2, 3, 4, 1, 2, 3, 4);
+ #[rustfmt::skip]
+ let b = u16x8::new(6, 7, 8, 9, 6, 7, 8, 9);
+ #[rustfmt::skip]
+ let r = u16x8::new(4, 5, 6, 7, 4, 5, 6, 7);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_aver_u_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_aver_u_w() {
+ #[rustfmt::skip]
+ let a = u32x4::new(1, 2, 3, 4);
+ #[rustfmt::skip]
+ let b = u32x4::new(6, 7, 8, 9);
+ #[rustfmt::skip]
+ let r = u32x4::new(4, 5, 6, 7);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_aver_u_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_aver_u_d() {
+ #[rustfmt::skip]
+ let a = u64x2::new(1, 2);
+ #[rustfmt::skip]
+ let b = u64x2::new(6, 7);
+ #[rustfmt::skip]
+ let r = u64x2::new(4, 5);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_aver_u_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_bclr_b() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ 255, 155, 55, 1,
+ 255, 155, 55, 1,
+ 255, 155, 55, 1,
+ 255, 155, 55, 1
+ );
+ #[rustfmt::skip]
+ let b = u8x16::new(
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9
+ );
+ #[rustfmt::skip]
+ let r = u8x16::new(
+ 191, 27, 54, 1,
+ 191, 27, 54, 1,
+ 191, 27, 54, 1,
+ 191, 27, 54, 1
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_bclr_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_bclr_h() {
+ #[rustfmt::skip]
+ let a = u16x8::new(255, 155, 55, 1, 255, 155, 55, 1);
+ #[rustfmt::skip]
+ let b = u16x8::new(6, 7, 8, 9, 6, 7, 8, 9);
+ #[rustfmt::skip]
+ let r = u16x8::new(191, 27, 55, 1, 191, 27, 55, 1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_bclr_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_bclr_w() {
+ #[rustfmt::skip]
+ let a = u32x4::new(255, 155, 55, 1);
+ #[rustfmt::skip]
+ let b = u32x4::new(6, 7, 8, 9);
+ #[rustfmt::skip]
+ let r = u32x4::new(191, 27, 55, 1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_bclr_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_bclr_d() {
+ #[rustfmt::skip]
+ let a = u64x2::new(255, 155);
+ #[rustfmt::skip]
+ let b = u64x2::new(6, 7);
+ #[rustfmt::skip]
+ let r = u64x2::new(191, 27);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_bclr_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_bclri_b() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ 255, 155, 55, 1,
+ 255, 155, 55, 1,
+ 255, 155, 55, 1,
+ 255, 155, 55, 1
+ );
+ #[rustfmt::skip]
+ let r = u8x16::new(
+ 247, 147, 55, 1,
+ 247, 147, 55, 1,
+ 247, 147, 55, 1,
+ 247, 147, 55, 1
+ );
+
+ assert_eq!(r, mem::transmute(__msa_bclri_b(mem::transmute(a), 3)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_bclri_h() {
+ #[rustfmt::skip]
+ let a = u16x8::new(2155, 1155, 155, 1, 2155, 1155, 155, 1);
+ #[rustfmt::skip]
+ let r = u16x8::new(107, 1155, 155, 1, 107, 1155, 155, 1);
+
+ assert_eq!(r, mem::transmute(__msa_bclri_h(mem::transmute(a), 11)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_bclri_w() {
+ #[rustfmt::skip]
+ let a = u32x4::new(211111155, 111111155, 11111155, 1);
+ #[rustfmt::skip]
+ let r = u32x4::new(202722547, 102722547, 2722547, 1);
+
+ assert_eq!(r, mem::transmute(__msa_bclri_w(mem::transmute(a), 23)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_bclri_d() {
+ #[rustfmt::skip]
+ let a = u64x2::new(211111111155, 11111111111111155);
+ #[rustfmt::skip]
+ let r = u64x2::new(73672157683, 11110973672157683);
+
+ assert_eq!(r, mem::transmute(__msa_bclri_d(mem::transmute(a), 37)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_binsl_b() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ 255, 155, 55, 1,
+ 255, 155, 55, 1,
+ 255, 155, 55, 1,
+ 255, 155, 55, 1
+ );
+ #[rustfmt::skip]
+ let b = u8x16::new(
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9
+ );
+ #[rustfmt::skip]
+ let c = u8x16::new(
+ 1, 3, 5, 9,
+ 1, 3, 5, 9,
+ 1, 3, 5, 9,
+ 1, 3, 5, 9
+ );
+ #[rustfmt::skip]
+ let r = u8x16::new(
+ 63, 11, 11, 1,
+ 63, 11, 11, 1,
+ 63, 11, 11, 1,
+ 63, 11, 11, 1
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_binsl_b(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_binsl_h() {
+ #[rustfmt::skip]
+ let a = u16x8::new(
+ 32767, 16384, 8192, 4096,
+ 32767, 16384, 8192, 4096
+ );
+ #[rustfmt::skip]
+ let b = u16x8::new(
+ 21656, 5273, 7081, 2985,
+ 21656, 5273, 7081, 2985
+ );
+ #[rustfmt::skip]
+ let c = u16x8::new(
+ 3, 7, 9, 13,
+ 15, 17, 21, 23
+ );
+ #[rustfmt::skip]
+ let r = u16x8::new(
+ 24575, 5120, 7040, 2984,
+ 21656, 0, 6144, 2816
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_binsl_h(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_binsl_w() {
+ #[rustfmt::skip]
+ let a = u32x4::new(2147483647, 536870912, 67108864, 8388608);
+ #[rustfmt::skip]
+ let b = u32x4::new(1036372536, 259093134, 78219975, 1119499719);
+ #[rustfmt::skip]
+ let c = u32x4::new(11, 15, 31, 37);
+ #[rustfmt::skip]
+ let r = u32x4::new(1037041663, 259063808, 78219975, 1082130432);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_binsl_w(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_binsl_d() {
+ #[rustfmt::skip]
+ let a = u64x2::new(8006399338, 2882303762);
+ #[rustfmt::skip]
+ let b = u64x2::new(9223372036854775805, 536870912);
+ #[rustfmt::skip]
+ let c = u64x2::new(12, 48);
+ #[rustfmt::skip]
+ let r = u64x2::new(9221120245047489898, 536901394);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_binsl_d(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_binsli_b() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ u8::MAX, 155, 55, 1,
+ u8::MAX, 155, 55, 1,
+ u8::MAX, 155, 55, 1,
+ u8::MAX, 155, 55, 1
+ );
+ #[rustfmt::skip]
+ let b = u8x16::new(
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9
+ );
+ #[rustfmt::skip]
+ let r = u8x16::new(
+ 7, 7, 11, 9,
+ 7, 7, 11, 9,
+ 7, 7, 11, 9,
+ 7, 7, 11, 9
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_binsli_b(mem::transmute(a), mem::transmute(b), 5))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_binsli_h() {
+ #[rustfmt::skip]
+ let a = u16x8::new(
+ 32767, 16384, 8192, 4096,
+ 32767, 16384, 8192, 4096
+ );
+ #[rustfmt::skip]
+ let b = u16x8::new(
+ 21656, 5273, 7081, 2985,
+ 21656, 5273, 7081, 2985
+ );
+ #[rustfmt::skip]
+ let r = u16x8::new(
+ 21659, 5272, 7080, 2984,
+ 21659, 5272, 7080, 2984
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_binsli_h(mem::transmute(a), mem::transmute(b), 13))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_binsli_w() {
+ #[rustfmt::skip]
+ let a = u32x4::new(2147483647, 536870912, 67108864, 8388608);
+ #[rustfmt::skip]
+ let b = u32x4::new(1036372536, 259093134, 78219975, 1119499719);
+ #[rustfmt::skip]
+ let r = u32x4::new(1036386303, 259080192, 78217216, 1119485952);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_binsli_w(mem::transmute(a), mem::transmute(b), 17))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_binsli_d() {
+ #[rustfmt::skip]
+ let a = u64x2::new(8006399338, 2882303762);
+ #[rustfmt::skip]
+ let b = u64x2::new(9223372036854775805, 536870912);
+ #[rustfmt::skip]
+ let r = u64x2::new(9223372036854773098, 536901394);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_binsli_d(mem::transmute(a), mem::transmute(b), 48))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_binsr_b() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ 255, 155, 55, 1,
+ 255, 155, 55, 1,
+ 255, 155, 55, 1,
+ 255, 155, 55, 1
+ );
+ #[rustfmt::skip]
+ let b = u8x16::new(
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9
+ );
+ #[rustfmt::skip]
+ let c = u8x16::new(
+ 1, 3, 5, 9,
+ 1, 3, 5, 9,
+ 1, 3, 5, 9,
+ 1, 3, 5, 9
+ );
+ #[rustfmt::skip]
+ let r = u8x16::new(
+ 254, 151, 8, 1,
+ 254, 151, 8, 1,
+ 254, 151, 8, 1,
+ 254, 151, 8, 1
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_binsr_b(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_binsr_h() {
+ #[rustfmt::skip]
+ let a = u16x8::new(
+ 32767, 16384, 8192, 4096,
+ 32767, 16384, 8192, 4096
+ );
+ #[rustfmt::skip]
+ let b = u16x8::new(
+ 21656, 5273, 7081, 2985,
+ 21656, 5273, 7081, 2985
+ );
+ #[rustfmt::skip]
+ let c = u16x8::new(
+ 3, 7, 9, 13,
+ 15, 17, 21, 23
+ );
+ #[rustfmt::skip]
+ let r = u16x8::new(
+ 32760, 16537, 9129, 2985,
+ 21656, 16385, 8233, 4265
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_binsr_h(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_binsr_w() {
+ #[rustfmt::skip]
+ let a = u32x4::new(2147483647, 536870912, 67108864, 8388608);
+ #[rustfmt::skip]
+ let b = u32x4::new(1036372536, 259093134, 78219975, 1119499719);
+ #[rustfmt::skip]
+ let c = u32x4::new(11, 15, 31, 37);
+ #[rustfmt::skip]
+ let r = u32x4::new(2147482168, 536900238, 78219975, 8388615);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_binsr_w(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_binsr_d() {
+ #[rustfmt::skip]
+ let a = u64x2::new(8006399338, 2882303762);
+ #[rustfmt::skip]
+ let b = u64x2::new(9223372036854775805, 536870912);
+ #[rustfmt::skip]
+ let c = u64x2::new(12, 48);
+ #[rustfmt::skip]
+ let r = u64x2::new(8006402045, 536870912);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_binsr_d(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_binsri_b() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ 255, 155, 55, 1,
+ 255, 155, 55, 1,
+ 255, 155, 55, 1,
+ 255, 155, 55, 1
+ );
+ #[rustfmt::skip]
+ let b = u8x16::new(
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9
+ );
+ #[rustfmt::skip]
+ let r = u8x16::new(
+ 198, 135, 8, 9,
+ 198, 135, 8, 9,
+ 198, 135, 8, 9,
+ 198, 135, 8, 9
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_binsri_b(mem::transmute(a), mem::transmute(b), 5))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_binsri_h() {
+ #[rustfmt::skip]
+ let a = u16x8::new(
+ 32767, 16384, 8192, 4096,
+ 32767, 16384, 8192, 4096
+ );
+ #[rustfmt::skip]
+ let b = u16x8::new(
+ 21656, 5273, 7081, 2985,
+ 21656, 5273, 7081, 2985
+ );
+ #[rustfmt::skip]
+ let r = u16x8::new(
+ 21656, 21657, 7081, 2985,
+ 21656, 21657, 7081, 2985
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_binsri_h(mem::transmute(a), mem::transmute(b), 13))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_binsri_w() {
+ #[rustfmt::skip]
+ let a = u32x4::new(2147483647, 536870912, 67108864, 8388608);
+ #[rustfmt::skip]
+ let b = u32x4::new(1036372536, 259093134, 78219975, 1119499719);
+ #[rustfmt::skip]
+ let r = u32x4::new(2147338808, 536965774, 67209927, 8533447);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_binsri_w(mem::transmute(a), mem::transmute(b), 17))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_binsri_d() {
+ #[rustfmt::skip]
+ let a = u64x2::new(8006399338, 2882303762);
+ #[rustfmt::skip]
+ let b = u64x2::new(9223372036854775805, 536870912);
+ #[rustfmt::skip]
+ let r = u64x2::new(562949953421309, 536870912);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_binsri_d(mem::transmute(a), mem::transmute(b), 48))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_bmnz_v() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ u8::MAX, 155, 55, 1,
+ u8::MAX, 155, 55, 1,
+ u8::MAX, 155, 55, 1,
+ u8::MAX, 155, 55, 1
+ );
+ #[rustfmt::skip]
+ let b = u8x16::new(
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ );
+ #[rustfmt::skip]
+ let c = u8x16::new(
+ 3, 5, 7, 1,
+ 3, 5, 7, 1,
+ 3, 5, 7, 1,
+ 3, 5, 7, 1
+ );
+ #[rustfmt::skip]
+ let r = u8x16::new(
+ 254, 159, 48, 1,
+ 254, 159, 48, 1,
+ 254, 159, 48, 1,
+ 254, 159, 48, 1
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_bmnz_v(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_bmnzi_b() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ u8::MAX, 155, 55, 1,
+ u8::MAX, 155, 55, 1,
+ u8::MAX, 155, 55, 1,
+ u8::MAX, 155, 55, 1
+ );
+ #[rustfmt::skip]
+ let b = u8x16::new(
+ 1, u8::MAX, 155, 55,
+ 1, u8::MAX, 155, 55,
+ 1, u8::MAX, 155, 55,
+ 1, u8::MAX, 155, 55
+ );
+ #[rustfmt::skip]
+ let r = u8x16::new(
+ 249, 159, 51, 7,
+ 249, 159, 51, 7,
+ 249, 159, 51, 7,
+ 249, 159, 51, 7
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_bmnzi_b(mem::transmute(a), mem::transmute(b), 7))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_bmz_v() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ u8::MAX, 155, 55, 1,
+ u8::MAX, 155, 55, 1,
+ u8::MAX, 155, 55, 1,
+ u8::MAX, 155, 55, 1
+ );
+ #[rustfmt::skip]
+ let b = u8x16::new(
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9
+ );
+ #[rustfmt::skip]
+ let c = u8x16::new(
+ 3, 5, 7, 1,
+ 3, 5, 7, 1,
+ 3, 5, 7, 1,
+ 3, 5, 7, 1
+ );
+ #[rustfmt::skip]
+ let r = u8x16::new(
+ 7, 3, 15, 9,
+ 7, 3, 15, 9,
+ 7, 3, 15, 9,
+ 7, 3, 15, 9
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_bmz_v(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_bmzi_b() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ u8::MAX, 155, 55, 1,
+ u8::MAX, 155, 55, 1,
+ u8::MAX, 155, 55, 1,
+ u8::MAX, 155, 55, 1
+ );
+ #[rustfmt::skip]
+ let b = u8x16::new(
+ 1, 255, 155, 55,
+ 1, 255, 155, 55,
+ 1, 255, 155, 55,
+ 1, 255, 155, 55
+ );
+ #[rustfmt::skip]
+ let r = u8x16::new(
+ 7, 251, 159, 49,
+ 7, 251, 159, 49,
+ 7, 251, 159, 49,
+ 7, 251, 159, 49
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_bmzi_b(mem::transmute(a), mem::transmute(b), 7))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_bneg_b() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ 255, 155, 55, 1,
+ 255, 155, 55, 1,
+ 255, 155, 55, 1,
+ 255, 155, 55, 1
+ );
+ #[rustfmt::skip]
+ let b = u8x16::new(
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9
+ );
+ #[rustfmt::skip]
+ let r = u8x16::new(
+ 191, 27, 54, 3,
+ 191, 27, 54, 3,
+ 191, 27, 54, 3,
+ 191, 27, 54, 3
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_bneg_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_bneg_h() {
+ #[rustfmt::skip]
+ let a = u16x8::new(255, 155, 55, 1, 255, 155, 55, 1);
+ #[rustfmt::skip]
+ let b = u16x8::new(6, 7, 8, 9, 6, 7, 8, 9);
+ #[rustfmt::skip]
+ let r = u16x8::new(191, 27, 311, 513, 191, 27, 311, 513);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_bneg_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_bneg_w() {
+ #[rustfmt::skip]
+ let a = u32x4::new(255, 155, 55, 1);
+ #[rustfmt::skip]
+ let b = u32x4::new(6, 7, 8, 9);
+ #[rustfmt::skip]
+ let r = u32x4::new(191, 27, 311, 513);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_bneg_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_bneg_d() {
+ #[rustfmt::skip]
+ let a = u64x2::new(255, 155);
+ #[rustfmt::skip]
+ let b = u64x2::new(6, 7);
+ #[rustfmt::skip]
+ let r = u64x2::new(191, 27);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_bneg_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_bnegi_b() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ 50, 100, 127, u8::MAX,
+ 50, 100, 127, u8::MAX,
+ 50, 100, 127, u8::MAX,
+ 50, 100, 127, u8::MAX
+ );
+ #[rustfmt::skip]
+ let r = u8x16::new(
+ 34, 116, 111, 239,
+ 34, 116, 111, 239,
+ 34, 116, 111, 239,
+ 34, 116, 111, 239
+ );
+
+ assert_eq!(r, mem::transmute(__msa_bnegi_b(mem::transmute(a), 4)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_bnegi_h() {
+ #[rustfmt::skip]
+ let a = u16x8::new(
+ 32767, 3276, 100, 127,
+ 32767, 3276, 100, 127
+ );
+ #[rustfmt::skip]
+ let r = u16x8::new(
+ 30719, 1228, 2148, 2175,
+ 30719, 1228, 2148, 2175
+ );
+
+ assert_eq!(r, mem::transmute(__msa_bnegi_h(mem::transmute(a), 11)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_bnegi_w() {
+ #[rustfmt::skip]
+ let a = u32x4::new(100, 2147483647, 100, 2147483648);
+ #[rustfmt::skip]
+ let r = u32x4::new(16777316, 2130706431, 16777316, 2164260864);
+
+ assert_eq!(r, mem::transmute(__msa_bnegi_w(mem::transmute(a), 24)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_bnegi_d() {
+ #[rustfmt::skip]
+ let a = u64x2::new(100, 9223372036854775808);
+ #[rustfmt::skip]
+ let r = u64x2::new(4398046511204, 9223376434901286912);
+
+ assert_eq!(r, mem::transmute(__msa_bnegi_d(mem::transmute(a), 42)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_bnz_b() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ 1, 1, 1, 1,
+ 1, 1, 1, 1,
+ 2, 2, 2, 2,
+ 4, 4, 0, 4,
+ );
+ let r = 0 as i32;
+
+ assert_eq!(r, mem::transmute(__msa_bnz_b(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_bnz_h() {
+ #[rustfmt::skip]
+ let a = u16x8::new(
+ 32767, 3276, 100, 127,
+ 32767, 0, 100, 127
+ );
+ let r = 0 as i32;
+
+ assert_eq!(r, mem::transmute(__msa_bnz_h(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_bnz_w() {
+ #[rustfmt::skip]
+ let a = u32x4::new(100, 2147483647, 0, 2147483648);
+ let r = 0 as i32;
+
+ assert_eq!(r, mem::transmute(__msa_bnz_w(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_bnz_d() {
+ #[rustfmt::skip]
+ let a = u64x2::new(100, 9223372036854775808);
+ #[rustfmt::skip]
+ let r = 1 as i32;
+
+ assert_eq!(r, mem::transmute(__msa_bnz_d(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_bnz_v() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ 0, 0, 0, 1,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ );
+ let r = 1 as i32;
+
+ assert_eq!(r, mem::transmute(__msa_bnz_v(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_bsel_v() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ 3, 5, 7, 1,
+ 3, 5, 7, 1,
+ 3, 5, 7, 1,
+ 3, 5, 7, 1
+ );
+ #[rustfmt::skip]
+ let b = u8x16::new(
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9
+ );
+ #[rustfmt::skip]
+ let c = u8x16::new(
+ 255, 155, 55, 1,
+ 255, 155, 55, 1,
+ 255, 155, 55, 1,
+ 255, 155, 55, 1
+ );
+ #[rustfmt::skip]
+ let r = u8x16::new(
+ 7, 3, 15, 9,
+ 7, 3, 15, 9,
+ 7, 3, 15, 9,
+ 7, 3, 15, 9
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_bsel_v(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_bseli_b() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ 255, 155, 55, 1,
+ 255, 155, 55, 1,
+ 255, 155, 55, 1,
+ 255, 155, 55, 1
+ );
+ #[rustfmt::skip]
+ let b = u8x16::new(
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9
+ );
+ #[rustfmt::skip]
+ let r = u8x16::new(
+ 121, 29, 57, 9,
+ 121, 29, 57, 9,
+ 121, 29, 57, 9,
+ 121, 29, 57, 9
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_bseli_b(mem::transmute(a), mem::transmute(b), 121))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_bset_b() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ 255, 155, 55, 1,
+ 255, 155, 55, 1,
+ 255, 155, 55, 1,
+ 255, 155, 55, 1
+ );
+ #[rustfmt::skip]
+ let b = u8x16::new(
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9
+ );
+ #[rustfmt::skip]
+ let r = u8x16::new(
+ 255, 155, 55, 3,
+ 255, 155, 55, 3,
+ 255, 155, 55, 3,
+ 255, 155, 55, 3
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_bset_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_bset_h() {
+ #[rustfmt::skip]
+ let a = u16x8::new(255, 155, 55, 1, 255, 155, 55, 1);
+ #[rustfmt::skip]
+ let b = u16x8::new(6, 7, 8, 9, 6, 7, 8, 9);
+ #[rustfmt::skip]
+ let r = u16x8::new(255, 155, 311, 513, 255, 155, 311, 513);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_bset_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_bset_w() {
+ #[rustfmt::skip]
+ let a = u32x4::new(255, 155, 55, 1);
+ #[rustfmt::skip]
+ let b = u32x4::new(6, 7, 8, 9);
+ #[rustfmt::skip]
+ let r = u32x4::new(255, 155, 311, 513);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_bset_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_bset_d() {
+ #[rustfmt::skip]
+ let a = u64x2::new(255, 155);
+ #[rustfmt::skip]
+ let b = u64x2::new(6, 7);
+ #[rustfmt::skip]
+ let r = u64x2::new(255, 155);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_bset_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_bseti_b() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ 255, 155, 55, 1,
+ 255, 155, 55, 1,
+ 255, 155, 55, 1,
+ 255, 155, 55, 1
+ );
+ #[rustfmt::skip]
+ let r = u8x16::new(
+ 255, 159, 55, 5,
+ 255, 159, 55, 5,
+ 255, 159, 55, 5,
+ 255, 159, 55, 5
+ );
+
+ assert_eq!(r, mem::transmute(__msa_bseti_b(mem::transmute(a), 2)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_bseti_h() {
+ #[rustfmt::skip]
+ let a = u16x8::new(255, 155, 55, 1, 255, 155, 55, 1);
+ #[rustfmt::skip]
+ let r = u16x8::new(255, 159, 55, 5, 255, 159, 55, 5);
+
+ assert_eq!(r, mem::transmute(__msa_bseti_h(mem::transmute(a), 2)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_bseti_w() {
+ #[rustfmt::skip]
+ let a = u32x4::new(255, 155, 55, 1);
+ #[rustfmt::skip]
+ let r = u32x4::new(255, 159, 55, 5);
+
+ assert_eq!(r, mem::transmute(__msa_bseti_w(mem::transmute(a), 2)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_bseti_d() {
+ #[rustfmt::skip]
+ let a = u64x2::new(255, 155);
+ #[rustfmt::skip]
+ let r = u64x2::new(255, 159);
+
+ assert_eq!(r, mem::transmute(__msa_bseti_d(mem::transmute(a), 2)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_bz_b() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ 255, 155, 55, 1,
+ 255, 155, 55, 1,
+ 255, 155, 55, 1,
+ 255, 155, 55, 1
+ );
+ let r = 0 as i32;
+
+ assert_eq!(r, mem::transmute(__msa_bz_b(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_bz_h() {
+ #[rustfmt::skip]
+ let a = u16x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+ let r = 1 as i32;
+
+ assert_eq!(r, mem::transmute(__msa_bz_h(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_bz_w() {
+ #[rustfmt::skip]
+ let a = u32x4::new(255, 0, 55, 1);
+ let r = 1 as i32;
+
+ assert_eq!(r, mem::transmute(__msa_bz_w(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_bz_d() {
+ #[rustfmt::skip]
+ let a = u64x2::new(255, 0);
+ let r = 1 as i32;
+
+ assert_eq!(r, mem::transmute(__msa_bz_d(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_bz_v() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0
+ );
+ let r = 1 as i32;
+
+ assert_eq!(r, mem::transmute(__msa_bz_v(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ceq_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ -128, 127, 55, 1,
+ -128, 127, 55, 1,
+ -128, 127, 55, 1,
+ -128, 127, 55, 1
+ );
+ #[rustfmt::skip]
+ let b = i8x16::new(
+ -128, 126, 55, 1,
+ -128, 126, 55, 1,
+ -128, 126, 55, 1,
+ -128, 126, 55, 1
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ -1, 0, -1, -1,
+ -1, 0, -1, -1,
+ -1, 0, -1, -1,
+ -1, 0, -1, -1
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_ceq_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ceq_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(255, 155, 55, 1, 255, 155, 55, 1);
+ #[rustfmt::skip]
+ let b = i16x8::new(255, 155, 56, 1, 255, 155, 56, 1);
+ #[rustfmt::skip]
+ let r = i16x8::new(-1, -1, 0, -1, -1, -1, 0, -1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_ceq_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ceq_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(255, 155, 55, 1);
+ #[rustfmt::skip]
+ let b = i32x4::new(255, 156, 55, 1);
+ #[rustfmt::skip]
+ let r = i32x4::new(-1, 0, -1, -1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_ceq_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ceq_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(255, 155);
+ #[rustfmt::skip]
+ let b = i64x2::new(255, 156);
+ #[rustfmt::skip]
+ let r = i64x2::new(-1, 0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_ceq_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ceqi_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ 100, -1, -4, 15,
+ 100, -1, -4, 15,
+ 100, -1, -4, 15,
+ 100, -1, -4, 15
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 0, 0, -1, 0,
+ 0, 0, -1, 0,
+ 0, 0, -1, 0,
+ 0, 0, -1, 0
+ );
+
+ assert_eq!(r, mem::transmute(__msa_ceqi_b(mem::transmute(a), -4)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ceqi_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ 32767, 3276, 100, -11,
+ 32767, 3276, 100, -11
+ );
+ #[rustfmt::skip]
+ let r = i16x8::new(0, 0, 0, -1, 0, 0, 0, -1);
+
+ assert_eq!(r, mem::transmute(__msa_ceqi_h(mem::transmute(a), -11)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ceqi_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(1, 3, 5, -3);
+ #[rustfmt::skip]
+ let r = i32x4::new(0, 0, -1, 0);
+
+ assert_eq!(r, mem::transmute(__msa_ceqi_w(mem::transmute(a), 5)));
+ }
+
+ // FIXME: https://reviews.llvm.org/D59884
+ // If target type is i64, negative immediate loses the sign
+ // Test passes if 4294967293 is used instead -3 in vector `a`
+ // #[simd_test(enable = "msa")]
+ // unsafe fn test_msa_ceqi_d() {
+ // #[rustfmt::skip]
+ // let a = i64x2::new(-3, 2);
+ // #[rustfmt::skip]
+ // let r = i64x2::new(-1, 0);
+
+ // assert_eq!(r, mem::transmute(__msa_ceqi_d(mem::transmute(a), -3)));
+ // }
+
+ // Can not be tested in user mode
+ // #[simd_test(enable = "msa")]
+ // unsafe fn test_msa_cfcmsa() {
+ // let r = 5;
+
+ // assert_eq!(r, mem::transmute(__msa_cfcmsa(5));
+ // }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_cle_s_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ -128, 127, 55, 2,
+ -128, 127, 55, 2,
+ -128, 127, 55, 2,
+ -128, 127, 55, 2
+ );
+ #[rustfmt::skip]
+ let b = i8x16::new(
+ -128, 126, 55, 1,
+ -128, 126, 55, 1,
+ -128, 126, 55, 1,
+ -128, 126, 55, 1
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ -1, 0, -1, 0,
+ -1, 0, -1, 0,
+ -1, 0, -1, 0,
+ -1, 0, -1, 0
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_cle_s_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_cle_s_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(255, 155, 55, 2, 255, 155, 55, 2);
+ #[rustfmt::skip]
+ let b = i16x8::new(255, 155, 56, 1, 255, 155, 56, 1);
+ #[rustfmt::skip]
+ let r = i16x8::new(-1, -1, -1, 0, -1, -1, -1, 0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_cle_s_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_cle_s_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(255, 155, 55, 2);
+ #[rustfmt::skip]
+ let b = i32x4::new(255, 156, 55, 1);
+ #[rustfmt::skip]
+ let r = i32x4::new(-1, -1, -1, 0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_cle_s_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_cle_s_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(255, 155);
+ #[rustfmt::skip]
+ let b = i64x2::new(255, 156);
+ #[rustfmt::skip]
+ let r = i64x2::new(-1, -1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_cle_s_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_cle_u_b() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ u8::MAX, 127, 55, 2,
+ u8::MAX, 127, 55, 2,
+ u8::MAX, 127, 55, 2,
+ u8::MAX, 127, 55, 2
+ );
+ #[rustfmt::skip]
+ let b = u8x16::new(
+ u8::MAX, 126, 55, 1,
+ u8::MAX, 126, 55, 1,
+ u8::MAX, 126, 55, 1,
+ u8::MAX, 126, 55, 1
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(-1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_cle_u_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_cle_u_h() {
+ #[rustfmt::skip]
+ let a = u16x8::new(
+ u16::MAX, 155, 55, 2,
+ u16::MAX, 155, 55, 2
+ );
+ #[rustfmt::skip]
+ let b = u16x8::new(
+ u16::MAX, 155, 56, 1,
+ u16::MAX, 155, 56, 1
+ );
+ #[rustfmt::skip]
+ let r = i16x8::new(-1, -1, -1, 0, -1, -1, -1, 0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_cle_u_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_cle_u_w() {
+ #[rustfmt::skip]
+ let a = u32x4::new(u32::MAX, 155, 55, 2);
+ #[rustfmt::skip]
+ let b = u32x4::new(u32::MAX, 156, 55, 1);
+ #[rustfmt::skip]
+ let r = i32x4::new(-1, -1, -1, 0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_cle_u_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_cle_u_d() {
+ #[rustfmt::skip]
+ let a = u64x2::new(u64::MAX, 155);
+ #[rustfmt::skip]
+ let b = u64x2::new(u64::MAX, 156);
+ #[rustfmt::skip]
+ let r = i64x2::new(-1, -1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_cle_u_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_clei_s_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ -2, -127, 100, -127,
+ -2, -127, 100, -127,
+ -2, -127, 100, -127,
+ -2, -127, 100, -127
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(-1, -1, 0, -1, -1, -1, 0, -1, -1, -1, 0, -1, -1, -1, 0, -1);
+
+ assert_eq!(r, mem::transmute(__msa_clei_s_b(mem::transmute(a), -2)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_clei_s_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ 32767, 3276, 10, -1,
+ 32767, 3276, 10, -1,
+ );
+ #[rustfmt::skip]
+ let r = i16x8::new(0, 0, 0, -1, 0, 0, 0, -1);
+
+ assert_eq!(r, mem::transmute(__msa_clei_s_h(mem::transmute(a), -1)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_clei_s_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(100, 2147483647, 6, 2147483647);
+ #[rustfmt::skip]
+ let r = i32x4::new(0, 0, -1, 0);
+
+ assert_eq!(r, mem::transmute(__msa_clei_s_w(mem::transmute(a), 6)));
+ }
+
+ // FIXME: https://reviews.llvm.org/D59884
+ // If target type is i64, negative immediate loses the sign
+ // -3 is represented as 4294967293
+ // #[simd_test(enable = "msa")]
+ // unsafe fn test_msa_clei_s_d() {
+ // #[rustfmt::skip]
+ // let a = i64x2::new(-3, 11);
+ // #[rustfmt::skip]
+ // let r = i64x2::new(-1, 0);
+
+ // assert_eq!(r, mem::transmute(__msa_clei_s_d(mem::transmute(a), -3)));
+ // }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_clei_u_b() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ 2, 127, 100, 127,
+ 2, 127, 100, 127,
+ 2, 127, 100, 127,
+ 2, 127, 100, 127,
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ -1, 0, 0, 0,
+ -1, 0, 0, 0,
+ -1, 0, 0, 0,
+ -1, 0, 0, 0
+ );
+
+ assert_eq!(r, mem::transmute(__msa_clei_u_b(mem::transmute(a), 25)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_clei_u_h() {
+ #[rustfmt::skip]
+ let a = u16x8::new(
+ 1, 26, 15, 36,
+ 1, 26, 15, 36
+ );
+ #[rustfmt::skip]
+ let r = i16x8::new(-1, 0, -1, 0, -1, 0, -1, 0);
+
+ assert_eq!(r, mem::transmute(__msa_clei_u_h(mem::transmute(a), 25)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_clei_u_w() {
+ #[rustfmt::skip]
+ let a = u32x4::new(25, 32, 25, 32);
+ #[rustfmt::skip]
+ let r = i32x4::new(-1, 0, -1, 0);
+
+ assert_eq!(r, mem::transmute(__msa_clei_u_w(mem::transmute(a), 31)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_clei_u_d() {
+ #[rustfmt::skip]
+ let a = u64x2::new(10, 26);
+ #[rustfmt::skip]
+ let r = i64x2::new(-1, 0);
+
+ assert_eq!(r, mem::transmute(__msa_clei_u_d(mem::transmute(a), 25)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_clt_s_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ -128, 127, 55, 2,
+ -128, 127, 55, 2,
+ -128, 127, 55, 2,
+ -128, 127, 55, 2
+ );
+ #[rustfmt::skip]
+ let b = i8x16::new(
+ -127, 126, 56, 1,
+ -127, 126, 56, 1,
+ -127, 126, 56, 1,
+ -127, 126, 56, 1
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ -1, 0, -1, 0,
+ -1, 0, -1, 0,
+ -1, 0, -1, 0,
+ -1, 0, -1, 0
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_clt_s_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_clt_s_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(-255, 155, 55, 2, -255, 155, 55, 2);
+ #[rustfmt::skip]
+ let b = i16x8::new(255, 156, 56, 1, 255, 156, 56, 1);
+ #[rustfmt::skip]
+ let r = i16x8::new(-1, -1, -1, 0, -1, -1, -1, 0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_clt_s_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_clt_s_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(-255, 155, 55, 2);
+ #[rustfmt::skip]
+ let b = i32x4::new(255, 156, 55, 1);
+ #[rustfmt::skip]
+ let r = i32x4::new(-1, -1, 0, 0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_clt_s_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_clt_s_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(-255, 155);
+ #[rustfmt::skip]
+ let b = i64x2::new(255, 156);
+ #[rustfmt::skip]
+ let r = i64x2::new(-1, -1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_clt_s_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_clt_u_b() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ 128, 127, 55, 2,
+ 128, 127, 55, 2,
+ 128, 127, 55, 2,
+ 128, 127, 55, 2
+ );
+ #[rustfmt::skip]
+ let b = u8x16::new(
+ 127, 126, 56, 1,
+ 127, 126, 56, 1,
+ 127, 126, 56, 1,
+ 127, 126, 56, 1
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 0, 0, -1, 0,
+ 0, 0, -1, 0,
+ 0, 0, -1, 0,
+ 0, 0, -1, 0
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_clt_u_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_clt_u_h() {
+ #[rustfmt::skip]
+ let a = u16x8::new(255, 155, 55, 2, 255, 155, 55, 2);
+ #[rustfmt::skip]
+ let b = u16x8::new(255, 156, 56, 1, 255, 156, 56, 1);
+ #[rustfmt::skip]
+ let r = i16x8::new(0, -1, -1, 0, 0, -1, -1, 0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_clt_u_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_clt_u_w() {
+ #[rustfmt::skip]
+ let a = u32x4::new(255, 155, 55, 2);
+ #[rustfmt::skip]
+ let b = u32x4::new(255, 156, 55, 1);
+ #[rustfmt::skip]
+ let r = i32x4::new(0, -1, 0, 0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_clt_u_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_clt_u_d() {
+ #[rustfmt::skip]
+ let a = u64x2::new(255, 155);
+ #[rustfmt::skip]
+ let b = u64x2::new(255, 156);
+ #[rustfmt::skip]
+ let r = i64x2::new(0, -1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_clt_u_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_clti_s_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ 2, -127, -5, 127,
+ 2, -127, -5, 127,
+ 2, -127, -5, 127,
+ 2, -127, -5, 127
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 0, -1, 0, 0,
+ 0, -1, 0, 0,
+ 0, -1, 0, 0,
+ 0, -1, 0, 0
+ );
+
+ assert_eq!(r, mem::transmute(__msa_clti_s_b(mem::transmute(a), -5)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_clti_s_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ -1024, 3276, 15, 127,
+ -1024, 3276, 15, 127
+ );
+ #[rustfmt::skip]
+ let r = i16x8::new(-1, 0, 0, 0, -1, 0, 0, 0);
+
+ assert_eq!(r, mem::transmute(__msa_clti_s_h(mem::transmute(a), 15)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_clti_s_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(-15, 2147483647, -15, 2147483647);
+ #[rustfmt::skip]
+ let r = i32x4::new(-1, 0, -1, 0);
+
+ assert_eq!(r, mem::transmute(__msa_clti_s_w(mem::transmute(a), -10)));
+ }
+
+ // FIXME: https://reviews.llvm.org/D59884
+ // If target type is i64, negative immediate loses the sign
+ // -3 is represented as 4294967293
+ // #[simd_test(enable = "msa")]
+ // unsafe fn test_msa_clti_s_d() {
+ // #[rustfmt::skip]
+ // let a = i64x2::new(-5, -2);
+ // #[rustfmt::skip]
+ // let r = i64x2::new(-1, 0);
+
+ // assert_eq!(r, mem::transmute(__msa_clti_s_d(mem::transmute(a), -3)));
+ // }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_clti_u_b() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ 2, 127, 49, 127,
+ 2, 127, 49, 127,
+ 2, 127, 49, 127,
+ 2, 127, 49, 127,
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ -1, 0, 0, 0,
+ -1, 0, 0, 0,
+ -1, 0, 0, 0,
+ -1, 0, 0, 0
+ );
+
+ assert_eq!(r, mem::transmute(__msa_clti_u_b(mem::transmute(a), 50)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_clti_u_h() {
+ #[rustfmt::skip]
+ let a = u16x8::new(
+ 327, 3276, 100, 127,
+ 327, 3276, 100, 127
+ );
+ #[rustfmt::skip]
+ let r = i16x8::new(0, 0, 0, 0, 0, 0, 0, 0);
+
+ assert_eq!(r, mem::transmute(__msa_clti_u_h(mem::transmute(a), 30)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_clti_u_w() {
+ #[rustfmt::skip]
+ let a = u32x4::new(100, 2147483647, 100, 2147483647);
+ #[rustfmt::skip]
+ let r = i32x4::new(0, 0, 0, 0);
+
+ assert_eq!(r, mem::transmute(__msa_clti_u_w(mem::transmute(a), 10)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_clti_u_d() {
+ #[rustfmt::skip]
+ let a = u64x2::new(1, 9223372036854775807);
+ #[rustfmt::skip]
+ let r = i64x2::new(-1, 0);
+
+ assert_eq!(r, mem::transmute(__msa_clti_u_d(mem::transmute(a), 10)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_copy_s_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ -100, 127, 4, 127,
+ -100, 127, 4, 127,
+ -100, 127, 4, 127,
+ -100, 127, 4, 127
+ );
+ #[rustfmt::skip]
+ let r = -100 as i32;
+
+ assert_eq!(r, mem::transmute(__msa_copy_s_b(mem::transmute(a), 12)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_copy_s_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ 32767, 3276, 100, 11,
+ 32767, 3276, 100, 11
+ );
+ #[rustfmt::skip]
+ let r = 32767 as i32;
+
+ assert_eq!(r, mem::transmute(__msa_copy_s_h(mem::transmute(a), 4)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_copy_s_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(100, 2147483647, 5, -2147483647);
+ let r = 2147483647 as i32;
+
+ assert_eq!(r, mem::transmute(__msa_copy_s_w(mem::transmute(a), 1)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_copy_s_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(3, 9223372036854775807);
+ #[rustfmt::skip]
+ let r = 9223372036854775807 as i64;
+
+ assert_eq!(r, mem::transmute(__msa_copy_s_d(mem::transmute(a), 1)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_copy_u_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ 100, 127, 4, 127,
+ 100, 127, 4, 127,
+ 100, 127, 4, 127,
+ 100, 127, 4, 127
+ );
+ #[rustfmt::skip]
+ let r = 100 as u32;
+
+ assert_eq!(r, mem::transmute(__msa_copy_u_b(mem::transmute(a), 12)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_copy_u_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ 32767, 3276, 100, 11,
+ 32767, 3276, 100, 11
+ );
+ #[rustfmt::skip]
+ let r = 32767 as u32;
+
+ assert_eq!(r, mem::transmute(__msa_copy_u_h(mem::transmute(a), 4)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_copy_u_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(100, 2147483647, 5, 2147483647);
+ #[rustfmt::skip]
+ let r = 2147483647 as u32;
+
+ assert_eq!(r, mem::transmute(__msa_copy_u_w(mem::transmute(a), 1)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_copy_u_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(3, i64::MAX);
+ #[rustfmt::skip]
+ let r = 9223372036854775807 as u64;
+
+ assert_eq!(r, mem::transmute(__msa_copy_u_d(mem::transmute(a), 1)));
+ }
+
+ // Can not be tested in user mode
+ // #[simd_test(enable = "msa")]
+ // unsafe fn test_msa_ctcmsa() {
+ // }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_div_s_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ -6, -7, -8, -9,
+ -6, -7, -8, -9,
+ -6, -7, -8, -9,
+ -6, -7, -8, -9
+ );
+ #[rustfmt::skip]
+ let b = i8x16::new(
+ -1, -2, -3, -4,
+ -1, -2, -3, -4,
+ -1, -2, -3, -4,
+ -1, -2, -3, -4
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 6, 3, 2, 2,
+ 6, 3, 2, 2,
+ 6, 3, 2, 2,
+ 6, 3, 2, 2
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_div_s_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_div_s_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(-6, -7, -8, -9, 6, 7, 8, 9);
+ #[rustfmt::skip]
+ let b = i16x8::new(-1, -2, -3, -4, -1, -2, -3, -4);
+ #[rustfmt::skip]
+ let r = i16x8::new(6, 3, 2, 2, -6, -3, -2, -2);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_div_s_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_div_s_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(-6, -7, 8, 9);
+ #[rustfmt::skip]
+ let b = i32x4::new(-1, -2, -3, -4);
+ #[rustfmt::skip]
+ let r = i32x4::new(6, 3, -2, -2);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_div_s_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_div_s_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(-6, 7);
+ #[rustfmt::skip]
+ let b = i64x2::new(-1, -2);
+ #[rustfmt::skip]
+ let r = i64x2::new(6, -3);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_div_s_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_div_u_b() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9
+ );
+ #[rustfmt::skip]
+ let b = u8x16::new(
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let r = u8x16::new(
+ 6, 3, 2, 2,
+ 6, 3, 2, 2,
+ 6, 3, 2, 2,
+ 6, 3, 2, 2
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_div_u_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_div_u_h() {
+ #[rustfmt::skip]
+ let a = u16x8::new(6, 7, 8, 9, 6, 7, 8, 9);
+ #[rustfmt::skip]
+ let b = u16x8::new(1, 2, 3, 4, 1, 2, 3, 4);
+ #[rustfmt::skip]
+ let r = u16x8::new(6, 3, 2, 2, 6, 3, 2, 2);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_div_u_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_div_u_w() {
+ #[rustfmt::skip]
+ let a = u32x4::new(6, 7, 8, 9);
+ #[rustfmt::skip]
+ let b = u32x4::new(1, 2, 3, 4);
+ #[rustfmt::skip]
+ let r = u32x4::new(6, 3, 2, 2);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_div_u_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_div_u_d() {
+ #[rustfmt::skip]
+ let a = u64x2::new(6, 7);
+ #[rustfmt::skip]
+ let b = u64x2::new(1, 2);
+ #[rustfmt::skip]
+ let r = u64x2::new(6, 3);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_div_u_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_dotp_s_h() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ -1, -2, -3, 4,
+ -1, -2, -3, -4,
+ -1, -2, -3, 4,
+ -1, -2, -3, -4
+ );
+ #[rustfmt::skip]
+ let b = i8x16::new(
+ -6, -7, -8, -9,
+ -6, -7, -8, -9,
+ -6, -7, -8, -9,
+ -6, -7, -8, -9
+ );
+ #[rustfmt::skip]
+ let r = i16x8::new(20, -12, 20, 60, 20, -12, 20, 60);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_dotp_s_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_dotp_s_w() {
+ #[rustfmt::skip]
+ let a = i16x8::new(-1, -2, -3, -4, -1, -2, -3, 4);
+ #[rustfmt::skip]
+ let b = i16x8::new(-6, -7, -8, -9, -6, -7, -8, -9);
+ #[rustfmt::skip]
+ let r = i32x4::new(20, 60, 20, -12);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_dotp_s_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_dotp_s_d() {
+ #[rustfmt::skip]
+ let a = i32x4::new(-1, -2, -3, 4);
+ #[rustfmt::skip]
+ let b = i32x4::new(-6, -7, -8, -9);
+ #[rustfmt::skip]
+ let r = i64x2::new(20, -12);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_dotp_s_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_dotp_u_h() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let b = u8x16::new(
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9
+ );
+ #[rustfmt::skip]
+ let r = u16x8::new(20, 60, 20, 60, 20, 60, 20, 60);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_dotp_u_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_dotp_u_w() {
+ #[rustfmt::skip]
+ let a = u16x8::new(1, 2, 3, 4, 1, 2, 3, 4);
+ #[rustfmt::skip]
+ let b = u16x8::new(6, 7, 8, 9, 6, 7, 8, 9);
+ #[rustfmt::skip]
+ let r = u32x4::new(20, 60, 20, 60);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_dotp_u_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_dotp_u_d() {
+ #[rustfmt::skip]
+ let a = u32x4::new(1, 2, 3, 4);
+ #[rustfmt::skip]
+ let b = u32x4::new(6, 7, 8, 9);
+ #[rustfmt::skip]
+ let r = u64x2::new(20, 60);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_dotp_u_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_dpadd_s_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(-1, -2, -3, -4, -1, -2, -3, 4);
+ #[rustfmt::skip]
+ let b = i8x16::new(
+ -1, -2, -3, 4,
+ -1, -2, -3, -4,
+ -1, -2, -3, 4,
+ -1, -2, -3, -4
+ );
+ #[rustfmt::skip]
+ let c = i8x16::new(
+ -6, -7, -8, -9,
+ -6, -7, -8, -9,
+ -6, -7, -8, -9,
+ -6, -7, -8, -9
+ );
+ #[rustfmt::skip]
+ let r = i16x8::new(19, -14, 17, 56, 19, -14, 17, 64);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_dpadd_s_h(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_dpadd_s_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(-1, -2, -3, -4);
+ #[rustfmt::skip]
+ let b = i16x8::new(
+ -1, -2, -3, 4,
+ -1, -2, -3, -4
+ );
+ #[rustfmt::skip]
+ let c = i16x8::new(
+ -6, -7, -8, -9,
+ -6, -7, -8, -9
+ );
+ #[rustfmt::skip]
+ let r = i32x4::new(19, -14, 17, 56);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_dpadd_s_w(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_dpadd_s_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(-1, -2);
+ #[rustfmt::skip]
+ let b = i32x4::new(-1, -2, -3, 4);
+ #[rustfmt::skip]
+ let c = i32x4::new(-6, -7, -8, -9);
+ #[rustfmt::skip]
+ let r = i64x2::new(19, -14);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_dpadd_s_d(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_dpadd_u_h() {
+ #[rustfmt::skip]
+ let a = u16x8::new(1, 2, 3, 4, 1, 2, 3, 4);
+ #[rustfmt::skip]
+ let b = u8x16::new(
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let c = u8x16::new(
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9
+ );
+ #[rustfmt::skip]
+ let r = u16x8::new(21, 62, 23, 64, 21, 62, 23, 64);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_dpadd_u_h(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_dpadd_u_w() {
+ #[rustfmt::skip]
+ let a = u32x4::new(1, 2, 3, 4);
+ #[rustfmt::skip]
+ let b = u16x8::new(
+ 1, 2, 3, 4,
+ 1, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let c = u16x8::new(
+ 6, 7, 8, 9,
+ 6, 7, 8, 9
+ );
+ #[rustfmt::skip]
+ let r = u32x4::new(21, 62, 23, 64);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_dpadd_u_w(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_dpadd_u_d() {
+ #[rustfmt::skip]
+ let a = u64x2::new(1, 2);
+ #[rustfmt::skip]
+ let b = u32x4::new(1, 2, 3, 4);
+ #[rustfmt::skip]
+ let c = u32x4::new(6, 7, 8, 9);
+ #[rustfmt::skip]
+ let r = u64x2::new(21, 62);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_dpadd_u_d(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_dpsub_s_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(-1, -2, -3, -4, -1, -2, -3, 4);
+ #[rustfmt::skip]
+ let b = i8x16::new(
+ -1, -2, -3, 4,
+ -1, -2, -3, -4,
+ -1, -2, -3, 4,
+ -1, -2, -3, -4
+ );
+ #[rustfmt::skip]
+ let c = i8x16::new(
+ -6, -7, -8, -9,
+ -6, -7, -8, -9,
+ -6, -7, -8, -9,
+ -6, -7, -8, -9
+ );
+ #[rustfmt::skip]
+ let r = i16x8::new(-21, 10, -23, -64, -21, 10, -23, -56);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_dpsub_s_h(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_dpsub_s_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(-1, -2, -3, -4);
+ #[rustfmt::skip]
+ let b = i16x8::new(
+ -1, -2, -3, 4,
+ -1, -2, -3, -4
+ );
+ #[rustfmt::skip]
+ let c = i16x8::new(
+ -6, -7, -8, -9,
+ -6, -7, -8, -9
+ );
+ #[rustfmt::skip]
+ let r = i32x4::new(-21, 10, -23, -64);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_dpsub_s_w(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_dpsub_s_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(-1, -2);
+ #[rustfmt::skip]
+ let b = i32x4::new(-1, -2, -3, 4);
+ #[rustfmt::skip]
+ let c = i32x4::new(-6, -7, -8, -9);
+ #[rustfmt::skip]
+ let r = i64x2::new(-21, 10);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_dpsub_s_d(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_dpsub_u_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(1, -2, 3, -4, -1, 2,-3, 4);
+ #[rustfmt::skip]
+ let b = u8x16::new(
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let c = u8x16::new(
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9
+ );
+ #[rustfmt::skip]
+ let r = i16x8::new(-19, -62, -17, -64, -21, -58, -23, -56);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_dpsub_u_h(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_dpsub_u_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(1, -2, 3, -4);
+ #[rustfmt::skip]
+ let b = u16x8::new(
+ 1, 2, 3, 4,
+ 1, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let c = u16x8::new(
+ 6, 7, 8, 9,
+ 6, 7, 8, 9
+ );
+ #[rustfmt::skip]
+ let r = i32x4::new(-19, -62, -17, -64);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_dpsub_u_w(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_dpsub_u_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(1, -2);
+ #[rustfmt::skip]
+ let b = u32x4::new(1, 2, 3, 4);
+ #[rustfmt::skip]
+ let c = u32x4::new(6, 7, 8, 9);
+ #[rustfmt::skip]
+ let r = i64x2::new(-19, -62);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_dpsub_u_d(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fadd_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(1.1, -2.2, 3.3, -4.4);
+ #[rustfmt::skip]
+ let b = f32x4::new(4.4, -3.3, 2.2, -1.1);
+ #[rustfmt::skip]
+ let r = f32x4::new(5.5, -5.5, 5.5, -5.5);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fadd_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fadd_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(1.1, -2.2);
+ #[rustfmt::skip]
+ let b = f64x2::new(4.4, -3.3);
+ #[rustfmt::skip]
+ let r = f64x2::new(5.5, -5.5);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fadd_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ // Only observed beahiour should be SIGFPE signal
+ // Can not be tested
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fcaf_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(1.1, -2.2, 3.3, -4.4);
+ #[rustfmt::skip]
+ let b = f32x4::new(0.0, -1.2, 3.3, f32::NAN);
+ #[rustfmt::skip]
+ let r = i32x4::new(0, 0, 0, 0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fcaf_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ // Only observed beahiour should be SIGFPE signal
+ // Can not be tested
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fcaf_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(1.1, -2.2);
+ #[rustfmt::skip]
+ let b = f64x2::new(-2.2, 1.1);
+ #[rustfmt::skip]
+ let r = i64x2::new(0, 0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fcaf_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fceq_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(1.1, -2.2, 3.3, f32::NAN);
+ #[rustfmt::skip]
+ let b = f32x4::new(-4.4, -2.2, 3.3, f32::NAN);
+ #[rustfmt::skip]
+ let r = i32x4::new(0, -1, -1, 0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fceq_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fceq_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(1.1, -2.2);
+ #[rustfmt::skip]
+ let b = f64x2::new(1.1, 1.1);
+ #[rustfmt::skip]
+ let r = i64x2::new(-1, 0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fceq_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fclass_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(1.1, -2.2, 3.3, f32::NAN);
+ #[rustfmt::skip]
+ let r = i32x4::new(128, 8, 128, 2);
+
+ assert_eq!(r, mem::transmute(__msa_fclass_w(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fclass_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(1.1, -2.2);
+ #[rustfmt::skip]
+ let r = i64x2::new(128, 8);
+
+ assert_eq!(r, mem::transmute(__msa_fclass_d(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fcle_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(1.1, -2.2, 3.3, f32::NAN);
+ #[rustfmt::skip]
+ let b = f32x4::new(-4.4, -1.2, 3.3, f32::NAN);
+ #[rustfmt::skip]
+ let r = i32x4::new(0, -1, -1, 0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fcle_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fcle_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(1.1, -2.2);
+ #[rustfmt::skip]
+ let b = f64x2::new(1.1, 1.1);
+ #[rustfmt::skip]
+ let r = i64x2::new(-1, -1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fcle_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fclt_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(1.1, -2.2, 3.3, f32::NAN);
+ #[rustfmt::skip]
+ let b = f32x4::new(-4.4, -1.2, 3.3, f32::NAN);
+ #[rustfmt::skip]
+ let r = i32x4::new(0, -1, 0, 0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fclt_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fclt_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(1.1, -2.2);
+ #[rustfmt::skip]
+ let b = f64x2::new(1.1, 1.1);
+ #[rustfmt::skip]
+ let r = i64x2::new(0, -1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fclt_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fcne_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(1.1, -2.2, 3.3, f32::NAN);
+ #[rustfmt::skip]
+ let b = f32x4::new(-4.4, -1.2, 3.3, f32::NAN);
+ #[rustfmt::skip]
+ let r = i32x4::new(-1, -1, 0, 0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fcne_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fcne_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(1.1, -2.2);
+ #[rustfmt::skip]
+ let b = f64x2::new(1.1, 1.1);
+ #[rustfmt::skip]
+ let r = i64x2::new(0, -1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fcne_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fcor_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(1.1, -2.2, 3.3, f32::NAN);
+ #[rustfmt::skip]
+ let b = f32x4::new(f32::NAN, -1.2, 3.3, f32::NAN);
+ #[rustfmt::skip]
+ let r = i32x4::new(0, -1, -1, 0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fcor_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fcor_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(1.1, f64::NAN);
+ #[rustfmt::skip]
+ let b = f64x2::new(1.1, 1.1);
+ #[rustfmt::skip]
+ let r = i64x2::new(-1, 0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fcor_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fcueq_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(1.1, -2.2, 3.3, f32::NAN);
+ #[rustfmt::skip]
+ let b = f32x4::new(f32::NAN, -1.2, 3.3, f32::NAN);
+ #[rustfmt::skip]
+ let r = i32x4::new(-1, 0, -1, -1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fcueq_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fcueq_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(1.1, f64::NAN);
+ #[rustfmt::skip]
+ let b = f64x2::new(1.1, 1.1);
+ #[rustfmt::skip]
+ let r = i64x2::new(-1, -1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fcueq_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fcule_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(1.1, -2.2, 3.3, f32::NAN);
+ #[rustfmt::skip]
+ let b = f32x4::new(f32::NAN, -1.2, 3.3, f32::NAN);
+ #[rustfmt::skip]
+ let r = i32x4::new(-1, -1, -1, -1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fcule_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fcule_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(1.1, f64::NAN);
+ #[rustfmt::skip]
+ let b = f64x2::new(1.1, 1.1);
+ #[rustfmt::skip]
+ let r = i64x2::new(-1, -1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fcule_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fcult_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(1.1, -2.2, 3.3, f32::NAN);
+ #[rustfmt::skip]
+ let b = f32x4::new(f32::NAN, -1.2, 3.3, f32::NAN);
+ #[rustfmt::skip]
+ let r = i32x4::new(-1, -1, 0, -1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fcult_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fcult_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(1.1, f64::NAN);
+ #[rustfmt::skip]
+ let b = f64x2::new(1.1, 1.1);
+ #[rustfmt::skip]
+ let r = i64x2::new(0, -1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fcult_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fcun_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(1.1, -2.2, 3.3, f32::NAN);
+ #[rustfmt::skip]
+ let b = f32x4::new(f32::NAN, -1.2, 3.3, f32::NAN);
+ #[rustfmt::skip]
+ let r = i32x4::new(-1, 0, 0, -1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fcun_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fcun_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(1.1, f64::NAN);
+ #[rustfmt::skip]
+ let b = f64x2::new(1.1, 1.1);
+ #[rustfmt::skip]
+ let r = i64x2::new(0, -1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fcun_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fcune_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(1.1, -2.2, 3.3, f32::NAN);
+ #[rustfmt::skip]
+ let b = f32x4::new(f32::NAN, -1.2, 3.3, f32::NAN);
+ #[rustfmt::skip]
+ let r = i32x4::new(-1, -1, 0, -1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fcune_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fcune_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(1.1, f64::NAN);
+ #[rustfmt::skip]
+ let b = f64x2::new(1.1, 1.1);
+ #[rustfmt::skip]
+ let r = i64x2::new(0, -1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fcune_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fdiv_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(5.25, -20.2, 333.333, -425.0);
+ #[rustfmt::skip]
+ let b = f32x4::new(4.0, -2.1, 11.11, 8.2);
+ #[rustfmt::skip]
+ let r = f32x4::new(1.3125, 9.619048, 30.002972, -51.82927);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fdiv_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fdiv_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(1111.11, -222222.2);
+ #[rustfmt::skip]
+ let b = f64x2::new(-4.85, 3.33);
+ #[rustfmt::skip]
+ let r = f64x2::new(-229.09484536082473, -66733.3933933934);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fdiv_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ /*// FIXME: 16-bit floats
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fexdo_h() {
+ #[rustfmt::skip]
+ let a = f32x4::new(20.5, 2.3, 4.5, 5.4);
+ #[rustfmt::skip]
+ let b = f32x4::new(1.1, 1.0, 1.0, 1.0);
+ let r = i16x8::new(1, 9, 30, 51, 1, 9, 30, 51);
+
+ assert_eq!(r, mem::transmute(__msa_fexdo_h(mem::transmute(a), mem::transmute(b))));
+ }*/
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fexdo_w() {
+ #[rustfmt::skip]
+ let a = f64x2::new(2000005.5, 2.3);
+ #[rustfmt::skip]
+ let b = f64x2::new(1235689784512.1, 2147483649998.5);
+ #[rustfmt::skip]
+ let r = f32x4::new(
+ 1235689800000.0, 2147483600000.0,
+ 2000005.5, 2.3
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fexdo_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fexp2_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(1.1, -2.2, 3.3, -4.4);
+ #[rustfmt::skip]
+ let b = i32x4::new(4, -3, 2, 1);
+ #[rustfmt::skip]
+ let r = f32x4::new(17.6, -0.275, 13.2, -8.8);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fexp2_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fexp2_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(1.1, -2.2);
+ #[rustfmt::skip]
+ let b = i64x2::new(-4, 3);
+ #[rustfmt::skip]
+ let r = f64x2::new(0.06875, -17.6);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fexp2_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ // FIXME: 16-bit floats
+ // #[simd_test(enable = "msa")]
+ // unsafe fn test_msa_fexupl_w() {
+ // #[rustfmt::skip]
+ // let a = f16x8(1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5);
+ // #[rustfmt::skip]
+ // let r = f32x4::new(5.5, 6.5, 7.5, 8.5);
+
+ // assert_eq!(r, mem::transmute(__msa_fexupl_w(mem::transmute(a))));
+ // }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fexupl_d() {
+ #[rustfmt::skip]
+ let a = f32x4::new(5.5, 6.5, 7.5, 8.5);
+ #[rustfmt::skip]
+ let r = f64x2::new(7.5, 8.5);
+
+ assert_eq!(r, mem::transmute(__msa_fexupl_d(mem::transmute(a))));
+ }
+
+ // FIXME: 16-bit floats
+ // #[simd_test(enable = "msa")]
+ // unsafe fn test_msa_fexupr_w() {
+ // #[rustfmt::skip]
+ // let a = f16x8(1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5);
+ // #[rustfmt::skip]
+ // let r = f32x4::new(1.5, 2.5, 3.5, 4.5);
+
+ // assert_eq!(r, mem::transmute(__msa_fexupr_w(mem::transmute(a))));
+ // }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fexupr_d() {
+ #[rustfmt::skip]
+ let a = f32x4::new(5.5, 6.5, 7.5, 8.5);
+ #[rustfmt::skip]
+ let r = f64x2::new(5.5, 6.5);
+
+ assert_eq!(r, mem::transmute(__msa_fexupr_d(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ffint_s_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(-1, 2, -3, 4);
+ #[rustfmt::skip]
+ let r = f32x4::new(-1.0, 2.0, -3.0, 4.0);
+
+ assert_eq!(r, mem::transmute(__msa_ffint_s_w(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ffint_s_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(-1, 2);
+ #[rustfmt::skip]
+ let r = f64x2::new(-1.0, 2.0);
+
+ assert_eq!(r, mem::transmute(__msa_ffint_s_d(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ffint_u_w() {
+ #[rustfmt::skip]
+ let a = u32x4::new(1, 2, 3, 4);
+ #[rustfmt::skip]
+ let r = f32x4::new(1.0, 2.0, 3.0, 4.0);
+
+ assert_eq!(r, mem::transmute(__msa_ffint_u_w(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ffint_u_d() {
+ #[rustfmt::skip]
+ let a = u64x2::new(1, 2);
+ #[rustfmt::skip]
+ let r = f64x2::new(1.0, 2.0);
+
+ assert_eq!(r, mem::transmute(__msa_ffint_u_d(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ffql_w() {
+ #[rustfmt::skip]
+ let a = i16x8::new(11, 25, 33, 47, 11, 25, 33, 47);
+ #[rustfmt::skip]
+ let r = f32x4::new(
+ 0.00033569336, 0.00076293945,
+ 0.0010070801, 0.0014343262
+ );
+
+ assert_eq!(r, mem::transmute(__msa_ffql_w(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ffql_d() {
+ #[rustfmt::skip]
+ let a = i32x4::new(1111, 2222, 3333, 4444);
+ #[rustfmt::skip]
+ let r = f64x2::new(
+ 0.000001552049070596695,
+ 0.0000020693987607955933
+ );
+
+ assert_eq!(r, mem::transmute(__msa_ffql_d(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ffqr_w() {
+ #[rustfmt::skip]
+ let a = i16x8::new(12, 26, 34, 48, 11, 25, 33, 47);
+ #[rustfmt::skip]
+ let r = f32x4::new(
+ 0.00036621094, 0.00079345703,
+ 0.0010375977, 0.0014648438
+ );
+
+ assert_eq!(r, mem::transmute(__msa_ffqr_w(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ffqr_d() {
+ #[rustfmt::skip]
+ let a = i32x4::new(1111, 2555, 3333, 475);
+ #[rustfmt::skip]
+ let r = f64x2::new(
+ 0.0000005173496901988983,
+ 0.0000011897645890712738
+ );
+
+ assert_eq!(r, mem::transmute(__msa_ffqr_d(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fill_b() {
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 2, 2, 2, 2,
+ 2, 2, 2, 2,
+ 2, 2, 2, 2,
+ 2, 2, 2, 2
+ );
+
+ assert_eq!(r, mem::transmute(__msa_fill_b(2)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fill_h() {
+ #[rustfmt::skip]
+ let r = i16x8::new(2, 2, 2, 2, 2, 2, 2, 2);
+
+ assert_eq!(r, mem::transmute(__msa_fill_h(2)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fill_w() {
+ #[rustfmt::skip]
+ let r = i32x4::new(2, 2, 2, 2);
+
+ assert_eq!(r, mem::transmute(__msa_fill_w(2)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fill_d() {
+ #[rustfmt::skip]
+ let r = i64x2::new(2, 2);
+
+ assert_eq!(r, mem::transmute(__msa_fill_d(2)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_flog2_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(8.0, 16.0, 32.0, 64.0);
+ #[rustfmt::skip]
+ let r = f32x4::new(3.0, 4.0, 5.0, 6.0);
+
+ assert_eq!(r, mem::transmute(__msa_flog2_w(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_flog2_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(8.0, 16.0);
+ #[rustfmt::skip]
+ let r = f64x2::new(3.0, 4.0);
+
+ assert_eq!(r, mem::transmute(__msa_flog2_d(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fmadd_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(1.0, 2.0, 3.0, 4.0);
+ #[rustfmt::skip]
+ let b = f32x4::new(5.0, 6.0, 7.0, 8.0);
+ #[rustfmt::skip]
+ let c = f32x4::new(9.0, 10.0, 11.0, 12.0);
+ #[rustfmt::skip]
+ let r = f32x4::new(46.0, 62.0, 80.0, 100.0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fmadd_w(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fmadd_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(1.0, 2.0);
+ #[rustfmt::skip]
+ let b = f64x2::new(3.0, 4.0);
+ #[rustfmt::skip]
+ let c = f64x2::new(5.0, 6.0);
+ #[rustfmt::skip]
+ let r = f64x2::new(16.0, 26.0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fmadd_d(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fmax_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(1.0, -6.0, 7.0, 8.0);
+ #[rustfmt::skip]
+ let b = f32x4::new(5.0, -2.0, 3.0, 4.0);
+ #[rustfmt::skip]
+ let r = f32x4::new(5.0, -2.0, 7.0, 8.0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fmax_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fmax_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(1.0, 4.0);
+ #[rustfmt::skip]
+ let b = f64x2::new(3.0, 2.0);
+ #[rustfmt::skip]
+ let r = f64x2::new(3.0, 4.0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fmax_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fmax_a_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(1.0, -6.0, -7.0, -8.0);
+ #[rustfmt::skip]
+ let b = f32x4::new(5.0, -2.0, 3.0, 4.0);
+ #[rustfmt::skip]
+ let r = f32x4::new(5.0, -6.0, -7.0, -8.0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fmax_a_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fmax_a_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(1.0, -4.0);
+ #[rustfmt::skip]
+ let b = f64x2::new(3.0, 2.0);
+ #[rustfmt::skip]
+ let r = f64x2::new(3.0, -4.0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fmax_a_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fmin_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(1.0, -6.0, 7.0, 8.0);
+ #[rustfmt::skip]
+ let b = f32x4::new(5.0, -2.0, 3.0, 4.0);
+ #[rustfmt::skip]
+ let r = f32x4::new(1.0, -6.0, 3.0, 4.0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fmin_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fmin_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(1.0, 4.0);
+ #[rustfmt::skip]
+ let b = f64x2::new(3.0, 2.0);
+ #[rustfmt::skip]
+ let r = f64x2::new(1.0, 2.0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fmin_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fmin_a_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(1.0, -6.0, -7.0, -8.0);
+ #[rustfmt::skip]
+ let b = f32x4::new(5.0, -2.0, 3.0, 4.0);
+ #[rustfmt::skip]
+ let r = f32x4::new(1.0, -2.0, 3.0, 4.0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fmin_a_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fmin_a_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(1.0, -4.0);
+ #[rustfmt::skip]
+ let b = f64x2::new(3.0, 2.0);
+ #[rustfmt::skip]
+ let r = f64x2::new(1.0, 2.0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fmin_a_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fmsub_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(1.0, 2.0, 3.0, 4.0);
+ #[rustfmt::skip]
+ let b = f32x4::new(5.0, 6.0, 7.0, 8.0);
+ #[rustfmt::skip]
+ let c = f32x4::new(9.0, 10.0, 11.0, 12.0);
+ #[rustfmt::skip]
+ let r = f32x4::new(-44.0, -58.0, -74.0, -92.0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fmsub_w(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fmsub_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(1.0, 2.0);
+ #[rustfmt::skip]
+ let b = f64x2::new(3.0, 4.0);
+ #[rustfmt::skip]
+ let c = f64x2::new(5.0, 6.0);
+ #[rustfmt::skip]
+ let r = f64x2::new(-14.0, -22.0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fmsub_d(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fmul_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(1.1, -2.2, 3.3, 4.4);
+ #[rustfmt::skip]
+ let b = f32x4::new(4.4, 3.3, 2.2, -1.1);
+ #[rustfmt::skip]
+ let r = f32x4::new(4.84, -7.26, 7.26, -4.84);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fmul_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fmul_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(1.1, -2.2);
+ #[rustfmt::skip]
+ let b = f64x2::new(4.0, -3.3);
+ #[rustfmt::skip]
+ let r = f64x2::new(4.4, 7.26);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fmul_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_frint_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(2.6, -2.7, 1.3, -1.7);
+ #[rustfmt::skip]
+ let r = f32x4::new(3.0, -3.0, 1.0, -2.0);
+
+ assert_eq!(r, mem::transmute(__msa_frint_w(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_frint_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(2.6, 1.3);
+ #[rustfmt::skip]
+ let r = f64x2::new(3.0, 1.0);
+
+ assert_eq!(r, mem::transmute(__msa_frint_d(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_frcp_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(2.6, -2.7, 1.3, -1.7);
+ #[rustfmt::skip]
+ let r = f32x4::new(
+ 0.3846154, -0.37037036,
+ 0.7692308, -0.58823526
+ );
+
+ assert_eq!(r, mem::transmute(__msa_frcp_w(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_frcp_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(2.6, 1.3);
+ #[rustfmt::skip]
+ let r = f64x2::new(0.3846153846153846, 0.7692307692307692);
+
+ assert_eq!(r, mem::transmute(__msa_frcp_d(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_frsqrt_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(2.6, 2.7, 1.3, 1.7);
+ #[rustfmt::skip]
+ let r = f32x4::new(
+ 0.6201737, 0.6085806,
+ 0.87705797, 0.766965
+ );
+
+ assert_eq!(r, mem::transmute(__msa_frsqrt_w(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_frsqrt_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(2.6, 1.3);
+ #[rustfmt::skip]
+ let r = f64x2::new(0.6201736729460422, 0.8770580193070292);
+
+ assert_eq!(r, mem::transmute(__msa_frsqrt_d(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fsaf_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(-5.5, 5.5, 5.5, 5.5);
+ #[rustfmt::skip]
+ let b = f32x4::new(-5.5, 5.5, 5.5, 5.5);
+ #[rustfmt::skip]
+ let r = i32x4::new(0, 0, 0, 0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fsaf_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fsaf_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(-125.5, 5.5);
+ #[rustfmt::skip]
+ let b = f64x2::new(125.5, 3.3);
+ #[rustfmt::skip]
+ let r = i64x2::new(0, 0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fsaf_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fseq_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(-5.5, -3.3, f32::NAN, f32::NAN);
+ #[rustfmt::skip]
+ let b = f32x4::new(5.5, -3.3, f32::NAN, 1.1);
+ #[rustfmt::skip]
+ let r = i32x4::new(0, -1, 0, 0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fseq_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fseq_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(-125.5, 5.5);
+ #[rustfmt::skip]
+ let b = f64x2::new(125.5, 5.5);
+ #[rustfmt::skip]
+ let r = i64x2::new(0, -1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fseq_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fsle_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(5.5, 5.5, 5.5, f32::NAN);
+ #[rustfmt::skip]
+ let b = f32x4::new(-5.5, 3.3, 5.5, f32::NAN);
+ #[rustfmt::skip]
+ let r = i32x4::new(0, 0, -1, 0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fsle_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fsle_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(-125.5, 5.5);
+ #[rustfmt::skip]
+ let b = f64x2::new(125.5, 3.3);
+ #[rustfmt::skip]
+ let r = i64x2::new(-1, 0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fsle_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fslt_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(-5.5, 5.5, 5.5, 5.5);
+ #[rustfmt::skip]
+ let b = f32x4::new(5.5, 3.3, 5.5, 1.1);
+ #[rustfmt::skip]
+ let r = i32x4::new(-1, 0, 0, 0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fslt_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fslt_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(-125.5, 5.5);
+ #[rustfmt::skip]
+ let b = f64x2::new(125.5, 3.3);
+ #[rustfmt::skip]
+ let r = i64x2::new(-1, 0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fslt_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fsne_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(-5.5, 5.5, 5.5, 5.5);
+ #[rustfmt::skip]
+ let b = f32x4::new(5.5, 3.3, 5.5, 1.1);
+ #[rustfmt::skip]
+ let r = i32x4::new(-1, -1, 0, -1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fsne_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fsne_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(-125.5, 5.5);
+ #[rustfmt::skip]
+ let b = f64x2::new(125.5, 5.5);
+ #[rustfmt::skip]
+ let r = i64x2::new(-1, 0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fsne_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fsor_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(-5.5, f32::NAN, 5.5, 5.5);
+ #[rustfmt::skip]
+ let b = f32x4::new(5.5, 3.3, 5.5, 1.1);
+ #[rustfmt::skip]
+ let r = i32x4::new(-1, 0, -1, -1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fsor_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fsor_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(-125.5, 5.5);
+ #[rustfmt::skip]
+ let b = f64x2::new(125.5, f64::NAN);
+ #[rustfmt::skip]
+ let r = i64x2::new(-1, 0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fsor_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fsqrt_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(9.0, 81.0, 1089.0, 10000.0);
+ #[rustfmt::skip]
+ let r = f32x4::new(3.0, 9.0, 33.0, 100.0);
+
+ assert_eq!(r, mem::transmute(__msa_fsqrt_w(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fsqrt_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(81.0, 10000.0);
+ #[rustfmt::skip]
+ let r = f64x2::new(9.0, 100.0);
+
+ assert_eq!(r, mem::transmute(__msa_fsqrt_d(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fsub_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(5.5, 6.5, 7.5, 8.5);
+ #[rustfmt::skip]
+ let b = f32x4::new(1.25, 1.75, 2.25, 2.75);
+ #[rustfmt::skip]
+ let r = f32x4::new(4.25, 4.75, 5.25, 5.75);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fsub_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fsub_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(555.5, 55.5);
+ #[rustfmt::skip]
+ let b = f64x2::new(4.25, 3.25);
+ #[rustfmt::skip]
+ let r = f64x2::new(551.25, 52.25);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fsub_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fsueq_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(5.5, f32::NAN, 5.5, 5.5);
+ #[rustfmt::skip]
+ let b = f32x4::new(5.5, 5.5, -5.5, 5.5);
+ #[rustfmt::skip]
+ let r = i32x4::new(-1, -1, 0, -1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fsueq_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fsueq_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(-5.5, 5.5);
+ #[rustfmt::skip]
+ let b = f64x2::new(5.5, f64::NAN);
+ #[rustfmt::skip]
+ let r = i64x2::new(0, -1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fsueq_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fsule_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(5.7, 5.8, 5.9, f32::NAN);
+ #[rustfmt::skip]
+ let b = f32x4::new(5.6, 5.9, 5.9, f32::NAN);
+ #[rustfmt::skip]
+ let r = i32x4::new(0, -1, -1, -1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fsule_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fsule_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(5.5, 5.5);
+ #[rustfmt::skip]
+ let b = f64x2::new(5.5, 5.5);
+ #[rustfmt::skip]
+ let r = i64x2::new(-1, -1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fsule_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fsult_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(5.5, 5.5, 5.5, 5.5);
+ #[rustfmt::skip]
+ let b = f32x4::new(5.6, f32::NAN, 2.2, 1.1);
+ #[rustfmt::skip]
+ let r = i32x4::new(-1, -1, 0, 0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fsult_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fsult_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(5.5, f64::NAN);
+ #[rustfmt::skip]
+ let b = f64x2::new(4.4, 3.3);
+ #[rustfmt::skip]
+ let r = i64x2::new(0, -1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fsult_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fsun_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(5.5, 5.5, f32::NAN, 5.5);
+ #[rustfmt::skip]
+ let b = f32x4::new(4.4, 3.3, 2.2, f32::NAN);
+ #[rustfmt::skip]
+ let r = i32x4::new(0, 0, -1, -1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fsun_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fsun_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(5.5, f64::NAN);
+ #[rustfmt::skip]
+ let b = f64x2::new(4.4, 3.3);
+ #[rustfmt::skip]
+ let r = i64x2::new(0, -1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fsun_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fsune_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(5.5, 5.5, f32::NAN, 5.5);
+ #[rustfmt::skip]
+ let b = f32x4::new(4.4, 3.3, 2.2, 5.5);
+ #[rustfmt::skip]
+ let r = i32x4::new(-1, -1, -1, 0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fsune_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_fsune_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(5.5, f64::NAN);
+ #[rustfmt::skip]
+ let b = f64x2::new(5.5, 3.3);
+ #[rustfmt::skip]
+ let r = i64x2::new(0, -1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_fsune_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ftint_s_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(-5.5, 75.6, -1000.7, 1219.3);
+ #[rustfmt::skip]
+ let r = i32x4::new(-6, 76, -1001, 1219);
+
+ assert_eq!(r, mem::transmute(__msa_ftint_s_w(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ftint_s_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(-5.5, 25656.4);
+ #[rustfmt::skip]
+ let r = i64x2::new(-6, 25656);
+
+ assert_eq!(r, mem::transmute(__msa_ftint_s_d(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ftint_u_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(-5.5, 75.6, -1000.7, 1219.3);
+ #[rustfmt::skip]
+ let r = u32x4::new(0, 76, 0, 1219);
+
+ assert_eq!(r, mem::transmute(__msa_ftint_u_w(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ftint_u_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(5.5, -25656.4);
+ #[rustfmt::skip]
+ let r = u64x2::new(6, 0);
+
+ assert_eq!(r, mem::transmute(__msa_ftint_u_d(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ftq_h() {
+ #[rustfmt::skip]
+ let a = f32x4::new(0.00001, 0.0002, 0.00001, -0.0002);
+ #[rustfmt::skip]
+ let b = f32x4::new(0.0001, -0.002, 0.0001, 0.002);
+ #[rustfmt::skip]
+ let r = i16x8::new(3, -66, 3, 66, 0, 7, 0, -7);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_ftq_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ftq_w() {
+ #[rustfmt::skip]
+ let a = f64x2::new(0.00001, -0.0002);
+ #[rustfmt::skip]
+ let b = f64x2::new(0.00000045, 0.000015);
+ #[rustfmt::skip]
+ let r = i32x4::new(966, 32212, 21475, -429497);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_ftq_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ftrunc_s_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(-5.5, 75.6, -1000.7, 1219.3);
+ #[rustfmt::skip]
+ let r = i32x4::new(-5, 75, -1000, 1219);
+
+ assert_eq!(r, mem::transmute(__msa_ftrunc_s_w(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ftrunc_s_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(-5.5, 25656.4);
+ #[rustfmt::skip]
+ let r = i64x2::new(-5, 25656);
+
+ assert_eq!(r, mem::transmute(__msa_ftrunc_s_d(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ftrunc_u_w() {
+ #[rustfmt::skip]
+ let a = f32x4::new(-5.5, 75.6, -1000.7, 1219.3);
+ #[rustfmt::skip]
+ let r = u32x4::new(0, 75, 0, 1219);
+
+ assert_eq!(r, mem::transmute(__msa_ftrunc_u_w(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ftrunc_u_d() {
+ #[rustfmt::skip]
+ let a = f64x2::new(5.5, -25656.4);
+ #[rustfmt::skip]
+ let r = u64x2::new(5, 0);
+
+ assert_eq!(r, mem::transmute(__msa_ftrunc_u_d(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_hadd_s_h() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ 1, 2, 3, 4,
+ -1, -2, -3, -4,
+ 1, 2, 3, 4,
+ -1, -2, -3, -4
+ );
+ #[rustfmt::skip]
+ let b = i8x16::new(
+ 4, 3, 2, 1,
+ 4, 3, 2, 1,
+ 4, 3, 2, 1,
+ 4, 3, 2, 1
+ );
+ #[rustfmt::skip]
+ let r = i16x8::new(6, 6, 2, -2, 6, 6, 2, -2);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_hadd_s_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_hadd_s_w() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ 1, 2, 3, 4,
+ -1, -2, -3, -4
+ );
+ #[rustfmt::skip]
+ let b = i16x8::new(
+ 4, 3, 2, 1,
+ 4, 3, 2, 1
+ );
+ #[rustfmt::skip]
+ let r = i32x4::new(6, 6, 2, -2);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_hadd_s_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_hadd_s_d() {
+ #[rustfmt::skip]
+ let a = i32x4::new(1, -2, 3, -4);
+ #[rustfmt::skip]
+ let b = i32x4::new(4, 3, 2, 1);
+ #[rustfmt::skip]
+ let r = i64x2::new(2, -2);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_hadd_s_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_hadd_u_h() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let b = u8x16::new(
+ 4, 3, 2, 1,
+ 4, 3, 2, 1,
+ 4, 3, 2, 1,
+ 4, 3, 2, 1
+ );
+ #[rustfmt::skip]
+ let r = u16x8::new(6, 6, 6, 6, 6, 6, 6, 6);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_hadd_u_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_hadd_u_w() {
+ #[rustfmt::skip]
+ let a = u16x8::new(
+ 1, 2, 3, 4,
+ 1, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let b = u16x8::new(
+ 4, 3, 2, 1,
+ 4, 3, 2, 1
+ );
+ #[rustfmt::skip]
+ let r = u32x4::new(6, 6, 6, 6);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_hadd_u_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_hadd_u_d() {
+ #[rustfmt::skip]
+ let a = u32x4::new(1, 2, 3, 4);
+ #[rustfmt::skip]
+ let b = u32x4::new(4, 3, 2, 1);
+ #[rustfmt::skip]
+ let r = u64x2::new(6, 6);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_hadd_u_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_hsub_s_h() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ 1, 2, 3, 4,
+ -1, -2, -3, -4,
+ 1, 2, 3, 4,
+ -1, -2, -3, -4
+ );
+ #[rustfmt::skip]
+ let b = i8x16::new(
+ 4, 3, 2, 1,
+ 4, 3, 2, 1,
+ 4, 3, 2, 1,
+ 4, 3, 2, 1
+ );
+ #[rustfmt::skip]
+ let r = i16x8::new(-2, 2, -6, -6, -2, 2, -6, -6);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_hsub_s_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_hsub_s_w() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ 1, 2, 3, 4,
+ -1, -2, -3, -4
+ );
+ #[rustfmt::skip]
+ let b = i16x8::new(
+ 4, 3, 2, 1,
+ 4, 3, 2, 1
+ );
+ #[rustfmt::skip]
+ let r = i32x4::new(-2, 2, -6, -6);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_hsub_s_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_hsub_s_d() {
+ #[rustfmt::skip]
+ let a = i32x4::new(1, -2, 3, -4);
+ #[rustfmt::skip]
+ let b = i32x4::new(4, 3, 2, 1);
+ #[rustfmt::skip]
+ let r = i64x2::new(-6, -6);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_hsub_s_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_hsub_u_h() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let b = u8x16::new(
+ 4, 3, 2, 1,
+ 4, 3, 2, 1,
+ 4, 3, 2, 1,
+ 4, 3, 2, 1
+ );
+ #[rustfmt::skip]
+ let r = i16x8::new(-2, 2, -2, 2, -2, 2, -2, 2);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_hsub_u_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_hsub_u_w() {
+ #[rustfmt::skip]
+ let a = u16x8::new(
+ 1, 2, 3, 4,
+ 1, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let b = u16x8::new(
+ 4, 3, 2, 1,
+ 4, 3, 2, 1
+ );
+ #[rustfmt::skip]
+ let r = i32x4::new(-2, 2, -2, 2);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_hsub_u_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_hsub_u_d() {
+ #[rustfmt::skip]
+ let a = u32x4::new(1, 2, 3, 4);
+ #[rustfmt::skip]
+ let b = u32x4::new(4, 3, 2, 1);
+ #[rustfmt::skip]
+ let r = i64x2::new(-2, 2);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_hsub_u_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ilvev_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let b = i8x16::new(
+ 4, 3, 2, 1,
+ 4, 3, 2, 1,
+ 4, 3, 2, 1,
+ 4, 3, 2, 1
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 4, 1, 2, 3,
+ 4, 1, 2, 3,
+ 4, 1, 2, 3,
+ 4, 1, 2, 3
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_ilvev_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ilvev_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ 1, 2, 3, 4,
+ 1, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let b = i16x8::new(
+ 4, 3, 2, 1,
+ 4, 3, 2, 1
+ );
+ #[rustfmt::skip]
+ let r = i16x8::new(4, 1, 2, 3, 4, 1, 2, 3);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_ilvev_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ilvev_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(1, 2, 3, 4);
+ #[rustfmt::skip]
+ let b = i32x4::new(4, 3, 2, 1);
+ #[rustfmt::skip]
+ let r = i32x4::new(4, 1, 2, 3);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_ilvev_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ilvev_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(1, 2);
+ #[rustfmt::skip]
+ let b = i64x2::new(4, 3);
+ #[rustfmt::skip]
+ let r = i64x2::new(4, 1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_ilvev_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ilvl_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ 1, 2, 3, 4,
+ 5, 6, 7, 8,
+ 9, 10, 11, 12,
+ 13, 14, 15, 16
+ );
+ #[rustfmt::skip]
+ let b = i8x16::new(
+ 16, 15, 14, 13,
+ 12, 11, 10, 9,
+ 8, 7, 6, 5,
+ 4, 3, 2, 1
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 8, 9, 7, 10,
+ 6, 11, 5, 12,
+ 4, 13, 3, 14,
+ 2, 15, 1, 16
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_ilvl_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ilvl_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ 1, 2, 3, 4,
+ 5, 6, 7, 8
+ );
+ #[rustfmt::skip]
+ let b = i16x8::new(
+ 8, 7, 6, 5,
+ 4, 3, 2, 1
+ );
+ #[rustfmt::skip]
+ let r = i16x8::new(4, 5, 3, 6, 2, 7, 1, 8);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_ilvl_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ilvl_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(1, 2, 3, 4);
+ #[rustfmt::skip]
+ let b = i32x4::new(4, 3, 2, 1);
+ #[rustfmt::skip]
+ let r = i32x4::new(2, 3, 1, 4);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_ilvl_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ilvl_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(1, 2);
+ #[rustfmt::skip]
+ let b = i64x2::new(2, 1);
+ #[rustfmt::skip]
+ let r = i64x2::new(1, 2);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_ilvl_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ilvod_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ 1, 2, 3, 4,
+ 5, 6, 7, 8,
+ 9, 10, 11, 12,
+ 13, 14, 15, 16
+ );
+ #[rustfmt::skip]
+ let b = i8x16::new(
+ 16, 15, 14, 13,
+ 12, 11, 10, 9,
+ 8, 7, 6, 5,
+ 4, 3, 2, 1
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 15, 2, 13, 4,
+ 11, 6, 9, 8,
+ 7, 10, 5, 12,
+ 3, 14, 1, 16
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_ilvod_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ilvod_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ 1, 2, 3, 4,
+ 5, 6, 7, 8
+ );
+ #[rustfmt::skip]
+ let b = i16x8::new(
+ 8, 7, 6, 5,
+ 4, 3, 2, 1
+ );
+ #[rustfmt::skip]
+ let r = i16x8::new(7, 2, 5, 4, 3, 6, 1, 8);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_ilvod_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ilvod_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(1, 2, 3, 4);
+ #[rustfmt::skip]
+ let b = i32x4::new(4, 3, 2, 1);
+ #[rustfmt::skip]
+ let r = i32x4::new(3, 2, 1, 4);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_ilvod_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ilvod_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(1, 2);
+ #[rustfmt::skip]
+ let b = i64x2::new(2, 1);
+ #[rustfmt::skip]
+ let r = i64x2::new(1, 2);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_ilvod_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ilvr_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ 1, 2, 3, 4,
+ 5, 6, 7, 8,
+ 9, 10, 11, 12,
+ 13, 14, 15, 16
+ );
+ #[rustfmt::skip]
+ let b = i8x16::new(
+ 16, 15, 14, 13,
+ 12, 11, 10, 9,
+ 8, 7, 6, 5,
+ 4, 3, 2, 1
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 16, 1, 15, 2,
+ 14, 3, 13, 4,
+ 12, 5, 11, 6,
+ 10, 7, 9, 8
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_ilvr_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ilvr_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ 1, 2, 3, 4,
+ 5, 6, 7, 8,
+ );
+ #[rustfmt::skip]
+ let b = i16x8::new(
+ 8, 7, 6, 5,
+ 4, 3, 2, 1,
+ );
+ #[rustfmt::skip]
+ let r = i16x8::new(8, 1, 7, 2, 6, 3, 5, 4);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_ilvr_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ilvr_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(1, 2, 3, 4);
+ #[rustfmt::skip]
+ let b = i32x4::new(4, 3, 2, 1);
+ #[rustfmt::skip]
+ let r = i32x4::new(4, 1, 3, 2);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_ilvr_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ilvr_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(1, 2);
+ #[rustfmt::skip]
+ let b = i64x2::new(2, 1);
+ #[rustfmt::skip]
+ let r = i64x2::new(2, 1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_ilvr_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_insert_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ -100, 127, 4, 127,
+ -100, 127, 4, 127,
+ -100, 127, 4, 127,
+ -100, 127, 4, 127
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ -100, 127, 4, 127,
+ -100, 127, 4, 127,
+ -100, 127, 4, 127,
+ 5, 127, 4, 127
+ );
+
+ assert_eq!(r, mem::transmute(__msa_insert_b(mem::transmute(a), 12, 5)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_insert_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ 32767, 3276, 100, 11,
+ 32767, 3276, 100, 11
+ );
+ #[rustfmt::skip]
+ let r = i16x8::new(
+ 32767, 3276, 100, 11,
+ 5, 3276, 100, 11
+ );
+
+ assert_eq!(r, mem::transmute(__msa_insert_h(mem::transmute(a), 4, 5)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_insert_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(100, 2147483647, 5, -2147483647);
+ #[rustfmt::skip]
+ let r = i32x4::new(100, 7, 5, -2147483647);
+
+ assert_eq!(r, mem::transmute(__msa_insert_w(mem::transmute(a), 1, 7)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_insert_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(3, i64::MAX);
+ #[rustfmt::skip]
+ let r = i64x2::new(3, 100);
+
+ assert_eq!(r, mem::transmute(__msa_insert_d(mem::transmute(a), 1, 100)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_insve_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ -100, i8::MAX, 4, i8::MAX,
+ -100, i8::MAX, 4, i8::MAX,
+ -100, i8::MAX, 4, i8::MAX,
+ -100, i8::MAX, 4, i8::MAX
+ );
+ #[rustfmt::skip]
+ let b = i8x16::new(
+ 5, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ -100, 127, 4, 127,
+ -100, 127, 4, 127,
+ -100, 127, 4, 127,
+ 5, 127, 4, 127
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_insve_b(mem::transmute(a), 12, mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_insve_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ i16::MAX, 3276, 100, 11,
+ i16::MAX, 3276, 100, 11
+ );
+ #[rustfmt::skip]
+ let b = i16x8::new(
+ 1, 2, 3, 4,
+ 1, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let r = i16x8::new(
+ 32767, 3276, 100, 11,
+ 1, 3276, 100, 11
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_insve_h(mem::transmute(a), 4, mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_insve_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(100, 2147483647, 5, -2147483647);
+ #[rustfmt::skip]
+ let b = i32x4::new(1, 2, 3, 4);
+ #[rustfmt::skip]
+ let r = i32x4::new(100, 2147483647, 5, 1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_insve_w(mem::transmute(a), 3, mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_insve_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(3, i64::MAX);
+ #[rustfmt::skip]
+ let b = i64x2::new(1, 2);
+ #[rustfmt::skip]
+ let r = i64x2::new(3, 1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_insve_d(mem::transmute(a), 1, mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ld_b() {
+ #[rustfmt::skip]
+ let mut a : [i8; 32] = [
+ 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 p = &mut a[4] as *mut _ as *mut u8;
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 13, 14, 15, 16,
+ 17, 18, 19, 20,
+ 21, 22, 23, 24,
+ 25, 26, 27, 28
+ );
+
+ assert_eq!(r, mem::transmute(__msa_ld_b(p, 9)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ld_h() {
+ #[rustfmt::skip]
+ let mut a : [i16; 16] = [
+ 0, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15
+ ];
+ let p = &mut a[4] as *mut _ as *mut u8;
+ #[rustfmt::skip]
+ let r = i16x8::new(3, 4, 5, 6, 7, 8, 9, 10);
+
+ assert_eq!(r, mem::transmute(__msa_ld_h(p, -2)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ld_w() {
+ #[rustfmt::skip]
+ let mut a : [i32; 8] = [0, 1, 2, 3, 4, 5, 6, 7];
+ let p = &mut a[3] as *mut _ as *mut u8;
+ #[rustfmt::skip]
+ let r = i32x4::new(2, 3, 4, 5);
+
+ assert_eq!(r, mem::transmute(__msa_ld_w(p, -4)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ld_d() {
+ #[rustfmt::skip]
+ let mut a : [i64; 8] = [0, 1, 2, 3, 4, 5, 6, 7];
+ let p = &mut a[4] as *mut _ as *mut u8;
+ #[rustfmt::skip]
+ let r = i64x2::new(0, 1);
+
+ assert_eq!(r, mem::transmute(__msa_ld_d(p, -32)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ldi_b() {
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ -20, -20, -20, -20,
+ -20, -20, -20, -20,
+ -20, -20, -20, -20,
+ -20, -20, -20, -20
+ );
+
+ assert_eq!(r, mem::transmute(__msa_ldi_b(-20)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ldi_h() {
+ #[rustfmt::skip]
+ let r = i16x8::new(
+ 255, 255, 255, 255,
+ 255, 255, 255, 255
+ );
+
+ assert_eq!(r, mem::transmute(__msa_ldi_h(255)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ldi_w() {
+ #[rustfmt::skip]
+ let r = i32x4::new(-509, -509, -509, -509);
+
+ assert_eq!(r, mem::transmute(__msa_ldi_w(-509)));
+ }
+
+ // FIXME: https://reviews.llvm.org/D59884
+ // If target type is i64, negative immediate loses the sign
+ // Test passes if 4294967185 is used instead -111 in vector `r`
+ // #[simd_test(enable = "msa")]
+ // unsafe fn test_msa_ldi_d() {
+ // let r = i64x2::new(-111, -111);
+
+ // assert_eq!(r, mem::transmute(__msa_ldi_d(-111)));
+ // }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_madd_q_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ i16::MAX, 1024, i16::MIN, -1024,
+ 1, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let b = i16x8::new(
+ 1024, 1024, 1024, 1024,
+ 1024, 1024, 1024, 1024
+ );
+ #[rustfmt::skip]
+ let c = i16x8::new(
+ i16::MAX, i16::MAX, 1, -1,
+ 33, 66, 99, 132
+ );
+ #[rustfmt::skip]
+ let r = i16x8::new(32767, 2047, -32768, -1025, 2, 4, 6, 8);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_madd_q_h(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_madd_q_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(i32::MAX, i32::MIN, 1, 2);
+ #[rustfmt::skip]
+ let b = i32x4::new(102401, 102401, 102401, 102401);
+ #[rustfmt::skip]
+ let c = i32x4::new(10240, 20480, 30720, 40960);
+ #[rustfmt::skip]
+ let r = i32x4::new(2147483647, -2147483648, 2, 3);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_madd_q_w(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_maddr_q_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ 32767, 1024, -32768, -1024,
+ 1, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let b = i16x8::new(
+ 1024, 1024, 1024, 1024,
+ 1024, 1024, 1024, 1024
+ );
+ #[rustfmt::skip]
+ let c = i16x8::new(
+ 32767, 32767, 32767, 32767,
+ 33, 66, 99, 132
+ );
+ #[rustfmt::skip]
+ let r = i16x8::new(32767, 2048, -31744, 0, 2, 4, 6, 8);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_maddr_q_h(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_maddr_q_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(i32::MAX, i32::MIN, 1, 2);
+ #[rustfmt::skip]
+ let b = i32x4::new(102401, 102401, 102401, 102401);
+ #[rustfmt::skip]
+ let c = i32x4::new(10240, 20480, 30720, 40960);
+ #[rustfmt::skip]
+ let r = i32x4::new(2147483647, -2147483647, 2, 4);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_maddr_q_w(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_maddv_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let b = i8x16::new(
+ 5, 6, 7, 8,
+ 5, 6, 7, 8,
+ 5, 6, 7, 8,
+ 5, 6, 7, 8
+ );
+ #[rustfmt::skip]
+ let c = i8x16::new(
+ 9, 10, 11, 12,
+ 9, 10, 11, 12,
+ 9, 10, 11, 12,
+ 9, 10, 11, 12
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 46, 62, 80, 100,
+ 46, 62, 80, 100,
+ 46, 62, 80, 100,
+ 46, 62, 80, 100
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_maddv_b(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_maddv_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(1, 2, 3, 4, 1, 2, 3, 4);
+ #[rustfmt::skip]
+ let b = i16x8::new(5, 6, 7, 8, 5, 6, 7, 8);
+ #[rustfmt::skip]
+ let c = i16x8::new(9, 10, 11, 12, 9, 10, 11, 12);
+ #[rustfmt::skip]
+ let r = i16x8::new(46, 62, 80, 100, 46, 62, 80, 100);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_maddv_h(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_maddv_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(1, 2, 1, 2);
+ #[rustfmt::skip]
+ let b = i32x4::new(3, 4, 3, 4);
+ #[rustfmt::skip]
+ let c = i32x4::new(5, 6, 5, 6);
+ #[rustfmt::skip]
+ let r = i32x4::new(16, 26, 16, 26);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_maddv_w(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_maddv_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(1, 2);
+ #[rustfmt::skip]
+ let b = i64x2::new(3, 4);
+ #[rustfmt::skip]
+ let c = i64x2::new(5, 6);
+ #[rustfmt::skip]
+ let r = i64x2::new(16, 26);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_maddv_d(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_max_a_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ 1, 2, 3, 4,
+ -1, -2, -3, -4,
+ 1, 2, 3, 4,
+ -1, -2, -3, -4
+ );
+ #[rustfmt::skip]
+ let b = i8x16::new(
+ -6, -7, -8, -9,
+ 6, 7, 8, 9,
+ -6, -7, -8, -9,
+ 6, 7, 8, 9
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ -6, -7, -8, -9,
+ 6, 7, 8, 9,
+ -6, -7, -8, -9,
+ 6, 7, 8, 9
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_max_a_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_max_a_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(1, -2, 3, -4, 1, -2, 3, -4);
+ #[rustfmt::skip]
+ let b = i16x8::new(-6, 7, -8, 9, -6, 7, -8, 9);
+ #[rustfmt::skip]
+ let r = i16x8::new(-6, 7, -8, 9, -6, 7, -8, 9);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_max_a_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_max_a_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(1, -2, 3, -4);
+ #[rustfmt::skip]
+ let b = i32x4::new(6, 7, 8, 9);
+ #[rustfmt::skip]
+ let r = i32x4::new(6, 7, 8, 9);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_max_a_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_max_a_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(-1, 2);
+ #[rustfmt::skip]
+ let b = i64x2::new(6, -7);
+ #[rustfmt::skip]
+ let r = i64x2::new(6, -7);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_max_a_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_max_s_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ 1, 2, 3, 4,
+ -1, -2, -3, -4,
+ 1, 2, 3, 4,
+ -1, -2, -3, -4
+ );
+ #[rustfmt::skip]
+ let b = i8x16::new(
+ -6, -7, -8, -9,
+ 6, 7, 8, 9,
+ -6, -7, -8, -9,
+ 6, 7, 8, 9
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 1, 2, 3, 4,
+ 6, 7, 8, 9,
+ 1, 2, 3, 4,
+ 6, 7, 8, 9
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_max_s_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_max_s_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(1, -2, 3, -4, 1, -2, 3, -4);
+ #[rustfmt::skip]
+ let b = i16x8::new(-6, 7, -8, 9, -6, 7, -8, 9);
+ #[rustfmt::skip]
+ let r = i16x8::new(1, 7, 3, 9, 1, 7, 3, 9);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_max_s_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_max_s_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(1, -2, 3, -4);
+ #[rustfmt::skip]
+ let b = i32x4::new(6, 7, 8, 9);
+ #[rustfmt::skip]
+ let r = i32x4::new(6, 7, 8, 9);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_max_s_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_max_s_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(-1, 2);
+ #[rustfmt::skip]
+ let b = i64x2::new(6, -7);
+ #[rustfmt::skip]
+ let r = i64x2::new(6, 2);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_max_s_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_max_u_b() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let b = u8x16::new(
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9
+ );
+ #[rustfmt::skip]
+ let r = u8x16::new(
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_max_u_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_max_u_h() {
+ #[rustfmt::skip]
+ let a = u16x8::new(1, 2, 3, 4, 1, 2, 3, 4);
+ #[rustfmt::skip]
+ let b = u16x8::new(6, 7, 8, 9, 6, 7, 8, 9);
+ #[rustfmt::skip]
+ let r = u16x8::new(6, 7, 8, 9, 6, 7, 8, 9);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_max_u_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_max_u_w() {
+ #[rustfmt::skip]
+ let a = u32x4::new(1, 2, 3, 4);
+ #[rustfmt::skip]
+ let b = u32x4::new(6, 7, 8, 9);
+ #[rustfmt::skip]
+ let r = u32x4::new(6, 7, 8, 9);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_max_u_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_max_u_d() {
+ #[rustfmt::skip]
+ let a = u64x2::new(1, 2);
+ #[rustfmt::skip]
+ let b = u64x2::new(6, 7);
+ #[rustfmt::skip]
+ let r = u64x2::new(6, 7);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_max_u_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_maxi_s_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ 1, -20, -6, 8,
+ 1, -20, -6, 8,
+ 1, -20, -6, 8,
+ 1, -20, -6, 8
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 1, -16, -6, 8,
+ 1, -16, -6, 8,
+ 1, -16, -6, 8,
+ 1, -16, -6, 8
+ );
+
+ assert_eq!(r, mem::transmute(__msa_maxi_s_b(mem::transmute(a), -16)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_maxi_s_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(1, 3, -60, -8, 1, 3, -6, -8);
+ #[rustfmt::skip]
+ let r = i16x8::new(15, 15, 15, 15, 15, 15, 15, 15);
+
+ assert_eq!(r, mem::transmute(__msa_maxi_s_h(mem::transmute(a), 15)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_maxi_s_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(1, 3, -6, -8);
+ #[rustfmt::skip]
+ let r = i32x4::new(1, 3, -5, -5);
+
+ assert_eq!(r, mem::transmute(__msa_maxi_s_w(mem::transmute(a), -5)));
+ }
+
+ // FIXME: https://reviews.llvm.org/D59884
+ // If target type is i64, negative immediate loses the sign
+ // Test passes if 4294967293 is used instead -3 in vector `r`
+ // #[simd_test(enable = "msa")]
+ // unsafe fn test_msa_maxi_s_d() {
+ // #[rustfmt::skip]
+ // let a = i64x2::new(1, -8);
+ // #[rustfmt::skip]
+ // let r = i64x2::new(-3, -3);
+
+ // assert_eq!(r, mem::transmute(__msa_maxi_s_d(mem::transmute(a), -3)));
+ // }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_maxi_u_b() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ 1, 3, 6, 8,
+ 1, 3, 6, 8,
+ 1, 3, 6, 8,
+ 1, 3, 6, 8
+ );
+ #[rustfmt::skip]
+ let r = u8x16::new(
+ 5, 5, 6, 8,
+ 5, 5, 6, 8,
+ 5, 5, 6, 8,
+ 5, 5, 6, 8
+ );
+
+ assert_eq!(r, mem::transmute(__msa_maxi_u_b(mem::transmute(a), 5)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_maxi_u_h() {
+ #[rustfmt::skip]
+ let a = u16x8::new(1, 3, 6, 8, 1, 3, 6, 8);
+ #[rustfmt::skip]
+ let r = u16x8::new(5, 5, 6, 8, 5, 5, 6, 8);
+
+ assert_eq!(r, mem::transmute(__msa_maxi_u_h(mem::transmute(a), 5)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_maxi_u_w() {
+ #[rustfmt::skip]
+ let a = u32x4::new(1, 3, 6, 8);
+ #[rustfmt::skip]
+ let r = u32x4::new(5, 5, 6, 8);
+
+ assert_eq!(r, mem::transmute(__msa_maxi_u_w(mem::transmute(a), 5)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_maxi_u_d() {
+ #[rustfmt::skip]
+ let a = u64x2::new(1, 8);
+ #[rustfmt::skip]
+ let r = u64x2::new(5, 8);
+
+ assert_eq!(r, mem::transmute(__msa_maxi_u_d(mem::transmute(a), 5)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_min_a_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ 1, 2, 3, 4,
+ -1, -2, -3, -4,
+ 1, 2, 3, 4,
+ -1, -2, -3, -4
+ );
+ #[rustfmt::skip]
+ let b = i8x16::new(
+ -6, -7, -8, -9,
+ 6, 7, 8, 9,
+ -6, -7, -8, -9,
+ 6, 7, 8, 9
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 1, 2, 3, 4,
+ -1, -2, -3, -4,
+ 1, 2, 3, 4,
+ -1, -2, -3, -4
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_min_a_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_min_a_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(1, -2, 3, -4, 1, -2, 3, -4);
+ #[rustfmt::skip]
+ let b = i16x8::new(-6, 7, -8, 9, -6, 7, -8, 9);
+ #[rustfmt::skip]
+ let r = i16x8::new(1, -2, 3, -4, 1, -2, 3, -4);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_min_a_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_min_a_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(1, -2, 3, -4);
+ #[rustfmt::skip]
+ let b = i32x4::new(6, 7, 8, 9);
+ #[rustfmt::skip]
+ let r = i32x4::new(1, -2, 3, -4);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_min_a_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_min_a_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(-1, 2);
+ #[rustfmt::skip]
+ let b = i64x2::new(6, -7);
+ #[rustfmt::skip]
+ let r = i64x2::new(-1, 2);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_min_a_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_min_s_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ 1, 2, 3, 4,
+ -1, -2, -3, -4,
+ 1, 2, 3, 4,
+ -1, -2, -3, -4
+ );
+ #[rustfmt::skip]
+ let b = i8x16::new(
+ -6, -7, -8, -9,
+ 6, 7, 8, 9,
+ -6, -7, -8, -9,
+ 6, 7, 8, 9
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ -6, -7, -8, -9,
+ -1, -2, -3, -4,
+ -6, -7, -8, -9,
+ -1, -2, -3, -4
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_min_s_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_min_s_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(1, -2, 3, -4, 1, -2, 3, -4);
+ #[rustfmt::skip]
+ let b = i16x8::new(-6, 7, -8, 9, -6, 7, -8, 9);
+ #[rustfmt::skip]
+ let r = i16x8::new(-6, -2, -8, -4, -6, -2, -8, -4);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_min_s_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_min_s_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(1, -2, 3, -4);
+ #[rustfmt::skip]
+ let b = i32x4::new(6, 7, 8, 9);
+ #[rustfmt::skip]
+ let r = i32x4::new(1, -2, 3, -4);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_min_s_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_min_s_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(-1, 2);
+ #[rustfmt::skip]
+ let b = i64x2::new(6, -7);
+ #[rustfmt::skip]
+ let r = i64x2::new(-1, -7);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_min_s_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_mini_s_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ 1, 2, 3, 4,
+ -1, -2, -3, -4,
+ 1, 2, 3, 4,
+ -1, -2, -3, -4
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ -10, -10, -10, -10,
+ -10, -10, -10, -10,
+ -10, -10, -10, -10,
+ -10, -10, -10, -10
+ );
+
+ assert_eq!(r, mem::transmute(__msa_mini_s_b(mem::transmute(a), -10)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_mini_s_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(1, -2, 3, -4, 1, -2, 3, -4);
+ #[rustfmt::skip]
+ let r = i16x8::new(-3, -3, -3, -4, -3, -3, -3, -4);
+
+ assert_eq!(r, mem::transmute(__msa_mini_s_h(mem::transmute(a), -3)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_mini_s_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(1, -2, 3, -4);
+ #[rustfmt::skip]
+ let r = i32x4::new(-3, -3, -3, -4);
+
+ assert_eq!(r, mem::transmute(__msa_mini_s_w(mem::transmute(a), -3)));
+ }
+
+ // FIXME: https://reviews.llvm.org/D59884
+ // If target type is i64, negative immediate loses the sign
+ // -3 is represented as 4294967293
+ // #[simd_test(enable = "msa")]
+ // unsafe fn test_msa_mini_s_d() {
+ // #[rustfmt::skip]
+ // let a = i64x2::new(-3, 2);
+ // #[rustfmt::skip]
+ // let r = i64x2::new(-1, -3);
+
+ // assert_eq!(r, mem::transmute(__msa_mini_s_d(mem::transmute(a), -3)));
+ // }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_min_u_b() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let b = u8x16::new(
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9
+ );
+ #[rustfmt::skip]
+ let r = u8x16::new(
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_min_u_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_min_u_h() {
+ #[rustfmt::skip]
+ let a = u16x8::new(1, 2, 3, 4, 1, 2, 3, 4);
+ #[rustfmt::skip]
+ let b = u16x8::new(6, 7, 8, 9, 6, 7, 8, 9);
+ #[rustfmt::skip]
+ let r = u16x8::new(1, 2, 3, 4, 1, 2, 3, 4,);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_min_u_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_min_u_w() {
+ #[rustfmt::skip]
+ let a = u32x4::new(1, 2, 3, 4);
+ #[rustfmt::skip]
+ let b = u32x4::new(6, 7, 8, 9);
+ #[rustfmt::skip]
+ let r = u32x4::new(1, 2, 3, 4,);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_min_u_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_min_u_d() {
+ #[rustfmt::skip]
+ let a = u64x2::new(1, 2);
+ #[rustfmt::skip]
+ let b = u64x2::new(6, 7);
+ #[rustfmt::skip]
+ let r = u64x2::new(1, 2,);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_min_u_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_mini_u_b() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ 1, 3, 6, 8,
+ 1, 3, 6, 8,
+ 1, 3, 6, 8,
+ 1, 3, 6, 8
+ );
+ #[rustfmt::skip]
+ let r = u8x16::new(
+ 1, 3, 5, 5,
+ 1, 3, 5, 5,
+ 1, 3, 5, 5,
+ 1, 3, 5, 5
+ );
+
+ assert_eq!(r, mem::transmute(__msa_mini_u_b(mem::transmute(a), 5)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_mini_u_h() {
+ #[rustfmt::skip]
+ let a = u16x8::new(1, 3, 6, 8, 1, 3, 6, 8);
+ #[rustfmt::skip]
+ let r = u16x8::new(1, 3, 5, 5, 1, 3, 5, 5);
+
+ assert_eq!(r, mem::transmute(__msa_mini_u_h(mem::transmute(a), 5)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_mini_u_w() {
+ #[rustfmt::skip]
+ let a = u32x4::new(1, 3, 6, 8);
+ #[rustfmt::skip]
+ let r = u32x4::new(1, 3, 5, 5);
+
+ assert_eq!(r, mem::transmute(__msa_mini_u_w(mem::transmute(a), 5)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_mini_u_d() {
+ #[rustfmt::skip]
+ let a = u64x2::new(1, 8);
+ #[rustfmt::skip]
+ let r = u64x2::new(1, 5);
+
+ assert_eq!(r, mem::transmute(__msa_mini_u_d(mem::transmute(a), 5)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_mod_s_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ -6, -7, -8, -9,
+ 6, 7, 8, 9,
+ -6, -7, -8, -9,
+ 6, 7, 8, 9
+ );
+ #[rustfmt::skip]
+ let b = i8x16::new(
+ 1, 2, 3, 4,
+ -1, -2, -3, -4,
+ 1, 2, 3, 4,
+ -1, -2, -3, -4
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 0, -1, -2, -1,
+ 0, 1, 2, 1,
+ 0, -1, -2, -1,
+ 0, 1, 2, 1
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_mod_s_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_mod_s_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(-6, 7, -8, 9, -6, 7, -8, 9);
+ #[rustfmt::skip]
+ let b = i16x8::new(1, -2, 3, -4, 1, -2, 3, -4);
+ #[rustfmt::skip]
+ let r = i16x8::new(0, 1, -2, 1, 0, 1, -2, 1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_mod_s_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_mod_s_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(6, 7, 8, 9);
+ #[rustfmt::skip]
+ let b = i32x4::new(1, -2, 3, -4);
+ #[rustfmt::skip]
+ let r = i32x4::new(0, 1, 2, 1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_mod_s_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_mod_s_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(6, -7);
+ #[rustfmt::skip]
+ let b = i64x2::new(-1, 2);
+ #[rustfmt::skip]
+ let r = i64x2::new(0, -1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_mod_s_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_mod_u_b() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9
+ );
+ #[rustfmt::skip]
+ let b = u8x16::new(
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let r = u8x16::new(
+ 0, 1, 2, 1,
+ 0, 1, 2, 1,
+ 0, 1, 2, 1,
+ 0, 1, 2, 1
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_mod_u_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_mod_u_h() {
+ #[rustfmt::skip]
+ let a = u16x8::new(6, 7, 8, 9, 6, 7, 8, 9);
+ #[rustfmt::skip]
+ let b = u16x8::new(1, 2, 3, 4, 1, 2, 3, 4);
+ #[rustfmt::skip]
+ let r = u16x8::new(0, 1, 2, 1, 0, 1, 2, 1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_mod_u_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_mod_u_w() {
+ #[rustfmt::skip]
+ let a = u32x4::new(6, 7, 8, 9);
+ #[rustfmt::skip]
+ let b = u32x4::new(1, 2, 3, 4);
+ #[rustfmt::skip]
+ let r = u32x4::new(0, 1, 2, 1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_mod_u_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_mod_u_d() {
+ #[rustfmt::skip]
+ let a = u64x2::new(6, 7);
+ #[rustfmt::skip]
+ let b = u64x2::new(1, 2);
+ #[rustfmt::skip]
+ let r = u64x2::new(0, 1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_mod_u_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_move_v() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ 1, 2, 3, 4,
+ 5, 6, 7, 8,
+ 1, 2, 3, 4,
+ 5, 6, 7, 8
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 1, 2, 3, 4,
+ 5, 6, 7, 8,
+ 1, 2, 3, 4,
+ 5, 6, 7, 8
+ );
+
+ assert_eq!(r, mem::transmute(__msa_move_v(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_msub_q_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ 1024, -1024, 1024, -1024,
+ 1, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let b = i16x8::new(
+ 1025, 1025, 1025, 1025,
+ 1025, 1025, 1025, 1025
+ );
+ #[rustfmt::skip]
+ let c = i16x8::new(
+ 1024, 2048, 3072, 4096,
+ 1024, 2048, 3072, 4096
+ );
+ #[rustfmt::skip]
+ let r = i16x8::new(991, -1089, 927, -1153, -32, -63, -94, -125);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_msub_q_h(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_msub_q_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(2147483647, -2147483647, 1, 2);
+ #[rustfmt::skip]
+ let b = i32x4::new(10240, 10240, 10240, 10240);
+ #[rustfmt::skip]
+ let c = i32x4::new(10240, 20480, 30720, 40960);
+ #[rustfmt::skip]
+ let r = i32x4::new(2147483646, -2147483648, 0, 1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_msub_q_w(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_msubr_q_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ 1024, -1024, 1024, -1024,
+ 1, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let b = i16x8::new(
+ 1025, 1025, 1025, 1025,
+ 1025, 1025, 1025, 1025
+ );
+ #[rustfmt::skip]
+ let c = i16x8::new(
+ 1024, 2048, 3072, 4096,
+ 1024, 2048, 3072, 4096
+ );
+ #[rustfmt::skip]
+ let r = i16x8::new(992, -1088, 928, -1152, -31, -62, -93, -124);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_msubr_q_h(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_msubr_q_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(i32::MAX, -2147483647, 1, 2);
+ #[rustfmt::skip]
+ let b = i32x4::new(10240, 10240, 10240, 10240);
+ #[rustfmt::skip]
+ let c = i32x4::new(10240, 20480, 30720, 40960);
+ #[rustfmt::skip]
+ let r = i32x4::new(2147483647, -2147483647, 1, 2);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_msubr_q_w(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_msubv_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let b = i8x16::new(
+ 5, 6, 7, 8,
+ 5, 6, 7, 8,
+ 5, 6, 7, 8,
+ 5, 6, 7, 8
+ );
+ #[rustfmt::skip]
+ let c = i8x16::new(
+ 9, 10, 11, 12,
+ 9, 10, 11, 12,
+ 9, 10, 11, 12,
+ 9, 10, 11, 12
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ -44, -58, -74, -92,
+ -44, -58, -74, -92,
+ -44, -58, -74, -92,
+ -44, -58, -74, -92
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_msubv_b(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_msubv_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(1, 2, 3, 4, 1, 2, 3, 4);
+ #[rustfmt::skip]
+ let b = i16x8::new(5, 6, 7, 8, 5, 6, 7, 8);
+ #[rustfmt::skip]
+ let c = i16x8::new(9, 10, 11, 12, 9, 10, 11, 12);
+ #[rustfmt::skip]
+ let r = i16x8::new(-44, -58, -74, -92, -44, -58, -74, -92);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_msubv_h(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_msubv_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(1, 2, 1, 2);
+ #[rustfmt::skip]
+ let b = i32x4::new(3, 4, 3, 4);
+ #[rustfmt::skip]
+ let c = i32x4::new(5, 6, 5, 6);
+ #[rustfmt::skip]
+ let r = i32x4::new(-14, -22, -14, -22);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_msubv_w(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_msubv_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(1, 2);
+ #[rustfmt::skip]
+ let b = i64x2::new(3, 4);
+ #[rustfmt::skip]
+ let c = i64x2::new(5, 6);
+ #[rustfmt::skip]
+ let r = i64x2::new(-14, -22);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_msubv_d(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_mul_q_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ 12500, -20, -300, 400,
+ 12500, 20, 300, 400
+ );
+ #[rustfmt::skip]
+ let b = i16x8::new(
+ 1250, 10240, -7585, 8456,
+ 1250, 10240, -7585, 8456
+ );
+ #[rustfmt::skip]
+ let r = i16x8::new(476, -7, 69, 103, 476, 6, -70, 103);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_mul_q_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_mul_q_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(
+ i32::MAX, i32::MAX,
+ i32::MIN, i32::MIN
+ );
+ #[rustfmt::skip]
+ let b = i32x4::new(30, 60, 30, 60);
+ #[rustfmt::skip]
+ let r = i32x4::new(29, 59, -30, -60);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_mul_q_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_mulr_q_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ 12500, -20, -300, 400,
+ 12500, 20, 300, 400
+ );
+ #[rustfmt::skip]
+ let b = i16x8::new(
+ 1250, 10240, -7585, 8456,
+ 1250, 10240, -7585, 8456
+ );
+ #[rustfmt::skip]
+ let r = i16x8::new(477, -6, 69, 103, 477, 6, -69, 103);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_mulr_q_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_mulr_q_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(
+ i32::MAX, i32::MAX,
+ i32::MIN, i32::MIN
+ );
+ #[rustfmt::skip]
+ let b = i32x4::new(30, 60, 30, 60);
+ #[rustfmt::skip]
+ let r = i32x4::new(30, 60, -30, -60);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_mulr_q_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_mulv_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ 1, 2, 3, 4,
+ 5, 6, 7, 8,
+ 9, 10, 11, 12,
+ 13, 14, 15, 16
+ );
+ #[rustfmt::skip]
+ let b = i8x16::new(
+ 16, 15, 14, 13,
+ 12, 11, 10, 9,
+ 8, 7, 6, 5,
+ 4, 3, 2, 1
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 16, 30, 42, 52,
+ 60, 66, 70, 72,
+ 72, 70, 66, 60,
+ 52, 42, 30, 16
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_mulv_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_mulv_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ 1, 2, 3, 4,
+ 5, 6, 7, 8
+ );
+ #[rustfmt::skip]
+ let b = i16x8::new(
+ 8, 7, 6, 5,
+ 4, 3, 2, 1
+ );
+ #[rustfmt::skip]
+ let r = i16x8::new(8, 14, 18, 20, 20, 18, 14, 8);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_mulv_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_mulv_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(1, 2, 3, 4);
+ #[rustfmt::skip]
+ let b = i32x4::new(4, 3, 2, 1);
+ #[rustfmt::skip]
+ let r = i32x4::new(4, 6, 6, 4);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_mulv_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_mulv_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(1, 2);
+ #[rustfmt::skip]
+ let b = i64x2::new(2, 1);
+ #[rustfmt::skip]
+ let r = i64x2::new(2, 2);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_mulv_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_nloc_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ -128, -64, -32, -16,
+ -8, -4, -2, -1,
+ 1, 2, 4, 8,
+ 16, 32, 64, 127
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 1, 2, 3, 4,
+ 5, 6, 7, 8,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0
+ );
+
+ assert_eq!(r, mem::transmute(__msa_nloc_b(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_nloc_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ -32768, -16384, -8192, -4096,
+ 4096, 8192, 16384, 32767
+ );
+ #[rustfmt::skip]
+ let r = i16x8::new(1, 2, 3, 4, 0, 0, 0, 0);
+
+ assert_eq!(r, mem::transmute(__msa_nloc_h(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_nloc_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(
+ i32::MIN, -1073741824,
+ 1073741824, i32::MAX
+ );
+ #[rustfmt::skip]
+ let r = i32x4::new(1, 2, 0, 0);
+
+ assert_eq!(r, mem::transmute(__msa_nloc_w(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_nloc_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(i64::MIN, i64::MAX);
+ #[rustfmt::skip]
+ let r = i64x2::new(1, 0);
+
+ assert_eq!(r, mem::transmute(__msa_nloc_d(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_nlzc_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ 1, 2, 3, 4,
+ 5, 6, 7, 8,
+ 9, 10, 11, 12,
+ 13, 14, 15, 16
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 7, 6, 6, 5,
+ 5, 5, 5, 4,
+ 4, 4, 4, 4,
+ 4, 4, 4, 3
+ );
+
+ assert_eq!(r, mem::transmute(__msa_nlzc_b(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_nlzc_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ 1, 2, 3, 4,
+ 5, 6, 7, 8
+ );
+ #[rustfmt::skip]
+ let r = i16x8::new(15, 14, 14, 13, 13, 13, 13, 12);
+
+ assert_eq!(r, mem::transmute(__msa_nlzc_h(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_nlzc_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(1, 2, 3, 4);
+ #[rustfmt::skip]
+ let r = i32x4::new(31, 30, 30, 29);
+
+ assert_eq!(r, mem::transmute(__msa_nlzc_w(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_nlzc_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(1, 2);
+ #[rustfmt::skip]
+ let r = i64x2::new(63, 62);
+
+ assert_eq!(r, mem::transmute(__msa_nlzc_d(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_nor_v() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ 1, 2, 3, 4,
+ 5, 6, 7, 8,
+ 9, 10, 11, 12,
+ 13, 14, 15, 16
+ );
+ #[rustfmt::skip]
+ let b = u8x16::new(
+ 1, 2, 3, 4,
+ 5, 6, 7, 8,
+ 9, 10, 11, 12,
+ 13, 14, 15, 16
+ );
+ #[rustfmt::skip]
+ let r = u8x16::new(
+ 254, 253, 252, 251,
+ 250, 249, 248, 247,
+ 246, 245, 244, 243,
+ 242, 241, 240, 239
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_nor_v(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_nori_b() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ 1, 2, 3, 4,
+ 5, 6, 7, 8,
+ 9, 10, 11, 12,
+ 13, 14, 15, 16
+ );
+ #[rustfmt::skip]
+ let r = u8x16::new(
+ 250, 249, 248, 251,
+ 250, 249, 248, 243,
+ 242, 241, 240, 243,
+ 242, 241, 240, 235
+ );
+
+ assert_eq!(r, mem::transmute(__msa_nori_b(mem::transmute(a), 4)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_or_v() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ 1, 2, 3, 4,
+ 5, 6, 7, 8,
+ 9, 10, 11, 12,
+ 13, 14, 15, 16
+ );
+ #[rustfmt::skip]
+ let b = u8x16::new(
+ 1, 2, 3, 4,
+ 5, 6, 7, 8,
+ 9, 10, 11, 12,
+ 13, 14, 15, 16
+ );
+ #[rustfmt::skip]
+ let r = u8x16::new(
+ 1, 2, 3, 4,
+ 5, 6, 7, 8,
+ 9, 10, 11, 12,
+ 13, 14, 15, 16
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_or_v(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_ori_b() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ 1, 2, 3, 4,
+ 5, 6, 7, 8,
+ 9, 10, 11, 12,
+ 13, 14, 15, 16
+ );
+ #[rustfmt::skip]
+ let r = u8x16::new(
+ 5, 6, 7, 4,
+ 5, 6, 7, 12,
+ 13, 14, 15, 12,
+ 13, 14, 15, 20
+ );
+
+ assert_eq!(r, mem::transmute(__msa_ori_b(mem::transmute(a), 4)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_pckev_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let b = i8x16::new(
+ 4, 3, 2, 1,
+ 4, 3, 2, 1,
+ 4, 3, 2, 1,
+ 4, 3, 2, 1
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 4, 2, 4, 2,
+ 4, 2, 4, 2,
+ 1, 3, 1, 3,
+ 1, 3, 1, 3
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_pckev_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_pckev_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(1, 2, 3, 4, 1, 2, 3, 4);
+ #[rustfmt::skip]
+ let b = i16x8::new(4, 3, 2, 1, 4, 3, 2, 1);
+ #[rustfmt::skip]
+ let r = i16x8::new(4, 2, 4, 2, 1, 3, 1, 3);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_pckev_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_pckev_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(1, 2, 3, 4);
+ #[rustfmt::skip]
+ let b = i32x4::new(4, 3, 2, 1);
+ #[rustfmt::skip]
+ let r = i32x4::new(4, 2, 1, 3);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_pckev_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_pckev_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(1, 2);
+ #[rustfmt::skip]
+ let b = i64x2::new(4, 3);
+ #[rustfmt::skip]
+ let r = i64x2::new(4, 1);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_pckev_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_pckod_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let b = i8x16::new(
+ 4, 3, 2, 1,
+ 4, 3, 2, 1,
+ 4, 3, 2, 1,
+ 4, 3, 2, 1
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 3, 1, 3, 1,
+ 3, 1, 3, 1,
+ 2, 4, 2, 4,
+ 2, 4, 2, 4
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_pckod_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_pckod_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(1, 2, 3, 4, 1, 2, 3, 4);
+ #[rustfmt::skip]
+ let b = i16x8::new(4, 3, 2, 1, 4, 3, 2, 1);
+ #[rustfmt::skip]
+ let r = i16x8::new(3, 1, 3, 1, 2, 4, 2, 4);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_pckod_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_pckod_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(1, 2, 3, 4);
+ #[rustfmt::skip]
+ let b = i32x4::new(4, 3, 2, 1);
+ #[rustfmt::skip]
+ let r = i32x4::new(3, 1, 2, 4);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_pckod_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_pckod_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(1, 2);
+ #[rustfmt::skip]
+ let b = i64x2::new(4, 3);
+ #[rustfmt::skip]
+ let r = i64x2::new(3, 2);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_pckod_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_pcnt_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ -128, -64, -32, -16,
+ -8, -4, -2, -1,
+ 1, 2, 4, 8,
+ 16, 32, 64, 127
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 1, 2, 3, 4,
+ 5, 6, 7, 8,
+ 1, 1, 1, 1,
+ 1, 1, 1, 7
+ );
+
+ assert_eq!(r, mem::transmute(__msa_pcnt_b(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_pcnt_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ -32768, -16384, -8192, -4096,
+ 4096, 8192, 16384, 32767
+ );
+ #[rustfmt::skip]
+ let r = i16x8::new(1, 2, 3, 4, 1, 1, 1, 15);
+
+ assert_eq!(r, mem::transmute(__msa_pcnt_h(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_pcnt_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(
+ i32::MIN, -1073741824,
+ 1073741824, i32::MAX
+ );
+ #[rustfmt::skip]
+ let r = i32x4::new(1, 2, 1, 31);
+
+ assert_eq!(r, mem::transmute(__msa_pcnt_w(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_pcnt_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(-2147483648, 2147483647);
+ #[rustfmt::skip]
+ let r = i64x2::new(33, 31);
+
+ assert_eq!(r, mem::transmute(__msa_pcnt_d(mem::transmute(a))));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_sat_s_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ i8::MAX, 105, 30, 1,
+ i8::MAX, 105, 30, 1,
+ i8::MAX, 105, 30, 1,
+ i8::MAX, 105, 30, 1
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 3, 3, 3, 1,
+ 3, 3, 3, 1,
+ 3, 3, 3, 1,
+ 3, 3, 3, 1
+ );
+
+ assert_eq!(r, mem::transmute(__msa_sat_s_b(mem::transmute(a), 2)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_sat_s_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ i16::MAX, 1155, 155, 1,
+ i16::MAX, 1155, 155, 1
+ );
+ #[rustfmt::skip]
+ let r = i16x8::new(127, 127, 127, 1, 127, 127, 127, 1);
+
+ assert_eq!(r, mem::transmute(__msa_sat_s_h(mem::transmute(a), 7)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_sat_s_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(i32::MAX, 111111155, i32::MAX, 1);
+ #[rustfmt::skip]
+ let r = i32x4::new(131071, 131071, 131071, 1);
+
+ assert_eq!(r, mem::transmute(__msa_sat_s_w(mem::transmute(a), 17)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_sat_s_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(i64::MAX, 1);
+ #[rustfmt::skip]
+ let r = i64x2::new(137438953471, 1);
+
+ assert_eq!(r, mem::transmute(__msa_sat_s_d(mem::transmute(a), 37)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_sat_u_b() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ u8::MAX, 105, 30, 1,
+ u8::MAX, 105, 30, 1,
+ u8::MAX, 105, 30, 1,
+ u8::MAX, 105, 30, 1
+ );
+ #[rustfmt::skip]
+ let r = u8x16::new(
+ 7, 7, 7, 1,
+ 7, 7, 7, 1,
+ 7, 7, 7, 1,
+ 7, 7, 7, 1
+ );
+
+ assert_eq!(r, mem::transmute(__msa_sat_u_b(mem::transmute(a), 2)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_sat_u_h() {
+ #[rustfmt::skip]
+ let a = u16x8::new(
+ u16::MAX, 1155, 155, 1,
+ u16::MAX, 1155, 155, 1
+ );
+ #[rustfmt::skip]
+ let r = u16x8::new(255, 255, 155, 1, 255, 255, 155, 1);
+
+ assert_eq!(r, mem::transmute(__msa_sat_u_h(mem::transmute(a), 7)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_sat_u_w() {
+ #[rustfmt::skip]
+ let a = u32x4::new(u32::MAX, 111111155, u32::MAX, 1);
+ #[rustfmt::skip]
+ let r = u32x4::new(262143, 262143, 262143, 1);
+
+ assert_eq!(r, mem::transmute(__msa_sat_u_w(mem::transmute(a), 17)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_sat_u_d() {
+ #[rustfmt::skip]
+ let a = u64x2::new(u64::MAX, 1);
+ #[rustfmt::skip]
+ let r = u64x2::new(274877906943, 1);
+
+ assert_eq!(r, mem::transmute(__msa_sat_u_d(mem::transmute(a), 37)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_shf_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ 11, 12, 3, 4,
+ 11, 12, 3, 4,
+ 11, 12, 3, 4,
+ 11, 12, 3, 4
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 11, 3, 4, 12,
+ 11, 3, 4, 12,
+ 11, 3, 4, 12,
+ 11, 3, 4, 12
+ );
+
+ assert_eq!(r, mem::transmute(__msa_shf_b(mem::transmute(a), 120)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_shf_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ 11, 12, 13, 14,
+ 11, 12, 13, 14
+ );
+ #[rustfmt::skip]
+ let r = i16x8::new(11, 14, 12, 13, 11, 14, 12, 13);
+
+ assert_eq!(r, mem::transmute(__msa_shf_h(mem::transmute(a), 156)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_shf_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(1, 2, 3, 4);
+ #[rustfmt::skip]
+ let r = i32x4::new(1, 3, 2, 4);
+
+ assert_eq!(r, mem::transmute(__msa_shf_w(mem::transmute(a), 216)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_sld_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ 0, 1, 2, 3,
+ 4, 5, 6, 7,
+ 8, 9, 10, 11,
+ 12, 13, 14, 15
+ );
+ #[rustfmt::skip]
+ let b = i8x16::new(
+ 16, 17, 18, 19,
+ 20, 21, 22, 23,
+ 24, 25, 26, 27,
+ 28, 29, 30, 31
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 21, 22, 23, 24,
+ 25, 26, 27, 28,
+ 29, 30, 31, 0,
+ 1, 2, 3, 4
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_sld_b(mem::transmute(a), mem::transmute(b), 5))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_sld_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ #[rustfmt::skip]
+ let b = i16x8::new(8, 9, 10, 11, 12, 13, 14, 15);
+ // let c = 5 as i32;
+ let r = i16x8::new(9, 10, 11, 0, 13, 14, 15, 4);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_sld_h(mem::transmute(a), mem::transmute(b), 2))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_sld_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(0, 1, 2, 3);
+ #[rustfmt::skip]
+ let b = i32x4::new(4, 5, 6, 7);
+ #[rustfmt::skip]
+ let r = i32x4::new(4, 5, 6, 7);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_sld_w(mem::transmute(a), mem::transmute(b), 4))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_sld_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(0, 1);
+ #[rustfmt::skip]
+ let b = i64x2::new(2, 3);
+ #[rustfmt::skip]
+ let r = i64x2::new(2, 3);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_sld_d(mem::transmute(a), mem::transmute(b), 2))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_sldi_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ 0, 1, 2, 3,
+ 4, 5, 6, 7,
+ 8, 9, 10, 11,
+ 12, 13, 14, 15
+ );
+ #[rustfmt::skip]
+ let b = i8x16::new(
+ 16, 17, 18, 19,
+ 20, 21, 22, 23,
+ 24, 25, 26, 27,
+ 28, 29, 30, 31
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 21, 22, 23, 24,
+ 25, 26, 27, 28,
+ 29, 30, 31, 0,
+ 1, 2, 3, 4
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_sldi_b(mem::transmute(a), mem::transmute(b), 5))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_sldi_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
+ #[rustfmt::skip]
+ let b = i16x8::new(8, 9, 10, 11, 12, 13, 14, 15);
+ // let c = 5 as i32;
+ let r = i16x8::new(9, 10, 11, 0, 13, 14, 15, 4);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_sldi_h(mem::transmute(a), mem::transmute(b), 2))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_sldi_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(0, 1, 2, 3);
+ #[rustfmt::skip]
+ let b = i32x4::new(4, 5, 6, 7);
+ #[rustfmt::skip]
+ let r = i32x4::new(4, 5, 6, 7);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_sldi_w(mem::transmute(a), mem::transmute(b), 4))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_sldi_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(0, 1);
+ #[rustfmt::skip]
+ let b = i64x2::new(2, 3);
+ #[rustfmt::skip]
+ let r = i64x2::new(2, 3);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_sldi_d(mem::transmute(a), mem::transmute(b), 2))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_sll_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let b = i8x16::new(
+ 4, 3, 2, 1,
+ 4, 3, 2, 1,
+ 4, 3, 2, 1,
+ 4, 3, 2, 1
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 16, 16, 12, 8,
+ 16, 16, 12, 8,
+ 16, 16, 12, 8,
+ 16, 16, 12, 8
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_sll_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_sll_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(1, 2, 3, 4, 1, 2, 3, 4);
+ #[rustfmt::skip]
+ let b = i16x8::new(4, 3, 2, 1, 4, 3, 2, 1);
+ #[rustfmt::skip]
+ let r = i16x8::new(16, 16, 12, 8, 16, 16, 12, 8);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_sll_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_sll_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(1, 2, 3, 4);
+ #[rustfmt::skip]
+ let b = i32x4::new(4, 3, 2, 1);
+ #[rustfmt::skip]
+ let r = i32x4::new(16, 16, 12, 8);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_sll_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_sll_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(1, 2);
+ #[rustfmt::skip]
+ let b = i64x2::new(4, 3);
+ #[rustfmt::skip]
+ let r = i64x2::new(16, 16);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_sll_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_slli_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 4, 8, 12, 16,
+ 4, 8, 12, 16,
+ 4, 8, 12, 16,
+ 4, 8, 12, 16
+ );
+
+ assert_eq!(r, mem::transmute(__msa_slli_b(mem::transmute(a), 2)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_slli_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ 1, 2, 3, 4,
+ 1, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let r = i16x8::new(4, 8, 12, 16, 4, 8, 12, 16);
+
+ assert_eq!(r, mem::transmute(__msa_slli_h(mem::transmute(a), 2)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_slli_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(1, 2, 3, 4);
+ #[rustfmt::skip]
+ let r = i32x4::new(4, 8, 12, 16);
+
+ assert_eq!(r, mem::transmute(__msa_slli_w(mem::transmute(a), 2)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_slli_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(1, 2);
+ #[rustfmt::skip]
+ let r = i64x2::new(2, 4);
+
+ assert_eq!(r, mem::transmute(__msa_slli_d(mem::transmute(a), 1)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_splat_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 4, 4, 4, 4,
+ 4, 4, 4, 4,
+ 4, 4, 4, 4,
+ 4, 4, 4, 4
+ );
+
+ assert_eq!(r, mem::transmute(__msa_splat_b(mem::transmute(a), 3)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_splat_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ );
+ #[rustfmt::skip]
+ let r = i16x8::new(4, 4, 4, 4, 4, 4, 4, 4);
+
+ assert_eq!(r, mem::transmute(__msa_splat_h(mem::transmute(a), 3)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_splat_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(1, 2, 3, 4);
+ #[rustfmt::skip]
+ let r = i32x4::new(4, 4, 4, 4);
+
+ assert_eq!(r, mem::transmute(__msa_splat_w(mem::transmute(a), 3)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_splat_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(1, 2);
+ #[rustfmt::skip]
+ let r = i64x2::new(2, 2);
+
+ assert_eq!(r, mem::transmute(__msa_splat_d(mem::transmute(a), 3)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_splati_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 3, 3, 3, 3,
+ 3, 3, 3, 3,
+ 3, 3, 3, 3,
+ 3, 3, 3, 3
+ );
+
+ assert_eq!(r, mem::transmute(__msa_splati_b(mem::transmute(a), 2)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_splati_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ );
+ #[rustfmt::skip]
+ let r = i16x8::new(3, 3, 3, 3, 3, 3, 3, 3);
+
+ assert_eq!(r, mem::transmute(__msa_splati_h(mem::transmute(a), 2)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_splati_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(1, 2, 3, 4);
+ #[rustfmt::skip]
+ let r = i32x4::new(3, 3, 3, 3);
+
+ assert_eq!(r, mem::transmute(__msa_splati_w(mem::transmute(a), 2)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_splati_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(1, 2);
+ #[rustfmt::skip]
+ let r = i64x2::new(2, 2);
+
+ assert_eq!(r, mem::transmute(__msa_splati_d(mem::transmute(a), 1)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_sra_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ -128, -64, -32, -16,
+ -8, -4, -2, -1,
+ 1, 2, 4, 8,
+ 16, 32, 64, 127
+ );
+ #[rustfmt::skip]
+ let b = i8x16::new(
+ 8, 7, 6, 5,
+ 4, 3, 2, 1,
+ 8, 7, 6, 5,
+ 4, 3, 2, 1
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ -128, -1, -1, -1,
+ -1, -1, -1, -1,
+ 1, 0, 0, 0,
+ 1, 4, 16, 63
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_sra_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_sra_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ -32768, -16384, -8192, -4096,
+ 1, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let b = i16x8::new(
+ 15, 14, 13, 12,
+ 12, 13, 14, 15
+ );
+ #[rustfmt::skip]
+ let r = i16x8::new(
+ -1, -1, -1, -1,
+ 0, 0, 0, 0
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_sra_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_sra_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(i32::MIN, -1073741824, 1, 2);
+ #[rustfmt::skip]
+ let b = i32x4::new(16, 15, 16, 15);
+ #[rustfmt::skip]
+ let r = i32x4::new(-32768, -32768, 0, 0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_sra_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_sra_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(i64::MIN, i64::MAX);
+ #[rustfmt::skip]
+ let b = i64x2::new(32, 31);
+ #[rustfmt::skip]
+ let r = i64x2::new(-2147483648, 4294967295);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_sra_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_srai_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ i8::MAX, 125, 55, 1,
+ i8::MAX, 125, 55, 1,
+ i8::MAX, 125, 55, 1,
+ i8::MAX, 125, 55, 1
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 31, 31, 13, 0,
+ 31, 31, 13, 0,
+ 31, 31, 13, 0,
+ 31, 31, 13, 0
+ );
+
+ assert_eq!(r, mem::transmute(__msa_srai_b(mem::transmute(a), 2)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_srai_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ i16::MAX, 125, 55, 1,
+ i16::MAX, 125, 55, 1
+ );
+ #[rustfmt::skip]
+ let r = i16x8::new(8191, 31, 13, 0, 8191, 31, 13, 0);
+
+ assert_eq!(r, mem::transmute(__msa_srai_h(mem::transmute(a), 2)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_srai_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(i32::MAX, 125, 55, 1);
+ let r = i32x4::new(536870911, 31, 13, 0);
+
+ assert_eq!(r, mem::transmute(__msa_srai_w(mem::transmute(a), 2)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_srai_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(i64::MAX, 55);
+ #[rustfmt::skip]
+ let r = i64x2::new(2305843009213693951, 13);
+
+ assert_eq!(r, mem::transmute(__msa_srai_d(mem::transmute(a), 2)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_srar_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ -128, -64, -32, -16,
+ -8, -4, -2, -1,
+ 1, 2, 4, 8,
+ 16, 32, 64, 127
+ );
+ #[rustfmt::skip]
+ let b = i8x16::new(
+ 4, 3, 2, 1,
+ 4, 3, 2, 1,
+ 8, 7, 6, 5,
+ 4, 3, 2, 1
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ -8, -8, -8, -8,
+ 0, 0, 0, 0,
+ 1, 0, 0, 0,
+ 1, 4, 16, 64
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_srar_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_srar_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ i16::MIN, -16384, -8192, -4096,
+ 150, 50, 25, 15
+ );
+ #[rustfmt::skip]
+ let b = i16x8::new(
+ 4, 3, 2, 1,
+ 1, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let r = i16x8::new(
+ -2048, -2048, -2048, -2048,
+ 75, 13, 3, 1
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_srar_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_srar_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(i32::MIN, -1073741824, 100, 50);
+ #[rustfmt::skip]
+ let b = i32x4::new(16, 15, 1, 2);
+ #[rustfmt::skip]
+ let r = i32x4::new(-32768, -32768, 50, 13);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_srar_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_srar_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(i64::MIN, i64::MAX);
+ #[rustfmt::skip]
+ let b = i64x2::new(32, 31);
+ #[rustfmt::skip]
+ let r = i64x2::new(-2147483648, 4294967296);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_srar_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_srari_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ 125, i8::MAX, 55, 1,
+ 125, i8::MAX, 55, 1,
+ 125, i8::MAX, 55, 1,
+ 125, i8::MAX, 55, 1
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 31, 32, 14, 0,
+ 31, 32, 14, 0,
+ 31, 32, 14, 0,
+ 31, 32, 14, 0
+ );
+
+ assert_eq!(r, mem::transmute(__msa_srari_b(mem::transmute(a), 2)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_srari_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(2155, 1155, 155, 1, 2155, 1155, 155, 1);
+ #[rustfmt::skip]
+ let r = i16x8::new(539, 289, 39, 0, 539, 289, 39, 0);
+
+ assert_eq!(r, mem::transmute(__msa_srari_h(mem::transmute(a), 2)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_srari_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(211111155, 111111155, 11111155, 1);
+ #[rustfmt::skip]
+ let r = i32x4::new(52777789, 27777789, 2777789, 0);
+
+ assert_eq!(r, mem::transmute(__msa_srari_w(mem::transmute(a), 2)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_srari_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(211111111155, 111111111155);
+ #[rustfmt::skip]
+ let r = i64x2::new(52777777789, 27777777789);
+
+ assert_eq!(r, mem::transmute(__msa_srari_d(mem::transmute(a), 2)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_srl_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ -128, -64, -32, -16,
+ -8, -4, -2, -1,
+ 1, 2, 4, 8,
+ 16, 32, 64, 127
+ );
+ #[rustfmt::skip]
+ let b = i8x16::new(
+ 8, 7, 6, 5,
+ 4, 3, 2, 1,
+ 8, 7, 6, 5,
+ 4, 3, 2, 1
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ -128, 1, 3, 7,
+ 15, 31, 63, 127,
+ 1, 0, 0, 0,
+ 1, 4, 16, 63
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_srl_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_srl_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ -32768, -16384, -8192, -4096,
+ 1, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let b = i16x8::new(
+ 15, 14, 13, 12,
+ 4, 3, 2, 1
+ );
+ #[rustfmt::skip]
+ let r = i16x8::new(1, 3, 7, 15, 0, 0, 0, 2);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_srl_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_srl_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(i32::MIN, -1073741824, 1, 2);
+ #[rustfmt::skip]
+ let b = i32x4::new(16, 15, 16, 15);
+ #[rustfmt::skip]
+ let r = i32x4::new(32768, 98304, 0, 0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_srl_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_srl_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(i64::MIN, i64::MAX);
+ #[rustfmt::skip]
+ let b = i64x2::new(32, 31);
+ #[rustfmt::skip]
+ let r = i64x2::new(2147483648, 4294967295);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_srl_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_srli_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ 25, 50, 100, 127,
+ 25, 50, 100, 127,
+ 25, 50, 100, 127,
+ 25, 50, 100, 127
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 6, 12, 25, 31,
+ 6, 12, 25, 31,
+ 6, 12, 25, 31,
+ 6, 12, 25, 31
+ );
+
+ assert_eq!(r, mem::transmute(__msa_srli_b(mem::transmute(a), 2)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_srli_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ i16::MAX, 3276, 100, 127,
+ i16::MAX, 3276, 100, 127
+ );
+ #[rustfmt::skip]
+ let r = i16x8::new(
+ 8191, 819, 25, 31,
+ 8191, 819, 25, 31
+ );
+
+ assert_eq!(r, mem::transmute(__msa_srli_h(mem::transmute(a), 2)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_srli_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(100, i32::MAX, 100, i32::MAX);
+ #[rustfmt::skip]
+ let r = i32x4::new(25, 536870911, 25, 536870911);
+
+ assert_eq!(r, mem::transmute(__msa_srli_w(mem::transmute(a), 2)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_srli_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(100, i64::MAX);
+ #[rustfmt::skip]
+ let r = i64x2::new(50, 4611686018427387903);
+
+ assert_eq!(r, mem::transmute(__msa_srli_d(mem::transmute(a), 1)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_srlr_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ -128, -64, -32, -16,
+ -8, -4, -2, -1,
+ 1, 2, 4, 8,
+ 16, 32, 64, 127
+ );
+ #[rustfmt::skip]
+ let b = i8x16::new(
+ 8, 7, 6, 5,
+ 4, 3, 2, 1,
+ 8, 7, 6, 5,
+ 4, 3, 2, 1
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ -128, 2, 4, 8,
+ 16, 32, 64, -128,
+ 1, 0, 0, 0,
+ 1, 4, 16, 64
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_srlr_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_srlr_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ -32768, -16384, -8192, -4096,
+ 1, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let b = i16x8::new(
+ 15, 14, 13, 12,
+ 4, 3, 2, 1
+ );
+ #[rustfmt::skip]
+ let r = i16x8::new(1, 3, 7, 15, 0, 0, 1, 2);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_srlr_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_srlr_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(i32::MIN, -1073741824, 1, 2);
+ #[rustfmt::skip]
+ let b = i32x4::new(16, 15, 16, 15);
+ let r = i32x4::new(32768, 98304, 0, 0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_srlr_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_srlr_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(i64::MIN, i64::MAX);
+ #[rustfmt::skip]
+ let b = i64x2::new(32, 31);
+ #[rustfmt::skip]
+ let r = i64x2::new(2147483648, 4294967296);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_srlr_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_srlri_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ 25, 50, 100, i8::MAX,
+ 25, 50, 100, i8::MAX,
+ 25, 50, 100, i8::MAX,
+ 25, 50, 100, i8::MAX
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 6, 13, 25, 32,
+ 6, 13, 25, 32,
+ 6, 13, 25, 32,
+ 6, 13, 25, 32
+ );
+
+ assert_eq!(r, mem::transmute(__msa_srlri_b(mem::transmute(a), 2)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_srlri_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ i16::MAX, 3276, 100, 127,
+ i16::MAX, 3276, 100, 127
+ );
+ let r = i16x8::new(8192, 819, 25, 32, 8192, 819, 25, 32);
+
+ assert_eq!(r, mem::transmute(__msa_srlri_h(mem::transmute(a), 2)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_srlri_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(100, 150, 200, i32::MAX);
+ #[rustfmt::skip]
+ let r = i32x4::new(25, 38, 50, 536870912);
+
+ assert_eq!(r, mem::transmute(__msa_srlri_w(mem::transmute(a), 2)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_srlri_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(100, i64::MAX);
+ #[rustfmt::skip]
+ let r = i64x2::new(50, 4611686018427387904);
+
+ assert_eq!(r, mem::transmute(__msa_srlri_d(mem::transmute(a), 1)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_st_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ 13, 14, 15, 16,
+ 17, 18, 19, 20,
+ 21, 22, 23, 24,
+ 25, 26, 27, 28
+ );
+ #[rustfmt::skip]
+ let mut arr : [i8; 16] = [
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0
+ ];
+ #[rustfmt::skip]
+ let r : [i8; 16] = [
+ 13, 14, 15, 16,
+ 17, 18, 19, 20,
+ 21, 22, 23, 24,
+ 25, 26, 27, 28
+ ];
+ __msa_st_b(mem::transmute(a), arr.as_mut_ptr() as *mut u8, 0);
+ assert_eq!(arr, r);
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_st_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(13, 14, 15, 16, 17, 18, 19, 20);
+ let mut arr: [i16; 8] = [0, 0, 0, 0, 0, 0, 0, 0];
+ #[rustfmt::skip]
+ let r : [i16; 8] = [13, 14, 15, 16, 17, 18, 19, 20];
+ __msa_st_h(mem::transmute(a), arr.as_mut_ptr() as *mut u8, 0);
+ assert_eq!(arr, r);
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_st_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(13, 14, 15, 16);
+ let mut arr: [i32; 4] = [0, 0, 0, 0];
+ #[rustfmt::skip]
+ let r : [i32; 4] = [13, 14, 15, 16];
+ __msa_st_w(mem::transmute(a), arr.as_mut_ptr() as *mut u8, 0);
+ assert_eq!(arr, r);
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_st_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(13, 14);
+ let mut arr: [i64; 2] = [0, 0];
+ #[rustfmt::skip]
+ let r : [i64; 2] = [13, 14];
+ __msa_st_d(mem::transmute(a), arr.as_mut_ptr() as *mut u8, 0);
+ assert_eq!(arr, r);
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_subs_s_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ i8::MIN, -2, -3, -4,
+ i8::MIN, -2, -3, -4,
+ i8::MIN, -2, -3, -4,
+ i8::MIN, -2, -3, -4
+ );
+ #[rustfmt::skip]
+ let b = i8x16::new(
+ 6, -7, 8, -9,
+ 6, -7, 8, -9,
+ 6, -7, 8, -9,
+ 6, -7, 8, -9
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ i8::MIN, 5, -11, 5,
+ i8::MIN, 5, -11, 5,
+ i8::MIN, 5, -11, 5,
+ i8::MIN, 5, -11, 5
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_subs_s_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_subs_s_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ i16::MIN, -2, -3, -4,
+ i16::MIN, -2, -3, -4
+ );
+ #[rustfmt::skip]
+ let b = i16x8::new(6, -7, 8, -9, 6, -7, 8, -9);
+ #[rustfmt::skip]
+ let r = i16x8::new(
+ i16::MIN, 5, -11, 5,
+ i16::MIN, 5, -11, 5
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_subs_s_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_subs_s_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(i32::MIN, -2, -3, -4);
+ #[rustfmt::skip]
+ let b = i32x4::new(6, -7, 8, -9);
+ #[rustfmt::skip]
+ let r = i32x4::new(i32::MIN, 5, -11, 5);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_subs_s_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_subs_s_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(i64::MIN, -2);
+ #[rustfmt::skip]
+ let b = i64x2::new(6, -7);
+ #[rustfmt::skip]
+ let r = i64x2::new(i64::MIN, 5);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_subs_s_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_subs_u_b() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ u8::MAX, 2, 3, 4,
+ u8::MAX, 2, 3, 4,
+ u8::MAX, 2, 3, 4,
+ u8::MAX, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let b = u8x16::new(
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9,
+ 6, 7, 8, 9
+ );
+ #[rustfmt::skip]
+ let r = u8x16::new(
+ 249, 0, 0, 0,
+ 249, 0, 0, 0,
+ 249, 0, 0, 0,
+ 249, 0, 0, 0
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_subs_u_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_subs_u_h() {
+ #[rustfmt::skip]
+ let a = u16x8::new(
+ u16::MAX, 2, 3, 4,
+ u16::MAX, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let b = u16x8::new(6, 7, 8, 9, 6, 7, 8, 9);
+ #[rustfmt::skip]
+ let r = u16x8::new(65529, 0, 0, 0, 65529, 0, 0, 0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_subs_u_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_subs_u_w() {
+ #[rustfmt::skip]
+ let a = u32x4::new(u32::MAX, 2, 3, 4);
+ #[rustfmt::skip]
+ let b = u32x4::new(6, 7, 8, 9);
+ #[rustfmt::skip]
+ let r = u32x4::new(4294967289, 0, 0, 0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_subs_u_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_subs_u_d() {
+ #[rustfmt::skip]
+ let a = u64x2::new(u64::MAX, 2);
+ #[rustfmt::skip]
+ let b = u64x2::new(6, 7);
+ #[rustfmt::skip]
+ let r = u64x2::new(18446744073709551609, 0);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_subs_u_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_subsus_u_b() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ u8::MAX, 2, 3, 4,
+ u8::MAX, 2, 3, 4,
+ u8::MAX, 2, 3, 4,
+ u8::MAX, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let b = i8x16::new(
+ -6, -7, -8, -9,
+ -6, -7, -8, -9,
+ -6, -7, -8, -9,
+ -6, -7, -8, -9
+ );
+ #[rustfmt::skip]
+ let r = u8x16::new(
+ 255, 9, 11, 13,
+ 255, 9, 11, 13,
+ 255, 9, 11, 13,
+ 255, 9, 11, 13
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_subsus_u_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_subsus_u_h() {
+ #[rustfmt::skip]
+ let a = u16x8::new(
+ u16::MAX, 2, 3, 4,
+ u16::MAX, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let b = i16x8::new(-6, -7, -8, -9, -6, -7, -8, -9);
+ #[rustfmt::skip]
+ let r = u16x8::new(65535, 9, 11, 13, 65535, 9, 11, 13);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_subsus_u_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_subsus_u_w() {
+ #[rustfmt::skip]
+ let a = u32x4::new(u32::MAX, 2, 3, 4);
+ #[rustfmt::skip]
+ let b = i32x4::new(-6, -7, -8, -9);
+ #[rustfmt::skip]
+ let r = u32x4::new(4294967295, 9, 11, 13);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_subsus_u_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_subsus_u_d() {
+ #[rustfmt::skip]
+ let a = u64x2::new(u64::MAX, 2);
+ #[rustfmt::skip]
+ let b = i64x2::new(-6, -7);
+ #[rustfmt::skip]
+ let r = u64x2::new(18446744073709551615, 9);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_subsus_u_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_subsuu_s_b() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ u8::MAX, 2, 3, 4,
+ u8::MAX, 2, 3, 4,
+ u8::MAX, 2, 3, 4,
+ u8::MAX, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let b = u8x16::new(
+ 6, 7, 8, u8::MAX,
+ 6, 7, 8, u8::MAX,
+ 6, 7, 8, u8::MAX,
+ 6, 7, 8, u8::MAX
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 127, -5, -5, -128,
+ 127, -5, -5, -128,
+ 127, -5, -5, -128,
+ 127, -5, -5, -128
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_subsuu_s_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_subsuu_s_h() {
+ #[rustfmt::skip]
+ let a = u16x8::new(
+ u16::MAX, 2, 3,
+ 4, u16::MAX, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let b = u16x8::new(6, 7, 8, 65535, 6, 7, 8, 65535);
+ #[rustfmt::skip]
+ let r = i16x8::new(32767, -5, -5, -32768, 32767, -5, -5, -32768);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_subsuu_s_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_subsuu_s_w() {
+ #[rustfmt::skip]
+ let a = u32x4::new(u32::MAX, 2, 3, 4);
+ #[rustfmt::skip]
+ let b = u32x4::new(6, 7, 8, 4294967295);
+ #[rustfmt::skip]
+ let r = i32x4::new(2147483647, -5, -5, -2147483648);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_subsuu_s_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_subsuu_s_d() {
+ #[rustfmt::skip]
+ let a = u64x2::new(u64::MAX, 2);
+ #[rustfmt::skip]
+ let b = u64x2::new(6, 7);
+ #[rustfmt::skip]
+ let r = i64x2::new(i64::MAX, -5);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_subsuu_s_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_subv_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ i8::MIN, -2, -3, -4,
+ i8::MIN, -2, -3, -4,
+ i8::MIN, -2, -3, -4,
+ i8::MIN, -2, -3, -4
+ );
+ #[rustfmt::skip]
+ let b = i8x16::new(
+ 6, -7, 8, -9,
+ 6, -7, 8, -9,
+ 6, -7, 8, -9,
+ 6, -7, 8, -9
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 122, 5, -11, 5,
+ 122, 5, -11, 5,
+ 122, 5, -11, 5,
+ 122, 5, -11, 5
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_subv_b(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_subv_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ i16::MIN, -2, -3, -4,
+ i16::MIN, -2, -3, -4
+ );
+ #[rustfmt::skip]
+ let b = i16x8::new(6, -7, 8, -9, 6, -7, 8, -9);
+ #[rustfmt::skip]
+ let r = i16x8::new(32762, 5, -11, 5, 32762, 5, -11, 5);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_subv_h(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_subv_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(i32::MIN, -2, -3, -4);
+ #[rustfmt::skip]
+ let b = i32x4::new(6, -7, 8, -9);
+ #[rustfmt::skip]
+ let r = i32x4::new(2147483642, 5, -11, 5);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_subv_w(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_subv_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(i64::MAX, -2);
+ #[rustfmt::skip]
+ let b = i64x2::new(6, -7);
+ #[rustfmt::skip]
+ let r = i64x2::new(9223372036854775801, 5);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_subv_d(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_subvi_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ 100, i8::MAX, 50, i8::MIN,
+ 100, i8::MAX, 50, i8::MIN,
+ 100, i8::MAX, 50, i8::MIN,
+ 100, i8::MAX, 50, i8::MIN
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 95, 122, 45, 123,
+ 95, 122, 45, 123,
+ 95, 122, 45, 123,
+ 95, 122, 45, 123
+ );
+
+ assert_eq!(r, mem::transmute(__msa_subvi_b(mem::transmute(a), 5)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_subvi_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ i16::MAX, 3276, -100, i16::MIN,
+ i16::MAX, 3276, -100, i16::MIN
+ );
+ #[rustfmt::skip]
+ let r = i16x8::new(
+ 32762, 3271, -105, 32763,
+ 32762, 3271, -105, 32763
+ );
+
+ assert_eq!(r, mem::transmute(__msa_subvi_h(mem::transmute(a), 5)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_subvi_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(100, 150, 200, i32::MAX);
+ #[rustfmt::skip]
+ let r = i32x4::new(95, 145, 195, 2147483642);
+
+ assert_eq!(r, mem::transmute(__msa_subvi_w(mem::transmute(a), 5)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_subvi_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(100, i64::MAX);
+ #[rustfmt::skip]
+ let r = i64x2::new(95, 9223372036854775802);
+
+ assert_eq!(r, mem::transmute(__msa_subvi_d(mem::transmute(a), 5)));
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_vshf_b() {
+ #[rustfmt::skip]
+ let a = i8x16::new(
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4,
+ 1, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let b = i8x16::new(
+ 4, 3, 2, 1,
+ 4, 3, 2, 1,
+ 4, 3, 2, 1,
+ 4, 3, 2, 1
+ );
+ #[rustfmt::skip]
+ let c = i8x16::new(
+ 4, 3, 2, 1,
+ 4, 3, 2, 1,
+ 4, 3, 2, 1,
+ 4, 3, 2, 1
+ );
+ #[rustfmt::skip]
+ let r = i8x16::new(
+ 3, 2, 1, 4,
+ 3, 2, 1, 4,
+ 3, 2, 1, 4,
+ 3, 2, 1, 4
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_vshf_b(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_vshf_h() {
+ #[rustfmt::skip]
+ let a = i16x8::new(
+ 1, 2, 3, 4,
+ 1, 2, 3, 4
+ );
+ #[rustfmt::skip]
+ let b = i16x8::new(
+ 4, 3, 2, 1,
+ 4, 3, 2, 1
+ );
+ #[rustfmt::skip]
+ let c = i16x8::new(
+ 4, 3, 2, 1,
+ 4, 3, 2, 1
+ );
+ let r = i16x8::new(3, 2, 1, 4, 3, 2, 1, 4);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_vshf_h(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_vshf_w() {
+ #[rustfmt::skip]
+ let a = i32x4::new(1, 2, 3, 4);
+ #[rustfmt::skip]
+ let b = i32x4::new(4, 3, 2, 1);
+ #[rustfmt::skip]
+ let c = i32x4::new(4, 3, 2, 1);
+ #[rustfmt::skip]
+ let r = i32x4::new(3, 2, 1, 4);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_vshf_w(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_vshf_d() {
+ #[rustfmt::skip]
+ let a = i64x2::new(1, 2);
+ #[rustfmt::skip]
+ let b = i64x2::new(4, 3);
+ #[rustfmt::skip]
+ let c = i64x2::new(4, 3);
+ #[rustfmt::skip]
+ let r = i64x2::new(3, 4);
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_vshf_d(
+ mem::transmute(a),
+ mem::transmute(b),
+ mem::transmute(c)
+ ))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_xor_v() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ 1, 2, 3, 4,
+ 5, 6, 7, 8,
+ 9, 10, 11, 12,
+ 13, 14, 15, 16
+ );
+ #[rustfmt::skip]
+ let b = u8x16::new(
+ 16, 15, 14, 13,
+ 12, 11, 10, 9,
+ 8, 7, 6, 5,
+ 4, 3, 2, 1
+ );
+ #[rustfmt::skip]
+ let r = u8x16::new(
+ 17, 13, 13, 9,
+ 9, 13, 13, 1,
+ 1, 13, 13, 9,
+ 9, 13, 13, 17
+ );
+
+ assert_eq!(
+ r,
+ mem::transmute(__msa_xor_v(mem::transmute(a), mem::transmute(b)))
+ );
+ }
+
+ #[simd_test(enable = "msa")]
+ unsafe fn test_msa_xori_b() {
+ #[rustfmt::skip]
+ let a = u8x16::new(
+ 1, 2, 3, 4,
+ 5, 6, 7, 8,
+ 9, 10, 11, 12,
+ 13, 14, 15, 16
+ );
+ #[rustfmt::skip]
+ let r = u8x16::new(
+ 5, 6, 7, 0,
+ 1, 2, 3, 12,
+ 13, 14, 15, 8,
+ 9, 10, 11, 20
+ );
+
+ assert_eq!(r, mem::transmute(__msa_xori_b(mem::transmute(a), 4)));
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/mips/msa/macros.rs b/library/stdarch/crates/core_arch/src/mips/msa/macros.rs
new file mode 100644
index 000000000..de8905840
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/mips/msa/macros.rs
@@ -0,0 +1,31 @@
+//! Utility macros.
+
+macro_rules! static_assert_imm_s5 {
+ ($imm:ident) => {
+ let _ = $crate::core_arch::macros::ValidateConstImm::<$imm, -16, 15>::VALID;
+ };
+}
+
+macro_rules! static_assert_imm_s10 {
+ ($imm:ident) => {
+ let _ = $crate::core_arch::macros::ValidateConstImm::<$imm, -512, 511>::VALID;
+ };
+}
+
+macro_rules! static_assert_imm_s11 {
+ ($imm:ident) => {
+ let _ = $crate::core_arch::macros::ValidateConstImm::<$imm, -1024, 1023>::VALID;
+ };
+}
+
+macro_rules! static_assert_imm_s12 {
+ ($imm:ident) => {
+ let _ = $crate::core_arch::macros::ValidateConstImm::<$imm, -2048, 2047>::VALID;
+ };
+}
+
+macro_rules! static_assert_imm_s13 {
+ ($imm:ident) => {
+ let _ = $crate::core_arch::macros::ValidateConstImm::<$imm, -4096, 4095>::VALID;
+ };
+}
diff --git a/library/stdarch/crates/core_arch/src/mod.rs b/library/stdarch/crates/core_arch/src/mod.rs
new file mode 100644
index 000000000..20751eeec
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/mod.rs
@@ -0,0 +1,305 @@
+//! `core_arch`
+
+#[macro_use]
+mod macros;
+
+#[cfg(any(target_arch = "arm", target_arch = "aarch64", doc))]
+mod arm_shared;
+
+mod simd;
+
+#[doc = include_str!("core_arch_docs.md")]
+#[stable(feature = "simd_arch", since = "1.27.0")]
+pub mod arch {
+ /// Platform-specific intrinsics for the `x86` platform.
+ ///
+ /// See the [module documentation](../index.html) for more details.
+ #[cfg(any(target_arch = "x86", doc))]
+ #[doc(cfg(target_arch = "x86"))]
+ #[stable(feature = "simd_x86", since = "1.27.0")]
+ pub mod x86 {
+ #[stable(feature = "simd_x86", since = "1.27.0")]
+ pub use crate::core_arch::x86::*;
+ }
+
+ /// Platform-specific intrinsics for the `x86_64` platform.
+ ///
+ /// See the [module documentation](../index.html) for more details.
+ #[cfg(any(target_arch = "x86_64", doc))]
+ #[doc(cfg(target_arch = "x86_64"))]
+ #[stable(feature = "simd_x86", since = "1.27.0")]
+ pub mod x86_64 {
+ #[stable(feature = "simd_x86", since = "1.27.0")]
+ pub use crate::core_arch::x86::*;
+ #[stable(feature = "simd_x86", since = "1.27.0")]
+ pub use crate::core_arch::x86_64::*;
+ }
+
+ /// Platform-specific intrinsics for the `arm` platform.
+ ///
+ /// See the [module documentation](../index.html) for more details.
+ #[cfg(any(target_arch = "arm", doc))]
+ #[doc(cfg(target_arch = "arm"))]
+ #[unstable(feature = "stdsimd", issue = "27731")]
+ pub mod arm {
+ pub use crate::core_arch::arm::*;
+ }
+
+ /// Platform-specific intrinsics for the `aarch64` platform.
+ ///
+ /// See the [module documentation](../index.html) for more details.
+ #[cfg(any(target_arch = "aarch64", doc))]
+ #[doc(cfg(target_arch = "aarch64"))]
+ #[stable(feature = "neon_intrinsics", since = "1.59.0")]
+ pub mod aarch64 {
+ #[stable(feature = "neon_intrinsics", since = "1.59.0")]
+ pub use crate::core_arch::aarch64::*;
+ }
+
+ /// Platform-specific intrinsics for the `riscv32` platform.
+ ///
+ /// See the [module documentation](../index.html) for more details.
+ #[cfg(any(target_arch = "riscv32", doc))]
+ #[doc(cfg(any(target_arch = "riscv32")))]
+ #[unstable(feature = "stdsimd", issue = "27731")]
+ pub mod riscv32 {
+ pub use crate::core_arch::riscv_shared::*;
+ }
+
+ /// Platform-specific intrinsics for the `riscv64` platform.
+ ///
+ /// See the [module documentation](../index.html) for more details.
+ #[cfg(any(target_arch = "riscv64", doc))]
+ #[doc(cfg(any(target_arch = "riscv64")))]
+ #[unstable(feature = "stdsimd", issue = "27731")]
+ pub mod riscv64 {
+ pub use crate::core_arch::riscv64::*;
+ // RISC-V RV64 supports all RV32 instructions as well in current specifications (2022-01-05).
+ // Module `riscv_shared` includes instructions available under all RISC-V platforms,
+ // i.e. RISC-V RV32 instructions.
+ pub use crate::core_arch::riscv_shared::*;
+ }
+
+ /// Platform-specific intrinsics for the `wasm32` platform.
+ ///
+ /// This module provides intrinsics specific to the WebAssembly
+ /// architecture. Here you'll find intrinsics specific to WebAssembly that
+ /// aren't otherwise surfaced somewhere in a cross-platform abstraction of
+ /// `std`, and you'll also find functions for leveraging WebAssembly
+ /// proposals such as [atomics] and [simd].
+ ///
+ /// Intrinsics in the `wasm32` module are modeled after the WebAssembly
+ /// instructions that they represent. Most functions are named after the
+ /// instruction they intend to correspond to, and the arguments/results
+ /// correspond to the type signature of the instruction itself. Stable
+ /// WebAssembly instructions are [documented online][instrdoc].
+ ///
+ /// [instrdoc]: https://webassembly.github.io/spec/core/valid/instructions.html
+ ///
+ /// If a proposal is not yet stable in WebAssembly itself then the functions
+ /// within this function may be unstable and require the nightly channel of
+ /// Rust to use. As the proposal itself stabilizes the intrinsics in this
+ /// module should stabilize as well.
+ ///
+ /// [atomics]: https://github.com/webassembly/threads
+ /// [simd]: https://github.com/webassembly/simd
+ ///
+ /// See the [module documentation](../index.html) for general information
+ /// about the `arch` module and platform intrinsics.
+ ///
+ /// ## Atomics
+ ///
+ /// The [threads proposal][atomics] for WebAssembly adds a number of
+ /// instructions for dealing with multithreaded programs. Most instructions
+ /// added in the [atomics] proposal are exposed in Rust through the
+ /// `std::sync::atomic` module. Some instructions, however, don't have
+ /// direct equivalents in Rust so they're exposed here instead.
+ ///
+ /// Note that the instructions added in the [atomics] proposal can work in
+ /// either a context with a shared wasm memory and without. These intrinsics
+ /// are always available in the standard library, but you likely won't be
+ /// able to use them too productively unless you recompile the standard
+ /// library (and all your code) with `-Ctarget-feature=+atomics`.
+ ///
+ /// It's also worth pointing out that multi-threaded WebAssembly and its
+ /// story in Rust is still in a somewhat "early days" phase as of the time
+ /// of this writing. Pieces should mostly work but it generally requires a
+ /// good deal of manual setup. At this time it's not as simple as "just call
+ /// `std::thread::spawn`", but it will hopefully get there one day!
+ ///
+ /// ## SIMD
+ ///
+ /// The [simd proposal][simd] for WebAssembly added a new `v128` type for a
+ /// 128-bit SIMD register. It also added a large array of instructions to
+ /// operate on the `v128` type to perform data processing. Using SIMD on
+ /// wasm is intended to be similar to as you would on `x86_64`, for example.
+ /// You'd write a function such as:
+ ///
+ /// ```rust,ignore
+ /// #[cfg(target_arch = "wasm32")]
+ /// #[target_feature(enable = "simd128")]
+ /// unsafe fn uses_simd() {
+ /// use std::arch::wasm32::*;
+ /// // ...
+ /// }
+ /// ```
+ ///
+ /// Unlike `x86_64`, however, WebAssembly does not currently have dynamic
+ /// detection at runtime as to whether SIMD is supported (this is one of the
+ /// motivators for the [conditional sections][condsections] and [feature
+ /// detection] proposals, but that is still pretty early days). This means
+ /// that your binary will either have SIMD and can only run on engines
+ /// which support SIMD, or it will not have SIMD at all. For compatibility
+ /// the standard library itself does not use any SIMD internally.
+ /// Determining how best to ship your WebAssembly binary with SIMD is
+ /// largely left up to you as it can can be pretty nuanced depending on
+ /// your situation.
+ ///
+ /// [condsections]: https://github.com/webassembly/conditional-sections
+ /// [feature detection]: https://github.com/WebAssembly/feature-detection
+ ///
+ /// To enable SIMD support at compile time you need to do one of two things:
+ ///
+ /// * First you can annotate functions with `#[target_feature(enable =
+ /// "simd128")]`. This causes just that one function to have SIMD support
+ /// available to it, and intrinsics will get inlined as usual in this
+ /// situation.
+ ///
+ /// * Second you can compile your program with `-Ctarget-feature=+simd128`.
+ /// This compilation flag blanket enables SIMD support for your entire
+ /// compilation. Note that this does not include the standard library
+ /// unless you [recompile the standard library][buildstd].
+ ///
+ /// [buildstd]: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#build-std
+ ///
+ /// If you enable SIMD via either of these routes then you'll have a
+ /// WebAssembly binary that uses SIMD instructions, and you'll need to ship
+ /// that accordingly. Also note that if you call SIMD intrinsics but don't
+ /// enable SIMD via either of these mechanisms, you'll still have SIMD
+ /// generated in your program. This means to generate a binary without SIMD
+ /// you'll need to avoid both options above plus calling into any intrinsics
+ /// in this module.
+ #[cfg(any(target_arch = "wasm32", doc))]
+ #[doc(cfg(target_arch = "wasm32"))]
+ #[stable(feature = "simd_wasm32", since = "1.33.0")]
+ pub mod wasm32 {
+ #[stable(feature = "simd_wasm32", since = "1.33.0")]
+ pub use crate::core_arch::wasm32::*;
+ }
+
+ /// Platform-specific intrinsics for the `wasm64` platform.
+ ///
+ /// See the [module documentation](../index.html) for more details.
+ #[cfg(any(target_arch = "wasm64", doc))]
+ #[doc(cfg(target_arch = "wasm64"))]
+ #[unstable(feature = "simd_wasm64", issue = "90599")]
+ pub mod wasm64 {
+ #[unstable(feature = "simd_wasm64", issue = "90599")]
+ pub use crate::core_arch::wasm32::*;
+ }
+
+ /// Platform-specific intrinsics for the `wasm` target family.
+ ///
+ /// See the [module documentation](../index.html) for more details.
+ #[cfg(any(target_family = "wasm", doc))]
+ #[doc(cfg(target_family = "wasm"))]
+ #[unstable(feature = "simd_wasm64", issue = "90599")]
+ pub mod wasm {
+ #[unstable(feature = "simd_wasm64", issue = "90599")]
+ pub use crate::core_arch::wasm32::*;
+ }
+
+ /// Platform-specific intrinsics for the `mips` platform.
+ ///
+ /// See the [module documentation](../index.html) for more details.
+ #[cfg(any(target_arch = "mips", doc))]
+ #[doc(cfg(target_arch = "mips"))]
+ #[unstable(feature = "stdsimd", issue = "27731")]
+ pub mod mips {
+ pub use crate::core_arch::mips::*;
+ }
+
+ /// Platform-specific intrinsics for the `mips64` platform.
+ ///
+ /// See the [module documentation](../index.html) for more details.
+ #[cfg(any(target_arch = "mips64", doc))]
+ #[doc(cfg(target_arch = "mips64"))]
+ #[unstable(feature = "stdsimd", issue = "27731")]
+ pub mod mips64 {
+ pub use crate::core_arch::mips::*;
+ }
+
+ /// Platform-specific intrinsics for the `PowerPC` platform.
+ ///
+ /// See the [module documentation](../index.html) for more details.
+ #[cfg(any(target_arch = "powerpc", doc))]
+ #[doc(cfg(target_arch = "powerpc"))]
+ #[unstable(feature = "stdsimd", issue = "27731")]
+ pub mod powerpc {
+ pub use crate::core_arch::powerpc::*;
+ }
+
+ /// Platform-specific intrinsics for the `PowerPC64` platform.
+ ///
+ /// See the [module documentation](../index.html) for more details.
+ #[cfg(any(target_arch = "powerpc64", doc))]
+ #[doc(cfg(target_arch = "powerpc64"))]
+ #[unstable(feature = "stdsimd", issue = "27731")]
+ pub mod powerpc64 {
+ pub use crate::core_arch::powerpc64::*;
+ }
+
+ /// Platform-specific intrinsics for the `NVPTX` platform.
+ ///
+ /// See the [module documentation](../index.html) for more details.
+ #[cfg(any(target_arch = "nvptx", target_arch = "nvptx64", doc))]
+ #[doc(cfg(any(target_arch = "nvptx", target_arch = "nvptx64")))]
+ #[unstable(feature = "stdsimd", issue = "27731")]
+ pub mod nvptx {
+ pub use crate::core_arch::nvptx::*;
+ }
+}
+
+mod simd_llvm;
+
+#[cfg(any(target_arch = "x86", target_arch = "x86_64", doc))]
+#[doc(cfg(any(target_arch = "x86", target_arch = "x86_64")))]
+mod x86;
+#[cfg(any(target_arch = "x86_64", doc))]
+#[doc(cfg(target_arch = "x86_64"))]
+mod x86_64;
+
+#[cfg(any(target_arch = "aarch64", doc))]
+#[doc(cfg(target_arch = "aarch64"))]
+mod aarch64;
+#[cfg(any(target_arch = "arm", doc))]
+#[doc(cfg(any(target_arch = "arm")))]
+mod arm;
+
+#[cfg(any(target_arch = "riscv32", target_arch = "riscv64", doc))]
+#[doc(cfg(any(target_arch = "riscv32", target_arch = "riscv64")))]
+mod riscv_shared;
+
+#[cfg(any(target_arch = "riscv64", doc))]
+#[doc(cfg(any(target_arch = "riscv64")))]
+mod riscv64;
+
+#[cfg(any(target_family = "wasm", doc))]
+#[doc(cfg(target_family = "wasm"))]
+mod wasm32;
+
+#[cfg(any(target_arch = "mips", target_arch = "mips64", doc))]
+#[doc(cfg(any(target_arch = "mips", target_arch = "mips64")))]
+mod mips;
+
+#[cfg(any(target_arch = "powerpc", target_arch = "powerpc64", doc))]
+#[doc(cfg(any(target_arch = "powerpc", target_arch = "powerpc64")))]
+mod powerpc;
+
+#[cfg(any(target_arch = "powerpc64", doc))]
+#[doc(cfg(target_arch = "powerpc64"))]
+mod powerpc64;
+
+#[cfg(any(target_arch = "nvptx", target_arch = "nvptx64", doc))]
+#[doc(cfg(any(target_arch = "nvptx", target_arch = "nvptx64")))]
+mod nvptx;
diff --git a/library/stdarch/crates/core_arch/src/nvptx/mod.rs b/library/stdarch/crates/core_arch/src/nvptx/mod.rs
new file mode 100644
index 000000000..bf6673f47
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/nvptx/mod.rs
@@ -0,0 +1,213 @@
+//! NVPTX intrinsics (experimental)
+//!
+//! These intrinsics form the foundation of the CUDA
+//! programming model.
+//!
+//! The reference is the [CUDA C Programming Guide][cuda_c]. Relevant is also
+//! the [LLVM NVPTX Backend documentation][llvm_docs].
+//!
+//! [cuda_c]:
+//! http://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html
+//! [llvm_docs]:
+//! https://llvm.org/docs/NVPTXUsage.html
+
+use crate::ffi::c_void;
+
+#[allow(improper_ctypes)]
+extern "C" {
+ #[link_name = "llvm.nvvm.barrier0"]
+ fn syncthreads() -> ();
+ #[link_name = "llvm.nvvm.read.ptx.sreg.ntid.x"]
+ fn block_dim_x() -> i32;
+ #[link_name = "llvm.nvvm.read.ptx.sreg.ntid.y"]
+ fn block_dim_y() -> i32;
+ #[link_name = "llvm.nvvm.read.ptx.sreg.ntid.z"]
+ fn block_dim_z() -> i32;
+ #[link_name = "llvm.nvvm.read.ptx.sreg.ctaid.x"]
+ fn block_idx_x() -> i32;
+ #[link_name = "llvm.nvvm.read.ptx.sreg.ctaid.y"]
+ fn block_idx_y() -> i32;
+ #[link_name = "llvm.nvvm.read.ptx.sreg.ctaid.z"]
+ fn block_idx_z() -> i32;
+ #[link_name = "llvm.nvvm.read.ptx.sreg.nctaid.x"]
+ fn grid_dim_x() -> i32;
+ #[link_name = "llvm.nvvm.read.ptx.sreg.nctaid.y"]
+ fn grid_dim_y() -> i32;
+ #[link_name = "llvm.nvvm.read.ptx.sreg.nctaid.z"]
+ fn grid_dim_z() -> i32;
+ #[link_name = "llvm.nvvm.read.ptx.sreg.tid.x"]
+ fn thread_idx_x() -> i32;
+ #[link_name = "llvm.nvvm.read.ptx.sreg.tid.y"]
+ fn thread_idx_y() -> i32;
+ #[link_name = "llvm.nvvm.read.ptx.sreg.tid.z"]
+ fn thread_idx_z() -> i32;
+}
+
+/// Synchronizes all threads in the block.
+#[inline]
+pub unsafe fn _syncthreads() -> () {
+ syncthreads()
+}
+
+/// x-th thread-block dimension.
+#[inline]
+pub unsafe fn _block_dim_x() -> i32 {
+ block_dim_x()
+}
+
+/// y-th thread-block dimension.
+#[inline]
+pub unsafe fn _block_dim_y() -> i32 {
+ block_dim_y()
+}
+
+/// z-th thread-block dimension.
+#[inline]
+pub unsafe fn _block_dim_z() -> i32 {
+ block_dim_z()
+}
+
+/// x-th thread-block index.
+#[inline]
+pub unsafe fn _block_idx_x() -> i32 {
+ block_idx_x()
+}
+
+/// y-th thread-block index.
+#[inline]
+pub unsafe fn _block_idx_y() -> i32 {
+ block_idx_y()
+}
+
+/// z-th thread-block index.
+#[inline]
+pub unsafe fn _block_idx_z() -> i32 {
+ block_idx_z()
+}
+
+/// x-th block-grid dimension.
+#[inline]
+pub unsafe fn _grid_dim_x() -> i32 {
+ grid_dim_x()
+}
+
+/// y-th block-grid dimension.
+#[inline]
+pub unsafe fn _grid_dim_y() -> i32 {
+ grid_dim_y()
+}
+
+/// z-th block-grid dimension.
+#[inline]
+pub unsafe fn _grid_dim_z() -> i32 {
+ grid_dim_z()
+}
+
+/// x-th thread index.
+#[inline]
+pub unsafe fn _thread_idx_x() -> i32 {
+ thread_idx_x()
+}
+
+/// y-th thread index.
+#[inline]
+pub unsafe fn _thread_idx_y() -> i32 {
+ thread_idx_y()
+}
+
+/// z-th thread index.
+#[inline]
+pub unsafe fn _thread_idx_z() -> i32 {
+ thread_idx_z()
+}
+
+/// Generates the trap instruction `TRAP`
+#[inline]
+pub unsafe fn trap() -> ! {
+ crate::intrinsics::abort()
+}
+
+// Basic CUDA syscall declarations.
+extern "C" {
+ /// Print formatted output from a kernel to a host-side output stream.
+ ///
+ /// Syscall arguments:
+ /// * `status`: The status value that is returned by `vprintf`.
+ /// * `format`: A pointer to the format specifier input (uses common `printf` format).
+ /// * `valist`: A pointer to the valist input.
+ ///
+ /// ```
+ /// #[repr(C)]
+ /// struct PrintArgs(f32, f32, f32, i32);
+ ///
+ /// vprintf(
+ /// "int(%f + %f) = int(%f) = %d\n".as_ptr(),
+ /// transmute(&PrintArgs(a, b, a + b, (a + b) as i32)),
+ /// );
+ /// ```
+ ///
+ /// Sources:
+ /// [Programming Guide](https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#formatted-output),
+ /// [PTX Interoperability](https://docs.nvidia.com/cuda/ptx-writers-guide-to-interoperability/index.html#system-calls).
+ pub fn vprintf(format: *const u8, valist: *const c_void) -> i32;
+
+ /// Allocate memory dynamically from a fixed-size heap in global memory.
+ ///
+ /// The CUDA in-kernel `malloc()` function allocates at least `size` bytes
+ /// from the device heap and returns a pointer to the allocated memory
+ /// or `NULL` if insufficient memory exists to fulfill the request.
+ ///
+ /// The returned pointer is guaranteed to be aligned to a 16-byte boundary.
+ ///
+ /// The memory allocated by a given CUDA thread via `malloc()` remains allocated
+ /// for the lifetime of the CUDA context, or until it is explicitly released
+ /// by a call to `free()`. It can be used by any other CUDA threads
+ /// even from subsequent kernel launches.
+ ///
+ /// Sources:
+ /// [Programming Guide](https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#dynamic-global-memory-allocation-and-operations),
+ /// [PTX Interoperability](https://docs.nvidia.com/cuda/ptx-writers-guide-to-interoperability/index.html#system-calls).
+ // FIXME(denzp): assign `malloc` and `nothrow` attributes.
+ pub fn malloc(size: usize) -> *mut c_void;
+
+ /// Free previously dynamically allocated memory.
+ ///
+ /// The CUDA in-kernel `free()` function deallocates the memory pointed to by `ptr`,
+ /// which must have been returned by a previous call to `malloc()`. If `ptr` is NULL,
+ /// the call to `free()` is ignored.
+ ///
+ /// Any CUDA thread may free memory allocated by another thread, but care should be taken
+ /// to ensure that the same pointer is not freed more than once. Repeated calls to `free()`
+ /// with the same `ptr` has undefined behavior.
+ ///
+ /// Sources:
+ /// [Programming Guide](https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#dynamic-global-memory-allocation-and-operations),
+ /// [PTX Interoperability](https://docs.nvidia.com/cuda/ptx-writers-guide-to-interoperability/index.html#system-calls).
+ // FIXME(denzp): assign `nothrow` attribute.
+ pub fn free(ptr: *mut c_void);
+
+ // Internal declaration of the syscall. Exported variant has
+ // the `char_size` parameter set to `1` (single char size in bytes).
+ fn __assertfail(
+ message: *const u8,
+ file: *const u8,
+ line: u32,
+ function: *const u8,
+ char_size: usize,
+ );
+}
+
+/// Syscall to be used whenever the *assert expression produces a `false` value*.
+///
+/// Syscall arguments:
+/// * `message`: The pointer to the string that should be output.
+/// * `file`: The pointer to the file name string associated with the assert.
+/// * `line`: The line number associated with the assert.
+/// * `function`: The pointer to the function name string associated with the assert.
+///
+/// Source:
+/// [PTX Interoperability](https://docs.nvidia.com/cuda/ptx-writers-guide-to-interoperability/index.html#system-calls).
+#[inline]
+pub unsafe fn __assert_fail(message: *const u8, file: *const u8, line: u32, function: *const u8) {
+ __assertfail(message, file, line, function, 1)
+}
diff --git a/library/stdarch/crates/core_arch/src/powerpc/altivec.rs b/library/stdarch/crates/core_arch/src/powerpc/altivec.rs
new file mode 100644
index 000000000..8b2be39dc
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/powerpc/altivec.rs
@@ -0,0 +1,2778 @@
+//! PowerPC AltiVec intrinsics.
+//!
+//! AltiVec is a brandname trademarked by Freescale (previously Motorola) for
+//! the standard `Category:Vector` part of the Power ISA v.2.03 specification.
+//! This Category is also known as VMX (used by IBM), and "Velocity Engine" (a
+//! brand name previously used by Apple).
+//!
+//! The references are: [POWER ISA v2.07B (for POWER8 & POWER8 with NVIDIA
+//! NVlink)] and [POWER ISA v3.0B (for POWER9)].
+//!
+//! [POWER ISA v2.07B (for POWER8 & POWER8 with NVIDIA NVlink)]: https://ibm.box.com/s/jd5w15gz301s5b5dt375mshpq9c3lh4u
+//! [POWER ISA v3.0B (for POWER9)]: https://ibm.box.com/s/1hzcwkwf8rbju5h9iyf44wm94amnlcrv
+
+#![allow(non_camel_case_types)]
+
+use crate::{
+ core_arch::{simd::*, simd_llvm::*},
+ mem::transmute,
+};
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+types! {
+ /// PowerPC-specific 128-bit wide vector of sixteen packed `i8`
+ pub struct vector_signed_char(i8, i8, i8, i8, i8, i8, i8, i8,
+ i8, i8, i8, i8, i8, i8, i8, i8);
+ /// PowerPC-specific 128-bit wide vector of sixteen packed `u8`
+ pub struct vector_unsigned_char(u8, u8, u8, u8, u8, u8, u8, u8,
+ u8, u8, u8, u8, u8, u8, u8, u8);
+
+ /// PowerPC-specific 128-bit wide vector mask of sixteen packed elements
+ pub struct vector_bool_char(i8, i8, i8, i8, i8, i8, i8, i8,
+ i8, i8, i8, i8, i8, i8, i8, i8);
+ /// PowerPC-specific 128-bit wide vector of eight packed `i16`
+ pub struct vector_signed_short(i16, i16, i16, i16, i16, i16, i16, i16);
+ /// PowerPC-specific 128-bit wide vector of eight packed `u16`
+ pub struct vector_unsigned_short(u16, u16, u16, u16, u16, u16, u16, u16);
+ /// PowerPC-specific 128-bit wide vector mask of eight packed elements
+ pub struct vector_bool_short(i16, i16, i16, i16, i16, i16, i16, i16);
+ // pub struct vector_pixel(???);
+ /// PowerPC-specific 128-bit wide vector of four packed `i32`
+ pub struct vector_signed_int(i32, i32, i32, i32);
+ /// PowerPC-specific 128-bit wide vector of four packed `u32`
+ pub struct vector_unsigned_int(u32, u32, u32, u32);
+ /// PowerPC-specific 128-bit wide vector mask of four packed elements
+ pub struct vector_bool_int(i32, i32, i32, i32);
+ /// PowerPC-specific 128-bit wide vector of four packed `f32`
+ pub struct vector_float(f32, f32, f32, f32);
+}
+
+#[allow(improper_ctypes)]
+extern "C" {
+ #[link_name = "llvm.ppc.altivec.vperm"]
+ fn vperm(
+ a: vector_signed_int,
+ b: vector_signed_int,
+ c: vector_unsigned_char,
+ ) -> vector_signed_int;
+ #[link_name = "llvm.ppc.altivec.vmhaddshs"]
+ fn vmhaddshs(
+ a: vector_signed_short,
+ b: vector_signed_short,
+ c: vector_signed_short,
+ ) -> vector_signed_short;
+ #[link_name = "llvm.ppc.altivec.vmhraddshs"]
+ fn vmhraddshs(
+ a: vector_signed_short,
+ b: vector_signed_short,
+ c: vector_signed_short,
+ ) -> vector_signed_short;
+ #[link_name = "llvm.ppc.altivec.vmsumuhs"]
+ fn vmsumuhs(
+ a: vector_unsigned_short,
+ b: vector_unsigned_short,
+ c: vector_unsigned_int,
+ ) -> vector_unsigned_int;
+ #[link_name = "llvm.ppc.altivec.vmsumshs"]
+ fn vmsumshs(
+ a: vector_signed_short,
+ b: vector_signed_short,
+ c: vector_signed_int,
+ ) -> vector_signed_int;
+ #[link_name = "llvm.ppc.altivec.vmsumubm"]
+ fn vmsumubm(
+ a: vector_unsigned_char,
+ b: vector_unsigned_char,
+ c: vector_unsigned_int,
+ ) -> vector_unsigned_int;
+ #[link_name = "llvm.ppc.altivec.vmsummbm"]
+ fn vmsummbm(
+ a: vector_signed_char,
+ b: vector_unsigned_char,
+ c: vector_signed_int,
+ ) -> vector_signed_int;
+ #[link_name = "llvm.ppc.altivec.vmsumuhm"]
+ fn vmsumuhm(
+ a: vector_unsigned_short,
+ b: vector_unsigned_short,
+ c: vector_unsigned_int,
+ ) -> vector_unsigned_int;
+ #[link_name = "llvm.ppc.altivec.vmsumshm"]
+ fn vmsumshm(
+ a: vector_signed_short,
+ b: vector_signed_short,
+ c: vector_signed_int,
+ ) -> vector_signed_int;
+ #[link_name = "llvm.ppc.altivec.vmaddfp"]
+ fn vmaddfp(a: vector_float, b: vector_float, c: vector_float) -> vector_float;
+ #[link_name = "llvm.ppc.altivec.vnmsubfp"]
+ fn vnmsubfp(a: vector_float, b: vector_float, c: vector_float) -> vector_float;
+ #[link_name = "llvm.ppc.altivec.vsum2sws"]
+ fn vsum2sws(a: vector_signed_int, b: vector_signed_int) -> vector_signed_int;
+ #[link_name = "llvm.ppc.altivec.vsum4ubs"]
+ fn vsum4ubs(a: vector_unsigned_char, b: vector_unsigned_int) -> vector_unsigned_int;
+ #[link_name = "llvm.ppc.altivec.vsum4sbs"]
+ fn vsum4sbs(a: vector_signed_char, b: vector_signed_int) -> vector_signed_int;
+ #[link_name = "llvm.ppc.altivec.vsum4shs"]
+ fn vsum4shs(a: vector_signed_short, b: vector_signed_int) -> vector_signed_int;
+ #[link_name = "llvm.ppc.altivec.vmuleub"]
+ fn vmuleub(a: vector_unsigned_char, b: vector_unsigned_char) -> vector_unsigned_short;
+ #[link_name = "llvm.ppc.altivec.vmulesb"]
+ fn vmulesb(a: vector_signed_char, b: vector_signed_char) -> vector_signed_short;
+ #[link_name = "llvm.ppc.altivec.vmuleuh"]
+ fn vmuleuh(a: vector_unsigned_short, b: vector_unsigned_short) -> vector_unsigned_int;
+ #[link_name = "llvm.ppc.altivec.vmulesh"]
+ fn vmulesh(a: vector_signed_short, b: vector_signed_short) -> vector_signed_int;
+ #[link_name = "llvm.ppc.altivec.vmuloub"]
+ fn vmuloub(a: vector_unsigned_char, b: vector_unsigned_char) -> vector_unsigned_short;
+ #[link_name = "llvm.ppc.altivec.vmulosb"]
+ fn vmulosb(a: vector_signed_char, b: vector_signed_char) -> vector_signed_short;
+ #[link_name = "llvm.ppc.altivec.vmulouh"]
+ fn vmulouh(a: vector_unsigned_short, b: vector_unsigned_short) -> vector_unsigned_int;
+ #[link_name = "llvm.ppc.altivec.vmulosh"]
+ fn vmulosh(a: vector_signed_short, b: vector_signed_short) -> vector_signed_int;
+
+ #[link_name = "llvm.ppc.altivec.vmaxsb"]
+ fn vmaxsb(a: vector_signed_char, b: vector_signed_char) -> vector_signed_char;
+ #[link_name = "llvm.ppc.altivec.vmaxsh"]
+ fn vmaxsh(a: vector_signed_short, b: vector_signed_short) -> vector_signed_short;
+ #[link_name = "llvm.ppc.altivec.vmaxsw"]
+ fn vmaxsw(a: vector_signed_int, b: vector_signed_int) -> vector_signed_int;
+
+ #[link_name = "llvm.ppc.altivec.vmaxub"]
+ fn vmaxub(a: vector_unsigned_char, b: vector_unsigned_char) -> vector_unsigned_char;
+ #[link_name = "llvm.ppc.altivec.vmaxuh"]
+ fn vmaxuh(a: vector_unsigned_short, b: vector_unsigned_short) -> vector_unsigned_short;
+ #[link_name = "llvm.ppc.altivec.vmaxuw"]
+ fn vmaxuw(a: vector_unsigned_int, b: vector_unsigned_int) -> vector_unsigned_int;
+
+ #[link_name = "llvm.ppc.altivec.vminsb"]
+ fn vminsb(a: vector_signed_char, b: vector_signed_char) -> vector_signed_char;
+ #[link_name = "llvm.ppc.altivec.vminsh"]
+ fn vminsh(a: vector_signed_short, b: vector_signed_short) -> vector_signed_short;
+ #[link_name = "llvm.ppc.altivec.vminsw"]
+ fn vminsw(a: vector_signed_int, b: vector_signed_int) -> vector_signed_int;
+
+ #[link_name = "llvm.ppc.altivec.vminub"]
+ fn vminub(a: vector_unsigned_char, b: vector_unsigned_char) -> vector_unsigned_char;
+ #[link_name = "llvm.ppc.altivec.vminuh"]
+ fn vminuh(a: vector_unsigned_short, b: vector_unsigned_short) -> vector_unsigned_short;
+ #[link_name = "llvm.ppc.altivec.vminuw"]
+ fn vminuw(a: vector_unsigned_int, b: vector_unsigned_int) -> vector_unsigned_int;
+
+ #[link_name = "llvm.ppc.altivec.vsubsbs"]
+ fn vsubsbs(a: vector_signed_char, b: vector_signed_char) -> vector_signed_char;
+ #[link_name = "llvm.ppc.altivec.vsubshs"]
+ fn vsubshs(a: vector_signed_short, b: vector_signed_short) -> vector_signed_short;
+ #[link_name = "llvm.ppc.altivec.vsubsws"]
+ fn vsubsws(a: vector_signed_int, b: vector_signed_int) -> vector_signed_int;
+
+ #[link_name = "llvm.ppc.altivec.vsububs"]
+ fn vsububs(a: vector_unsigned_char, b: vector_unsigned_char) -> vector_unsigned_char;
+ #[link_name = "llvm.ppc.altivec.vsubuhs"]
+ fn vsubuhs(a: vector_unsigned_short, b: vector_unsigned_short) -> vector_unsigned_short;
+ #[link_name = "llvm.ppc.altivec.vsubuws"]
+ fn vsubuws(a: vector_unsigned_int, b: vector_unsigned_int) -> vector_unsigned_int;
+
+ #[link_name = "llvm.ppc.altivec.vaddcuw"]
+ fn vaddcuw(a: vector_unsigned_int, b: vector_unsigned_int) -> vector_unsigned_int;
+
+ #[link_name = "llvm.ppc.altivec.vaddsbs"]
+ fn vaddsbs(a: vector_signed_char, b: vector_signed_char) -> vector_signed_char;
+ #[link_name = "llvm.ppc.altivec.vaddshs"]
+ fn vaddshs(a: vector_signed_short, b: vector_signed_short) -> vector_signed_short;
+ #[link_name = "llvm.ppc.altivec.vaddsws"]
+ fn vaddsws(a: vector_signed_int, b: vector_signed_int) -> vector_signed_int;
+
+ #[link_name = "llvm.ppc.altivec.vaddubs"]
+ fn vaddubs(a: vector_unsigned_char, b: vector_unsigned_char) -> vector_unsigned_char;
+ #[link_name = "llvm.ppc.altivec.vadduhs"]
+ fn vadduhs(a: vector_unsigned_short, b: vector_unsigned_short) -> vector_unsigned_short;
+ #[link_name = "llvm.ppc.altivec.vadduws"]
+ fn vadduws(a: vector_unsigned_int, b: vector_unsigned_int) -> vector_unsigned_int;
+
+ #[link_name = "llvm.ppc.altivec.vavgsb"]
+ fn vavgsb(a: vector_signed_char, b: vector_signed_char) -> vector_signed_char;
+ #[link_name = "llvm.ppc.altivec.vavgsh"]
+ fn vavgsh(a: vector_signed_short, b: vector_signed_short) -> vector_signed_short;
+ #[link_name = "llvm.ppc.altivec.vavgsw"]
+ fn vavgsw(a: vector_signed_int, b: vector_signed_int) -> vector_signed_int;
+
+ #[link_name = "llvm.ppc.altivec.vavgub"]
+ fn vavgub(a: vector_unsigned_char, b: vector_unsigned_char) -> vector_unsigned_char;
+ #[link_name = "llvm.ppc.altivec.vavguh"]
+ fn vavguh(a: vector_unsigned_short, b: vector_unsigned_short) -> vector_unsigned_short;
+ #[link_name = "llvm.ppc.altivec.vavguw"]
+ fn vavguw(a: vector_unsigned_int, b: vector_unsigned_int) -> vector_unsigned_int;
+
+ #[link_name = "llvm.ceil.v4f32"]
+ fn vceil(a: vector_float) -> vector_float;
+
+ #[link_name = "llvm.ppc.altivec.vcmpbfp"]
+ fn vcmpbfp(a: vector_float, b: vector_float) -> vector_signed_int;
+
+ #[link_name = "llvm.ppc.altivec.vcmpequb"]
+ fn vcmpequb(a: vector_unsigned_char, b: vector_unsigned_char) -> vector_bool_char;
+ #[link_name = "llvm.ppc.altivec.vcmpequh"]
+ fn vcmpequh(a: vector_unsigned_short, b: vector_unsigned_short) -> vector_bool_short;
+ #[link_name = "llvm.ppc.altivec.vcmpequw"]
+ fn vcmpequw(a: vector_unsigned_int, b: vector_unsigned_int) -> vector_bool_int;
+
+ #[link_name = "llvm.ppc.altivec.vcmpgefp"]
+ fn vcmpgefp(a: vector_float, b: vector_float) -> vector_bool_int;
+
+ #[link_name = "llvm.ppc.altivec.vcmpgtub"]
+ fn vcmpgtub(a: vector_unsigned_char, b: vector_unsigned_char) -> vector_bool_char;
+ #[link_name = "llvm.ppc.altivec.vcmpgtuh"]
+ fn vcmpgtuh(a: vector_unsigned_short, b: vector_unsigned_short) -> vector_bool_short;
+ #[link_name = "llvm.ppc.altivec.vcmpgtuw"]
+ fn vcmpgtuw(a: vector_unsigned_int, b: vector_unsigned_int) -> vector_bool_int;
+
+ #[link_name = "llvm.ppc.altivec.vcmpgtsb"]
+ fn vcmpgtsb(a: vector_signed_char, b: vector_signed_char) -> vector_bool_char;
+ #[link_name = "llvm.ppc.altivec.vcmpgtsh"]
+ fn vcmpgtsh(a: vector_signed_short, b: vector_signed_short) -> vector_bool_short;
+ #[link_name = "llvm.ppc.altivec.vcmpgtsw"]
+ fn vcmpgtsw(a: vector_signed_int, b: vector_signed_int) -> vector_bool_int;
+
+ #[link_name = "llvm.ppc.altivec.vexptefp"]
+ fn vexptefp(a: vector_float) -> vector_float;
+
+ #[link_name = "llvm.floor.v4f32"]
+ fn vfloor(a: vector_float) -> vector_float;
+}
+
+macro_rules! s_t_l {
+ (i32x4) => {
+ vector_signed_int
+ };
+ (i16x8) => {
+ vector_signed_short
+ };
+ (i8x16) => {
+ vector_signed_char
+ };
+
+ (u32x4) => {
+ vector_unsigned_int
+ };
+ (u16x8) => {
+ vector_unsigned_short
+ };
+ (u8x16) => {
+ vector_unsigned_char
+ };
+
+ (f32x4) => {
+ vector_float
+ };
+}
+
+macro_rules! t_t_l {
+ (i32) => {
+ vector_signed_int
+ };
+ (i16) => {
+ vector_signed_short
+ };
+ (i8) => {
+ vector_signed_char
+ };
+
+ (u32) => {
+ vector_unsigned_int
+ };
+ (u16) => {
+ vector_unsigned_short
+ };
+ (u8) => {
+ vector_unsigned_char
+ };
+
+ (f32) => {
+ vector_float
+ };
+}
+
+macro_rules! impl_from {
+ ($s: ident) => {
+ impl From<$s> for s_t_l!($s) {
+ fn from (v: $s) -> Self {
+ unsafe {
+ transmute(v)
+ }
+ }
+ }
+ };
+ ($($s: ident),*) => {
+ $(
+ impl_from! { $s }
+ )*
+ };
+}
+
+impl_from! { i8x16, u8x16, i16x8, u16x8, i32x4, u32x4, f32x4 }
+
+macro_rules! impl_neg {
+ ($s: ident : $zero: expr) => {
+ impl crate::ops::Neg for s_t_l!($s) {
+ type Output = s_t_l!($s);
+ fn neg(self) -> Self::Output {
+ let zero = $s::splat($zero);
+ unsafe { transmute(simd_sub(zero, transmute(self))) }
+ }
+ }
+ };
+}
+
+impl_neg! { i8x16 : 0 }
+impl_neg! { i16x8 : 0 }
+impl_neg! { i32x4 : 0 }
+impl_neg! { f32x4 : 0f32 }
+
+mod sealed {
+ use super::*;
+
+ macro_rules! test_impl {
+ ($fun:ident ($($v:ident : $ty:ty),*) -> $r:ty [$call:ident, $instr:ident]) => {
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ #[cfg_attr(test, assert_instr($instr))]
+ pub unsafe fn $fun ($($v : $ty),*) -> $r {
+ $call ($($v),*)
+ }
+ };
+ ($fun:ident ($($v:ident : $ty:ty),*) -> $r:ty [$call:ident, $instr_altivec:ident / $instr_vsx:ident]) => {
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ #[cfg_attr(all(test, not(target_feature="vsx")), assert_instr($instr_altivec))]
+ #[cfg_attr(all(test, target_feature="vsx"), assert_instr($instr_vsx))]
+ pub unsafe fn $fun ($($v : $ty),*) -> $r {
+ $call ($($v),*)
+ }
+ }
+
+ }
+
+ #[allow(unknown_lints, unused_macro_rules)]
+ macro_rules! impl_vec_trait {
+ ([$Trait:ident $m:ident] $fun:ident ($a:ty)) => {
+ impl $Trait for $a {
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn $m(self) -> Self {
+ $fun(transmute(self))
+ }
+ }
+ };
+ ([$Trait:ident $m:ident] $fun:ident ($a:ty) -> $r:ty) => {
+ impl $Trait for $a {
+ type Result = $r;
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn $m(self) -> Self::Result {
+ $fun(transmute(self))
+ }
+ }
+ };
+ ([$Trait:ident $m:ident] 1 ($ub:ident, $sb:ident, $uh:ident, $sh:ident, $uw:ident, $sw:ident, $sf: ident)) => {
+ impl_vec_trait!{ [$Trait $m] $ub (vector_unsigned_char) -> vector_unsigned_char }
+ impl_vec_trait!{ [$Trait $m] $sb (vector_signed_char) -> vector_signed_char }
+ impl_vec_trait!{ [$Trait $m] $uh (vector_unsigned_short) -> vector_unsigned_short }
+ impl_vec_trait!{ [$Trait $m] $sh (vector_signed_short) -> vector_signed_short }
+ impl_vec_trait!{ [$Trait $m] $uw (vector_unsigned_int) -> vector_unsigned_int }
+ impl_vec_trait!{ [$Trait $m] $sw (vector_signed_int) -> vector_signed_int }
+ impl_vec_trait!{ [$Trait $m] $sf (vector_float) -> vector_float }
+ };
+ ([$Trait:ident $m:ident] $fun:ident ($a:ty, $b:ty) -> $r:ty) => {
+ impl $Trait<$b> for $a {
+ type Result = $r;
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn $m(self, b: $b) -> Self::Result {
+ $fun(transmute(self), transmute(b))
+ }
+ }
+ };
+ ([$Trait:ident $m:ident] $fun:ident ($a:ty, ~$b:ty) -> $r:ty) => {
+ impl_vec_trait!{ [$Trait $m] $fun ($a, $a) -> $r }
+ impl_vec_trait!{ [$Trait $m] $fun ($a, $b) -> $r }
+ impl_vec_trait!{ [$Trait $m] $fun ($b, $a) -> $r }
+ };
+ ([$Trait:ident $m:ident] ~($ub:ident, $sb:ident, $uh:ident, $sh:ident, $uw:ident, $sw:ident)) => {
+ impl_vec_trait!{ [$Trait $m] $ub (vector_unsigned_char, ~vector_bool_char) -> vector_unsigned_char }
+ impl_vec_trait!{ [$Trait $m] $sb (vector_signed_char, ~vector_bool_char) -> vector_signed_char }
+ impl_vec_trait!{ [$Trait $m] $uh (vector_unsigned_short, ~vector_bool_short) -> vector_unsigned_short }
+ impl_vec_trait!{ [$Trait $m] $sh (vector_signed_short, ~vector_bool_short) -> vector_signed_short }
+ impl_vec_trait!{ [$Trait $m] $uw (vector_unsigned_int, ~vector_bool_int) -> vector_unsigned_int }
+ impl_vec_trait!{ [$Trait $m] $sw (vector_signed_int, ~vector_bool_int) -> vector_signed_int }
+ };
+ ([$Trait:ident $m:ident] ~($fn:ident)) => {
+ impl_vec_trait!{ [$Trait $m] ~($fn, $fn, $fn, $fn, $fn, $fn) }
+ };
+ ([$Trait:ident $m:ident] 2 ($ub:ident, $sb:ident, $uh:ident, $sh:ident, $uw:ident, $sw:ident)) => {
+ impl_vec_trait!{ [$Trait $m] $ub (vector_unsigned_char, vector_unsigned_char) -> vector_unsigned_char }
+ impl_vec_trait!{ [$Trait $m] $sb (vector_signed_char, vector_signed_char) -> vector_signed_char }
+ impl_vec_trait!{ [$Trait $m] $uh (vector_unsigned_short, vector_unsigned_short) -> vector_unsigned_short }
+ impl_vec_trait!{ [$Trait $m] $sh (vector_signed_short, vector_signed_short) -> vector_signed_short }
+ impl_vec_trait!{ [$Trait $m] $uw (vector_unsigned_int, vector_unsigned_int) -> vector_unsigned_int }
+ impl_vec_trait!{ [$Trait $m] $sw (vector_signed_int, vector_signed_int) -> vector_signed_int }
+ };
+ ([$Trait:ident $m:ident] 2 ($fn:ident)) => {
+ impl_vec_trait!{ [$Trait $m] ($fn, $fn, $fn, $fn, $fn, $fn) }
+ }
+ }
+
+ macro_rules! impl_vec_cmp {
+ ([$Trait:ident $m:ident] ($b:ident, $h:ident, $w:ident)) => {
+ impl_vec_cmp! { [$Trait $m] ($b, $b, $h, $h, $w, $w) }
+ };
+ ([$Trait:ident $m:ident] ($ub:ident, $sb:ident, $uh:ident, $sh:ident, $uw:ident, $sw:ident)) => {
+ impl_vec_trait!{ [$Trait $m] $ub (vector_unsigned_char, vector_unsigned_char) -> vector_bool_char }
+ impl_vec_trait!{ [$Trait $m] $sb (vector_signed_char, vector_signed_char) -> vector_bool_char }
+ impl_vec_trait!{ [$Trait $m] $uh (vector_unsigned_short, vector_unsigned_short) -> vector_bool_short }
+ impl_vec_trait!{ [$Trait $m] $sh (vector_signed_short, vector_signed_short) -> vector_bool_short }
+ impl_vec_trait!{ [$Trait $m] $uw (vector_unsigned_int, vector_unsigned_int) -> vector_bool_int }
+ impl_vec_trait!{ [$Trait $m] $sw (vector_signed_int, vector_signed_int) -> vector_bool_int }
+ }
+ }
+
+ #[inline(always)]
+ unsafe fn load(off: i32, p: *const i8) -> u32x4 {
+ let addr = p.offset(off as isize);
+
+ *(addr as *const u32x4)
+ }
+
+ pub trait VectorLd {
+ type Result;
+ unsafe fn vec_ld(self, off: i32) -> Self::Result;
+ }
+
+ macro_rules! impl_vec_ld {
+ ($fun:ident $ty:ident [$instr:ident]) => {
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ #[cfg_attr(test, assert_instr($instr))]
+ pub unsafe fn $fun(off: i32, p: *const $ty) -> t_t_l!($ty) {
+ transmute(load(off, p as *const i8))
+ }
+
+ impl VectorLd for *const $ty {
+ type Result = t_t_l!($ty);
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn vec_ld(self, off: i32) -> Self::Result {
+ $fun(off, self)
+ }
+ }
+ };
+ ($fun:ident $ty:ident) => {
+ impl_vec_ld! { $fun $ty [lvx] }
+ };
+ }
+
+ impl_vec_ld! { vec_ld_u8 u8 }
+ impl_vec_ld! { vec_ld_i8 i8 }
+
+ impl_vec_ld! { vec_ld_u16 u16 }
+ impl_vec_ld! { vec_ld_i16 i16 }
+
+ impl_vec_ld! { vec_ld_u32 u32 }
+ impl_vec_ld! { vec_ld_i32 i32 }
+
+ impl_vec_ld! { vec_ld_f32 f32 }
+
+ test_impl! { vec_floor(a: vector_float) -> vector_float [ vfloor, vrfim / xvrspim ] }
+
+ test_impl! { vec_vexptefp(a: vector_float) -> vector_float [ vexptefp, vexptefp ] }
+
+ test_impl! { vec_vcmpgtub(a: vector_unsigned_char, b: vector_unsigned_char) -> vector_bool_char [ vcmpgtub, vcmpgtub ] }
+ test_impl! { vec_vcmpgtuh(a: vector_unsigned_short, b: vector_unsigned_short) -> vector_bool_short [ vcmpgtuh, vcmpgtuh ] }
+ test_impl! { vec_vcmpgtuw(a: vector_unsigned_int, b: vector_unsigned_int) -> vector_bool_int [ vcmpgtuw, vcmpgtuw ] }
+
+ test_impl! { vec_vcmpgtsb(a: vector_signed_char, b: vector_signed_char) -> vector_bool_char [ vcmpgtsb, vcmpgtsb ] }
+ test_impl! { vec_vcmpgtsh(a: vector_signed_short, b: vector_signed_short) -> vector_bool_short [ vcmpgtsh, vcmpgtsh ] }
+ test_impl! { vec_vcmpgtsw(a: vector_signed_int, b: vector_signed_int) -> vector_bool_int [ vcmpgtsw, vcmpgtsw ] }
+
+ pub trait VectorCmpGt<Other> {
+ type Result;
+ unsafe fn vec_cmpgt(self, b: Other) -> Self::Result;
+ }
+
+ impl_vec_cmp! { [VectorCmpGt vec_cmpgt] ( vec_vcmpgtub, vec_vcmpgtsb, vec_vcmpgtuh, vec_vcmpgtsh, vec_vcmpgtuw, vec_vcmpgtsw ) }
+
+ test_impl! { vec_vcmpgefp(a: vector_float, b: vector_float) -> vector_bool_int [ vcmpgefp, vcmpgefp ] }
+
+ test_impl! { vec_vcmpequb(a: vector_unsigned_char, b: vector_unsigned_char) -> vector_bool_char [ vcmpequb, vcmpequb ] }
+ test_impl! { vec_vcmpequh(a: vector_unsigned_short, b: vector_unsigned_short) -> vector_bool_short [ vcmpequh, vcmpequh ] }
+ test_impl! { vec_vcmpequw(a: vector_unsigned_int, b: vector_unsigned_int) -> vector_bool_int [ vcmpequw, vcmpequw ] }
+
+ pub trait VectorCmpEq<Other> {
+ type Result;
+ unsafe fn vec_cmpeq(self, b: Other) -> Self::Result;
+ }
+
+ impl_vec_cmp! { [VectorCmpEq vec_cmpeq] (vec_vcmpequb, vec_vcmpequh, vec_vcmpequw) }
+
+ test_impl! { vec_vcmpbfp(a: vector_float, b: vector_float) -> vector_signed_int [vcmpbfp, vcmpbfp] }
+
+ test_impl! { vec_vceil(a: vector_float) -> vector_float [vceil, vrfip / xvrspip ] }
+
+ test_impl! { vec_vavgsb(a: vector_signed_char, b: vector_signed_char) -> vector_signed_char [ vavgsb, vavgsb ] }
+ test_impl! { vec_vavgsh(a: vector_signed_short, b: vector_signed_short) -> vector_signed_short [ vavgsh, vavgsh ] }
+ test_impl! { vec_vavgsw(a: vector_signed_int, b: vector_signed_int) -> vector_signed_int [ vavgsw, vavgsw ] }
+ test_impl! { vec_vavgub(a: vector_unsigned_char, b: vector_unsigned_char) -> vector_unsigned_char [ vavgub, vavgub ] }
+ test_impl! { vec_vavguh(a: vector_unsigned_short, b: vector_unsigned_short) -> vector_unsigned_short [ vavguh, vavguh ] }
+ test_impl! { vec_vavguw(a: vector_unsigned_int, b: vector_unsigned_int) -> vector_unsigned_int [ vavguw, vavguw ] }
+
+ pub trait VectorAvg<Other> {
+ type Result;
+ unsafe fn vec_avg(self, b: Other) -> Self::Result;
+ }
+
+ impl_vec_trait! { [VectorAvg vec_avg] 2 (vec_vavgub, vec_vavgsb, vec_vavguh, vec_vavgsh, vec_vavguw, vec_vavgsw) }
+
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ #[cfg_attr(all(test, not(target_feature = "vsx")), assert_instr(vandc))]
+ #[cfg_attr(all(test, target_feature = "vsx"), assert_instr(xxlandc))]
+ unsafe fn andc(a: u8x16, b: u8x16) -> u8x16 {
+ simd_and(simd_xor(u8x16::splat(0xff), b), a)
+ }
+
+ pub trait VectorAndc<Other> {
+ type Result;
+ unsafe fn vec_andc(self, b: Other) -> Self::Result;
+ }
+
+ macro_rules! impl_vec_andc {
+ (($a:ty, $b:ty) -> $r:ty) => {
+ impl VectorAndc<$b> for $a {
+ type Result = $r;
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn vec_andc(self, b: $b) -> Self::Result {
+ transmute(andc(transmute(self), transmute(b)))
+ }
+ }
+ };
+ (($a:ty, ~$b:ty) -> $r:ty) => {
+ impl_vec_andc! { ($a, $a) -> $r }
+ impl_vec_andc! { ($a, $b) -> $r }
+ impl_vec_andc! { ($b, $a) -> $r }
+ };
+ }
+
+ impl_vec_andc! { (vector_unsigned_char, ~vector_bool_char) -> vector_unsigned_char }
+ impl_vec_andc! { (vector_signed_char, ~vector_bool_char) -> vector_signed_char }
+ impl_vec_andc! { (vector_unsigned_short, ~vector_bool_short) -> vector_unsigned_short }
+ impl_vec_andc! { (vector_signed_short, ~vector_bool_short) -> vector_signed_short }
+ impl_vec_andc! { (vector_unsigned_int, ~vector_bool_int) -> vector_unsigned_int }
+ impl_vec_andc! { (vector_signed_int, ~vector_bool_int) -> vector_signed_int }
+
+ test_impl! { vec_vand(a: vector_signed_char, b: vector_signed_char) -> vector_signed_char [ simd_and, vand / xxland ] }
+
+ pub trait VectorAnd<Other> {
+ type Result;
+ unsafe fn vec_and(self, b: Other) -> Self::Result;
+ }
+
+ impl_vec_trait! { [VectorAnd vec_and] ~(simd_and) }
+
+ test_impl! { vec_vaddsbs(a: vector_signed_char, b: vector_signed_char) -> vector_signed_char [ vaddsbs, vaddsbs ] }
+ test_impl! { vec_vaddshs(a: vector_signed_short, b: vector_signed_short) -> vector_signed_short [ vaddshs, vaddshs ] }
+ test_impl! { vec_vaddsws(a: vector_signed_int, b: vector_signed_int) -> vector_signed_int [ vaddsws, vaddsws ] }
+ test_impl! { vec_vaddubs(a: vector_unsigned_char, b: vector_unsigned_char) -> vector_unsigned_char [ vaddubs, vaddubs ] }
+ test_impl! { vec_vadduhs(a: vector_unsigned_short, b: vector_unsigned_short) -> vector_unsigned_short [ vadduhs, vadduhs ] }
+ test_impl! { vec_vadduws(a: vector_unsigned_int, b: vector_unsigned_int) -> vector_unsigned_int [ vadduws, vadduws ] }
+
+ pub trait VectorAdds<Other> {
+ type Result;
+ unsafe fn vec_adds(self, b: Other) -> Self::Result;
+ }
+
+ impl_vec_trait! { [VectorAdds vec_adds] ~(vaddubs, vaddsbs, vadduhs, vaddshs, vadduws, vaddsws) }
+
+ test_impl! { vec_vaddcuw(a: vector_unsigned_int, b: vector_unsigned_int) -> vector_unsigned_int [vaddcuw, vaddcuw] }
+
+ test_impl! { vec_vsubsbs(a: vector_signed_char, b: vector_signed_char) -> vector_signed_char [ vsubsbs, vsubsbs ] }
+ test_impl! { vec_vsubshs(a: vector_signed_short, b: vector_signed_short) -> vector_signed_short [ vsubshs, vsubshs ] }
+ test_impl! { vec_vsubsws(a: vector_signed_int, b: vector_signed_int) -> vector_signed_int [ vsubsws, vsubsws ] }
+ test_impl! { vec_vsububs(a: vector_unsigned_char, b: vector_unsigned_char) -> vector_unsigned_char [ vsububs, vsububs ] }
+ test_impl! { vec_vsubuhs(a: vector_unsigned_short, b: vector_unsigned_short) -> vector_unsigned_short [ vsubuhs, vsubuhs ] }
+ test_impl! { vec_vsubuws(a: vector_unsigned_int, b: vector_unsigned_int) -> vector_unsigned_int [ vsubuws, vsubuws ] }
+
+ pub trait VectorSubs<Other> {
+ type Result;
+ unsafe fn vec_subs(self, b: Other) -> Self::Result;
+ }
+
+ impl_vec_trait! { [VectorSubs vec_subs] ~(vsububs, vsubsbs, vsubuhs, vsubshs, vsubuws, vsubsws) }
+
+ pub trait VectorAbs {
+ unsafe fn vec_abs(self) -> Self;
+ }
+
+ macro_rules! impl_abs {
+ ($name:ident, $ty: ident) => {
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn $name(v: s_t_l!($ty)) -> s_t_l!($ty) {
+ v.vec_max(-v)
+ }
+
+ impl_vec_trait! { [VectorAbs vec_abs] $name (s_t_l!($ty)) }
+ };
+ }
+
+ impl_abs! { vec_abs_i8, i8x16 }
+ impl_abs! { vec_abs_i16, i16x8 }
+ impl_abs! { vec_abs_i32, i32x4 }
+
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn vec_abs_f32(v: vector_float) -> vector_float {
+ let v: u32x4 = transmute(v);
+
+ transmute(simd_and(v, u32x4::splat(0x7FFFFFFF)))
+ }
+
+ impl_vec_trait! { [VectorAbs vec_abs] vec_abs_f32 (vector_float) }
+
+ pub trait VectorAbss {
+ unsafe fn vec_abss(self) -> Self;
+ }
+
+ macro_rules! impl_abss {
+ ($name:ident, $ty: ident) => {
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn $name(v: s_t_l!($ty)) -> s_t_l!($ty) {
+ let zero: s_t_l!($ty) = transmute(0u8.vec_splats());
+ v.vec_max(zero.vec_subs(v))
+ }
+
+ impl_vec_trait! { [VectorAbss vec_abss] $name (s_t_l!($ty)) }
+ };
+ }
+
+ impl_abss! { vec_abss_i8, i8x16 }
+ impl_abss! { vec_abss_i16, i16x8 }
+ impl_abss! { vec_abss_i32, i32x4 }
+
+ macro_rules! splats {
+ ($name:ident, $v:ident, $r:ident) => {
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn $name(v: $v) -> s_t_l!($r) {
+ transmute($r::splat(v))
+ }
+ };
+ }
+
+ splats! { splats_u8, u8, u8x16 }
+ splats! { splats_u16, u16, u16x8 }
+ splats! { splats_u32, u32, u32x4 }
+ splats! { splats_i8, i8, i8x16 }
+ splats! { splats_i16, i16, i16x8 }
+ splats! { splats_i32, i32, i32x4 }
+ splats! { splats_f32, f32, f32x4 }
+
+ test_impl! { vec_splats_u8 (v: u8) -> vector_unsigned_char [splats_u8, vspltb] }
+ test_impl! { vec_splats_u16 (v: u16) -> vector_unsigned_short [splats_u16, vsplth] }
+ test_impl! { vec_splats_u32 (v: u32) -> vector_unsigned_int [splats_u32, vspltw / xxspltw] }
+ test_impl! { vec_splats_i8 (v: i8) -> vector_signed_char [splats_i8, vspltb] }
+ test_impl! { vec_splats_i16 (v: i16) -> vector_signed_short [splats_i16, vsplth] }
+ test_impl! { vec_splats_i32 (v: i32) -> vector_signed_int [splats_i32, vspltw / xxspltw] }
+ test_impl! { vec_splats_f32 (v: f32) -> vector_float [splats_f32, vspltw / xxspltw] }
+
+ pub trait VectorSplats {
+ type Result;
+ unsafe fn vec_splats(self) -> Self::Result;
+ }
+
+ macro_rules! impl_vec_splats {
+ ($(($fn:ident ($ty:ty) -> $r:ty)),*) => {
+ $(
+ impl_vec_trait!{ [VectorSplats vec_splats] $fn ($ty) -> $r }
+ )*
+ }
+ }
+
+ impl_vec_splats! {
+ (vec_splats_u8 (u8) -> vector_unsigned_char),
+ (vec_splats_i8 (i8) -> vector_signed_char),
+ (vec_splats_u16 (u16) -> vector_unsigned_short),
+ (vec_splats_i16 (i16) -> vector_signed_short),
+ (vec_splats_u32 (u32) -> vector_unsigned_int),
+ (vec_splats_i32 (i32) -> vector_signed_int),
+ (vec_splats_f32 (f32) -> vector_float)
+ }
+
+ test_impl! { vec_vsububm (a: vector_unsigned_char, b: vector_unsigned_char) -> vector_unsigned_char [simd_sub, vsububm] }
+ test_impl! { vec_vsubuhm (a: vector_unsigned_short, b: vector_unsigned_short) -> vector_unsigned_short [simd_sub, vsubuhm] }
+ test_impl! { vec_vsubuwm (a: vector_unsigned_int, b: vector_unsigned_int) -> vector_unsigned_int [simd_sub, vsubuwm] }
+
+ pub trait VectorSub<Other> {
+ type Result;
+ unsafe fn vec_sub(self, b: Other) -> Self::Result;
+ }
+
+ impl_vec_trait! { [VectorSub vec_sub] ~(simd_sub, simd_sub, simd_sub, simd_sub, simd_sub, simd_sub) }
+ impl_vec_trait! { [VectorSub vec_sub] simd_sub(vector_float, vector_float) -> vector_float }
+
+ test_impl! { vec_vminsb (a: vector_signed_char, b: vector_signed_char) -> vector_signed_char [vminsb, vminsb] }
+ test_impl! { vec_vminsh (a: vector_signed_short, b: vector_signed_short) -> vector_signed_short [vminsh, vminsh] }
+ test_impl! { vec_vminsw (a: vector_signed_int, b: vector_signed_int) -> vector_signed_int [vminsw, vminsw] }
+
+ test_impl! { vec_vminub (a: vector_unsigned_char, b: vector_unsigned_char) -> vector_unsigned_char [vminub, vminub] }
+ test_impl! { vec_vminuh (a: vector_unsigned_short, b: vector_unsigned_short) -> vector_unsigned_short [vminuh, vminuh] }
+ test_impl! { vec_vminuw (a: vector_unsigned_int, b: vector_unsigned_int) -> vector_unsigned_int [vminuw, vminuw] }
+
+ pub trait VectorMin<Other> {
+ type Result;
+ unsafe fn vec_min(self, b: Other) -> Self::Result;
+ }
+
+ impl_vec_trait! { [VectorMin vec_min] ~(vminub, vminsb, vminuh, vminsh, vminuw, vminsw) }
+
+ test_impl! { vec_vmaxsb (a: vector_signed_char, b: vector_signed_char) -> vector_signed_char [vmaxsb, vmaxsb] }
+ test_impl! { vec_vmaxsh (a: vector_signed_short, b: vector_signed_short) -> vector_signed_short [vmaxsh, vmaxsh] }
+ test_impl! { vec_vmaxsw (a: vector_signed_int, b: vector_signed_int) -> vector_signed_int [vmaxsw, vmaxsw] }
+
+ test_impl! { vec_vmaxub (a: vector_unsigned_char, b: vector_unsigned_char) -> vector_unsigned_char [vmaxub, vmaxub] }
+ test_impl! { vec_vmaxuh (a: vector_unsigned_short, b: vector_unsigned_short) -> vector_unsigned_short [vmaxuh, vmaxuh] }
+ test_impl! { vec_vmaxuw (a: vector_unsigned_int, b: vector_unsigned_int) -> vector_unsigned_int [vmaxuw, vmaxuw] }
+
+ pub trait VectorMax<Other> {
+ type Result;
+ unsafe fn vec_max(self, b: Other) -> Self::Result;
+ }
+
+ impl_vec_trait! { [VectorMax vec_max] ~(vmaxub, vmaxsb, vmaxuh, vmaxsh, vmaxuw, vmaxsw) }
+
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ #[cfg_attr(test, assert_instr(vmuleub))]
+ unsafe fn vec_vmuleub(
+ a: vector_unsigned_char,
+ b: vector_unsigned_char,
+ ) -> vector_unsigned_short {
+ vmuleub(a, b)
+ }
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ #[cfg_attr(test, assert_instr(vmulesb))]
+ unsafe fn vec_vmulesb(a: vector_signed_char, b: vector_signed_char) -> vector_signed_short {
+ vmulesb(a, b)
+ }
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ #[cfg_attr(test, assert_instr(vmuleuh))]
+ unsafe fn vec_vmuleuh(
+ a: vector_unsigned_short,
+ b: vector_unsigned_short,
+ ) -> vector_unsigned_int {
+ vmuleuh(a, b)
+ }
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ #[cfg_attr(test, assert_instr(vmulesh))]
+ unsafe fn vec_vmulesh(a: vector_signed_short, b: vector_signed_short) -> vector_signed_int {
+ vmulesh(a, b)
+ }
+
+ pub trait VectorMule<Result> {
+ unsafe fn vec_mule(self, b: Self) -> Result;
+ }
+
+ impl VectorMule<vector_unsigned_short> for vector_unsigned_char {
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn vec_mule(self, b: Self) -> vector_unsigned_short {
+ vmuleub(self, b)
+ }
+ }
+ impl VectorMule<vector_signed_short> for vector_signed_char {
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn vec_mule(self, b: Self) -> vector_signed_short {
+ vmulesb(self, b)
+ }
+ }
+ impl VectorMule<vector_unsigned_int> for vector_unsigned_short {
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn vec_mule(self, b: Self) -> vector_unsigned_int {
+ vmuleuh(self, b)
+ }
+ }
+ impl VectorMule<vector_signed_int> for vector_signed_short {
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn vec_mule(self, b: Self) -> vector_signed_int {
+ vmulesh(self, b)
+ }
+ }
+
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ #[cfg_attr(test, assert_instr(vmuloub))]
+ unsafe fn vec_vmuloub(
+ a: vector_unsigned_char,
+ b: vector_unsigned_char,
+ ) -> vector_unsigned_short {
+ vmuloub(a, b)
+ }
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ #[cfg_attr(test, assert_instr(vmulosb))]
+ unsafe fn vec_vmulosb(a: vector_signed_char, b: vector_signed_char) -> vector_signed_short {
+ vmulosb(a, b)
+ }
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ #[cfg_attr(test, assert_instr(vmulouh))]
+ unsafe fn vec_vmulouh(
+ a: vector_unsigned_short,
+ b: vector_unsigned_short,
+ ) -> vector_unsigned_int {
+ vmulouh(a, b)
+ }
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ #[cfg_attr(test, assert_instr(vmulosh))]
+ unsafe fn vec_vmulosh(a: vector_signed_short, b: vector_signed_short) -> vector_signed_int {
+ vmulosh(a, b)
+ }
+
+ pub trait VectorMulo<Result> {
+ unsafe fn vec_mulo(self, b: Self) -> Result;
+ }
+
+ impl VectorMulo<vector_unsigned_short> for vector_unsigned_char {
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn vec_mulo(self, b: Self) -> vector_unsigned_short {
+ vmuloub(self, b)
+ }
+ }
+ impl VectorMulo<vector_signed_short> for vector_signed_char {
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn vec_mulo(self, b: Self) -> vector_signed_short {
+ vmulosb(self, b)
+ }
+ }
+ impl VectorMulo<vector_unsigned_int> for vector_unsigned_short {
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn vec_mulo(self, b: Self) -> vector_unsigned_int {
+ vmulouh(self, b)
+ }
+ }
+ impl VectorMulo<vector_signed_int> for vector_signed_short {
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn vec_mulo(self, b: Self) -> vector_signed_int {
+ vmulosh(self, b)
+ }
+ }
+
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ #[cfg_attr(test, assert_instr(vsum4ubs))]
+ unsafe fn vec_vsum4ubs(a: vector_unsigned_char, b: vector_unsigned_int) -> vector_unsigned_int {
+ vsum4ubs(a, b)
+ }
+
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ #[cfg_attr(test, assert_instr(vsum4sbs))]
+ unsafe fn vec_vsum4sbs(a: vector_signed_char, b: vector_signed_int) -> vector_signed_int {
+ vsum4sbs(a, b)
+ }
+
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ #[cfg_attr(test, assert_instr(vsum4shs))]
+ unsafe fn vec_vsum4shs(a: vector_signed_short, b: vector_signed_int) -> vector_signed_int {
+ vsum4shs(a, b)
+ }
+
+ pub trait VectorSum4s<Other> {
+ unsafe fn vec_sum4s(self, b: Other) -> Other;
+ }
+
+ impl VectorSum4s<vector_unsigned_int> for vector_unsigned_char {
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn vec_sum4s(self, b: vector_unsigned_int) -> vector_unsigned_int {
+ vsum4ubs(self, b)
+ }
+ }
+
+ impl VectorSum4s<vector_signed_int> for vector_signed_char {
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn vec_sum4s(self, b: vector_signed_int) -> vector_signed_int {
+ vsum4sbs(self, b)
+ }
+ }
+
+ impl VectorSum4s<vector_signed_int> for vector_signed_short {
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn vec_sum4s(self, b: vector_signed_int) -> vector_signed_int {
+ vsum4shs(self, b)
+ }
+ }
+
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ #[cfg_attr(test, assert_instr(vsum2sws))]
+ unsafe fn vec_vsum2sws(a: vector_signed_int, b: vector_signed_int) -> vector_signed_int {
+ vsum2sws(a, b)
+ }
+
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ #[cfg_attr(test, assert_instr(vnmsubfp))]
+ unsafe fn vec_vnmsubfp(a: vector_float, b: vector_float, c: vector_float) -> vector_float {
+ vnmsubfp(a, b, c)
+ }
+
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ #[cfg_attr(test, assert_instr(vmaddfp))]
+ unsafe fn vec_vmaddfp(a: vector_float, b: vector_float, c: vector_float) -> vector_float {
+ vmaddfp(a, b, c)
+ }
+
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ #[cfg_attr(test, assert_instr(vmsumubm))]
+ unsafe fn vec_vmsumubm(
+ a: vector_unsigned_char,
+ b: vector_unsigned_char,
+ c: vector_unsigned_int,
+ ) -> vector_unsigned_int {
+ vmsumubm(a, b, c)
+ }
+
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ #[cfg_attr(test, assert_instr(vmsummbm))]
+ unsafe fn vec_vmsummbm(
+ a: vector_signed_char,
+ b: vector_unsigned_char,
+ c: vector_signed_int,
+ ) -> vector_signed_int {
+ vmsummbm(a, b, c)
+ }
+
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ #[cfg_attr(test, assert_instr(vmsumuhm))]
+ unsafe fn vec_vmsumuhm(
+ a: vector_unsigned_short,
+ b: vector_unsigned_short,
+ c: vector_unsigned_int,
+ ) -> vector_unsigned_int {
+ vmsumuhm(a, b, c)
+ }
+
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ #[cfg_attr(test, assert_instr(vmsumshm))]
+ unsafe fn vec_vmsumshm(
+ a: vector_signed_short,
+ b: vector_signed_short,
+ c: vector_signed_int,
+ ) -> vector_signed_int {
+ vmsumshm(a, b, c)
+ }
+
+ pub trait VectorMsum<B, Other> {
+ unsafe fn vec_msum(self, b: B, c: Other) -> Other;
+ }
+
+ impl VectorMsum<vector_unsigned_char, vector_unsigned_int> for vector_unsigned_char {
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn vec_msum(
+ self,
+ b: vector_unsigned_char,
+ c: vector_unsigned_int,
+ ) -> vector_unsigned_int {
+ vmsumubm(self, b, c)
+ }
+ }
+
+ impl VectorMsum<vector_unsigned_char, vector_signed_int> for vector_signed_char {
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn vec_msum(
+ self,
+ b: vector_unsigned_char,
+ c: vector_signed_int,
+ ) -> vector_signed_int {
+ vmsummbm(self, b, c)
+ }
+ }
+
+ impl VectorMsum<vector_unsigned_short, vector_unsigned_int> for vector_unsigned_short {
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn vec_msum(
+ self,
+ b: vector_unsigned_short,
+ c: vector_unsigned_int,
+ ) -> vector_unsigned_int {
+ vmsumuhm(self, b, c)
+ }
+ }
+
+ impl VectorMsum<vector_signed_short, vector_signed_int> for vector_signed_short {
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn vec_msum(
+ self,
+ b: vector_signed_short,
+ c: vector_signed_int,
+ ) -> vector_signed_int {
+ vmsumshm(self, b, c)
+ }
+ }
+
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ #[cfg_attr(test, assert_instr(vmsumuhs))]
+ unsafe fn vec_vmsumuhs(
+ a: vector_unsigned_short,
+ b: vector_unsigned_short,
+ c: vector_unsigned_int,
+ ) -> vector_unsigned_int {
+ vmsumuhs(a, b, c)
+ }
+
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ #[cfg_attr(test, assert_instr(vmsumshs))]
+ unsafe fn vec_vmsumshs(
+ a: vector_signed_short,
+ b: vector_signed_short,
+ c: vector_signed_int,
+ ) -> vector_signed_int {
+ vmsumshs(a, b, c)
+ }
+
+ pub trait VectorMsums<Other> {
+ unsafe fn vec_msums(self, b: Self, c: Other) -> Other;
+ }
+
+ impl VectorMsums<vector_unsigned_int> for vector_unsigned_short {
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn vec_msums(self, b: Self, c: vector_unsigned_int) -> vector_unsigned_int {
+ vmsumuhs(self, b, c)
+ }
+ }
+
+ impl VectorMsums<vector_signed_int> for vector_signed_short {
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn vec_msums(self, b: Self, c: vector_signed_int) -> vector_signed_int {
+ vmsumshs(self, b, c)
+ }
+ }
+
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ #[cfg_attr(test, assert_instr(vperm))]
+ unsafe fn vec_vperm(
+ a: vector_signed_int,
+ b: vector_signed_int,
+ c: vector_unsigned_char,
+ ) -> vector_signed_int {
+ vperm(a, b, c)
+ }
+
+ pub trait VectorPerm {
+ unsafe fn vec_vperm(self, b: Self, c: vector_unsigned_char) -> Self;
+ }
+
+ macro_rules! vector_perm {
+ {$impl: ident} => {
+ impl VectorPerm for $impl {
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn vec_vperm(self, b: Self, c: vector_unsigned_char) -> Self {
+ transmute(vec_vperm(transmute(self), transmute(b), c))
+ }
+ }
+ }
+ }
+
+ vector_perm! { vector_signed_char }
+ vector_perm! { vector_unsigned_char }
+ vector_perm! { vector_bool_char }
+
+ vector_perm! { vector_signed_short }
+ vector_perm! { vector_unsigned_short }
+ vector_perm! { vector_bool_short }
+
+ vector_perm! { vector_signed_int }
+ vector_perm! { vector_unsigned_int }
+ vector_perm! { vector_bool_int }
+
+ vector_perm! { vector_float }
+
+ pub trait VectorAdd<Other> {
+ type Result;
+ unsafe fn vec_add(self, other: Other) -> Self::Result;
+ }
+
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ #[cfg_attr(test, assert_instr(vaddubm))]
+ pub unsafe fn vec_add_bc_sc(a: vector_bool_char, b: vector_signed_char) -> vector_signed_char {
+ simd_add(transmute(a), b)
+ }
+ impl VectorAdd<vector_signed_char> for vector_bool_char {
+ type Result = vector_signed_char;
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn vec_add(self, other: vector_signed_char) -> Self::Result {
+ vec_add_bc_sc(self, other)
+ }
+ }
+ impl VectorAdd<vector_bool_char> for vector_signed_char {
+ type Result = vector_signed_char;
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn vec_add(self, other: vector_bool_char) -> Self::Result {
+ other.vec_add(self)
+ }
+ }
+
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ #[cfg_attr(test, assert_instr(vaddubm))]
+ pub unsafe fn vec_add_sc_sc(
+ a: vector_signed_char,
+ b: vector_signed_char,
+ ) -> vector_signed_char {
+ simd_add(a, b)
+ }
+ impl VectorAdd<vector_signed_char> for vector_signed_char {
+ type Result = vector_signed_char;
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn vec_add(self, other: vector_signed_char) -> Self::Result {
+ vec_add_sc_sc(self, other)
+ }
+ }
+
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ #[cfg_attr(test, assert_instr(vaddubm))]
+ pub unsafe fn vec_add_bc_uc(
+ a: vector_bool_char,
+ b: vector_unsigned_char,
+ ) -> vector_unsigned_char {
+ simd_add(transmute(a), b)
+ }
+ impl VectorAdd<vector_unsigned_char> for vector_bool_char {
+ type Result = vector_unsigned_char;
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn vec_add(self, other: vector_unsigned_char) -> Self::Result {
+ vec_add_bc_uc(self, other)
+ }
+ }
+ impl VectorAdd<vector_bool_char> for vector_unsigned_char {
+ type Result = vector_unsigned_char;
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn vec_add(self, other: vector_bool_char) -> Self::Result {
+ other.vec_add(self)
+ }
+ }
+
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ #[cfg_attr(test, assert_instr(vaddubm))]
+ pub unsafe fn vec_add_uc_uc(
+ a: vector_unsigned_char,
+ b: vector_unsigned_char,
+ ) -> vector_unsigned_char {
+ simd_add(a, b)
+ }
+ impl VectorAdd<vector_unsigned_char> for vector_unsigned_char {
+ type Result = vector_unsigned_char;
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn vec_add(self, other: vector_unsigned_char) -> Self::Result {
+ vec_add_uc_uc(self, other)
+ }
+ }
+
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ #[cfg_attr(test, assert_instr(vadduhm))]
+ pub unsafe fn vec_add_bs_ss(
+ a: vector_bool_short,
+ b: vector_signed_short,
+ ) -> vector_signed_short {
+ let a: i16x8 = transmute(a);
+ let a: vector_signed_short = simd_cast(a);
+ simd_add(a, b)
+ }
+
+ impl VectorAdd<vector_signed_short> for vector_bool_short {
+ type Result = vector_signed_short;
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn vec_add(self, other: vector_signed_short) -> Self::Result {
+ vec_add_bs_ss(self, other)
+ }
+ }
+ impl VectorAdd<vector_bool_short> for vector_signed_short {
+ type Result = vector_signed_short;
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn vec_add(self, other: vector_bool_short) -> Self::Result {
+ other.vec_add(self)
+ }
+ }
+
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ #[cfg_attr(test, assert_instr(vadduhm))]
+ pub unsafe fn vec_add_ss_ss(
+ a: vector_signed_short,
+ b: vector_signed_short,
+ ) -> vector_signed_short {
+ simd_add(a, b)
+ }
+ impl VectorAdd<vector_signed_short> for vector_signed_short {
+ type Result = vector_signed_short;
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn vec_add(self, other: vector_signed_short) -> Self::Result {
+ vec_add_ss_ss(self, other)
+ }
+ }
+
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ #[cfg_attr(test, assert_instr(vadduhm))]
+ pub unsafe fn vec_add_bs_us(
+ a: vector_bool_short,
+ b: vector_unsigned_short,
+ ) -> vector_unsigned_short {
+ let a: i16x8 = transmute(a);
+ let a: vector_unsigned_short = simd_cast(a);
+ simd_add(a, b)
+ }
+ impl VectorAdd<vector_unsigned_short> for vector_bool_short {
+ type Result = vector_unsigned_short;
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn vec_add(self, other: vector_unsigned_short) -> Self::Result {
+ vec_add_bs_us(self, other)
+ }
+ }
+ impl VectorAdd<vector_bool_short> for vector_unsigned_short {
+ type Result = vector_unsigned_short;
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn vec_add(self, other: vector_bool_short) -> Self::Result {
+ other.vec_add(self)
+ }
+ }
+
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ #[cfg_attr(test, assert_instr(vadduhm))]
+ pub unsafe fn vec_add_us_us(
+ a: vector_unsigned_short,
+ b: vector_unsigned_short,
+ ) -> vector_unsigned_short {
+ simd_add(a, b)
+ }
+
+ impl VectorAdd<vector_unsigned_short> for vector_unsigned_short {
+ type Result = vector_unsigned_short;
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn vec_add(self, other: vector_unsigned_short) -> Self::Result {
+ vec_add_us_us(self, other)
+ }
+ }
+
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ #[cfg_attr(test, assert_instr(vadduwm))]
+ pub unsafe fn vec_add_bi_si(a: vector_bool_int, b: vector_signed_int) -> vector_signed_int {
+ let a: i32x4 = transmute(a);
+ let a: vector_signed_int = simd_cast(a);
+ simd_add(a, b)
+ }
+ impl VectorAdd<vector_signed_int> for vector_bool_int {
+ type Result = vector_signed_int;
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn vec_add(self, other: vector_signed_int) -> Self::Result {
+ vec_add_bi_si(self, other)
+ }
+ }
+ impl VectorAdd<vector_bool_int> for vector_signed_int {
+ type Result = vector_signed_int;
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn vec_add(self, other: vector_bool_int) -> Self::Result {
+ other.vec_add(self)
+ }
+ }
+
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ #[cfg_attr(test, assert_instr(vadduwm))]
+ pub unsafe fn vec_add_si_si(a: vector_signed_int, b: vector_signed_int) -> vector_signed_int {
+ simd_add(a, b)
+ }
+ impl VectorAdd<vector_signed_int> for vector_signed_int {
+ type Result = vector_signed_int;
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn vec_add(self, other: vector_signed_int) -> Self::Result {
+ vec_add_si_si(self, other)
+ }
+ }
+
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ #[cfg_attr(test, assert_instr(vadduwm))]
+ pub unsafe fn vec_add_bi_ui(a: vector_bool_int, b: vector_unsigned_int) -> vector_unsigned_int {
+ let a: i32x4 = transmute(a);
+ let a: vector_unsigned_int = simd_cast(a);
+ simd_add(a, b)
+ }
+ impl VectorAdd<vector_unsigned_int> for vector_bool_int {
+ type Result = vector_unsigned_int;
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn vec_add(self, other: vector_unsigned_int) -> Self::Result {
+ vec_add_bi_ui(self, other)
+ }
+ }
+ impl VectorAdd<vector_bool_int> for vector_unsigned_int {
+ type Result = vector_unsigned_int;
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn vec_add(self, other: vector_bool_int) -> Self::Result {
+ other.vec_add(self)
+ }
+ }
+
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ #[cfg_attr(test, assert_instr(vadduwm))]
+ pub unsafe fn vec_add_ui_ui(
+ a: vector_unsigned_int,
+ b: vector_unsigned_int,
+ ) -> vector_unsigned_int {
+ simd_add(a, b)
+ }
+ impl VectorAdd<vector_unsigned_int> for vector_unsigned_int {
+ type Result = vector_unsigned_int;
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn vec_add(self, other: vector_unsigned_int) -> Self::Result {
+ vec_add_ui_ui(self, other)
+ }
+ }
+
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ #[cfg_attr(test, assert_instr(xvaddsp))]
+ pub unsafe fn vec_add_float_float(a: vector_float, b: vector_float) -> vector_float {
+ simd_add(a, b)
+ }
+
+ impl VectorAdd<vector_float> for vector_float {
+ type Result = vector_float;
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn vec_add(self, other: vector_float) -> Self::Result {
+ vec_add_float_float(self, other)
+ }
+ }
+
+ pub trait VectorMladd<Other> {
+ type Result;
+ unsafe fn vec_mladd(self, b: Other, c: Other) -> Self::Result;
+ }
+
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ #[cfg_attr(test, assert_instr(vmladduhm))]
+ unsafe fn mladd(a: i16x8, b: i16x8, c: i16x8) -> i16x8 {
+ simd_add(simd_mul(a, b), c)
+ }
+
+ macro_rules! vector_mladd {
+ ($a: ident, $bc: ident, $d: ident) => {
+ impl VectorMladd<$bc> for $a {
+ type Result = $d;
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ unsafe fn vec_mladd(self, b: $bc, c: $bc) -> Self::Result {
+ let a: i16x8 = transmute(self);
+ let b: i16x8 = transmute(b);
+ let c: i16x8 = transmute(c);
+
+ transmute(mladd(a, b, c))
+ }
+ }
+ };
+ }
+
+ vector_mladd! { vector_unsigned_short, vector_unsigned_short, vector_unsigned_short }
+ vector_mladd! { vector_unsigned_short, vector_signed_short, vector_signed_short }
+ vector_mladd! { vector_signed_short, vector_unsigned_short, vector_signed_short }
+ vector_mladd! { vector_signed_short, vector_signed_short, vector_signed_short }
+}
+
+/// Vector ld.
+#[inline]
+#[target_feature(enable = "altivec")]
+pub unsafe fn vec_ld<T>(off: i32, p: T) -> <T as sealed::VectorLd>::Result
+where
+ T: sealed::VectorLd,
+{
+ p.vec_ld(off)
+}
+
+/// Vector floor.
+#[inline]
+#[target_feature(enable = "altivec")]
+pub unsafe fn vec_floor(a: vector_float) -> vector_float {
+ sealed::vec_floor(a)
+}
+
+/// Vector expte.
+#[inline]
+#[target_feature(enable = "altivec")]
+pub unsafe fn vec_expte(a: vector_float) -> vector_float {
+ sealed::vec_vexptefp(a)
+}
+
+/// Vector cmplt.
+#[inline]
+#[target_feature(enable = "altivec")]
+pub unsafe fn vec_cmplt<T, U>(a: U, b: T) -> <T as sealed::VectorCmpGt<U>>::Result
+where
+ T: sealed::VectorCmpGt<U>,
+{
+ vec_cmpgt(b, a)
+}
+
+/// Vector cmple.
+#[inline]
+#[target_feature(enable = "altivec")]
+pub unsafe fn vec_cmple(a: vector_float, b: vector_float) -> vector_bool_int {
+ vec_cmpge(b, a)
+}
+
+/// Vector cmpgt.
+#[inline]
+#[target_feature(enable = "altivec")]
+pub unsafe fn vec_cmpgt<T, U>(a: T, b: U) -> <T as sealed::VectorCmpGt<U>>::Result
+where
+ T: sealed::VectorCmpGt<U>,
+{
+ a.vec_cmpgt(b)
+}
+
+/// Vector cmpge.
+#[inline]
+#[target_feature(enable = "altivec")]
+pub unsafe fn vec_cmpge(a: vector_float, b: vector_float) -> vector_bool_int {
+ sealed::vec_vcmpgefp(a, b)
+}
+
+/// Vector cmpeq.
+#[inline]
+#[target_feature(enable = "altivec")]
+pub unsafe fn vec_cmpeq<T, U>(a: T, b: U) -> <T as sealed::VectorCmpEq<U>>::Result
+where
+ T: sealed::VectorCmpEq<U>,
+{
+ a.vec_cmpeq(b)
+}
+
+/// Vector cmpb.
+#[inline]
+#[target_feature(enable = "altivec")]
+pub unsafe fn vec_cmpb(a: vector_float, b: vector_float) -> vector_signed_int {
+ sealed::vec_vcmpbfp(a, b)
+}
+
+/// Vector cmpb.
+#[inline]
+#[target_feature(enable = "altivec")]
+pub unsafe fn vec_ceil(a: vector_float) -> vector_float {
+ sealed::vec_vceil(a)
+}
+
+/// Vector avg.
+#[inline]
+#[target_feature(enable = "altivec")]
+pub unsafe fn vec_avg<T, U>(a: T, b: U) -> <T as sealed::VectorAvg<U>>::Result
+where
+ T: sealed::VectorAvg<U>,
+{
+ a.vec_avg(b)
+}
+
+/// Vector andc.
+#[inline]
+#[target_feature(enable = "altivec")]
+pub unsafe fn vec_andc<T, U>(a: T, b: U) -> <T as sealed::VectorAndc<U>>::Result
+where
+ T: sealed::VectorAndc<U>,
+{
+ a.vec_andc(b)
+}
+
+/// Vector and.
+#[inline]
+#[target_feature(enable = "altivec")]
+pub unsafe fn vec_and<T, U>(a: T, b: U) -> <T as sealed::VectorAnd<U>>::Result
+where
+ T: sealed::VectorAnd<U>,
+{
+ a.vec_and(b)
+}
+
+/// Vector adds.
+#[inline]
+#[target_feature(enable = "altivec")]
+pub unsafe fn vec_adds<T, U>(a: T, b: U) -> <T as sealed::VectorAdds<U>>::Result
+where
+ T: sealed::VectorAdds<U>,
+{
+ a.vec_adds(b)
+}
+
+/// Vector addc.
+#[inline]
+#[target_feature(enable = "altivec")]
+pub unsafe fn vec_addc(a: vector_unsigned_int, b: vector_unsigned_int) -> vector_unsigned_int {
+ sealed::vec_vaddcuw(a, b)
+}
+
+/// Vector abs.
+#[inline]
+#[target_feature(enable = "altivec")]
+pub unsafe fn vec_abs<T>(a: T) -> T
+where
+ T: sealed::VectorAbs,
+{
+ a.vec_abs()
+}
+
+/// Vector abss.
+#[inline]
+#[target_feature(enable = "altivec")]
+pub unsafe fn vec_abss<T>(a: T) -> T
+where
+ T: sealed::VectorAbss,
+{
+ a.vec_abss()
+}
+
+/// Vector splats.
+#[inline]
+#[target_feature(enable = "altivec")]
+pub unsafe fn vec_splats<T>(a: T) -> <T as sealed::VectorSplats>::Result
+where
+ T: sealed::VectorSplats,
+{
+ a.vec_splats()
+}
+
+/// Vector sub.
+#[inline]
+#[target_feature(enable = "altivec")]
+pub unsafe fn vec_sub<T, U>(a: T, b: U) -> <T as sealed::VectorSub<U>>::Result
+where
+ T: sealed::VectorSub<U>,
+{
+ a.vec_sub(b)
+}
+
+/// Vector subs.
+#[inline]
+#[target_feature(enable = "altivec")]
+pub unsafe fn vec_subs<T, U>(a: T, b: U) -> <T as sealed::VectorSubs<U>>::Result
+where
+ T: sealed::VectorSubs<U>,
+{
+ a.vec_subs(b)
+}
+
+/// Vector min.
+#[inline]
+#[target_feature(enable = "altivec")]
+pub unsafe fn vec_min<T, U>(a: T, b: U) -> <T as sealed::VectorMin<U>>::Result
+where
+ T: sealed::VectorMin<U>,
+{
+ a.vec_min(b)
+}
+
+/// Vector max.
+#[inline]
+#[target_feature(enable = "altivec")]
+pub unsafe fn vec_max<T, U>(a: T, b: U) -> <T as sealed::VectorMax<U>>::Result
+where
+ T: sealed::VectorMax<U>,
+{
+ a.vec_max(b)
+}
+
+/// Vector add.
+#[inline]
+#[target_feature(enable = "altivec")]
+pub unsafe fn vec_add<T, U>(a: T, b: U) -> <T as sealed::VectorAdd<U>>::Result
+where
+ T: sealed::VectorAdd<U>,
+{
+ a.vec_add(b)
+}
+
+/// Endian-biased intrinsics
+#[cfg(target_endian = "little")]
+mod endian {
+ use super::*;
+ /// Vector permute.
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ pub unsafe fn vec_perm<T>(a: T, b: T, c: vector_unsigned_char) -> T
+ where
+ T: sealed::VectorPerm,
+ {
+ // vperm has big-endian bias
+ //
+ // Xor the mask and flip the arguments
+ let d = transmute(u8x16::new(
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ ));
+ let c = simd_xor(c, d);
+
+ b.vec_vperm(a, c)
+ }
+
+ /// Vector Sum Across Partial (1/2) Saturated
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ pub unsafe fn vec_sum2s(a: vector_signed_int, b: vector_signed_int) -> vector_signed_int {
+ // vsum2sws has big-endian bias
+ //
+ // swap the even b elements with the odd ones
+ let flip = transmute(u8x16::new(
+ 4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15, 8, 9, 10, 11,
+ ));
+ let b = vec_perm(b, b, flip);
+ let c = vsum2sws(a, b);
+
+ vec_perm(c, c, flip)
+ }
+
+ // Even and Odd are swapped in little-endian
+ /// Vector Multiply Even
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ pub unsafe fn vec_mule<T, U>(a: T, b: T) -> U
+ where
+ T: sealed::VectorMulo<U>,
+ {
+ a.vec_mulo(b)
+ }
+ /// Vector Multiply Odd
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ pub unsafe fn vec_mulo<T, U>(a: T, b: T) -> U
+ where
+ T: sealed::VectorMule<U>,
+ {
+ a.vec_mule(b)
+ }
+}
+
+/// Vector Multiply Add Saturated
+#[inline]
+#[target_feature(enable = "altivec")]
+#[cfg_attr(test, assert_instr(vmhaddshs))]
+pub unsafe fn vec_madds(
+ a: vector_signed_short,
+ b: vector_signed_short,
+ c: vector_signed_short,
+) -> vector_signed_short {
+ vmhaddshs(a, b, c)
+}
+
+/// Vector Multiply Low and Add Unsigned Half Word
+#[inline]
+#[target_feature(enable = "altivec")]
+pub unsafe fn vec_mladd<T, U>(a: T, b: U, c: U) -> <T as sealed::VectorMladd<U>>::Result
+where
+ T: sealed::VectorMladd<U>,
+{
+ a.vec_mladd(b, c)
+}
+
+/// Vector Multiply Round and Add Saturated
+#[inline]
+#[target_feature(enable = "altivec")]
+#[cfg_attr(test, assert_instr(vmhraddshs))]
+pub unsafe fn vec_mradds(
+ a: vector_signed_short,
+ b: vector_signed_short,
+ c: vector_signed_short,
+) -> vector_signed_short {
+ vmhraddshs(a, b, c)
+}
+
+/// Vector Multiply Sum
+#[inline]
+#[target_feature(enable = "altivec")]
+pub unsafe fn vec_msum<T, B, U>(a: T, b: B, c: U) -> U
+where
+ T: sealed::VectorMsum<B, U>,
+{
+ a.vec_msum(b, c)
+}
+
+/// Vector Multiply Sum Saturated
+#[inline]
+#[target_feature(enable = "altivec")]
+pub unsafe fn vec_msums<T, U>(a: T, b: T, c: U) -> U
+where
+ T: sealed::VectorMsums<U>,
+{
+ a.vec_msums(b, c)
+}
+
+/// Vector Multiply Add
+#[inline]
+#[target_feature(enable = "altivec")]
+pub unsafe fn vec_madd(a: vector_float, b: vector_float, c: vector_float) -> vector_float {
+ vmaddfp(a, b, c)
+}
+
+/// Vector Negative Multiply Subtract
+#[inline]
+#[target_feature(enable = "altivec")]
+pub unsafe fn vec_nmsub(a: vector_float, b: vector_float, c: vector_float) -> vector_float {
+ vnmsubfp(a, b, c)
+}
+
+/// Vector Sum Across Partial (1/4) Saturated
+#[inline]
+#[target_feature(enable = "altivec")]
+pub unsafe fn vec_sum4s<T, U>(a: T, b: U) -> U
+where
+ T: sealed::VectorSum4s<U>,
+{
+ a.vec_sum4s(b)
+}
+
+#[cfg(target_endian = "big")]
+mod endian {
+ use super::*;
+ /// Vector permute.
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ pub unsafe fn vec_perm<T>(a: T, b: T, c: vector_unsigned_char) -> T
+ where
+ T: sealed::VectorPerm,
+ {
+ a.vec_vperm(b, c)
+ }
+
+ /// Vector Sum Across Partial (1/2) Saturated
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ pub unsafe fn vec_sum2s(a: vector_signed_int, b: vector_signed_int) -> vector_signed_int {
+ vsum2sws(a, b)
+ }
+
+ /// Vector Multiply Even
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ pub unsafe fn vec_mule<T, U>(a: T, b: T) -> U
+ where
+ T: sealed::VectorMule<U>,
+ {
+ a.vec_mule(b)
+ }
+ /// Vector Multiply Odd
+ #[inline]
+ #[target_feature(enable = "altivec")]
+ pub unsafe fn vec_mulo<T, U>(a: T, b: T) -> U
+ where
+ T: sealed::VectorMulo<U>,
+ {
+ a.vec_mulo(b)
+ }
+}
+
+pub use self::endian::*;
+
+#[cfg(test)]
+mod tests {
+ #[cfg(target_arch = "powerpc")]
+ use crate::core_arch::arch::powerpc::*;
+
+ #[cfg(target_arch = "powerpc64")]
+ use crate::core_arch::arch::powerpc64::*;
+
+ use std::mem::transmute;
+
+ use crate::core_arch::simd::*;
+ use stdarch_test::simd_test;
+
+ macro_rules! test_vec_2 {
+ { $name: ident, $fn:ident, $ty: ident, [$($a:expr),+], [$($b:expr),+], [$($d:expr),+] } => {
+ test_vec_2! { $name, $fn, $ty -> $ty, [$($a),+], [$($b),+], [$($d),+] }
+ };
+ { $name: ident, $fn:ident, $ty: ident -> $ty_out: ident, [$($a:expr),+], [$($b:expr),+], [$($d:expr),+] } => {
+ #[simd_test(enable = "altivec")]
+ unsafe fn $name() {
+ let a: s_t_l!($ty) = transmute($ty::new($($a),+));
+ let b: s_t_l!($ty) = transmute($ty::new($($b),+));
+
+ let d = $ty_out::new($($d),+);
+ let r : $ty_out = transmute($fn(a, b));
+ assert_eq!(d, r);
+ }
+ }
+ }
+
+ macro_rules! test_vec_1 {
+ { $name: ident, $fn:ident, f32x4, [$($a:expr),+], ~[$($d:expr),+] } => {
+ #[simd_test(enable = "altivec")]
+ unsafe fn $name() {
+ let a: vector_float = transmute(f32x4::new($($a),+));
+
+ let d: vector_float = transmute(f32x4::new($($d),+));
+ let r = transmute(vec_cmple(vec_abs(vec_sub($fn(a), d)), vec_splats(std::f32::EPSILON)));
+ let e = m32x4::new(true, true, true, true);
+ assert_eq!(e, r);
+ }
+ };
+ { $name: ident, $fn:ident, $ty: ident, [$($a:expr),+], [$($d:expr),+] } => {
+ test_vec_1! { $name, $fn, $ty -> $ty, [$($a),+], [$($d),+] }
+ };
+ { $name: ident, $fn:ident, $ty: ident -> $ty_out: ident, [$($a:expr),+], [$($d:expr),+] } => {
+ #[simd_test(enable = "altivec")]
+ unsafe fn $name() {
+ let a: s_t_l!($ty) = transmute($ty::new($($a),+));
+
+ let d = $ty_out::new($($d),+);
+ let r : $ty_out = transmute($fn(a));
+ assert_eq!(d, r);
+ }
+ }
+ }
+
+ #[simd_test(enable = "altivec")]
+ unsafe fn test_vec_ld() {
+ let pat = [
+ u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15),
+ u8x16::new(
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
+ ),
+ ];
+
+ for off in 0..16 {
+ let v: u8x16 = transmute(vec_ld(0, (pat.as_ptr() as *const u8).offset(off)));
+ assert_eq!(
+ v,
+ u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)
+ );
+ }
+ for off in 16..32 {
+ let v: u8x16 = transmute(vec_ld(0, (pat.as_ptr() as *const u8).offset(off)));
+ assert_eq!(
+ v,
+ u8x16::new(16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31)
+ );
+ }
+ }
+
+ test_vec_1! { test_vec_floor, vec_floor, f32x4,
+ [1.1, 1.9, -0.5, -0.9],
+ [1.0, 1.0, -1.0, -1.0]
+ }
+
+ test_vec_1! { test_vec_expte, vec_expte, f32x4,
+ [0.0, 2.0, 2.0, -1.0],
+ ~[1.0, 4.0, 4.0, 0.5]
+ }
+
+ test_vec_2! { test_vec_cmpgt_i8, vec_cmpgt, i8x16 -> m8x16,
+ [1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ [0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ [true, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false]
+ }
+
+ test_vec_2! { test_vec_cmpgt_u8, vec_cmpgt, u8x16 -> m8x16,
+ [1, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ [0, 0, 255, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ [true, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false]
+ }
+
+ test_vec_2! { test_vec_cmpgt_i16, vec_cmpgt, i16x8 -> m16x8,
+ [1, -1, 0, 0, 0, 0, 0, 0],
+ [0, 0, -1, 1, 0, 0, 0, 0],
+ [true, false, true, false, false, false, false, false]
+ }
+
+ test_vec_2! { test_vec_cmpgt_u16, vec_cmpgt, u16x8 -> m16x8,
+ [1, 255, 0, 0, 0, 0, 0, 0],
+ [0, 0, 255, 1, 0, 0, 0, 0],
+ [true, true, false, false, false, false, false, false]
+ }
+
+ test_vec_2! { test_vec_cmpgt_i32, vec_cmpgt, i32x4 -> m32x4,
+ [1, -1, 0, 0],
+ [0, -1, 0, 1],
+ [true, false, false, false]
+ }
+
+ test_vec_2! { test_vec_cmpgt_u32, vec_cmpgt, u32x4 -> m32x4,
+ [1, 255, 0, 0],
+ [0, 255, 0, 1],
+ [true, false, false, false]
+ }
+
+ test_vec_2! { test_vec_cmpge, vec_cmpge, f32x4 -> m32x4,
+ [0.1, -0.1, 0.0, 0.99],
+ [0.1, 0.0, 0.1, 1.0],
+ [true, false, false, false]
+ }
+
+ test_vec_2! { test_vec_cmpeq_i8, vec_cmpeq, i8x16 -> m8x16,
+ [1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ [0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ [false, false, false, false, true, true, true, true, true, true, true, true, true, true, true, true]
+ }
+
+ test_vec_2! { test_vec_cmpeq_u8, vec_cmpeq, u8x16 -> m8x16,
+ [1, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ [0, 0, 255, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ [false, false, false, false, true, true, true, true, true, true, true, true, true, true, true, true]
+ }
+
+ test_vec_2! { test_vec_cmpeq_i16, vec_cmpeq, i16x8 -> m16x8,
+ [1, -1, 0, 0, 0, 0, 0, 0],
+ [0, 0, -1, 1, 0, 0, 0, 0],
+ [false, false, false, false, true, true, true, true]
+ }
+
+ test_vec_2! { test_vec_cmpeq_u16, vec_cmpeq, u16x8 -> m16x8,
+ [1, 255, 0, 0, 0, 0, 0, 0],
+ [0, 0, 255, 1, 0, 0, 0, 0],
+ [false, false, false, false, true, true, true, true]
+ }
+
+ test_vec_2! { test_vec_cmpeq_i32, vec_cmpeq, i32x4 -> m32x4,
+ [1, -1, 0, 0],
+ [0, -1, 0, 1],
+ [false, true, true, false]
+ }
+
+ test_vec_2! { test_vec_cmpeq_u32, vec_cmpeq, u32x4 -> m32x4,
+ [1, 255, 0, 0],
+ [0, 255, 0, 1],
+ [false, true, true, false]
+ }
+
+ #[simd_test(enable = "altivec")]
+ unsafe fn test_vec_cmpb() {
+ let a: vector_float = transmute(f32x4::new(0.1, 0.5, 0.6, 0.9));
+ let b: vector_float = transmute(f32x4::new(-0.1, 0.5, -0.6, 0.9));
+ let d = i32x4::new(
+ -0b10000000000000000000000000000000,
+ 0,
+ -0b10000000000000000000000000000000,
+ 0,
+ );
+
+ assert_eq!(d, transmute(vec_cmpb(a, b)));
+ }
+
+ #[simd_test(enable = "altivec")]
+ unsafe fn test_vec_ceil() {
+ let a: vector_float = transmute(f32x4::new(0.1, 0.5, 0.6, 0.9));
+ let d = f32x4::new(1.0, 1.0, 1.0, 1.0);
+
+ assert_eq!(d, transmute(vec_ceil(a)));
+ }
+
+ test_vec_2! { test_vec_andc, vec_andc, i32x4,
+ [0b11001100, 0b11001100, 0b11001100, 0b11001100],
+ [0b00110011, 0b11110011, 0b00001100, 0b10000000],
+ [0b11001100, 0b00001100, 0b11000000, 0b01001100] }
+
+ test_vec_2! { test_vec_and, vec_and, i32x4,
+ [0b11001100, 0b11001100, 0b11001100, 0b11001100],
+ [0b00110011, 0b11110011, 0b00001100, 0b00000000],
+ [0b00000000, 0b11000000, 0b00001100, 0b00000000] }
+
+ macro_rules! test_vec_avg {
+ { $name: ident, $ty: ident, [$($a:expr),+], [$($b:expr),+], [$($d:expr),+] } => {
+ test_vec_2! {$name, vec_avg, $ty, [$($a),+], [$($b),+], [$($d),+] }
+ }
+ }
+
+ test_vec_avg! { test_vec_avg_i32x4, i32x4,
+ [i32::MIN, i32::MAX, 1, -1],
+ [-1, 1, 1, -1],
+ [-1073741824, 1073741824, 1, -1] }
+
+ test_vec_avg! { test_vec_avg_u32x4, u32x4,
+ [u32::MAX, 0, 1, 2],
+ [2, 1, 0, 0],
+ [2147483649, 1, 1, 1] }
+
+ test_vec_avg! { test_vec_avg_i16x8, i16x8,
+ [i16::MIN, i16::MAX, 1, -1, 0, 0, 0, 0],
+ [-1, 1, 1, -1, 0, 0, 0, 0],
+ [-16384, 16384, 1, -1, 0, 0, 0, 0] }
+
+ test_vec_avg! { test_vec_avg_u16x8, u16x8,
+ [u16::MAX, 0, 1, 2, 0, 0, 0, 0],
+ [2, 1, 0, 0, 0, 0, 0, 0],
+ [32769, 1, 1, 1, 0, 0, 0, 0] }
+
+ test_vec_avg! { test_vec_avg_i8x16, i8x16,
+ [i8::MIN, i8::MAX, 1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ [-1, 1, 1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ [-64, 64, 1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] }
+
+ test_vec_avg! { test_vec_avg_u8x16, u8x16,
+ [u8::MAX, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ [2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ [129, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] }
+
+ macro_rules! test_vec_adds {
+ { $name: ident, $ty: ident, [$($a:expr),+], [$($b:expr),+], [$($d:expr),+] } => {
+ test_vec_2! {$name, vec_adds, $ty, [$($a),+], [$($b),+], [$($d),+] }
+ }
+ }
+
+ test_vec_adds! { test_vec_adds_i32x4, i32x4,
+ [i32::MIN, i32::MAX, 1, -1],
+ [-1, 1, 1, -1],
+ [i32::MIN, i32::MAX, 2, -2] }
+
+ test_vec_adds! { test_vec_adds_u32x4, u32x4,
+ [u32::MAX, 0, 1, 2],
+ [2, 1, 0, 0],
+ [u32::MAX, 1, 1, 2] }
+
+ test_vec_adds! { test_vec_adds_i16x8, i16x8,
+ [i16::MIN, i16::MAX, 1, -1, 0, 0, 0, 0],
+ [-1, 1, 1, -1, 0, 0, 0, 0],
+ [i16::MIN, i16::MAX, 2, -2, 0, 0, 0, 0] }
+
+ test_vec_adds! { test_vec_adds_u16x8, u16x8,
+ [u16::MAX, 0, 1, 2, 0, 0, 0, 0],
+ [2, 1, 0, 0, 0, 0, 0, 0],
+ [u16::MAX, 1, 1, 2, 0, 0, 0, 0] }
+
+ test_vec_adds! { test_vec_adds_i8x16, i8x16,
+ [i8::MIN, i8::MAX, 1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ [-1, 1, 1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ [i8::MIN, i8::MAX, 2, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] }
+
+ test_vec_adds! { test_vec_adds_u8x16, u8x16,
+ [u8::MAX, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ [2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ [u8::MAX, 1, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] }
+
+ test_vec_2! { test_vec_addc, vec_addc, u32x4, [u32::MAX, 0, 0, 0], [1, 1, 1, 1], [1, 0, 0, 0] }
+
+ macro_rules! test_vec_abs {
+ { $name: ident, $ty: ident, $a: expr, $d: expr } => {
+ #[simd_test(enable = "altivec")]
+ unsafe fn $name() {
+ let a = vec_splats($a);
+ let a: s_t_l!($ty) = vec_abs(a);
+ let d = $ty::splat($d);
+ assert_eq!(d, transmute(a));
+ }
+ }
+ }
+
+ test_vec_abs! { test_vec_abs_i8, i8x16, -42i8, 42i8 }
+ test_vec_abs! { test_vec_abs_i16, i16x8, -42i16, 42i16 }
+ test_vec_abs! { test_vec_abs_i32, i32x4, -42i32, 42i32 }
+ test_vec_abs! { test_vec_abs_f32, f32x4, -42f32, 42f32 }
+
+ macro_rules! test_vec_abss {
+ { $name: ident, $ty: ident, $a: expr, $d: expr } => {
+ #[simd_test(enable = "altivec")]
+ unsafe fn $name() {
+ let a = vec_splats($a);
+ let a: s_t_l!($ty) = vec_abss(a);
+ let d = $ty::splat($d);
+ assert_eq!(d, transmute(a));
+ }
+ }
+ }
+
+ test_vec_abss! { test_vec_abss_i8, i8x16, -127i8, 127i8 }
+ test_vec_abss! { test_vec_abss_i16, i16x8, -42i16, 42i16 }
+ test_vec_abss! { test_vec_abss_i32, i32x4, -42i32, 42i32 }
+
+ macro_rules! test_vec_splats {
+ { $name: ident, $ty: ident, $a: expr } => {
+ #[simd_test(enable = "altivec")]
+ unsafe fn $name() {
+ let a: s_t_l!($ty) = vec_splats($a);
+ let d = $ty::splat($a);
+ assert_eq!(d, transmute(a));
+ }
+ }
+ }
+
+ test_vec_splats! { test_vec_splats_u8, u8x16, 42u8 }
+ test_vec_splats! { test_vec_splats_u16, u16x8, 42u16 }
+ test_vec_splats! { test_vec_splats_u32, u32x4, 42u32 }
+ test_vec_splats! { test_vec_splats_i8, i8x16, 42i8 }
+ test_vec_splats! { test_vec_splats_i16, i16x8, 42i16 }
+ test_vec_splats! { test_vec_splats_i32, i32x4, 42i32 }
+ test_vec_splats! { test_vec_splats_f32, f32x4, 42f32 }
+
+ macro_rules! test_vec_sub {
+ { $name: ident, $ty: ident, [$($a:expr),+], [$($b:expr),+], [$($d:expr),+] } => {
+ test_vec_2! {$name, vec_sub, $ty, [$($a),+], [$($b),+], [$($d),+] }
+ }
+ }
+
+ test_vec_sub! { test_vec_sub_f32x4, f32x4,
+ [-1.0, 0.0, 1.0, 2.0],
+ [2.0, 1.0, -1.0, -2.0],
+ [-3.0, -1.0, 2.0, 4.0] }
+
+ test_vec_sub! { test_vec_sub_i32x4, i32x4,
+ [-1, 0, 1, 2],
+ [2, 1, -1, -2],
+ [-3, -1, 2, 4] }
+
+ test_vec_sub! { test_vec_sub_u32x4, u32x4,
+ [0, 0, 1, 2],
+ [2, 1, 0, 0],
+ [4294967294, 4294967295, 1, 2] }
+
+ test_vec_sub! { test_vec_sub_i16x8, i16x8,
+ [-1, 0, 1, 2, -1, 0, 1, 2],
+ [2, 1, -1, -2, 2, 1, -1, -2],
+ [-3, -1, 2, 4, -3, -1, 2, 4] }
+
+ test_vec_sub! { test_vec_sub_u16x8, u16x8,
+ [0, 0, 1, 2, 0, 0, 1, 2],
+ [2, 1, 0, 0, 2, 1, 0, 0],
+ [65534, 65535, 1, 2, 65534, 65535, 1, 2] }
+
+ test_vec_sub! { test_vec_sub_i8x16, i8x16,
+ [-1, 0, 1, 2, -1, 0, 1, 2, -1, 0, 1, 2, -1, 0, 1, 2],
+ [2, 1, -1, -2, 2, 1, -1, -2, 2, 1, -1, -2, 2, 1, -1, -2],
+ [-3, -1, 2, 4, -3, -1, 2, 4, -3, -1, 2, 4, -3, -1, 2, 4] }
+
+ test_vec_sub! { test_vec_sub_u8x16, u8x16,
+ [0, 0, 1, 2, 0, 0, 1, 2, 0, 0, 1, 2, 0, 0, 1, 2],
+ [2, 1, 0, 0, 2, 1, 0, 0, 2, 1, 0, 0, 2, 1, 0, 0],
+ [254, 255, 1, 2, 254, 255, 1, 2, 254, 255, 1, 2, 254, 255, 1, 2] }
+
+ macro_rules! test_vec_subs {
+ { $name: ident, $ty: ident, [$($a:expr),+], [$($b:expr),+], [$($d:expr),+] } => {
+ test_vec_2! {$name, vec_subs, $ty, [$($a),+], [$($b),+], [$($d),+] }
+ }
+ }
+
+ test_vec_subs! { test_vec_subs_i32x4, i32x4,
+ [-1, 0, 1, 2],
+ [2, 1, -1, -2],
+ [-3, -1, 2, 4] }
+
+ test_vec_subs! { test_vec_subs_u32x4, u32x4,
+ [0, 0, 1, 2],
+ [2, 1, 0, 0],
+ [0, 0, 1, 2] }
+
+ test_vec_subs! { test_vec_subs_i16x8, i16x8,
+ [-1, 0, 1, 2, -1, 0, 1, 2],
+ [2, 1, -1, -2, 2, 1, -1, -2],
+ [-3, -1, 2, 4, -3, -1, 2, 4] }
+
+ test_vec_subs! { test_vec_subs_u16x8, u16x8,
+ [0, 0, 1, 2, 0, 0, 1, 2],
+ [2, 1, 0, 0, 2, 1, 0, 0],
+ [0, 0, 1, 2, 0, 0, 1, 2] }
+
+ test_vec_subs! { test_vec_subs_i8x16, i8x16,
+ [-1, 0, 1, 2, -1, 0, 1, 2, -1, 0, 1, 2, -1, 0, 1, 2],
+ [2, 1, -1, -2, 2, 1, -1, -2, 2, 1, -1, -2, 2, 1, -1, -2],
+ [-3, -1, 2, 4, -3, -1, 2, 4, -3, -1, 2, 4, -3, -1, 2, 4] }
+
+ test_vec_subs! { test_vec_subs_u8x16, u8x16,
+ [0, 0, 1, 2, 0, 0, 1, 2, 0, 0, 1, 2, 0, 0, 1, 2],
+ [2, 1, 0, 0, 2, 1, 0, 0, 2, 1, 0, 0, 2, 1, 0, 0],
+ [0, 0, 1, 2, 0, 0, 1, 2, 0, 0, 1, 2, 0, 0, 1, 2] }
+
+ macro_rules! test_vec_min {
+ { $name: ident, $ty: ident, [$($a:expr),+], [$($b:expr),+], [$($d:expr),+] } => {
+ #[simd_test(enable = "altivec")]
+ unsafe fn $name() {
+ let a: s_t_l!($ty) = transmute($ty::new($($a),+));
+ let b: s_t_l!($ty) = transmute($ty::new($($b),+));
+
+ let d = $ty::new($($d),+);
+ let r : $ty = transmute(vec_min(a, b));
+ assert_eq!(d, r);
+ }
+ }
+ }
+
+ test_vec_min! { test_vec_min_i32x4, i32x4,
+ [-1, 0, 1, 2],
+ [2, 1, -1, -2],
+ [-1, 0, -1, -2] }
+
+ test_vec_min! { test_vec_min_u32x4, u32x4,
+ [0, 0, 1, 2],
+ [2, 1, 0, 0],
+ [0, 0, 0, 0] }
+
+ test_vec_min! { test_vec_min_i16x8, i16x8,
+ [-1, 0, 1, 2, -1, 0, 1, 2],
+ [2, 1, -1, -2, 2, 1, -1, -2],
+ [-1, 0, -1, -2, -1, 0, -1, -2] }
+
+ test_vec_min! { test_vec_min_u16x8, u16x8,
+ [0, 0, 1, 2, 0, 0, 1, 2],
+ [2, 1, 0, 0, 2, 1, 0, 0],
+ [0, 0, 0, 0, 0, 0, 0, 0] }
+
+ test_vec_min! { test_vec_min_i8x16, i8x16,
+ [-1, 0, 1, 2, -1, 0, 1, 2, -1, 0, 1, 2, -1, 0, 1, 2],
+ [2, 1, -1, -2, 2, 1, -1, -2, 2, 1, -1, -2, 2, 1, -1, -2],
+ [-1, 0, -1, -2, -1, 0, -1, -2, -1, 0, -1, -2, -1, 0, -1, -2] }
+
+ test_vec_min! { test_vec_min_u8x16, u8x16,
+ [0, 0, 1, 2, 0, 0, 1, 2, 0, 0, 1, 2, 0, 0, 1, 2],
+ [2, 1, 0, 0, 2, 1, 0, 0, 2, 1, 0, 0, 2, 1, 0, 0],
+ [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] }
+
+ macro_rules! test_vec_max {
+ { $name: ident, $ty: ident, [$($a:expr),+], [$($b:expr),+], [$($d:expr),+] } => {
+ #[simd_test(enable = "altivec")]
+ unsafe fn $name() {
+ let a: s_t_l!($ty) = transmute($ty::new($($a),+));
+ let b: s_t_l!($ty) = transmute($ty::new($($b),+));
+
+ let d = $ty::new($($d),+);
+ let r : $ty = transmute(vec_max(a, b));
+ assert_eq!(d, r);
+ }
+ }
+ }
+
+ test_vec_max! { test_vec_max_i32x4, i32x4,
+ [-1, 0, 1, 2],
+ [2, 1, -1, -2],
+ [2, 1, 1, 2] }
+
+ test_vec_max! { test_vec_max_u32x4, u32x4,
+ [0, 0, 1, 2],
+ [2, 1, 0, 0],
+ [2, 1, 1, 2] }
+
+ test_vec_max! { test_vec_max_i16x8, i16x8,
+ [-1, 0, 1, 2, -1, 0, 1, 2],
+ [2, 1, -1, -2, 2, 1, -1, -2],
+ [2, 1, 1, 2, 2, 1, 1, 2] }
+
+ test_vec_max! { test_vec_max_u16x8, u16x8,
+ [0, 0, 1, 2, 0, 0, 1, 2],
+ [2, 1, 0, 0, 2, 1, 0, 0],
+ [2, 1, 1, 2, 2, 1, 1, 2] }
+
+ test_vec_max! { test_vec_max_i8x16, i8x16,
+ [-1, 0, 1, 2, -1, 0, 1, 2, -1, 0, 1, 2, -1, 0, 1, 2],
+ [2, 1, -1, -2, 2, 1, -1, -2, 2, 1, -1, -2, 2, 1, -1, -2],
+ [2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2] }
+
+ test_vec_max! { test_vec_max_u8x16, u8x16,
+ [0, 0, 1, 2, 0, 0, 1, 2, 0, 0, 1, 2, 0, 0, 1, 2],
+ [2, 1, 0, 0, 2, 1, 0, 0, 2, 1, 0, 0, 2, 1, 0, 0],
+ [2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2] }
+
+ macro_rules! test_vec_perm {
+ {$name:ident,
+ $shorttype:ident, $longtype:ident,
+ [$($a:expr),+], [$($b:expr),+], [$($c:expr),+], [$($d:expr),+]} => {
+ #[simd_test(enable = "altivec")]
+ unsafe fn $name() {
+ let a: $longtype = transmute($shorttype::new($($a),+));
+ let b: $longtype = transmute($shorttype::new($($b),+));
+ let c: vector_unsigned_char = transmute(u8x16::new($($c),+));
+ let d = $shorttype::new($($d),+);
+
+ let r: $shorttype = transmute(vec_perm(a, b, c));
+ assert_eq!(d, r);
+ }
+ }
+ }
+
+ test_vec_perm! {test_vec_perm_u8x16,
+ u8x16, vector_unsigned_char,
+ [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
+ [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115],
+ [0x00, 0x01, 0x10, 0x11, 0x02, 0x03, 0x12, 0x13,
+ 0x04, 0x05, 0x14, 0x15, 0x06, 0x07, 0x16, 0x17],
+ [0, 1, 100, 101, 2, 3, 102, 103, 4, 5, 104, 105, 6, 7, 106, 107]}
+ test_vec_perm! {test_vec_perm_i8x16,
+ i8x16, vector_signed_char,
+ [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
+ [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115],
+ [0x00, 0x01, 0x10, 0x11, 0x02, 0x03, 0x12, 0x13,
+ 0x04, 0x05, 0x14, 0x15, 0x06, 0x07, 0x16, 0x17],
+ [0, 1, 100, 101, 2, 3, 102, 103, 4, 5, 104, 105, 6, 7, 106, 107]}
+
+ test_vec_perm! {test_vec_perm_m8x16,
+ m8x16, vector_bool_char,
+ [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false],
+ [true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true],
+ [0x00, 0x01, 0x10, 0x11, 0x02, 0x03, 0x12, 0x13,
+ 0x04, 0x05, 0x14, 0x15, 0x06, 0x07, 0x16, 0x17],
+ [false, false, true, true, false, false, true, true, false, false, true, true, false, false, true, true]}
+ test_vec_perm! {test_vec_perm_u16x8,
+ u16x8, vector_unsigned_short,
+ [0, 1, 2, 3, 4, 5, 6, 7],
+ [10, 11, 12, 13, 14, 15, 16, 17],
+ [0x00, 0x01, 0x10, 0x11, 0x02, 0x03, 0x12, 0x13,
+ 0x04, 0x05, 0x14, 0x15, 0x06, 0x07, 0x16, 0x17],
+ [0, 10, 1, 11, 2, 12, 3, 13]}
+ test_vec_perm! {test_vec_perm_i16x8,
+ i16x8, vector_signed_short,
+ [0, 1, 2, 3, 4, 5, 6, 7],
+ [10, 11, 12, 13, 14, 15, 16, 17],
+ [0x00, 0x01, 0x10, 0x11, 0x02, 0x03, 0x12, 0x13,
+ 0x04, 0x05, 0x14, 0x15, 0x06, 0x07, 0x16, 0x17],
+ [0, 10, 1, 11, 2, 12, 3, 13]}
+ test_vec_perm! {test_vec_perm_m16x8,
+ m16x8, vector_bool_short,
+ [false, false, false, false, false, false, false, false],
+ [true, true, true, true, true, true, true, true],
+ [0x00, 0x01, 0x10, 0x11, 0x02, 0x03, 0x12, 0x13,
+ 0x04, 0x05, 0x14, 0x15, 0x06, 0x07, 0x16, 0x17],
+ [false, true, false, true, false, true, false, true]}
+
+ test_vec_perm! {test_vec_perm_u32x4,
+ u32x4, vector_unsigned_int,
+ [0, 1, 2, 3],
+ [10, 11, 12, 13],
+ [0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13,
+ 0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17],
+ [0, 10, 1, 11]}
+ test_vec_perm! {test_vec_perm_i32x4,
+ i32x4, vector_signed_int,
+ [0, 1, 2, 3],
+ [10, 11, 12, 13],
+ [0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13,
+ 0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17],
+ [0, 10, 1, 11]}
+ test_vec_perm! {test_vec_perm_m32x4,
+ m32x4, vector_bool_int,
+ [false, false, false, false],
+ [true, true, true, true],
+ [0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13,
+ 0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17],
+ [false, true, false, true]}
+ test_vec_perm! {test_vec_perm_f32x4,
+ f32x4, vector_float,
+ [0.0, 1.0, 2.0, 3.0],
+ [1.0, 1.1, 1.2, 1.3],
+ [0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13,
+ 0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17],
+ [0.0, 1.0, 1.0, 1.1]}
+
+ #[simd_test(enable = "altivec")]
+ unsafe fn test_vec_madds() {
+ let a: vector_signed_short = transmute(i16x8::new(
+ 0 * 256,
+ 1 * 256,
+ 2 * 256,
+ 3 * 256,
+ 4 * 256,
+ 5 * 256,
+ 6 * 256,
+ 7 * 256,
+ ));
+ let b: vector_signed_short = transmute(i16x8::new(256, 256, 256, 256, 256, 256, 256, 256));
+ let c: vector_signed_short = transmute(i16x8::new(0, 1, 2, 3, 4, 5, 6, 7));
+
+ let d = i16x8::new(0, 3, 6, 9, 12, 15, 18, 21);
+
+ assert_eq!(d, transmute(vec_madds(a, b, c)));
+ }
+
+ #[simd_test(enable = "altivec")]
+ unsafe fn test_vec_madd_float() {
+ let a: vector_float = transmute(f32x4::new(0.1, 0.2, 0.3, 0.4));
+ let b: vector_float = transmute(f32x4::new(0.1, 0.2, 0.3, 0.4));
+ let c: vector_float = transmute(f32x4::new(0.1, 0.2, 0.3, 0.4));
+ let d = f32x4::new(
+ 0.1 * 0.1 + 0.1,
+ 0.2 * 0.2 + 0.2,
+ 0.3 * 0.3 + 0.3,
+ 0.4 * 0.4 + 0.4,
+ );
+
+ assert_eq!(d, transmute(vec_madd(a, b, c)));
+ }
+
+ #[simd_test(enable = "altivec")]
+ unsafe fn test_vec_nmsub_float() {
+ let a: vector_float = transmute(f32x4::new(0.1, 0.2, 0.3, 0.4));
+ let b: vector_float = transmute(f32x4::new(0.1, 0.2, 0.3, 0.4));
+ let c: vector_float = transmute(f32x4::new(0.1, 0.2, 0.3, 0.4));
+ let d = f32x4::new(
+ -(0.1 * 0.1 - 0.1),
+ -(0.2 * 0.2 - 0.2),
+ -(0.3 * 0.3 - 0.3),
+ -(0.4 * 0.4 - 0.4),
+ );
+ assert_eq!(d, transmute(vec_nmsub(a, b, c)));
+ }
+
+ #[simd_test(enable = "altivec")]
+ unsafe fn test_vec_mradds() {
+ let a: vector_signed_short = transmute(i16x8::new(
+ 0 * 256,
+ 1 * 256,
+ 2 * 256,
+ 3 * 256,
+ 4 * 256,
+ 5 * 256,
+ 6 * 256,
+ 7 * 256,
+ ));
+ let b: vector_signed_short = transmute(i16x8::new(256, 256, 256, 256, 256, 256, 256, 256));
+ let c: vector_signed_short = transmute(i16x8::new(0, 1, 2, 3, 4, 5, 6, i16::MAX - 1));
+
+ let d = i16x8::new(0, 3, 6, 9, 12, 15, 18, i16::MAX);
+
+ assert_eq!(d, transmute(vec_mradds(a, b, c)));
+ }
+
+ macro_rules! test_vec_mladd {
+ {$name:ident, $sa:ident, $la:ident, $sbc:ident, $lbc:ident, $sd:ident,
+ [$($a:expr),+], [$($b:expr),+], [$($c:expr),+], [$($d:expr),+]} => {
+ #[simd_test(enable = "altivec")]
+ unsafe fn $name() {
+ let a: $la = transmute($sa::new($($a),+));
+ let b: $lbc = transmute($sbc::new($($b),+));
+ let c = transmute($sbc::new($($c),+));
+ let d = $sd::new($($d),+);
+
+ assert_eq!(d, transmute(vec_mladd(a, b, c)));
+ }
+ }
+ }
+
+ test_vec_mladd! { test_vec_mladd_u16x8_u16x8, u16x8, vector_unsigned_short, u16x8, vector_unsigned_short, u16x8,
+ [0, 1, 2, 3, 4, 5, 6, 7], [0, 1, 2, 3, 4, 5, 6, 7], [0, 1, 2, 3, 4, 5, 6, 7], [0, 2, 6, 12, 20, 30, 42, 56]
+ }
+ test_vec_mladd! { test_vec_mladd_u16x8_i16x8, u16x8, vector_unsigned_short, i16x8, vector_unsigned_short, i16x8,
+ [0, 1, 2, 3, 4, 5, 6, 7], [0, 1, 2, 3, 4, 5, 6, 7], [0, 1, 2, 3, 4, 5, 6, 7], [0, 2, 6, 12, 20, 30, 42, 56]
+ }
+ test_vec_mladd! { test_vec_mladd_i16x8_u16x8, i16x8, vector_signed_short, u16x8, vector_unsigned_short, i16x8,
+ [0, 1, 2, 3, 4, 5, 6, 7], [0, 1, 2, 3, 4, 5, 6, 7], [0, 1, 2, 3, 4, 5, 6, 7], [0, 2, 6, 12, 20, 30, 42, 56]
+ }
+ test_vec_mladd! { test_vec_mladd_i16x8_i16x8, i16x8, vector_signed_short, i16x8, vector_unsigned_short, i16x8,
+ [0, 1, 2, 3, 4, 5, 6, 7], [0, 1, 2, 3, 4, 5, 6, 7], [0, 1, 2, 3, 4, 5, 6, 7], [0, 2, 6, 12, 20, 30, 42, 56]
+ }
+
+ #[simd_test(enable = "altivec")]
+ unsafe fn test_vec_msum_unsigned_char() {
+ let a: vector_unsigned_char =
+ transmute(u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7));
+ let b: vector_unsigned_char = transmute(u8x16::new(
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ ));
+ let c: vector_unsigned_int = transmute(u32x4::new(0, 1, 2, 3));
+ let d = u32x4::new(
+ (0 + 1 + 2 + 3) * 255 + 0,
+ (4 + 5 + 6 + 7) * 255 + 1,
+ (0 + 1 + 2 + 3) * 255 + 2,
+ (4 + 5 + 6 + 7) * 255 + 3,
+ );
+
+ assert_eq!(d, transmute(vec_msum(a, b, c)));
+ }
+
+ #[simd_test(enable = "altivec")]
+ unsafe fn test_vec_msum_signed_char() {
+ let a: vector_signed_char = transmute(i8x16::new(
+ 0, -1, 2, -3, 1, -1, 1, -1, 0, 1, 2, 3, 4, -5, -6, -7,
+ ));
+ let b: vector_unsigned_char =
+ transmute(i8x16::new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1));
+ let c: vector_signed_int = transmute(u32x4::new(0, 1, 2, 3));
+ let d = i32x4::new(
+ (0 - 1 + 2 - 3) + 0,
+ (0) + 1,
+ (0 + 1 + 2 + 3) + 2,
+ (4 - 5 - 6 - 7) + 3,
+ );
+
+ assert_eq!(d, transmute(vec_msum(a, b, c)));
+ }
+ #[simd_test(enable = "altivec")]
+ unsafe fn test_vec_msum_unsigned_short() {
+ let a: vector_unsigned_short = transmute(u16x8::new(
+ 0 * 256,
+ 1 * 256,
+ 2 * 256,
+ 3 * 256,
+ 4 * 256,
+ 5 * 256,
+ 6 * 256,
+ 7 * 256,
+ ));
+ let b: vector_unsigned_short =
+ transmute(u16x8::new(256, 256, 256, 256, 256, 256, 256, 256));
+ let c: vector_unsigned_int = transmute(u32x4::new(0, 1, 2, 3));
+ let d = u32x4::new(
+ (0 + 1) * 256 * 256 + 0,
+ (2 + 3) * 256 * 256 + 1,
+ (4 + 5) * 256 * 256 + 2,
+ (6 + 7) * 256 * 256 + 3,
+ );
+
+ assert_eq!(d, transmute(vec_msum(a, b, c)));
+ }
+
+ #[simd_test(enable = "altivec")]
+ unsafe fn test_vec_msum_signed_short() {
+ let a: vector_signed_short = transmute(i16x8::new(
+ 0 * 256,
+ -1 * 256,
+ 2 * 256,
+ -3 * 256,
+ 4 * 256,
+ -5 * 256,
+ 6 * 256,
+ -7 * 256,
+ ));
+ let b: vector_signed_short = transmute(i16x8::new(256, 256, 256, 256, 256, 256, 256, 256));
+ let c: vector_signed_int = transmute(i32x4::new(0, 1, 2, 3));
+ let d = i32x4::new(
+ (0 - 1) * 256 * 256 + 0,
+ (2 - 3) * 256 * 256 + 1,
+ (4 - 5) * 256 * 256 + 2,
+ (6 - 7) * 256 * 256 + 3,
+ );
+
+ assert_eq!(d, transmute(vec_msum(a, b, c)));
+ }
+
+ #[simd_test(enable = "altivec")]
+ unsafe fn test_vec_msums_unsigned() {
+ let a: vector_unsigned_short = transmute(u16x8::new(
+ 0 * 256,
+ 1 * 256,
+ 2 * 256,
+ 3 * 256,
+ 4 * 256,
+ 5 * 256,
+ 6 * 256,
+ 7 * 256,
+ ));
+ let b: vector_unsigned_short =
+ transmute(u16x8::new(256, 256, 256, 256, 256, 256, 256, 256));
+ let c: vector_unsigned_int = transmute(u32x4::new(0, 1, 2, 3));
+ let d = u32x4::new(
+ (0 + 1) * 256 * 256 + 0,
+ (2 + 3) * 256 * 256 + 1,
+ (4 + 5) * 256 * 256 + 2,
+ (6 + 7) * 256 * 256 + 3,
+ );
+
+ assert_eq!(d, transmute(vec_msums(a, b, c)));
+ }
+
+ #[simd_test(enable = "altivec")]
+ unsafe fn test_vec_msums_signed() {
+ let a: vector_signed_short = transmute(i16x8::new(
+ 0 * 256,
+ -1 * 256,
+ 2 * 256,
+ -3 * 256,
+ 4 * 256,
+ -5 * 256,
+ 6 * 256,
+ -7 * 256,
+ ));
+ let b: vector_signed_short = transmute(i16x8::new(256, 256, 256, 256, 256, 256, 256, 256));
+ let c: vector_signed_int = transmute(i32x4::new(0, 1, 2, 3));
+ let d = i32x4::new(
+ (0 - 1) * 256 * 256 + 0,
+ (2 - 3) * 256 * 256 + 1,
+ (4 - 5) * 256 * 256 + 2,
+ (6 - 7) * 256 * 256 + 3,
+ );
+
+ assert_eq!(d, transmute(vec_msums(a, b, c)));
+ }
+
+ #[simd_test(enable = "altivec")]
+ unsafe fn test_vec_sum2s() {
+ let a: vector_signed_int = transmute(i32x4::new(0, 1, 2, 3));
+ let b: vector_signed_int = transmute(i32x4::new(0, 1, 2, 3));
+ let d = i32x4::new(0, 0 + 1 + 1, 0, 2 + 3 + 3);
+
+ assert_eq!(d, transmute(vec_sum2s(a, b)));
+ }
+
+ #[simd_test(enable = "altivec")]
+ unsafe fn test_vec_sum4s_unsigned_char() {
+ let a: vector_unsigned_char =
+ transmute(u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7));
+ let b: vector_unsigned_int = transmute(u32x4::new(0, 1, 2, 3));
+ let d = u32x4::new(
+ 0 + 1 + 2 + 3 + 0,
+ 4 + 5 + 6 + 7 + 1,
+ 0 + 1 + 2 + 3 + 2,
+ 4 + 5 + 6 + 7 + 3,
+ );
+
+ assert_eq!(d, transmute(vec_sum4s(a, b)));
+ }
+ #[simd_test(enable = "altivec")]
+ unsafe fn test_vec_sum4s_signed_char() {
+ let a: vector_signed_char =
+ transmute(i8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7));
+ let b: vector_signed_int = transmute(i32x4::new(0, 1, 2, 3));
+ let d = i32x4::new(
+ 0 + 1 + 2 + 3 + 0,
+ 4 + 5 + 6 + 7 + 1,
+ 0 + 1 + 2 + 3 + 2,
+ 4 + 5 + 6 + 7 + 3,
+ );
+
+ assert_eq!(d, transmute(vec_sum4s(a, b)));
+ }
+ #[simd_test(enable = "altivec")]
+ unsafe fn test_vec_sum4s_signed_short() {
+ let a: vector_signed_short = transmute(i16x8::new(0, 1, 2, 3, 4, 5, 6, 7));
+ let b: vector_signed_int = transmute(i32x4::new(0, 1, 2, 3));
+ let d = i32x4::new(0 + 1 + 0, 2 + 3 + 1, 4 + 5 + 2, 6 + 7 + 3);
+
+ assert_eq!(d, transmute(vec_sum4s(a, b)));
+ }
+
+ #[simd_test(enable = "altivec")]
+ unsafe fn test_vec_mule_unsigned_char() {
+ let a: vector_unsigned_char =
+ transmute(u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7));
+ let d = u16x8::new(0 * 0, 2 * 2, 4 * 4, 6 * 6, 0 * 0, 2 * 2, 4 * 4, 6 * 6);
+
+ assert_eq!(d, transmute(vec_mule(a, a)));
+ }
+
+ #[simd_test(enable = "altivec")]
+ unsafe fn test_vec_mule_signed_char() {
+ let a: vector_signed_char = transmute(i8x16::new(
+ 0, 1, -2, 3, -4, 5, -6, 7, 0, 1, 2, 3, 4, 5, 6, 7,
+ ));
+ let d = i16x8::new(0 * 0, 2 * 2, 4 * 4, 6 * 6, 0 * 0, 2 * 2, 4 * 4, 6 * 6);
+
+ assert_eq!(d, transmute(vec_mule(a, a)));
+ }
+
+ #[simd_test(enable = "altivec")]
+ unsafe fn test_vec_mule_unsigned_short() {
+ let a: vector_unsigned_short = transmute(u16x8::new(0, 1, 2, 3, 4, 5, 6, 7));
+ let d = u32x4::new(0 * 0, 2 * 2, 4 * 4, 6 * 6);
+
+ assert_eq!(d, transmute(vec_mule(a, a)));
+ }
+
+ #[simd_test(enable = "altivec")]
+ unsafe fn test_vec_mule_signed_short() {
+ let a: vector_signed_short = transmute(i16x8::new(0, 1, -2, 3, -4, 5, -6, 7));
+ let d = i32x4::new(0 * 0, 2 * 2, 4 * 4, 6 * 6);
+
+ assert_eq!(d, transmute(vec_mule(a, a)));
+ }
+
+ #[simd_test(enable = "altivec")]
+ unsafe fn test_vec_mulo_unsigned_char() {
+ let a: vector_unsigned_char =
+ transmute(u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7));
+ let d = u16x8::new(1 * 1, 3 * 3, 5 * 5, 7 * 7, 1 * 1, 3 * 3, 5 * 5, 7 * 7);
+
+ assert_eq!(d, transmute(vec_mulo(a, a)));
+ }
+
+ #[simd_test(enable = "altivec")]
+ unsafe fn test_vec_mulo_signed_char() {
+ let a: vector_signed_char = transmute(i8x16::new(
+ 0, 1, -2, 3, -4, 5, -6, 7, 0, 1, 2, 3, 4, 5, 6, 7,
+ ));
+ let d = i16x8::new(1 * 1, 3 * 3, 5 * 5, 7 * 7, 1 * 1, 3 * 3, 5 * 5, 7 * 7);
+
+ assert_eq!(d, transmute(vec_mulo(a, a)));
+ }
+
+ #[simd_test(enable = "altivec")]
+ unsafe fn test_vec_mulo_unsigned_short() {
+ let a: vector_unsigned_short = transmute(u16x8::new(0, 1, 2, 3, 4, 5, 6, 7));
+ let d = u32x4::new(1 * 1, 3 * 3, 5 * 5, 7 * 7);
+
+ assert_eq!(d, transmute(vec_mulo(a, a)));
+ }
+
+ #[simd_test(enable = "altivec")]
+ unsafe fn test_vec_mulo_signed_short() {
+ let a: vector_signed_short = transmute(i16x8::new(0, 1, -2, 3, -4, 5, -6, 7));
+ let d = i32x4::new(1 * 1, 3 * 3, 5 * 5, 7 * 7);
+
+ assert_eq!(d, transmute(vec_mulo(a, a)));
+ }
+
+ #[simd_test(enable = "altivec")]
+ unsafe fn vec_add_i32x4_i32x4() {
+ let x = i32x4::new(1, 2, 3, 4);
+ let y = i32x4::new(4, 3, 2, 1);
+ let x: vector_signed_int = transmute(x);
+ let y: vector_signed_int = transmute(y);
+ let z = vec_add(x, y);
+ assert_eq!(i32x4::splat(5), transmute(z));
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/powerpc/mod.rs b/library/stdarch/crates/core_arch/src/powerpc/mod.rs
new file mode 100644
index 000000000..9765d11d1
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/powerpc/mod.rs
@@ -0,0 +1,19 @@
+//! PowerPC intrinsics
+
+#[cfg(target_feature = "altivec")]
+mod altivec;
+#[cfg(target_feature = "altivec")]
+pub use self::altivec::*;
+
+mod vsx;
+pub use self::vsx::*;
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+/// Generates the trap instruction `TRAP`
+#[cfg_attr(test, assert_instr(trap))]
+#[inline]
+pub unsafe fn trap() -> ! {
+ crate::intrinsics::abort()
+}
diff --git a/library/stdarch/crates/core_arch/src/powerpc/vsx.rs b/library/stdarch/crates/core_arch/src/powerpc/vsx.rs
new file mode 100644
index 000000000..3141bc8bc
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/powerpc/vsx.rs
@@ -0,0 +1,118 @@
+//! PowerPC Vector Scalar eXtensions (VSX) intrinsics.
+//!
+//! The references are: [POWER ISA v2.07B (for POWER8 & POWER8 with NVIDIA
+//! NVlink)] and [POWER ISA v3.0B (for POWER9)].
+//!
+//! [POWER ISA v2.07B (for POWER8 & POWER8 with NVIDIA NVlink)]: https://ibm.box.com/s/jd5w15gz301s5b5dt375mshpq9c3lh4u
+//! [POWER ISA v3.0B (for POWER9)]: https://ibm.box.com/s/1hzcwkwf8rbju5h9iyf44wm94amnlcrv
+
+#![allow(non_camel_case_types)]
+
+use crate::core_arch::simd_llvm::*;
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+use crate::mem;
+
+types! {
+ // pub struct vector_Float16 = f16x8;
+ /// PowerPC-specific 128-bit wide vector of two packed `i64`
+ pub struct vector_signed_long(i64, i64);
+ /// PowerPC-specific 128-bit wide vector of two packed `u64`
+ pub struct vector_unsigned_long(u64, u64);
+ /// PowerPC-specific 128-bit wide vector mask of two `i64`
+ pub struct vector_bool_long(i64, i64);
+ /// PowerPC-specific 128-bit wide vector of two packed `f64`
+ pub struct vector_double(f64, f64);
+ // pub struct vector_signed_long_long = vector_signed_long;
+ // pub struct vector_unsigned_long_long = vector_unsigned_long;
+ // pub struct vector_bool_long_long = vector_bool_long;
+ // pub struct vector_signed___int128 = i128x1;
+ // pub struct vector_unsigned___int128 = i128x1;
+}
+
+mod sealed {
+ use super::*;
+ use crate::core_arch::simd::*;
+
+ pub trait VectorPermDI {
+ unsafe fn vec_xxpermdi(self, b: Self, dm: u8) -> Self;
+ }
+
+ // xxpermdi has an big-endian bias and extended mnemonics
+ #[inline]
+ #[target_feature(enable = "vsx")]
+ #[cfg_attr(all(test, target_endian = "little"), assert_instr(xxmrgld, dm = 0x0))]
+ #[cfg_attr(all(test, target_endian = "big"), assert_instr(xxspltd, dm = 0x0))]
+ unsafe fn xxpermdi(a: i64x2, b: i64x2, dm: u8) -> i64x2 {
+ match dm & 0b11 {
+ 0 => simd_shuffle2!(a, b, [0b00, 0b10]),
+ 1 => simd_shuffle2!(a, b, [0b01, 0b10]),
+ 2 => simd_shuffle2!(a, b, [0b00, 0b11]),
+ _ => simd_shuffle2!(a, b, [0b01, 0b11]),
+ }
+ }
+
+ macro_rules! vec_xxpermdi {
+ {$impl: ident} => {
+ impl VectorPermDI for $impl {
+ #[inline]
+ #[target_feature(enable = "vsx")]
+ unsafe fn vec_xxpermdi(self, b: Self, dm: u8) -> Self {
+ mem::transmute(xxpermdi(mem::transmute(self), mem::transmute(b), dm))
+ }
+ }
+ }
+ }
+
+ vec_xxpermdi! { vector_unsigned_long }
+ vec_xxpermdi! { vector_signed_long }
+ vec_xxpermdi! { vector_bool_long }
+ vec_xxpermdi! { vector_double }
+}
+
+/// Vector permute.
+#[inline]
+#[target_feature(enable = "vsx")]
+//#[rustc_legacy_const_generics(2)]
+pub unsafe fn vec_xxpermdi<T, const DM: i32>(a: T, b: T) -> T
+where
+ T: sealed::VectorPermDI,
+{
+ static_assert_imm2!(DM);
+ a.vec_xxpermdi(b, DM as u8)
+}
+
+#[cfg(test)]
+mod tests {
+ #[cfg(target_arch = "powerpc")]
+ use crate::core_arch::arch::powerpc::*;
+
+ #[cfg(target_arch = "powerpc64")]
+ use crate::core_arch::arch::powerpc64::*;
+
+ use super::mem;
+ use crate::core_arch::simd::*;
+ use stdarch_test::simd_test;
+
+ macro_rules! test_vec_xxpermdi {
+ {$name:ident, $shorttype:ident, $longtype:ident, [$($a:expr),+], [$($b:expr),+], [$($c:expr),+], [$($d:expr),+]} => {
+ #[simd_test(enable = "vsx")]
+ unsafe fn $name() {
+ let a: $longtype = mem::transmute($shorttype::new($($a),+, $($b),+));
+ let b = mem::transmute($shorttype::new($($c),+, $($d),+));
+
+ assert_eq!($shorttype::new($($a),+, $($c),+), mem::transmute(vec_xxpermdi::<_, 0>(a, b)));
+ assert_eq!($shorttype::new($($b),+, $($c),+), mem::transmute(vec_xxpermdi::<_, 1>(a, b)));
+ assert_eq!($shorttype::new($($a),+, $($d),+), mem::transmute(vec_xxpermdi::<_, 2>(a, b)));
+ assert_eq!($shorttype::new($($b),+, $($d),+), mem::transmute(vec_xxpermdi::<_, 3>(a, b)));
+ }
+ }
+ }
+
+ test_vec_xxpermdi! {test_vec_xxpermdi_u64x2, u64x2, vector_unsigned_long, [0], [1], [2], [3]}
+ test_vec_xxpermdi! {test_vec_xxpermdi_i64x2, i64x2, vector_signed_long, [0], [-1], [2], [-3]}
+ test_vec_xxpermdi! {test_vec_xxpermdi_m64x2, m64x2, vector_bool_long, [false], [true], [false], [true]}
+ test_vec_xxpermdi! {test_vec_xxpermdi_f64x2, f64x2, vector_double, [0.0], [1.0], [2.0], [3.0]}
+}
diff --git a/library/stdarch/crates/core_arch/src/powerpc64/mod.rs b/library/stdarch/crates/core_arch/src/powerpc64/mod.rs
new file mode 100644
index 000000000..3990a0e8d
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/powerpc64/mod.rs
@@ -0,0 +1,8 @@
+//! PowerPC 64
+//!
+//! The reference is the [64-Bit ELF V2 ABI Specification - Power
+//! Architecture].
+//!
+//! [64-Bit ELF V2 ABI Specification - Power Architecture]: http://openpowerfoundation.org/wp-content/uploads/resources/leabi/leabi-20170510.pdf
+
+pub use crate::core_arch::powerpc::*;
diff --git a/library/stdarch/crates/core_arch/src/riscv64/mod.rs b/library/stdarch/crates/core_arch/src/riscv64/mod.rs
new file mode 100644
index 000000000..751b9a860
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/riscv64/mod.rs
@@ -0,0 +1,49 @@
+//! RISC-V RV64 specific intrinsics
+use crate::arch::asm;
+
+/// Loads virtual machine memory by unsigned word integer
+///
+/// This instruction performs an explicit memory access as though `V=1`;
+/// i.e., with the address translation and protection, and the endianness, that apply to memory
+/// accesses in either VS-mode or VU-mode.
+///
+/// This operation is not available under RV32 base instruction set.
+///
+/// This function is unsafe for it accesses the virtual supervisor or user via a `HLV.WU`
+/// instruction which is effectively a dereference to any memory address.
+#[inline]
+pub unsafe fn hlv_wu(src: *const u32) -> u32 {
+ let value: u32;
+ asm!(".insn i 0x73, 0x4, {}, {}, 0x681", out(reg) value, in(reg) src, options(readonly, nostack));
+ value
+}
+
+/// Loads virtual machine memory by double integer
+///
+/// This instruction performs an explicit memory access as though `V=1`;
+/// i.e., with the address translation and protection, and the endianness, that apply to memory
+/// accesses in either VS-mode or VU-mode.
+///
+/// This operation is not available under RV32 base instruction set.
+///
+/// This function is unsafe for it accesses the virtual supervisor or user via a `HLV.D`
+/// instruction which is effectively a dereference to any memory address.
+#[inline]
+pub unsafe fn hlv_d(src: *const i64) -> i64 {
+ let value: i64;
+ asm!(".insn i 0x73, 0x4, {}, {}, 0x6C0", out(reg) value, in(reg) src, options(readonly, nostack));
+ value
+}
+
+/// Stores virtual machine memory by double integer
+///
+/// This instruction performs an explicit memory access as though `V=1`;
+/// i.e., with the address translation and protection, and the endianness, that apply to memory
+/// accesses in either VS-mode or VU-mode.
+///
+/// This function is unsafe for it accesses the virtual supervisor or user via a `HSV.D`
+/// instruction which is effectively a dereference to any memory address.
+#[inline]
+pub unsafe fn hsv_d(dst: *mut i64, src: i64) {
+ asm!(".insn r 0x73, 0x4, 0x37, x0, {}, {}", in(reg) dst, in(reg) src, options(nostack));
+}
diff --git a/library/stdarch/crates/core_arch/src/riscv_shared/mod.rs b/library/stdarch/crates/core_arch/src/riscv_shared/mod.rs
new file mode 100644
index 000000000..347735df1
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/riscv_shared/mod.rs
@@ -0,0 +1,771 @@
+//! Shared RISC-V intrinsics
+
+use crate::arch::asm;
+
+/// Generates the `PAUSE` instruction
+///
+/// The PAUSE instruction is a HINT that indicates the current hart's rate of instruction retirement
+/// should be temporarily reduced or paused. The duration of its effect must be bounded and may be zero.
+#[inline]
+pub fn pause() {
+ unsafe { asm!(".insn i 0x0F, 0, x0, x0, 0x010", options(nomem, nostack)) }
+}
+
+/// Generates the `NOP` instruction
+///
+/// The NOP instruction does not change any architecturally visible state, except for
+/// advancing the `pc` and incrementing any applicable performance counters.
+#[inline]
+pub fn nop() {
+ unsafe { asm!("nop", options(nomem, nostack)) }
+}
+
+/// Generates the `WFI` instruction
+///
+/// The WFI instruction provides a hint to the implementation that the current hart can be stalled
+/// until an interrupt might need servicing. This instruction is a hint,
+/// and a legal implementation is to simply implement WFI as a NOP.
+#[inline]
+pub unsafe fn wfi() {
+ asm!("wfi", options(nomem, nostack))
+}
+
+/// Generates the `FENCE.I` instruction
+///
+/// A FENCE.I instruction ensures that a subsequent instruction fetch on a RISC-V hart will see
+/// any previous data stores already visible to the same RISC-V hart.
+///
+/// FENCE.I does not ensure that other RISC-V harts' instruction fetches will observe the
+/// local hart's stores in a multiprocessor system.
+#[inline]
+pub unsafe fn fence_i() {
+ asm!("fence.i", options(nostack))
+}
+
+/// Supervisor memory management fence for given virtual address and address space
+///
+/// The fence orders only reads and writes made to leaf page table entries corresponding to
+/// the virtual address in parameter `vaddr`, for the address space identified by integer parameter
+/// `asid`. Accesses to global mappings are not ordered. The fence also invalidates all
+/// address-translation cache entries that contain leaf page table entries corresponding to the
+/// virtual address in parameter `vaddr` and that match the address space identified by integer
+/// parameter `asid`, except for entries containing global mappings.
+#[inline]
+pub unsafe fn sfence_vma(vaddr: usize, asid: usize) {
+ asm!("sfence.vma {}, {}", in(reg) vaddr, in(reg) asid, options(nostack))
+}
+
+/// Supervisor memory management fence for given virtual address
+///
+/// The fence orders only reads and writes made to leaf page table entries corresponding to
+/// the virtual address in parameter `vaddr`, for all address spaces.
+/// The fence also invalidates all address-translation cache entries that contain leaf page
+/// table entries corresponding to the virtual address in parameter `vaddr`, for all address spaces.
+#[inline]
+pub unsafe fn sfence_vma_vaddr(vaddr: usize) {
+ asm!("sfence.vma {}, x0", in(reg) vaddr, options(nostack))
+}
+
+/// Supervisor memory management fence for given address space
+///
+/// The fence orders all reads and writes made to any level of the page tables,
+/// but only for the address space identified by integer parameter `asid`.
+///
+/// Accesses to global mappings are not ordered. The fence also invalidates all
+/// address-translation cache entries matching the address space identified by integer
+/// parameter `asid`, except for entries containing global mappings.
+#[inline]
+pub unsafe fn sfence_vma_asid(asid: usize) {
+ asm!("sfence.vma x0, {}", in(reg) asid, options(nostack))
+}
+
+/// Supervisor memory management fence for all address spaces and virtual addresses
+///
+/// The fence orders all reads and writes made to any level of the page
+/// tables, for all address spaces. The fence also invalidates all address-translation cache entries,
+/// for all address spaces.
+#[inline]
+pub unsafe fn sfence_vma_all() {
+ asm!("sfence.vma", options(nostack))
+}
+
+/// Invalidate supervisor translation cache for given virtual address and address space
+///
+/// This instruction invalidates any address-translation cache entries that an
+/// `SFENCE.VMA` instruction with the same values of `vaddr` and `asid` would invalidate.
+#[inline]
+pub unsafe fn sinval_vma(vaddr: usize, asid: usize) {
+ // asm!("sinval.vma {}, {}", in(reg) vaddr, in(reg) asid, options(nostack))
+ asm!(".insn r 0x73, 0, 0x0B, x0, {}, {}", in(reg) vaddr, in(reg) asid, options(nostack))
+}
+
+/// Invalidate supervisor translation cache for given virtual address
+///
+/// This instruction invalidates any address-translation cache entries that an
+/// `SFENCE.VMA` instruction with the same values of `vaddr` and `asid` would invalidate.
+#[inline]
+pub unsafe fn sinval_vma_vaddr(vaddr: usize) {
+ asm!(".insn r 0x73, 0, 0x0B, x0, {}, x0", in(reg) vaddr, options(nostack))
+}
+
+/// Invalidate supervisor translation cache for given address space
+///
+/// This instruction invalidates any address-translation cache entries that an
+/// `SFENCE.VMA` instruction with the same values of `vaddr` and `asid` would invalidate.
+#[inline]
+pub unsafe fn sinval_vma_asid(asid: usize) {
+ asm!(".insn r 0x73, 0, 0x0B, x0, x0, {}", in(reg) asid, options(nostack))
+}
+
+/// Invalidate supervisor translation cache for all address spaces and virtual addresses
+///
+/// This instruction invalidates any address-translation cache entries that an
+/// `SFENCE.VMA` instruction with the same values of `vaddr` and `asid` would invalidate.
+#[inline]
+pub unsafe fn sinval_vma_all() {
+ asm!(".insn r 0x73, 0, 0x0B, x0, x0, x0", options(nostack))
+}
+
+/// Generates the `SFENCE.W.INVAL` instruction
+///
+/// This instruction guarantees that any previous stores already visible to the current RISC-V hart
+/// are ordered before subsequent `SINVAL.VMA` instructions executed by the same hart.
+#[inline]
+pub unsafe fn sfence_w_inval() {
+ // asm!("sfence.w.inval", options(nostack))
+ asm!(".insn i 0x73, 0, x0, x0, 0x180", options(nostack))
+}
+
+/// Generates the `SFENCE.INVAL.IR` instruction
+///
+/// This instruction guarantees that any previous SINVAL.VMA instructions executed by the current hart
+/// are ordered before subsequent implicit references by that hart to the memory-management data structures.
+#[inline]
+pub unsafe fn sfence_inval_ir() {
+ // asm!("sfence.inval.ir", options(nostack))
+ asm!(".insn i 0x73, 0, x0, x0, 0x181", options(nostack))
+}
+
+/// Loads virtual machine memory by signed byte integer
+///
+/// This instruction performs an explicit memory access as though `V=1`;
+/// i.e., with the address translation and protection, and the endianness, that apply to memory
+/// accesses in either VS-mode or VU-mode.
+///
+/// This function is unsafe for it accesses the virtual supervisor or user via a `HLV.B`
+/// instruction which is effectively a dereference to any memory address.
+#[inline]
+pub unsafe fn hlv_b(src: *const i8) -> i8 {
+ let value: i8;
+ asm!(".insn i 0x73, 0x4, {}, {}, 0x600", out(reg) value, in(reg) src, options(readonly, nostack));
+ value
+}
+
+/// Loads virtual machine memory by unsigned byte integer
+///
+/// This instruction performs an explicit memory access as though `V=1`;
+/// i.e., with the address translation and protection, and the endianness, that apply to memory
+/// accesses in either VS-mode or VU-mode.
+///
+/// This function is unsafe for it accesses the virtual supervisor or user via a `HLV.BU`
+/// instruction which is effectively a dereference to any memory address.
+#[inline]
+pub unsafe fn hlv_bu(src: *const u8) -> u8 {
+ let value: u8;
+ asm!(".insn i 0x73, 0x4, {}, {}, 0x601", out(reg) value, in(reg) src, options(readonly, nostack));
+ value
+}
+
+/// Loads virtual machine memory by signed half integer
+///
+/// This instruction performs an explicit memory access as though `V=1`;
+/// i.e., with the address translation and protection, and the endianness, that apply to memory
+/// accesses in either VS-mode or VU-mode.
+///
+/// This function is unsafe for it accesses the virtual supervisor or user via a `HLV.H`
+/// instruction which is effectively a dereference to any memory address.
+#[inline]
+pub unsafe fn hlv_h(src: *const i16) -> i16 {
+ let value: i16;
+ asm!(".insn i 0x73, 0x4, {}, {}, 0x640", out(reg) value, in(reg) src, options(readonly, nostack));
+ value
+}
+
+/// Loads virtual machine memory by unsigned half integer
+///
+/// This instruction performs an explicit memory access as though `V=1`;
+/// i.e., with the address translation and protection, and the endianness, that apply to memory
+/// accesses in either VS-mode or VU-mode.
+///
+/// This function is unsafe for it accesses the virtual supervisor or user via a `HLV.HU`
+/// instruction which is effectively a dereference to any memory address.
+#[inline]
+pub unsafe fn hlv_hu(src: *const u16) -> u16 {
+ let value: u16;
+ asm!(".insn i 0x73, 0x4, {}, {}, 0x641", out(reg) value, in(reg) src, options(readonly, nostack));
+ value
+}
+
+/// Accesses virtual machine instruction by unsigned half integer
+///
+/// This instruction performs an explicit memory access as though `V=1`;
+/// the memory being read must be executable in both stages of address translation,
+/// but read permission is not required.
+///
+/// This function is unsafe for it accesses the virtual supervisor or user via a `HLVX.HU`
+/// instruction which is effectively a dereference to any memory address.
+#[inline]
+pub unsafe fn hlvx_hu(src: *const u16) -> u16 {
+ let insn: u16;
+ asm!(".insn i 0x73, 0x4, {}, {}, 0x643", out(reg) insn, in(reg) src, options(readonly, nostack));
+ insn
+}
+
+/// Loads virtual machine memory by signed word integer
+///
+/// This instruction performs an explicit memory access as though `V=1`;
+/// i.e., with the address translation and protection, and the endianness, that apply to memory
+/// accesses in either VS-mode or VU-mode.
+///
+/// This function is unsafe for it accesses the virtual supervisor or user via a `HLV.W`
+/// instruction which is effectively a dereference to any memory address.
+#[inline]
+pub unsafe fn hlv_w(src: *const i32) -> i32 {
+ let value: i32;
+ asm!(".insn i 0x73, 0x4, {}, {}, 0x680", out(reg) value, in(reg) src, options(readonly, nostack));
+ value
+}
+
+/// Accesses virtual machine instruction by unsigned word integer
+///
+/// This instruction performs an explicit memory access as though `V=1`;
+/// the memory being read must be executable in both stages of address translation,
+/// but read permission is not required.
+///
+/// This function is unsafe for it accesses the virtual supervisor or user via a `HLVX.WU`
+/// instruction which is effectively a dereference to any memory address.
+#[inline]
+pub unsafe fn hlvx_wu(src: *const u32) -> u32 {
+ let insn: u32;
+ asm!(".insn i 0x73, 0x4, {}, {}, 0x683", out(reg) insn, in(reg) src, options(readonly, nostack));
+ insn
+}
+
+/// Stores virtual machine memory by byte integer
+///
+/// This instruction performs an explicit memory access as though `V=1`;
+/// i.e., with the address translation and protection, and the endianness, that apply to memory
+/// accesses in either VS-mode or VU-mode.
+///
+/// This function is unsafe for it accesses the virtual supervisor or user via a `HSV.B`
+/// instruction which is effectively a dereference to any memory address.
+#[inline]
+pub unsafe fn hsv_b(dst: *mut i8, src: i8) {
+ asm!(".insn r 0x73, 0x4, 0x31, x0, {}, {}", in(reg) dst, in(reg) src, options(nostack));
+}
+
+/// Stores virtual machine memory by half integer
+///
+/// This instruction performs an explicit memory access as though `V=1`;
+/// i.e., with the address translation and protection, and the endianness, that apply to memory
+/// accesses in either VS-mode or VU-mode.
+///
+/// This function is unsafe for it accesses the virtual supervisor or user via a `HSV.H`
+/// instruction which is effectively a dereference to any memory address.
+#[inline]
+pub unsafe fn hsv_h(dst: *mut i16, src: i16) {
+ asm!(".insn r 0x73, 0x4, 0x33, x0, {}, {}", in(reg) dst, in(reg) src, options(nostack));
+}
+
+/// Stores virtual machine memory by word integer
+///
+/// This instruction performs an explicit memory access as though `V=1`;
+/// i.e., with the address translation and protection, and the endianness, that apply to memory
+/// accesses in either VS-mode or VU-mode.
+///
+/// This function is unsafe for it accesses the virtual supervisor or user via a `HSV.W`
+/// instruction which is effectively a dereference to any memory address.
+#[inline]
+pub unsafe fn hsv_w(dst: *mut i32, src: i32) {
+ asm!(".insn r 0x73, 0x4, 0x35, x0, {}, {}", in(reg) dst, in(reg) src, options(nostack));
+}
+
+/// Hypervisor memory management fence for given guest virtual address and guest address space
+///
+/// Guarantees that any previous stores already visible to the current hart are ordered before all
+/// implicit reads by that hart done for VS-stage address translation for instructions that:
+/// - are subsequent to the `HFENCE.VVMA`, and
+/// - execute when `hgatp.VMID` has the same setting as it did when `HFENCE.VVMA` executed.
+///
+/// This fence specifies a single guest virtual address, and a single guest address-space identifier.
+#[inline]
+pub unsafe fn hfence_vvma(vaddr: usize, asid: usize) {
+ // asm!("hfence.vvma {}, {}", in(reg) vaddr, in(reg) asid)
+ asm!(".insn r 0x73, 0, 0x11, x0, {}, {}", in(reg) vaddr, in(reg) asid, options(nostack))
+}
+
+/// Hypervisor memory management fence for given guest virtual address
+///
+/// Guarantees that any previous stores already visible to the current hart are ordered before all
+/// implicit reads by that hart done for VS-stage address translation for instructions that:
+/// - are subsequent to the `HFENCE.VVMA`, and
+/// - execute when `hgatp.VMID` has the same setting as it did when `HFENCE.VVMA` executed.
+///
+/// This fence specifies a single guest virtual address.
+#[inline]
+pub unsafe fn hfence_vvma_vaddr(vaddr: usize) {
+ asm!(".insn r 0x73, 0, 0x11, x0, {}, x0", in(reg) vaddr, options(nostack))
+}
+
+/// Hypervisor memory management fence for given guest address space
+///
+/// Guarantees that any previous stores already visible to the current hart are ordered before all
+/// implicit reads by that hart done for VS-stage address translation for instructions that:
+/// - are subsequent to the `HFENCE.VVMA`, and
+/// - execute when `hgatp.VMID` has the same setting as it did when `HFENCE.VVMA` executed.
+///
+/// This fence specifies a single guest address-space identifier.
+#[inline]
+pub unsafe fn hfence_vvma_asid(asid: usize) {
+ asm!(".insn r 0x73, 0, 0x11, x0, x0, {}", in(reg) asid, options(nostack))
+}
+
+/// Hypervisor memory management fence for all guest address spaces and guest virtual addresses
+///
+/// Guarantees that any previous stores already visible to the current hart are ordered before all
+/// implicit reads by that hart done for VS-stage address translation for instructions that:
+/// - are subsequent to the `HFENCE.VVMA`, and
+/// - execute when `hgatp.VMID` has the same setting as it did when `HFENCE.VVMA` executed.
+///
+/// This fence applies to any guest address spaces and guest virtual addresses.
+#[inline]
+pub unsafe fn hfence_vvma_all() {
+ asm!(".insn r 0x73, 0, 0x11, x0, x0, x0", options(nostack))
+}
+
+/// Hypervisor memory management fence for guest physical address and virtual machine
+///
+/// Guarantees that any previous stores already visible to the current hart are ordered before all implicit reads
+/// by that hart done for G-stage address translation for instructions that follow the HFENCE.GVMA.
+///
+/// This fence specifies a single guest physical address, **shifted right by 2 bits**, and a single virtual machine
+/// by virtual machine identifier (VMID).
+#[inline]
+pub unsafe fn hfence_gvma(gaddr: usize, vmid: usize) {
+ // asm!("hfence.gvma {}, {}", in(reg) gaddr, in(reg) vmid, options(nostack))
+ asm!(".insn r 0x73, 0, 0x31, x0, {}, {}", in(reg) gaddr, in(reg) vmid, options(nostack))
+}
+
+/// Hypervisor memory management fence for guest physical address
+///
+/// Guarantees that any previous stores already visible to the current hart are ordered before all implicit reads
+/// by that hart done for G-stage address translation for instructions that follow the HFENCE.GVMA.
+///
+/// This fence specifies a single guest physical address; **the physical address should be shifted right by 2 bits**.
+#[inline]
+pub unsafe fn hfence_gvma_gaddr(gaddr: usize) {
+ asm!(".insn r 0x73, 0, 0x31, x0, {}, x0", in(reg) gaddr, options(nostack))
+}
+
+/// Hypervisor memory management fence for given virtual machine
+///
+/// Guarantees that any previous stores already visible to the current hart are ordered before all implicit reads
+/// by that hart done for G-stage address translation for instructions that follow the HFENCE.GVMA.
+///
+/// This fence specifies a single virtual machine by virtual machine identifier (VMID).
+#[inline]
+pub unsafe fn hfence_gvma_vmid(vmid: usize) {
+ asm!(".insn r 0x73, 0, 0x31, x0, x0, {}", in(reg) vmid, options(nostack))
+}
+
+/// Hypervisor memory management fence for all virtual machines and guest physical addresses
+///
+/// Guarantees that any previous stores already visible to the current hart are ordered before all implicit reads
+/// by that hart done for G-stage address translation for instructions that follow the HFENCE.GVMA.
+///
+/// This fence specifies all guest physical addresses and all virtual machines.
+#[inline]
+pub unsafe fn hfence_gvma_all() {
+ asm!(".insn r 0x73, 0, 0x31, x0, x0, x0", options(nostack))
+}
+
+/// Invalidate hypervisor translation cache for given guest virtual address and guest address space
+///
+/// This instruction invalidates any address-translation cache entries that an
+/// `HFENCE.VVMA` instruction with the same values of `vaddr` and `asid` would invalidate.
+///
+/// This fence specifies a single guest virtual address, and a single guest address-space identifier.
+#[inline]
+pub unsafe fn hinval_vvma(vaddr: usize, asid: usize) {
+ // asm!("hinval.vvma {}, {}", in(reg) vaddr, in(reg) asid, options(nostack))
+ asm!(".insn r 0x73, 0, 0x13, x0, {}, {}", in(reg) vaddr, in(reg) asid, options(nostack))
+}
+
+/// Invalidate hypervisor translation cache for given guest virtual address
+///
+/// This instruction invalidates any address-translation cache entries that an
+/// `HFENCE.VVMA` instruction with the same values of `vaddr` and `asid` would invalidate.
+///
+/// This fence specifies a single guest virtual address.
+#[inline]
+pub unsafe fn hinval_vvma_vaddr(vaddr: usize) {
+ asm!(".insn r 0x73, 0, 0x13, x0, {}, x0", in(reg) vaddr, options(nostack))
+}
+
+/// Invalidate hypervisor translation cache for given guest address space
+///
+/// This instruction invalidates any address-translation cache entries that an
+/// `HFENCE.VVMA` instruction with the same values of `vaddr` and `asid` would invalidate.
+///
+/// This fence specifies a single guest address-space identifier.
+#[inline]
+pub unsafe fn hinval_vvma_asid(asid: usize) {
+ asm!(".insn r 0x73, 0, 0x13, x0, x0, {}", in(reg) asid, options(nostack))
+}
+
+/// Invalidate hypervisor translation cache for all guest address spaces and guest virtual addresses
+///
+/// This instruction invalidates any address-translation cache entries that an
+/// `HFENCE.VVMA` instruction with the same values of `vaddr` and `asid` would invalidate.
+///
+/// This fence applies to any guest address spaces and guest virtual addresses.
+#[inline]
+pub unsafe fn hinval_vvma_all() {
+ asm!(".insn r 0x73, 0, 0x13, x0, x0, x0", options(nostack))
+}
+
+/// Invalidate hypervisor translation cache for guest physical address and virtual machine
+///
+/// This instruction invalidates any address-translation cache entries that an
+/// `HFENCE.GVMA` instruction with the same values of `gaddr` and `vmid` would invalidate.
+///
+/// This fence specifies a single guest physical address, **shifted right by 2 bits**, and a single virtual machine
+/// by virtual machine identifier (VMID).
+#[inline]
+pub unsafe fn hinval_gvma(gaddr: usize, vmid: usize) {
+ // asm!("hinval.gvma {}, {}", in(reg) gaddr, in(reg) vmid, options(nostack))
+ asm!(".insn r 0x73, 0, 0x33, x0, {}, {}", in(reg) gaddr, in(reg) vmid, options(nostack))
+}
+
+/// Invalidate hypervisor translation cache for guest physical address
+///
+/// This instruction invalidates any address-translation cache entries that an
+/// `HFENCE.GVMA` instruction with the same values of `gaddr` and `vmid` would invalidate.
+///
+/// This fence specifies a single guest physical address; **the physical address should be shifted right by 2 bits**.
+#[inline]
+pub unsafe fn hinval_gvma_gaddr(gaddr: usize) {
+ asm!(".insn r 0x73, 0, 0x33, x0, {}, x0", in(reg) gaddr, options(nostack))
+}
+
+/// Invalidate hypervisor translation cache for given virtual machine
+///
+/// This instruction invalidates any address-translation cache entries that an
+/// `HFENCE.GVMA` instruction with the same values of `gaddr` and `vmid` would invalidate.
+///
+/// This fence specifies a single virtual machine by virtual machine identifier (VMID).
+#[inline]
+pub unsafe fn hinval_gvma_vmid(vmid: usize) {
+ asm!(".insn r 0x73, 0, 0x33, x0, x0, {}", in(reg) vmid, options(nostack))
+}
+
+/// Reads the floating-point control and status register `fcsr`
+///
+/// Register `fcsr` is a 32-bit read/write register that selects the dynamic rounding mode
+/// for floating-point arithmetic operations and holds the accrued exception flag.
+///
+/// Accoding to "F" Standard Extension for Single-Precision Floating-Point, Version 2.2,
+/// register `fcsr` is defined as:
+///
+/// | Bit index | Meaning |
+/// |:----------|:--------|
+/// | 0..=4 | Accrued Exceptions (`fflags`) |
+/// | 5..=7 | Rounding Mode (`frm`) |
+/// | 8..=31 | _Reserved_ |
+///
+/// For definition of each field, visit [`frrm`] and [`frflags`].
+///
+/// [`frrm`]: fn.frrm.html
+/// [`frflags`]: fn.frflags.html
+#[inline]
+pub fn frcsr() -> u32 {
+ let value: u32;
+ unsafe { asm!("frcsr {}", out(reg) value, options(nomem, nostack)) };
+ value
+}
+
+/// Swaps the floating-point control and status register `fcsr`
+///
+/// This function swaps the value in `fcsr` by copying the original value to be returned,
+/// and then writing a new value obtained from input variable `value` into `fcsr`.
+#[inline]
+pub fn fscsr(value: u32) -> u32 {
+ let original: u32;
+ unsafe { asm!("fscsr {}, {}", out(reg) original, in(reg) value, options(nomem, nostack)) }
+ original
+}
+
+/// Reads the floating-point rounding mode register `frm`
+///
+/// Accoding to "F" Standard Extension for Single-Precision Floating-Point, Version 2.2,
+/// the rounding mode field is defined as listed in the table below:
+///
+/// | Rounding Mode | Mnemonic | Meaning |
+/// |:-------------|:----------|:---------|
+/// | 000 | RNE | Round to Nearest, ties to Even |
+/// | 001 | RTZ | Round towards Zero |
+/// | 010 | RDN | Round Down (towards −∞) |
+/// | 011 | RUP | Round Up (towards +∞) |
+/// | 100 | RMM | Round to Nearest, ties to Max Magnitude |
+/// | 101 | | _Reserved for future use._ |
+/// | 110 | | _Reserved for future use._ |
+/// | 111 | DYN | In Rounding Mode register, _reserved_. |
+#[inline]
+pub fn frrm() -> u32 {
+ let value: u32;
+ unsafe { asm!("frrm {}", out(reg) value, options(nomem, nostack)) };
+ value
+}
+
+/// Swaps the floating-point rounding mode register `frm`
+///
+/// This function swaps the value in `frm` by copying the original value to be returned,
+/// and then writing a new value obtained from the three least-significant bits of
+/// input variable `value` into `frm`.
+#[inline]
+pub fn fsrm(value: u32) -> u32 {
+ let original: u32;
+ unsafe { asm!("fsrm {}, {}", out(reg) original, in(reg) value, options(nomem, nostack)) }
+ original
+}
+
+/// Reads the floating-point accrued exception flags register `fflags`
+///
+/// The accrued exception flags indicate the exception conditions that have arisen
+/// on any floating-point arithmetic instruction since the field was last reset by software.
+///
+/// Accoding to "F" Standard Extension for Single-Precision Floating-Point, Version 2.2,
+/// the accured exception flags is defined as a bit vector of 5 bits.
+/// The meaning of each binary bit is listed in the table below.
+///
+/// | Bit index | Mnemonic | Meaning |
+/// |:--|:---|:-----------------|
+/// | 4 | NV | Invalid Operation |
+/// | 3 | DZ | Divide by Zero |
+/// | 2 | OF | Overflow |
+/// | 1 | UF | Underflow |
+/// | 0 | NX | Inexact |
+#[inline]
+pub fn frflags() -> u32 {
+ let value: u32;
+ unsafe { asm!("frflags {}", out(reg) value, options(nomem, nostack)) };
+ value
+}
+
+/// Swaps the floating-point accrued exception flags register `fflags`
+///
+/// This function swaps the value in `fflags` by copying the original value to be returned,
+/// and then writing a new value obtained from the five least-significant bits of
+/// input variable `value` into `fflags`.
+#[inline]
+pub fn fsflags(value: u32) -> u32 {
+ let original: u32;
+ unsafe { asm!("fsflags {}, {}", out(reg) original, in(reg) value, options(nomem, nostack)) }
+ original
+}
+
+/// Invalidate hypervisor translation cache for all virtual machines and guest physical addresses
+///
+/// This instruction invalidates any address-translation cache entries that an
+/// `HFENCE.GVMA` instruction with the same values of `gaddr` and `vmid` would invalidate.
+///
+/// This fence specifies all guest physical addresses and all virtual machines.
+#[inline]
+pub unsafe fn hinval_gvma_all() {
+ asm!(".insn r 0x73, 0, 0x33, x0, x0, x0", options(nostack))
+}
+
+/// `P0` transformation function as is used in the SM3 hash algorithm
+///
+/// This function is included in `Zksh` extension. It's defined as:
+///
+/// ```text
+/// P0(X) = X ⊕ (X ≪ 9) ⊕ (X ≪ 17)
+/// ```
+///
+/// where `⊕` represents 32-bit xor, and `≪ k` represents rotate left by `k` bits.
+///
+/// In the SM3 algorithm, the `P0` transformation is used as `E ← P0(TT2)` when the
+/// compression function `CF` uses the intermediate value `TT2` to calculate
+/// the variable `E` in one iteration for subsequent processes.
+///
+/// According to RISC-V Cryptography Extensions, Volume I, the execution latency of
+/// this instruction must always be independent from the data it operates on.
+#[inline]
+pub fn sm3p0(x: u32) -> u32 {
+ let ans: u32;
+ unsafe {
+ // asm!("sm3p0 {}, {}", out(reg) ans, in(reg) x, options(nomem, nostack))
+ asm!(".insn i 0x13, 0x1, {}, {}, 0x108", out(reg) ans, in(reg) x, options(nomem, nostack))
+ };
+ ans
+}
+
+/// `P1` transformation function as is used in the SM3 hash algorithm
+///
+/// This function is included in `Zksh` extension. It's defined as:
+///
+/// ```text
+/// P1(X) = X ⊕ (X ≪ 15) ⊕ (X ≪ 23)
+/// ```
+///
+/// where `⊕` represents 32-bit xor, and `≪ k` represents rotate left by `k` bits.
+///
+/// In the SM3 algorithm, the `P1` transformation is used to expand message,
+/// where expanded word `Wj` can be generated from the previous words.
+/// The whole process can be described as the following pseudocode:
+///
+/// ```text
+/// FOR j=16 TO 67
+/// Wj ← P1(Wj−16 ⊕ Wj−9 ⊕ (Wj−3 ≪ 15)) ⊕ (Wj−13 ≪ 7) ⊕ Wj−6
+/// ENDFOR
+/// ```
+///
+/// According to RISC-V Cryptography Extensions, Volume I, the execution latency of
+/// this instruction must always be independent from the data it operates on.
+#[inline]
+pub fn sm3p1(x: u32) -> u32 {
+ let ans: u32;
+ unsafe {
+ // asm!("sm3p1 {}, {}", out(reg) ans, in(reg) x, options(nomem, nostack))
+ asm!(".insn i 0x13, 0x1, {}, {}, 0x109", out(reg) ans, in(reg) x, options(nomem, nostack))
+ };
+ ans
+}
+
+/// Accelerates the round function `F` in the SM4 block cipher algorithm
+///
+/// This instruction is included in extension `Zksed`. It's defined as:
+///
+/// ```text
+/// SM4ED(x, a, BS) = x ⊕ T(ai)
+/// ... where
+/// ai = a.bytes[BS]
+/// T(ai) = L(τ(ai))
+/// bi = τ(ai) = SM4-S-Box(ai)
+/// ci = L(bi) = bi ⊕ (bi ≪ 2) ⊕ (bi ≪ 10) ⊕ (bi ≪ 18) ⊕ (bi ≪ 24)
+/// SM4ED = (ci ≪ (BS * 8)) ⊕ x
+/// ```
+///
+/// where `⊕` represents 32-bit xor, and `≪ k` represents rotate left by `k` bits.
+/// As is defined above, `T` is a combined transformation of non linear S-Box transform `τ`
+/// and linear layer transform `L`.
+///
+/// In the SM4 algorithm, the round function `F` is defined as:
+///
+/// ```text
+/// F(x0, x1, x2, x3, rk) = x0 ⊕ T(x1 ⊕ x2 ⊕ x3 ⊕ rk)
+/// ... where
+/// T(A) = L(τ(A))
+/// B = τ(A) = (SM4-S-Box(a0), SM4-S-Box(a1), SM4-S-Box(a2), SM4-S-Box(a3))
+/// C = L(B) = B ⊕ (B ≪ 2) ⊕ (B ≪ 10) ⊕ (B ≪ 18) ⊕ (B ≪ 24)
+/// ```
+///
+/// It can be implemented by `sm4ed` instruction like:
+///
+/// ```no_run
+/// let a = x1 ^ x2 ^ x3 ^ rk;
+/// let c0 = sm4ed::<0>(x0, a);
+/// let c1 = sm4ed::<1>(c0, a); // c1 represents c[0..=1], etc.
+/// let c2 = sm4ed::<2>(c1, a);
+/// let c3 = sm4ed::<3>(c2, a);
+/// return c3; // c3 represents c[0..=3]
+/// ```
+///
+/// According to RISC-V Cryptography Extensions, Volume I, the execution latency of
+/// this instruction must always be independent from the data it operates on.
+pub fn sm4ed<const BS: u8>(x: u32, a: u32) -> u32 {
+ static_assert!(BS: u8 where BS <= 3);
+ let ans: u32;
+ match BS {
+ 0 => unsafe {
+ asm!(".insn r 0x33, 0, 0x18, {}, {}, {}", out(reg) ans, in(reg) x, in(reg) a, options(nomem, nostack))
+ },
+ 1 => unsafe {
+ asm!(".insn r 0x33, 0, 0x38, {}, {}, {}", out(reg) ans, in(reg) x, in(reg) a, options(nomem, nostack))
+ },
+ 2 => unsafe {
+ asm!(".insn r 0x33, 0, 0x58, {}, {}, {}", out(reg) ans, in(reg) x, in(reg) a, options(nomem, nostack))
+ },
+ 3 => unsafe {
+ asm!(".insn r 0x33, 0, 0x78, {}, {}, {}", out(reg) ans, in(reg) x, in(reg) a, options(nomem, nostack))
+ },
+ _ => unreachable!(),
+ };
+ ans
+}
+
+/// Accelerates the key schedule operation in the SM4 block cipher algorithm
+///
+/// This instruction is included in extension `Zksed`. It's defined as:
+///
+/// ```text
+/// SM4KS(x, k, BS) = x ⊕ T'(ki)
+/// ... where
+/// ki = k.bytes[BS]
+/// T'(ki) = L'(τ(ki))
+/// bi = τ(ki) = SM4-S-Box(ki)
+/// ci = L'(bi) = bi ⊕ (bi ≪ 13) ⊕ (bi ≪ 23)
+/// SM4KS = (ci ≪ (BS * 8)) ⊕ x
+/// ```
+///
+/// where `⊕` represents 32-bit xor, and `≪ k` represents rotate left by `k` bits.
+/// As is defined above, `T'` is a combined transformation of non linear S-Box transform `τ`
+/// and the replaced linear layer transform `L'`.
+///
+/// In the SM4 algorithm, the key schedule is defined as:
+///
+/// ```text
+/// rk[i] = K[i+4] = K[i] ⊕ T'(K[i+1] ⊕ K[i+2] ⊕ K[i+3] ⊕ CK[i])
+/// ... where
+/// K[0..=3] = MK[0..=3] ⊕ FK[0..=3]
+/// T'(K) = L'(τ(K))
+/// B = τ(K) = (SM4-S-Box(k0), SM4-S-Box(k1), SM4-S-Box(k2), SM4-S-Box(k3))
+/// C = L'(B) = B ⊕ (B ≪ 13) ⊕ (B ≪ 23)
+/// ```
+///
+/// where `MK` represents the input 128-bit encryption key,
+/// constants `FK` and `CK` are fixed system configuration constant values defined by the SM4 algorithm.
+/// Hence, the key schedule operation can be implemented by `sm4ks` instruction like:
+///
+/// ```no_run
+/// let k = k1 ^ k2 ^ k3 ^ ck_i;
+/// let c0 = sm4ks::<0>(k0, k);
+/// let c1 = sm4ks::<1>(c0, k); // c1 represents c[0..=1], etc.
+/// let c2 = sm4ks::<2>(c1, k);
+/// let c3 = sm4ks::<3>(c2, k);
+/// return c3; // c3 represents c[0..=3]
+/// ```
+///
+/// According to RISC-V Cryptography Extensions, Volume I, the execution latency of
+/// this instruction must always be independent from the data it operates on.
+pub fn sm4ks<const BS: u8>(x: u32, k: u32) -> u32 {
+ static_assert!(BS: u8 where BS <= 3);
+ let ans: u32;
+ match BS {
+ 0 => unsafe {
+ asm!(".insn r 0x33, 0, 0x1A, {}, {}, {}", out(reg) ans, in(reg) x, in(reg) k, options(nomem, nostack))
+ },
+ 1 => unsafe {
+ asm!(".insn r 0x33, 0, 0x3A, {}, {}, {}", out(reg) ans, in(reg) x, in(reg) k, options(nomem, nostack))
+ },
+ 2 => unsafe {
+ asm!(".insn r 0x33, 0, 0x5A, {}, {}, {}", out(reg) ans, in(reg) x, in(reg) k, options(nomem, nostack))
+ },
+ 3 => unsafe {
+ asm!(".insn r 0x33, 0, 0x7A, {}, {}, {}", out(reg) ans, in(reg) x, in(reg) k, options(nomem, nostack))
+ },
+ _ => unreachable!(),
+ };
+ ans
+}
diff --git a/library/stdarch/crates/core_arch/src/simd.rs b/library/stdarch/crates/core_arch/src/simd.rs
new file mode 100644
index 000000000..281fefba4
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/simd.rs
@@ -0,0 +1,1105 @@
+//! Internal `#[repr(simd)]` types
+
+#![allow(non_camel_case_types)]
+
+macro_rules! simd_ty {
+ ($id:ident [$ety:ident]: $($elem_ty:ident),* | $($elem_name:ident),*) => {
+ #[repr(simd)]
+ #[derive(Copy, Clone, Debug, PartialEq)]
+ pub(crate) struct $id($(pub $elem_ty),*);
+
+ #[allow(clippy::use_self)]
+ impl $id {
+ #[inline(always)]
+ pub(crate) const fn new($($elem_name: $elem_ty),*) -> Self {
+ $id($($elem_name),*)
+ }
+ // FIXME: Workaround rust@60637
+ #[inline(always)]
+ pub(crate) const fn splat(value: $ety) -> Self {
+ $id($({
+ #[allow(non_camel_case_types, dead_code)]
+ struct $elem_name;
+ value
+ }),*)
+ }
+
+ // FIXME: Workaround rust@60637
+ #[inline(always)]
+ pub(crate) fn extract(self, index: usize) -> $ety {
+ unsafe {
+ crate::core_arch::simd_llvm::simd_extract(self, index as u32)
+ }
+ }
+ }
+ }
+}
+
+macro_rules! simd_m_ty {
+ ($id:ident [$ety:ident]: $($elem_ty:ident),* | $($elem_name:ident),*) => {
+ #[repr(simd)]
+ #[derive(Copy, Clone, Debug, PartialEq)]
+ pub(crate) struct $id($(pub $elem_ty),*);
+
+ #[allow(clippy::use_self)]
+ impl $id {
+ #[inline(always)]
+ const fn bool_to_internal(x: bool) -> $ety {
+ [0 as $ety, !(0 as $ety)][x as usize]
+ }
+
+ #[inline(always)]
+ pub(crate) const fn new($($elem_name: bool),*) -> Self {
+ $id($(Self::bool_to_internal($elem_name)),*)
+ }
+
+ // FIXME: Workaround rust@60637
+ #[inline(always)]
+ pub(crate) const fn splat(value: bool) -> Self {
+ $id($({
+ #[allow(non_camel_case_types, dead_code)]
+ struct $elem_name;
+ Self::bool_to_internal(value)
+ }),*)
+ }
+
+ // FIXME: Workaround rust@60637
+ #[inline(always)]
+ pub(crate) fn extract(self, index: usize) -> bool {
+ let r: $ety = unsafe {
+ crate::core_arch::simd_llvm::simd_extract(self, index as u32)
+ };
+ r != 0
+ }
+ }
+ }
+}
+
+// 16-bit wide types:
+
+simd_ty!(u8x2[u8]: u8, u8 | x0, x1);
+simd_ty!(i8x2[i8]: i8, i8 | x0, x1);
+
+// 32-bit wide types:
+
+simd_ty!(u8x4[u8]: u8, u8, u8, u8 | x0, x1, x2, x3);
+simd_ty!(u16x2[u16]: u16, u16 | x0, x1);
+
+simd_ty!(i8x4[i8]: i8, i8, i8, i8 | x0, x1, x2, x3);
+simd_ty!(i16x2[i16]: i16, i16 | x0, x1);
+
+// 64-bit wide types:
+
+simd_ty!(
+ u8x8[u8]: u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8 | x0,
+ x1,
+ x2,
+ x3,
+ x4,
+ x5,
+ x6,
+ x7
+);
+simd_ty!(u16x4[u16]: u16, u16, u16, u16 | x0, x1, x2, x3);
+simd_ty!(u32x2[u32]: u32, u32 | x0, x1);
+simd_ty!(u64x1[u64]: u64 | x1);
+
+simd_ty!(
+ i8x8[i8]: i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8 | x0,
+ x1,
+ x2,
+ x3,
+ x4,
+ x5,
+ x6,
+ x7
+);
+simd_ty!(i16x4[i16]: i16, i16, i16, i16 | x0, x1, x2, x3);
+simd_ty!(i32x2[i32]: i32, i32 | x0, x1);
+simd_ty!(i64x1[i64]: i64 | x1);
+
+simd_ty!(f32x2[f32]: f32, f32 | x0, x1);
+simd_ty!(f64x1[f64]: f64 | x1);
+
+// 128-bit wide types:
+
+simd_ty!(
+ u8x16[u8]: u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8 | x0,
+ x1,
+ x2,
+ x3,
+ x4,
+ x5,
+ x6,
+ x7,
+ x8,
+ x9,
+ x10,
+ x11,
+ x12,
+ x13,
+ x14,
+ x15
+);
+simd_ty!(
+ u16x8[u16]: u16,
+ u16,
+ u16,
+ u16,
+ u16,
+ u16,
+ u16,
+ u16 | x0,
+ x1,
+ x2,
+ x3,
+ x4,
+ x5,
+ x6,
+ x7
+);
+simd_ty!(u32x4[u32]: u32, u32, u32, u32 | x0, x1, x2, x3);
+simd_ty!(u64x2[u64]: u64, u64 | x0, x1);
+
+simd_ty!(
+ i8x16[i8]: i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8 | x0,
+ x1,
+ x2,
+ x3,
+ x4,
+ x5,
+ x6,
+ x7,
+ x8,
+ x9,
+ x10,
+ x11,
+ x12,
+ x13,
+ x14,
+ x15
+);
+simd_ty!(
+ i16x8[i16]: i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16 | x0,
+ x1,
+ x2,
+ x3,
+ x4,
+ x5,
+ x6,
+ x7
+);
+simd_ty!(i32x4[i32]: i32, i32, i32, i32 | x0, x1, x2, x3);
+simd_ty!(i64x2[i64]: i64, i64 | x0, x1);
+
+simd_ty!(f32x4[f32]: f32, f32, f32, f32 | x0, x1, x2, x3);
+simd_ty!(f64x2[f64]: f64, f64 | x0, x1);
+simd_ty!(f64x4[f64]: f64, f64, f64, f64 | x0, x1, x2, x3);
+
+simd_m_ty!(
+ m8x16[i8]: i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8 | x0,
+ x1,
+ x2,
+ x3,
+ x4,
+ x5,
+ x6,
+ x7,
+ x8,
+ x9,
+ x10,
+ x11,
+ x12,
+ x13,
+ x14,
+ x15
+);
+simd_m_ty!(
+ m16x8[i16]: i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16 | x0,
+ x1,
+ x2,
+ x3,
+ x4,
+ x5,
+ x6,
+ x7
+);
+simd_m_ty!(m32x4[i32]: i32, i32, i32, i32 | x0, x1, x2, x3);
+simd_m_ty!(m64x2[i64]: i64, i64 | x0, x1);
+
+// 256-bit wide types:
+
+simd_ty!(
+ u8x32[u8]: u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8 | x0,
+ x1,
+ x2,
+ x3,
+ x4,
+ x5,
+ x6,
+ x7,
+ x8,
+ x9,
+ x10,
+ x11,
+ x12,
+ x13,
+ x14,
+ x15,
+ x16,
+ x17,
+ x18,
+ x19,
+ x20,
+ x21,
+ x22,
+ x23,
+ x24,
+ x25,
+ x26,
+ x27,
+ x28,
+ x29,
+ x30,
+ x31
+);
+simd_ty!(
+ u16x16[u16]: u16,
+ u16,
+ u16,
+ u16,
+ u16,
+ u16,
+ u16,
+ u16,
+ u16,
+ u16,
+ u16,
+ u16,
+ u16,
+ u16,
+ u16,
+ u16 | x0,
+ x1,
+ x2,
+ x3,
+ x4,
+ x5,
+ x6,
+ x7,
+ x8,
+ x9,
+ x10,
+ x11,
+ x12,
+ x13,
+ x14,
+ x15
+);
+simd_ty!(
+ u32x8[u32]: u32,
+ u32,
+ u32,
+ u32,
+ u32,
+ u32,
+ u32,
+ u32 | x0,
+ x1,
+ x2,
+ x3,
+ x4,
+ x5,
+ x6,
+ x7
+);
+simd_ty!(u64x4[u64]: u64, u64, u64, u64 | x0, x1, x2, x3);
+
+simd_ty!(
+ i8x32[i8]: i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8 | x0,
+ x1,
+ x2,
+ x3,
+ x4,
+ x5,
+ x6,
+ x7,
+ x8,
+ x9,
+ x10,
+ x11,
+ x12,
+ x13,
+ x14,
+ x15,
+ x16,
+ x17,
+ x18,
+ x19,
+ x20,
+ x21,
+ x22,
+ x23,
+ x24,
+ x25,
+ x26,
+ x27,
+ x28,
+ x29,
+ x30,
+ x31
+);
+simd_ty!(
+ i16x16[i16]: i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16 | x0,
+ x1,
+ x2,
+ x3,
+ x4,
+ x5,
+ x6,
+ x7,
+ x8,
+ x9,
+ x10,
+ x11,
+ x12,
+ x13,
+ x14,
+ x15
+);
+simd_ty!(
+ i32x8[i32]: i32,
+ i32,
+ i32,
+ i32,
+ i32,
+ i32,
+ i32,
+ i32 | x0,
+ x1,
+ x2,
+ x3,
+ x4,
+ x5,
+ x6,
+ x7
+);
+simd_ty!(i64x4[i64]: i64, i64, i64, i64 | x0, x1, x2, x3);
+
+simd_ty!(
+ f32x8[f32]: f32,
+ f32,
+ f32,
+ f32,
+ f32,
+ f32,
+ f32,
+ f32 | x0,
+ x1,
+ x2,
+ x3,
+ x4,
+ x5,
+ x6,
+ x7
+);
+
+// 512-bit wide types:
+
+simd_ty!(
+ i8x64[i8]: i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8,
+ i8 | x0,
+ x1,
+ x2,
+ x3,
+ x4,
+ x5,
+ x6,
+ x7,
+ x8,
+ x9,
+ x10,
+ x11,
+ x12,
+ x13,
+ x14,
+ x15,
+ x16,
+ x17,
+ x18,
+ x19,
+ x20,
+ x21,
+ x22,
+ x23,
+ x24,
+ x25,
+ x26,
+ x27,
+ x28,
+ x29,
+ x30,
+ x31,
+ x32,
+ x33,
+ x34,
+ x35,
+ x36,
+ x37,
+ x38,
+ x39,
+ x40,
+ x41,
+ x42,
+ x43,
+ x44,
+ x45,
+ x46,
+ x47,
+ x48,
+ x49,
+ x50,
+ x51,
+ x52,
+ x53,
+ x54,
+ x55,
+ x56,
+ x57,
+ x58,
+ x59,
+ x60,
+ x61,
+ x62,
+ x63
+);
+
+simd_ty!(
+ u8x64[u8]: u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+ u8 | x0,
+ x1,
+ x2,
+ x3,
+ x4,
+ x5,
+ x6,
+ x7,
+ x8,
+ x9,
+ x10,
+ x11,
+ x12,
+ x13,
+ x14,
+ x15,
+ x16,
+ x17,
+ x18,
+ x19,
+ x20,
+ x21,
+ x22,
+ x23,
+ x24,
+ x25,
+ x26,
+ x27,
+ x28,
+ x29,
+ x30,
+ x31,
+ x32,
+ x33,
+ x34,
+ x35,
+ x36,
+ x37,
+ x38,
+ x39,
+ x40,
+ x41,
+ x42,
+ x43,
+ x44,
+ x45,
+ x46,
+ x47,
+ x48,
+ x49,
+ x50,
+ x51,
+ x52,
+ x53,
+ x54,
+ x55,
+ x56,
+ x57,
+ x58,
+ x59,
+ x60,
+ x61,
+ x62,
+ x63
+);
+
+simd_ty!(
+ i16x32[i16]: i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16,
+ i16 | x0,
+ x1,
+ x2,
+ x3,
+ x4,
+ x5,
+ x6,
+ x7,
+ x8,
+ x9,
+ x10,
+ x11,
+ x12,
+ x13,
+ x14,
+ x15,
+ x16,
+ x17,
+ x18,
+ x19,
+ x20,
+ x21,
+ x22,
+ x23,
+ x24,
+ x25,
+ x26,
+ x27,
+ x28,
+ x29,
+ x30,
+ x31
+);
+
+simd_ty!(
+ u16x32[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,
+ u16 | x0,
+ x1,
+ x2,
+ x3,
+ x4,
+ x5,
+ x6,
+ x7,
+ x8,
+ x9,
+ x10,
+ x11,
+ x12,
+ x13,
+ x14,
+ x15,
+ x16,
+ x17,
+ x18,
+ x19,
+ x20,
+ x21,
+ x22,
+ x23,
+ x24,
+ x25,
+ x26,
+ x27,
+ x28,
+ x29,
+ x30,
+ x31
+);
+
+simd_ty!(
+ i32x16[i32]: i32,
+ i32,
+ i32,
+ i32,
+ i32,
+ i32,
+ i32,
+ i32,
+ i32,
+ i32,
+ i32,
+ i32,
+ i32,
+ i32,
+ i32,
+ i32 | x0,
+ x1,
+ x2,
+ x3,
+ x4,
+ x5,
+ x6,
+ x7,
+ x8,
+ x9,
+ x10,
+ x11,
+ x12,
+ x13,
+ x14,
+ x15
+);
+
+simd_ty!(
+ u32x16[u32]: u32,
+ u32,
+ u32,
+ u32,
+ u32,
+ u32,
+ u32,
+ u32,
+ u32,
+ u32,
+ u32,
+ u32,
+ u32,
+ u32,
+ u32,
+ u32 | x0,
+ x1,
+ x2,
+ x3,
+ x4,
+ x5,
+ x6,
+ x7,
+ x8,
+ x9,
+ x10,
+ x11,
+ x12,
+ x13,
+ x14,
+ x15
+);
+
+simd_ty!(
+ f32x16[f32]: f32,
+ f32,
+ f32,
+ f32,
+ f32,
+ f32,
+ f32,
+ f32,
+ f32,
+ f32,
+ f32,
+ f32,
+ f32,
+ f32,
+ f32,
+ f32 | x0,
+ x1,
+ x2,
+ x3,
+ x4,
+ x5,
+ x6,
+ x7,
+ x8,
+ x9,
+ x10,
+ x11,
+ x12,
+ x13,
+ x14,
+ x15
+);
+
+simd_ty!(
+ i64x8[i64]: i64,
+ i64,
+ i64,
+ i64,
+ i64,
+ i64,
+ i64,
+ i64 | x0,
+ x1,
+ x2,
+ x3,
+ x4,
+ x5,
+ x6,
+ x7
+);
+
+simd_ty!(
+ u64x8[u64]: u64,
+ u64,
+ u64,
+ u64,
+ u64,
+ u64,
+ u64,
+ u64 | x0,
+ x1,
+ x2,
+ x3,
+ x4,
+ x5,
+ x6,
+ x7
+);
+
+simd_ty!(
+ f64x8[f64]: f64,
+ f64,
+ f64,
+ f64,
+ f64,
+ f64,
+ f64,
+ f64 | x0,
+ x1,
+ x2,
+ x3,
+ x4,
+ x5,
+ x6,
+ x7
+);
diff --git a/library/stdarch/crates/core_arch/src/simd_llvm.rs b/library/stdarch/crates/core_arch/src/simd_llvm.rs
new file mode 100644
index 000000000..1970e5c69
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/simd_llvm.rs
@@ -0,0 +1,81 @@
+//! LLVM's SIMD platform intrinsics
+
+extern "platform-intrinsic" {
+ //pub fn simd_select_bitmask
+ pub fn simd_eq<T, U>(x: T, y: T) -> U;
+ pub fn simd_ne<T, U>(x: T, y: T) -> U;
+ pub fn simd_lt<T, U>(x: T, y: T) -> U;
+ pub fn simd_le<T, U>(x: T, y: T) -> U;
+ pub fn simd_gt<T, U>(x: T, y: T) -> U;
+ pub fn simd_ge<T, U>(x: T, y: T) -> U;
+
+ pub fn simd_shuffle2<T, U>(x: T, y: T, idx: [u32; 2]) -> U;
+ pub fn simd_shuffle4<T, U>(x: T, y: T, idx: [u32; 4]) -> U;
+ pub fn simd_shuffle8<T, U>(x: T, y: T, idx: [u32; 8]) -> U;
+ pub fn simd_shuffle16<T, U>(x: T, y: T, idx: [u32; 16]) -> U;
+ pub fn simd_shuffle32<T, U>(x: T, y: T, idx: [u32; 32]) -> U;
+ pub fn simd_shuffle64<T, U>(x: T, y: T, idx: [u32; 64]) -> U;
+ pub fn simd_shuffle128<T, U>(x: T, y: T, idx: [u32; 128]) -> U;
+
+ #[rustc_const_unstable(feature = "const_simd_insert", issue = "none")]
+ pub fn simd_insert<T, U>(x: T, idx: u32, val: U) -> T;
+ #[rustc_const_unstable(feature = "const_simd_extract", issue = "none")]
+ pub fn simd_extract<T, U>(x: T, idx: u32) -> U;
+ //pub fn simd_select
+ pub fn simd_bitmask<T, U>(x: T) -> U;
+
+ pub fn simd_cast<T, U>(x: T) -> U;
+
+ pub fn simd_add<T>(x: T, y: T) -> T;
+ pub fn simd_sub<T>(x: T, y: T) -> T;
+ pub fn simd_mul<T>(x: T, y: T) -> T;
+ pub fn simd_div<T>(x: T, y: T) -> T;
+ pub fn simd_shl<T>(x: T, y: T) -> T;
+ pub fn simd_shr<T>(x: T, y: T) -> T;
+ pub fn simd_and<T>(x: T, y: T) -> T;
+ pub fn simd_or<T>(x: T, y: T) -> T;
+ pub fn simd_xor<T>(x: T, y: T) -> T;
+
+ pub fn simd_neg<T>(x: T) -> T;
+
+ pub fn simd_saturating_add<T>(x: T, y: T) -> T;
+ pub fn simd_saturating_sub<T>(x: T, y: T) -> T;
+
+ pub fn simd_gather<T, U, V>(values: T, pointers: U, mask: V) -> T;
+ pub fn simd_scatter<T, U, V>(values: T, pointers: U, mask: V);
+
+ pub fn simd_reduce_add_unordered<T, U>(x: T) -> U;
+ pub fn simd_reduce_mul_unordered<T, U>(x: T) -> U;
+ pub fn simd_reduce_add_ordered<T, U>(x: T, acc: U) -> U;
+ pub fn simd_reduce_mul_ordered<T, U>(x: T, acc: U) -> U;
+ pub fn simd_reduce_min<T, U>(x: T) -> U;
+ pub fn simd_reduce_max<T, U>(x: T) -> U;
+ pub fn simd_reduce_min_nanless<T, U>(x: T) -> U;
+ pub fn simd_reduce_max_nanless<T, U>(x: T) -> U;
+ pub fn simd_reduce_and<T, U>(x: T) -> U;
+ pub fn simd_reduce_or<T, U>(x: T) -> U;
+ pub fn simd_reduce_xor<T, U>(x: T) -> U;
+ pub fn simd_reduce_all<T>(x: T) -> bool;
+ pub fn simd_reduce_any<T>(x: T) -> bool;
+
+ pub fn simd_select<M, T>(m: M, a: T, b: T) -> T;
+ pub fn simd_select_bitmask<M, T>(m: M, a: T, b: T) -> T;
+
+ pub fn simd_fmin<T>(a: T, b: T) -> T;
+ pub fn simd_fmax<T>(a: T, b: T) -> T;
+
+ pub fn simd_fsqrt<T>(a: T) -> T;
+ pub fn simd_fsin<T>(a: T) -> T;
+ pub fn simd_fcos<T>(a: T) -> T;
+ pub fn simd_fabs<T>(a: T) -> T;
+ pub fn simd_floor<T>(a: T) -> T;
+ pub fn simd_ceil<T>(a: T) -> T;
+ pub fn simd_fexp<T>(a: T) -> T;
+ pub fn simd_fexp2<T>(a: T) -> T;
+ pub fn simd_flog10<T>(a: T) -> T;
+ pub fn simd_flog2<T>(a: T) -> T;
+ pub fn simd_flog<T>(a: T) -> T;
+ //pub fn simd_fpowi
+ //pub fn simd_fpow
+ pub fn simd_fma<T>(a: T, b: T, c: T) -> T;
+}
diff --git a/library/stdarch/crates/core_arch/src/v64.rs b/library/stdarch/crates/core_arch/src/v64.rs
new file mode 100644
index 000000000..631b76a85
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/v64.rs
@@ -0,0 +1,85 @@
+//! 64-bit wide vector types
+
+use crate::prelude::v1::*;
+
+use crate::core_arch::simd_llvm::*;
+
+define_ty_doc! {
+ f32x2, f32, f32 |
+ /// A 64-bit vector with 2 `f32` lanes.
+}
+define_impl! { f32x2, f32, 2, i32x2, x0, x1 }
+
+define_ty_doc! {
+ u32x2, u32, u32 |
+ /// A 64-bit vector with 2 `u32` lanes.
+}
+define_impl! { u32x2, u32, 2, i32x2, x0, x1 }
+
+define_ty! { i32x2, i32, i32 }
+define_impl! { i32x2, i32, 2, i32x2, x0, x1 }
+
+define_ty! { u16x4, u16, u16, u16, u16 }
+define_impl! { u16x4, u16, 4, i16x4, x0, x1, x2, x3 }
+
+define_ty! { i16x4, i16, i16, i16, i16 }
+define_impl! { i16x4, i16, 4, i16x4, x0, x1, x2, x3 }
+
+define_ty! { u8x8, u8, u8, u8, u8, u8, u8, u8, u8 }
+define_impl! { u8x8, u8, 8, i8x8, x0, x1, x2, x3, x4, x5, x6, x7 }
+
+define_ty! { i8x8, i8, i8, i8, i8, i8, i8, i8, i8 }
+define_impl! { i8x8, i8, 8, i8x8, x0, x1, x2, x3, x4, x5, x6, x7 }
+
+define_from!(u32x2, i32x2, u16x4, i16x4, u8x8, i8x8);
+define_from!(i32x2, u32x2, u16x4, i16x4, u8x8, i8x8);
+define_from!(u16x4, u32x2, i32x2, i16x4, u8x8, i8x8);
+define_from!(i16x4, u32x2, i32x2, u16x4, u8x8, i8x8);
+define_from!(u8x8, u32x2, i32x2, u16x4, i16x4, i8x8);
+define_from!(i8x8, u32x2, i32x2, u16x4, i16x4, u8x8);
+
+define_common_ops!(f32x2, u32x2, i32x2, u16x4, i16x4, u8x8, i8x8);
+define_float_ops!(f32x2);
+define_integer_ops!(
+ (u32x2, u32),
+ (i32x2, i32),
+ (u16x4, u16),
+ (i16x4, i16),
+ (u8x8, u8),
+ (i8x8, i8)
+);
+define_signed_integer_ops!(i32x2, i16x4, i8x8);
+define_casts!(
+ (f32x2, f64x2, as_f64x2),
+ (f32x2, u32x2, as_u32x2),
+ (f32x2, i32x2, as_i32x2),
+ (u32x2, f32x2, as_f32x2),
+ (u32x2, i32x2, as_i32x2),
+ (i32x2, f32x2, as_f32x2),
+ (i32x2, u32x2, as_u32x2),
+ (u16x4, i16x4, as_i16x4),
+ (i16x4, u16x4, as_u16x4),
+ (u8x8, i8x8, as_i8x8),
+ (i8x8, u8x8, as_u8x8),
+ (i8x8, i16x8, as_i16x8),
+ (u8x8, i16x8, as_i16x8),
+ (i16x4, i32x4, as_i32x4),
+ (i32x2, i64x2, as_i64x2),
+ (u8x8, u16x8, as_u16x8),
+ (u16x4, u32x4, as_u32x4),
+ (u16x4, i32x4, as_i32x4),
+ (u32x2, u64x2, as_u64x2),
+ (u32x2, i64x2, as_i64x2)
+);
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[test]
+ fn operators() {
+ test_ops_si!(i8x8, i16x4, i32x2);
+ test_ops_ui!(u8x8, u16x4, u32x2);
+ test_ops_f!(f32x2);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/wasm32/atomic.rs b/library/stdarch/crates/core_arch/src/wasm32/atomic.rs
new file mode 100644
index 000000000..52d4bea87
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/wasm32/atomic.rs
@@ -0,0 +1,93 @@
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+extern "C" {
+ #[link_name = "llvm.wasm.memory.atomic.wait32"]
+ fn llvm_atomic_wait_i32(ptr: *mut i32, exp: i32, timeout: i64) -> i32;
+ #[link_name = "llvm.wasm.memory.atomic.wait64"]
+ fn llvm_atomic_wait_i64(ptr: *mut i64, exp: i64, timeout: i64) -> i32;
+ #[link_name = "llvm.wasm.memory.atomic.notify"]
+ fn llvm_atomic_notify(ptr: *mut i32, cnt: i32) -> i32;
+}
+
+/// Corresponding intrinsic to wasm's [`memory.atomic.wait32` instruction][instr]
+///
+/// This function, when called, will block the current thread if the memory
+/// pointed to by `ptr` is equal to `expression` (performing this action
+/// atomically).
+///
+/// The argument `timeout_ns` is a maximum number of nanoseconds the calling
+/// thread will be blocked for, if it blocks. If the timeout is negative then
+/// the calling thread will be blocked forever.
+///
+/// The calling thread can only be woken up with a call to the `wake` intrinsic
+/// once it has been blocked. Changing the memory behind `ptr` will not wake
+/// the thread once it's blocked.
+///
+/// # Return value
+///
+/// * 0 - indicates that the thread blocked and then was woken up
+/// * 1 - the loaded value from `ptr` didn't match `expression`, the thread
+/// didn't block
+/// * 2 - the thread blocked, but the timeout expired.
+///
+/// [instr]: https://webassembly.github.io/threads/core/syntax/instructions.html#syntax-instr-atomic-memory
+#[inline]
+#[cfg_attr(test, assert_instr(memory.atomic.wait32))]
+#[target_feature(enable = "atomics")]
+#[doc(alias("memory.atomic.wait32"))]
+pub unsafe fn memory_atomic_wait32(ptr: *mut i32, expression: i32, timeout_ns: i64) -> i32 {
+ llvm_atomic_wait_i32(ptr, expression, timeout_ns)
+}
+
+/// Corresponding intrinsic to wasm's [`memory.atomic.wait64` instruction][instr]
+///
+/// This function, when called, will block the current thread if the memory
+/// pointed to by `ptr` is equal to `expression` (performing this action
+/// atomically).
+///
+/// The argument `timeout_ns` is a maximum number of nanoseconds the calling
+/// thread will be blocked for, if it blocks. If the timeout is negative then
+/// the calling thread will be blocked forever.
+///
+/// The calling thread can only be woken up with a call to the `wake` intrinsic
+/// once it has been blocked. Changing the memory behind `ptr` will not wake
+/// the thread once it's blocked.
+///
+/// # Return value
+///
+/// * 0 - indicates that the thread blocked and then was woken up
+/// * 1 - the loaded value from `ptr` didn't match `expression`, the thread
+/// didn't block
+/// * 2 - the thread blocked, but the timeout expired.
+///
+/// [instr]: https://webassembly.github.io/threads/core/syntax/instructions.html#syntax-instr-atomic-memory
+#[inline]
+#[cfg_attr(test, assert_instr(memory.atomic.wait64))]
+#[target_feature(enable = "atomics")]
+#[doc(alias("memory.atomic.wait64"))]
+pub unsafe fn memory_atomic_wait64(ptr: *mut i64, expression: i64, timeout_ns: i64) -> i32 {
+ llvm_atomic_wait_i64(ptr, expression, timeout_ns)
+}
+
+/// Corresponding intrinsic to wasm's [`memory.atomic.notify` instruction][instr]
+///
+/// This function will notify a number of threads blocked on the address
+/// indicated by `ptr`. Threads previously blocked with the `i32_atomic_wait`
+/// and `i64_atomic_wait` functions above will be woken up.
+///
+/// The `waiters` argument indicates how many waiters should be woken up (a
+/// maximum). If the value is zero no waiters are woken up.
+///
+/// # Return value
+///
+/// Returns the number of waiters which were actually notified.
+///
+/// [instr]: https://webassembly.github.io/threads/core/syntax/instructions.html#syntax-instr-atomic-memory
+#[inline]
+#[cfg_attr(test, assert_instr(memory.atomic.notify))]
+#[target_feature(enable = "atomics")]
+#[doc(alias("memory.atomic.notify"))]
+pub unsafe fn memory_atomic_notify(ptr: *mut i32, waiters: u32) -> u32 {
+ llvm_atomic_notify(ptr, waiters as i32) as u32
+}
diff --git a/library/stdarch/crates/core_arch/src/wasm32/memory.rs b/library/stdarch/crates/core_arch/src/wasm32/memory.rs
new file mode 100644
index 000000000..b5cf13e98
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/wasm32/memory.rs
@@ -0,0 +1,58 @@
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+extern "C" {
+ #[link_name = "llvm.wasm.memory.grow"]
+ fn llvm_memory_grow(mem: u32, pages: usize) -> usize;
+ #[link_name = "llvm.wasm.memory.size"]
+ fn llvm_memory_size(mem: u32) -> usize;
+}
+
+/// Corresponding intrinsic to wasm's [`memory.size` instruction][instr]
+///
+/// This function, when called, will return the current memory size in units of
+/// pages. The current WebAssembly page size is 65536 bytes (64 KB).
+///
+/// The argument `MEM` is the numerical index of which memory to return the
+/// size of. Note that currently the WebAssembly specification only supports one
+/// memory, so it is required that zero is passed in. The argument is present to
+/// be forward-compatible with future WebAssembly revisions. If a nonzero
+/// argument is passed to this function it will currently unconditionally abort.
+///
+/// [instr]: http://webassembly.github.io/spec/core/exec/instructions.html#exec-memory-size
+#[inline]
+#[cfg_attr(test, assert_instr("memory.size", MEM = 0))]
+#[rustc_legacy_const_generics(0)]
+#[stable(feature = "simd_wasm32", since = "1.33.0")]
+#[doc(alias("memory.size"))]
+pub fn memory_size<const MEM: u32>() -> usize {
+ static_assert!(MEM: u32 where MEM == 0);
+ unsafe { llvm_memory_size(MEM) }
+}
+
+/// Corresponding intrinsic to wasm's [`memory.grow` instruction][instr]
+///
+/// This function, when called, will attempt to grow the default linear memory
+/// by the specified `delta` of pages. The current WebAssembly page size is
+/// 65536 bytes (64 KB). If memory is successfully grown then the previous size
+/// of memory, in pages, is returned. If memory cannot be grown then
+/// `usize::MAX` is returned.
+///
+/// The argument `MEM` is the numerical index of which memory to return the
+/// size of. Note that currently the WebAssembly specification only supports one
+/// memory, so it is required that zero is passed in. The argument is present to
+/// be forward-compatible with future WebAssembly revisions. If a nonzero
+/// argument is passed to this function it will currently unconditionally abort.
+///
+/// [instr]: http://webassembly.github.io/spec/core/exec/instructions.html#exec-memory-grow
+#[inline]
+#[cfg_attr(test, assert_instr("memory.grow", MEM = 0))]
+#[rustc_legacy_const_generics(0)]
+#[stable(feature = "simd_wasm32", since = "1.33.0")]
+#[doc(alias("memory.grow"))]
+pub fn memory_grow<const MEM: u32>(delta: usize) -> usize {
+ unsafe {
+ static_assert!(MEM: u32 where MEM == 0);
+ llvm_memory_grow(MEM, delta)
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/wasm32/mod.rs b/library/stdarch/crates/core_arch/src/wasm32/mod.rs
new file mode 100644
index 000000000..2fbe80e99
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/wasm32/mod.rs
@@ -0,0 +1,26 @@
+//! WASM32 intrinsics
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+mod atomic;
+pub use self::atomic::*;
+
+mod simd128;
+pub use self::simd128::*;
+
+mod memory;
+pub use self::memory::*;
+
+/// Generates the [`unreachable`] instruction, which causes an unconditional [trap].
+///
+/// This function is safe to call and immediately aborts the execution.
+///
+/// [`unreachable`]: https://webassembly.github.io/spec/core/syntax/instructions.html#syntax-instr-control
+/// [trap]: https://webassembly.github.io/spec/core/intro/overview.html#trap
+#[cfg_attr(test, assert_instr(unreachable))]
+#[inline]
+#[stable(feature = "unreachable_wasm32", since = "1.37.0")]
+pub fn unreachable() -> ! {
+ crate::intrinsics::abort()
+}
diff --git a/library/stdarch/crates/core_arch/src/wasm32/simd128.rs b/library/stdarch/crates/core_arch/src/wasm32/simd128.rs
new file mode 100644
index 000000000..c0025696b
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/wasm32/simd128.rs
@@ -0,0 +1,6136 @@
+//! This module implements the [WebAssembly `SIMD128` ISA].
+//!
+//! [WebAssembly `SIMD128` ISA]:
+//! https://github.com/WebAssembly/simd/blob/master/proposals/simd/SIMD.md
+
+#![allow(non_camel_case_types)]
+#![allow(unused_imports)]
+
+use crate::{
+ core_arch::{simd, simd_llvm::*},
+ marker::Sized,
+ mem, ptr,
+};
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+types! {
+ /// WASM-specific 128-bit wide SIMD vector type.
+ ///
+ /// This type corresponds to the `v128` type in the [WebAssembly SIMD
+ /// proposal](https://github.com/webassembly/simd). This type is 128-bits
+ /// large and the meaning of all the bits is defined within the context of
+ /// how this value is used.
+ ///
+ /// This same type is used simultaneously for all 128-bit-wide SIMD types,
+ /// for example:
+ ///
+ /// * sixteen 8-bit integers (both `i8` and `u8`)
+ /// * eight 16-bit integers (both `i16` and `u16`)
+ /// * four 32-bit integers (both `i32` and `u32`)
+ /// * two 64-bit integers (both `i64` and `u64`)
+ /// * four 32-bit floats (`f32`)
+ /// * two 64-bit floats (`f64`)
+ ///
+ /// The `v128` type in Rust is intended to be quite analogous to the `v128`
+ /// type in WebAssembly. Operations on `v128` can only be performed with the
+ /// functions in this module.
+ // N.B., internals here are arbitrary.
+ #[stable(feature = "wasm_simd", since = "1.54.0")]
+ pub struct v128(i32, i32, i32, i32);
+}
+
+macro_rules! conversions {
+ ($(($name:ident = $ty:ty))*) => {
+ impl v128 {
+ $(
+ #[inline(always)]
+ fn $name(self) -> $ty {
+ unsafe { mem::transmute(self) }
+ }
+ )*
+ }
+ $(
+ impl $ty {
+ #[inline(always)]
+ #[rustc_const_stable(feature = "wasm_simd_const", since = "1.56.0")]
+ const fn v128(self) -> v128 {
+ unsafe { mem::transmute(self) }
+ }
+ }
+ )*
+ }
+}
+
+conversions! {
+ (as_u8x16 = simd::u8x16)
+ (as_u16x8 = simd::u16x8)
+ (as_u32x4 = simd::u32x4)
+ (as_u64x2 = simd::u64x2)
+ (as_i8x16 = simd::i8x16)
+ (as_i16x8 = simd::i16x8)
+ (as_i32x4 = simd::i32x4)
+ (as_i64x2 = simd::i64x2)
+ (as_f32x4 = simd::f32x4)
+ (as_f64x2 = simd::f64x2)
+}
+
+#[allow(improper_ctypes)]
+extern "C" {
+ #[link_name = "llvm.wasm.swizzle"]
+ fn llvm_swizzle(a: simd::i8x16, b: simd::i8x16) -> simd::i8x16;
+
+ #[link_name = "llvm.wasm.bitselect.v16i8"]
+ fn llvm_bitselect(a: simd::i8x16, b: simd::i8x16, c: simd::i8x16) -> simd::i8x16;
+ #[link_name = "llvm.wasm.anytrue.v16i8"]
+ fn llvm_any_true_i8x16(x: simd::i8x16) -> i32;
+
+ #[link_name = "llvm.wasm.alltrue.v16i8"]
+ fn llvm_i8x16_all_true(x: simd::i8x16) -> i32;
+ #[link_name = "llvm.ctpop.v16i8"]
+ fn llvm_popcnt(a: simd::i8x16) -> simd::i8x16;
+ #[link_name = "llvm.wasm.bitmask.v16i8"]
+ fn llvm_bitmask_i8x16(a: simd::i8x16) -> i32;
+ #[link_name = "llvm.wasm.narrow.signed.v16i8.v8i16"]
+ fn llvm_narrow_i8x16_s(a: simd::i16x8, b: simd::i16x8) -> simd::i8x16;
+ #[link_name = "llvm.wasm.narrow.unsigned.v16i8.v8i16"]
+ fn llvm_narrow_i8x16_u(a: simd::i16x8, b: simd::i16x8) -> simd::i8x16;
+ #[link_name = "llvm.sadd.sat.v16i8"]
+ fn llvm_i8x16_add_sat_s(a: simd::i8x16, b: simd::i8x16) -> simd::i8x16;
+ #[link_name = "llvm.uadd.sat.v16i8"]
+ fn llvm_i8x16_add_sat_u(a: simd::i8x16, b: simd::i8x16) -> simd::i8x16;
+ #[link_name = "llvm.wasm.sub.sat.signed.v16i8"]
+ fn llvm_i8x16_sub_sat_s(a: simd::i8x16, b: simd::i8x16) -> simd::i8x16;
+ #[link_name = "llvm.wasm.sub.sat.unsigned.v16i8"]
+ fn llvm_i8x16_sub_sat_u(a: simd::i8x16, b: simd::i8x16) -> simd::i8x16;
+ #[link_name = "llvm.wasm.avgr.unsigned.v16i8"]
+ fn llvm_avgr_u_i8x16(a: simd::i8x16, b: simd::i8x16) -> simd::i8x16;
+
+ #[link_name = "llvm.wasm.extadd.pairwise.signed.v8i16"]
+ fn llvm_i16x8_extadd_pairwise_i8x16_s(x: simd::i8x16) -> simd::i16x8;
+ #[link_name = "llvm.wasm.extadd.pairwise.unsigned.v8i16"]
+ fn llvm_i16x8_extadd_pairwise_i8x16_u(x: simd::i8x16) -> simd::i16x8;
+ #[link_name = "llvm.wasm.q15mulr.sat.signed"]
+ fn llvm_q15mulr(a: simd::i16x8, b: simd::i16x8) -> simd::i16x8;
+ #[link_name = "llvm.wasm.alltrue.v8i16"]
+ fn llvm_i16x8_all_true(x: simd::i16x8) -> i32;
+ #[link_name = "llvm.wasm.bitmask.v8i16"]
+ fn llvm_bitmask_i16x8(a: simd::i16x8) -> i32;
+ #[link_name = "llvm.wasm.narrow.signed.v8i16.v4i32"]
+ fn llvm_narrow_i16x8_s(a: simd::i32x4, b: simd::i32x4) -> simd::i16x8;
+ #[link_name = "llvm.wasm.narrow.unsigned.v8i16.v4i32"]
+ fn llvm_narrow_i16x8_u(a: simd::i32x4, b: simd::i32x4) -> simd::i16x8;
+ #[link_name = "llvm.sadd.sat.v8i16"]
+ fn llvm_i16x8_add_sat_s(a: simd::i16x8, b: simd::i16x8) -> simd::i16x8;
+ #[link_name = "llvm.uadd.sat.v8i16"]
+ fn llvm_i16x8_add_sat_u(a: simd::i16x8, b: simd::i16x8) -> simd::i16x8;
+ #[link_name = "llvm.wasm.sub.sat.signed.v8i16"]
+ fn llvm_i16x8_sub_sat_s(a: simd::i16x8, b: simd::i16x8) -> simd::i16x8;
+ #[link_name = "llvm.wasm.sub.sat.unsigned.v8i16"]
+ fn llvm_i16x8_sub_sat_u(a: simd::i16x8, b: simd::i16x8) -> simd::i16x8;
+ #[link_name = "llvm.wasm.avgr.unsigned.v8i16"]
+ fn llvm_avgr_u_i16x8(a: simd::i16x8, b: simd::i16x8) -> simd::i16x8;
+
+ #[link_name = "llvm.wasm.extadd.pairwise.signed.v16i8"]
+ fn llvm_i32x4_extadd_pairwise_i16x8_s(x: simd::i16x8) -> simd::i32x4;
+ #[link_name = "llvm.wasm.extadd.pairwise.unsigned.v16i8"]
+ fn llvm_i32x4_extadd_pairwise_i16x8_u(x: simd::i16x8) -> simd::i32x4;
+ #[link_name = "llvm.wasm.alltrue.v4i32"]
+ fn llvm_i32x4_all_true(x: simd::i32x4) -> i32;
+ #[link_name = "llvm.wasm.bitmask.v4i32"]
+ fn llvm_bitmask_i32x4(a: simd::i32x4) -> i32;
+ #[link_name = "llvm.wasm.dot"]
+ fn llvm_i32x4_dot_i16x8_s(a: simd::i16x8, b: simd::i16x8) -> simd::i32x4;
+
+ #[link_name = "llvm.wasm.alltrue.v2i64"]
+ fn llvm_i64x2_all_true(x: simd::i64x2) -> i32;
+ #[link_name = "llvm.wasm.bitmask.v2i64"]
+ fn llvm_bitmask_i64x2(a: simd::i64x2) -> i32;
+
+ #[link_name = "llvm.ceil.v4f32"]
+ fn llvm_f32x4_ceil(x: simd::f32x4) -> simd::f32x4;
+ #[link_name = "llvm.floor.v4f32"]
+ fn llvm_f32x4_floor(x: simd::f32x4) -> simd::f32x4;
+ #[link_name = "llvm.trunc.v4f32"]
+ fn llvm_f32x4_trunc(x: simd::f32x4) -> simd::f32x4;
+ #[link_name = "llvm.nearbyint.v4f32"]
+ fn llvm_f32x4_nearest(x: simd::f32x4) -> simd::f32x4;
+ #[link_name = "llvm.fabs.v4f32"]
+ fn llvm_f32x4_abs(x: simd::f32x4) -> simd::f32x4;
+ #[link_name = "llvm.sqrt.v4f32"]
+ fn llvm_f32x4_sqrt(x: simd::f32x4) -> simd::f32x4;
+ #[link_name = "llvm.minimum.v4f32"]
+ fn llvm_f32x4_min(x: simd::f32x4, y: simd::f32x4) -> simd::f32x4;
+ #[link_name = "llvm.maximum.v4f32"]
+ fn llvm_f32x4_max(x: simd::f32x4, y: simd::f32x4) -> simd::f32x4;
+
+ #[link_name = "llvm.ceil.v2f64"]
+ fn llvm_f64x2_ceil(x: simd::f64x2) -> simd::f64x2;
+ #[link_name = "llvm.floor.v2f64"]
+ fn llvm_f64x2_floor(x: simd::f64x2) -> simd::f64x2;
+ #[link_name = "llvm.trunc.v2f64"]
+ fn llvm_f64x2_trunc(x: simd::f64x2) -> simd::f64x2;
+ #[link_name = "llvm.nearbyint.v2f64"]
+ fn llvm_f64x2_nearest(x: simd::f64x2) -> simd::f64x2;
+ #[link_name = "llvm.fabs.v2f64"]
+ fn llvm_f64x2_abs(x: simd::f64x2) -> simd::f64x2;
+ #[link_name = "llvm.sqrt.v2f64"]
+ fn llvm_f64x2_sqrt(x: simd::f64x2) -> simd::f64x2;
+ #[link_name = "llvm.minimum.v2f64"]
+ fn llvm_f64x2_min(x: simd::f64x2, y: simd::f64x2) -> simd::f64x2;
+ #[link_name = "llvm.maximum.v2f64"]
+ fn llvm_f64x2_max(x: simd::f64x2, y: simd::f64x2) -> simd::f64x2;
+
+ #[link_name = "llvm.fptosi.sat.v4i32.v4f32"]
+ fn llvm_i32x4_trunc_sat_f32x4_s(x: simd::f32x4) -> simd::i32x4;
+ #[link_name = "llvm.fptoui.sat.v4i32.v4f32"]
+ fn llvm_i32x4_trunc_sat_f32x4_u(x: simd::f32x4) -> simd::i32x4;
+ #[link_name = "llvm.fptosi.sat.v2i32.v2f64"]
+ fn llvm_i32x2_trunc_sat_f64x2_s(x: simd::f64x2) -> simd::i32x2;
+ #[link_name = "llvm.fptoui.sat.v2i32.v2f64"]
+ fn llvm_i32x2_trunc_sat_f64x2_u(x: simd::f64x2) -> simd::i32x2;
+}
+
+#[repr(packed)]
+#[derive(Copy)]
+struct Unaligned<T>(T);
+
+impl<T: Copy> Clone for Unaligned<T> {
+ fn clone(&self) -> Unaligned<T> {
+ *self
+ }
+}
+
+/// Loads a `v128` vector from the given heap address.
+///
+/// This intrinsic will emit a load with an alignment of 1. While this is
+/// provided for completeness it is not strictly necessary, you can also load
+/// the pointer directly:
+///
+/// ```rust,ignore
+/// let a: &v128 = ...;
+/// let value = unsafe { v128_load(a) };
+/// // .. is the same as ..
+/// let value = *a;
+/// ```
+///
+/// The alignment of the load can be configured by doing a manual load without
+/// this intrinsic.
+///
+/// # Unsafety
+///
+/// This intrinsic is unsafe because it takes a raw pointer as an argument, and
+/// the pointer must be valid to load 16 bytes from. Note that there is no
+/// alignment requirement on this pointer since this intrinsic performs a
+/// 1-aligned load.
+#[inline]
+#[cfg_attr(test, assert_instr(v128.load))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("v128.load"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub unsafe fn v128_load(m: *const v128) -> v128 {
+ (*(m as *const Unaligned<v128>)).0
+}
+
+/// Load eight 8-bit integers and sign extend each one to a 16-bit lane
+///
+/// # Unsafety
+///
+/// This intrinsic is unsafe because it takes a raw pointer as an argument, and
+/// the pointer must be valid to load 8 bytes from. Note that there is no
+/// alignment requirement on this pointer since this intrinsic performs a
+/// 1-aligned load.
+#[inline]
+#[cfg_attr(test, assert_instr(v128.load8x8_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("v128.load8x8_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub unsafe fn i16x8_load_extend_i8x8(m: *const i8) -> v128 {
+ let m = *(m as *const Unaligned<simd::i8x8>);
+ simd_cast::<_, simd::i16x8>(m.0).v128()
+}
+
+/// Load eight 8-bit integers and zero extend each one to a 16-bit lane
+///
+/// # Unsafety
+///
+/// This intrinsic is unsafe because it takes a raw pointer as an argument, and
+/// the pointer must be valid to load 8 bytes from. Note that there is no
+/// alignment requirement on this pointer since this intrinsic performs a
+/// 1-aligned load.
+#[inline]
+#[cfg_attr(test, assert_instr(v128.load8x8_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("v128.load8x8_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub unsafe fn i16x8_load_extend_u8x8(m: *const u8) -> v128 {
+ let m = *(m as *const Unaligned<simd::u8x8>);
+ simd_cast::<_, simd::u16x8>(m.0).v128()
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i16x8_load_extend_u8x8 as u16x8_load_extend_u8x8;
+
+/// Load four 16-bit integers and sign extend each one to a 32-bit lane
+///
+/// # Unsafety
+///
+/// This intrinsic is unsafe because it takes a raw pointer as an argument, and
+/// the pointer must be valid to load 8 bytes from. Note that there is no
+/// alignment requirement on this pointer since this intrinsic performs a
+/// 1-aligned load.
+#[inline]
+#[cfg_attr(test, assert_instr(v128.load16x4_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("v128.load16x4_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub unsafe fn i32x4_load_extend_i16x4(m: *const i16) -> v128 {
+ let m = *(m as *const Unaligned<simd::i16x4>);
+ simd_cast::<_, simd::i32x4>(m.0).v128()
+}
+
+/// Load four 16-bit integers and zero extend each one to a 32-bit lane
+///
+/// # Unsafety
+///
+/// This intrinsic is unsafe because it takes a raw pointer as an argument, and
+/// the pointer must be valid to load 8 bytes from. Note that there is no
+/// alignment requirement on this pointer since this intrinsic performs a
+/// 1-aligned load.
+#[inline]
+#[cfg_attr(test, assert_instr(v128.load16x4_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("v128.load16x4_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub unsafe fn i32x4_load_extend_u16x4(m: *const u16) -> v128 {
+ let m = *(m as *const Unaligned<simd::u16x4>);
+ simd_cast::<_, simd::u32x4>(m.0).v128()
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i32x4_load_extend_u16x4 as u32x4_load_extend_u16x4;
+
+/// Load two 32-bit integers and sign extend each one to a 64-bit lane
+///
+/// # Unsafety
+///
+/// This intrinsic is unsafe because it takes a raw pointer as an argument, and
+/// the pointer must be valid to load 8 bytes from. Note that there is no
+/// alignment requirement on this pointer since this intrinsic performs a
+/// 1-aligned load.
+#[inline]
+#[cfg_attr(test, assert_instr(v128.load32x2_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("v128.load32x2_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub unsafe fn i64x2_load_extend_i32x2(m: *const i32) -> v128 {
+ let m = *(m as *const Unaligned<simd::i32x2>);
+ simd_cast::<_, simd::i64x2>(m.0).v128()
+}
+
+/// Load two 32-bit integers and zero extend each one to a 64-bit lane
+///
+/// # Unsafety
+///
+/// This intrinsic is unsafe because it takes a raw pointer as an argument, and
+/// the pointer must be valid to load 8 bytes from. Note that there is no
+/// alignment requirement on this pointer since this intrinsic performs a
+/// 1-aligned load.
+#[inline]
+#[cfg_attr(test, assert_instr(v128.load32x2_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("v128.load32x2_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub unsafe fn i64x2_load_extend_u32x2(m: *const u32) -> v128 {
+ let m = *(m as *const Unaligned<simd::u32x2>);
+ simd_cast::<_, simd::u64x2>(m.0).v128()
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i64x2_load_extend_u32x2 as u64x2_load_extend_u32x2;
+
+/// Load a single element and splat to all lanes of a v128 vector.
+///
+/// While this intrinsic is provided for completeness it can also be replaced
+/// with `u8x16_splat(*m)` and it should generate equivalent code (and also not
+/// require `unsafe`).
+///
+/// # Unsafety
+///
+/// This intrinsic is unsafe because it takes a raw pointer as an argument, and
+/// the pointer must be valid to load 1 byte from. Note that there is no
+/// alignment requirement on this pointer since this intrinsic performs a
+/// 1-aligned load.
+#[inline]
+#[cfg_attr(test, assert_instr(v128.load8_splat))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("v128.load8_splat"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub unsafe fn v128_load8_splat(m: *const u8) -> v128 {
+ u8x16_splat(*m)
+}
+
+/// Load a single element and splat to all lanes of a v128 vector.
+///
+/// While this intrinsic is provided for completeness it can also be replaced
+/// with `u16x8_splat(*m)` and it should generate equivalent code (and also not
+/// require `unsafe`).
+///
+/// # Unsafety
+///
+/// This intrinsic is unsafe because it takes a raw pointer as an argument, and
+/// the pointer must be valid to load 2 bytes from. Note that there is no
+/// alignment requirement on this pointer since this intrinsic performs a
+/// 1-aligned load.
+#[inline]
+#[cfg_attr(test, assert_instr(v128.load16_splat))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("v128.load16_splat"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub unsafe fn v128_load16_splat(m: *const u16) -> v128 {
+ u16x8_splat(ptr::read_unaligned(m))
+}
+
+/// Load a single element and splat to all lanes of a v128 vector.
+///
+/// While this intrinsic is provided for completeness it can also be replaced
+/// with `u32x4_splat(*m)` and it should generate equivalent code (and also not
+/// require `unsafe`).
+///
+/// # Unsafety
+///
+/// This intrinsic is unsafe because it takes a raw pointer as an argument, and
+/// the pointer must be valid to load 4 bytes from. Note that there is no
+/// alignment requirement on this pointer since this intrinsic performs a
+/// 1-aligned load.
+#[inline]
+#[cfg_attr(test, assert_instr(v128.load32_splat))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("v128.load32_splat"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub unsafe fn v128_load32_splat(m: *const u32) -> v128 {
+ u32x4_splat(ptr::read_unaligned(m))
+}
+
+/// Load a single element and splat to all lanes of a v128 vector.
+///
+/// While this intrinsic is provided for completeness it can also be replaced
+/// with `u64x2_splat(*m)` and it should generate equivalent code (and also not
+/// require `unsafe`).
+///
+/// # Unsafety
+///
+/// This intrinsic is unsafe because it takes a raw pointer as an argument, and
+/// the pointer must be valid to load 8 bytes from. Note that there is no
+/// alignment requirement on this pointer since this intrinsic performs a
+/// 1-aligned load.
+#[inline]
+#[cfg_attr(test, assert_instr(v128.load64_splat))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("v128.load64_splat"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub unsafe fn v128_load64_splat(m: *const u64) -> v128 {
+ u64x2_splat(ptr::read_unaligned(m))
+}
+
+/// Load a 32-bit element into the low bits of the vector and sets all other
+/// bits to zero.
+///
+/// This intrinsic is provided for completeness and is equivalent to `u32x4(*m,
+/// 0, 0, 0)` (which doesn't require `unsafe`).
+///
+/// # Unsafety
+///
+/// This intrinsic is unsafe because it takes a raw pointer as an argument, and
+/// the pointer must be valid to load 4 bytes from. Note that there is no
+/// alignment requirement on this pointer since this intrinsic performs a
+/// 1-aligned load.
+#[inline]
+#[cfg_attr(test, assert_instr(v128.load32_zero))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("v128.load32_zero"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub unsafe fn v128_load32_zero(m: *const u32) -> v128 {
+ u32x4(ptr::read_unaligned(m), 0, 0, 0)
+}
+
+/// Load a 64-bit element into the low bits of the vector and sets all other
+/// bits to zero.
+///
+/// This intrinsic is provided for completeness and is equivalent to
+/// `u64x2_replace_lane::<0>(u64x2(0, 0), *m)` (which doesn't require `unsafe`).
+///
+/// # Unsafety
+///
+/// This intrinsic is unsafe because it takes a raw pointer as an argument, and
+/// the pointer must be valid to load 8 bytes from. Note that there is no
+/// alignment requirement on this pointer since this intrinsic performs a
+/// 1-aligned load.
+#[inline]
+#[cfg_attr(test, assert_instr(v128.load64_zero))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("v128.load64_zero"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub unsafe fn v128_load64_zero(m: *const u64) -> v128 {
+ u64x2_replace_lane::<0>(u64x2(0, 0), ptr::read_unaligned(m))
+}
+
+/// Stores a `v128` vector to the given heap address.
+///
+/// This intrinsic will emit a store with an alignment of 1. While this is
+/// provided for completeness it is not strictly necessary, you can also store
+/// the pointer directly:
+///
+/// ```rust,ignore
+/// let a: &mut v128 = ...;
+/// unsafe { v128_store(a, value) };
+/// // .. is the same as ..
+/// *a = value;
+/// ```
+///
+/// The alignment of the store can be configured by doing a manual store without
+/// this intrinsic.
+///
+/// # Unsafety
+///
+/// This intrinsic is unsafe because it takes a raw pointer as an argument, and
+/// the pointer must be valid to store 16 bytes to. Note that there is no
+/// alignment requirement on this pointer since this intrinsic performs a
+/// 1-aligned store.
+#[inline]
+#[cfg_attr(test, assert_instr(v128.store))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("v128.store"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub unsafe fn v128_store(m: *mut v128, a: v128) {
+ *(m as *mut Unaligned<v128>) = Unaligned(a);
+}
+
+/// Loads an 8-bit value from `m` and sets lane `L` of `v` to that value.
+///
+/// This intrinsic is provided for completeness and is equivalent to
+/// `u8x16_replace_lane::<L>(v, *m)` (which doesn't require `unsafe`).
+///
+/// # Unsafety
+///
+/// This intrinsic is unsafe because it takes a raw pointer as an argument, and
+/// the pointer must be valid to load 1 byte from. Note that there is no
+/// alignment requirement on this pointer since this intrinsic performs a
+/// 1-aligned load.
+#[inline]
+#[cfg_attr(test, assert_instr(v128.load8_lane, L = 0))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("v128.load8_lane"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub unsafe fn v128_load8_lane<const L: usize>(v: v128, m: *const u8) -> v128 {
+ u8x16_replace_lane::<L>(v, *m)
+}
+
+/// Loads a 16-bit value from `m` and sets lane `L` of `v` to that value.
+///
+/// This intrinsic is provided for completeness and is equivalent to
+/// `u16x8_replace_lane::<L>(v, *m)` (which doesn't require `unsafe`).
+///
+/// # Unsafety
+///
+/// This intrinsic is unsafe because it takes a raw pointer as an argument, and
+/// the pointer must be valid to load 2 bytes from. Note that there is no
+/// alignment requirement on this pointer since this intrinsic performs a
+/// 1-aligned load.
+#[inline]
+#[cfg_attr(test, assert_instr(v128.load16_lane, L = 0))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("v128.load16_lane"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub unsafe fn v128_load16_lane<const L: usize>(v: v128, m: *const u16) -> v128 {
+ u16x8_replace_lane::<L>(v, ptr::read_unaligned(m))
+}
+
+/// Loads a 32-bit value from `m` and sets lane `L` of `v` to that value.
+///
+/// This intrinsic is provided for completeness and is equivalent to
+/// `u32x4_replace_lane::<L>(v, *m)` (which doesn't require `unsafe`).
+///
+/// # Unsafety
+///
+/// This intrinsic is unsafe because it takes a raw pointer as an argument, and
+/// the pointer must be valid to load 4 bytes from. Note that there is no
+/// alignment requirement on this pointer since this intrinsic performs a
+/// 1-aligned load.
+#[inline]
+#[cfg_attr(test, assert_instr(v128.load32_lane, L = 0))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("v128.load32_lane"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub unsafe fn v128_load32_lane<const L: usize>(v: v128, m: *const u32) -> v128 {
+ u32x4_replace_lane::<L>(v, ptr::read_unaligned(m))
+}
+
+/// Loads a 64-bit value from `m` and sets lane `L` of `v` to that value.
+///
+/// This intrinsic is provided for completeness and is equivalent to
+/// `u64x2_replace_lane::<L>(v, *m)` (which doesn't require `unsafe`).
+///
+/// # Unsafety
+///
+/// This intrinsic is unsafe because it takes a raw pointer as an argument, and
+/// the pointer must be valid to load 8 bytes from. Note that there is no
+/// alignment requirement on this pointer since this intrinsic performs a
+/// 1-aligned load.
+#[inline]
+#[cfg_attr(test, assert_instr(v128.load64_lane, L = 0))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("v128.load64_lane"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub unsafe fn v128_load64_lane<const L: usize>(v: v128, m: *const u64) -> v128 {
+ u64x2_replace_lane::<L>(v, ptr::read_unaligned(m))
+}
+
+/// Stores the 8-bit value from lane `L` of `v` into `m`
+///
+/// This intrinsic is provided for completeness and is equivalent to
+/// `*m = u8x16_extract_lane::<L>(v)` (which doesn't require `unsafe`).
+///
+/// # Unsafety
+///
+/// This intrinsic is unsafe because it takes a raw pointer as an argument, and
+/// the pointer must be valid to store 1 byte to. Note that there is no
+/// alignment requirement on this pointer since this intrinsic performs a
+/// 1-aligned store.
+#[inline]
+#[cfg_attr(test, assert_instr(v128.store8_lane, L = 0))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("v128.store8_lane"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub unsafe fn v128_store8_lane<const L: usize>(v: v128, m: *mut u8) {
+ *m = u8x16_extract_lane::<L>(v);
+}
+
+/// Stores the 16-bit value from lane `L` of `v` into `m`
+///
+/// This intrinsic is provided for completeness and is equivalent to
+/// `*m = u16x8_extract_lane::<L>(v)` (which doesn't require `unsafe`).
+///
+/// # Unsafety
+///
+/// This intrinsic is unsafe because it takes a raw pointer as an argument, and
+/// the pointer must be valid to store 2 bytes to. Note that there is no
+/// alignment requirement on this pointer since this intrinsic performs a
+/// 1-aligned store.
+#[inline]
+#[cfg_attr(test, assert_instr(v128.store16_lane, L = 0))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("v128.store16_lane"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub unsafe fn v128_store16_lane<const L: usize>(v: v128, m: *mut u16) {
+ ptr::write_unaligned(m, u16x8_extract_lane::<L>(v))
+}
+
+/// Stores the 32-bit value from lane `L` of `v` into `m`
+///
+/// This intrinsic is provided for completeness and is equivalent to
+/// `*m = u32x4_extract_lane::<L>(v)` (which doesn't require `unsafe`).
+///
+/// # Unsafety
+///
+/// This intrinsic is unsafe because it takes a raw pointer as an argument, and
+/// the pointer must be valid to store 4 bytes to. Note that there is no
+/// alignment requirement on this pointer since this intrinsic performs a
+/// 1-aligned store.
+#[inline]
+#[cfg_attr(test, assert_instr(v128.store32_lane, L = 0))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("v128.store32_lane"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub unsafe fn v128_store32_lane<const L: usize>(v: v128, m: *mut u32) {
+ ptr::write_unaligned(m, u32x4_extract_lane::<L>(v))
+}
+
+/// Stores the 64-bit value from lane `L` of `v` into `m`
+///
+/// This intrinsic is provided for completeness and is equivalent to
+/// `*m = u64x2_extract_lane::<L>(v)` (which doesn't require `unsafe`).
+///
+/// # Unsafety
+///
+/// This intrinsic is unsafe because it takes a raw pointer as an argument, and
+/// the pointer must be valid to store 8 bytes to. Note that there is no
+/// alignment requirement on this pointer since this intrinsic performs a
+/// 1-aligned store.
+#[inline]
+#[cfg_attr(test, assert_instr(v128.store64_lane, L = 0))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("v128.store64_lane"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub unsafe fn v128_store64_lane<const L: usize>(v: v128, m: *mut u64) {
+ ptr::write_unaligned(m, u64x2_extract_lane::<L>(v))
+}
+
+/// Materializes a SIMD value from the provided operands.
+///
+/// If possible this will generate a `v128.const` instruction, otherwise it may
+/// be lowered to a sequence of instructions to materialize the vector value.
+#[inline]
+#[target_feature(enable = "simd128")]
+#[cfg_attr(
+ test,
+ assert_instr(
+ v128.const,
+ a0 = 0,
+ a1 = 1,
+ a2 = 2,
+ a3 = 3,
+ a4 = 4,
+ a5 = 5,
+ a6 = 6,
+ a7 = 7,
+ a8 = 8,
+ a9 = 9,
+ a10 = 10,
+ a11 = 11,
+ a12 = 12,
+ a13 = 13,
+ a14 = 14,
+ a15 = 15,
+ )
+)]
+#[doc(alias("v128.const"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+#[rustc_const_stable(feature = "wasm_simd", since = "1.54.0")]
+pub const fn i8x16(
+ a0: i8,
+ a1: i8,
+ a2: i8,
+ a3: i8,
+ a4: i8,
+ a5: i8,
+ a6: i8,
+ a7: i8,
+ a8: i8,
+ a9: i8,
+ a10: i8,
+ a11: i8,
+ a12: i8,
+ a13: i8,
+ a14: i8,
+ a15: i8,
+) -> v128 {
+ simd::i8x16(
+ a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15,
+ )
+ .v128()
+}
+
+/// Materializes a SIMD value from the provided operands.
+///
+/// If possible this will generate a `v128.const` instruction, otherwise it may
+/// be lowered to a sequence of instructions to materialize the vector value.
+#[inline]
+#[target_feature(enable = "simd128")]
+#[doc(alias("v128.const"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+#[rustc_const_stable(feature = "wasm_simd", since = "1.54.0")]
+pub const fn u8x16(
+ a0: u8,
+ a1: u8,
+ a2: u8,
+ a3: u8,
+ a4: u8,
+ a5: u8,
+ a6: u8,
+ a7: u8,
+ a8: u8,
+ a9: u8,
+ a10: u8,
+ a11: u8,
+ a12: u8,
+ a13: u8,
+ a14: u8,
+ a15: u8,
+) -> v128 {
+ simd::u8x16(
+ a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15,
+ )
+ .v128()
+}
+
+/// Materializes a SIMD value from the provided operands.
+///
+/// If possible this will generate a `v128.const` instruction, otherwise it may
+/// be lowered to a sequence of instructions to materialize the vector value.
+#[inline]
+#[target_feature(enable = "simd128")]
+#[cfg_attr(
+ test,
+ assert_instr(
+ v128.const,
+ a0 = 0,
+ a1 = 1,
+ a2 = 2,
+ a3 = 3,
+ a4 = 4,
+ a5 = 5,
+ a6 = 6,
+ a7 = 7,
+ )
+)]
+#[doc(alias("v128.const"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+#[rustc_const_stable(feature = "wasm_simd", since = "1.54.0")]
+pub const fn i16x8(a0: i16, a1: i16, a2: i16, a3: i16, a4: i16, a5: i16, a6: i16, a7: i16) -> v128 {
+ simd::i16x8(a0, a1, a2, a3, a4, a5, a6, a7).v128()
+}
+
+/// Materializes a SIMD value from the provided operands.
+///
+/// If possible this will generate a `v128.const` instruction, otherwise it may
+/// be lowered to a sequence of instructions to materialize the vector value.
+#[inline]
+#[target_feature(enable = "simd128")]
+#[doc(alias("v128.const"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+#[rustc_const_stable(feature = "wasm_simd", since = "1.54.0")]
+pub const fn u16x8(a0: u16, a1: u16, a2: u16, a3: u16, a4: u16, a5: u16, a6: u16, a7: u16) -> v128 {
+ simd::u16x8(a0, a1, a2, a3, a4, a5, a6, a7).v128()
+}
+
+/// Materializes a SIMD value from the provided operands.
+///
+/// If possible this will generate a `v128.const` instruction, otherwise it may
+/// be lowered to a sequence of instructions to materialize the vector value.
+#[inline]
+#[target_feature(enable = "simd128")]
+#[cfg_attr(test, assert_instr(v128.const, a0 = 0, a1 = 1, a2 = 2, a3 = 3))]
+#[doc(alias("v128.const"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+#[rustc_const_stable(feature = "wasm_simd", since = "1.54.0")]
+pub const fn i32x4(a0: i32, a1: i32, a2: i32, a3: i32) -> v128 {
+ simd::i32x4(a0, a1, a2, a3).v128()
+}
+
+/// Materializes a SIMD value from the provided operands.
+///
+/// If possible this will generate a `v128.const` instruction, otherwise it may
+/// be lowered to a sequence of instructions to materialize the vector value.
+#[inline]
+#[target_feature(enable = "simd128")]
+#[doc(alias("v128.const"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+#[rustc_const_stable(feature = "wasm_simd", since = "1.54.0")]
+pub const fn u32x4(a0: u32, a1: u32, a2: u32, a3: u32) -> v128 {
+ simd::u32x4(a0, a1, a2, a3).v128()
+}
+
+/// Materializes a SIMD value from the provided operands.
+///
+/// If possible this will generate a `v128.const` instruction, otherwise it may
+/// be lowered to a sequence of instructions to materialize the vector value.
+#[inline]
+#[target_feature(enable = "simd128")]
+#[cfg_attr(test, assert_instr(v128.const, a0 = 1, a1 = 2))]
+#[doc(alias("v128.const"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+#[rustc_const_stable(feature = "wasm_simd", since = "1.54.0")]
+pub const fn i64x2(a0: i64, a1: i64) -> v128 {
+ simd::i64x2(a0, a1).v128()
+}
+
+/// Materializes a SIMD value from the provided operands.
+///
+/// If possible this will generate a `v128.const` instruction, otherwise it may
+/// be lowered to a sequence of instructions to materialize the vector value.
+#[inline]
+#[target_feature(enable = "simd128")]
+#[doc(alias("v128.const"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+#[rustc_const_stable(feature = "wasm_simd", since = "1.54.0")]
+pub const fn u64x2(a0: u64, a1: u64) -> v128 {
+ simd::u64x2(a0, a1).v128()
+}
+
+/// Materializes a SIMD value from the provided operands.
+///
+/// If possible this will generate a `v128.const` instruction, otherwise it may
+/// be lowered to a sequence of instructions to materialize the vector value.
+#[inline]
+#[target_feature(enable = "simd128")]
+#[cfg_attr(test, assert_instr(v128.const, a0 = 0.0, a1 = 1.0, a2 = 2.0, a3 = 3.0))]
+#[doc(alias("v128.const"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+#[rustc_const_stable(feature = "wasm_simd_const", since = "1.56.0")]
+pub const fn f32x4(a0: f32, a1: f32, a2: f32, a3: f32) -> v128 {
+ simd::f32x4(a0, a1, a2, a3).v128()
+}
+
+/// Materializes a SIMD value from the provided operands.
+///
+/// If possible this will generate a `v128.const` instruction, otherwise it may
+/// be lowered to a sequence of instructions to materialize the vector value.
+#[inline]
+#[target_feature(enable = "simd128")]
+#[cfg_attr(test, assert_instr(v128.const, a0 = 0.0, a1 = 1.0))]
+#[doc(alias("v128.const"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+#[rustc_const_stable(feature = "wasm_simd_const", since = "1.56.0")]
+pub const fn f64x2(a0: f64, a1: f64) -> v128 {
+ simd::f64x2(a0, a1).v128()
+}
+
+/// Returns a new vector with lanes selected from the lanes of the two input
+/// vectors `$a` and `$b` specified in the 16 immediate operands.
+///
+/// The `$a` and `$b` expressions must have type `v128`, and this function
+/// generates a wasm instruction that is encoded with 16 bytes providing the
+/// indices of the elements to return. The indices `i` in range [0, 15] select
+/// the `i`-th element of `a`. The indices in range [16, 31] select the `i -
+/// 16`-th element of `b`.
+///
+/// Note that this is a macro due to the codegen requirements of all of the
+/// index expressions `$i*` must be constant. A compiler error will be
+/// generated if any of the expressions are not constant.
+///
+/// All indexes `$i*` must have the type `u32`.
+#[inline]
+#[cfg_attr(test,
+ assert_instr(
+ i8x16.shuffle,
+ I0 = 0,
+ I1 = 2,
+ I2 = 4,
+ I3 = 6,
+ I4 = 8,
+ I5 = 10,
+ I6 = 12,
+ I7 = 14,
+ I8 = 16,
+ I9 = 18,
+ I10 = 20,
+ I11 = 22,
+ I12 = 24,
+ I13 = 26,
+ I14 = 28,
+ I15 = 30,
+ )
+)]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i8x16.shuffle"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i8x16_shuffle<
+ const I0: usize,
+ const I1: usize,
+ const I2: usize,
+ const I3: usize,
+ const I4: usize,
+ const I5: usize,
+ const I6: usize,
+ const I7: usize,
+ const I8: usize,
+ const I9: usize,
+ const I10: usize,
+ const I11: usize,
+ const I12: usize,
+ const I13: usize,
+ const I14: usize,
+ const I15: usize,
+>(
+ a: v128,
+ b: v128,
+) -> v128 {
+ static_assert!(I0: usize where I0 < 32);
+ static_assert!(I1: usize where I1 < 32);
+ static_assert!(I2: usize where I2 < 32);
+ static_assert!(I3: usize where I3 < 32);
+ static_assert!(I4: usize where I4 < 32);
+ static_assert!(I5: usize where I5 < 32);
+ static_assert!(I6: usize where I6 < 32);
+ static_assert!(I7: usize where I7 < 32);
+ static_assert!(I8: usize where I8 < 32);
+ static_assert!(I9: usize where I9 < 32);
+ static_assert!(I10: usize where I10 < 32);
+ static_assert!(I11: usize where I11 < 32);
+ static_assert!(I12: usize where I12 < 32);
+ static_assert!(I13: usize where I13 < 32);
+ static_assert!(I14: usize where I14 < 32);
+ static_assert!(I15: usize where I15 < 32);
+ let shuf: simd::u8x16 = unsafe {
+ simd_shuffle16!(
+ a.as_u8x16(),
+ b.as_u8x16(),
+ <
+ const I0: usize,
+ const I1: usize,
+ const I2: usize,
+ const I3: usize,
+ const I4: usize,
+ const I5: usize,
+ const I6: usize,
+ const I7: usize,
+ const I8: usize,
+ const I9: usize,
+ const I10: usize,
+ const I11: usize,
+ const I12: usize,
+ const I13: usize,
+ const I14: usize,
+ const I15: usize,
+ > [
+ I0 as u32, I1 as u32, I2 as u32, I3 as u32, I4 as u32, I5 as u32, I6 as u32, I7 as u32,
+ I8 as u32, I9 as u32, I10 as u32, I11 as u32, I12 as u32, I13 as u32, I14 as u32,
+ I15 as u32,
+ ],
+ )
+ };
+ shuf.v128()
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i8x16_shuffle as u8x16_shuffle;
+
+/// Same as [`i8x16_shuffle`], except operates as if the inputs were eight
+/// 16-bit integers, only taking 8 indices to shuffle.
+///
+/// Indices in the range [0, 7] select from `a` while [8, 15] select from `b`.
+/// Note that this will generate the `i8x16.shuffle` instruction, since there
+/// is no native `i16x8.shuffle` instruction (there is no need for one since
+/// `i8x16.shuffle` suffices).
+#[inline]
+#[cfg_attr(test,
+ assert_instr(
+ i8x16.shuffle,
+ I0 = 0,
+ I1 = 2,
+ I2 = 4,
+ I3 = 6,
+ I4 = 8,
+ I5 = 10,
+ I6 = 12,
+ I7 = 14,
+ )
+)]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i8x16.shuffle"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i16x8_shuffle<
+ const I0: usize,
+ const I1: usize,
+ const I2: usize,
+ const I3: usize,
+ const I4: usize,
+ const I5: usize,
+ const I6: usize,
+ const I7: usize,
+>(
+ a: v128,
+ b: v128,
+) -> v128 {
+ static_assert!(I0: usize where I0 < 16);
+ static_assert!(I1: usize where I1 < 16);
+ static_assert!(I2: usize where I2 < 16);
+ static_assert!(I3: usize where I3 < 16);
+ static_assert!(I4: usize where I4 < 16);
+ static_assert!(I5: usize where I5 < 16);
+ static_assert!(I6: usize where I6 < 16);
+ static_assert!(I7: usize where I7 < 16);
+ let shuf: simd::u16x8 = unsafe {
+ simd_shuffle8!(
+ a.as_u16x8(),
+ b.as_u16x8(),
+ <
+ const I0: usize,
+ const I1: usize,
+ const I2: usize,
+ const I3: usize,
+ const I4: usize,
+ const I5: usize,
+ const I6: usize,
+ const I7: usize,
+ > [
+ I0 as u32, I1 as u32, I2 as u32, I3 as u32, I4 as u32, I5 as u32, I6 as u32, I7 as u32,
+ ],
+ )
+ };
+ shuf.v128()
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i16x8_shuffle as u16x8_shuffle;
+
+/// Same as [`i8x16_shuffle`], except operates as if the inputs were four
+/// 32-bit integers, only taking 4 indices to shuffle.
+///
+/// Indices in the range [0, 3] select from `a` while [4, 7] select from `b`.
+/// Note that this will generate the `i8x16.shuffle` instruction, since there
+/// is no native `i32x4.shuffle` instruction (there is no need for one since
+/// `i8x16.shuffle` suffices).
+#[inline]
+#[cfg_attr(test, assert_instr(i8x16.shuffle, I0 = 0, I1 = 2, I2 = 4, I3 = 6))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i8x16.shuffle"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i32x4_shuffle<const I0: usize, const I1: usize, const I2: usize, const I3: usize>(
+ a: v128,
+ b: v128,
+) -> v128 {
+ static_assert!(I0: usize where I0 < 8);
+ static_assert!(I1: usize where I1 < 8);
+ static_assert!(I2: usize where I2 < 8);
+ static_assert!(I3: usize where I3 < 8);
+ let shuf: simd::u32x4 = unsafe {
+ simd_shuffle4!(
+ a.as_u32x4(),
+ b.as_u32x4(),
+ <const I0: usize, const I1: usize, const I2: usize, const I3: usize> [I0 as u32, I1 as u32, I2 as u32, I3 as u32],
+ )
+ };
+ shuf.v128()
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i32x4_shuffle as u32x4_shuffle;
+
+/// Same as [`i8x16_shuffle`], except operates as if the inputs were two
+/// 64-bit integers, only taking 2 indices to shuffle.
+///
+/// Indices in the range [0, 1] select from `a` while [2, 3] select from `b`.
+/// Note that this will generate the `v8x16.shuffle` instruction, since there
+/// is no native `i64x2.shuffle` instruction (there is no need for one since
+/// `i8x16.shuffle` suffices).
+#[inline]
+#[cfg_attr(test, assert_instr(i8x16.shuffle, I0 = 0, I1 = 2))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i8x16.shuffle"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i64x2_shuffle<const I0: usize, const I1: usize>(a: v128, b: v128) -> v128 {
+ static_assert!(I0: usize where I0 < 4);
+ static_assert!(I1: usize where I1 < 4);
+ let shuf: simd::u64x2 = unsafe {
+ simd_shuffle2!(
+ a.as_u64x2(),
+ b.as_u64x2(),
+ <const I0: usize, const I1: usize> [I0 as u32, I1 as u32],
+ )
+ };
+ shuf.v128()
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i64x2_shuffle as u64x2_shuffle;
+
+/// Extracts a lane from a 128-bit vector interpreted as 16 packed i8 numbers.
+///
+/// Extracts the scalar value of lane specified in the immediate mode operand
+/// `N` from `a`. If `N` is out of bounds then it is a compile time error.
+#[inline]
+#[cfg_attr(test, assert_instr(i8x16.extract_lane_s, N = 3))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i8x16.extract_lane_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i8x16_extract_lane<const N: usize>(a: v128) -> i8 {
+ static_assert!(N: usize where N < 16);
+ unsafe { simd_extract(a.as_i8x16(), N as u32) }
+}
+
+/// Extracts a lane from a 128-bit vector interpreted as 16 packed u8 numbers.
+///
+/// Extracts the scalar value of lane specified in the immediate mode operand
+/// `N` from `a`. If `N` is out of bounds then it is a compile time error.
+#[inline]
+#[cfg_attr(test, assert_instr(i8x16.extract_lane_u, N = 3))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i8x16.extract_lane_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u8x16_extract_lane<const N: usize>(a: v128) -> u8 {
+ static_assert!(N: usize where N < 16);
+ unsafe { simd_extract(a.as_u8x16(), N as u32) }
+}
+
+/// Replaces a lane from a 128-bit vector interpreted as 16 packed i8 numbers.
+///
+/// Replaces the scalar value of lane specified in the immediate mode operand
+/// `N` from `a`. If `N` is out of bounds then it is a compile time error.
+#[inline]
+#[cfg_attr(test, assert_instr(i8x16.replace_lane, N = 2))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i8x16.replace_lane"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i8x16_replace_lane<const N: usize>(a: v128, val: i8) -> v128 {
+ static_assert!(N: usize where N < 16);
+ unsafe { simd_insert(a.as_i8x16(), N as u32, val).v128() }
+}
+
+/// Replaces a lane from a 128-bit vector interpreted as 16 packed u8 numbers.
+///
+/// Replaces the scalar value of lane specified in the immediate mode operand
+/// `N` from `a`. If `N` is out of bounds then it is a compile time error.
+#[inline]
+#[cfg_attr(test, assert_instr(i8x16.replace_lane, N = 2))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i8x16.replace_lane"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u8x16_replace_lane<const N: usize>(a: v128, val: u8) -> v128 {
+ static_assert!(N: usize where N < 16);
+ unsafe { simd_insert(a.as_u8x16(), N as u32, val).v128() }
+}
+
+/// Extracts a lane from a 128-bit vector interpreted as 8 packed i16 numbers.
+///
+/// Extracts a the scalar value of lane specified in the immediate mode operand
+/// `N` from `a`. If `N` is out of bounds then it is a compile time error.
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.extract_lane_s, N = 2))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.extract_lane_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i16x8_extract_lane<const N: usize>(a: v128) -> i16 {
+ static_assert!(N: usize where N < 8);
+ unsafe { simd_extract(a.as_i16x8(), N as u32) }
+}
+
+/// Extracts a lane from a 128-bit vector interpreted as 8 packed u16 numbers.
+///
+/// Extracts a the scalar value of lane specified in the immediate mode operand
+/// `N` from `a`. If `N` is out of bounds then it is a compile time error.
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.extract_lane_u, N = 2))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.extract_lane_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u16x8_extract_lane<const N: usize>(a: v128) -> u16 {
+ static_assert!(N: usize where N < 8);
+ unsafe { simd_extract(a.as_u16x8(), N as u32) }
+}
+
+/// Replaces a lane from a 128-bit vector interpreted as 8 packed i16 numbers.
+///
+/// Replaces the scalar value of lane specified in the immediate mode operand
+/// `N` from `a`. If `N` is out of bounds then it is a compile time error.
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.replace_lane, N = 2))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.replace_lane"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i16x8_replace_lane<const N: usize>(a: v128, val: i16) -> v128 {
+ static_assert!(N: usize where N < 8);
+ unsafe { simd_insert(a.as_i16x8(), N as u32, val).v128() }
+}
+
+/// Replaces a lane from a 128-bit vector interpreted as 8 packed u16 numbers.
+///
+/// Replaces the scalar value of lane specified in the immediate mode operand
+/// `N` from `a`. If `N` is out of bounds then it is a compile time error.
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.replace_lane, N = 2))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.replace_lane"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u16x8_replace_lane<const N: usize>(a: v128, val: u16) -> v128 {
+ static_assert!(N: usize where N < 8);
+ unsafe { simd_insert(a.as_u16x8(), N as u32, val).v128() }
+}
+
+/// Extracts a lane from a 128-bit vector interpreted as 4 packed i32 numbers.
+///
+/// Extracts the scalar value of lane specified in the immediate mode operand
+/// `N` from `a`. If `N` is out of bounds then it is a compile time error.
+#[inline]
+#[cfg_attr(test, assert_instr(i32x4.extract_lane, N = 2))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.extract_lane"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i32x4_extract_lane<const N: usize>(a: v128) -> i32 {
+ static_assert!(N: usize where N < 4);
+ unsafe { simd_extract(a.as_i32x4(), N as u32) }
+}
+
+/// Extracts a lane from a 128-bit vector interpreted as 4 packed u32 numbers.
+///
+/// Extracts the scalar value of lane specified in the immediate mode operand
+/// `N` from `a`. If `N` is out of bounds then it is a compile time error.
+#[inline]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.extract_lane"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u32x4_extract_lane<const N: usize>(a: v128) -> u32 {
+ i32x4_extract_lane::<N>(a) as u32
+}
+
+/// Replaces a lane from a 128-bit vector interpreted as 4 packed i32 numbers.
+///
+/// Replaces the scalar value of lane specified in the immediate mode operand
+/// `N` from `a`. If `N` is out of bounds then it is a compile time error.
+#[inline]
+#[cfg_attr(test, assert_instr(i32x4.replace_lane, N = 2))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.replace_lane"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i32x4_replace_lane<const N: usize>(a: v128, val: i32) -> v128 {
+ static_assert!(N: usize where N < 4);
+ unsafe { simd_insert(a.as_i32x4(), N as u32, val).v128() }
+}
+
+/// Replaces a lane from a 128-bit vector interpreted as 4 packed u32 numbers.
+///
+/// Replaces the scalar value of lane specified in the immediate mode operand
+/// `N` from `a`. If `N` is out of bounds then it is a compile time error.
+#[inline]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.replace_lane"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u32x4_replace_lane<const N: usize>(a: v128, val: u32) -> v128 {
+ i32x4_replace_lane::<N>(a, val as i32)
+}
+
+/// Extracts a lane from a 128-bit vector interpreted as 2 packed i64 numbers.
+///
+/// Extracts the scalar value of lane specified in the immediate mode operand
+/// `N` from `a`. If `N` is out of bounds then it is a compile time error.
+#[inline]
+#[cfg_attr(test, assert_instr(i64x2.extract_lane, N = 1))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i64x2.extract_lane"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i64x2_extract_lane<const N: usize>(a: v128) -> i64 {
+ static_assert!(N: usize where N < 2);
+ unsafe { simd_extract(a.as_i64x2(), N as u32) }
+}
+
+/// Extracts a lane from a 128-bit vector interpreted as 2 packed u64 numbers.
+///
+/// Extracts the scalar value of lane specified in the immediate mode operand
+/// `N` from `a`. If `N` is out of bounds then it is a compile time error.
+#[inline]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i64x2.extract_lane"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u64x2_extract_lane<const N: usize>(a: v128) -> u64 {
+ i64x2_extract_lane::<N>(a) as u64
+}
+
+/// Replaces a lane from a 128-bit vector interpreted as 2 packed i64 numbers.
+///
+/// Replaces the scalar value of lane specified in the immediate mode operand
+/// `N` from `a`. If `N` is out of bounds then it is a compile time error.
+#[inline]
+#[cfg_attr(test, assert_instr(i64x2.replace_lane, N = 0))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i64x2.replace_lane"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i64x2_replace_lane<const N: usize>(a: v128, val: i64) -> v128 {
+ static_assert!(N: usize where N < 2);
+ unsafe { simd_insert(a.as_i64x2(), N as u32, val).v128() }
+}
+
+/// Replaces a lane from a 128-bit vector interpreted as 2 packed u64 numbers.
+///
+/// Replaces the scalar value of lane specified in the immediate mode operand
+/// `N` from `a`. If `N` is out of bounds then it is a compile time error.
+#[inline]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i64x2.replace_lane"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u64x2_replace_lane<const N: usize>(a: v128, val: u64) -> v128 {
+ i64x2_replace_lane::<N>(a, val as i64)
+}
+
+/// Extracts a lane from a 128-bit vector interpreted as 4 packed f32 numbers.
+///
+/// Extracts the scalar value of lane specified fn the immediate mode operand
+/// `N` from `a`. If `N` is out of bounds then it is a compile time error.
+#[inline]
+#[cfg_attr(test, assert_instr(f32x4.extract_lane, N = 1))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f32x4.extract_lane"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f32x4_extract_lane<const N: usize>(a: v128) -> f32 {
+ static_assert!(N: usize where N < 4);
+ unsafe { simd_extract(a.as_f32x4(), N as u32) }
+}
+
+/// Replaces a lane from a 128-bit vector interpreted as 4 packed f32 numbers.
+///
+/// Replaces the scalar value of lane specified fn the immediate mode operand
+/// `N` from `a`. If `N` is out of bounds then it is a compile time error.
+#[inline]
+#[cfg_attr(test, assert_instr(f32x4.replace_lane, N = 1))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f32x4.replace_lane"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f32x4_replace_lane<const N: usize>(a: v128, val: f32) -> v128 {
+ static_assert!(N: usize where N < 4);
+ unsafe { simd_insert(a.as_f32x4(), N as u32, val).v128() }
+}
+
+/// Extracts a lane from a 128-bit vector interpreted as 2 packed f64 numbers.
+///
+/// Extracts the scalar value of lane specified fn the immediate mode operand
+/// `N` from `a`. If `N` fs out of bounds then it is a compile time error.
+#[inline]
+#[cfg_attr(test, assert_instr(f64x2.extract_lane, N = 1))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f64x2.extract_lane"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f64x2_extract_lane<const N: usize>(a: v128) -> f64 {
+ static_assert!(N: usize where N < 2);
+ unsafe { simd_extract(a.as_f64x2(), N as u32) }
+}
+
+/// Replaces a lane from a 128-bit vector interpreted as 2 packed f64 numbers.
+///
+/// Replaces the scalar value of lane specified in the immediate mode operand
+/// `N` from `a`. If `N` is out of bounds then it is a compile time error.
+#[inline]
+#[cfg_attr(test, assert_instr(f64x2.replace_lane, N = 1))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f64x2.replace_lane"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f64x2_replace_lane<const N: usize>(a: v128, val: f64) -> v128 {
+ static_assert!(N: usize where N < 2);
+ unsafe { simd_insert(a.as_f64x2(), N as u32, val).v128() }
+}
+
+/// Returns a new vector with lanes selected from the lanes of the first input
+/// vector `a` specified in the second input vector `s`.
+///
+/// The indices `i` in range [0, 15] select the `i`-th element of `a`. For
+/// indices outside of the range the resulting lane is 0.
+#[inline]
+#[cfg_attr(test, assert_instr(i8x16.swizzle))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i8x16.swizzle"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i8x16_swizzle(a: v128, s: v128) -> v128 {
+ unsafe { llvm_swizzle(a.as_i8x16(), s.as_i8x16()).v128() }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i8x16_swizzle as u8x16_swizzle;
+
+/// Creates a vector with identical lanes.
+///
+/// Constructs a vector with `x` replicated to all 16 lanes.
+#[inline]
+#[cfg_attr(test, assert_instr(i8x16.splat))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i8x16.splat"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i8x16_splat(a: i8) -> v128 {
+ simd::i8x16::splat(a).v128()
+}
+
+/// Creates a vector with identical lanes.
+///
+/// Constructs a vector with `x` replicated to all 16 lanes.
+#[inline]
+#[cfg_attr(test, assert_instr(i8x16.splat))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i8x16.splat"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u8x16_splat(a: u8) -> v128 {
+ simd::u8x16::splat(a).v128()
+}
+
+/// Creates a vector with identical lanes.
+///
+/// Construct a vector with `x` replicated to all 8 lanes.
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.splat))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.splat"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i16x8_splat(a: i16) -> v128 {
+ simd::i16x8::splat(a).v128()
+}
+
+/// Creates a vector with identical lanes.
+///
+/// Construct a vector with `x` replicated to all 8 lanes.
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.splat))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.splat"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u16x8_splat(a: u16) -> v128 {
+ simd::u16x8::splat(a).v128()
+}
+
+/// Creates a vector with identical lanes.
+///
+/// Constructs a vector with `x` replicated to all 4 lanes.
+#[inline]
+#[cfg_attr(test, assert_instr(i32x4.splat))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.splat"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i32x4_splat(a: i32) -> v128 {
+ simd::i32x4::splat(a).v128()
+}
+
+/// Creates a vector with identical lanes.
+///
+/// Constructs a vector with `x` replicated to all 4 lanes.
+#[inline]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.splat"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u32x4_splat(a: u32) -> v128 {
+ i32x4_splat(a as i32)
+}
+
+/// Creates a vector with identical lanes.
+///
+/// Construct a vector with `x` replicated to all 2 lanes.
+#[inline]
+#[cfg_attr(test, assert_instr(i64x2.splat))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i64x2.splat"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i64x2_splat(a: i64) -> v128 {
+ simd::i64x2::splat(a).v128()
+}
+
+/// Creates a vector with identical lanes.
+///
+/// Construct a vector with `x` replicated to all 2 lanes.
+#[inline]
+#[target_feature(enable = "simd128")]
+#[doc(alias("u64x2.splat"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u64x2_splat(a: u64) -> v128 {
+ i64x2_splat(a as i64)
+}
+
+/// Creates a vector with identical lanes.
+///
+/// Constructs a vector with `x` replicated to all 4 lanes.
+#[inline]
+#[cfg_attr(test, assert_instr(f32x4.splat))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f32x4.splat"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f32x4_splat(a: f32) -> v128 {
+ simd::f32x4::splat(a).v128()
+}
+
+/// Creates a vector with identical lanes.
+///
+/// Constructs a vector with `x` replicated to all 2 lanes.
+#[inline]
+#[cfg_attr(test, assert_instr(f64x2.splat))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f64x2.splat"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f64x2_splat(a: f64) -> v128 {
+ simd::f64x2::splat(a).v128()
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 16 eight-bit
+/// integers.
+///
+/// Returns a new vector where each lane is all ones if the corresponding input elements
+/// were equal, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(i8x16.eq))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i8x16.eq"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i8x16_eq(a: v128, b: v128) -> v128 {
+ unsafe { simd_eq::<_, simd::i8x16>(a.as_i8x16(), b.as_i8x16()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 16 eight-bit
+/// integers.
+///
+/// Returns a new vector where each lane is all ones if the corresponding input elements
+/// were not equal, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(i8x16.ne))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i8x16.ne"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i8x16_ne(a: v128, b: v128) -> v128 {
+ unsafe { simd_ne::<_, simd::i8x16>(a.as_i8x16(), b.as_i8x16()).v128() }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i8x16_eq as u8x16_eq;
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i8x16_ne as u8x16_ne;
+
+/// Compares two 128-bit vectors as if they were two vectors of 16 eight-bit
+/// signed integers.
+///
+/// Returns a new vector where each lane is all ones if the lane-wise left
+/// element is less than the right element, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(i8x16.lt_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i8x16.lt_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i8x16_lt(a: v128, b: v128) -> v128 {
+ unsafe { simd_lt::<_, simd::i8x16>(a.as_i8x16(), b.as_i8x16()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 16 eight-bit
+/// unsigned integers.
+///
+/// Returns a new vector where each lane is all ones if the lane-wise left
+/// element is less than the right element, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(i8x16.lt_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i8x16.lt_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u8x16_lt(a: v128, b: v128) -> v128 {
+ unsafe { simd_lt::<_, simd::i8x16>(a.as_u8x16(), b.as_u8x16()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 16 eight-bit
+/// signed integers.
+///
+/// Returns a new vector where each lane is all ones if the lane-wise left
+/// element is greater than the right element, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(i8x16.gt_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i8x16.gt_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i8x16_gt(a: v128, b: v128) -> v128 {
+ unsafe { simd_gt::<_, simd::i8x16>(a.as_i8x16(), b.as_i8x16()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 16 eight-bit
+/// unsigned integers.
+///
+/// Returns a new vector where each lane is all ones if the lane-wise left
+/// element is greater than the right element, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(i8x16.gt_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i8x16.gt_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u8x16_gt(a: v128, b: v128) -> v128 {
+ unsafe { simd_gt::<_, simd::i8x16>(a.as_u8x16(), b.as_u8x16()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 16 eight-bit
+/// signed integers.
+///
+/// Returns a new vector where each lane is all ones if the lane-wise left
+/// element is less than the right element, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(i8x16.le_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i8x16.le_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i8x16_le(a: v128, b: v128) -> v128 {
+ unsafe { simd_le::<_, simd::i8x16>(a.as_i8x16(), b.as_i8x16()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 16 eight-bit
+/// unsigned integers.
+///
+/// Returns a new vector where each lane is all ones if the lane-wise left
+/// element is less than the right element, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(i8x16.le_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i8x16.le_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u8x16_le(a: v128, b: v128) -> v128 {
+ unsafe { simd_le::<_, simd::i8x16>(a.as_u8x16(), b.as_u8x16()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 16 eight-bit
+/// signed integers.
+///
+/// Returns a new vector where each lane is all ones if the lane-wise left
+/// element is greater than the right element, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(i8x16.ge_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i8x16.ge_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i8x16_ge(a: v128, b: v128) -> v128 {
+ unsafe { simd_ge::<_, simd::i8x16>(a.as_i8x16(), b.as_i8x16()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 16 eight-bit
+/// unsigned integers.
+///
+/// Returns a new vector where each lane is all ones if the lane-wise left
+/// element is greater than the right element, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(i8x16.ge_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i8x16.ge_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u8x16_ge(a: v128, b: v128) -> v128 {
+ unsafe { simd_ge::<_, simd::i8x16>(a.as_u8x16(), b.as_u8x16()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 8 sixteen-bit
+/// integers.
+///
+/// Returns a new vector where each lane is all ones if the corresponding input elements
+/// were equal, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.eq))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.eq"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i16x8_eq(a: v128, b: v128) -> v128 {
+ unsafe { simd_eq::<_, simd::i16x8>(a.as_i16x8(), b.as_i16x8()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 8 sixteen-bit
+/// integers.
+///
+/// Returns a new vector where each lane is all ones if the corresponding input elements
+/// were not equal, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.ne))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.ne"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i16x8_ne(a: v128, b: v128) -> v128 {
+ unsafe { simd_ne::<_, simd::i16x8>(a.as_i16x8(), b.as_i16x8()).v128() }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i16x8_eq as u16x8_eq;
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i16x8_ne as u16x8_ne;
+
+/// Compares two 128-bit vectors as if they were two vectors of 8 sixteen-bit
+/// signed integers.
+///
+/// Returns a new vector where each lane is all ones if the lane-wise left
+/// element is less than the right element, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.lt_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.lt_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i16x8_lt(a: v128, b: v128) -> v128 {
+ unsafe { simd_lt::<_, simd::i16x8>(a.as_i16x8(), b.as_i16x8()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 8 sixteen-bit
+/// unsigned integers.
+///
+/// Returns a new vector where each lane is all ones if the lane-wise left
+/// element is less than the right element, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.lt_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.lt_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u16x8_lt(a: v128, b: v128) -> v128 {
+ unsafe { simd_lt::<_, simd::i16x8>(a.as_u16x8(), b.as_u16x8()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 8 sixteen-bit
+/// signed integers.
+///
+/// Returns a new vector where each lane is all ones if the lane-wise left
+/// element is greater than the right element, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.gt_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.gt_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i16x8_gt(a: v128, b: v128) -> v128 {
+ unsafe { simd_gt::<_, simd::i16x8>(a.as_i16x8(), b.as_i16x8()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 8 sixteen-bit
+/// unsigned integers.
+///
+/// Returns a new vector where each lane is all ones if the lane-wise left
+/// element is greater than the right element, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.gt_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.gt_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u16x8_gt(a: v128, b: v128) -> v128 {
+ unsafe { simd_gt::<_, simd::i16x8>(a.as_u16x8(), b.as_u16x8()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 8 sixteen-bit
+/// signed integers.
+///
+/// Returns a new vector where each lane is all ones if the lane-wise left
+/// element is less than the right element, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.le_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.le_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i16x8_le(a: v128, b: v128) -> v128 {
+ unsafe { simd_le::<_, simd::i16x8>(a.as_i16x8(), b.as_i16x8()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 8 sixteen-bit
+/// unsigned integers.
+///
+/// Returns a new vector where each lane is all ones if the lane-wise left
+/// element is less than the right element, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.le_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.le_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u16x8_le(a: v128, b: v128) -> v128 {
+ unsafe { simd_le::<_, simd::i16x8>(a.as_u16x8(), b.as_u16x8()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 8 sixteen-bit
+/// signed integers.
+///
+/// Returns a new vector where each lane is all ones if the lane-wise left
+/// element is greater than the right element, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.ge_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.ge_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i16x8_ge(a: v128, b: v128) -> v128 {
+ unsafe { simd_ge::<_, simd::i16x8>(a.as_i16x8(), b.as_i16x8()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 8 sixteen-bit
+/// unsigned integers.
+///
+/// Returns a new vector where each lane is all ones if the lane-wise left
+/// element is greater than the right element, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.ge_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.ge_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u16x8_ge(a: v128, b: v128) -> v128 {
+ unsafe { simd_ge::<_, simd::i16x8>(a.as_u16x8(), b.as_u16x8()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 4 thirty-two-bit
+/// integers.
+///
+/// Returns a new vector where each lane is all ones if the corresponding input elements
+/// were equal, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(i32x4.eq))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.eq"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i32x4_eq(a: v128, b: v128) -> v128 {
+ unsafe { simd_eq::<_, simd::i32x4>(a.as_i32x4(), b.as_i32x4()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 4 thirty-two-bit
+/// integers.
+///
+/// Returns a new vector where each lane is all ones if the corresponding input elements
+/// were not equal, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(i32x4.ne))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.ne"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i32x4_ne(a: v128, b: v128) -> v128 {
+ unsafe { simd_ne::<_, simd::i32x4>(a.as_i32x4(), b.as_i32x4()).v128() }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i32x4_eq as u32x4_eq;
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i32x4_ne as u32x4_ne;
+
+/// Compares two 128-bit vectors as if they were two vectors of 4 thirty-two-bit
+/// signed integers.
+///
+/// Returns a new vector where each lane is all ones if the lane-wise left
+/// element is less than the right element, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(i32x4.lt_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.lt_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i32x4_lt(a: v128, b: v128) -> v128 {
+ unsafe { simd_lt::<_, simd::i32x4>(a.as_i32x4(), b.as_i32x4()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 4 thirty-two-bit
+/// unsigned integers.
+///
+/// Returns a new vector where each lane is all ones if the lane-wise left
+/// element is less than the right element, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(i32x4.lt_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.lt_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u32x4_lt(a: v128, b: v128) -> v128 {
+ unsafe { simd_lt::<_, simd::i32x4>(a.as_u32x4(), b.as_u32x4()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 4 thirty-two-bit
+/// signed integers.
+///
+/// Returns a new vector where each lane is all ones if the lane-wise left
+/// element is greater than the right element, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(i32x4.gt_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.gt_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i32x4_gt(a: v128, b: v128) -> v128 {
+ unsafe { simd_gt::<_, simd::i32x4>(a.as_i32x4(), b.as_i32x4()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 4 thirty-two-bit
+/// unsigned integers.
+///
+/// Returns a new vector where each lane is all ones if the lane-wise left
+/// element is greater than the right element, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(i32x4.gt_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.gt_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u32x4_gt(a: v128, b: v128) -> v128 {
+ unsafe { simd_gt::<_, simd::i32x4>(a.as_u32x4(), b.as_u32x4()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 4 thirty-two-bit
+/// signed integers.
+///
+/// Returns a new vector where each lane is all ones if the lane-wise left
+/// element is less than the right element, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(i32x4.le_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.le_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i32x4_le(a: v128, b: v128) -> v128 {
+ unsafe { simd_le::<_, simd::i32x4>(a.as_i32x4(), b.as_i32x4()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 4 thirty-two-bit
+/// unsigned integers.
+///
+/// Returns a new vector where each lane is all ones if the lane-wise left
+/// element is less than the right element, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(i32x4.le_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.le_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u32x4_le(a: v128, b: v128) -> v128 {
+ unsafe { simd_le::<_, simd::i32x4>(a.as_u32x4(), b.as_u32x4()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 4 thirty-two-bit
+/// signed integers.
+///
+/// Returns a new vector where each lane is all ones if the lane-wise left
+/// element is greater than the right element, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(i32x4.ge_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.ge_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i32x4_ge(a: v128, b: v128) -> v128 {
+ unsafe { simd_ge::<_, simd::i32x4>(a.as_i32x4(), b.as_i32x4()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 4 thirty-two-bit
+/// unsigned integers.
+///
+/// Returns a new vector where each lane is all ones if the lane-wise left
+/// element is greater than the right element, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(i32x4.ge_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.ge_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u32x4_ge(a: v128, b: v128) -> v128 {
+ unsafe { simd_ge::<_, simd::i32x4>(a.as_u32x4(), b.as_u32x4()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 2 sixty-four-bit
+/// integers.
+///
+/// Returns a new vector where each lane is all ones if the corresponding input elements
+/// were equal, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(i64x2.eq))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i64x2.eq"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i64x2_eq(a: v128, b: v128) -> v128 {
+ unsafe { simd_eq::<_, simd::i64x2>(a.as_i64x2(), b.as_i64x2()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 2 sixty-four-bit
+/// integers.
+///
+/// Returns a new vector where each lane is all ones if the corresponding input elements
+/// were not equal, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(i64x2.ne))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i64x2.ne"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i64x2_ne(a: v128, b: v128) -> v128 {
+ unsafe { simd_ne::<_, simd::i64x2>(a.as_i64x2(), b.as_i64x2()).v128() }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i64x2_eq as u64x2_eq;
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i64x2_ne as u64x2_ne;
+
+/// Compares two 128-bit vectors as if they were two vectors of 2 sixty-four-bit
+/// signed integers.
+///
+/// Returns a new vector where each lane is all ones if the lane-wise left
+/// element is less than the right element, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(i64x2.lt_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i64x2.lt_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i64x2_lt(a: v128, b: v128) -> v128 {
+ unsafe { simd_lt::<_, simd::i64x2>(a.as_i64x2(), b.as_i64x2()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 2 sixty-four-bit
+/// signed integers.
+///
+/// Returns a new vector where each lane is all ones if the lane-wise left
+/// element is greater than the right element, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(i64x2.gt_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i64x2.gt_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i64x2_gt(a: v128, b: v128) -> v128 {
+ unsafe { simd_gt::<_, simd::i64x2>(a.as_i64x2(), b.as_i64x2()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 2 sixty-four-bit
+/// signed integers.
+///
+/// Returns a new vector where each lane is all ones if the lane-wise left
+/// element is less than the right element, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(i64x2.le_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i64x2.le_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i64x2_le(a: v128, b: v128) -> v128 {
+ unsafe { simd_le::<_, simd::i64x2>(a.as_i64x2(), b.as_i64x2()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 2 sixty-four-bit
+/// signed integers.
+///
+/// Returns a new vector where each lane is all ones if the lane-wise left
+/// element is greater than the right element, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(i64x2.ge_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i64x2.ge_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i64x2_ge(a: v128, b: v128) -> v128 {
+ unsafe { simd_ge::<_, simd::i64x2>(a.as_i64x2(), b.as_i64x2()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 4 thirty-two-bit
+/// floating point numbers.
+///
+/// Returns a new vector where each lane is all ones if the corresponding input elements
+/// were equal, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(f32x4.eq))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f32x4.eq"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f32x4_eq(a: v128, b: v128) -> v128 {
+ unsafe { simd_eq::<_, simd::i32x4>(a.as_f32x4(), b.as_f32x4()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 4 thirty-two-bit
+/// floating point numbers.
+///
+/// Returns a new vector where each lane is all ones if the corresponding input elements
+/// were not equal, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(f32x4.ne))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f32x4.ne"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f32x4_ne(a: v128, b: v128) -> v128 {
+ unsafe { simd_ne::<_, simd::i32x4>(a.as_f32x4(), b.as_f32x4()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 4 thirty-two-bit
+/// floating point numbers.
+///
+/// Returns a new vector where each lane is all ones if the lane-wise left
+/// element is less than the right element, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(f32x4.lt))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f32x4.lt"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f32x4_lt(a: v128, b: v128) -> v128 {
+ unsafe { simd_lt::<_, simd::i32x4>(a.as_f32x4(), b.as_f32x4()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 4 thirty-two-bit
+/// floating point numbers.
+///
+/// Returns a new vector where each lane is all ones if the lane-wise left
+/// element is greater than the right element, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(f32x4.gt))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f32x4.gt"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f32x4_gt(a: v128, b: v128) -> v128 {
+ unsafe { simd_gt::<_, simd::i32x4>(a.as_f32x4(), b.as_f32x4()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 4 thirty-two-bit
+/// floating point numbers.
+///
+/// Returns a new vector where each lane is all ones if the lane-wise left
+/// element is less than the right element, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(f32x4.le))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f32x4.le"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f32x4_le(a: v128, b: v128) -> v128 {
+ unsafe { simd_le::<_, simd::i32x4>(a.as_f32x4(), b.as_f32x4()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 4 thirty-two-bit
+/// floating point numbers.
+///
+/// Returns a new vector where each lane is all ones if the lane-wise left
+/// element is greater than the right element, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(f32x4.ge))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f32x4.ge"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f32x4_ge(a: v128, b: v128) -> v128 {
+ unsafe { simd_ge::<_, simd::i32x4>(a.as_f32x4(), b.as_f32x4()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 2 sixty-four-bit
+/// floating point numbers.
+///
+/// Returns a new vector where each lane is all ones if the corresponding input elements
+/// were equal, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(f64x2.eq))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f64x2.eq"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f64x2_eq(a: v128, b: v128) -> v128 {
+ unsafe { simd_eq::<_, simd::i64x2>(a.as_f64x2(), b.as_f64x2()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 2 sixty-four-bit
+/// floating point numbers.
+///
+/// Returns a new vector where each lane is all ones if the corresponding input elements
+/// were not equal, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(f64x2.ne))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f64x2.ne"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f64x2_ne(a: v128, b: v128) -> v128 {
+ unsafe { simd_ne::<_, simd::i64x2>(a.as_f64x2(), b.as_f64x2()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 2 sixty-four-bit
+/// floating point numbers.
+///
+/// Returns a new vector where each lane is all ones if the lane-wise left
+/// element is less than the right element, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(f64x2.lt))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f64x2.lt"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f64x2_lt(a: v128, b: v128) -> v128 {
+ unsafe { simd_lt::<_, simd::i64x2>(a.as_f64x2(), b.as_f64x2()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 2 sixty-four-bit
+/// floating point numbers.
+///
+/// Returns a new vector where each lane is all ones if the lane-wise left
+/// element is greater than the right element, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(f64x2.gt))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f64x2.gt"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f64x2_gt(a: v128, b: v128) -> v128 {
+ unsafe { simd_gt::<_, simd::i64x2>(a.as_f64x2(), b.as_f64x2()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 2 sixty-four-bit
+/// floating point numbers.
+///
+/// Returns a new vector where each lane is all ones if the lane-wise left
+/// element is less than the right element, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(f64x2.le))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f64x2.le"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f64x2_le(a: v128, b: v128) -> v128 {
+ unsafe { simd_le::<_, simd::i64x2>(a.as_f64x2(), b.as_f64x2()).v128() }
+}
+
+/// Compares two 128-bit vectors as if they were two vectors of 2 sixty-four-bit
+/// floating point numbers.
+///
+/// Returns a new vector where each lane is all ones if the lane-wise left
+/// element is greater than the right element, or all zeros otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(f64x2.ge))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f64x2.ge"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f64x2_ge(a: v128, b: v128) -> v128 {
+ unsafe { simd_ge::<_, simd::i64x2>(a.as_f64x2(), b.as_f64x2()).v128() }
+}
+
+/// Flips each bit of the 128-bit input vector.
+#[inline]
+#[cfg_attr(test, assert_instr(v128.not))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("v128.not"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn v128_not(a: v128) -> v128 {
+ unsafe { simd_xor(a.as_i64x2(), simd::i64x2(!0, !0)).v128() }
+}
+
+/// Performs a bitwise and of the two input 128-bit vectors, returning the
+/// resulting vector.
+#[inline]
+#[cfg_attr(test, assert_instr(v128.and))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("v128.and"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn v128_and(a: v128, b: v128) -> v128 {
+ unsafe { simd_and(a.as_i64x2(), b.as_i64x2()).v128() }
+}
+
+/// Bitwise AND of bits of `a` and the logical inverse of bits of `b`.
+///
+/// This operation is equivalent to `v128.and(a, v128.not(b))`
+#[inline]
+#[cfg_attr(test, assert_instr(v128.andnot))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("v128.andnot"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn v128_andnot(a: v128, b: v128) -> v128 {
+ unsafe { simd_and(a.as_i64x2(), simd_xor(b.as_i64x2(), simd::i64x2(-1, -1))).v128() }
+}
+
+/// Performs a bitwise or of the two input 128-bit vectors, returning the
+/// resulting vector.
+#[inline]
+#[cfg_attr(test, assert_instr(v128.or))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("v128.or"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn v128_or(a: v128, b: v128) -> v128 {
+ unsafe { simd_or(a.as_i64x2(), b.as_i64x2()).v128() }
+}
+
+/// Performs a bitwise xor of the two input 128-bit vectors, returning the
+/// resulting vector.
+#[inline]
+#[cfg_attr(test, assert_instr(v128.xor))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("v128.xor"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn v128_xor(a: v128, b: v128) -> v128 {
+ unsafe { simd_xor(a.as_i64x2(), b.as_i64x2()).v128() }
+}
+
+/// Use the bitmask in `c` to select bits from `v1` when 1 and `v2` when 0.
+#[inline]
+#[cfg_attr(test, assert_instr(v128.bitselect))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("v128.bitselect"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn v128_bitselect(v1: v128, v2: v128, c: v128) -> v128 {
+ unsafe { llvm_bitselect(v1.as_i8x16(), v2.as_i8x16(), c.as_i8x16()).v128() }
+}
+
+/// Returns `true` if any bit in `a` is set, or `false` otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(v128.any_true))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("v128.any_true"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn v128_any_true(a: v128) -> bool {
+ unsafe { llvm_any_true_i8x16(a.as_i8x16()) != 0 }
+}
+
+/// Lane-wise wrapping absolute value.
+#[inline]
+#[cfg_attr(test, assert_instr(i8x16.abs))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i8x16.abs"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i8x16_abs(a: v128) -> v128 {
+ unsafe {
+ let a = a.as_i8x16();
+ let zero = simd::i8x16::splat(0);
+ simd_select::<simd::m8x16, simd::i8x16>(simd_lt(a, zero), simd_sub(zero, a), a).v128()
+ }
+}
+
+/// Negates a 128-bit vectors interpreted as sixteen 8-bit signed integers
+#[inline]
+#[cfg_attr(test, assert_instr(i8x16.neg))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i8x16.neg"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i8x16_neg(a: v128) -> v128 {
+ unsafe { simd_mul(a.as_i8x16(), simd::i8x16::splat(-1)).v128() }
+}
+
+/// Count the number of bits set to one within each lane.
+#[inline]
+#[cfg_attr(test, assert_instr(i8x16.popcnt))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i8x16.popcnt"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i8x16_popcnt(v: v128) -> v128 {
+ unsafe { llvm_popcnt(v.as_i8x16()).v128() }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i8x16_popcnt as u8x16_popcnt;
+
+/// Returns true if all lanes are non-zero, false otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(i8x16.all_true))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i8x16.all_true"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i8x16_all_true(a: v128) -> bool {
+ unsafe { llvm_i8x16_all_true(a.as_i8x16()) != 0 }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i8x16_all_true as u8x16_all_true;
+
+/// Extracts the high bit for each lane in `a` and produce a scalar mask with
+/// all bits concatenated.
+#[inline]
+#[cfg_attr(test, assert_instr(i8x16.bitmask))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i8x16.bitmask"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i8x16_bitmask(a: v128) -> u16 {
+ // FIXME(https://bugs.llvm.org/show_bug.cgi?id=50507) - this produces an
+ // extraneous `i32.and` instruction against a mask of 65535 when converting
+ // from the native intrinsic's i32 return value to our desired u16. This
+ // shouldn't be necessary, though, but requires upstream LLVM changes.
+ unsafe { llvm_bitmask_i8x16(a.as_i8x16()) as u16 }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i8x16_bitmask as u8x16_bitmask;
+
+/// Converts two input vectors into a smaller lane vector by narrowing each
+/// lane.
+///
+/// Signed saturation to 0x7f or 0x80 is used and the input lanes are always
+/// interpreted as signed integers.
+#[inline]
+#[cfg_attr(test, assert_instr(i8x16.narrow_i16x8_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i8x16.narrow_i16x8_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i8x16_narrow_i16x8(a: v128, b: v128) -> v128 {
+ unsafe { llvm_narrow_i8x16_s(a.as_i16x8(), b.as_i16x8()).v128() }
+}
+
+/// Converts two input vectors into a smaller lane vector by narrowing each
+/// lane.
+///
+/// Signed saturation to 0x00 or 0xff is used and the input lanes are always
+/// interpreted as signed integers.
+#[inline]
+#[cfg_attr(test, assert_instr(i8x16.narrow_i16x8_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i8x16.narrow_i16x8_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u8x16_narrow_i16x8(a: v128, b: v128) -> v128 {
+ unsafe { llvm_narrow_i8x16_u(a.as_i16x8(), b.as_i16x8()).v128() }
+}
+
+/// Shifts each lane to the left by the specified number of bits.
+///
+/// Only the low bits of the shift amount are used if the shift amount is
+/// greater than the lane width.
+#[inline]
+#[cfg_attr(test, assert_instr(i8x16.shl))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i8x16.shl"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i8x16_shl(a: v128, amt: u32) -> v128 {
+ unsafe { simd_shl(a.as_i8x16(), simd::i8x16::splat(amt as i8)).v128() }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i8x16_shl as u8x16_shl;
+
+/// Shifts each lane to the right by the specified number of bits, sign
+/// extending.
+///
+/// Only the low bits of the shift amount are used if the shift amount is
+/// greater than the lane width.
+#[inline]
+#[cfg_attr(test, assert_instr(i8x16.shr_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i8x16.shr_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i8x16_shr(a: v128, amt: u32) -> v128 {
+ unsafe { simd_shr(a.as_i8x16(), simd::i8x16::splat(amt as i8)).v128() }
+}
+
+/// Shifts each lane to the right by the specified number of bits, shifting in
+/// zeros.
+///
+/// Only the low bits of the shift amount are used if the shift amount is
+/// greater than the lane width.
+#[inline]
+#[cfg_attr(test, assert_instr(i8x16.shr_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i8x16.shr_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u8x16_shr(a: v128, amt: u32) -> v128 {
+ unsafe { simd_shr(a.as_u8x16(), simd::u8x16::splat(amt as u8)).v128() }
+}
+
+/// Adds two 128-bit vectors as if they were two packed sixteen 8-bit integers.
+#[inline]
+#[cfg_attr(test, assert_instr(i8x16.add))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i8x16.add"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i8x16_add(a: v128, b: v128) -> v128 {
+ unsafe { simd_add(a.as_i8x16(), b.as_i8x16()).v128() }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i8x16_add as u8x16_add;
+
+/// Adds two 128-bit vectors as if they were two packed sixteen 8-bit signed
+/// integers, saturating on overflow to `i8::MAX`.
+#[inline]
+#[cfg_attr(test, assert_instr(i8x16.add_sat_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i8x16.add_sat_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i8x16_add_sat(a: v128, b: v128) -> v128 {
+ unsafe { llvm_i8x16_add_sat_s(a.as_i8x16(), b.as_i8x16()).v128() }
+}
+
+/// Adds two 128-bit vectors as if they were two packed sixteen 8-bit unsigned
+/// integers, saturating on overflow to `u8::MAX`.
+#[inline]
+#[cfg_attr(test, assert_instr(i8x16.add_sat_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i8x16.add_sat_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u8x16_add_sat(a: v128, b: v128) -> v128 {
+ unsafe { llvm_i8x16_add_sat_u(a.as_i8x16(), b.as_i8x16()).v128() }
+}
+
+/// Subtracts two 128-bit vectors as if they were two packed sixteen 8-bit integers.
+#[inline]
+#[cfg_attr(test, assert_instr(i8x16.sub))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i8x16.sub"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i8x16_sub(a: v128, b: v128) -> v128 {
+ unsafe { simd_sub(a.as_i8x16(), b.as_i8x16()).v128() }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i8x16_sub as u8x16_sub;
+
+/// Subtracts two 128-bit vectors as if they were two packed sixteen 8-bit
+/// signed integers, saturating on overflow to `i8::MIN`.
+#[inline]
+#[cfg_attr(test, assert_instr(i8x16.sub_sat_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i8x16.sub_sat_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i8x16_sub_sat(a: v128, b: v128) -> v128 {
+ unsafe { llvm_i8x16_sub_sat_s(a.as_i8x16(), b.as_i8x16()).v128() }
+}
+
+/// Subtracts two 128-bit vectors as if they were two packed sixteen 8-bit
+/// unsigned integers, saturating on overflow to 0.
+#[inline]
+#[cfg_attr(test, assert_instr(i8x16.sub_sat_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i8x16.sub_sat_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u8x16_sub_sat(a: v128, b: v128) -> v128 {
+ unsafe { llvm_i8x16_sub_sat_u(a.as_i8x16(), b.as_i8x16()).v128() }
+}
+
+/// Compares lane-wise signed integers, and returns the minimum of
+/// each pair.
+#[inline]
+#[cfg_attr(test, assert_instr(i8x16.min_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i8x16.min_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i8x16_min(a: v128, b: v128) -> v128 {
+ let a = a.as_i8x16();
+ let b = b.as_i8x16();
+ unsafe { simd_select::<simd::i8x16, _>(simd_lt(a, b), a, b).v128() }
+}
+
+/// Compares lane-wise unsigned integers, and returns the minimum of
+/// each pair.
+#[inline]
+#[cfg_attr(test, assert_instr(i8x16.min_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i8x16.min_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u8x16_min(a: v128, b: v128) -> v128 {
+ let a = a.as_u8x16();
+ let b = b.as_u8x16();
+ unsafe { simd_select::<simd::i8x16, _>(simd_lt(a, b), a, b).v128() }
+}
+
+/// Compares lane-wise signed integers, and returns the maximum of
+/// each pair.
+#[inline]
+#[cfg_attr(test, assert_instr(i8x16.max_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i8x16.max_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i8x16_max(a: v128, b: v128) -> v128 {
+ let a = a.as_i8x16();
+ let b = b.as_i8x16();
+ unsafe { simd_select::<simd::i8x16, _>(simd_gt(a, b), a, b).v128() }
+}
+
+/// Compares lane-wise unsigned integers, and returns the maximum of
+/// each pair.
+#[inline]
+#[cfg_attr(test, assert_instr(i8x16.max_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i8x16.max_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u8x16_max(a: v128, b: v128) -> v128 {
+ let a = a.as_u8x16();
+ let b = b.as_u8x16();
+ unsafe { simd_select::<simd::i8x16, _>(simd_gt(a, b), a, b).v128() }
+}
+
+/// Lane-wise rounding average.
+#[inline]
+#[cfg_attr(test, assert_instr(i8x16.avgr_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i8x16.avgr_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u8x16_avgr(a: v128, b: v128) -> v128 {
+ unsafe { llvm_avgr_u_i8x16(a.as_i8x16(), b.as_i8x16()).v128() }
+}
+
+/// Integer extended pairwise addition producing extended results
+/// (twice wider results than the inputs).
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.extadd_pairwise_i8x16_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.extadd_pairwise_i8x16_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i16x8_extadd_pairwise_i8x16(a: v128) -> v128 {
+ unsafe { llvm_i16x8_extadd_pairwise_i8x16_s(a.as_i8x16()).v128() }
+}
+
+/// Integer extended pairwise addition producing extended results
+/// (twice wider results than the inputs).
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.extadd_pairwise_i8x16_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.extadd_pairwise_i8x16_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i16x8_extadd_pairwise_u8x16(a: v128) -> v128 {
+ unsafe { llvm_i16x8_extadd_pairwise_i8x16_u(a.as_i8x16()).v128() }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i16x8_extadd_pairwise_u8x16 as u16x8_extadd_pairwise_u8x16;
+
+/// Lane-wise wrapping absolute value.
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.abs))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.abs"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i16x8_abs(a: v128) -> v128 {
+ let a = a.as_i16x8();
+ let zero = simd::i16x8::splat(0);
+ unsafe {
+ simd_select::<simd::m16x8, simd::i16x8>(simd_lt(a, zero), simd_sub(zero, a), a).v128()
+ }
+}
+
+/// Negates a 128-bit vectors interpreted as eight 16-bit signed integers
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.neg))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.neg"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i16x8_neg(a: v128) -> v128 {
+ unsafe { simd_mul(a.as_i16x8(), simd::i16x8::splat(-1)).v128() }
+}
+
+/// Lane-wise saturating rounding multiplication in Q15 format.
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.q15mulr_sat_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.q15mulr_sat_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i16x8_q15mulr_sat(a: v128, b: v128) -> v128 {
+ unsafe { llvm_q15mulr(a.as_i16x8(), b.as_i16x8()).v128() }
+}
+
+/// Returns true if all lanes are non-zero, false otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.all_true))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.all_true"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i16x8_all_true(a: v128) -> bool {
+ unsafe { llvm_i16x8_all_true(a.as_i16x8()) != 0 }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i16x8_all_true as u16x8_all_true;
+
+/// Extracts the high bit for each lane in `a` and produce a scalar mask with
+/// all bits concatenated.
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.bitmask))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.bitmask"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i16x8_bitmask(a: v128) -> u8 {
+ unsafe { llvm_bitmask_i16x8(a.as_i16x8()) as u8 }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i16x8_bitmask as u16x8_bitmask;
+
+/// Converts two input vectors into a smaller lane vector by narrowing each
+/// lane.
+///
+/// Signed saturation to 0x7fff or 0x8000 is used and the input lanes are always
+/// interpreted as signed integers.
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.narrow_i32x4_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.narrow_i32x4_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i16x8_narrow_i32x4(a: v128, b: v128) -> v128 {
+ unsafe { llvm_narrow_i16x8_s(a.as_i32x4(), b.as_i32x4()).v128() }
+}
+
+/// Converts two input vectors into a smaller lane vector by narrowing each
+/// lane.
+///
+/// Signed saturation to 0x0000 or 0xffff is used and the input lanes are always
+/// interpreted as signed integers.
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.narrow_i32x4_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.narrow_i32x4_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u16x8_narrow_i32x4(a: v128, b: v128) -> v128 {
+ unsafe { llvm_narrow_i16x8_u(a.as_i32x4(), b.as_i32x4()).v128() }
+}
+
+/// Converts low half of the smaller lane vector to a larger lane
+/// vector, sign extended.
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.extend_low_i8x16_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.extend_low_i8x16_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i16x8_extend_low_i8x16(a: v128) -> v128 {
+ unsafe {
+ simd_cast::<simd::i8x8, simd::i16x8>(simd_shuffle8!(
+ a.as_i8x16(),
+ a.as_i8x16(),
+ [0, 1, 2, 3, 4, 5, 6, 7],
+ ))
+ .v128()
+ }
+}
+
+/// Converts high half of the smaller lane vector to a larger lane
+/// vector, sign extended.
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.extend_high_i8x16_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.extend_high_i8x16_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i16x8_extend_high_i8x16(a: v128) -> v128 {
+ unsafe {
+ simd_cast::<simd::i8x8, simd::i16x8>(simd_shuffle8!(
+ a.as_i8x16(),
+ a.as_i8x16(),
+ [8, 9, 10, 11, 12, 13, 14, 15],
+ ))
+ .v128()
+ }
+}
+
+/// Converts low half of the smaller lane vector to a larger lane
+/// vector, zero extended.
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.extend_low_i8x16_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.extend_low_i8x16_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i16x8_extend_low_u8x16(a: v128) -> v128 {
+ unsafe {
+ simd_cast::<simd::u8x8, simd::u16x8>(simd_shuffle8!(
+ a.as_u8x16(),
+ a.as_u8x16(),
+ [0, 1, 2, 3, 4, 5, 6, 7],
+ ))
+ .v128()
+ }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i16x8_extend_low_u8x16 as u16x8_extend_low_u8x16;
+
+/// Converts high half of the smaller lane vector to a larger lane
+/// vector, zero extended.
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.extend_high_i8x16_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.extend_high_i8x16_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i16x8_extend_high_u8x16(a: v128) -> v128 {
+ unsafe {
+ simd_cast::<simd::u8x8, simd::u16x8>(simd_shuffle8!(
+ a.as_u8x16(),
+ a.as_u8x16(),
+ [8, 9, 10, 11, 12, 13, 14, 15],
+ ))
+ .v128()
+ }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i16x8_extend_high_u8x16 as u16x8_extend_high_u8x16;
+
+/// Shifts each lane to the left by the specified number of bits.
+///
+/// Only the low bits of the shift amount are used if the shift amount is
+/// greater than the lane width.
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.shl))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.shl"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i16x8_shl(a: v128, amt: u32) -> v128 {
+ unsafe { simd_shl(a.as_i16x8(), simd::i16x8::splat(amt as i16)).v128() }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i16x8_shl as u16x8_shl;
+
+/// Shifts each lane to the right by the specified number of bits, sign
+/// extending.
+///
+/// Only the low bits of the shift amount are used if the shift amount is
+/// greater than the lane width.
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.shr_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.shr_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i16x8_shr(a: v128, amt: u32) -> v128 {
+ unsafe { simd_shr(a.as_i16x8(), simd::i16x8::splat(amt as i16)).v128() }
+}
+
+/// Shifts each lane to the right by the specified number of bits, shifting in
+/// zeros.
+///
+/// Only the low bits of the shift amount are used if the shift amount is
+/// greater than the lane width.
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.shr_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.shr_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u16x8_shr(a: v128, amt: u32) -> v128 {
+ unsafe { simd_shr(a.as_u16x8(), simd::u16x8::splat(amt as u16)).v128() }
+}
+
+/// Adds two 128-bit vectors as if they were two packed eight 16-bit integers.
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.add))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.add"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i16x8_add(a: v128, b: v128) -> v128 {
+ unsafe { simd_add(a.as_i16x8(), b.as_i16x8()).v128() }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i16x8_add as u16x8_add;
+
+/// Adds two 128-bit vectors as if they were two packed eight 16-bit signed
+/// integers, saturating on overflow to `i16::MAX`.
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.add_sat_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.add_sat_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i16x8_add_sat(a: v128, b: v128) -> v128 {
+ unsafe { llvm_i16x8_add_sat_s(a.as_i16x8(), b.as_i16x8()).v128() }
+}
+
+/// Adds two 128-bit vectors as if they were two packed eight 16-bit unsigned
+/// integers, saturating on overflow to `u16::MAX`.
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.add_sat_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.add_sat_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u16x8_add_sat(a: v128, b: v128) -> v128 {
+ unsafe { llvm_i16x8_add_sat_u(a.as_i16x8(), b.as_i16x8()).v128() }
+}
+
+/// Subtracts two 128-bit vectors as if they were two packed eight 16-bit integers.
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.sub))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.sub"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i16x8_sub(a: v128, b: v128) -> v128 {
+ unsafe { simd_sub(a.as_i16x8(), b.as_i16x8()).v128() }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i16x8_sub as u16x8_sub;
+
+/// Subtracts two 128-bit vectors as if they were two packed eight 16-bit
+/// signed integers, saturating on overflow to `i16::MIN`.
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.sub_sat_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.sub_sat_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i16x8_sub_sat(a: v128, b: v128) -> v128 {
+ unsafe { llvm_i16x8_sub_sat_s(a.as_i16x8(), b.as_i16x8()).v128() }
+}
+
+/// Subtracts two 128-bit vectors as if they were two packed eight 16-bit
+/// unsigned integers, saturating on overflow to 0.
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.sub_sat_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.sub_sat_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u16x8_sub_sat(a: v128, b: v128) -> v128 {
+ unsafe { llvm_i16x8_sub_sat_u(a.as_i16x8(), b.as_i16x8()).v128() }
+}
+
+/// Multiplies two 128-bit vectors as if they were two packed eight 16-bit
+/// signed integers.
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.mul))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.mul"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i16x8_mul(a: v128, b: v128) -> v128 {
+ unsafe { simd_mul(a.as_i16x8(), b.as_i16x8()).v128() }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i16x8_mul as u16x8_mul;
+
+/// Compares lane-wise signed integers, and returns the minimum of
+/// each pair.
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.min_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.min_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i16x8_min(a: v128, b: v128) -> v128 {
+ let a = a.as_i16x8();
+ let b = b.as_i16x8();
+ unsafe { simd_select::<simd::i16x8, _>(simd_lt(a, b), a, b).v128() }
+}
+
+/// Compares lane-wise unsigned integers, and returns the minimum of
+/// each pair.
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.min_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.min_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u16x8_min(a: v128, b: v128) -> v128 {
+ let a = a.as_u16x8();
+ let b = b.as_u16x8();
+ unsafe { simd_select::<simd::i16x8, _>(simd_lt(a, b), a, b).v128() }
+}
+
+/// Compares lane-wise signed integers, and returns the maximum of
+/// each pair.
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.max_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.max_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i16x8_max(a: v128, b: v128) -> v128 {
+ let a = a.as_i16x8();
+ let b = b.as_i16x8();
+ unsafe { simd_select::<simd::i16x8, _>(simd_gt(a, b), a, b).v128() }
+}
+
+/// Compares lane-wise unsigned integers, and returns the maximum of
+/// each pair.
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.max_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.max_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u16x8_max(a: v128, b: v128) -> v128 {
+ let a = a.as_u16x8();
+ let b = b.as_u16x8();
+ unsafe { simd_select::<simd::i16x8, _>(simd_gt(a, b), a, b).v128() }
+}
+
+/// Lane-wise rounding average.
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.avgr_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.avgr_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u16x8_avgr(a: v128, b: v128) -> v128 {
+ unsafe { llvm_avgr_u_i16x8(a.as_i16x8(), b.as_i16x8()).v128() }
+}
+
+/// Lane-wise integer extended multiplication producing twice wider result than
+/// the inputs.
+///
+/// Equivalent of `i16x8_mul(i16x8_extend_low_i8x16(a), i16x8_extend_low_i8x16(b))`
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.extmul_low_i8x16_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.extmul_low_i8x16_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i16x8_extmul_low_i8x16(a: v128, b: v128) -> v128 {
+ unsafe {
+ let lhs = simd_cast::<simd::i8x8, simd::i16x8>(simd_shuffle8!(
+ a.as_i8x16(),
+ a.as_i8x16(),
+ [0, 1, 2, 3, 4, 5, 6, 7],
+ ));
+ let rhs = simd_cast::<simd::i8x8, simd::i16x8>(simd_shuffle8!(
+ b.as_i8x16(),
+ b.as_i8x16(),
+ [0, 1, 2, 3, 4, 5, 6, 7],
+ ));
+ simd_mul(lhs, rhs).v128()
+ }
+}
+
+/// Lane-wise integer extended multiplication producing twice wider result than
+/// the inputs.
+///
+/// Equivalent of `i16x8_mul(i16x8_extend_high_i8x16(a), i16x8_extend_high_i8x16(b))`
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.extmul_high_i8x16_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.extmul_high_i8x16_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i16x8_extmul_high_i8x16(a: v128, b: v128) -> v128 {
+ unsafe {
+ let lhs = simd_cast::<simd::i8x8, simd::i16x8>(simd_shuffle8!(
+ a.as_i8x16(),
+ a.as_i8x16(),
+ [8, 9, 10, 11, 12, 13, 14, 15],
+ ));
+ let rhs = simd_cast::<simd::i8x8, simd::i16x8>(simd_shuffle8!(
+ b.as_i8x16(),
+ b.as_i8x16(),
+ [8, 9, 10, 11, 12, 13, 14, 15],
+ ));
+ simd_mul(lhs, rhs).v128()
+ }
+}
+
+/// Lane-wise integer extended multiplication producing twice wider result than
+/// the inputs.
+///
+/// Equivalent of `i16x8_mul(i16x8_extend_low_u8x16(a), i16x8_extend_low_u8x16(b))`
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.extmul_low_i8x16_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.extmul_low_i8x16_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i16x8_extmul_low_u8x16(a: v128, b: v128) -> v128 {
+ unsafe {
+ let lhs = simd_cast::<simd::u8x8, simd::u16x8>(simd_shuffle8!(
+ a.as_u8x16(),
+ a.as_u8x16(),
+ [0, 1, 2, 3, 4, 5, 6, 7],
+ ));
+ let rhs = simd_cast::<simd::u8x8, simd::u16x8>(simd_shuffle8!(
+ b.as_u8x16(),
+ b.as_u8x16(),
+ [0, 1, 2, 3, 4, 5, 6, 7],
+ ));
+ simd_mul(lhs, rhs).v128()
+ }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i16x8_extmul_low_u8x16 as u16x8_extmul_low_u8x16;
+
+/// Lane-wise integer extended multiplication producing twice wider result than
+/// the inputs.
+///
+/// Equivalent of `i16x8_mul(i16x8_extend_high_u8x16(a), i16x8_extend_high_u8x16(b))`
+#[inline]
+#[cfg_attr(test, assert_instr(i16x8.extmul_high_i8x16_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i16x8.extmul_high_i8x16_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i16x8_extmul_high_u8x16(a: v128, b: v128) -> v128 {
+ unsafe {
+ let lhs = simd_cast::<simd::u8x8, simd::u16x8>(simd_shuffle8!(
+ a.as_u8x16(),
+ a.as_u8x16(),
+ [8, 9, 10, 11, 12, 13, 14, 15],
+ ));
+ let rhs = simd_cast::<simd::u8x8, simd::u16x8>(simd_shuffle8!(
+ b.as_u8x16(),
+ b.as_u8x16(),
+ [8, 9, 10, 11, 12, 13, 14, 15],
+ ));
+ simd_mul(lhs, rhs).v128()
+ }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i16x8_extmul_high_u8x16 as u16x8_extmul_high_u8x16;
+
+/// Integer extended pairwise addition producing extended results
+/// (twice wider results than the inputs).
+#[inline]
+#[cfg_attr(test, assert_instr(i32x4.extadd_pairwise_i16x8_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.extadd_pairwise_i16x8_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i32x4_extadd_pairwise_i16x8(a: v128) -> v128 {
+ unsafe { llvm_i32x4_extadd_pairwise_i16x8_s(a.as_i16x8()).v128() }
+}
+
+/// Integer extended pairwise addition producing extended results
+/// (twice wider results than the inputs).
+#[inline]
+#[cfg_attr(test, assert_instr(i32x4.extadd_pairwise_i16x8_u))]
+#[doc(alias("i32x4.extadd_pairwise_i16x8_u"))]
+#[target_feature(enable = "simd128")]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i32x4_extadd_pairwise_u16x8(a: v128) -> v128 {
+ unsafe { llvm_i32x4_extadd_pairwise_i16x8_u(a.as_i16x8()).v128() }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i32x4_extadd_pairwise_u16x8 as u32x4_extadd_pairwise_u16x8;
+
+/// Lane-wise wrapping absolute value.
+#[inline]
+#[cfg_attr(test, assert_instr(i32x4.abs))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.abs"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i32x4_abs(a: v128) -> v128 {
+ let a = a.as_i32x4();
+ let zero = simd::i32x4::splat(0);
+ unsafe {
+ simd_select::<simd::m32x4, simd::i32x4>(simd_lt(a, zero), simd_sub(zero, a), a).v128()
+ }
+}
+
+/// Negates a 128-bit vectors interpreted as four 32-bit signed integers
+#[inline]
+#[cfg_attr(test, assert_instr(i32x4.neg))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.neg"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i32x4_neg(a: v128) -> v128 {
+ unsafe { simd_mul(a.as_i32x4(), simd::i32x4::splat(-1)).v128() }
+}
+
+/// Returns true if all lanes are non-zero, false otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(i32x4.all_true))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.all_true"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i32x4_all_true(a: v128) -> bool {
+ unsafe { llvm_i32x4_all_true(a.as_i32x4()) != 0 }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i32x4_all_true as u32x4_all_true;
+
+/// Extracts the high bit for each lane in `a` and produce a scalar mask with
+/// all bits concatenated.
+#[inline]
+#[cfg_attr(test, assert_instr(i32x4.bitmask))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.bitmask"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i32x4_bitmask(a: v128) -> u8 {
+ unsafe { llvm_bitmask_i32x4(a.as_i32x4()) as u8 }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i32x4_bitmask as u32x4_bitmask;
+
+/// Converts low half of the smaller lane vector to a larger lane
+/// vector, sign extended.
+#[inline]
+#[cfg_attr(test, assert_instr(i32x4.extend_low_i16x8_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.extend_low_i16x8_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i32x4_extend_low_i16x8(a: v128) -> v128 {
+ unsafe {
+ simd_cast::<simd::i16x4, simd::i32x4>(simd_shuffle4!(
+ a.as_i16x8(),
+ a.as_i16x8(),
+ [0, 1, 2, 3]
+ ))
+ .v128()
+ }
+}
+
+/// Converts high half of the smaller lane vector to a larger lane
+/// vector, sign extended.
+#[inline]
+#[cfg_attr(test, assert_instr(i32x4.extend_high_i16x8_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.extend_high_i16x8_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i32x4_extend_high_i16x8(a: v128) -> v128 {
+ unsafe {
+ simd_cast::<simd::i16x4, simd::i32x4>(simd_shuffle4!(
+ a.as_i16x8(),
+ a.as_i16x8(),
+ [4, 5, 6, 7]
+ ))
+ .v128()
+ }
+}
+
+/// Converts low half of the smaller lane vector to a larger lane
+/// vector, zero extended.
+#[inline]
+#[cfg_attr(test, assert_instr(i32x4.extend_low_i16x8_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.extend_low_i16x8_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i32x4_extend_low_u16x8(a: v128) -> v128 {
+ unsafe {
+ simd_cast::<simd::u16x4, simd::u32x4>(simd_shuffle4!(
+ a.as_u16x8(),
+ a.as_u16x8(),
+ [0, 1, 2, 3]
+ ))
+ .v128()
+ }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i32x4_extend_low_u16x8 as u32x4_extend_low_u16x8;
+
+/// Converts high half of the smaller lane vector to a larger lane
+/// vector, zero extended.
+#[inline]
+#[cfg_attr(test, assert_instr(i32x4.extend_high_i16x8_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.extend_high_i16x8_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i32x4_extend_high_u16x8(a: v128) -> v128 {
+ unsafe {
+ simd_cast::<simd::u16x4, simd::u32x4>(simd_shuffle4!(
+ a.as_u16x8(),
+ a.as_u16x8(),
+ [4, 5, 6, 7]
+ ))
+ .v128()
+ }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i32x4_extend_high_u16x8 as u32x4_extend_high_u16x8;
+
+/// Shifts each lane to the left by the specified number of bits.
+///
+/// Only the low bits of the shift amount are used if the shift amount is
+/// greater than the lane width.
+#[inline]
+#[cfg_attr(test, assert_instr(i32x4.shl))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.shl"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i32x4_shl(a: v128, amt: u32) -> v128 {
+ unsafe { simd_shl(a.as_i32x4(), simd::i32x4::splat(amt as i32)).v128() }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i32x4_shl as u32x4_shl;
+
+/// Shifts each lane to the right by the specified number of bits, sign
+/// extending.
+///
+/// Only the low bits of the shift amount are used if the shift amount is
+/// greater than the lane width.
+#[inline]
+#[cfg_attr(test, assert_instr(i32x4.shr_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.shr_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i32x4_shr(a: v128, amt: u32) -> v128 {
+ unsafe { simd_shr(a.as_i32x4(), simd::i32x4::splat(amt as i32)).v128() }
+}
+
+/// Shifts each lane to the right by the specified number of bits, shifting in
+/// zeros.
+///
+/// Only the low bits of the shift amount are used if the shift amount is
+/// greater than the lane width.
+#[inline]
+#[cfg_attr(test, assert_instr(i32x4.shr_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.shr_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u32x4_shr(a: v128, amt: u32) -> v128 {
+ unsafe { simd_shr(a.as_u32x4(), simd::u32x4::splat(amt as u32)).v128() }
+}
+
+/// Adds two 128-bit vectors as if they were two packed four 32-bit integers.
+#[inline]
+#[cfg_attr(test, assert_instr(i32x4.add))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.add"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i32x4_add(a: v128, b: v128) -> v128 {
+ unsafe { simd_add(a.as_i32x4(), b.as_i32x4()).v128() }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i32x4_add as u32x4_add;
+
+/// Subtracts two 128-bit vectors as if they were two packed four 32-bit integers.
+#[inline]
+#[cfg_attr(test, assert_instr(i32x4.sub))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.sub"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i32x4_sub(a: v128, b: v128) -> v128 {
+ unsafe { simd_sub(a.as_i32x4(), b.as_i32x4()).v128() }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i32x4_sub as u32x4_sub;
+
+/// Multiplies two 128-bit vectors as if they were two packed four 32-bit
+/// signed integers.
+#[inline]
+#[cfg_attr(test, assert_instr(i32x4.mul))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.mul"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i32x4_mul(a: v128, b: v128) -> v128 {
+ unsafe { simd_mul(a.as_i32x4(), b.as_i32x4()).v128() }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i32x4_mul as u32x4_mul;
+
+/// Compares lane-wise signed integers, and returns the minimum of
+/// each pair.
+#[inline]
+#[cfg_attr(test, assert_instr(i32x4.min_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.min_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i32x4_min(a: v128, b: v128) -> v128 {
+ let a = a.as_i32x4();
+ let b = b.as_i32x4();
+ unsafe { simd_select::<simd::i32x4, _>(simd_lt(a, b), a, b).v128() }
+}
+
+/// Compares lane-wise unsigned integers, and returns the minimum of
+/// each pair.
+#[inline]
+#[cfg_attr(test, assert_instr(i32x4.min_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.min_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u32x4_min(a: v128, b: v128) -> v128 {
+ let a = a.as_u32x4();
+ let b = b.as_u32x4();
+ unsafe { simd_select::<simd::i32x4, _>(simd_lt(a, b), a, b).v128() }
+}
+
+/// Compares lane-wise signed integers, and returns the maximum of
+/// each pair.
+#[inline]
+#[cfg_attr(test, assert_instr(i32x4.max_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.max_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i32x4_max(a: v128, b: v128) -> v128 {
+ let a = a.as_i32x4();
+ let b = b.as_i32x4();
+ unsafe { simd_select::<simd::i32x4, _>(simd_gt(a, b), a, b).v128() }
+}
+
+/// Compares lane-wise unsigned integers, and returns the maximum of
+/// each pair.
+#[inline]
+#[cfg_attr(test, assert_instr(i32x4.max_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.max_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u32x4_max(a: v128, b: v128) -> v128 {
+ let a = a.as_u32x4();
+ let b = b.as_u32x4();
+ unsafe { simd_select::<simd::i32x4, _>(simd_gt(a, b), a, b).v128() }
+}
+
+/// Lane-wise multiply signed 16-bit integers in the two input vectors and add
+/// adjacent pairs of the full 32-bit results.
+#[inline]
+#[cfg_attr(test, assert_instr(i32x4.dot_i16x8_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.dot_i16x8_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i32x4_dot_i16x8(a: v128, b: v128) -> v128 {
+ unsafe { llvm_i32x4_dot_i16x8_s(a.as_i16x8(), b.as_i16x8()).v128() }
+}
+
+/// Lane-wise integer extended multiplication producing twice wider result than
+/// the inputs.
+///
+/// Equivalent of `i32x4_mul(i32x4_extend_low_i16x8_s(a), i32x4_extend_low_i16x8_s(b))`
+#[inline]
+#[cfg_attr(test, assert_instr(i32x4.extmul_low_i16x8_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.extmul_low_i16x8_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i32x4_extmul_low_i16x8(a: v128, b: v128) -> v128 {
+ unsafe {
+ let lhs = simd_cast::<simd::i16x4, simd::i32x4>(simd_shuffle4!(
+ a.as_i16x8(),
+ a.as_i16x8(),
+ [0, 1, 2, 3]
+ ));
+ let rhs = simd_cast::<simd::i16x4, simd::i32x4>(simd_shuffle4!(
+ b.as_i16x8(),
+ b.as_i16x8(),
+ [0, 1, 2, 3]
+ ));
+ simd_mul(lhs, rhs).v128()
+ }
+}
+
+/// Lane-wise integer extended multiplication producing twice wider result than
+/// the inputs.
+///
+/// Equivalent of `i32x4_mul(i32x4_extend_high_i16x8_s(a), i32x4_extend_high_i16x8_s(b))`
+#[inline]
+#[cfg_attr(test, assert_instr(i32x4.extmul_high_i16x8_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.extmul_high_i16x8_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i32x4_extmul_high_i16x8(a: v128, b: v128) -> v128 {
+ unsafe {
+ let lhs = simd_cast::<simd::i16x4, simd::i32x4>(simd_shuffle4!(
+ a.as_i16x8(),
+ a.as_i16x8(),
+ [4, 5, 6, 7]
+ ));
+ let rhs = simd_cast::<simd::i16x4, simd::i32x4>(simd_shuffle4!(
+ b.as_i16x8(),
+ b.as_i16x8(),
+ [4, 5, 6, 7]
+ ));
+ simd_mul(lhs, rhs).v128()
+ }
+}
+
+/// Lane-wise integer extended multiplication producing twice wider result than
+/// the inputs.
+///
+/// Equivalent of `i32x4_mul(i32x4_extend_low_u16x8(a), i32x4_extend_low_u16x8(b))`
+#[inline]
+#[cfg_attr(test, assert_instr(i32x4.extmul_low_i16x8_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.extmul_low_i16x8_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i32x4_extmul_low_u16x8(a: v128, b: v128) -> v128 {
+ unsafe {
+ let lhs = simd_cast::<simd::u16x4, simd::u32x4>(simd_shuffle4!(
+ a.as_u16x8(),
+ a.as_u16x8(),
+ [0, 1, 2, 3]
+ ));
+ let rhs = simd_cast::<simd::u16x4, simd::u32x4>(simd_shuffle4!(
+ b.as_u16x8(),
+ b.as_u16x8(),
+ [0, 1, 2, 3]
+ ));
+ simd_mul(lhs, rhs).v128()
+ }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i32x4_extmul_low_u16x8 as u32x4_extmul_low_u16x8;
+
+/// Lane-wise integer extended multiplication producing twice wider result than
+/// the inputs.
+///
+/// Equivalent of `i32x4_mul(i32x4_extend_high_u16x8(a), i32x4_extend_high_u16x8(b))`
+#[inline]
+#[cfg_attr(test, assert_instr(i32x4.extmul_high_i16x8_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.extmul_high_i16x8_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i32x4_extmul_high_u16x8(a: v128, b: v128) -> v128 {
+ unsafe {
+ let lhs = simd_cast::<simd::u16x4, simd::u32x4>(simd_shuffle4!(
+ a.as_u16x8(),
+ a.as_u16x8(),
+ [4, 5, 6, 7]
+ ));
+ let rhs = simd_cast::<simd::u16x4, simd::u32x4>(simd_shuffle4!(
+ b.as_u16x8(),
+ b.as_u16x8(),
+ [4, 5, 6, 7]
+ ));
+ simd_mul(lhs, rhs).v128()
+ }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i32x4_extmul_high_u16x8 as u32x4_extmul_high_u16x8;
+
+/// Lane-wise wrapping absolute value.
+#[inline]
+// #[cfg_attr(test, assert_instr(i64x2.abs))] // FIXME llvm
+#[target_feature(enable = "simd128")]
+#[doc(alias("i64x2.abs"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i64x2_abs(a: v128) -> v128 {
+ let a = a.as_i64x2();
+ let zero = simd::i64x2::splat(0);
+ unsafe {
+ simd_select::<simd::m64x2, simd::i64x2>(simd_lt(a, zero), simd_sub(zero, a), a).v128()
+ }
+}
+
+/// Negates a 128-bit vectors interpreted as two 64-bit signed integers
+#[inline]
+#[cfg_attr(test, assert_instr(i64x2.neg))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i64x2.neg"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i64x2_neg(a: v128) -> v128 {
+ unsafe { simd_mul(a.as_i64x2(), simd::i64x2::splat(-1)).v128() }
+}
+
+/// Returns true if all lanes are non-zero, false otherwise.
+#[inline]
+#[cfg_attr(test, assert_instr(i64x2.all_true))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i64x2.all_true"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i64x2_all_true(a: v128) -> bool {
+ unsafe { llvm_i64x2_all_true(a.as_i64x2()) != 0 }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i64x2_all_true as u64x2_all_true;
+
+/// Extracts the high bit for each lane in `a` and produce a scalar mask with
+/// all bits concatenated.
+#[inline]
+#[cfg_attr(test, assert_instr(i64x2.bitmask))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i64x2.bitmask"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i64x2_bitmask(a: v128) -> u8 {
+ unsafe { llvm_bitmask_i64x2(a.as_i64x2()) as u8 }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i64x2_bitmask as u64x2_bitmask;
+
+/// Converts low half of the smaller lane vector to a larger lane
+/// vector, sign extended.
+#[inline]
+#[cfg_attr(test, assert_instr(i64x2.extend_low_i32x4_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i64x2.extend_low_i32x4_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i64x2_extend_low_i32x4(a: v128) -> v128 {
+ unsafe {
+ simd_cast::<simd::i32x2, simd::i64x2>(simd_shuffle2!(a.as_i32x4(), a.as_i32x4(), [0, 1]))
+ .v128()
+ }
+}
+
+/// Converts high half of the smaller lane vector to a larger lane
+/// vector, sign extended.
+#[inline]
+#[cfg_attr(test, assert_instr(i64x2.extend_high_i32x4_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i64x2.extend_high_i32x4_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i64x2_extend_high_i32x4(a: v128) -> v128 {
+ unsafe {
+ simd_cast::<simd::i32x2, simd::i64x2>(simd_shuffle2!(a.as_i32x4(), a.as_i32x4(), [2, 3]))
+ .v128()
+ }
+}
+
+/// Converts low half of the smaller lane vector to a larger lane
+/// vector, zero extended.
+#[inline]
+#[cfg_attr(test, assert_instr(i64x2.extend_low_i32x4_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i64x2.extend_low_i32x4_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i64x2_extend_low_u32x4(a: v128) -> v128 {
+ unsafe {
+ simd_cast::<simd::u32x2, simd::i64x2>(simd_shuffle2!(a.as_u32x4(), a.as_u32x4(), [0, 1]))
+ .v128()
+ }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i64x2_extend_low_u32x4 as u64x2_extend_low_u32x4;
+
+/// Converts high half of the smaller lane vector to a larger lane
+/// vector, zero extended.
+#[inline]
+#[cfg_attr(test, assert_instr(i64x2.extend_high_i32x4_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i64x2.extend_high_i32x4_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i64x2_extend_high_u32x4(a: v128) -> v128 {
+ unsafe {
+ simd_cast::<simd::u32x2, simd::i64x2>(simd_shuffle2!(a.as_u32x4(), a.as_u32x4(), [2, 3]))
+ .v128()
+ }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i64x2_extend_high_u32x4 as u64x2_extend_high_u32x4;
+
+/// Shifts each lane to the left by the specified number of bits.
+///
+/// Only the low bits of the shift amount are used if the shift amount is
+/// greater than the lane width.
+#[inline]
+#[cfg_attr(test, assert_instr(i64x2.shl))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i64x2.shl"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i64x2_shl(a: v128, amt: u32) -> v128 {
+ unsafe { simd_shl(a.as_i64x2(), simd::i64x2::splat(amt as i64)).v128() }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i64x2_shl as u64x2_shl;
+
+/// Shifts each lane to the right by the specified number of bits, sign
+/// extending.
+///
+/// Only the low bits of the shift amount are used if the shift amount is
+/// greater than the lane width.
+#[inline]
+#[cfg_attr(test, assert_instr(i64x2.shr_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i64x2.shr_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i64x2_shr(a: v128, amt: u32) -> v128 {
+ unsafe { simd_shr(a.as_i64x2(), simd::i64x2::splat(amt as i64)).v128() }
+}
+
+/// Shifts each lane to the right by the specified number of bits, shifting in
+/// zeros.
+///
+/// Only the low bits of the shift amount are used if the shift amount is
+/// greater than the lane width.
+#[inline]
+#[cfg_attr(test, assert_instr(i64x2.shr_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i64x2.shr_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u64x2_shr(a: v128, amt: u32) -> v128 {
+ unsafe { simd_shr(a.as_u64x2(), simd::u64x2::splat(amt as u64)).v128() }
+}
+
+/// Adds two 128-bit vectors as if they were two packed two 64-bit integers.
+#[inline]
+#[cfg_attr(test, assert_instr(i64x2.add))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i64x2.add"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i64x2_add(a: v128, b: v128) -> v128 {
+ unsafe { simd_add(a.as_i64x2(), b.as_i64x2()).v128() }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i64x2_add as u64x2_add;
+
+/// Subtracts two 128-bit vectors as if they were two packed two 64-bit integers.
+#[inline]
+#[cfg_attr(test, assert_instr(i64x2.sub))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i64x2.sub"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i64x2_sub(a: v128, b: v128) -> v128 {
+ unsafe { simd_sub(a.as_i64x2(), b.as_i64x2()).v128() }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i64x2_sub as u64x2_sub;
+
+/// Multiplies two 128-bit vectors as if they were two packed two 64-bit integers.
+#[inline]
+#[cfg_attr(test, assert_instr(i64x2.mul))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i64x2.mul"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i64x2_mul(a: v128, b: v128) -> v128 {
+ unsafe { simd_mul(a.as_i64x2(), b.as_i64x2()).v128() }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i64x2_mul as u64x2_mul;
+
+/// Lane-wise integer extended multiplication producing twice wider result than
+/// the inputs.
+///
+/// Equivalent of `i64x2_mul(i64x2_extend_low_i32x4_s(a), i64x2_extend_low_i32x4_s(b))`
+#[inline]
+#[cfg_attr(test, assert_instr(i64x2.extmul_low_i32x4_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i64x2.extmul_low_i32x4_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i64x2_extmul_low_i32x4(a: v128, b: v128) -> v128 {
+ unsafe {
+ let lhs = simd_cast::<simd::i32x2, simd::i64x2>(simd_shuffle2!(
+ a.as_i32x4(),
+ a.as_i32x4(),
+ [0, 1]
+ ));
+ let rhs = simd_cast::<simd::i32x2, simd::i64x2>(simd_shuffle2!(
+ b.as_i32x4(),
+ b.as_i32x4(),
+ [0, 1]
+ ));
+ simd_mul(lhs, rhs).v128()
+ }
+}
+
+/// Lane-wise integer extended multiplication producing twice wider result than
+/// the inputs.
+///
+/// Equivalent of `i64x2_mul(i64x2_extend_high_i32x4_s(a), i64x2_extend_high_i32x4_s(b))`
+#[inline]
+#[cfg_attr(test, assert_instr(i64x2.extmul_high_i32x4_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i64x2.extmul_high_i32x4_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i64x2_extmul_high_i32x4(a: v128, b: v128) -> v128 {
+ unsafe {
+ let lhs = simd_cast::<simd::i32x2, simd::i64x2>(simd_shuffle2!(
+ a.as_i32x4(),
+ a.as_i32x4(),
+ [2, 3]
+ ));
+ let rhs = simd_cast::<simd::i32x2, simd::i64x2>(simd_shuffle2!(
+ b.as_i32x4(),
+ b.as_i32x4(),
+ [2, 3]
+ ));
+ simd_mul(lhs, rhs).v128()
+ }
+}
+
+/// Lane-wise integer extended multiplication producing twice wider result than
+/// the inputs.
+///
+/// Equivalent of `i64x2_mul(i64x2_extend_low_i32x4_u(a), i64x2_extend_low_i32x4_u(b))`
+#[inline]
+#[cfg_attr(test, assert_instr(i64x2.extmul_low_i32x4_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i64x2.extmul_low_i32x4_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i64x2_extmul_low_u32x4(a: v128, b: v128) -> v128 {
+ unsafe {
+ let lhs = simd_cast::<simd::u32x2, simd::u64x2>(simd_shuffle2!(
+ a.as_u32x4(),
+ a.as_u32x4(),
+ [0, 1]
+ ));
+ let rhs = simd_cast::<simd::u32x2, simd::u64x2>(simd_shuffle2!(
+ b.as_u32x4(),
+ b.as_u32x4(),
+ [0, 1]
+ ));
+ simd_mul(lhs, rhs).v128()
+ }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i64x2_extmul_low_u32x4 as u64x2_extmul_low_u32x4;
+
+/// Lane-wise integer extended multiplication producing twice wider result than
+/// the inputs.
+///
+/// Equivalent of `i64x2_mul(i64x2_extend_high_i32x4_u(a), i64x2_extend_high_i32x4_u(b))`
+#[inline]
+#[cfg_attr(test, assert_instr(i64x2.extmul_high_i32x4_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i64x2.extmul_high_i32x4_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i64x2_extmul_high_u32x4(a: v128, b: v128) -> v128 {
+ unsafe {
+ let lhs = simd_cast::<simd::u32x2, simd::u64x2>(simd_shuffle2!(
+ a.as_u32x4(),
+ a.as_u32x4(),
+ [2, 3]
+ ));
+ let rhs = simd_cast::<simd::u32x2, simd::u64x2>(simd_shuffle2!(
+ b.as_u32x4(),
+ b.as_u32x4(),
+ [2, 3]
+ ));
+ simd_mul(lhs, rhs).v128()
+ }
+}
+
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub use i64x2_extmul_high_u32x4 as u64x2_extmul_high_u32x4;
+
+/// Lane-wise rounding to the nearest integral value not smaller than the input.
+#[inline]
+#[cfg_attr(test, assert_instr(f32x4.ceil))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f32x4.ceil"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f32x4_ceil(a: v128) -> v128 {
+ unsafe { llvm_f32x4_ceil(a.as_f32x4()).v128() }
+}
+
+/// Lane-wise rounding to the nearest integral value not greater than the input.
+#[inline]
+#[cfg_attr(test, assert_instr(f32x4.floor))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f32x4.floor"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f32x4_floor(a: v128) -> v128 {
+ unsafe { llvm_f32x4_floor(a.as_f32x4()).v128() }
+}
+
+/// Lane-wise rounding to the nearest integral value with the magnitude not
+/// larger than the input.
+#[inline]
+#[cfg_attr(test, assert_instr(f32x4.trunc))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f32x4.trunc"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f32x4_trunc(a: v128) -> v128 {
+ unsafe { llvm_f32x4_trunc(a.as_f32x4()).v128() }
+}
+
+/// Lane-wise rounding to the nearest integral value; if two values are equally
+/// near, rounds to the even one.
+#[inline]
+#[cfg_attr(test, assert_instr(f32x4.nearest))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f32x4.nearest"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f32x4_nearest(a: v128) -> v128 {
+ unsafe { llvm_f32x4_nearest(a.as_f32x4()).v128() }
+}
+
+/// Calculates the absolute value of each lane of a 128-bit vector interpreted
+/// as four 32-bit floating point numbers.
+#[inline]
+#[cfg_attr(test, assert_instr(f32x4.abs))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f32x4.abs"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f32x4_abs(a: v128) -> v128 {
+ unsafe { llvm_f32x4_abs(a.as_f32x4()).v128() }
+}
+
+/// Negates each lane of a 128-bit vector interpreted as four 32-bit floating
+/// point numbers.
+#[inline]
+#[cfg_attr(test, assert_instr(f32x4.neg))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f32x4.neg"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f32x4_neg(a: v128) -> v128 {
+ f32x4_mul(a, f32x4_splat(-1.))
+}
+
+/// Calculates the square root of each lane of a 128-bit vector interpreted as
+/// four 32-bit floating point numbers.
+#[inline]
+#[cfg_attr(test, assert_instr(f32x4.sqrt))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f32x4.sqrt"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f32x4_sqrt(a: v128) -> v128 {
+ unsafe { llvm_f32x4_sqrt(a.as_f32x4()).v128() }
+}
+
+/// Lane-wise addition of two 128-bit vectors interpreted as four 32-bit
+/// floating point numbers.
+#[inline]
+#[cfg_attr(test, assert_instr(f32x4.add))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f32x4.add"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f32x4_add(a: v128, b: v128) -> v128 {
+ unsafe { simd_add(a.as_f32x4(), b.as_f32x4()).v128() }
+}
+
+/// Lane-wise subtraction of two 128-bit vectors interpreted as four 32-bit
+/// floating point numbers.
+#[inline]
+#[cfg_attr(test, assert_instr(f32x4.sub))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f32x4.sub"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f32x4_sub(a: v128, b: v128) -> v128 {
+ unsafe { simd_sub(a.as_f32x4(), b.as_f32x4()).v128() }
+}
+
+/// Lane-wise multiplication of two 128-bit vectors interpreted as four 32-bit
+/// floating point numbers.
+#[inline]
+#[cfg_attr(test, assert_instr(f32x4.mul))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f32x4.mul"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f32x4_mul(a: v128, b: v128) -> v128 {
+ unsafe { simd_mul(a.as_f32x4(), b.as_f32x4()).v128() }
+}
+
+/// Lane-wise division of two 128-bit vectors interpreted as four 32-bit
+/// floating point numbers.
+#[inline]
+#[cfg_attr(test, assert_instr(f32x4.div))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f32x4.div"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f32x4_div(a: v128, b: v128) -> v128 {
+ unsafe { simd_div(a.as_f32x4(), b.as_f32x4()).v128() }
+}
+
+/// Calculates the lane-wise minimum of two 128-bit vectors interpreted
+/// as four 32-bit floating point numbers.
+#[inline]
+#[cfg_attr(test, assert_instr(f32x4.min))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f32x4.min"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f32x4_min(a: v128, b: v128) -> v128 {
+ unsafe { llvm_f32x4_min(a.as_f32x4(), b.as_f32x4()).v128() }
+}
+
+/// Calculates the lane-wise minimum of two 128-bit vectors interpreted
+/// as four 32-bit floating point numbers.
+#[inline]
+#[cfg_attr(test, assert_instr(f32x4.max))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f32x4.max"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f32x4_max(a: v128, b: v128) -> v128 {
+ unsafe { llvm_f32x4_max(a.as_f32x4(), b.as_f32x4()).v128() }
+}
+
+/// Lane-wise minimum value, defined as `b < a ? b : a`
+#[inline]
+#[cfg_attr(test, assert_instr(f32x4.pmin))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f32x4.pmin"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f32x4_pmin(a: v128, b: v128) -> v128 {
+ unsafe {
+ simd_select::<simd::m32x4, simd::f32x4>(
+ simd_lt(b.as_f32x4(), a.as_f32x4()),
+ b.as_f32x4(),
+ a.as_f32x4(),
+ )
+ .v128()
+ }
+}
+
+/// Lane-wise maximum value, defined as `a < b ? b : a`
+#[inline]
+#[cfg_attr(test, assert_instr(f32x4.pmax))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f32x4.pmax"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f32x4_pmax(a: v128, b: v128) -> v128 {
+ unsafe {
+ simd_select::<simd::m32x4, simd::f32x4>(
+ simd_lt(a.as_f32x4(), b.as_f32x4()),
+ b.as_f32x4(),
+ a.as_f32x4(),
+ )
+ .v128()
+ }
+}
+
+/// Lane-wise rounding to the nearest integral value not smaller than the input.
+#[inline]
+#[cfg_attr(test, assert_instr(f64x2.ceil))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f64x2.ceil"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f64x2_ceil(a: v128) -> v128 {
+ unsafe { llvm_f64x2_ceil(a.as_f64x2()).v128() }
+}
+
+/// Lane-wise rounding to the nearest integral value not greater than the input.
+#[inline]
+#[cfg_attr(test, assert_instr(f64x2.floor))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f64x2.floor"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f64x2_floor(a: v128) -> v128 {
+ unsafe { llvm_f64x2_floor(a.as_f64x2()).v128() }
+}
+
+/// Lane-wise rounding to the nearest integral value with the magnitude not
+/// larger than the input.
+#[inline]
+#[cfg_attr(test, assert_instr(f64x2.trunc))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f64x2.trunc"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f64x2_trunc(a: v128) -> v128 {
+ unsafe { llvm_f64x2_trunc(a.as_f64x2()).v128() }
+}
+
+/// Lane-wise rounding to the nearest integral value; if two values are equally
+/// near, rounds to the even one.
+#[inline]
+#[cfg_attr(test, assert_instr(f64x2.nearest))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f64x2.nearest"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f64x2_nearest(a: v128) -> v128 {
+ unsafe { llvm_f64x2_nearest(a.as_f64x2()).v128() }
+}
+
+/// Calculates the absolute value of each lane of a 128-bit vector interpreted
+/// as two 64-bit floating point numbers.
+#[inline]
+#[cfg_attr(test, assert_instr(f64x2.abs))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f64x2.abs"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f64x2_abs(a: v128) -> v128 {
+ unsafe { llvm_f64x2_abs(a.as_f64x2()).v128() }
+}
+
+/// Negates each lane of a 128-bit vector interpreted as two 64-bit floating
+/// point numbers.
+#[inline]
+#[cfg_attr(test, assert_instr(f64x2.neg))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f64x2.neg"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f64x2_neg(a: v128) -> v128 {
+ f64x2_mul(a, f64x2_splat(-1.0))
+}
+
+/// Calculates the square root of each lane of a 128-bit vector interpreted as
+/// two 64-bit floating point numbers.
+#[inline]
+#[cfg_attr(test, assert_instr(f64x2.sqrt))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f64x2.sqrt"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f64x2_sqrt(a: v128) -> v128 {
+ unsafe { llvm_f64x2_sqrt(a.as_f64x2()).v128() }
+}
+
+/// Lane-wise add of two 128-bit vectors interpreted as two 64-bit
+/// floating point numbers.
+#[inline]
+#[cfg_attr(test, assert_instr(f64x2.add))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f64x2.add"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f64x2_add(a: v128, b: v128) -> v128 {
+ unsafe { simd_add(a.as_f64x2(), b.as_f64x2()).v128() }
+}
+
+/// Lane-wise subtract of two 128-bit vectors interpreted as two 64-bit
+/// floating point numbers.
+#[inline]
+#[cfg_attr(test, assert_instr(f64x2.sub))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f64x2.sub"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f64x2_sub(a: v128, b: v128) -> v128 {
+ unsafe { simd_sub(a.as_f64x2(), b.as_f64x2()).v128() }
+}
+
+/// Lane-wise multiply of two 128-bit vectors interpreted as two 64-bit
+/// floating point numbers.
+#[inline]
+#[cfg_attr(test, assert_instr(f64x2.mul))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f64x2.mul"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f64x2_mul(a: v128, b: v128) -> v128 {
+ unsafe { simd_mul(a.as_f64x2(), b.as_f64x2()).v128() }
+}
+
+/// Lane-wise divide of two 128-bit vectors interpreted as two 64-bit
+/// floating point numbers.
+#[inline]
+#[cfg_attr(test, assert_instr(f64x2.div))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f64x2.div"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f64x2_div(a: v128, b: v128) -> v128 {
+ unsafe { simd_div(a.as_f64x2(), b.as_f64x2()).v128() }
+}
+
+/// Calculates the lane-wise minimum of two 128-bit vectors interpreted
+/// as two 64-bit floating point numbers.
+#[inline]
+#[cfg_attr(test, assert_instr(f64x2.min))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f64x2.min"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f64x2_min(a: v128, b: v128) -> v128 {
+ unsafe { llvm_f64x2_min(a.as_f64x2(), b.as_f64x2()).v128() }
+}
+
+/// Calculates the lane-wise maximum of two 128-bit vectors interpreted
+/// as two 64-bit floating point numbers.
+#[inline]
+#[cfg_attr(test, assert_instr(f64x2.max))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f64x2.max"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f64x2_max(a: v128, b: v128) -> v128 {
+ unsafe { llvm_f64x2_max(a.as_f64x2(), b.as_f64x2()).v128() }
+}
+
+/// Lane-wise minimum value, defined as `b < a ? b : a`
+#[inline]
+#[cfg_attr(test, assert_instr(f64x2.pmin))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f64x2.pmin"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f64x2_pmin(a: v128, b: v128) -> v128 {
+ unsafe {
+ simd_select::<simd::m64x2, simd::f64x2>(
+ simd_lt(b.as_f64x2(), a.as_f64x2()),
+ b.as_f64x2(),
+ a.as_f64x2(),
+ )
+ .v128()
+ }
+}
+
+/// Lane-wise maximum value, defined as `a < b ? b : a`
+#[inline]
+#[cfg_attr(test, assert_instr(f64x2.pmax))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f64x2.pmax"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f64x2_pmax(a: v128, b: v128) -> v128 {
+ unsafe {
+ simd_select::<simd::m64x2, simd::f64x2>(
+ simd_lt(a.as_f64x2(), b.as_f64x2()),
+ b.as_f64x2(),
+ a.as_f64x2(),
+ )
+ .v128()
+ }
+}
+
+/// Converts a 128-bit vector interpreted as four 32-bit floating point numbers
+/// into a 128-bit vector of four 32-bit signed integers.
+///
+/// NaN is converted to 0 and if it's out of bounds it becomes the nearest
+/// representable intger.
+#[inline]
+#[cfg_attr(test, assert_instr(i32x4.trunc_sat_f32x4_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.trunc_sat_f32x4_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i32x4_trunc_sat_f32x4(a: v128) -> v128 {
+ unsafe { llvm_i32x4_trunc_sat_f32x4_s(a.as_f32x4()).v128() }
+}
+
+/// Converts a 128-bit vector interpreted as four 32-bit floating point numbers
+/// into a 128-bit vector of four 32-bit unsigned integers.
+///
+/// NaN is converted to 0 and if it's out of bounds it becomes the nearest
+/// representable intger.
+#[inline]
+#[cfg_attr(test, assert_instr(i32x4.trunc_sat_f32x4_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.trunc_sat_f32x4_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u32x4_trunc_sat_f32x4(a: v128) -> v128 {
+ unsafe { llvm_i32x4_trunc_sat_f32x4_u(a.as_f32x4()).v128() }
+}
+
+/// Converts a 128-bit vector interpreted as four 32-bit signed integers into a
+/// 128-bit vector of four 32-bit floating point numbers.
+#[inline]
+#[cfg_attr(test, assert_instr(f32x4.convert_i32x4_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f32x4.convert_i32x4_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f32x4_convert_i32x4(a: v128) -> v128 {
+ unsafe { simd_cast::<_, simd::f32x4>(a.as_i32x4()).v128() }
+}
+
+/// Converts a 128-bit vector interpreted as four 32-bit unsigned integers into a
+/// 128-bit vector of four 32-bit floating point numbers.
+#[inline]
+#[cfg_attr(test, assert_instr(f32x4.convert_i32x4_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f32x4.convert_i32x4_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f32x4_convert_u32x4(a: v128) -> v128 {
+ unsafe { simd_cast::<_, simd::f32x4>(a.as_u32x4()).v128() }
+}
+
+/// Saturating conversion of the two double-precision floating point lanes to
+/// two lower integer lanes using the IEEE `convertToIntegerTowardZero`
+/// function.
+///
+/// The two higher lanes of the result are initialized to zero. If any input
+/// lane is a NaN, the resulting lane is 0. If the rounded integer value of a
+/// lane is outside the range of the destination type, the result is saturated
+/// to the nearest representable integer value.
+#[inline]
+#[cfg_attr(test, assert_instr(i32x4.trunc_sat_f64x2_s_zero))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.trunc_sat_f64x2_s_zero"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn i32x4_trunc_sat_f64x2_zero(a: v128) -> v128 {
+ let ret: simd::i32x4 = unsafe {
+ simd_shuffle4!(
+ llvm_i32x2_trunc_sat_f64x2_s(a.as_f64x2()),
+ simd::i32x2::splat(0),
+ [0, 1, 2, 3],
+ )
+ };
+ ret.v128()
+}
+
+/// Saturating conversion of the two double-precision floating point lanes to
+/// two lower integer lanes using the IEEE `convertToIntegerTowardZero`
+/// function.
+///
+/// The two higher lanes of the result are initialized to zero. If any input
+/// lane is a NaN, the resulting lane is 0. If the rounded integer value of a
+/// lane is outside the range of the destination type, the result is saturated
+/// to the nearest representable integer value.
+#[inline]
+#[cfg_attr(test, assert_instr(i32x4.trunc_sat_f64x2_u_zero))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("i32x4.trunc_sat_f64x2_u_zero"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn u32x4_trunc_sat_f64x2_zero(a: v128) -> v128 {
+ let ret: simd::i32x4 = unsafe {
+ simd_shuffle4!(
+ llvm_i32x2_trunc_sat_f64x2_u(a.as_f64x2()),
+ simd::i32x2::splat(0),
+ [0, 1, 2, 3],
+ )
+ };
+ ret.v128()
+}
+
+/// Lane-wise conversion from integer to floating point.
+#[inline]
+#[cfg_attr(test, assert_instr(f64x2.convert_low_i32x4_s))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f64x2.convert_low_i32x4_s"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f64x2_convert_low_i32x4(a: v128) -> v128 {
+ unsafe {
+ simd_cast::<simd::i32x2, simd::f64x2>(simd_shuffle2!(a.as_i32x4(), a.as_i32x4(), [0, 1],))
+ .v128()
+ }
+}
+
+/// Lane-wise conversion from integer to floating point.
+#[inline]
+#[cfg_attr(test, assert_instr(f64x2.convert_low_i32x4_u))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f64x2.convert_low_i32x4_u"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f64x2_convert_low_u32x4(a: v128) -> v128 {
+ unsafe {
+ simd_cast::<simd::u32x2, simd::f64x2>(simd_shuffle2!(a.as_u32x4(), a.as_u32x4(), [0, 1],))
+ .v128()
+ }
+}
+
+/// Conversion of the two double-precision floating point lanes to two lower
+/// single-precision lanes of the result. The two higher lanes of the result are
+/// initialized to zero. If the conversion result is not representable as a
+/// single-precision floating point number, it is rounded to the nearest-even
+/// representable number.
+#[inline]
+#[cfg_attr(test, assert_instr(f32x4.demote_f64x2_zero))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f32x4.demote_f64x2_zero"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f32x4_demote_f64x2_zero(a: v128) -> v128 {
+ unsafe {
+ simd_cast::<simd::f64x4, simd::f32x4>(simd_shuffle4!(
+ a.as_f64x2(),
+ simd::f64x2::splat(0.0),
+ [0, 1, 2, 3]
+ ))
+ .v128()
+ }
+}
+
+/// Conversion of the two lower single-precision floating point lanes to the two
+/// double-precision lanes of the result.
+#[inline]
+#[cfg_attr(test, assert_instr(f64x2.promote_low_f32x4))]
+#[target_feature(enable = "simd128")]
+#[doc(alias("f32x4.promote_low_f32x4"))]
+#[stable(feature = "wasm_simd", since = "1.54.0")]
+pub fn f64x2_promote_low_f32x4(a: v128) -> v128 {
+ unsafe {
+ simd_cast::<simd::f32x2, simd::f64x2>(simd_shuffle2!(a.as_f32x4(), a.as_f32x4(), [0, 1]))
+ .v128()
+ }
+}
+
+#[cfg(test)]
+pub mod tests {
+ use super::*;
+ use core::ops::{Add, Div, Mul, Neg, Sub};
+ use std;
+ use std::fmt::Debug;
+ use std::mem::transmute;
+ use std::num::Wrapping;
+ use std::prelude::v1::*;
+
+ fn compare_bytes(a: v128, b: v128) {
+ let a: [u8; 16] = unsafe { transmute(a) };
+ let b: [u8; 16] = unsafe { transmute(b) };
+ assert_eq!(a, b);
+ }
+
+ #[test]
+ fn test_load() {
+ unsafe {
+ let arr: [i32; 4] = [0, 1, 2, 3];
+ let vec = v128_load(arr.as_ptr() as *const v128);
+ compare_bytes(vec, i32x4(0, 1, 2, 3));
+ }
+ }
+
+ #[test]
+ fn test_load_extend() {
+ unsafe {
+ let arr: [i8; 8] = [-3, -2, -1, 0, 1, 2, 3, 4];
+ let vec = i16x8_load_extend_i8x8(arr.as_ptr());
+ compare_bytes(vec, i16x8(-3, -2, -1, 0, 1, 2, 3, 4));
+ let vec = i16x8_load_extend_u8x8(arr.as_ptr() as *const u8);
+ compare_bytes(vec, i16x8(253, 254, 255, 0, 1, 2, 3, 4));
+
+ let arr: [i16; 4] = [-1, 0, 1, 2];
+ let vec = i32x4_load_extend_i16x4(arr.as_ptr());
+ compare_bytes(vec, i32x4(-1, 0, 1, 2));
+ let vec = i32x4_load_extend_u16x4(arr.as_ptr() as *const u16);
+ compare_bytes(vec, i32x4(65535, 0, 1, 2));
+
+ let arr: [i32; 2] = [-1, 1];
+ let vec = i64x2_load_extend_i32x2(arr.as_ptr());
+ compare_bytes(vec, i64x2(-1, 1));
+ let vec = i64x2_load_extend_u32x2(arr.as_ptr() as *const u32);
+ compare_bytes(vec, i64x2(u32::max_value().into(), 1));
+ }
+ }
+
+ #[test]
+ fn test_load_splat() {
+ unsafe {
+ compare_bytes(v128_load8_splat(&8), i8x16_splat(8));
+ compare_bytes(v128_load16_splat(&9), i16x8_splat(9));
+ compare_bytes(v128_load32_splat(&10), i32x4_splat(10));
+ compare_bytes(v128_load64_splat(&11), i64x2_splat(11));
+ }
+ }
+
+ #[test]
+ fn test_load_zero() {
+ unsafe {
+ compare_bytes(v128_load32_zero(&10), i32x4(10, 0, 0, 0));
+ compare_bytes(v128_load64_zero(&11), i64x2(11, 0));
+ }
+ }
+
+ #[test]
+ fn test_store() {
+ unsafe {
+ let mut spot = i8x16_splat(0);
+ v128_store(&mut spot, i8x16_splat(1));
+ compare_bytes(spot, i8x16_splat(1));
+ }
+ }
+
+ #[test]
+ fn test_load_lane() {
+ unsafe {
+ let zero = i8x16_splat(0);
+ compare_bytes(
+ v128_load8_lane::<2>(zero, &1),
+ i8x16_replace_lane::<2>(zero, 1),
+ );
+
+ compare_bytes(
+ v128_load16_lane::<2>(zero, &1),
+ i16x8_replace_lane::<2>(zero, 1),
+ );
+
+ compare_bytes(
+ v128_load32_lane::<2>(zero, &1),
+ i32x4_replace_lane::<2>(zero, 1),
+ );
+
+ compare_bytes(
+ v128_load64_lane::<1>(zero, &1),
+ i64x2_replace_lane::<1>(zero, 1),
+ );
+ }
+ }
+
+ #[test]
+ fn test_store_lane() {
+ unsafe {
+ let mut spot = 0;
+ let zero = i8x16_splat(0);
+ v128_store8_lane::<5>(i8x16_replace_lane::<5>(zero, 7), &mut spot);
+ assert_eq!(spot, 7);
+
+ let mut spot = 0;
+ v128_store16_lane::<5>(i16x8_replace_lane::<5>(zero, 7), &mut spot);
+ assert_eq!(spot, 7);
+
+ let mut spot = 0;
+ v128_store32_lane::<3>(i32x4_replace_lane::<3>(zero, 7), &mut spot);
+ assert_eq!(spot, 7);
+
+ let mut spot = 0;
+ v128_store64_lane::<0>(i64x2_replace_lane::<0>(zero, 7), &mut spot);
+ assert_eq!(spot, 7);
+ }
+ }
+
+ #[test]
+ fn test_i8x16() {
+ const A: v128 = super::i8x16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ compare_bytes(A, A);
+
+ const _: v128 = i16x8(0, 1, 2, 3, 4, 5, 6, 7);
+ const _: v128 = i32x4(0, 1, 2, 3);
+ const _: v128 = i64x2(0, 1);
+ const _: v128 = f32x4(0., 1., 2., 3.);
+ const _: v128 = f64x2(0., 1.);
+
+ let bytes: [i16; 8] = unsafe { mem::transmute(i16x8(-1, -2, -3, -4, -5, -6, -7, -8)) };
+ assert_eq!(bytes, [-1, -2, -3, -4, -5, -6, -7, -8]);
+ let bytes: [i8; 16] = unsafe {
+ mem::transmute(i8x16(
+ -1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -16,
+ ))
+ };
+ assert_eq!(
+ bytes,
+ [-1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -16]
+ );
+ }
+
+ #[test]
+ fn test_shuffle() {
+ let vec_a = i8x16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let vec_b = i8x16(
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
+ );
+
+ let vec_r = i8x16_shuffle::<0, 16, 2, 18, 4, 20, 6, 22, 8, 24, 10, 26, 12, 28, 14, 30>(
+ vec_a, vec_b,
+ );
+ let vec_e = i8x16(0, 16, 2, 18, 4, 20, 6, 22, 8, 24, 10, 26, 12, 28, 14, 30);
+ compare_bytes(vec_r, vec_e);
+
+ let vec_a = i16x8(0, 1, 2, 3, 4, 5, 6, 7);
+ let vec_b = i16x8(8, 9, 10, 11, 12, 13, 14, 15);
+ let vec_r = i16x8_shuffle::<0, 8, 2, 10, 4, 12, 6, 14>(vec_a, vec_b);
+ let vec_e = i16x8(0, 8, 2, 10, 4, 12, 6, 14);
+ compare_bytes(vec_r, vec_e);
+
+ let vec_a = i32x4(0, 1, 2, 3);
+ let vec_b = i32x4(4, 5, 6, 7);
+ let vec_r = i32x4_shuffle::<0, 4, 2, 6>(vec_a, vec_b);
+ let vec_e = i32x4(0, 4, 2, 6);
+ compare_bytes(vec_r, vec_e);
+
+ let vec_a = i64x2(0, 1);
+ let vec_b = i64x2(2, 3);
+ let vec_r = i64x2_shuffle::<0, 2>(vec_a, vec_b);
+ let vec_e = i64x2(0, 2);
+ compare_bytes(vec_r, vec_e);
+ }
+
+ // tests extract and replace lanes
+ macro_rules! test_extract {
+ (
+ name: $test_id:ident,
+ extract: $extract:ident,
+ replace: $replace:ident,
+ elem: $elem:ty,
+ count: $count:expr,
+ indices: [$($idx:expr),*],
+ ) => {
+ #[test]
+ fn $test_id() {
+ unsafe {
+ let arr: [$elem; $count] = [123 as $elem; $count];
+ let vec: v128 = transmute(arr);
+ $(
+ assert_eq!($extract::<$idx>(vec), 123 as $elem);
+ )*
+
+ // create a vector from array and check that the indices contain
+ // the same values as in the array:
+ let arr: [$elem; $count] = [$($idx as $elem),*];
+ let vec: v128 = transmute(arr);
+ $(
+ assert_eq!($extract::<$idx>(vec), $idx as $elem);
+
+ let tmp = $replace::<$idx>(vec, 124 as $elem);
+ assert_eq!($extract::<$idx>(tmp), 124 as $elem);
+ )*
+ }
+ }
+ }
+ }
+
+ test_extract! {
+ name: test_i8x16_extract_replace,
+ extract: i8x16_extract_lane,
+ replace: i8x16_replace_lane,
+ elem: i8,
+ count: 16,
+ indices: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
+ }
+ test_extract! {
+ name: test_i16x8_extract_replace,
+ extract: i16x8_extract_lane,
+ replace: i16x8_replace_lane,
+ elem: i16,
+ count: 8,
+ indices: [0, 1, 2, 3, 4, 5, 6, 7],
+ }
+ test_extract! {
+ name: test_i32x4_extract_replace,
+ extract: i32x4_extract_lane,
+ replace: i32x4_replace_lane,
+ elem: i32,
+ count: 4,
+ indices: [0, 1, 2, 3],
+ }
+ test_extract! {
+ name: test_i64x2_extract_replace,
+ extract: i64x2_extract_lane,
+ replace: i64x2_replace_lane,
+ elem: i64,
+ count: 2,
+ indices: [0, 1],
+ }
+ test_extract! {
+ name: test_f32x4_extract_replace,
+ extract: f32x4_extract_lane,
+ replace: f32x4_replace_lane,
+ elem: f32,
+ count: 4,
+ indices: [0, 1, 2, 3],
+ }
+ test_extract! {
+ name: test_f64x2_extract_replace,
+ extract: f64x2_extract_lane,
+ replace: f64x2_replace_lane,
+ elem: f64,
+ count: 2,
+ indices: [0, 1],
+ }
+
+ #[test]
+ #[rustfmt::skip]
+ fn test_swizzle() {
+ compare_bytes(
+ i8x16_swizzle(
+ i32x4(1, 2, 3, 4),
+ i8x16(
+ 32, 31, 30, 29,
+ 0, 1, 2, 3,
+ 12, 13, 14, 15,
+ 0, 4, 8, 12),
+ ),
+ i32x4(0, 1, 4, 0x04030201),
+ );
+ }
+
+ macro_rules! test_splat {
+ ($test_id:ident: $val:expr => $($vals:expr),*) => {
+ #[test]
+ fn $test_id() {
+ let a = super::$test_id($val);
+ let b = u8x16($($vals as u8),*);
+ compare_bytes(a, b);
+ }
+ }
+ }
+
+ mod splats {
+ use super::*;
+ test_splat!(i8x16_splat: 42 => 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42);
+ test_splat!(i16x8_splat: 42 => 42, 0, 42, 0, 42, 0, 42, 0, 42, 0, 42, 0, 42, 0, 42, 0);
+ test_splat!(i32x4_splat: 42 => 42, 0, 0, 0, 42, 0, 0, 0, 42, 0, 0, 0, 42, 0, 0, 0);
+ test_splat!(i64x2_splat: 42 => 42, 0, 0, 0, 0, 0, 0, 0, 42, 0, 0, 0, 0, 0, 0, 0);
+ test_splat!(f32x4_splat: 42. => 0, 0, 40, 66, 0, 0, 40, 66, 0, 0, 40, 66, 0, 0, 40, 66);
+ test_splat!(f64x2_splat: 42. => 0, 0, 0, 0, 0, 0, 69, 64, 0, 0, 0, 0, 0, 0, 69, 64);
+ }
+
+ #[test]
+ fn test_bitmasks() {
+ let zero = i8x16_splat(0);
+ let ones = i8x16_splat(!0);
+
+ assert_eq!(i8x16_bitmask(zero), 0);
+ assert_eq!(i8x16_bitmask(ones), 0xffff);
+ assert_eq!(i8x16_bitmask(i8x16_splat(i8::MAX)), 0);
+ assert_eq!(i8x16_bitmask(i8x16_splat(i8::MIN)), 0xffff);
+ assert_eq!(i8x16_bitmask(i8x16_replace_lane::<1>(zero, -1)), 0b10);
+
+ assert_eq!(i16x8_bitmask(zero), 0);
+ assert_eq!(i16x8_bitmask(ones), 0xff);
+ assert_eq!(i16x8_bitmask(i16x8_splat(i16::MAX)), 0);
+ assert_eq!(i16x8_bitmask(i16x8_splat(i16::MIN)), 0xff);
+ assert_eq!(i16x8_bitmask(i16x8_replace_lane::<1>(zero, -1)), 0b10);
+
+ assert_eq!(i32x4_bitmask(zero), 0);
+ assert_eq!(i32x4_bitmask(ones), 0b1111);
+ assert_eq!(i32x4_bitmask(i32x4_splat(i32::MAX)), 0);
+ assert_eq!(i32x4_bitmask(i32x4_splat(i32::MIN)), 0b1111);
+ assert_eq!(i32x4_bitmask(i32x4_replace_lane::<1>(zero, -1)), 0b10);
+
+ assert_eq!(i64x2_bitmask(zero), 0);
+ assert_eq!(i64x2_bitmask(ones), 0b11);
+ assert_eq!(i64x2_bitmask(i64x2_splat(i64::MAX)), 0);
+ assert_eq!(i64x2_bitmask(i64x2_splat(i64::MIN)), 0b11);
+ assert_eq!(i64x2_bitmask(i64x2_replace_lane::<1>(zero, -1)), 0b10);
+ }
+
+ #[test]
+ fn test_narrow() {
+ let zero = i8x16_splat(0);
+ let ones = i8x16_splat(!0);
+
+ compare_bytes(i8x16_narrow_i16x8(zero, zero), zero);
+ compare_bytes(u8x16_narrow_i16x8(zero, zero), zero);
+ compare_bytes(i8x16_narrow_i16x8(ones, ones), ones);
+ compare_bytes(u8x16_narrow_i16x8(ones, ones), zero);
+
+ compare_bytes(
+ i8x16_narrow_i16x8(
+ i16x8(
+ 0,
+ 1,
+ 2,
+ -1,
+ i8::MIN.into(),
+ i8::MAX.into(),
+ u8::MIN.into(),
+ u8::MAX.into(),
+ ),
+ i16x8(
+ i16::MIN.into(),
+ i16::MAX.into(),
+ u16::MIN as i16,
+ u16::MAX as i16,
+ 0,
+ 0,
+ 0,
+ 0,
+ ),
+ ),
+ i8x16(0, 1, 2, -1, -128, 127, 0, 127, -128, 127, 0, -1, 0, 0, 0, 0),
+ );
+
+ compare_bytes(
+ u8x16_narrow_i16x8(
+ i16x8(
+ 0,
+ 1,
+ 2,
+ -1,
+ i8::MIN.into(),
+ i8::MAX.into(),
+ u8::MIN.into(),
+ u8::MAX.into(),
+ ),
+ i16x8(
+ i16::MIN.into(),
+ i16::MAX.into(),
+ u16::MIN as i16,
+ u16::MAX as i16,
+ 0,
+ 0,
+ 0,
+ 0,
+ ),
+ ),
+ i8x16(0, 1, 2, 0, 0, 127, 0, -1, 0, -1, 0, 0, 0, 0, 0, 0),
+ );
+
+ compare_bytes(i16x8_narrow_i32x4(zero, zero), zero);
+ compare_bytes(u16x8_narrow_i32x4(zero, zero), zero);
+ compare_bytes(i16x8_narrow_i32x4(ones, ones), ones);
+ compare_bytes(u16x8_narrow_i32x4(ones, ones), zero);
+
+ compare_bytes(
+ i16x8_narrow_i32x4(
+ i32x4(0, -1, i16::MIN.into(), i16::MAX.into()),
+ i32x4(
+ i32::MIN.into(),
+ i32::MAX.into(),
+ u32::MIN as i32,
+ u32::MAX as i32,
+ ),
+ ),
+ i16x8(0, -1, i16::MIN, i16::MAX, i16::MIN, i16::MAX, 0, -1),
+ );
+
+ compare_bytes(
+ u16x8_narrow_i32x4(
+ i32x4(u16::MAX.into(), -1, i16::MIN.into(), i16::MAX.into()),
+ i32x4(
+ i32::MIN.into(),
+ i32::MAX.into(),
+ u32::MIN as i32,
+ u32::MAX as i32,
+ ),
+ ),
+ i16x8(-1, 0, 0, i16::MAX, 0, -1, 0, 0),
+ );
+ }
+
+ #[test]
+ fn test_extend() {
+ let zero = i8x16_splat(0);
+ let ones = i8x16_splat(!0);
+
+ compare_bytes(i16x8_extend_low_i8x16(zero), zero);
+ compare_bytes(i16x8_extend_high_i8x16(zero), zero);
+ compare_bytes(i16x8_extend_low_u8x16(zero), zero);
+ compare_bytes(i16x8_extend_high_u8x16(zero), zero);
+ compare_bytes(i16x8_extend_low_i8x16(ones), ones);
+ compare_bytes(i16x8_extend_high_i8x16(ones), ones);
+ let halves = u16x8_splat(u8::MAX.into());
+ compare_bytes(i16x8_extend_low_u8x16(ones), halves);
+ compare_bytes(i16x8_extend_high_u8x16(ones), halves);
+
+ compare_bytes(i32x4_extend_low_i16x8(zero), zero);
+ compare_bytes(i32x4_extend_high_i16x8(zero), zero);
+ compare_bytes(i32x4_extend_low_u16x8(zero), zero);
+ compare_bytes(i32x4_extend_high_u16x8(zero), zero);
+ compare_bytes(i32x4_extend_low_i16x8(ones), ones);
+ compare_bytes(i32x4_extend_high_i16x8(ones), ones);
+ let halves = u32x4_splat(u16::MAX.into());
+ compare_bytes(i32x4_extend_low_u16x8(ones), halves);
+ compare_bytes(i32x4_extend_high_u16x8(ones), halves);
+
+ compare_bytes(i64x2_extend_low_i32x4(zero), zero);
+ compare_bytes(i64x2_extend_high_i32x4(zero), zero);
+ compare_bytes(i64x2_extend_low_u32x4(zero), zero);
+ compare_bytes(i64x2_extend_high_u32x4(zero), zero);
+ compare_bytes(i64x2_extend_low_i32x4(ones), ones);
+ compare_bytes(i64x2_extend_high_i32x4(ones), ones);
+ let halves = i64x2_splat(u32::MAX.into());
+ compare_bytes(u64x2_extend_low_u32x4(ones), halves);
+ compare_bytes(u64x2_extend_high_u32x4(ones), halves);
+ }
+
+ #[test]
+ fn test_dot() {
+ let zero = i8x16_splat(0);
+ let ones = i8x16_splat(!0);
+ let two = i32x4_splat(2);
+ compare_bytes(i32x4_dot_i16x8(zero, zero), zero);
+ compare_bytes(i32x4_dot_i16x8(ones, ones), two);
+ }
+
+ macro_rules! test_binop {
+ (
+ $($name:ident => {
+ $([$($vec1:tt)*] ($op:ident | $f:ident) [$($vec2:tt)*],)*
+ })*
+ ) => ($(
+ #[test]
+ fn $name() {
+ unsafe {
+ $(
+ let v1 = [$($vec1)*];
+ let v2 = [$($vec2)*];
+ let v1_v128: v128 = mem::transmute(v1);
+ let v2_v128: v128 = mem::transmute(v2);
+ let v3_v128 = super::$f(v1_v128, v2_v128);
+ let mut v3 = [$($vec1)*];
+ drop(v3);
+ v3 = mem::transmute(v3_v128);
+
+ for (i, actual) in v3.iter().enumerate() {
+ let expected = v1[i].$op(v2[i]);
+ assert_eq!(*actual, expected);
+ }
+ )*
+ }
+ }
+ )*)
+ }
+
+ macro_rules! test_unop {
+ (
+ $($name:ident => {
+ $(($op:ident | $f:ident) [$($vec1:tt)*],)*
+ })*
+ ) => ($(
+ #[test]
+ fn $name() {
+ unsafe {
+ $(
+ let v1 = [$($vec1)*];
+ let v1_v128: v128 = mem::transmute(v1);
+ let v2_v128 = super::$f(v1_v128);
+ let mut v2 = [$($vec1)*];
+ drop(v2);
+ v2 = mem::transmute(v2_v128);
+
+ for (i, actual) in v2.iter().enumerate() {
+ let expected = v1[i].$op();
+ assert_eq!(*actual, expected);
+ }
+ )*
+ }
+ }
+ )*)
+ }
+
+ trait Avgr: Sized {
+ fn avgr(self, other: Self) -> Self;
+ }
+
+ macro_rules! impl_avgr {
+ ($($i:ident)*) => ($(impl Avgr for $i {
+ fn avgr(self, other: Self) -> Self {
+ ((self as u64 + other as u64 + 1) / 2) as $i
+ }
+ })*)
+ }
+
+ impl_avgr!(u8 u16);
+
+ test_binop! {
+ test_i8x16_add => {
+ [0i8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
+ (wrapping_add | i8x16_add)
+ [1i8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+
+ [1i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
+ (wrapping_add | i8x16_add)
+ [-2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -16, -18],
+
+ [1i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
+ (wrapping_add | i8x16_add)
+ [127, -44, 43, 126, 4, 2, 9, -3, -59, -43, 39, -69, 79, -3, 9, -24],
+ }
+
+ test_i8x16_add_sat_s => {
+ [0i8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
+ (saturating_add | i8x16_add_sat)
+ [1i8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+
+ [1i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
+ (saturating_add | i8x16_add_sat)
+ [-2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -16, -18],
+
+ [1i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
+ (saturating_add | i8x16_add_sat)
+ [127, -44, 43, 126, 4, 2, 9, -3, -59, -43, 39, -69, 79, -3, 9, -24],
+ }
+
+ test_i8x16_add_sat_u => {
+ [0u8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
+ (saturating_add | u8x16_add_sat)
+ [1u8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+
+ [1u8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
+ (saturating_add | u8x16_add_sat)
+ [255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240],
+
+ [1u8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
+ (saturating_add | u8x16_add_sat)
+ [127, -44i8 as u8, 43, 126, 4, 2, 9, -3i8 as u8, -59i8 as u8, -43i8 as u8, 39, -69i8 as u8, 79, -3i8 as u8, 9, -24i8 as u8],
+ }
+
+ test_i8x16_sub => {
+ [0i8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
+ (wrapping_sub | i8x16_sub)
+ [1i8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+
+ [1i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
+ (wrapping_sub | i8x16_sub)
+ [-2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -16, -18],
+
+ [1i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
+ (wrapping_sub | i8x16_sub)
+ [-127, -44, 43, 126, 4, 2, 9, -3, -59, -43, 39, -69, 79, -3, 4, 8],
+ }
+
+ test_i8x16_sub_sat_s => {
+ [0i8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
+ (saturating_sub | i8x16_sub_sat)
+ [1i8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+
+ [1i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
+ (saturating_sub | i8x16_sub_sat)
+ [-2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -16, -18],
+
+ [1i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
+ (saturating_sub | i8x16_sub_sat)
+ [-127, -44, 43, 126, 4, 2, 9, -3, -59, -43, 39, -69, 79, -3, 4, 8],
+ }
+
+ test_i8x16_sub_sat_u => {
+ [0u8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
+ (saturating_sub | u8x16_sub_sat)
+ [1u8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+
+ [1u8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
+ (saturating_sub | u8x16_sub_sat)
+ [255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240],
+
+ [1u8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
+ (saturating_sub | u8x16_sub_sat)
+ [127, -44i8 as u8, 43, 126, 4, 2, 9, -3i8 as u8, -59i8 as u8, -43i8 as u8, 39, -69i8 as u8, 79, -3i8 as u8, 9, -24i8 as u8],
+ }
+
+ test_i8x16_min_s => {
+ [0i8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
+ (min | i8x16_min)
+ [1i8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+
+ [1i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
+ (min | i8x16_min)
+ [-2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -16, -18],
+
+ [1i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
+ (min | i8x16_min)
+ [-127, -44, 43, 126, 4, 2, 9, -3, -59, -43, 39, -69, 79, -3, 4, 8],
+ }
+
+ test_i8x16_min_u => {
+ [0u8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
+ (min | u8x16_min)
+ [1u8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+
+ [1u8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
+ (min | u8x16_min)
+ [255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240],
+
+ [1u8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
+ (min | u8x16_min)
+ [127, -44i8 as u8, 43, 126, 4, 2, 9, -3i8 as u8, -59i8 as u8, -43i8 as u8, 39, -69i8 as u8, 79, -3i8 as u8, 9, -24i8 as u8],
+ }
+
+ test_i8x16_max_s => {
+ [0i8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
+ (max | i8x16_max)
+ [1i8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+
+ [1i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
+ (max | i8x16_max)
+ [-2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -16, -18],
+
+ [1i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
+ (max | i8x16_max)
+ [-127, -44, 43, 126, 4, 2, 9, -3, -59, -43, 39, -69, 79, -3, 4, 8],
+ }
+
+ test_i8x16_max_u => {
+ [0u8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
+ (max | u8x16_max)
+ [1u8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+
+ [1u8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
+ (max | u8x16_max)
+ [255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240],
+
+ [1u8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
+ (max | u8x16_max)
+ [127, -44i8 as u8, 43, 126, 4, 2, 9, -3i8 as u8, -59i8 as u8, -43i8 as u8, 39, -69i8 as u8, 79, -3i8 as u8, 9, -24i8 as u8],
+ }
+
+ test_i8x16_avgr_u => {
+ [0u8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
+ (avgr | u8x16_avgr)
+ [1u8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+
+ [1u8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
+ (avgr | u8x16_avgr)
+ [255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240],
+
+ [1u8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
+ (avgr | u8x16_avgr)
+ [127, -44i8 as u8, 43, 126, 4, 2, 9, -3i8 as u8, -59i8 as u8, -43i8 as u8, 39, -69i8 as u8, 79, -3i8 as u8, 9, -24i8 as u8],
+ }
+
+ test_i16x8_add => {
+ [0i16, 0, 0, 0, 0, 0, 0, 0]
+ (wrapping_add | i16x8_add)
+ [1i16, 1, 1, 1, 1, 1, 1, 1],
+
+ [1i16, 2, 3, 4, 5, 6, 7, 8]
+ (wrapping_add | i16x8_add)
+ [32767, 8, -2494,-4, 4882, -4, 848, 3830],
+ }
+
+ test_i16x8_add_sat_s => {
+ [0i16, 0, 0, 0, 0, 0, 0, 0]
+ (saturating_add | i16x8_add_sat)
+ [1i16, 1, 1, 1, 1, 1, 1, 1],
+
+ [1i16, 2, 3, 4, 5, 6, 7, 8]
+ (saturating_add | i16x8_add_sat)
+ [32767, 8, -2494,-4, 4882, -4, 848, 3830],
+ }
+
+ test_i16x8_add_sat_u => {
+ [0u16, 0, 0, 0, 0, 0, 0, 0]
+ (saturating_add | u16x8_add_sat)
+ [1u16, 1, 1, 1, 1, 1, 1, 1],
+
+ [1u16, 2, 3, 4, 5, 6, 7, 8]
+ (saturating_add | u16x8_add_sat)
+ [32767, 8, -2494i16 as u16,-4i16 as u16, 4882, -4i16 as u16, 848, 3830],
+ }
+
+ test_i16x8_sub => {
+ [0i16, 0, 0, 0, 0, 0, 0, 0]
+ (wrapping_sub | i16x8_sub)
+ [1i16, 1, 1, 1, 1, 1, 1, 1],
+
+ [1i16, 2, 3, 4, 5, 6, 7, 8]
+ (wrapping_sub | i16x8_sub)
+ [32767, 8, -2494,-4, 4882, -4, 848, 3830],
+ }
+
+ test_i16x8_sub_sat_s => {
+ [0i16, 0, 0, 0, 0, 0, 0, 0]
+ (saturating_sub | i16x8_sub_sat)
+ [1i16, 1, 1, 1, 1, 1, 1, 1],
+
+ [1i16, 2, 3, 4, 5, 6, 7, 8]
+ (saturating_sub | i16x8_sub_sat)
+ [32767, 8, -2494,-4, 4882, -4, 848, 3830],
+ }
+
+ test_i16x8_sub_sat_u => {
+ [0u16, 0, 0, 0, 0, 0, 0, 0]
+ (saturating_sub | u16x8_sub_sat)
+ [1u16, 1, 1, 1, 1, 1, 1, 1],
+
+ [1u16, 2, 3, 4, 5, 6, 7, 8]
+ (saturating_sub | u16x8_sub_sat)
+ [32767, 8, -2494i16 as u16,-4i16 as u16, 4882, -4i16 as u16, 848, 3830],
+ }
+
+ test_i16x8_mul => {
+ [0i16, 0, 0, 0, 0, 0, 0, 0]
+ (wrapping_mul | i16x8_mul)
+ [1i16, 1, 1, 1, 1, 1, 1, 1],
+
+ [1i16, 2, 3, 4, 5, 6, 7, 8]
+ (wrapping_mul | i16x8_mul)
+ [32767, 8, -2494,-4, 4882, -4, 848, 3830],
+ }
+
+ test_i16x8_min_s => {
+ [0i16, 0, 0, 0, 0, 0, 0, 0]
+ (min | i16x8_min)
+ [1i16, 1, 1, 1, 1, 1, 1, 1],
+
+ [1i16, 2, 3, 4, 5, 6, 7, 8]
+ (min | i16x8_min)
+ [32767, 8, -2494,-4, 4882, -4, 848, 3830],
+ }
+
+ test_i16x8_min_u => {
+ [0u16, 0, 0, 0, 0, 0, 0, 0]
+ (min | u16x8_min)
+ [1u16, 1, 1, 1, 1, 1, 1, 1],
+
+ [1u16, 2, 3, 4, 5, 6, 7, 8]
+ (min | u16x8_min)
+ [32767, 8, -2494i16 as u16,-4i16 as u16, 4882, -4i16 as u16, 848, 3830],
+ }
+
+ test_i16x8_max_s => {
+ [0i16, 0, 0, 0, 0, 0, 0, 0]
+ (max | i16x8_max)
+ [1i16, 1, 1, 1, 1, 1, 1, 1],
+
+ [1i16, 2, 3, 4, 5, 6, 7, 8]
+ (max | i16x8_max)
+ [32767, 8, -2494,-4, 4882, -4, 848, 3830],
+ }
+
+ test_i16x8_max_u => {
+ [0u16, 0, 0, 0, 0, 0, 0, 0]
+ (max | u16x8_max)
+ [1u16, 1, 1, 1, 1, 1, 1, 1],
+
+ [1u16, 2, 3, 4, 5, 6, 7, 8]
+ (max | u16x8_max)
+ [32767, 8, -2494i16 as u16,-4i16 as u16, 4882, -4i16 as u16, 848, 3830],
+ }
+
+ test_i16x8_avgr_u => {
+ [0u16, 0, 0, 0, 0, 0, 0, 0]
+ (avgr | u16x8_avgr)
+ [1u16, 1, 1, 1, 1, 1, 1, 1],
+
+ [1u16, 2, 3, 4, 5, 6, 7, 8]
+ (avgr | u16x8_avgr)
+ [32767, 8, -2494i16 as u16,-4i16 as u16, 4882, -4i16 as u16, 848, 3830],
+ }
+
+ test_i32x4_add => {
+ [0i32, 0, 0, 0] (wrapping_add | i32x4_add) [1, 2, 3, 4],
+ [1i32, 1283, i32::MAX, i32::MIN]
+ (wrapping_add | i32x4_add)
+ [i32::MAX; 4],
+ }
+
+ test_i32x4_sub => {
+ [0i32, 0, 0, 0] (wrapping_sub | i32x4_sub) [1, 2, 3, 4],
+ [1i32, 1283, i32::MAX, i32::MIN]
+ (wrapping_sub | i32x4_sub)
+ [i32::MAX; 4],
+ }
+
+ test_i32x4_mul => {
+ [0i32, 0, 0, 0] (wrapping_mul | i32x4_mul) [1, 2, 3, 4],
+ [1i32, 1283, i32::MAX, i32::MIN]
+ (wrapping_mul | i32x4_mul)
+ [i32::MAX; 4],
+ }
+
+ test_i32x4_min_s => {
+ [0i32, 0, 0, 0] (min | i32x4_min) [1, 2, 3, 4],
+ [1i32, 1283, i32::MAX, i32::MIN]
+ (min | i32x4_min)
+ [i32::MAX; 4],
+ }
+
+ test_i32x4_min_u => {
+ [0u32, 0, 0, 0] (min | u32x4_min) [1, 2, 3, 4],
+ [1u32, 1283, i32::MAX as u32, i32::MIN as u32]
+ (min | u32x4_min)
+ [i32::MAX as u32; 4],
+ }
+
+ test_i32x4_max_s => {
+ [0i32, 0, 0, 0] (max | i32x4_max) [1, 2, 3, 4],
+ [1i32, 1283, i32::MAX, i32::MIN]
+ (max | i32x4_max)
+ [i32::MAX; 4],
+ }
+
+ test_i32x4_max_u => {
+ [0u32, 0, 0, 0] (max | u32x4_max) [1, 2, 3, 4],
+ [1u32, 1283, i32::MAX as u32, i32::MIN as u32]
+ (max | u32x4_max)
+ [i32::MAX as u32; 4],
+ }
+
+ test_i64x2_add => {
+ [0i64, 0] (wrapping_add | i64x2_add) [1, 2],
+ [i64::MIN, i64::MAX] (wrapping_add | i64x2_add) [i64::MAX, i64::MIN],
+ [i64::MAX; 2] (wrapping_add | i64x2_add) [i64::MAX; 2],
+ [-4i64, -4] (wrapping_add | i64x2_add) [800, 939],
+ }
+
+ test_i64x2_sub => {
+ [0i64, 0] (wrapping_sub | i64x2_sub) [1, 2],
+ [i64::MIN, i64::MAX] (wrapping_sub | i64x2_sub) [i64::MAX, i64::MIN],
+ [i64::MAX; 2] (wrapping_sub | i64x2_sub) [i64::MAX; 2],
+ [-4i64, -4] (wrapping_sub | i64x2_sub) [800, 939],
+ }
+
+ test_i64x2_mul => {
+ [0i64, 0] (wrapping_mul | i64x2_mul) [1, 2],
+ [i64::MIN, i64::MAX] (wrapping_mul | i64x2_mul) [i64::MAX, i64::MIN],
+ [i64::MAX; 2] (wrapping_mul | i64x2_mul) [i64::MAX; 2],
+ [-4i64, -4] (wrapping_mul | i64x2_mul) [800, 939],
+ }
+
+ test_f32x4_add => {
+ [-1.0f32, 2.0, 3.0, 4.0] (add | f32x4_add) [1., 2., 0., 0.],
+ [f32::INFINITY, -0.0, f32::NEG_INFINITY, 3.0]
+ (add | f32x4_add)
+ [1., 2., 0., 0.],
+ }
+
+ test_f32x4_sub => {
+ [-1.0f32, 2.0, 3.0, 4.0] (sub | f32x4_sub) [1., 2., 0., 0.],
+ [f32::INFINITY, -0.0, f32::NEG_INFINITY, 3.0]
+ (sub | f32x4_sub)
+ [1., 2., 0., 0.],
+ }
+
+ test_f32x4_mul => {
+ [-1.0f32, 2.0, 3.0, 4.0] (mul | f32x4_mul) [1., 2., 0., 0.],
+ [f32::INFINITY, -0.0, f32::NEG_INFINITY, 3.0]
+ (mul | f32x4_mul)
+ [1., 2., 1., 0.],
+ }
+
+ test_f32x4_div => {
+ [-1.0f32, 2.0, 3.0, 4.0] (div | f32x4_div) [1., 2., 0., 0.],
+ [f32::INFINITY, -0.0, f32::NEG_INFINITY, 3.0]
+ (div | f32x4_div)
+ [1., 2., 0., 0.],
+ }
+
+ test_f32x4_min => {
+ [-1.0f32, 2.0, 3.0, 4.0] (min | f32x4_min) [1., 2., 0., 0.],
+ [f32::INFINITY, -0.0, f32::NEG_INFINITY, 3.0]
+ (min | f32x4_min)
+ [1., 2., 0., 0.],
+ }
+
+ test_f32x4_max => {
+ [-1.0f32, 2.0, 3.0, 4.0] (max | f32x4_max) [1., 2., 0., 0.],
+ [f32::INFINITY, -0.0, f32::NEG_INFINITY, 3.0]
+ (max | f32x4_max)
+ [1., 2., 0., 0.],
+ }
+
+ test_f32x4_pmin => {
+ [-1.0f32, 2.0, 3.0, 4.0] (min | f32x4_pmin) [1., 2., 0., 0.],
+ [f32::INFINITY, -0.0, f32::NEG_INFINITY, 3.0]
+ (min | f32x4_pmin)
+ [1., 2., 0., 0.],
+ }
+
+ test_f32x4_pmax => {
+ [-1.0f32, 2.0, 3.0, 4.0] (max | f32x4_pmax) [1., 2., 0., 0.],
+ [f32::INFINITY, -0.0, f32::NEG_INFINITY, 3.0]
+ (max | f32x4_pmax)
+ [1., 2., 0., 0.],
+ }
+
+ test_f64x2_add => {
+ [-1.0f64, 2.0] (add | f64x2_add) [1., 2.],
+ [f64::INFINITY, f64::NEG_INFINITY] (add | f64x2_add) [1., 2.],
+ }
+
+ test_f64x2_sub => {
+ [-1.0f64, 2.0] (sub | f64x2_sub) [1., 2.],
+ [f64::INFINITY, f64::NEG_INFINITY] (sub | f64x2_sub) [1., 2.],
+ }
+
+ test_f64x2_mul => {
+ [-1.0f64, 2.0] (mul | f64x2_mul) [1., 2.],
+ [f64::INFINITY, f64::NEG_INFINITY] (mul | f64x2_mul) [1., 2.],
+ }
+
+ test_f64x2_div => {
+ [-1.0f64, 2.0] (div | f64x2_div) [1., 2.],
+ [f64::INFINITY, f64::NEG_INFINITY] (div | f64x2_div) [1., 2.],
+ }
+
+ test_f64x2_min => {
+ [-1.0f64, 2.0] (min | f64x2_min) [1., 2.],
+ [f64::INFINITY, f64::NEG_INFINITY] (min | f64x2_min) [1., 2.],
+ }
+
+ test_f64x2_max => {
+ [-1.0f64, 2.0] (max | f64x2_max) [1., 2.],
+ [f64::INFINITY, f64::NEG_INFINITY] (max | f64x2_max) [1., 2.],
+ }
+
+ test_f64x2_pmin => {
+ [-1.0f64, 2.0] (min | f64x2_pmin) [1., 2.],
+ [f64::INFINITY, f64::NEG_INFINITY] (min | f64x2_pmin) [1., 2.],
+ }
+
+ test_f64x2_pmax => {
+ [-1.0f64, 2.0] (max | f64x2_pmax) [1., 2.],
+ [f64::INFINITY, f64::NEG_INFINITY] (max | f64x2_pmax) [1., 2.],
+ }
+ }
+
+ test_unop! {
+ test_i8x16_abs => {
+ (wrapping_abs | i8x16_abs)
+ [1i8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+
+ (wrapping_abs | i8x16_abs)
+ [-2i8, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -16, -18],
+
+ (wrapping_abs | i8x16_abs)
+ [-127i8, -44, 43, 126, 4, -128, 127, -59, -43, 39, -69, 79, -3, 35, 83, 13],
+ }
+
+ test_i8x16_neg => {
+ (wrapping_neg | i8x16_neg)
+ [1i8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+
+ (wrapping_neg | i8x16_neg)
+ [-2i8, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -16, -18],
+
+ (wrapping_neg | i8x16_neg)
+ [-127i8, -44, 43, 126, 4, -128, 127, -59, -43, 39, -69, 79, -3, 35, 83, 13],
+ }
+
+ test_i16x8_abs => {
+ (wrapping_abs | i16x8_abs) [1i16, 1, 1, 1, 1, 1, 1, 1],
+ (wrapping_abs | i16x8_abs) [2i16, 0x7fff, !0, 4, 42, -5, 33, -4847],
+ }
+
+ test_i16x8_neg => {
+ (wrapping_neg | i16x8_neg) [1i16, 1, 1, 1, 1, 1, 1, 1],
+ (wrapping_neg | i16x8_neg) [2i16, 0x7fff, !0, 4, 42, -5, 33, -4847],
+ }
+
+ test_i32x4_abs => {
+ (wrapping_abs | i32x4_abs) [1i32, 2, 3, 4],
+ (wrapping_abs | i32x4_abs) [i32::MIN, i32::MAX, 0, 4],
+ }
+
+ test_i32x4_neg => {
+ (wrapping_neg | i32x4_neg) [1i32, 2, 3, 4],
+ (wrapping_neg | i32x4_neg) [i32::MIN, i32::MAX, 0, 4],
+ }
+
+ test_i64x2_abs => {
+ (wrapping_abs | i64x2_abs) [1i64, 2],
+ (wrapping_abs | i64x2_abs) [i64::MIN, i64::MAX],
+ }
+
+ test_i64x2_neg => {
+ (wrapping_neg | i64x2_neg) [1i64, 2],
+ (wrapping_neg | i64x2_neg) [i64::MIN, i64::MAX],
+ }
+
+ test_f32x4_ceil => {
+ (ceil | f32x4_ceil) [1.0f32, 2., 2.5, 3.3],
+ (ceil | f32x4_ceil) [0.0, -0.3, f32::INFINITY, -0.0],
+ }
+
+ test_f32x4_floor => {
+ (floor | f32x4_floor) [1.0f32, 2., 2.5, 3.3],
+ (floor | f32x4_floor) [0.0, -0.3, f32::INFINITY, -0.0],
+ }
+
+ test_f32x4_trunc => {
+ (trunc | f32x4_trunc) [1.0f32, 2., 2.5, 3.3],
+ (trunc | f32x4_trunc) [0.0, -0.3, f32::INFINITY, -0.0],
+ }
+
+ test_f32x4_nearest => {
+ (round | f32x4_nearest) [1.0f32, 2., 2.6, 3.3],
+ (round | f32x4_nearest) [0.0, -0.3, f32::INFINITY, -0.0],
+ }
+
+ test_f32x4_abs => {
+ (abs | f32x4_abs) [1.0f32, 2., 2.6, 3.3],
+ (abs | f32x4_abs) [0.0, -0.3, f32::INFINITY, -0.0],
+ }
+
+ test_f32x4_neg => {
+ (neg | f32x4_neg) [1.0f32, 2., 2.6, 3.3],
+ (neg | f32x4_neg) [0.0, -0.3, f32::INFINITY, -0.0],
+ }
+
+ test_f32x4_sqrt => {
+ (sqrt | f32x4_sqrt) [1.0f32, 2., 2.6, 3.3],
+ (sqrt | f32x4_sqrt) [0.0, 0.3, f32::INFINITY, 0.1],
+ }
+
+ test_f64x2_ceil => {
+ (ceil | f64x2_ceil) [1.0f64, 2.3],
+ (ceil | f64x2_ceil) [f64::INFINITY, -0.1],
+ }
+
+ test_f64x2_floor => {
+ (floor | f64x2_floor) [1.0f64, 2.3],
+ (floor | f64x2_floor) [f64::INFINITY, -0.1],
+ }
+
+ test_f64x2_trunc => {
+ (trunc | f64x2_trunc) [1.0f64, 2.3],
+ (trunc | f64x2_trunc) [f64::INFINITY, -0.1],
+ }
+
+ test_f64x2_nearest => {
+ (round | f64x2_nearest) [1.0f64, 2.3],
+ (round | f64x2_nearest) [f64::INFINITY, -0.1],
+ }
+
+ test_f64x2_abs => {
+ (abs | f64x2_abs) [1.0f64, 2.3],
+ (abs | f64x2_abs) [f64::INFINITY, -0.1],
+ }
+
+ test_f64x2_neg => {
+ (neg | f64x2_neg) [1.0f64, 2.3],
+ (neg | f64x2_neg) [f64::INFINITY, -0.1],
+ }
+
+ test_f64x2_sqrt => {
+ (sqrt | f64x2_sqrt) [1.0f64, 2.3],
+ (sqrt | f64x2_sqrt) [f64::INFINITY, 0.1],
+ }
+ }
+
+ macro_rules! floating_point {
+ (f32) => {
+ true
+ };
+ (f64) => {
+ true
+ };
+ ($id:ident) => {
+ false
+ };
+ }
+
+ trait IsNan: Sized {
+ fn is_nan(self) -> bool {
+ false
+ }
+ }
+ impl IsNan for i8 {}
+ impl IsNan for i16 {}
+ impl IsNan for i32 {}
+ impl IsNan for i64 {}
+
+ macro_rules! test_bop {
+ ($id:ident[$ety:ident; $ecount:expr] |
+ $binary_op:ident [$op_test_id:ident] :
+ ([$($in_a:expr),*], [$($in_b:expr),*]) => [$($out:expr),*]) => {
+ test_bop!(
+ $id[$ety; $ecount] => $ety | $binary_op [ $op_test_id ]:
+ ([$($in_a),*], [$($in_b),*]) => [$($out),*]
+ );
+
+ };
+ ($id:ident[$ety:ident; $ecount:expr] => $oty:ident |
+ $binary_op:ident [$op_test_id:ident] :
+ ([$($in_a:expr),*], [$($in_b:expr),*]) => [$($out:expr),*]) => {
+ #[test]
+ fn $op_test_id() {
+ unsafe {
+ let a_input: [$ety; $ecount] = [$($in_a),*];
+ let b_input: [$ety; $ecount] = [$($in_b),*];
+ let output: [$oty; $ecount] = [$($out),*];
+
+ let a_vec_in: v128 = transmute(a_input);
+ let b_vec_in: v128 = transmute(b_input);
+ let vec_res: v128 = $binary_op(a_vec_in, b_vec_in);
+
+ let res: [$oty; $ecount] = transmute(vec_res);
+
+ if !floating_point!($ety) {
+ assert_eq!(res, output);
+ } else {
+ for i in 0..$ecount {
+ let r = res[i];
+ let o = output[i];
+ assert_eq!(r.is_nan(), o.is_nan());
+ if !r.is_nan() {
+ assert_eq!(r, o);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ macro_rules! test_bops {
+ ($id:ident[$ety:ident; $ecount:expr] |
+ $binary_op:ident [$op_test_id:ident]:
+ ([$($in_a:expr),*], $in_b:expr) => [$($out:expr),*]) => {
+ #[test]
+ fn $op_test_id() {
+ unsafe {
+ let a_input: [$ety; $ecount] = [$($in_a),*];
+ let output: [$ety; $ecount] = [$($out),*];
+
+ let a_vec_in: v128 = transmute(a_input);
+ let vec_res: v128 = $binary_op(a_vec_in, $in_b);
+
+ let res: [$ety; $ecount] = transmute(vec_res);
+ assert_eq!(res, output);
+ }
+ }
+ }
+ }
+
+ macro_rules! test_uop {
+ ($id:ident[$ety:ident; $ecount:expr] |
+ $unary_op:ident [$op_test_id:ident]: [$($in_a:expr),*] => [$($out:expr),*]) => {
+ #[test]
+ fn $op_test_id() {
+ unsafe {
+ let a_input: [$ety; $ecount] = [$($in_a),*];
+ let output: [$ety; $ecount] = [$($out),*];
+
+ let a_vec_in: v128 = transmute(a_input);
+ let vec_res: v128 = $unary_op(a_vec_in);
+
+ let res: [$ety; $ecount] = transmute(vec_res);
+ assert_eq!(res, output);
+ }
+ }
+ }
+ }
+
+ test_bops!(i8x16[i8; 16] | i8x16_shl[i8x16_shl_test]:
+ ([0, -1, 2, 3, 4, 5, 6, i8::MAX, 1, 1, 1, 1, 1, 1, 1, 1], 1) =>
+ [0, -2, 4, 6, 8, 10, 12, -2, 2, 2, 2, 2, 2, 2, 2, 2]);
+ test_bops!(i16x8[i16; 8] | i16x8_shl[i16x8_shl_test]:
+ ([0, -1, 2, 3, 4, 5, 6, i16::MAX], 1) =>
+ [0, -2, 4, 6, 8, 10, 12, -2]);
+ test_bops!(i32x4[i32; 4] | i32x4_shl[i32x4_shl_test]:
+ ([0, -1, 2, 3], 1) => [0, -2, 4, 6]);
+ test_bops!(i64x2[i64; 2] | i64x2_shl[i64x2_shl_test]:
+ ([0, -1], 1) => [0, -2]);
+
+ test_bops!(i8x16[i8; 16] | i8x16_shr[i8x16_shr_s_test]:
+ ([0, -1, 2, 3, 4, 5, 6, i8::MAX, 1, 1, 1, 1, 1, 1, 1, 1], 1) =>
+ [0, -1, 1, 1, 2, 2, 3, 63, 0, 0, 0, 0, 0, 0, 0, 0]);
+ test_bops!(i16x8[i16; 8] | i16x8_shr[i16x8_shr_s_test]:
+ ([0, -1, 2, 3, 4, 5, 6, i16::MAX], 1) =>
+ [0, -1, 1, 1, 2, 2, 3, i16::MAX / 2]);
+ test_bops!(i32x4[i32; 4] | i32x4_shr[i32x4_shr_s_test]:
+ ([0, -1, 2, 3], 1) => [0, -1, 1, 1]);
+ test_bops!(i64x2[i64; 2] | i64x2_shr[i64x2_shr_s_test]:
+ ([0, -1], 1) => [0, -1]);
+
+ test_bops!(i8x16[i8; 16] | u8x16_shr[i8x16_uhr_u_test]:
+ ([0, -1, 2, 3, 4, 5, 6, i8::MAX, 1, 1, 1, 1, 1, 1, 1, 1], 1) =>
+ [0, i8::MAX, 1, 1, 2, 2, 3, 63, 0, 0, 0, 0, 0, 0, 0, 0]);
+ test_bops!(i16x8[i16; 8] | u16x8_shr[i16x8_uhr_u_test]:
+ ([0, -1, 2, 3, 4, 5, 6, i16::MAX], 1) =>
+ [0, i16::MAX, 1, 1, 2, 2, 3, i16::MAX / 2]);
+ test_bops!(i32x4[i32; 4] | u32x4_shr[i32x4_uhr_u_test]:
+ ([0, -1, 2, 3], 1) => [0, i32::MAX, 1, 1]);
+ test_bops!(i64x2[i64; 2] | u64x2_shr[i64x2_uhr_u_test]:
+ ([0, -1], 1) => [0, i64::MAX]);
+
+ #[test]
+ fn v128_bitwise_logical_ops() {
+ unsafe {
+ let a: [u32; 4] = [u32::MAX, 0, u32::MAX, 0];
+ let b: [u32; 4] = [u32::MAX; 4];
+ let c: [u32; 4] = [0; 4];
+
+ let vec_a: v128 = transmute(a);
+ let vec_b: v128 = transmute(b);
+ let vec_c: v128 = transmute(c);
+
+ let r: v128 = v128_and(vec_a, vec_a);
+ compare_bytes(r, vec_a);
+ let r: v128 = v128_and(vec_a, vec_b);
+ compare_bytes(r, vec_a);
+ let r: v128 = v128_andnot(vec_a, vec_b);
+ compare_bytes(r, vec_c);
+ let r: v128 = v128_andnot(vec_a, vec_a);
+ compare_bytes(r, vec_c);
+ let r: v128 = v128_andnot(vec_a, vec_c);
+ compare_bytes(r, vec_a);
+ let r: v128 = v128_or(vec_a, vec_b);
+ compare_bytes(r, vec_b);
+ let r: v128 = v128_not(vec_b);
+ compare_bytes(r, vec_c);
+ let r: v128 = v128_xor(vec_a, vec_c);
+ compare_bytes(r, vec_a);
+
+ let r: v128 = v128_bitselect(vec_b, vec_c, vec_b);
+ compare_bytes(r, vec_b);
+ let r: v128 = v128_bitselect(vec_b, vec_c, vec_c);
+ compare_bytes(r, vec_c);
+ let r: v128 = v128_bitselect(vec_b, vec_c, vec_a);
+ compare_bytes(r, vec_a);
+ }
+ }
+
+ macro_rules! test_bool_red {
+ ([$test_id:ident, $any:ident, $all:ident] | [$($true:expr),*] | [$($false:expr),*] | [$($alt:expr),*]) => {
+ #[test]
+ fn $test_id() {
+ unsafe {
+ let vec_a: v128 = transmute([$($true),*]); // true
+ let vec_b: v128 = transmute([$($false),*]); // false
+ let vec_c: v128 = transmute([$($alt),*]); // alternating
+
+ // TODO
+ // assert_eq!($any(vec_a), true);
+ // assert_eq!($any(vec_b), false);
+ // assert_eq!($any(vec_c), true);
+
+ assert_eq!($all(vec_a), true);
+ assert_eq!($all(vec_b), false);
+ assert_eq!($all(vec_c), false);
+ }
+ }
+ }
+ }
+
+ test_bool_red!(
+ [i8x16_boolean_reductions, v128_any_true, i8x16_all_true]
+ | [1_i8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
+ | [0_i8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
+ | [1_i8, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0]
+ );
+ test_bool_red!(
+ [i16x8_boolean_reductions, v128_any_true, i16x8_all_true]
+ | [1_i16, 1, 1, 1, 1, 1, 1, 1]
+ | [0_i16, 0, 0, 0, 0, 0, 0, 0]
+ | [1_i16, 0, 1, 0, 1, 0, 1, 0]
+ );
+ test_bool_red!(
+ [i32x4_boolean_reductions, v128_any_true, i32x4_all_true]
+ | [1_i32, 1, 1, 1]
+ | [0_i32, 0, 0, 0]
+ | [1_i32, 0, 1, 0]
+ );
+ test_bool_red!(
+ [i64x2_boolean_reductions, v128_any_true, i64x2_all_true]
+ | [1_i64, 1]
+ | [0_i64, 0]
+ | [1_i64, 0]
+ );
+
+ test_bop!(i8x16[i8; 16] | i8x16_eq[i8x16_eq_test]:
+ ([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
+ [0, 2, 2, 4, 4, 6, 6, 7, 8, 10, 10, 12, 12, 14, 14, 15]) =>
+ [-1, 0, -1, 0 ,-1, 0, -1, -1, -1, 0, -1, 0 ,-1, 0, -1, -1]);
+ test_bop!(i16x8[i16; 8] | i16x8_eq[i16x8_eq_test]:
+ ([0, 1, 2, 3, 4, 5, 6, 7], [0, 2, 2, 4, 4, 6, 6, 7]) =>
+ [-1, 0, -1, 0 ,-1, 0, -1, -1]);
+ test_bop!(i32x4[i32; 4] | i32x4_eq[i32x4_eq_test]:
+ ([0, 1, 2, 3], [0, 2, 2, 4]) => [-1, 0, -1, 0]);
+ test_bop!(i64x2[i64; 2] | i64x2_eq[i64x2_eq_test]:
+ ([0, 1], [0, 2]) => [-1, 0]);
+ test_bop!(f32x4[f32; 4] => i32 | f32x4_eq[f32x4_eq_test]:
+ ([0., 1., 2., 3.], [0., 2., 2., 4.]) => [-1, 0, -1, 0]);
+ test_bop!(f64x2[f64; 2] => i64 | f64x2_eq[f64x2_eq_test]: ([0., 1.], [0., 2.]) => [-1, 0]);
+
+ test_bop!(i8x16[i8; 16] | i8x16_ne[i8x16_ne_test]:
+ ([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
+ [0, 2, 2, 4, 4, 6, 6, 7, 8, 10, 10, 12, 12, 14, 14, 15]) =>
+ [0, -1, 0, -1 ,0, -1, 0, 0, 0, -1, 0, -1 ,0, -1, 0, 0]);
+ test_bop!(i16x8[i16; 8] | i16x8_ne[i16x8_ne_test]:
+ ([0, 1, 2, 3, 4, 5, 6, 7], [0, 2, 2, 4, 4, 6, 6, 7]) =>
+ [0, -1, 0, -1 ,0, -1, 0, 0]);
+ test_bop!(i32x4[i32; 4] | i32x4_ne[i32x4_ne_test]:
+ ([0, 1, 2, 3], [0, 2, 2, 4]) => [0, -1, 0, -1]);
+ test_bop!(i64x2[i64; 2] | i64x2_ne[i64x2_ne_test]:
+ ([0, 1], [0, 2]) => [0, -1]);
+ test_bop!(f32x4[f32; 4] => i32 | f32x4_ne[f32x4_ne_test]:
+ ([0., 1., 2., 3.], [0., 2., 2., 4.]) => [0, -1, 0, -1]);
+ test_bop!(f64x2[f64; 2] => i64 | f64x2_ne[f64x2_ne_test]: ([0., 1.], [0., 2.]) => [0, -1]);
+
+ test_bop!(i8x16[i8; 16] | i8x16_lt[i8x16_lt_s_test]:
+ ([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, -12, 13, 14, 15],
+ [0, 2, 2, 4, 4, 6, 6, 7, 8, 10, 10, 12, 12, 14, 14, 15]) =>
+ [0, -1, 0, -1 ,0, -1, 0, 0, 0, -1, 0, -1, -1, -1, 0, 0]);
+ test_bop!(i8x16[i8; 16] | u8x16_lt[i8x16_lt_u_test]:
+ ([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, -12, 13, 14, 15],
+ [0, 2, 2, 4, 4, 6, 6, 7, 8, 10, 10, 12, 12, 14, 14, 15]) =>
+ [0, -1, 0, -1 ,0, -1, 0, 0, 0, -1, 0, -1 ,0, -1, 0, 0]);
+ test_bop!(i16x8[i16; 8] | i16x8_lt[i16x8_lt_s_test]:
+ ([0, 1, 2, 3, 4, 5, 6, -7], [0, 2, 2, 4, 4, 6, 6, 7]) =>
+ [0, -1, 0, -1 ,0, -1, 0, -1]);
+ test_bop!(i16x8[i16; 8] | u16x8_lt[i16x8_lt_u_test]:
+ ([0, 1, 2, 3, 4, 5, 6, -7], [0, 2, 2, 4, 4, 6, 6, 7]) =>
+ [0, -1, 0, -1 ,0, -1, 0, 0]);
+ test_bop!(i32x4[i32; 4] | i32x4_lt[i32x4_lt_s_test]:
+ ([-1, 1, 2, 3], [0, 2, 2, 4]) => [-1, -1, 0, -1]);
+ test_bop!(i32x4[i32; 4] | u32x4_lt[i32x4_lt_u_test]:
+ ([-1, 1, 2, 3], [0, 2, 2, 4]) => [0, -1, 0, -1]);
+ test_bop!(i64x2[i64; 2] | i64x2_lt[i64x2_lt_s_test]:
+ ([-1, 3], [0, 2]) => [-1, 0]);
+ test_bop!(f32x4[f32; 4] => i32 | f32x4_lt[f32x4_lt_test]:
+ ([0., 1., 2., 3.], [0., 2., 2., 4.]) => [0, -1, 0, -1]);
+ test_bop!(f64x2[f64; 2] => i64 | f64x2_lt[f64x2_lt_test]: ([0., 1.], [0., 2.]) => [0, -1]);
+
+ test_bop!(i8x16[i8; 16] | i8x16_gt[i8x16_gt_s_test]:
+ ([0, 2, 2, 4, 4, 6, 6, 7, 8, 10, 10, 12, 12, 14, 14, -15],
+ [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]) =>
+ [0, -1, 0, -1 ,0, -1, 0, 0, 0, -1, 0, -1 ,0, -1, 0, 0]);
+ test_bop!(i8x16[i8; 16] | u8x16_gt[i8x16_gt_u_test]:
+ ([0, 2, 2, 4, 4, 6, 6, 7, 8, 10, 10, 12, 12, 14, 14, -15],
+ [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]) =>
+ [0, -1, 0, -1 ,0, -1, 0, 0, 0, -1, 0, -1 ,0, -1, 0, -1]);
+ test_bop!(i16x8[i16; 8] | i16x8_gt[i16x8_gt_s_test]:
+ ([0, 2, 2, 4, 4, 6, 6, -7], [0, 1, 2, 3, 4, 5, 6, 7]) =>
+ [0, -1, 0, -1 ,0, -1, 0, 0]);
+ test_bop!(i16x8[i16; 8] | u16x8_gt[i16x8_gt_u_test]:
+ ([0, 2, 2, 4, 4, 6, 6, -7], [0, 1, 2, 3, 4, 5, 6, 7]) =>
+ [0, -1, 0, -1 ,0, -1, 0, -1]);
+ test_bop!(i32x4[i32; 4] | i32x4_gt[i32x4_gt_s_test]:
+ ([0, 2, 2, -4], [0, 1, 2, 3]) => [0, -1, 0, 0]);
+ test_bop!(i32x4[i32; 4] | u32x4_gt[i32x4_gt_u_test]:
+ ([0, 2, 2, -4], [0, 1, 2, 3]) => [0, -1, 0, -1]);
+ test_bop!(i64x2[i64; 2] | i64x2_gt[i64x2_gt_s_test]:
+ ([-1, 2], [0, 1]) => [0, -1]);
+ test_bop!(f32x4[f32; 4] => i32 | f32x4_gt[f32x4_gt_test]:
+ ([0., 2., 2., 4.], [0., 1., 2., 3.]) => [0, -1, 0, -1]);
+ test_bop!(f64x2[f64; 2] => i64 | f64x2_gt[f64x2_gt_test]: ([0., 2.], [0., 1.]) => [0, -1]);
+
+ test_bop!(i8x16[i8; 16] | i8x16_ge[i8x16_ge_s_test]:
+ ([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, -15],
+ [0, 2, 2, 4, 4, 6, 6, 7, 8, 10, 10, 12, 12, 14, 14, 15]) =>
+ [-1, 0, -1, 0 ,-1, 0, -1, -1, -1, 0, -1, 0 ,-1, 0, -1, 0]);
+ test_bop!(i8x16[i8; 16] | u8x16_ge[i8x16_ge_u_test]:
+ ([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, -15],
+ [0, 2, 2, 4, 4, 6, 6, 7, 8, 10, 10, 12, 12, 14, 14, 15]) =>
+ [-1, 0, -1, 0 ,-1, 0, -1, -1, -1, 0, -1, 0 ,-1, 0, -1, -1]);
+ test_bop!(i16x8[i16; 8] | i16x8_ge[i16x8_ge_s_test]:
+ ([0, 1, 2, 3, 4, 5, 6, -7], [0, 2, 2, 4, 4, 6, 6, 7]) =>
+ [-1, 0, -1, 0 ,-1, 0, -1, 0]);
+ test_bop!(i16x8[i16; 8] | u16x8_ge[i16x8_ge_u_test]:
+ ([0, 1, 2, 3, 4, 5, 6, -7], [0, 2, 2, 4, 4, 6, 6, 7]) =>
+ [-1, 0, -1, 0 ,-1, 0, -1, -1]);
+ test_bop!(i32x4[i32; 4] | i32x4_ge[i32x4_ge_s_test]:
+ ([0, 1, 2, -3], [0, 2, 2, 4]) => [-1, 0, -1, 0]);
+ test_bop!(i32x4[i32; 4] | u32x4_ge[i32x4_ge_u_test]:
+ ([0, 1, 2, -3], [0, 2, 2, 4]) => [-1, 0, -1, -1]);
+ test_bop!(i64x2[i64; 2] | i64x2_ge[i64x2_ge_s_test]:
+ ([0, 1], [-1, 2]) => [-1, 0]);
+ test_bop!(f32x4[f32; 4] => i32 | f32x4_ge[f32x4_ge_test]:
+ ([0., 1., 2., 3.], [0., 2., 2., 4.]) => [-1, 0, -1, 0]);
+ test_bop!(f64x2[f64; 2] => i64 | f64x2_ge[f64x2_ge_test]: ([0., 1.], [0., 2.]) => [-1, 0]);
+
+ test_bop!(i8x16[i8; 16] | i8x16_le[i8x16_le_s_test]:
+ ([0, 2, 2, 4, 4, 6, 6, 7, 8, 10, 10, 12, 12, 14, 14, -15],
+ [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
+ ) =>
+ [-1, 0, -1, 0 ,-1, 0, -1, -1, -1, 0, -1, 0 ,-1, 0, -1, -1]);
+ test_bop!(i8x16[i8; 16] | u8x16_le[i8x16_le_u_test]:
+ ([0, 2, 2, 4, 4, 6, 6, 7, 8, 10, 10, 12, 12, 14, 14, -15],
+ [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
+ ) =>
+ [-1, 0, -1, 0 ,-1, 0, -1, -1, -1, 0, -1, 0 ,-1, 0, -1, 0]);
+ test_bop!(i16x8[i16; 8] | i16x8_le[i16x8_le_s_test]:
+ ([0, 2, 2, 4, 4, 6, 6, -7], [0, 1, 2, 3, 4, 5, 6, 7]) =>
+ [-1, 0, -1, 0 ,-1, 0, -1, -1]);
+ test_bop!(i16x8[i16; 8] | u16x8_le[i16x8_le_u_test]:
+ ([0, 2, 2, 4, 4, 6, 6, -7], [0, 1, 2, 3, 4, 5, 6, 7]) =>
+ [-1, 0, -1, 0 ,-1, 0, -1, 0]);
+ test_bop!(i32x4[i32; 4] | i32x4_le[i32x4_le_s_test]:
+ ([0, 2, 2, -4], [0, 1, 2, 3]) => [-1, 0, -1, -1]);
+ test_bop!(i32x4[i32; 4] | u32x4_le[i32x4_le_u_test]:
+ ([0, 2, 2, -4], [0, 1, 2, 3]) => [-1, 0, -1, 0]);
+ test_bop!(i64x2[i64; 2] | i64x2_le[i64x2_le_s_test]:
+ ([0, 2], [0, 1]) => [-1, 0]);
+ test_bop!(f32x4[f32; 4] => i32 | f32x4_le[f32x4_le_test]:
+ ([0., 2., 2., 4.], [0., 1., 2., 3.]) => [-1, 0, -1, -0]);
+ test_bop!(f64x2[f64; 2] => i64 | f64x2_le[f64x2_le_test]: ([0., 2.], [0., 1.]) => [-1, 0]);
+
+ test_uop!(f32x4[f32; 4] | f32x4_neg[f32x4_neg_test]: [0., 1., 2., 3.] => [ 0., -1., -2., -3.]);
+ test_uop!(f32x4[f32; 4] | f32x4_abs[f32x4_abs_test]: [0., -1., 2., -3.] => [ 0., 1., 2., 3.]);
+ test_bop!(f32x4[f32; 4] | f32x4_min[f32x4_min_test]:
+ ([0., -1., 7., 8.], [1., -3., -4., 10.]) => [0., -3., -4., 8.]);
+ test_bop!(f32x4[f32; 4] | f32x4_min[f32x4_min_test_nan]:
+ ([0., -1., 7., 8.], [1., -3., -4., std::f32::NAN])
+ => [0., -3., -4., std::f32::NAN]);
+ test_bop!(f32x4[f32; 4] | f32x4_max[f32x4_max_test]:
+ ([0., -1., 7., 8.], [1., -3., -4., 10.]) => [1., -1., 7., 10.]);
+ test_bop!(f32x4[f32; 4] | f32x4_max[f32x4_max_test_nan]:
+ ([0., -1., 7., 8.], [1., -3., -4., std::f32::NAN])
+ => [1., -1., 7., std::f32::NAN]);
+ test_bop!(f32x4[f32; 4] | f32x4_add[f32x4_add_test]:
+ ([0., -1., 7., 8.], [1., -3., -4., 10.]) => [1., -4., 3., 18.]);
+ test_bop!(f32x4[f32; 4] | f32x4_sub[f32x4_sub_test]:
+ ([0., -1., 7., 8.], [1., -3., -4., 10.]) => [-1., 2., 11., -2.]);
+ test_bop!(f32x4[f32; 4] | f32x4_mul[f32x4_mul_test]:
+ ([0., -1., 7., 8.], [1., -3., -4., 10.]) => [0., 3., -28., 80.]);
+ test_bop!(f32x4[f32; 4] | f32x4_div[f32x4_div_test]:
+ ([0., -8., 70., 8.], [1., 4., 10., 2.]) => [0., -2., 7., 4.]);
+
+ test_uop!(f64x2[f64; 2] | f64x2_neg[f64x2_neg_test]: [0., 1.] => [ 0., -1.]);
+ test_uop!(f64x2[f64; 2] | f64x2_abs[f64x2_abs_test]: [0., -1.] => [ 0., 1.]);
+ test_bop!(f64x2[f64; 2] | f64x2_min[f64x2_min_test]:
+ ([0., -1.], [1., -3.]) => [0., -3.]);
+ test_bop!(f64x2[f64; 2] | f64x2_min[f64x2_min_test_nan]:
+ ([7., 8.], [-4., std::f64::NAN])
+ => [ -4., std::f64::NAN]);
+ test_bop!(f64x2[f64; 2] | f64x2_max[f64x2_max_test]:
+ ([0., -1.], [1., -3.]) => [1., -1.]);
+ test_bop!(f64x2[f64; 2] | f64x2_max[f64x2_max_test_nan]:
+ ([7., 8.], [ -4., std::f64::NAN])
+ => [7., std::f64::NAN]);
+ test_bop!(f64x2[f64; 2] | f64x2_add[f64x2_add_test]:
+ ([0., -1.], [1., -3.]) => [1., -4.]);
+ test_bop!(f64x2[f64; 2] | f64x2_sub[f64x2_sub_test]:
+ ([0., -1.], [1., -3.]) => [-1., 2.]);
+ test_bop!(f64x2[f64; 2] | f64x2_mul[f64x2_mul_test]:
+ ([0., -1.], [1., -3.]) => [0., 3.]);
+ test_bop!(f64x2[f64; 2] | f64x2_div[f64x2_div_test]:
+ ([0., -8.], [1., 4.]) => [0., -2.]);
+
+ macro_rules! test_conv {
+ ($test_id:ident | $conv_id:ident | $to_ty:ident | $from:expr, $to:expr) => {
+ #[test]
+ fn $test_id() {
+ unsafe {
+ let from: v128 = transmute($from);
+ let to: v128 = transmute($to);
+
+ let r: v128 = $conv_id(from);
+
+ compare_bytes(r, to);
+ }
+ }
+ };
+ }
+
+ test_conv!(
+ f32x4_convert_s_i32x4 | f32x4_convert_i32x4 | f32x4 | [1_i32, 2, 3, 4],
+ [1_f32, 2., 3., 4.]
+ );
+ test_conv!(
+ f32x4_convert_u_i32x4 | f32x4_convert_u32x4 | f32x4 | [u32::MAX, 2, 3, 4],
+ [u32::MAX as f32, 2., 3., 4.]
+ );
+
+ #[test]
+ fn test_conversions() {
+ compare_bytes(
+ i32x4_trunc_sat_f32x4(f32x4(1., f32::NEG_INFINITY, f32::INFINITY, f32::NAN)),
+ i32x4(1, i32::MIN, i32::MAX, 0),
+ );
+ compare_bytes(
+ u32x4_trunc_sat_f32x4(f32x4(1., f32::NEG_INFINITY, f32::INFINITY, f32::NAN)),
+ u32x4(1, 0, u32::MAX, 0),
+ );
+ compare_bytes(f64x2_convert_low_i32x4(i32x4(1, 2, 3, 4)), f64x2(1., 2.));
+ compare_bytes(
+ f64x2_convert_low_i32x4(i32x4(i32::MIN, i32::MAX, 3, 4)),
+ f64x2(f64::from(i32::MIN), f64::from(i32::MAX)),
+ );
+ compare_bytes(f64x2_convert_low_u32x4(u32x4(1, 2, 3, 4)), f64x2(1., 2.));
+ compare_bytes(
+ f64x2_convert_low_u32x4(u32x4(u32::MIN, u32::MAX, 3, 4)),
+ f64x2(f64::from(u32::MIN), f64::from(u32::MAX)),
+ );
+
+ compare_bytes(
+ i32x4_trunc_sat_f64x2_zero(f64x2(1., f64::NEG_INFINITY)),
+ i32x4(1, i32::MIN, 0, 0),
+ );
+ compare_bytes(
+ i32x4_trunc_sat_f64x2_zero(f64x2(f64::NAN, f64::INFINITY)),
+ i32x4(0, i32::MAX, 0, 0),
+ );
+ compare_bytes(
+ u32x4_trunc_sat_f64x2_zero(f64x2(1., f64::NEG_INFINITY)),
+ u32x4(1, 0, 0, 0),
+ );
+ compare_bytes(
+ u32x4_trunc_sat_f64x2_zero(f64x2(f64::NAN, f64::INFINITY)),
+ u32x4(0, u32::MAX, 0, 0),
+ );
+ }
+
+ #[test]
+ fn test_popcnt() {
+ unsafe {
+ for i in 0..=255 {
+ compare_bytes(
+ i8x16_popcnt(u8x16_splat(i)),
+ u8x16_splat(i.count_ones() as u8),
+ )
+ }
+
+ let vectors = [
+ [0u8, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
+ [
+ 100, 200, 50, 0, 10, 7, 38, 185, 192, 3, 34, 85, 93, 7, 31, 99,
+ ],
+ ];
+
+ for vector in vectors.iter() {
+ compare_bytes(
+ i8x16_popcnt(transmute(*vector)),
+ i8x16(
+ vector[0].count_ones() as i8,
+ vector[1].count_ones() as i8,
+ vector[2].count_ones() as i8,
+ vector[3].count_ones() as i8,
+ vector[4].count_ones() as i8,
+ vector[5].count_ones() as i8,
+ vector[6].count_ones() as i8,
+ vector[7].count_ones() as i8,
+ vector[8].count_ones() as i8,
+ vector[9].count_ones() as i8,
+ vector[10].count_ones() as i8,
+ vector[11].count_ones() as i8,
+ vector[12].count_ones() as i8,
+ vector[13].count_ones() as i8,
+ vector[14].count_ones() as i8,
+ vector[15].count_ones() as i8,
+ ),
+ )
+ }
+ }
+ }
+
+ #[test]
+ fn test_promote_demote() {
+ let tests = [
+ [1., 2.],
+ [f64::NAN, f64::INFINITY],
+ [100., 201.],
+ [0., -0.],
+ [f64::NEG_INFINITY, 0.],
+ ];
+
+ for [a, b] in tests {
+ compare_bytes(
+ f32x4_demote_f64x2_zero(f64x2(a, b)),
+ f32x4(a as f32, b as f32, 0., 0.),
+ );
+ compare_bytes(
+ f64x2_promote_low_f32x4(f32x4(a as f32, b as f32, 0., 0.)),
+ f64x2(a, b),
+ );
+ }
+ }
+
+ #[test]
+ fn test_extmul() {
+ macro_rules! test {
+ ($(
+ $ctor:ident {
+ from: $from:ident,
+ to: $to:ident,
+ low: $low:ident,
+ high: $high:ident,
+ } => {
+ $(([$($a:tt)*] * [$($b:tt)*]))*
+ }
+ )*) => ($(
+ $(unsafe {
+ let a: [$from; 16 / mem::size_of::<$from>()] = [$($a)*];
+ let b: [$from; 16 / mem::size_of::<$from>()] = [$($b)*];
+ let low = mem::transmute::<_, [$to; 16 / mem::size_of::<$to>()]>($low($ctor($($a)*), $ctor($($b)*)));
+ let high = mem::transmute::<_, [$to; 16 / mem::size_of::<$to>()]>($high($ctor($($a)*), $ctor($($b)*)));
+
+ let half = a.len() / 2;
+ for i in 0..half {
+ assert_eq!(
+ (a[i] as $to).wrapping_mul((b[i] as $to)),
+ low[i],
+ "expected {} * {}", a[i] as $to, b[i] as $to,
+ );
+ assert_eq!(
+ (a[half + i] as $to).wrapping_mul((b[half + i] as $to)),
+ high[i],
+ "expected {} * {}", a[half + i] as $to, b[half + i] as $to,
+ );
+ }
+ })*
+ )*)
+ }
+ test! {
+ i8x16 {
+ from: i8,
+ to: i16,
+ low: i16x8_extmul_low_i8x16,
+ high: i16x8_extmul_high_i8x16,
+ } => {
+ (
+ [0, 0, 0, 0, 0, 0, 0, 0, 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, -2, 3, 100, 124, -38, 33, 87, 92, 108, 22, 8, -43, -128, 22, 0]
+ *
+ [-5, -2, 6, 10, 45, -4, 4, -2, 0, 88, 92, -102, -98, 83, 73, 54]
+ )
+ }
+ u8x16 {
+ from: u8,
+ to: u16,
+ low: u16x8_extmul_low_u8x16,
+ high: u16x8_extmul_high_u8x16,
+ } => {
+ (
+ [0, 0, 0, 0, 0, 0, 0, 0, 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, 2, 3, 100, 124, 38, 33, 87, 92, 198, 22, 8, 43, 128, 22, 0]
+ *
+ [5, 200, 6, 10, 45, 248, 4, 2, 0, 2, 92, 102, 234, 83, 73, 54]
+ )
+ }
+ i16x8 {
+ from: i16,
+ to: i32,
+ low: i32x4_extmul_low_i16x8,
+ high: i32x4_extmul_high_i16x8,
+ } => {
+ (
+ [0, 0, 0, 0, 0, 0, 0, 0]
+ *
+ [0, 0, 0, 0, 0, 0, 0, 0]
+ )
+ (
+ [-1, 0, i16::MAX, 19931, -2259, 64, 200, 87]
+ *
+ [1, 1, i16::MIN, 29391, 105, 2, 100, -2]
+ )
+ }
+ u16x8 {
+ from: u16,
+ to: u32,
+ low: u32x4_extmul_low_u16x8,
+ high: u32x4_extmul_high_u16x8,
+ } => {
+ (
+ [0, 0, 0, 0, 0, 0, 0, 0]
+ *
+ [0, 0, 0, 0, 0, 0, 0, 0]
+ )
+ (
+ [1, 0, u16::MAX, 19931, 2259, 64, 200, 87]
+ *
+ [1, 1, 3, 29391, 105, 2, 100, 2]
+ )
+ }
+ i32x4 {
+ from: i32,
+ to: i64,
+ low: i64x2_extmul_low_i32x4,
+ high: i64x2_extmul_high_i32x4,
+ } => {
+ (
+ [0, 0, 0, 0]
+ *
+ [0, 0, 0, 0]
+ )
+ (
+ [-1, 0, i32::MAX, 19931]
+ *
+ [1, 1, i32::MIN, 29391]
+ )
+ (
+ [i32::MAX, 3003183, 3 << 20, 0xffffff]
+ *
+ [i32::MAX, i32::MIN, -40042, 300]
+ )
+ }
+ u32x4 {
+ from: u32,
+ to: u64,
+ low: u64x2_extmul_low_u32x4,
+ high: u64x2_extmul_high_u32x4,
+ } => {
+ (
+ [0, 0, 0, 0]
+ *
+ [0, 0, 0, 0]
+ )
+ (
+ [1, 0, u32::MAX, 19931]
+ *
+ [1, 1, 3, 29391]
+ )
+ (
+ [u32::MAX, 3003183, 3 << 20, 0xffffff]
+ *
+ [u32::MAX, 3000, 40042, 300]
+ )
+ }
+ }
+ }
+
+ #[test]
+ fn test_q15mulr_sat_s() {
+ fn test(a: [i16; 8], b: [i16; 8]) {
+ let a_v = i16x8(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7]);
+ let b_v = i16x8(b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7]);
+ let result = i16x8_q15mulr_sat(a_v, b_v);
+ let result = unsafe { mem::transmute::<v128, [i16; 8]>(result) };
+
+ for (i, (a, b)) in a.iter().zip(&b).enumerate() {
+ assert_eq!(
+ result[i],
+ (((*a as i32) * (*b as i32) + 0x4000) >> 15) as i16
+ );
+ }
+ }
+
+ test([0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0]);
+ test([1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1]);
+ test(
+ [-1, 100, 2003, -29494, 12, 128, 994, 1],
+ [-4049, 8494, -10483, 0, 5, 2222, 883, -9],
+ );
+ }
+
+ #[test]
+ fn test_extadd() {
+ macro_rules! test {
+ ($(
+ $func:ident {
+ from: $from:ident,
+ to: $to:ident,
+ } => {
+ $([$($a:tt)*])*
+ }
+ )*) => ($(
+ $(unsafe {
+ let a: [$from; 16 / mem::size_of::<$from>()] = [$($a)*];
+ let a_v = mem::transmute::<_, v128>(a);
+ let r = mem::transmute::<v128, [$to; 16 / mem::size_of::<$to>()]>($func(a_v));
+
+ let half = a.len() / 2;
+ for i in 0..half {
+ assert_eq!(
+ (a[2 * i] as $to).wrapping_add((a[2 * i + 1] as $to)),
+ r[i],
+ "failed {} + {} != {}",
+ a[2 * i] as $to,
+ a[2 * i + 1] as $to,
+ r[i],
+ );
+ }
+ })*
+ )*)
+ }
+ test! {
+ i16x8_extadd_pairwise_i8x16 {
+ from: i8,
+ to: i16,
+ } => {
+ [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
+ [-1, -2, 3, 100, 124, -38, 33, 87, 92, 108, 22, 8, -43, -128, 22, 0]
+ [-5, -2, 6, 10, 45, -4, 4, -2, 0, 88, 92, -102, -98, 83, 73, 54]
+ }
+ i16x8_extadd_pairwise_u8x16 {
+ from: u8,
+ to: i16,
+ } => {
+ [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
+ [1, 2, 3, 100, 124, 38, 33, 87, 92, 198, 22, 8, 43, 128, 22, 0]
+ [5, 200, 6, 10, 45, 248, 4, 2, 0, 2, 92, 102, 234, 83, 73, 54]
+ }
+ i32x4_extadd_pairwise_i16x8 {
+ from: i16,
+ to: i32,
+ } => {
+ [0, 0, 0, 0, 0, 0, 0, 0]
+ [-1, 0, i16::MAX, 19931, -2259, 64, 200, 87]
+ [1, 1, i16::MIN, 29391, 105, 2, 100, -2]
+ }
+ i32x4_extadd_pairwise_u16x8 {
+ from: u16,
+ to: i32,
+ } => {
+ [0, 0, 0, 0, 0, 0, 0, 0]
+ [1, 0, u16::MAX, 19931, 2259, 64, 200, 87]
+ [1, 1, 3, 29391, 105, 2, 100, 2]
+ }
+ }
+ }
+}
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);
+ }
+ */
+}
diff --git a/library/stdarch/crates/core_arch/src/x86_64/abm.rs b/library/stdarch/crates/core_arch/src/x86_64/abm.rs
new file mode 100644
index 000000000..988074d67
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86_64/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_u64)
+#[inline]
+#[target_feature(enable = "lzcnt")]
+#[cfg_attr(test, assert_instr(lzcnt))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _lzcnt_u64(x: u64) -> u64 {
+ x.leading_zeros() as u64
+}
+
+/// Counts the bits that are set.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_popcnt64)
+#[inline]
+#[target_feature(enable = "popcnt")]
+#[cfg_attr(test, assert_instr(popcnt))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _popcnt64(x: i64) -> i32 {
+ x.count_ones() as i32
+}
+
+#[cfg(test)]
+mod tests {
+ use stdarch_test::simd_test;
+
+ use crate::core_arch::arch::x86_64::*;
+
+ #[simd_test(enable = "lzcnt")]
+ unsafe fn test_lzcnt_u64() {
+ assert_eq!(_lzcnt_u64(0b0101_1010), 57);
+ }
+
+ #[simd_test(enable = "popcnt")]
+ unsafe fn test_popcnt64() {
+ assert_eq!(_popcnt64(0b0101_1010), 4);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86_64/adx.rs b/library/stdarch/crates/core_arch/src/x86_64/adx.rs
new file mode 100644
index 000000000..a54d71136
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86_64/adx.rs
@@ -0,0 +1,148 @@
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+#[allow(improper_ctypes)]
+extern "unadjusted" {
+ #[link_name = "llvm.x86.addcarry.64"]
+ fn llvm_addcarry_u64(a: u8, b: u64, c: u64) -> (u8, u64);
+ #[link_name = "llvm.x86.addcarryx.u64"]
+ fn llvm_addcarryx_u64(a: u8, b: u64, c: u64, d: *mut u8) -> u8;
+ #[link_name = "llvm.x86.subborrow.64"]
+ fn llvm_subborrow_u64(a: u8, b: u64, c: u64) -> (u8, u64);
+}
+
+/// Adds unsigned 64-bit integers `a` and `b` with unsigned 8-bit carry-in `c_in`
+/// (carry flag), and store the unsigned 64-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_u64(c_in: u8, a: u64, b: u64, out: &mut u64) -> u8 {
+ let (a, b) = llvm_addcarry_u64(c_in, a, b);
+ *out = b;
+ a
+}
+
+/// Adds unsigned 64-bit integers `a` and `b` with unsigned 8-bit carry-in `c_in`
+/// (carry or overflow flag), and store the unsigned 64-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_u64(c_in: u8, a: u64, b: u64, out: &mut u64) -> u8 {
+ llvm_addcarryx_u64(c_in, a, b, out as *mut _ as *mut u8)
+}
+
+/// Adds unsigned 64-bit integers `a` and `b` with unsigned 8-bit carry-in `c_in`.
+/// (carry or overflow flag), and store the unsigned 64-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_u64(c_in: u8, a: u64, b: u64, out: &mut u64) -> u8 {
+ let (a, b) = llvm_subborrow_u64(c_in, a, b);
+ *out = b;
+ a
+}
+
+#[cfg(test)]
+mod tests {
+ use stdarch_test::simd_test;
+
+ use crate::core_arch::x86_64::*;
+
+ #[test]
+ fn test_addcarry_u64() {
+ unsafe {
+ let a = u64::MAX;
+ let mut out = 0;
+
+ let r = _addcarry_u64(0, a, 1, &mut out);
+ assert_eq!(r, 1);
+ assert_eq!(out, 0);
+
+ let r = _addcarry_u64(0, a, 0, &mut out);
+ assert_eq!(r, 0);
+ assert_eq!(out, a);
+
+ let r = _addcarry_u64(1, a, 1, &mut out);
+ assert_eq!(r, 1);
+ assert_eq!(out, 1);
+
+ let r = _addcarry_u64(1, a, 0, &mut out);
+ assert_eq!(r, 1);
+ assert_eq!(out, 0);
+
+ let r = _addcarry_u64(0, 3, 4, &mut out);
+ assert_eq!(r, 0);
+ assert_eq!(out, 7);
+
+ let r = _addcarry_u64(1, 3, 4, &mut out);
+ assert_eq!(r, 0);
+ assert_eq!(out, 8);
+ }
+ }
+
+ #[simd_test(enable = "adx")]
+ unsafe fn test_addcarryx_u64() {
+ let a = u64::MAX;
+ let mut out = 0;
+
+ let r = _addcarry_u64(0, a, 1, &mut out);
+ assert_eq!(r, 1);
+ assert_eq!(out, 0);
+
+ let r = _addcarry_u64(0, a, 0, &mut out);
+ assert_eq!(r, 0);
+ assert_eq!(out, a);
+
+ let r = _addcarry_u64(1, a, 1, &mut out);
+ assert_eq!(r, 1);
+ assert_eq!(out, 1);
+
+ let r = _addcarry_u64(1, a, 0, &mut out);
+ assert_eq!(r, 1);
+ assert_eq!(out, 0);
+
+ let r = _addcarry_u64(0, 3, 4, &mut out);
+ assert_eq!(r, 0);
+ assert_eq!(out, 7);
+
+ let r = _addcarry_u64(1, 3, 4, &mut out);
+ assert_eq!(r, 0);
+ assert_eq!(out, 8);
+ }
+
+ #[test]
+ fn test_subborrow_u64() {
+ unsafe {
+ let a = u64::MAX;
+ let mut out = 0;
+
+ let r = _subborrow_u64(0, 0, 1, &mut out);
+ assert_eq!(r, 1);
+ assert_eq!(out, a);
+
+ let r = _subborrow_u64(0, 0, 0, &mut out);
+ assert_eq!(r, 0);
+ assert_eq!(out, 0);
+
+ let r = _subborrow_u64(1, 0, 1, &mut out);
+ assert_eq!(r, 1);
+ assert_eq!(out, a - 1);
+
+ let r = _subborrow_u64(1, 0, 0, &mut out);
+ assert_eq!(r, 1);
+ assert_eq!(out, a);
+
+ let r = _subborrow_u64(0, 7, 3, &mut out);
+ assert_eq!(r, 0);
+ assert_eq!(out, 4);
+
+ let r = _subborrow_u64(1, 7, 3, &mut out);
+ assert_eq!(r, 0);
+ assert_eq!(out, 3);
+ }
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86_64/avx.rs b/library/stdarch/crates/core_arch/src/x86_64/avx.rs
new file mode 100644
index 000000000..7ba26371c
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86_64/avx.rs
@@ -0,0 +1,48 @@
+//! 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_llvm::*, x86::*},
+ mem::transmute,
+};
+
+/// Copies `a` to result, and insert the 64-bit integer `i` into result
+/// at the location specified by `index`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_insert_epi64)
+#[inline]
+#[rustc_legacy_const_generics(2)]
+#[target_feature(enable = "avx")]
+// This intrinsic has no corresponding instruction.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_insert_epi64<const INDEX: i32>(a: __m256i, i: i64) -> __m256i {
+ static_assert_imm2!(INDEX);
+ transmute(simd_insert(a.as_i64x4(), INDEX as u32, i))
+}
+
+#[cfg(test)]
+mod tests {
+ use stdarch_test::simd_test;
+
+ use crate::core_arch::x86::*;
+
+ #[simd_test(enable = "avx")]
+ unsafe fn test_mm256_insert_epi64() {
+ let a = _mm256_setr_epi64x(1, 2, 3, 4);
+ let r = _mm256_insert_epi64::<3>(a, 0);
+ let e = _mm256_setr_epi64x(1, 2, 3, 0);
+ assert_eq_m256i(r, e);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86_64/avx2.rs b/library/stdarch/crates/core_arch/src/x86_64/avx2.rs
new file mode 100644
index 000000000..14447a137
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86_64/avx2.rs
@@ -0,0 +1,47 @@
+//! 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_llvm::*, x86::*};
+
+/// Extracts a 64-bit integer from `a`, selected with `INDEX`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_extract_epi64)
+#[inline]
+#[target_feature(enable = "avx2")]
+#[rustc_legacy_const_generics(1)]
+// This intrinsic has no corresponding instruction.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm256_extract_epi64<const INDEX: i32>(a: __m256i) -> i64 {
+ static_assert_imm2!(INDEX);
+ simd_extract(a.as_i64x4(), INDEX as u32)
+}
+
+#[cfg(test)]
+mod tests {
+ use crate::core_arch::arch::x86_64::*;
+ use stdarch_test::simd_test;
+
+ #[simd_test(enable = "avx2")]
+ unsafe fn test_mm256_extract_epi64() {
+ let a = _mm256_setr_epi64x(0, 1, 2, 3);
+ let r = _mm256_extract_epi64::<3>(a);
+ assert_eq!(r, 3);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86_64/avx512f.rs b/library/stdarch/crates/core_arch/src/x86_64/avx512f.rs
new file mode 100644
index 000000000..5eed0502c
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86_64/avx512f.rs
@@ -0,0 +1,12346 @@
+use crate::{
+ core_arch::{simd::*, simd_llvm::*, x86::*, x86_64::*},
+ mem::transmute,
+};
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+/// Convert the lower double-precision (64-bit) floating-point element in a to a 64-bit integer, and store the result in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtsd_i64&expand=1792)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtsd2si))]
+pub unsafe fn _mm_cvtsd_i64(a: __m128d) -> i64 {
+ _mm_cvtsd_si64(a)
+}
+
+/// Convert the lower single-precision (32-bit) floating-point element in a to a 64-bit integer, and store the result in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtss_i64&expand=1894)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtss2si))]
+pub unsafe fn _mm_cvtss_i64(a: __m128) -> i64 {
+ _mm_cvtss_si64(a)
+}
+
+/// Convert the lower single-precision (32-bit) floating-point element in a to an unsigned 64-bit integer, and store the result in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtss_u64&expand=1902)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtss2usi))]
+pub unsafe fn _mm_cvtss_u64(a: __m128) -> u64 {
+ transmute(vcvtss2usi64(a.as_f32x4(), _MM_FROUND_CUR_DIRECTION))
+}
+
+/// Convert the lower double-precision (64-bit) floating-point element in a to an unsigned 64-bit integer, and store the result in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtsd_u64&expand=1800)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtsd2usi))]
+pub unsafe fn _mm_cvtsd_u64(a: __m128d) -> u64 {
+ transmute(vcvtsd2usi64(a.as_f64x2(), _MM_FROUND_CUR_DIRECTION))
+}
+
+/// Convert the signed 64-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_cvti64_ss(a: __m128, b: i64) -> __m128 {
+ let b = b as f32;
+ let r = simd_insert(a, 0, b);
+ transmute(r)
+}
+
+/// Convert the signed 64-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_cvti64_sd&expand=1644)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtsi2sd))]
+pub unsafe fn _mm_cvti64_sd(a: __m128d, b: i64) -> __m128d {
+ let b = b as f64;
+ let r = simd_insert(a, 0, b);
+ transmute(r)
+}
+
+/// Convert the unsigned 64-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_cvtu64_ss&expand=2035)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtusi2ss))]
+pub unsafe fn _mm_cvtu64_ss(a: __m128, b: u64) -> __m128 {
+ let b = b as f32;
+ let r = simd_insert(a, 0, b);
+ transmute(r)
+}
+
+/// Convert the unsigned 64-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_cvtu64_sd&expand=2034)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtusi2sd))]
+pub unsafe fn _mm_cvtu64_sd(a: __m128d, b: u64) -> __m128d {
+ let b = b as f64;
+ let r = simd_insert(a, 0, b);
+ transmute(r)
+}
+
+/// Convert the lower double-precision (64-bit) floating-point element in a to a 64-bit integer with truncation, and store the result in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvttsd_i64&expand=2016)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtsd2si))]
+pub unsafe fn _mm_cvttsd_i64(a: __m128d) -> i64 {
+ transmute(vcvtsd2si64(a.as_f64x2(), _MM_FROUND_CUR_DIRECTION))
+}
+
+/// Convert the lower double-precision (64-bit) floating-point element in a to an unsigned 64-bit integer with truncation, and store the result in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvttsd_u64&expand=2021)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtsd2usi))]
+pub unsafe fn _mm_cvttsd_u64(a: __m128d) -> u64 {
+ transmute(vcvtsd2usi64(a.as_f64x2(), _MM_FROUND_CUR_DIRECTION))
+}
+
+/// Convert the lower single-precision (32-bit) floating-point element in a to a 64-bit integer with truncation, and store the result in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=#text=_mm_cvttss_i64&expand=2023)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtss2si))]
+pub unsafe fn _mm_cvttss_i64(a: __m128) -> i64 {
+ transmute(vcvtss2si64(a.as_f32x4(), _MM_FROUND_CUR_DIRECTION))
+}
+
+/// Convert the lower single-precision (32-bit) floating-point element in a to an unsigned 64-bit integer with truncation, and store the result in dst.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvttss_u64&expand=2027)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtss2usi))]
+pub unsafe fn _mm_cvttss_u64(a: __m128) -> u64 {
+ transmute(vcvtss2usi64(a.as_f32x4(), _MM_FROUND_CUR_DIRECTION))
+}
+
+/// Convert the signed 64-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.
+/// 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_roundi64_sd&expand=1313)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtsi2sd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_cvt_roundi64_sd<const ROUNDING: i32>(a: __m128d, b: i64) -> __m128d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x2();
+ let r = vcvtsi2sd64(a, b, ROUNDING);
+ transmute(r)
+}
+
+/// Convert the signed 64-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.
+/// 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_roundsi64_sd&expand=1367)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtsi2sd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_cvt_roundsi64_sd<const ROUNDING: i32>(a: __m128d, b: i64) -> __m128d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x2();
+ let r = vcvtsi2sd64(a, b, ROUNDING);
+ transmute(r)
+}
+
+/// Convert the signed 64-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_roundi64_ss&expand=1314)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtsi2ss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_cvt_roundi64_ss<const ROUNDING: i32>(a: __m128, b: i64) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x4();
+ let r = vcvtsi2ss64(a, b, ROUNDING);
+ transmute(r)
+}
+
+/// Convert the unsigned 64-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.\
+/// 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_roundu64_sd&expand=1379)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtusi2sd, ROUNDING = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_cvt_roundu64_sd<const ROUNDING: i32>(a: __m128d, b: u64) -> __m128d {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x2();
+ let r = vcvtusi2sd64(a, b, ROUNDING);
+ transmute(r)
+}
+
+/// Convert the signed 64-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_roundsi64_ss&expand=1368)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtsi2ss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_cvt_roundsi64_ss<const ROUNDING: i32>(a: __m128, b: i64) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x4();
+ let r = vcvtsi2ss64(a, b, ROUNDING);
+ transmute(r)
+}
+
+/// Convert the unsigned 64-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_roundu64_ss&expand=1380)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtusi2ss, ROUNDING = 8))]
+#[rustc_legacy_const_generics(2)]
+pub unsafe fn _mm_cvt_roundu64_ss<const ROUNDING: i32>(a: __m128, b: u64) -> __m128 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x4();
+ let r = vcvtusi2ss64(a, b, ROUNDING);
+ transmute(r)
+}
+
+/// Convert the lower double-precision (64-bit) floating-point element in a to a 64-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_si64&expand=1360)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtsd2si, ROUNDING = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm_cvt_roundsd_si64<const ROUNDING: i32>(a: __m128d) -> i64 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x2();
+ let r = vcvtsd2si64(a, ROUNDING);
+ transmute(r)
+}
+
+/// Convert the lower double-precision (64-bit) floating-point element in a to a 64-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_i64&expand=1358)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtsd2si, ROUNDING = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm_cvt_roundsd_i64<const ROUNDING: i32>(a: __m128d) -> i64 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x2();
+ let r = vcvtsd2si64(a, ROUNDING);
+ transmute(r)
+}
+
+/// Convert the lower double-precision (64-bit) floating-point element in a to an unsigned 64-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_u64&expand=1365)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtsd2usi, ROUNDING = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm_cvt_roundsd_u64<const ROUNDING: i32>(a: __m128d) -> u64 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f64x2();
+ let r = vcvtsd2usi64(a, ROUNDING);
+ transmute(r)
+}
+
+/// Convert the lower single-precision (32-bit) floating-point element in a to a 64-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_si64&expand=1375)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtss2si, ROUNDING = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm_cvt_roundss_si64<const ROUNDING: i32>(a: __m128) -> i64 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x4();
+ let r = vcvtss2si64(a, ROUNDING);
+ transmute(r)
+}
+
+/// Convert the lower single-precision (32-bit) floating-point element in a to a 64-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_i64&expand=1370)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtss2si, ROUNDING = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm_cvt_roundss_i64<const ROUNDING: i32>(a: __m128) -> i64 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x4();
+ let r = vcvtss2si64(a, ROUNDING);
+ transmute(r)
+}
+
+/// Convert the lower single-precision (32-bit) floating-point element in a to an unsigned 64-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_u64&expand=1377)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtss2usi, ROUNDING = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm_cvt_roundss_u64<const ROUNDING: i32>(a: __m128) -> u64 {
+ static_assert_rounding!(ROUNDING);
+ let a = a.as_f32x4();
+ let r = vcvtss2usi64(a, ROUNDING);
+ transmute(r)
+}
+
+/// Convert the lower double-precision (64-bit) floating-point element in a to a 64-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_si64&expand=1931)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtsd2si, SAE = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm_cvtt_roundsd_si64<const SAE: i32>(a: __m128d) -> i64 {
+ static_assert_sae!(SAE);
+ let a = a.as_f64x2();
+ let r = vcvtsd2si64(a, SAE);
+ transmute(r)
+}
+
+/// Convert the lower double-precision (64-bit) floating-point element in a to a 64-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_i64&expand=1929)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtsd2si, SAE = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm_cvtt_roundsd_i64<const SAE: i32>(a: __m128d) -> i64 {
+ static_assert_sae!(SAE);
+ let a = a.as_f64x2();
+ let r = vcvtsd2si64(a, SAE);
+ transmute(r)
+}
+
+/// Convert the lower double-precision (64-bit) floating-point element in a to an unsigned 64-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_u64&expand=1933)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtsd2usi, SAE = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm_cvtt_roundsd_u64<const SAE: i32>(a: __m128d) -> u64 {
+ static_assert_sae!(SAE);
+ let a = a.as_f64x2();
+ let r = vcvtsd2usi64(a, SAE);
+ transmute(r)
+}
+
+/// Convert the lower single-precision (32-bit) floating-point element in a to a 64-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_i64&expand=1935)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtss2si, SAE = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm_cvtt_roundss_i64<const SAE: i32>(a: __m128) -> i64 {
+ static_assert_sae!(SAE);
+ let a = a.as_f32x4();
+ let r = vcvtss2si64(a, SAE);
+ transmute(r)
+}
+
+/// Convert the lower single-precision (32-bit) floating-point element in a to a 64-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_si64&expand=1937)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtss2si, SAE = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm_cvtt_roundss_si64<const SAE: i32>(a: __m128) -> i64 {
+ static_assert_sae!(SAE);
+ let a = a.as_f32x4();
+ let r = vcvtss2si64(a, SAE);
+ transmute(r)
+}
+
+/// Convert the lower single-precision (32-bit) floating-point element in a to an unsigned 64-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_u64&expand=1939)
+#[inline]
+#[target_feature(enable = "avx512f")]
+#[cfg_attr(test, assert_instr(vcvtss2usi, SAE = 8))]
+#[rustc_legacy_const_generics(1)]
+pub unsafe fn _mm_cvtt_roundss_u64<const SAE: i32>(a: __m128) -> u64 {
+ static_assert_sae!(SAE);
+ let a = a.as_f32x4();
+ let r = vcvtss2usi64(a, SAE);
+ transmute(r)
+}
+
+#[allow(improper_ctypes)]
+extern "C" {
+ #[link_name = "llvm.x86.avx512.vcvtss2si64"]
+ fn vcvtss2si64(a: f32x4, rounding: i32) -> i64;
+ #[link_name = "llvm.x86.avx512.vcvtss2usi64"]
+ fn vcvtss2usi64(a: f32x4, rounding: i32) -> u64;
+ #[link_name = "llvm.x86.avx512.vcvtsd2si64"]
+ fn vcvtsd2si64(a: f64x2, rounding: i32) -> i64;
+ #[link_name = "llvm.x86.avx512.vcvtsd2usi64"]
+ fn vcvtsd2usi64(a: f64x2, rounding: i32) -> u64;
+
+ #[link_name = "llvm.x86.avx512.cvtsi2ss64"]
+ fn vcvtsi2ss64(a: f32x4, b: i64, rounding: i32) -> f32x4;
+ #[link_name = "llvm.x86.avx512.cvtsi2sd64"]
+ fn vcvtsi2sd64(a: f64x2, b: i64, rounding: i32) -> f64x2;
+ #[link_name = "llvm.x86.avx512.cvtusi642ss"]
+ fn vcvtusi2ss64(a: f32x4, b: u64, rounding: i32) -> f32x4;
+ #[link_name = "llvm.x86.avx512.cvtusi642sd"]
+ fn vcvtusi2sd64(a: f64x2, b: u64, rounding: i32) -> f64x2;
+}
+
+#[cfg(test)]
+mod tests {
+
+ use stdarch_test::simd_test;
+
+ use crate::core_arch::x86::*;
+ use crate::core_arch::x86_64::*;
+ use crate::hint::black_box;
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_abs_epi64() {
+ let a = _mm512_set_epi64(0, 1, -1, i64::MAX, i64::MIN, 100, -100, -32);
+ let r = _mm512_abs_epi64(a);
+ let e = _mm512_set_epi64(0, 1, 1, i64::MAX, i64::MAX.wrapping_add(1), 100, 100, 32);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_abs_epi64() {
+ let a = _mm512_set_epi64(0, 1, -1, i64::MAX, i64::MIN, 100, -100, -32);
+ let r = _mm512_mask_abs_epi64(a, 0, a);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_abs_epi64(a, 0b11111111, a);
+ let e = _mm512_set_epi64(0, 1, 1, i64::MAX, i64::MIN, 100, 100, 32);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_abs_epi64() {
+ let a = _mm512_set_epi64(0, 1, -1, i64::MAX, i64::MIN, 100, -100, -32);
+ let r = _mm512_maskz_abs_epi64(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_abs_epi64(0b11111111, a);
+ let e = _mm512_set_epi64(0, 1, 1, i64::MAX, i64::MIN, 100, 100, 32);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_abs_epi64() {
+ let a = _mm256_set_epi64x(i64::MAX, i64::MIN, 100, -100);
+ let r = _mm256_abs_epi64(a);
+ let e = _mm256_set_epi64x(i64::MAX, i64::MAX.wrapping_add(1), 100, 100);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_abs_epi64() {
+ let a = _mm256_set_epi64x(i64::MAX, i64::MIN, 100, -100);
+ let r = _mm256_mask_abs_epi64(a, 0, a);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_abs_epi64(a, 0b00001111, a);
+ let e = _mm256_set_epi64x(i64::MAX, i64::MAX.wrapping_add(1), 100, 100);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_abs_epi64() {
+ let a = _mm256_set_epi64x(i64::MAX, i64::MIN, 100, -100);
+ let r = _mm256_maskz_abs_epi64(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_abs_epi64(0b00001111, a);
+ let e = _mm256_set_epi64x(i64::MAX, i64::MAX.wrapping_add(1), 100, 100);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_abs_pd() {
+ let a = _mm512_setr_pd(0., 1., -1., f64::MAX, f64::MIN, 100., -100., -32.);
+ let r = _mm512_abs_pd(a);
+ let e = _mm512_setr_pd(0., 1., 1., f64::MAX, f64::MAX, 100., 100., 32.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_abs_pd() {
+ let a = _mm512_setr_pd(0., 1., -1., f64::MAX, f64::MIN, 100., -100., -32.);
+ let r = _mm512_mask_abs_pd(a, 0, a);
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_abs_pd(a, 0b00001111, a);
+ let e = _mm512_setr_pd(0., 1., 1., f64::MAX, f64::MIN, 100., -100., -32.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_mov_epi64() {
+ let src = _mm512_set1_epi64(1);
+ let a = _mm512_set1_epi64(2);
+ let r = _mm512_mask_mov_epi64(src, 0, a);
+ assert_eq_m512i(r, src);
+ let r = _mm512_mask_mov_epi64(src, 0b11111111, a);
+ assert_eq_m512i(r, a);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_mov_epi64() {
+ let a = _mm512_set1_epi64(2);
+ let r = _mm512_maskz_mov_epi64(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_mov_epi64(0b11111111, a);
+ assert_eq_m512i(r, a);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_mov_epi64() {
+ let src = _mm256_set1_epi64x(1);
+ let a = _mm256_set1_epi64x(2);
+ let r = _mm256_mask_mov_epi64(src, 0, a);
+ assert_eq_m256i(r, src);
+ let r = _mm256_mask_mov_epi64(src, 0b00001111, a);
+ assert_eq_m256i(r, a);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_mov_epi64() {
+ let a = _mm256_set1_epi64x(2);
+ let r = _mm256_maskz_mov_epi64(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_mov_epi64(0b00001111, a);
+ assert_eq_m256i(r, a);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_mov_epi64() {
+ let src = _mm_set1_epi64x(1);
+ let a = _mm_set1_epi64x(2);
+ let r = _mm_mask_mov_epi64(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_mov_epi64(src, 0b00000011, a);
+ assert_eq_m128i(r, a);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_mov_epi64() {
+ let a = _mm_set1_epi64x(2);
+ let r = _mm_maskz_mov_epi64(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_mov_epi64(0b00000011, a);
+ assert_eq_m128i(r, a);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_mov_pd() {
+ let src = _mm512_set1_pd(1.);
+ let a = _mm512_set1_pd(2.);
+ let r = _mm512_mask_mov_pd(src, 0, a);
+ assert_eq_m512d(r, src);
+ let r = _mm512_mask_mov_pd(src, 0b11111111, a);
+ assert_eq_m512d(r, a);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_mov_pd() {
+ let a = _mm512_set1_pd(2.);
+ let r = _mm512_maskz_mov_pd(0, a);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_mov_pd(0b11111111, a);
+ assert_eq_m512d(r, a);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_mov_pd() {
+ let src = _mm256_set1_pd(1.);
+ let a = _mm256_set1_pd(2.);
+ let r = _mm256_mask_mov_pd(src, 0, a);
+ assert_eq_m256d(r, src);
+ let r = _mm256_mask_mov_pd(src, 0b00001111, a);
+ assert_eq_m256d(r, a);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_mov_pd() {
+ let a = _mm256_set1_pd(2.);
+ let r = _mm256_maskz_mov_pd(0, a);
+ assert_eq_m256d(r, _mm256_setzero_pd());
+ let r = _mm256_maskz_mov_pd(0b00001111, a);
+ assert_eq_m256d(r, a);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_mov_pd() {
+ let src = _mm_set1_pd(1.);
+ let a = _mm_set1_pd(2.);
+ let r = _mm_mask_mov_pd(src, 0, a);
+ assert_eq_m128d(r, src);
+ let r = _mm_mask_mov_pd(src, 0b00000011, a);
+ assert_eq_m128d(r, a);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_mov_pd() {
+ let a = _mm_set1_pd(2.);
+ let r = _mm_maskz_mov_pd(0, a);
+ assert_eq_m128d(r, _mm_setzero_pd());
+ let r = _mm_maskz_mov_pd(0b00000011, a);
+ assert_eq_m128d(r, a);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_add_epi64() {
+ let a = _mm512_setr_epi64(0, 1, -1, i64::MAX, i64::MIN, 100, -100, -32);
+ let b = _mm512_set1_epi64(1);
+ let r = _mm512_add_epi64(a, b);
+ let e = _mm512_setr_epi64(1, 2, 0, i64::MIN, i64::MIN + 1, 101, -99, -31);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_add_epi64() {
+ let a = _mm512_setr_epi64(0, 1, -1, i64::MAX, i64::MIN, 100, -100, -32);
+ let b = _mm512_set1_epi64(1);
+ let r = _mm512_mask_add_epi64(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_add_epi64(a, 0b00001111, a, b);
+ let e = _mm512_setr_epi64(1, 2, 0, i64::MIN, i64::MIN, 100, -100, -32);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_add_epi64() {
+ let a = _mm512_setr_epi64(0, 1, -1, i64::MAX, i64::MIN, 100, -100, -32);
+ let b = _mm512_set1_epi64(1);
+ let r = _mm512_maskz_add_epi64(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_add_epi64(0b00001111, a, b);
+ let e = _mm512_setr_epi64(1, 2, 0, i64::MIN, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_add_epi64() {
+ let a = _mm256_set_epi64x(1, -1, i64::MAX, i64::MIN);
+ let b = _mm256_set1_epi64x(1);
+ let r = _mm256_mask_add_epi64(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_add_epi64(a, 0b00001111, a, b);
+ let e = _mm256_set_epi64x(2, 0, i64::MIN, i64::MIN + 1);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_add_epi64() {
+ let a = _mm256_set_epi64x(1, -1, i64::MAX, i64::MIN);
+ let b = _mm256_set1_epi64x(1);
+ let r = _mm256_maskz_add_epi64(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_add_epi64(0b00001111, a, b);
+ let e = _mm256_set_epi64x(2, 0, i64::MIN, i64::MIN + 1);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_add_epi64() {
+ let a = _mm_set_epi64x(i64::MAX, i64::MIN);
+ let b = _mm_set1_epi64x(1);
+ let r = _mm_mask_add_epi64(a, 0, a, b);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_add_epi64(a, 0b00000011, a, b);
+ let e = _mm_set_epi64x(i64::MIN, i64::MIN + 1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_add_epi64() {
+ let a = _mm_set_epi64x(i64::MAX, i64::MIN);
+ let b = _mm_set1_epi64x(1);
+ let r = _mm_maskz_add_epi64(0, a, b);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_add_epi64(0b00000011, a, b);
+ let e = _mm_set_epi64x(i64::MIN, i64::MIN + 1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_add_pd() {
+ let a = _mm512_setr_pd(0., 1., -1., f64::MAX, f64::MIN, 100., -100., -32.);
+ let b = _mm512_set1_pd(1.);
+ let r = _mm512_add_pd(a, b);
+ let e = _mm512_setr_pd(1., 2., 0., f64::MAX, f64::MIN + 1., 101., -99., -31.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_add_pd() {
+ let a = _mm512_setr_pd(0., 1., -1., f64::MAX, f64::MIN, 100., -100., -32.);
+ let b = _mm512_set1_pd(1.);
+ let r = _mm512_mask_add_pd(a, 0, a, b);
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_add_pd(a, 0b00001111, a, b);
+ let e = _mm512_setr_pd(1., 2., 0., f64::MAX, f64::MIN, 100., -100., -32.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_add_pd() {
+ let a = _mm512_setr_pd(0., 1., -1., f64::MAX, f64::MIN, 100., -100., -32.);
+ let b = _mm512_set1_pd(1.);
+ let r = _mm512_maskz_add_pd(0, a, b);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_add_pd(0b00001111, a, b);
+ let e = _mm512_setr_pd(1., 2., 0., f64::MAX, 0., 0., 0., 0.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_add_pd() {
+ let a = _mm256_set_pd(1., -1., f64::MAX, f64::MIN);
+ let b = _mm256_set1_pd(1.);
+ let r = _mm256_mask_add_pd(a, 0, a, b);
+ assert_eq_m256d(r, a);
+ let r = _mm256_mask_add_pd(a, 0b00001111, a, b);
+ let e = _mm256_set_pd(2., 0., f64::MAX, f64::MIN + 1.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_add_pd() {
+ let a = _mm256_set_pd(1., -1., f64::MAX, f64::MIN);
+ let b = _mm256_set1_pd(1.);
+ let r = _mm256_maskz_add_pd(0, a, b);
+ assert_eq_m256d(r, _mm256_setzero_pd());
+ let r = _mm256_maskz_add_pd(0b00001111, a, b);
+ let e = _mm256_set_pd(2., 0., f64::MAX, f64::MIN + 1.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_add_pd() {
+ let a = _mm_set_pd(f64::MAX, f64::MIN);
+ let b = _mm_set1_pd(1.);
+ let r = _mm_mask_add_pd(a, 0, a, b);
+ assert_eq_m128d(r, a);
+ let r = _mm_mask_add_pd(a, 0b00000011, a, b);
+ let e = _mm_set_pd(f64::MAX, f64::MIN + 1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_add_pd() {
+ let a = _mm_set_pd(f64::MAX, f64::MIN);
+ let b = _mm_set1_pd(1.);
+ let r = _mm_maskz_add_pd(0, a, b);
+ assert_eq_m128d(r, _mm_setzero_pd());
+ let r = _mm_maskz_add_pd(0b00000011, a, b);
+ let e = _mm_set_pd(f64::MAX, f64::MIN + 1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_sub_epi64() {
+ let a = _mm512_setr_epi64(0, 1, -1, i64::MAX, i64::MIN, 100, -100, -32);
+ let b = _mm512_set1_epi64(1);
+ let r = _mm512_sub_epi64(a, b);
+ let e = _mm512_setr_epi64(-1, 0, -2, i64::MAX - 1, i64::MAX, 99, -101, -33);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_sub_epi64() {
+ let a = _mm512_setr_epi64(0, 1, -1, i64::MAX, i64::MIN, 100, -100, -32);
+ let b = _mm512_set1_epi64(1);
+ let r = _mm512_mask_sub_epi64(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_sub_epi64(a, 0b00001111, a, b);
+ let e = _mm512_setr_epi64(-1, 0, -2, i64::MAX - 1, i64::MIN, 100, -100, -32);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_sub_epi64() {
+ let a = _mm512_setr_epi64(0, 1, -1, i64::MAX, i64::MIN, 100, -100, -32);
+ let b = _mm512_set1_epi64(1);
+ let r = _mm512_maskz_sub_epi64(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_sub_epi64(0b00001111, a, b);
+ let e = _mm512_setr_epi64(-1, 0, -2, i64::MAX - 1, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_sub_epi64() {
+ let a = _mm256_set_epi64x(1, -1, i64::MAX, i64::MIN);
+ let b = _mm256_set1_epi64x(1);
+ let r = _mm256_mask_sub_epi64(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_sub_epi64(a, 0b00001111, a, b);
+ let e = _mm256_set_epi64x(0, -2, i64::MAX - 1, i64::MAX);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_sub_epi64() {
+ let a = _mm256_set_epi64x(1, -1, i64::MAX, i64::MIN);
+ let b = _mm256_set1_epi64x(1);
+ let r = _mm256_maskz_sub_epi64(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_sub_epi64(0b00001111, a, b);
+ let e = _mm256_set_epi64x(0, -2, i64::MAX - 1, i64::MAX);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_sub_epi64() {
+ let a = _mm_set_epi64x(i64::MAX, i64::MIN);
+ let b = _mm_set1_epi64x(1);
+ let r = _mm_mask_sub_epi64(a, 0, a, b);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_sub_epi64(a, 0b00000011, a, b);
+ let e = _mm_set_epi64x(i64::MAX - 1, i64::MAX);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_sub_epi64() {
+ let a = _mm_set_epi64x(i64::MAX, i64::MIN);
+ let b = _mm_set1_epi64x(1);
+ let r = _mm_maskz_sub_epi64(0, a, b);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_sub_epi64(0b00000011, a, b);
+ let e = _mm_set_epi64x(i64::MAX - 1, i64::MAX);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_sub_pd() {
+ let a = _mm512_setr_pd(0., 1., -1., f64::MAX, f64::MIN, 100., -100., -32.);
+ let b = _mm512_set1_pd(1.);
+ let r = _mm512_sub_pd(a, b);
+ let e = _mm512_setr_pd(-1., 0., -2., f64::MAX - 1., f64::MIN, 99., -101., -33.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_sub_pd() {
+ let a = _mm512_setr_pd(0., 1., -1., f64::MAX, f64::MIN, 100., -100., -32.);
+ let b = _mm512_set1_pd(1.);
+ let r = _mm512_mask_sub_pd(a, 0, a, b);
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_sub_pd(a, 0b00001111, a, b);
+ let e = _mm512_setr_pd(-1., 0., -2., f64::MAX - 1., f64::MIN, 100., -100., -32.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_sub_pd() {
+ let a = _mm512_setr_pd(0., 1., -1., f64::MAX, f64::MIN, 100., -100., -32.);
+ let b = _mm512_set1_pd(1.);
+ let r = _mm512_maskz_sub_pd(0, a, b);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_sub_pd(0b00001111, a, b);
+ let e = _mm512_setr_pd(-1., 0., -2., f64::MAX - 1., 0., 0., 0., 0.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_sub_pd() {
+ let a = _mm256_set_pd(1., -1., f64::MAX, f64::MIN);
+ let b = _mm256_set1_pd(1.);
+ let r = _mm256_mask_sub_pd(a, 0, a, b);
+ assert_eq_m256d(r, a);
+ let r = _mm256_mask_sub_pd(a, 0b00001111, a, b);
+ let e = _mm256_set_pd(0., -2., f64::MAX - 1., f64::MIN);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_sub_pd() {
+ let a = _mm256_set_pd(1., -1., f64::MAX, f64::MIN);
+ let b = _mm256_set1_pd(1.);
+ let r = _mm256_maskz_sub_pd(0, a, b);
+ assert_eq_m256d(r, _mm256_setzero_pd());
+ let r = _mm256_maskz_sub_pd(0b00001111, a, b);
+ let e = _mm256_set_pd(0., -2., f64::MAX - 1., f64::MIN);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_sub_pd() {
+ let a = _mm_set_pd(f64::MAX, f64::MIN);
+ let b = _mm_set1_pd(1.);
+ let r = _mm_mask_sub_pd(a, 0, a, b);
+ assert_eq_m128d(r, a);
+ let r = _mm_mask_sub_pd(a, 0b00000011, a, b);
+ let e = _mm_set_pd(f64::MAX - 1., f64::MIN);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_sub_pd() {
+ let a = _mm_set_pd(f64::MAX, f64::MIN);
+ let b = _mm_set1_pd(1.);
+ let r = _mm_maskz_sub_pd(0, a, b);
+ assert_eq_m128d(r, _mm_setzero_pd());
+ let r = _mm_maskz_sub_pd(0b00000011, a, b);
+ let e = _mm_set_pd(f64::MAX - 1., f64::MIN);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mul_epi32() {
+ let a = _mm512_set1_epi32(1);
+ let b = _mm512_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let r = _mm512_mul_epi32(a, b);
+ let e = _mm512_set_epi64(15, 13, 11, 9, 7, 5, 3, 1);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_mul_epi32() {
+ let a = _mm512_set1_epi32(1);
+ let b = _mm512_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let r = _mm512_mask_mul_epi32(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_mul_epi32(a, 0b00001111, a, b);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi64(
+ 1 | 1 << 32, 1 | 1 << 32, 1 | 1 << 32, 1 | 1 << 32,
+ 7, 5, 3, 1,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_mul_epi32() {
+ let a = _mm512_set1_epi32(1);
+ let b = _mm512_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let r = _mm512_maskz_mul_epi32(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_mul_epi32(0b00001111, a, b);
+ let e = _mm512_set_epi64(0, 0, 0, 0, 7, 5, 3, 1);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_mul_epi32() {
+ let a = _mm256_set1_epi32(1);
+ let b = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8);
+ let r = _mm256_mask_mul_epi32(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_mul_epi32(a, 0b00001111, a, b);
+ let e = _mm256_set_epi64x(2, 4, 6, 8);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_mul_epi32() {
+ let a = _mm256_set1_epi32(1);
+ let b = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8);
+ let r = _mm256_maskz_mul_epi32(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_mul_epi32(0b00001111, a, b);
+ let e = _mm256_set_epi64x(2, 4, 6, 8);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_mul_epi32() {
+ let a = _mm_set1_epi32(1);
+ let b = _mm_set_epi32(1, 2, 3, 4);
+ let r = _mm_mask_mul_epi32(a, 0, a, b);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_mul_epi32(a, 0b00000011, a, b);
+ let e = _mm_set_epi64x(2, 4);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_mul_epi32() {
+ let a = _mm_set1_epi32(1);
+ let b = _mm_set_epi32(1, 2, 3, 4);
+ let r = _mm_maskz_mul_epi32(0, a, b);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_mul_epi32(0b00000011, a, b);
+ let e = _mm_set_epi64x(2, 4);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mul_epu32() {
+ let a = _mm512_set1_epi32(1);
+ let b = _mm512_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let r = _mm512_mul_epu32(a, b);
+ let e = _mm512_set_epi64(15, 13, 11, 9, 7, 5, 3, 1);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_mul_epu32() {
+ let a = _mm512_set1_epi32(1);
+ let b = _mm512_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let r = _mm512_mask_mul_epu32(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_mul_epu32(a, 0b00001111, a, b);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi64(
+ 1 | 1 << 32, 1 | 1 << 32, 1 | 1 << 32, 1 | 1 << 32,
+ 7, 5, 3, 1,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_mul_epu32() {
+ let a = _mm512_set1_epi32(1);
+ let b = _mm512_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ let r = _mm512_maskz_mul_epu32(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_mul_epu32(0b00001111, a, b);
+ let e = _mm512_set_epi64(0, 0, 0, 0, 7, 5, 3, 1);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_mul_epu32() {
+ let a = _mm256_set1_epi32(1);
+ let b = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8);
+ let r = _mm256_mask_mul_epu32(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_mul_epu32(a, 0b00001111, a, b);
+ let e = _mm256_set_epi64x(2, 4, 6, 8);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_mul_epu32() {
+ let a = _mm256_set1_epi32(1);
+ let b = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8);
+ let r = _mm256_maskz_mul_epu32(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_mul_epu32(0b00001111, a, b);
+ let e = _mm256_set_epi64x(2, 4, 6, 8);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_mul_epu32() {
+ let a = _mm_set1_epi32(1);
+ let b = _mm_set_epi32(1, 2, 3, 4);
+ let r = _mm_mask_mul_epu32(a, 0, a, b);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_mul_epu32(a, 0b00000011, a, b);
+ let e = _mm_set_epi64x(2, 4);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_mul_epu32() {
+ let a = _mm_set1_epi32(1);
+ let b = _mm_set_epi32(1, 2, 3, 4);
+ let r = _mm_maskz_mul_epu32(0, a, b);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_mul_epu32(0b00000011, a, b);
+ let e = _mm_set_epi64x(2, 4);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mullox_epi64() {
+ let a = _mm512_setr_epi64(0, 1, i64::MAX, i64::MIN, i64::MAX, 100, -100, -32);
+ let b = _mm512_set1_epi64(2);
+ let r = _mm512_mullox_epi64(a, b);
+ let e = _mm512_setr_epi64(0, 2, -2, 0, -2, 200, -200, -64);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_mullox_epi64() {
+ let a = _mm512_setr_epi64(0, 1, i64::MAX, i64::MIN, i64::MAX, 100, -100, -32);
+ let b = _mm512_set1_epi64(2);
+ let r = _mm512_mask_mullox_epi64(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_mullox_epi64(a, 0b00001111, a, b);
+ let e = _mm512_setr_epi64(0, 2, -2, 0, i64::MAX, 100, -100, -32);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mul_pd() {
+ let a = _mm512_setr_pd(0., 1., f64::MAX, f64::MIN, f64::MAX, f64::MIN, -100., -32.);
+ let b = _mm512_set1_pd(2.);
+ let r = _mm512_mul_pd(a, b);
+ #[rustfmt::skip]
+ let e = _mm512_setr_pd(
+ 0., 2., f64::INFINITY, f64::NEG_INFINITY,
+ f64::INFINITY, f64::NEG_INFINITY, -200., -64.,
+ );
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_mul_pd() {
+ let a = _mm512_setr_pd(0., 1., f64::MAX, f64::MIN, f64::MAX, f64::MIN, -100., -32.);
+ let b = _mm512_set1_pd(2.);
+ let r = _mm512_mask_mul_pd(a, 0, a, b);
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_mul_pd(a, 0b00001111, a, b);
+ #[rustfmt::skip]
+ let e = _mm512_setr_pd(
+ 0., 2., f64::INFINITY, f64::NEG_INFINITY,
+ f64::MAX, f64::MIN, -100., -32.,
+ );
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_mul_pd() {
+ let a = _mm512_setr_pd(0., 1., f64::MAX, f64::MIN, f64::MAX, f64::MIN, -100., -32.);
+ let b = _mm512_set1_pd(2.);
+ let r = _mm512_maskz_mul_pd(0, a, b);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_mul_pd(0b00001111, a, b);
+ let e = _mm512_setr_pd(0., 2., f64::INFINITY, f64::NEG_INFINITY, 0., 0., 0., 0.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_mul_pd() {
+ let a = _mm256_set_pd(0., 1., f64::MAX, f64::MIN);
+ let b = _mm256_set1_pd(2.);
+ let r = _mm256_mask_mul_pd(a, 0, a, b);
+ assert_eq_m256d(r, a);
+ let r = _mm256_mask_mul_pd(a, 0b00001111, a, b);
+ let e = _mm256_set_pd(0., 2., f64::INFINITY, f64::NEG_INFINITY);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_mul_pd() {
+ let a = _mm256_set_pd(0., 1., f64::MAX, f64::MIN);
+ let b = _mm256_set1_pd(2.);
+ let r = _mm256_maskz_mul_pd(0, a, b);
+ assert_eq_m256d(r, _mm256_setzero_pd());
+ let r = _mm256_maskz_mul_pd(0b00001111, a, b);
+ let e = _mm256_set_pd(0., 2., f64::INFINITY, f64::NEG_INFINITY);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_mul_pd() {
+ let a = _mm_set_pd(f64::MAX, f64::MIN);
+ let b = _mm_set1_pd(2.);
+ let r = _mm_mask_mul_pd(a, 0, a, b);
+ assert_eq_m128d(r, a);
+ let r = _mm_mask_mul_pd(a, 0b00000011, a, b);
+ let e = _mm_set_pd(f64::INFINITY, f64::NEG_INFINITY);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_mul_pd() {
+ let a = _mm_set_pd(f64::MAX, f64::MIN);
+ let b = _mm_set1_pd(2.);
+ let r = _mm_maskz_mul_pd(0, a, b);
+ assert_eq_m128d(r, _mm_setzero_pd());
+ let r = _mm_maskz_mul_pd(0b00000011, a, b);
+ let e = _mm_set_pd(f64::INFINITY, f64::NEG_INFINITY);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_div_pd() {
+ let a = _mm512_setr_pd(0., 1., f64::MAX, f64::MIN, f64::MAX, f64::MIN, -100., -32.);
+ let b = _mm512_setr_pd(2., 2., 0., 0., 0., 0., 2., 2.);
+ let r = _mm512_div_pd(a, b);
+ #[rustfmt::skip]
+ let e = _mm512_setr_pd(
+ 0., 0.5, f64::INFINITY, f64::NEG_INFINITY,
+ f64::INFINITY, f64::NEG_INFINITY, -50., -16.,
+ );
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_div_pd() {
+ let a = _mm512_setr_pd(0., 1., f64::MAX, f64::MIN, f64::MAX, f64::MIN, -100., -32.);
+ let b = _mm512_setr_pd(2., 2., 0., 0., 0., 0., 2., 2.);
+ let r = _mm512_mask_div_pd(a, 0, a, b);
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_div_pd(a, 0b00001111, a, b);
+ #[rustfmt::skip]
+ let e = _mm512_setr_pd(
+ 0., 0.5, f64::INFINITY, f64::NEG_INFINITY,
+ f64::MAX, f64::MIN, -100., -32.,
+ );
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_div_pd() {
+ let a = _mm512_setr_pd(0., 1., f64::MAX, f64::MIN, f64::MAX, f64::MIN, -100., -32.);
+ let b = _mm512_setr_pd(2., 2., 0., 0., 0., 0., 2., 2.);
+ let r = _mm512_maskz_div_pd(0, a, b);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_div_pd(0b00001111, a, b);
+ let e = _mm512_setr_pd(0., 0.5, f64::INFINITY, f64::NEG_INFINITY, 0., 0., 0., 0.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_div_pd() {
+ let a = _mm256_set_pd(0., 1., f64::MAX, f64::MIN);
+ let b = _mm256_set_pd(2., 2., 0., 0.);
+ let r = _mm256_mask_div_pd(a, 0, a, b);
+ assert_eq_m256d(r, a);
+ let r = _mm256_mask_div_pd(a, 0b00001111, a, b);
+ let e = _mm256_set_pd(0., 0.5, f64::INFINITY, f64::NEG_INFINITY);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_div_pd() {
+ let a = _mm256_set_pd(0., 1., f64::MAX, f64::MIN);
+ let b = _mm256_set_pd(2., 2., 0., 0.);
+ let r = _mm256_maskz_div_pd(0, a, b);
+ assert_eq_m256d(r, _mm256_setzero_pd());
+ let r = _mm256_maskz_div_pd(0b00001111, a, b);
+ let e = _mm256_set_pd(0., 0.5, f64::INFINITY, f64::NEG_INFINITY);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_div_pd() {
+ let a = _mm_set_pd(f64::MAX, f64::MIN);
+ let b = _mm_set_pd(0., 0.);
+ let r = _mm_mask_div_pd(a, 0, a, b);
+ assert_eq_m128d(r, a);
+ let r = _mm_mask_div_pd(a, 0b00000011, a, b);
+ let e = _mm_set_pd(f64::INFINITY, f64::NEG_INFINITY);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_div_pd() {
+ let a = _mm_set_pd(f64::MAX, f64::MIN);
+ let b = _mm_set_pd(0., 0.);
+ let r = _mm_maskz_div_pd(0, a, b);
+ assert_eq_m128d(r, _mm_setzero_pd());
+ let r = _mm_maskz_div_pd(0b00000011, a, b);
+ let e = _mm_set_pd(f64::INFINITY, f64::NEG_INFINITY);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_max_epi64() {
+ let a = _mm512_setr_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ let b = _mm512_setr_epi64(7, 6, 5, 4, 3, 2, 1, 0);
+ let r = _mm512_max_epi64(a, b);
+ let e = _mm512_setr_epi64(7, 6, 5, 4, 4, 5, 6, 7);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_max_epi64() {
+ let a = _mm512_setr_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ let b = _mm512_setr_epi64(7, 6, 5, 4, 3, 2, 1, 0);
+ let r = _mm512_mask_max_epi64(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_max_epi64(a, 0b00001111, a, b);
+ let e = _mm512_setr_epi64(7, 6, 5, 4, 4, 5, 6, 7);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_max_epi64() {
+ let a = _mm512_setr_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ let b = _mm512_setr_epi64(7, 6, 5, 4, 3, 2, 1, 0);
+ let r = _mm512_maskz_max_epi64(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_max_epi64(0b00001111, a, b);
+ let e = _mm512_setr_epi64(7, 6, 5, 4, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_max_epi64() {
+ let a = _mm256_set_epi64x(0, 1, 2, 3);
+ let b = _mm256_set_epi64x(3, 2, 1, 0);
+ let r = _mm256_max_epi64(a, b);
+ let e = _mm256_set_epi64x(3, 2, 2, 3);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_max_epi64() {
+ let a = _mm256_set_epi64x(0, 1, 2, 3);
+ let b = _mm256_set_epi64x(3, 2, 1, 0);
+ let r = _mm256_mask_max_epi64(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_max_epi64(a, 0b00001111, a, b);
+ let e = _mm256_set_epi64x(3, 2, 2, 3);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_max_epi64() {
+ let a = _mm256_set_epi64x(0, 1, 2, 3);
+ let b = _mm256_set_epi64x(3, 2, 1, 0);
+ let r = _mm256_maskz_max_epi64(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_max_epi64(0b00001111, a, b);
+ let e = _mm256_set_epi64x(3, 2, 2, 3);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_max_epi64() {
+ let a = _mm_set_epi64x(2, 3);
+ let b = _mm_set_epi64x(3, 2);
+ let r = _mm_max_epi64(a, b);
+ let e = _mm_set_epi64x(3, 3);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_max_epi64() {
+ let a = _mm_set_epi64x(2, 3);
+ let b = _mm_set_epi64x(3, 2);
+ let r = _mm_mask_max_epi64(a, 0, a, b);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_max_epi64(a, 0b00000011, a, b);
+ let e = _mm_set_epi64x(3, 3);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_max_epi64() {
+ let a = _mm_set_epi64x(2, 3);
+ let b = _mm_set_epi64x(3, 2);
+ let r = _mm_maskz_max_epi64(0, a, b);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_max_epi64(0b00000011, a, b);
+ let e = _mm_set_epi64x(3, 3);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_max_pd() {
+ let a = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let b = _mm512_setr_pd(7., 6., 5., 4., 3., 2., 1., 0.);
+ let r = _mm512_max_pd(a, b);
+ let e = _mm512_setr_pd(7., 6., 5., 4., 4., 5., 6., 7.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_max_pd() {
+ let a = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let b = _mm512_setr_pd(7., 6., 5., 4., 3., 2., 1., 0.);
+ let r = _mm512_mask_max_pd(a, 0, a, b);
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_max_pd(a, 0b00001111, a, b);
+ let e = _mm512_setr_pd(7., 6., 5., 4., 4., 5., 6., 7.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_max_pd() {
+ let a = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let b = _mm512_setr_pd(7., 6., 5., 4., 3., 2., 1., 0.);
+ let r = _mm512_maskz_max_pd(0, a, b);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_max_pd(0b00001111, a, b);
+ let e = _mm512_setr_pd(7., 6., 5., 4., 0., 0., 0., 0.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_max_pd() {
+ let a = _mm256_set_pd(0., 1., 2., 3.);
+ let b = _mm256_set_pd(3., 2., 1., 0.);
+ let r = _mm256_mask_max_pd(a, 0, a, b);
+ assert_eq_m256d(r, a);
+ let r = _mm256_mask_max_pd(a, 0b00001111, a, b);
+ let e = _mm256_set_pd(3., 2., 2., 3.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_max_pd() {
+ let a = _mm256_set_pd(0., 1., 2., 3.);
+ let b = _mm256_set_pd(3., 2., 1., 0.);
+ let r = _mm256_maskz_max_pd(0, a, b);
+ assert_eq_m256d(r, _mm256_setzero_pd());
+ let r = _mm256_maskz_max_pd(0b00001111, a, b);
+ let e = _mm256_set_pd(3., 2., 2., 3.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_max_pd() {
+ let a = _mm_set_pd(2., 3.);
+ let b = _mm_set_pd(3., 2.);
+ let r = _mm_mask_max_pd(a, 0, a, b);
+ assert_eq_m128d(r, a);
+ let r = _mm_mask_max_pd(a, 0b00000011, a, b);
+ let e = _mm_set_pd(3., 3.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_max_pd() {
+ let a = _mm_set_pd(2., 3.);
+ let b = _mm_set_pd(3., 2.);
+ let r = _mm_maskz_max_pd(0, a, b);
+ assert_eq_m128d(r, _mm_setzero_pd());
+ let r = _mm_maskz_max_pd(0b00000011, a, b);
+ let e = _mm_set_pd(3., 3.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_max_epu64() {
+ let a = _mm512_setr_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ let b = _mm512_setr_epi64(7, 6, 5, 4, 3, 2, 1, 0);
+ let r = _mm512_max_epu64(a, b);
+ let e = _mm512_setr_epi64(7, 6, 5, 4, 4, 5, 6, 7);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_max_epu64() {
+ let a = _mm512_setr_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ let b = _mm512_setr_epi64(7, 6, 5, 4, 3, 2, 1, 0);
+ let r = _mm512_mask_max_epu64(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_max_epu64(a, 0b00001111, a, b);
+ let e = _mm512_setr_epi64(7, 6, 5, 4, 4, 5, 6, 7);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_max_epu64() {
+ let a = _mm512_setr_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ let b = _mm512_setr_epi64(7, 6, 5, 4, 3, 2, 1, 0);
+ let r = _mm512_maskz_max_epu64(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_max_epu64(0b00001111, a, b);
+ let e = _mm512_setr_epi64(7, 6, 5, 4, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_max_epu64() {
+ let a = _mm256_set_epi64x(0, 1, 2, 3);
+ let b = _mm256_set_epi64x(3, 2, 1, 0);
+ let r = _mm256_max_epu64(a, b);
+ let e = _mm256_set_epi64x(3, 2, 2, 3);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_max_epu64() {
+ let a = _mm256_set_epi64x(0, 1, 2, 3);
+ let b = _mm256_set_epi64x(3, 2, 1, 0);
+ let r = _mm256_mask_max_epu64(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_max_epu64(a, 0b00001111, a, b);
+ let e = _mm256_set_epi64x(3, 2, 2, 3);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_max_epu64() {
+ let a = _mm256_set_epi64x(0, 1, 2, 3);
+ let b = _mm256_set_epi64x(3, 2, 1, 0);
+ let r = _mm256_maskz_max_epu64(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_max_epu64(0b00001111, a, b);
+ let e = _mm256_set_epi64x(3, 2, 2, 3);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_max_epu64() {
+ let a = _mm_set_epi64x(2, 3);
+ let b = _mm_set_epi64x(3, 2);
+ let r = _mm_max_epu64(a, b);
+ let e = _mm_set_epi64x(3, 3);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_max_epu64() {
+ let a = _mm_set_epi64x(2, 3);
+ let b = _mm_set_epi64x(3, 2);
+ let r = _mm_mask_max_epu64(a, 0, a, b);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_max_epu64(a, 0b00000011, a, b);
+ let e = _mm_set_epi64x(3, 3);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_max_epu64() {
+ let a = _mm_set_epi64x(2, 3);
+ let b = _mm_set_epi64x(3, 2);
+ let r = _mm_maskz_max_epu64(0, a, b);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_max_epu64(0b00000011, a, b);
+ let e = _mm_set_epi64x(3, 3);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_min_epi64() {
+ let a = _mm512_setr_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ let b = _mm512_setr_epi64(7, 6, 5, 4, 3, 2, 1, 0);
+ let r = _mm512_min_epi64(a, b);
+ let e = _mm512_setr_epi64(0, 1, 2, 3, 3, 2, 1, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_min_epi64() {
+ let a = _mm512_setr_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ let b = _mm512_setr_epi64(7, 6, 5, 4, 3, 2, 1, 0);
+ let r = _mm512_mask_min_epi64(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_min_epi64(a, 0b00001111, a, b);
+ let e = _mm512_setr_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_min_epi64() {
+ let a = _mm512_setr_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ let b = _mm512_setr_epi64(7, 6, 5, 4, 3, 2, 1, 0);
+ let r = _mm512_maskz_min_epi64(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_min_epi64(0b00001111, a, b);
+ let e = _mm512_setr_epi64(0, 1, 2, 3, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_min_epi64() {
+ let a = _mm256_set_epi64x(0, 1, 2, 3);
+ let b = _mm256_set_epi64x(3, 2, 1, 0);
+ let r = _mm256_min_epi64(a, b);
+ let e = _mm256_set_epi64x(0, 1, 1, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_min_epi64() {
+ let a = _mm256_set_epi64x(0, 1, 2, 3);
+ let b = _mm256_set_epi64x(3, 2, 1, 0);
+ let r = _mm256_mask_min_epi64(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_min_epi64(a, 0b00001111, a, b);
+ let e = _mm256_set_epi64x(0, 1, 1, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_min_epi64() {
+ let a = _mm256_set_epi64x(0, 1, 2, 3);
+ let b = _mm256_set_epi64x(3, 2, 1, 0);
+ let r = _mm256_maskz_min_epi64(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_min_epi64(0b00001111, a, b);
+ let e = _mm256_set_epi64x(0, 1, 1, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_min_pd() {
+ let a = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let b = _mm512_setr_pd(7., 6., 5., 4., 3., 2., 1., 0.);
+ let r = _mm512_min_pd(a, b);
+ let e = _mm512_setr_pd(0., 1., 2., 3., 3., 2., 1., 0.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_min_pd() {
+ let a = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let b = _mm512_setr_pd(7., 6., 5., 4., 3., 2., 1., 0.);
+ let r = _mm512_mask_min_pd(a, 0, a, b);
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_min_pd(a, 0b00001111, a, b);
+ let e = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_min_pd() {
+ let a = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let b = _mm512_setr_pd(7., 6., 5., 4., 3., 2., 1., 0.);
+ let r = _mm512_maskz_min_pd(0, a, b);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_min_pd(0b00001111, a, b);
+ let e = _mm512_setr_pd(0., 1., 2., 3., 0., 0., 0., 0.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_min_pd() {
+ let a = _mm256_set_pd(0., 1., 2., 3.);
+ let b = _mm256_set_pd(3., 2., 1., 0.);
+ let r = _mm256_mask_min_pd(a, 0, a, b);
+ assert_eq_m256d(r, a);
+ let r = _mm256_mask_min_pd(a, 0b00001111, a, b);
+ let e = _mm256_set_pd(0., 1., 1., 0.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_min_pd() {
+ let a = _mm256_set_pd(0., 1., 2., 3.);
+ let b = _mm256_set_pd(3., 2., 1., 0.);
+ let r = _mm256_maskz_min_pd(0, a, b);
+ assert_eq_m256d(r, _mm256_setzero_pd());
+ let r = _mm256_maskz_min_pd(0b00001111, a, b);
+ let e = _mm256_set_pd(0., 1., 1., 0.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_min_pd() {
+ let a = _mm_set_pd(0., 1.);
+ let b = _mm_set_pd(1., 0.);
+ let r = _mm_mask_min_pd(a, 0, a, b);
+ assert_eq_m128d(r, a);
+ let r = _mm_mask_min_pd(a, 0b00000011, a, b);
+ let e = _mm_set_pd(0., 0.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_min_pd() {
+ let a = _mm_set_pd(0., 1.);
+ let b = _mm_set_pd(1., 0.);
+ let r = _mm_maskz_min_pd(0, a, b);
+ assert_eq_m128d(r, _mm_setzero_pd());
+ let r = _mm_maskz_min_pd(0b00000011, a, b);
+ let e = _mm_set_pd(0., 0.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_min_epu64() {
+ let a = _mm512_setr_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ let b = _mm512_setr_epi64(7, 6, 5, 4, 3, 2, 1, 0);
+ let r = _mm512_min_epu64(a, b);
+ let e = _mm512_setr_epi64(0, 1, 2, 3, 3, 2, 1, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_min_epu64() {
+ let a = _mm512_setr_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ let b = _mm512_setr_epi64(7, 6, 5, 4, 3, 2, 1, 0);
+ let r = _mm512_mask_min_epu64(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_min_epu64(a, 0b00001111, a, b);
+ let e = _mm512_setr_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_min_epu64() {
+ let a = _mm512_setr_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ let b = _mm512_setr_epi64(7, 6, 5, 4, 3, 2, 1, 0);
+ let r = _mm512_maskz_min_epu64(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_min_epu64(0b00001111, a, b);
+ let e = _mm512_setr_epi64(0, 1, 2, 3, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_min_epu64() {
+ let a = _mm256_set_epi64x(0, 1, 2, 3);
+ let b = _mm256_set_epi64x(3, 2, 1, 0);
+ let r = _mm256_min_epu64(a, b);
+ let e = _mm256_set_epi64x(0, 1, 1, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_min_epu64() {
+ let a = _mm256_set_epi64x(0, 1, 2, 3);
+ let b = _mm256_set_epi64x(3, 2, 1, 0);
+ let r = _mm256_mask_min_epu64(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_min_epu64(a, 0b00001111, a, b);
+ let e = _mm256_set_epi64x(0, 1, 1, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_min_epu64() {
+ let a = _mm256_set_epi64x(0, 1, 2, 3);
+ let b = _mm256_set_epi64x(3, 2, 1, 0);
+ let r = _mm256_maskz_min_epu64(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_min_epu64(0b00001111, a, b);
+ let e = _mm256_set_epi64x(0, 1, 1, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_min_epu64() {
+ let a = _mm_set_epi64x(0, 1);
+ let b = _mm_set_epi64x(1, 0);
+ let r = _mm_min_epu64(a, b);
+ let e = _mm_set_epi64x(0, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_min_epu64() {
+ let a = _mm_set_epi64x(0, 1);
+ let b = _mm_set_epi64x(1, 0);
+ let r = _mm_mask_min_epu64(a, 0, a, b);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_min_epu64(a, 0b00000011, a, b);
+ let e = _mm_set_epi64x(0, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_min_epu64() {
+ let a = _mm_set_epi64x(0, 1);
+ let b = _mm_set_epi64x(1, 0);
+ let r = _mm_maskz_min_epu64(0, a, b);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_min_epu64(0b00000011, a, b);
+ let e = _mm_set_epi64x(0, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_sqrt_pd() {
+ let a = _mm512_setr_pd(0., 1., 4., 9., 16., 25., 36., 49.);
+ let r = _mm512_sqrt_pd(a);
+ let e = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_sqrt_pd() {
+ let a = _mm512_setr_pd(0., 1., 4., 9., 16., 25., 36., 49.);
+ let r = _mm512_mask_sqrt_pd(a, 0, a);
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_sqrt_pd(a, 0b00001111, a);
+ let e = _mm512_setr_pd(0., 1., 2., 3., 16., 25., 36., 49.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_sqrt_pd() {
+ let a = _mm512_setr_pd(0., 1., 4., 9., 16., 25., 36., 49.);
+ let r = _mm512_maskz_sqrt_pd(0, a);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_sqrt_pd(0b00001111, a);
+ let e = _mm512_setr_pd(0., 1., 2., 3., 0., 0., 0., 0.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_sqrt_pd() {
+ let a = _mm256_set_pd(0., 1., 4., 9.);
+ let r = _mm256_mask_sqrt_pd(a, 0, a);
+ assert_eq_m256d(r, a);
+ let r = _mm256_mask_sqrt_pd(a, 0b00001111, a);
+ let e = _mm256_set_pd(0., 1., 2., 3.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_sqrt_pd() {
+ let a = _mm256_set_pd(0., 1., 4., 9.);
+ let r = _mm256_maskz_sqrt_pd(0, a);
+ assert_eq_m256d(r, _mm256_setzero_pd());
+ let r = _mm256_maskz_sqrt_pd(0b00001111, a);
+ let e = _mm256_set_pd(0., 1., 2., 3.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_sqrt_pd() {
+ let a = _mm_set_pd(0., 1.);
+ let r = _mm_mask_sqrt_pd(a, 0, a);
+ assert_eq_m128d(r, a);
+ let r = _mm_mask_sqrt_pd(a, 0b00000011, a);
+ let e = _mm_set_pd(0., 1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_sqrt_pd() {
+ let a = _mm_set_pd(0., 1.);
+ let r = _mm_maskz_sqrt_pd(0, a);
+ assert_eq_m128d(r, _mm_setzero_pd());
+ let r = _mm_maskz_sqrt_pd(0b00000011, a);
+ let e = _mm_set_pd(0., 1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_fmadd_pd() {
+ let a = _mm512_setr_pd(1., 1., 1., 1., 1., 1., 1., 1.);
+ let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let c = _mm512_setr_pd(1., 1., 1., 1., 1., 1., 1., 1.);
+ let r = _mm512_fmadd_pd(a, b, c);
+ let e = _mm512_setr_pd(1., 2., 3., 4., 5., 6., 7., 8.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_fmadd_pd() {
+ let a = _mm512_setr_pd(1., 1., 1., 1., 1., 1., 1., 1.);
+ let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let c = _mm512_setr_pd(1., 1., 1., 1., 1., 1., 1., 1.);
+ let r = _mm512_mask_fmadd_pd(a, 0, b, c);
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_fmadd_pd(a, 0b00001111, b, c);
+ let e = _mm512_setr_pd(1., 2., 3., 4., 1., 1., 1., 1.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_fmadd_pd() {
+ let a = _mm512_setr_pd(1., 1., 1., 1., 1., 1., 1., 1.);
+ let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let c = _mm512_setr_pd(1., 1., 1., 1., 1., 1., 1., 1.);
+ let r = _mm512_maskz_fmadd_pd(0, a, b, c);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_fmadd_pd(0b00001111, a, b, c);
+ let e = _mm512_setr_pd(1., 2., 3., 4., 0., 0., 0., 0.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask3_fmadd_pd() {
+ let a = _mm512_setr_pd(1., 1., 1., 1., 1., 1., 1., 1.);
+ let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let c = _mm512_setr_pd(1., 1., 1., 1., 2., 2., 2., 2.);
+ let r = _mm512_mask3_fmadd_pd(a, b, c, 0);
+ assert_eq_m512d(r, c);
+ let r = _mm512_mask3_fmadd_pd(a, b, c, 0b00001111);
+ let e = _mm512_setr_pd(1., 2., 3., 4., 2., 2., 2., 2.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_fmadd_pd() {
+ let a = _mm256_set1_pd(1.);
+ let b = _mm256_set_pd(0., 1., 2., 3.);
+ let c = _mm256_set1_pd(1.);
+ let r = _mm256_mask_fmadd_pd(a, 0, b, c);
+ assert_eq_m256d(r, a);
+ let r = _mm256_mask_fmadd_pd(a, 0b00001111, b, c);
+ let e = _mm256_set_pd(1., 2., 3., 4.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_fmadd_pd() {
+ let a = _mm256_set1_pd(1.);
+ let b = _mm256_set_pd(0., 1., 2., 3.);
+ let c = _mm256_set1_pd(1.);
+ let r = _mm256_maskz_fmadd_pd(0, a, b, c);
+ assert_eq_m256d(r, _mm256_setzero_pd());
+ let r = _mm256_maskz_fmadd_pd(0b00001111, a, b, c);
+ let e = _mm256_set_pd(1., 2., 3., 4.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask3_fmadd_pd() {
+ let a = _mm256_set1_pd(1.);
+ let b = _mm256_set_pd(0., 1., 2., 3.);
+ let c = _mm256_set1_pd(1.);
+ let r = _mm256_mask3_fmadd_pd(a, b, c, 0);
+ assert_eq_m256d(r, c);
+ let r = _mm256_mask3_fmadd_pd(a, b, c, 0b00001111);
+ let e = _mm256_set_pd(1., 2., 3., 4.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_fmadd_pd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set_pd(0., 1.);
+ let c = _mm_set1_pd(1.);
+ let r = _mm_mask_fmadd_pd(a, 0, b, c);
+ assert_eq_m128d(r, a);
+ let r = _mm_mask_fmadd_pd(a, 0b00000011, b, c);
+ let e = _mm_set_pd(1., 2.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_fmadd_pd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set_pd(0., 1.);
+ let c = _mm_set1_pd(1.);
+ let r = _mm_maskz_fmadd_pd(0, a, b, c);
+ assert_eq_m128d(r, _mm_setzero_pd());
+ let r = _mm_maskz_fmadd_pd(0b00000011, a, b, c);
+ let e = _mm_set_pd(1., 2.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask3_fmadd_pd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set_pd(0., 1.);
+ let c = _mm_set1_pd(1.);
+ let r = _mm_mask3_fmadd_pd(a, b, c, 0);
+ assert_eq_m128d(r, c);
+ let r = _mm_mask3_fmadd_pd(a, b, c, 0b00000011);
+ let e = _mm_set_pd(1., 2.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_fmsub_pd() {
+ let a = _mm512_set1_pd(1.);
+ let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let c = _mm512_set1_pd(1.);
+ let r = _mm512_fmsub_pd(a, b, c);
+ let e = _mm512_setr_pd(-1., 0., 1., 2., 3., 4., 5., 6.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_fmsub_pd() {
+ let a = _mm512_set1_pd(1.);
+ let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let c = _mm512_set1_pd(1.);
+ let r = _mm512_mask_fmsub_pd(a, 0, b, c);
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_fmsub_pd(a, 0b00001111, b, c);
+ let e = _mm512_setr_pd(-1., 0., 1., 2., 1., 1., 1., 1.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_fmsub_pd() {
+ let a = _mm512_set1_pd(1.);
+ let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let c = _mm512_set1_pd(1.);
+ let r = _mm512_maskz_fmsub_pd(0, a, b, c);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_fmsub_pd(0b00001111, a, b, c);
+ let e = _mm512_setr_pd(-1., 0., 1., 2., 0., 0., 0., 0.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask3_fmsub_pd() {
+ let a = _mm512_set1_pd(1.);
+ let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let c = _mm512_setr_pd(1., 1., 1., 1., 2., 2., 2., 2.);
+ let r = _mm512_mask3_fmsub_pd(a, b, c, 0);
+ assert_eq_m512d(r, c);
+ let r = _mm512_mask3_fmsub_pd(a, b, c, 0b00001111);
+ let e = _mm512_setr_pd(-1., 0., 1., 2., 2., 2., 2., 2.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_fmsub_pd() {
+ let a = _mm256_set1_pd(1.);
+ let b = _mm256_set_pd(0., 1., 2., 3.);
+ let c = _mm256_set1_pd(1.);
+ let r = _mm256_mask_fmsub_pd(a, 0, b, c);
+ assert_eq_m256d(r, a);
+ let r = _mm256_mask_fmsub_pd(a, 0b00001111, b, c);
+ let e = _mm256_set_pd(-1., 0., 1., 2.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_fmsub_pd() {
+ let a = _mm256_set1_pd(1.);
+ let b = _mm256_set_pd(0., 1., 2., 3.);
+ let c = _mm256_set1_pd(1.);
+ let r = _mm256_maskz_fmsub_pd(0, a, b, c);
+ assert_eq_m256d(r, _mm256_setzero_pd());
+ let r = _mm256_maskz_fmsub_pd(0b00001111, a, b, c);
+ let e = _mm256_set_pd(-1., 0., 1., 2.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask3_fmsub_pd() {
+ let a = _mm256_set1_pd(1.);
+ let b = _mm256_set_pd(0., 1., 2., 3.);
+ let c = _mm256_set1_pd(1.);
+ let r = _mm256_mask3_fmsub_pd(a, b, c, 0);
+ assert_eq_m256d(r, c);
+ let r = _mm256_mask3_fmsub_pd(a, b, c, 0b00001111);
+ let e = _mm256_set_pd(-1., 0., 1., 2.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_fmsub_pd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set_pd(0., 1.);
+ let c = _mm_set1_pd(1.);
+ let r = _mm_mask_fmsub_pd(a, 0, b, c);
+ assert_eq_m128d(r, a);
+ let r = _mm_mask_fmsub_pd(a, 0b00000011, b, c);
+ let e = _mm_set_pd(-1., 0.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_fmsub_pd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set_pd(0., 1.);
+ let c = _mm_set1_pd(1.);
+ let r = _mm_maskz_fmsub_pd(0, a, b, c);
+ assert_eq_m128d(r, _mm_setzero_pd());
+ let r = _mm_maskz_fmsub_pd(0b00000011, a, b, c);
+ let e = _mm_set_pd(-1., 0.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask3_fmsub_pd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set_pd(0., 1.);
+ let c = _mm_set1_pd(1.);
+ let r = _mm_mask3_fmsub_pd(a, b, c, 0);
+ assert_eq_m128d(r, c);
+ let r = _mm_mask3_fmsub_pd(a, b, c, 0b00000011);
+ let e = _mm_set_pd(-1., 0.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_fmaddsub_pd() {
+ let a = _mm512_set1_pd(1.);
+ let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let c = _mm512_set1_pd(1.);
+ let r = _mm512_fmaddsub_pd(a, b, c);
+ let e = _mm512_setr_pd(-1., 2., 1., 4., 3., 6., 5., 8.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_fmaddsub_pd() {
+ let a = _mm512_set1_pd(1.);
+ let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let c = _mm512_set1_pd(1.);
+ let r = _mm512_mask_fmaddsub_pd(a, 0, b, c);
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_fmaddsub_pd(a, 0b00001111, b, c);
+ let e = _mm512_setr_pd(-1., 2., 1., 4., 1., 1., 1., 1.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_fmaddsub_pd() {
+ let a = _mm512_set1_pd(1.);
+ let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let c = _mm512_set1_pd(1.);
+ let r = _mm512_maskz_fmaddsub_pd(0, a, b, c);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_fmaddsub_pd(0b00001111, a, b, c);
+ let e = _mm512_setr_pd(-1., 2., 1., 4., 0., 0., 0., 0.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask3_fmaddsub_pd() {
+ let a = _mm512_set1_pd(1.);
+ let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let c = _mm512_setr_pd(1., 1., 1., 1., 2., 2., 2., 2.);
+ let r = _mm512_mask3_fmaddsub_pd(a, b, c, 0);
+ assert_eq_m512d(r, c);
+ let r = _mm512_mask3_fmaddsub_pd(a, b, c, 0b00001111);
+ let e = _mm512_setr_pd(-1., 2., 1., 4., 2., 2., 2., 2.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_fmaddsub_pd() {
+ let a = _mm256_set1_pd(1.);
+ let b = _mm256_set_pd(0., 1., 2., 3.);
+ let c = _mm256_set1_pd(1.);
+ let r = _mm256_mask_fmaddsub_pd(a, 0, b, c);
+ assert_eq_m256d(r, a);
+ let r = _mm256_mask_fmaddsub_pd(a, 0b00001111, b, c);
+ let e = _mm256_set_pd(1., 0., 3., 2.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_fmaddsub_pd() {
+ let a = _mm256_set1_pd(1.);
+ let b = _mm256_set_pd(0., 1., 2., 3.);
+ let c = _mm256_set1_pd(1.);
+ let r = _mm256_maskz_fmaddsub_pd(0, a, b, c);
+ assert_eq_m256d(r, _mm256_setzero_pd());
+ let r = _mm256_maskz_fmaddsub_pd(0b00001111, a, b, c);
+ let e = _mm256_set_pd(1., 0., 3., 2.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask3_fmaddsub_pd() {
+ let a = _mm256_set1_pd(1.);
+ let b = _mm256_set_pd(0., 1., 2., 3.);
+ let c = _mm256_set1_pd(1.);
+ let r = _mm256_mask3_fmaddsub_pd(a, b, c, 0);
+ assert_eq_m256d(r, c);
+ let r = _mm256_mask3_fmaddsub_pd(a, b, c, 0b00001111);
+ let e = _mm256_set_pd(1., 0., 3., 2.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_fmaddsub_pd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set_pd(0., 1.);
+ let c = _mm_set1_pd(1.);
+ let r = _mm_mask_fmaddsub_pd(a, 0, b, c);
+ assert_eq_m128d(r, a);
+ let r = _mm_mask_fmaddsub_pd(a, 0b00000011, b, c);
+ let e = _mm_set_pd(1., 0.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_fmaddsub_pd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set_pd(0., 1.);
+ let c = _mm_set1_pd(1.);
+ let r = _mm_maskz_fmaddsub_pd(0, a, b, c);
+ assert_eq_m128d(r, _mm_setzero_pd());
+ let r = _mm_maskz_fmaddsub_pd(0b00000011, a, b, c);
+ let e = _mm_set_pd(1., 0.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask3_fmaddsub_pd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set_pd(0., 1.);
+ let c = _mm_set1_pd(1.);
+ let r = _mm_mask3_fmaddsub_pd(a, b, c, 0);
+ assert_eq_m128d(r, c);
+ let r = _mm_mask3_fmaddsub_pd(a, b, c, 0b00000011);
+ let e = _mm_set_pd(1., 0.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_fmsubadd_pd() {
+ let a = _mm512_set1_pd(1.);
+ let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let c = _mm512_set1_pd(1.);
+ let r = _mm512_fmsubadd_pd(a, b, c);
+ let e = _mm512_setr_pd(1., 0., 3., 2., 5., 4., 7., 6.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_fmsubadd_pd() {
+ let a = _mm512_set1_pd(1.);
+ let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let c = _mm512_set1_pd(1.);
+ let r = _mm512_mask_fmsubadd_pd(a, 0, b, c);
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_fmsubadd_pd(a, 0b00001111, b, c);
+ let e = _mm512_setr_pd(1., 0., 3., 2., 1., 1., 1., 1.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_fmsubadd_pd() {
+ let a = _mm512_set1_pd(1.);
+ let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let c = _mm512_set1_pd(1.);
+ let r = _mm512_maskz_fmsubadd_pd(0, a, b, c);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_fmsubadd_pd(0b00001111, a, b, c);
+ let e = _mm512_setr_pd(1., 0., 3., 2., 0., 0., 0., 0.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask3_fmsubadd_pd() {
+ let a = _mm512_set1_pd(1.);
+ let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let c = _mm512_setr_pd(1., 1., 1., 1., 2., 2., 2., 2.);
+ let r = _mm512_mask3_fmsubadd_pd(a, b, c, 0);
+ assert_eq_m512d(r, c);
+ let r = _mm512_mask3_fmsubadd_pd(a, b, c, 0b00001111);
+ let e = _mm512_setr_pd(1., 0., 3., 2., 2., 2., 2., 2.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_fmsubadd_pd() {
+ let a = _mm256_set1_pd(1.);
+ let b = _mm256_set_pd(0., 1., 2., 3.);
+ let c = _mm256_set1_pd(1.);
+ let r = _mm256_mask_fmsubadd_pd(a, 0, b, c);
+ assert_eq_m256d(r, a);
+ let r = _mm256_mask_fmsubadd_pd(a, 0b00001111, b, c);
+ let e = _mm256_set_pd(-1., 2., 1., 4.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_fmsubadd_pd() {
+ let a = _mm256_set1_pd(1.);
+ let b = _mm256_set_pd(0., 1., 2., 3.);
+ let c = _mm256_set1_pd(1.);
+ let r = _mm256_maskz_fmsubadd_pd(0, a, b, c);
+ assert_eq_m256d(r, _mm256_setzero_pd());
+ let r = _mm256_maskz_fmsubadd_pd(0b00001111, a, b, c);
+ let e = _mm256_set_pd(-1., 2., 1., 4.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask3_fmsubadd_pd() {
+ let a = _mm256_set1_pd(1.);
+ let b = _mm256_set_pd(0., 1., 2., 3.);
+ let c = _mm256_set1_pd(1.);
+ let r = _mm256_mask3_fmsubadd_pd(a, b, c, 0);
+ assert_eq_m256d(r, c);
+ let r = _mm256_mask3_fmsubadd_pd(a, b, c, 0b00001111);
+ let e = _mm256_set_pd(-1., 2., 1., 4.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_fmsubadd_pd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set_pd(0., 1.);
+ let c = _mm_set1_pd(1.);
+ let r = _mm_mask_fmsubadd_pd(a, 0, b, c);
+ assert_eq_m128d(r, a);
+ let r = _mm_mask_fmsubadd_pd(a, 0b00000011, b, c);
+ let e = _mm_set_pd(-1., 2.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_fmsubadd_pd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set_pd(0., 1.);
+ let c = _mm_set1_pd(1.);
+ let r = _mm_maskz_fmsubadd_pd(0, a, b, c);
+ assert_eq_m128d(r, _mm_setzero_pd());
+ let r = _mm_maskz_fmsubadd_pd(0b00000011, a, b, c);
+ let e = _mm_set_pd(-1., 2.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask3_fmsubadd_pd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set_pd(0., 1.);
+ let c = _mm_set1_pd(1.);
+ let r = _mm_mask3_fmsubadd_pd(a, b, c, 0);
+ assert_eq_m128d(r, c);
+ let r = _mm_mask3_fmsubadd_pd(a, b, c, 0b00000011);
+ let e = _mm_set_pd(-1., 2.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_fnmadd_pd() {
+ let a = _mm512_set1_pd(1.);
+ let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let c = _mm512_set1_pd(1.);
+ let r = _mm512_fnmadd_pd(a, b, c);
+ let e = _mm512_setr_pd(1., 0., -1., -2., -3., -4., -5., -6.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_fnmadd_pd() {
+ let a = _mm512_set1_pd(1.);
+ let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let c = _mm512_set1_pd(1.);
+ let r = _mm512_mask_fnmadd_pd(a, 0, b, c);
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_fnmadd_pd(a, 0b00001111, b, c);
+ let e = _mm512_setr_pd(1., 0., -1., -2., 1., 1., 1., 1.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_fnmadd_pd() {
+ let a = _mm512_set1_pd(1.);
+ let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let c = _mm512_set1_pd(1.);
+ let r = _mm512_maskz_fnmadd_pd(0, a, b, c);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_fnmadd_pd(0b00001111, a, b, c);
+ let e = _mm512_setr_pd(1., 0., -1., -2., 0., 0., 0., 0.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask3_fnmadd_pd() {
+ let a = _mm512_set1_pd(1.);
+ let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let c = _mm512_setr_pd(1., 1., 1., 1., 2., 2., 2., 2.);
+ let r = _mm512_mask3_fnmadd_pd(a, b, c, 0);
+ assert_eq_m512d(r, c);
+ let r = _mm512_mask3_fnmadd_pd(a, b, c, 0b00001111);
+ let e = _mm512_setr_pd(1., 0., -1., -2., 2., 2., 2., 2.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_fnmadd_pd() {
+ let a = _mm256_set1_pd(1.);
+ let b = _mm256_set_pd(0., 1., 2., 3.);
+ let c = _mm256_set1_pd(1.);
+ let r = _mm256_mask_fnmadd_pd(a, 0, b, c);
+ assert_eq_m256d(r, a);
+ let r = _mm256_mask_fnmadd_pd(a, 0b00001111, b, c);
+ let e = _mm256_set_pd(1., 0., -1., -2.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_fnmadd_pd() {
+ let a = _mm256_set1_pd(1.);
+ let b = _mm256_set_pd(0., 1., 2., 3.);
+ let c = _mm256_set1_pd(1.);
+ let r = _mm256_maskz_fnmadd_pd(0, a, b, c);
+ assert_eq_m256d(r, _mm256_setzero_pd());
+ let r = _mm256_maskz_fnmadd_pd(0b00001111, a, b, c);
+ let e = _mm256_set_pd(1., 0., -1., -2.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask3_fnmadd_pd() {
+ let a = _mm256_set1_pd(1.);
+ let b = _mm256_set_pd(0., 1., 2., 3.);
+ let c = _mm256_set1_pd(1.);
+ let r = _mm256_mask3_fnmadd_pd(a, b, c, 0);
+ assert_eq_m256d(r, c);
+ let r = _mm256_mask3_fnmadd_pd(a, b, c, 0b00001111);
+ let e = _mm256_set_pd(1., 0., -1., -2.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_fnmadd_pd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set_pd(0., 1.);
+ let c = _mm_set1_pd(1.);
+ let r = _mm_mask_fnmadd_pd(a, 0, b, c);
+ assert_eq_m128d(r, a);
+ let r = _mm_mask_fnmadd_pd(a, 0b00000011, b, c);
+ let e = _mm_set_pd(1., 0.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_fnmadd_pd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set_pd(0., 1.);
+ let c = _mm_set1_pd(1.);
+ let r = _mm_maskz_fnmadd_pd(0, a, b, c);
+ assert_eq_m128d(r, _mm_setzero_pd());
+ let r = _mm_maskz_fnmadd_pd(0b00000011, a, b, c);
+ let e = _mm_set_pd(1., 0.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask3_fnmadd_pd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set_pd(0., 1.);
+ let c = _mm_set1_pd(1.);
+ let r = _mm_mask3_fnmadd_pd(a, b, c, 0);
+ assert_eq_m128d(r, c);
+ let r = _mm_mask3_fnmadd_pd(a, b, c, 0b00000011);
+ let e = _mm_set_pd(1., 0.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_fnmsub_pd() {
+ let a = _mm512_set1_pd(1.);
+ let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let c = _mm512_set1_pd(1.);
+ let r = _mm512_fnmsub_pd(a, b, c);
+ let e = _mm512_setr_pd(-1., -2., -3., -4., -5., -6., -7., -8.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_fnmsub_pd() {
+ let a = _mm512_set1_pd(1.);
+ let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let c = _mm512_set1_pd(1.);
+ let r = _mm512_mask_fnmsub_pd(a, 0, b, c);
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_fnmsub_pd(a, 0b00001111, b, c);
+ let e = _mm512_setr_pd(-1., -2., -3., -4., 1., 1., 1., 1.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_fnmsub_pd() {
+ let a = _mm512_set1_pd(1.);
+ let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let c = _mm512_set1_pd(1.);
+ let r = _mm512_maskz_fnmsub_pd(0, a, b, c);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_fnmsub_pd(0b00001111, a, b, c);
+ let e = _mm512_setr_pd(-1., -2., -3., -4., 0., 0., 0., 0.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask3_fnmsub_pd() {
+ let a = _mm512_set1_pd(1.);
+ let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let c = _mm512_setr_pd(1., 1., 1., 1., 2., 2., 2., 2.);
+ let r = _mm512_mask3_fnmsub_pd(a, b, c, 0);
+ assert_eq_m512d(r, c);
+ let r = _mm512_mask3_fnmsub_pd(a, b, c, 0b00001111);
+ let e = _mm512_setr_pd(-1., -2., -3., -4., 2., 2., 2., 2.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_fnmsub_pd() {
+ let a = _mm256_set1_pd(1.);
+ let b = _mm256_set_pd(0., 1., 2., 3.);
+ let c = _mm256_set1_pd(1.);
+ let r = _mm256_mask_fnmsub_pd(a, 0, b, c);
+ assert_eq_m256d(r, a);
+ let r = _mm256_mask_fnmsub_pd(a, 0b00001111, b, c);
+ let e = _mm256_set_pd(-1., -2., -3., -4.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_fnmsub_pd() {
+ let a = _mm256_set1_pd(1.);
+ let b = _mm256_set_pd(0., 1., 2., 3.);
+ let c = _mm256_set1_pd(1.);
+ let r = _mm256_maskz_fnmsub_pd(0, a, b, c);
+ assert_eq_m256d(r, _mm256_setzero_pd());
+ let r = _mm256_maskz_fnmsub_pd(0b00001111, a, b, c);
+ let e = _mm256_set_pd(-1., -2., -3., -4.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask3_fnmsub_pd() {
+ let a = _mm256_set1_pd(1.);
+ let b = _mm256_set_pd(0., 1., 2., 3.);
+ let c = _mm256_set1_pd(1.);
+ let r = _mm256_mask3_fnmsub_pd(a, b, c, 0);
+ assert_eq_m256d(r, c);
+ let r = _mm256_mask3_fnmsub_pd(a, b, c, 0b00001111);
+ let e = _mm256_set_pd(-1., -2., -3., -4.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_fnmsub_pd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set_pd(0., 1.);
+ let c = _mm_set1_pd(1.);
+ let r = _mm_mask_fnmsub_pd(a, 0, b, c);
+ assert_eq_m128d(r, a);
+ let r = _mm_mask_fnmsub_pd(a, 0b00000011, b, c);
+ let e = _mm_set_pd(-1., -2.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_fnmsub_pd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set_pd(0., 1.);
+ let c = _mm_set1_pd(1.);
+ let r = _mm_maskz_fnmsub_pd(0, a, b, c);
+ assert_eq_m128d(r, _mm_setzero_pd());
+ let r = _mm_maskz_fnmsub_pd(0b00000011, a, b, c);
+ let e = _mm_set_pd(-1., -2.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask3_fnmsub_pd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set_pd(0., 1.);
+ let c = _mm_set1_pd(1.);
+ let r = _mm_mask3_fnmsub_pd(a, b, c, 0);
+ assert_eq_m128d(r, c);
+ let r = _mm_mask3_fnmsub_pd(a, b, c, 0b00000011);
+ let e = _mm_set_pd(-1., -2.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_rcp14_pd() {
+ let a = _mm512_set1_pd(3.);
+ let r = _mm512_rcp14_pd(a);
+ let e = _mm512_set1_pd(0.3333320617675781);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_rcp14_pd() {
+ let a = _mm512_set1_pd(3.);
+ let r = _mm512_mask_rcp14_pd(a, 0, a);
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_rcp14_pd(a, 0b11110000, a);
+ #[rustfmt::skip]
+ let e = _mm512_setr_pd(
+ 3., 3., 3., 3.,
+ 0.3333320617675781, 0.3333320617675781, 0.3333320617675781, 0.3333320617675781,
+ );
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_rcp14_pd() {
+ let a = _mm512_set1_pd(3.);
+ let r = _mm512_maskz_rcp14_pd(0, a);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_rcp14_pd(0b11110000, a);
+ #[rustfmt::skip]
+ let e = _mm512_setr_pd(
+ 0., 0., 0., 0.,
+ 0.3333320617675781, 0.3333320617675781, 0.3333320617675781, 0.3333320617675781,
+ );
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_rcp14_pd() {
+ let a = _mm256_set1_pd(3.);
+ let r = _mm256_rcp14_pd(a);
+ let e = _mm256_set1_pd(0.3333320617675781);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_rcp14_pd() {
+ let a = _mm256_set1_pd(3.);
+ let r = _mm256_mask_rcp14_pd(a, 0, a);
+ assert_eq_m256d(r, a);
+ let r = _mm256_mask_rcp14_pd(a, 0b00001111, a);
+ let e = _mm256_set1_pd(0.3333320617675781);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_rcp14_pd() {
+ let a = _mm256_set1_pd(3.);
+ let r = _mm256_maskz_rcp14_pd(0, a);
+ assert_eq_m256d(r, _mm256_setzero_pd());
+ let r = _mm256_maskz_rcp14_pd(0b00001111, a);
+ let e = _mm256_set1_pd(0.3333320617675781);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_rcp14_pd() {
+ let a = _mm_set1_pd(3.);
+ let r = _mm_rcp14_pd(a);
+ let e = _mm_set1_pd(0.3333320617675781);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_rcp14_pd() {
+ let a = _mm_set1_pd(3.);
+ let r = _mm_mask_rcp14_pd(a, 0, a);
+ assert_eq_m128d(r, a);
+ let r = _mm_mask_rcp14_pd(a, 0b00000011, a);
+ let e = _mm_set1_pd(0.3333320617675781);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_rcp14_pd() {
+ let a = _mm_set1_pd(3.);
+ let r = _mm_maskz_rcp14_pd(0, a);
+ assert_eq_m128d(r, _mm_setzero_pd());
+ let r = _mm_maskz_rcp14_pd(0b00000011, a);
+ let e = _mm_set1_pd(0.3333320617675781);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_rsqrt14_pd() {
+ let a = _mm512_set1_pd(3.);
+ let r = _mm512_rsqrt14_pd(a);
+ let e = _mm512_set1_pd(0.5773391723632813);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_rsqrt14_pd() {
+ let a = _mm512_set1_pd(3.);
+ let r = _mm512_mask_rsqrt14_pd(a, 0, a);
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_rsqrt14_pd(a, 0b11110000, a);
+ #[rustfmt::skip]
+ let e = _mm512_setr_pd(
+ 3., 3., 3., 3.,
+ 0.5773391723632813, 0.5773391723632813, 0.5773391723632813, 0.5773391723632813,
+ );
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_rsqrt14_pd() {
+ let a = _mm512_set1_pd(3.);
+ let r = _mm512_maskz_rsqrt14_pd(0, a);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_rsqrt14_pd(0b11110000, a);
+ #[rustfmt::skip]
+ let e = _mm512_setr_pd(
+ 0., 0., 0., 0.,
+ 0.5773391723632813, 0.5773391723632813, 0.5773391723632813, 0.5773391723632813,
+ );
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_rsqrt14_pd() {
+ let a = _mm256_set1_pd(3.);
+ let r = _mm256_mask_rsqrt14_pd(a, 0, a);
+ assert_eq_m256d(r, a);
+ let r = _mm256_mask_rsqrt14_pd(a, 0b00001111, a);
+ let e = _mm256_set1_pd(0.5773391723632813);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_rsqrt14_pd() {
+ let a = _mm256_set1_pd(3.);
+ let r = _mm256_maskz_rsqrt14_pd(0, a);
+ assert_eq_m256d(r, _mm256_setzero_pd());
+ let r = _mm256_maskz_rsqrt14_pd(0b00001111, a);
+ let e = _mm256_set1_pd(0.5773391723632813);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_rsqrt14_pd() {
+ let a = _mm_set1_pd(3.);
+ let r = _mm_mask_rsqrt14_pd(a, 0, a);
+ assert_eq_m128d(r, a);
+ let r = _mm_mask_rsqrt14_pd(a, 0b00000011, a);
+ let e = _mm_set1_pd(0.5773391723632813);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_rsqrt14_pd() {
+ let a = _mm_set1_pd(3.);
+ let r = _mm_maskz_rsqrt14_pd(0, a);
+ assert_eq_m128d(r, _mm_setzero_pd());
+ let r = _mm_maskz_rsqrt14_pd(0b00000011, a);
+ let e = _mm_set1_pd(0.5773391723632813);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_getexp_pd() {
+ let a = _mm512_set1_pd(3.);
+ let r = _mm512_getexp_pd(a);
+ let e = _mm512_set1_pd(1.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_getexp_pd() {
+ let a = _mm512_set1_pd(3.);
+ let r = _mm512_mask_getexp_pd(a, 0, a);
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_getexp_pd(a, 0b11110000, a);
+ let e = _mm512_setr_pd(3., 3., 3., 3., 1., 1., 1., 1.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_getexp_pd() {
+ let a = _mm512_set1_pd(3.);
+ let r = _mm512_maskz_getexp_pd(0, a);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_getexp_pd(0b11110000, a);
+ let e = _mm512_setr_pd(0., 0., 0., 0., 1., 1., 1., 1.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_getexp_pd() {
+ let a = _mm256_set1_pd(3.);
+ let r = _mm256_getexp_pd(a);
+ let e = _mm256_set1_pd(1.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_getexp_pd() {
+ let a = _mm256_set1_pd(3.);
+ let r = _mm256_mask_getexp_pd(a, 0, a);
+ assert_eq_m256d(r, a);
+ let r = _mm256_mask_getexp_pd(a, 0b00001111, a);
+ let e = _mm256_set1_pd(1.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_getexp_pd() {
+ let a = _mm256_set1_pd(3.);
+ let r = _mm256_maskz_getexp_pd(0, a);
+ assert_eq_m256d(r, _mm256_setzero_pd());
+ let r = _mm256_maskz_getexp_pd(0b00001111, a);
+ let e = _mm256_set1_pd(1.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_getexp_pd() {
+ let a = _mm_set1_pd(3.);
+ let r = _mm_getexp_pd(a);
+ let e = _mm_set1_pd(1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_getexp_pd() {
+ let a = _mm_set1_pd(3.);
+ let r = _mm_mask_getexp_pd(a, 0, a);
+ assert_eq_m128d(r, a);
+ let r = _mm_mask_getexp_pd(a, 0b00000011, a);
+ let e = _mm_set1_pd(1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_getexp_pd() {
+ let a = _mm_set1_pd(3.);
+ let r = _mm_maskz_getexp_pd(0, a);
+ assert_eq_m128d(r, _mm_setzero_pd());
+ let r = _mm_maskz_getexp_pd(0b00000011, a);
+ let e = _mm_set1_pd(1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_roundscale_pd() {
+ let a = _mm512_set1_pd(1.1);
+ let r = _mm512_roundscale_pd::<0b00_00_00_00>(a);
+ let e = _mm512_set1_pd(1.0);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_roundscale_pd() {
+ let a = _mm512_set1_pd(1.1);
+ let r = _mm512_mask_roundscale_pd::<0b00_00_00_00>(a, 0, a);
+ let e = _mm512_set1_pd(1.1);
+ assert_eq_m512d(r, e);
+ let r = _mm512_mask_roundscale_pd::<0b00_00_00_00>(a, 0b11111111, a);
+ let e = _mm512_set1_pd(1.0);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_roundscale_pd() {
+ let a = _mm512_set1_pd(1.1);
+ let r = _mm512_maskz_roundscale_pd::<0b00_00_00_00>(0, a);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_roundscale_pd::<0b00_00_00_00>(0b11111111, a);
+ let e = _mm512_set1_pd(1.0);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_roundscale_pd() {
+ let a = _mm256_set1_pd(1.1);
+ let r = _mm256_roundscale_pd::<0b00_00_00_00>(a);
+ let e = _mm256_set1_pd(1.0);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_roundscale_pd() {
+ let a = _mm256_set1_pd(1.1);
+ let r = _mm256_mask_roundscale_pd::<0b00_00_00_00>(a, 0, a);
+ assert_eq_m256d(r, a);
+ let r = _mm256_mask_roundscale_pd::<0b00_00_00_00>(a, 0b00001111, a);
+ let e = _mm256_set1_pd(1.0);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_roundscale_pd() {
+ let a = _mm256_set1_pd(1.1);
+ let r = _mm256_maskz_roundscale_pd::<0b00_00_00_00>(0, a);
+ assert_eq_m256d(r, _mm256_setzero_pd());
+ let r = _mm256_maskz_roundscale_pd::<0b00_00_00_00>(0b00001111, a);
+ let e = _mm256_set1_pd(1.0);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_roundscale_pd() {
+ let a = _mm_set1_pd(1.1);
+ let r = _mm_roundscale_pd::<0b00_00_00_00>(a);
+ let e = _mm_set1_pd(1.0);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_roundscale_pd() {
+ let a = _mm_set1_pd(1.1);
+ let r = _mm_mask_roundscale_pd::<0b00_00_00_00>(a, 0, a);
+ let e = _mm_set1_pd(1.1);
+ assert_eq_m128d(r, e);
+ let r = _mm_mask_roundscale_pd::<0b00_00_00_00>(a, 0b00000011, a);
+ let e = _mm_set1_pd(1.0);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_roundscale_pd() {
+ let a = _mm_set1_pd(1.1);
+ let r = _mm_maskz_roundscale_pd::<0b00_00_00_00>(0, a);
+ assert_eq_m128d(r, _mm_setzero_pd());
+ let r = _mm_maskz_roundscale_pd::<0b00_00_00_00>(0b00000011, a);
+ let e = _mm_set1_pd(1.0);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_scalef_pd() {
+ let a = _mm512_set1_pd(1.);
+ let b = _mm512_set1_pd(3.);
+ let r = _mm512_scalef_pd(a, b);
+ let e = _mm512_set1_pd(8.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_scalef_pd() {
+ let a = _mm512_set1_pd(1.);
+ let b = _mm512_set1_pd(3.);
+ let r = _mm512_mask_scalef_pd(a, 0, a, b);
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_scalef_pd(a, 0b11110000, a, b);
+ let e = _mm512_set_pd(8., 8., 8., 8., 1., 1., 1., 1.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_scalef_pd() {
+ let a = _mm512_set1_pd(1.);
+ let b = _mm512_set1_pd(3.);
+ let r = _mm512_maskz_scalef_pd(0, a, b);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_scalef_pd(0b11110000, a, b);
+ let e = _mm512_set_pd(8., 8., 8., 8., 0., 0., 0., 0.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_scalef_pd() {
+ let a = _mm256_set1_pd(1.);
+ let b = _mm256_set1_pd(3.);
+ let r = _mm256_scalef_pd(a, b);
+ let e = _mm256_set1_pd(8.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_scalef_pd() {
+ let a = _mm256_set1_pd(1.);
+ let b = _mm256_set1_pd(3.);
+ let r = _mm256_mask_scalef_pd(a, 0, a, b);
+ assert_eq_m256d(r, a);
+ let r = _mm256_mask_scalef_pd(a, 0b00001111, a, b);
+ let e = _mm256_set1_pd(8.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_scalef_pd() {
+ let a = _mm256_set1_pd(1.);
+ let b = _mm256_set1_pd(3.);
+ let r = _mm256_maskz_scalef_pd(0, a, b);
+ assert_eq_m256d(r, _mm256_setzero_pd());
+ let r = _mm256_maskz_scalef_pd(0b00001111, a, b);
+ let e = _mm256_set1_pd(8.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_scalef_pd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set1_pd(3.);
+ let r = _mm_scalef_pd(a, b);
+ let e = _mm_set1_pd(8.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_scalef_pd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set1_pd(3.);
+ let r = _mm_mask_scalef_pd(a, 0, a, b);
+ assert_eq_m128d(r, a);
+ let r = _mm_mask_scalef_pd(a, 0b00000011, a, b);
+ let e = _mm_set1_pd(8.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_scalef_pd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set1_pd(3.);
+ let r = _mm_maskz_scalef_pd(0, a, b);
+ assert_eq_m128d(r, _mm_setzero_pd());
+ let r = _mm_maskz_scalef_pd(0b00000011, a, b);
+ let e = _mm_set1_pd(8.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_fixupimm_pd() {
+ let a = _mm512_set1_pd(f64::NAN);
+ let b = _mm512_set1_pd(f64::MAX);
+ let c = _mm512_set1_epi64(i32::MAX as i64);
+ let r = _mm512_fixupimm_pd::<5>(a, b, c);
+ let e = _mm512_set1_pd(0.0);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_fixupimm_pd() {
+ let a = _mm512_set_pd(f64::NAN, f64::NAN, f64::NAN, f64::NAN, 1., 1., 1., 1.);
+ let b = _mm512_set1_pd(f64::MAX);
+ let c = _mm512_set1_epi64(i32::MAX as i64);
+ let r = _mm512_mask_fixupimm_pd::<5>(a, 0b11110000, b, c);
+ let e = _mm512_set_pd(0., 0., 0., 0., 1., 1., 1., 1.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_fixupimm_pd() {
+ let a = _mm512_set_pd(f64::NAN, f64::NAN, f64::NAN, f64::NAN, 1., 1., 1., 1.);
+ let b = _mm512_set1_pd(f64::MAX);
+ let c = _mm512_set1_epi64(i32::MAX as i64);
+ let r = _mm512_maskz_fixupimm_pd::<5>(0b11110000, a, b, c);
+ let e = _mm512_set_pd(0., 0., 0., 0., 0., 0., 0., 0.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_fixupimm_pd() {
+ let a = _mm256_set1_pd(f64::NAN);
+ let b = _mm256_set1_pd(f64::MAX);
+ let c = _mm256_set1_epi64x(i32::MAX as i64);
+ let r = _mm256_fixupimm_pd::<5>(a, b, c);
+ let e = _mm256_set1_pd(0.0);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_fixupimm_pd() {
+ let a = _mm256_set1_pd(f64::NAN);
+ let b = _mm256_set1_pd(f64::MAX);
+ let c = _mm256_set1_epi64x(i32::MAX as i64);
+ let r = _mm256_mask_fixupimm_pd::<5>(a, 0b00001111, b, c);
+ let e = _mm256_set1_pd(0.0);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_fixupimm_pd() {
+ let a = _mm256_set1_pd(f64::NAN);
+ let b = _mm256_set1_pd(f64::MAX);
+ let c = _mm256_set1_epi64x(i32::MAX as i64);
+ let r = _mm256_maskz_fixupimm_pd::<5>(0b00001111, a, b, c);
+ let e = _mm256_set1_pd(0.0);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_fixupimm_pd() {
+ let a = _mm_set1_pd(f64::NAN);
+ let b = _mm_set1_pd(f64::MAX);
+ let c = _mm_set1_epi64x(i32::MAX as i64);
+ let r = _mm_fixupimm_pd::<5>(a, b, c);
+ let e = _mm_set1_pd(0.0);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_fixupimm_pd() {
+ let a = _mm_set1_pd(f64::NAN);
+ let b = _mm_set1_pd(f64::MAX);
+ let c = _mm_set1_epi64x(i32::MAX as i64);
+ let r = _mm_mask_fixupimm_pd::<5>(a, 0b00000011, b, c);
+ let e = _mm_set1_pd(0.0);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_fixupimm_pd() {
+ let a = _mm_set1_pd(f64::NAN);
+ let b = _mm_set1_pd(f64::MAX);
+ let c = _mm_set1_epi64x(i32::MAX as i64);
+ let r = _mm_maskz_fixupimm_pd::<5>(0b00000011, a, b, c);
+ let e = _mm_set1_pd(0.0);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_ternarylogic_epi64() {
+ let a = _mm512_set1_epi64(1 << 2);
+ let b = _mm512_set1_epi64(1 << 1);
+ let c = _mm512_set1_epi64(1 << 0);
+ let r = _mm512_ternarylogic_epi64::<8>(a, b, c);
+ let e = _mm512_set1_epi64(0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_ternarylogic_epi64() {
+ let src = _mm512_set1_epi64(1 << 2);
+ let a = _mm512_set1_epi64(1 << 1);
+ let b = _mm512_set1_epi64(1 << 0);
+ let r = _mm512_mask_ternarylogic_epi64::<8>(src, 0, a, b);
+ assert_eq_m512i(r, src);
+ let r = _mm512_mask_ternarylogic_epi64::<8>(src, 0b11111111, a, b);
+ let e = _mm512_set1_epi64(0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_ternarylogic_epi64() {
+ let a = _mm512_set1_epi64(1 << 2);
+ let b = _mm512_set1_epi64(1 << 1);
+ let c = _mm512_set1_epi64(1 << 0);
+ let r = _mm512_maskz_ternarylogic_epi64::<8>(0, a, b, c);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_ternarylogic_epi64::<8>(0b11111111, a, b, c);
+ let e = _mm512_set1_epi64(0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_ternarylogic_epi64() {
+ let a = _mm256_set1_epi64x(1 << 2);
+ let b = _mm256_set1_epi64x(1 << 1);
+ let c = _mm256_set1_epi64x(1 << 0);
+ let r = _mm256_ternarylogic_epi64::<8>(a, b, c);
+ let e = _mm256_set1_epi64x(0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_ternarylogic_epi64() {
+ let src = _mm256_set1_epi64x(1 << 2);
+ let a = _mm256_set1_epi64x(1 << 1);
+ let b = _mm256_set1_epi64x(1 << 0);
+ let r = _mm256_mask_ternarylogic_epi64::<8>(src, 0, a, b);
+ assert_eq_m256i(r, src);
+ let r = _mm256_mask_ternarylogic_epi64::<8>(src, 0b00001111, a, b);
+ let e = _mm256_set1_epi64x(0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_ternarylogic_epi64() {
+ let a = _mm256_set1_epi64x(1 << 2);
+ let b = _mm256_set1_epi64x(1 << 1);
+ let c = _mm256_set1_epi64x(1 << 0);
+ let r = _mm256_maskz_ternarylogic_epi64::<9>(0, a, b, c);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_ternarylogic_epi64::<8>(0b00001111, a, b, c);
+ let e = _mm256_set1_epi64x(0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_ternarylogic_epi64() {
+ let a = _mm_set1_epi64x(1 << 2);
+ let b = _mm_set1_epi64x(1 << 1);
+ let c = _mm_set1_epi64x(1 << 0);
+ let r = _mm_ternarylogic_epi64::<8>(a, b, c);
+ let e = _mm_set1_epi64x(0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_ternarylogic_epi64() {
+ let src = _mm_set1_epi64x(1 << 2);
+ let a = _mm_set1_epi64x(1 << 1);
+ let b = _mm_set1_epi64x(1 << 0);
+ let r = _mm_mask_ternarylogic_epi64::<8>(src, 0, a, b);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_ternarylogic_epi64::<8>(src, 0b00000011, a, b);
+ let e = _mm_set1_epi64x(0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_ternarylogic_epi64() {
+ let a = _mm_set1_epi64x(1 << 2);
+ let b = _mm_set1_epi64x(1 << 1);
+ let c = _mm_set1_epi64x(1 << 0);
+ let r = _mm_maskz_ternarylogic_epi64::<9>(0, a, b, c);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_ternarylogic_epi64::<8>(0b00000011, a, b, c);
+ let e = _mm_set1_epi64x(0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_getmant_pd() {
+ let a = _mm512_set1_pd(10.);
+ let r = _mm512_getmant_pd::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(a);
+ let e = _mm512_set1_pd(1.25);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_getmant_pd() {
+ let a = _mm512_set1_pd(10.);
+ let r = _mm512_mask_getmant_pd::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(a, 0, a);
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_getmant_pd::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(a, 0b11110000, a);
+ let e = _mm512_setr_pd(10., 10., 10., 10., 1.25, 1.25, 1.25, 1.25);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_getmant_pd() {
+ let a = _mm512_set1_pd(10.);
+ let r = _mm512_maskz_getmant_pd::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(0, a);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_getmant_pd::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(0b11110000, a);
+ let e = _mm512_setr_pd(0., 0., 0., 0., 1.25, 1.25, 1.25, 1.25);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_getmant_pd() {
+ let a = _mm256_set1_pd(10.);
+ let r = _mm256_getmant_pd::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(a);
+ let e = _mm256_set1_pd(1.25);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_getmant_pd() {
+ let a = _mm256_set1_pd(10.);
+ let r = _mm256_mask_getmant_pd::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(a, 0, a);
+ assert_eq_m256d(r, a);
+ let r = _mm256_mask_getmant_pd::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(a, 0b00001111, a);
+ let e = _mm256_set1_pd(1.25);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_getmant_pd() {
+ let a = _mm256_set1_pd(10.);
+ let r = _mm256_maskz_getmant_pd::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(0, a);
+ assert_eq_m256d(r, _mm256_setzero_pd());
+ let r = _mm256_maskz_getmant_pd::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(0b00001111, a);
+ let e = _mm256_set1_pd(1.25);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_getmant_pd() {
+ let a = _mm_set1_pd(10.);
+ let r = _mm_getmant_pd::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(a);
+ let e = _mm_set1_pd(1.25);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_getmant_pd() {
+ let a = _mm_set1_pd(10.);
+ let r = _mm_mask_getmant_pd::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(a, 0, a);
+ assert_eq_m128d(r, a);
+ let r = _mm_mask_getmant_pd::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(a, 0b00000011, a);
+ let e = _mm_set1_pd(1.25);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_getmant_pd() {
+ let a = _mm_set1_pd(10.);
+ let r = _mm_maskz_getmant_pd::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(0, a);
+ assert_eq_m128d(r, _mm_setzero_pd());
+ let r = _mm_maskz_getmant_pd::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(0b00000011, a);
+ let e = _mm_set1_pd(1.25);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtps_pd() {
+ let a = _mm256_setr_ps(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5);
+ let r = _mm512_cvtps_pd(a);
+ let e = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtps_pd() {
+ let a = _mm256_setr_ps(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5);
+ let src = _mm512_set1_pd(0.);
+ let r = _mm512_mask_cvtps_pd(src, 0, a);
+ assert_eq_m512d(r, src);
+ let r = _mm512_mask_cvtps_pd(src, 0b00001111, a);
+ let e = _mm512_setr_pd(0., -1.5, 2., -3.5, 0., 0., 0., 0.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvtps_pd() {
+ let a = _mm256_setr_ps(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5);
+ let r = _mm512_maskz_cvtps_pd(0, a);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_cvtps_pd(0b00001111, a);
+ let e = _mm512_setr_pd(0., -1.5, 2., -3.5, 0., 0., 0., 0.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtpslo_pd() {
+ let v2 = _mm512_setr_ps(
+ 0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5, 100., 100., 100., 100., 100., 100., 100., 100.,
+ );
+ let r = _mm512_cvtpslo_pd(v2);
+ let e = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtpslo_pd() {
+ let v2 = _mm512_setr_ps(
+ 0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5, 100., 100., 100., 100., 100., 100., 100., 100.,
+ );
+ let src = _mm512_set1_pd(0.);
+ let r = _mm512_mask_cvtpslo_pd(src, 0, v2);
+ assert_eq_m512d(r, src);
+ let r = _mm512_mask_cvtpslo_pd(src, 0b00001111, v2);
+ let e = _mm512_setr_pd(0., -1.5, 2., -3.5, 0., 0., 0., 0.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtpd_ps() {
+ let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5);
+ let r = _mm512_cvtpd_ps(a);
+ let e = _mm256_setr_ps(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtpd_ps() {
+ let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5);
+ let src = _mm256_set1_ps(0.);
+ let r = _mm512_mask_cvtpd_ps(src, 0, a);
+ assert_eq_m256(r, src);
+ let r = _mm512_mask_cvtpd_ps(src, 0b00001111, a);
+ let e = _mm256_setr_ps(0., -1.5, 2., -3.5, 0., 0., 0., 0.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvtpd_ps() {
+ let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5);
+ let r = _mm512_maskz_cvtpd_ps(0, a);
+ assert_eq_m256(r, _mm256_setzero_ps());
+ let r = _mm512_maskz_cvtpd_ps(0b00001111, a);
+ let e = _mm256_setr_ps(0., -1.5, 2., -3.5, 0., 0., 0., 0.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cvtpd_ps() {
+ let a = _mm256_set_pd(4., -5.5, 6., -7.5);
+ let src = _mm_set1_ps(0.);
+ let r = _mm256_mask_cvtpd_ps(src, 0, a);
+ assert_eq_m128(r, src);
+ let r = _mm256_mask_cvtpd_ps(src, 0b00001111, a);
+ let e = _mm_set_ps(4., -5.5, 6., -7.5);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_cvtpd_ps() {
+ let a = _mm256_set_pd(4., -5.5, 6., -7.5);
+ let r = _mm256_maskz_cvtpd_ps(0, a);
+ assert_eq_m128(r, _mm_setzero_ps());
+ let r = _mm256_maskz_cvtpd_ps(0b00001111, a);
+ let e = _mm_set_ps(4., -5.5, 6., -7.5);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtpd_ps() {
+ let a = _mm_set_pd(6., -7.5);
+ let src = _mm_set1_ps(0.);
+ let r = _mm_mask_cvtpd_ps(src, 0, a);
+ assert_eq_m128(r, src);
+ let r = _mm_mask_cvtpd_ps(src, 0b00000011, a);
+ let e = _mm_set_ps(0., 0., 6., -7.5);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_cvtpd_ps() {
+ let a = _mm_set_pd(6., -7.5);
+ let r = _mm_maskz_cvtpd_ps(0, a);
+ assert_eq_m128(r, _mm_setzero_ps());
+ let r = _mm_maskz_cvtpd_ps(0b00000011, a);
+ let e = _mm_set_ps(0., 0., 6., -7.5);
+ assert_eq_m128(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtpd_epi32() {
+ let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5);
+ let r = _mm512_cvtpd_epi32(a);
+ let e = _mm256_setr_epi32(0, -2, 2, -4, 4, -6, 6, -8);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtpd_epi32() {
+ let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5);
+ let src = _mm256_set1_epi32(0);
+ let r = _mm512_mask_cvtpd_epi32(src, 0, a);
+ assert_eq_m256i(r, src);
+ let r = _mm512_mask_cvtpd_epi32(src, 0b11111111, a);
+ let e = _mm256_setr_epi32(0, -2, 2, -4, 4, -6, 6, -8);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvtpd_epi32() {
+ let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5);
+ let r = _mm512_maskz_cvtpd_epi32(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm512_maskz_cvtpd_epi32(0b11111111, a);
+ let e = _mm256_setr_epi32(0, -2, 2, -4, 4, -6, 6, -8);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cvtpd_epi32() {
+ let a = _mm256_set_pd(4., -5.5, 6., -7.5);
+ let src = _mm_set1_epi32(0);
+ let r = _mm256_mask_cvtpd_epi32(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm256_mask_cvtpd_epi32(src, 0b00001111, a);
+ let e = _mm_set_epi32(4, -6, 6, -8);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_cvtpd_epi32() {
+ let a = _mm256_set_pd(4., -5.5, 6., -7.5);
+ let r = _mm256_maskz_cvtpd_epi32(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm256_maskz_cvtpd_epi32(0b00001111, a);
+ let e = _mm_set_epi32(4, -6, 6, -8);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtpd_epi32() {
+ let a = _mm_set_pd(6., -7.5);
+ let src = _mm_set1_epi32(0);
+ let r = _mm_mask_cvtpd_epi32(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_cvtpd_epi32(src, 0b00000011, a);
+ let e = _mm_set_epi32(0, 0, 6, -8);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_cvtpd_epi32() {
+ let a = _mm_set_pd(6., -7.5);
+ let r = _mm_maskz_cvtpd_epi32(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_cvtpd_epi32(0b00000011, a);
+ let e = _mm_set_epi32(0, 0, 6, -8);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtpd_epu32() {
+ let a = _mm512_setr_pd(0., 1.5, 2., 3.5, 4., 5.5, 6., 7.5);
+ let r = _mm512_cvtpd_epu32(a);
+ let e = _mm256_setr_epi32(0, 2, 2, 4, 4, 6, 6, 8);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtpd_epu32() {
+ let a = _mm512_setr_pd(0., 1.5, 2., 3.5, 4., 5.5, 6., 7.5);
+ let src = _mm256_set1_epi32(0);
+ let r = _mm512_mask_cvtpd_epu32(src, 0, a);
+ assert_eq_m256i(r, src);
+ let r = _mm512_mask_cvtpd_epu32(src, 0b11111111, a);
+ let e = _mm256_setr_epi32(0, 2, 2, 4, 4, 6, 6, 8);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvtpd_epu32() {
+ let a = _mm512_setr_pd(0., 1.5, 2., 3.5, 4., 5.5, 6., 7.5);
+ let r = _mm512_maskz_cvtpd_epu32(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm512_maskz_cvtpd_epu32(0b11111111, a);
+ let e = _mm256_setr_epi32(0, 2, 2, 4, 4, 6, 6, 8);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cvtpd_epu32() {
+ let a = _mm256_set_pd(4., 5.5, 6., 7.5);
+ let r = _mm256_cvtpd_epu32(a);
+ let e = _mm_set_epi32(4, 6, 6, 8);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cvtpd_epu32() {
+ let a = _mm256_set_pd(4., 5.5, 6., 7.5);
+ let src = _mm_set1_epi32(0);
+ let r = _mm256_mask_cvtpd_epu32(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm256_mask_cvtpd_epu32(src, 0b00001111, a);
+ let e = _mm_set_epi32(4, 6, 6, 8);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_cvtpd_epu32() {
+ let a = _mm256_set_pd(4., 5.5, 6., 7.5);
+ let r = _mm256_maskz_cvtpd_epu32(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm256_maskz_cvtpd_epu32(0b00001111, a);
+ let e = _mm_set_epi32(4, 6, 6, 8);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cvtpd_epu32() {
+ let a = _mm_set_pd(6., 7.5);
+ let r = _mm_cvtpd_epu32(a);
+ let e = _mm_set_epi32(0, 0, 6, 8);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtpd_epu32() {
+ let a = _mm_set_pd(6., 7.5);
+ let src = _mm_set1_epi32(0);
+ let r = _mm_mask_cvtpd_epu32(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_cvtpd_epu32(src, 0b00000011, a);
+ let e = _mm_set_epi32(0, 0, 6, 8);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_cvtpd_epu32() {
+ let a = _mm_set_pd(6., 7.5);
+ let r = _mm_maskz_cvtpd_epu32(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_cvtpd_epu32(0b00000011, a);
+ let e = _mm_set_epi32(0, 0, 6, 8);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtpd_pslo() {
+ let v2 = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5);
+ let r = _mm512_cvtpd_pslo(v2);
+ let e = _mm512_setr_ps(
+ 0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5, 0., 0., 0., 0., 0., 0., 0., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtpd_pslo() {
+ let v2 = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5);
+ let src = _mm512_set1_ps(0.);
+ let r = _mm512_mask_cvtpd_pslo(src, 0, v2);
+ assert_eq_m512(r, src);
+ let r = _mm512_mask_cvtpd_pslo(src, 0b00001111, v2);
+ let e = _mm512_setr_ps(
+ 0., -1.5, 2., -3.5, 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_cvtepi8_epi64() {
+ 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_epi64(a);
+ let e = _mm512_set_epi64(8, 9, 10, 11, 12, 13, 14, 15);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtepi8_epi64() {
+ 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_epi64(-1);
+ let r = _mm512_mask_cvtepi8_epi64(src, 0, a);
+ assert_eq_m512i(r, src);
+ let r = _mm512_mask_cvtepi8_epi64(src, 0b00001111, a);
+ let e = _mm512_set_epi64(-1, -1, -1, -1, 12, 13, 14, 15);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvtepi8_epi64() {
+ 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_epi64(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_cvtepi8_epi64(0b00001111, a);
+ let e = _mm512_set_epi64(0, 0, 0, 0, 12, 13, 14, 15);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cvtepi8_epi64() {
+ 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_epi64x(-1);
+ let r = _mm256_mask_cvtepi8_epi64(src, 0, a);
+ assert_eq_m256i(r, src);
+ let r = _mm256_mask_cvtepi8_epi64(src, 0b00001111, a);
+ let e = _mm256_set_epi64x(12, 13, 14, 15);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_cvtepi8_epi64() {
+ 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_epi64(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_cvtepi8_epi64(0b00001111, a);
+ let e = _mm256_set_epi64x(12, 13, 14, 15);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtepi8_epi64() {
+ 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_epi64x(-1);
+ let r = _mm_mask_cvtepi8_epi64(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_cvtepi8_epi64(src, 0b00000011, a);
+ let e = _mm_set_epi64x(14, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_cvtepi8_epi64() {
+ 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_epi64(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_cvtepi8_epi64(0b00000011, a);
+ let e = _mm_set_epi64x(14, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtepu8_epi64() {
+ 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_epi64(a);
+ let e = _mm512_set_epi64(8, 9, 10, 11, 12, 13, 14, 15);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtepu8_epi64() {
+ 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_epi64(-1);
+ let r = _mm512_mask_cvtepu8_epi64(src, 0, a);
+ assert_eq_m512i(r, src);
+ let r = _mm512_mask_cvtepu8_epi64(src, 0b00001111, a);
+ let e = _mm512_set_epi64(-1, -1, -1, -1, 12, 13, 14, 15);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvtepu8_epi64() {
+ 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_epi64(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_cvtepu8_epi64(0b00001111, a);
+ let e = _mm512_set_epi64(0, 0, 0, 0, 12, 13, 14, 15);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cvtepu8_epi64() {
+ 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_epi64x(-1);
+ let r = _mm256_mask_cvtepu8_epi64(src, 0, a);
+ assert_eq_m256i(r, src);
+ let r = _mm256_mask_cvtepu8_epi64(src, 0b00001111, a);
+ let e = _mm256_set_epi64x(12, 13, 14, 15);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_cvtepu8_epi64() {
+ 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_epi64(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_cvtepu8_epi64(0b00001111, a);
+ let e = _mm256_set_epi64x(12, 13, 14, 15);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtepu8_epi64() {
+ 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_epi64x(-1);
+ let r = _mm_mask_cvtepu8_epi64(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_cvtepu8_epi64(src, 0b00000011, a);
+ let e = _mm_set_epi64x(14, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_cvtepu8_epi64() {
+ 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_epi64(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_cvtepu8_epi64(0b00000011, a);
+ let e = _mm_set_epi64x(14, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtepi16_epi64() {
+ let a = _mm_set_epi16(8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_cvtepi16_epi64(a);
+ let e = _mm512_set_epi64(8, 9, 10, 11, 12, 13, 14, 15);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtepi16_epi64() {
+ let a = _mm_set_epi16(8, 9, 10, 11, 12, 13, 14, 15);
+ let src = _mm512_set1_epi64(-1);
+ let r = _mm512_mask_cvtepi16_epi64(src, 0, a);
+ assert_eq_m512i(r, src);
+ let r = _mm512_mask_cvtepi16_epi64(src, 0b00001111, a);
+ let e = _mm512_set_epi64(-1, -1, -1, -1, 12, 13, 14, 15);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvtepi16_epi64() {
+ let a = _mm_set_epi16(8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_maskz_cvtepi16_epi64(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_cvtepi16_epi64(0b00001111, a);
+ let e = _mm512_set_epi64(0, 0, 0, 0, 12, 13, 14, 15);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cvtepi16_epi64() {
+ let a = _mm_set_epi16(8, 9, 10, 11, 12, 13, 14, 15);
+ let src = _mm256_set1_epi64x(-1);
+ let r = _mm256_mask_cvtepi16_epi64(src, 0, a);
+ assert_eq_m256i(r, src);
+ let r = _mm256_mask_cvtepi16_epi64(src, 0b00001111, a);
+ let e = _mm256_set_epi64x(12, 13, 14, 15);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_cvtepi16_epi64() {
+ let a = _mm_set_epi16(8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm256_maskz_cvtepi16_epi64(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_cvtepi16_epi64(0b00001111, a);
+ let e = _mm256_set_epi64x(12, 13, 14, 15);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtepi16_epi64() {
+ let a = _mm_set_epi16(8, 9, 10, 11, 12, 13, 14, 15);
+ let src = _mm_set1_epi64x(-1);
+ let r = _mm_mask_cvtepi16_epi64(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_cvtepi16_epi64(src, 0b00000011, a);
+ let e = _mm_set_epi64x(14, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_cvtepi16_epi64() {
+ let a = _mm_set_epi16(8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm_maskz_cvtepi16_epi64(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_cvtepi16_epi64(0b00000011, a);
+ let e = _mm_set_epi64x(14, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtepu16_epi64() {
+ let a = _mm_set_epi16(8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_cvtepu16_epi64(a);
+ let e = _mm512_set_epi64(8, 9, 10, 11, 12, 13, 14, 15);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtepu16_epi64() {
+ let a = _mm_set_epi16(8, 9, 10, 11, 12, 13, 14, 15);
+ let src = _mm512_set1_epi64(-1);
+ let r = _mm512_mask_cvtepu16_epi64(src, 0, a);
+ assert_eq_m512i(r, src);
+ let r = _mm512_mask_cvtepu16_epi64(src, 0b00001111, a);
+ let e = _mm512_set_epi64(-1, -1, -1, -1, 12, 13, 14, 15);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvtepu16_epi64() {
+ let a = _mm_set_epi16(8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_maskz_cvtepu16_epi64(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_cvtepu16_epi64(0b00001111, a);
+ let e = _mm512_set_epi64(0, 0, 0, 0, 12, 13, 14, 15);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cvtepu16_epi64() {
+ let a = _mm_set_epi16(8, 9, 10, 11, 12, 13, 14, 15);
+ let src = _mm256_set1_epi64x(-1);
+ let r = _mm256_mask_cvtepu16_epi64(src, 0, a);
+ assert_eq_m256i(r, src);
+ let r = _mm256_mask_cvtepu16_epi64(src, 0b00001111, a);
+ let e = _mm256_set_epi64x(12, 13, 14, 15);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_cvtepu16_epi64() {
+ let a = _mm_set_epi16(8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm256_maskz_cvtepu16_epi64(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_cvtepu16_epi64(0b00001111, a);
+ let e = _mm256_set_epi64x(12, 13, 14, 15);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtepu16_epi64() {
+ let a = _mm_set_epi16(8, 9, 10, 11, 12, 13, 14, 15);
+ let src = _mm_set1_epi64x(-1);
+ let r = _mm_mask_cvtepu16_epi64(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_cvtepu16_epi64(src, 0b00000011, a);
+ let e = _mm_set_epi64x(14, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_cvtepu16_epi64() {
+ let a = _mm_set_epi16(8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm_maskz_cvtepu16_epi64(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_cvtepu16_epi64(0b00000011, a);
+ let e = _mm_set_epi64x(14, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtepi32_epi64() {
+ let a = _mm256_set_epi32(8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_cvtepi32_epi64(a);
+ let e = _mm512_set_epi64(8, 9, 10, 11, 12, 13, 14, 15);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtepi32_epi64() {
+ let a = _mm256_set_epi32(8, 9, 10, 11, 12, 13, 14, 15);
+ let src = _mm512_set1_epi64(-1);
+ let r = _mm512_mask_cvtepi32_epi64(src, 0, a);
+ assert_eq_m512i(r, src);
+ let r = _mm512_mask_cvtepi32_epi64(src, 0b00001111, a);
+ let e = _mm512_set_epi64(-1, -1, -1, -1, 12, 13, 14, 15);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvtepi32_epi64() {
+ let a = _mm256_set_epi32(8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_maskz_cvtepi32_epi64(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_cvtepi32_epi64(0b00001111, a);
+ let e = _mm512_set_epi64(0, 0, 0, 0, 12, 13, 14, 15);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cvtepi32_epi64() {
+ let a = _mm_set_epi32(8, 9, 10, 11);
+ let src = _mm256_set1_epi64x(-1);
+ let r = _mm256_mask_cvtepi32_epi64(src, 0, a);
+ assert_eq_m256i(r, src);
+ let r = _mm256_mask_cvtepi32_epi64(src, 0b00001111, a);
+ let e = _mm256_set_epi64x(8, 9, 10, 11);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_cvtepi32_epi64() {
+ let a = _mm_set_epi32(8, 9, 10, 11);
+ let r = _mm256_maskz_cvtepi32_epi64(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_cvtepi32_epi64(0b00001111, a);
+ let e = _mm256_set_epi64x(8, 9, 10, 11);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtepi32_epi64() {
+ let a = _mm_set_epi32(8, 9, 10, 11);
+ let src = _mm_set1_epi64x(0);
+ let r = _mm_mask_cvtepi32_epi64(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_cvtepi32_epi64(src, 0b00000011, a);
+ let e = _mm_set_epi64x(10, 11);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_cvtepi32_epi64() {
+ let a = _mm_set_epi32(8, 9, 10, 11);
+ let r = _mm_maskz_cvtepi32_epi64(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_cvtepi32_epi64(0b00000011, a);
+ let e = _mm_set_epi64x(10, 11);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtepu32_epi64() {
+ let a = _mm256_set_epi32(8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_cvtepu32_epi64(a);
+ let e = _mm512_set_epi64(8, 9, 10, 11, 12, 13, 14, 15);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtepu32_epi64() {
+ let a = _mm256_set_epi32(8, 9, 10, 11, 12, 13, 14, 15);
+ let src = _mm512_set1_epi64(-1);
+ let r = _mm512_mask_cvtepu32_epi64(src, 0, a);
+ assert_eq_m512i(r, src);
+ let r = _mm512_mask_cvtepu32_epi64(src, 0b00001111, a);
+ let e = _mm512_set_epi64(-1, -1, -1, -1, 12, 13, 14, 15);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvtepu32_epi64() {
+ let a = _mm256_set_epi32(8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_maskz_cvtepu32_epi64(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_cvtepu32_epi64(0b00001111, a);
+ let e = _mm512_set_epi64(0, 0, 0, 0, 12, 13, 14, 15);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cvtepu32_epi64() {
+ let a = _mm_set_epi32(12, 13, 14, 15);
+ let src = _mm256_set1_epi64x(-1);
+ let r = _mm256_mask_cvtepu32_epi64(src, 0, a);
+ assert_eq_m256i(r, src);
+ let r = _mm256_mask_cvtepu32_epi64(src, 0b00001111, a);
+ let e = _mm256_set_epi64x(12, 13, 14, 15);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_cvtepu32_epi64() {
+ let a = _mm_set_epi32(12, 13, 14, 15);
+ let r = _mm256_maskz_cvtepu32_epi64(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_cvtepu32_epi64(0b00001111, a);
+ let e = _mm256_set_epi64x(12, 13, 14, 15);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtepu32_epi64() {
+ let a = _mm_set_epi32(12, 13, 14, 15);
+ let src = _mm_set1_epi64x(-1);
+ let r = _mm_mask_cvtepu32_epi64(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_cvtepu32_epi64(src, 0b00000011, a);
+ let e = _mm_set_epi64x(14, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_cvtepu32_epi64() {
+ let a = _mm_set_epi32(12, 13, 14, 15);
+ let r = _mm_maskz_cvtepu32_epi64(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_cvtepu32_epi64(0b00000011, a);
+ let e = _mm_set_epi64x(14, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtepi32_pd() {
+ let a = _mm256_set_epi32(8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_cvtepi32_pd(a);
+ let e = _mm512_set_pd(8., 9., 10., 11., 12., 13., 14., 15.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtepi32_pd() {
+ let a = _mm256_set_epi32(8, 9, 10, 11, 12, 13, 14, 15);
+ let src = _mm512_set1_pd(-1.);
+ let r = _mm512_mask_cvtepi32_pd(src, 0, a);
+ assert_eq_m512d(r, src);
+ let r = _mm512_mask_cvtepi32_pd(src, 0b00001111, a);
+ let e = _mm512_set_pd(-1., -1., -1., -1., 12., 13., 14., 15.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvtepi32_pd() {
+ let a = _mm256_set_epi32(8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_maskz_cvtepi32_pd(0, a);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_cvtepi32_pd(0b00001111, a);
+ let e = _mm512_set_pd(0., 0., 0., 0., 12., 13., 14., 15.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cvtepi32_pd() {
+ let a = _mm_set_epi32(12, 13, 14, 15);
+ let src = _mm256_set1_pd(-1.);
+ let r = _mm256_mask_cvtepi32_pd(src, 0, a);
+ assert_eq_m256d(r, src);
+ let r = _mm256_mask_cvtepi32_pd(src, 0b00001111, a);
+ let e = _mm256_set_pd(12., 13., 14., 15.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_cvtepi32_pd() {
+ let a = _mm_set_epi32(12, 13, 14, 15);
+ let r = _mm256_maskz_cvtepi32_pd(0, a);
+ assert_eq_m256d(r, _mm256_setzero_pd());
+ let r = _mm256_maskz_cvtepi32_pd(0b00001111, a);
+ let e = _mm256_set_pd(12., 13., 14., 15.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtepi32_pd() {
+ let a = _mm_set_epi32(12, 13, 14, 15);
+ let src = _mm_set1_pd(-1.);
+ let r = _mm_mask_cvtepi32_pd(src, 0, a);
+ assert_eq_m128d(r, src);
+ let r = _mm_mask_cvtepi32_pd(src, 0b00000011, a);
+ let e = _mm_set_pd(14., 15.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_cvtepi32_pd() {
+ let a = _mm_set_epi32(12, 13, 14, 15);
+ let r = _mm_maskz_cvtepi32_pd(0, a);
+ assert_eq_m128d(r, _mm_setzero_pd());
+ let r = _mm_maskz_cvtepi32_pd(0b00000011, a);
+ let e = _mm_set_pd(14., 15.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtepu32_pd() {
+ let a = _mm256_set_epi32(8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_cvtepu32_pd(a);
+ let e = _mm512_set_pd(8., 9., 10., 11., 12., 13., 14., 15.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtepu32_pd() {
+ let a = _mm256_set_epi32(8, 9, 10, 11, 12, 13, 14, 15);
+ let src = _mm512_set1_pd(-1.);
+ let r = _mm512_mask_cvtepu32_pd(src, 0, a);
+ assert_eq_m512d(r, src);
+ let r = _mm512_mask_cvtepu32_pd(src, 0b00001111, a);
+ let e = _mm512_set_pd(-1., -1., -1., -1., 12., 13., 14., 15.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvtepu32_pd() {
+ let a = _mm256_set_epi32(8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_maskz_cvtepu32_pd(0, a);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_cvtepu32_pd(0b00001111, a);
+ let e = _mm512_set_pd(0., 0., 0., 0., 12., 13., 14., 15.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cvtepu32_pd() {
+ let a = _mm_set_epi32(12, 13, 14, 15);
+ let r = _mm256_cvtepu32_pd(a);
+ let e = _mm256_set_pd(12., 13., 14., 15.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cvtepu32_pd() {
+ let a = _mm_set_epi32(12, 13, 14, 15);
+ let src = _mm256_set1_pd(-1.);
+ let r = _mm256_mask_cvtepu32_pd(src, 0, a);
+ assert_eq_m256d(r, src);
+ let r = _mm256_mask_cvtepu32_pd(src, 0b00001111, a);
+ let e = _mm256_set_pd(12., 13., 14., 15.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_cvtepu32_pd() {
+ let a = _mm_set_epi32(12, 13, 14, 15);
+ let r = _mm256_maskz_cvtepu32_pd(0, a);
+ assert_eq_m256d(r, _mm256_setzero_pd());
+ let r = _mm256_maskz_cvtepu32_pd(0b00001111, a);
+ let e = _mm256_set_pd(12., 13., 14., 15.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cvtepu32_pd() {
+ let a = _mm_set_epi32(12, 13, 14, 15);
+ let r = _mm_cvtepu32_pd(a);
+ let e = _mm_set_pd(14., 15.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtepu32_pd() {
+ let a = _mm_set_epi32(12, 13, 14, 15);
+ let src = _mm_set1_pd(-1.);
+ let r = _mm_mask_cvtepu32_pd(src, 0, a);
+ assert_eq_m128d(r, src);
+ let r = _mm_mask_cvtepu32_pd(src, 0b00000011, a);
+ let e = _mm_set_pd(14., 15.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_cvtepu32_pd() {
+ let a = _mm_set_epi32(12, 13, 14, 15);
+ let r = _mm_maskz_cvtepu32_pd(0, a);
+ assert_eq_m128d(r, _mm_setzero_pd());
+ let r = _mm_maskz_cvtepu32_pd(0b00000011, a);
+ let e = _mm_set_pd(14., 15.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtepi32lo_pd() {
+ let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_cvtepi32lo_pd(a);
+ let e = _mm512_set_pd(8., 9., 10., 11., 12., 13., 14., 15.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtepi32lo_pd() {
+ 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_pd(-1.);
+ let r = _mm512_mask_cvtepi32lo_pd(src, 0, a);
+ assert_eq_m512d(r, src);
+ let r = _mm512_mask_cvtepi32lo_pd(src, 0b00001111, a);
+ let e = _mm512_set_pd(-1., -1., -1., -1., 12., 13., 14., 15.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtepu32lo_pd() {
+ let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_cvtepu32lo_pd(a);
+ let e = _mm512_set_pd(8., 9., 10., 11., 12., 13., 14., 15.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtepu32lo_pd() {
+ 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_pd(-1.);
+ let r = _mm512_mask_cvtepu32lo_pd(src, 0, a);
+ assert_eq_m512d(r, src);
+ let r = _mm512_mask_cvtepu32lo_pd(src, 0b00001111, a);
+ let e = _mm512_set_pd(-1., -1., -1., -1., 12., 13., 14., 15.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtepi64_epi32() {
+ let a = _mm512_set_epi64(8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_cvtepi64_epi32(a);
+ let e = _mm256_set_epi32(8, 9, 10, 11, 12, 13, 14, 15);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtepi64_epi32() {
+ let a = _mm512_set_epi64(8, 9, 10, 11, 12, 13, 14, 15);
+ let src = _mm256_set1_epi32(-1);
+ let r = _mm512_mask_cvtepi64_epi32(src, 0, a);
+ assert_eq_m256i(r, src);
+ let r = _mm512_mask_cvtepi64_epi32(src, 0b00001111, a);
+ let e = _mm256_set_epi32(-1, -1, -1, -1, 12, 13, 14, 15);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvtepi64_epi32() {
+ let a = _mm512_set_epi64(8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_maskz_cvtepi64_epi32(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm512_maskz_cvtepi64_epi32(0b00001111, a);
+ let e = _mm256_set_epi32(0, 0, 0, 0, 12, 13, 14, 15);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cvtepi64_epi32() {
+ let a = _mm256_set_epi64x(1, 2, 3, 4);
+ let r = _mm256_cvtepi64_epi32(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_cvtepi64_epi32() {
+ let a = _mm256_set_epi64x(1, 2, 3, 4);
+ let src = _mm_set1_epi32(0);
+ let r = _mm256_mask_cvtepi64_epi32(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm256_mask_cvtepi64_epi32(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_cvtepi64_epi32() {
+ let a = _mm256_set_epi64x(1, 2, 3, 4);
+ let r = _mm256_maskz_cvtepi64_epi32(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm256_maskz_cvtepi64_epi32(0b00001111, a);
+ let e = _mm_set_epi32(1, 2, 3, 4);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cvtepi64_epi32() {
+ let a = _mm_set_epi64x(3, 4);
+ let r = _mm_cvtepi64_epi32(a);
+ let e = _mm_set_epi32(0, 0, 3, 4);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtepi64_epi32() {
+ let a = _mm_set_epi64x(3, 4);
+ let src = _mm_set1_epi32(0);
+ let r = _mm_mask_cvtepi64_epi32(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_cvtepi64_epi32(src, 0b00000011, a);
+ let e = _mm_set_epi32(0, 0, 3, 4);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_cvtepi64_epi32() {
+ let a = _mm_set_epi64x(3, 4);
+ let r = _mm_maskz_cvtepi64_epi32(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_cvtepi64_epi32(0b00000011, a);
+ let e = _mm_set_epi32(0, 0, 3, 4);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtepi64_epi16() {
+ let a = _mm512_set_epi64(8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_cvtepi64_epi16(a);
+ let e = _mm_set_epi16(8, 9, 10, 11, 12, 13, 14, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtepi64_epi16() {
+ let a = _mm512_set_epi64(8, 9, 10, 11, 12, 13, 14, 15);
+ let src = _mm_set1_epi16(-1);
+ let r = _mm512_mask_cvtepi64_epi16(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm512_mask_cvtepi64_epi16(src, 0b00001111, a);
+ let e = _mm_set_epi16(-1, -1, -1, -1, 12, 13, 14, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvtepi64_epi16() {
+ let a = _mm512_set_epi64(8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_maskz_cvtepi64_epi16(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm512_maskz_cvtepi64_epi16(0b00001111, a);
+ let e = _mm_set_epi16(0, 0, 0, 0, 12, 13, 14, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cvtepi64_epi16() {
+ let a = _mm256_set_epi64x(12, 13, 14, 15);
+ let r = _mm256_cvtepi64_epi16(a);
+ let e = _mm_set_epi16(0, 0, 0, 0, 12, 13, 14, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cvtepi64_epi16() {
+ let a = _mm256_set_epi64x(12, 13, 14, 15);
+ let src = _mm_set1_epi16(0);
+ let r = _mm256_mask_cvtepi64_epi16(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm256_mask_cvtepi64_epi16(src, 0b11111111, a);
+ let e = _mm_set_epi16(0, 0, 0, 0, 12, 13, 14, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_cvtepi64_epi16() {
+ let a = _mm256_set_epi64x(12, 13, 14, 15);
+ let r = _mm256_maskz_cvtepi64_epi16(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm256_maskz_cvtepi64_epi16(0b11111111, a);
+ let e = _mm_set_epi16(0, 0, 0, 0, 12, 13, 14, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cvtepi64_epi16() {
+ let a = _mm_set_epi64x(14, 15);
+ let r = _mm_cvtepi64_epi16(a);
+ let e = _mm_set_epi16(0, 0, 0, 0, 0, 0, 14, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtepi64_epi16() {
+ let a = _mm_set_epi64x(14, 15);
+ let src = _mm_set1_epi16(0);
+ let r = _mm_mask_cvtepi64_epi16(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_cvtepi64_epi16(src, 0b11111111, a);
+ let e = _mm_set_epi16(0, 0, 0, 0, 0, 0, 14, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_cvtepi64_epi16() {
+ let a = _mm_set_epi64x(14, 15);
+ let r = _mm_maskz_cvtepi64_epi16(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_cvtepi64_epi16(0b11111111, a);
+ let e = _mm_set_epi16(0, 0, 0, 0, 0, 0, 14, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtepi64_epi8() {
+ let a = _mm512_set_epi64(8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_cvtepi64_epi8(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")]
+ unsafe fn test_mm512_mask_cvtepi64_epi8() {
+ let a = _mm512_set_epi64(8, 9, 10, 11, 12, 13, 14, 15);
+ let src = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1);
+ let r = _mm512_mask_cvtepi64_epi8(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm512_mask_cvtepi64_epi8(src, 0b00001111, a);
+ let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, 12, 13, 14, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvtepi64_epi8() {
+ let a = _mm512_set_epi64(8, 9, 10, 11, 12, 13, 14, 15);
+ let r = _mm512_maskz_cvtepi64_epi8(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm512_maskz_cvtepi64_epi8(0b00001111, a);
+ let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 13, 14, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cvtepi64_epi8() {
+ let a = _mm256_set_epi64x(12, 13, 14, 15);
+ let r = _mm256_cvtepi64_epi8(a);
+ let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 13, 14, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cvtepi64_epi8() {
+ let a = _mm256_set_epi64x(12, 13, 14, 15);
+ let src = _mm_set1_epi8(0);
+ let r = _mm256_mask_cvtepi64_epi8(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm256_mask_cvtepi64_epi8(src, 0b00001111, a);
+ let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 13, 14, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_cvtepi64_epi8() {
+ let a = _mm256_set_epi64x(12, 13, 14, 15);
+ let r = _mm256_maskz_cvtepi64_epi8(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm256_maskz_cvtepi64_epi8(0b00001111, a);
+ let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 13, 14, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cvtepi64_epi8() {
+ let a = _mm_set_epi64x(14, 15);
+ let r = _mm_cvtepi64_epi8(a);
+ let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtepi64_epi8() {
+ let a = _mm_set_epi64x(14, 15);
+ let src = _mm_set1_epi8(0);
+ let r = _mm_mask_cvtepi64_epi8(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_cvtepi64_epi8(src, 0b00000011, a);
+ let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_cvtepi64_epi8() {
+ let a = _mm_set_epi64x(14, 15);
+ let r = _mm_maskz_cvtepi64_epi8(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_cvtepi64_epi8(0b00000011, a);
+ let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtsepi64_epi32() {
+ let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, i64::MIN, i64::MAX);
+ let r = _mm512_cvtsepi64_epi32(a);
+ let e = _mm256_set_epi32(0, 1, 2, 3, 4, 5, i32::MIN, i32::MAX);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtsepi64_epi32() {
+ let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, i64::MIN, i64::MAX);
+ let src = _mm256_set1_epi32(-1);
+ let r = _mm512_mask_cvtsepi64_epi32(src, 0, a);
+ assert_eq_m256i(r, src);
+ let r = _mm512_mask_cvtsepi64_epi32(src, 0b00001111, a);
+ let e = _mm256_set_epi32(-1, -1, -1, -1, 4, 5, i32::MIN, i32::MAX);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvtsepi64_epi32() {
+ let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, i64::MIN, i64::MAX);
+ let r = _mm512_maskz_cvtsepi64_epi32(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm512_maskz_cvtsepi64_epi32(0b00001111, a);
+ let e = _mm256_set_epi32(0, 0, 0, 0, 4, 5, i32::MIN, i32::MAX);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cvtsepi64_epi32() {
+ let a = _mm256_set_epi64x(4, 5, i64::MIN, i64::MAX);
+ let r = _mm256_cvtsepi64_epi32(a);
+ let e = _mm_set_epi32(4, 5, i32::MIN, i32::MAX);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cvtsepi64_epi32() {
+ let a = _mm256_set_epi64x(4, 5, i64::MIN, i64::MAX);
+ let src = _mm_set1_epi32(-1);
+ let r = _mm256_mask_cvtsepi64_epi32(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm256_mask_cvtsepi64_epi32(src, 0b00001111, a);
+ let e = _mm_set_epi32(4, 5, i32::MIN, i32::MAX);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_cvtsepi64_epi32() {
+ let a = _mm256_set_epi64x(4, 5, i64::MIN, i64::MAX);
+ let r = _mm256_maskz_cvtsepi64_epi32(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm256_maskz_cvtsepi64_epi32(0b00001111, a);
+ let e = _mm_set_epi32(4, 5, i32::MIN, i32::MAX);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cvtsepi64_epi32() {
+ let a = _mm_set_epi64x(i64::MIN, i64::MAX);
+ let r = _mm_cvtsepi64_epi32(a);
+ let e = _mm_set_epi32(0, 0, i32::MIN, i32::MAX);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtsepi64_epi32() {
+ let a = _mm_set_epi64x(i64::MIN, i64::MAX);
+ let src = _mm_set1_epi32(0);
+ let r = _mm_mask_cvtsepi64_epi32(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_cvtsepi64_epi32(src, 0b00000011, a);
+ let e = _mm_set_epi32(0, 0, i32::MIN, i32::MAX);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_cvtsepi64_epi32() {
+ let a = _mm_set_epi64x(i64::MIN, i64::MAX);
+ let r = _mm_maskz_cvtsepi64_epi32(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_cvtsepi64_epi32(0b00000011, a);
+ let e = _mm_set_epi32(0, 0, i32::MIN, i32::MAX);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtsepi64_epi16() {
+ let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, i64::MIN, i64::MAX);
+ let r = _mm512_cvtsepi64_epi16(a);
+ let e = _mm_set_epi16(0, 1, 2, 3, 4, 5, i16::MIN, i16::MAX);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtsepi64_epi16() {
+ let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, i64::MIN, i64::MAX);
+ let src = _mm_set1_epi16(-1);
+ let r = _mm512_mask_cvtsepi64_epi16(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm512_mask_cvtsepi64_epi16(src, 0b00001111, a);
+ let e = _mm_set_epi16(-1, -1, -1, -1, 4, 5, i16::MIN, i16::MAX);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvtsepi64_epi16() {
+ let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, i64::MIN, i64::MAX);
+ let r = _mm512_maskz_cvtsepi64_epi16(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm512_maskz_cvtsepi64_epi16(0b00001111, a);
+ let e = _mm_set_epi16(0, 0, 0, 0, 4, 5, i16::MIN, i16::MAX);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cvtsepi64_epi16() {
+ let a = _mm256_set_epi64x(4, 5, i64::MIN, i64::MAX);
+ let r = _mm256_cvtsepi64_epi16(a);
+ let e = _mm_set_epi16(0, 0, 0, 0, 4, 5, i16::MIN, i16::MAX);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cvtsepi64_epi16() {
+ let a = _mm256_set_epi64x(4, 5, i64::MIN, i64::MAX);
+ let src = _mm_set1_epi16(0);
+ let r = _mm256_mask_cvtsepi64_epi16(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm256_mask_cvtsepi64_epi16(src, 0b00001111, a);
+ let e = _mm_set_epi16(0, 0, 0, 0, 4, 5, i16::MIN, i16::MAX);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_cvtsepi64_epi16() {
+ let a = _mm256_set_epi64x(4, 5, i64::MIN, i64::MAX);
+ let r = _mm256_maskz_cvtsepi64_epi16(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm256_maskz_cvtsepi64_epi16(0b00001111, a);
+ let e = _mm_set_epi16(0, 0, 0, 0, 4, 5, i16::MIN, i16::MAX);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cvtsepi64_epi16() {
+ let a = _mm_set_epi64x(i64::MIN, i64::MAX);
+ let r = _mm_cvtsepi64_epi16(a);
+ let e = _mm_set_epi16(0, 0, 0, 0, 0, 0, i16::MIN, i16::MAX);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtsepi64_epi16() {
+ let a = _mm_set_epi64x(i64::MIN, i64::MAX);
+ let src = _mm_set1_epi16(0);
+ let r = _mm_mask_cvtsepi64_epi16(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_cvtsepi64_epi16(src, 0b00000011, a);
+ let e = _mm_set_epi16(0, 0, 0, 0, 0, 0, i16::MIN, i16::MAX);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_cvtsepi64_epi16() {
+ let a = _mm_set_epi64x(i64::MIN, i64::MAX);
+ let r = _mm_maskz_cvtsepi64_epi16(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_cvtsepi64_epi16(0b00000011, a);
+ let e = _mm_set_epi16(0, 0, 0, 0, 0, 0, i16::MIN, i16::MAX);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtsepi64_epi8() {
+ let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, i64::MIN, i64::MAX);
+ let r = _mm512_cvtsepi64_epi8(a);
+ let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, i8::MIN, i8::MAX);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtsepi64_epi8() {
+ let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, i64::MIN, i64::MAX);
+ let src = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1);
+ let r = _mm512_mask_cvtsepi64_epi8(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm512_mask_cvtsepi64_epi8(src, 0b00001111, a);
+ #[rustfmt::skip]
+ let e = _mm_set_epi8(
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ -1, -1, -1, -1,
+ 4, 5, i8::MIN, i8::MAX,
+ );
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvtsepi64_epi8() {
+ let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, i64::MIN, i64::MAX);
+ let r = _mm512_maskz_cvtsepi64_epi8(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm512_maskz_cvtsepi64_epi8(0b00001111, a);
+ let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, i8::MIN, i8::MAX);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cvtsepi64_epi8() {
+ let a = _mm256_set_epi64x(4, 5, i64::MIN, i64::MAX);
+ let r = _mm256_cvtsepi64_epi8(a);
+ let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, i8::MIN, i8::MAX);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cvtsepi64_epi8() {
+ let a = _mm256_set_epi64x(4, 5, i64::MIN, i64::MAX);
+ let src = _mm_set1_epi8(0);
+ let r = _mm256_mask_cvtsepi64_epi8(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm256_mask_cvtsepi64_epi8(src, 0b00001111, a);
+ let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, i8::MIN, i8::MAX);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_cvtsepi64_epi8() {
+ let a = _mm256_set_epi64x(4, 5, i64::MIN, i64::MAX);
+ let r = _mm256_maskz_cvtsepi64_epi8(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm256_maskz_cvtsepi64_epi8(0b00001111, a);
+ let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, i8::MIN, i8::MAX);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cvtsepi64_epi8() {
+ let a = _mm_set_epi64x(i64::MIN, i64::MAX);
+ let r = _mm_cvtsepi64_epi8(a);
+ let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i8::MIN, i8::MAX);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtsepi64_epi8() {
+ let a = _mm_set_epi64x(i64::MIN, i64::MAX);
+ let src = _mm_set1_epi8(0);
+ let r = _mm_mask_cvtsepi64_epi8(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_cvtsepi64_epi8(src, 0b00000011, a);
+ let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i8::MIN, i8::MAX);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_cvtsepi64_epi8() {
+ let a = _mm_set_epi64x(i64::MIN, i64::MAX);
+ let r = _mm_maskz_cvtsepi64_epi8(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_cvtsepi64_epi8(0b00000011, a);
+ let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i8::MIN, i8::MAX);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtusepi64_epi32() {
+ let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, i64::MIN, i64::MIN);
+ let r = _mm512_cvtusepi64_epi32(a);
+ let e = _mm256_set_epi32(0, 1, 2, 3, 4, 5, -1, -1);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtusepi64_epi32() {
+ let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, i64::MIN, i64::MIN);
+ let src = _mm256_set1_epi32(-1);
+ let r = _mm512_mask_cvtusepi64_epi32(src, 0, a);
+ assert_eq_m256i(r, src);
+ let r = _mm512_mask_cvtusepi64_epi32(src, 0b00001111, a);
+ let e = _mm256_set_epi32(-1, -1, -1, -1, 4, 5, -1, -1);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvtusepi64_epi32() {
+ let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, i64::MIN, i64::MIN);
+ let r = _mm512_maskz_cvtusepi64_epi32(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm512_maskz_cvtusepi64_epi32(0b00001111, a);
+ let e = _mm256_set_epi32(0, 0, 0, 0, 4, 5, -1, -1);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cvtusepi64_epi32() {
+ let a = _mm256_set_epi64x(4, 5, 6, i64::MAX);
+ let r = _mm256_cvtusepi64_epi32(a);
+ let e = _mm_set_epi32(4, 5, 6, u32::MAX as i32);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cvtusepi64_epi32() {
+ let a = _mm256_set_epi64x(4, 5, 6, i64::MAX);
+ let src = _mm_set1_epi32(0);
+ let r = _mm256_mask_cvtusepi64_epi32(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm256_mask_cvtusepi64_epi32(src, 0b00001111, a);
+ let e = _mm_set_epi32(4, 5, 6, u32::MAX as i32);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_cvtusepi64_epi32() {
+ let a = _mm256_set_epi64x(4, 5, 6, i64::MAX);
+ let r = _mm256_maskz_cvtusepi64_epi32(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm256_maskz_cvtusepi64_epi32(0b00001111, a);
+ let e = _mm_set_epi32(4, 5, 6, u32::MAX as i32);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cvtusepi64_epi32() {
+ let a = _mm_set_epi64x(6, i64::MAX);
+ let r = _mm_cvtusepi64_epi32(a);
+ let e = _mm_set_epi32(0, 0, 6, u32::MAX as i32);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtusepi64_epi32() {
+ let a = _mm_set_epi64x(6, i64::MAX);
+ let src = _mm_set1_epi32(0);
+ let r = _mm_mask_cvtusepi64_epi32(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_cvtusepi64_epi32(src, 0b00000011, a);
+ let e = _mm_set_epi32(0, 0, 6, u32::MAX as i32);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_cvtusepi64_epi32() {
+ let a = _mm_set_epi64x(6, i64::MAX);
+ let r = _mm_maskz_cvtusepi64_epi32(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_cvtusepi64_epi32(0b00000011, a);
+ let e = _mm_set_epi32(0, 0, 6, u32::MAX as i32);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtusepi64_epi16() {
+ let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, i64::MIN, i64::MIN);
+ let r = _mm512_cvtusepi64_epi16(a);
+ let e = _mm_set_epi16(0, 1, 2, 3, 4, 5, -1, -1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtusepi64_epi16() {
+ let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, i64::MIN, i64::MIN);
+ let src = _mm_set1_epi16(-1);
+ let r = _mm512_mask_cvtusepi64_epi16(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm512_mask_cvtusepi64_epi16(src, 0b00001111, a);
+ let e = _mm_set_epi16(-1, -1, -1, -1, 4, 5, -1, -1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvtusepi64_epi16() {
+ let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, i64::MIN, i64::MIN);
+ let r = _mm512_maskz_cvtusepi64_epi16(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm512_maskz_cvtusepi64_epi16(0b00001111, a);
+ let e = _mm_set_epi16(0, 0, 0, 0, 4, 5, -1, -1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cvtusepi64_epi16() {
+ let a = _mm256_set_epi64x(4, 5, 6, i64::MAX);
+ let r = _mm256_cvtusepi64_epi16(a);
+ let e = _mm_set_epi16(0, 0, 0, 0, 4, 5, 6, u16::MAX as i16);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cvtusepi64_epi16() {
+ let a = _mm256_set_epi64x(4, 5, 6, i64::MAX);
+ let src = _mm_set1_epi16(0);
+ let r = _mm256_mask_cvtusepi64_epi16(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm256_mask_cvtusepi64_epi16(src, 0b00001111, a);
+ let e = _mm_set_epi16(0, 0, 0, 0, 4, 5, 6, u16::MAX as i16);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_cvtusepi64_epi16() {
+ let a = _mm256_set_epi64x(4, 5, 6, i64::MAX);
+ let r = _mm256_maskz_cvtusepi64_epi16(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm256_maskz_cvtusepi64_epi16(0b00001111, a);
+ let e = _mm_set_epi16(0, 0, 0, 0, 4, 5, 6, u16::MAX as i16);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cvtusepi64_epi16() {
+ let a = _mm_set_epi64x(6, i64::MAX);
+ let r = _mm_cvtusepi64_epi16(a);
+ let e = _mm_set_epi16(0, 0, 0, 0, 0, 0, 6, u16::MAX as i16);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtusepi64_epi16() {
+ let a = _mm_set_epi64x(6, i64::MAX);
+ let src = _mm_set1_epi16(0);
+ let r = _mm_mask_cvtusepi64_epi16(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_cvtusepi64_epi16(src, 0b00000011, a);
+ let e = _mm_set_epi16(0, 0, 0, 0, 0, 0, 6, u16::MAX as i16);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_cvtusepi64_epi16() {
+ let a = _mm_set_epi64x(6, i64::MAX);
+ let r = _mm_maskz_cvtusepi64_epi16(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_cvtusepi64_epi16(0b00000011, a);
+ let e = _mm_set_epi16(0, 0, 0, 0, 0, 0, 6, u16::MAX as i16);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtusepi64_epi8() {
+ let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, i64::MIN, i64::MIN);
+ let r = _mm512_cvtusepi64_epi8(a);
+ let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, -1, -1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtusepi64_epi8() {
+ let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, i64::MIN, i64::MIN);
+ let src = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1);
+ let r = _mm512_mask_cvtusepi64_epi8(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm512_mask_cvtusepi64_epi8(src, 0b00001111, a);
+ let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, 4, 5, -1, -1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvtusepi64_epi8() {
+ let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, i64::MIN, i64::MIN);
+ let r = _mm512_maskz_cvtusepi64_epi8(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm512_maskz_cvtusepi64_epi8(0b00001111, a);
+ let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, -1, -1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cvtusepi64_epi8() {
+ let a = _mm256_set_epi64x(4, 5, 6, i64::MAX);
+ let r = _mm256_cvtusepi64_epi8(a);
+ let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 6, u8::MAX as i8);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cvtusepi64_epi8() {
+ let a = _mm256_set_epi64x(4, 5, 6, i64::MAX);
+ let src = _mm_set1_epi8(0);
+ let r = _mm256_mask_cvtusepi64_epi8(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm256_mask_cvtusepi64_epi8(src, 0b00001111, a);
+ let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 6, u8::MAX as i8);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_cvtusepi64_epi8() {
+ let a = _mm256_set_epi64x(4, 5, 6, i64::MAX);
+ let r = _mm256_maskz_cvtusepi64_epi8(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm256_maskz_cvtusepi64_epi8(0b00001111, a);
+ let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 6, u8::MAX as i8);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cvtusepi64_epi8() {
+ let a = _mm_set_epi64x(6, i64::MAX);
+ let r = _mm_cvtusepi64_epi8(a);
+ let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, u8::MAX as i8);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtusepi64_epi8() {
+ let a = _mm_set_epi64x(6, i64::MAX);
+ let src = _mm_set1_epi8(0);
+ let r = _mm_mask_cvtusepi64_epi8(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_cvtusepi64_epi8(src, 0b00000011, a);
+ let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, u8::MAX as i8);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_cvtusepi64_epi8() {
+ let a = _mm_set_epi64x(6, i64::MAX);
+ let r = _mm_maskz_cvtusepi64_epi8(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_cvtusepi64_epi8(0b00000011, a);
+ let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, u8::MAX as i8);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtt_roundpd_epi32() {
+ let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5);
+ let r = _mm512_cvtt_roundpd_epi32::<_MM_FROUND_NO_EXC>(a);
+ let e = _mm256_setr_epi32(0, -1, 2, -3, 4, -5, 6, -7);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtt_roundpd_epi32() {
+ let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5);
+ let src = _mm256_set1_epi32(0);
+ let r = _mm512_mask_cvtt_roundpd_epi32::<_MM_FROUND_NO_EXC>(src, 0, a);
+ assert_eq_m256i(r, src);
+ let r = _mm512_mask_cvtt_roundpd_epi32::<_MM_FROUND_NO_EXC>(src, 0b00001111, a);
+ let e = _mm256_setr_epi32(0, -1, 2, -3, 0, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvtt_roundpd_epi32() {
+ let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5);
+ let r = _mm512_maskz_cvtt_roundpd_epi32::<_MM_FROUND_NO_EXC>(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm512_maskz_cvtt_roundpd_epi32::<_MM_FROUND_NO_EXC>(0b00001111, a);
+ let e = _mm256_setr_epi32(0, -1, 2, -3, 0, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvtt_roundpd_epu32() {
+ let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5);
+ let r = _mm512_cvtt_roundpd_epu32::<_MM_FROUND_NO_EXC>(a);
+ let e = _mm256_setr_epi32(0, -1, 2, -1, 4, -1, 6, -1);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtt_roundpd_epu32() {
+ let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5);
+ let src = _mm256_set1_epi32(0);
+ let r = _mm512_mask_cvtt_roundpd_epu32::<_MM_FROUND_NO_EXC>(src, 0, a);
+ assert_eq_m256i(r, src);
+ let r = _mm512_mask_cvtt_roundpd_epu32::<_MM_FROUND_NO_EXC>(src, 0b00001111, a);
+ let e = _mm256_setr_epi32(0, -1, 2, -1, 0, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvtt_roundpd_epu32() {
+ let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5);
+ let r = _mm512_maskz_cvtt_roundpd_epu32::<_MM_FROUND_NO_EXC>(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm512_maskz_cvtt_roundpd_epu32::<_MM_FROUND_NO_EXC>(0b00001111, a);
+ let e = _mm256_setr_epi32(0, -1, 2, -1, 0, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvttpd_epi32() {
+ let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5);
+ let r = _mm512_cvttpd_epi32(a);
+ let e = _mm256_setr_epi32(0, -1, 2, -3, 4, -5, 6, -7);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvttpd_epi32() {
+ let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5);
+ let src = _mm256_set1_epi32(0);
+ let r = _mm512_mask_cvttpd_epi32(src, 0, a);
+ assert_eq_m256i(r, src);
+ let r = _mm512_mask_cvttpd_epi32(src, 0b00001111, a);
+ let e = _mm256_setr_epi32(0, -1, 2, -3, 0, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvttpd_epi32() {
+ let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5);
+ let r = _mm512_maskz_cvttpd_epi32(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm512_maskz_cvttpd_epi32(0b00001111, a);
+ let e = _mm256_setr_epi32(0, -1, 2, -3, 0, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cvttpd_epi32() {
+ let a = _mm256_setr_pd(4., -5.5, 6., -7.5);
+ let src = _mm_set1_epi32(0);
+ let r = _mm256_mask_cvttpd_epi32(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm256_mask_cvttpd_epi32(src, 0b00001111, a);
+ let e = _mm_setr_epi32(4, -5, 6, -7);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_cvttpd_epi32() {
+ let a = _mm256_setr_pd(4., -5.5, 6., -7.5);
+ let r = _mm256_maskz_cvttpd_epi32(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm256_maskz_cvttpd_epi32(0b00001111, a);
+ let e = _mm_setr_epi32(4, -5, 6, -7);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvttpd_epi32() {
+ let a = _mm_set_pd(6., -7.5);
+ let src = _mm_set1_epi32(0);
+ let r = _mm_mask_cvttpd_epi32(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_cvttpd_epi32(src, 0b00000011, a);
+ let e = _mm_set_epi32(0, 0, 6, -7);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_cvttpd_epi32() {
+ let a = _mm_set_pd(6., -7.5);
+ let r = _mm_maskz_cvttpd_epi32(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_cvttpd_epi32(0b00000011, a);
+ let e = _mm_set_epi32(0, 0, 6, -7);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvttpd_epu32() {
+ let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5);
+ let r = _mm512_cvttpd_epu32(a);
+ let e = _mm256_setr_epi32(0, -1, 2, -1, 4, -1, 6, -1);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvttpd_epu32() {
+ let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5);
+ let src = _mm256_set1_epi32(0);
+ let r = _mm512_mask_cvttpd_epu32(src, 0, a);
+ assert_eq_m256i(r, src);
+ let r = _mm512_mask_cvttpd_epu32(src, 0b00001111, a);
+ let e = _mm256_setr_epi32(0, -1, 2, -1, 0, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvttpd_epu32() {
+ let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5);
+ let r = _mm512_maskz_cvttpd_epu32(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm512_maskz_cvttpd_epu32(0b00001111, a);
+ let e = _mm256_setr_epi32(0, -1, 2, -1, 0, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cvttpd_epu32() {
+ let a = _mm256_set_pd(4., 5.5, 6., 7.5);
+ let r = _mm256_cvttpd_epu32(a);
+ let e = _mm_set_epi32(4, 5, 6, 7);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cvttpd_epu32() {
+ let a = _mm256_set_pd(4., 5.5, 6., 7.5);
+ let src = _mm_set1_epi32(0);
+ let r = _mm256_mask_cvttpd_epu32(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm256_mask_cvttpd_epu32(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_mm256_maskz_cvttpd_epu32() {
+ let a = _mm256_set_pd(4., 5.5, 6., 7.5);
+ let r = _mm256_maskz_cvttpd_epu32(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm256_maskz_cvttpd_epu32(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_cvttpd_epu32() {
+ let a = _mm_set_pd(6., 7.5);
+ let r = _mm_cvttpd_epu32(a);
+ let e = _mm_set_epi32(0, 0, 6, 7);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvttpd_epu32() {
+ let a = _mm_set_pd(6., 7.5);
+ let src = _mm_set1_epi32(0);
+ let r = _mm_mask_cvttpd_epu32(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_cvttpd_epu32(src, 0b00000011, a);
+ let e = _mm_set_epi32(0, 0, 6, 7);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_cvttpd_epu32() {
+ let a = _mm_set_pd(6., 7.5);
+ let r = _mm_maskz_cvttpd_epu32(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_cvttpd_epu32(0b00000011, a);
+ let e = _mm_set_epi32(0, 0, 6, 7);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_add_round_pd() {
+ let a = _mm512_setr_pd(8., 9.5, 10., 11.5, 12., 13.5, 14., 0.000000000000000007);
+ let b = _mm512_set1_pd(-1.);
+ let r = _mm512_add_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b);
+ let e = _mm512_setr_pd(7., 8.5, 9., 10.5, 11., 12.5, 13., -1.0);
+ assert_eq_m512d(r, e);
+ let r = _mm512_add_round_pd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b);
+ let e = _mm512_setr_pd(7., 8.5, 9., 10.5, 11., 12.5, 13., -0.9999999999999999);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_add_round_pd() {
+ let a = _mm512_setr_pd(8., 9.5, 10., 11.5, 12., 13.5, 14., 0.000000000000000007);
+ let b = _mm512_set1_pd(-1.);
+ let r = _mm512_mask_add_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0, a, b,
+ );
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_add_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0b11110000, a, b,
+ );
+ let e = _mm512_setr_pd(8., 9.5, 10., 11.5, 11., 12.5, 13., -1.0);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_add_round_pd() {
+ let a = _mm512_setr_pd(8., 9.5, 10., 11.5, 12., 13.5, 14., 0.000000000000000007);
+ let b = _mm512_set1_pd(-1.);
+ let r =
+ _mm512_maskz_add_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(0, a, b);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_add_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0b11110000, a, b,
+ );
+ let e = _mm512_setr_pd(0., 0., 0., 0., 11., 12.5, 13., -1.0);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_sub_round_pd() {
+ let a = _mm512_setr_pd(8., 9.5, 10., 11.5, 12., 13.5, 14., 0.000000000000000007);
+ let b = _mm512_set1_pd(1.);
+ let r = _mm512_sub_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b);
+ let e = _mm512_setr_pd(7., 8.5, 9., 10.5, 11., 12.5, 13., -1.0);
+ assert_eq_m512d(r, e);
+ let r = _mm512_sub_round_pd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b);
+ let e = _mm512_setr_pd(7., 8.5, 9., 10.5, 11., 12.5, 13., -0.9999999999999999);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_sub_round_pd() {
+ let a = _mm512_setr_pd(8., 9.5, 10., 11.5, 12., 13.5, 14., 0.000000000000000007);
+ let b = _mm512_set1_pd(1.);
+ let r = _mm512_mask_sub_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0, a, b,
+ );
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_sub_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0b11110000, a, b,
+ );
+ let e = _mm512_setr_pd(8., 9.5, 10., 11.5, 11., 12.5, 13., -1.0);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_sub_round_pd() {
+ let a = _mm512_setr_pd(8., 9.5, 10., 11.5, 12., 13.5, 14., 0.000000000000000007);
+ let b = _mm512_set1_pd(1.);
+ let r =
+ _mm512_maskz_sub_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(0, a, b);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_sub_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0b11110000, a, b,
+ );
+ let e = _mm512_setr_pd(0., 0., 0., 0., 11., 12.5, 13., -1.0);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mul_round_pd() {
+ let a = _mm512_setr_pd(8., 9.5, 10., 11.5, 12., 13.5, 14., 0.);
+ let b = _mm512_set1_pd(0.1);
+ let r = _mm512_mul_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b);
+ let e = _mm512_setr_pd(
+ 0.8,
+ 0.9500000000000001,
+ 1.,
+ 1.1500000000000001,
+ 1.2000000000000002,
+ 1.35,
+ 1.4000000000000001,
+ 0.,
+ );
+ assert_eq_m512d(r, e);
+ let r = _mm512_mul_round_pd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b);
+ let e = _mm512_setr_pd(0.8, 0.95, 1.0, 1.15, 1.2, 1.3499999999999999, 1.4, 0.0);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_mul_round_pd() {
+ let a = _mm512_setr_pd(8., 9.5, 10., 11.5, 12., 13.5, 14., 0.);
+ let b = _mm512_set1_pd(0.1);
+ let r = _mm512_mask_mul_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0, a, b,
+ );
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_mul_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0b11110000, a, b,
+ );
+ let e = _mm512_setr_pd(
+ 8.,
+ 9.5,
+ 10.,
+ 11.5,
+ 1.2000000000000002,
+ 1.35,
+ 1.4000000000000001,
+ 0.,
+ );
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_mul_round_pd() {
+ let a = _mm512_setr_pd(8., 9.5, 10., 11.5, 12., 13.5, 14., 0.);
+ let b = _mm512_set1_pd(0.1);
+ let r =
+ _mm512_maskz_mul_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(0, a, b);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_mul_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0b11110000, a, b,
+ );
+ let e = _mm512_setr_pd(
+ 0.,
+ 0.,
+ 0.,
+ 0.,
+ 1.2000000000000002,
+ 1.35,
+ 1.4000000000000001,
+ 0.,
+ );
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_div_round_pd() {
+ let a = _mm512_set1_pd(1.);
+ let b = _mm512_set1_pd(3.);
+ let r = _mm512_div_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b);
+ let e = _mm512_set1_pd(0.3333333333333333);
+ assert_eq_m512d(r, e);
+ let r = _mm512_div_round_pd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b);
+ let e = _mm512_set1_pd(0.3333333333333333);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_div_round_pd() {
+ let a = _mm512_set1_pd(1.);
+ let b = _mm512_set1_pd(3.);
+ let r = _mm512_mask_div_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0, a, b,
+ );
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_div_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0b11110000, a, b,
+ );
+ let e = _mm512_setr_pd(
+ 1.,
+ 1.,
+ 1.,
+ 1.,
+ 0.3333333333333333,
+ 0.3333333333333333,
+ 0.3333333333333333,
+ 0.3333333333333333,
+ );
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_div_round_pd() {
+ let a = _mm512_set1_pd(1.);
+ let b = _mm512_set1_pd(3.);
+ let r =
+ _mm512_maskz_div_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(0, a, b);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_div_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0b11110000, a, b,
+ );
+ let e = _mm512_setr_pd(
+ 0.,
+ 0.,
+ 0.,
+ 0.,
+ 0.3333333333333333,
+ 0.3333333333333333,
+ 0.3333333333333333,
+ 0.3333333333333333,
+ );
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_sqrt_round_pd() {
+ let a = _mm512_set1_pd(3.);
+ let r = _mm512_sqrt_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a);
+ let e = _mm512_set1_pd(1.7320508075688772);
+ assert_eq_m512d(r, e);
+ let r = _mm512_sqrt_round_pd::<{ _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC }>(a);
+ let e = _mm512_set1_pd(1.7320508075688774);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_sqrt_round_pd() {
+ let a = _mm512_set1_pd(3.);
+ let r =
+ _mm512_mask_sqrt_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, 0, a);
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_sqrt_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0b11110000, a,
+ );
+ let e = _mm512_setr_pd(
+ 3.,
+ 3.,
+ 3.,
+ 3.,
+ 1.7320508075688772,
+ 1.7320508075688772,
+ 1.7320508075688772,
+ 1.7320508075688772,
+ );
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_sqrt_round_pd() {
+ let a = _mm512_set1_pd(3.);
+ let r =
+ _mm512_maskz_sqrt_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(0, a);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_sqrt_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0b11110000, a,
+ );
+ let e = _mm512_setr_pd(
+ 0.,
+ 0.,
+ 0.,
+ 0.,
+ 1.7320508075688772,
+ 1.7320508075688772,
+ 1.7320508075688772,
+ 1.7320508075688772,
+ );
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_fmadd_round_pd() {
+ let a = _mm512_set1_pd(0.000000000000000007);
+ let b = _mm512_set1_pd(1.);
+ let c = _mm512_set1_pd(-1.);
+ let r = _mm512_fmadd_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b, c);
+ let e = _mm512_set1_pd(-1.);
+ assert_eq_m512d(r, e);
+ let r = _mm512_fmadd_round_pd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b, c);
+ let e = _mm512_set1_pd(-0.9999999999999999);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_fmadd_round_pd() {
+ let a = _mm512_set1_pd(0.000000000000000007);
+ let b = _mm512_set1_pd(1.);
+ let c = _mm512_set1_pd(-1.);
+ let r = _mm512_mask_fmadd_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0, b, c,
+ );
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_fmadd_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0b00001111, b, c,
+ );
+ let e = _mm512_setr_pd(
+ -1.,
+ -1.,
+ -1.,
+ -1.,
+ 0.000000000000000007,
+ 0.000000000000000007,
+ 0.000000000000000007,
+ 0.000000000000000007,
+ );
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_fmadd_round_pd() {
+ let a = _mm512_set1_pd(0.000000000000000007);
+ let b = _mm512_set1_pd(1.);
+ let c = _mm512_set1_pd(-1.);
+ let r = _mm512_maskz_fmadd_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0, a, b, c,
+ );
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_fmadd_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0b00001111, a, b, c,
+ );
+ let e = _mm512_setr_pd(-1., -1., -1., -1., 0., 0., 0., 0.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask3_fmadd_round_pd() {
+ let a = _mm512_set1_pd(0.000000000000000007);
+ let b = _mm512_set1_pd(1.);
+ let c = _mm512_set1_pd(-1.);
+ let r = _mm512_mask3_fmadd_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, b, c, 0,
+ );
+ assert_eq_m512d(r, c);
+ let r = _mm512_mask3_fmadd_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, b, c, 0b00001111,
+ );
+ let e = _mm512_setr_pd(-1., -1., -1., -1., -1., -1., -1., -1.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_fmsub_round_pd() {
+ let a = _mm512_set1_pd(0.000000000000000007);
+ let b = _mm512_set1_pd(1.);
+ let c = _mm512_set1_pd(1.);
+ let r = _mm512_fmsub_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b, c);
+ let e = _mm512_set1_pd(-1.);
+ assert_eq_m512d(r, e);
+ let r = _mm512_fmsub_round_pd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b, c);
+ let e = _mm512_set1_pd(-0.9999999999999999);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_fmsub_round_pd() {
+ let a = _mm512_set1_pd(0.000000000000000007);
+ let b = _mm512_set1_pd(1.);
+ let c = _mm512_set1_pd(1.);
+ let r = _mm512_mask_fmsub_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0, b, c,
+ );
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_fmsub_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0b00001111, b, c,
+ );
+ let e = _mm512_setr_pd(
+ -1.,
+ -1.,
+ -1.,
+ -1.,
+ 0.000000000000000007,
+ 0.000000000000000007,
+ 0.000000000000000007,
+ 0.000000000000000007,
+ );
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_fmsub_round_pd() {
+ let a = _mm512_set1_pd(0.000000000000000007);
+ let b = _mm512_set1_pd(1.);
+ let c = _mm512_set1_pd(1.);
+ let r = _mm512_maskz_fmsub_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0, a, b, c,
+ );
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_fmsub_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0b00001111, a, b, c,
+ );
+ let e = _mm512_setr_pd(-1., -1., -1., -1., 0., 0., 0., 0.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask3_fmsub_round_pd() {
+ let a = _mm512_set1_pd(0.000000000000000007);
+ let b = _mm512_set1_pd(1.);
+ let c = _mm512_set1_pd(1.);
+ let r = _mm512_mask3_fmsub_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, b, c, 0,
+ );
+ assert_eq_m512d(r, c);
+ let r = _mm512_mask3_fmsub_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, b, c, 0b00001111,
+ );
+ let e = _mm512_setr_pd(-1., -1., -1., -1., 1., 1., 1., 1.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_fmaddsub_round_pd() {
+ let a = _mm512_set1_pd(0.000000000000000007);
+ let b = _mm512_set1_pd(1.);
+ let c = _mm512_set1_pd(-1.);
+ let r =
+ _mm512_fmaddsub_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b, c);
+ let e = _mm512_setr_pd(1., -1., 1., -1., 1., -1., 1., -1.);
+ assert_eq_m512d(r, e);
+ let r = _mm512_fmaddsub_round_pd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b, c);
+ let e = _mm512_setr_pd(
+ 1.,
+ -0.9999999999999999,
+ 1.,
+ -0.9999999999999999,
+ 1.,
+ -0.9999999999999999,
+ 1.,
+ -0.9999999999999999,
+ );
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_fmaddsub_round_pd() {
+ let a = _mm512_set1_pd(0.000000000000000007);
+ let b = _mm512_set1_pd(1.);
+ let c = _mm512_set1_pd(-1.);
+ let r = _mm512_mask_fmaddsub_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0, b, c,
+ );
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_fmaddsub_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0b00001111, b, c,
+ );
+ let e = _mm512_setr_pd(
+ 1.,
+ -1.,
+ 1.,
+ -1.,
+ 0.000000000000000007,
+ 0.000000000000000007,
+ 0.000000000000000007,
+ 0.000000000000000007,
+ );
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_fmaddsub_round_pd() {
+ let a = _mm512_set1_pd(0.000000000000000007);
+ let b = _mm512_set1_pd(1.);
+ let c = _mm512_set1_pd(-1.);
+ let r = _mm512_maskz_fmaddsub_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0, a, b, c,
+ );
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_fmaddsub_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0b00001111, a, b, c,
+ );
+ let e = _mm512_setr_pd(1., -1., 1., -1., 0., 0., 0., 0.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask3_fmaddsub_round_pd() {
+ let a = _mm512_set1_pd(0.000000000000000007);
+ let b = _mm512_set1_pd(1.);
+ let c = _mm512_set1_pd(-1.);
+ let r = _mm512_mask3_fmaddsub_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, b, c, 0,
+ );
+ assert_eq_m512d(r, c);
+ let r = _mm512_mask3_fmaddsub_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, b, c, 0b00001111,
+ );
+ let e = _mm512_setr_pd(1., -1., 1., -1., -1., -1., -1., -1.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_fmsubadd_round_pd() {
+ let a = _mm512_set1_pd(0.000000000000000007);
+ let b = _mm512_set1_pd(1.);
+ let c = _mm512_set1_pd(-1.);
+ let r =
+ _mm512_fmsubadd_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b, c);
+ let e = _mm512_setr_pd(-1., 1., -1., 1., -1., 1., -1., 1.);
+ assert_eq_m512d(r, e);
+ let r = _mm512_fmsubadd_round_pd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b, c);
+ let e = _mm512_setr_pd(
+ -0.9999999999999999,
+ 1.,
+ -0.9999999999999999,
+ 1.,
+ -0.9999999999999999,
+ 1.,
+ -0.9999999999999999,
+ 1.,
+ );
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_fmsubadd_round_pd() {
+ let a = _mm512_set1_pd(0.000000000000000007);
+ let b = _mm512_set1_pd(1.);
+ let c = _mm512_set1_pd(-1.);
+ let r = _mm512_mask_fmsubadd_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0, b, c,
+ );
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_fmsubadd_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0b00001111, b, c,
+ );
+ let e = _mm512_setr_pd(
+ -1.,
+ 1.,
+ -1.,
+ 1.,
+ 0.000000000000000007,
+ 0.000000000000000007,
+ 0.000000000000000007,
+ 0.000000000000000007,
+ );
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_fmsubadd_round_pd() {
+ let a = _mm512_set1_pd(0.000000000000000007);
+ let b = _mm512_set1_pd(1.);
+ let c = _mm512_set1_pd(-1.);
+ let r = _mm512_maskz_fmsubadd_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0, a, b, c,
+ );
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_fmsubadd_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0b00001111, a, b, c,
+ );
+ let e = _mm512_setr_pd(-1., 1., -1., 1., 0., 0., 0., 0.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask3_fmsubadd_round_pd() {
+ let a = _mm512_set1_pd(0.000000000000000007);
+ let b = _mm512_set1_pd(1.);
+ let c = _mm512_set1_pd(-1.);
+ let r = _mm512_mask3_fmsubadd_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, b, c, 0,
+ );
+ assert_eq_m512d(r, c);
+ let r = _mm512_mask3_fmsubadd_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, b, c, 0b00001111,
+ );
+ let e = _mm512_setr_pd(-1., 1., -1., 1., -1., -1., -1., -1.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_fnmadd_round_pd() {
+ let a = _mm512_set1_pd(0.000000000000000007);
+ let b = _mm512_set1_pd(1.);
+ let c = _mm512_set1_pd(1.);
+ let r =
+ _mm512_fnmadd_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b, c);
+ let e = _mm512_set1_pd(1.);
+ assert_eq_m512d(r, e);
+ let r = _mm512_fnmadd_round_pd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b, c);
+ let e = _mm512_set1_pd(0.9999999999999999);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_fnmadd_round_pd() {
+ let a = _mm512_set1_pd(0.000000000000000007);
+ let b = _mm512_set1_pd(1.);
+ let c = _mm512_set1_pd(1.);
+ let r = _mm512_mask_fnmadd_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0, b, c,
+ );
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_fnmadd_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0b00001111, b, c,
+ );
+ let e = _mm512_setr_pd(
+ 1.,
+ 1.,
+ 1.,
+ 1.,
+ 0.000000000000000007,
+ 0.000000000000000007,
+ 0.000000000000000007,
+ 0.000000000000000007,
+ );
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_fnmadd_round_pd() {
+ let a = _mm512_set1_pd(0.000000000000000007);
+ let b = _mm512_set1_pd(1.);
+ let c = _mm512_set1_pd(1.);
+ let r = _mm512_maskz_fnmadd_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0, a, b, c,
+ );
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_fnmadd_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0b00001111, a, b, c,
+ );
+ let e = _mm512_setr_pd(1., 1., 1., 1., 0., 0., 0., 0.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask3_fnmadd_round_pd() {
+ let a = _mm512_set1_pd(0.000000000000000007);
+ let b = _mm512_set1_pd(1.);
+ let c = _mm512_set1_pd(1.);
+ let r = _mm512_mask3_fnmadd_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, b, c, 0,
+ );
+ assert_eq_m512d(r, c);
+ let r = _mm512_mask3_fnmadd_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, b, c, 0b00001111,
+ );
+ let e = _mm512_setr_pd(1., 1., 1., 1., 1., 1., 1., 1.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_fnmsub_round_pd() {
+ let a = _mm512_set1_pd(0.000000000000000007);
+ let b = _mm512_set1_pd(1.);
+ let c = _mm512_set1_pd(-1.);
+ let r =
+ _mm512_fnmsub_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b, c);
+ let e = _mm512_set1_pd(1.);
+ assert_eq_m512d(r, e);
+ let r = _mm512_fnmsub_round_pd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b, c);
+ let e = _mm512_set1_pd(0.9999999999999999);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_fnmsub_round_pd() {
+ let a = _mm512_set1_pd(0.000000000000000007);
+ let b = _mm512_set1_pd(1.);
+ let c = _mm512_set1_pd(-1.);
+ let r = _mm512_mask_fnmsub_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0, b, c,
+ );
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_fnmsub_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0b00001111, b, c,
+ );
+ let e = _mm512_setr_pd(
+ 1.,
+ 1.,
+ 1.,
+ 1.,
+ 0.000000000000000007,
+ 0.000000000000000007,
+ 0.000000000000000007,
+ 0.000000000000000007,
+ );
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_fnmsub_round_pd() {
+ let a = _mm512_set1_pd(0.000000000000000007);
+ let b = _mm512_set1_pd(1.);
+ let c = _mm512_set1_pd(-1.);
+ let r = _mm512_maskz_fnmsub_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0, a, b, c,
+ );
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_fnmsub_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0b00001111, a, b, c,
+ );
+ let e = _mm512_setr_pd(1., 1., 1., 1., 0., 0., 0., 0.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask3_fnmsub_round_pd() {
+ let a = _mm512_set1_pd(0.000000000000000007);
+ let b = _mm512_set1_pd(1.);
+ let c = _mm512_set1_pd(-1.);
+ let r = _mm512_mask3_fnmsub_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, b, c, 0,
+ );
+ assert_eq_m512d(r, c);
+ let r = _mm512_mask3_fnmsub_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, b, c, 0b00001111,
+ );
+ let e = _mm512_setr_pd(1., 1., 1., 1., -1., -1., -1., -1.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_max_round_pd() {
+ let a = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let b = _mm512_setr_pd(7., 6., 5., 4., 3., 2., 1., 0.);
+ let r = _mm512_max_round_pd::<_MM_FROUND_CUR_DIRECTION>(a, b);
+ let e = _mm512_setr_pd(7., 6., 5., 4., 4., 5., 6., 7.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_max_round_pd() {
+ let a = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let b = _mm512_setr_pd(7., 6., 5., 4., 3., 2., 1., 0.);
+ let r = _mm512_mask_max_round_pd::<_MM_FROUND_CUR_DIRECTION>(a, 0, a, b);
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_max_round_pd::<_MM_FROUND_CUR_DIRECTION>(a, 0b00001111, a, b);
+ let e = _mm512_setr_pd(7., 6., 5., 4., 4., 5., 6., 7.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_max_round_pd() {
+ let a = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let b = _mm512_setr_pd(7., 6., 5., 4., 3., 2., 1., 0.);
+ let r = _mm512_maskz_max_round_pd::<_MM_FROUND_CUR_DIRECTION>(0, a, b);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_max_round_pd::<_MM_FROUND_CUR_DIRECTION>(0b00001111, a, b);
+ let e = _mm512_setr_pd(7., 6., 5., 4., 0., 0., 0., 0.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_min_round_pd() {
+ let a = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let b = _mm512_setr_pd(7., 6., 5., 4., 3., 2., 1., 0.);
+ let r = _mm512_min_round_pd::<_MM_FROUND_CUR_DIRECTION>(a, b);
+ let e = _mm512_setr_pd(0., 1., 2., 3., 3., 2., 1., 0.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_min_round_pd() {
+ let a = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let b = _mm512_setr_pd(7., 6., 5., 4., 3., 2., 1., 0.);
+ let r = _mm512_mask_min_round_pd::<_MM_FROUND_CUR_DIRECTION>(a, 0, a, b);
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_min_round_pd::<_MM_FROUND_CUR_DIRECTION>(a, 0b00001111, a, b);
+ let e = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_min_round_pd() {
+ let a = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let b = _mm512_setr_pd(7., 6., 5., 4., 3., 2., 1., 0.);
+ let r = _mm512_maskz_min_round_pd::<_MM_FROUND_CUR_DIRECTION>(0, a, b);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_min_round_pd::<_MM_FROUND_CUR_DIRECTION>(0b00001111, a, b);
+ let e = _mm512_setr_pd(0., 1., 2., 3., 0., 0., 0., 0.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_getexp_round_pd() {
+ let a = _mm512_set1_pd(3.);
+ let r = _mm512_getexp_round_pd::<_MM_FROUND_CUR_DIRECTION>(a);
+ let e = _mm512_set1_pd(1.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_getexp_round_pd() {
+ let a = _mm512_set1_pd(3.);
+ let r = _mm512_mask_getexp_round_pd::<_MM_FROUND_CUR_DIRECTION>(a, 0, a);
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_getexp_round_pd::<_MM_FROUND_CUR_DIRECTION>(a, 0b11110000, a);
+ let e = _mm512_setr_pd(3., 3., 3., 3., 1., 1., 1., 1.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_getexp_round_pd() {
+ let a = _mm512_set1_pd(3.);
+ let r = _mm512_maskz_getexp_round_pd::<_MM_FROUND_CUR_DIRECTION>(0, a);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_getexp_round_pd::<_MM_FROUND_CUR_DIRECTION>(0b11110000, a);
+ let e = _mm512_setr_pd(0., 0., 0., 0., 1., 1., 1., 1.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_roundscale_round_pd() {
+ let a = _mm512_set1_pd(1.1);
+ let r = _mm512_roundscale_round_pd::<0, _MM_FROUND_CUR_DIRECTION>(a);
+ let e = _mm512_set1_pd(1.0);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_roundscale_round_pd() {
+ let a = _mm512_set1_pd(1.1);
+ let r = _mm512_mask_roundscale_round_pd::<0, _MM_FROUND_CUR_DIRECTION>(a, 0, a);
+ let e = _mm512_set1_pd(1.1);
+ assert_eq_m512d(r, e);
+ let r = _mm512_mask_roundscale_round_pd::<0, _MM_FROUND_CUR_DIRECTION>(a, 0b11111111, a);
+ let e = _mm512_set1_pd(1.0);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_roundscale_round_pd() {
+ let a = _mm512_set1_pd(1.1);
+ let r = _mm512_maskz_roundscale_round_pd::<0, _MM_FROUND_CUR_DIRECTION>(0, a);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_roundscale_round_pd::<0, _MM_FROUND_CUR_DIRECTION>(0b11111111, a);
+ let e = _mm512_set1_pd(1.0);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_scalef_round_pd() {
+ let a = _mm512_set1_pd(1.);
+ let b = _mm512_set1_pd(3.);
+ let r = _mm512_scalef_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b);
+ let e = _mm512_set1_pd(8.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_scalef_round_pd() {
+ let a = _mm512_set1_pd(1.);
+ let b = _mm512_set1_pd(3.);
+ let r = _mm512_mask_scalef_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0, a, b,
+ );
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_scalef_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ a, 0b11110000, a, b,
+ );
+ let e = _mm512_set_pd(8., 8., 8., 8., 1., 1., 1., 1.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_scalef_round_pd() {
+ let a = _mm512_set1_pd(1.);
+ let b = _mm512_set1_pd(3.);
+ let r = _mm512_maskz_scalef_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0, a, b,
+ );
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_scalef_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(
+ 0b11110000, a, b,
+ );
+ let e = _mm512_set_pd(8., 8., 8., 8., 0., 0., 0., 0.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_fixupimm_round_pd() {
+ let a = _mm512_set1_pd(f64::NAN);
+ let b = _mm512_set1_pd(f64::MAX);
+ let c = _mm512_set1_epi64(i32::MAX as i64);
+ let r = _mm512_fixupimm_round_pd::<5, _MM_FROUND_CUR_DIRECTION>(a, b, c);
+ let e = _mm512_set1_pd(0.0);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_fixupimm_round_pd() {
+ let a = _mm512_set_pd(f64::NAN, f64::NAN, f64::NAN, f64::NAN, 1., 1., 1., 1.);
+ let b = _mm512_set1_pd(f64::MAX);
+ let c = _mm512_set1_epi64(i32::MAX as i64);
+ let r = _mm512_mask_fixupimm_round_pd::<5, _MM_FROUND_CUR_DIRECTION>(a, 0b11110000, b, c);
+ let e = _mm512_set_pd(0., 0., 0., 0., 1., 1., 1., 1.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_fixupimm_round_pd() {
+ let a = _mm512_set_pd(f64::NAN, f64::NAN, f64::NAN, f64::NAN, 1., 1., 1., 1.);
+ let b = _mm512_set1_pd(f64::MAX);
+ let c = _mm512_set1_epi64(i32::MAX as i64);
+ let r = _mm512_maskz_fixupimm_round_pd::<5, _MM_FROUND_CUR_DIRECTION>(0b11110000, a, b, c);
+ let e = _mm512_set_pd(0., 0., 0., 0., 0., 0., 0., 0.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_getmant_round_pd() {
+ let a = _mm512_set1_pd(10.);
+ let r = _mm512_getmant_round_pd::<
+ _MM_MANT_NORM_1_2,
+ _MM_MANT_SIGN_SRC,
+ _MM_FROUND_CUR_DIRECTION,
+ >(a);
+ let e = _mm512_set1_pd(1.25);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_getmant_round_pd() {
+ let a = _mm512_set1_pd(10.);
+ let r = _mm512_mask_getmant_round_pd::<
+ _MM_MANT_NORM_1_2,
+ _MM_MANT_SIGN_SRC,
+ _MM_FROUND_CUR_DIRECTION,
+ >(a, 0, a);
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_getmant_round_pd::<
+ _MM_MANT_NORM_1_2,
+ _MM_MANT_SIGN_SRC,
+ _MM_FROUND_CUR_DIRECTION,
+ >(a, 0b11110000, a);
+ let e = _mm512_setr_pd(10., 10., 10., 10., 1.25, 1.25, 1.25, 1.25);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_getmant_round_pd() {
+ let a = _mm512_set1_pd(10.);
+ let r = _mm512_maskz_getmant_round_pd::<
+ _MM_MANT_NORM_1_2,
+ _MM_MANT_SIGN_SRC,
+ _MM_FROUND_CUR_DIRECTION,
+ >(0, a);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_getmant_round_pd::<
+ _MM_MANT_NORM_1_2,
+ _MM_MANT_SIGN_SRC,
+ _MM_FROUND_CUR_DIRECTION,
+ >(0b11110000, a);
+ let e = _mm512_setr_pd(0., 0., 0., 0., 1.25, 1.25, 1.25, 1.25);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvt_roundps_pd() {
+ let a = _mm256_setr_ps(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5);
+ let r = _mm512_cvt_roundps_pd::<_MM_FROUND_CUR_DIRECTION>(a);
+ let e = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvt_roundps_pd() {
+ let a = _mm256_setr_ps(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5);
+ let src = _mm512_set1_pd(0.);
+ let r = _mm512_mask_cvt_roundps_pd::<_MM_FROUND_CUR_DIRECTION>(src, 0, a);
+ assert_eq_m512d(r, src);
+ let r = _mm512_mask_cvt_roundps_pd::<_MM_FROUND_CUR_DIRECTION>(src, 0b00001111, a);
+ let e = _mm512_setr_pd(0., -1.5, 2., -3.5, 0., 0., 0., 0.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvt_roundps_pd() {
+ let a = _mm256_setr_ps(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5);
+ let r = _mm512_maskz_cvt_roundps_pd::<_MM_FROUND_CUR_DIRECTION>(0, a);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_cvt_roundps_pd::<_MM_FROUND_CUR_DIRECTION>(0b00001111, a);
+ let e = _mm512_setr_pd(0., -1.5, 2., -3.5, 0., 0., 0., 0.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvt_roundpd_ps() {
+ let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5);
+ let r = _mm512_cvt_roundpd_ps::<_MM_FROUND_CUR_DIRECTION>(a);
+ let e = _mm256_setr_ps(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvt_roundpd_ps() {
+ let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5);
+ let src = _mm256_set1_ps(0.);
+ let r = _mm512_mask_cvt_roundpd_ps::<_MM_FROUND_CUR_DIRECTION>(src, 0, a);
+ assert_eq_m256(r, src);
+ let r = _mm512_mask_cvt_roundpd_ps::<_MM_FROUND_CUR_DIRECTION>(src, 0b00001111, a);
+ let e = _mm256_setr_ps(0., -1.5, 2., -3.5, 0., 0., 0., 0.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvt_roundpd_ps() {
+ let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5);
+ let r = _mm512_maskz_cvt_roundpd_ps::<_MM_FROUND_CUR_DIRECTION>(0, a);
+ assert_eq_m256(r, _mm256_setzero_ps());
+ let r = _mm512_maskz_cvt_roundpd_ps::<_MM_FROUND_CUR_DIRECTION>(0b00001111, a);
+ let e = _mm256_setr_ps(0., -1.5, 2., -3.5, 0., 0., 0., 0.);
+ assert_eq_m256(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvt_roundpd_epi32() {
+ let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5);
+ let r = _mm512_cvt_roundpd_epi32::<_MM_FROUND_CUR_DIRECTION>(a);
+ let e = _mm256_setr_epi32(0, -2, 2, -4, 4, -6, 6, -8);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvt_roundpd_epi32() {
+ let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5);
+ let src = _mm256_set1_epi32(0);
+ let r = _mm512_mask_cvt_roundpd_epi32::<_MM_FROUND_CUR_DIRECTION>(src, 0, a);
+ assert_eq_m256i(r, src);
+ let r = _mm512_mask_cvt_roundpd_epi32::<_MM_FROUND_CUR_DIRECTION>(src, 0b00001111, a);
+ let e = _mm256_setr_epi32(0, -2, 2, -4, 0, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvt_roundpd_epi32() {
+ let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5);
+ let r = _mm512_maskz_cvt_roundpd_epi32::<_MM_FROUND_CUR_DIRECTION>(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm512_maskz_cvt_roundpd_epi32::<_MM_FROUND_CUR_DIRECTION>(0b00001111, a);
+ let e = _mm256_setr_epi32(0, -2, 2, -4, 0, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cvt_roundpd_epu32() {
+ let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5);
+ let r = _mm512_cvt_roundpd_epu32::<_MM_FROUND_CUR_DIRECTION>(a);
+ let e = _mm256_setr_epi32(0, -1, 2, -1, 4, -1, 6, -1);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvt_roundpd_epu32() {
+ let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5);
+ let src = _mm256_set1_epi32(0);
+ let r = _mm512_mask_cvt_roundpd_epu32::<_MM_FROUND_CUR_DIRECTION>(src, 0, a);
+ assert_eq_m256i(r, src);
+ let r = _mm512_mask_cvt_roundpd_epu32::<_MM_FROUND_CUR_DIRECTION>(src, 0b00001111, a);
+ let e = _mm256_setr_epi32(0, -1, 2, -1, 0, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_cvt_roundpd_epu32() {
+ let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5);
+ let r = _mm512_maskz_cvt_roundpd_epu32::<_MM_FROUND_CUR_DIRECTION>(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm512_maskz_cvt_roundpd_epu32::<_MM_FROUND_CUR_DIRECTION>(0b00001111, a);
+ let e = _mm256_setr_epi32(0, -1, 2, -1, 0, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_setzero_pd() {
+ assert_eq_m512d(_mm512_setzero_pd(), _mm512_set1_pd(0.));
+ }
+
+ unsafe fn test_mm512_set1_epi64() {
+ let r = _mm512_set_epi64(2, 2, 2, 2, 2, 2, 2, 2);
+ assert_eq_m512i(r, _mm512_set1_epi64(2));
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_set1_pd() {
+ let expected = _mm512_set_pd(2., 2., 2., 2., 2., 2., 2., 2.);
+ assert_eq_m512d(expected, _mm512_set1_pd(2.));
+ }
+
+ unsafe fn test_mm512_set4_epi64() {
+ let r = _mm512_set_epi64(4, 3, 2, 1, 4, 3, 2, 1);
+ assert_eq_m512i(r, _mm512_set4_epi64(4, 3, 2, 1));
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_set4_pd() {
+ let r = _mm512_set_pd(4., 3., 2., 1., 4., 3., 2., 1.);
+ assert_eq_m512d(r, _mm512_set4_pd(4., 3., 2., 1.));
+ }
+
+ unsafe fn test_mm512_setr4_epi64() {
+ let r = _mm512_set_epi64(4, 3, 2, 1, 4, 3, 2, 1);
+ assert_eq_m512i(r, _mm512_setr4_epi64(1, 2, 3, 4));
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_setr4_pd() {
+ let r = _mm512_set_pd(4., 3., 2., 1., 4., 3., 2., 1.);
+ assert_eq_m512d(r, _mm512_setr4_pd(1., 2., 3., 4.));
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmplt_pd_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_pd(0., 1., -1., f64::MAX, f64::NAN, f64::MIN, 100., -100.);
+ let b = _mm512_set1_pd(-1.);
+ let m = _mm512_cmplt_pd_mask(a, b);
+ assert_eq!(m, 0b00000101);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmplt_pd_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_pd(0., 1., -1., f64::MAX, f64::NAN, f64::MIN, 100., -100.);
+ let b = _mm512_set1_pd(-1.);
+ let mask = 0b01100110;
+ let r = _mm512_mask_cmplt_pd_mask(mask, a, b);
+ assert_eq!(r, 0b00000100);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmpnlt_pd_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_pd(0., 1., -1., f64::MAX, f64::NAN, f64::MIN, 100., -100.);
+ let b = _mm512_set1_pd(-1.);
+ assert_eq!(_mm512_cmpnlt_pd_mask(a, b), !_mm512_cmplt_pd_mask(a, b));
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmpnlt_pd_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_pd(0., 1., -1., f64::MAX, f64::NAN, f64::MIN, 100., -100.);
+ let b = _mm512_set1_pd(-1.);
+ let mask = 0b01111010;
+ assert_eq!(_mm512_mask_cmpnlt_pd_mask(mask, a, b), 0b01111010);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmple_pd_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_pd(0., 1., -1., f64::MAX, f64::NAN, f64::MIN, 100., -100.);
+ let b = _mm512_set1_pd(-1.);
+ assert_eq!(_mm512_cmple_pd_mask(a, b), 0b00100101);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmple_pd_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_pd(0., 1., -1., f64::MAX, f64::NAN, f64::MIN, 100., -100.);
+ let b = _mm512_set1_pd(-1.);
+ let mask = 0b01111010;
+ assert_eq!(_mm512_mask_cmple_pd_mask(mask, a, b), 0b00100000);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmpnle_pd_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_pd(0., 1., -1., f64::MAX, f64::NAN, f64::MIN, 100., -100.);
+ let b = _mm512_set1_pd(-1.);
+ let m = _mm512_cmpnle_pd_mask(b, a);
+ assert_eq!(m, 0b00001101);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmpnle_pd_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_pd(0., 1., -1., f64::MAX, f64::NAN, f64::MIN, 100., -100.);
+ let b = _mm512_set1_pd(-1.);
+ let mask = 0b01100110;
+ let r = _mm512_mask_cmpnle_pd_mask(mask, b, a);
+ assert_eq!(r, 0b00000100);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmpeq_pd_mask() {
+ let a = _mm512_set_pd(0., 1., -1., 13., f64::MAX, f64::MIN, f64::NAN, -100.);
+ let b = _mm512_set_pd(0., 1., 13., 42., f64::MAX, f64::MIN, f64::NAN, -100.);
+ let m = _mm512_cmpeq_pd_mask(b, a);
+ assert_eq!(m, 0b11001101);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmpeq_pd_mask() {
+ let a = _mm512_set_pd(0., 1., -1., 13., f64::MAX, f64::MIN, f64::NAN, -100.);
+ let b = _mm512_set_pd(0., 1., 13., 42., f64::MAX, f64::MIN, f64::NAN, -100.);
+ let mask = 0b01111010;
+ let r = _mm512_mask_cmpeq_pd_mask(mask, b, a);
+ assert_eq!(r, 0b01001000);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmpneq_pd_mask() {
+ let a = _mm512_set_pd(0., 1., -1., 13., f64::MAX, f64::MIN, f64::NAN, -100.);
+ let b = _mm512_set_pd(0., 1., 13., 42., f64::MAX, f64::MIN, f64::NAN, -100.);
+ let m = _mm512_cmpneq_pd_mask(b, a);
+ assert_eq!(m, 0b00110010);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmpneq_pd_mask() {
+ let a = _mm512_set_pd(0., 1., -1., 13., f64::MAX, f64::MIN, f64::NAN, -100.);
+ let b = _mm512_set_pd(0., 1., 13., 42., f64::MAX, f64::MIN, f64::NAN, -100.);
+ let mask = 0b01111010;
+ let r = _mm512_mask_cmpneq_pd_mask(mask, b, a);
+ assert_eq!(r, 0b00110010)
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmp_pd_mask() {
+ let a = _mm512_set_pd(0., 1., -1., 13., f64::MAX, f64::MIN, 100., -100.);
+ let b = _mm512_set1_pd(-1.);
+ let m = _mm512_cmp_pd_mask::<_CMP_LT_OQ>(a, b);
+ assert_eq!(m, 0b00000101);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmp_pd_mask() {
+ let a = _mm512_set_pd(0., 1., -1., 13., f64::MAX, f64::MIN, 100., -100.);
+ let b = _mm512_set1_pd(-1.);
+ let mask = 0b01100110;
+ let r = _mm512_mask_cmp_pd_mask::<_CMP_LT_OQ>(mask, a, b);
+ assert_eq!(r, 0b00000100);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cmp_pd_mask() {
+ let a = _mm256_set_pd(0., 1., -1., 13.);
+ let b = _mm256_set1_pd(1.);
+ let m = _mm256_cmp_pd_mask::<_CMP_LT_OQ>(a, b);
+ assert_eq!(m, 0b00001010);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cmp_pd_mask() {
+ let a = _mm256_set_pd(0., 1., -1., 13.);
+ let b = _mm256_set1_pd(1.);
+ let mask = 0b11111111;
+ let r = _mm256_mask_cmp_pd_mask::<_CMP_LT_OQ>(mask, a, b);
+ assert_eq!(r, 0b00001010);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cmp_pd_mask() {
+ let a = _mm_set_pd(0., 1.);
+ let b = _mm_set1_pd(1.);
+ let m = _mm_cmp_pd_mask::<_CMP_LT_OQ>(a, b);
+ assert_eq!(m, 0b00000010);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cmp_pd_mask() {
+ let a = _mm_set_pd(0., 1.);
+ let b = _mm_set1_pd(1.);
+ let mask = 0b11111111;
+ let r = _mm_mask_cmp_pd_mask::<_CMP_LT_OQ>(mask, a, b);
+ assert_eq!(r, 0b00000010);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmp_round_pd_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_pd(0., 1., -1., 13., f64::MAX, f64::MIN, 100., -100.);
+ let b = _mm512_set1_pd(-1.);
+ let m = _mm512_cmp_round_pd_mask::<_CMP_LT_OQ, _MM_FROUND_CUR_DIRECTION>(a, b);
+ assert_eq!(m, 0b00000101);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmp_round_pd_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_pd(0., 1., -1., 13., f64::MAX, f64::MIN, 100., -100.);
+ let b = _mm512_set1_pd(-1.);
+ let mask = 0b01100110;
+ let r = _mm512_mask_cmp_round_pd_mask::<_CMP_LT_OQ, _MM_FROUND_CUR_DIRECTION>(mask, a, b);
+ assert_eq!(r, 0b00000100);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmpord_pd_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_pd(f64::NAN, f64::MAX, f64::NAN, f64::MIN, f64::NAN, -1., f64::NAN, 0.);
+ #[rustfmt::skip]
+ let b = _mm512_set_pd(f64::NAN, f64::NAN, f64::NAN, f64::NAN, f64::MIN, f64::MAX, -1., 0.);
+ let m = _mm512_cmpord_pd_mask(a, b);
+ assert_eq!(m, 0b00000101);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmpord_pd_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_pd(f64::NAN, f64::MAX, f64::NAN, f64::MIN, f64::NAN, -1., f64::NAN, 0.);
+ #[rustfmt::skip]
+ let b = _mm512_set_pd(f64::NAN, f64::NAN, f64::NAN, f64::NAN, f64::MIN, f64::MAX, -1., 0.);
+ let mask = 0b11000011;
+ let m = _mm512_mask_cmpord_pd_mask(mask, a, b);
+ assert_eq!(m, 0b00000001);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmpunord_pd_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_pd(f64::NAN, f64::MAX, f64::NAN, f64::MIN, f64::NAN, -1., f64::NAN, 0.);
+ #[rustfmt::skip]
+ let b = _mm512_set_pd(f64::NAN, f64::NAN, f64::NAN, f64::NAN, f64::MIN, f64::MAX, -1., 0.);
+ let m = _mm512_cmpunord_pd_mask(a, b);
+
+ assert_eq!(m, 0b11111010);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmpunord_pd_mask() {
+ #[rustfmt::skip]
+ let a = _mm512_set_pd(f64::NAN, f64::MAX, f64::NAN, f64::MIN, f64::NAN, -1., f64::NAN, 0.);
+ #[rustfmt::skip]
+ let b = _mm512_set_pd(f64::NAN, f64::NAN, f64::NAN, f64::NAN, f64::MIN, f64::MAX, -1., 0.);
+ let mask = 0b00001111;
+ let m = _mm512_mask_cmpunord_pd_mask(mask, a, b);
+ assert_eq!(m, 0b000001010);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmplt_epu64_mask() {
+ let a = _mm512_set_epi64(0, 1, -1, u64::MAX as i64, i64::MAX, i64::MIN, 100, -100);
+ let b = _mm512_set1_epi64(-1);
+ let m = _mm512_cmplt_epu64_mask(a, b);
+ assert_eq!(m, 0b11001111);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmplt_epu64_mask() {
+ let a = _mm512_set_epi64(0, 1, -1, u64::MAX as i64, i64::MAX, i64::MIN, 100, -100);
+ let b = _mm512_set1_epi64(-1);
+ let mask = 0b01111010;
+ let r = _mm512_mask_cmplt_epu64_mask(mask, a, b);
+ assert_eq!(r, 0b01001010);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cmplt_epu64_mask() {
+ let a = _mm256_set_epi64x(0, 1, 2, 100);
+ let b = _mm256_set1_epi64x(2);
+ let r = _mm256_cmplt_epu64_mask(a, b);
+ assert_eq!(r, 0b00001100);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cmplt_epu64_mask() {
+ let a = _mm256_set_epi64x(0, 1, 2, 100);
+ let b = _mm256_set1_epi64x(2);
+ let mask = 0b11111111;
+ let r = _mm256_mask_cmplt_epu64_mask(mask, a, b);
+ assert_eq!(r, 0b00001100);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cmplt_epu64_mask() {
+ let a = _mm_set_epi64x(0, 1);
+ let b = _mm_set1_epi64x(2);
+ let r = _mm_cmplt_epu64_mask(a, b);
+ assert_eq!(r, 0b00000011);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cmplt_epu64_mask() {
+ let a = _mm_set_epi64x(0, 1);
+ let b = _mm_set1_epi64x(2);
+ let mask = 0b11111111;
+ let r = _mm_mask_cmplt_epu64_mask(mask, a, b);
+ assert_eq!(r, 0b00000011);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmpgt_epu64_mask() {
+ let a = _mm512_set_epi64(0, 1, -1, u64::MAX as i64, i64::MAX, i64::MIN, 100, -100);
+ let b = _mm512_set1_epi64(-1);
+ let m = _mm512_cmpgt_epu64_mask(b, a);
+ assert_eq!(m, 0b11001111);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmpgt_epu64_mask() {
+ let a = _mm512_set_epi64(0, 1, -1, u64::MAX as i64, i64::MAX, i64::MIN, 100, -100);
+ let b = _mm512_set1_epi64(-1);
+ let mask = 0b01111010;
+ let r = _mm512_mask_cmpgt_epu64_mask(mask, b, a);
+ assert_eq!(r, 0b01001010);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cmpgt_epu64_mask() {
+ let a = _mm256_set_epi64x(0, 1, 2, 3);
+ let b = _mm256_set1_epi64x(1);
+ let r = _mm256_cmpgt_epu64_mask(a, b);
+ assert_eq!(r, 0b00000011);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cmpgt_epu64_mask() {
+ let a = _mm256_set_epi64x(0, 1, 2, 3);
+ let b = _mm256_set1_epi64x(1);
+ let mask = 0b11111111;
+ let r = _mm256_mask_cmpgt_epu64_mask(mask, a, b);
+ assert_eq!(r, 0b00000011);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cmpgt_epu64_mask() {
+ let a = _mm_set_epi64x(1, 2);
+ let b = _mm_set1_epi64x(1);
+ let r = _mm_cmpgt_epu64_mask(a, b);
+ assert_eq!(r, 0b00000001);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cmpgt_epu64_mask() {
+ let a = _mm_set_epi64x(1, 2);
+ let b = _mm_set1_epi64x(1);
+ let mask = 0b11111111;
+ let r = _mm_mask_cmpgt_epu64_mask(mask, a, b);
+ assert_eq!(r, 0b00000001);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmple_epu64_mask() {
+ let a = _mm512_set_epi64(0, 1, -1, u64::MAX as i64, i64::MAX, i64::MIN, 100, -100);
+ let b = _mm512_set1_epi64(-1);
+ assert_eq!(
+ _mm512_cmple_epu64_mask(a, b),
+ !_mm512_cmpgt_epu64_mask(a, b)
+ )
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmple_epu64_mask() {
+ let a = _mm512_set_epi64(0, 1, -1, u64::MAX as i64, i64::MAX, i64::MIN, 100, -100);
+ let b = _mm512_set1_epi64(-1);
+ let mask = 0b01111010;
+ assert_eq!(_mm512_mask_cmple_epu64_mask(mask, a, b), 0b01111010);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cmple_epu64_mask() {
+ let a = _mm256_set_epi64x(0, 1, 2, 1);
+ let b = _mm256_set1_epi64x(1);
+ let r = _mm256_cmple_epu64_mask(a, b);
+ assert_eq!(r, 0b00001101)
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cmple_epu64_mask() {
+ let a = _mm256_set_epi64x(0, 1, 2, 1);
+ let b = _mm256_set1_epi64x(1);
+ let mask = 0b11111111;
+ let r = _mm256_mask_cmple_epu64_mask(mask, a, b);
+ assert_eq!(r, 0b00001101)
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cmple_epu64_mask() {
+ let a = _mm_set_epi64x(0, 1);
+ let b = _mm_set1_epi64x(1);
+ let r = _mm_cmple_epu64_mask(a, b);
+ assert_eq!(r, 0b00000011)
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cmple_epu64_mask() {
+ let a = _mm_set_epi64x(0, 1);
+ let b = _mm_set1_epi64x(1);
+ let mask = 0b11111111;
+ let r = _mm_mask_cmple_epu64_mask(mask, a, b);
+ assert_eq!(r, 0b00000011)
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmpge_epu64_mask() {
+ let a = _mm512_set_epi64(0, 1, -1, u64::MAX as i64, i64::MAX, i64::MIN, 100, -100);
+ let b = _mm512_set1_epi64(-1);
+ assert_eq!(
+ _mm512_cmpge_epu64_mask(a, b),
+ !_mm512_cmplt_epu64_mask(a, b)
+ );
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmpge_epu64_mask() {
+ let a = _mm512_set_epi64(0, 1, -1, u64::MAX as i64, i64::MAX, i64::MIN, 100, -100);
+ let b = _mm512_set1_epi64(-1);
+ let mask = 0b11111111;
+ let r = _mm512_mask_cmpge_epu64_mask(mask, a, b);
+ assert_eq!(r, 0b00110000);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cmpge_epu64_mask() {
+ let a = _mm256_set_epi64x(0, 1, 2, u64::MAX as i64);
+ let b = _mm256_set1_epi64x(1);
+ let r = _mm256_cmpge_epu64_mask(a, b);
+ assert_eq!(r, 0b00000111);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cmpge_epu64_mask() {
+ let a = _mm256_set_epi64x(0, 1, 2, u64::MAX as i64);
+ let b = _mm256_set1_epi64x(1);
+ let mask = 0b11111111;
+ let r = _mm256_mask_cmpge_epu64_mask(mask, a, b);
+ assert_eq!(r, 0b00000111);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cmpge_epu64_mask() {
+ let a = _mm_set_epi64x(0, 1);
+ let b = _mm_set1_epi64x(1);
+ let r = _mm_cmpge_epu64_mask(a, b);
+ assert_eq!(r, 0b00000001);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cmpge_epu64_mask() {
+ let a = _mm_set_epi64x(0, 1);
+ let b = _mm_set1_epi64x(1);
+ let mask = 0b11111111;
+ let r = _mm_mask_cmpge_epu64_mask(mask, a, b);
+ assert_eq!(r, 0b00000001);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmpeq_epu64_mask() {
+ let a = _mm512_set_epi64(0, 1, -1, u64::MAX as i64, i64::MAX, i64::MIN, 100, -100);
+ let b = _mm512_set_epi64(0, 1, 13, 42, i64::MAX, i64::MIN, 100, -100);
+ let m = _mm512_cmpeq_epu64_mask(b, a);
+ assert_eq!(m, 0b11001111);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmpeq_epu64_mask() {
+ let a = _mm512_set_epi64(0, 1, -1, u64::MAX as i64, i64::MAX, i64::MIN, 100, -100);
+ let b = _mm512_set_epi64(0, 1, 13, 42, i64::MAX, i64::MIN, 100, -100);
+ let mask = 0b01111010;
+ let r = _mm512_mask_cmpeq_epu64_mask(mask, b, a);
+ assert_eq!(r, 0b01001010);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cmpeq_epu64_mask() {
+ let a = _mm256_set_epi64x(0, 1, -1, u64::MAX as i64);
+ let b = _mm256_set_epi64x(0, 1, 13, 42);
+ let m = _mm256_cmpeq_epu64_mask(b, a);
+ assert_eq!(m, 0b00001100);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cmpeq_epu64_mask() {
+ let a = _mm256_set_epi64x(0, 1, -1, u64::MAX as i64);
+ let b = _mm256_set_epi64x(0, 1, 13, 42);
+ let mask = 0b11111111;
+ let r = _mm256_mask_cmpeq_epu64_mask(mask, b, a);
+ assert_eq!(r, 0b00001100);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cmpeq_epu64_mask() {
+ let a = _mm_set_epi64x(0, 1);
+ let b = _mm_set_epi64x(0, 1);
+ let m = _mm_cmpeq_epu64_mask(b, a);
+ assert_eq!(m, 0b00000011);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cmpeq_epu64_mask() {
+ let a = _mm_set_epi64x(0, 1);
+ let b = _mm_set_epi64x(0, 1);
+ let mask = 0b11111111;
+ let r = _mm_mask_cmpeq_epu64_mask(mask, b, a);
+ assert_eq!(r, 0b00000011);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmpneq_epu64_mask() {
+ let a = _mm512_set_epi64(0, 1, -1, u64::MAX as i64, i64::MAX, i64::MIN, 100, -100);
+ let b = _mm512_set_epi64(0, 1, 13, 42, i64::MAX, i64::MIN, 100, -100);
+ let m = _mm512_cmpneq_epu64_mask(b, a);
+ assert_eq!(m, !_mm512_cmpeq_epu64_mask(b, a));
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmpneq_epu64_mask() {
+ let a = _mm512_set_epi64(0, 1, -1, u64::MAX as i64, i64::MAX, i64::MIN, -100, 100);
+ let b = _mm512_set_epi64(0, 1, 13, 42, i64::MAX, i64::MIN, 100, -100);
+ let mask = 0b01111010;
+ let r = _mm512_mask_cmpneq_epu64_mask(mask, b, a);
+ assert_eq!(r, 0b00110010);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cmpneq_epu64_mask() {
+ let a = _mm256_set_epi64x(0, 1, -1, u64::MAX as i64);
+ let b = _mm256_set_epi64x(0, 1, 13, 42);
+ let r = _mm256_cmpneq_epu64_mask(b, a);
+ assert_eq!(r, 0b00000011);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cmpneq_epu64_mask() {
+ let a = _mm256_set_epi64x(0, 1, -1, u64::MAX as i64);
+ let b = _mm256_set_epi64x(0, 1, 13, 42);
+ let mask = 0b11111111;
+ let r = _mm256_mask_cmpneq_epu64_mask(mask, b, a);
+ assert_eq!(r, 0b00000011);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cmpneq_epu64_mask() {
+ let a = _mm_set_epi64x(-1, u64::MAX as i64);
+ let b = _mm_set_epi64x(13, 42);
+ let r = _mm_cmpneq_epu64_mask(b, a);
+ assert_eq!(r, 0b00000011);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cmpneq_epu64_mask() {
+ let a = _mm_set_epi64x(-1, u64::MAX as i64);
+ let b = _mm_set_epi64x(13, 42);
+ let mask = 0b11111111;
+ let r = _mm_mask_cmpneq_epu64_mask(mask, b, a);
+ assert_eq!(r, 0b00000011);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmp_epu64_mask() {
+ let a = _mm512_set_epi64(0, 1, -1, u64::MAX as i64, i64::MAX, i64::MIN, 100, -100);
+ let b = _mm512_set1_epi64(-1);
+ let m = _mm512_cmp_epu64_mask::<_MM_CMPINT_LT>(a, b);
+ assert_eq!(m, 0b11001111);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmp_epu64_mask() {
+ let a = _mm512_set_epi64(0, 1, -1, u64::MAX as i64, i64::MAX, i64::MIN, 100, -100);
+ let b = _mm512_set1_epi64(-1);
+ let mask = 0b01111010;
+ let r = _mm512_mask_cmp_epu64_mask::<_MM_CMPINT_LT>(mask, a, b);
+ assert_eq!(r, 0b01001010);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cmp_epu64_mask() {
+ let a = _mm256_set_epi64x(0, 1, -1, 100);
+ let b = _mm256_set1_epi64x(1);
+ let m = _mm256_cmp_epu64_mask::<_MM_CMPINT_LT>(a, b);
+ assert_eq!(m, 0b00001000);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cmp_epu64_mask() {
+ let a = _mm256_set_epi64x(0, 1, -1, 100);
+ let b = _mm256_set1_epi64x(1);
+ let mask = 0b11111111;
+ let r = _mm256_mask_cmp_epu64_mask::<_MM_CMPINT_LT>(mask, a, b);
+ assert_eq!(r, 0b00001000);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cmp_epu64_mask() {
+ let a = _mm_set_epi64x(0, 1);
+ let b = _mm_set1_epi64x(1);
+ let m = _mm_cmp_epu64_mask::<_MM_CMPINT_LT>(a, b);
+ assert_eq!(m, 0b00000010);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cmp_epu64_mask() {
+ let a = _mm_set_epi64x(0, 1);
+ let b = _mm_set1_epi64x(1);
+ let mask = 0b11111111;
+ let r = _mm_mask_cmp_epu64_mask::<_MM_CMPINT_LT>(mask, a, b);
+ assert_eq!(r, 0b00000010);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmplt_epi64_mask() {
+ let a = _mm512_set_epi64(0, 1, -1, 13, i64::MAX, i64::MIN, 100, -100);
+ let b = _mm512_set1_epi64(-1);
+ let m = _mm512_cmplt_epi64_mask(a, b);
+ assert_eq!(m, 0b00000101);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmplt_epi64_mask() {
+ let a = _mm512_set_epi64(0, 1, -1, 13, i64::MAX, i64::MIN, 100, -100);
+ let b = _mm512_set1_epi64(-1);
+ let mask = 0b01100110;
+ let r = _mm512_mask_cmplt_epi64_mask(mask, a, b);
+ assert_eq!(r, 0b00000100);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cmplt_epi64_mask() {
+ let a = _mm256_set_epi64x(0, 1, -1, -13);
+ let b = _mm256_set1_epi64x(-1);
+ let r = _mm256_cmplt_epi64_mask(a, b);
+ assert_eq!(r, 0b00000001);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cmplt_epi64_mask() {
+ let a = _mm256_set_epi64x(0, 1, -1, -13);
+ let b = _mm256_set1_epi64x(-1);
+ let mask = 0b11111111;
+ let r = _mm256_mask_cmplt_epi64_mask(mask, a, b);
+ assert_eq!(r, 0b00000001);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cmplt_epi64_mask() {
+ let a = _mm_set_epi64x(-1, -13);
+ let b = _mm_set1_epi64x(-1);
+ let r = _mm_cmplt_epi64_mask(a, b);
+ assert_eq!(r, 0b00000001);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cmplt_epi64_mask() {
+ let a = _mm_set_epi64x(-1, -13);
+ let b = _mm_set1_epi64x(-1);
+ let mask = 0b11111111;
+ let r = _mm_mask_cmplt_epi64_mask(mask, a, b);
+ assert_eq!(r, 0b00000001);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmpgt_epi64_mask() {
+ let a = _mm512_set_epi64(0, 1, -1, 13, i64::MAX, i64::MIN, 100, -100);
+ let b = _mm512_set1_epi64(-1);
+ let m = _mm512_cmpgt_epi64_mask(b, a);
+ assert_eq!(m, 0b00000101);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmpgt_epi64_mask() {
+ let a = _mm512_set_epi64(0, 1, -1, 13, i64::MAX, i64::MIN, 100, -100);
+ let b = _mm512_set1_epi64(-1);
+ let mask = 0b01100110;
+ let r = _mm512_mask_cmpgt_epi64_mask(mask, b, a);
+ assert_eq!(r, 0b00000100);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cmpgt_epi64_mask() {
+ let a = _mm256_set_epi64x(0, 1, -1, 13);
+ let b = _mm256_set1_epi64x(-1);
+ let r = _mm256_cmpgt_epi64_mask(a, b);
+ assert_eq!(r, 0b00001101);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cmpgt_epi64_mask() {
+ let a = _mm256_set_epi64x(0, 1, -1, 13);
+ let b = _mm256_set1_epi64x(-1);
+ let mask = 0b11111111;
+ let r = _mm256_mask_cmpgt_epi64_mask(mask, a, b);
+ assert_eq!(r, 0b00001101);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cmpgt_epi64_mask() {
+ let a = _mm_set_epi64x(0, -1);
+ let b = _mm_set1_epi64x(-1);
+ let r = _mm_cmpgt_epi64_mask(a, b);
+ assert_eq!(r, 0b00000010);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cmpgt_epi64_mask() {
+ let a = _mm_set_epi64x(0, -1);
+ let b = _mm_set1_epi64x(-1);
+ let mask = 0b11111111;
+ let r = _mm_mask_cmpgt_epi64_mask(mask, a, b);
+ assert_eq!(r, 0b00000010);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmple_epi64_mask() {
+ let a = _mm512_set_epi64(0, 1, -1, u64::MAX as i64, i64::MAX, i64::MIN, 100, -100);
+ let b = _mm512_set1_epi64(-1);
+ assert_eq!(
+ _mm512_cmple_epi64_mask(a, b),
+ !_mm512_cmpgt_epi64_mask(a, b)
+ )
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmple_epi64_mask() {
+ let a = _mm512_set_epi64(0, 1, -1, u64::MAX as i64, i64::MAX, i64::MIN, 100, -100);
+ let b = _mm512_set1_epi64(-1);
+ let mask = 0b01111010;
+ assert_eq!(_mm512_mask_cmple_epi64_mask(mask, a, b), 0b00110000);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cmple_epi64_mask() {
+ let a = _mm256_set_epi64x(0, 1, -1, i64::MAX);
+ let b = _mm256_set1_epi64x(-1);
+ let r = _mm256_cmple_epi64_mask(a, b);
+ assert_eq!(r, 0b00000010)
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cmple_epi64_mask() {
+ let a = _mm256_set_epi64x(0, 1, -1, i64::MAX);
+ let b = _mm256_set1_epi64x(-1);
+ let mask = 0b11111111;
+ let r = _mm256_mask_cmple_epi64_mask(mask, a, b);
+ assert_eq!(r, 0b00000010)
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cmple_epi64_mask() {
+ let a = _mm_set_epi64x(0, 1);
+ let b = _mm_set1_epi64x(1);
+ let r = _mm_cmple_epi64_mask(a, b);
+ assert_eq!(r, 0b00000011)
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cmple_epi64_mask() {
+ let a = _mm_set_epi64x(0, 1);
+ let b = _mm_set1_epi64x(1);
+ let mask = 0b11111111;
+ let r = _mm_mask_cmple_epi64_mask(mask, a, b);
+ assert_eq!(r, 0b00000011)
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmpge_epi64_mask() {
+ let a = _mm512_set_epi64(0, 1, -1, u64::MAX as i64, i64::MAX, i64::MIN, 100, -100);
+ let b = _mm512_set1_epi64(-1);
+ assert_eq!(
+ _mm512_cmpge_epi64_mask(a, b),
+ !_mm512_cmplt_epi64_mask(a, b)
+ )
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmpge_epi64_mask() {
+ let a = _mm512_set_epi64(0, 1, -1, u64::MAX as i64, i64::MAX, i64::MIN, 100, -100);
+ let b = _mm512_set1_epi64(-1);
+ let mask = 0b11111111;
+ let r = _mm512_mask_cmpge_epi64_mask(mask, a, b);
+ assert_eq!(r, 0b11111010);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cmpge_epi64_mask() {
+ let a = _mm256_set_epi64x(0, 1, -1, i64::MAX);
+ let b = _mm256_set1_epi64x(-1);
+ let r = _mm256_cmpge_epi64_mask(a, b);
+ assert_eq!(r, 0b00001111);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cmpge_epi64_mask() {
+ let a = _mm256_set_epi64x(0, 1, -1, i64::MAX);
+ let b = _mm256_set1_epi64x(-1);
+ let mask = 0b11111111;
+ let r = _mm256_mask_cmpge_epi64_mask(mask, a, b);
+ assert_eq!(r, 0b00001111);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cmpge_epi64_mask() {
+ let a = _mm_set_epi64x(0, 1);
+ let b = _mm_set1_epi64x(-1);
+ let r = _mm_cmpge_epi64_mask(a, b);
+ assert_eq!(r, 0b00000011);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cmpge_epi64_mask() {
+ let a = _mm_set_epi64x(0, 1);
+ let b = _mm_set1_epi64x(-1);
+ let mask = 0b11111111;
+ let r = _mm_mask_cmpge_epi64_mask(mask, a, b);
+ assert_eq!(r, 0b00000011);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmpeq_epi64_mask() {
+ let a = _mm512_set_epi64(0, 1, -1, 13, i64::MAX, i64::MIN, 100, -100);
+ let b = _mm512_set_epi64(0, 1, 13, 42, i64::MAX, i64::MIN, 100, -100);
+ let m = _mm512_cmpeq_epi64_mask(b, a);
+ assert_eq!(m, 0b11001111);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmpeq_epi64_mask() {
+ let a = _mm512_set_epi64(0, 1, -1, 13, i64::MAX, i64::MIN, 100, -100);
+ let b = _mm512_set_epi64(0, 1, 13, 42, i64::MAX, i64::MIN, 100, -100);
+ let mask = 0b01111010;
+ let r = _mm512_mask_cmpeq_epi64_mask(mask, b, a);
+ assert_eq!(r, 0b01001010);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cmpeq_epi64_mask() {
+ let a = _mm256_set_epi64x(0, 1, -1, 13);
+ let b = _mm256_set_epi64x(0, 1, 13, 42);
+ let m = _mm256_cmpeq_epi64_mask(b, a);
+ assert_eq!(m, 0b00001100);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cmpeq_epi64_mask() {
+ let a = _mm256_set_epi64x(0, 1, -1, 13);
+ let b = _mm256_set_epi64x(0, 1, 13, 42);
+ let mask = 0b11111111;
+ let r = _mm256_mask_cmpeq_epi64_mask(mask, b, a);
+ assert_eq!(r, 0b00001100);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cmpeq_epi64_mask() {
+ let a = _mm_set_epi64x(0, 1);
+ let b = _mm_set_epi64x(0, 1);
+ let m = _mm_cmpeq_epi64_mask(b, a);
+ assert_eq!(m, 0b00000011);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cmpeq_epi64_mask() {
+ let a = _mm_set_epi64x(0, 1);
+ let b = _mm_set_epi64x(0, 1);
+ let mask = 0b11111111;
+ let r = _mm_mask_cmpeq_epi64_mask(mask, b, a);
+ assert_eq!(r, 0b00000011);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_set_epi64() {
+ let r = _mm512_setr_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ assert_eq_m512i(r, _mm512_set_epi64(7, 6, 5, 4, 3, 2, 1, 0))
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_setr_epi64() {
+ let r = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ assert_eq_m512i(r, _mm512_setr_epi64(7, 6, 5, 4, 3, 2, 1, 0))
+ }
+
+ unsafe fn test_mm512_cmpneq_epi64_mask() {
+ let a = _mm512_set_epi64(0, 1, -1, 13, i64::MAX, i64::MIN, 100, -100);
+ let b = _mm512_set_epi64(0, 1, 13, 42, i64::MAX, i64::MIN, 100, -100);
+ let m = _mm512_cmpneq_epi64_mask(b, a);
+ assert_eq!(m, !_mm512_cmpeq_epi64_mask(b, a));
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmpneq_epi64_mask() {
+ let a = _mm512_set_epi64(0, 1, -1, 13, i64::MAX, i64::MIN, -100, 100);
+ let b = _mm512_set_epi64(0, 1, 13, 42, i64::MAX, i64::MIN, 100, -100);
+ let mask = 0b01111010;
+ let r = _mm512_mask_cmpneq_epi64_mask(mask, b, a);
+ assert_eq!(r, 0b00110010)
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cmpneq_epi64_mask() {
+ let a = _mm256_set_epi64x(0, 1, -1, 13);
+ let b = _mm256_set_epi64x(0, 1, 13, 42);
+ let r = _mm256_cmpneq_epi64_mask(b, a);
+ assert_eq!(r, 0b00000011)
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cmpneq_epi64_mask() {
+ let a = _mm256_set_epi64x(0, 1, -1, 13);
+ let b = _mm256_set_epi64x(0, 1, 13, 42);
+ let mask = 0b11111111;
+ let r = _mm256_mask_cmpneq_epi64_mask(mask, b, a);
+ assert_eq!(r, 0b00000011)
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cmpneq_epi64_mask() {
+ let a = _mm_set_epi64x(-1, 13);
+ let b = _mm_set_epi64x(13, 42);
+ let r = _mm_cmpneq_epi64_mask(b, a);
+ assert_eq!(r, 0b00000011)
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cmpneq_epi64_mask() {
+ let a = _mm_set_epi64x(-1, 13);
+ let b = _mm_set_epi64x(13, 42);
+ let mask = 0b11111111;
+ let r = _mm_mask_cmpneq_epi64_mask(mask, b, a);
+ assert_eq!(r, 0b00000011)
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_cmp_epi64_mask() {
+ let a = _mm512_set_epi64(0, 1, -1, 13, i64::MAX, i64::MIN, 100, -100);
+ let b = _mm512_set1_epi64(-1);
+ let m = _mm512_cmp_epi64_mask::<_MM_CMPINT_LT>(a, b);
+ assert_eq!(m, 0b00000101);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cmp_epi64_mask() {
+ let a = _mm512_set_epi64(0, 1, -1, 13, i64::MAX, i64::MIN, 100, -100);
+ let b = _mm512_set1_epi64(-1);
+ let mask = 0b01100110;
+ let r = _mm512_mask_cmp_epi64_mask::<_MM_CMPINT_LT>(mask, a, b);
+ assert_eq!(r, 0b00000100);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_cmp_epi64_mask() {
+ let a = _mm256_set_epi64x(0, 1, -1, 13);
+ let b = _mm256_set1_epi64x(1);
+ let m = _mm256_cmp_epi64_mask::<_MM_CMPINT_LT>(a, b);
+ assert_eq!(m, 0b00001010);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cmp_epi64_mask() {
+ let a = _mm256_set_epi64x(0, 1, -1, 13);
+ let b = _mm256_set1_epi64x(1);
+ let mask = 0b11111111;
+ let r = _mm256_mask_cmp_epi64_mask::<_MM_CMPINT_LT>(mask, a, b);
+ assert_eq!(r, 0b00001010);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_cmp_epi64_mask() {
+ let a = _mm_set_epi64x(0, 1);
+ let b = _mm_set1_epi64x(1);
+ let m = _mm_cmp_epi64_mask::<_MM_CMPINT_LT>(a, b);
+ assert_eq!(m, 0b00000010);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cmp_epi64_mask() {
+ let a = _mm_set_epi64x(0, 1);
+ let b = _mm_set1_epi64x(1);
+ let mask = 0b11111111;
+ let r = _mm_mask_cmp_epi64_mask::<_MM_CMPINT_LT>(mask, a, b);
+ assert_eq!(r, 0b00000010);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_i32gather_pd() {
+ let mut arr = [0f64; 128];
+ for i in 0..128 {
+ arr[i] = i as f64;
+ }
+ // A multiplier of 8 is word-addressing
+ let index = _mm256_setr_epi32(0, 16, 32, 48, 64, 80, 96, 112);
+ let r = _mm512_i32gather_pd::<8>(index, arr.as_ptr() as *const u8);
+ assert_eq_m512d(r, _mm512_setr_pd(0., 16., 32., 48., 64., 80., 96., 112.));
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_i32gather_pd() {
+ let mut arr = [0f64; 128];
+ for i in 0..128 {
+ arr[i] = i as f64;
+ }
+ let src = _mm512_set1_pd(2.);
+ let mask = 0b10101010;
+ let index = _mm256_setr_epi32(0, 16, 32, 48, 64, 80, 96, 112);
+ // A multiplier of 8 is word-addressing
+ let r = _mm512_mask_i32gather_pd::<8>(src, mask, index, arr.as_ptr() as *const u8);
+ assert_eq_m512d(r, _mm512_setr_pd(2., 16., 2., 48., 2., 80., 2., 112.));
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_i64gather_pd() {
+ let mut arr = [0f64; 128];
+ for i in 0..128 {
+ arr[i] = i as f64;
+ }
+ // A multiplier of 8 is word-addressing
+ let index = _mm512_setr_epi64(0, 16, 32, 48, 64, 80, 96, 112);
+ let r = _mm512_i64gather_pd::<8>(index, arr.as_ptr() as *const u8);
+ assert_eq_m512d(r, _mm512_setr_pd(0., 16., 32., 48., 64., 80., 96., 112.));
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_i64gather_pd() {
+ let mut arr = [0f64; 128];
+ for i in 0..128 {
+ arr[i] = i as f64;
+ }
+ let src = _mm512_set1_pd(2.);
+ let mask = 0b10101010;
+ let index = _mm512_setr_epi64(0, 16, 32, 48, 64, 80, 96, 112);
+ // A multiplier of 8 is word-addressing
+ let r = _mm512_mask_i64gather_pd::<8>(src, mask, index, arr.as_ptr() as *const u8);
+ assert_eq_m512d(r, _mm512_setr_pd(2., 16., 2., 48., 2., 80., 2., 112.));
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_i64gather_ps() {
+ let mut arr = [0f32; 128];
+ for i in 0..128 {
+ arr[i] = i as f32;
+ }
+ // A multiplier of 4 is word-addressing
+ #[rustfmt::skip]
+ let index = _mm512_setr_epi64(0, 16, 32, 48, 64, 80, 96, 112);
+ let r = _mm512_i64gather_ps::<4>(index, arr.as_ptr() as *const u8);
+ assert_eq_m256(r, _mm256_setr_ps(0., 16., 32., 48., 64., 80., 96., 112.));
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_i64gather_ps() {
+ let mut arr = [0f32; 128];
+ for i in 0..128 {
+ arr[i] = i as f32;
+ }
+ let src = _mm256_set1_ps(2.);
+ let mask = 0b10101010;
+ #[rustfmt::skip]
+ let index = _mm512_setr_epi64(0, 16, 32, 48, 64, 80, 96, 112);
+ // A multiplier of 4 is word-addressing
+ let r = _mm512_mask_i64gather_ps::<4>(src, mask, index, arr.as_ptr() as *const u8);
+ assert_eq_m256(r, _mm256_setr_ps(2., 16., 2., 48., 2., 80., 2., 112.));
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_i32gather_epi64() {
+ let mut arr = [0i64; 128];
+ for i in 0..128i64 {
+ arr[i as usize] = i;
+ }
+ // A multiplier of 8 is word-addressing
+ let index = _mm256_setr_epi32(0, 16, 32, 48, 64, 80, 96, 112);
+ let r = _mm512_i32gather_epi64::<8>(index, arr.as_ptr() as *const u8);
+ assert_eq_m512i(r, _mm512_setr_epi64(0, 16, 32, 48, 64, 80, 96, 112));
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_i32gather_epi64() {
+ let mut arr = [0i64; 128];
+ for i in 0..128i64 {
+ arr[i as usize] = i;
+ }
+ let src = _mm512_set1_epi64(2);
+ let mask = 0b10101010;
+ let index = _mm256_setr_epi32(0, 16, 32, 48, 64, 80, 96, 112);
+ // A multiplier of 8 is word-addressing
+ let r = _mm512_mask_i32gather_epi64::<8>(src, mask, index, arr.as_ptr() as *const u8);
+ assert_eq_m512i(r, _mm512_setr_epi64(2, 16, 2, 48, 2, 80, 2, 112));
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_i64gather_epi64() {
+ let mut arr = [0i64; 128];
+ for i in 0..128i64 {
+ arr[i as usize] = i;
+ }
+ // A multiplier of 8 is word-addressing
+ let index = _mm512_setr_epi64(0, 16, 32, 48, 64, 80, 96, 112);
+ let r = _mm512_i64gather_epi64::<8>(index, arr.as_ptr() as *const u8);
+ assert_eq_m512i(r, _mm512_setr_epi64(0, 16, 32, 48, 64, 80, 96, 112));
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_i64gather_epi64() {
+ let mut arr = [0i64; 128];
+ for i in 0..128i64 {
+ arr[i as usize] = i;
+ }
+ let src = _mm512_set1_epi64(2);
+ let mask = 0b10101010;
+ let index = _mm512_setr_epi64(0, 16, 32, 48, 64, 80, 96, 112);
+ // A multiplier of 8 is word-addressing
+ let r = _mm512_mask_i64gather_epi64::<8>(src, mask, index, arr.as_ptr() as *const u8);
+ assert_eq_m512i(r, _mm512_setr_epi64(2, 16, 2, 48, 2, 80, 2, 112));
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_i64gather_epi32() {
+ let mut arr = [0i64; 128];
+ for i in 0..128i64 {
+ arr[i as usize] = i;
+ }
+ // A multiplier of 8 is word-addressing
+ let index = _mm512_setr_epi64(0, 16, 32, 48, 64, 80, 96, 112);
+ let r = _mm512_i64gather_epi32::<8>(index, arr.as_ptr() as *const u8);
+ assert_eq_m256i(r, _mm256_setr_epi32(0, 16, 32, 48, 64, 80, 96, 112));
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_i64gather_epi32() {
+ let mut arr = [0i64; 128];
+ for i in 0..128i64 {
+ arr[i as usize] = i;
+ }
+ let src = _mm256_set1_epi32(2);
+ let mask = 0b10101010;
+ let index = _mm512_setr_epi64(0, 16, 32, 48, 64, 80, 96, 112);
+ // A multiplier of 8 is word-addressing
+ let r = _mm512_mask_i64gather_epi32::<8>(src, mask, index, arr.as_ptr() as *const u8);
+ assert_eq_m256i(r, _mm256_setr_epi32(2, 16, 2, 48, 2, 80, 2, 112));
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_i32scatter_pd() {
+ let mut arr = [0f64; 128];
+ let index = _mm256_setr_epi32(0, 16, 32, 48, 64, 80, 96, 112);
+ let src = _mm512_setr_pd(1., 2., 3., 4., 5., 6., 7., 8.);
+ // A multiplier of 8 is word-addressing
+ _mm512_i32scatter_pd::<8>(arr.as_mut_ptr() as *mut u8, index, src);
+ let mut expected = [0f64; 128];
+ for i in 0..8 {
+ expected[i * 16] = (i + 1) as f64;
+ }
+ assert_eq!(&arr[..], &expected[..],);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_i32scatter_pd() {
+ let mut arr = [0f64; 128];
+ let mask = 0b10101010;
+ let index = _mm256_setr_epi32(0, 16, 32, 48, 64, 80, 96, 112);
+ let src = _mm512_setr_pd(1., 2., 3., 4., 5., 6., 7., 8.);
+ // A multiplier of 8 is word-addressing
+ _mm512_mask_i32scatter_pd::<8>(arr.as_mut_ptr() as *mut u8, mask, index, src);
+ let mut expected = [0f64; 128];
+ for i in 0..4 {
+ expected[i * 32 + 16] = 2. * (i + 1) as f64;
+ }
+ assert_eq!(&arr[..], &expected[..],);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_i64scatter_pd() {
+ let mut arr = [0f64; 128];
+ let index = _mm512_setr_epi64(0, 16, 32, 48, 64, 80, 96, 112);
+ let src = _mm512_setr_pd(1., 2., 3., 4., 5., 6., 7., 8.);
+ // A multiplier of 8 is word-addressing
+ _mm512_i64scatter_pd::<8>(arr.as_mut_ptr() as *mut u8, index, src);
+ let mut expected = [0f64; 128];
+ for i in 0..8 {
+ expected[i * 16] = (i + 1) as f64;
+ }
+ assert_eq!(&arr[..], &expected[..],);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_i64scatter_pd() {
+ let mut arr = [0f64; 128];
+ let mask = 0b10101010;
+ let index = _mm512_setr_epi64(0, 16, 32, 48, 64, 80, 96, 112);
+ let src = _mm512_setr_pd(1., 2., 3., 4., 5., 6., 7., 8.);
+ // A multiplier of 8 is word-addressing
+ _mm512_mask_i64scatter_pd::<8>(arr.as_mut_ptr() as *mut u8, mask, index, src);
+ let mut expected = [0f64; 128];
+ for i in 0..4 {
+ expected[i * 32 + 16] = 2. * (i + 1) as f64;
+ }
+ assert_eq!(&arr[..], &expected[..],);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_i64scatter_ps() {
+ let mut arr = [0f32; 128];
+ let index = _mm512_setr_epi64(0, 16, 32, 48, 64, 80, 96, 112);
+ let src = _mm256_setr_ps(1., 2., 3., 4., 5., 6., 7., 8.);
+ // A multiplier of 4 is word-addressing
+ _mm512_i64scatter_ps::<4>(arr.as_mut_ptr() as *mut u8, index, src);
+ let mut expected = [0f32; 128];
+ for i in 0..8 {
+ expected[i * 16] = (i + 1) as f32;
+ }
+ assert_eq!(&arr[..], &expected[..],);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_i64scatter_ps() {
+ let mut arr = [0f32; 128];
+ let mask = 0b10101010;
+ let index = _mm512_setr_epi64(0, 16, 32, 48, 64, 80, 96, 112);
+ let src = _mm256_setr_ps(1., 2., 3., 4., 5., 6., 7., 8.);
+ // A multiplier of 4 is word-addressing
+ _mm512_mask_i64scatter_ps::<4>(arr.as_mut_ptr() as *mut u8, mask, index, src);
+ let mut expected = [0f32; 128];
+ for i in 0..4 {
+ expected[i * 32 + 16] = 2. * (i + 1) as f32;
+ }
+ assert_eq!(&arr[..], &expected[..],);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_i32scatter_epi64() {
+ let mut arr = [0i64; 128];
+ let index = _mm256_setr_epi32(0, 16, 32, 48, 64, 80, 96, 112);
+ let src = _mm512_setr_epi64(1, 2, 3, 4, 5, 6, 7, 8);
+ // A multiplier of 8 is word-addressing
+ _mm512_i32scatter_epi64::<8>(arr.as_mut_ptr() as *mut u8, index, src);
+ let mut expected = [0i64; 128];
+ for i in 0..8 {
+ expected[i * 16] = (i + 1) as i64;
+ }
+ assert_eq!(&arr[..], &expected[..],);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_i32scatter_epi64() {
+ let mut arr = [0i64; 128];
+ let mask = 0b10101010;
+ let index = _mm256_setr_epi32(0, 16, 32, 48, 64, 80, 96, 112);
+ let src = _mm512_setr_epi64(1, 2, 3, 4, 5, 6, 7, 8);
+ // A multiplier of 8 is word-addressing
+ _mm512_mask_i32scatter_epi64::<8>(arr.as_mut_ptr() as *mut u8, mask, index, src);
+ let mut expected = [0i64; 128];
+ for i in 0..4 {
+ expected[i * 32 + 16] = 2 * (i + 1) as i64;
+ }
+ assert_eq!(&arr[..], &expected[..],);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_i64scatter_epi64() {
+ let mut arr = [0i64; 128];
+ let index = _mm512_setr_epi64(0, 16, 32, 48, 64, 80, 96, 112);
+ let src = _mm512_setr_epi64(1, 2, 3, 4, 5, 6, 7, 8);
+ // A multiplier of 8 is word-addressing
+ _mm512_i64scatter_epi64::<8>(arr.as_mut_ptr() as *mut u8, index, src);
+ let mut expected = [0i64; 128];
+ for i in 0..8 {
+ expected[i * 16] = (i + 1) as i64;
+ }
+ assert_eq!(&arr[..], &expected[..],);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_i64scatter_epi64() {
+ let mut arr = [0i64; 128];
+ let mask = 0b10101010;
+ let index = _mm512_setr_epi64(0, 16, 32, 48, 64, 80, 96, 112);
+ let src = _mm512_setr_epi64(1, 2, 3, 4, 5, 6, 7, 8);
+ // A multiplier of 8 is word-addressing
+ _mm512_mask_i64scatter_epi64::<8>(arr.as_mut_ptr() as *mut u8, mask, index, src);
+ let mut expected = [0i64; 128];
+ for i in 0..4 {
+ expected[i * 32 + 16] = 2 * (i + 1) as i64;
+ }
+ assert_eq!(&arr[..], &expected[..],);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_i64scatter_epi32() {
+ let mut arr = [0i32; 128];
+ let index = _mm512_setr_epi64(0, 16, 32, 48, 64, 80, 96, 112);
+ let src = _mm256_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8);
+ // A multiplier of 4 is word-addressing
+ _mm512_i64scatter_epi32::<4>(arr.as_mut_ptr() as *mut u8, index, src);
+ let mut expected = [0i32; 128];
+ for i in 0..8 {
+ expected[i * 16] = (i + 1) as i32;
+ }
+ assert_eq!(&arr[..], &expected[..],);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_i64scatter_epi32() {
+ let mut arr = [0i32; 128];
+ let mask = 0b10101010;
+ let index = _mm512_setr_epi64(0, 16, 32, 48, 64, 80, 96, 112);
+ let src = _mm256_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8);
+ // A multiplier of 4 is word-addressing
+ _mm512_mask_i64scatter_epi32::<4>(arr.as_mut_ptr() as *mut u8, mask, index, src);
+ let mut expected = [0i32; 128];
+ for i in 0..4 {
+ expected[i * 32 + 16] = 2 * (i + 1) as i32;
+ }
+ assert_eq!(&arr[..], &expected[..],);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_rol_epi64() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi64(
+ 1 << 63, 1 << 32, 1 << 32, 1 << 32,
+ 1 << 32, 1 << 32, 1 << 32, 1 << 32,
+ );
+ let r = _mm512_rol_epi64::<1>(a);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi64(
+ 1 << 0, 1 << 33, 1 << 33, 1 << 33,
+ 1 << 33, 1 << 33, 1 << 33, 1 << 33,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_rol_epi64() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi64(
+ 1 << 63, 1 << 32, 1 << 32, 1 << 32,
+ 1 << 32, 1 << 32, 1 << 32, 1 << 32,
+ );
+ let r = _mm512_mask_rol_epi64::<1>(a, 0, a);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_rol_epi64::<1>(a, 0b11111111, a);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi64(
+ 1 << 0, 1 << 33, 1 << 33, 1 << 33,
+ 1 << 33, 1 << 33, 1 << 33, 1 << 33,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_rol_epi64() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi64(
+ 1 << 32, 1 << 32, 1 << 32, 1 << 32,
+ 1 << 32, 1 << 32, 1 << 32, 1 << 63,
+ );
+ let r = _mm512_maskz_rol_epi64::<1>(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_rol_epi64::<1>(0b00001111, a);
+ let e = _mm512_set_epi64(0, 0, 0, 0, 1 << 33, 1 << 33, 1 << 33, 1 << 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_rol_epi64() {
+ let a = _mm256_set_epi64x(1 << 63, 1 << 32, 1 << 32, 1 << 32);
+ let r = _mm256_rol_epi64::<1>(a);
+ let e = _mm256_set_epi64x(1 << 0, 1 << 33, 1 << 33, 1 << 33);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_rol_epi64() {
+ let a = _mm256_set_epi64x(1 << 63, 1 << 32, 1 << 32, 1 << 32);
+ let r = _mm256_mask_rol_epi64::<1>(a, 0, a);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_rol_epi64::<1>(a, 0b00001111, a);
+ let e = _mm256_set_epi64x(1 << 0, 1 << 33, 1 << 33, 1 << 33);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_rol_epi64() {
+ let a = _mm256_set_epi64x(1 << 63, 1 << 32, 1 << 32, 1 << 32);
+ let r = _mm256_maskz_rol_epi64::<1>(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_rol_epi64::<1>(0b00001111, a);
+ let e = _mm256_set_epi64x(1 << 0, 1 << 33, 1 << 33, 1 << 33);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_rol_epi64() {
+ let a = _mm_set_epi64x(1 << 63, 1 << 32);
+ let r = _mm_rol_epi64::<1>(a);
+ let e = _mm_set_epi64x(1 << 0, 1 << 33);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_rol_epi64() {
+ let a = _mm_set_epi64x(1 << 63, 1 << 32);
+ let r = _mm_mask_rol_epi64::<1>(a, 0, a);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_rol_epi64::<1>(a, 0b00000011, a);
+ let e = _mm_set_epi64x(1 << 0, 1 << 33);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_rol_epi64() {
+ let a = _mm_set_epi64x(1 << 63, 1 << 32);
+ let r = _mm_maskz_rol_epi64::<1>(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_rol_epi64::<1>(0b00000011, a);
+ let e = _mm_set_epi64x(1 << 0, 1 << 33);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_ror_epi64() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi64(
+ 1 << 0, 1 << 32, 1 << 32, 1 << 32,
+ 1 << 32, 1 << 32, 1 << 32, 1 << 32,
+ );
+ let r = _mm512_ror_epi64::<1>(a);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi64(
+ 1 << 63, 1 << 31, 1 << 31, 1 << 31,
+ 1 << 31, 1 << 31, 1 << 31, 1 << 31,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_ror_epi64() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi64(
+ 1 << 0, 1 << 32, 1 << 32, 1 << 32,
+ 1 << 32, 1 << 32, 1 << 32, 1 << 32,
+ );
+ let r = _mm512_mask_ror_epi64::<1>(a, 0, a);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_ror_epi64::<1>(a, 0b11111111, a);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi64(
+ 1 << 63, 1 << 31, 1 << 31, 1 << 31,
+ 1 << 31, 1 << 31, 1 << 31, 1 << 31,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_ror_epi64() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi64(
+ 1 << 32, 1 << 32, 1 << 32, 1 << 32,
+ 1 << 32, 1 << 32, 1 << 32, 1 << 0,
+ );
+ let r = _mm512_maskz_ror_epi64::<1>(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_ror_epi64::<1>(0b00001111, a);
+ let e = _mm512_set_epi64(0, 0, 0, 0, 1 << 31, 1 << 31, 1 << 31, 1 << 63);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_ror_epi64() {
+ let a = _mm256_set_epi64x(1 << 0, 1 << 32, 1 << 32, 1 << 32);
+ let r = _mm256_ror_epi64::<1>(a);
+ let e = _mm256_set_epi64x(1 << 63, 1 << 31, 1 << 31, 1 << 31);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_ror_epi64() {
+ let a = _mm256_set_epi64x(1 << 0, 1 << 32, 1 << 32, 1 << 32);
+ let r = _mm256_mask_ror_epi64::<1>(a, 0, a);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_ror_epi64::<1>(a, 0b00001111, a);
+ let e = _mm256_set_epi64x(1 << 63, 1 << 31, 1 << 31, 1 << 31);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_ror_epi64() {
+ let a = _mm256_set_epi64x(1 << 0, 1 << 32, 1 << 32, 1 << 32);
+ let r = _mm256_maskz_ror_epi64::<1>(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_ror_epi64::<1>(0b00001111, a);
+ let e = _mm256_set_epi64x(1 << 63, 1 << 31, 1 << 31, 1 << 31);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_ror_epi64() {
+ let a = _mm_set_epi64x(1 << 0, 1 << 32);
+ let r = _mm_ror_epi64::<1>(a);
+ let e = _mm_set_epi64x(1 << 63, 1 << 31);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_ror_epi64() {
+ let a = _mm_set_epi64x(1 << 0, 1 << 32);
+ let r = _mm_mask_ror_epi64::<1>(a, 0, a);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_ror_epi64::<1>(a, 0b00000011, a);
+ let e = _mm_set_epi64x(1 << 63, 1 << 31);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_ror_epi64() {
+ let a = _mm_set_epi64x(1 << 0, 1 << 32);
+ let r = _mm_maskz_ror_epi64::<1>(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_ror_epi64::<1>(0b00000011, a);
+ let e = _mm_set_epi64x(1 << 63, 1 << 31);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_slli_epi64() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi64(
+ 1 << 63, 1 << 32, 1 << 32, 1 << 32,
+ 1 << 32, 1 << 32, 1 << 32, 1 << 32,
+ );
+ let r = _mm512_slli_epi64::<1>(a);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi64(
+ 0, 1 << 33, 1 << 33, 1 << 33,
+ 1 << 33, 1 << 33, 1 << 33, 1 << 33,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_slli_epi64() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi64(
+ 1 << 63, 1 << 32, 1 << 32, 1 << 32,
+ 1 << 32, 1 << 32, 1 << 32, 1 << 32,
+ );
+ let r = _mm512_mask_slli_epi64::<1>(a, 0, a);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_slli_epi64::<1>(a, 0b11111111, a);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi64(
+ 0, 1 << 33, 1 << 33, 1 << 33,
+ 1 << 33, 1 << 33, 1 << 33, 1 << 33,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_slli_epi64() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi64(
+ 1 << 32, 1 << 32, 1 << 32, 1 << 32,
+ 1 << 32, 1 << 32, 1 << 32, 1 << 63,
+ );
+ let r = _mm512_maskz_slli_epi64::<1>(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_slli_epi64::<1>(0b00001111, a);
+ let e = _mm512_set_epi64(0, 0, 0, 0, 1 << 33, 1 << 33, 1 << 33, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_slli_epi64() {
+ let a = _mm256_set_epi64x(1 << 63, 1 << 32, 1 << 32, 1 << 32);
+ let r = _mm256_mask_slli_epi64::<1>(a, 0, a);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_slli_epi64::<1>(a, 0b00001111, a);
+ let e = _mm256_set_epi64x(0, 1 << 33, 1 << 33, 1 << 33);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_slli_epi64() {
+ let a = _mm256_set_epi64x(1 << 63, 1 << 32, 1 << 32, 1 << 32);
+ let r = _mm256_maskz_slli_epi64::<1>(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_slli_epi64::<1>(0b00001111, a);
+ let e = _mm256_set_epi64x(0, 1 << 33, 1 << 33, 1 << 33);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_slli_epi64() {
+ let a = _mm_set_epi64x(1 << 63, 1 << 32);
+ let r = _mm_mask_slli_epi64::<1>(a, 0, a);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_slli_epi64::<1>(a, 0b00000011, a);
+ let e = _mm_set_epi64x(0, 1 << 33);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_slli_epi64() {
+ let a = _mm_set_epi64x(1 << 63, 1 << 32);
+ let r = _mm_maskz_slli_epi64::<1>(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_slli_epi64::<1>(0b00000011, a);
+ let e = _mm_set_epi64x(0, 1 << 33);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_srli_epi64() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi64(
+ 1 << 0, 1 << 32, 1 << 32, 1 << 32,
+ 1 << 32, 1 << 32, 1 << 32, 1 << 32,
+ );
+ let r = _mm512_srli_epi64::<1>(a);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi64(
+ 0, 1 << 31, 1 << 31, 1 << 31,
+ 1 << 31, 1 << 31, 1 << 31, 1 << 31,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_srli_epi64() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi64(
+ 1 << 0, 1 << 32, 1 << 32, 1 << 32,
+ 1 << 32, 1 << 32, 1 << 32, 1 << 32,
+ );
+ let r = _mm512_mask_srli_epi64::<1>(a, 0, a);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_srli_epi64::<1>(a, 0b11111111, a);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi64(
+ 0, 1 << 31, 1 << 31, 1 << 31,
+ 1 << 31, 1 << 31, 1 << 31, 1 << 31,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_srli_epi64() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi64(
+ 1 << 32, 1 << 32, 1 << 32, 1 << 32,
+ 1 << 32, 1 << 32, 1 << 32, 1 << 0,
+ );
+ let r = _mm512_maskz_srli_epi64::<1>(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_srli_epi64::<1>(0b00001111, a);
+ let e = _mm512_set_epi64(0, 0, 0, 0, 1 << 31, 1 << 31, 1 << 31, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_srli_epi64() {
+ let a = _mm256_set_epi64x(1 << 5, 0, 0, 0);
+ let r = _mm256_mask_srli_epi64::<1>(a, 0, a);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_srli_epi64::<1>(a, 0b00001111, a);
+ let e = _mm256_set_epi64x(1 << 4, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_srli_epi64() {
+ let a = _mm256_set_epi64x(1 << 5, 0, 0, 0);
+ let r = _mm256_maskz_srli_epi64::<1>(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_srli_epi64::<1>(0b00001111, a);
+ let e = _mm256_set_epi64x(1 << 4, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_srli_epi64() {
+ let a = _mm_set_epi64x(1 << 5, 0);
+ let r = _mm_mask_srli_epi64::<1>(a, 0, a);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_srli_epi64::<1>(a, 0b00000011, a);
+ let e = _mm_set_epi64x(1 << 4, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_srli_epi64() {
+ let a = _mm_set_epi64x(1 << 5, 0);
+ let r = _mm_maskz_srli_epi64::<1>(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_srli_epi64::<1>(0b00000011, a);
+ let e = _mm_set_epi64x(1 << 4, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_rolv_epi64() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi64(
+ 1 << 32, 1 << 63, 1 << 32, 1 << 32,
+ 1 << 32, 1 << 32, 1 << 32, 1 << 32,
+ );
+ let b = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = _mm512_rolv_epi64(a, b);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi64(
+ 1 << 32, 1 << 0, 1 << 34, 1 << 35,
+ 1 << 36, 1 << 37, 1 << 38, 1 << 39,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_rolv_epi64() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi64(
+ 1 << 32, 1 << 63, 1 << 32, 1 << 32,
+ 1 << 32, 1 << 32, 1 << 32, 1 << 32,
+ );
+ let b = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = _mm512_mask_rolv_epi64(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_rolv_epi64(a, 0b11111111, a, b);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi64(
+ 1 << 32, 1 << 0, 1 << 34, 1 << 35,
+ 1 << 36, 1 << 37, 1 << 38, 1 << 39,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_rolv_epi64() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi64(
+ 1 << 32, 1 << 32, 1 << 32, 1 << 32,
+ 1 << 32, 1 << 32, 1 << 32, 1 << 62,
+ );
+ let b = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 2);
+ let r = _mm512_maskz_rolv_epi64(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_rolv_epi64(0b00001111, a, b);
+ let e = _mm512_set_epi64(0, 0, 0, 0, 1 << 36, 1 << 37, 1 << 38, 1 << 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_rolv_epi64() {
+ let a = _mm256_set_epi64x(1 << 32, 1 << 63, 1 << 32, 1 << 32);
+ let b = _mm256_set_epi64x(0, 1, 2, 3);
+ let r = _mm256_rolv_epi64(a, b);
+ let e = _mm256_set_epi64x(1 << 32, 1 << 0, 1 << 34, 1 << 35);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_rolv_epi64() {
+ let a = _mm256_set_epi64x(1 << 32, 1 << 63, 1 << 32, 1 << 32);
+ let b = _mm256_set_epi64x(0, 1, 2, 3);
+ let r = _mm256_mask_rolv_epi64(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_rolv_epi64(a, 0b00001111, a, b);
+ let e = _mm256_set_epi64x(1 << 32, 1 << 0, 1 << 34, 1 << 35);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_rolv_epi64() {
+ let a = _mm256_set_epi64x(1 << 32, 1 << 63, 1 << 32, 1 << 32);
+ let b = _mm256_set_epi64x(0, 1, 2, 3);
+ let r = _mm256_maskz_rolv_epi64(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_rolv_epi64(0b00001111, a, b);
+ let e = _mm256_set_epi64x(1 << 32, 1 << 0, 1 << 34, 1 << 35);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_rolv_epi64() {
+ let a = _mm_set_epi64x(1 << 32, 1 << 63);
+ let b = _mm_set_epi64x(0, 1);
+ let r = _mm_rolv_epi64(a, b);
+ let e = _mm_set_epi64x(1 << 32, 1 << 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_rolv_epi64() {
+ let a = _mm_set_epi64x(1 << 32, 1 << 63);
+ let b = _mm_set_epi64x(0, 1);
+ let r = _mm_mask_rolv_epi64(a, 0, a, b);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_rolv_epi64(a, 0b00000011, a, b);
+ let e = _mm_set_epi64x(1 << 32, 1 << 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_rolv_epi64() {
+ let a = _mm_set_epi64x(1 << 32, 1 << 63);
+ let b = _mm_set_epi64x(0, 1);
+ let r = _mm_maskz_rolv_epi64(0, a, b);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_rolv_epi64(0b00000011, a, b);
+ let e = _mm_set_epi64x(1 << 32, 1 << 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_rorv_epi64() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi64(
+ 1 << 32, 1 << 0, 1 << 32, 1 << 32,
+ 1 << 32, 1 << 32, 1 << 32, 1 << 32,
+ );
+ let b = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = _mm512_rorv_epi64(a, b);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi64(
+ 1 << 32, 1 << 63, 1 << 30, 1 << 29,
+ 1 << 28, 1 << 27, 1 << 26, 1 << 25,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_rorv_epi64() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi64(
+ 1 << 32, 1 << 0, 1 << 32, 1 << 32,
+ 1 << 32, 1 << 32, 1 << 32, 1 << 32,
+ );
+ let b = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = _mm512_mask_rorv_epi64(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_rorv_epi64(a, 0b11111111, a, b);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi64(
+ 1 << 32, 1 << 63, 1 << 30, 1 << 29,
+ 1 << 28, 1 << 27, 1 << 26, 1 << 25,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_rorv_epi64() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi64(
+ 1 << 32, 1 << 32, 1 << 32, 1 << 32,
+ 1 << 32, 1 << 32, 1 << 32, 1 << 0,
+ );
+ let b = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 2);
+ let r = _mm512_maskz_rorv_epi64(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_rorv_epi64(0b00001111, a, b);
+ let e = _mm512_set_epi64(0, 0, 0, 0, 1 << 28, 1 << 27, 1 << 26, 1 << 62);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_rorv_epi64() {
+ let a = _mm256_set_epi64x(1 << 32, 1 << 0, 1 << 32, 1 << 32);
+ let b = _mm256_set_epi64x(0, 1, 2, 3);
+ let r = _mm256_rorv_epi64(a, b);
+ let e = _mm256_set_epi64x(1 << 32, 1 << 63, 1 << 30, 1 << 29);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_rorv_epi64() {
+ let a = _mm256_set_epi64x(1 << 32, 1 << 0, 1 << 32, 1 << 32);
+ let b = _mm256_set_epi64x(0, 1, 2, 3);
+ let r = _mm256_mask_rorv_epi64(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_rorv_epi64(a, 0b00001111, a, b);
+ let e = _mm256_set_epi64x(1 << 32, 1 << 63, 1 << 30, 1 << 29);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_rorv_epi64() {
+ let a = _mm256_set_epi64x(1 << 32, 1 << 0, 1 << 32, 1 << 32);
+ let b = _mm256_set_epi64x(0, 1, 2, 3);
+ let r = _mm256_maskz_rorv_epi64(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_rorv_epi64(0b00001111, a, b);
+ let e = _mm256_set_epi64x(1 << 32, 1 << 63, 1 << 30, 1 << 29);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_rorv_epi64() {
+ let a = _mm_set_epi64x(1 << 32, 1 << 0);
+ let b = _mm_set_epi64x(0, 1);
+ let r = _mm_rorv_epi64(a, b);
+ let e = _mm_set_epi64x(1 << 32, 1 << 63);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_rorv_epi64() {
+ let a = _mm_set_epi64x(1 << 32, 1 << 0);
+ let b = _mm_set_epi64x(0, 1);
+ let r = _mm_mask_rorv_epi64(a, 0, a, b);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_rorv_epi64(a, 0b00000011, a, b);
+ let e = _mm_set_epi64x(1 << 32, 1 << 63);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_rorv_epi64() {
+ let a = _mm_set_epi64x(1 << 32, 1 << 0);
+ let b = _mm_set_epi64x(0, 1);
+ let r = _mm_maskz_rorv_epi64(0, a, b);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_rorv_epi64(0b00000011, a, b);
+ let e = _mm_set_epi64x(1 << 32, 1 << 63);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_sllv_epi64() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi64(
+ 1 << 32, 1 << 63, 1 << 32, 1 << 32,
+ 1 << 32, 1 << 32, 1 << 32, 1 << 32,
+ );
+ let count = _mm512_set_epi64(0, 2, 2, 3, 4, 5, 6, 7);
+ let r = _mm512_sllv_epi64(a, count);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi64(
+ 1 << 32, 0, 1 << 34, 1 << 35,
+ 1 << 36, 1 << 37, 1 << 38, 1 << 39,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_sllv_epi64() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi64(
+ 1 << 32, 1 << 32, 1 << 63, 1 << 32,
+ 1 << 32, 1 << 32, 1 << 32, 1 << 32,
+ );
+ let count = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = _mm512_mask_sllv_epi64(a, 0, a, count);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_sllv_epi64(a, 0b11111111, a, count);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi64(
+ 1 << 32, 1 << 33, 0, 1 << 35,
+ 1 << 36, 1 << 37, 1 << 38, 1 << 39,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_sllv_epi64() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi64(
+ 1 << 32, 1 << 32, 1 << 32, 1 << 32,
+ 1 << 32, 1 << 32, 1 << 32, 1 << 63,
+ );
+ let count = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 1);
+ let r = _mm512_maskz_sllv_epi64(0, a, count);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_sllv_epi64(0b00001111, a, count);
+ let e = _mm512_set_epi64(0, 0, 0, 0, 1 << 36, 1 << 37, 1 << 38, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_sllv_epi64() {
+ let a = _mm256_set_epi64x(1 << 32, 1 << 32, 1 << 63, 1 << 32);
+ let count = _mm256_set_epi64x(0, 1, 2, 3);
+ let r = _mm256_mask_sllv_epi64(a, 0, a, count);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_sllv_epi64(a, 0b00001111, a, count);
+ let e = _mm256_set_epi64x(1 << 32, 1 << 33, 0, 1 << 35);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_sllv_epi64() {
+ let a = _mm256_set_epi64x(1 << 32, 1 << 32, 1 << 63, 1 << 32);
+ let count = _mm256_set_epi64x(0, 1, 2, 3);
+ let r = _mm256_maskz_sllv_epi64(0, a, count);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_sllv_epi64(0b00001111, a, count);
+ let e = _mm256_set_epi64x(1 << 32, 1 << 33, 0, 1 << 35);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_sllv_epi64() {
+ let a = _mm_set_epi64x(1 << 63, 1 << 32);
+ let count = _mm_set_epi64x(2, 3);
+ let r = _mm_mask_sllv_epi64(a, 0, a, count);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_sllv_epi64(a, 0b00000011, a, count);
+ let e = _mm_set_epi64x(0, 1 << 35);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_sllv_epi64() {
+ let a = _mm_set_epi64x(1 << 63, 1 << 32);
+ let count = _mm_set_epi64x(2, 3);
+ let r = _mm_maskz_sllv_epi64(0, a, count);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_sllv_epi64(0b00000011, a, count);
+ let e = _mm_set_epi64x(0, 1 << 35);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_srlv_epi64() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi64(
+ 1 << 32, 1 << 0, 1 << 32, 1 << 32,
+ 1 << 32, 1 << 32, 1 << 32, 1 << 32,
+ );
+ let count = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = _mm512_srlv_epi64(a, count);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi64(
+ 1 << 32, 0, 1 << 30, 1 << 29,
+ 1 << 28, 1 << 27, 1 << 26, 1 << 25,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_srlv_epi64() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi64(
+ 1 << 32, 1 << 0, 1 << 32, 1 << 32,
+ 1 << 32, 1 << 32, 1 << 32, 1 << 32,
+ );
+ let count = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = _mm512_mask_srlv_epi64(a, 0, a, count);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_srlv_epi64(a, 0b11111111, a, count);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi64(
+ 1 << 32, 0, 1 << 30, 1 << 29,
+ 1 << 28, 1 << 27, 1 << 26, 1 << 25,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_srlv_epi64() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi64(
+ 1 << 32, 1 << 32, 1 << 32, 1 << 32,
+ 1 << 32, 1 << 32, 1 << 32, 1 << 0,
+ );
+ let count = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = _mm512_maskz_srlv_epi64(0, a, count);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_srlv_epi64(0b00001111, a, count);
+ let e = _mm512_set_epi64(0, 0, 0, 0, 1 << 28, 1 << 27, 1 << 26, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_srlv_epi64() {
+ let a = _mm256_set_epi64x(1 << 5, 0, 0, 0);
+ let count = _mm256_set1_epi64x(1);
+ let r = _mm256_mask_srlv_epi64(a, 0, a, count);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_srlv_epi64(a, 0b00001111, a, count);
+ let e = _mm256_set_epi64x(1 << 4, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_srlv_epi64() {
+ let a = _mm256_set_epi64x(1 << 5, 0, 0, 0);
+ let count = _mm256_set1_epi64x(1);
+ let r = _mm256_maskz_srlv_epi64(0, a, count);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_srlv_epi64(0b00001111, a, count);
+ let e = _mm256_set_epi64x(1 << 4, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_srlv_epi64() {
+ let a = _mm_set_epi64x(1 << 5, 0);
+ let count = _mm_set1_epi64x(1);
+ let r = _mm_mask_srlv_epi64(a, 0, a, count);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_srlv_epi64(a, 0b00000011, a, count);
+ let e = _mm_set_epi64x(1 << 4, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_srlv_epi64() {
+ let a = _mm_set_epi64x(1 << 5, 0);
+ let count = _mm_set1_epi64x(1);
+ let r = _mm_maskz_srlv_epi64(0, a, count);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_srlv_epi64(0b00000011, a, count);
+ let e = _mm_set_epi64x(1 << 4, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_sll_epi64() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi64(
+ 1 << 63, 1 << 32, 1 << 32, 1 << 32,
+ 1 << 32, 1 << 32, 1 << 32, 1 << 32,
+ );
+ let count = _mm_set_epi64x(0, 1);
+ let r = _mm512_sll_epi64(a, count);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi64(
+ 0, 1 << 33, 1 << 33, 1 << 33,
+ 1 << 33, 1 << 33, 1 << 33, 1 << 33,
+ );
+ assert_eq_m512i(r, e);
+ let count = _mm_set_epi64x(1, 0);
+ let r = _mm512_sll_epi64(a, count);
+ assert_eq_m512i(r, a);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_sll_epi64() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi64(
+ 1 << 63, 1 << 32, 1 << 32, 1 << 32,
+ 1 << 32, 1 << 32, 1 << 32, 1 << 32,
+ );
+ let count = _mm_set_epi64x(0, 1);
+ let r = _mm512_mask_sll_epi64(a, 0, a, count);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_sll_epi64(a, 0b11111111, a, count);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi64(
+ 0, 1 << 33, 1 << 33, 1 << 33,
+ 1 << 33, 1 << 33, 1 << 33, 1 << 33,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_sll_epi64() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi64(
+ 1 << 32, 1 << 32, 1 << 32, 1 << 32,
+ 1 << 32, 1 << 32, 1 << 32, 1 << 63,
+ );
+ let count = _mm_set_epi64x(0, 1);
+ let r = _mm512_maskz_sll_epi64(0, a, count);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_sll_epi64(0b00001111, a, count);
+ let e = _mm512_set_epi64(0, 0, 0, 0, 1 << 33, 1 << 33, 1 << 33, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_sll_epi64() {
+ let a = _mm256_set_epi64x(1 << 63, 1 << 32, 1 << 32, 1 << 32);
+ let count = _mm_set_epi64x(0, 1);
+ let r = _mm256_mask_sll_epi64(a, 0, a, count);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_sll_epi64(a, 0b00001111, a, count);
+ let e = _mm256_set_epi64x(0, 1 << 33, 1 << 33, 1 << 33);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_sll_epi64() {
+ let a = _mm256_set_epi64x(1 << 63, 1 << 32, 1 << 32, 1 << 32);
+ let count = _mm_set_epi64x(0, 1);
+ let r = _mm256_maskz_sll_epi64(0, a, count);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_sll_epi64(0b00001111, a, count);
+ let e = _mm256_set_epi64x(0, 1 << 33, 1 << 33, 1 << 33);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_sll_epi64() {
+ let a = _mm_set_epi64x(1 << 63, 1 << 32);
+ let count = _mm_set_epi64x(0, 1);
+ let r = _mm_mask_sll_epi64(a, 0, a, count);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_sll_epi64(a, 0b00000011, a, count);
+ let e = _mm_set_epi64x(0, 1 << 33);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_sll_epi64() {
+ let a = _mm_set_epi64x(1 << 63, 1 << 32);
+ let count = _mm_set_epi64x(0, 1);
+ let r = _mm_maskz_sll_epi64(0, a, count);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_sll_epi64(0b00000011, a, count);
+ let e = _mm_set_epi64x(0, 1 << 33);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_srl_epi64() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi64(
+ 1 << 0, 1 << 32, 1 << 32, 1 << 32,
+ 1 << 32, 1 << 32, 1 << 32, 1 << 32,
+ );
+ let count = _mm_set_epi64x(0, 1);
+ let r = _mm512_srl_epi64(a, count);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi64(
+ 0, 1 << 31, 1 << 31, 1 << 31,
+ 1 << 31, 1 << 31, 1 << 31, 1 << 31,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_srl_epi64() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi64(
+ 1 << 0, 1 << 32, 1 << 32, 1 << 32,
+ 1 << 32, 1 << 32, 1 << 32, 1 << 32,
+ );
+ let count = _mm_set_epi64x(0, 1);
+ let r = _mm512_mask_srl_epi64(a, 0, a, count);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_srl_epi64(a, 0b11111111, a, count);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi64(
+ 0, 1 << 31, 1 << 31, 1 << 31,
+ 1 << 31, 1 << 31, 1 << 31, 1 << 31,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_srl_epi64() {
+ #[rustfmt::skip]
+ let a = _mm512_set_epi64(
+ 1 << 32, 1 << 32, 1 << 32, 1 << 32,
+ 1 << 32, 1 << 32, 1 << 32, 1 << 0,
+ );
+ let count = _mm_set_epi64x(0, 1);
+ let r = _mm512_maskz_srl_epi64(0, a, count);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_srl_epi64(0b00001111, a, count);
+ let e = _mm512_set_epi64(0, 0, 0, 0, 1 << 31, 1 << 31, 1 << 31, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_srl_epi64() {
+ let a = _mm256_set_epi64x(1 << 5, 0, 0, 0);
+ let count = _mm_set_epi64x(0, 1);
+ let r = _mm256_mask_srl_epi64(a, 0, a, count);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_srl_epi64(a, 0b00001111, a, count);
+ let e = _mm256_set_epi64x(1 << 4, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_srl_epi64() {
+ let a = _mm256_set_epi64x(1 << 5, 0, 0, 0);
+ let count = _mm_set_epi64x(0, 1);
+ let r = _mm256_maskz_srl_epi64(0, a, count);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_srl_epi64(0b00001111, a, count);
+ let e = _mm256_set_epi64x(1 << 4, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_srl_epi64() {
+ let a = _mm_set_epi64x(1 << 5, 0);
+ let count = _mm_set_epi64x(0, 1);
+ let r = _mm_mask_srl_epi64(a, 0, a, count);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_srl_epi64(a, 0b00000011, a, count);
+ let e = _mm_set_epi64x(1 << 4, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_srl_epi64() {
+ let a = _mm_set_epi64x(1 << 5, 0);
+ let count = _mm_set_epi64x(0, 1);
+ let r = _mm_maskz_srl_epi64(0, a, count);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_srl_epi64(0b00000011, a, count);
+ let e = _mm_set_epi64x(1 << 4, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_sra_epi64() {
+ let a = _mm512_set_epi64(1, -8, 0, 0, 0, 0, 15, -16);
+ let count = _mm_set_epi64x(0, 2);
+ let r = _mm512_sra_epi64(a, count);
+ let e = _mm512_set_epi64(0, -2, 0, 0, 0, 0, 3, -4);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_sra_epi64() {
+ let a = _mm512_set_epi64(1, -8, 0, 0, 0, 0, 15, -16);
+ let count = _mm_set_epi64x(0, 2);
+ let r = _mm512_mask_sra_epi64(a, 0, a, count);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_sra_epi64(a, 0b11111111, a, count);
+ let e = _mm512_set_epi64(0, -2, 0, 0, 0, 0, 3, -4);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_sra_epi64() {
+ let a = _mm512_set_epi64(1, -8, 0, 0, 0, 0, 15, -16);
+ let count = _mm_set_epi64x(0, 2);
+ let r = _mm512_maskz_sra_epi64(0, a, count);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_sra_epi64(0b00001111, a, count);
+ let e = _mm512_set_epi64(0, 0, 0, 0, 0, 0, 3, -4);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_sra_epi64() {
+ let a = _mm256_set_epi64x(1 << 5, 0, 0, 0);
+ let count = _mm_set_epi64x(0, 1);
+ let r = _mm256_sra_epi64(a, count);
+ let e = _mm256_set_epi64x(1 << 4, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_sra_epi64() {
+ let a = _mm256_set_epi64x(1 << 5, 0, 0, 0);
+ let count = _mm_set_epi64x(0, 1);
+ let r = _mm256_mask_sra_epi64(a, 0, a, count);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_sra_epi64(a, 0b00001111, a, count);
+ let e = _mm256_set_epi64x(1 << 4, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_sra_epi64() {
+ let a = _mm256_set_epi64x(1 << 5, 0, 0, 0);
+ let count = _mm_set_epi64x(0, 1);
+ let r = _mm256_maskz_sra_epi64(0, a, count);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_sra_epi64(0b00001111, a, count);
+ let e = _mm256_set_epi64x(1 << 4, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_sra_epi64() {
+ let a = _mm_set_epi64x(1 << 5, 0);
+ let count = _mm_set_epi64x(0, 1);
+ let r = _mm_sra_epi64(a, count);
+ let e = _mm_set_epi64x(1 << 4, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_sra_epi64() {
+ let a = _mm_set_epi64x(1 << 5, 0);
+ let count = _mm_set_epi64x(0, 1);
+ let r = _mm_mask_sra_epi64(a, 0, a, count);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_sra_epi64(a, 0b00000011, a, count);
+ let e = _mm_set_epi64x(1 << 4, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_sra_epi64() {
+ let a = _mm_set_epi64x(1 << 5, 0);
+ let count = _mm_set_epi64x(0, 1);
+ let r = _mm_maskz_sra_epi64(0, a, count);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_sra_epi64(0b00000011, a, count);
+ let e = _mm_set_epi64x(1 << 4, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_srav_epi64() {
+ let a = _mm512_set_epi64(1, -8, 0, 0, 0, 0, 15, -16);
+ let count = _mm512_set_epi64(2, 2, 0, 0, 0, 0, 2, 1);
+ let r = _mm512_srav_epi64(a, count);
+ let e = _mm512_set_epi64(0, -2, 0, 0, 0, 0, 3, -8);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_srav_epi64() {
+ let a = _mm512_set_epi64(1, -8, 0, 0, 0, 0, 15, -16);
+ let count = _mm512_set_epi64(2, 2, 0, 0, 0, 0, 2, 1);
+ let r = _mm512_mask_srav_epi64(a, 0, a, count);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_srav_epi64(a, 0b11111111, a, count);
+ let e = _mm512_set_epi64(0, -2, 0, 0, 0, 0, 3, -8);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_srav_epi64() {
+ let a = _mm512_set_epi64(1, -8, 0, 0, 0, 0, 15, -16);
+ let count = _mm512_set_epi64(2, 2, 0, 0, 0, 0, 2, 1);
+ let r = _mm512_maskz_srav_epi64(0, a, count);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_srav_epi64(0b00001111, a, count);
+ let e = _mm512_set_epi64(0, 0, 0, 0, 0, 0, 3, -8);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_srav_epi64() {
+ let a = _mm256_set_epi64x(1 << 5, 0, 0, 0);
+ let count = _mm256_set1_epi64x(1);
+ let r = _mm256_srav_epi64(a, count);
+ let e = _mm256_set_epi64x(1 << 4, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_srav_epi64() {
+ let a = _mm256_set_epi64x(1 << 5, 0, 0, 0);
+ let count = _mm256_set1_epi64x(1);
+ let r = _mm256_mask_srav_epi64(a, 0, a, count);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_srav_epi64(a, 0b00001111, a, count);
+ let e = _mm256_set_epi64x(1 << 4, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_srav_epi64() {
+ let a = _mm256_set_epi64x(1 << 5, 0, 0, 0);
+ let count = _mm256_set1_epi64x(1);
+ let r = _mm256_maskz_srav_epi64(0, a, count);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_srav_epi64(0b00001111, a, count);
+ let e = _mm256_set_epi64x(1 << 4, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_srav_epi64() {
+ let a = _mm_set_epi64x(1 << 5, 0);
+ let count = _mm_set1_epi64x(1);
+ let r = _mm_srav_epi64(a, count);
+ let e = _mm_set_epi64x(1 << 4, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_srav_epi64() {
+ let a = _mm_set_epi64x(1 << 5, 0);
+ let count = _mm_set1_epi64x(1);
+ let r = _mm_mask_srav_epi64(a, 0, a, count);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_srav_epi64(a, 0b00000011, a, count);
+ let e = _mm_set_epi64x(1 << 4, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_srav_epi64() {
+ let a = _mm_set_epi64x(1 << 5, 0);
+ let count = _mm_set1_epi64x(1);
+ let r = _mm_maskz_srav_epi64(0, a, count);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_srav_epi64(0b00000011, a, count);
+ let e = _mm_set_epi64x(1 << 4, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_srai_epi64() {
+ let a = _mm512_set_epi64(1, -4, 15, 0, 0, 0, 0, -16);
+ let r = _mm512_srai_epi64::<2>(a);
+ let e = _mm512_set_epi64(0, -1, 3, 0, 0, 0, 0, -4);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_srai_epi64() {
+ let a = _mm512_set_epi64(1, -4, 15, 0, 0, 0, 0, -16);
+ let r = _mm512_mask_srai_epi64::<2>(a, 0, a);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_srai_epi64::<2>(a, 0b11111111, a);
+ let e = _mm512_set_epi64(0, -1, 3, 0, 0, 0, 0, -4);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_srai_epi64() {
+ let a = _mm512_set_epi64(1, -4, 15, 0, 0, 0, 0, -16);
+ let r = _mm512_maskz_srai_epi64::<2>(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_srai_epi64::<2>(0b00001111, a);
+ let e = _mm512_set_epi64(0, 0, 0, 0, 0, 0, 0, -4);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_srai_epi64() {
+ let a = _mm256_set_epi64x(1 << 5, 0, 0, 0);
+ let r = _mm256_srai_epi64::<1>(a);
+ let e = _mm256_set_epi64x(1 << 4, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_srai_epi64() {
+ let a = _mm256_set_epi64x(1 << 5, 0, 0, 0);
+ let r = _mm256_mask_srai_epi64::<1>(a, 0, a);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_srai_epi64::<1>(a, 0b00001111, a);
+ let e = _mm256_set_epi64x(1 << 4, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_srai_epi64() {
+ let a = _mm256_set_epi64x(1 << 5, 0, 0, 0);
+ let r = _mm256_maskz_srai_epi64::<1>(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_srai_epi64::<1>(0b00001111, a);
+ let e = _mm256_set_epi64x(1 << 4, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_srai_epi64() {
+ let a = _mm_set_epi64x(1 << 5, 0);
+ let r = _mm_srai_epi64::<1>(a);
+ let e = _mm_set_epi64x(1 << 4, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_srai_epi64() {
+ let a = _mm_set_epi64x(1 << 5, 0);
+ let r = _mm_mask_srai_epi64::<1>(a, 0, a);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_srai_epi64::<1>(a, 0b00000011, a);
+ let e = _mm_set_epi64x(1 << 4, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_srai_epi64() {
+ let a = _mm_set_epi64x(1 << 5, 0);
+ let r = _mm_maskz_srai_epi64::<1>(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_srai_epi64::<1>(0b00000011, a);
+ let e = _mm_set_epi64x(1 << 4, 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_permute_pd() {
+ let a = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let r = _mm512_permute_pd::<0b11_11_11_11>(a);
+ let e = _mm512_setr_pd(1., 1., 3., 3., 5., 5., 7., 7.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_permute_pd() {
+ let a = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let r = _mm512_mask_permute_pd::<0b11_11_11_11>(a, 0, a);
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_permute_pd::<0b11_11_11_11>(a, 0b11111111, a);
+ let e = _mm512_setr_pd(1., 1., 3., 3., 5., 5., 7., 7.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_permute_pd() {
+ let a = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let r = _mm512_maskz_permute_pd::<0b11_11_11_11>(0, a);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_permute_pd::<0b11_11_11_11>(0b11111111, a);
+ let e = _mm512_setr_pd(1., 1., 3., 3., 5., 5., 7., 7.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_permute_pd() {
+ let a = _mm256_set_pd(3., 2., 1., 0.);
+ let r = _mm256_mask_permute_pd::<0b11_11>(a, 0, a);
+ assert_eq_m256d(r, a);
+ let r = _mm256_mask_permute_pd::<0b11_11>(a, 0b00001111, a);
+ let e = _mm256_set_pd(3., 3., 1., 1.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_permute_pd() {
+ let a = _mm256_set_pd(3., 2., 1., 0.);
+ let r = _mm256_maskz_permute_pd::<0b11_11>(0, a);
+ assert_eq_m256d(r, _mm256_setzero_pd());
+ let r = _mm256_maskz_permute_pd::<0b11_11>(0b00001111, a);
+ let e = _mm256_set_pd(3., 3., 1., 1.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_permute_pd() {
+ let a = _mm_set_pd(1., 0.);
+ let r = _mm_mask_permute_pd::<0b11>(a, 0, a);
+ assert_eq_m128d(r, a);
+ let r = _mm_mask_permute_pd::<0b11>(a, 0b00000011, a);
+ let e = _mm_set_pd(1., 1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_permute_pd() {
+ let a = _mm_set_pd(1., 0.);
+ let r = _mm_maskz_permute_pd::<0b11>(0, a);
+ assert_eq_m128d(r, _mm_setzero_pd());
+ let r = _mm_maskz_permute_pd::<0b11>(0b00000011, a);
+ let e = _mm_set_pd(1., 1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_permutex_epi64() {
+ let a = _mm512_setr_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = _mm512_permutex_epi64::<0b11_11_11_11>(a);
+ let e = _mm512_setr_epi64(3, 3, 3, 3, 7, 7, 7, 7);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_permutex_epi64() {
+ let a = _mm512_setr_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = _mm512_mask_permutex_epi64::<0b11_11_11_11>(a, 0, a);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_permutex_epi64::<0b11_11_11_11>(a, 0b11111111, a);
+ let e = _mm512_setr_epi64(3, 3, 3, 3, 7, 7, 7, 7);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_permutex_epi64() {
+ let a = _mm512_setr_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = _mm512_maskz_permutex_epi64::<0b11_11_11_11>(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_permutex_epi64::<0b11_11_11_11>(0b11111111, a);
+ let e = _mm512_setr_epi64(3, 3, 3, 3, 7, 7, 7, 7);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_permutex_epi64() {
+ let a = _mm256_set_epi64x(3, 2, 1, 0);
+ let r = _mm256_permutex_epi64::<0b11_11_11_11>(a);
+ let e = _mm256_set_epi64x(3, 3, 3, 3);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_permutex_epi64() {
+ let a = _mm256_set_epi64x(3, 2, 1, 0);
+ let r = _mm256_mask_permutex_epi64::<0b11_11_11_11>(a, 0, a);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_permutex_epi64::<0b11_11_11_11>(a, 0b00001111, a);
+ let e = _mm256_set_epi64x(3, 3, 3, 3);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm256_maskz_permutex_epi64() {
+ let a = _mm256_set_epi64x(3, 2, 1, 0);
+ let r = _mm256_maskz_permutex_epi64::<0b11_11_11_11>(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_permutex_epi64::<0b11_11_11_11>(0b00001111, a);
+ let e = _mm256_set_epi64x(3, 3, 3, 3);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_permutex_pd() {
+ let a = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let r = _mm512_permutex_pd::<0b11_11_11_11>(a);
+ let e = _mm512_setr_pd(3., 3., 3., 3., 7., 7., 7., 7.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_permutex_pd() {
+ let a = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let r = _mm512_mask_permutex_pd::<0b11_11_11_11>(a, 0, a);
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_permutex_pd::<0b11_11_11_11>(a, 0b11111111, a);
+ let e = _mm512_setr_pd(3., 3., 3., 3., 7., 7., 7., 7.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_permutex_pd() {
+ let a = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let r = _mm512_maskz_permutex_pd::<0b11_11_11_11>(0, a);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_permutex_pd::<0b11_11_11_11>(0b11111111, a);
+ let e = _mm512_setr_pd(3., 3., 3., 3., 7., 7., 7., 7.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_permutex_pd() {
+ let a = _mm256_set_pd(0., 1., 2., 3.);
+ let r = _mm256_permutex_pd::<0b11_11_11_11>(a);
+ let e = _mm256_set_pd(0., 0., 0., 0.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_permutex_pd() {
+ let a = _mm256_set_pd(0., 1., 2., 3.);
+ let r = _mm256_mask_permutex_pd::<0b11_11_11_11>(a, 0, a);
+ assert_eq_m256d(r, a);
+ let r = _mm256_mask_permutex_pd::<0b11_11_11_11>(a, 0b00001111, a);
+ let e = _mm256_set_pd(0., 0., 0., 0.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_permutex_pd() {
+ let a = _mm256_set_pd(0., 1., 2., 3.);
+ let r = _mm256_maskz_permutex_pd::<0b11_11_11_11>(0, a);
+ assert_eq_m256d(r, _mm256_setzero_pd());
+ let r = _mm256_maskz_permutex_pd::<0b11_11_11_11>(0b00001111, a);
+ let e = _mm256_set_pd(0., 0., 0., 0.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_permutevar_pd() {
+ let a = _mm512_set_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let b = _mm512_set1_epi64(0b1);
+ let r = _mm512_permutevar_pd(a, b);
+ let e = _mm512_set_pd(1., 1., 3., 3., 5., 5., 7., 7.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_permutevar_pd() {
+ let a = _mm512_set_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let b = _mm512_set1_epi64(0b1);
+ let r = _mm512_mask_permutevar_pd(a, 0, a, b);
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_permutevar_pd(a, 0b11111111, a, b);
+ let e = _mm512_set_pd(1., 1., 3., 3., 5., 5., 7., 7.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_permutevar_pd() {
+ let a = _mm512_set_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let b = _mm512_set1_epi64(0b1);
+ let r = _mm512_maskz_permutevar_pd(0, a, b);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_permutevar_pd(0b00001111, a, b);
+ let e = _mm512_set_pd(0., 0., 0., 0., 5., 5., 7., 7.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_permutevar_pd() {
+ let a = _mm256_set_pd(0., 1., 2., 3.);
+ let b = _mm256_set1_epi64x(0b1);
+ let r = _mm256_mask_permutevar_pd(a, 0, a, b);
+ assert_eq_m256d(r, a);
+ let r = _mm256_mask_permutevar_pd(a, 0b00001111, a, b);
+ let e = _mm256_set_pd(1., 1., 3., 3.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_permutevar_pd() {
+ let a = _mm256_set_pd(0., 1., 2., 3.);
+ let b = _mm256_set1_epi64x(0b1);
+ let r = _mm256_maskz_permutevar_pd(0, a, b);
+ assert_eq_m256d(r, _mm256_setzero_pd());
+ let r = _mm256_maskz_permutevar_pd(0b00001111, a, b);
+ let e = _mm256_set_pd(1., 1., 3., 3.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_permutevar_pd() {
+ let a = _mm_set_pd(0., 1.);
+ let b = _mm_set1_epi64x(0b1);
+ let r = _mm_mask_permutevar_pd(a, 0, a, b);
+ assert_eq_m128d(r, a);
+ let r = _mm_mask_permutevar_pd(a, 0b00000011, a, b);
+ let e = _mm_set_pd(1., 1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_permutevar_pd() {
+ let a = _mm_set_pd(0., 1.);
+ let b = _mm_set1_epi64x(0b1);
+ let r = _mm_maskz_permutevar_pd(0, a, b);
+ assert_eq_m128d(r, _mm_setzero_pd());
+ let r = _mm_maskz_permutevar_pd(0b00000011, a, b);
+ let e = _mm_set_pd(1., 1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_permutexvar_epi64() {
+ let idx = _mm512_set1_epi64(1);
+ let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = _mm512_permutexvar_epi64(idx, a);
+ let e = _mm512_set1_epi64(6);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_permutexvar_epi64() {
+ let idx = _mm512_set1_epi64(1);
+ let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = _mm512_mask_permutexvar_epi64(a, 0, idx, a);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_permutexvar_epi64(a, 0b11111111, idx, a);
+ let e = _mm512_set1_epi64(6);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_permutexvar_epi64() {
+ let idx = _mm512_set1_epi64(1);
+ let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = _mm512_maskz_permutexvar_epi64(0, idx, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_permutexvar_epi64(0b00001111, idx, a);
+ let e = _mm512_set_epi64(0, 0, 0, 0, 6, 6, 6, 6);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_permutexvar_epi64() {
+ let idx = _mm256_set1_epi64x(1);
+ let a = _mm256_set_epi64x(0, 1, 2, 3);
+ let r = _mm256_permutexvar_epi64(idx, a);
+ let e = _mm256_set1_epi64x(2);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_permutexvar_epi64() {
+ let idx = _mm256_set1_epi64x(1);
+ let a = _mm256_set_epi64x(0, 1, 2, 3);
+ let r = _mm256_mask_permutexvar_epi64(a, 0, idx, a);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_permutexvar_epi64(a, 0b00001111, idx, a);
+ let e = _mm256_set1_epi64x(2);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_permutexvar_epi64() {
+ let idx = _mm256_set1_epi64x(1);
+ let a = _mm256_set_epi64x(0, 1, 2, 3);
+ let r = _mm256_maskz_permutexvar_epi64(0, idx, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_permutexvar_epi64(0b00001111, idx, a);
+ let e = _mm256_set1_epi64x(2);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_permutexvar_pd() {
+ let idx = _mm512_set1_epi64(1);
+ let a = _mm512_set_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let r = _mm512_permutexvar_pd(idx, a);
+ let e = _mm512_set1_pd(6.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_permutexvar_pd() {
+ let idx = _mm512_set1_epi64(1);
+ let a = _mm512_set_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let r = _mm512_mask_permutexvar_pd(a, 0, idx, a);
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_permutexvar_pd(a, 0b11111111, idx, a);
+ let e = _mm512_set1_pd(6.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_permutexvar_pd() {
+ let idx = _mm512_set1_epi64(1);
+ let a = _mm512_set_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let r = _mm512_maskz_permutexvar_pd(0, idx, a);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_permutexvar_pd(0b00001111, idx, a);
+ let e = _mm512_set_pd(0., 0., 0., 0., 6., 6., 6., 6.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_permutexvar_pd() {
+ let idx = _mm256_set1_epi64x(1);
+ let a = _mm256_set_pd(0., 1., 2., 3.);
+ let r = _mm256_permutexvar_pd(idx, a);
+ let e = _mm256_set1_pd(2.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_permutexvar_pd() {
+ let idx = _mm256_set1_epi64x(1);
+ let a = _mm256_set_pd(0., 1., 2., 3.);
+ let r = _mm256_mask_permutexvar_pd(a, 0, idx, a);
+ assert_eq_m256d(r, a);
+ let r = _mm256_mask_permutexvar_pd(a, 0b00001111, idx, a);
+ let e = _mm256_set1_pd(2.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_permutexvar_pd() {
+ let idx = _mm256_set1_epi64x(1);
+ let a = _mm256_set_pd(0., 1., 2., 3.);
+ let r = _mm256_maskz_permutexvar_pd(0, idx, a);
+ assert_eq_m256d(r, _mm256_setzero_pd());
+ let r = _mm256_maskz_permutexvar_pd(0b00001111, idx, a);
+ let e = _mm256_set1_pd(2.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_permutex2var_epi64() {
+ let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ let idx = _mm512_set_epi64(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3);
+ let b = _mm512_set1_epi64(100);
+ let r = _mm512_permutex2var_epi64(a, idx, b);
+ let e = _mm512_set_epi64(6, 100, 5, 100, 4, 100, 3, 100);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_permutex2var_epi64() {
+ let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ let idx = _mm512_set_epi64(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3);
+ let b = _mm512_set1_epi64(100);
+ let r = _mm512_mask_permutex2var_epi64(a, 0, idx, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_permutex2var_epi64(a, 0b11111111, idx, b);
+ let e = _mm512_set_epi64(6, 100, 5, 100, 4, 100, 3, 100);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_permutex2var_epi64() {
+ let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ let idx = _mm512_set_epi64(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3);
+ let b = _mm512_set1_epi64(100);
+ let r = _mm512_maskz_permutex2var_epi64(0, a, idx, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_permutex2var_epi64(0b00001111, a, idx, b);
+ let e = _mm512_set_epi64(0, 0, 0, 0, 4, 100, 3, 100);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask2_permutex2var_epi64() {
+ let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ let idx = _mm512_set_epi64(1000, 1 << 3, 2000, 1 << 3, 3, 1 << 3, 4, 1 << 3);
+ let b = _mm512_set1_epi64(100);
+ let r = _mm512_mask2_permutex2var_epi64(a, idx, 0, b);
+ assert_eq_m512i(r, idx);
+ let r = _mm512_mask2_permutex2var_epi64(a, idx, 0b00001111, b);
+ let e = _mm512_set_epi64(1000, 1 << 3, 2000, 1 << 3, 4, 100, 3, 100);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_permutex2var_epi64() {
+ let a = _mm256_set_epi64x(0, 1, 2, 3);
+ let idx = _mm256_set_epi64x(1, 1 << 2, 2, 1 << 2);
+ let b = _mm256_set1_epi64x(100);
+ let r = _mm256_permutex2var_epi64(a, idx, b);
+ let e = _mm256_set_epi64x(2, 100, 1, 100);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_permutex2var_epi64() {
+ let a = _mm256_set_epi64x(0, 1, 2, 3);
+ let idx = _mm256_set_epi64x(1, 1 << 2, 2, 1 << 2);
+ let b = _mm256_set1_epi64x(100);
+ let r = _mm256_mask_permutex2var_epi64(a, 0, idx, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_permutex2var_epi64(a, 0b00001111, idx, b);
+ let e = _mm256_set_epi64x(2, 100, 1, 100);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_permutex2var_epi64() {
+ let a = _mm256_set_epi64x(0, 1, 2, 3);
+ let idx = _mm256_set_epi64x(1, 1 << 2, 2, 1 << 2);
+ let b = _mm256_set1_epi64x(100);
+ let r = _mm256_maskz_permutex2var_epi64(0, a, idx, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_permutex2var_epi64(0b00001111, a, idx, b);
+ let e = _mm256_set_epi64x(2, 100, 1, 100);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask2_permutex2var_epi64() {
+ let a = _mm256_set_epi64x(0, 1, 2, 3);
+ let idx = _mm256_set_epi64x(1, 1 << 2, 2, 1 << 2);
+ let b = _mm256_set1_epi64x(100);
+ let r = _mm256_mask2_permutex2var_epi64(a, idx, 0, b);
+ assert_eq_m256i(r, idx);
+ let r = _mm256_mask2_permutex2var_epi64(a, idx, 0b00001111, b);
+ let e = _mm256_set_epi64x(2, 100, 1, 100);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_permutex2var_epi64() {
+ let a = _mm_set_epi64x(0, 1);
+ let idx = _mm_set_epi64x(1, 1 << 1);
+ let b = _mm_set1_epi64x(100);
+ let r = _mm_permutex2var_epi64(a, idx, b);
+ let e = _mm_set_epi64x(0, 100);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_permutex2var_epi64() {
+ let a = _mm_set_epi64x(0, 1);
+ let idx = _mm_set_epi64x(1, 1 << 1);
+ let b = _mm_set1_epi64x(100);
+ let r = _mm_mask_permutex2var_epi64(a, 0, idx, b);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_permutex2var_epi64(a, 0b00000011, idx, b);
+ let e = _mm_set_epi64x(0, 100);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_permutex2var_epi64() {
+ let a = _mm_set_epi64x(0, 1);
+ let idx = _mm_set_epi64x(1, 1 << 1);
+ let b = _mm_set1_epi64x(100);
+ let r = _mm_maskz_permutex2var_epi64(0, a, idx, b);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_permutex2var_epi64(0b00000011, a, idx, b);
+ let e = _mm_set_epi64x(0, 100);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask2_permutex2var_epi64() {
+ let a = _mm_set_epi64x(0, 1);
+ let idx = _mm_set_epi64x(1, 1 << 1);
+ let b = _mm_set1_epi64x(100);
+ let r = _mm_mask2_permutex2var_epi64(a, idx, 0, b);
+ assert_eq_m128i(r, idx);
+ let r = _mm_mask2_permutex2var_epi64(a, idx, 0b00000011, b);
+ let e = _mm_set_epi64x(0, 100);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_permutex2var_pd() {
+ let a = _mm512_set_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let idx = _mm512_set_epi64(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3);
+ let b = _mm512_set1_pd(100.);
+ let r = _mm512_permutex2var_pd(a, idx, b);
+ let e = _mm512_set_pd(6., 100., 5., 100., 4., 100., 3., 100.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_permutex2var_pd() {
+ let a = _mm512_set_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let idx = _mm512_set_epi64(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3);
+ let b = _mm512_set1_pd(100.);
+ let r = _mm512_mask_permutex2var_pd(a, 0, idx, b);
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_permutex2var_pd(a, 0b11111111, idx, b);
+ let e = _mm512_set_pd(6., 100., 5., 100., 4., 100., 3., 100.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_permutex2var_pd() {
+ let a = _mm512_set_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let idx = _mm512_set_epi64(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3);
+ let b = _mm512_set1_pd(100.);
+ let r = _mm512_maskz_permutex2var_pd(0, a, idx, b);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_permutex2var_pd(0b00001111, a, idx, b);
+ let e = _mm512_set_pd(0., 0., 0., 0., 4., 100., 3., 100.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask2_permutex2var_pd() {
+ let a = _mm512_set_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let idx = _mm512_set_epi64(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3);
+ let b = _mm512_set1_pd(100.);
+ let r = _mm512_mask2_permutex2var_pd(a, idx, 0, b);
+ assert_eq_m512d(r, _mm512_castsi512_pd(idx));
+ let r = _mm512_mask2_permutex2var_pd(a, idx, 0b11111111, b);
+ let e = _mm512_set_pd(6., 100., 5., 100., 4., 100., 3., 100.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_permutex2var_pd() {
+ let a = _mm256_set_pd(0., 1., 2., 3.);
+ let idx = _mm256_set_epi64x(1, 1 << 2, 2, 1 << 2);
+ let b = _mm256_set1_pd(100.);
+ let r = _mm256_permutex2var_pd(a, idx, b);
+ let e = _mm256_set_pd(2., 100., 1., 100.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_permutex2var_pd() {
+ let a = _mm256_set_pd(0., 1., 2., 3.);
+ let idx = _mm256_set_epi64x(1, 1 << 2, 2, 1 << 2);
+ let b = _mm256_set1_pd(100.);
+ let r = _mm256_mask_permutex2var_pd(a, 0, idx, b);
+ assert_eq_m256d(r, a);
+ let r = _mm256_mask_permutex2var_pd(a, 0b00001111, idx, b);
+ let e = _mm256_set_pd(2., 100., 1., 100.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_permutex2var_pd() {
+ let a = _mm256_set_pd(0., 1., 2., 3.);
+ let idx = _mm256_set_epi64x(1, 1 << 2, 2, 1 << 2);
+ let b = _mm256_set1_pd(100.);
+ let r = _mm256_maskz_permutex2var_pd(0, a, idx, b);
+ assert_eq_m256d(r, _mm256_setzero_pd());
+ let r = _mm256_maskz_permutex2var_pd(0b00001111, a, idx, b);
+ let e = _mm256_set_pd(2., 100., 1., 100.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask2_permutex2var_pd() {
+ let a = _mm256_set_pd(0., 1., 2., 3.);
+ let idx = _mm256_set_epi64x(1, 1 << 2, 2, 1 << 2);
+ let b = _mm256_set1_pd(100.);
+ let r = _mm256_mask2_permutex2var_pd(a, idx, 0, b);
+ assert_eq_m256d(r, _mm256_castsi256_pd(idx));
+ let r = _mm256_mask2_permutex2var_pd(a, idx, 0b00001111, b);
+ let e = _mm256_set_pd(2., 100., 1., 100.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_permutex2var_pd() {
+ let a = _mm_set_pd(0., 1.);
+ let idx = _mm_set_epi64x(1, 1 << 1);
+ let b = _mm_set1_pd(100.);
+ let r = _mm_permutex2var_pd(a, idx, b);
+ let e = _mm_set_pd(0., 100.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_permutex2var_pd() {
+ let a = _mm_set_pd(0., 1.);
+ let idx = _mm_set_epi64x(1, 1 << 1);
+ let b = _mm_set1_pd(100.);
+ let r = _mm_mask_permutex2var_pd(a, 0, idx, b);
+ assert_eq_m128d(r, a);
+ let r = _mm_mask_permutex2var_pd(a, 0b00000011, idx, b);
+ let e = _mm_set_pd(0., 100.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_permutex2var_pd() {
+ let a = _mm_set_pd(0., 1.);
+ let idx = _mm_set_epi64x(1, 1 << 1);
+ let b = _mm_set1_pd(100.);
+ let r = _mm_maskz_permutex2var_pd(0, a, idx, b);
+ assert_eq_m128d(r, _mm_setzero_pd());
+ let r = _mm_maskz_permutex2var_pd(0b00000011, a, idx, b);
+ let e = _mm_set_pd(0., 100.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask2_permutex2var_pd() {
+ let a = _mm_set_pd(0., 1.);
+ let idx = _mm_set_epi64x(1, 1 << 1);
+ let b = _mm_set1_pd(100.);
+ let r = _mm_mask2_permutex2var_pd(a, idx, 0, b);
+ assert_eq_m128d(r, _mm_castsi128_pd(idx));
+ let r = _mm_mask2_permutex2var_pd(a, idx, 0b00000011, b);
+ let e = _mm_set_pd(0., 100.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_shuffle_pd() {
+ let a = _mm256_set_pd(1., 4., 5., 8.);
+ let b = _mm256_set_pd(2., 3., 6., 7.);
+ let r = _mm256_mask_shuffle_pd::<0b11_11_11_11>(a, 0, a, b);
+ assert_eq_m256d(r, a);
+ let r = _mm256_mask_shuffle_pd::<0b11_11_11_11>(a, 0b00001111, a, b);
+ let e = _mm256_set_pd(2., 1., 6., 5.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_shuffle_pd() {
+ let a = _mm256_set_pd(1., 4., 5., 8.);
+ let b = _mm256_set_pd(2., 3., 6., 7.);
+ let r = _mm256_maskz_shuffle_pd::<0b11_11_11_11>(0, a, b);
+ assert_eq_m256d(r, _mm256_setzero_pd());
+ let r = _mm256_maskz_shuffle_pd::<0b11_11_11_11>(0b00001111, a, b);
+ let e = _mm256_set_pd(2., 1., 6., 5.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_shuffle_pd() {
+ let a = _mm_set_pd(1., 4.);
+ let b = _mm_set_pd(2., 3.);
+ let r = _mm_mask_shuffle_pd::<0b11_11_11_11>(a, 0, a, b);
+ assert_eq_m128d(r, a);
+ let r = _mm_mask_shuffle_pd::<0b11_11_11_11>(a, 0b00000011, a, b);
+ let e = _mm_set_pd(2., 1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_shuffle_pd() {
+ let a = _mm_set_pd(1., 4.);
+ let b = _mm_set_pd(2., 3.);
+ let r = _mm_maskz_shuffle_pd::<0b11_11_11_11>(0, a, b);
+ assert_eq_m128d(r, _mm_setzero_pd());
+ let r = _mm_maskz_shuffle_pd::<0b11_11_11_11>(0b00000011, a, b);
+ let e = _mm_set_pd(2., 1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_shuffle_i64x2() {
+ let a = _mm512_setr_epi64(1, 4, 5, 8, 9, 12, 13, 16);
+ let b = _mm512_setr_epi64(2, 3, 6, 7, 10, 11, 14, 15);
+ let r = _mm512_shuffle_i64x2::<0b00_00_00_00>(a, b);
+ let e = _mm512_setr_epi64(1, 4, 1, 4, 2, 3, 2, 3);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_shuffle_i64x2() {
+ let a = _mm512_setr_epi64(1, 4, 5, 8, 9, 12, 13, 16);
+ let b = _mm512_setr_epi64(2, 3, 6, 7, 10, 11, 14, 15);
+ let r = _mm512_mask_shuffle_i64x2::<0b00_00_00_00>(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_shuffle_i64x2::<0b00_00_00_00>(a, 0b11111111, a, b);
+ let e = _mm512_setr_epi64(1, 4, 1, 4, 2, 3, 2, 3);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_shuffle_i64x2() {
+ let a = _mm512_setr_epi64(1, 4, 5, 8, 9, 12, 13, 16);
+ let b = _mm512_setr_epi64(2, 3, 6, 7, 10, 11, 14, 15);
+ let r = _mm512_maskz_shuffle_i64x2::<0b00_00_00_00>(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_shuffle_i64x2::<0b00_00_00_00>(0b00001111, a, b);
+ let e = _mm512_setr_epi64(1, 4, 1, 4, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_shuffle_i64x2() {
+ let a = _mm256_set_epi64x(1, 4, 5, 8);
+ let b = _mm256_set_epi64x(2, 3, 6, 7);
+ let r = _mm256_shuffle_i64x2::<0b00>(a, b);
+ let e = _mm256_set_epi64x(6, 7, 5, 8);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_shuffle_i64x2() {
+ let a = _mm256_set_epi64x(1, 4, 5, 8);
+ let b = _mm256_set_epi64x(2, 3, 6, 7);
+ let r = _mm256_mask_shuffle_i64x2::<0b00>(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_shuffle_i64x2::<0b00>(a, 0b00001111, a, b);
+ let e = _mm256_set_epi64x(6, 7, 5, 8);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_shuffle_i64x2() {
+ let a = _mm256_set_epi64x(1, 4, 5, 8);
+ let b = _mm256_set_epi64x(2, 3, 6, 7);
+ let r = _mm256_maskz_shuffle_i64x2::<0b00>(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_shuffle_i64x2::<0b00>(0b00001111, a, b);
+ let e = _mm256_set_epi64x(6, 7, 5, 8);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_shuffle_f64x2() {
+ let a = _mm512_setr_pd(1., 4., 5., 8., 9., 12., 13., 16.);
+ let b = _mm512_setr_pd(2., 3., 6., 7., 10., 11., 14., 15.);
+ let r = _mm512_shuffle_f64x2::<0b00_00_00_00>(a, b);
+ let e = _mm512_setr_pd(1., 4., 1., 4., 2., 3., 2., 3.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_shuffle_f64x2() {
+ let a = _mm512_setr_pd(1., 4., 5., 8., 9., 12., 13., 16.);
+ let b = _mm512_setr_pd(2., 3., 6., 7., 10., 11., 14., 15.);
+ let r = _mm512_mask_shuffle_f64x2::<0b00_00_00_00>(a, 0, a, b);
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_shuffle_f64x2::<0b00_00_00_00>(a, 0b11111111, a, b);
+ let e = _mm512_setr_pd(1., 4., 1., 4., 2., 3., 2., 3.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_shuffle_f64x2() {
+ let a = _mm512_setr_pd(1., 4., 5., 8., 9., 12., 13., 16.);
+ let b = _mm512_setr_pd(2., 3., 6., 7., 10., 11., 14., 15.);
+ let r = _mm512_maskz_shuffle_f64x2::<0b00_00_00_00>(0, a, b);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_shuffle_f64x2::<0b00_00_00_00>(0b00001111, a, b);
+ let e = _mm512_setr_pd(1., 4., 1., 4., 0., 0., 0., 0.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_shuffle_f64x2() {
+ let a = _mm256_set_pd(1., 4., 5., 8.);
+ let b = _mm256_set_pd(2., 3., 6., 7.);
+ let r = _mm256_shuffle_f64x2::<0b00>(a, b);
+ let e = _mm256_set_pd(6., 7., 5., 8.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_shuffle_f64x2() {
+ let a = _mm256_set_pd(1., 4., 5., 8.);
+ let b = _mm256_set_pd(2., 3., 6., 7.);
+ let r = _mm256_mask_shuffle_f64x2::<0b00>(a, 0, a, b);
+ assert_eq_m256d(r, a);
+ let r = _mm256_mask_shuffle_f64x2::<0b00>(a, 0b00001111, a, b);
+ let e = _mm256_set_pd(6., 7., 5., 8.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_shuffle_f64x2() {
+ let a = _mm256_set_pd(1., 4., 5., 8.);
+ let b = _mm256_set_pd(2., 3., 6., 7.);
+ let r = _mm256_maskz_shuffle_f64x2::<0b00>(0, a, b);
+ assert_eq_m256d(r, _mm256_setzero_pd());
+ let r = _mm256_maskz_shuffle_f64x2::<0b00>(0b00001111, a, b);
+ let e = _mm256_set_pd(6., 7., 5., 8.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_movedup_pd() {
+ let a = _mm512_setr_pd(1., 2., 3., 4., 5., 6., 7., 8.);
+ let r = _mm512_movedup_pd(a);
+ let e = _mm512_setr_pd(1., 1., 3., 3., 5., 5., 7., 7.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_movedup_pd() {
+ let a = _mm512_setr_pd(1., 2., 3., 4., 5., 6., 7., 8.);
+ let r = _mm512_mask_movedup_pd(a, 0, a);
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_movedup_pd(a, 0b11111111, a);
+ let e = _mm512_setr_pd(1., 1., 3., 3., 5., 5., 7., 7.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_movedup_pd() {
+ let a = _mm512_setr_pd(1., 2., 3., 4., 5., 6., 7., 8.);
+ let r = _mm512_maskz_movedup_pd(0, a);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_movedup_pd(0b00001111, a);
+ let e = _mm512_setr_pd(1., 1., 3., 3., 0., 0., 0., 0.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_movedup_pd() {
+ let a = _mm256_set_pd(1., 2., 3., 4.);
+ let r = _mm256_mask_movedup_pd(a, 0, a);
+ assert_eq_m256d(r, a);
+ let r = _mm256_mask_movedup_pd(a, 0b00001111, a);
+ let e = _mm256_set_pd(2., 2., 4., 4.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_movedup_pd() {
+ let a = _mm256_set_pd(1., 2., 3., 4.);
+ let r = _mm256_maskz_movedup_pd(0, a);
+ assert_eq_m256d(r, _mm256_setzero_pd());
+ let r = _mm256_maskz_movedup_pd(0b00001111, a);
+ let e = _mm256_set_pd(2., 2., 4., 4.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_movedup_pd() {
+ let a = _mm_set_pd(1., 2.);
+ let r = _mm_mask_movedup_pd(a, 0, a);
+ assert_eq_m128d(r, a);
+ let r = _mm_mask_movedup_pd(a, 0b00000011, a);
+ let e = _mm_set_pd(2., 2.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_movedup_pd() {
+ let a = _mm_set_pd(1., 2.);
+ let r = _mm_maskz_movedup_pd(0, a);
+ assert_eq_m128d(r, _mm_setzero_pd());
+ let r = _mm_maskz_movedup_pd(0b00000011, a);
+ let e = _mm_set_pd(2., 2.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_inserti64x4() {
+ let a = _mm512_setr_epi64(1, 2, 3, 4, 5, 6, 7, 8);
+ let b = _mm256_setr_epi64x(17, 18, 19, 20);
+ let r = _mm512_inserti64x4::<1>(a, b);
+ let e = _mm512_setr_epi64(1, 2, 3, 4, 17, 18, 19, 20);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_inserti64x4() {
+ let a = _mm512_setr_epi64(1, 2, 3, 4, 5, 6, 7, 8);
+ let b = _mm256_setr_epi64x(17, 18, 19, 20);
+ let r = _mm512_mask_inserti64x4::<1>(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_inserti64x4::<1>(a, 0b11111111, a, b);
+ let e = _mm512_setr_epi64(1, 2, 3, 4, 17, 18, 19, 20);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_inserti64x4() {
+ let a = _mm512_setr_epi64(1, 2, 3, 4, 5, 6, 7, 8);
+ let b = _mm256_setr_epi64x(17, 18, 19, 20);
+ let r = _mm512_maskz_inserti64x4::<1>(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_inserti64x4::<1>(0b00001111, a, b);
+ let e = _mm512_setr_epi64(1, 2, 3, 4, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_insertf64x4() {
+ let a = _mm512_setr_pd(1., 2., 3., 4., 5., 6., 7., 8.);
+ let b = _mm256_setr_pd(17., 18., 19., 20.);
+ let r = _mm512_insertf64x4::<1>(a, b);
+ let e = _mm512_setr_pd(1., 2., 3., 4., 17., 18., 19., 20.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_insertf64x4() {
+ let a = _mm512_setr_pd(1., 2., 3., 4., 5., 6., 7., 8.);
+ let b = _mm256_setr_pd(17., 18., 19., 20.);
+ let r = _mm512_mask_insertf64x4::<1>(a, 0, a, b);
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_insertf64x4::<1>(a, 0b11111111, a, b);
+ let e = _mm512_setr_pd(1., 2., 3., 4., 17., 18., 19., 20.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_insertf64x4() {
+ let a = _mm512_setr_pd(1., 2., 3., 4., 5., 6., 7., 8.);
+ let b = _mm256_setr_pd(17., 18., 19., 20.);
+ let r = _mm512_maskz_insertf64x4::<1>(0, a, b);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_insertf64x4::<1>(0b00001111, a, b);
+ let e = _mm512_setr_pd(1., 2., 3., 4., 0., 0., 0., 0.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_castpd128_pd512() {
+ let a = _mm_setr_pd(17., 18.);
+ let r = _mm512_castpd128_pd512(a);
+ let e = _mm512_setr_pd(17., 18., -1., -1., -1., -1., -1., -1.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_castpd256_pd512() {
+ let a = _mm256_setr_pd(17., 18., 19., 20.);
+ let r = _mm512_castpd256_pd512(a);
+ let e = _mm512_setr_pd(17., 18., 19., 20., -1., -1., -1., -1.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_zextpd128_pd512() {
+ let a = _mm_setr_pd(17., 18.);
+ let r = _mm512_zextpd128_pd512(a);
+ let e = _mm512_setr_pd(17., 18., 0., 0., 0., 0., 0., 0.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_zextpd256_pd512() {
+ let a = _mm256_setr_pd(17., 18., 19., 20.);
+ let r = _mm512_zextpd256_pd512(a);
+ let e = _mm512_setr_pd(17., 18., 19., 20., 0., 0., 0., 0.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_castpd512_pd128() {
+ let a = _mm512_setr_pd(17., 18., -1., -1., -1., -1., -1., -1.);
+ let r = _mm512_castpd512_pd128(a);
+ let e = _mm_setr_pd(17., 18.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_castpd512_pd256() {
+ let a = _mm512_setr_pd(17., 18., 19., 20., -1., -1., -1., -1.);
+ let r = _mm512_castpd512_pd256(a);
+ let e = _mm256_setr_pd(17., 18., 19., 20.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_castpd_ps() {
+ let a = _mm512_set1_pd(1.);
+ let r = _mm512_castpd_ps(a);
+ let e = _mm512_set_ps(
+ 1.875, 0.0, 1.875, 0.0, 1.875, 0.0, 1.875, 0.0, 1.875, 0.0, 1.875, 0.0, 1.875, 0.0,
+ 1.875, 0.0,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_castpd_si512() {
+ let a = _mm512_set1_pd(1.);
+ let r = _mm512_castpd_si512(a);
+ let e = _mm512_set_epi32(
+ 1072693248, 0, 1072693248, 0, 1072693248, 0, 1072693248, 0, 1072693248, 0, 1072693248,
+ 0, 1072693248, 0, 1072693248, 0,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_castsi128_si512() {
+ let a = _mm_setr_epi64x(17, 18);
+ let r = _mm512_castsi128_si512(a);
+ let e = _mm512_setr_epi64(17, 18, -1, -1, -1, -1, -1, -1);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_castsi256_si512() {
+ let a = _mm256_setr_epi64x(17, 18, 19, 20);
+ let r = _mm512_castsi256_si512(a);
+ let e = _mm512_setr_epi64(17, 18, 19, 20, -1, -1, -1, -1);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_zextsi128_si512() {
+ let a = _mm_setr_epi64x(17, 18);
+ let r = _mm512_zextsi128_si512(a);
+ let e = _mm512_setr_epi64(17, 18, 0, 0, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_zextsi256_si512() {
+ let a = _mm256_setr_epi64x(17, 18, 19, 20);
+ let r = _mm512_zextsi256_si512(a);
+ let e = _mm512_setr_epi64(17, 18, 19, 20, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_castsi512_si128() {
+ let a = _mm512_setr_epi64(17, 18, -1, -1, -1, -1, -1, -1);
+ let r = _mm512_castsi512_si128(a);
+ let e = _mm_setr_epi64x(17, 18);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_castsi512_si256() {
+ let a = _mm512_setr_epi64(17, 18, 19, 20, -1, -1, -1, -1);
+ let r = _mm512_castsi512_si256(a);
+ let e = _mm256_setr_epi64x(17, 18, 19, 20);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_castsi512_ps() {
+ let a = _mm512_set1_epi64(1 << 62);
+ let r = _mm512_castsi512_ps(a);
+ let e = _mm512_set_ps(
+ 2., 0., 2., 0., 2., 0., 2., 0., 2., 0., 2., 0., 2., 0., 2., 0.,
+ );
+ assert_eq_m512(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_castsi512_pd() {
+ let a = _mm512_set1_epi64(1 << 62);
+ let r = _mm512_castsi512_pd(a);
+ let e = _mm512_set_pd(2., 2., 2., 2., 2., 2., 2., 2.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_broadcastq_epi64() {
+ let a = _mm_setr_epi64x(17, 18);
+ let r = _mm512_broadcastq_epi64(a);
+ let e = _mm512_set1_epi64(17);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_broadcastq_epi64() {
+ let src = _mm512_set1_epi64(18);
+ let a = _mm_setr_epi64x(17, 18);
+ let r = _mm512_mask_broadcastq_epi64(src, 0, a);
+ assert_eq_m512i(r, src);
+ let r = _mm512_mask_broadcastq_epi64(src, 0b11111111, a);
+ let e = _mm512_set1_epi64(17);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_broadcastq_epi64() {
+ let a = _mm_setr_epi64x(17, 18);
+ let r = _mm512_maskz_broadcastq_epi64(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_broadcastq_epi64(0b00001111, a);
+ let e = _mm512_set_epi64(0, 0, 0, 0, 17, 17, 17, 17);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_broadcastq_epi64() {
+ let src = _mm256_set1_epi64x(18);
+ let a = _mm_set_epi64x(17, 18);
+ let r = _mm256_mask_broadcastq_epi64(src, 0, a);
+ assert_eq_m256i(r, src);
+ let r = _mm256_mask_broadcastq_epi64(src, 0b00001111, a);
+ let e = _mm256_set1_epi64x(18);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_broadcastq_epi64() {
+ let a = _mm_set_epi64x(17, 18);
+ let r = _mm256_maskz_broadcastq_epi64(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_broadcastq_epi64(0b00001111, a);
+ let e = _mm256_set1_epi64x(18);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_broadcastq_epi64() {
+ let src = _mm_set1_epi64x(18);
+ let a = _mm_set_epi64x(17, 18);
+ let r = _mm_mask_broadcastq_epi64(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_broadcastq_epi64(src, 0b00000011, a);
+ let e = _mm_set1_epi64x(18);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_broadcastq_epi64() {
+ let a = _mm_set_epi64x(17, 18);
+ let r = _mm_maskz_broadcastq_epi64(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_broadcastq_epi64(0b00000011, a);
+ let e = _mm_set1_epi64x(18);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_broadcastsd_pd() {
+ let a = _mm_set_pd(17., 18.);
+ let r = _mm512_broadcastsd_pd(a);
+ let e = _mm512_set1_pd(18.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_broadcastsd_pd() {
+ let src = _mm512_set1_pd(18.);
+ let a = _mm_set_pd(17., 18.);
+ let r = _mm512_mask_broadcastsd_pd(src, 0, a);
+ assert_eq_m512d(r, src);
+ let r = _mm512_mask_broadcastsd_pd(src, 0b11111111, a);
+ let e = _mm512_set1_pd(18.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_broadcastsd_pd() {
+ let a = _mm_set_pd(17., 18.);
+ let r = _mm512_maskz_broadcastsd_pd(0, a);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_broadcastsd_pd(0b00001111, a);
+ let e = _mm512_set_pd(0., 0., 0., 0., 18., 18., 18., 18.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_broadcastsd_pd() {
+ let src = _mm256_set1_pd(18.);
+ let a = _mm_set_pd(17., 18.);
+ let r = _mm256_mask_broadcastsd_pd(src, 0, a);
+ assert_eq_m256d(r, src);
+ let r = _mm256_mask_broadcastsd_pd(src, 0b00001111, a);
+ let e = _mm256_set1_pd(18.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_broadcastsd_pd() {
+ let a = _mm_set_pd(17., 18.);
+ let r = _mm256_maskz_broadcastsd_pd(0, a);
+ assert_eq_m256d(r, _mm256_setzero_pd());
+ let r = _mm256_maskz_broadcastsd_pd(0b00001111, a);
+ let e = _mm256_set1_pd(18.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_broadcast_i64x4() {
+ let a = _mm256_set_epi64x(17, 18, 19, 20);
+ let r = _mm512_broadcast_i64x4(a);
+ let e = _mm512_set_epi64(17, 18, 19, 20, 17, 18, 19, 20);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_broadcast_i64x4() {
+ let src = _mm512_set1_epi64(18);
+ let a = _mm256_set_epi64x(17, 18, 19, 20);
+ let r = _mm512_mask_broadcast_i64x4(src, 0, a);
+ assert_eq_m512i(r, src);
+ let r = _mm512_mask_broadcast_i64x4(src, 0b11111111, a);
+ let e = _mm512_set_epi64(17, 18, 19, 20, 17, 18, 19, 20);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_broadcast_i64x4() {
+ let a = _mm256_set_epi64x(17, 18, 19, 20);
+ let r = _mm512_maskz_broadcast_i64x4(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_broadcast_i64x4(0b00001111, a);
+ let e = _mm512_set_epi64(0, 0, 0, 0, 17, 18, 19, 20);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_broadcast_f64x4() {
+ let a = _mm256_set_pd(17., 18., 19., 20.);
+ let r = _mm512_broadcast_f64x4(a);
+ let e = _mm512_set_pd(17., 18., 19., 20., 17., 18., 19., 20.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_broadcast_f64x4() {
+ let src = _mm512_set1_pd(18.);
+ let a = _mm256_set_pd(17., 18., 19., 20.);
+ let r = _mm512_mask_broadcast_f64x4(src, 0, a);
+ assert_eq_m512d(r, src);
+ let r = _mm512_mask_broadcast_f64x4(src, 0b11111111, a);
+ let e = _mm512_set_pd(17., 18., 19., 20., 17., 18., 19., 20.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_broadcast_f64x4() {
+ let a = _mm256_set_pd(17., 18., 19., 20.);
+ let r = _mm512_maskz_broadcast_f64x4(0, a);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_broadcast_f64x4(0b00001111, a);
+ let e = _mm512_set_pd(0., 0., 0., 0., 17., 18., 19., 20.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_blend_epi64() {
+ let a = _mm512_set1_epi64(1);
+ let b = _mm512_set1_epi64(2);
+ let r = _mm512_mask_blend_epi64(0b11110000, a, b);
+ let e = _mm512_set_epi64(2, 2, 2, 2, 1, 1, 1, 1);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_blend_epi64() {
+ let a = _mm256_set1_epi64x(1);
+ let b = _mm256_set1_epi64x(2);
+ let r = _mm256_mask_blend_epi64(0b00001111, a, b);
+ let e = _mm256_set1_epi64x(2);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_blend_epi64() {
+ let a = _mm_set1_epi64x(1);
+ let b = _mm_set1_epi64x(2);
+ let r = _mm_mask_blend_epi64(0b00000011, a, b);
+ let e = _mm_set1_epi64x(2);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_blend_pd() {
+ let a = _mm512_set1_pd(1.);
+ let b = _mm512_set1_pd(2.);
+ let r = _mm512_mask_blend_pd(0b11110000, a, b);
+ let e = _mm512_set_pd(2., 2., 2., 2., 1., 1., 1., 1.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_blend_pd() {
+ let a = _mm256_set1_pd(1.);
+ let b = _mm256_set1_pd(2.);
+ let r = _mm256_mask_blend_pd(0b00001111, a, b);
+ let e = _mm256_set1_pd(2.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_blend_pd() {
+ let a = _mm_set1_pd(1.);
+ let b = _mm_set1_pd(2.);
+ let r = _mm_mask_blend_pd(0b00000011, a, b);
+ let e = _mm_set1_pd(2.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_unpackhi_epi64() {
+ let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8);
+ let b = _mm512_set_epi64(17, 18, 19, 20, 21, 22, 23, 24);
+ let r = _mm512_unpackhi_epi64(a, b);
+ let e = _mm512_set_epi64(17, 1, 19, 3, 21, 5, 23, 7);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_unpackhi_epi64() {
+ let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8);
+ let b = _mm512_set_epi64(17, 18, 19, 20, 21, 22, 23, 24);
+ let r = _mm512_mask_unpackhi_epi64(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_unpackhi_epi64(a, 0b11111111, a, b);
+ let e = _mm512_set_epi64(17, 1, 19, 3, 21, 5, 23, 7);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_unpackhi_epi64() {
+ let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8);
+ let b = _mm512_set_epi64(17, 18, 19, 20, 21, 22, 23, 24);
+ let r = _mm512_maskz_unpackhi_epi64(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_unpackhi_epi64(0b00001111, a, b);
+ let e = _mm512_set_epi64(0, 0, 0, 0, 21, 5, 23, 7);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_unpackhi_epi64() {
+ let a = _mm256_set_epi64x(1, 2, 3, 4);
+ let b = _mm256_set_epi64x(17, 18, 19, 20);
+ let r = _mm256_mask_unpackhi_epi64(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_unpackhi_epi64(a, 0b00001111, a, b);
+ let e = _mm256_set_epi64x(17, 1, 19, 3);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_unpackhi_epi64() {
+ let a = _mm256_set_epi64x(1, 2, 3, 4);
+ let b = _mm256_set_epi64x(17, 18, 19, 20);
+ let r = _mm256_maskz_unpackhi_epi64(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_unpackhi_epi64(0b00001111, a, b);
+ let e = _mm256_set_epi64x(17, 1, 19, 3);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_unpackhi_epi64() {
+ let a = _mm_set_epi64x(1, 2);
+ let b = _mm_set_epi64x(17, 18);
+ let r = _mm_mask_unpackhi_epi64(a, 0, a, b);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_unpackhi_epi64(a, 0b00000011, a, b);
+ let e = _mm_set_epi64x(17, 1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_unpackhi_epi64() {
+ let a = _mm_set_epi64x(1, 2);
+ let b = _mm_set_epi64x(17, 18);
+ let r = _mm_maskz_unpackhi_epi64(0, a, b);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_unpackhi_epi64(0b00000011, a, b);
+ let e = _mm_set_epi64x(17, 1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_unpackhi_pd() {
+ let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.);
+ let b = _mm512_set_pd(17., 18., 19., 20., 21., 22., 23., 24.);
+ let r = _mm512_unpackhi_pd(a, b);
+ let e = _mm512_set_pd(17., 1., 19., 3., 21., 5., 23., 7.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_unpackhi_pd() {
+ let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.);
+ let b = _mm512_set_pd(17., 18., 19., 20., 21., 22., 23., 24.);
+ let r = _mm512_mask_unpackhi_pd(a, 0, a, b);
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_unpackhi_pd(a, 0b11111111, a, b);
+ let e = _mm512_set_pd(17., 1., 19., 3., 21., 5., 23., 7.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_unpackhi_pd() {
+ let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.);
+ let b = _mm512_set_pd(17., 18., 19., 20., 21., 22., 23., 24.);
+ let r = _mm512_maskz_unpackhi_pd(0, a, b);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_unpackhi_pd(0b00001111, a, b);
+ let e = _mm512_set_pd(0., 0., 0., 0., 21., 5., 23., 7.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_unpackhi_pd() {
+ let a = _mm256_set_pd(1., 2., 3., 4.);
+ let b = _mm256_set_pd(17., 18., 19., 20.);
+ let r = _mm256_mask_unpackhi_pd(a, 0, a, b);
+ assert_eq_m256d(r, a);
+ let r = _mm256_mask_unpackhi_pd(a, 0b00001111, a, b);
+ let e = _mm256_set_pd(17., 1., 19., 3.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_unpackhi_pd() {
+ let a = _mm256_set_pd(1., 2., 3., 4.);
+ let b = _mm256_set_pd(17., 18., 19., 20.);
+ let r = _mm256_maskz_unpackhi_pd(0, a, b);
+ assert_eq_m256d(r, _mm256_setzero_pd());
+ let r = _mm256_maskz_unpackhi_pd(0b00001111, a, b);
+ let e = _mm256_set_pd(17., 1., 19., 3.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_unpackhi_pd() {
+ let a = _mm_set_pd(1., 2.);
+ let b = _mm_set_pd(17., 18.);
+ let r = _mm_mask_unpackhi_pd(a, 0, a, b);
+ assert_eq_m128d(r, a);
+ let r = _mm_mask_unpackhi_pd(a, 0b00000011, a, b);
+ let e = _mm_set_pd(17., 1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_unpackhi_pd() {
+ let a = _mm_set_pd(1., 2.);
+ let b = _mm_set_pd(17., 18.);
+ let r = _mm_maskz_unpackhi_pd(0, a, b);
+ assert_eq_m128d(r, _mm_setzero_pd());
+ let r = _mm_maskz_unpackhi_pd(0b00000011, a, b);
+ let e = _mm_set_pd(17., 1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_unpacklo_epi64() {
+ let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8);
+ let b = _mm512_set_epi64(17, 18, 19, 20, 21, 22, 23, 24);
+ let r = _mm512_unpacklo_epi64(a, b);
+ let e = _mm512_set_epi64(18, 2, 20, 4, 22, 6, 24, 8);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_unpacklo_epi64() {
+ let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8);
+ let b = _mm512_set_epi64(17, 18, 19, 20, 21, 22, 23, 24);
+ let r = _mm512_mask_unpacklo_epi64(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_unpacklo_epi64(a, 0b11111111, a, b);
+ let e = _mm512_set_epi64(18, 2, 20, 4, 22, 6, 24, 8);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_unpacklo_epi64() {
+ let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8);
+ let b = _mm512_set_epi64(17, 18, 19, 20, 21, 22, 23, 24);
+ let r = _mm512_maskz_unpacklo_epi64(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_unpacklo_epi64(0b00001111, a, b);
+ let e = _mm512_set_epi64(0, 0, 0, 0, 22, 6, 24, 8);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_unpacklo_epi64() {
+ let a = _mm256_set_epi64x(1, 2, 3, 4);
+ let b = _mm256_set_epi64x(17, 18, 19, 20);
+ let r = _mm256_mask_unpacklo_epi64(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_unpacklo_epi64(a, 0b00001111, a, b);
+ let e = _mm256_set_epi64x(18, 2, 20, 4);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_unpacklo_epi64() {
+ let a = _mm256_set_epi64x(1, 2, 3, 4);
+ let b = _mm256_set_epi64x(17, 18, 19, 20);
+ let r = _mm256_maskz_unpacklo_epi64(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_unpacklo_epi64(0b00001111, a, b);
+ let e = _mm256_set_epi64x(18, 2, 20, 4);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_unpacklo_epi64() {
+ let a = _mm_set_epi64x(1, 2);
+ let b = _mm_set_epi64x(17, 18);
+ let r = _mm_mask_unpacklo_epi64(a, 0, a, b);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_unpacklo_epi64(a, 0b00000011, a, b);
+ let e = _mm_set_epi64x(18, 2);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_unpacklo_epi64() {
+ let a = _mm_set_epi64x(1, 2);
+ let b = _mm_set_epi64x(17, 18);
+ let r = _mm_maskz_unpacklo_epi64(0, a, b);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_unpacklo_epi64(0b00000011, a, b);
+ let e = _mm_set_epi64x(18, 2);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_unpacklo_pd() {
+ let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.);
+ let b = _mm512_set_pd(17., 18., 19., 20., 21., 22., 23., 24.);
+ let r = _mm512_unpacklo_pd(a, b);
+ let e = _mm512_set_pd(18., 2., 20., 4., 22., 6., 24., 8.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_unpacklo_pd() {
+ let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.);
+ let b = _mm512_set_pd(17., 18., 19., 20., 21., 22., 23., 24.);
+ let r = _mm512_mask_unpacklo_pd(a, 0, a, b);
+ assert_eq_m512d(r, a);
+ let r = _mm512_mask_unpacklo_pd(a, 0b11111111, a, b);
+ let e = _mm512_set_pd(18., 2., 20., 4., 22., 6., 24., 8.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_unpacklo_pd() {
+ let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.);
+ let b = _mm512_set_pd(17., 18., 19., 20., 21., 22., 23., 24.);
+ let r = _mm512_maskz_unpacklo_pd(0, a, b);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_unpacklo_pd(0b00001111, a, b);
+ let e = _mm512_set_pd(0., 0., 0., 0., 22., 6., 24., 8.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_unpacklo_pd() {
+ let a = _mm256_set_pd(1., 2., 3., 4.);
+ let b = _mm256_set_pd(17., 18., 19., 20.);
+ let r = _mm256_mask_unpacklo_pd(a, 0, a, b);
+ assert_eq_m256d(r, a);
+ let r = _mm256_mask_unpacklo_pd(a, 0b00001111, a, b);
+ let e = _mm256_set_pd(18., 2., 20., 4.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_unpacklo_pd() {
+ let a = _mm256_set_pd(1., 2., 3., 4.);
+ let b = _mm256_set_pd(17., 18., 19., 20.);
+ let r = _mm256_maskz_unpacklo_pd(0, a, b);
+ assert_eq_m256d(r, _mm256_setzero_pd());
+ let r = _mm256_maskz_unpacklo_pd(0b00001111, a, b);
+ let e = _mm256_set_pd(18., 2., 20., 4.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_unpacklo_pd() {
+ let a = _mm_set_pd(1., 2.);
+ let b = _mm_set_pd(17., 18.);
+ let r = _mm_mask_unpacklo_pd(a, 0, a, b);
+ assert_eq_m128d(r, a);
+ let r = _mm_mask_unpacklo_pd(a, 0b00000011, a, b);
+ let e = _mm_set_pd(18., 2.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_unpacklo_pd() {
+ let a = _mm_set_pd(1., 2.);
+ let b = _mm_set_pd(17., 18.);
+ let r = _mm_maskz_unpacklo_pd(0, a, b);
+ assert_eq_m128d(r, _mm_setzero_pd());
+ let r = _mm_maskz_unpacklo_pd(0b00000011, a, b);
+ let e = _mm_set_pd(18., 2.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_alignr_epi64() {
+ let a = _mm512_set_epi64(8, 7, 6, 5, 4, 3, 2, 1);
+ let b = _mm512_set_epi64(16, 15, 14, 13, 12, 11, 10, 9);
+ let r = _mm512_alignr_epi64::<0>(a, b);
+ assert_eq_m512i(r, b);
+ let r = _mm512_alignr_epi64::<8>(a, b);
+ assert_eq_m512i(r, b);
+ let r = _mm512_alignr_epi64::<1>(a, b);
+ let e = _mm512_set_epi64(1, 16, 15, 14, 13, 12, 11, 10);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_alignr_epi64() {
+ let a = _mm512_set_epi64(8, 7, 6, 5, 4, 3, 2, 1);
+ let b = _mm512_set_epi64(16, 15, 14, 13, 12, 11, 10, 9);
+ let r = _mm512_mask_alignr_epi64::<1>(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_alignr_epi64::<1>(a, 0b11111111, a, b);
+ let e = _mm512_set_epi64(1, 16, 15, 14, 13, 12, 11, 10);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_alignr_epi64() {
+ let a = _mm512_set_epi64(8, 7, 6, 5, 4, 3, 2, 1);
+ let b = _mm512_set_epi64(16, 15, 14, 13, 12, 11, 10, 9);
+ let r = _mm512_maskz_alignr_epi64::<1>(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_alignr_epi64::<1>(0b00001111, a, b);
+ let e = _mm512_set_epi64(0, 0, 0, 0, 13, 12, 11, 10);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_alignr_epi64() {
+ let a = _mm256_set_epi64x(4, 3, 2, 1);
+ let b = _mm256_set_epi64x(8, 7, 6, 5);
+ let r = _mm256_alignr_epi64::<0>(a, b);
+ let e = _mm256_set_epi64x(8, 7, 6, 5);
+ assert_eq_m256i(r, e);
+ let r = _mm256_alignr_epi64::<6>(a, b);
+ let e = _mm256_set_epi64x(6, 5, 4, 3);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_alignr_epi64() {
+ let a = _mm256_set_epi64x(4, 3, 2, 1);
+ let b = _mm256_set_epi64x(8, 7, 6, 5);
+ let r = _mm256_mask_alignr_epi64::<1>(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_alignr_epi64::<0>(a, 0b00001111, a, b);
+ let e = _mm256_set_epi64x(8, 7, 6, 5);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_alignr_epi64() {
+ let a = _mm256_set_epi64x(4, 3, 2, 1);
+ let b = _mm256_set_epi64x(8, 7, 6, 5);
+ let r = _mm256_maskz_alignr_epi64::<1>(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_alignr_epi64::<0>(0b00001111, a, b);
+ let e = _mm256_set_epi64x(8, 7, 6, 5);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_alignr_epi64() {
+ let a = _mm_set_epi64x(2, 1);
+ let b = _mm_set_epi64x(4, 3);
+ let r = _mm_alignr_epi64::<0>(a, b);
+ let e = _mm_set_epi64x(4, 3);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_alignr_epi64() {
+ let a = _mm_set_epi64x(2, 1);
+ let b = _mm_set_epi64x(4, 3);
+ let r = _mm_mask_alignr_epi64::<1>(a, 0, a, b);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_alignr_epi64::<0>(a, 0b00000011, a, b);
+ let e = _mm_set_epi64x(4, 3);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_alignr_epi64() {
+ let a = _mm_set_epi64x(2, 1);
+ let b = _mm_set_epi64x(4, 3);
+ let r = _mm_maskz_alignr_epi64::<1>(0, a, b);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_alignr_epi64::<0>(0b00000011, a, b);
+ let e = _mm_set_epi64x(4, 3);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_and_epi64() {
+ let a = _mm512_set_epi64(1 << 0 | 1 << 15, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3);
+ let b = _mm512_set_epi64(1 << 13, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3);
+ let r = _mm512_and_epi64(a, b);
+ let e = _mm512_set_epi64(0, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_and_epi64() {
+ let a = _mm512_set_epi64(1 << 0 | 1 << 15, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3);
+ let b = _mm512_set_epi64(1 << 13, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3);
+ let r = _mm512_mask_and_epi64(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_and_epi64(a, 0b01111111, a, b);
+ let e = _mm512_set_epi64(1 << 0 | 1 << 15, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_and_epi64() {
+ let a = _mm512_set_epi64(1 << 0 | 1 << 15, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3);
+ let b = _mm512_set_epi64(1 << 13, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3);
+ let r = _mm512_maskz_and_epi64(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_and_epi64(0b00001111, a, b);
+ let e = _mm512_set_epi64(0, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_and_epi64() {
+ let a = _mm256_set1_epi64x(1 << 0 | 1 << 15);
+ let b = _mm256_set1_epi64x(1 << 0);
+ let r = _mm256_mask_and_epi64(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_and_epi64(a, 0b00001111, a, b);
+ let e = _mm256_set1_epi64x(1 << 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_and_epi64() {
+ let a = _mm256_set1_epi64x(1 << 0 | 1 << 15);
+ let b = _mm256_set1_epi64x(1 << 0);
+ let r = _mm256_maskz_and_epi64(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_and_epi64(0b00001111, a, b);
+ let e = _mm256_set1_epi64x(1 << 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_and_epi64() {
+ let a = _mm_set1_epi64x(1 << 0 | 1 << 15);
+ let b = _mm_set1_epi64x(1 << 0);
+ let r = _mm_mask_and_epi64(a, 0, a, b);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_and_epi64(a, 0b00000011, a, b);
+ let e = _mm_set1_epi64x(1 << 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_and_epi64() {
+ let a = _mm_set1_epi64x(1 << 0 | 1 << 15);
+ let b = _mm_set1_epi64x(1 << 0);
+ let r = _mm_maskz_and_epi64(0, a, b);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_and_epi64(0b00000011, a, b);
+ let e = _mm_set1_epi64x(1 << 0);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_and_si512() {
+ let a = _mm512_set_epi64(1 << 0 | 1 << 15, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3);
+ let b = _mm512_set_epi64(1 << 13, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3);
+ let r = _mm512_and_epi64(a, b);
+ let e = _mm512_set_epi64(0, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_or_epi64() {
+ let a = _mm512_set_epi64(1 << 0 | 1 << 15, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3);
+ let b = _mm512_set_epi64(1 << 13, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3);
+ let r = _mm512_or_epi64(a, b);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi64(
+ 1 << 0 | 1 << 13 | 1 << 15, 0, 0, 0,
+ 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_or_epi64() {
+ let a = _mm512_set_epi64(1 << 0 | 1 << 15, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3);
+ let b = _mm512_set_epi64(1 << 13, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3);
+ let r = _mm512_mask_or_epi64(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_or_epi64(a, 0b11111111, a, b);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi64(
+ 1 << 0 | 1 << 13 | 1 << 15, 0, 0, 0,
+ 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_or_epi64() {
+ let a = _mm512_set_epi64(1 << 0 | 1 << 15, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3);
+ let b = _mm512_set_epi64(1 << 13, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3);
+ let r = _mm512_maskz_or_epi64(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_or_epi64(0b00001111, a, b);
+ let e = _mm512_set_epi64(0, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_or_epi64() {
+ let a = _mm256_set1_epi64x(1 << 0 | 1 << 15);
+ let b = _mm256_set1_epi64x(1 << 13);
+ let r = _mm256_or_epi64(a, b);
+ let e = _mm256_set1_epi64x(1 << 0 | 1 << 13 | 1 << 15);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_or_epi64() {
+ let a = _mm256_set1_epi64x(1 << 0 | 1 << 15);
+ let b = _mm256_set1_epi64x(1 << 13);
+ let r = _mm256_mask_or_epi64(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_or_epi64(a, 0b00001111, a, b);
+ let e = _mm256_set1_epi64x(1 << 0 | 1 << 13 | 1 << 15);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_or_epi64() {
+ let a = _mm256_set1_epi64x(1 << 0 | 1 << 15);
+ let b = _mm256_set1_epi64x(1 << 13);
+ let r = _mm256_maskz_or_epi64(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_or_epi64(0b00001111, a, b);
+ let e = _mm256_set1_epi64x(1 << 0 | 1 << 13 | 1 << 15);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_or_epi64() {
+ let a = _mm_set1_epi64x(1 << 0 | 1 << 15);
+ let b = _mm_set1_epi64x(1 << 13);
+ let r = _mm_or_epi64(a, b);
+ let e = _mm_set1_epi64x(1 << 0 | 1 << 13 | 1 << 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_or_epi64() {
+ let a = _mm_set1_epi64x(1 << 0 | 1 << 15);
+ let b = _mm_set1_epi64x(1 << 13);
+ let r = _mm_mask_or_epi64(a, 0, a, b);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_or_epi64(a, 0b00000011, a, b);
+ let e = _mm_set1_epi64x(1 << 0 | 1 << 13 | 1 << 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_or_epi64() {
+ let a = _mm_set1_epi64x(1 << 0 | 1 << 15);
+ let b = _mm_set1_epi64x(1 << 13);
+ let r = _mm_maskz_or_epi64(0, a, b);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_or_epi64(0b00000011, a, b);
+ let e = _mm_set1_epi64x(1 << 0 | 1 << 13 | 1 << 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_or_si512() {
+ let a = _mm512_set_epi64(1 << 0 | 1 << 15, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3);
+ let b = _mm512_set_epi64(1 << 13, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3);
+ let r = _mm512_or_epi64(a, b);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi64(
+ 1 << 0 | 1 << 13 | 1 << 15, 0, 0, 0,
+ 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3,
+ );
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_xor_epi64() {
+ let a = _mm512_set_epi64(1 << 0 | 1 << 15, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3);
+ let b = _mm512_set_epi64(1 << 13, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3);
+ let r = _mm512_xor_epi64(a, b);
+ let e = _mm512_set_epi64(1 << 0 | 1 << 13 | 1 << 15, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_xor_epi64() {
+ let a = _mm512_set_epi64(1 << 0 | 1 << 15, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3);
+ let b = _mm512_set_epi64(1 << 13, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3);
+ let r = _mm512_mask_xor_epi64(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_xor_epi64(a, 0b11111111, a, b);
+ let e = _mm512_set_epi64(1 << 0 | 1 << 13 | 1 << 15, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_xor_epi64() {
+ let a = _mm512_set_epi64(1 << 0 | 1 << 15, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3);
+ let b = _mm512_set_epi64(1 << 13, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3);
+ let r = _mm512_maskz_xor_epi64(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_xor_epi64(0b00001111, a, b);
+ let e = _mm512_set_epi64(0, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_xor_epi64() {
+ let a = _mm256_set1_epi64x(1 << 0 | 1 << 15);
+ let b = _mm256_set1_epi64x(1 << 13);
+ let r = _mm256_xor_epi64(a, b);
+ let e = _mm256_set1_epi64x(1 << 0 | 1 << 13 | 1 << 15);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_xor_epi64() {
+ let a = _mm256_set1_epi64x(1 << 0 | 1 << 15);
+ let b = _mm256_set1_epi64x(1 << 13);
+ let r = _mm256_mask_xor_epi64(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_xor_epi64(a, 0b00001111, a, b);
+ let e = _mm256_set1_epi64x(1 << 0 | 1 << 13 | 1 << 15);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_xor_epi64() {
+ let a = _mm256_set1_epi64x(1 << 0 | 1 << 15);
+ let b = _mm256_set1_epi64x(1 << 13);
+ let r = _mm256_maskz_xor_epi64(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_xor_epi64(0b00001111, a, b);
+ let e = _mm256_set1_epi64x(1 << 0 | 1 << 13 | 1 << 15);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_xor_epi64() {
+ let a = _mm_set1_epi64x(1 << 0 | 1 << 15);
+ let b = _mm_set1_epi64x(1 << 13);
+ let r = _mm_xor_epi64(a, b);
+ let e = _mm_set1_epi64x(1 << 0 | 1 << 13 | 1 << 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_xor_epi64() {
+ let a = _mm_set1_epi64x(1 << 0 | 1 << 15);
+ let b = _mm_set1_epi64x(1 << 13);
+ let r = _mm_mask_xor_epi64(a, 0, a, b);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_xor_epi64(a, 0b00000011, a, b);
+ let e = _mm_set1_epi64x(1 << 0 | 1 << 13 | 1 << 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_xor_epi64() {
+ let a = _mm_set1_epi64x(1 << 0 | 1 << 15);
+ let b = _mm_set1_epi64x(1 << 13);
+ let r = _mm_maskz_xor_epi64(0, a, b);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_xor_epi64(0b00000011, a, b);
+ let e = _mm_set1_epi64x(1 << 0 | 1 << 13 | 1 << 15);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_xor_si512() {
+ let a = _mm512_set_epi64(1 << 0 | 1 << 15, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3);
+ let b = _mm512_set_epi64(1 << 13, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3);
+ let r = _mm512_xor_epi64(a, b);
+ let e = _mm512_set_epi64(1 << 0 | 1 << 13 | 1 << 15, 0, 0, 0, 0, 0, 0, 0);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_andnot_epi64() {
+ let a = _mm512_set1_epi64(0);
+ let b = _mm512_set1_epi64(1 << 3 | 1 << 4);
+ let r = _mm512_andnot_epi64(a, b);
+ let e = _mm512_set1_epi64(1 << 3 | 1 << 4);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_andnot_epi64() {
+ let a = _mm512_set1_epi64(1 << 1 | 1 << 2);
+ let b = _mm512_set1_epi64(1 << 3 | 1 << 4);
+ let r = _mm512_mask_andnot_epi64(a, 0, a, b);
+ assert_eq_m512i(r, a);
+ let r = _mm512_mask_andnot_epi64(a, 0b11111111, a, b);
+ let e = _mm512_set1_epi64(1 << 3 | 1 << 4);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_andnot_epi64() {
+ let a = _mm512_set1_epi64(1 << 1 | 1 << 2);
+ let b = _mm512_set1_epi64(1 << 3 | 1 << 4);
+ let r = _mm512_maskz_andnot_epi64(0, a, b);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_andnot_epi64(0b00001111, a, b);
+ #[rustfmt::skip]
+ let e = _mm512_set_epi64(
+ 0, 0, 0, 0,
+ 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_epi64() {
+ let a = _mm256_set1_epi64x(1 << 1 | 1 << 2);
+ let b = _mm256_set1_epi64x(1 << 3 | 1 << 4);
+ let r = _mm256_mask_andnot_epi64(a, 0, a, b);
+ assert_eq_m256i(r, a);
+ let r = _mm256_mask_andnot_epi64(a, 0b00001111, a, b);
+ let e = _mm256_set1_epi64x(1 << 3 | 1 << 4);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_andnot_epi64() {
+ let a = _mm256_set1_epi64x(1 << 1 | 1 << 2);
+ let b = _mm256_set1_epi64x(1 << 3 | 1 << 4);
+ let r = _mm256_maskz_andnot_epi64(0, a, b);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_andnot_epi64(0b00001111, a, b);
+ let e = _mm256_set1_epi64x(1 << 3 | 1 << 4);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_andnot_epi64() {
+ let a = _mm_set1_epi64x(1 << 1 | 1 << 2);
+ let b = _mm_set1_epi64x(1 << 3 | 1 << 4);
+ let r = _mm_mask_andnot_epi64(a, 0, a, b);
+ assert_eq_m128i(r, a);
+ let r = _mm_mask_andnot_epi64(a, 0b00000011, a, b);
+ let e = _mm_set1_epi64x(1 << 3 | 1 << 4);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_andnot_epi64() {
+ let a = _mm_set1_epi64x(1 << 1 | 1 << 2);
+ let b = _mm_set1_epi64x(1 << 3 | 1 << 4);
+ let r = _mm_maskz_andnot_epi64(0, a, b);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_andnot_epi64(0b00000011, a, b);
+ let e = _mm_set1_epi64x(1 << 3 | 1 << 4);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_andnot_si512() {
+ let a = _mm512_set1_epi64(0);
+ let b = _mm512_set1_epi64(1 << 3 | 1 << 4);
+ let r = _mm512_andnot_si512(a, b);
+ let e = _mm512_set1_epi64(1 << 3 | 1 << 4);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_reduce_add_epi64() {
+ let a = _mm512_set1_epi64(1);
+ let e: i64 = _mm512_reduce_add_epi64(a);
+ assert_eq!(8, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_reduce_add_epi64() {
+ let a = _mm512_set1_epi64(1);
+ let e: i64 = _mm512_mask_reduce_add_epi64(0b11110000, a);
+ assert_eq!(4, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_reduce_add_pd() {
+ let a = _mm512_set1_pd(1.);
+ let e: f64 = _mm512_reduce_add_pd(a);
+ assert_eq!(8., e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_reduce_add_pd() {
+ let a = _mm512_set1_pd(1.);
+ let e: f64 = _mm512_mask_reduce_add_pd(0b11110000, a);
+ assert_eq!(4., e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_reduce_mul_epi64() {
+ let a = _mm512_set1_epi64(2);
+ let e: i64 = _mm512_reduce_mul_epi64(a);
+ assert_eq!(256, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_reduce_mul_epi64() {
+ let a = _mm512_set1_epi64(2);
+ let e: i64 = _mm512_mask_reduce_mul_epi64(0b11110000, a);
+ assert_eq!(16, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_reduce_mul_pd() {
+ let a = _mm512_set1_pd(2.);
+ let e: f64 = _mm512_reduce_mul_pd(a);
+ assert_eq!(256., e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_reduce_mul_pd() {
+ let a = _mm512_set1_pd(2.);
+ let e: f64 = _mm512_mask_reduce_mul_pd(0b11110000, a);
+ assert_eq!(16., e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_reduce_max_epi64() {
+ let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: i64 = _mm512_reduce_max_epi64(a);
+ assert_eq!(7, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_reduce_max_epi64() {
+ let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: i64 = _mm512_mask_reduce_max_epi64(0b11110000, a);
+ assert_eq!(3, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_reduce_max_epu64() {
+ let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: u64 = _mm512_reduce_max_epu64(a);
+ assert_eq!(7, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_reduce_max_epu64() {
+ let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: u64 = _mm512_mask_reduce_max_epu64(0b11110000, a);
+ assert_eq!(3, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_reduce_max_pd() {
+ let a = _mm512_set_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let e: f64 = _mm512_reduce_max_pd(a);
+ assert_eq!(7., e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_reduce_max_pd() {
+ let a = _mm512_set_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let e: f64 = _mm512_mask_reduce_max_pd(0b11110000, a);
+ assert_eq!(3., e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_reduce_min_epi64() {
+ let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: i64 = _mm512_reduce_min_epi64(a);
+ assert_eq!(0, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_reduce_min_epi64() {
+ let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: i64 = _mm512_mask_reduce_min_epi64(0b11110000, a);
+ assert_eq!(0, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_reduce_min_epu64() {
+ let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: u64 = _mm512_reduce_min_epu64(a);
+ assert_eq!(0, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_reduce_min_epu64() {
+ let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ let e: u64 = _mm512_mask_reduce_min_epu64(0b11110000, a);
+ assert_eq!(0, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_reduce_min_pd() {
+ let a = _mm512_set_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let e: f64 = _mm512_reduce_min_pd(a);
+ assert_eq!(0., e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_reduce_min_pd() {
+ let a = _mm512_set_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let e: f64 = _mm512_mask_reduce_min_pd(0b11110000, a);
+ assert_eq!(0., e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_reduce_and_epi64() {
+ let a = _mm512_set_epi64(1, 1, 1, 1, 2, 2, 2, 2);
+ let e: i64 = _mm512_reduce_and_epi64(a);
+ assert_eq!(0, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_reduce_and_epi64() {
+ let a = _mm512_set_epi64(1, 1, 1, 1, 2, 2, 2, 2);
+ let e: i64 = _mm512_mask_reduce_and_epi64(0b11110000, a);
+ assert_eq!(1, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_reduce_or_epi64() {
+ let a = _mm512_set_epi64(1, 1, 1, 1, 2, 2, 2, 2);
+ let e: i64 = _mm512_reduce_or_epi64(a);
+ assert_eq!(3, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_reduce_or_epi64() {
+ let a = _mm512_set_epi64(1, 1, 1, 1, 2, 2, 2, 2);
+ let e: i64 = _mm512_mask_reduce_or_epi64(0b11110000, a);
+ assert_eq!(1, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_extractf64x4_pd() {
+ let a = _mm512_setr_pd(1., 2., 3., 4., 5., 6., 7., 8.);
+ let r = _mm512_extractf64x4_pd::<1>(a);
+ let e = _mm256_setr_pd(5., 6., 7., 8.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_extractf64x4_pd() {
+ let a = _mm512_setr_pd(1., 2., 3., 4., 5., 6., 7., 8.);
+ let src = _mm256_set1_pd(100.);
+ let r = _mm512_mask_extractf64x4_pd::<1>(src, 0, a);
+ assert_eq_m256d(r, src);
+ let r = _mm512_mask_extractf64x4_pd::<1>(src, 0b11111111, a);
+ let e = _mm256_setr_pd(5., 6., 7., 8.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_extractf64x4_pd() {
+ let a = _mm512_setr_pd(1., 2., 3., 4., 5., 6., 7., 8.);
+ let r = _mm512_maskz_extractf64x4_pd::<1>(0, a);
+ assert_eq_m256d(r, _mm256_setzero_pd());
+ let r = _mm512_maskz_extractf64x4_pd::<1>(0b00000001, a);
+ let e = _mm256_setr_pd(5., 0., 0., 0.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_extracti64x4_epi64() {
+ let a = _mm512_setr_epi64(1, 2, 3, 4, 5, 6, 7, 8);
+ let r = _mm512_extracti64x4_epi64::<0x1>(a);
+ let e = _mm256_setr_epi64x(5, 6, 7, 8);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_extracti64x4_epi64() {
+ let a = _mm512_setr_epi64(1, 2, 3, 4, 5, 6, 7, 8);
+ let src = _mm256_set1_epi64x(100);
+ let r = _mm512_mask_extracti64x4_epi64::<0x1>(src, 0, a);
+ assert_eq_m256i(r, src);
+ let r = _mm512_mask_extracti64x4_epi64::<0x1>(src, 0b11111111, a);
+ let e = _mm256_setr_epi64x(5, 6, 7, 8);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_extracti64x4_epi64() {
+ let a = _mm512_setr_epi64(1, 2, 3, 4, 5, 6, 7, 8);
+ let r = _mm512_maskz_extracti64x4_epi64::<0x1>(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm512_maskz_extracti64x4_epi64::<0x1>(0b00000001, a);
+ let e = _mm256_setr_epi64x(5, 0, 0, 0);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_compress_epi64() {
+ let src = _mm512_set1_epi64(200);
+ let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = _mm512_mask_compress_epi64(src, 0, a);
+ assert_eq_m512i(r, src);
+ let r = _mm512_mask_compress_epi64(src, 0b01010101, a);
+ let e = _mm512_set_epi64(200, 200, 200, 200, 1, 3, 5, 7);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_compress_epi64() {
+ let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = _mm512_maskz_compress_epi64(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_compress_epi64(0b01010101, a);
+ let e = _mm512_set_epi64(0, 0, 0, 0, 1, 3, 5, 7);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_compress_epi64() {
+ let src = _mm256_set1_epi64x(200);
+ let a = _mm256_set_epi64x(0, 1, 2, 3);
+ let r = _mm256_mask_compress_epi64(src, 0, a);
+ assert_eq_m256i(r, src);
+ let r = _mm256_mask_compress_epi64(src, 0b00000101, a);
+ let e = _mm256_set_epi64x(200, 200, 1, 3);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_compress_epi64() {
+ let a = _mm256_set_epi64x(0, 1, 2, 3);
+ let r = _mm256_maskz_compress_epi64(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_compress_epi64(0b00000101, a);
+ let e = _mm256_set_epi64x(0, 0, 1, 3);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_compress_epi64() {
+ let src = _mm_set1_epi64x(200);
+ let a = _mm_set_epi64x(0, 1);
+ let r = _mm_mask_compress_epi64(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_compress_epi64(src, 0b00000001, a);
+ let e = _mm_set_epi64x(200, 1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_compress_epi64() {
+ let a = _mm_set_epi64x(0, 1);
+ let r = _mm_maskz_compress_epi64(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_compress_epi64(0b00000001, a);
+ let e = _mm_set_epi64x(0, 1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_compress_pd() {
+ let src = _mm512_set1_pd(200.);
+ let a = _mm512_set_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let r = _mm512_mask_compress_pd(src, 0, a);
+ assert_eq_m512d(r, src);
+ let r = _mm512_mask_compress_pd(src, 0b01010101, a);
+ let e = _mm512_set_pd(200., 200., 200., 200., 1., 3., 5., 7.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_compress_pd() {
+ let a = _mm512_set_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let r = _mm512_maskz_compress_pd(0, a);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_compress_pd(0b01010101, a);
+ let e = _mm512_set_pd(0., 0., 0., 0., 1., 3., 5., 7.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_compress_pd() {
+ let src = _mm256_set1_pd(200.);
+ let a = _mm256_set_pd(0., 1., 2., 3.);
+ let r = _mm256_mask_compress_pd(src, 0, a);
+ assert_eq_m256d(r, src);
+ let r = _mm256_mask_compress_pd(src, 0b00000101, a);
+ let e = _mm256_set_pd(200., 200., 1., 3.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_compress_pd() {
+ let a = _mm256_set_pd(0., 1., 2., 3.);
+ let r = _mm256_maskz_compress_pd(0, a);
+ assert_eq_m256d(r, _mm256_setzero_pd());
+ let r = _mm256_maskz_compress_pd(0b00000101, a);
+ let e = _mm256_set_pd(0., 0., 1., 3.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_compress_pd() {
+ let src = _mm_set1_pd(200.);
+ let a = _mm_set_pd(0., 1.);
+ let r = _mm_mask_compress_pd(src, 0, a);
+ assert_eq_m128d(r, src);
+ let r = _mm_mask_compress_pd(src, 0b00000001, a);
+ let e = _mm_set_pd(200., 1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_compress_pd() {
+ let a = _mm_set_pd(0., 1.);
+ let r = _mm_maskz_compress_pd(0, a);
+ assert_eq_m128d(r, _mm_setzero_pd());
+ let r = _mm_maskz_compress_pd(0b00000001, a);
+ let e = _mm_set_pd(0., 1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_expand_epi64() {
+ let src = _mm512_set1_epi64(200);
+ let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = _mm512_mask_expand_epi64(src, 0, a);
+ assert_eq_m512i(r, src);
+ let r = _mm512_mask_expand_epi64(src, 0b01010101, a);
+ let e = _mm512_set_epi64(200, 4, 200, 5, 200, 6, 200, 7);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_expand_epi64() {
+ let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7);
+ let r = _mm512_maskz_expand_epi64(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_expand_epi64(0b01010101, a);
+ let e = _mm512_set_epi64(0, 4, 0, 5, 0, 6, 0, 7);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_expand_epi64() {
+ let src = _mm256_set1_epi64x(200);
+ let a = _mm256_set_epi64x(0, 1, 2, 3);
+ let r = _mm256_mask_expand_epi64(src, 0, a);
+ assert_eq_m256i(r, src);
+ let r = _mm256_mask_expand_epi64(src, 0b00000101, a);
+ let e = _mm256_set_epi64x(200, 2, 200, 3);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_expand_epi64() {
+ let a = _mm256_set_epi64x(0, 1, 2, 3);
+ let r = _mm256_maskz_expand_epi64(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_expand_epi64(0b00000101, a);
+ let e = _mm256_set_epi64x(0, 2, 0, 3);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_expand_epi64() {
+ let src = _mm_set1_epi64x(200);
+ let a = _mm_set_epi64x(0, 1);
+ let r = _mm_mask_expand_epi64(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_expand_epi64(src, 0b00000001, a);
+ let e = _mm_set_epi64x(200, 1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_expand_epi64() {
+ let a = _mm_set_epi64x(0, 1);
+ let r = _mm_maskz_expand_epi64(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_expand_epi64(0b00000001, a);
+ let e = _mm_set_epi64x(0, 1);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_expand_pd() {
+ let src = _mm512_set1_pd(200.);
+ let a = _mm512_set_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let r = _mm512_mask_expand_pd(src, 0, a);
+ assert_eq_m512d(r, src);
+ let r = _mm512_mask_expand_pd(src, 0b01010101, a);
+ let e = _mm512_set_pd(200., 4., 200., 5., 200., 6., 200., 7.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_expand_pd() {
+ let a = _mm512_set_pd(0., 1., 2., 3., 4., 5., 6., 7.);
+ let r = _mm512_maskz_expand_pd(0, a);
+ assert_eq_m512d(r, _mm512_setzero_pd());
+ let r = _mm512_maskz_expand_pd(0b01010101, a);
+ let e = _mm512_set_pd(0., 4., 0., 5., 0., 6., 0., 7.);
+ assert_eq_m512d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_expand_pd() {
+ let src = _mm256_set1_pd(200.);
+ let a = _mm256_set_pd(0., 1., 2., 3.);
+ let r = _mm256_mask_expand_pd(src, 0, a);
+ assert_eq_m256d(r, src);
+ let r = _mm256_mask_expand_pd(src, 0b00000101, a);
+ let e = _mm256_set_pd(200., 2., 200., 3.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_expand_pd() {
+ let a = _mm256_set_pd(0., 1., 2., 3.);
+ let r = _mm256_maskz_expand_pd(0, a);
+ assert_eq_m256d(r, _mm256_setzero_pd());
+ let r = _mm256_maskz_expand_pd(0b00000101, a);
+ let e = _mm256_set_pd(0., 2., 0., 3.);
+ assert_eq_m256d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_expand_pd() {
+ let src = _mm_set1_pd(200.);
+ let a = _mm_set_pd(0., 1.);
+ let r = _mm_mask_expand_pd(src, 0, a);
+ assert_eq_m128d(r, src);
+ let r = _mm_mask_expand_pd(src, 0b00000001, a);
+ let e = _mm_set_pd(200., 1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_expand_pd() {
+ let a = _mm_set_pd(0., 1.);
+ let r = _mm_maskz_expand_pd(0, a);
+ assert_eq_m128d(r, _mm_setzero_pd());
+ let r = _mm_maskz_expand_pd(0b00000001, a);
+ let e = _mm_set_pd(0., 1.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_loadu_epi64() {
+ let a = &[4, 3, 2, 5, -8, -9, -64, -50];
+ let p = a.as_ptr();
+ let r = _mm512_loadu_epi64(black_box(p));
+ let e = _mm512_setr_epi64(4, 3, 2, 5, -8, -9, -64, -50);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_loadu_epi64() {
+ let a = &[4, 3, 2, 5];
+ let p = a.as_ptr();
+ let r = _mm256_loadu_epi64(black_box(p));
+ let e = _mm256_setr_epi64x(4, 3, 2, 5);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_loadu_epi64() {
+ let a = &[4, 3];
+ let p = a.as_ptr();
+ let r = _mm_loadu_epi64(black_box(p));
+ let e = _mm_setr_epi64x(4, 3);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtepi64_storeu_epi16() {
+ let a = _mm512_set1_epi64(9);
+ let mut r = _mm_undefined_si128();
+ _mm512_mask_cvtepi64_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_mm256_mask_cvtepi64_storeu_epi16() {
+ let a = _mm256_set1_epi64x(9);
+ let mut r = _mm_set1_epi16(0);
+ _mm256_mask_cvtepi64_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,avx512vl")]
+ unsafe fn test_mm_mask_cvtepi64_storeu_epi16() {
+ let a = _mm_set1_epi64x(9);
+ let mut r = _mm_set1_epi16(0);
+ _mm_mask_cvtepi64_storeu_epi16(&mut r as *mut _ as *mut i8, 0b11111111, a);
+ let e = _mm_set_epi16(0, 0, 0, 0, 0, 0, 9, 9);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtsepi64_storeu_epi16() {
+ let a = _mm512_set1_epi64(i64::MAX);
+ let mut r = _mm_undefined_si128();
+ _mm512_mask_cvtsepi64_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_mm256_mask_cvtsepi64_storeu_epi16() {
+ let a = _mm256_set1_epi64x(i64::MAX);
+ let mut r = _mm_set1_epi16(0);
+ _mm256_mask_cvtsepi64_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,avx512vl")]
+ unsafe fn test_mm_mask_cvtsepi64_storeu_epi16() {
+ let a = _mm_set1_epi64x(i64::MAX);
+ let mut r = _mm_set1_epi16(0);
+ _mm_mask_cvtsepi64_storeu_epi16(&mut r as *mut _ as *mut i8, 0b11111111, a);
+ let e = _mm_set_epi16(0, 0, 0, 0, 0, 0, i16::MAX, i16::MAX);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtusepi64_storeu_epi16() {
+ let a = _mm512_set1_epi64(i64::MAX);
+ let mut r = _mm_undefined_si128();
+ _mm512_mask_cvtusepi64_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_mm256_mask_cvtusepi64_storeu_epi16() {
+ let a = _mm256_set1_epi64x(i64::MAX);
+ let mut r = _mm_set1_epi16(0);
+ _mm256_mask_cvtusepi64_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,avx512vl")]
+ unsafe fn test_mm_mask_cvtusepi64_storeu_epi16() {
+ let a = _mm_set1_epi64x(i64::MAX);
+ let mut r = _mm_set1_epi16(0);
+ _mm_mask_cvtusepi64_storeu_epi16(&mut r as *mut _ as *mut i8, 0b11111111, a);
+ let e = _mm_set_epi16(0, 0, 0, 0, 0, 0, u16::MAX as i16, u16::MAX as i16);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtepi64_storeu_epi8() {
+ let a = _mm512_set1_epi64(9);
+ let mut r = _mm_set1_epi8(0);
+ _mm512_mask_cvtepi64_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_mm256_mask_cvtepi64_storeu_epi8() {
+ let a = _mm256_set1_epi64x(9);
+ let mut r = _mm_set1_epi8(0);
+ _mm256_mask_cvtepi64_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,avx512vl")]
+ unsafe fn test_mm_mask_cvtepi64_storeu_epi8() {
+ let a = _mm_set1_epi64x(9);
+ let mut r = _mm_set1_epi8(0);
+ _mm_mask_cvtepi64_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, 0, 0, 9, 9);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtsepi64_storeu_epi8() {
+ let a = _mm512_set1_epi64(i64::MAX);
+ let mut r = _mm_set1_epi8(0);
+ _mm512_mask_cvtsepi64_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_mm256_mask_cvtsepi64_storeu_epi8() {
+ let a = _mm256_set1_epi64x(i64::MAX);
+ let mut r = _mm_set1_epi8(0);
+ _mm256_mask_cvtsepi64_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,avx512vl")]
+ unsafe fn test_mm_mask_cvtsepi64_storeu_epi8() {
+ let a = _mm_set1_epi64x(i64::MAX);
+ let mut r = _mm_set1_epi8(0);
+ _mm_mask_cvtsepi64_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, 0, 0, i8::MAX, i8::MAX);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtusepi64_storeu_epi8() {
+ let a = _mm512_set1_epi64(i64::MAX);
+ let mut r = _mm_set1_epi8(0);
+ _mm512_mask_cvtusepi64_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_mm256_mask_cvtusepi64_storeu_epi8() {
+ let a = _mm256_set1_epi64x(i64::MAX);
+ let mut r = _mm_set1_epi8(0);
+ _mm256_mask_cvtusepi64_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,avx512vl")]
+ unsafe fn test_mm_mask_cvtusepi64_storeu_epi8() {
+ let a = _mm_set1_epi64x(i64::MAX);
+ let mut r = _mm_set1_epi8(0);
+ _mm_mask_cvtusepi64_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,
+ 0, 0, u8::MAX as i8, u8::MAX as i8,
+ );
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtepi64_storeu_epi32() {
+ let a = _mm512_set1_epi64(9);
+ let mut r = _mm256_undefined_si256();
+ _mm512_mask_cvtepi64_storeu_epi32(&mut r as *mut _ as *mut i8, 0b11111111, a);
+ let e = _mm256_set1_epi32(9);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cvtepi64_storeu_epi32() {
+ let a = _mm256_set1_epi64x(9);
+ let mut r = _mm_set1_epi32(0);
+ _mm256_mask_cvtepi64_storeu_epi32(&mut r as *mut _ as *mut i8, 0b11111111, a);
+ let e = _mm_set_epi32(9, 9, 9, 9);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtepi64_storeu_epi32() {
+ let a = _mm_set1_epi64x(9);
+ let mut r = _mm_set1_epi16(0);
+ _mm_mask_cvtepi64_storeu_epi32(&mut r as *mut _ as *mut i8, 0b11111111, a);
+ let e = _mm_set_epi32(0, 0, 9, 9);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtsepi64_storeu_epi32() {
+ let a = _mm512_set1_epi64(i64::MAX);
+ let mut r = _mm256_undefined_si256();
+ _mm512_mask_cvtsepi64_storeu_epi32(&mut r as *mut _ as *mut i8, 0b11111111, a);
+ let e = _mm256_set1_epi32(i32::MAX);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cvtsepi64_storeu_epi32() {
+ let a = _mm256_set1_epi64x(i64::MAX);
+ let mut r = _mm_set1_epi32(0);
+ _mm256_mask_cvtsepi64_storeu_epi32(&mut r as *mut _ as *mut i8, 0b00001111, a);
+ let e = _mm_set1_epi32(i32::MAX);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtsepi64_storeu_epi32() {
+ let a = _mm_set1_epi64x(i64::MAX);
+ let mut r = _mm_set1_epi16(0);
+ _mm_mask_cvtsepi64_storeu_epi32(&mut r as *mut _ as *mut i8, 0b00000011, a);
+ let e = _mm_set_epi32(0, 0, i32::MAX, i32::MAX);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_cvtusepi64_storeu_epi32() {
+ let a = _mm512_set1_epi64(i64::MAX);
+ let mut r = _mm256_undefined_si256();
+ _mm512_mask_cvtusepi64_storeu_epi32(&mut r as *mut _ as *mut i8, 0b11111111, a);
+ let e = _mm256_set1_epi32(u32::MAX as i32);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_cvtusepi64_storeu_epi32() {
+ let a = _mm256_set1_epi64x(i64::MAX);
+ let mut r = _mm_set1_epi32(0);
+ _mm256_mask_cvtusepi64_storeu_epi32(&mut r as *mut _ as *mut i8, 0b00001111, a);
+ let e = _mm_set1_epi32(u32::MAX as i32);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_cvtusepi64_storeu_epi32() {
+ let a = _mm_set1_epi64x(i64::MAX);
+ let mut r = _mm_set1_epi16(0);
+ _mm_mask_cvtusepi64_storeu_epi32(&mut r as *mut _ as *mut i8, 0b00000011, a);
+ let e = _mm_set_epi32(0, 0, u32::MAX as i32, u32::MAX as i32);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_storeu_epi64() {
+ let a = _mm512_set1_epi64(9);
+ let mut r = _mm512_set1_epi64(0);
+ _mm512_storeu_epi64(&mut r as *mut _ as *mut i64, a);
+ assert_eq_m512i(r, a);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_storeu_epi64() {
+ let a = _mm256_set1_epi64x(9);
+ let mut r = _mm256_set1_epi64x(0);
+ _mm256_storeu_epi64(&mut r as *mut _ as *mut i64, a);
+ assert_eq_m256i(r, a);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_storeu_epi64() {
+ let a = _mm_set1_epi64x(9);
+ let mut r = _mm_set1_epi64x(0);
+ _mm_storeu_epi64(&mut r as *mut _ as *mut i64, a);
+ assert_eq_m128i(r, a);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_load_epi64() {
+ #[repr(align(64))]
+ struct Align {
+ data: [i64; 8], // 64 bytes
+ }
+ let a = Align {
+ data: [4, 3, 2, 5, -8, -9, -64, -50],
+ };
+ let p = (a.data).as_ptr();
+ let r = _mm512_load_epi64(black_box(p));
+ let e = _mm512_setr_epi64(4, 3, 2, 5, -8, -9, -64, -50);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_load_epi64() {
+ #[repr(align(64))]
+ struct Align {
+ data: [i64; 4],
+ }
+ let a = Align { data: [4, 3, 2, 5] };
+ let p = (a.data).as_ptr();
+ let r = _mm256_load_epi64(black_box(p));
+ let e = _mm256_set_epi64x(5, 2, 3, 4);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_load_epi64() {
+ #[repr(align(64))]
+ struct Align {
+ data: [i64; 2],
+ }
+ let a = Align { data: [4, 3] };
+ let p = (a.data).as_ptr();
+ let r = _mm_load_epi64(black_box(p));
+ let e = _mm_set_epi64x(3, 4);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_store_epi64() {
+ let a = _mm512_set1_epi64(9);
+ let mut r = _mm512_set1_epi64(0);
+ _mm512_store_epi64(&mut r as *mut _ as *mut i64, a);
+ assert_eq_m512i(r, a);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_store_epi64() {
+ let a = _mm256_set1_epi64x(9);
+ let mut r = _mm256_set1_epi64x(0);
+ _mm256_store_epi64(&mut r as *mut _ as *mut i64, a);
+ assert_eq_m256i(r, a);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_store_epi64() {
+ let a = _mm_set1_epi64x(9);
+ let mut r = _mm_set1_epi64x(0);
+ _mm_store_epi64(&mut r as *mut _ as *mut i64, a);
+ assert_eq_m128i(r, a);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_load_pd() {
+ #[repr(align(64))]
+ struct Align {
+ data: [f64; 8], // 64 bytes
+ }
+ let a = Align {
+ data: [4., 3., 2., 5., -8., -9., -64., -50.],
+ };
+ let p = (a.data).as_ptr();
+ let r = _mm512_load_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_store_pd() {
+ let a = _mm512_set1_pd(9.);
+ let mut r = _mm512_undefined_pd();
+ _mm512_store_pd(&mut r as *mut _ as *mut f64, a);
+ assert_eq_m512d(r, a);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_test_epi64_mask() {
+ let a = _mm512_set1_epi64(1 << 0);
+ let b = _mm512_set1_epi64(1 << 0 | 1 << 1);
+ let r = _mm512_test_epi64_mask(a, b);
+ let e: __mmask8 = 0b11111111;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_test_epi64_mask() {
+ let a = _mm512_set1_epi64(1 << 0);
+ let b = _mm512_set1_epi64(1 << 0 | 1 << 1);
+ let r = _mm512_mask_test_epi64_mask(0, a, b);
+ assert_eq!(r, 0);
+ let r = _mm512_mask_test_epi64_mask(0b11111111, a, b);
+ let e: __mmask8 = 0b11111111;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_test_epi64_mask() {
+ let a = _mm256_set1_epi64x(1 << 0);
+ let b = _mm256_set1_epi64x(1 << 0 | 1 << 1);
+ let r = _mm256_test_epi64_mask(a, b);
+ let e: __mmask8 = 0b00001111;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_test_epi64_mask() {
+ let a = _mm256_set1_epi64x(1 << 0);
+ let b = _mm256_set1_epi64x(1 << 0 | 1 << 1);
+ let r = _mm256_mask_test_epi64_mask(0, a, b);
+ assert_eq!(r, 0);
+ let r = _mm256_mask_test_epi64_mask(0b00001111, a, b);
+ let e: __mmask8 = 0b00001111;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_test_epi64_mask() {
+ let a = _mm_set1_epi64x(1 << 0);
+ let b = _mm_set1_epi64x(1 << 0 | 1 << 1);
+ let r = _mm_test_epi64_mask(a, b);
+ let e: __mmask8 = 0b00000011;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_test_epi64_mask() {
+ let a = _mm_set1_epi64x(1 << 0);
+ let b = _mm_set1_epi64x(1 << 0 | 1 << 1);
+ let r = _mm_mask_test_epi64_mask(0, a, b);
+ assert_eq!(r, 0);
+ let r = _mm_mask_test_epi64_mask(0b00000011, a, b);
+ let e: __mmask8 = 0b00000011;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_testn_epi64_mask() {
+ let a = _mm512_set1_epi64(1 << 0);
+ let b = _mm512_set1_epi64(1 << 0 | 1 << 1);
+ let r = _mm512_testn_epi64_mask(a, b);
+ let e: __mmask8 = 0b00000000;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_testn_epi64_mask() {
+ let a = _mm512_set1_epi64(1 << 0);
+ let b = _mm512_set1_epi64(1 << 1);
+ let r = _mm512_mask_testn_epi64_mask(0, a, b);
+ assert_eq!(r, 0);
+ let r = _mm512_mask_testn_epi64_mask(0b11111111, a, b);
+ let e: __mmask8 = 0b11111111;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_testn_epi64_mask() {
+ let a = _mm256_set1_epi64x(1 << 0);
+ let b = _mm256_set1_epi64x(1 << 1);
+ let r = _mm256_testn_epi64_mask(a, b);
+ let e: __mmask8 = 0b00001111;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_testn_epi64_mask() {
+ let a = _mm256_set1_epi64x(1 << 0);
+ let b = _mm256_set1_epi64x(1 << 1);
+ let r = _mm256_mask_testn_epi64_mask(0, a, b);
+ assert_eq!(r, 0);
+ let r = _mm256_mask_testn_epi64_mask(0b11111111, a, b);
+ let e: __mmask8 = 0b00001111;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_testn_epi64_mask() {
+ let a = _mm_set1_epi64x(1 << 0);
+ let b = _mm_set1_epi64x(1 << 1);
+ let r = _mm_testn_epi64_mask(a, b);
+ let e: __mmask8 = 0b00000011;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_testn_epi64_mask() {
+ let a = _mm_set1_epi64x(1 << 0);
+ let b = _mm_set1_epi64x(1 << 1);
+ let r = _mm_mask_testn_epi64_mask(0, a, b);
+ assert_eq!(r, 0);
+ let r = _mm_mask_testn_epi64_mask(0b11111111, a, b);
+ let e: __mmask8 = 0b00000011;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_stream_pd() {
+ #[repr(align(64))]
+ struct Memory {
+ pub data: [f64; 8],
+ }
+ let a = _mm512_set1_pd(7.0);
+ let mut mem = Memory { data: [-1.0; 8] };
+
+ _mm512_stream_pd(&mut mem.data[0] as *mut f64, a);
+ for i in 0..8 {
+ assert_eq!(mem.data[i], get_m512d(a, i));
+ }
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_stream_si512() {
+ #[repr(align(64))]
+ struct Memory {
+ pub data: [i64; 8],
+ }
+ let a = _mm512_set1_epi64(7);
+ let mut mem = Memory { data: [-1; 8] };
+
+ _mm512_stream_si512(&mut mem.data[0] as *mut i64, a);
+ for i in 0..8 {
+ assert_eq!(mem.data[i], get_m512i(a, i));
+ }
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_mask_set1_epi64() {
+ let src = _mm512_set1_epi64(2);
+ let a: i64 = 11;
+ let r = _mm512_mask_set1_epi64(src, 0, a);
+ assert_eq_m512i(r, src);
+ let r = _mm512_mask_set1_epi64(src, 0b11111111, a);
+ let e = _mm512_set1_epi64(11);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm512_maskz_set1_epi64() {
+ let a: i64 = 11;
+ let r = _mm512_maskz_set1_epi64(0, a);
+ assert_eq_m512i(r, _mm512_setzero_si512());
+ let r = _mm512_maskz_set1_epi64(0b11111111, a);
+ let e = _mm512_set1_epi64(11);
+ assert_eq_m512i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_mask_set1_epi64() {
+ let src = _mm256_set1_epi64x(2);
+ let a: i64 = 11;
+ let r = _mm256_mask_set1_epi64(src, 0, a);
+ assert_eq_m256i(r, src);
+ let r = _mm256_mask_set1_epi64(src, 0b00001111, a);
+ let e = _mm256_set1_epi64x(11);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm256_maskz_set1_epi64() {
+ let a: i64 = 11;
+ let r = _mm256_maskz_set1_epi64(0, a);
+ assert_eq_m256i(r, _mm256_setzero_si256());
+ let r = _mm256_maskz_set1_epi64(0b00001111, a);
+ let e = _mm256_set1_epi64x(11);
+ assert_eq_m256i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_mask_set1_epi64() {
+ let src = _mm_set1_epi64x(2);
+ let a: i64 = 11;
+ let r = _mm_mask_set1_epi64(src, 0, a);
+ assert_eq_m128i(r, src);
+ let r = _mm_mask_set1_epi64(src, 0b00000011, a);
+ let e = _mm_set1_epi64x(11);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f,avx512vl")]
+ unsafe fn test_mm_maskz_set1_epi64() {
+ let a: i64 = 11;
+ let r = _mm_maskz_set1_epi64(0, a);
+ assert_eq_m128i(r, _mm_setzero_si128());
+ let r = _mm_maskz_set1_epi64(0b00000011, a);
+ let e = _mm_set1_epi64x(11);
+ assert_eq_m128i(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvtsd_i64() {
+ let a = _mm_set_pd(1., -1.5);
+ let r = _mm_cvtsd_i64(a);
+ let e: i64 = -2;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvtss_i64() {
+ let a = _mm_set_ps(0., -0.5, 1., -1.5);
+ let r = _mm_cvtss_i64(a);
+ let e: i64 = -2;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvt_roundi64_ss() {
+ let a = _mm_set_ps(0., -0.5, 1., -1.5);
+ let b: i64 = 9;
+ let r = _mm_cvt_roundi64_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_roundsi64_ss() {
+ let a = _mm_set_ps(0., -0.5, 1., -1.5);
+ let b: i64 = 9;
+ let r = _mm_cvt_roundsi64_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_cvti64_ss() {
+ let a = _mm_set_ps(0., -0.5, 1., -1.5);
+ let b: i64 = 9;
+ let r = _mm_cvti64_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_cvti64_sd() {
+ let a = _mm_set_pd(1., -1.5);
+ let b: i64 = 9;
+ let r = _mm_cvti64_sd(a, b);
+ let e = _mm_set_pd(1., 9.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvt_roundsd_si64() {
+ let a = _mm_set_pd(1., -1.5);
+ let r = _mm_cvt_roundsd_si64::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a);
+ let e: i64 = -1;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvt_roundsd_i64() {
+ let a = _mm_set_pd(1., -1.5);
+ let r = _mm_cvt_roundsd_i64::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a);
+ let e: i64 = -1;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvt_roundsd_u64() {
+ let a = _mm_set_pd(1., f64::MAX);
+ let r = _mm_cvt_roundsd_u64::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a);
+ let e: u64 = u64::MAX;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvtsd_u64() {
+ let a = _mm_set_pd(1., -1.5);
+ let r = _mm_cvtsd_u64(a);
+ let e: u64 = u64::MAX;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvt_roundss_i64() {
+ let a = _mm_set_ps(0., -0.5, 1., -1.5);
+ let r = _mm_cvt_roundss_i64::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a);
+ let e: i64 = -1;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvt_roundss_si64() {
+ let a = _mm_set_ps(0., -0.5, 1., -1.5);
+ let r = _mm_cvt_roundss_si64::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a);
+ let e: i64 = -1;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvt_roundss_u64() {
+ let a = _mm_set_ps(0., -0.5, 1., -1.5);
+ let r = _mm_cvt_roundss_u64::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a);
+ let e: u64 = u64::MAX;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvtss_u64() {
+ let a = _mm_set_ps(0., -0.5, 1., -1.5);
+ let r = _mm_cvtss_u64(a);
+ let e: u64 = u64::MAX;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvttsd_i64() {
+ let a = _mm_set_pd(1., -1.5);
+ let r = _mm_cvttsd_i64(a);
+ let e: i64 = -2;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvtt_roundsd_i64() {
+ let a = _mm_set_pd(1., -1.5);
+ let r = _mm_cvtt_roundsd_i64::<_MM_FROUND_CUR_DIRECTION>(a);
+ let e: i64 = -2;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvtt_roundsd_si64() {
+ let a = _mm_set_pd(1., -1.5);
+ let r = _mm_cvtt_roundsd_si64::<_MM_FROUND_CUR_DIRECTION>(a);
+ let e: i64 = -2;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvtt_roundsd_u64() {
+ let a = _mm_set_pd(1., -1.5);
+ let r = _mm_cvtt_roundsd_u64::<_MM_FROUND_CUR_DIRECTION>(a);
+ let e: u64 = u64::MAX;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvttsd_u64() {
+ let a = _mm_set_pd(1., -1.5);
+ let r = _mm_cvttsd_u64(a);
+ let e: u64 = u64::MAX;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvttss_i64() {
+ let a = _mm_set_ps(0., -0.5, 1., -1.5);
+ let r = _mm_cvttss_i64(a);
+ let e: i64 = -2;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvtt_roundss_i64() {
+ let a = _mm_set_ps(0., -0.5, 1., -1.5);
+ let r = _mm_cvtt_roundss_i64::<_MM_FROUND_CUR_DIRECTION>(a);
+ let e: i64 = -2;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvtt_roundss_si64() {
+ let a = _mm_set_ps(0., -0.5, 1., -1.5);
+ let r = _mm_cvtt_roundss_si64::<_MM_FROUND_CUR_DIRECTION>(a);
+ let e: i64 = -2;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvtt_roundss_u64() {
+ let a = _mm_set_ps(0., -0.5, 1., -1.5);
+ let r = _mm_cvtt_roundss_u64::<_MM_FROUND_CUR_DIRECTION>(a);
+ let e: u64 = u64::MAX;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvttss_u64() {
+ let a = _mm_set_ps(0., -0.5, 1., -1.5);
+ let r = _mm_cvttss_u64(a);
+ let e: u64 = u64::MAX;
+ assert_eq!(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvtu64_ss() {
+ let a = _mm_set_ps(0., -0.5, 1., -1.5);
+ let b: u64 = 9;
+ let r = _mm_cvtu64_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_cvtu64_sd() {
+ let a = _mm_set_pd(1., -1.5);
+ let b: u64 = 9;
+ let r = _mm_cvtu64_sd(a, b);
+ let e = _mm_set_pd(1., 9.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvt_roundu64_ss() {
+ let a = _mm_set_ps(0., -0.5, 1., -1.5);
+ let b: u64 = 9;
+ let r = _mm_cvt_roundu64_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_roundu64_sd() {
+ let a = _mm_set_pd(1., -1.5);
+ let b: u64 = 9;
+ let r = _mm_cvt_roundu64_sd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b);
+ let e = _mm_set_pd(1., 9.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvt_roundi64_sd() {
+ let a = _mm_set_pd(1., -1.5);
+ let b: i64 = 9;
+ let r = _mm_cvt_roundi64_sd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b);
+ let e = _mm_set_pd(1., 9.);
+ assert_eq_m128d(r, e);
+ }
+
+ #[simd_test(enable = "avx512f")]
+ unsafe fn test_mm_cvt_roundsi64_sd() {
+ let a = _mm_set_pd(1., -1.5);
+ let b: i64 = 9;
+ let r = _mm_cvt_roundsi64_sd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b);
+ let e = _mm_set_pd(1., 9.);
+ assert_eq_m128d(r, e);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86_64/bmi.rs b/library/stdarch/crates/core_arch/src/x86_64/bmi.rs
new file mode 100644
index 000000000..9f71a8d38
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86_64/bmi.rs
@@ -0,0 +1,183 @@
+//! 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_u64)
+#[inline]
+#[target_feature(enable = "bmi1")]
+#[cfg_attr(test, assert_instr(bextr))]
+#[cfg(not(target_arch = "x86"))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _bextr_u64(a: u64, start: u32, len: u32) -> u64 {
+ _bextr2_u64(a, ((start & 0xff) | ((len & 0xff) << 8)) as u64)
+}
+
+/// 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_u64)
+#[inline]
+#[target_feature(enable = "bmi1")]
+#[cfg_attr(test, assert_instr(bextr))]
+#[cfg(not(target_arch = "x86"))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _bextr2_u64(a: u64, control: u64) -> u64 {
+ x86_bmi_bextr_64(a, control)
+}
+
+/// Bitwise logical `AND` of inverted `a` with `b`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_andn_u64)
+#[inline]
+#[target_feature(enable = "bmi1")]
+#[cfg_attr(test, assert_instr(andn))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _andn_u64(a: u64, b: u64) -> u64 {
+ !a & b
+}
+
+/// Extracts lowest set isolated bit.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_blsi_u64)
+#[inline]
+#[target_feature(enable = "bmi1")]
+#[cfg_attr(test, assert_instr(blsi))]
+#[cfg(not(target_arch = "x86"))] // generates lots of instructions
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _blsi_u64(x: u64) -> u64 {
+ x & x.wrapping_neg()
+}
+
+/// Gets mask up to lowest set bit.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_blsmsk_u64)
+#[inline]
+#[target_feature(enable = "bmi1")]
+#[cfg_attr(test, assert_instr(blsmsk))]
+#[cfg(not(target_arch = "x86"))] // generates lots of instructions
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _blsmsk_u64(x: u64) -> u64 {
+ x ^ (x.wrapping_sub(1_u64))
+}
+
+/// Resets the lowest set bit of `x`.
+///
+/// If `x` is sets CF.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_blsr_u64)
+#[inline]
+#[target_feature(enable = "bmi1")]
+#[cfg_attr(test, assert_instr(blsr))]
+#[cfg(not(target_arch = "x86"))] // generates lots of instructions
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _blsr_u64(x: u64) -> u64 {
+ 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_u64)
+#[inline]
+#[target_feature(enable = "bmi1")]
+#[cfg_attr(test, assert_instr(tzcnt))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _tzcnt_u64(x: u64) -> u64 {
+ x.trailing_zeros() as u64
+}
+
+/// 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_64)
+#[inline]
+#[target_feature(enable = "bmi1")]
+#[cfg_attr(test, assert_instr(tzcnt))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_tzcnt_64(x: u64) -> i64 {
+ x.trailing_zeros() as i64
+}
+
+extern "C" {
+ #[link_name = "llvm.x86.bmi.bextr.64"]
+ fn x86_bmi_bextr_64(x: u64, y: u64) -> u64;
+}
+
+#[cfg(test)]
+mod tests {
+ use stdarch_test::simd_test;
+
+ use crate::core_arch::{x86::*, x86_64::*};
+
+ #[simd_test(enable = "bmi1")]
+ unsafe fn test_bextr_u64() {
+ let r = _bextr_u64(0b0101_0000u64, 4, 4);
+ assert_eq!(r, 0b0000_0101u64);
+ }
+
+ #[simd_test(enable = "bmi1")]
+ unsafe fn test_andn_u64() {
+ assert_eq!(_andn_u64(0, 0), 0);
+ assert_eq!(_andn_u64(0, 1), 1);
+ assert_eq!(_andn_u64(1, 0), 0);
+ assert_eq!(_andn_u64(1, 1), 0);
+
+ let r = _andn_u64(0b0000_0000u64, 0b0000_0000u64);
+ assert_eq!(r, 0b0000_0000u64);
+
+ let r = _andn_u64(0b0000_0000u64, 0b1111_1111u64);
+ assert_eq!(r, 0b1111_1111u64);
+
+ let r = _andn_u64(0b1111_1111u64, 0b0000_0000u64);
+ assert_eq!(r, 0b0000_0000u64);
+
+ let r = _andn_u64(0b1111_1111u64, 0b1111_1111u64);
+ assert_eq!(r, 0b0000_0000u64);
+
+ let r = _andn_u64(0b0100_0000u64, 0b0101_1101u64);
+ assert_eq!(r, 0b0001_1101u64);
+ }
+
+ #[simd_test(enable = "bmi1")]
+ unsafe fn test_blsi_u64() {
+ assert_eq!(_blsi_u64(0b1101_0000u64), 0b0001_0000u64);
+ }
+
+ #[simd_test(enable = "bmi1")]
+ unsafe fn test_blsmsk_u64() {
+ let r = _blsmsk_u64(0b0011_0000u64);
+ assert_eq!(r, 0b0001_1111u64);
+ }
+
+ #[simd_test(enable = "bmi1")]
+ unsafe fn test_blsr_u64() {
+ // TODO: test the behavior when the input is `0`.
+ let r = _blsr_u64(0b0011_0000u64);
+ assert_eq!(r, 0b0010_0000u64);
+ }
+
+ #[simd_test(enable = "bmi1")]
+ unsafe fn test_tzcnt_u64() {
+ assert_eq!(_tzcnt_u64(0b0000_0001u64), 0u64);
+ assert_eq!(_tzcnt_u64(0b0000_0000u64), 64u64);
+ assert_eq!(_tzcnt_u64(0b1001_0000u64), 4u64);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86_64/bmi2.rs b/library/stdarch/crates/core_arch/src/x86_64/bmi2.rs
new file mode 100644
index 000000000..356d95a3d
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86_64/bmi2.rs
@@ -0,0 +1,139 @@
+//! 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_u64)
+#[inline]
+#[cfg_attr(test, assert_instr(mul))]
+#[target_feature(enable = "bmi2")]
+#[cfg(not(target_arch = "x86"))] // calls an intrinsic
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mulx_u64(a: u64, b: u64, hi: &mut u64) -> u64 {
+ let result: u128 = (a as u128) * (b as u128);
+ *hi = (result >> 64) as u64;
+ result as u64
+}
+
+/// Zeroes higher bits of `a` >= `index`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_bzhi_u64)
+#[inline]
+#[target_feature(enable = "bmi2")]
+#[cfg_attr(test, assert_instr(bzhi))]
+#[cfg(not(target_arch = "x86"))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _bzhi_u64(a: u64, index: u32) -> u64 {
+ x86_bmi2_bzhi_64(a, index as u64)
+}
+
+/// 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_u64)
+#[inline]
+#[target_feature(enable = "bmi2")]
+#[cfg_attr(test, assert_instr(pdep))]
+#[cfg(not(target_arch = "x86"))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _pdep_u64(a: u64, mask: u64) -> u64 {
+ x86_bmi2_pdep_64(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_u64)
+#[inline]
+#[target_feature(enable = "bmi2")]
+#[cfg_attr(test, assert_instr(pext))]
+#[cfg(not(target_arch = "x86"))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _pext_u64(a: u64, mask: u64) -> u64 {
+ x86_bmi2_pext_64(a, mask)
+}
+
+extern "C" {
+ #[link_name = "llvm.x86.bmi.bzhi.64"]
+ fn x86_bmi2_bzhi_64(x: u64, y: u64) -> u64;
+ #[link_name = "llvm.x86.bmi.pdep.64"]
+ fn x86_bmi2_pdep_64(x: u64, y: u64) -> u64;
+ #[link_name = "llvm.x86.bmi.pext.64"]
+ fn x86_bmi2_pext_64(x: u64, y: u64) -> u64;
+}
+
+#[cfg(test)]
+mod tests {
+ use stdarch_test::simd_test;
+
+ use crate::core_arch::x86_64::*;
+
+ #[simd_test(enable = "bmi2")]
+ unsafe fn test_pext_u64() {
+ let n = 0b1011_1110_1001_0011u64;
+
+ let m0 = 0b0110_0011_1000_0101u64;
+ let s0 = 0b0000_0000_0011_0101u64;
+
+ let m1 = 0b1110_1011_1110_1111u64;
+ let s1 = 0b0001_0111_0100_0011u64;
+
+ assert_eq!(_pext_u64(n, m0), s0);
+ assert_eq!(_pext_u64(n, m1), s1);
+ }
+
+ #[simd_test(enable = "bmi2")]
+ unsafe fn test_pdep_u64() {
+ let n = 0b1011_1110_1001_0011u64;
+
+ let m0 = 0b0110_0011_1000_0101u64;
+ let s0 = 0b0000_0010_0000_0101u64;
+
+ let m1 = 0b1110_1011_1110_1111u64;
+ let s1 = 0b1110_1001_0010_0011u64;
+
+ assert_eq!(_pdep_u64(n, m0), s0);
+ assert_eq!(_pdep_u64(n, m1), s1);
+ }
+
+ #[simd_test(enable = "bmi2")]
+ unsafe fn test_bzhi_u64() {
+ let n = 0b1111_0010u64;
+ let s = 0b0001_0010u64;
+ assert_eq!(_bzhi_u64(n, 5), s);
+ }
+
+ #[simd_test(enable = "bmi2")]
+ #[rustfmt::skip]
+ unsafe fn test_mulx_u64() {
+ let a: u64 = 9_223_372_036_854_775_800;
+ let b: u64 = 100;
+ let mut hi = 0;
+ let lo = _mulx_u64(a, b, &mut hi);
+ /*
+result = 922337203685477580000 =
+0b00110001_1111111111111111_1111111111111111_1111111111111111_1111110011100000
+ ^~hi~~~~ ^~lo~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ */
+ assert_eq!(
+ lo,
+ 0b11111111_11111111_11111111_11111111_11111111_11111111_11111100_11100000u64
+ );
+ assert_eq!(hi, 0b00110001u64);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86_64/bswap.rs b/library/stdarch/crates/core_arch/src/x86_64/bswap.rs
new file mode 100644
index 000000000..90a209ce3
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86_64/bswap.rs
@@ -0,0 +1,29 @@
+//! 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=_bswap64)
+#[inline]
+#[cfg_attr(test, assert_instr(bswap))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _bswap64(x: i64) -> i64 {
+ x.swap_bytes()
+}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[test]
+ fn test_bswap64() {
+ unsafe {
+ assert_eq!(_bswap64(0x0EADBEEFFADECA0E), 0x0ECADEFAEFBEAD0E);
+ assert_eq!(_bswap64(0x0000000000000000), 0x0000000000000000);
+ }
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86_64/bt.rs b/library/stdarch/crates/core_arch/src/x86_64/bt.rs
new file mode 100644
index 000000000..53da9d02f
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86_64/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}, ({p:e})")
+ };
+}
+#[cfg(target_pointer_width = "64")]
+macro_rules! bt {
+ ($inst:expr) => {
+ concat!($inst, " {b}, ({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 _bittest64(p: *const i64, b: i64) -> u8 {
+ let r: u8;
+ asm!(
+ bt!("btq"),
+ "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 _bittestandset64(p: *mut i64, b: i64) -> u8 {
+ let r: u8;
+ asm!(
+ bt!("btsq"),
+ "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 _bittestandreset64(p: *mut i64, b: i64) -> u8 {
+ let r: u8;
+ asm!(
+ bt!("btrq"),
+ "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 _bittestandcomplement64(p: *mut i64, b: i64) -> u8 {
+ let r: u8;
+ asm!(
+ bt!("btcq"),
+ "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_64::*;
+
+ #[test]
+ fn test_bittest64() {
+ unsafe {
+ let a = 0b0101_0000i64;
+ assert_eq!(_bittest64(&a as _, 4), 1);
+ assert_eq!(_bittest64(&a as _, 5), 0);
+ }
+ }
+
+ #[test]
+ fn test_bittestandset64() {
+ unsafe {
+ let mut a = 0b0101_0000i64;
+ assert_eq!(_bittestandset64(&mut a as _, 4), 1);
+ assert_eq!(_bittestandset64(&mut a as _, 4), 1);
+ assert_eq!(_bittestandset64(&mut a as _, 5), 0);
+ assert_eq!(_bittestandset64(&mut a as _, 5), 1);
+ }
+ }
+
+ #[test]
+ fn test_bittestandreset64() {
+ unsafe {
+ let mut a = 0b0101_0000i64;
+ assert_eq!(_bittestandreset64(&mut a as _, 4), 1);
+ assert_eq!(_bittestandreset64(&mut a as _, 4), 0);
+ assert_eq!(_bittestandreset64(&mut a as _, 5), 0);
+ assert_eq!(_bittestandreset64(&mut a as _, 5), 0);
+ }
+ }
+
+ #[test]
+ fn test_bittestandcomplement64() {
+ unsafe {
+ let mut a = 0b0101_0000i64;
+ assert_eq!(_bittestandcomplement64(&mut a as _, 4), 1);
+ assert_eq!(_bittestandcomplement64(&mut a as _, 4), 0);
+ assert_eq!(_bittestandcomplement64(&mut a as _, 4), 1);
+ assert_eq!(_bittestandcomplement64(&mut a as _, 5), 0);
+ assert_eq!(_bittestandcomplement64(&mut a as _, 5), 1);
+ }
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86_64/cmpxchg16b.rs b/library/stdarch/crates/core_arch/src/x86_64/cmpxchg16b.rs
new file mode 100644
index 000000000..391daed20
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86_64/cmpxchg16b.rs
@@ -0,0 +1,73 @@
+use crate::sync::atomic::Ordering;
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+/// Compares and exchange 16 bytes (128 bits) of data atomically.
+///
+/// This intrinsic corresponds to the `cmpxchg16b` instruction on `x86_64`
+/// processors. It performs an atomic compare-and-swap, updating the `ptr`
+/// memory location to `val` if the current value in memory equals `old`.
+///
+/// # Return value
+///
+/// This function returns the previous value at the memory location. If it is
+/// equal to `old` then the memory was updated to `new`.
+///
+/// # Memory Orderings
+///
+/// This atomic operations has the same semantics of memory orderings as
+/// `AtomicUsize::compare_exchange` does, only operating on 16 bytes of memory
+/// instead of just a pointer.
+///
+/// For more information on memory orderings here see the `compare_exchange`
+/// documentation for other `Atomic*` types in the standard library.
+///
+/// # Unsafety
+///
+/// This method is unsafe because it takes a raw pointer and will attempt to
+/// read and possibly write the memory at the pointer. The pointer must also be
+/// aligned on a 16-byte boundary.
+///
+/// This method also requires the `cmpxchg16b` CPU feature to be available at
+/// runtime to work correctly. If the CPU running the binary does not actually
+/// support `cmpxchg16b` and the program enters an execution path that
+/// eventually would reach this function the behavior is undefined.
+///
+/// The `success` ordering must also be stronger or equal to `failure`, or this
+/// function call is undefined. See the `Atomic*` documentation's
+/// `compare_exchange` function for more information. When `compare_exchange`
+/// panics, this is undefined behavior. Currently this function aborts the
+/// process with an undefined instruction.
+#[inline]
+#[cfg_attr(test, assert_instr(cmpxchg16b, success = Ordering::SeqCst, failure = Ordering::SeqCst))]
+#[target_feature(enable = "cmpxchg16b")]
+pub unsafe fn cmpxchg16b(
+ dst: *mut u128,
+ old: u128,
+ new: u128,
+ success: Ordering,
+ failure: Ordering,
+) -> u128 {
+ use crate::{intrinsics, sync::atomic::Ordering::*};
+
+ debug_assert!(dst as usize % 16 == 0);
+
+ let (val, _ok) = match (success, failure) {
+ (Acquire, Acquire) => intrinsics::atomic_cxchg_acq(dst, old, new),
+ (Release, Relaxed) => intrinsics::atomic_cxchg_rel(dst, old, new),
+ (AcqRel, Acquire) => intrinsics::atomic_cxchg_acqrel(dst, old, new),
+ (Relaxed, Relaxed) => intrinsics::atomic_cxchg_relaxed(dst, old, new),
+ (SeqCst, SeqCst) => intrinsics::atomic_cxchg(dst, old, new),
+ (Acquire, Relaxed) => intrinsics::atomic_cxchg_acq_failrelaxed(dst, old, new),
+ (AcqRel, Relaxed) => intrinsics::atomic_cxchg_acqrel_failrelaxed(dst, old, new),
+ (SeqCst, Relaxed) => intrinsics::atomic_cxchg_failrelaxed(dst, old, new),
+ (SeqCst, Acquire) => intrinsics::atomic_cxchg_failacq(dst, old, new),
+
+ // The above block is all copied from libcore, and this statement is
+ // also copied from libcore except that it's a panic in libcore and we
+ // have a little bit more of a lightweight panic here.
+ _ => crate::core_arch::x86::ud2(),
+ };
+ val
+}
diff --git a/library/stdarch/crates/core_arch/src/x86_64/fxsr.rs b/library/stdarch/crates/core_arch/src/x86_64/fxsr.rs
new file mode 100644
index 000000000..d02702046
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86_64/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.fxsave64"]
+ fn fxsave64(p: *mut u8);
+ #[link_name = "llvm.x86.fxrstor64"]
+ fn fxrstor64(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=_fxsave64)
+#[inline]
+#[target_feature(enable = "fxsr")]
+#[cfg_attr(test, assert_instr(fxsave64))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _fxsave64(mem_addr: *mut u8) {
+ fxsave64(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=_fxrstor64)
+#[inline]
+#[target_feature(enable = "fxsr")]
+#[cfg_attr(test, assert_instr(fxrstor64))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _fxrstor64(mem_addr: *const u8) {
+ fxrstor64(mem_addr)
+}
+
+#[cfg(test)]
+mod tests {
+ use crate::core_arch::x86_64::*;
+ 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 fxsave64() {
+ let mut a = FxsaveArea::new();
+ let mut b = FxsaveArea::new();
+
+ fxsr::_fxsave64(a.ptr());
+ fxsr::_fxrstor64(a.ptr());
+ fxsr::_fxsave64(b.ptr());
+ assert_eq!(a, b);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86_64/macros.rs b/library/stdarch/crates/core_arch/src/x86_64/macros.rs
new file mode 100644
index 000000000..a3ea0e821
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86_64/macros.rs
@@ -0,0 +1,36 @@
+//! 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_64::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_64::macros::ValidateConstSae::<$imm>::VALID;
+ };
+}
diff --git a/library/stdarch/crates/core_arch/src/x86_64/mod.rs b/library/stdarch/crates/core_arch/src/x86_64/mod.rs
new file mode 100644
index 000000000..461874ece
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86_64/mod.rs
@@ -0,0 +1,55 @@
+//! `x86_64` intrinsics
+
+#[macro_use]
+mod macros;
+
+mod fxsr;
+pub use self::fxsr::*;
+
+mod sse;
+pub use self::sse::*;
+
+mod sse2;
+pub use self::sse2::*;
+
+mod sse41;
+pub use self::sse41::*;
+
+mod sse42;
+pub use self::sse42::*;
+
+mod xsave;
+pub use self::xsave::*;
+
+mod abm;
+pub use self::abm::*;
+
+mod avx;
+pub use self::avx::*;
+
+mod bmi;
+pub use self::bmi::*;
+
+mod bmi2;
+pub use self::bmi2::*;
+
+mod avx2;
+pub use self::avx2::*;
+
+mod avx512f;
+pub use self::avx512f::*;
+
+mod bswap;
+pub use self::bswap::*;
+
+mod rdrand;
+pub use self::rdrand::*;
+
+mod cmpxchg16b;
+pub use self::cmpxchg16b::*;
+
+mod adx;
+pub use self::adx::*;
+
+mod bt;
+pub use self::bt::*;
diff --git a/library/stdarch/crates/core_arch/src/x86_64/rdrand.rs b/library/stdarch/crates/core_arch/src/x86_64/rdrand.rs
new file mode 100644
index 000000000..e5ec933fb
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86_64/rdrand.rs
@@ -0,0 +1,44 @@
+//! 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.64"]
+ fn x86_rdrand64_step() -> (u64, i32);
+ #[link_name = "llvm.x86.rdseed.64"]
+ fn x86_rdseed64_step() -> (u64, i32);
+}
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+/// Read a hardware generated 64-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=_rdrand64_step)
+#[inline]
+#[target_feature(enable = "rdrand")]
+#[cfg_attr(test, assert_instr(rdrand))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _rdrand64_step(val: &mut u64) -> i32 {
+ let (v, flag) = x86_rdrand64_step();
+ *val = v;
+ flag
+}
+
+/// Read a 64-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=_rdseed64_step)
+#[inline]
+#[target_feature(enable = "rdseed")]
+#[cfg_attr(test, assert_instr(rdseed))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _rdseed64_step(val: &mut u64) -> i32 {
+ let (v, flag) = x86_rdseed64_step();
+ *val = v;
+ flag
+}
diff --git a/library/stdarch/crates/core_arch/src/x86_64/sse.rs b/library/stdarch/crates/core_arch/src/x86_64/sse.rs
new file mode 100644
index 000000000..ca6799c90
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86_64/sse.rs
@@ -0,0 +1,148 @@
+//! `x86_64` Streaming SIMD Extensions (SSE)
+
+use crate::core_arch::x86::*;
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+#[allow(improper_ctypes)]
+extern "C" {
+ #[link_name = "llvm.x86.sse.cvtss2si64"]
+ fn cvtss2si64(a: __m128) -> i64;
+ #[link_name = "llvm.x86.sse.cvttss2si64"]
+ fn cvttss2si64(a: __m128) -> i64;
+ #[link_name = "llvm.x86.sse.cvtsi642ss"]
+ fn cvtsi642ss(a: __m128, b: i64) -> __m128;
+}
+
+/// Converts the lowest 32 bit float in the input vector to a 64 bit integer.
+///
+/// The result is rounded according to the current rounding mode. If the result
+/// cannot be represented as a 64 bit integer the result will be
+/// `0x8000_0000_0000_0000` (`i64::MIN`) or trigger an invalid operation
+/// floating point exception if unmasked (see
+/// [`_mm_setcsr`](fn._mm_setcsr.html)).
+///
+/// This corresponds to the `CVTSS2SI` instruction (with 64 bit output).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtss_si64)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(cvtss2si))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvtss_si64(a: __m128) -> i64 {
+ cvtss2si64(a)
+}
+
+/// Converts the lowest 32 bit float in the input vector to a 64 bit integer
+/// with truncation.
+///
+/// The result is rounded always using truncation (round towards zero). If the
+/// result cannot be represented as a 64 bit integer the result will be
+/// `0x8000_0000_0000_0000` (`i64::MIN`) or an invalid operation floating
+/// point exception if unmasked (see [`_mm_setcsr`](fn._mm_setcsr.html)).
+///
+/// This corresponds to the `CVTTSS2SI` instruction (with 64 bit output).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvttss_si64)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(cvttss2si))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvttss_si64(a: __m128) -> i64 {
+ cvttss2si64(a)
+}
+
+/// Converts a 64 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 64 bit
+/// input).
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtsi64_ss)
+#[inline]
+#[target_feature(enable = "sse")]
+#[cfg_attr(test, assert_instr(cvtsi2ss))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvtsi64_ss(a: __m128, b: i64) -> __m128 {
+ cvtsi642ss(a, b)
+}
+
+#[cfg(test)]
+mod tests {
+ use crate::core_arch::arch::x86_64::*;
+ use stdarch_test::simd_test;
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_cvtss_si64() {
+ let inputs = &[
+ (42.0f32, 42i64),
+ (-31.4, -31),
+ (-33.5, -34),
+ (-34.5, -34),
+ (4.0e10, 40_000_000_000),
+ (4.0e-10, 0),
+ (f32::NAN, i64::MIN),
+ (2147483500.1, 2147483520),
+ (9.223371e18, 9223370937343148032),
+ ];
+ 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_cvtss_si64(x);
+ assert_eq!(
+ e, r,
+ "TestCase #{} _mm_cvtss_si64({:?}) = {}, expected: {}",
+ i, x, r, e
+ );
+ }
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_cvttss_si64() {
+ let inputs = &[
+ (42.0f32, 42i64),
+ (-31.4, -31),
+ (-33.5, -33),
+ (-34.5, -34),
+ (10.999, 10),
+ (-5.99, -5),
+ (4.0e10, 40_000_000_000),
+ (4.0e-10, 0),
+ (f32::NAN, i64::MIN),
+ (2147483500.1, 2147483520),
+ (9.223371e18, 9223370937343148032),
+ (9.223372e18, i64::MIN),
+ ];
+ 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_si64(x);
+ assert_eq!(
+ e, r,
+ "TestCase #{} _mm_cvttss_si64({:?}) = {}, expected: {}",
+ i, x, r, e
+ );
+ }
+ }
+
+ #[simd_test(enable = "sse")]
+ unsafe fn test_mm_cvtsi64_ss() {
+ let inputs = &[
+ (4555i64, 4555.0f32),
+ (322223333, 322223330.0),
+ (-432, -432.0),
+ (-322223333, -322223330.0),
+ (9223372036854775807, 9.223372e18),
+ (-9223372036854775808, -9.223372e18),
+ ];
+
+ 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_cvtsi64_ss(a, x);
+ let e = _mm_setr_ps(f, 6.0, 7.0, 8.0);
+ assert_eq_m128(e, r);
+ }
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86_64/sse2.rs b/library/stdarch/crates/core_arch/src/x86_64/sse2.rs
new file mode 100644
index 000000000..f487a067f
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86_64/sse2.rs
@@ -0,0 +1,209 @@
+//! `x86_64`'s Streaming SIMD Extensions 2 (SSE2)
+
+use crate::{
+ core_arch::{simd_llvm::*, x86::*},
+ intrinsics,
+};
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+#[allow(improper_ctypes)]
+extern "C" {
+ #[link_name = "llvm.x86.sse2.cvtsd2si64"]
+ fn cvtsd2si64(a: __m128d) -> i64;
+ #[link_name = "llvm.x86.sse2.cvttsd2si64"]
+ fn cvttsd2si64(a: __m128d) -> i64;
+}
+
+/// Converts the lower double-precision (64-bit) floating-point element in a to
+/// a 64-bit integer.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtsd_si64)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cvtsd2si))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvtsd_si64(a: __m128d) -> i64 {
+ cvtsd2si64(a)
+}
+
+/// Alias for `_mm_cvtsd_si64`
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtsd_si64x)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cvtsd2si))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvtsd_si64x(a: __m128d) -> i64 {
+ _mm_cvtsd_si64(a)
+}
+
+/// Converts the lower double-precision (64-bit) floating-point element in `a`
+/// to a 64-bit integer with truncation.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvttsd_si64)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cvttsd2si))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvttsd_si64(a: __m128d) -> i64 {
+ cvttsd2si64(a)
+}
+
+/// Alias for `_mm_cvttsd_si64`
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvttsd_si64x)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cvttsd2si))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvttsd_si64x(a: __m128d) -> i64 {
+ _mm_cvttsd_si64(a)
+}
+
+/// Stores a 64-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_si64)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(movnti))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_stream_si64(mem_addr: *mut i64, a: i64) {
+ intrinsics::nontemporal_store(mem_addr, 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_cvtsi64_si128)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(all(test, not(windows)), assert_instr(movq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvtsi64_si128(a: i64) -> __m128i {
+ _mm_set_epi64x(0, 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_cvtsi64x_si128)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(all(test, not(windows)), assert_instr(movq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvtsi64x_si128(a: i64) -> __m128i {
+ _mm_cvtsi64_si128(a)
+}
+
+/// Returns the lowest element of `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtsi128_si64)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(all(test, not(windows)), assert_instr(movq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvtsi128_si64(a: __m128i) -> i64 {
+ simd_extract(a.as_i64x2(), 0)
+}
+
+/// Returns the lowest element of `a`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtsi128_si64x)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(all(test, not(windows)), assert_instr(movq))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvtsi128_si64x(a: __m128i) -> i64 {
+ _mm_cvtsi128_si64(a)
+}
+
+/// 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_cvtsi64_sd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cvtsi2sd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvtsi64_sd(a: __m128d, b: i64) -> __m128d {
+ simd_insert(a, 0, b as f64)
+}
+
+/// 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_cvtsi64x_sd)
+#[inline]
+#[target_feature(enable = "sse2")]
+#[cfg_attr(test, assert_instr(cvtsi2sd))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_cvtsi64x_sd(a: __m128d, b: i64) -> __m128d {
+ _mm_cvtsi64_sd(a, b)
+}
+
+#[cfg(test)]
+mod tests {
+ use crate::core_arch::arch::x86_64::*;
+ use std::boxed;
+ use stdarch_test::simd_test;
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cvtsd_si64() {
+ let r = _mm_cvtsd_si64(_mm_setr_pd(-2.0, 5.0));
+ assert_eq!(r, -2_i64);
+
+ let r = _mm_cvtsd_si64(_mm_setr_pd(f64::MAX, f64::MIN));
+ assert_eq!(r, i64::MIN);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cvtsd_si64x() {
+ let r = _mm_cvtsd_si64x(_mm_setr_pd(f64::NAN, f64::NAN));
+ assert_eq!(r, i64::MIN);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cvttsd_si64() {
+ let a = _mm_setr_pd(-1.1, 2.2);
+ let r = _mm_cvttsd_si64(a);
+ assert_eq!(r, -1_i64);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cvttsd_si64x() {
+ let a = _mm_setr_pd(f64::NEG_INFINITY, f64::NAN);
+ let r = _mm_cvttsd_si64x(a);
+ assert_eq!(r, i64::MIN);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_stream_si64() {
+ let a: i64 = 7;
+ let mut mem = boxed::Box::<i64>::new(-1);
+ _mm_stream_si64(&mut *mem as *mut i64, a);
+ assert_eq!(a, *mem);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cvtsi64_si128() {
+ let r = _mm_cvtsi64_si128(5);
+ assert_eq_m128i(r, _mm_setr_epi64x(5, 0));
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cvtsi128_si64() {
+ let r = _mm_cvtsi128_si64(_mm_setr_epi64x(5, 0));
+ assert_eq!(r, 5);
+ }
+
+ #[simd_test(enable = "sse2")]
+ unsafe fn test_mm_cvtsi64_sd() {
+ let a = _mm_set1_pd(3.5);
+ let r = _mm_cvtsi64_sd(a, 5);
+ assert_eq_m128d(r, _mm_setr_pd(5.0, 3.5));
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86_64/sse41.rs b/library/stdarch/crates/core_arch/src/x86_64/sse41.rs
new file mode 100644
index 000000000..3d1ea0cf6
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86_64/sse41.rs
@@ -0,0 +1,62 @@
+//! `i686`'s Streaming SIMD Extensions 4.1 (SSE4.1)
+
+use crate::{
+ core_arch::{simd_llvm::*, x86::*},
+ mem::transmute,
+};
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+/// Extracts an 64-bit integer from `a` selected with `IMM1`
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_extract_epi64)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(all(test, not(target_os = "windows")), assert_instr(pextrq, IMM1 = 1))]
+#[rustc_legacy_const_generics(1)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_extract_epi64<const IMM1: i32>(a: __m128i) -> i64 {
+ static_assert_imm1!(IMM1);
+ simd_extract(a.as_i64x2(), IMM1 as u32)
+}
+
+/// Returns a copy of `a` with the 64-bit integer from `i` inserted at a
+/// location specified by `IMM1`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_insert_epi64)
+#[inline]
+#[target_feature(enable = "sse4.1")]
+#[cfg_attr(test, assert_instr(pinsrq, IMM1 = 0))]
+#[rustc_legacy_const_generics(2)]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _mm_insert_epi64<const IMM1: i32>(a: __m128i, i: i64) -> __m128i {
+ static_assert_imm1!(IMM1);
+ transmute(simd_insert(a.as_i64x2(), IMM1 as u32, i))
+}
+
+#[cfg(test)]
+mod tests {
+ use crate::core_arch::arch::x86_64::*;
+ use stdarch_test::simd_test;
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_extract_epi64() {
+ let a = _mm_setr_epi64x(0, 1);
+ let r = _mm_extract_epi64::<1>(a);
+ assert_eq!(r, 1);
+ let r = _mm_extract_epi64::<0>(a);
+ assert_eq!(r, 0);
+ }
+
+ #[simd_test(enable = "sse4.1")]
+ unsafe fn test_mm_insert_epi64() {
+ let a = _mm_set1_epi64x(0);
+ let e = _mm_setr_epi64x(0, 32);
+ let r = _mm_insert_epi64::<1>(a, 32);
+ assert_eq_m128i(r, e);
+ let e = _mm_setr_epi64x(32, 0);
+ let r = _mm_insert_epi64::<0>(a, 32);
+ assert_eq_m128i(r, e);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86_64/sse42.rs b/library/stdarch/crates/core_arch/src/x86_64/sse42.rs
new file mode 100644
index 000000000..6b5d087c1
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86_64/sse42.rs
@@ -0,0 +1,37 @@
+//! `x86_64`'s Streaming SIMD Extensions 4.2 (SSE4.2)
+
+#[cfg(test)]
+use stdarch_test::assert_instr;
+
+#[allow(improper_ctypes)]
+extern "C" {
+ #[link_name = "llvm.x86.sse42.crc32.64.64"]
+ fn crc32_64_64(crc: u64, v: u64) -> u64;
+}
+
+/// Starting with the initial value in `crc`, return the accumulated
+/// CRC32-C value for unsigned 64-bit integer `v`.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_crc32_u64)
+#[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_u64(crc: u64, v: u64) -> u64 {
+ crc32_64_64(crc, v)
+}
+
+#[cfg(test)]
+mod tests {
+ use crate::core_arch::arch::x86_64::*;
+
+ use stdarch_test::simd_test;
+
+ #[simd_test(enable = "sse4.2")]
+ unsafe fn test_mm_crc32_u64() {
+ let crc = 0x7819dccd3e824;
+ let v = 0x2a22b845fed;
+ let i = _mm_crc32_u64(crc, v);
+ assert_eq!(i, 0xbb6cdc6c);
+ }
+}
diff --git a/library/stdarch/crates/core_arch/src/x86_64/xsave.rs b/library/stdarch/crates/core_arch/src/x86_64/xsave.rs
new file mode 100644
index 000000000..2afd3e433
--- /dev/null
+++ b/library/stdarch/crates/core_arch/src/x86_64/xsave.rs
@@ -0,0 +1,227 @@
+//! `x86_64`'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.xsave64"]
+ fn xsave64(p: *mut u8, hi: u32, lo: u32);
+ #[link_name = "llvm.x86.xrstor64"]
+ fn xrstor64(p: *const u8, hi: u32, lo: u32);
+ #[link_name = "llvm.x86.xsaveopt64"]
+ fn xsaveopt64(p: *mut u8, hi: u32, lo: u32);
+ #[link_name = "llvm.x86.xsavec64"]
+ fn xsavec64(p: *mut u8, hi: u32, lo: u32);
+ #[link_name = "llvm.x86.xsaves64"]
+ fn xsaves64(p: *mut u8, hi: u32, lo: u32);
+ #[link_name = "llvm.x86.xrstors64"]
+ fn xrstors64(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=_xsave64)
+#[inline]
+#[target_feature(enable = "xsave")]
+#[cfg_attr(test, assert_instr(xsave64))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _xsave64(mem_addr: *mut u8, save_mask: u64) {
+ xsave64(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=_xrstor64)
+#[inline]
+#[target_feature(enable = "xsave")]
+#[cfg_attr(test, assert_instr(xrstor64))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _xrstor64(mem_addr: *const u8, rs_mask: u64) {
+ xrstor64(mem_addr, (rs_mask >> 32) as u32, rs_mask as 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 hardware may optimize
+/// the manner in which data is saved. The performance of this instruction will
+/// be equal to or better than using the `XSAVE64` instruction.
+///
+/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_xsaveopt64)
+#[inline]
+#[target_feature(enable = "xsave,xsaveopt")]
+#[cfg_attr(test, assert_instr(xsaveopt64))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _xsaveopt64(mem_addr: *mut u8, save_mask: u64) {
+ xsaveopt64(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=_xsavec64)
+#[inline]
+#[target_feature(enable = "xsave,xsavec")]
+#[cfg_attr(test, assert_instr(xsavec64))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _xsavec64(mem_addr: *mut u8, save_mask: u64) {
+ xsavec64(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=_xsaves64)
+#[inline]
+#[target_feature(enable = "xsave,xsaves")]
+#[cfg_attr(test, assert_instr(xsaves64))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _xsaves64(mem_addr: *mut u8, save_mask: u64) {
+ xsaves64(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=_xrstors64)
+#[inline]
+#[target_feature(enable = "xsave,xsaves")]
+#[cfg_attr(test, assert_instr(xrstors64))]
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub unsafe fn _xrstors64(mem_addr: *const u8, rs_mask: u64) {
+ xrstors64(mem_addr, (rs_mask >> 32) as u32, rs_mask as u32);
+}
+
+// FIXME: https://github.com/rust-lang/stdarch/issues/209
+// All these tests fail with Intel SDE.
+/*
+#[cfg(test)]
+mod tests {
+ use crate::core_arch::x86::x86_64::xsave;
+ use stdarch_test::simd_test;
+ use std::fmt;
+
+ // FIXME: https://github.com/rust-lang/stdarch/issues/209
+ #[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, "]")
+ }
+ }
+
+ #[simd_test(enable = "xsave")]
+ unsafe fn xsave64() {
+ let m = 0xFFFFFFFFFFFFFFFF_u64; //< all registers
+ let mut a = XsaveArea::new();
+ let mut b = XsaveArea::new();
+
+ xsave::_xsave64(a.ptr(), m);
+ xsave::_xrstor64(a.ptr(), m);
+ xsave::_xsave64(b.ptr(), m);
+ assert_eq!(a, b);
+ }
+
+ #[simd_test(enable = "xsave,xsaveopt")]
+ unsafe fn xsaveopt64() {
+ let m = 0xFFFFFFFFFFFFFFFF_u64; //< all registers
+ let mut a = XsaveArea::new();
+ let mut b = XsaveArea::new();
+
+ xsave::_xsaveopt64(a.ptr(), m);
+ xsave::_xrstor64(a.ptr(), m);
+ xsave::_xsaveopt64(b.ptr(), m);
+ assert_eq!(a, b);
+ }
+
+ #[simd_test(enable = "xsave,xsavec")]
+ unsafe fn xsavec64() {
+ let m = 0xFFFFFFFFFFFFFFFF_u64; //< all registers
+ let mut a = XsaveArea::new();
+ let mut b = XsaveArea::new();
+
+ xsave::_xsavec64(a.ptr(), m);
+ xsave::_xrstor64(a.ptr(), m);
+ xsave::_xsavec64(b.ptr(), m);
+ assert_eq!(a, b);
+ }
+
+ #[simd_test(enable = "xsave,xsaves")]
+ unsafe fn xsaves64() {
+ let m = 0xFFFFFFFFFFFFFFFF_u64; //< all registers
+ let mut a = XsaveArea::new();
+ let mut b = XsaveArea::new();
+
+ xsave::_xsaves64(a.ptr(), m);
+ xsave::_xrstors64(a.ptr(), m);
+ xsave::_xsaves64(b.ptr(), m);
+ assert_eq!(a, b);
+ }
+}
+*/