From 879d1a0bbec332886faf4949cb352b1337e89d47 Mon Sep 17 00:00:00 2001 From: Yi-Yen Chung <45251297+yyctw@users.noreply.github.com> Date: Thu, 19 Oct 2023 05:30:31 +0800 Subject: [PATCH] neon/st1{,q}_*_x{2,3,4}: initial implementation (#1082) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Décio Luiz Gazzoni Filho Co-authored-by: Michael R. Crusoe --- meson.build | 6 + simde/arm/neon.h | 6 + simde/arm/neon/st1_x2.h | 195 ++++++ simde/arm/neon/st1_x3.h | 205 +++++++ simde/arm/neon/st1_x4.h | 215 +++++++ simde/arm/neon/st1q_x2.h | 195 ++++++ simde/arm/neon/st1q_x3.h | 205 +++++++ simde/arm/neon/st1q_x4.h | 215 +++++++ simde/simde-common.h | 3 + test/arm/neon/st1_x2.c | 742 +++++++++++++++++++++++ test/arm/neon/st1_x3.c | 882 +++++++++++++++++++++++++++ test/arm/neon/st1_x4.c | 998 +++++++++++++++++++++++++++++++ test/arm/neon/st1q_x2.c | 830 ++++++++++++++++++++++++++ test/arm/neon/st1q_x3.c | 1042 ++++++++++++++++++++++++++++++++ test/arm/neon/st1q_x4.c | 1214 ++++++++++++++++++++++++++++++++++++++ 15 files changed, 6953 insertions(+) create mode 100644 simde/arm/neon/st1_x2.h create mode 100644 simde/arm/neon/st1_x3.h create mode 100644 simde/arm/neon/st1_x4.h create mode 100644 simde/arm/neon/st1q_x2.h create mode 100644 simde/arm/neon/st1q_x3.h create mode 100644 simde/arm/neon/st1q_x4.h create mode 100644 test/arm/neon/st1_x2.c create mode 100644 test/arm/neon/st1_x3.c create mode 100644 test/arm/neon/st1_x4.c create mode 100644 test/arm/neon/st1q_x2.c create mode 100644 test/arm/neon/st1q_x3.c create mode 100644 test/arm/neon/st1q_x4.c diff --git a/meson.build b/meson.build index a9e325b3c..98306dbfc 100644 --- a/meson.build +++ b/meson.build @@ -210,6 +210,12 @@ simde_neon_families = [ 'sri_n', 'st1', 'st1_lane', + 'st1_x2', + 'st1_x3', + 'st1_x4', + 'st1q_x2', + 'st1q_x3', + 'st1q_x4', 'st2', 'st2_lane', 'st3', diff --git a/simde/arm/neon.h b/simde/arm/neon.h index 980fc9ccf..88d13b2ed 100644 --- a/simde/arm/neon.h +++ b/simde/arm/neon.h @@ -231,6 +231,12 @@ #include "neon/sri_n.h" #include "neon/st1.h" #include "neon/st1_lane.h" +#include "neon/st1_x2.h" +#include "neon/st1_x3.h" +#include "neon/st1_x4.h" +#include "neon/st1q_x2.h" +#include "neon/st1q_x3.h" +#include "neon/st1q_x4.h" #include "neon/st2.h" #include "neon/st2_lane.h" #include "neon/st3.h" diff --git a/simde/arm/neon/st1_x2.h b/simde/arm/neon/st1_x2.h new file mode 100644 index 000000000..53e7107be --- /dev/null +++ b/simde/arm/neon/st1_x2.h @@ -0,0 +1,195 @@ +/* SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, + * modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Copyright: + * 2020 Evan Nemerson + * 2021 Décio Luiz Gazzoni Filho + * 2023 Yi-Yen Chung (Copyright owned by Andes Technology) + */ + +#if !defined(SIMDE_ARM_NEON_ST1_X2_H) +#define SIMDE_ARM_NEON_ST1_X2_H + +#include "types.h" + +HEDLEY_DIAGNOSTIC_PUSH +SIMDE_DISABLE_UNWANTED_DIAGNOSTICS +SIMDE_BEGIN_DECLS_ + +#if !defined(SIMDE_BUG_INTEL_857088) + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1_f32_x2(simde_float32 ptr[HEDLEY_ARRAY_PARAM(4)], simde_float32x2x2_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1_f32_x2(ptr, val); + #else + simde_vst1_f32(ptr, val.val[0]); + simde_vst1_f32(ptr+2, val.val[1]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1_f32_x2 + #define vst1_f32_x2(ptr, val) simde_vst1_f32_x2((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1_f64_x2(simde_float64 ptr[HEDLEY_ARRAY_PARAM(2)], simde_float64x1x2_t val) { + #if defined(SIMDE_ARM_NEON_A64V8_NATIVE) + vst1_f64_x2(ptr, val); + #else + simde_vst1_f64(ptr, val.val[0]); + simde_vst1_f64(ptr+1, val.val[1]); + #endif +} +#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES) + #undef vst1_f64_x2 + #define vst1_f64_x2(ptr, val) simde_vst1_f64_x2((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1_s8_x2(int8_t ptr[HEDLEY_ARRAY_PARAM(16)], simde_int8x8x2_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1_s8_x2(ptr, val); + #else + simde_vst1_s8(ptr, val.val[0]); + simde_vst1_s8(ptr+8, val.val[1]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1_s8_x2 + #define vst1_s8_x2(ptr, val) simde_vst1_s8_x2((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1_s16_x2(int16_t ptr[HEDLEY_ARRAY_PARAM(8)], simde_int16x4x2_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1_s16_x2(ptr, val); + #else + simde_vst1_s16(ptr, val.val[0]); + simde_vst1_s16(ptr+4, val.val[1]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1_s16_x2 + #define vst1_s16_x2(ptr, val) simde_vst1_s16_x2((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1_s32_x2(int32_t ptr[HEDLEY_ARRAY_PARAM(4)], simde_int32x2x2_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1_s32_x2(ptr, val); + #else + simde_vst1_s32(ptr, val.val[0]); + simde_vst1_s32(ptr+2, val.val[1]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1_s32_x2 + #define vst1_s32_x2(ptr, val) simde_vst1_s32_x2((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1_s64_x2(int64_t ptr[HEDLEY_ARRAY_PARAM(2)], simde_int64x1x2_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1_s64_x2(ptr, val); + #else + simde_vst1_s64(ptr, val.val[0]); + simde_vst1_s64(ptr+1, val.val[1]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1_s64_x2 + #define vst1_s64_x2(ptr, val) simde_vst1_s64_x2((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1_u8_x2(uint8_t ptr[HEDLEY_ARRAY_PARAM(16)], simde_uint8x8x2_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1_u8_x2(ptr, val); + #else + simde_vst1_u8(ptr, val.val[0]); + simde_vst1_u8(ptr+8, val.val[1]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1_u8_x2 + #define vst1_u8_x2(ptr, val) simde_vst1_u8_x2((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1_u16_x2(uint16_t ptr[HEDLEY_ARRAY_PARAM(8)], simde_uint16x4x2_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1_u16_x2(ptr, val); + #else + simde_vst1_u16(ptr, val.val[0]); + simde_vst1_u16(ptr+4, val.val[1]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1_u16_x2 + #define vst1_u16_x2(ptr, val) simde_vst1_u16_x2((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1_u32_x2(uint32_t ptr[HEDLEY_ARRAY_PARAM(4)], simde_uint32x2x2_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1_u32_x2(ptr, val); + #else + simde_vst1_u32(ptr, val.val[0]); + simde_vst1_u32(ptr+2, val.val[1]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1_u32_x2 + #define vst1_u32_x2(ptr, val) simde_vst1_u32_x2((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1_u64_x2(uint64_t ptr[HEDLEY_ARRAY_PARAM(2)], simde_uint64x1x2_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1_u64_x2(ptr, val); + #else + simde_vst1_u64(ptr, val.val[0]); + simde_vst1_u64(ptr+1, val.val[1]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1_u64_x2 + #define vst1_u64_x2(ptr, val) simde_vst1_u64_x2((ptr), (val)) +#endif + +#endif /* !defined(SIMDE_BUG_INTEL_857088) */ + +SIMDE_END_DECLS_ +HEDLEY_DIAGNOSTIC_POP + +#endif /* !defined(SIMDE_ARM_NEON_ST1_X2_H) */ diff --git a/simde/arm/neon/st1_x3.h b/simde/arm/neon/st1_x3.h new file mode 100644 index 000000000..7b85cfab1 --- /dev/null +++ b/simde/arm/neon/st1_x3.h @@ -0,0 +1,205 @@ +/* SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, + * modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Copyright: + * 2020 Evan Nemerson + * 2021 Décio Luiz Gazzoni Filho + * 2023 Yi-Yen Chung (Copyright owned by Andes Technology) + */ + +#if !defined(SIMDE_ARM_NEON_ST1_X3_H) +#define SIMDE_ARM_NEON_ST1_X3_H + +#include "types.h" + +HEDLEY_DIAGNOSTIC_PUSH +SIMDE_DISABLE_UNWANTED_DIAGNOSTICS +SIMDE_BEGIN_DECLS_ + +#if !defined(SIMDE_BUG_INTEL_857088) + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1_f32_x3(simde_float32 ptr[HEDLEY_ARRAY_PARAM(6)], simde_float32x2x3_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1_f32_x3(ptr, val); + #else + simde_vst1_f32(ptr, val.val[0]); + simde_vst1_f32(ptr+2, val.val[1]); + simde_vst1_f32(ptr+4, val.val[2]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1_f32_x3 + #define vst1_f32_x3(ptr, val) simde_vst1_f32_x3((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1_f64_x3(simde_float64 ptr[HEDLEY_ARRAY_PARAM(3)], simde_float64x1x3_t val) { + #if defined(SIMDE_ARM_NEON_A64V8_NATIVE) + vst1_f64_x3(ptr, val); + #else + simde_vst1_f64(ptr, val.val[0]); + simde_vst1_f64(ptr+1, val.val[1]); + simde_vst1_f64(ptr+2, val.val[2]); + #endif +} +#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES) + #undef vst1_f64_x3 + #define vst1_f64_x3(ptr, val) simde_vst1_f64_x3((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1_s8_x3(int8_t ptr[HEDLEY_ARRAY_PARAM(24)], simde_int8x8x3_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1_s8_x3(ptr, val); + #else + simde_vst1_s8(ptr, val.val[0]); + simde_vst1_s8(ptr+8, val.val[1]); + simde_vst1_s8(ptr+16, val.val[2]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1_s8_x3 + #define vst1_s8_x3(ptr, val) simde_vst1_s8_x3((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1_s16_x3(int16_t ptr[HEDLEY_ARRAY_PARAM(12)], simde_int16x4x3_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1_s16_x3(ptr, val); + #else + simde_vst1_s16(ptr, val.val[0]); + simde_vst1_s16(ptr+4, val.val[1]); + simde_vst1_s16(ptr+8, val.val[2]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1_s16_x3 + #define vst1_s16_x3(ptr, val) simde_vst1_s16_x3((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1_s32_x3(int32_t ptr[HEDLEY_ARRAY_PARAM(6)], simde_int32x2x3_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1_s32_x3(ptr, val); + #else + simde_vst1_s32(ptr, val.val[0]); + simde_vst1_s32(ptr+2, val.val[1]); + simde_vst1_s32(ptr+4, val.val[2]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1_s32_x3 + #define vst1_s32_x3(ptr, val) simde_vst1_s32_x3((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1_s64_x3(int64_t ptr[HEDLEY_ARRAY_PARAM(3)], simde_int64x1x3_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1_s64_x3(ptr, val); + #else + simde_vst1_s64(ptr, val.val[0]); + simde_vst1_s64(ptr+1, val.val[1]); + simde_vst1_s64(ptr+2, val.val[2]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1_s64_x3 + #define vst1_s64_x3(ptr, val) simde_vst1_s64_x3((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1_u8_x3(uint8_t ptr[HEDLEY_ARRAY_PARAM(24)], simde_uint8x8x3_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1_u8_x3(ptr, val); + #else + simde_vst1_u8(ptr, val.val[0]); + simde_vst1_u8(ptr+8, val.val[1]); + simde_vst1_u8(ptr+16, val.val[2]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1_u8_x3 + #define vst1_u8_x3(ptr, val) simde_vst1_u8_x3((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1_u16_x3(uint16_t ptr[HEDLEY_ARRAY_PARAM(12)], simde_uint16x4x3_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1_u16_x3(ptr, val); + #else + simde_vst1_u16(ptr, val.val[0]); + simde_vst1_u16(ptr+4, val.val[1]); + simde_vst1_u16(ptr+8, val.val[2]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1_u16_x3 + #define vst1_u16_x3(ptr, val) simde_vst1_u16_x3((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1_u32_x3(uint32_t ptr[HEDLEY_ARRAY_PARAM(6)], simde_uint32x2x3_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1_u32_x3(ptr, val); + #else + simde_vst1_u32(ptr, val.val[0]); + simde_vst1_u32(ptr+2, val.val[1]); + simde_vst1_u32(ptr+4, val.val[2]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1_u32_x3 + #define vst1_u32_x3(ptr, val) simde_vst1_u32_x3((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1_u64_x3(uint64_t ptr[HEDLEY_ARRAY_PARAM(3)], simde_uint64x1x3_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1_u64_x3(ptr, val); + #else + simde_vst1_u64(ptr, val.val[0]); + simde_vst1_u64(ptr+1, val.val[1]); + simde_vst1_u64(ptr+2, val.val[2]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1_u64_x3 + #define vst1_u64_x3(ptr, val) simde_vst1_u64_x3((ptr), (val)) +#endif + +#endif /* !defined(SIMDE_BUG_INTEL_857088) */ + +SIMDE_END_DECLS_ +HEDLEY_DIAGNOSTIC_POP + +#endif /* !defined(SIMDE_ARM_NEON_ST1_X3_H) */ diff --git a/simde/arm/neon/st1_x4.h b/simde/arm/neon/st1_x4.h new file mode 100644 index 000000000..b9b3497d1 --- /dev/null +++ b/simde/arm/neon/st1_x4.h @@ -0,0 +1,215 @@ +/* SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, + * modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Copyright: + * 2020 Evan Nemerson + * 2021 Décio Luiz Gazzoni Filho + * 2023 Yi-Yen Chung (Copyright owned by Andes Technology) + */ + +#if !defined(SIMDE_ARM_NEON_ST1_X4_H) +#define SIMDE_ARM_NEON_ST1_X4_H + +#include "types.h" + +HEDLEY_DIAGNOSTIC_PUSH +SIMDE_DISABLE_UNWANTED_DIAGNOSTICS +SIMDE_BEGIN_DECLS_ + +#if !defined(SIMDE_BUG_INTEL_857088) + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1_f32_x4(simde_float32 ptr[HEDLEY_ARRAY_PARAM(8)], simde_float32x2x4_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1_f32_x4(ptr, val); + #else + simde_vst1_f32(ptr, val.val[0]); + simde_vst1_f32(ptr+2, val.val[1]); + simde_vst1_f32(ptr+4, val.val[2]); + simde_vst1_f32(ptr+6, val.val[3]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1_f32_x4 + #define vst1_f32_x4(ptr, val) simde_vst1_f32_x4((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1_f64_x4(simde_float64 ptr[HEDLEY_ARRAY_PARAM(4)], simde_float64x1x4_t val) { + #if defined(SIMDE_ARM_NEON_A64V8_NATIVE) + vst1_f64_x4(ptr, val); + #else + simde_vst1_f64(ptr, val.val[0]); + simde_vst1_f64(ptr+1, val.val[1]); + simde_vst1_f64(ptr+2, val.val[2]); + simde_vst1_f64(ptr+3, val.val[3]); + #endif +} +#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES) + #undef vst1_f64_x4 + #define vst1_f64_x4(ptr, val) simde_vst1_f64_x4((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1_s8_x4(int8_t ptr[HEDLEY_ARRAY_PARAM(32)], simde_int8x8x4_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1_s8_x4(ptr, val); + #else + simde_vst1_s8(ptr, val.val[0]); + simde_vst1_s8(ptr+8, val.val[1]); + simde_vst1_s8(ptr+16, val.val[2]); + simde_vst1_s8(ptr+24, val.val[3]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1_s8_x4 + #define vst1_s8_x4(ptr, val) simde_vst1_s8_x4((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1_s16_x4(int16_t ptr[HEDLEY_ARRAY_PARAM(16)], simde_int16x4x4_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1_s16_x4(ptr, val); + #else + simde_vst1_s16(ptr, val.val[0]); + simde_vst1_s16(ptr+4, val.val[1]); + simde_vst1_s16(ptr+8, val.val[2]); + simde_vst1_s16(ptr+12, val.val[3]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1_s16_x4 + #define vst1_s16_x4(ptr, val) simde_vst1_s16_x4((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1_s32_x4(int32_t ptr[HEDLEY_ARRAY_PARAM(8)], simde_int32x2x4_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1_s32_x4(ptr, val); + #else + simde_vst1_s32(ptr, val.val[0]); + simde_vst1_s32(ptr+2, val.val[1]); + simde_vst1_s32(ptr+4, val.val[2]); + simde_vst1_s32(ptr+6, val.val[3]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1_s32_x4 + #define vst1_s32_x4(ptr, val) simde_vst1_s32_x4((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1_s64_x4(int64_t ptr[HEDLEY_ARRAY_PARAM(4)], simde_int64x1x4_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1_s64_x4(ptr, val); + #else + simde_vst1_s64(ptr, val.val[0]); + simde_vst1_s64(ptr+1, val.val[1]); + simde_vst1_s64(ptr+2, val.val[2]); + simde_vst1_s64(ptr+3, val.val[3]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1_s64_x4 + #define vst1_s64_x4(ptr, val) simde_vst1_s64_x4((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1_u8_x4(uint8_t ptr[HEDLEY_ARRAY_PARAM(32)], simde_uint8x8x4_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1_u8_x4(ptr, val); + #else + simde_vst1_u8(ptr, val.val[0]); + simde_vst1_u8(ptr+8, val.val[1]); + simde_vst1_u8(ptr+16, val.val[2]); + simde_vst1_u8(ptr+24, val.val[3]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1_u8_x4 + #define vst1_u8_x4(ptr, val) simde_vst1_u8_x4((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1_u16_x4(uint16_t ptr[HEDLEY_ARRAY_PARAM(16)], simde_uint16x4x4_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1_u16_x4(ptr, val); + #else + simde_vst1_u16(ptr, val.val[0]); + simde_vst1_u16(ptr+4, val.val[1]); + simde_vst1_u16(ptr+8, val.val[2]); + simde_vst1_u16(ptr+12, val.val[3]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1_u16_x4 + #define vst1_u16_x4(ptr, val) simde_vst1_u16_x4((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1_u32_x4(uint32_t ptr[HEDLEY_ARRAY_PARAM(8)], simde_uint32x2x4_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1_u32_x4(ptr, val); + #else + simde_vst1_u32(ptr, val.val[0]); + simde_vst1_u32(ptr+2, val.val[1]); + simde_vst1_u32(ptr+4, val.val[2]); + simde_vst1_u32(ptr+6, val.val[3]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1_u32_x4 + #define vst1_u32_x4(ptr, val) simde_vst1_u32_x4((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1_u64_x4(uint64_t ptr[HEDLEY_ARRAY_PARAM(4)], simde_uint64x1x4_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1_u64_x4(ptr, val); + #else + simde_vst1_u64(ptr, val.val[0]); + simde_vst1_u64(ptr+1, val.val[1]); + simde_vst1_u64(ptr+2, val.val[2]); + simde_vst1_u64(ptr+3, val.val[3]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1_u64_x4 + #define vst1_u64_x4(ptr, val) simde_vst1_u64_x4((ptr), (val)) +#endif + +#endif /* !defined(SIMDE_BUG_INTEL_857088) */ + +SIMDE_END_DECLS_ +HEDLEY_DIAGNOSTIC_POP + +#endif /* !defined(SIMDE_ARM_NEON_ST1_X4_H) */ diff --git a/simde/arm/neon/st1q_x2.h b/simde/arm/neon/st1q_x2.h new file mode 100644 index 000000000..a429fde9b --- /dev/null +++ b/simde/arm/neon/st1q_x2.h @@ -0,0 +1,195 @@ +/* SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, + * modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Copyright: + * 2020 Evan Nemerson + * 2021 Décio Luiz Gazzoni Filho + * 2023 Yi-Yen Chung (Copyright owned by Andes Technology) + */ + +#if !defined(SIMDE_ARM_NEON_ST1Q_X2_H) +#define SIMDE_ARM_NEON_ST1Q_X2_H + +#include "types.h" + +HEDLEY_DIAGNOSTIC_PUSH +SIMDE_DISABLE_UNWANTED_DIAGNOSTICS +SIMDE_BEGIN_DECLS_ + +#if !defined(SIMDE_BUG_INTEL_857088) + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1q_f32_x2(simde_float32 ptr[HEDLEY_ARRAY_PARAM(8)], simde_float32x4x2_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1q_f32_x2(ptr, val); + #else + simde_vst1q_f32(ptr, val.val[0]); + simde_vst1q_f32(ptr+4, val.val[1]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1q_f32_x2 + #define vst1q_f32_x2(ptr, val) simde_vst1q_f32_x2((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1q_f64_x2(simde_float64 ptr[HEDLEY_ARRAY_PARAM(4)], simde_float64x2x2_t val) { + #if defined(SIMDE_ARM_NEON_A64V8_NATIVE) + vst1q_f64_x2(ptr, val); + #else + simde_vst1q_f64(ptr, val.val[0]); + simde_vst1q_f64(ptr+2, val.val[1]); + #endif +} +#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES) + #undef vst1q_f64_x2 + #define vst1q_f64_x2(ptr, val) simde_vst1q_f64_x2((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1q_s8_x2(int8_t ptr[HEDLEY_ARRAY_PARAM(32)], simde_int8x16x2_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1q_s8_x2(ptr, val); + #else + simde_vst1q_s8(ptr, val.val[0]); + simde_vst1q_s8(ptr+16, val.val[1]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1q_s8_x2 + #define vst1q_s8_x2(ptr, val) simde_vst1q_s8_x2((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1q_s16_x2(int16_t ptr[HEDLEY_ARRAY_PARAM(16)], simde_int16x8x2_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1q_s16_x2(ptr, val); + #else + simde_vst1q_s16(ptr, val.val[0]); + simde_vst1q_s16(ptr+8, val.val[1]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1q_s16_x2 + #define vst1q_s16_x2(ptr, val) simde_vst1q_s16_x2((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1q_s32_x2(int32_t ptr[HEDLEY_ARRAY_PARAM(8)], simde_int32x4x2_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1q_s32_x2(ptr, val); + #else + simde_vst1q_s32(ptr, val.val[0]); + simde_vst1q_s32(ptr+4, val.val[1]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1q_s32_x2 + #define vst1q_s32_x2(ptr, val) simde_vst1q_s32_x2((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1q_s64_x2(int64_t ptr[HEDLEY_ARRAY_PARAM(4)], simde_int64x2x2_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1q_s64_x2(ptr, val); + #else + simde_vst1q_s64(ptr, val.val[0]); + simde_vst1q_s64(ptr+2, val.val[1]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1q_s64_x2 + #define vst1q_s64_x2(ptr, val) simde_vst1q_s64_x2((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1q_u8_x2(uint8_t ptr[HEDLEY_ARRAY_PARAM(32)], simde_uint8x16x2_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1q_u8_x2(ptr, val); + #else + simde_vst1q_u8(ptr, val.val[0]); + simde_vst1q_u8(ptr+16, val.val[1]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1q_u8_x2 + #define vst1q_u8_x2(ptr, val) simde_vst1q_u8_x2((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1q_u16_x2(uint16_t ptr[HEDLEY_ARRAY_PARAM(16)], simde_uint16x8x2_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1q_u16_x2(ptr, val); + #else + simde_vst1q_u16(ptr, val.val[0]); + simde_vst1q_u16(ptr+8, val.val[1]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1q_u16_x2 + #define vst1q_u16_x2(ptr, val) simde_vst1q_u16_x2((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1q_u32_x2(uint32_t ptr[HEDLEY_ARRAY_PARAM(8)], simde_uint32x4x2_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1q_u32_x2(ptr, val); + #else + simde_vst1q_u32(ptr, val.val[0]); + simde_vst1q_u32(ptr+4, val.val[1]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1q_u32_x2 + #define vst1q_u32_x2(ptr, val) simde_vst1q_u32_x2((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1q_u64_x2(uint64_t ptr[HEDLEY_ARRAY_PARAM(4)], simde_uint64x2x2_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1q_u64_x2(ptr, val); + #else + simde_vst1q_u64(ptr, val.val[0]); + simde_vst1q_u64(ptr+2, val.val[1]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1q_u64_x2 + #define vst1q_u64_x2(ptr, val) simde_vst1q_u64_x2((ptr), (val)) +#endif + +#endif /* !defined(SIMDE_BUG_INTEL_857088) */ + +SIMDE_END_DECLS_ +HEDLEY_DIAGNOSTIC_POP + +#endif /* !defined(SIMDE_ARM_NEON_ST1Q_X2_H) */ diff --git a/simde/arm/neon/st1q_x3.h b/simde/arm/neon/st1q_x3.h new file mode 100644 index 000000000..72ccfba6d --- /dev/null +++ b/simde/arm/neon/st1q_x3.h @@ -0,0 +1,205 @@ +/* SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, + * modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Copyright: + * 2020 Evan Nemerson + * 2021 Décio Luiz Gazzoni Filho + * 2023 Yi-Yen Chung (Copyright owned by Andes Technology) + */ + +#if !defined(SIMDE_ARM_NEON_ST1Q_X3_H) +#define SIMDE_ARM_NEON_ST1Q_X3_H + +#include "types.h" + +HEDLEY_DIAGNOSTIC_PUSH +SIMDE_DISABLE_UNWANTED_DIAGNOSTICS +SIMDE_BEGIN_DECLS_ + +#if !defined(SIMDE_BUG_INTEL_857088) + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1q_f32_x3(simde_float32 ptr[HEDLEY_ARRAY_PARAM(12)], simde_float32x4x3_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1q_f32_x3(ptr, val); + #else + simde_vst1q_f32(ptr, val.val[0]); + simde_vst1q_f32(ptr+4, val.val[1]); + simde_vst1q_f32(ptr+8, val.val[2]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1q_f32_x3 + #define vst1q_f32_x3(ptr, val) simde_vst1q_f32_x3((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1q_f64_x3(simde_float64 ptr[HEDLEY_ARRAY_PARAM(6)], simde_float64x2x3_t val) { + #if defined(SIMDE_ARM_NEON_A64V8_NATIVE) + vst1q_f64_x3(ptr, val); + #else + simde_vst1q_f64(ptr, val.val[0]); + simde_vst1q_f64(ptr+2, val.val[1]); + simde_vst1q_f64(ptr+4, val.val[2]); + #endif +} +#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES) + #undef vst1q_f64_x3 + #define vst1q_f64_x3(ptr, val) simde_vst1q_f64_x3((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1q_s8_x3(int8_t ptr[HEDLEY_ARRAY_PARAM(48)], simde_int8x16x3_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1q_s8_x3(ptr, val); + #else + simde_vst1q_s8(ptr, val.val[0]); + simde_vst1q_s8(ptr+16, val.val[1]); + simde_vst1q_s8(ptr+32, val.val[2]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1q_s8_x3 + #define vst1q_s8_x3(ptr, val) simde_vst1q_s8_x3((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1q_s16_x3(int16_t ptr[HEDLEY_ARRAY_PARAM(24)], simde_int16x8x3_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1q_s16_x3(ptr, val); + #else + simde_vst1q_s16(ptr, val.val[0]); + simde_vst1q_s16(ptr+8, val.val[1]); + simde_vst1q_s16(ptr+16, val.val[2]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1q_s16_x3 + #define vst1q_s16_x3(ptr, val) simde_vst1q_s16_x3((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1q_s32_x3(int32_t ptr[HEDLEY_ARRAY_PARAM(12)], simde_int32x4x3_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1q_s32_x3(ptr, val); + #else + simde_vst1q_s32(ptr, val.val[0]); + simde_vst1q_s32(ptr+4, val.val[1]); + simde_vst1q_s32(ptr+8, val.val[2]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1q_s32_x3 + #define vst1q_s32_x3(ptr, val) simde_vst1q_s32_x3((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1q_s64_x3(int64_t ptr[HEDLEY_ARRAY_PARAM(6)], simde_int64x2x3_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1q_s64_x3(ptr, val); + #else + simde_vst1q_s64(ptr, val.val[0]); + simde_vst1q_s64(ptr+2, val.val[1]); + simde_vst1q_s64(ptr+4, val.val[2]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1q_s64_x3 + #define vst1q_s64_x3(ptr, val) simde_vst1q_s64_x3((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1q_u8_x3(uint8_t ptr[HEDLEY_ARRAY_PARAM(48)], simde_uint8x16x3_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1q_u8_x3(ptr, val); + #else + simde_vst1q_u8(ptr, val.val[0]); + simde_vst1q_u8(ptr+16, val.val[1]); + simde_vst1q_u8(ptr+32, val.val[2]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1q_u8_x3 + #define vst1q_u8_x3(ptr, val) simde_vst1q_u8_x3((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1q_u16_x3(uint16_t ptr[HEDLEY_ARRAY_PARAM(24)], simde_uint16x8x3_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1q_u16_x3(ptr, val); + #else + simde_vst1q_u16(ptr, val.val[0]); + simde_vst1q_u16(ptr+8, val.val[1]); + simde_vst1q_u16(ptr+16, val.val[2]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1q_u16_x3 + #define vst1q_u16_x3(ptr, val) simde_vst1q_u16_x3((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1q_u32_x3(uint32_t ptr[HEDLEY_ARRAY_PARAM(12)], simde_uint32x4x3_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1q_u32_x3(ptr, val); + #else + simde_vst1q_u32(ptr, val.val[0]); + simde_vst1q_u32(ptr+4, val.val[1]); + simde_vst1q_u32(ptr+8, val.val[2]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1q_u32_x3 + #define vst1q_u32_x3(ptr, val) simde_vst1q_u32_x3((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1q_u64_x3(uint64_t ptr[HEDLEY_ARRAY_PARAM(6)], simde_uint64x2x3_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1q_u64_x3(ptr, val); + #else + simde_vst1q_u64(ptr, val.val[0]); + simde_vst1q_u64(ptr+2, val.val[1]); + simde_vst1q_u64(ptr+4, val.val[2]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1q_u64_x3 + #define vst1q_u64_x3(ptr, val) simde_vst1q_u64_x3((ptr), (val)) +#endif + +#endif /* !defined(SIMDE_BUG_INTEL_857088) */ + +SIMDE_END_DECLS_ +HEDLEY_DIAGNOSTIC_POP + +#endif /* !defined(SIMDE_ARM_NEON_ST1Q_X3_H) */ diff --git a/simde/arm/neon/st1q_x4.h b/simde/arm/neon/st1q_x4.h new file mode 100644 index 000000000..c52140444 --- /dev/null +++ b/simde/arm/neon/st1q_x4.h @@ -0,0 +1,215 @@ +/* SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, + * modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Copyright: + * 2020 Evan Nemerson + * 2021 Décio Luiz Gazzoni Filho + * 2023 Yi-Yen Chung (Copyright owned by Andes Technology) + */ + +#if !defined(SIMDE_ARM_NEON_ST1Q_X4_H) +#define SIMDE_ARM_NEON_ST1Q_X4_H + +#include "types.h" + +HEDLEY_DIAGNOSTIC_PUSH +SIMDE_DISABLE_UNWANTED_DIAGNOSTICS +SIMDE_BEGIN_DECLS_ + +#if !defined(SIMDE_BUG_INTEL_857088) + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1q_f32_x4(simde_float32 ptr[HEDLEY_ARRAY_PARAM(16)], simde_float32x4x4_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1q_f32_x4(ptr, val); + #else + simde_vst1q_f32(ptr, val.val[0]); + simde_vst1q_f32(ptr+4, val.val[1]); + simde_vst1q_f32(ptr+8, val.val[2]); + simde_vst1q_f32(ptr+12, val.val[3]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1q_f32_x4 + #define vst1q_f32_x4(ptr, val) simde_vst1q_f32_x4((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1q_f64_x4(simde_float64 ptr[HEDLEY_ARRAY_PARAM(8)], simde_float64x2x4_t val) { + #if defined(SIMDE_ARM_NEON_A64V8_NATIVE) + vst1q_f64_x4(ptr, val); + #else + simde_vst1q_f64(ptr, val.val[0]); + simde_vst1q_f64(ptr+2, val.val[1]); + simde_vst1q_f64(ptr+4, val.val[2]); + simde_vst1q_f64(ptr+6, val.val[3]); + #endif +} +#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES) + #undef vst1q_f64_x4 + #define vst1q_f64_x4(ptr, val) simde_vst1q_f64_x4((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1q_s8_x4(int8_t ptr[HEDLEY_ARRAY_PARAM(64)], simde_int8x16x4_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1q_s8_x4(ptr, val); + #else + simde_vst1q_s8(ptr, val.val[0]); + simde_vst1q_s8(ptr+16, val.val[1]); + simde_vst1q_s8(ptr+32, val.val[2]); + simde_vst1q_s8(ptr+48, val.val[3]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1q_s8_x4 + #define vst1q_s8_x4(ptr, val) simde_vst1q_s8_x4((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1q_s16_x4(int16_t ptr[HEDLEY_ARRAY_PARAM(32)], simde_int16x8x4_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1q_s16_x4(ptr, val); + #else + simde_vst1q_s16(ptr, val.val[0]); + simde_vst1q_s16(ptr+8, val.val[1]); + simde_vst1q_s16(ptr+16, val.val[2]); + simde_vst1q_s16(ptr+24, val.val[3]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1q_s16_x4 + #define vst1q_s16_x4(ptr, val) simde_vst1q_s16_x4((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1q_s32_x4(int32_t ptr[HEDLEY_ARRAY_PARAM(16)], simde_int32x4x4_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1q_s32_x4(ptr, val); + #else + simde_vst1q_s32(ptr, val.val[0]); + simde_vst1q_s32(ptr+4, val.val[1]); + simde_vst1q_s32(ptr+8, val.val[2]); + simde_vst1q_s32(ptr+12, val.val[3]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1q_s32_x4 + #define vst1q_s32_x4(ptr, val) simde_vst1q_s32_x4((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1q_s64_x4(int64_t ptr[HEDLEY_ARRAY_PARAM(8)], simde_int64x2x4_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1q_s64_x4(ptr, val); + #else + simde_vst1q_s64(ptr, val.val[0]); + simde_vst1q_s64(ptr+2, val.val[1]); + simde_vst1q_s64(ptr+4, val.val[2]); + simde_vst1q_s64(ptr+6, val.val[3]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1q_s64_x4 + #define vst1q_s64_x4(ptr, val) simde_vst1q_s64_x4((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1q_u8_x4(uint8_t ptr[HEDLEY_ARRAY_PARAM(64)], simde_uint8x16x4_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1q_u8_x4(ptr, val); + #else + simde_vst1q_u8(ptr, val.val[0]); + simde_vst1q_u8(ptr+16, val.val[1]); + simde_vst1q_u8(ptr+32, val.val[2]); + simde_vst1q_u8(ptr+48, val.val[3]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1q_u8_x4 + #define vst1q_u8_x4(ptr, val) simde_vst1q_u8_x4((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1q_u16_x4(uint16_t ptr[HEDLEY_ARRAY_PARAM(32)], simde_uint16x8x4_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1q_u16_x4(ptr, val); + #else + simde_vst1q_u16(ptr, val.val[0]); + simde_vst1q_u16(ptr+8, val.val[1]); + simde_vst1q_u16(ptr+16, val.val[2]); + simde_vst1q_u16(ptr+24, val.val[3]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1q_u16_x4 + #define vst1q_u16_x4(ptr, val) simde_vst1q_u16_x4((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1q_u32_x4(uint32_t ptr[HEDLEY_ARRAY_PARAM(16)], simde_uint32x4x4_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1q_u32_x4(ptr, val); + #else + simde_vst1q_u32(ptr, val.val[0]); + simde_vst1q_u32(ptr+4, val.val[1]); + simde_vst1q_u32(ptr+8, val.val[2]); + simde_vst1q_u32(ptr+12, val.val[3]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1q_u32_x4 + #define vst1q_u32_x4(ptr, val) simde_vst1q_u32_x4((ptr), (val)) +#endif + +SIMDE_FUNCTION_ATTRIBUTES +void +simde_vst1q_u64_x4(uint64_t ptr[HEDLEY_ARRAY_PARAM(8)], simde_uint64x2x4_t val) { + #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_BUG_GCC_REV_260989) + vst1q_u64_x4(ptr, val); + #else + simde_vst1q_u64(ptr, val.val[0]); + simde_vst1q_u64(ptr+2, val.val[1]); + simde_vst1q_u64(ptr+4, val.val[2]); + simde_vst1q_u64(ptr+6, val.val[3]); + #endif +} +#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) + #undef vst1q_u64_x4 + #define vst1q_u64_x4(ptr, val) simde_vst1q_u64_x4((ptr), (val)) +#endif + +#endif /* !defined(SIMDE_BUG_INTEL_857088) */ + +SIMDE_END_DECLS_ +HEDLEY_DIAGNOSTIC_POP + +#endif /* !defined(SIMDE_ARM_NEON_ST1Q_X4_H) */ diff --git a/simde/simde-common.h b/simde/simde-common.h index 30d11b5d1..58f4234ce 100644 --- a/simde/simde-common.h +++ b/simde/simde-common.h @@ -974,6 +974,9 @@ HEDLEY_DIAGNOSTIC_POP # if !HEDLEY_GCC_VERSION_CHECK(9,1,0) && defined(SIMDE_ARCH_AARCH64) # define SIMDE_BUG_GCC_REV_264019 # endif +# if (!HEDLEY_GCC_VERSION_CHECK(9,0,0) && !defined(SIMDE_ARCH_AARCH64)) || (!defined(SIMDE_ARCH_AARCH64) && defined(SIMDE_ARCH_ARM)) +# define SIMDE_BUG_GCC_REV_260989 +# endif # if defined(SIMDE_ARCH_ARM) # define SIMDE_BUG_GCC_95399 # define SIMDE_BUG_GCC_95471 diff --git a/test/arm/neon/st1_x2.c b/test/arm/neon/st1_x2.c new file mode 100644 index 000000000..327ab6614 --- /dev/null +++ b/test/arm/neon/st1_x2.c @@ -0,0 +1,742 @@ + +#include "test/test.h" +#define SIMDE_TEST_ARM_NEON_INSN st1_x2 +#include "test-neon.h" +#include "../../../simde/arm/neon/st1_x2.h" + +#if !defined(SIMDE_BUG_INTEL_857088) + +static int +test_simde_vst1_f32_x2 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + simde_float32 r[2][2]; + simde_float32 a[4]; + } test_vec[] = { + { + { { SIMDE_FLOAT32_C( 768.40), SIMDE_FLOAT32_C( 597.15) }, + { SIMDE_FLOAT32_C( 753.33), SIMDE_FLOAT32_C( -342.42) } }, + { SIMDE_FLOAT32_C( 768.40), SIMDE_FLOAT32_C( 597.15), SIMDE_FLOAT32_C( 753.33), SIMDE_FLOAT32_C( -342.42) } }, + { + { { SIMDE_FLOAT32_C( 56.78), SIMDE_FLOAT32_C( 403.46) }, + { SIMDE_FLOAT32_C( 878.90), SIMDE_FLOAT32_C( -758.81) } }, + { SIMDE_FLOAT32_C( 56.78), SIMDE_FLOAT32_C( 403.46), SIMDE_FLOAT32_C( 878.90), SIMDE_FLOAT32_C( -758.81) } }, + { + { { SIMDE_FLOAT32_C( 936.16), SIMDE_FLOAT32_C( 350.75) }, + { SIMDE_FLOAT32_C( -778.99), SIMDE_FLOAT32_C( 459.89) } }, + { SIMDE_FLOAT32_C( 936.16), SIMDE_FLOAT32_C( 350.75), SIMDE_FLOAT32_C( -778.99), SIMDE_FLOAT32_C( 459.89) } }, + { + { { SIMDE_FLOAT32_C( 642.14), SIMDE_FLOAT32_C( -227.01) }, + { SIMDE_FLOAT32_C( -808.03), SIMDE_FLOAT32_C( 325.65) } }, + { SIMDE_FLOAT32_C( 642.14), SIMDE_FLOAT32_C( -227.01), SIMDE_FLOAT32_C( -808.03), SIMDE_FLOAT32_C( 325.65) } }, + { + { { SIMDE_FLOAT32_C( -493.68), SIMDE_FLOAT32_C( -172.48) }, + { SIMDE_FLOAT32_C( -117.53), SIMDE_FLOAT32_C( 43.47) } }, + { SIMDE_FLOAT32_C( -493.68), SIMDE_FLOAT32_C( -172.48), SIMDE_FLOAT32_C( -117.53), SIMDE_FLOAT32_C( 43.47) } }, + { + { { SIMDE_FLOAT32_C( -505.19), SIMDE_FLOAT32_C( -46.35) }, + { SIMDE_FLOAT32_C( -685.91), SIMDE_FLOAT32_C( 845.53) } }, + { SIMDE_FLOAT32_C( -505.19), SIMDE_FLOAT32_C( -46.35), SIMDE_FLOAT32_C( -685.91), SIMDE_FLOAT32_C( 845.53) } }, + { + { { SIMDE_FLOAT32_C( 98.78), SIMDE_FLOAT32_C( -607.16) }, + { SIMDE_FLOAT32_C( -50.00), SIMDE_FLOAT32_C( 486.94) } }, + { SIMDE_FLOAT32_C( 98.78), SIMDE_FLOAT32_C( -607.16), SIMDE_FLOAT32_C( -50.00), SIMDE_FLOAT32_C( 486.94) } }, + { + { { SIMDE_FLOAT32_C( 338.30), SIMDE_FLOAT32_C( 908.46) }, + { SIMDE_FLOAT32_C( 930.53), SIMDE_FLOAT32_C( 106.71) } }, + { SIMDE_FLOAT32_C( 338.30), SIMDE_FLOAT32_C( 908.46), SIMDE_FLOAT32_C( 930.53), SIMDE_FLOAT32_C( 106.71) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_float32x2x2_t r_ = { { simde_vld1_f32(test_vec[i].r[0]), + simde_vld1_f32(test_vec[i].r[1]) } }; + + SIMDE_ALIGN_TO_16 simde_float32 a_[4]; + simde_vst1_f32_x2(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_float32x2_t a = simde_test_arm_neon_random_f32x2(-1000.0f, 1000.0f); + simde_float32x2_t b = simde_test_arm_neon_random_f32x2(-1000.0f, 1000.0f); + simde_float32x2x2_t c = {{a, b}}; + + simde_test_arm_neon_write_f32x2x2(2, c, SIMDE_TEST_VEC_POS_FIRST); + + simde_float32 buf[4]; + simde_vst1_f32_x2(buf, c); + + simde_test_codegen_write_vf32(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1_f64_x2 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + simde_float64 r[2][1]; + simde_float64 a[2]; + } test_vec[] = { + { + { { SIMDE_FLOAT64_C( 505.61) }, + { SIMDE_FLOAT64_C( 683.86) } }, + { SIMDE_FLOAT64_C( 505.61), SIMDE_FLOAT64_C( 683.86) } }, + { + { { SIMDE_FLOAT64_C( 764.28) }, + { SIMDE_FLOAT64_C( -437.62) } }, + { SIMDE_FLOAT64_C( 764.28), SIMDE_FLOAT64_C( -437.62) } }, + { + { { SIMDE_FLOAT64_C( 87.32) }, + { SIMDE_FLOAT64_C( 643.18) } }, + { SIMDE_FLOAT64_C( 87.32), SIMDE_FLOAT64_C( 643.18) } }, + { + { { SIMDE_FLOAT64_C( -196.43) }, + { SIMDE_FLOAT64_C( 23.48) } }, + { SIMDE_FLOAT64_C( -196.43), SIMDE_FLOAT64_C( 23.48) } }, + { + { { SIMDE_FLOAT64_C( -6.06) }, + { SIMDE_FLOAT64_C( 24.58) } }, + { SIMDE_FLOAT64_C( -6.06), SIMDE_FLOAT64_C( 24.58) } }, + { + { { SIMDE_FLOAT64_C( -516.63) }, + { SIMDE_FLOAT64_C( -363.92) } }, + { SIMDE_FLOAT64_C( -516.63), SIMDE_FLOAT64_C( -363.92) } }, + { + { { SIMDE_FLOAT64_C( 797.57) }, + { SIMDE_FLOAT64_C( -324.66) } }, + { SIMDE_FLOAT64_C( 797.57), SIMDE_FLOAT64_C( -324.66) } }, + { + { { SIMDE_FLOAT64_C( 961.74) }, + { SIMDE_FLOAT64_C( -696.12) } }, + { SIMDE_FLOAT64_C( 961.74), SIMDE_FLOAT64_C( -696.12) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_float64x1x2_t r_ = { { simde_vld1_f64(test_vec[i].r[0]), + simde_vld1_f64(test_vec[i].r[1]) } }; + + SIMDE_ALIGN_TO_16 simde_float64 a_[2]; + simde_vst1_f64_x2(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_float64x1_t a = simde_test_arm_neon_random_f64x1(-1000.0, 1000.0); + simde_float64x1_t b = simde_test_arm_neon_random_f64x1(-1000.0, 1000.0); + simde_float64x1x2_t c = {{a, b}}; + + simde_test_arm_neon_write_f64x1x2(2, c, SIMDE_TEST_VEC_POS_FIRST); + + simde_float64 buf[2]; + simde_vst1_f64_x2(buf, c); + + simde_test_codegen_write_vf64(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1_s8_x2 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + int8_t r[2][8]; + int8_t a[16]; + } test_vec[] = { + { + { { INT8_C( 52), -INT8_C( 99), -INT8_C( 89), -INT8_C( 70), INT8_C( 53), INT8_C( 9), INT8_C( 49), -INT8_C( 51) }, + { -INT8_C( 68), -INT8_C( 47), INT8_C( 120), -INT8_C( 17), -INT8_C( 15), INT8_C( 51), -INT8_C( 89), -INT8_C( 54) } }, + { INT8_C( 52), -INT8_C( 99), -INT8_C( 89), -INT8_C( 70), INT8_C( 53), INT8_C( 9), INT8_C( 49), -INT8_C( 51), + -INT8_C( 68), -INT8_C( 47), INT8_C( 120), -INT8_C( 17), -INT8_C( 15), INT8_C( 51), -INT8_C( 89), -INT8_C( 54) } }, + { + { { -INT8_C( 13), -INT8_C( 105), INT8_C( 108), INT8_C( 83), INT8_C( 9), -INT8_C( 18), INT8_C( 89), -INT8_C( 66) }, + { -INT8_C( 35), INT8_C( 62), INT8_C( 115), -INT8_C( 35), INT8_C( 111), -INT8_C( 68), INT8_C( 70), -INT8_C( 93) } }, + { -INT8_C( 13), -INT8_C( 105), INT8_C( 108), INT8_C( 83), INT8_C( 9), -INT8_C( 18), INT8_C( 89), -INT8_C( 66), + -INT8_C( 35), INT8_C( 62), INT8_C( 115), -INT8_C( 35), INT8_C( 111), -INT8_C( 68), INT8_C( 70), -INT8_C( 93) } }, + { + { { INT8_C( 89), -INT8_C( 19), INT8_C( 93), -INT8_C( 114), -INT8_C( 10), -INT8_C( 113), INT8_C( 92), -INT8_C( 77) }, + { INT8_C( 96), -INT8_C( 44), -INT8_C( 94), INT8_C( 81), INT8_C( 7), INT8_C( 73), INT8_C( 28), -INT8_C( 5) } }, + { INT8_C( 89), -INT8_C( 19), INT8_C( 93), -INT8_C( 114), -INT8_C( 10), -INT8_C( 113), INT8_C( 92), -INT8_C( 77), + INT8_C( 96), -INT8_C( 44), -INT8_C( 94), INT8_C( 81), INT8_C( 7), INT8_C( 73), INT8_C( 28), -INT8_C( 5) } }, + { + { { -INT8_C( 32), -INT8_C( 120), INT8_C( 78), -INT8_C( 23), INT8_C( 118), -INT8_C( 89), -INT8_C( 88), INT8_C( 83) }, + { -INT8_C( 26), INT8_C( 27), INT8_C( 49), INT8_C( 85), -INT8_C( 41), INT8_C( 119), -INT8_C( 8), INT8_C( 48) } }, + { -INT8_C( 32), -INT8_C( 120), INT8_C( 78), -INT8_C( 23), INT8_C( 118), -INT8_C( 89), -INT8_C( 88), INT8_C( 83), + -INT8_C( 26), INT8_C( 27), INT8_C( 49), INT8_C( 85), -INT8_C( 41), INT8_C( 119), -INT8_C( 8), INT8_C( 48) } }, + { + { { INT8_C( 100), INT8_C( 85), -INT8_C( 66), INT8_C( 90), -INT8_C( 28), INT8_C( 26), INT8_C( 13), INT8_C( 69) }, + { -INT8_C( 18), -INT8_C( 81), -INT8_C( 106), -INT8_C( 10), -INT8_C( 8), -INT8_C( 78), -INT8_C( 15), -INT8_C( 40) } }, + { INT8_C( 100), INT8_C( 85), -INT8_C( 66), INT8_C( 90), -INT8_C( 28), INT8_C( 26), INT8_C( 13), INT8_C( 69), + -INT8_C( 18), -INT8_C( 81), -INT8_C( 106), -INT8_C( 10), -INT8_C( 8), -INT8_C( 78), -INT8_C( 15), -INT8_C( 40) } }, + { + { { INT8_C( 58), INT8_C( 63), -INT8_C( 62), -INT8_C( 79), -INT8_C( 26), INT8_C( 106), INT8_C( 4), -INT8_C( 52) }, + { -INT8_C( 123), INT8_C( 53), INT8_C( 33), INT8_C( 92), -INT8_C( 84), INT8_C( 25), -INT8_C( 116), INT8_C( 16) } }, + { INT8_C( 58), INT8_C( 63), -INT8_C( 62), -INT8_C( 79), -INT8_C( 26), INT8_C( 106), INT8_C( 4), -INT8_C( 52), + -INT8_C( 123), INT8_C( 53), INT8_C( 33), INT8_C( 92), -INT8_C( 84), INT8_C( 25), -INT8_C( 116), INT8_C( 16) } }, + { + { { INT8_C( 111), INT8_C( 74), INT8_C( 107), INT8_C( 83), INT8_C( 101), INT8_C( 120), -INT8_C( 104), INT8_C( 83) }, + { INT8_C( 40), INT8_C( 47), INT8_C( 73), INT8_C( 32), -INT8_C( 31), INT8_C( 58), -INT8_C( 7), INT8_C( 28) } }, + { INT8_C( 111), INT8_C( 74), INT8_C( 107), INT8_C( 83), INT8_C( 101), INT8_C( 120), -INT8_C( 104), INT8_C( 83), + INT8_C( 40), INT8_C( 47), INT8_C( 73), INT8_C( 32), -INT8_C( 31), INT8_C( 58), -INT8_C( 7), INT8_C( 28) } }, + { + { { INT8_C( 121), -INT8_C( 69), -INT8_C( 51), INT8_C( 96), INT8_C( 37), -INT8_C( 47), INT8_C( 44), -INT8_C( 86) }, + { INT8_C( 7), INT8_C( 78), INT8_C( 6), -INT8_C( 77), INT8_C( 103), -INT8_C( 110), -INT8_C( 60), -INT8_C( 42) } }, + { INT8_C( 121), -INT8_C( 69), -INT8_C( 51), INT8_C( 96), INT8_C( 37), -INT8_C( 47), INT8_C( 44), -INT8_C( 86), + INT8_C( 7), INT8_C( 78), INT8_C( 6), -INT8_C( 77), INT8_C( 103), -INT8_C( 110), -INT8_C( 60), -INT8_C( 42) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_int8x8x2_t r_ = { { simde_vld1_s8(test_vec[i].r[0]), + simde_vld1_s8(test_vec[i].r[1]) } }; + + SIMDE_ALIGN_TO_16 int8_t a_[16]; + simde_vst1_s8_x2(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_int8x8_t a = simde_test_arm_neon_random_i8x8(); + simde_int8x8_t b = simde_test_arm_neon_random_i8x8(); + simde_int8x8x2_t c = {{a, b}}; + + simde_test_arm_neon_write_i8x8x2(2, c, SIMDE_TEST_VEC_POS_FIRST); + + int8_t buf[16]; + simde_vst1_s8_x2(buf, c); + + simde_test_codegen_write_vi8(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1_s16_x2 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + int16_t r[2][4]; + int16_t a[8]; + } test_vec[] = { + { + { { INT16_C( 12252), INT16_C( 16682), -INT16_C( 15705), -INT16_C( 12395) }, + { -INT16_C( 8463), -INT16_C( 11280), -INT16_C( 5863), -INT16_C( 27921) } }, + { INT16_C( 12252), INT16_C( 16682), -INT16_C( 15705), -INT16_C( 12395), -INT16_C( 8463), -INT16_C( 11280), -INT16_C( 5863), -INT16_C( 27921) } }, + { + { { -INT16_C( 17244), -INT16_C( 13838), INT16_C( 8077), -INT16_C( 27533) }, + { INT16_C( 31085), -INT16_C( 11192), INT16_C( 3083), -INT16_C( 6229) } }, + { -INT16_C( 17244), -INT16_C( 13838), INT16_C( 8077), -INT16_C( 27533), INT16_C( 31085), -INT16_C( 11192), INT16_C( 3083), -INT16_C( 6229) } }, + { + { { -INT16_C( 10949), -INT16_C( 7639), -INT16_C( 16745), -INT16_C( 30286) }, + { -INT16_C( 23908), -INT16_C( 19108), INT16_C( 19339), INT16_C( 12104) } }, + { -INT16_C( 10949), -INT16_C( 7639), -INT16_C( 16745), -INT16_C( 30286), -INT16_C( 23908), -INT16_C( 19108), INT16_C( 19339), INT16_C( 12104) } }, + { + { { INT16_C( 14855), -INT16_C( 27400), INT16_C( 27481), -INT16_C( 14807) }, + { INT16_C( 29156), -INT16_C( 4197), INT16_C( 18045), -INT16_C( 18218) } }, + { INT16_C( 14855), -INT16_C( 27400), INT16_C( 27481), -INT16_C( 14807), INT16_C( 29156), -INT16_C( 4197), INT16_C( 18045), -INT16_C( 18218) } }, + { + { { -INT16_C( 229), -INT16_C( 19814), INT16_C( 19645), INT16_C( 23099) }, + { -INT16_C( 26642), INT16_C( 30991), INT16_C( 22498), -INT16_C( 5720) } }, + { -INT16_C( 229), -INT16_C( 19814), INT16_C( 19645), INT16_C( 23099), -INT16_C( 26642), INT16_C( 30991), INT16_C( 22498), -INT16_C( 5720) } }, + { + { { -INT16_C( 24430), -INT16_C( 5250), -INT16_C( 22773), -INT16_C( 4174) }, + { INT16_C( 19736), -INT16_C( 27170), -INT16_C( 19053), -INT16_C( 20915) } }, + { -INT16_C( 24430), -INT16_C( 5250), -INT16_C( 22773), -INT16_C( 4174), INT16_C( 19736), -INT16_C( 27170), -INT16_C( 19053), -INT16_C( 20915) } }, + { + { { -INT16_C( 6220), INT16_C( 29280), -INT16_C( 25548), INT16_C( 8908) }, + { -INT16_C( 9421), INT16_C( 5788), INT16_C( 17459), -INT16_C( 14849) } }, + { -INT16_C( 6220), INT16_C( 29280), -INT16_C( 25548), INT16_C( 8908), -INT16_C( 9421), INT16_C( 5788), INT16_C( 17459), -INT16_C( 14849) } }, + { + { { INT16_C( 32229), -INT16_C( 3920), INT16_C( 25124), INT16_C( 15584) }, + { -INT16_C( 16721), INT16_C( 17105), INT16_C( 7795), INT16_C( 10480) } }, + { INT16_C( 32229), -INT16_C( 3920), INT16_C( 25124), INT16_C( 15584), -INT16_C( 16721), INT16_C( 17105), INT16_C( 7795), INT16_C( 10480) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_int16x4x2_t r_ = { { simde_vld1_s16(test_vec[i].r[0]), + simde_vld1_s16(test_vec[i].r[1]) } }; + + SIMDE_ALIGN_TO_16 int16_t a_[8]; + simde_vst1_s16_x2(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_int16x4_t a = simde_test_arm_neon_random_i16x4(); + simde_int16x4_t b = simde_test_arm_neon_random_i16x4(); + simde_int16x4x2_t c = {{a, b}}; + + simde_test_arm_neon_write_i16x4x2(2, c, SIMDE_TEST_VEC_POS_FIRST); + + int16_t buf[8]; + simde_vst1_s16_x2(buf, c); + + simde_test_codegen_write_vi16(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1_s32_x2 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + int32_t r[2][2]; + int32_t a[4]; + } test_vec[] = { + { + { { INT32_C( 983191814), INT32_C( 542926573) }, + { INT32_C( 1949759553), INT32_C( 574174781) } }, + { INT32_C( 983191814), INT32_C( 542926573), INT32_C( 1949759553), INT32_C( 574174781) } }, + { + { { -INT32_C( 669848909), -INT32_C( 65736116) }, + { INT32_C( 608102065), INT32_C( 172764932) } }, + { -INT32_C( 669848909), -INT32_C( 65736116), INT32_C( 608102065), INT32_C( 172764932) } }, + { + { { INT32_C( 1833232000), -INT32_C( 1903320756) }, + { -INT32_C( 704461671), -INT32_C( 1376240390) } }, + { INT32_C( 1833232000), -INT32_C( 1903320756), -INT32_C( 704461671), -INT32_C( 1376240390) } }, + { + { { INT32_C( 1921321766), -INT32_C( 1368483075) }, + { -INT32_C( 2066502272), INT32_C( 1552883676) } }, + { INT32_C( 1921321766), -INT32_C( 1368483075), -INT32_C( 2066502272), INT32_C( 1552883676) } }, + { + { { INT32_C( 1388958470), INT32_C( 249583220) }, + { INT32_C( 350544666), INT32_C( 1170398495) } }, + { INT32_C( 1388958470), INT32_C( 249583220), INT32_C( 350544666), INT32_C( 1170398495) } }, + { + { { -INT32_C( 440973336), INT32_C( 1637099233) }, + { -INT32_C( 1343854637), -INT32_C( 1945406074) } }, + { -INT32_C( 440973336), INT32_C( 1637099233), -INT32_C( 1343854637), -INT32_C( 1945406074) } }, + { + { { -INT32_C( 1109404600), INT32_C( 1170980650) }, + { -INT32_C( 1051086942), INT32_C( 1946557324) } }, + { -INT32_C( 1109404600), INT32_C( 1170980650), -INT32_C( 1051086942), INT32_C( 1946557324) } }, + { + { { INT32_C( 1146797667), -INT32_C( 1213796636) }, + { -INT32_C( 614036395), INT32_C( 1231581441) } }, + { INT32_C( 1146797667), -INT32_C( 1213796636), -INT32_C( 614036395), INT32_C( 1231581441) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_int32x2x2_t r_ = { { simde_vld1_s32(test_vec[i].r[0]), + simde_vld1_s32(test_vec[i].r[1]) } }; + + SIMDE_ALIGN_TO_16 int32_t a_[4]; + simde_vst1_s32_x2(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_int32x2_t a = simde_test_arm_neon_random_i32x2(); + simde_int32x2_t b = simde_test_arm_neon_random_i32x2(); + simde_int32x2x2_t c = {{a, b}}; + + simde_test_arm_neon_write_i32x2x2(2, c, SIMDE_TEST_VEC_POS_FIRST); + + int32_t buf[4]; + simde_vst1_s32_x2(buf, c); + + simde_test_codegen_write_vi32(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1_s64_x2 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + int64_t r[2][1]; + int64_t a[2]; + } test_vec[] = { + { + { { -INT64_C( 6218115359929120955) }, + { -INT64_C( 8321964740294603135) } }, + { -INT64_C( 6218115359929120955), -INT64_C( 8321964740294603135) } }, + { + { { INT64_C( 2290775070270938159) }, + { -INT64_C( 1851715428066643965) } }, + { INT64_C( 2290775070270938159), -INT64_C( 1851715428066643965) } }, + { + { { -INT64_C( 6460121033497815895) }, + { INT64_C( 7191745253025825560) } }, + { -INT64_C( 6460121033497815895), INT64_C( 7191745253025825560) } }, + { + { { INT64_C( 1872160537034792722) }, + { INT64_C( 141698839762302320) } }, + { INT64_C( 1872160537034792722), INT64_C( 141698839762302320) } }, + { + { { INT64_C( 8037247857611328958) }, + { -INT64_C( 8762176988276310322) } }, + { INT64_C( 8037247857611328958), -INT64_C( 8762176988276310322) } }, + { + { { -INT64_C( 8265128836134151139) }, + { -INT64_C( 7877755808021255853) } }, + { -INT64_C( 8265128836134151139), -INT64_C( 7877755808021255853) } }, + { + { { INT64_C( 3938680896281272035) }, + { -INT64_C( 704074638644651457) } }, + { INT64_C( 3938680896281272035), -INT64_C( 704074638644651457) } }, + { + { { INT64_C( 5559261608702221691) }, + { INT64_C( 4559513486039238111) } }, + { INT64_C( 5559261608702221691), INT64_C( 4559513486039238111) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_int64x1x2_t r_ = { { simde_vld1_s64(test_vec[i].r[0]), + simde_vld1_s64(test_vec[i].r[1]) } }; + + SIMDE_ALIGN_TO_16 int64_t a_[2]; + simde_vst1_s64_x2(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_int64x1_t a = simde_test_arm_neon_random_i64x1(); + simde_int64x1_t b = simde_test_arm_neon_random_i64x1(); + simde_int64x1x2_t c = {{a, b}}; + + simde_test_arm_neon_write_i64x1x2(2, c, SIMDE_TEST_VEC_POS_FIRST); + + int64_t buf[2]; + simde_vst1_s64_x2(buf, c); + + simde_test_codegen_write_vi64(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1_u8_x2 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + uint8_t r[2][8]; + uint8_t a[16]; + } test_vec[] = { + { + { { UINT8_C(230), UINT8_C( 67), UINT8_C( 45), UINT8_C(189), UINT8_C(130), UINT8_C( 30), UINT8_C( 47), UINT8_C(189) }, + { UINT8_C( 73), UINT8_C(156), UINT8_C( 80), UINT8_C(165), UINT8_C(146), UINT8_C( 90), UINT8_C( 22), UINT8_C( 30) } }, + { UINT8_C(230), UINT8_C( 67), UINT8_C( 45), UINT8_C(189), UINT8_C(130), UINT8_C( 30), UINT8_C( 47), UINT8_C(189), + UINT8_C( 73), UINT8_C(156), UINT8_C( 80), UINT8_C(165), UINT8_C(146), UINT8_C( 90), UINT8_C( 22), UINT8_C( 30) } }, + { + { { UINT8_C( 80), UINT8_C(137), UINT8_C( 8), UINT8_C(236), UINT8_C( 28), UINT8_C(181), UINT8_C(124), UINT8_C( 1) }, + { UINT8_C( 25), UINT8_C( 98), UINT8_C(112), UINT8_C( 11), UINT8_C(184), UINT8_C(206), UINT8_C(100), UINT8_C(158) } }, + { UINT8_C( 80), UINT8_C(137), UINT8_C( 8), UINT8_C(236), UINT8_C( 28), UINT8_C(181), UINT8_C(124), UINT8_C( 1), + UINT8_C( 25), UINT8_C( 98), UINT8_C(112), UINT8_C( 11), UINT8_C(184), UINT8_C(206), UINT8_C(100), UINT8_C(158) } }, + { + { { UINT8_C( 17), UINT8_C(145), UINT8_C( 91), UINT8_C(147), UINT8_C(175), UINT8_C(139), UINT8_C( 80), UINT8_C(249) }, + { UINT8_C( 39), UINT8_C(161), UINT8_C(158), UINT8_C(185), UINT8_C(251), UINT8_C(181), UINT8_C(216), UINT8_C( 75) } }, + { UINT8_C( 17), UINT8_C(145), UINT8_C( 91), UINT8_C(147), UINT8_C(175), UINT8_C(139), UINT8_C( 80), UINT8_C(249), + UINT8_C( 39), UINT8_C(161), UINT8_C(158), UINT8_C(185), UINT8_C(251), UINT8_C(181), UINT8_C(216), UINT8_C( 75) } }, + { + { { UINT8_C( 62), UINT8_C(224), UINT8_C( 55), UINT8_C( 90), UINT8_C(149), UINT8_C(180), UINT8_C( 91), UINT8_C(174) }, + { UINT8_C( 22), UINT8_C(203), UINT8_C(186), UINT8_C(206), UINT8_C(153), UINT8_C( 30), UINT8_C(109), UINT8_C(170) } }, + { UINT8_C( 62), UINT8_C(224), UINT8_C( 55), UINT8_C( 90), UINT8_C(149), UINT8_C(180), UINT8_C( 91), UINT8_C(174), + UINT8_C( 22), UINT8_C(203), UINT8_C(186), UINT8_C(206), UINT8_C(153), UINT8_C( 30), UINT8_C(109), UINT8_C(170) } }, + { + { { UINT8_C(175), UINT8_C(200), UINT8_C( 61), UINT8_C( 94), UINT8_C( 83), UINT8_C(142), UINT8_C( 87), UINT8_C(122) }, + { UINT8_C( 47), UINT8_C(246), UINT8_C( 52), UINT8_C( 42), UINT8_C(171), UINT8_C( 12), UINT8_C(117), UINT8_C(233) } }, + { UINT8_C(175), UINT8_C(200), UINT8_C( 61), UINT8_C( 94), UINT8_C( 83), UINT8_C(142), UINT8_C( 87), UINT8_C(122), + UINT8_C( 47), UINT8_C(246), UINT8_C( 52), UINT8_C( 42), UINT8_C(171), UINT8_C( 12), UINT8_C(117), UINT8_C(233) } }, + { + { { UINT8_C(236), UINT8_C(173), UINT8_C( 67), UINT8_C(129), UINT8_C( 97), UINT8_C(158), UINT8_C( 47), UINT8_C(119) }, + { UINT8_C(106), UINT8_C(233), UINT8_C( 70), UINT8_C( 3), UINT8_C( 7), UINT8_C(179), UINT8_C(174), UINT8_C(182) } }, + { UINT8_C(236), UINT8_C(173), UINT8_C( 67), UINT8_C(129), UINT8_C( 97), UINT8_C(158), UINT8_C( 47), UINT8_C(119), + UINT8_C(106), UINT8_C(233), UINT8_C( 70), UINT8_C( 3), UINT8_C( 7), UINT8_C(179), UINT8_C(174), UINT8_C(182) } }, + { + { { UINT8_C(123), UINT8_C(235), UINT8_C( 21), UINT8_C(207), UINT8_C(121), UINT8_C(108), UINT8_C( 73), UINT8_C(168) }, + { UINT8_C( 98), UINT8_C(125), UINT8_C(210), UINT8_C( 13), UINT8_C(137), UINT8_C( 72), UINT8_C(246), UINT8_C(117) } }, + { UINT8_C(123), UINT8_C(235), UINT8_C( 21), UINT8_C(207), UINT8_C(121), UINT8_C(108), UINT8_C( 73), UINT8_C(168), + UINT8_C( 98), UINT8_C(125), UINT8_C(210), UINT8_C( 13), UINT8_C(137), UINT8_C( 72), UINT8_C(246), UINT8_C(117) } }, + { + { { UINT8_C(245), UINT8_C( 57), UINT8_C(246), UINT8_C( 86), UINT8_C(216), UINT8_C( 38), UINT8_C(205), UINT8_C( 66) }, + { UINT8_C( 15), UINT8_C( 19), UINT8_C( 69), UINT8_C( 23), UINT8_C(198), UINT8_C(243), UINT8_C(205), UINT8_C( 66) } }, + { UINT8_C(245), UINT8_C( 57), UINT8_C(246), UINT8_C( 86), UINT8_C(216), UINT8_C( 38), UINT8_C(205), UINT8_C( 66), + UINT8_C( 15), UINT8_C( 19), UINT8_C( 69), UINT8_C( 23), UINT8_C(198), UINT8_C(243), UINT8_C(205), UINT8_C( 66) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_uint8x8x2_t r_ = { { simde_vld1_u8(test_vec[i].r[0]), + simde_vld1_u8(test_vec[i].r[1]) } }; + + SIMDE_ALIGN_TO_16 uint8_t a_[16]; + simde_vst1_u8_x2(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_uint8x8_t a = simde_test_arm_neon_random_u8x8(); + simde_uint8x8_t b = simde_test_arm_neon_random_u8x8(); + simde_uint8x8x2_t c = {{a, b}}; + + simde_test_arm_neon_write_u8x8x2(2, c, SIMDE_TEST_VEC_POS_FIRST); + + uint8_t buf[16]; + simde_vst1_u8_x2(buf, c); + + simde_test_codegen_write_vu8(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1_u16_x2 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + uint16_t r[2][4]; + uint16_t a[8]; + } test_vec[] = { + { + { { UINT16_C( 5790), UINT16_C(32356), UINT16_C(38547), UINT16_C(48772) }, + { UINT16_C(18976), UINT16_C( 882), UINT16_C(13574), UINT16_C(13707) } }, + { UINT16_C( 5790), UINT16_C(32356), UINT16_C(38547), UINT16_C(48772), UINT16_C(18976), UINT16_C( 882), UINT16_C(13574), UINT16_C(13707) } }, + { + { { UINT16_C(47046), UINT16_C(12838), UINT16_C(35580), UINT16_C(36186) }, + { UINT16_C(30369), UINT16_C(42558), UINT16_C(38313), UINT16_C(18297) } }, + { UINT16_C(47046), UINT16_C(12838), UINT16_C(35580), UINT16_C(36186), UINT16_C(30369), UINT16_C(42558), UINT16_C(38313), UINT16_C(18297) } }, + { + { { UINT16_C(56747), UINT16_C(16326), UINT16_C(19059), UINT16_C(37885) }, + { UINT16_C(28564), UINT16_C(39574), UINT16_C( 8612), UINT16_C(27344) } }, + { UINT16_C(56747), UINT16_C(16326), UINT16_C(19059), UINT16_C(37885), UINT16_C(28564), UINT16_C(39574), UINT16_C( 8612), UINT16_C(27344) } }, + { + { { UINT16_C(63192), UINT16_C(54685), UINT16_C(63360), UINT16_C( 8546) }, + { UINT16_C(41069), UINT16_C( 6088), UINT16_C(16694), UINT16_C(57694) } }, + { UINT16_C(63192), UINT16_C(54685), UINT16_C(63360), UINT16_C( 8546), UINT16_C(41069), UINT16_C( 6088), UINT16_C(16694), UINT16_C(57694) } }, + { + { { UINT16_C( 9246), UINT16_C(37408), UINT16_C( 7534), UINT16_C( 805) }, + { UINT16_C(48269), UINT16_C(12701), UINT16_C(28125), UINT16_C(46748) } }, + { UINT16_C( 9246), UINT16_C(37408), UINT16_C( 7534), UINT16_C( 805), UINT16_C(48269), UINT16_C(12701), UINT16_C(28125), UINT16_C(46748) } }, + { + { { UINT16_C(14691), UINT16_C(58251), UINT16_C(60720), UINT16_C(40197) }, + { UINT16_C(52622), UINT16_C(50356), UINT16_C( 4878), UINT16_C(11429) } }, + { UINT16_C(14691), UINT16_C(58251), UINT16_C(60720), UINT16_C(40197), UINT16_C(52622), UINT16_C(50356), UINT16_C( 4878), UINT16_C(11429) } }, + { + { { UINT16_C(50743), UINT16_C(42686), UINT16_C(58595), UINT16_C(28841) }, + { UINT16_C(18080), UINT16_C(32162), UINT16_C(16052), UINT16_C( 5939) } }, + { UINT16_C(50743), UINT16_C(42686), UINT16_C(58595), UINT16_C(28841), UINT16_C(18080), UINT16_C(32162), UINT16_C(16052), UINT16_C( 5939) } }, + { + { { UINT16_C(48759), UINT16_C(43003), UINT16_C( 172), UINT16_C(14916) }, + { UINT16_C(63949), UINT16_C(56318), UINT16_C(41740), UINT16_C(17159) } }, + { UINT16_C(48759), UINT16_C(43003), UINT16_C( 172), UINT16_C(14916), UINT16_C(63949), UINT16_C(56318), UINT16_C(41740), UINT16_C(17159) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_uint16x4x2_t r_ = { { simde_vld1_u16(test_vec[i].r[0]), + simde_vld1_u16(test_vec[i].r[1]) } }; + + SIMDE_ALIGN_TO_16 uint16_t a_[8]; + simde_vst1_u16_x2(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_uint16x4_t a = simde_test_arm_neon_random_u16x4(); + simde_uint16x4_t b = simde_test_arm_neon_random_u16x4(); + simde_uint16x4x2_t c = {{a, b}}; + + simde_test_arm_neon_write_u16x4x2(2, c, SIMDE_TEST_VEC_POS_FIRST); + + uint16_t buf[8]; + simde_vst1_u16_x2(buf, c); + + simde_test_codegen_write_vu16(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1_u32_x2 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + uint32_t r[2][2]; + uint32_t a[4]; + } test_vec[] = { + { + { { UINT32_C(1307166313), UINT32_C(1253937834) }, + { UINT32_C(2378653657), UINT32_C( 346356637) } }, + { UINT32_C(1307166313), UINT32_C(1253937834), UINT32_C(2378653657), UINT32_C( 346356637) } }, + { + { { UINT32_C(1706794937), UINT32_C(1822359711) }, + { UINT32_C( 88579577), UINT32_C(2856865601) } }, + { UINT32_C(1706794937), UINT32_C(1822359711), UINT32_C( 88579577), UINT32_C(2856865601) } }, + { + { { UINT32_C(3220648469), UINT32_C(2634659268) }, + { UINT32_C(2989150228), UINT32_C(2244399051) } }, + { UINT32_C(3220648469), UINT32_C(2634659268), UINT32_C(2989150228), UINT32_C(2244399051) } }, + { + { { UINT32_C( 250249838), UINT32_C(2071628418) }, + { UINT32_C(1753268775), UINT32_C( 638830609) } }, + { UINT32_C( 250249838), UINT32_C(2071628418), UINT32_C(1753268775), UINT32_C( 638830609) } }, + { + { { UINT32_C(3219458810), UINT32_C(3562860223) }, + { UINT32_C(2324072382), UINT32_C(3289336918) } }, + { UINT32_C(3219458810), UINT32_C(3562860223), UINT32_C(2324072382), UINT32_C(3289336918) } }, + { + { { UINT32_C(1356003790), UINT32_C(2882227587) }, + { UINT32_C( 538135311), UINT32_C( 239478292) } }, + { UINT32_C(1356003790), UINT32_C(2882227587), UINT32_C( 538135311), UINT32_C( 239478292) } }, + { + { { UINT32_C(4039977777), UINT32_C(3619957273) }, + { UINT32_C( 123816625), UINT32_C(1707831447) } }, + { UINT32_C(4039977777), UINT32_C(3619957273), UINT32_C( 123816625), UINT32_C(1707831447) } }, + { + { { UINT32_C(3988168298), UINT32_C(4204298731) }, + { UINT32_C(3776621773), UINT32_C( 66019538) } }, + { UINT32_C(3988168298), UINT32_C(4204298731), UINT32_C(3776621773), UINT32_C( 66019538) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_uint32x2x2_t r_ = { { simde_vld1_u32(test_vec[i].r[0]), + simde_vld1_u32(test_vec[i].r[1]) } }; + + SIMDE_ALIGN_TO_16 uint32_t a_[4]; + simde_vst1_u32_x2(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_uint32x2_t a = simde_test_arm_neon_random_u32x2(); + simde_uint32x2_t b = simde_test_arm_neon_random_u32x2(); + simde_uint32x2x2_t c = {{a, b}}; + + simde_test_arm_neon_write_u32x2x2(2, c, SIMDE_TEST_VEC_POS_FIRST); + + uint32_t buf[4]; + simde_vst1_u32_x2(buf, c); + + simde_test_codegen_write_vu32(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1_u64_x2 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + uint64_t r[2][1]; + uint64_t a[2]; + } test_vec[] = { + { + { { UINT64_C(10987579020944915851) }, + { UINT64_C(13258432709541223683) } }, + { UINT64_C(10987579020944915851), UINT64_C(13258432709541223683) } }, + { + { { UINT64_C( 355007256152356104) }, + { UINT64_C(17491933019746142185) } }, + { UINT64_C( 355007256152356104), UINT64_C(17491933019746142185) } }, + { + { { UINT64_C( 8002916794926281617) }, + { UINT64_C( 2518647000376389615) } }, + { UINT64_C( 8002916794926281617), UINT64_C( 2518647000376389615) } }, + { + { { UINT64_C(13905149546252900798) }, + { UINT64_C( 4928411004837879307) } }, + { UINT64_C(13905149546252900798), UINT64_C( 4928411004837879307) } }, + { + { { UINT64_C(18215597100110773231) }, + { UINT64_C(11076935179635905404) } }, + { UINT64_C(18215597100110773231), UINT64_C(11076935179635905404) } }, + { + { { UINT64_C(15950773318878941126) }, + { UINT64_C( 242267577883088997) } }, + { UINT64_C(15950773318878941126), UINT64_C( 242267577883088997) } }, + { + { { UINT64_C( 7114043528591579312) }, + { UINT64_C(16604966580718728187) } }, + { UINT64_C( 7114043528591579312), UINT64_C(16604966580718728187) } }, + { + { { UINT64_C(16947291165814947456) }, + { UINT64_C(16631616633563218104) } }, + { UINT64_C(16947291165814947456), UINT64_C(16631616633563218104) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_uint64x1x2_t r_ = { { simde_vld1_u64(test_vec[i].r[0]), + simde_vld1_u64(test_vec[i].r[1]) } }; + + SIMDE_ALIGN_TO_16 uint64_t a_[2]; + simde_vst1_u64_x2(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_uint64x1_t a = simde_test_arm_neon_random_u64x1(); + simde_uint64x1_t b = simde_test_arm_neon_random_u64x1(); + simde_uint64x1x2_t c = {{a, b}}; + + simde_test_arm_neon_write_u64x1x2(2, c, SIMDE_TEST_VEC_POS_FIRST); + + uint64_t buf[2]; + simde_vst1_u64_x2(buf, c); + + simde_test_codegen_write_vu64(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +#endif /* !defined(SIMDE_BUG_INTEL_857088) */ + +SIMDE_TEST_FUNC_LIST_BEGIN +#if !defined(SIMDE_BUG_INTEL_857088) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1_f32_x2) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1_f64_x2) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1_s8_x2) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1_s16_x2) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1_s32_x2) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1_s64_x2) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1_u8_x2) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1_u16_x2) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1_u32_x2) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1_u64_x2) +#endif /* !defined(SIMDE_BUG_INTEL_857088) */ +SIMDE_TEST_FUNC_LIST_END + +#include "test-neon-footer.h" diff --git a/test/arm/neon/st1_x3.c b/test/arm/neon/st1_x3.c new file mode 100644 index 000000000..8165ae5bc --- /dev/null +++ b/test/arm/neon/st1_x3.c @@ -0,0 +1,882 @@ + +#include "test/test.h" +#define SIMDE_TEST_ARM_NEON_INSN st1_x3 +#include "test-neon.h" +#include "../../../simde/arm/neon/st1_x3.h" + +#if !defined(SIMDE_BUG_INTEL_857088) + +static int +test_simde_vst1_f32_x3 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + simde_float32 r[3][2]; + simde_float32 a[6]; + } test_vec[] = { + { + { { SIMDE_FLOAT32_C( 146.01), SIMDE_FLOAT32_C( -889.05) }, + { SIMDE_FLOAT32_C( 962.13), SIMDE_FLOAT32_C( 530.25) }, + { SIMDE_FLOAT32_C( -129.82), SIMDE_FLOAT32_C( 952.84) } }, + { SIMDE_FLOAT32_C( 146.01), SIMDE_FLOAT32_C( -889.05), SIMDE_FLOAT32_C( 962.13), SIMDE_FLOAT32_C( 530.25), + SIMDE_FLOAT32_C( -129.82), SIMDE_FLOAT32_C( 952.84) } }, + { + { { SIMDE_FLOAT32_C( -520.62), SIMDE_FLOAT32_C( 248.83) }, + { SIMDE_FLOAT32_C( -761.06), SIMDE_FLOAT32_C( -988.57) }, + { SIMDE_FLOAT32_C( -830.55), SIMDE_FLOAT32_C( -351.49) } }, + { SIMDE_FLOAT32_C( -520.62), SIMDE_FLOAT32_C( 248.83), SIMDE_FLOAT32_C( -761.06), SIMDE_FLOAT32_C( -988.57), + SIMDE_FLOAT32_C( -830.55), SIMDE_FLOAT32_C( -351.49) } }, + { + { { SIMDE_FLOAT32_C( -860.29), SIMDE_FLOAT32_C( 301.63) }, + { SIMDE_FLOAT32_C( 467.74), SIMDE_FLOAT32_C( 663.11) }, + { SIMDE_FLOAT32_C( 572.60), SIMDE_FLOAT32_C( 37.59) } }, + { SIMDE_FLOAT32_C( -860.29), SIMDE_FLOAT32_C( 301.63), SIMDE_FLOAT32_C( 467.74), SIMDE_FLOAT32_C( 663.11), + SIMDE_FLOAT32_C( 572.60), SIMDE_FLOAT32_C( 37.59) } }, + { + { { SIMDE_FLOAT32_C( 3.56), SIMDE_FLOAT32_C( 801.90) }, + { SIMDE_FLOAT32_C( 170.26), SIMDE_FLOAT32_C( -137.39) }, + { SIMDE_FLOAT32_C( 789.73), SIMDE_FLOAT32_C( 293.65) } }, + { SIMDE_FLOAT32_C( 3.56), SIMDE_FLOAT32_C( 801.90), SIMDE_FLOAT32_C( 170.26), SIMDE_FLOAT32_C( -137.39), + SIMDE_FLOAT32_C( 789.73), SIMDE_FLOAT32_C( 293.65) } }, + { + { { SIMDE_FLOAT32_C( 296.66), SIMDE_FLOAT32_C( -773.54) }, + { SIMDE_FLOAT32_C( 693.95), SIMDE_FLOAT32_C( 373.73) }, + { SIMDE_FLOAT32_C( 48.70), SIMDE_FLOAT32_C( 530.76) } }, + { SIMDE_FLOAT32_C( 296.66), SIMDE_FLOAT32_C( -773.54), SIMDE_FLOAT32_C( 693.95), SIMDE_FLOAT32_C( 373.73), + SIMDE_FLOAT32_C( 48.70), SIMDE_FLOAT32_C( 530.76) } }, + { + { { SIMDE_FLOAT32_C( -291.99), SIMDE_FLOAT32_C( -805.30) }, + { SIMDE_FLOAT32_C( 641.71), SIMDE_FLOAT32_C( -329.86) }, + { SIMDE_FLOAT32_C( 724.96), SIMDE_FLOAT32_C( -488.11) } }, + { SIMDE_FLOAT32_C( -291.99), SIMDE_FLOAT32_C( -805.30), SIMDE_FLOAT32_C( 641.71), SIMDE_FLOAT32_C( -329.86), + SIMDE_FLOAT32_C( 724.96), SIMDE_FLOAT32_C( -488.11) } }, + { + { { SIMDE_FLOAT32_C( -377.02), SIMDE_FLOAT32_C( -795.66) }, + { SIMDE_FLOAT32_C( 760.72), SIMDE_FLOAT32_C( -138.08) }, + { SIMDE_FLOAT32_C( -784.23), SIMDE_FLOAT32_C( 930.17) } }, + { SIMDE_FLOAT32_C( -377.02), SIMDE_FLOAT32_C( -795.66), SIMDE_FLOAT32_C( 760.72), SIMDE_FLOAT32_C( -138.08), + SIMDE_FLOAT32_C( -784.23), SIMDE_FLOAT32_C( 930.17) } }, + { + { { SIMDE_FLOAT32_C( 510.43), SIMDE_FLOAT32_C( -644.52) }, + { SIMDE_FLOAT32_C( 231.80), SIMDE_FLOAT32_C( -21.82) }, + { SIMDE_FLOAT32_C( -981.41), SIMDE_FLOAT32_C( -195.60) } }, + { SIMDE_FLOAT32_C( 510.43), SIMDE_FLOAT32_C( -644.52), SIMDE_FLOAT32_C( 231.80), SIMDE_FLOAT32_C( -21.82), + SIMDE_FLOAT32_C( -981.41), SIMDE_FLOAT32_C( -195.60) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_float32x2x3_t r_ = { { simde_vld1_f32(test_vec[i].r[0]), + simde_vld1_f32(test_vec[i].r[1]), + simde_vld1_f32(test_vec[i].r[2]) } }; + + SIMDE_ALIGN_TO_16 simde_float32 a_[6]; + simde_vst1_f32_x3(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_float32x2_t a = simde_test_arm_neon_random_f32x2(-1000.0f, 1000.0f); + simde_float32x2_t b = simde_test_arm_neon_random_f32x2(-1000.0f, 1000.0f); + simde_float32x2_t c = simde_test_arm_neon_random_f32x2(-1000.0f, 1000.0f); + simde_float32x2x3_t d = {{a, b, c}}; + + simde_test_arm_neon_write_f32x2x3(2, d, SIMDE_TEST_VEC_POS_FIRST); + + simde_float32 buf[6]; + simde_vst1_f32_x3(buf, d); + + simde_test_codegen_write_vf32(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1_f64_x3 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + simde_float64 r[3][1]; + simde_float64 a[3]; + } test_vec[] = { + { + { { SIMDE_FLOAT64_C( -984.23) }, + { SIMDE_FLOAT64_C( 22.14) }, + { SIMDE_FLOAT64_C( -393.70) } }, + { SIMDE_FLOAT64_C( -984.23), SIMDE_FLOAT64_C( 22.14), SIMDE_FLOAT64_C( -393.70) } }, + { + { { SIMDE_FLOAT64_C( 186.03) }, + { SIMDE_FLOAT64_C( 884.75) }, + { SIMDE_FLOAT64_C( -603.97) } }, + { SIMDE_FLOAT64_C( 186.03), SIMDE_FLOAT64_C( 884.75), SIMDE_FLOAT64_C( -603.97) } }, + { + { { SIMDE_FLOAT64_C( -520.32) }, + { SIMDE_FLOAT64_C( 181.42) }, + { SIMDE_FLOAT64_C( -377.51) } }, + { SIMDE_FLOAT64_C( -520.32), SIMDE_FLOAT64_C( 181.42), SIMDE_FLOAT64_C( -377.51) } }, + { + { { SIMDE_FLOAT64_C( -826.37) }, + { SIMDE_FLOAT64_C( -444.85) }, + { SIMDE_FLOAT64_C( 671.18) } }, + { SIMDE_FLOAT64_C( -826.37), SIMDE_FLOAT64_C( -444.85), SIMDE_FLOAT64_C( 671.18) } }, + { + { { SIMDE_FLOAT64_C( 704.39) }, + { SIMDE_FLOAT64_C( 263.16) }, + { SIMDE_FLOAT64_C( 865.89) } }, + { SIMDE_FLOAT64_C( 704.39), SIMDE_FLOAT64_C( 263.16), SIMDE_FLOAT64_C( 865.89) } }, + { + { { SIMDE_FLOAT64_C( 346.10) }, + { SIMDE_FLOAT64_C( 933.30) }, + { SIMDE_FLOAT64_C( 590.84) } }, + { SIMDE_FLOAT64_C( 346.10), SIMDE_FLOAT64_C( 933.30), SIMDE_FLOAT64_C( 590.84) } }, + { + { { SIMDE_FLOAT64_C( 857.99) }, + { SIMDE_FLOAT64_C( -443.72) }, + { SIMDE_FLOAT64_C( 795.18) } }, + { SIMDE_FLOAT64_C( 857.99), SIMDE_FLOAT64_C( -443.72), SIMDE_FLOAT64_C( 795.18) } }, + { + { { SIMDE_FLOAT64_C( 618.71) }, + { SIMDE_FLOAT64_C( 418.20) }, + { SIMDE_FLOAT64_C( -989.05) } }, + { SIMDE_FLOAT64_C( 618.71), SIMDE_FLOAT64_C( 418.20), SIMDE_FLOAT64_C( -989.05) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_float64x1x3_t r_ = { { simde_vld1_f64(test_vec[i].r[0]), + simde_vld1_f64(test_vec[i].r[1]), + simde_vld1_f64(test_vec[i].r[2]) } }; + + SIMDE_ALIGN_TO_16 simde_float64 a_[3]; + simde_vst1_f64_x3(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_float64x1_t a = simde_test_arm_neon_random_f64x1(-1000.0, 1000.0); + simde_float64x1_t b = simde_test_arm_neon_random_f64x1(-1000.0, 1000.0); + simde_float64x1_t c = simde_test_arm_neon_random_f64x1(-1000.0, 1000.0); + simde_float64x1x3_t d = {{a, b, c}}; + + simde_test_arm_neon_write_f64x1x3(2, d, SIMDE_TEST_VEC_POS_FIRST); + + simde_float64 buf[3]; + simde_vst1_f64_x3(buf, d); + + simde_test_codegen_write_vf64(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1_s8_x3 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + int8_t r[3][8]; + int8_t a[24]; + } test_vec[] = { + { + { { INT8_C( 89), -INT8_C( 93), INT8_C( 125), -INT8_C( 4), INT8_C( 26), INT8_C( 11), -INT8_C( 4), -INT8_C( 78) }, + { INT8_C( 83), INT8_C( 54), -INT8_C( 19), INT8_C( 5), INT8_C( 77), INT8_C( 63), INT8_C( 112), -INT8_C( 68) }, + { INT8_C( 7), -INT8_C( 57), INT8_MAX, -INT8_C( 121), -INT8_C( 72), INT8_C( 26), INT8_C( 1), -INT8_C( 51) } }, + { INT8_C( 89), -INT8_C( 93), INT8_C( 125), -INT8_C( 4), INT8_C( 26), INT8_C( 11), -INT8_C( 4), -INT8_C( 78), + INT8_C( 83), INT8_C( 54), -INT8_C( 19), INT8_C( 5), INT8_C( 77), INT8_C( 63), INT8_C( 112), -INT8_C( 68), + INT8_C( 7), -INT8_C( 57), INT8_MAX, -INT8_C( 121), -INT8_C( 72), INT8_C( 26), INT8_C( 1), -INT8_C( 51) } }, + { + { { -INT8_C( 23), INT8_C( 41), INT8_C( 1), INT8_C( 29), -INT8_C( 97), -INT8_C( 79), INT8_C( 100), -INT8_C( 8) }, + { INT8_C( 84), -INT8_C( 31), -INT8_C( 11), INT8_C( 110), -INT8_C( 20), -INT8_C( 15), INT8_C( 33), INT8_C( 63) }, + { INT8_C( 39), INT8_C( 14), INT8_C( 68), INT8_C( 116), INT8_C( 77), -INT8_C( 76), INT8_C( 49), INT8_C( 85) } }, + { -INT8_C( 23), INT8_C( 41), INT8_C( 1), INT8_C( 29), -INT8_C( 97), -INT8_C( 79), INT8_C( 100), -INT8_C( 8), + INT8_C( 84), -INT8_C( 31), -INT8_C( 11), INT8_C( 110), -INT8_C( 20), -INT8_C( 15), INT8_C( 33), INT8_C( 63), + INT8_C( 39), INT8_C( 14), INT8_C( 68), INT8_C( 116), INT8_C( 77), -INT8_C( 76), INT8_C( 49), INT8_C( 85) } }, + { + { { INT8_C( 124), -INT8_C( 80), -INT8_C( 36), INT8_C( 52), -INT8_C( 54), -INT8_C( 35), INT8_C( 1), -INT8_C( 77) }, + { INT8_C( 6), INT8_C( 3), -INT8_C( 48), -INT8_C( 91), -INT8_C( 76), INT8_C( 52), -INT8_C( 98), INT8_C( 8) }, + { INT8_C( 21), -INT8_C( 109), INT8_C( 119), INT8_C( 1), -INT8_C( 124), -INT8_C( 104), INT8_C( 65), -INT8_C( 84) } }, + { INT8_C( 124), -INT8_C( 80), -INT8_C( 36), INT8_C( 52), -INT8_C( 54), -INT8_C( 35), INT8_C( 1), -INT8_C( 77), + INT8_C( 6), INT8_C( 3), -INT8_C( 48), -INT8_C( 91), -INT8_C( 76), INT8_C( 52), -INT8_C( 98), INT8_C( 8), + INT8_C( 21), -INT8_C( 109), INT8_C( 119), INT8_C( 1), -INT8_C( 124), -INT8_C( 104), INT8_C( 65), -INT8_C( 84) } }, + { + { { -INT8_C( 90), -INT8_C( 123), INT8_C( 32), -INT8_C( 13), INT8_C( 58), INT8_C( 81), INT8_C( 72), -INT8_C( 74) }, + { INT8_C( 1), INT8_C( 36), -INT8_C( 22), -INT8_C( 53), INT8_C( 1), -INT8_C( 20), INT8_MAX, INT8_C( 8) }, + { -INT8_C( 17), INT8_C( 79), -INT8_C( 83), -INT8_C( 93), -INT8_C( 124), INT8_C( 75), -INT8_C( 85), -INT8_C( 103) } }, + { -INT8_C( 90), -INT8_C( 123), INT8_C( 32), -INT8_C( 13), INT8_C( 58), INT8_C( 81), INT8_C( 72), -INT8_C( 74), + INT8_C( 1), INT8_C( 36), -INT8_C( 22), -INT8_C( 53), INT8_C( 1), -INT8_C( 20), INT8_MAX, INT8_C( 8), + -INT8_C( 17), INT8_C( 79), -INT8_C( 83), -INT8_C( 93), -INT8_C( 124), INT8_C( 75), -INT8_C( 85), -INT8_C( 103) } }, + { + { { -INT8_C( 34), INT8_C( 34), -INT8_C( 101), INT8_C( 99), -INT8_C( 70), -INT8_C( 36), INT8_C( 15), INT8_C( 96) }, + { INT8_C( 97), INT8_C( 47), INT8_C( 84), -INT8_C( 101), -INT8_C( 127), -INT8_C( 100), INT8_C( 81), -INT8_C( 126) }, + { -INT8_C( 63), INT8_C( 60), INT8_C( 78), -INT8_C( 62), INT8_C( 40), -INT8_C( 51), -INT8_C( 54), INT8_C( 23) } }, + { -INT8_C( 34), INT8_C( 34), -INT8_C( 101), INT8_C( 99), -INT8_C( 70), -INT8_C( 36), INT8_C( 15), INT8_C( 96), + INT8_C( 97), INT8_C( 47), INT8_C( 84), -INT8_C( 101), -INT8_C( 127), -INT8_C( 100), INT8_C( 81), -INT8_C( 126), + -INT8_C( 63), INT8_C( 60), INT8_C( 78), -INT8_C( 62), INT8_C( 40), -INT8_C( 51), -INT8_C( 54), INT8_C( 23) } }, + { + { { INT8_C( 28), INT8_C( 120), -INT8_C( 70), -INT8_C( 96), -INT8_C( 61), INT8_C( 101), INT8_C( 58), -INT8_C( 94) }, + { -INT8_C( 120), -INT8_C( 43), INT8_C( 5), INT8_C( 66), -INT8_C( 79), INT8_C( 20), -INT8_C( 93), INT8_C( 18) }, + { INT8_C( 67), -INT8_C( 9), -INT8_C( 82), -INT8_C( 60), -INT8_C( 109), -INT8_C( 1), INT8_C( 71), INT8_C( 84) } }, + { INT8_C( 28), INT8_C( 120), -INT8_C( 70), -INT8_C( 96), -INT8_C( 61), INT8_C( 101), INT8_C( 58), -INT8_C( 94), + -INT8_C( 120), -INT8_C( 43), INT8_C( 5), INT8_C( 66), -INT8_C( 79), INT8_C( 20), -INT8_C( 93), INT8_C( 18), + INT8_C( 67), -INT8_C( 9), -INT8_C( 82), -INT8_C( 60), -INT8_C( 109), -INT8_C( 1), INT8_C( 71), INT8_C( 84) } }, + { + { { INT8_C( 59), -INT8_C( 107), INT8_C( 23), INT8_C( 99), INT8_C( 98), -INT8_C( 31), INT8_C( 122), INT8_C( 126) }, + { INT8_C( 89), INT8_C( 52), INT8_C( 31), INT8_C( 29), -INT8_C( 102), INT8_C( 89), -INT8_C( 65), INT8_C( 34) }, + { INT8_C( 46), -INT8_C( 60), INT8_C( 100), -INT8_C( 33), -INT8_C( 40), INT8_C( 7), -INT8_C( 15), INT8_C( 27) } }, + { INT8_C( 59), -INT8_C( 107), INT8_C( 23), INT8_C( 99), INT8_C( 98), -INT8_C( 31), INT8_C( 122), INT8_C( 126), + INT8_C( 89), INT8_C( 52), INT8_C( 31), INT8_C( 29), -INT8_C( 102), INT8_C( 89), -INT8_C( 65), INT8_C( 34), + INT8_C( 46), -INT8_C( 60), INT8_C( 100), -INT8_C( 33), -INT8_C( 40), INT8_C( 7), -INT8_C( 15), INT8_C( 27) } }, + { + { { -INT8_C( 2), -INT8_C( 97), -INT8_C( 32), -INT8_C( 110), -INT8_C( 97), INT8_C( 39), -INT8_C( 26), -INT8_C( 38) }, + { -INT8_C( 68), -INT8_C( 3), INT8_C( 62), INT8_C( 30), -INT8_C( 33), -INT8_C( 72), -INT8_C( 100), INT8_C( 56) }, + { -INT8_C( 19), -INT8_C( 69), INT8_C( 85), -INT8_C( 121), INT8_C( 20), INT8_C( 20), -INT8_C( 87), INT8_C( 66) } }, + { -INT8_C( 2), -INT8_C( 97), -INT8_C( 32), -INT8_C( 110), -INT8_C( 97), INT8_C( 39), -INT8_C( 26), -INT8_C( 38), + -INT8_C( 68), -INT8_C( 3), INT8_C( 62), INT8_C( 30), -INT8_C( 33), -INT8_C( 72), -INT8_C( 100), INT8_C( 56), + -INT8_C( 19), -INT8_C( 69), INT8_C( 85), -INT8_C( 121), INT8_C( 20), INT8_C( 20), -INT8_C( 87), INT8_C( 66) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_int8x8x3_t r_ = { { simde_vld1_s8(test_vec[i].r[0]), + simde_vld1_s8(test_vec[i].r[1]), + simde_vld1_s8(test_vec[i].r[2]) } }; + + SIMDE_ALIGN_TO_16 int8_t a_[24]; + simde_vst1_s8_x3(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_int8x8_t a = simde_test_arm_neon_random_i8x8(); + simde_int8x8_t b = simde_test_arm_neon_random_i8x8(); + simde_int8x8_t c = simde_test_arm_neon_random_i8x8(); + simde_int8x8x3_t d = {{a, b, c}}; + + simde_test_arm_neon_write_i8x8x3(2, d, SIMDE_TEST_VEC_POS_FIRST); + + int8_t buf[24]; + simde_vst1_s8_x3(buf, d); + + simde_test_codegen_write_vi8(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1_s16_x3 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + int16_t r[3][4]; + int16_t a[12]; + } test_vec[] = { + { + { { INT16_C( 3544), -INT16_C( 20447), INT16_C( 4885), INT16_C( 5068) }, + { -INT16_C( 21326), INT16_C( 20901), -INT16_C( 29485), -INT16_C( 28884) }, + { INT16_C( 27273), INT16_C( 26797), INT16_C( 18722), INT16_C( 4001) } }, + { INT16_C( 3544), -INT16_C( 20447), INT16_C( 4885), INT16_C( 5068), -INT16_C( 21326), INT16_C( 20901), -INT16_C( 29485), -INT16_C( 28884), + INT16_C( 27273), INT16_C( 26797), INT16_C( 18722), INT16_C( 4001) } }, + { + { { -INT16_C( 2555), INT16_C( 6550), INT16_C( 16139), -INT16_C( 7332) }, + { INT16_C( 32077), INT16_C( 25236), INT16_C( 24720), INT16_C( 17269) }, + { INT16_C( 6924), -INT16_C( 8300), -INT16_C( 16217), INT16_C( 12398) } }, + { -INT16_C( 2555), INT16_C( 6550), INT16_C( 16139), -INT16_C( 7332), INT16_C( 32077), INT16_C( 25236), INT16_C( 24720), INT16_C( 17269), + INT16_C( 6924), -INT16_C( 8300), -INT16_C( 16217), INT16_C( 12398) } }, + { + { { INT16_C( 6954), INT16_C( 19865), INT16_C( 14948), INT16_C( 26972) }, + { -INT16_C( 3280), INT16_C( 15235), -INT16_C( 8398), INT16_C( 32543) }, + { -INT16_C( 19620), -INT16_C( 4639), INT16_C( 22291), INT16_C( 7984) } }, + { INT16_C( 6954), INT16_C( 19865), INT16_C( 14948), INT16_C( 26972), -INT16_C( 3280), INT16_C( 15235), -INT16_C( 8398), INT16_C( 32543), + -INT16_C( 19620), -INT16_C( 4639), INT16_C( 22291), INT16_C( 7984) } }, + { + { { -INT16_C( 15246), INT16_C( 6654), INT16_C( 27781), -INT16_C( 20663) }, + { -INT16_C( 7545), -INT16_C( 5124), INT16_C( 22812), INT16_C( 19797) }, + { -INT16_C( 10164), INT16_C( 32392), -INT16_C( 22601), INT16_C( 5118) } }, + { -INT16_C( 15246), INT16_C( 6654), INT16_C( 27781), -INT16_C( 20663), -INT16_C( 7545), -INT16_C( 5124), INT16_C( 22812), INT16_C( 19797), + -INT16_C( 10164), INT16_C( 32392), -INT16_C( 22601), INT16_C( 5118) } }, + { + { { -INT16_C( 8358), INT16_C( 27904), INT16_C( 12342), -INT16_C( 22388) }, + { -INT16_C( 29963), INT16_C( 31425), INT16_C( 3062), INT16_C( 32041) }, + { INT16_C( 9965), INT16_C( 2665), -INT16_C( 16769), -INT16_C( 13481) } }, + { -INT16_C( 8358), INT16_C( 27904), INT16_C( 12342), -INT16_C( 22388), -INT16_C( 29963), INT16_C( 31425), INT16_C( 3062), INT16_C( 32041), + INT16_C( 9965), INT16_C( 2665), -INT16_C( 16769), -INT16_C( 13481) } }, + { + { { -INT16_C( 8298), INT16_C( 19785), INT16_C( 18311), -INT16_C( 7840) }, + { INT16_C( 24871), INT16_C( 23887), -INT16_C( 9327), -INT16_C( 31226) }, + { -INT16_C( 14490), INT16_C( 23552), INT16_C( 10962), -INT16_C( 16166) } }, + { -INT16_C( 8298), INT16_C( 19785), INT16_C( 18311), -INT16_C( 7840), INT16_C( 24871), INT16_C( 23887), -INT16_C( 9327), -INT16_C( 31226), + -INT16_C( 14490), INT16_C( 23552), INT16_C( 10962), -INT16_C( 16166) } }, + { + { { INT16_C( 17232), -INT16_C( 12342), INT16_C( 8449), -INT16_C( 26726) }, + { -INT16_C( 7424), -INT16_C( 30748), INT16_C( 17451), INT16_C( 21097) }, + { -INT16_C( 18267), INT16_C( 14255), -INT16_C( 19053), -INT16_C( 1603) } }, + { INT16_C( 17232), -INT16_C( 12342), INT16_C( 8449), -INT16_C( 26726), -INT16_C( 7424), -INT16_C( 30748), INT16_C( 17451), INT16_C( 21097), + -INT16_C( 18267), INT16_C( 14255), -INT16_C( 19053), -INT16_C( 1603) } }, + { + { { -INT16_C( 16771), INT16_C( 20310), INT16_C( 12520), INT16_C( 14351) }, + { -INT16_C( 9869), INT16_C( 29703), -INT16_C( 24070), -INT16_C( 1269) }, + { -INT16_C( 4220), -INT16_C( 20606), -INT16_C( 5325), -INT16_C( 9983) } }, + { -INT16_C( 16771), INT16_C( 20310), INT16_C( 12520), INT16_C( 14351), -INT16_C( 9869), INT16_C( 29703), -INT16_C( 24070), -INT16_C( 1269), + -INT16_C( 4220), -INT16_C( 20606), -INT16_C( 5325), -INT16_C( 9983) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_int16x4x3_t r_ = { { simde_vld1_s16(test_vec[i].r[0]), + simde_vld1_s16(test_vec[i].r[1]), + simde_vld1_s16(test_vec[i].r[2]) } }; + + SIMDE_ALIGN_TO_16 int16_t a_[12]; + simde_vst1_s16_x3(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_int16x4_t a = simde_test_arm_neon_random_i16x4(); + simde_int16x4_t b = simde_test_arm_neon_random_i16x4(); + simde_int16x4_t c = simde_test_arm_neon_random_i16x4(); + simde_int16x4x3_t d = {{a, b, c}}; + + simde_test_arm_neon_write_i16x4x3(2, d, SIMDE_TEST_VEC_POS_FIRST); + + int16_t buf[12]; + simde_vst1_s16_x3(buf, d); + + simde_test_codegen_write_vi16(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1_s32_x3 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + int32_t r[3][2]; + int32_t a[6]; + } test_vec[] = { + { + { { INT32_C( 923840931), -INT32_C( 483340954) }, + { INT32_C( 1932756619), INT32_C( 699089590) }, + { INT32_C( 379433500), -INT32_C( 669931437) } }, + { INT32_C( 923840931), -INT32_C( 483340954), INT32_C( 1932756619), INT32_C( 699089590), INT32_C( 379433500), -INT32_C( 669931437) } }, + { + { { -INT32_C( 880307049), INT32_C( 597985663) }, + { -INT32_C( 1604668358), INT32_C( 226790017) }, + { -INT32_C( 947865839), INT32_C( 368127225) } }, + { -INT32_C( 880307049), INT32_C( 597985663), -INT32_C( 1604668358), INT32_C( 226790017), -INT32_C( 947865839), INT32_C( 368127225) } }, + { + { { INT32_C( 841780958), -INT32_C( 838189769) }, + { INT32_C( 1369018833), INT32_C( 1416903962) }, + { INT32_C( 1945489137), INT32_C( 1770027352) } }, + { INT32_C( 841780958), -INT32_C( 838189769), INT32_C( 1369018833), INT32_C( 1416903962), INT32_C( 1945489137), INT32_C( 1770027352) } }, + { + { { INT32_C( 691077168), INT32_C( 188686892) }, + { -INT32_C( 415405136), INT32_C( 2058766248) }, + { -INT32_C( 204779560), INT32_C( 2118598541) } }, + { INT32_C( 691077168), INT32_C( 188686892), -INT32_C( 415405136), INT32_C( 2058766248), -INT32_C( 204779560), INT32_C( 2118598541) } }, + { + { { INT32_C( 1710308365), -INT32_C( 439389771) }, + { -INT32_C( 1643184014), -INT32_C( 760656350) }, + { INT32_C( 1639638713), INT32_C( 115044397) } }, + { INT32_C( 1710308365), -INT32_C( 439389771), -INT32_C( 1643184014), -INT32_C( 760656350), INT32_C( 1639638713), INT32_C( 115044397) } }, + { + { { INT32_C( 1291429567), -INT32_C( 221560603) }, + { INT32_C( 844676221), -INT32_C( 1609029842) }, + { INT32_C( 1228810023), INT32_C( 773580917) } }, + { INT32_C( 1291429567), -INT32_C( 221560603), INT32_C( 844676221), -INT32_C( 1609029842), INT32_C( 1228810023), INT32_C( 773580917) } }, + { + { { -INT32_C( 57682482), INT32_C( 84044613) }, + { -INT32_C( 145622255), -INT32_C( 1192682437) }, + { INT32_C( 132858329), -INT32_C( 1884880024) } }, + { -INT32_C( 57682482), INT32_C( 84044613), -INT32_C( 145622255), -INT32_C( 1192682437), INT32_C( 132858329), -INT32_C( 1884880024) } }, + { + { { -INT32_C( 1613175510), -INT32_C( 1664224051) }, + { INT32_C( 261643465), -INT32_C( 652961081) }, + { -INT32_C( 791648875), INT32_C( 1535752578) } }, + { -INT32_C( 1613175510), -INT32_C( 1664224051), INT32_C( 261643465), -INT32_C( 652961081), -INT32_C( 791648875), INT32_C( 1535752578) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_int32x2x3_t r_ = { { simde_vld1_s32(test_vec[i].r[0]), + simde_vld1_s32(test_vec[i].r[1]), + simde_vld1_s32(test_vec[i].r[2]) } }; + + SIMDE_ALIGN_TO_16 int32_t a_[6]; + simde_vst1_s32_x3(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_int32x2_t a = simde_test_arm_neon_random_i32x2(); + simde_int32x2_t b = simde_test_arm_neon_random_i32x2(); + simde_int32x2_t c = simde_test_arm_neon_random_i32x2(); + simde_int32x2x3_t d = {{a, b, c}}; + + simde_test_arm_neon_write_i32x2x3(2, d, SIMDE_TEST_VEC_POS_FIRST); + + int32_t buf[6]; + simde_vst1_s32_x3(buf, d); + + simde_test_codegen_write_vi32(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1_s64_x3 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + int64_t r[3][1]; + int64_t a[3]; + } test_vec[] = { + { + { { -INT64_C( 6777062605889309445) }, + { -INT64_C( 8550068775414608914) }, + { INT64_C( 2236789874480443497) } }, + { -INT64_C( 6777062605889309445), -INT64_C( 8550068775414608914), INT64_C( 2236789874480443497) } }, + { + { { -INT64_C( 8147442100629153263) }, + { INT64_C( 5189524842729328876) }, + { -INT64_C( 4901785214574639952) } }, + { -INT64_C( 8147442100629153263), INT64_C( 5189524842729328876), -INT64_C( 4901785214574639952) } }, + { + { { INT64_C( 5689724449711755596) }, + { INT64_C( 5328550408659068112) }, + { INT64_C( 8773770502975906849) } }, + { INT64_C( 5689724449711755596), INT64_C( 5328550408659068112), INT64_C( 8773770502975906849) } }, + { + { { INT64_C( 7927146930988762870) }, + { -INT64_C( 5404537373448671629) }, + { -INT64_C( 3259468472918679266) } }, + { INT64_C( 7927146930988762870), -INT64_C( 5404537373448671629), -INT64_C( 3259468472918679266) } }, + { + { { INT64_C( 1814967295903887854) }, + { INT64_C( 8099552392999082710) }, + { INT64_C( 282072995980159825) } }, + { INT64_C( 1814967295903887854), INT64_C( 8099552392999082710), INT64_C( 282072995980159825) } }, + { + { { -INT64_C( 395118245000117760) }, + { -INT64_C( 5192400910743907916) }, + { INT64_C( 389586329994744060) } }, + { -INT64_C( 395118245000117760), -INT64_C( 5192400910743907916), INT64_C( 389586329994744060) } }, + { + { { -INT64_C( 6221118528968488510) }, + { INT64_C( 2175202792281155624) }, + { -INT64_C( 4735000909351362383) } }, + { -INT64_C( 6221118528968488510), INT64_C( 2175202792281155624), -INT64_C( 4735000909351362383) } }, + { + { { -INT64_C( 3319681722119358410) }, + { INT64_C( 8645260158755678632) }, + { -INT64_C( 1885923899033823926) } }, + { -INT64_C( 3319681722119358410), INT64_C( 8645260158755678632), -INT64_C( 1885923899033823926) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_int64x1x3_t r_ = { { simde_vld1_s64(test_vec[i].r[0]), + simde_vld1_s64(test_vec[i].r[1]), + simde_vld1_s64(test_vec[i].r[2]) } }; + + SIMDE_ALIGN_TO_16 int64_t a_[3]; + simde_vst1_s64_x3(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_int64x1_t a = simde_test_arm_neon_random_i64x1(); + simde_int64x1_t b = simde_test_arm_neon_random_i64x1(); + simde_int64x1_t c = simde_test_arm_neon_random_i64x1(); + simde_int64x1x3_t d = {{a, b, c}}; + + simde_test_arm_neon_write_i64x1x3(2, d, SIMDE_TEST_VEC_POS_FIRST); + + int64_t buf[3]; + simde_vst1_s64_x3(buf, d); + + simde_test_codegen_write_vi64(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1_u8_x3 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + uint8_t r[3][8]; + uint8_t a[24]; + } test_vec[] = { + { + { { UINT8_C(187), UINT8_C(200), UINT8_C(119), UINT8_C(125), UINT8_C(174), UINT8_C(192), UINT8_C( 60), UINT8_C(228) }, + { UINT8_C(185), UINT8_C(243), UINT8_C(205), UINT8_C(200), UINT8_C( 18), UINT8_C(188), UINT8_C(153), UINT8_C(187) }, + { UINT8_C(229), UINT8_C( 17), UINT8_C( 12), UINT8_C( 52), UINT8_C( 51), UINT8_C( 6), UINT8_C(171), UINT8_C(125) } }, + { UINT8_C(187), UINT8_C(200), UINT8_C(119), UINT8_C(125), UINT8_C(174), UINT8_C(192), UINT8_C( 60), UINT8_C(228), + UINT8_C(185), UINT8_C(243), UINT8_C(205), UINT8_C(200), UINT8_C( 18), UINT8_C(188), UINT8_C(153), UINT8_C(187), + UINT8_C(229), UINT8_C( 17), UINT8_C( 12), UINT8_C( 52), UINT8_C( 51), UINT8_C( 6), UINT8_C(171), UINT8_C(125) } }, + { + { { UINT8_C( 91), UINT8_C( 87), UINT8_C( 49), UINT8_C(143), UINT8_C( 49), UINT8_C( 4), UINT8_C(117), UINT8_C(236) }, + { UINT8_C(205), UINT8_C(236), UINT8_C(106), UINT8_C(123), UINT8_C(173), UINT8_C(166), UINT8_C( 95), UINT8_C(102) }, + { UINT8_C(153), UINT8_C( 44), UINT8_C( 46), UINT8_C(171), UINT8_C(232), UINT8_C(199), UINT8_C(102), UINT8_C(206) } }, + { UINT8_C( 91), UINT8_C( 87), UINT8_C( 49), UINT8_C(143), UINT8_C( 49), UINT8_C( 4), UINT8_C(117), UINT8_C(236), + UINT8_C(205), UINT8_C(236), UINT8_C(106), UINT8_C(123), UINT8_C(173), UINT8_C(166), UINT8_C( 95), UINT8_C(102), + UINT8_C(153), UINT8_C( 44), UINT8_C( 46), UINT8_C(171), UINT8_C(232), UINT8_C(199), UINT8_C(102), UINT8_C(206) } }, + { + { { UINT8_C(216), UINT8_C(114), UINT8_C( 2), UINT8_C( 11), UINT8_C(120), UINT8_C(174), UINT8_C(136), UINT8_C(211) }, + { UINT8_C( 5), UINT8_C(185), UINT8_C( 99), UINT8_C( 54), UINT8_C(190), UINT8_C(216), UINT8_C( 35), UINT8_C(139) }, + { UINT8_C(196), UINT8_C(141), UINT8_C( 6), UINT8_C(113), UINT8_C( 51), UINT8_C(101), UINT8_C(215), UINT8_C(204) } }, + { UINT8_C(216), UINT8_C(114), UINT8_C( 2), UINT8_C( 11), UINT8_C(120), UINT8_C(174), UINT8_C(136), UINT8_C(211), + UINT8_C( 5), UINT8_C(185), UINT8_C( 99), UINT8_C( 54), UINT8_C(190), UINT8_C(216), UINT8_C( 35), UINT8_C(139), + UINT8_C(196), UINT8_C(141), UINT8_C( 6), UINT8_C(113), UINT8_C( 51), UINT8_C(101), UINT8_C(215), UINT8_C(204) } }, + { + { { UINT8_C(145), UINT8_C( 5), UINT8_C(119), UINT8_C(122), UINT8_C(204), UINT8_C(222), UINT8_C( 72), UINT8_C(164) }, + { UINT8_C( 80), UINT8_C( 74), UINT8_C(175), UINT8_C(201), UINT8_C(248), UINT8_C( 55), UINT8_C(156), UINT8_C(253) }, + { UINT8_C(241), UINT8_MAX, UINT8_C( 52), UINT8_C(175), UINT8_C(215), UINT8_C( 87), UINT8_C( 58), UINT8_C(156) } }, + { UINT8_C(145), UINT8_C( 5), UINT8_C(119), UINT8_C(122), UINT8_C(204), UINT8_C(222), UINT8_C( 72), UINT8_C(164), + UINT8_C( 80), UINT8_C( 74), UINT8_C(175), UINT8_C(201), UINT8_C(248), UINT8_C( 55), UINT8_C(156), UINT8_C(253), + UINT8_C(241), UINT8_MAX, UINT8_C( 52), UINT8_C(175), UINT8_C(215), UINT8_C( 87), UINT8_C( 58), UINT8_C(156) } }, + { + { { UINT8_C(228), UINT8_C( 64), UINT8_C( 13), UINT8_C( 23), UINT8_C(165), UINT8_C(229), UINT8_C(227), UINT8_C( 54) }, + { UINT8_C(234), UINT8_C( 90), UINT8_C(176), UINT8_C(183), UINT8_C( 56), UINT8_C(248), UINT8_C( 91), UINT8_C(137) }, + { UINT8_C( 67), UINT8_C( 11), UINT8_C( 82), UINT8_C( 59), UINT8_C( 66), UINT8_C(238), UINT8_C( 57), UINT8_C( 51) } }, + { UINT8_C(228), UINT8_C( 64), UINT8_C( 13), UINT8_C( 23), UINT8_C(165), UINT8_C(229), UINT8_C(227), UINT8_C( 54), + UINT8_C(234), UINT8_C( 90), UINT8_C(176), UINT8_C(183), UINT8_C( 56), UINT8_C(248), UINT8_C( 91), UINT8_C(137), + UINT8_C( 67), UINT8_C( 11), UINT8_C( 82), UINT8_C( 59), UINT8_C( 66), UINT8_C(238), UINT8_C( 57), UINT8_C( 51) } }, + { + { { UINT8_C(238), UINT8_C(109), UINT8_C(226), UINT8_C(197), UINT8_C(196), UINT8_C( 28), UINT8_C( 97), UINT8_C(168) }, + { UINT8_C( 92), UINT8_C(111), UINT8_C(191), UINT8_C( 1), UINT8_C( 84), UINT8_C(162), UINT8_C( 56), UINT8_C( 62) }, + { UINT8_C(252), UINT8_C(232), UINT8_C(245), UINT8_C( 53), UINT8_C(225), UINT8_C( 81), UINT8_C(190), UINT8_C( 36) } }, + { UINT8_C(238), UINT8_C(109), UINT8_C(226), UINT8_C(197), UINT8_C(196), UINT8_C( 28), UINT8_C( 97), UINT8_C(168), + UINT8_C( 92), UINT8_C(111), UINT8_C(191), UINT8_C( 1), UINT8_C( 84), UINT8_C(162), UINT8_C( 56), UINT8_C( 62), + UINT8_C(252), UINT8_C(232), UINT8_C(245), UINT8_C( 53), UINT8_C(225), UINT8_C( 81), UINT8_C(190), UINT8_C( 36) } }, + { + { { UINT8_C( 92), UINT8_C( 16), UINT8_C( 95), UINT8_C(158), UINT8_C(254), UINT8_C(152), UINT8_C(210), UINT8_C(236) }, + { UINT8_C( 5), UINT8_C(180), UINT8_C(178), UINT8_C(201), UINT8_C(209), UINT8_C( 19), UINT8_C(113), UINT8_C( 45) }, + { UINT8_C(130), UINT8_C( 48), UINT8_C( 47), UINT8_C(214), UINT8_C(210), UINT8_C(103), UINT8_C( 21), UINT8_C(207) } }, + { UINT8_C( 92), UINT8_C( 16), UINT8_C( 95), UINT8_C(158), UINT8_C(254), UINT8_C(152), UINT8_C(210), UINT8_C(236), + UINT8_C( 5), UINT8_C(180), UINT8_C(178), UINT8_C(201), UINT8_C(209), UINT8_C( 19), UINT8_C(113), UINT8_C( 45), + UINT8_C(130), UINT8_C( 48), UINT8_C( 47), UINT8_C(214), UINT8_C(210), UINT8_C(103), UINT8_C( 21), UINT8_C(207) } }, + { + { { UINT8_C( 79), UINT8_C( 10), UINT8_C( 4), UINT8_C( 48), UINT8_C( 91), UINT8_C(194), UINT8_C( 84), UINT8_C(183) }, + { UINT8_C(210), UINT8_C(180), UINT8_C( 86), UINT8_C(208), UINT8_C( 76), UINT8_C( 40), UINT8_C(189), UINT8_C( 82) }, + { UINT8_C(220), UINT8_C(111), UINT8_C( 27), UINT8_C(173), UINT8_C(130), UINT8_C(141), UINT8_C(219), UINT8_C( 5) } }, + { UINT8_C( 79), UINT8_C( 10), UINT8_C( 4), UINT8_C( 48), UINT8_C( 91), UINT8_C(194), UINT8_C( 84), UINT8_C(183), + UINT8_C(210), UINT8_C(180), UINT8_C( 86), UINT8_C(208), UINT8_C( 76), UINT8_C( 40), UINT8_C(189), UINT8_C( 82), + UINT8_C(220), UINT8_C(111), UINT8_C( 27), UINT8_C(173), UINT8_C(130), UINT8_C(141), UINT8_C(219), UINT8_C( 5) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_uint8x8x3_t r_ = { { simde_vld1_u8(test_vec[i].r[0]), + simde_vld1_u8(test_vec[i].r[1]), + simde_vld1_u8(test_vec[i].r[2]) } }; + + SIMDE_ALIGN_TO_16 uint8_t a_[24]; + simde_vst1_u8_x3(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_uint8x8_t a = simde_test_arm_neon_random_u8x8(); + simde_uint8x8_t b = simde_test_arm_neon_random_u8x8(); + simde_uint8x8_t c = simde_test_arm_neon_random_u8x8(); + simde_uint8x8x3_t d = {{a, b, c}}; + + simde_test_arm_neon_write_u8x8x3(2, d, SIMDE_TEST_VEC_POS_FIRST); + + uint8_t buf[24]; + simde_vst1_u8_x3(buf, d); + + simde_test_codegen_write_vu8(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1_u16_x3 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + uint16_t r[3][4]; + uint16_t a[12]; + } test_vec[] = { + { + { { UINT16_C( 2749), UINT16_C(37083), UINT16_C(61553), UINT16_C(49247) }, + { UINT16_C(25595), UINT16_C(22257), UINT16_C(17701), UINT16_C(63246) }, + { UINT16_C(25849), UINT16_C(18119), UINT16_C(33932), UINT16_C(26776) } }, + { UINT16_C( 2749), UINT16_C(37083), UINT16_C(61553), UINT16_C(49247), UINT16_C(25595), UINT16_C(22257), UINT16_C(17701), UINT16_C(63246), + UINT16_C(25849), UINT16_C(18119), UINT16_C(33932), UINT16_C(26776) } }, + { + { { UINT16_C(46067), UINT16_C(30230), UINT16_C(61760), UINT16_C(65147) }, + { UINT16_C(22267), UINT16_C(27790), UINT16_C(60743), UINT16_C(16940) }, + { UINT16_C( 7504), UINT16_C(30104), UINT16_C(42595), UINT16_C(23660) } }, + { UINT16_C(46067), UINT16_C(30230), UINT16_C(61760), UINT16_C(65147), UINT16_C(22267), UINT16_C(27790), UINT16_C(60743), UINT16_C(16940), + UINT16_C( 7504), UINT16_C(30104), UINT16_C(42595), UINT16_C(23660) } }, + { + { { UINT16_C(13066), UINT16_C(38562), UINT16_C(15032), UINT16_C(44031) }, + { UINT16_C( 5614), UINT16_C(11809), UINT16_C(39942), UINT16_C( 300) }, + { UINT16_C(47859), UINT16_C(14957), UINT16_C(39335), UINT16_C(63356) } }, + { UINT16_C(13066), UINT16_C(38562), UINT16_C(15032), UINT16_C(44031), UINT16_C( 5614), UINT16_C(11809), UINT16_C(39942), UINT16_C( 300), + UINT16_C(47859), UINT16_C(14957), UINT16_C(39335), UINT16_C(63356) } }, + { + { { UINT16_C( 5303), UINT16_C( 6764), UINT16_C(55483), UINT16_C(50550) }, + { UINT16_C( 6412), UINT16_C(50268), UINT16_C(23379), UINT16_C(16751) }, + { UINT16_C(37232), UINT16_C(30320), UINT16_C(39981), UINT16_C( 8311) } }, + { UINT16_C( 5303), UINT16_C( 6764), UINT16_C(55483), UINT16_C(50550), UINT16_C( 6412), UINT16_C(50268), UINT16_C(23379), UINT16_C(16751), + UINT16_C(37232), UINT16_C(30320), UINT16_C(39981), UINT16_C( 8311) } }, + { + { { UINT16_C(58455), UINT16_C(65114), UINT16_C(54909), UINT16_C(13558) }, + { UINT16_C(25323), UINT16_C(42574), UINT16_C(50491), UINT16_C(18283) }, + { UINT16_C(51166), UINT16_C(12555), UINT16_C(31266), UINT16_C(37491) } }, + { UINT16_C(58455), UINT16_C(65114), UINT16_C(54909), UINT16_C(13558), UINT16_C(25323), UINT16_C(42574), UINT16_C(50491), UINT16_C(18283), + UINT16_C(51166), UINT16_C(12555), UINT16_C(31266), UINT16_C(37491) } }, + { + { { UINT16_C(58123), UINT16_C(14600), UINT16_C(32639), UINT16_C(54873) }, + { UINT16_C(46179), UINT16_C(57813), UINT16_C(52106), UINT16_C(29973) }, + { UINT16_C(25645), UINT16_C(26651), UINT16_C(34601), UINT16_C( 1967) } }, + { UINT16_C(58123), UINT16_C(14600), UINT16_C(32639), UINT16_C(54873), UINT16_C(46179), UINT16_C(57813), UINT16_C(52106), UINT16_C(29973), + UINT16_C(25645), UINT16_C(26651), UINT16_C(34601), UINT16_C( 1967) } }, + { + { { UINT16_C(47694), UINT16_C(28984), UINT16_C(43829), UINT16_C(16387) }, + { UINT16_C( 3214), UINT16_C( 3705), UINT16_C(54155), UINT16_C(61412) }, + { UINT16_C(47495), UINT16_C( 4560), UINT16_C(58756), UINT16_C(45703) } }, + { UINT16_C(47694), UINT16_C(28984), UINT16_C(43829), UINT16_C(16387), UINT16_C( 3214), UINT16_C( 3705), UINT16_C(54155), UINT16_C(61412), + UINT16_C(47495), UINT16_C( 4560), UINT16_C(58756), UINT16_C(45703) } }, + { + { { UINT16_C(41545), UINT16_C(29210), UINT16_C(51753), UINT16_C(30841) }, + { UINT16_C(45700), UINT16_C(47593), UINT16_C(60509), UINT16_C(60666) }, + { UINT16_C(29688), UINT16_C(34042), UINT16_C(56902), UINT16_C(52595) } }, + { UINT16_C(41545), UINT16_C(29210), UINT16_C(51753), UINT16_C(30841), UINT16_C(45700), UINT16_C(47593), UINT16_C(60509), UINT16_C(60666), + UINT16_C(29688), UINT16_C(34042), UINT16_C(56902), UINT16_C(52595) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_uint16x4x3_t r_ = { { simde_vld1_u16(test_vec[i].r[0]), + simde_vld1_u16(test_vec[i].r[1]), + simde_vld1_u16(test_vec[i].r[2]) } }; + + SIMDE_ALIGN_TO_16 uint16_t a_[12]; + simde_vst1_u16_x3(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_uint16x4_t a = simde_test_arm_neon_random_u16x4(); + simde_uint16x4_t b = simde_test_arm_neon_random_u16x4(); + simde_uint16x4_t c = simde_test_arm_neon_random_u16x4(); + simde_uint16x4x3_t d = {{a, b, c}}; + + simde_test_arm_neon_write_u16x4x3(2, d, SIMDE_TEST_VEC_POS_FIRST); + + uint16_t buf[12]; + simde_vst1_u16_x3(buf, d); + + simde_test_codegen_write_vu16(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1_u32_x3 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + uint32_t r[3][2]; + uint32_t a[6]; + } test_vec[] = { + { + { { UINT32_C( 484393880), UINT32_C(1926129192) }, + { UINT32_C( 853862664), UINT32_C( 933912243) }, + { UINT32_C(1844548368), UINT32_C(2019158911) } }, + { UINT32_C( 484393880), UINT32_C(1926129192), UINT32_C( 853862664), UINT32_C( 933912243), UINT32_C(1844548368), UINT32_C(2019158911) } }, + { + { { UINT32_C(2784777054), UINT32_C(3396497202) }, + { UINT32_C(3672527282), UINT32_C(3226252727) }, + { UINT32_C(1374826910), UINT32_C(2676530319) } }, + { UINT32_C(2784777054), UINT32_C(3396497202), UINT32_C(3672527282), UINT32_C(3226252727), UINT32_C(1374826910), UINT32_C(2676530319) } }, + { + { { UINT32_C(2920053039), UINT32_C(3274073700) }, + { UINT32_C(3949470393), UINT32_C(1135991441) }, + { UINT32_C(3810434092), UINT32_C(4020464209) } }, + { UINT32_C(2920053039), UINT32_C(3274073700), UINT32_C(3949470393), UINT32_C(1135991441), UINT32_C(3810434092), UINT32_C(4020464209) } }, + { + { { UINT32_C( 708875675), UINT32_C(1623836721) }, + { UINT32_C(2786055746), UINT32_C(4117312828) }, + { UINT32_C(3923890520), UINT32_C(3626866348) } }, + { UINT32_C( 708875675), UINT32_C(1623836721), UINT32_C(2786055746), UINT32_C(4117312828), UINT32_C(3923890520), UINT32_C(3626866348) } }, + { + { { UINT32_C(2210089778), UINT32_C(1366450101) }, + { UINT32_C( 645640948), UINT32_C(3179693435) }, + { UINT32_C(1466144027), UINT32_C( 592235979) } }, + { UINT32_C(2210089778), UINT32_C(1366450101), UINT32_C( 645640948), UINT32_C(3179693435), UINT32_C(1466144027), UINT32_C( 592235979) } }, + { + { { UINT32_C(1242312094), UINT32_C(4129438148) }, + { UINT32_C( 981130884), UINT32_C( 831253565) }, + { UINT32_C( 441910943), UINT32_C(1725423179) } }, + { UINT32_C(1242312094), UINT32_C(4129438148), UINT32_C( 981130884), UINT32_C( 831253565), UINT32_C( 441910943), UINT32_C(1725423179) } }, + { + { { UINT32_C(1052588659), UINT32_C(2791377415) }, + { UINT32_C(4226838071), UINT32_C( 754062247) }, + { UINT32_C( 778464497), UINT32_C(4150260056) } }, + { UINT32_C(1052588659), UINT32_C(2791377415), UINT32_C(4226838071), UINT32_C( 754062247), UINT32_C( 778464497), UINT32_C(4150260056) } }, + { + { { UINT32_C(1125234679), UINT32_C( 145352853) }, + { UINT32_C( 709322531), UINT32_C(2832246897) }, + { UINT32_C(3198468374), UINT32_C(3320485588) } }, + { UINT32_C(1125234679), UINT32_C( 145352853), UINT32_C( 709322531), UINT32_C(2832246897), UINT32_C(3198468374), UINT32_C(3320485588) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_uint32x2x3_t r_ = { { simde_vld1_u32(test_vec[i].r[0]), + simde_vld1_u32(test_vec[i].r[1]), + simde_vld1_u32(test_vec[i].r[2]) } }; + + SIMDE_ALIGN_TO_16 uint32_t a_[6]; + simde_vst1_u32_x3(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_uint32x2_t a = simde_test_arm_neon_random_u32x2(); + simde_uint32x2_t b = simde_test_arm_neon_random_u32x2(); + simde_uint32x2_t c = simde_test_arm_neon_random_u32x2(); + simde_uint32x2x3_t d = {{a, b, c}}; + + simde_test_arm_neon_write_u32x2x3(2, d, SIMDE_TEST_VEC_POS_FIRST); + + uint32_t buf[6]; + simde_vst1_u32_x3(buf, d); + + simde_test_codegen_write_vu32(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1_u64_x3 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + uint64_t r[3][1]; + uint64_t a[3]; + } test_vec[] = { + { + { { UINT64_C( 4058396654866485250) }, + { UINT64_C( 8045440270327309065) }, + { UINT64_C(12512524336451153548) } }, + { UINT64_C( 4058396654866485250), UINT64_C( 8045440270327309065), UINT64_C(12512524336451153548) } }, + { + { { UINT64_C(16268222174520363307) }, + { UINT64_C( 1377694709190539173) }, + { UINT64_C( 5452830827235875569) } }, + { UINT64_C(16268222174520363307), UINT64_C( 1377694709190539173), UINT64_C( 5452830827235875569) } }, + { + { { UINT64_C(15819717984974816838) }, + { UINT64_C(17291744810337236279) }, + { UINT64_C(12930384021297640533) } }, + { UINT64_C(15819717984974816838), UINT64_C(17291744810337236279), UINT64_C(12930384021297640533) } }, + { + { { UINT64_C(14021849117738738573) }, + { UINT64_C( 319238586511646691) }, + { UINT64_C( 4275907152009906206) } }, + { UINT64_C(14021849117738738573), UINT64_C( 319238586511646691), UINT64_C( 4275907152009906206) } }, + { + { { UINT64_C(12518893292099349574) }, + { UINT64_C( 3345208373111532846) }, + { UINT64_C( 5927071585528777584) } }, + { UINT64_C(12518893292099349574), UINT64_C( 3345208373111532846), UINT64_C( 5927071585528777584) } }, + { + { { UINT64_C(13085790833028521080) }, + { UINT64_C( 7929001936303240253) }, + { UINT64_C( 333130670536131366) } }, + { UINT64_C(13085790833028521080), UINT64_C( 7929001936303240253), UINT64_C( 333130670536131366) } }, + { + { { UINT64_C( 654573978626711695) }, + { UINT64_C( 2090517814441463775) }, + { UINT64_C( 6982131084443697207) } }, + { UINT64_C( 654573978626711695), UINT64_C( 2090517814441463775), UINT64_C( 6982131084443697207) } }, + { + { { UINT64_C( 1305886121058762374) }, + { UINT64_C(14153384145091650001) }, + { UINT64_C( 916506531343815354) } }, + { UINT64_C( 1305886121058762374), UINT64_C(14153384145091650001), UINT64_C( 916506531343815354) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_uint64x1x3_t r_ = { { simde_vld1_u64(test_vec[i].r[0]), + simde_vld1_u64(test_vec[i].r[1]), + simde_vld1_u64(test_vec[i].r[2]) } }; + + SIMDE_ALIGN_TO_16 uint64_t a_[3]; + simde_vst1_u64_x3(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_uint64x1_t a = simde_test_arm_neon_random_u64x1(); + simde_uint64x1_t b = simde_test_arm_neon_random_u64x1(); + simde_uint64x1_t c = simde_test_arm_neon_random_u64x1(); + simde_uint64x1x3_t d = {{a, b, c}}; + + simde_test_arm_neon_write_u64x1x3(2, d, SIMDE_TEST_VEC_POS_FIRST); + + uint64_t buf[3]; + simde_vst1_u64_x3(buf, d); + + simde_test_codegen_write_vu64(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +#endif /* !defined(SIMDE_BUG_INTEL_857088) */ + +SIMDE_TEST_FUNC_LIST_BEGIN +#if !defined(SIMDE_BUG_INTEL_857088) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1_f32_x3) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1_f64_x3) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1_s8_x3) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1_s16_x3) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1_s32_x3) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1_s64_x3) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1_u8_x3) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1_u16_x3) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1_u32_x3) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1_u64_x3) +#endif /* !defined(SIMDE_BUG_INTEL_857088) */ +SIMDE_TEST_FUNC_LIST_END + +#include "test-neon-footer.h" diff --git a/test/arm/neon/st1_x4.c b/test/arm/neon/st1_x4.c new file mode 100644 index 000000000..4acefb6e2 --- /dev/null +++ b/test/arm/neon/st1_x4.c @@ -0,0 +1,998 @@ + +#include "test/test.h" +#define SIMDE_TEST_ARM_NEON_INSN st1_x4 +#include "test-neon.h" +#include "../../../simde/arm/neon/st1_x4.h" + +#if !defined(SIMDE_BUG_INTEL_857088) + +static int +test_simde_vst1_f32_x4 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + simde_float32 r[4][2]; + simde_float32 a[8]; + } test_vec[] = { + { + { { SIMDE_FLOAT32_C( -888.87), SIMDE_FLOAT32_C( 708.47) }, + { SIMDE_FLOAT32_C( -777.85), SIMDE_FLOAT32_C( -799.91) }, + { SIMDE_FLOAT32_C( 264.52), SIMDE_FLOAT32_C( -980.05) }, + { SIMDE_FLOAT32_C( 823.07), SIMDE_FLOAT32_C( -578.13) } }, + { SIMDE_FLOAT32_C( -888.87), SIMDE_FLOAT32_C( 708.47), SIMDE_FLOAT32_C( -777.85), SIMDE_FLOAT32_C( -799.91), + SIMDE_FLOAT32_C( 264.52), SIMDE_FLOAT32_C( -980.05), SIMDE_FLOAT32_C( 823.07), SIMDE_FLOAT32_C( -578.13) } }, + { + { { SIMDE_FLOAT32_C( -306.04), SIMDE_FLOAT32_C( 710.58) }, + { SIMDE_FLOAT32_C( 931.81), SIMDE_FLOAT32_C( -975.48) }, + { SIMDE_FLOAT32_C( -597.35), SIMDE_FLOAT32_C( -797.34) }, + { SIMDE_FLOAT32_C( -552.00), SIMDE_FLOAT32_C( 948.97) } }, + { SIMDE_FLOAT32_C( -306.04), SIMDE_FLOAT32_C( 710.58), SIMDE_FLOAT32_C( 931.81), SIMDE_FLOAT32_C( -975.48), + SIMDE_FLOAT32_C( -597.35), SIMDE_FLOAT32_C( -797.34), SIMDE_FLOAT32_C( -552.00), SIMDE_FLOAT32_C( 948.97) } }, + { + { { SIMDE_FLOAT32_C( 491.44), SIMDE_FLOAT32_C( 902.32) }, + { SIMDE_FLOAT32_C( 651.63), SIMDE_FLOAT32_C( -87.23) }, + { SIMDE_FLOAT32_C( -496.24), SIMDE_FLOAT32_C( -468.31) }, + { SIMDE_FLOAT32_C( -590.91), SIMDE_FLOAT32_C( 295.14) } }, + { SIMDE_FLOAT32_C( 491.44), SIMDE_FLOAT32_C( 902.32), SIMDE_FLOAT32_C( 651.63), SIMDE_FLOAT32_C( -87.23), + SIMDE_FLOAT32_C( -496.24), SIMDE_FLOAT32_C( -468.31), SIMDE_FLOAT32_C( -590.91), SIMDE_FLOAT32_C( 295.14) } }, + { + { { SIMDE_FLOAT32_C( -655.57), SIMDE_FLOAT32_C( -620.90) }, + { SIMDE_FLOAT32_C( -517.88), SIMDE_FLOAT32_C( -603.98) }, + { SIMDE_FLOAT32_C( 181.30), SIMDE_FLOAT32_C( -312.67) }, + { SIMDE_FLOAT32_C( 733.21), SIMDE_FLOAT32_C( 292.43) } }, + { SIMDE_FLOAT32_C( -655.57), SIMDE_FLOAT32_C( -620.90), SIMDE_FLOAT32_C( -517.88), SIMDE_FLOAT32_C( -603.98), + SIMDE_FLOAT32_C( 181.30), SIMDE_FLOAT32_C( -312.67), SIMDE_FLOAT32_C( 733.21), SIMDE_FLOAT32_C( 292.43) } }, + { + { { SIMDE_FLOAT32_C( -604.20), SIMDE_FLOAT32_C( 955.36) }, + { SIMDE_FLOAT32_C( 492.52), SIMDE_FLOAT32_C( 660.31) }, + { SIMDE_FLOAT32_C( 975.31), SIMDE_FLOAT32_C( 315.60) }, + { SIMDE_FLOAT32_C( -917.81), SIMDE_FLOAT32_C( -330.72) } }, + { SIMDE_FLOAT32_C( -604.20), SIMDE_FLOAT32_C( 955.36), SIMDE_FLOAT32_C( 492.52), SIMDE_FLOAT32_C( 660.31), + SIMDE_FLOAT32_C( 975.31), SIMDE_FLOAT32_C( 315.60), SIMDE_FLOAT32_C( -917.81), SIMDE_FLOAT32_C( -330.72) } }, + { + { { SIMDE_FLOAT32_C( 26.18), SIMDE_FLOAT32_C( -986.00) }, + { SIMDE_FLOAT32_C( -306.20), SIMDE_FLOAT32_C( 428.83) }, + { SIMDE_FLOAT32_C( -783.34), SIMDE_FLOAT32_C( 141.79) }, + { SIMDE_FLOAT32_C( 377.80), SIMDE_FLOAT32_C( 708.09) } }, + { SIMDE_FLOAT32_C( 26.18), SIMDE_FLOAT32_C( -986.00), SIMDE_FLOAT32_C( -306.20), SIMDE_FLOAT32_C( 428.83), + SIMDE_FLOAT32_C( -783.34), SIMDE_FLOAT32_C( 141.79), SIMDE_FLOAT32_C( 377.80), SIMDE_FLOAT32_C( 708.09) } }, + { + { { SIMDE_FLOAT32_C( 44.11), SIMDE_FLOAT32_C( 29.43) }, + { SIMDE_FLOAT32_C( -379.13), SIMDE_FLOAT32_C( 547.87) }, + { SIMDE_FLOAT32_C( 561.12), SIMDE_FLOAT32_C( 29.96) }, + { SIMDE_FLOAT32_C( -156.99), SIMDE_FLOAT32_C( 905.55) } }, + { SIMDE_FLOAT32_C( 44.11), SIMDE_FLOAT32_C( 29.43), SIMDE_FLOAT32_C( -379.13), SIMDE_FLOAT32_C( 547.87), + SIMDE_FLOAT32_C( 561.12), SIMDE_FLOAT32_C( 29.96), SIMDE_FLOAT32_C( -156.99), SIMDE_FLOAT32_C( 905.55) } }, + { + { { SIMDE_FLOAT32_C( 409.06), SIMDE_FLOAT32_C( 325.12) }, + { SIMDE_FLOAT32_C( -698.43), SIMDE_FLOAT32_C( -409.64) }, + { SIMDE_FLOAT32_C( -987.55), SIMDE_FLOAT32_C( -965.21) }, + { SIMDE_FLOAT32_C( 882.79), SIMDE_FLOAT32_C( -591.76) } }, + { SIMDE_FLOAT32_C( 409.06), SIMDE_FLOAT32_C( 325.12), SIMDE_FLOAT32_C( -698.43), SIMDE_FLOAT32_C( -409.64), + SIMDE_FLOAT32_C( -987.55), SIMDE_FLOAT32_C( -965.21), SIMDE_FLOAT32_C( 882.79), SIMDE_FLOAT32_C( -591.76) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_float32x2x4_t r_ = { { simde_vld1_f32(test_vec[i].r[0]), + simde_vld1_f32(test_vec[i].r[1]), + simde_vld1_f32(test_vec[i].r[2]), + simde_vld1_f32(test_vec[i].r[3]) } }; + + SIMDE_ALIGN_TO_16 simde_float32 a_[8]; + simde_vst1_f32_x4(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_float32x2_t a = simde_test_arm_neon_random_f32x2(-1000.0f, 1000.0f); + simde_float32x2_t b = simde_test_arm_neon_random_f32x2(-1000.0f, 1000.0f); + simde_float32x2_t c = simde_test_arm_neon_random_f32x2(-1000.0f, 1000.0f); + simde_float32x2_t d = simde_test_arm_neon_random_f32x2(-1000.0f, 1000.0f); + simde_float32x2x4_t e = {{a, b, c, d}}; + + simde_test_arm_neon_write_f32x2x4(2, e, SIMDE_TEST_VEC_POS_FIRST); + + simde_float32 buf[8]; + simde_vst1_f32_x4(buf, e); + + simde_test_codegen_write_vf32(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1_f64_x4 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + simde_float64 r[4][1]; + simde_float64 a[4]; + } test_vec[] = { + { + { { SIMDE_FLOAT64_C( 990.15) }, + { SIMDE_FLOAT64_C( 375.32) }, + { SIMDE_FLOAT64_C( -931.44) }, + { SIMDE_FLOAT64_C( 965.47) } }, + { SIMDE_FLOAT64_C( 990.15), SIMDE_FLOAT64_C( 375.32), SIMDE_FLOAT64_C( -931.44), SIMDE_FLOAT64_C( 965.47) } }, + { + { { SIMDE_FLOAT64_C( -309.09) }, + { SIMDE_FLOAT64_C( -849.25) }, + { SIMDE_FLOAT64_C( -365.26) }, + { SIMDE_FLOAT64_C( 717.09) } }, + { SIMDE_FLOAT64_C( -309.09), SIMDE_FLOAT64_C( -849.25), SIMDE_FLOAT64_C( -365.26), SIMDE_FLOAT64_C( 717.09) } }, + { + { { SIMDE_FLOAT64_C( -835.25) }, + { SIMDE_FLOAT64_C( 328.54) }, + { SIMDE_FLOAT64_C( 145.92) }, + { SIMDE_FLOAT64_C( -618.59) } }, + { SIMDE_FLOAT64_C( -835.25), SIMDE_FLOAT64_C( 328.54), SIMDE_FLOAT64_C( 145.92), SIMDE_FLOAT64_C( -618.59) } }, + { + { { SIMDE_FLOAT64_C( -529.67) }, + { SIMDE_FLOAT64_C( -476.28) }, + { SIMDE_FLOAT64_C( -910.50) }, + { SIMDE_FLOAT64_C( 514.44) } }, + { SIMDE_FLOAT64_C( -529.67), SIMDE_FLOAT64_C( -476.28), SIMDE_FLOAT64_C( -910.50), SIMDE_FLOAT64_C( 514.44) } }, + { + { { SIMDE_FLOAT64_C( 553.15) }, + { SIMDE_FLOAT64_C( -289.63) }, + { SIMDE_FLOAT64_C( 62.31) }, + { SIMDE_FLOAT64_C( 114.28) } }, + { SIMDE_FLOAT64_C( 553.15), SIMDE_FLOAT64_C( -289.63), SIMDE_FLOAT64_C( 62.31), SIMDE_FLOAT64_C( 114.28) } }, + { + { { SIMDE_FLOAT64_C( 740.34) }, + { SIMDE_FLOAT64_C( 905.32) }, + { SIMDE_FLOAT64_C( 19.83) }, + { SIMDE_FLOAT64_C( 149.40) } }, + { SIMDE_FLOAT64_C( 740.34), SIMDE_FLOAT64_C( 905.32), SIMDE_FLOAT64_C( 19.83), SIMDE_FLOAT64_C( 149.40) } }, + { + { { SIMDE_FLOAT64_C( 230.44) }, + { SIMDE_FLOAT64_C( 321.40) }, + { SIMDE_FLOAT64_C( 739.76) }, + { SIMDE_FLOAT64_C( 242.89) } }, + { SIMDE_FLOAT64_C( 230.44), SIMDE_FLOAT64_C( 321.40), SIMDE_FLOAT64_C( 739.76), SIMDE_FLOAT64_C( 242.89) } }, + { + { { SIMDE_FLOAT64_C( 356.19) }, + { SIMDE_FLOAT64_C( 622.55) }, + { SIMDE_FLOAT64_C( 651.14) }, + { SIMDE_FLOAT64_C( 346.34) } }, + { SIMDE_FLOAT64_C( 356.19), SIMDE_FLOAT64_C( 622.55), SIMDE_FLOAT64_C( 651.14), SIMDE_FLOAT64_C( 346.34) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_float64x1x4_t r_ = { { simde_vld1_f64(test_vec[i].r[0]), + simde_vld1_f64(test_vec[i].r[1]), + simde_vld1_f64(test_vec[i].r[2]), + simde_vld1_f64(test_vec[i].r[3]) } }; + + SIMDE_ALIGN_TO_16 simde_float64 a_[4]; + simde_vst1_f64_x4(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_float64x1_t a = simde_test_arm_neon_random_f64x1(-1000.0, 1000.0); + simde_float64x1_t b = simde_test_arm_neon_random_f64x1(-1000.0, 1000.0); + simde_float64x1_t c = simde_test_arm_neon_random_f64x1(-1000.0, 1000.0); + simde_float64x1_t d = simde_test_arm_neon_random_f64x1(-1000.0, 1000.0); + simde_float64x1x4_t e = {{a, b, c, d}}; + + simde_test_arm_neon_write_f64x1x4(2, e, SIMDE_TEST_VEC_POS_FIRST); + + simde_float64 buf[4]; + simde_vst1_f64_x4(buf, e); + + simde_test_codegen_write_vf64(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1_s8_x4 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + int8_t r[4][8]; + int8_t a[32]; + } test_vec[] = { + { + { { -INT8_C( 60), INT8_C( 53), INT8_C( 119), -INT8_C( 27), -INT8_C( 113), -INT8_C( 14), INT8_C( 22), -INT8_C( 97) }, + { INT8_C( 55), INT8_C( 89), -INT8_C( 119), -INT8_C( 114), -INT8_C( 103), INT8_C( 60), -INT8_C( 26), -INT8_C( 100) }, + { -INT8_C( 115), -INT8_C( 38), -INT8_C( 93), -INT8_C( 67), INT8_C( 31), INT8_C( 19), INT8_C( 66), INT8_C( 107) }, + { -INT8_C( 54), -INT8_C( 94), -INT8_C( 65), INT8_C( 45), INT8_C( 61), -INT8_C( 46), INT8_C( 56), INT8_C( 1) } }, + { -INT8_C( 60), INT8_C( 53), INT8_C( 119), -INT8_C( 27), -INT8_C( 113), -INT8_C( 14), INT8_C( 22), -INT8_C( 97), + INT8_C( 55), INT8_C( 89), -INT8_C( 119), -INT8_C( 114), -INT8_C( 103), INT8_C( 60), -INT8_C( 26), -INT8_C( 100), + -INT8_C( 115), -INT8_C( 38), -INT8_C( 93), -INT8_C( 67), INT8_C( 31), INT8_C( 19), INT8_C( 66), INT8_C( 107), + -INT8_C( 54), -INT8_C( 94), -INT8_C( 65), INT8_C( 45), INT8_C( 61), -INT8_C( 46), INT8_C( 56), INT8_C( 1) } }, + { + { { INT8_C( 7), -INT8_C( 80), -INT8_C( 26), -INT8_C( 105), -INT8_C( 94), -INT8_C( 3), INT8_C( 54), -INT8_C( 38) }, + { INT8_C( 86), -INT8_C( 65), INT8_C( 104), -INT8_C( 17), -INT8_C( 5), INT8_C( 78), -INT8_C( 117), -INT8_C( 120) }, + { INT8_C( 40), INT8_C( 46), INT8_C( 69), INT8_C( 71), INT8_C( 66), -INT8_C( 121), -INT8_C( 77), INT8_C( 12) }, + { INT8_C( 42), INT8_C( 114), INT8_C( 58), INT8_C( 103), INT8_C( 68), INT8_C( 114), INT8_C( 104), INT8_C( 75) } }, + { INT8_C( 7), -INT8_C( 80), -INT8_C( 26), -INT8_C( 105), -INT8_C( 94), -INT8_C( 3), INT8_C( 54), -INT8_C( 38), + INT8_C( 86), -INT8_C( 65), INT8_C( 104), -INT8_C( 17), -INT8_C( 5), INT8_C( 78), -INT8_C( 117), -INT8_C( 120), + INT8_C( 40), INT8_C( 46), INT8_C( 69), INT8_C( 71), INT8_C( 66), -INT8_C( 121), -INT8_C( 77), INT8_C( 12), + INT8_C( 42), INT8_C( 114), INT8_C( 58), INT8_C( 103), INT8_C( 68), INT8_C( 114), INT8_C( 104), INT8_C( 75) } }, + { + { { INT8_C( 34), INT8_C( 78), -INT8_C( 30), -INT8_C( 59), INT8_C( 75), INT8_C( 24), -INT8_C( 97), -INT8_C( 95) }, + { -INT8_C( 41), INT8_C( 7), -INT8_C( 112), -INT8_C( 46), INT8_C( 85), INT8_C( 28), INT8_C( 90), INT8_C( 125) }, + { INT8_C( 74), -INT8_C( 96), -INT8_C( 60), -INT8_C( 116), INT8_C( 39), INT8_C( 119), -INT8_C( 103), INT8_C( 81) }, + { -INT8_C( 23), -INT8_C( 45), -INT8_C( 72), INT8_C( 45), INT8_C( 69), INT8_C( 32), INT8_C( 121), INT8_C( 104) } }, + { INT8_C( 34), INT8_C( 78), -INT8_C( 30), -INT8_C( 59), INT8_C( 75), INT8_C( 24), -INT8_C( 97), -INT8_C( 95), + -INT8_C( 41), INT8_C( 7), -INT8_C( 112), -INT8_C( 46), INT8_C( 85), INT8_C( 28), INT8_C( 90), INT8_C( 125), + INT8_C( 74), -INT8_C( 96), -INT8_C( 60), -INT8_C( 116), INT8_C( 39), INT8_C( 119), -INT8_C( 103), INT8_C( 81), + -INT8_C( 23), -INT8_C( 45), -INT8_C( 72), INT8_C( 45), INT8_C( 69), INT8_C( 32), INT8_C( 121), INT8_C( 104) } }, + { + { { INT8_C( 111), INT8_C( 91), INT8_C( 45), -INT8_C( 70), INT8_C( 116), -INT8_C( 52), INT8_C( 92), INT8_C( 75) }, + { -INT8_C( 45), -INT8_C( 20), INT8_C( 30), INT8_C( 40), INT8_C( 8), INT8_C( 120), -INT8_C( 91), INT8_C( 83) }, + { INT8_C( 24), INT8_C( 105), -INT8_C( 33), INT8_C( 64), -INT8_C( 31), INT8_C( 120), -INT8_C( 111), -INT8_C( 54) }, + { INT8_C( 75), INT8_C( 74), -INT8_C( 8), -INT8_C( 111), INT8_C( 106), INT8_C( 113), -INT8_C( 7), -INT8_C( 39) } }, + { INT8_C( 111), INT8_C( 91), INT8_C( 45), -INT8_C( 70), INT8_C( 116), -INT8_C( 52), INT8_C( 92), INT8_C( 75), + -INT8_C( 45), -INT8_C( 20), INT8_C( 30), INT8_C( 40), INT8_C( 8), INT8_C( 120), -INT8_C( 91), INT8_C( 83), + INT8_C( 24), INT8_C( 105), -INT8_C( 33), INT8_C( 64), -INT8_C( 31), INT8_C( 120), -INT8_C( 111), -INT8_C( 54), + INT8_C( 75), INT8_C( 74), -INT8_C( 8), -INT8_C( 111), INT8_C( 106), INT8_C( 113), -INT8_C( 7), -INT8_C( 39) } }, + { + { { -INT8_C( 52), INT8_C( 38), -INT8_C( 108), INT8_C( 64), -INT8_C( 14), -INT8_C( 16), -INT8_C( 116), -INT8_C( 59) }, + { -INT8_C( 36), -INT8_C( 86), -INT8_C( 19), -INT8_C( 27), INT8_C( 34), -INT8_C( 110), INT8_C( 56), INT8_C( 59) }, + { -INT8_C( 5), INT8_C( 23), INT8_C( 123), -INT8_C( 36), -INT8_C( 112), INT8_C( 12), -INT8_C( 89), -INT8_C( 37) }, + { INT8_C( 86), -INT8_C( 97), INT8_C( 108), -INT8_C( 63), INT8_C( 16), INT8_C( 101), -INT8_C( 102), -INT8_C( 36) } }, + { -INT8_C( 52), INT8_C( 38), -INT8_C( 108), INT8_C( 64), -INT8_C( 14), -INT8_C( 16), -INT8_C( 116), -INT8_C( 59), + -INT8_C( 36), -INT8_C( 86), -INT8_C( 19), -INT8_C( 27), INT8_C( 34), -INT8_C( 110), INT8_C( 56), INT8_C( 59), + -INT8_C( 5), INT8_C( 23), INT8_C( 123), -INT8_C( 36), -INT8_C( 112), INT8_C( 12), -INT8_C( 89), -INT8_C( 37), + INT8_C( 86), -INT8_C( 97), INT8_C( 108), -INT8_C( 63), INT8_C( 16), INT8_C( 101), -INT8_C( 102), -INT8_C( 36) } }, + { + { { -INT8_C( 117), INT8_C( 46), INT8_C( 29), INT8_C( 125), INT8_C( 30), -INT8_C( 87), INT8_C( 66), -INT8_C( 5) }, + { INT8_C( 83), INT8_C( 47), -INT8_C( 32), INT8_C( 117), -INT8_C( 63), INT8_C( 24), -INT8_C( 80), -INT8_C( 67) }, + { INT8_C( 47), INT8_C( 43), -INT8_C( 103), -INT8_C( 65), INT8_C( 56), INT8_C( 64), -INT8_C( 101), -INT8_C( 114) }, + { -INT8_C( 33), INT8_C( 7), INT8_C( 79), -INT8_C( 17), INT8_C( 109), -INT8_C( 22), -INT8_C( 52), -INT8_C( 8) } }, + { -INT8_C( 117), INT8_C( 46), INT8_C( 29), INT8_C( 125), INT8_C( 30), -INT8_C( 87), INT8_C( 66), -INT8_C( 5), + INT8_C( 83), INT8_C( 47), -INT8_C( 32), INT8_C( 117), -INT8_C( 63), INT8_C( 24), -INT8_C( 80), -INT8_C( 67), + INT8_C( 47), INT8_C( 43), -INT8_C( 103), -INT8_C( 65), INT8_C( 56), INT8_C( 64), -INT8_C( 101), -INT8_C( 114), + -INT8_C( 33), INT8_C( 7), INT8_C( 79), -INT8_C( 17), INT8_C( 109), -INT8_C( 22), -INT8_C( 52), -INT8_C( 8) } }, + { + { { INT8_C( 24), -INT8_C( 23), INT8_C( 118), INT8_C( 55), -INT8_C( 110), -INT8_C( 72), INT8_C( 50), -INT8_C( 27) }, + { -INT8_C( 24), INT8_C( 18), INT8_C( 90), -INT8_C( 87), INT8_C( 42), INT8_C( 11), INT8_C( 102), INT8_C( 89) }, + { INT8_C( 54), INT8_C( 0), INT8_C( 25), INT8_C( 110), INT8_C( 64), -INT8_C( 76), -INT8_C( 3), INT8_C( 32) }, + { -INT8_C( 69), INT8_C( 76), INT8_C( 15), INT8_C( 40), INT8_C( 54), -INT8_C( 37), INT8_C( 33), INT8_C( 79) } }, + { INT8_C( 24), -INT8_C( 23), INT8_C( 118), INT8_C( 55), -INT8_C( 110), -INT8_C( 72), INT8_C( 50), -INT8_C( 27), + -INT8_C( 24), INT8_C( 18), INT8_C( 90), -INT8_C( 87), INT8_C( 42), INT8_C( 11), INT8_C( 102), INT8_C( 89), + INT8_C( 54), INT8_C( 0), INT8_C( 25), INT8_C( 110), INT8_C( 64), -INT8_C( 76), -INT8_C( 3), INT8_C( 32), + -INT8_C( 69), INT8_C( 76), INT8_C( 15), INT8_C( 40), INT8_C( 54), -INT8_C( 37), INT8_C( 33), INT8_C( 79) } }, + { + { { -INT8_C( 60), -INT8_C( 105), -INT8_C( 122), INT8_C( 86), INT8_C( 79), -INT8_C( 72), INT8_C( 59), INT8_C( 55) }, + { -INT8_C( 54), -INT8_C( 106), -INT8_C( 31), -INT8_C( 12), -INT8_C( 95), INT8_C( 71), INT8_C( 77), -INT8_C( 41) }, + { INT8_C( 71), INT8_C( 102), INT8_C( 70), -INT8_C( 120), INT8_C( 26), INT8_C( 67), -INT8_C( 88), -INT8_C( 42) }, + { -INT8_C( 113), -INT8_C( 73), -INT8_C( 2), -INT8_C( 58), -INT8_C( 109), INT8_C( 31), INT8_C( 21), INT8_C( 87) } }, + { -INT8_C( 60), -INT8_C( 105), -INT8_C( 122), INT8_C( 86), INT8_C( 79), -INT8_C( 72), INT8_C( 59), INT8_C( 55), + -INT8_C( 54), -INT8_C( 106), -INT8_C( 31), -INT8_C( 12), -INT8_C( 95), INT8_C( 71), INT8_C( 77), -INT8_C( 41), + INT8_C( 71), INT8_C( 102), INT8_C( 70), -INT8_C( 120), INT8_C( 26), INT8_C( 67), -INT8_C( 88), -INT8_C( 42), + -INT8_C( 113), -INT8_C( 73), -INT8_C( 2), -INT8_C( 58), -INT8_C( 109), INT8_C( 31), INT8_C( 21), INT8_C( 87) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_int8x8x4_t r_ = { { simde_vld1_s8(test_vec[i].r[0]), + simde_vld1_s8(test_vec[i].r[1]), + simde_vld1_s8(test_vec[i].r[2]), + simde_vld1_s8(test_vec[i].r[3]) } }; + + SIMDE_ALIGN_TO_16 int8_t a_[32]; + simde_vst1_s8_x4(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_int8x8_t a = simde_test_arm_neon_random_i8x8(); + simde_int8x8_t b = simde_test_arm_neon_random_i8x8(); + simde_int8x8_t c = simde_test_arm_neon_random_i8x8(); + simde_int8x8_t d = simde_test_arm_neon_random_i8x8(); + simde_int8x8x4_t e = {{a, b, c, d}}; + + simde_test_arm_neon_write_i8x8x4(2, e, SIMDE_TEST_VEC_POS_FIRST); + + int8_t buf[32]; + simde_vst1_s8_x4(buf, e); + + simde_test_codegen_write_vi8(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1_s16_x4 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + int16_t r[4][4]; + int16_t a[16]; + } test_vec[] = { + { + { { -INT16_C( 25674), INT16_C( 1710), -INT16_C( 5805), INT16_C( 7485) }, + { INT16_C( 7807), INT16_C( 8209), INT16_C( 24166), -INT16_C( 21000) }, + { INT16_C( 16069), -INT16_C( 8395), -INT16_C( 8831), INT16_C( 4277) }, + { -INT16_C( 19307), INT16_C( 10454), -INT16_C( 5165), -INT16_C( 30081) } }, + { -INT16_C( 25674), INT16_C( 1710), -INT16_C( 5805), INT16_C( 7485), INT16_C( 7807), INT16_C( 8209), INT16_C( 24166), -INT16_C( 21000), + INT16_C( 16069), -INT16_C( 8395), -INT16_C( 8831), INT16_C( 4277), -INT16_C( 19307), INT16_C( 10454), -INT16_C( 5165), -INT16_C( 30081) } }, + { + { { INT16_C( 11654), -INT16_C( 9840), -INT16_C( 13033), -INT16_C( 26890) }, + { INT16_C( 2028), INT16_C( 21175), -INT16_C( 20634), INT16_C( 11263) }, + { INT16_C( 13805), INT16_C( 28170), -INT16_C( 16366), -INT16_C( 22658) }, + { INT16_C( 21876), INT16_C( 18383), INT16_C( 20288), -INT16_C( 14383) } }, + { INT16_C( 11654), -INT16_C( 9840), -INT16_C( 13033), -INT16_C( 26890), INT16_C( 2028), INT16_C( 21175), -INT16_C( 20634), INT16_C( 11263), + INT16_C( 13805), INT16_C( 28170), -INT16_C( 16366), -INT16_C( 22658), INT16_C( 21876), INT16_C( 18383), INT16_C( 20288), -INT16_C( 14383) } }, + { + { { INT16_C( 24956), -INT16_C( 27744), -INT16_C( 26833), INT16_C( 6954) }, + { -INT16_C( 7778), INT16_C( 1133), INT16_C( 27792), INT16_C( 32047) }, + { INT16_C( 15009), -INT16_C( 19221), INT16_C( 27130), INT16_C( 28251) }, + { INT16_C( 11198), -INT16_C( 75), -INT16_C( 30854), -INT16_C( 2362) } }, + { INT16_C( 24956), -INT16_C( 27744), -INT16_C( 26833), INT16_C( 6954), -INT16_C( 7778), INT16_C( 1133), INT16_C( 27792), INT16_C( 32047), + INT16_C( 15009), -INT16_C( 19221), INT16_C( 27130), INT16_C( 28251), INT16_C( 11198), -INT16_C( 75), -INT16_C( 30854), -INT16_C( 2362) } }, + { + { { INT16_C( 26344), INT16_C( 6026), -INT16_C( 19203), -INT16_C( 25550) }, + { -INT16_C( 24683), INT16_C( 9632), -INT16_C( 12276), -INT16_C( 21086) }, + { -INT16_C( 29430), INT16_C( 1121), -INT16_C( 16906), -INT16_C( 19086) }, + { INT16_C( 10216), INT16_C( 25268), INT16_C( 31406), -INT16_C( 26792) } }, + { INT16_C( 26344), INT16_C( 6026), -INT16_C( 19203), -INT16_C( 25550), -INT16_C( 24683), INT16_C( 9632), -INT16_C( 12276), -INT16_C( 21086), + -INT16_C( 29430), INT16_C( 1121), -INT16_C( 16906), -INT16_C( 19086), INT16_C( 10216), INT16_C( 25268), INT16_C( 31406), -INT16_C( 26792) } }, + { + { { -INT16_C( 7456), -INT16_C( 8530), -INT16_C( 7786), INT16_C( 11130) }, + { INT16_C( 6784), -INT16_C( 29616), -INT16_C( 3350), -INT16_C( 3014) }, + { -INT16_C( 25729), INT16_C( 30456), INT16_C( 27224), INT16_C( 16427) }, + { -INT16_C( 8302), INT16_C( 16546), -INT16_C( 1191), INT16_C( 14807) } }, + { -INT16_C( 7456), -INT16_C( 8530), -INT16_C( 7786), INT16_C( 11130), INT16_C( 6784), -INT16_C( 29616), -INT16_C( 3350), -INT16_C( 3014), + -INT16_C( 25729), INT16_C( 30456), INT16_C( 27224), INT16_C( 16427), -INT16_C( 8302), INT16_C( 16546), -INT16_C( 1191), INT16_C( 14807) } }, + { + { { -INT16_C( 31011), INT16_C( 29719), -INT16_C( 28313), -INT16_C( 6241) }, + { -INT16_C( 3924), -INT16_C( 27020), -INT16_C( 20766), INT16_C( 25227) }, + { -INT16_C( 31927), -INT16_C( 23848), INT16_C( 1006), -INT16_C( 32542) }, + { -INT16_C( 31262), INT16_C( 15296), -INT16_C( 26496), INT16_C( 23924) } }, + { -INT16_C( 31011), INT16_C( 29719), -INT16_C( 28313), -INT16_C( 6241), -INT16_C( 3924), -INT16_C( 27020), -INT16_C( 20766), INT16_C( 25227), + -INT16_C( 31927), -INT16_C( 23848), INT16_C( 1006), -INT16_C( 32542), -INT16_C( 31262), INT16_C( 15296), -INT16_C( 26496), INT16_C( 23924) } }, + { + { { -INT16_C( 29666), -INT16_C( 31279), INT16_C( 28957), -INT16_C( 13972) }, + { -INT16_C( 8095), INT16_C( 17248), -INT16_C( 5234), -INT16_C( 10075) }, + { INT16_C( 32110), INT16_C( 23674), INT16_C( 23680), INT16_C( 25308) }, + { -INT16_C( 25119), INT16_C( 24989), INT16_C( 4661), INT16_C( 21439) } }, + { -INT16_C( 29666), -INT16_C( 31279), INT16_C( 28957), -INT16_C( 13972), -INT16_C( 8095), INT16_C( 17248), -INT16_C( 5234), -INT16_C( 10075), + INT16_C( 32110), INT16_C( 23674), INT16_C( 23680), INT16_C( 25308), -INT16_C( 25119), INT16_C( 24989), INT16_C( 4661), INT16_C( 21439) } }, + { + { { -INT16_C( 28514), -INT16_C( 17448), INT16_C( 17409), INT16_C( 25221) }, + { -INT16_C( 6875), -INT16_C( 19546), INT16_C( 19408), INT16_C( 16011) }, + { INT16_C( 1481), INT16_C( 18843), INT16_C( 30562), INT16_C( 17324) }, + { INT16_C( 18708), INT16_C( 18853), INT16_C( 25691), -INT16_C( 1636) } }, + { -INT16_C( 28514), -INT16_C( 17448), INT16_C( 17409), INT16_C( 25221), -INT16_C( 6875), -INT16_C( 19546), INT16_C( 19408), INT16_C( 16011), + INT16_C( 1481), INT16_C( 18843), INT16_C( 30562), INT16_C( 17324), INT16_C( 18708), INT16_C( 18853), INT16_C( 25691), -INT16_C( 1636) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_int16x4x4_t r_ = { { simde_vld1_s16(test_vec[i].r[0]), + simde_vld1_s16(test_vec[i].r[1]), + simde_vld1_s16(test_vec[i].r[2]), + simde_vld1_s16(test_vec[i].r[3]) } }; + + SIMDE_ALIGN_TO_16 int16_t a_[16]; + simde_vst1_s16_x4(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_int16x4_t a = simde_test_arm_neon_random_i16x4(); + simde_int16x4_t b = simde_test_arm_neon_random_i16x4(); + simde_int16x4_t c = simde_test_arm_neon_random_i16x4(); + simde_int16x4_t d = simde_test_arm_neon_random_i16x4(); + simde_int16x4x4_t e = {{a, b, c, d}}; + + simde_test_arm_neon_write_i16x4x4(2, e, SIMDE_TEST_VEC_POS_FIRST); + + int16_t buf[16]; + simde_vst1_s16_x4(buf, e); + + simde_test_codegen_write_vi16(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1_s32_x4 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + int32_t r[4][2]; + int32_t a[8]; + } test_vec[] = { + { + { { -INT32_C( 155880204), -INT32_C( 564643143) }, + { -INT32_C( 275644897), INT32_C( 321723722) }, + { -INT32_C( 2074294238), INT32_C( 1422395456) }, + { -INT32_C( 1382126254), -INT32_C( 978896175) } }, + { -INT32_C( 155880204), -INT32_C( 564643143), -INT32_C( 275644897), INT32_C( 321723722), -INT32_C( 2074294238), INT32_C( 1422395456), -INT32_C( 1382126254), -INT32_C( 978896175) } }, + { + { { INT32_C( 1757109423), -INT32_C( 1253698410) }, + { INT32_C( 1554306834), INT32_C( 393204212) }, + { -INT32_C( 627323750), INT32_C( 640574420) }, + { -INT32_C( 1579889456), -INT32_C( 1234732281) } }, + { INT32_C( 1757109423), -INT32_C( 1253698410), INT32_C( 1554306834), INT32_C( 393204212), -INT32_C( 627323750), INT32_C( 640574420), -INT32_C( 1579889456), -INT32_C( 1234732281) } }, + { + { { INT32_C( 1830691543), INT32_C( 1226990646) }, + { INT32_C( 816170555), INT32_C( 826742167) }, + { -INT32_C( 1257512223), INT32_C( 383531590) }, + { INT32_C( 230207494), INT32_C( 46341931) } }, + { INT32_C( 1830691543), INT32_C( 1226990646), INT32_C( 816170555), INT32_C( 826742167), -INT32_C( 1257512223), INT32_C( 383531590), INT32_C( 230207494), INT32_C( 46341931) } }, + { + { { INT32_C( 2020598081), -INT32_C( 2118020795) }, + { -INT32_C( 290363817), INT32_C( 1545664635) }, + { INT32_C( 538061786), INT32_C( 1815604837) }, + { -INT32_C( 914755682), INT32_C( 1338719502) } }, + { INT32_C( 2020598081), -INT32_C( 2118020795), -INT32_C( 290363817), INT32_C( 1545664635), INT32_C( 538061786), INT32_C( 1815604837), -INT32_C( 914755682), INT32_C( 1338719502) } }, + { + { { INT32_C( 1690778142), INT32_C( 585468107) }, + { INT32_C( 1779472111), INT32_C( 1757884558) }, + { -INT32_C( 1047930532), INT32_C( 1697497287) }, + { -INT32_C( 1121015889), INT32_C( 34404836) } }, + { INT32_C( 1690778142), INT32_C( 585468107), INT32_C( 1779472111), INT32_C( 1757884558), -INT32_C( 1047930532), INT32_C( 1697497287), -INT32_C( 1121015889), INT32_C( 34404836) } }, + { + { { -INT32_C( 26815437), INT32_C( 1260407644) }, + { INT32_C( 1874211041), -INT32_C( 1109885599) }, + { INT32_C( 494821718), -INT32_C( 796742623) }, + { INT32_C( 932032595), -INT32_C( 600204887) } }, + { -INT32_C( 26815437), INT32_C( 1260407644), INT32_C( 1874211041), -INT32_C( 1109885599), INT32_C( 494821718), -INT32_C( 796742623), INT32_C( 932032595), -INT32_C( 600204887) } }, + { + { { -INT32_C( 891641747), -INT32_C( 854197525) }, + { -INT32_C( 1958950102), -INT32_C( 1639443384) }, + { -INT32_C( 1766078603), -INT32_C( 966378125) }, + { -INT32_C( 1761741843), -INT32_C( 93178227) } }, + { -INT32_C( 891641747), -INT32_C( 854197525), -INT32_C( 1958950102), -INT32_C( 1639443384), -INT32_C( 1766078603), -INT32_C( 966378125), -INT32_C( 1761741843), -INT32_C( 93178227) } }, + { + { { -INT32_C( 1027322666), INT32_C( 1905252934) }, + { -INT32_C( 285422683), INT32_C( 1435256288) }, + { INT32_C( 2146191372), INT32_C( 1933922949) }, + { -INT32_C( 754367930), INT32_C( 1338866808) } }, + { -INT32_C( 1027322666), INT32_C( 1905252934), -INT32_C( 285422683), INT32_C( 1435256288), INT32_C( 2146191372), INT32_C( 1933922949), -INT32_C( 754367930), INT32_C( 1338866808) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_int32x2x4_t r_ = { { simde_vld1_s32(test_vec[i].r[0]), + simde_vld1_s32(test_vec[i].r[1]), + simde_vld1_s32(test_vec[i].r[2]), + simde_vld1_s32(test_vec[i].r[3]) } }; + + SIMDE_ALIGN_TO_16 int32_t a_[8]; + simde_vst1_s32_x4(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_int32x2_t a = simde_test_arm_neon_random_i32x2(); + simde_int32x2_t b = simde_test_arm_neon_random_i32x2(); + simde_int32x2_t c = simde_test_arm_neon_random_i32x2(); + simde_int32x2_t d = simde_test_arm_neon_random_i32x2(); + simde_int32x2x4_t e = {{a, b, c, d}}; + + simde_test_arm_neon_write_i32x2x4(2, e, SIMDE_TEST_VEC_POS_FIRST); + + int32_t buf[8]; + simde_vst1_s32_x4(buf, e); + + simde_test_codegen_write_vi32(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1_s64_x4 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + int64_t r[4][1]; + int64_t a[4]; + } test_vec[] = { + { + { { INT64_C( 1261184281633460936) }, + { -INT64_C( 3629465062852297621) }, + { INT64_C( 2723712263114231252) }, + { INT64_C( 1917344123157272275) } }, + { INT64_C( 1261184281633460936), -INT64_C( 3629465062852297621), INT64_C( 2723712263114231252), INT64_C( 1917344123157272275) } }, + { + { { -INT64_C( 5200064047555695528) }, + { INT64_C( 3870180195189380390) }, + { INT64_C( 7365174927807086897) }, + { INT64_C( 5520654430802947633) } }, + { -INT64_C( 5200064047555695528), INT64_C( 3870180195189380390), INT64_C( 7365174927807086897), INT64_C( 5520654430802947633) } }, + { + { { -INT64_C( 7566638429043111943) }, + { -INT64_C( 3075620290571665221) }, + { INT64_C( 7723140350262763316) }, + { INT64_C( 2849525319494197322) } }, + { -INT64_C( 7566638429043111943), -INT64_C( 3075620290571665221), INT64_C( 7723140350262763316), INT64_C( 2849525319494197322) } }, + { + { { INT64_C( 4348905495741700947) }, + { INT64_C( 4603709109053216874) }, + { INT64_C( 3327937906290968713) }, + { -INT64_C( 257840247290979051) } }, + { INT64_C( 4348905495741700947), INT64_C( 4603709109053216874), INT64_C( 3327937906290968713), -INT64_C( 257840247290979051) } }, + { + { { -INT64_C( 6030009554954037101) }, + { -INT64_C( 2577011902698051086) }, + { -INT64_C( 8180843182068645019) }, + { INT64_C( 7967497604580893932) } }, + { -INT64_C( 6030009554954037101), -INT64_C( 2577011902698051086), -INT64_C( 8180843182068645019), INT64_C( 7967497604580893932) } }, + { + { { INT64_C( 6774210351291650580) }, + { -INT64_C( 4635163504467526531) }, + { INT64_C( 495818284538023131) }, + { INT64_C( 337258627198661476) } }, + { INT64_C( 6774210351291650580), -INT64_C( 4635163504467526531), INT64_C( 495818284538023131), INT64_C( 337258627198661476) } }, + { + { { -INT64_C( 9058325420480777856) }, + { INT64_C( 1671679046805857561) }, + { INT64_C( 2192211482088520267) }, + { -INT64_C( 5263850109382293249) } }, + { -INT64_C( 9058325420480777856), INT64_C( 1671679046805857561), INT64_C( 2192211482088520267), -INT64_C( 5263850109382293249) } }, + { + { { -INT64_C( 4268026330833859267) }, + { INT64_C( 7126217536348559249) }, + { -INT64_C( 7170797556664348509) }, + { INT64_C( 2533977268612225597) } }, + { -INT64_C( 4268026330833859267), INT64_C( 7126217536348559249), -INT64_C( 7170797556664348509), INT64_C( 2533977268612225597) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_int64x1x4_t r_ = { { simde_vld1_s64(test_vec[i].r[0]), + simde_vld1_s64(test_vec[i].r[1]), + simde_vld1_s64(test_vec[i].r[2]), + simde_vld1_s64(test_vec[i].r[3]) } }; + + SIMDE_ALIGN_TO_16 int64_t a_[4]; + simde_vst1_s64_x4(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_int64x1_t a = simde_test_arm_neon_random_i64x1(); + simde_int64x1_t b = simde_test_arm_neon_random_i64x1(); + simde_int64x1_t c = simde_test_arm_neon_random_i64x1(); + simde_int64x1_t d = simde_test_arm_neon_random_i64x1(); + simde_int64x1x4_t e = {{a, b, c, d}}; + + simde_test_arm_neon_write_i64x1x4(2, e, SIMDE_TEST_VEC_POS_FIRST); + + int64_t buf[4]; + simde_vst1_s64_x4(buf, e); + + simde_test_codegen_write_vi64(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1_u8_x4 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + uint8_t r[4][8]; + uint8_t a[32]; + } test_vec[] = { + { + { { UINT8_C(204), UINT8_C(205), UINT8_C(101), UINT8_C(118), UINT8_C(185), UINT8_C( 42), UINT8_C( 58), UINT8_C( 75) }, + { UINT8_C( 65), UINT8_C(113), UINT8_C( 25), UINT8_C( 88), UINT8_C(218), UINT8_C(254), UINT8_C(187), UINT8_C(126) }, + { UINT8_C( 79), UINT8_C(131), UINT8_C(220), UINT8_C(236), UINT8_C(184), UINT8_C( 88), UINT8_C(136), UINT8_C(246) }, + { UINT8_C( 51), UINT8_C( 20), UINT8_C(106), UINT8_C( 25), UINT8_C(146), UINT8_C(148), UINT8_C( 61), UINT8_C( 94) } }, + { UINT8_C(204), UINT8_C(205), UINT8_C(101), UINT8_C(118), UINT8_C(185), UINT8_C( 42), UINT8_C( 58), UINT8_C( 75), + UINT8_C( 65), UINT8_C(113), UINT8_C( 25), UINT8_C( 88), UINT8_C(218), UINT8_C(254), UINT8_C(187), UINT8_C(126), + UINT8_C( 79), UINT8_C(131), UINT8_C(220), UINT8_C(236), UINT8_C(184), UINT8_C( 88), UINT8_C(136), UINT8_C(246), + UINT8_C( 51), UINT8_C( 20), UINT8_C(106), UINT8_C( 25), UINT8_C(146), UINT8_C(148), UINT8_C( 61), UINT8_C( 94) } }, + { + { { UINT8_C( 97), UINT8_C(162), UINT8_C(213), UINT8_C( 27), UINT8_C(204), UINT8_C( 15), UINT8_C(102), UINT8_C( 14) }, + { UINT8_C(129), UINT8_C(127), UINT8_C(102), UINT8_C( 91), UINT8_C(125), UINT8_C( 33), UINT8_C(217), UINT8_C(204) }, + { UINT8_C(165), UINT8_C(181), UINT8_C(184), UINT8_C( 93), UINT8_C( 14), UINT8_C( 65), UINT8_C( 83), UINT8_C( 65) }, + { UINT8_C( 85), UINT8_C(189), UINT8_C( 90), UINT8_C(231), UINT8_C( 82), UINT8_C(151), UINT8_C( 70), UINT8_C(179) } }, + { UINT8_C( 97), UINT8_C(162), UINT8_C(213), UINT8_C( 27), UINT8_C(204), UINT8_C( 15), UINT8_C(102), UINT8_C( 14), + UINT8_C(129), UINT8_C(127), UINT8_C(102), UINT8_C( 91), UINT8_C(125), UINT8_C( 33), UINT8_C(217), UINT8_C(204), + UINT8_C(165), UINT8_C(181), UINT8_C(184), UINT8_C( 93), UINT8_C( 14), UINT8_C( 65), UINT8_C( 83), UINT8_C( 65), + UINT8_C( 85), UINT8_C(189), UINT8_C( 90), UINT8_C(231), UINT8_C( 82), UINT8_C(151), UINT8_C( 70), UINT8_C(179) } }, + { + { { UINT8_C( 58), UINT8_C( 27), UINT8_C(206), UINT8_C( 6), UINT8_C( 42), UINT8_C( 52), UINT8_C( 20), UINT8_C(171) }, + { UINT8_C(179), UINT8_C(123), UINT8_C( 7), UINT8_C( 49), UINT8_C(156), UINT8_C(224), UINT8_C(253), UINT8_C( 65) }, + { UINT8_C(150), UINT8_C(182), UINT8_C(159), UINT8_C(164), UINT8_C(247), UINT8_C(242), UINT8_C(229), UINT8_C( 76) }, + { UINT8_C(176), UINT8_C( 63), UINT8_C( 51), UINT8_C( 2), UINT8_C(215), UINT8_C(121), UINT8_C(181), UINT8_C( 17) } }, + { UINT8_C( 58), UINT8_C( 27), UINT8_C(206), UINT8_C( 6), UINT8_C( 42), UINT8_C( 52), UINT8_C( 20), UINT8_C(171), + UINT8_C(179), UINT8_C(123), UINT8_C( 7), UINT8_C( 49), UINT8_C(156), UINT8_C(224), UINT8_C(253), UINT8_C( 65), + UINT8_C(150), UINT8_C(182), UINT8_C(159), UINT8_C(164), UINT8_C(247), UINT8_C(242), UINT8_C(229), UINT8_C( 76), + UINT8_C(176), UINT8_C( 63), UINT8_C( 51), UINT8_C( 2), UINT8_C(215), UINT8_C(121), UINT8_C(181), UINT8_C( 17) } }, + { + { { UINT8_C(148), UINT8_C(132), UINT8_C( 23), UINT8_C(191), UINT8_C(184), UINT8_C( 44), UINT8_C(106), UINT8_C(108) }, + { UINT8_C(167), UINT8_C(113), UINT8_C(157), UINT8_C( 67), UINT8_C( 82), UINT8_C(154), UINT8_C(133), UINT8_C(232) }, + { UINT8_C( 80), UINT8_C( 36), UINT8_C(140), UINT8_C( 71), UINT8_C( 22), UINT8_C(113), UINT8_C(147), UINT8_C(198) }, + { UINT8_C(176), UINT8_C(199), UINT8_C(200), UINT8_C(135), UINT8_C( 64), UINT8_C(126), UINT8_C(152), UINT8_C(213) } }, + { UINT8_C(148), UINT8_C(132), UINT8_C( 23), UINT8_C(191), UINT8_C(184), UINT8_C( 44), UINT8_C(106), UINT8_C(108), + UINT8_C(167), UINT8_C(113), UINT8_C(157), UINT8_C( 67), UINT8_C( 82), UINT8_C(154), UINT8_C(133), UINT8_C(232), + UINT8_C( 80), UINT8_C( 36), UINT8_C(140), UINT8_C( 71), UINT8_C( 22), UINT8_C(113), UINT8_C(147), UINT8_C(198), + UINT8_C(176), UINT8_C(199), UINT8_C(200), UINT8_C(135), UINT8_C( 64), UINT8_C(126), UINT8_C(152), UINT8_C(213) } }, + { + { { UINT8_C( 2), UINT8_C(176), UINT8_C(148), UINT8_C(186), UINT8_C(220), UINT8_C(254), UINT8_C( 38), UINT8_C(131) }, + { UINT8_C(112), UINT8_C(195), UINT8_C(198), UINT8_C(194), UINT8_C( 94), UINT8_C( 75), UINT8_C(170), UINT8_C(174) }, + { UINT8_C(111), UINT8_C( 54), UINT8_C(246), UINT8_C(134), UINT8_C(167), UINT8_C(137), UINT8_C( 76), UINT8_C( 87) }, + { UINT8_C( 80), UINT8_C( 21), UINT8_C(223), UINT8_C(145), UINT8_C(147), UINT8_C(119), UINT8_C(102), UINT8_C(149) } }, + { UINT8_C( 2), UINT8_C(176), UINT8_C(148), UINT8_C(186), UINT8_C(220), UINT8_C(254), UINT8_C( 38), UINT8_C(131), + UINT8_C(112), UINT8_C(195), UINT8_C(198), UINT8_C(194), UINT8_C( 94), UINT8_C( 75), UINT8_C(170), UINT8_C(174), + UINT8_C(111), UINT8_C( 54), UINT8_C(246), UINT8_C(134), UINT8_C(167), UINT8_C(137), UINT8_C( 76), UINT8_C( 87), + UINT8_C( 80), UINT8_C( 21), UINT8_C(223), UINT8_C(145), UINT8_C(147), UINT8_C(119), UINT8_C(102), UINT8_C(149) } }, + { + { { UINT8_C( 39), UINT8_C(250), UINT8_C( 79), UINT8_C( 3), UINT8_C(248), UINT8_C(118), UINT8_C(134), UINT8_C(104) }, + { UINT8_C( 57), UINT8_C( 77), UINT8_C( 42), UINT8_C(151), UINT8_C(152), UINT8_C(212), UINT8_C( 70), UINT8_C( 8) }, + { UINT8_C( 10), UINT8_C( 60), UINT8_C(142), UINT8_C(177), UINT8_C(197), UINT8_C(218), UINT8_C( 9), UINT8_C( 22) }, + { UINT8_C(239), UINT8_C(232), UINT8_C(167), UINT8_C(130), UINT8_C( 95), UINT8_C( 13), UINT8_C( 23), UINT8_C(135) } }, + { UINT8_C( 39), UINT8_C(250), UINT8_C( 79), UINT8_C( 3), UINT8_C(248), UINT8_C(118), UINT8_C(134), UINT8_C(104), + UINT8_C( 57), UINT8_C( 77), UINT8_C( 42), UINT8_C(151), UINT8_C(152), UINT8_C(212), UINT8_C( 70), UINT8_C( 8), + UINT8_C( 10), UINT8_C( 60), UINT8_C(142), UINT8_C(177), UINT8_C(197), UINT8_C(218), UINT8_C( 9), UINT8_C( 22), + UINT8_C(239), UINT8_C(232), UINT8_C(167), UINT8_C(130), UINT8_C( 95), UINT8_C( 13), UINT8_C( 23), UINT8_C(135) } }, + { + { { UINT8_C( 7), UINT8_C(103), UINT8_C(138), UINT8_MAX, UINT8_C(221), UINT8_C( 17), UINT8_C(104), UINT8_C( 22) }, + { UINT8_C( 94), UINT8_C(146), UINT8_C(174), UINT8_C(246), UINT8_C(103), UINT8_C(244), UINT8_C(254), UINT8_C(113) }, + { UINT8_C( 48), UINT8_C(140), UINT8_C( 35), UINT8_C(245), UINT8_C(103), UINT8_C( 44), UINT8_C( 11), UINT8_C( 86) }, + { UINT8_C( 20), UINT8_C(178), UINT8_C(217), UINT8_C(115), UINT8_C(191), UINT8_C(240), UINT8_C(250), UINT8_C(198) } }, + { UINT8_C( 7), UINT8_C(103), UINT8_C(138), UINT8_MAX, UINT8_C(221), UINT8_C( 17), UINT8_C(104), UINT8_C( 22), + UINT8_C( 94), UINT8_C(146), UINT8_C(174), UINT8_C(246), UINT8_C(103), UINT8_C(244), UINT8_C(254), UINT8_C(113), + UINT8_C( 48), UINT8_C(140), UINT8_C( 35), UINT8_C(245), UINT8_C(103), UINT8_C( 44), UINT8_C( 11), UINT8_C( 86), + UINT8_C( 20), UINT8_C(178), UINT8_C(217), UINT8_C(115), UINT8_C(191), UINT8_C(240), UINT8_C(250), UINT8_C(198) } }, + { + { { UINT8_C( 87), UINT8_C(133), UINT8_C(198), UINT8_C( 52), UINT8_C(150), UINT8_C( 46), UINT8_C( 75), UINT8_C(244) }, + { UINT8_C(192), UINT8_C(249), UINT8_C(234), UINT8_C( 39), UINT8_C(237), UINT8_C(233), UINT8_C(153), UINT8_C( 29) }, + { UINT8_C(117), UINT8_C(188), UINT8_C( 18), UINT8_C(220), UINT8_C(232), UINT8_C( 30), UINT8_C( 51), UINT8_C(252) }, + { UINT8_C(208), UINT8_C( 12), UINT8_C(111), UINT8_C(144), UINT8_C(252), UINT8_C(106), UINT8_C( 86), UINT8_C( 84) } }, + { UINT8_C( 87), UINT8_C(133), UINT8_C(198), UINT8_C( 52), UINT8_C(150), UINT8_C( 46), UINT8_C( 75), UINT8_C(244), + UINT8_C(192), UINT8_C(249), UINT8_C(234), UINT8_C( 39), UINT8_C(237), UINT8_C(233), UINT8_C(153), UINT8_C( 29), + UINT8_C(117), UINT8_C(188), UINT8_C( 18), UINT8_C(220), UINT8_C(232), UINT8_C( 30), UINT8_C( 51), UINT8_C(252), + UINT8_C(208), UINT8_C( 12), UINT8_C(111), UINT8_C(144), UINT8_C(252), UINT8_C(106), UINT8_C( 86), UINT8_C( 84) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_uint8x8x4_t r_ = { { simde_vld1_u8(test_vec[i].r[0]), + simde_vld1_u8(test_vec[i].r[1]), + simde_vld1_u8(test_vec[i].r[2]), + simde_vld1_u8(test_vec[i].r[3]) } }; + + SIMDE_ALIGN_TO_16 uint8_t a_[32]; + simde_vst1_u8_x4(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_uint8x8_t a = simde_test_arm_neon_random_u8x8(); + simde_uint8x8_t b = simde_test_arm_neon_random_u8x8(); + simde_uint8x8_t c = simde_test_arm_neon_random_u8x8(); + simde_uint8x8_t d = simde_test_arm_neon_random_u8x8(); + simde_uint8x8x4_t e = {{a, b, c, d}}; + + simde_test_arm_neon_write_u8x8x4(2, e, SIMDE_TEST_VEC_POS_FIRST); + + uint8_t buf[32]; + simde_vst1_u8_x4(buf, e); + + simde_test_codegen_write_vu8(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1_u16_x4 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + uint16_t r[4][4]; + uint16_t a[16]; + } test_vec[] = { + { + { { UINT16_C( 7407), UINT16_C(34184), UINT16_C(54090), UINT16_C( 2937) }, + { UINT16_C(25548), UINT16_C(47410), UINT16_C(52044), UINT16_C(49878) }, + { UINT16_C(59783), UINT16_C(28574), UINT16_C(53511), UINT16_C(55147) }, + { UINT16_C(56285), UINT16_C(55911), UINT16_C(48709), UINT16_C(13358) } }, + { UINT16_C( 7407), UINT16_C(34184), UINT16_C(54090), UINT16_C( 2937), UINT16_C(25548), UINT16_C(47410), UINT16_C(52044), UINT16_C(49878), + UINT16_C(59783), UINT16_C(28574), UINT16_C(53511), UINT16_C(55147), UINT16_C(56285), UINT16_C(55911), UINT16_C(48709), UINT16_C(13358) } }, + { + { { UINT16_C(46810), UINT16_C( 9657), UINT16_C(12938), UINT16_C(22064) }, + { UINT16_C(25237), UINT16_C(57872), UINT16_C(58926), UINT16_C(46500) }, + { UINT16_C(17103), UINT16_C(54821), UINT16_C(36884), UINT16_C(61870) }, + { UINT16_C( 5483), UINT16_C(45259), UINT16_C(63955), UINT16_C(44772) } }, + { UINT16_C(46810), UINT16_C( 9657), UINT16_C(12938), UINT16_C(22064), UINT16_C(25237), UINT16_C(57872), UINT16_C(58926), UINT16_C(46500), + UINT16_C(17103), UINT16_C(54821), UINT16_C(36884), UINT16_C(61870), UINT16_C( 5483), UINT16_C(45259), UINT16_C(63955), UINT16_C(44772) } }, + { + { { UINT16_C(40368), UINT16_C(15059), UINT16_C( 975), UINT16_C(26000) }, + { UINT16_C(41061), UINT16_C(37703), UINT16_C(60295), UINT16_C(22089) }, + { UINT16_C(28205), UINT16_C(16685), UINT16_C(56318), UINT16_C(27187) }, + { UINT16_C(65264), UINT16_C(50202), UINT16_C(65528), UINT16_C(43122) } }, + { UINT16_C(40368), UINT16_C(15059), UINT16_C( 975), UINT16_C(26000), UINT16_C(41061), UINT16_C(37703), UINT16_C(60295), UINT16_C(22089), + UINT16_C(28205), UINT16_C(16685), UINT16_C(56318), UINT16_C(27187), UINT16_C(65264), UINT16_C(50202), UINT16_C(65528), UINT16_C(43122) } }, + { + { { UINT16_C(17820), UINT16_C(27874), UINT16_C(29256), UINT16_C(44497) }, + { UINT16_C( 6163), UINT16_C(39489), UINT16_C(35331), UINT16_C(12528) }, + { UINT16_C( 7672), UINT16_C(63090), UINT16_C(42488), UINT16_C(59744) }, + { UINT16_C(31651), UINT16_C(39853), UINT16_C( 8058), UINT16_C( 5699) } }, + { UINT16_C(17820), UINT16_C(27874), UINT16_C(29256), UINT16_C(44497), UINT16_C( 6163), UINT16_C(39489), UINT16_C(35331), UINT16_C(12528), + UINT16_C( 7672), UINT16_C(63090), UINT16_C(42488), UINT16_C(59744), UINT16_C(31651), UINT16_C(39853), UINT16_C( 8058), UINT16_C( 5699) } }, + { + { { UINT16_C( 9572), UINT16_C(44162), UINT16_C(21400), UINT16_C(43865) }, + { UINT16_C(39531), UINT16_C(28229), UINT16_C(13604), UINT16_C( 7327) }, + { UINT16_C( 4435), UINT16_C(19219), UINT16_C(29622), UINT16_C(22836) }, + { UINT16_C(57838), UINT16_C(26869), UINT16_C(14336), UINT16_C(25727) } }, + { UINT16_C( 9572), UINT16_C(44162), UINT16_C(21400), UINT16_C(43865), UINT16_C(39531), UINT16_C(28229), UINT16_C(13604), UINT16_C( 7327), + UINT16_C( 4435), UINT16_C(19219), UINT16_C(29622), UINT16_C(22836), UINT16_C(57838), UINT16_C(26869), UINT16_C(14336), UINT16_C(25727) } }, + { + { { UINT16_C( 350), UINT16_C(62992), UINT16_C(27221), UINT16_C(49313) }, + { UINT16_C(58884), UINT16_C(10543), UINT16_C(52763), UINT16_C(28229) }, + { UINT16_C(22751), UINT16_C(38330), UINT16_C(61132), UINT16_C(47854) }, + { UINT16_C(58320), UINT16_C(53283), UINT16_C(41500), UINT16_C(31285) } }, + { UINT16_C( 350), UINT16_C(62992), UINT16_C(27221), UINT16_C(49313), UINT16_C(58884), UINT16_C(10543), UINT16_C(52763), UINT16_C(28229), + UINT16_C(22751), UINT16_C(38330), UINT16_C(61132), UINT16_C(47854), UINT16_C(58320), UINT16_C(53283), UINT16_C(41500), UINT16_C(31285) } }, + { + { { UINT16_C(17827), UINT16_C(63600), UINT16_C( 4527), UINT16_C(46265) }, + { UINT16_C(59639), UINT16_C( 4829), UINT16_C( 8886), UINT16_C(38273) }, + { UINT16_C(15227), UINT16_C(18218), UINT16_C( 6185), UINT16_C(63745) }, + { UINT16_C( 9468), UINT16_C( 6346), UINT16_C(65478), UINT16_C(27282) } }, + { UINT16_C(17827), UINT16_C(63600), UINT16_C( 4527), UINT16_C(46265), UINT16_C(59639), UINT16_C( 4829), UINT16_C( 8886), UINT16_C(38273), + UINT16_C(15227), UINT16_C(18218), UINT16_C( 6185), UINT16_C(63745), UINT16_C( 9468), UINT16_C( 6346), UINT16_C(65478), UINT16_C(27282) } }, + { + { { UINT16_C( 580), UINT16_C(62562), UINT16_C( 6931), UINT16_C( 2728) }, + { UINT16_C(34051), UINT16_C(47388), UINT16_C(40359), UINT16_C( 8782) }, + { UINT16_C(30936), UINT16_C( 617), UINT16_C(27537), UINT16_C(36347) }, + { UINT16_C(50575), UINT16_C(22181), UINT16_C(14276), UINT16_C( 2496) } }, + { UINT16_C( 580), UINT16_C(62562), UINT16_C( 6931), UINT16_C( 2728), UINT16_C(34051), UINT16_C(47388), UINT16_C(40359), UINT16_C( 8782), + UINT16_C(30936), UINT16_C( 617), UINT16_C(27537), UINT16_C(36347), UINT16_C(50575), UINT16_C(22181), UINT16_C(14276), UINT16_C( 2496) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_uint16x4x4_t r_ = { { simde_vld1_u16(test_vec[i].r[0]), + simde_vld1_u16(test_vec[i].r[1]), + simde_vld1_u16(test_vec[i].r[2]), + simde_vld1_u16(test_vec[i].r[3]) } }; + + SIMDE_ALIGN_TO_16 uint16_t a_[16]; + simde_vst1_u16_x4(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_uint16x4_t a = simde_test_arm_neon_random_u16x4(); + simde_uint16x4_t b = simde_test_arm_neon_random_u16x4(); + simde_uint16x4_t c = simde_test_arm_neon_random_u16x4(); + simde_uint16x4_t d = simde_test_arm_neon_random_u16x4(); + simde_uint16x4x4_t e = {{a, b, c, d}}; + + simde_test_arm_neon_write_u16x4x4(2, e, SIMDE_TEST_VEC_POS_FIRST); + + uint16_t buf[16]; + simde_vst1_u16_x4(buf, e); + + simde_test_codegen_write_vu16(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1_u32_x4 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + uint32_t r[4][2]; + uint32_t a[8]; + } test_vec[] = { + { + { { UINT32_C(1291657785), UINT32_C(1096197438) }, + { UINT32_C(3522916906), UINT32_C(3908323600) }, + { UINT32_C(1407868354), UINT32_C(1491134152) }, + { UINT32_C(1890485675), UINT32_C(4118376124) } }, + { UINT32_C(1291657785), UINT32_C(1096197438), UINT32_C(3522916906), UINT32_C(3908323600), UINT32_C(1407868354), UINT32_C(1491134152), UINT32_C(1890485675), UINT32_C(4118376124) } }, + { + { { UINT32_C(3460396688), UINT32_C(1158715163) }, + { UINT32_C( 420875017), UINT32_C( 369232468) }, + { UINT32_C( 812248168), UINT32_C(2122861010) }, + { UINT32_C(2330867406), UINT32_C( 897542052) } }, + { UINT32_C(3460396688), UINT32_C(1158715163), UINT32_C( 420875017), UINT32_C( 369232468), UINT32_C( 812248168), UINT32_C(2122861010), UINT32_C(2330867406), UINT32_C( 897542052) } }, + { + { { UINT32_C(4160995549), UINT32_C(1631392599) }, + { UINT32_C(1937396510), UINT32_C(3330899038) }, + { UINT32_C(1006039913), UINT32_C( 196706108) }, + { UINT32_C(1519757237), UINT32_C(3952022798) } }, + { UINT32_C(4160995549), UINT32_C(1631392599), UINT32_C(1937396510), UINT32_C(3330899038), UINT32_C(1006039913), UINT32_C( 196706108), UINT32_C(1519757237), UINT32_C(3952022798) } }, + { + { { UINT32_C( 769888981), UINT32_C(3297648806) }, + { UINT32_C(3526822004), UINT32_C(4002988421) }, + { UINT32_C(4029255348), UINT32_C(3288064781) }, + { UINT32_C(2568851850), UINT32_C(2072292518) } }, + { UINT32_C( 769888981), UINT32_C(3297648806), UINT32_C(3526822004), UINT32_C(4002988421), UINT32_C(4029255348), UINT32_C(3288064781), UINT32_C(2568851850), UINT32_C(2072292518) } }, + { + { { UINT32_C(3836241982), UINT32_C(4238947976) }, + { UINT32_C(3301892159), UINT32_C(1437755041) }, + { UINT32_C( 38198261), UINT32_C(1237664190) }, + { UINT32_C(2028135122), UINT32_C(3455346318) } }, + { UINT32_C(3836241982), UINT32_C(4238947976), UINT32_C(3301892159), UINT32_C(1437755041), UINT32_C( 38198261), UINT32_C(1237664190), UINT32_C(2028135122), UINT32_C(3455346318) } }, + { + { { UINT32_C(1471257806), UINT32_C( 307452627) }, + { UINT32_C(3705020987), UINT32_C(2100463752) }, + { UINT32_C( 578844771), UINT32_C(2355840441) }, + { UINT32_C(3053735208), UINT32_C(2189686963) } }, + { UINT32_C(1471257806), UINT32_C( 307452627), UINT32_C(3705020987), UINT32_C(2100463752), UINT32_C( 578844771), UINT32_C(2355840441), UINT32_C(3053735208), UINT32_C(2189686963) } }, + { + { { UINT32_C(1759065493), UINT32_C(3397004431) }, + { UINT32_C(3618066510), UINT32_C( 995416536) }, + { UINT32_C( 173921361), UINT32_C(1117177882) }, + { UINT32_C(3388513045), UINT32_C( 676035731) } }, + { UINT32_C(1759065493), UINT32_C(3397004431), UINT32_C(3618066510), UINT32_C( 995416536), UINT32_C( 173921361), UINT32_C(1117177882), UINT32_C(3388513045), UINT32_C( 676035731) } }, + { + { { UINT32_C(1083188401), UINT32_C(2668300880) }, + { UINT32_C( 846639706), UINT32_C(3698248331) }, + { UINT32_C(3118910367), UINT32_C(2851831188) }, + { UINT32_C(2876437272), UINT32_C( 550813039) } }, + { UINT32_C(1083188401), UINT32_C(2668300880), UINT32_C( 846639706), UINT32_C(3698248331), UINT32_C(3118910367), UINT32_C(2851831188), UINT32_C(2876437272), UINT32_C( 550813039) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_uint32x2x4_t r_ = { { simde_vld1_u32(test_vec[i].r[0]), + simde_vld1_u32(test_vec[i].r[1]), + simde_vld1_u32(test_vec[i].r[2]), + simde_vld1_u32(test_vec[i].r[3]) } }; + + SIMDE_ALIGN_TO_16 uint32_t a_[8]; + simde_vst1_u32_x4(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_uint32x2_t a = simde_test_arm_neon_random_u32x2(); + simde_uint32x2_t b = simde_test_arm_neon_random_u32x2(); + simde_uint32x2_t c = simde_test_arm_neon_random_u32x2(); + simde_uint32x2_t d = simde_test_arm_neon_random_u32x2(); + simde_uint32x2x4_t e = {{a, b, c, d}}; + + simde_test_arm_neon_write_u32x2x4(2, e, SIMDE_TEST_VEC_POS_FIRST); + + uint32_t buf[8]; + simde_vst1_u32_x4(buf, e); + + simde_test_codegen_write_vu32(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1_u64_x4 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + uint64_t r[4][1]; + uint64_t a[4]; + } test_vec[] = { + { + { { UINT64_C(14542523896598455521) }, + { UINT64_C(12719689346676705054) }, + { UINT64_C( 32480573296044853) }, + { UINT64_C( 9577046048521381208) } }, + { UINT64_C(14542523896598455521), UINT64_C(12719689346676705054), UINT64_C( 32480573296044853), UINT64_C( 9577046048521381208) } }, + { + { { UINT64_C(15212464329190689252) }, + { UINT64_C(13299131365543647694) }, + { UINT64_C(13138677273433668204) }, + { UINT64_C( 7350550248164295130) } }, + { UINT64_C(15212464329190689252), UINT64_C(13299131365543647694), UINT64_C(13138677273433668204), UINT64_C( 7350550248164295130) } }, + { + { { UINT64_C( 1024523012306221231) }, + { UINT64_C( 2318086846211339247) }, + { UINT64_C( 8975335007655931257) }, + { UINT64_C( 2428843666941021388) } }, + { UINT64_C( 1024523012306221231), UINT64_C( 2318086846211339247), UINT64_C( 8975335007655931257), UINT64_C( 2428843666941021388) } }, + { + { { UINT64_C( 3675988725210639796) }, + { UINT64_C(16808508513841508719) }, + { UINT64_C( 5808605048304941438) }, + { UINT64_C( 5183171011618444891) } }, + { UINT64_C( 3675988725210639796), UINT64_C(16808508513841508719), UINT64_C( 5808605048304941438), UINT64_C( 5183171011618444891) } }, + { + { { UINT64_C(11400649353367090112) }, + { UINT64_C( 3209382832522779952) }, + { UINT64_C(17695462734621854653) }, + { UINT64_C( 4853104150470340735) } }, + { UINT64_C(11400649353367090112), UINT64_C( 3209382832522779952), UINT64_C(17695462734621854653), UINT64_C( 4853104150470340735) } }, + { + { { UINT64_C( 283866222607963171) }, + { UINT64_C( 8302154693671629148) }, + { UINT64_C(17007639947772199800) }, + { UINT64_C(11258250824909769079) } }, + { UINT64_C( 283866222607963171), UINT64_C( 8302154693671629148), UINT64_C(17007639947772199800), UINT64_C(11258250824909769079) } }, + { + { { UINT64_C( 6827982613444986091) }, + { UINT64_C( 844601480222172559) }, + { UINT64_C( 3061363299852315683) }, + { UINT64_C(13548061131060574958) } }, + { UINT64_C( 6827982613444986091), UINT64_C( 844601480222172559), UINT64_C( 3061363299852315683), UINT64_C(13548061131060574958) } }, + { + { { UINT64_C( 7009356742278247397) }, + { UINT64_C( 8232402338135322529) }, + { UINT64_C( 8117595947971796170) }, + { UINT64_C( 1262938830447102968) } }, + { UINT64_C( 7009356742278247397), UINT64_C( 8232402338135322529), UINT64_C( 8117595947971796170), UINT64_C( 1262938830447102968) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_uint64x1x4_t r_ = { { simde_vld1_u64(test_vec[i].r[0]), + simde_vld1_u64(test_vec[i].r[1]), + simde_vld1_u64(test_vec[i].r[2]), + simde_vld1_u64(test_vec[i].r[3]) } }; + + SIMDE_ALIGN_TO_16 uint64_t a_[4]; + simde_vst1_u64_x4(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_uint64x1_t a = simde_test_arm_neon_random_u64x1(); + simde_uint64x1_t b = simde_test_arm_neon_random_u64x1(); + simde_uint64x1_t c = simde_test_arm_neon_random_u64x1(); + simde_uint64x1_t d = simde_test_arm_neon_random_u64x1(); + simde_uint64x1x4_t e = {{a, b, c, d}}; + + simde_test_arm_neon_write_u64x1x4(2, e, SIMDE_TEST_VEC_POS_FIRST); + + uint64_t buf[4]; + simde_vst1_u64_x4(buf, e); + + simde_test_codegen_write_vu64(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +#endif /* !defined(SIMDE_BUG_INTEL_857088) */ + +SIMDE_TEST_FUNC_LIST_BEGIN +#if !defined(SIMDE_BUG_INTEL_857088) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1_f32_x4) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1_f64_x4) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1_s8_x4) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1_s16_x4) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1_s32_x4) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1_s64_x4) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1_u8_x4) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1_u16_x4) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1_u32_x4) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1_u64_x4) +#endif /* !defined(SIMDE_BUG_INTEL_857088) */ +SIMDE_TEST_FUNC_LIST_END + +#include "test-neon-footer.h" diff --git a/test/arm/neon/st1q_x2.c b/test/arm/neon/st1q_x2.c new file mode 100644 index 000000000..d6228ece9 --- /dev/null +++ b/test/arm/neon/st1q_x2.c @@ -0,0 +1,830 @@ + +#include "test/test.h" +#define SIMDE_TEST_ARM_NEON_INSN st1q_x2 +#include "test-neon.h" +#include "../../../simde/arm/neon/st1q_x2.h" + +#if !defined(SIMDE_BUG_INTEL_857088) + +static int +test_simde_vst1q_f32_x2 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + simde_float32 r[2][4]; + simde_float32 a[8]; + } test_vec[] = { + { + { { SIMDE_FLOAT32_C( -814.14), SIMDE_FLOAT32_C( -94.07), SIMDE_FLOAT32_C( 948.70), SIMDE_FLOAT32_C( -406.94) }, + { SIMDE_FLOAT32_C( 726.28), SIMDE_FLOAT32_C( 949.91), SIMDE_FLOAT32_C( -352.52), SIMDE_FLOAT32_C( 185.24) } }, + { SIMDE_FLOAT32_C( -814.14), SIMDE_FLOAT32_C( -94.07), SIMDE_FLOAT32_C( 948.70), SIMDE_FLOAT32_C( -406.94), + SIMDE_FLOAT32_C( 726.28), SIMDE_FLOAT32_C( 949.91), SIMDE_FLOAT32_C( -352.52), SIMDE_FLOAT32_C( 185.24) } }, + { + { { SIMDE_FLOAT32_C( 286.92), SIMDE_FLOAT32_C( 764.27), SIMDE_FLOAT32_C( -522.50), SIMDE_FLOAT32_C( 86.44) }, + { SIMDE_FLOAT32_C( 133.06), SIMDE_FLOAT32_C( 598.10), SIMDE_FLOAT32_C( 639.80), SIMDE_FLOAT32_C( 910.39) } }, + { SIMDE_FLOAT32_C( 286.92), SIMDE_FLOAT32_C( 764.27), SIMDE_FLOAT32_C( -522.50), SIMDE_FLOAT32_C( 86.44), + SIMDE_FLOAT32_C( 133.06), SIMDE_FLOAT32_C( 598.10), SIMDE_FLOAT32_C( 639.80), SIMDE_FLOAT32_C( 910.39) } }, + { + { { SIMDE_FLOAT32_C( -462.75), SIMDE_FLOAT32_C( -168.94), SIMDE_FLOAT32_C( 654.57), SIMDE_FLOAT32_C( -619.06) }, + { SIMDE_FLOAT32_C( -663.52), SIMDE_FLOAT32_C( -730.61), SIMDE_FLOAT32_C( 624.00), SIMDE_FLOAT32_C( 502.46) } }, + { SIMDE_FLOAT32_C( -462.75), SIMDE_FLOAT32_C( -168.94), SIMDE_FLOAT32_C( 654.57), SIMDE_FLOAT32_C( -619.06), + SIMDE_FLOAT32_C( -663.52), SIMDE_FLOAT32_C( -730.61), SIMDE_FLOAT32_C( 624.00), SIMDE_FLOAT32_C( 502.46) } }, + { + { { SIMDE_FLOAT32_C( 356.79), SIMDE_FLOAT32_C( -915.72), SIMDE_FLOAT32_C( 439.28), SIMDE_FLOAT32_C( 204.87) }, + { SIMDE_FLOAT32_C( -612.34), SIMDE_FLOAT32_C( -70.37), SIMDE_FLOAT32_C( 33.68), SIMDE_FLOAT32_C( -426.49) } }, + { SIMDE_FLOAT32_C( 356.79), SIMDE_FLOAT32_C( -915.72), SIMDE_FLOAT32_C( 439.28), SIMDE_FLOAT32_C( 204.87), + SIMDE_FLOAT32_C( -612.34), SIMDE_FLOAT32_C( -70.37), SIMDE_FLOAT32_C( 33.68), SIMDE_FLOAT32_C( -426.49) } }, + { + { { SIMDE_FLOAT32_C( 835.56), SIMDE_FLOAT32_C( -17.62), SIMDE_FLOAT32_C( 166.58), SIMDE_FLOAT32_C( 561.84) }, + { SIMDE_FLOAT32_C( -67.72), SIMDE_FLOAT32_C( 814.06), SIMDE_FLOAT32_C( -252.91), SIMDE_FLOAT32_C( -780.80) } }, + { SIMDE_FLOAT32_C( 835.56), SIMDE_FLOAT32_C( -17.62), SIMDE_FLOAT32_C( 166.58), SIMDE_FLOAT32_C( 561.84), + SIMDE_FLOAT32_C( -67.72), SIMDE_FLOAT32_C( 814.06), SIMDE_FLOAT32_C( -252.91), SIMDE_FLOAT32_C( -780.80) } }, + { + { { SIMDE_FLOAT32_C( 578.33), SIMDE_FLOAT32_C( 224.58), SIMDE_FLOAT32_C( 305.65), SIMDE_FLOAT32_C( -288.61) }, + { SIMDE_FLOAT32_C( -177.32), SIMDE_FLOAT32_C( -54.55), SIMDE_FLOAT32_C( -378.22), SIMDE_FLOAT32_C( 359.94) } }, + { SIMDE_FLOAT32_C( 578.33), SIMDE_FLOAT32_C( 224.58), SIMDE_FLOAT32_C( 305.65), SIMDE_FLOAT32_C( -288.61), + SIMDE_FLOAT32_C( -177.32), SIMDE_FLOAT32_C( -54.55), SIMDE_FLOAT32_C( -378.22), SIMDE_FLOAT32_C( 359.94) } }, + { + { { SIMDE_FLOAT32_C( 776.51), SIMDE_FLOAT32_C( -723.65), SIMDE_FLOAT32_C( 740.87), SIMDE_FLOAT32_C( -887.01) }, + { SIMDE_FLOAT32_C( -454.26), SIMDE_FLOAT32_C( 364.87), SIMDE_FLOAT32_C( 615.45), SIMDE_FLOAT32_C( 902.53) } }, + { SIMDE_FLOAT32_C( 776.51), SIMDE_FLOAT32_C( -723.65), SIMDE_FLOAT32_C( 740.87), SIMDE_FLOAT32_C( -887.01), + SIMDE_FLOAT32_C( -454.26), SIMDE_FLOAT32_C( 364.87), SIMDE_FLOAT32_C( 615.45), SIMDE_FLOAT32_C( 902.53) } }, + { + { { SIMDE_FLOAT32_C( 449.16), SIMDE_FLOAT32_C( 54.72), SIMDE_FLOAT32_C( 107.41), SIMDE_FLOAT32_C( 836.82) }, + { SIMDE_FLOAT32_C( 984.35), SIMDE_FLOAT32_C( -858.92), SIMDE_FLOAT32_C( -589.67), SIMDE_FLOAT32_C( 819.91) } }, + { SIMDE_FLOAT32_C( 449.16), SIMDE_FLOAT32_C( 54.72), SIMDE_FLOAT32_C( 107.41), SIMDE_FLOAT32_C( 836.82), + SIMDE_FLOAT32_C( 984.35), SIMDE_FLOAT32_C( -858.92), SIMDE_FLOAT32_C( -589.67), SIMDE_FLOAT32_C( 819.91) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_float32x4x2_t r_ = { { simde_vld1q_f32(test_vec[i].r[0]), + simde_vld1q_f32(test_vec[i].r[1]) } }; + + SIMDE_ALIGN_TO_16 simde_float32 a_[8]; + simde_vst1q_f32_x2(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_float32x4_t a = simde_test_arm_neon_random_f32x4(-1000.0f, 1000.0f); + simde_float32x4_t b = simde_test_arm_neon_random_f32x4(-1000.0f, 1000.0f); + simde_float32x4x2_t c = {{a, b}}; + + simde_test_arm_neon_write_f32x4x2(2, c, SIMDE_TEST_VEC_POS_FIRST); + + simde_float32 buf[8]; + simde_vst1q_f32_x2(buf, c); + + simde_test_codegen_write_vf32(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1q_f64_x2 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + simde_float64 r[2][2]; + simde_float64 a[4]; + } test_vec[] = { + { + { { SIMDE_FLOAT64_C( 123.46), SIMDE_FLOAT64_C( 576.90) }, + { SIMDE_FLOAT64_C( 381.75), SIMDE_FLOAT64_C( -944.26) } }, + { SIMDE_FLOAT64_C( 123.46), SIMDE_FLOAT64_C( 576.90), SIMDE_FLOAT64_C( 381.75), SIMDE_FLOAT64_C( -944.26) } }, + { + { { SIMDE_FLOAT64_C( 390.96), SIMDE_FLOAT64_C( -871.16) }, + { SIMDE_FLOAT64_C( -725.05), SIMDE_FLOAT64_C( -30.71) } }, + { SIMDE_FLOAT64_C( 390.96), SIMDE_FLOAT64_C( -871.16), SIMDE_FLOAT64_C( -725.05), SIMDE_FLOAT64_C( -30.71) } }, + { + { { SIMDE_FLOAT64_C( 353.42), SIMDE_FLOAT64_C( 580.59) }, + { SIMDE_FLOAT64_C( 680.68), SIMDE_FLOAT64_C( -823.89) } }, + { SIMDE_FLOAT64_C( 353.42), SIMDE_FLOAT64_C( 580.59), SIMDE_FLOAT64_C( 680.68), SIMDE_FLOAT64_C( -823.89) } }, + { + { { SIMDE_FLOAT64_C( -473.96), SIMDE_FLOAT64_C( -697.54) }, + { SIMDE_FLOAT64_C( 536.04), SIMDE_FLOAT64_C( -697.45) } }, + { SIMDE_FLOAT64_C( -473.96), SIMDE_FLOAT64_C( -697.54), SIMDE_FLOAT64_C( 536.04), SIMDE_FLOAT64_C( -697.45) } }, + { + { { SIMDE_FLOAT64_C( -421.19), SIMDE_FLOAT64_C( 276.92) }, + { SIMDE_FLOAT64_C( -584.46), SIMDE_FLOAT64_C( 124.55) } }, + { SIMDE_FLOAT64_C( -421.19), SIMDE_FLOAT64_C( 276.92), SIMDE_FLOAT64_C( -584.46), SIMDE_FLOAT64_C( 124.55) } }, + { + { { SIMDE_FLOAT64_C( -358.21), SIMDE_FLOAT64_C( -969.01) }, + { SIMDE_FLOAT64_C( 27.09), SIMDE_FLOAT64_C( -909.05) } }, + { SIMDE_FLOAT64_C( -358.21), SIMDE_FLOAT64_C( -969.01), SIMDE_FLOAT64_C( 27.09), SIMDE_FLOAT64_C( -909.05) } }, + { + { { SIMDE_FLOAT64_C( 85.71), SIMDE_FLOAT64_C( -865.51) }, + { SIMDE_FLOAT64_C( 927.77), SIMDE_FLOAT64_C( 70.06) } }, + { SIMDE_FLOAT64_C( 85.71), SIMDE_FLOAT64_C( -865.51), SIMDE_FLOAT64_C( 927.77), SIMDE_FLOAT64_C( 70.06) } }, + { + { { SIMDE_FLOAT64_C( -724.43), SIMDE_FLOAT64_C( -661.90) }, + { SIMDE_FLOAT64_C( -110.03), SIMDE_FLOAT64_C( 399.03) } }, + { SIMDE_FLOAT64_C( -724.43), SIMDE_FLOAT64_C( -661.90), SIMDE_FLOAT64_C( -110.03), SIMDE_FLOAT64_C( 399.03) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_float64x2x2_t r_ = { { simde_vld1q_f64(test_vec[i].r[0]), + simde_vld1q_f64(test_vec[i].r[1]) } }; + + SIMDE_ALIGN_TO_16 simde_float64 a_[4]; + simde_vst1q_f64_x2(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_float64x2_t a = simde_test_arm_neon_random_f64x2(-1000.0, 1000.0); + simde_float64x2_t b = simde_test_arm_neon_random_f64x2(-1000.0, 1000.0); + simde_float64x2x2_t c = {{a, b}}; + + simde_test_arm_neon_write_f64x2x2(2, c, SIMDE_TEST_VEC_POS_FIRST); + + simde_float64 buf[4]; + simde_vst1q_f64_x2(buf, c); + + simde_test_codegen_write_vf64(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1q_s8_x2 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + int8_t r[2][16]; + int8_t a[32]; + } test_vec[] = { + { + { { INT8_C( 96), INT8_C( 3), -INT8_C( 74), INT8_C( 109), -INT8_C( 64), -INT8_C( 106), INT8_C( 64), -INT8_C( 117), + INT8_C( 56), INT8_C( 41), INT8_C( 41), INT8_C( 117), -INT8_C( 27), INT8_C( 101), -INT8_C( 63), INT8_C( 97) }, + { -INT8_C( 39), -INT8_C( 25), -INT8_C( 81), INT8_C( 85), INT8_C( 34), -INT8_C( 5), -INT8_C( 58), -INT8_C( 114), + -INT8_C( 121), -INT8_C( 34), INT8_C( 23), -INT8_C( 116), -INT8_C( 57), INT8_C( 82), INT8_C( 68), INT8_C( 39) } }, + { INT8_C( 96), INT8_C( 3), -INT8_C( 74), INT8_C( 109), -INT8_C( 64), -INT8_C( 106), INT8_C( 64), -INT8_C( 117), + INT8_C( 56), INT8_C( 41), INT8_C( 41), INT8_C( 117), -INT8_C( 27), INT8_C( 101), -INT8_C( 63), INT8_C( 97), + -INT8_C( 39), -INT8_C( 25), -INT8_C( 81), INT8_C( 85), INT8_C( 34), -INT8_C( 5), -INT8_C( 58), -INT8_C( 114), + -INT8_C( 121), -INT8_C( 34), INT8_C( 23), -INT8_C( 116), -INT8_C( 57), INT8_C( 82), INT8_C( 68), INT8_C( 39) } }, + { + { { INT8_C( 86), -INT8_C( 6), -INT8_C( 107), INT8_C( 22), -INT8_C( 112), -INT8_C( 43), -INT8_C( 95), -INT8_C( 56), + -INT8_C( 2), -INT8_C( 54), INT8_C( 62), -INT8_C( 29), INT8_C( 48), -INT8_C( 1), INT8_C( 68), INT8_C( 9) }, + { -INT8_C( 26), -INT8_C( 13), INT8_C( 94), INT8_C( 8), -INT8_C( 17), INT8_C( 37), -INT8_C( 105), INT8_C( 118), + INT8_C( 3), -INT8_C( 82), INT8_C( 2), -INT8_C( 54), INT8_C( 1), INT8_C( 70), -INT8_C( 15), INT8_C( 87) } }, + { INT8_C( 86), -INT8_C( 6), -INT8_C( 107), INT8_C( 22), -INT8_C( 112), -INT8_C( 43), -INT8_C( 95), -INT8_C( 56), + -INT8_C( 2), -INT8_C( 54), INT8_C( 62), -INT8_C( 29), INT8_C( 48), -INT8_C( 1), INT8_C( 68), INT8_C( 9), + -INT8_C( 26), -INT8_C( 13), INT8_C( 94), INT8_C( 8), -INT8_C( 17), INT8_C( 37), -INT8_C( 105), INT8_C( 118), + INT8_C( 3), -INT8_C( 82), INT8_C( 2), -INT8_C( 54), INT8_C( 1), INT8_C( 70), -INT8_C( 15), INT8_C( 87) } }, + { + { { INT8_C( 64), -INT8_C( 122), INT8_C( 109), -INT8_C( 48), INT8_C( 91), INT8_C( 14), -INT8_C( 103), INT8_C( 89), + -INT8_C( 39), -INT8_C( 41), INT8_C( 61), INT8_C( 9), -INT8_C( 42), -INT8_C( 127), INT8_C( 18), -INT8_C( 67) }, + { INT8_C( 117), INT8_C( 113), -INT8_C( 59), INT8_C( 100), -INT8_C( 106), INT8_C( 92), -INT8_C( 38), -INT8_C( 103), + INT8_C( 11), -INT8_C( 35), INT8_C( 99), INT8_C( 12), INT8_C( 35), INT8_C( 84), INT8_C( 99), INT8_C( 100) } }, + { INT8_C( 64), -INT8_C( 122), INT8_C( 109), -INT8_C( 48), INT8_C( 91), INT8_C( 14), -INT8_C( 103), INT8_C( 89), + -INT8_C( 39), -INT8_C( 41), INT8_C( 61), INT8_C( 9), -INT8_C( 42), -INT8_C( 127), INT8_C( 18), -INT8_C( 67), + INT8_C( 117), INT8_C( 113), -INT8_C( 59), INT8_C( 100), -INT8_C( 106), INT8_C( 92), -INT8_C( 38), -INT8_C( 103), + INT8_C( 11), -INT8_C( 35), INT8_C( 99), INT8_C( 12), INT8_C( 35), INT8_C( 84), INT8_C( 99), INT8_C( 100) } }, + { + { { -INT8_C( 37), -INT8_C( 48), INT8_C( 52), INT8_C( 54), -INT8_C( 34), -INT8_C( 51), -INT8_C( 112), -INT8_C( 73), + -INT8_C( 92), -INT8_C( 51), -INT8_C( 64), INT8_C( 123), INT8_C( 78), -INT8_C( 45), INT8_C( 56), -INT8_C( 61) }, + { INT8_C( 68), -INT8_C( 3), INT8_C( 39), -INT8_C( 38), INT8_C( 90), INT8_C( 2), INT8_C( 115), INT8_C( 101), + -INT8_C( 33), -INT8_C( 42), INT8_C( 113), INT8_C( 2), INT8_C( 42), -INT8_C( 44), INT8_C( 102), INT8_C( 5) } }, + { -INT8_C( 37), -INT8_C( 48), INT8_C( 52), INT8_C( 54), -INT8_C( 34), -INT8_C( 51), -INT8_C( 112), -INT8_C( 73), + -INT8_C( 92), -INT8_C( 51), -INT8_C( 64), INT8_C( 123), INT8_C( 78), -INT8_C( 45), INT8_C( 56), -INT8_C( 61), + INT8_C( 68), -INT8_C( 3), INT8_C( 39), -INT8_C( 38), INT8_C( 90), INT8_C( 2), INT8_C( 115), INT8_C( 101), + -INT8_C( 33), -INT8_C( 42), INT8_C( 113), INT8_C( 2), INT8_C( 42), -INT8_C( 44), INT8_C( 102), INT8_C( 5) } }, + { + { { -INT8_C( 92), -INT8_C( 101), INT8_C( 60), -INT8_C( 126), INT8_C( 104), -INT8_C( 52), INT8_C( 58), INT8_C( 13), + -INT8_C( 103), -INT8_C( 6), -INT8_C( 120), -INT8_C( 25), -INT8_C( 51), -INT8_C( 64), -INT8_C( 85), INT8_C( 17) }, + { -INT8_C( 67), -INT8_C( 46), -INT8_C( 21), INT8_C( 23), -INT8_C( 44), INT8_C( 94), INT8_C( 124), -INT8_C( 77), + INT8_C( 52), -INT8_C( 19), -INT8_C( 74), INT8_C( 95), -INT8_C( 63), INT8_C( 28), INT8_C( 100), INT8_C( 101) } }, + { -INT8_C( 92), -INT8_C( 101), INT8_C( 60), -INT8_C( 126), INT8_C( 104), -INT8_C( 52), INT8_C( 58), INT8_C( 13), + -INT8_C( 103), -INT8_C( 6), -INT8_C( 120), -INT8_C( 25), -INT8_C( 51), -INT8_C( 64), -INT8_C( 85), INT8_C( 17), + -INT8_C( 67), -INT8_C( 46), -INT8_C( 21), INT8_C( 23), -INT8_C( 44), INT8_C( 94), INT8_C( 124), -INT8_C( 77), + INT8_C( 52), -INT8_C( 19), -INT8_C( 74), INT8_C( 95), -INT8_C( 63), INT8_C( 28), INT8_C( 100), INT8_C( 101) } }, + { + { { -INT8_C( 73), -INT8_C( 96), -INT8_C( 24), INT8_C( 32), INT8_C( 108), INT8_C( 34), INT8_C( 45), INT8_C( 5), + INT8_C( 28), -INT8_C( 75), -INT8_C( 19), -INT8_C( 22), INT8_C( 117), -INT8_C( 104), -INT8_C( 5), INT8_C( 50) }, + { INT8_C( 106), -INT8_C( 25), INT8_C( 74), INT8_C( 63), INT8_C( 69), -INT8_C( 58), -INT8_C( 14), INT8_C( 122), + -INT8_C( 76), -INT8_C( 88), -INT8_C( 39), INT8_C( 117), -INT8_C( 59), INT8_C( 61), -INT8_C( 37), INT8_C( 124) } }, + { -INT8_C( 73), -INT8_C( 96), -INT8_C( 24), INT8_C( 32), INT8_C( 108), INT8_C( 34), INT8_C( 45), INT8_C( 5), + INT8_C( 28), -INT8_C( 75), -INT8_C( 19), -INT8_C( 22), INT8_C( 117), -INT8_C( 104), -INT8_C( 5), INT8_C( 50), + INT8_C( 106), -INT8_C( 25), INT8_C( 74), INT8_C( 63), INT8_C( 69), -INT8_C( 58), -INT8_C( 14), INT8_C( 122), + -INT8_C( 76), -INT8_C( 88), -INT8_C( 39), INT8_C( 117), -INT8_C( 59), INT8_C( 61), -INT8_C( 37), INT8_C( 124) } }, + { + { { -INT8_C( 34), -INT8_C( 61), -INT8_C( 100), INT8_C( 74), -INT8_C( 27), -INT8_C( 55), INT8_C( 80), INT8_C( 1), + INT8_C( 126), INT8_C( 61), -INT8_C( 21), -INT8_C( 13), -INT8_C( 43), -INT8_C( 25), INT8_C( 38), INT8_C( 63) }, + { -INT8_C( 50), INT8_C( 112), INT8_C( 126), INT8_C( 19), INT8_C( 54), INT8_C( 113), -INT8_C( 115), -INT8_C( 22), + INT8_C( 25), INT8_C( 102), INT8_C( 96), -INT8_C( 34), -INT8_C( 92), INT8_C( 59), INT8_C( 91), -INT8_C( 126) } }, + { -INT8_C( 34), -INT8_C( 61), -INT8_C( 100), INT8_C( 74), -INT8_C( 27), -INT8_C( 55), INT8_C( 80), INT8_C( 1), + INT8_C( 126), INT8_C( 61), -INT8_C( 21), -INT8_C( 13), -INT8_C( 43), -INT8_C( 25), INT8_C( 38), INT8_C( 63), + -INT8_C( 50), INT8_C( 112), INT8_C( 126), INT8_C( 19), INT8_C( 54), INT8_C( 113), -INT8_C( 115), -INT8_C( 22), + INT8_C( 25), INT8_C( 102), INT8_C( 96), -INT8_C( 34), -INT8_C( 92), INT8_C( 59), INT8_C( 91), -INT8_C( 126) } }, + { + { { -INT8_C( 2), -INT8_C( 9), -INT8_C( 52), -INT8_C( 29), -INT8_C( 63), INT8_C( 28), -INT8_C( 28), INT8_C( 63), + INT8_C( 89), -INT8_C( 48), INT8_C( 51), INT8_C( 46), -INT8_C( 73), INT8_C( 89), INT8_C( 110), -INT8_C( 123) }, + { -INT8_C( 55), -INT8_C( 20), -INT8_C( 104), -INT8_C( 1), INT8_C( 93), INT8_C( 38), -INT8_C( 22), INT8_C( 119), + -INT8_C( 116), INT8_C( 74), INT8_C( 85), INT8_C( 48), -INT8_C( 123), -INT8_C( 80), -INT8_C( 78), -INT8_C( 125) } }, + { -INT8_C( 2), -INT8_C( 9), -INT8_C( 52), -INT8_C( 29), -INT8_C( 63), INT8_C( 28), -INT8_C( 28), INT8_C( 63), + INT8_C( 89), -INT8_C( 48), INT8_C( 51), INT8_C( 46), -INT8_C( 73), INT8_C( 89), INT8_C( 110), -INT8_C( 123), + -INT8_C( 55), -INT8_C( 20), -INT8_C( 104), -INT8_C( 1), INT8_C( 93), INT8_C( 38), -INT8_C( 22), INT8_C( 119), + -INT8_C( 116), INT8_C( 74), INT8_C( 85), INT8_C( 48), -INT8_C( 123), -INT8_C( 80), -INT8_C( 78), -INT8_C( 125) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_int8x16x2_t r_ = { { simde_vld1q_s8(test_vec[i].r[0]), + simde_vld1q_s8(test_vec[i].r[1]) } }; + + SIMDE_ALIGN_TO_16 int8_t a_[32]; + simde_vst1q_s8_x2(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_int8x16_t a = simde_test_arm_neon_random_i8x16(); + simde_int8x16_t b = simde_test_arm_neon_random_i8x16(); + simde_int8x16x2_t c = {{a, b}}; + + simde_test_arm_neon_write_i8x16x2(2, c, SIMDE_TEST_VEC_POS_FIRST); + + int8_t buf[32]; + simde_vst1q_s8_x2(buf, c); + + simde_test_codegen_write_vi8(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1q_s16_x2 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + int16_t r[2][8]; + int16_t a[16]; + } test_vec[] = { + { + { { INT16_C( 32680), INT16_C( 26982), INT16_C( 19099), -INT16_C( 2648), -INT16_C( 9446), -INT16_C( 11997), -INT16_C( 28364), -INT16_C( 682) }, + { -INT16_C( 4226), -INT16_C( 9219), -INT16_C( 6379), -INT16_C( 24238), -INT16_C( 22479), -INT16_C( 18734), -INT16_C( 31656), INT16_C( 57) } }, + { INT16_C( 32680), INT16_C( 26982), INT16_C( 19099), -INT16_C( 2648), -INT16_C( 9446), -INT16_C( 11997), -INT16_C( 28364), -INT16_C( 682), + -INT16_C( 4226), -INT16_C( 9219), -INT16_C( 6379), -INT16_C( 24238), -INT16_C( 22479), -INT16_C( 18734), -INT16_C( 31656), INT16_C( 57) } }, + { + { { -INT16_C( 24829), -INT16_C( 24727), INT16_C( 4841), INT16_C( 1172), -INT16_C( 18451), INT16_C( 8917), INT16_C( 11337), -INT16_C( 14561) }, + { INT16_C( 7195), INT16_C( 12450), -INT16_C( 2813), INT16_C( 13521), -INT16_C( 23651), -INT16_C( 2582), INT16_C( 9000), INT16_C( 11254) } }, + { -INT16_C( 24829), -INT16_C( 24727), INT16_C( 4841), INT16_C( 1172), -INT16_C( 18451), INT16_C( 8917), INT16_C( 11337), -INT16_C( 14561), + INT16_C( 7195), INT16_C( 12450), -INT16_C( 2813), INT16_C( 13521), -INT16_C( 23651), -INT16_C( 2582), INT16_C( 9000), INT16_C( 11254) } }, + { + { { INT16_C( 24514), -INT16_C( 21302), INT16_C( 24177), INT16_C( 24496), -INT16_C( 31466), INT16_C( 24449), -INT16_C( 24399), -INT16_C( 13274) }, + { -INT16_C( 14147), -INT16_C( 16132), -INT16_C( 12611), INT16_C( 23285), -INT16_C( 8335), -INT16_C( 26288), INT16_C( 17923), -INT16_C( 14907) } }, + { INT16_C( 24514), -INT16_C( 21302), INT16_C( 24177), INT16_C( 24496), -INT16_C( 31466), INT16_C( 24449), -INT16_C( 24399), -INT16_C( 13274), + -INT16_C( 14147), -INT16_C( 16132), -INT16_C( 12611), INT16_C( 23285), -INT16_C( 8335), -INT16_C( 26288), INT16_C( 17923), -INT16_C( 14907) } }, + { + { { -INT16_C( 28763), INT16_C( 6001), INT16_C( 8686), INT16_C( 1142), -INT16_C( 2137), INT16_C( 22627), -INT16_C( 30313), INT16_C( 21541) }, + { INT16_C( 8529), INT16_C( 3861), INT16_C( 2799), INT16_C( 24937), -INT16_C( 17943), -INT16_C( 4870), -INT16_C( 16385), -INT16_C( 23118) } }, + { -INT16_C( 28763), INT16_C( 6001), INT16_C( 8686), INT16_C( 1142), -INT16_C( 2137), INT16_C( 22627), -INT16_C( 30313), INT16_C( 21541), + INT16_C( 8529), INT16_C( 3861), INT16_C( 2799), INT16_C( 24937), -INT16_C( 17943), -INT16_C( 4870), -INT16_C( 16385), -INT16_C( 23118) } }, + { + { { INT16_C( 9039), INT16_C( 15804), INT16_C( 12869), -INT16_C( 5055), -INT16_C( 23511), -INT16_C( 16316), INT16_C( 26925), INT16_C( 32277) }, + { INT16_C( 10891), INT16_C( 31373), -INT16_C( 2252), INT16_C( 7643), -INT16_C( 10576), -INT16_C( 20470), -INT16_C( 17259), -INT16_C( 7083) } }, + { INT16_C( 9039), INT16_C( 15804), INT16_C( 12869), -INT16_C( 5055), -INT16_C( 23511), -INT16_C( 16316), INT16_C( 26925), INT16_C( 32277), + INT16_C( 10891), INT16_C( 31373), -INT16_C( 2252), INT16_C( 7643), -INT16_C( 10576), -INT16_C( 20470), -INT16_C( 17259), -INT16_C( 7083) } }, + { + { { INT16_C( 4575), INT16_C( 9249), INT16_C( 25155), INT16_C( 27664), INT16_C( 21766), INT16_C( 13100), INT16_C( 16830), INT16_C( 18866) }, + { INT16_C( 16235), -INT16_C( 24636), -INT16_C( 24778), -INT16_C( 6211), -INT16_C( 14475), INT16_C( 2967), -INT16_C( 4989), INT16_C( 25327) } }, + { INT16_C( 4575), INT16_C( 9249), INT16_C( 25155), INT16_C( 27664), INT16_C( 21766), INT16_C( 13100), INT16_C( 16830), INT16_C( 18866), + INT16_C( 16235), -INT16_C( 24636), -INT16_C( 24778), -INT16_C( 6211), -INT16_C( 14475), INT16_C( 2967), -INT16_C( 4989), INT16_C( 25327) } }, + { + { { INT16_C( 4605), INT16_C( 16519), -INT16_C( 26765), INT16_C( 31404), -INT16_C( 10004), -INT16_C( 21587), INT16_C( 24346), -INT16_C( 31244) }, + { -INT16_C( 18273), -INT16_C( 10971), -INT16_C( 7592), -INT16_C( 12868), INT16_C( 21417), INT16_C( 11480), -INT16_C( 14273), INT16_C( 15502) } }, + { INT16_C( 4605), INT16_C( 16519), -INT16_C( 26765), INT16_C( 31404), -INT16_C( 10004), -INT16_C( 21587), INT16_C( 24346), -INT16_C( 31244), + -INT16_C( 18273), -INT16_C( 10971), -INT16_C( 7592), -INT16_C( 12868), INT16_C( 21417), INT16_C( 11480), -INT16_C( 14273), INT16_C( 15502) } }, + { + { { INT16_C( 5593), INT16_C( 19580), INT16_C( 10413), -INT16_C( 26170), INT16_C( 29697), INT16_C( 6980), INT16_C( 14803), INT16_C( 29344) }, + { -INT16_C( 14863), INT16_C( 18760), INT16_C( 1191), INT16_C( 20503), -INT16_C( 4264), -INT16_C( 26756), INT16_C( 2999), -INT16_C( 28460) } }, + { INT16_C( 5593), INT16_C( 19580), INT16_C( 10413), -INT16_C( 26170), INT16_C( 29697), INT16_C( 6980), INT16_C( 14803), INT16_C( 29344), + -INT16_C( 14863), INT16_C( 18760), INT16_C( 1191), INT16_C( 20503), -INT16_C( 4264), -INT16_C( 26756), INT16_C( 2999), -INT16_C( 28460) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_int16x8x2_t r_ = { { simde_vld1q_s16(test_vec[i].r[0]), + simde_vld1q_s16(test_vec[i].r[1]) } }; + + SIMDE_ALIGN_TO_16 int16_t a_[16]; + simde_vst1q_s16_x2(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_int16x8_t a = simde_test_arm_neon_random_i16x8(); + simde_int16x8_t b = simde_test_arm_neon_random_i16x8(); + simde_int16x8x2_t c = {{a, b}}; + + simde_test_arm_neon_write_i16x8x2(2, c, SIMDE_TEST_VEC_POS_FIRST); + + int16_t buf[16]; + simde_vst1q_s16_x2(buf, c); + + simde_test_codegen_write_vi16(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1q_s32_x2 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + int32_t r[2][4]; + int32_t a[8]; + } test_vec[] = { + { + { { -INT32_C( 841134048), INT32_C( 2053612409), -INT32_C( 342512873), -INT32_C( 698534428) }, + { -INT32_C( 1574984197), INT32_C( 49493674), -INT32_C( 577147098), -INT32_C( 1687261830) } }, + { -INT32_C( 841134048), INT32_C( 2053612409), -INT32_C( 342512873), -INT32_C( 698534428), -INT32_C( 1574984197), INT32_C( 49493674), -INT32_C( 577147098), -INT32_C( 1687261830) } }, + { + { { INT32_C( 929582014), INT32_C( 112316398), INT32_C( 1609647739), INT32_C( 1983204987) }, + { -INT32_C( 1642506764), -INT32_C( 1314911093), -INT32_C( 158385797), INT32_C( 1704066471) } }, + { INT32_C( 929582014), INT32_C( 112316398), INT32_C( 1609647739), INT32_C( 1983204987), -INT32_C( 1642506764), -INT32_C( 1314911093), -INT32_C( 158385797), INT32_C( 1704066471) } }, + { + { { INT32_C( 916257096), INT32_C( 1144802761), INT32_C( 245575059), INT32_C( 1887820156) }, + { -INT32_C( 1190224338), INT32_C( 627814058), -INT32_C( 1910768921), INT32_C( 1072934135) } }, + { INT32_C( 916257096), INT32_C( 1144802761), INT32_C( 245575059), INT32_C( 1887820156), -INT32_C( 1190224338), INT32_C( 627814058), -INT32_C( 1910768921), INT32_C( 1072934135) } }, + { + { { INT32_C( 1869975462), INT32_C( 1874047708), INT32_C( 1535006431), INT32_C( 1573585711) }, + { INT32_C( 1259854241), INT32_C( 1869644423), INT32_C( 1945996412), -INT32_C( 558698184) } }, + { INT32_C( 1869975462), INT32_C( 1874047708), INT32_C( 1535006431), INT32_C( 1573585711), INT32_C( 1259854241), INT32_C( 1869644423), INT32_C( 1945996412), -INT32_C( 558698184) } }, + { + { { INT32_C( 1565337472), -INT32_C( 1177812775), -INT32_C( 2045490601), -INT32_C( 286990259) }, + { INT32_C( 1094319033), -INT32_C( 105862531), INT32_C( 1852615990), INT32_C( 525147806) } }, + { INT32_C( 1565337472), -INT32_C( 1177812775), -INT32_C( 2045490601), -INT32_C( 286990259), INT32_C( 1094319033), -INT32_C( 105862531), INT32_C( 1852615990), INT32_C( 525147806) } }, + { + { { INT32_C( 528259653), -INT32_C( 220706661), -INT32_C( 528946029), -INT32_C( 2033230644) }, + { -INT32_C( 725153705), -INT32_C( 389187662), -INT32_C( 1017693916), -INT32_C( 1646091177) } }, + { INT32_C( 528259653), -INT32_C( 220706661), -INT32_C( 528946029), -INT32_C( 2033230644), -INT32_C( 725153705), -INT32_C( 389187662), -INT32_C( 1017693916), -INT32_C( 1646091177) } }, + { + { { -INT32_C( 641966530), INT32_C( 969643174), INT32_C( 1293567104), -INT32_C( 120329824) }, + { -INT32_C( 1530094863), INT32_C( 898406929), INT32_C( 737731539), -INT32_C( 959915385) } }, + { -INT32_C( 641966530), INT32_C( 969643174), INT32_C( 1293567104), -INT32_C( 120329824), -INT32_C( 1530094863), INT32_C( 898406929), INT32_C( 737731539), -INT32_C( 959915385) } }, + { + { { -INT32_C( 543194056), -INT32_C( 1743230184), INT32_C( 1340420783), INT32_C( 222803995) }, + { INT32_C( 1672549458), -INT32_C( 2120663634), -INT32_C( 1465085663), -INT32_C( 1536265108) } }, + { -INT32_C( 543194056), -INT32_C( 1743230184), INT32_C( 1340420783), INT32_C( 222803995), INT32_C( 1672549458), -INT32_C( 2120663634), -INT32_C( 1465085663), -INT32_C( 1536265108) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_int32x4x2_t r_ = { { simde_vld1q_s32(test_vec[i].r[0]), + simde_vld1q_s32(test_vec[i].r[1]) } }; + + SIMDE_ALIGN_TO_16 int32_t a_[8]; + simde_vst1q_s32_x2(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_int32x4_t a = simde_test_arm_neon_random_i32x4(); + simde_int32x4_t b = simde_test_arm_neon_random_i32x4(); + simde_int32x4x2_t c = {{a, b}}; + + simde_test_arm_neon_write_i32x4x2(2, c, SIMDE_TEST_VEC_POS_FIRST); + + int32_t buf[8]; + simde_vst1q_s32_x2(buf, c); + + simde_test_codegen_write_vi32(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1q_s64_x2 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + int64_t r[2][2]; + int64_t a[4]; + } test_vec[] = { + { + { { INT64_C( 2930045076363218680), -INT64_C( 7352197551061758258) }, + { INT64_C( 433074426653550803), INT64_C( 2033407270396604199) } }, + { INT64_C( 2930045076363218680), -INT64_C( 7352197551061758258), INT64_C( 433074426653550803), INT64_C( 2033407270396604199) } }, + { + { { INT64_C( 2795844041083501355), -INT64_C( 3007270938840382364) }, + { -INT64_C( 28330190206189137), -INT64_C( 7833789007332750840) } }, + { INT64_C( 2795844041083501355), -INT64_C( 3007270938840382364), -INT64_C( 28330190206189137), -INT64_C( 7833789007332750840) } }, + { + { { -INT64_C( 5907873566594468730), -INT64_C( 3953706261595745464) }, + { -INT64_C( 2686966923553507105), -INT64_C( 7476733964296239037) } }, + { -INT64_C( 5907873566594468730), -INT64_C( 3953706261595745464), -INT64_C( 2686966923553507105), -INT64_C( 7476733964296239037) } }, + { + { { -INT64_C( 4487140517914184254), -INT64_C( 8038593618844576883) }, + { INT64_C( 815429470462070693), INT64_C( 7489472592495334980) } }, + { -INT64_C( 4487140517914184254), -INT64_C( 8038593618844576883), INT64_C( 815429470462070693), INT64_C( 7489472592495334980) } }, + { + { { INT64_C( 7755813043085469032), -INT64_C( 9186634209688310207) }, + { INT64_C( 659293307359643987), INT64_C( 3938765996896017309) } }, + { INT64_C( 7755813043085469032), -INT64_C( 9186634209688310207), INT64_C( 659293307359643987), INT64_C( 3938765996896017309) } }, + { + { { -INT64_C( 8287264009362137933), -INT64_C( 1746831969183985561) }, + { -INT64_C( 7090873630430414390), -INT64_C( 501720045708118268) } }, + { -INT64_C( 8287264009362137933), -INT64_C( 1746831969183985561), -INT64_C( 7090873630430414390), -INT64_C( 501720045708118268) } }, + { + { { INT64_C( 4718516608015474853), -INT64_C( 4245409029095621991) }, + { INT64_C( 4944367729828436223), -INT64_C( 6187066256540599069) } }, + { INT64_C( 4718516608015474853), -INT64_C( 4245409029095621991), INT64_C( 4944367729828436223), -INT64_C( 6187066256540599069) } }, + { + { { -INT64_C( 3360787895511568832), INT64_C( 2796476047246221327) }, + { -INT64_C( 958771874141756628), INT64_C( 3021422666819881023) } }, + { -INT64_C( 3360787895511568832), INT64_C( 2796476047246221327), -INT64_C( 958771874141756628), INT64_C( 3021422666819881023) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_int64x2x2_t r_ = { { simde_vld1q_s64(test_vec[i].r[0]), + simde_vld1q_s64(test_vec[i].r[1]) } }; + + SIMDE_ALIGN_TO_16 int64_t a_[4]; + simde_vst1q_s64_x2(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_int64x2_t a = simde_test_arm_neon_random_i64x2(); + simde_int64x2_t b = simde_test_arm_neon_random_i64x2(); + simde_int64x2x2_t c = {{a, b}}; + + simde_test_arm_neon_write_i64x2x2(2, c, SIMDE_TEST_VEC_POS_FIRST); + + int64_t buf[4]; + simde_vst1q_s64_x2(buf, c); + + simde_test_codegen_write_vi64(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1q_u8_x2 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + uint8_t r[2][16]; + uint8_t a[32]; + } test_vec[] = { + { + { { UINT8_C(237), UINT8_C(135), UINT8_C( 67), UINT8_C( 37), UINT8_C(156), UINT8_C(159), UINT8_C(246), UINT8_C(171), + UINT8_C(127), UINT8_C(245), UINT8_C(181), UINT8_C(166), UINT8_C( 9), UINT8_C(132), UINT8_C(204), UINT8_C( 54) }, + { UINT8_C(167), UINT8_C(241), UINT8_C(163), UINT8_C(182), UINT8_C(180), UINT8_C( 84), UINT8_C(169), UINT8_C(243), + UINT8_C( 29), UINT8_C(197), UINT8_C( 55), UINT8_C( 5), UINT8_C( 4), UINT8_C( 37), UINT8_C( 46), UINT8_C(241) } }, + { UINT8_C(237), UINT8_C(135), UINT8_C( 67), UINT8_C( 37), UINT8_C(156), UINT8_C(159), UINT8_C(246), UINT8_C(171), + UINT8_C(127), UINT8_C(245), UINT8_C(181), UINT8_C(166), UINT8_C( 9), UINT8_C(132), UINT8_C(204), UINT8_C( 54), + UINT8_C(167), UINT8_C(241), UINT8_C(163), UINT8_C(182), UINT8_C(180), UINT8_C( 84), UINT8_C(169), UINT8_C(243), + UINT8_C( 29), UINT8_C(197), UINT8_C( 55), UINT8_C( 5), UINT8_C( 4), UINT8_C( 37), UINT8_C( 46), UINT8_C(241) } }, + { + { { UINT8_C(172), UINT8_C(114), UINT8_C( 22), UINT8_C( 73), UINT8_C( 17), UINT8_C( 12), UINT8_C(244), UINT8_C(145), + UINT8_C( 1), UINT8_C(170), UINT8_C( 55), UINT8_C( 11), UINT8_C( 46), UINT8_C( 3), UINT8_C( 65), UINT8_C(214) }, + { UINT8_C(244), UINT8_C(228), UINT8_C(140), UINT8_C(168), UINT8_C( 56), UINT8_C( 53), UINT8_C(155), UINT8_C( 85), + UINT8_C(250), UINT8_C(210), UINT8_C( 91), UINT8_C(254), UINT8_C(247), UINT8_C(137), UINT8_C(240), UINT8_C(164) } }, + { UINT8_C(172), UINT8_C(114), UINT8_C( 22), UINT8_C( 73), UINT8_C( 17), UINT8_C( 12), UINT8_C(244), UINT8_C(145), + UINT8_C( 1), UINT8_C(170), UINT8_C( 55), UINT8_C( 11), UINT8_C( 46), UINT8_C( 3), UINT8_C( 65), UINT8_C(214), + UINT8_C(244), UINT8_C(228), UINT8_C(140), UINT8_C(168), UINT8_C( 56), UINT8_C( 53), UINT8_C(155), UINT8_C( 85), + UINT8_C(250), UINT8_C(210), UINT8_C( 91), UINT8_C(254), UINT8_C(247), UINT8_C(137), UINT8_C(240), UINT8_C(164) } }, + { + { { UINT8_C(251), UINT8_C( 6), UINT8_C(237), UINT8_C( 13), UINT8_C( 19), UINT8_C(225), UINT8_C(158), UINT8_C( 20), + UINT8_C(139), UINT8_C(213), UINT8_C( 31), UINT8_C(186), UINT8_C(216), UINT8_C( 96), UINT8_C(144), UINT8_C(204) }, + { UINT8_C( 68), UINT8_C( 28), UINT8_C(117), UINT8_C(125), UINT8_C( 82), UINT8_C( 16), UINT8_C(210), UINT8_C( 76), + UINT8_C(227), UINT8_C( 45), UINT8_C( 75), UINT8_C(218), UINT8_C(183), UINT8_C( 59), UINT8_C(126), UINT8_C(178) } }, + { UINT8_C(251), UINT8_C( 6), UINT8_C(237), UINT8_C( 13), UINT8_C( 19), UINT8_C(225), UINT8_C(158), UINT8_C( 20), + UINT8_C(139), UINT8_C(213), UINT8_C( 31), UINT8_C(186), UINT8_C(216), UINT8_C( 96), UINT8_C(144), UINT8_C(204), + UINT8_C( 68), UINT8_C( 28), UINT8_C(117), UINT8_C(125), UINT8_C( 82), UINT8_C( 16), UINT8_C(210), UINT8_C( 76), + UINT8_C(227), UINT8_C( 45), UINT8_C( 75), UINT8_C(218), UINT8_C(183), UINT8_C( 59), UINT8_C(126), UINT8_C(178) } }, + { + { { UINT8_C( 65), UINT8_C(107), UINT8_C(191), UINT8_C( 84), UINT8_C( 77), UINT8_C( 93), UINT8_C(105), UINT8_C(216), + UINT8_C( 50), UINT8_C(136), UINT8_C(146), UINT8_C( 10), UINT8_C(233), UINT8_C( 34), UINT8_C(215), UINT8_C( 45) }, + { UINT8_C( 63), UINT8_C( 76), UINT8_C(170), UINT8_C(145), UINT8_C( 92), UINT8_C(125), UINT8_C(221), UINT8_C( 63), + UINT8_C(170), UINT8_C( 40), UINT8_C( 26), UINT8_C( 97), UINT8_C( 99), UINT8_C(152), UINT8_C( 20), UINT8_C(165) } }, + { UINT8_C( 65), UINT8_C(107), UINT8_C(191), UINT8_C( 84), UINT8_C( 77), UINT8_C( 93), UINT8_C(105), UINT8_C(216), + UINT8_C( 50), UINT8_C(136), UINT8_C(146), UINT8_C( 10), UINT8_C(233), UINT8_C( 34), UINT8_C(215), UINT8_C( 45), + UINT8_C( 63), UINT8_C( 76), UINT8_C(170), UINT8_C(145), UINT8_C( 92), UINT8_C(125), UINT8_C(221), UINT8_C( 63), + UINT8_C(170), UINT8_C( 40), UINT8_C( 26), UINT8_C( 97), UINT8_C( 99), UINT8_C(152), UINT8_C( 20), UINT8_C(165) } }, + { + { { UINT8_C( 4), UINT8_C(211), UINT8_C(249), UINT8_C( 81), UINT8_C( 49), UINT8_C( 98), UINT8_C( 41), UINT8_C( 99), + UINT8_C(235), UINT8_C(188), UINT8_C(110), UINT8_C(212), UINT8_C(222), UINT8_C( 69), UINT8_C( 1), UINT8_C( 29) }, + { UINT8_C(145), UINT8_C(172), UINT8_C(174), UINT8_C(237), UINT8_C( 41), UINT8_C(140), UINT8_C( 45), UINT8_C(211), + UINT8_C(180), UINT8_C( 71), UINT8_C( 53), UINT8_C( 24), UINT8_C(223), UINT8_C( 73), UINT8_C(189), UINT8_C(227) } }, + { UINT8_C( 4), UINT8_C(211), UINT8_C(249), UINT8_C( 81), UINT8_C( 49), UINT8_C( 98), UINT8_C( 41), UINT8_C( 99), + UINT8_C(235), UINT8_C(188), UINT8_C(110), UINT8_C(212), UINT8_C(222), UINT8_C( 69), UINT8_C( 1), UINT8_C( 29), + UINT8_C(145), UINT8_C(172), UINT8_C(174), UINT8_C(237), UINT8_C( 41), UINT8_C(140), UINT8_C( 45), UINT8_C(211), + UINT8_C(180), UINT8_C( 71), UINT8_C( 53), UINT8_C( 24), UINT8_C(223), UINT8_C( 73), UINT8_C(189), UINT8_C(227) } }, + { + { { UINT8_C( 28), UINT8_C(182), UINT8_C( 52), UINT8_C( 77), UINT8_C( 25), UINT8_C( 94), UINT8_C(177), UINT8_C( 4), + UINT8_C( 26), UINT8_C( 31), UINT8_C(216), UINT8_C(248), UINT8_C(100), UINT8_C(217), UINT8_C( 22), UINT8_C(245) }, + { UINT8_C(133), UINT8_C(196), UINT8_C(226), UINT8_C(174), UINT8_C( 80), UINT8_C( 15), UINT8_C(130), UINT8_C( 5), + UINT8_C( 86), UINT8_C(183), UINT8_C( 29), UINT8_C( 54), UINT8_C( 0), UINT8_C(218), UINT8_C( 25), UINT8_C( 28) } }, + { UINT8_C( 28), UINT8_C(182), UINT8_C( 52), UINT8_C( 77), UINT8_C( 25), UINT8_C( 94), UINT8_C(177), UINT8_C( 4), + UINT8_C( 26), UINT8_C( 31), UINT8_C(216), UINT8_C(248), UINT8_C(100), UINT8_C(217), UINT8_C( 22), UINT8_C(245), + UINT8_C(133), UINT8_C(196), UINT8_C(226), UINT8_C(174), UINT8_C( 80), UINT8_C( 15), UINT8_C(130), UINT8_C( 5), + UINT8_C( 86), UINT8_C(183), UINT8_C( 29), UINT8_C( 54), UINT8_C( 0), UINT8_C(218), UINT8_C( 25), UINT8_C( 28) } }, + { + { { UINT8_C(144), UINT8_C( 78), UINT8_C(106), UINT8_C(169), UINT8_C(172), UINT8_C( 27), UINT8_C(173), UINT8_C(198), + UINT8_C( 58), UINT8_C(133), UINT8_C(190), UINT8_C(158), UINT8_C( 95), UINT8_C(212), UINT8_C(147), UINT8_C(228) }, + { UINT8_C(153), UINT8_C(117), UINT8_C(147), UINT8_C(233), UINT8_C(133), UINT8_C( 21), UINT8_C(238), UINT8_C(219), + UINT8_C(204), UINT8_C( 11), UINT8_C( 17), UINT8_C(204), UINT8_C(229), UINT8_C( 43), UINT8_C(232), UINT8_C(118) } }, + { UINT8_C(144), UINT8_C( 78), UINT8_C(106), UINT8_C(169), UINT8_C(172), UINT8_C( 27), UINT8_C(173), UINT8_C(198), + UINT8_C( 58), UINT8_C(133), UINT8_C(190), UINT8_C(158), UINT8_C( 95), UINT8_C(212), UINT8_C(147), UINT8_C(228), + UINT8_C(153), UINT8_C(117), UINT8_C(147), UINT8_C(233), UINT8_C(133), UINT8_C( 21), UINT8_C(238), UINT8_C(219), + UINT8_C(204), UINT8_C( 11), UINT8_C( 17), UINT8_C(204), UINT8_C(229), UINT8_C( 43), UINT8_C(232), UINT8_C(118) } }, + { + { { UINT8_C(121), UINT8_C( 82), UINT8_C( 31), UINT8_C( 37), UINT8_C(109), UINT8_C(205), UINT8_C(235), UINT8_C(167), + UINT8_C( 82), UINT8_C(169), UINT8_C( 69), UINT8_C(177), UINT8_C(126), UINT8_C(216), UINT8_C(150), UINT8_C( 23) }, + { UINT8_C( 78), UINT8_C( 41), UINT8_C( 0), UINT8_C(211), UINT8_C( 62), UINT8_C(239), UINT8_C(174), UINT8_C( 10), + UINT8_C(250), UINT8_C(192), UINT8_C(214), UINT8_C(224), UINT8_C(235), UINT8_C(190), UINT8_C( 86), UINT8_C(100) } }, + { UINT8_C(121), UINT8_C( 82), UINT8_C( 31), UINT8_C( 37), UINT8_C(109), UINT8_C(205), UINT8_C(235), UINT8_C(167), + UINT8_C( 82), UINT8_C(169), UINT8_C( 69), UINT8_C(177), UINT8_C(126), UINT8_C(216), UINT8_C(150), UINT8_C( 23), + UINT8_C( 78), UINT8_C( 41), UINT8_C( 0), UINT8_C(211), UINT8_C( 62), UINT8_C(239), UINT8_C(174), UINT8_C( 10), + UINT8_C(250), UINT8_C(192), UINT8_C(214), UINT8_C(224), UINT8_C(235), UINT8_C(190), UINT8_C( 86), UINT8_C(100) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_uint8x16x2_t r_ = { { simde_vld1q_u8(test_vec[i].r[0]), + simde_vld1q_u8(test_vec[i].r[1]) } }; + + SIMDE_ALIGN_TO_16 uint8_t a_[32]; + simde_vst1q_u8_x2(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_uint8x16_t a = simde_test_arm_neon_random_u8x16(); + simde_uint8x16_t b = simde_test_arm_neon_random_u8x16(); + simde_uint8x16x2_t c = {{a, b}}; + + simde_test_arm_neon_write_u8x16x2(2, c, SIMDE_TEST_VEC_POS_FIRST); + + uint8_t buf[32]; + simde_vst1q_u8_x2(buf, c); + + simde_test_codegen_write_vu8(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1q_u16_x2 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + uint16_t r[2][8]; + uint16_t a[16]; + } test_vec[] = { + { + { { UINT16_C(29969), UINT16_C(32393), UINT16_C(29762), UINT16_C(38182), UINT16_C(27421), UINT16_C(39750), UINT16_C(56388), UINT16_C(37554) }, + { UINT16_C(45829), UINT16_C(17253), UINT16_C( 5026), UINT16_C(40013), UINT16_C( 9171), UINT16_C(48764), UINT16_C(53986), UINT16_C(62242) } }, + { UINT16_C(29969), UINT16_C(32393), UINT16_C(29762), UINT16_C(38182), UINT16_C(27421), UINT16_C(39750), UINT16_C(56388), UINT16_C(37554), + UINT16_C(45829), UINT16_C(17253), UINT16_C( 5026), UINT16_C(40013), UINT16_C( 9171), UINT16_C(48764), UINT16_C(53986), UINT16_C(62242) } }, + { + { { UINT16_C(43848), UINT16_C(35441), UINT16_C(38687), UINT16_C(15647), UINT16_C(26115), UINT16_C(18392), UINT16_C(35650), UINT16_C(18649) }, + { UINT16_C(15934), UINT16_C(57483), UINT16_C(55633), UINT16_C( 9596), UINT16_C(63996), UINT16_C(57059), UINT16_C( 1739), UINT16_C( 5073) } }, + { UINT16_C(43848), UINT16_C(35441), UINT16_C(38687), UINT16_C(15647), UINT16_C(26115), UINT16_C(18392), UINT16_C(35650), UINT16_C(18649), + UINT16_C(15934), UINT16_C(57483), UINT16_C(55633), UINT16_C( 9596), UINT16_C(63996), UINT16_C(57059), UINT16_C( 1739), UINT16_C( 5073) } }, + { + { { UINT16_C(17329), UINT16_C(53662), UINT16_C(48602), UINT16_C(56590), UINT16_C(58915), UINT16_C(26148), UINT16_C(64881), UINT16_C(44974) }, + { UINT16_C(14651), UINT16_C(36239), UINT16_C( 3090), UINT16_C( 4018), UINT16_C(38149), UINT16_C(53485), UINT16_C(49051), UINT16_C(19940) } }, + { UINT16_C(17329), UINT16_C(53662), UINT16_C(48602), UINT16_C(56590), UINT16_C(58915), UINT16_C(26148), UINT16_C(64881), UINT16_C(44974), + UINT16_C(14651), UINT16_C(36239), UINT16_C( 3090), UINT16_C( 4018), UINT16_C(38149), UINT16_C(53485), UINT16_C(49051), UINT16_C(19940) } }, + { + { { UINT16_C(33282), UINT16_C(56350), UINT16_C(11327), UINT16_C(25530), UINT16_C(56850), UINT16_C(33993), UINT16_C(30684), UINT16_C( 5939) }, + { UINT16_C(50096), UINT16_C(50084), UINT16_C(22223), UINT16_C(54482), UINT16_C(49132), UINT16_C(34724), UINT16_C(34942), UINT16_C(32980) } }, + { UINT16_C(33282), UINT16_C(56350), UINT16_C(11327), UINT16_C(25530), UINT16_C(56850), UINT16_C(33993), UINT16_C(30684), UINT16_C( 5939), + UINT16_C(50096), UINT16_C(50084), UINT16_C(22223), UINT16_C(54482), UINT16_C(49132), UINT16_C(34724), UINT16_C(34942), UINT16_C(32980) } }, + { + { { UINT16_C(61962), UINT16_C(19037), UINT16_C( 5918), UINT16_C(12717), UINT16_C(30453), UINT16_C(53685), UINT16_C(59629), UINT16_C(40425) }, + { UINT16_C(36267), UINT16_C(31328), UINT16_C(13028), UINT16_C(53326), UINT16_C(62450), UINT16_C(28759), UINT16_C(11387), UINT16_C(34545) } }, + { UINT16_C(61962), UINT16_C(19037), UINT16_C( 5918), UINT16_C(12717), UINT16_C(30453), UINT16_C(53685), UINT16_C(59629), UINT16_C(40425), + UINT16_C(36267), UINT16_C(31328), UINT16_C(13028), UINT16_C(53326), UINT16_C(62450), UINT16_C(28759), UINT16_C(11387), UINT16_C(34545) } }, + { + { { UINT16_C(19998), UINT16_C(15824), UINT16_C(32101), UINT16_C(23150), UINT16_C( 9203), UINT16_C(57388), UINT16_C( 5387), UINT16_C(46973) }, + { UINT16_C(56994), UINT16_C(34353), UINT16_C(32784), UINT16_C( 598), UINT16_C(44659), UINT16_C(61043), UINT16_C(25818), UINT16_C(63604) } }, + { UINT16_C(19998), UINT16_C(15824), UINT16_C(32101), UINT16_C(23150), UINT16_C( 9203), UINT16_C(57388), UINT16_C( 5387), UINT16_C(46973), + UINT16_C(56994), UINT16_C(34353), UINT16_C(32784), UINT16_C( 598), UINT16_C(44659), UINT16_C(61043), UINT16_C(25818), UINT16_C(63604) } }, + { + { { UINT16_C(17586), UINT16_C( 5941), UINT16_C(41921), UINT16_C(46193), UINT16_C(40390), UINT16_C(53908), UINT16_C( 4786), UINT16_C(21897) }, + { UINT16_C(47856), UINT16_C( 219), UINT16_C(12858), UINT16_C(44291), UINT16_C(30432), UINT16_C(47772), UINT16_C( 4314), UINT16_C(36018) } }, + { UINT16_C(17586), UINT16_C( 5941), UINT16_C(41921), UINT16_C(46193), UINT16_C(40390), UINT16_C(53908), UINT16_C( 4786), UINT16_C(21897), + UINT16_C(47856), UINT16_C( 219), UINT16_C(12858), UINT16_C(44291), UINT16_C(30432), UINT16_C(47772), UINT16_C( 4314), UINT16_C(36018) } }, + { + { { UINT16_C(59477), UINT16_C( 5795), UINT16_C( 5259), UINT16_C(21195), UINT16_C(24498), UINT16_C(25636), UINT16_C(44401), UINT16_C(25017) }, + { UINT16_C(38247), UINT16_C(41570), UINT16_C(26055), UINT16_C(42831), UINT16_C(60379), UINT16_C(46433), UINT16_C( 5116), UINT16_C(20801) } }, + { UINT16_C(59477), UINT16_C( 5795), UINT16_C( 5259), UINT16_C(21195), UINT16_C(24498), UINT16_C(25636), UINT16_C(44401), UINT16_C(25017), + UINT16_C(38247), UINT16_C(41570), UINT16_C(26055), UINT16_C(42831), UINT16_C(60379), UINT16_C(46433), UINT16_C( 5116), UINT16_C(20801) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_uint16x8x2_t r_ = { { simde_vld1q_u16(test_vec[i].r[0]), + simde_vld1q_u16(test_vec[i].r[1]) } }; + + SIMDE_ALIGN_TO_16 uint16_t a_[16]; + simde_vst1q_u16_x2(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_uint16x8_t a = simde_test_arm_neon_random_u16x8(); + simde_uint16x8_t b = simde_test_arm_neon_random_u16x8(); + simde_uint16x8x2_t c = {{a, b}}; + + simde_test_arm_neon_write_u16x8x2(2, c, SIMDE_TEST_VEC_POS_FIRST); + + uint16_t buf[16]; + simde_vst1q_u16_x2(buf, c); + + simde_test_codegen_write_vu16(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1q_u32_x2 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + uint32_t r[2][4]; + uint32_t a[8]; + } test_vec[] = { + { + { { UINT32_C(2271732987), UINT32_C(2866361080), UINT32_C( 51379602), UINT32_C( 291883178) }, + { UINT32_C( 615761757), UINT32_C( 130745132), UINT32_C(3938200814), UINT32_C( 993787200) } }, + { UINT32_C(2271732987), UINT32_C(2866361080), UINT32_C( 51379602), UINT32_C( 291883178), UINT32_C( 615761757), UINT32_C( 130745132), UINT32_C(3938200814), UINT32_C( 993787200) } }, + { + { { UINT32_C(3653411809), UINT32_C(1736743893), UINT32_C(1114346392), UINT32_C(3109343323) }, + { UINT32_C(3286042519), UINT32_C(4190808330), UINT32_C( 367232725), UINT32_C(1683038083) } }, + { UINT32_C(3653411809), UINT32_C(1736743893), UINT32_C(1114346392), UINT32_C(3109343323), UINT32_C(3286042519), UINT32_C(4190808330), UINT32_C( 367232725), UINT32_C(1683038083) } }, + { + { { UINT32_C(2537362370), UINT32_C(1207943599), UINT32_C(2961861204), UINT32_C(3513376314) }, + { UINT32_C(4036249317), UINT32_C(3320405743), UINT32_C(1742392548), UINT32_C(2915773419) } }, + { UINT32_C(2537362370), UINT32_C(1207943599), UINT32_C(2961861204), UINT32_C(3513376314), UINT32_C(4036249317), UINT32_C(3320405743), UINT32_C(1742392548), UINT32_C(2915773419) } }, + { + { { UINT32_C(3997501503), UINT32_C( 506807498), UINT32_C(3905863598), UINT32_C(2209953693) }, + { UINT32_C(1836273022), UINT32_C(2402442411), UINT32_C( 351669544), UINT32_C(2009186616) } }, + { UINT32_C(3997501503), UINT32_C( 506807498), UINT32_C(3905863598), UINT32_C(2209953693), UINT32_C(1836273022), UINT32_C(2402442411), UINT32_C( 351669544), UINT32_C(2009186616) } }, + { + { { UINT32_C(2472871625), UINT32_C(4172454730), UINT32_C(4175462490), UINT32_C( 914069944) }, + { UINT32_C(2443439846), UINT32_C(1914754634), UINT32_C( 461772515), UINT32_C(2710784215) } }, + { UINT32_C(2472871625), UINT32_C(4172454730), UINT32_C(4175462490), UINT32_C( 914069944), UINT32_C(2443439846), UINT32_C(1914754634), UINT32_C( 461772515), UINT32_C(2710784215) } }, + { + { { UINT32_C(2570385486), UINT32_C(4002539155), UINT32_C( 535196263), UINT32_C(4065681675) }, + { UINT32_C(2575562831), UINT32_C(2970330318), UINT32_C(2462945978), UINT32_C( 674455770) } }, + { UINT32_C(2570385486), UINT32_C(4002539155), UINT32_C( 535196263), UINT32_C(4065681675), UINT32_C(2575562831), UINT32_C(2970330318), UINT32_C(2462945978), UINT32_C( 674455770) } }, + { + { { UINT32_C(3972097880), UINT32_C(3050984270), UINT32_C(3503603909), UINT32_C(1891772705) }, + { UINT32_C(4027139617), UINT32_C(2762020074), UINT32_C(2151050918), UINT32_C( 665414094) } }, + { UINT32_C(3972097880), UINT32_C(3050984270), UINT32_C(3503603909), UINT32_C(1891772705), UINT32_C(4027139617), UINT32_C(2762020074), UINT32_C(2151050918), UINT32_C( 665414094) } }, + { + { { UINT32_C( 521366225), UINT32_C(2194992573), UINT32_C(3461589165), UINT32_C(4064155089) }, + { UINT32_C(1172457307), UINT32_C( 48923739), UINT32_C(3246530802), UINT32_C(1541942154) } }, + { UINT32_C( 521366225), UINT32_C(2194992573), UINT32_C(3461589165), UINT32_C(4064155089), UINT32_C(1172457307), UINT32_C( 48923739), UINT32_C(3246530802), UINT32_C(1541942154) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_uint32x4x2_t r_ = { { simde_vld1q_u32(test_vec[i].r[0]), + simde_vld1q_u32(test_vec[i].r[1]) } }; + + SIMDE_ALIGN_TO_16 uint32_t a_[8]; + simde_vst1q_u32_x2(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_uint32x4_t a = simde_test_arm_neon_random_u32x4(); + simde_uint32x4_t b = simde_test_arm_neon_random_u32x4(); + simde_uint32x4x2_t c = {{a, b}}; + + simde_test_arm_neon_write_u32x4x2(2, c, SIMDE_TEST_VEC_POS_FIRST); + + uint32_t buf[8]; + simde_vst1q_u32_x2(buf, c); + + simde_test_codegen_write_vu32(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1q_u64_x2 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + uint64_t r[2][2]; + uint64_t a[4]; + } test_vec[] = { + { + { { UINT64_C(10796903916407290774), UINT64_C(11149119643537582582) }, + { UINT64_C( 1316679606490602728), UINT64_C( 9930362357686716650) } }, + { UINT64_C(10796903916407290774), UINT64_C(11149119643537582582), UINT64_C( 1316679606490602728), UINT64_C( 9930362357686716650) } }, + { + { { UINT64_C(10174673446946818486), UINT64_C( 2284465441299797724) }, + { UINT64_C( 5178198792333399209), UINT64_C( 2444762366588202864) } }, + { UINT64_C(10174673446946818486), UINT64_C( 2284465441299797724), UINT64_C( 5178198792333399209), UINT64_C( 2444762366588202864) } }, + { + { { UINT64_C( 6482917908610599635), UINT64_C( 207491423798578058) }, + { UINT64_C( 6728845050283574460), UINT64_C( 8927452396905373015) } }, + { UINT64_C( 6482917908610599635), UINT64_C( 207491423798578058), UINT64_C( 6728845050283574460), UINT64_C( 8927452396905373015) } }, + { + { { UINT64_C( 2400662246140519545), UINT64_C(12215104609406141480) }, + { UINT64_C( 5715390053786800136), UINT64_C( 4207759264570282561) } }, + { UINT64_C( 2400662246140519545), UINT64_C(12215104609406141480), UINT64_C( 5715390053786800136), UINT64_C( 4207759264570282561) } }, + { + { { UINT64_C( 5716053253585652122), UINT64_C( 205570166553065028) }, + { UINT64_C( 282680873016794532), UINT64_C(10256192735776931418) } }, + { UINT64_C( 5716053253585652122), UINT64_C( 205570166553065028), UINT64_C( 282680873016794532), UINT64_C(10256192735776931418) } }, + { + { { UINT64_C( 5408561497708136089), UINT64_C(15583675393062526792) }, + { UINT64_C(15976345421416315891), UINT64_C(10223539436100625247) } }, + { UINT64_C( 5408561497708136089), UINT64_C(15583675393062526792), UINT64_C(15976345421416315891), UINT64_C(10223539436100625247) } }, + { + { { UINT64_C(18097254080183115988), UINT64_C(16953944800766108219) }, + { UINT64_C( 9015739291487157693), UINT64_C( 4214156927691659258) } }, + { UINT64_C(18097254080183115988), UINT64_C(16953944800766108219), UINT64_C( 9015739291487157693), UINT64_C( 4214156927691659258) } }, + { + { { UINT64_C( 6845536459476551761), UINT64_C( 9133326161295654621) }, + { UINT64_C(12785680545442848724), UINT64_C( 4725150053639864307) } }, + { UINT64_C( 6845536459476551761), UINT64_C( 9133326161295654621), UINT64_C(12785680545442848724), UINT64_C( 4725150053639864307) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_uint64x2x2_t r_ = { { simde_vld1q_u64(test_vec[i].r[0]), + simde_vld1q_u64(test_vec[i].r[1]) } }; + + SIMDE_ALIGN_TO_16 uint64_t a_[4]; + simde_vst1q_u64_x2(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_uint64x2_t a = simde_test_arm_neon_random_u64x2(); + simde_uint64x2_t b = simde_test_arm_neon_random_u64x2(); + simde_uint64x2x2_t c = {{a, b}}; + + simde_test_arm_neon_write_u64x2x2(2, c, SIMDE_TEST_VEC_POS_FIRST); + + uint64_t buf[4]; + simde_vst1q_u64_x2(buf, c); + + simde_test_codegen_write_vu64(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +#endif /* !defined(SIMDE_BUG_INTEL_857088) */ + +SIMDE_TEST_FUNC_LIST_BEGIN +#if !defined(SIMDE_BUG_INTEL_857088) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1q_f32_x2) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1q_f64_x2) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1q_s8_x2) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1q_s16_x2) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1q_s32_x2) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1q_s64_x2) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1q_u8_x2) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1q_u16_x2) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1q_u32_x2) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1q_u64_x2) +#endif /* !defined(SIMDE_BUG_INTEL_857088) */ +SIMDE_TEST_FUNC_LIST_END + +#include "test-neon-footer.h" diff --git a/test/arm/neon/st1q_x3.c b/test/arm/neon/st1q_x3.c new file mode 100644 index 000000000..81f7e1968 --- /dev/null +++ b/test/arm/neon/st1q_x3.c @@ -0,0 +1,1042 @@ + +#include "test/test.h" +#define SIMDE_TEST_ARM_NEON_INSN st1q_x3 +#include "test-neon.h" +#include "../../../simde/arm/neon/st1q_x3.h" + +#if !defined(SIMDE_BUG_INTEL_857088) + +static int +test_simde_vst1q_f32_x3 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + simde_float32 r[3][4]; + simde_float32 a[12]; + } test_vec[] = { + { + { { SIMDE_FLOAT32_C( 301.75), SIMDE_FLOAT32_C( 948.57), SIMDE_FLOAT32_C( -641.77), SIMDE_FLOAT32_C( 911.15) }, + { SIMDE_FLOAT32_C( 292.66), SIMDE_FLOAT32_C( 217.08), SIMDE_FLOAT32_C( -302.00), SIMDE_FLOAT32_C( 632.24) }, + { SIMDE_FLOAT32_C( 542.22), SIMDE_FLOAT32_C( -23.30), SIMDE_FLOAT32_C( 887.34), SIMDE_FLOAT32_C( -873.31) } }, + { SIMDE_FLOAT32_C( 301.75), SIMDE_FLOAT32_C( 948.57), SIMDE_FLOAT32_C( -641.77), SIMDE_FLOAT32_C( 911.15), + SIMDE_FLOAT32_C( 292.66), SIMDE_FLOAT32_C( 217.08), SIMDE_FLOAT32_C( -302.00), SIMDE_FLOAT32_C( 632.24), + SIMDE_FLOAT32_C( 542.22), SIMDE_FLOAT32_C( -23.30), SIMDE_FLOAT32_C( 887.34), SIMDE_FLOAT32_C( -873.31) } }, + { + { { SIMDE_FLOAT32_C( 654.53), SIMDE_FLOAT32_C( 351.69), SIMDE_FLOAT32_C( -76.10), SIMDE_FLOAT32_C( -702.90) }, + { SIMDE_FLOAT32_C( -365.99), SIMDE_FLOAT32_C( 70.51), SIMDE_FLOAT32_C( -342.83), SIMDE_FLOAT32_C( -252.59) }, + { SIMDE_FLOAT32_C( 408.41), SIMDE_FLOAT32_C( -48.80), SIMDE_FLOAT32_C( -256.81), SIMDE_FLOAT32_C( -769.94) } }, + { SIMDE_FLOAT32_C( 654.53), SIMDE_FLOAT32_C( 351.69), SIMDE_FLOAT32_C( -76.10), SIMDE_FLOAT32_C( -702.90), + SIMDE_FLOAT32_C( -365.99), SIMDE_FLOAT32_C( 70.51), SIMDE_FLOAT32_C( -342.83), SIMDE_FLOAT32_C( -252.59), + SIMDE_FLOAT32_C( 408.41), SIMDE_FLOAT32_C( -48.80), SIMDE_FLOAT32_C( -256.81), SIMDE_FLOAT32_C( -769.94) } }, + { + { { SIMDE_FLOAT32_C( 179.53), SIMDE_FLOAT32_C( 588.47), SIMDE_FLOAT32_C( 697.20), SIMDE_FLOAT32_C( -852.44) }, + { SIMDE_FLOAT32_C( -681.19), SIMDE_FLOAT32_C( -606.32), SIMDE_FLOAT32_C( 247.13), SIMDE_FLOAT32_C( 620.56) }, + { SIMDE_FLOAT32_C( -657.75), SIMDE_FLOAT32_C( 605.36), SIMDE_FLOAT32_C( 531.71), SIMDE_FLOAT32_C( 634.91) } }, + { SIMDE_FLOAT32_C( 179.53), SIMDE_FLOAT32_C( 588.47), SIMDE_FLOAT32_C( 697.20), SIMDE_FLOAT32_C( -852.44), + SIMDE_FLOAT32_C( -681.19), SIMDE_FLOAT32_C( -606.32), SIMDE_FLOAT32_C( 247.13), SIMDE_FLOAT32_C( 620.56), + SIMDE_FLOAT32_C( -657.75), SIMDE_FLOAT32_C( 605.36), SIMDE_FLOAT32_C( 531.71), SIMDE_FLOAT32_C( 634.91) } }, + { + { { SIMDE_FLOAT32_C( -177.57), SIMDE_FLOAT32_C( -770.29), SIMDE_FLOAT32_C( 267.15), SIMDE_FLOAT32_C( -635.35) }, + { SIMDE_FLOAT32_C( 206.41), SIMDE_FLOAT32_C( 154.49), SIMDE_FLOAT32_C( -508.65), SIMDE_FLOAT32_C( -139.06) }, + { SIMDE_FLOAT32_C( -493.82), SIMDE_FLOAT32_C( 415.25), SIMDE_FLOAT32_C( 158.04), SIMDE_FLOAT32_C( 140.20) } }, + { SIMDE_FLOAT32_C( -177.57), SIMDE_FLOAT32_C( -770.29), SIMDE_FLOAT32_C( 267.15), SIMDE_FLOAT32_C( -635.35), + SIMDE_FLOAT32_C( 206.41), SIMDE_FLOAT32_C( 154.49), SIMDE_FLOAT32_C( -508.65), SIMDE_FLOAT32_C( -139.06), + SIMDE_FLOAT32_C( -493.82), SIMDE_FLOAT32_C( 415.25), SIMDE_FLOAT32_C( 158.04), SIMDE_FLOAT32_C( 140.20) } }, + { + { { SIMDE_FLOAT32_C( -514.24), SIMDE_FLOAT32_C( 815.21), SIMDE_FLOAT32_C( 887.61), SIMDE_FLOAT32_C( 894.16) }, + { SIMDE_FLOAT32_C( -233.59), SIMDE_FLOAT32_C( -369.20), SIMDE_FLOAT32_C( -875.77), SIMDE_FLOAT32_C( 945.95) }, + { SIMDE_FLOAT32_C( -780.73), SIMDE_FLOAT32_C( 821.42), SIMDE_FLOAT32_C( -906.49), SIMDE_FLOAT32_C( -461.92) } }, + { SIMDE_FLOAT32_C( -514.24), SIMDE_FLOAT32_C( 815.21), SIMDE_FLOAT32_C( 887.61), SIMDE_FLOAT32_C( 894.16), + SIMDE_FLOAT32_C( -233.59), SIMDE_FLOAT32_C( -369.20), SIMDE_FLOAT32_C( -875.77), SIMDE_FLOAT32_C( 945.95), + SIMDE_FLOAT32_C( -780.73), SIMDE_FLOAT32_C( 821.42), SIMDE_FLOAT32_C( -906.49), SIMDE_FLOAT32_C( -461.92) } }, + { + { { SIMDE_FLOAT32_C( -784.89), SIMDE_FLOAT32_C( 340.64), SIMDE_FLOAT32_C( -841.36), SIMDE_FLOAT32_C( -442.64) }, + { SIMDE_FLOAT32_C( -54.01), SIMDE_FLOAT32_C( 690.35), SIMDE_FLOAT32_C( -807.73), SIMDE_FLOAT32_C( 768.43) }, + { SIMDE_FLOAT32_C( 920.06), SIMDE_FLOAT32_C( 459.43), SIMDE_FLOAT32_C( -866.92), SIMDE_FLOAT32_C( 126.47) } }, + { SIMDE_FLOAT32_C( -784.89), SIMDE_FLOAT32_C( 340.64), SIMDE_FLOAT32_C( -841.36), SIMDE_FLOAT32_C( -442.64), + SIMDE_FLOAT32_C( -54.01), SIMDE_FLOAT32_C( 690.35), SIMDE_FLOAT32_C( -807.73), SIMDE_FLOAT32_C( 768.43), + SIMDE_FLOAT32_C( 920.06), SIMDE_FLOAT32_C( 459.43), SIMDE_FLOAT32_C( -866.92), SIMDE_FLOAT32_C( 126.47) } }, + { + { { SIMDE_FLOAT32_C( -386.08), SIMDE_FLOAT32_C( -375.57), SIMDE_FLOAT32_C( 987.41), SIMDE_FLOAT32_C( 120.10) }, + { SIMDE_FLOAT32_C( -960.32), SIMDE_FLOAT32_C( 145.45), SIMDE_FLOAT32_C( -739.70), SIMDE_FLOAT32_C( -474.57) }, + { SIMDE_FLOAT32_C( -39.34), SIMDE_FLOAT32_C( -852.09), SIMDE_FLOAT32_C( -580.40), SIMDE_FLOAT32_C( 727.07) } }, + { SIMDE_FLOAT32_C( -386.08), SIMDE_FLOAT32_C( -375.57), SIMDE_FLOAT32_C( 987.41), SIMDE_FLOAT32_C( 120.10), + SIMDE_FLOAT32_C( -960.32), SIMDE_FLOAT32_C( 145.45), SIMDE_FLOAT32_C( -739.70), SIMDE_FLOAT32_C( -474.57), + SIMDE_FLOAT32_C( -39.34), SIMDE_FLOAT32_C( -852.09), SIMDE_FLOAT32_C( -580.40), SIMDE_FLOAT32_C( 727.07) } }, + { + { { SIMDE_FLOAT32_C( -221.29), SIMDE_FLOAT32_C( -456.17), SIMDE_FLOAT32_C( 673.02), SIMDE_FLOAT32_C( -2.02) }, + { SIMDE_FLOAT32_C( -634.75), SIMDE_FLOAT32_C( 766.53), SIMDE_FLOAT32_C( 536.06), SIMDE_FLOAT32_C( -419.64) }, + { SIMDE_FLOAT32_C( 107.17), SIMDE_FLOAT32_C( 694.69), SIMDE_FLOAT32_C( 137.72), SIMDE_FLOAT32_C( -946.84) } }, + { SIMDE_FLOAT32_C( -221.29), SIMDE_FLOAT32_C( -456.17), SIMDE_FLOAT32_C( 673.02), SIMDE_FLOAT32_C( -2.02), + SIMDE_FLOAT32_C( -634.75), SIMDE_FLOAT32_C( 766.53), SIMDE_FLOAT32_C( 536.06), SIMDE_FLOAT32_C( -419.64), + SIMDE_FLOAT32_C( 107.17), SIMDE_FLOAT32_C( 694.69), SIMDE_FLOAT32_C( 137.72), SIMDE_FLOAT32_C( -946.84) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_float32x4x3_t r_ = { { simde_vld1q_f32(test_vec[i].r[0]), + simde_vld1q_f32(test_vec[i].r[1]), + simde_vld1q_f32(test_vec[i].r[2]) } }; + + SIMDE_ALIGN_TO_16 simde_float32 a_[12]; + simde_vst1q_f32_x3(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_float32x4_t a = simde_test_arm_neon_random_f32x4(-1000.0f, 1000.0f); + simde_float32x4_t b = simde_test_arm_neon_random_f32x4(-1000.0f, 1000.0f); + simde_float32x4_t c = simde_test_arm_neon_random_f32x4(-1000.0f, 1000.0f); + simde_float32x4x3_t d = {{a, b, c}}; + + simde_test_arm_neon_write_f32x4x3(2, d, SIMDE_TEST_VEC_POS_FIRST); + + simde_float32 buf[12]; + simde_vst1q_f32_x3(buf, d); + + simde_test_codegen_write_vf32(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1q_f64_x3 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + simde_float64 r[3][2]; + simde_float64 a[6]; + } test_vec[] = { + { + { { SIMDE_FLOAT64_C( 385.04), SIMDE_FLOAT64_C( 329.99) }, + { SIMDE_FLOAT64_C( 821.59), SIMDE_FLOAT64_C( 305.10) }, + { SIMDE_FLOAT64_C( -210.58), SIMDE_FLOAT64_C( 954.67) } }, + { SIMDE_FLOAT64_C( 385.04), SIMDE_FLOAT64_C( 329.99), SIMDE_FLOAT64_C( 821.59), SIMDE_FLOAT64_C( 305.10), + SIMDE_FLOAT64_C( -210.58), SIMDE_FLOAT64_C( 954.67) } }, + { + { { SIMDE_FLOAT64_C( -568.43), SIMDE_FLOAT64_C( 403.34) }, + { SIMDE_FLOAT64_C( -420.90), SIMDE_FLOAT64_C( -581.02) }, + { SIMDE_FLOAT64_C( -476.56), SIMDE_FLOAT64_C( -381.22) } }, + { SIMDE_FLOAT64_C( -568.43), SIMDE_FLOAT64_C( 403.34), SIMDE_FLOAT64_C( -420.90), SIMDE_FLOAT64_C( -581.02), + SIMDE_FLOAT64_C( -476.56), SIMDE_FLOAT64_C( -381.22) } }, + { + { { SIMDE_FLOAT64_C( 564.42), SIMDE_FLOAT64_C( -216.26) }, + { SIMDE_FLOAT64_C( 144.21), SIMDE_FLOAT64_C( -474.92) }, + { SIMDE_FLOAT64_C( -68.35), SIMDE_FLOAT64_C( 563.81) } }, + { SIMDE_FLOAT64_C( 564.42), SIMDE_FLOAT64_C( -216.26), SIMDE_FLOAT64_C( 144.21), SIMDE_FLOAT64_C( -474.92), + SIMDE_FLOAT64_C( -68.35), SIMDE_FLOAT64_C( 563.81) } }, + { + { { SIMDE_FLOAT64_C( -747.84), SIMDE_FLOAT64_C( 710.36) }, + { SIMDE_FLOAT64_C( -892.36), SIMDE_FLOAT64_C( 925.18) }, + { SIMDE_FLOAT64_C( -291.66), SIMDE_FLOAT64_C( -527.11) } }, + { SIMDE_FLOAT64_C( -747.84), SIMDE_FLOAT64_C( 710.36), SIMDE_FLOAT64_C( -892.36), SIMDE_FLOAT64_C( 925.18), + SIMDE_FLOAT64_C( -291.66), SIMDE_FLOAT64_C( -527.11) } }, + { + { { SIMDE_FLOAT64_C( 691.70), SIMDE_FLOAT64_C( -755.60) }, + { SIMDE_FLOAT64_C( 53.25), SIMDE_FLOAT64_C( -201.13) }, + { SIMDE_FLOAT64_C( 939.10), SIMDE_FLOAT64_C( -809.03) } }, + { SIMDE_FLOAT64_C( 691.70), SIMDE_FLOAT64_C( -755.60), SIMDE_FLOAT64_C( 53.25), SIMDE_FLOAT64_C( -201.13), + SIMDE_FLOAT64_C( 939.10), SIMDE_FLOAT64_C( -809.03) } }, + { + { { SIMDE_FLOAT64_C( -147.97), SIMDE_FLOAT64_C( 324.14) }, + { SIMDE_FLOAT64_C( 520.96), SIMDE_FLOAT64_C( -326.38) }, + { SIMDE_FLOAT64_C( -370.77), SIMDE_FLOAT64_C( -689.62) } }, + { SIMDE_FLOAT64_C( -147.97), SIMDE_FLOAT64_C( 324.14), SIMDE_FLOAT64_C( 520.96), SIMDE_FLOAT64_C( -326.38), + SIMDE_FLOAT64_C( -370.77), SIMDE_FLOAT64_C( -689.62) } }, + { + { { SIMDE_FLOAT64_C( -371.71), SIMDE_FLOAT64_C( 60.80) }, + { SIMDE_FLOAT64_C( 713.72), SIMDE_FLOAT64_C( 207.39) }, + { SIMDE_FLOAT64_C( 479.77), SIMDE_FLOAT64_C( -762.84) } }, + { SIMDE_FLOAT64_C( -371.71), SIMDE_FLOAT64_C( 60.80), SIMDE_FLOAT64_C( 713.72), SIMDE_FLOAT64_C( 207.39), + SIMDE_FLOAT64_C( 479.77), SIMDE_FLOAT64_C( -762.84) } }, + { + { { SIMDE_FLOAT64_C( 826.17), SIMDE_FLOAT64_C( 44.20) }, + { SIMDE_FLOAT64_C( 20.90), SIMDE_FLOAT64_C( -29.62) }, + { SIMDE_FLOAT64_C( 569.28), SIMDE_FLOAT64_C( 952.55) } }, + { SIMDE_FLOAT64_C( 826.17), SIMDE_FLOAT64_C( 44.20), SIMDE_FLOAT64_C( 20.90), SIMDE_FLOAT64_C( -29.62), + SIMDE_FLOAT64_C( 569.28), SIMDE_FLOAT64_C( 952.55) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_float64x2x3_t r_ = { { simde_vld1q_f64(test_vec[i].r[0]), + simde_vld1q_f64(test_vec[i].r[1]), + simde_vld1q_f64(test_vec[i].r[2]) } }; + + SIMDE_ALIGN_TO_16 simde_float64 a_[6]; + simde_vst1q_f64_x3(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_float64x2_t a = simde_test_arm_neon_random_f64x2(-1000.0, 1000.0); + simde_float64x2_t b = simde_test_arm_neon_random_f64x2(-1000.0, 1000.0); + simde_float64x2_t c = simde_test_arm_neon_random_f64x2(-1000.0, 1000.0); + simde_float64x2x3_t d = {{a, b, c}}; + + simde_test_arm_neon_write_f64x2x3(2, d, SIMDE_TEST_VEC_POS_FIRST); + + simde_float64 buf[6]; + simde_vst1q_f64_x3(buf, d); + + simde_test_codegen_write_vf64(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1q_s8_x3 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + int8_t r[3][16]; + int8_t a[48]; + } test_vec[] = { + { + { { INT8_C( 86), INT8_C( 69), -INT8_C( 105), INT8_C( 122), -INT8_C( 113), INT8_C( 2), INT8_C( 118), INT8_C( 42), + -INT8_C( 15), INT8_C( 99), -INT8_C( 22), INT8_C( 14), -INT8_C( 58), INT8_C( 93), -INT8_C( 10), -INT8_C( 84) }, + { -INT8_C( 85), -INT8_C( 57), INT8_C( 6), INT8_C( 0), INT8_C( 52), -INT8_C( 72), INT8_C( 107), -INT8_C( 71), + -INT8_C( 92), -INT8_C( 6), -INT8_C( 18), -INT8_C( 72), -INT8_C( 106), INT8_C( 27), INT8_C( 57), -INT8_C( 19) }, + { INT8_C( 96), -INT8_C( 48), INT8_C( 103), -INT8_C( 16), -INT8_C( 46), -INT8_C( 35), INT8_C( 26), -INT8_C( 61), + INT8_C( 65), INT8_C( 4), -INT8_C( 47), INT8_C( 7), INT8_C( 97), -INT8_C( 56), -INT8_C( 76), INT8_C( 12) } }, + { INT8_C( 86), INT8_C( 69), -INT8_C( 105), INT8_C( 122), -INT8_C( 113), INT8_C( 2), INT8_C( 118), INT8_C( 42), + -INT8_C( 15), INT8_C( 99), -INT8_C( 22), INT8_C( 14), -INT8_C( 58), INT8_C( 93), -INT8_C( 10), -INT8_C( 84), + -INT8_C( 85), -INT8_C( 57), INT8_C( 6), INT8_C( 0), INT8_C( 52), -INT8_C( 72), INT8_C( 107), -INT8_C( 71), + -INT8_C( 92), -INT8_C( 6), -INT8_C( 18), -INT8_C( 72), -INT8_C( 106), INT8_C( 27), INT8_C( 57), -INT8_C( 19), + INT8_C( 96), -INT8_C( 48), INT8_C( 103), -INT8_C( 16), -INT8_C( 46), -INT8_C( 35), INT8_C( 26), -INT8_C( 61), + INT8_C( 65), INT8_C( 4), -INT8_C( 47), INT8_C( 7), INT8_C( 97), -INT8_C( 56), -INT8_C( 76), INT8_C( 12) } }, + { + { { -INT8_C( 113), -INT8_C( 70), INT8_C( 13), -INT8_C( 61), INT8_C( 115), INT8_C( 120), INT8_C( 124), INT8_C( 23), + INT8_C( 115), INT8_C( 106), -INT8_C( 49), INT8_C( 9), -INT8_C( 123), INT8_C( 8), -INT8_C( 10), -INT8_C( 27) }, + { -INT8_C( 40), INT8_C( 94), -INT8_C( 43), -INT8_C( 86), INT8_C( 59), -INT8_C( 17), INT8_C( 109), INT8_C( 124), + -INT8_C( 13), INT8_C( 63), -INT8_C( 124), INT8_C( 84), INT8_C( 7), INT8_C( 56), INT8_C( 97), -INT8_C( 106) }, + { -INT8_C( 14), INT8_C( 110), INT8_C( 89), INT8_C( 101), -INT8_C( 26), -INT8_C( 43), INT8_C( 124), INT8_C( 89), + INT8_C( 63), INT8_C( 76), INT8_C( 99), -INT8_C( 60), INT8_C( 84), INT8_C( 89), -INT8_C( 87), INT8_C( 45) } }, + { -INT8_C( 113), -INT8_C( 70), INT8_C( 13), -INT8_C( 61), INT8_C( 115), INT8_C( 120), INT8_C( 124), INT8_C( 23), + INT8_C( 115), INT8_C( 106), -INT8_C( 49), INT8_C( 9), -INT8_C( 123), INT8_C( 8), -INT8_C( 10), -INT8_C( 27), + -INT8_C( 40), INT8_C( 94), -INT8_C( 43), -INT8_C( 86), INT8_C( 59), -INT8_C( 17), INT8_C( 109), INT8_C( 124), + -INT8_C( 13), INT8_C( 63), -INT8_C( 124), INT8_C( 84), INT8_C( 7), INT8_C( 56), INT8_C( 97), -INT8_C( 106), + -INT8_C( 14), INT8_C( 110), INT8_C( 89), INT8_C( 101), -INT8_C( 26), -INT8_C( 43), INT8_C( 124), INT8_C( 89), + INT8_C( 63), INT8_C( 76), INT8_C( 99), -INT8_C( 60), INT8_C( 84), INT8_C( 89), -INT8_C( 87), INT8_C( 45) } }, + { + { { -INT8_C( 73), INT8_MAX, -INT8_C( 41), -INT8_C( 13), INT8_C( 110), INT8_C( 69), INT8_C( 111), INT8_C( 98), + -INT8_C( 124), -INT8_C( 13), -INT8_C( 74), -INT8_C( 117), INT8_C( 43), INT8_C( 23), INT8_C( 33), INT8_C( 30) }, + { -INT8_C( 123), INT8_C( 122), -INT8_C( 125), INT8_C( 108), INT8_C( 79), INT8_C( 0), -INT8_C( 59), -INT8_C( 114), + INT8_C( 76), INT8_C( 40), INT8_C( 82), -INT8_C( 96), -INT8_C( 126), -INT8_C( 5), -INT8_C( 51), INT8_C( 57) }, + { INT8_C( 122), -INT8_C( 91), INT8_C( 44), -INT8_C( 23), -INT8_C( 22), -INT8_C( 100), INT8_C( 75), INT8_C( 110), + -INT8_C( 113), INT8_C( 1), -INT8_C( 7), -INT8_C( 69), INT8_C( 25), INT8_C( 26), -INT8_C( 39), -INT8_C( 98) } }, + { -INT8_C( 73), INT8_MAX, -INT8_C( 41), -INT8_C( 13), INT8_C( 110), INT8_C( 69), INT8_C( 111), INT8_C( 98), + -INT8_C( 124), -INT8_C( 13), -INT8_C( 74), -INT8_C( 117), INT8_C( 43), INT8_C( 23), INT8_C( 33), INT8_C( 30), + -INT8_C( 123), INT8_C( 122), -INT8_C( 125), INT8_C( 108), INT8_C( 79), INT8_C( 0), -INT8_C( 59), -INT8_C( 114), + INT8_C( 76), INT8_C( 40), INT8_C( 82), -INT8_C( 96), -INT8_C( 126), -INT8_C( 5), -INT8_C( 51), INT8_C( 57), + INT8_C( 122), -INT8_C( 91), INT8_C( 44), -INT8_C( 23), -INT8_C( 22), -INT8_C( 100), INT8_C( 75), INT8_C( 110), + -INT8_C( 113), INT8_C( 1), -INT8_C( 7), -INT8_C( 69), INT8_C( 25), INT8_C( 26), -INT8_C( 39), -INT8_C( 98) } }, + { + { { -INT8_C( 108), INT8_C( 92), INT8_C( 10), -INT8_C( 29), INT8_C( 92), -INT8_C( 48), INT8_C( 113), -INT8_C( 88), + -INT8_C( 8), -INT8_C( 61), INT8_C( 73), INT8_C( 122), -INT8_C( 66), INT8_C( 22), -INT8_C( 76), INT8_C( 57) }, + { -INT8_C( 69), -INT8_C( 32), INT8_C( 34), -INT8_C( 91), INT8_C( 124), INT8_C( 109), INT8_C( 19), INT8_C( 12), + INT8_C( 110), INT8_C( 12), -INT8_C( 57), -INT8_C( 121), INT8_C( 38), -INT8_C( 96), INT8_C( 38), -INT8_C( 70) }, + { -INT8_C( 4), INT8_C( 48), -INT8_C( 99), INT8_C( 89), INT8_C( 0), INT8_C( 14), INT8_C( 1), -INT8_C( 7), + -INT8_C( 47), INT8_C( 74), INT8_C( 115), -INT8_C( 112), INT8_C( 97), INT8_C( 39), -INT8_C( 55), INT8_C( 28) } }, + { -INT8_C( 108), INT8_C( 92), INT8_C( 10), -INT8_C( 29), INT8_C( 92), -INT8_C( 48), INT8_C( 113), -INT8_C( 88), + -INT8_C( 8), -INT8_C( 61), INT8_C( 73), INT8_C( 122), -INT8_C( 66), INT8_C( 22), -INT8_C( 76), INT8_C( 57), + -INT8_C( 69), -INT8_C( 32), INT8_C( 34), -INT8_C( 91), INT8_C( 124), INT8_C( 109), INT8_C( 19), INT8_C( 12), + INT8_C( 110), INT8_C( 12), -INT8_C( 57), -INT8_C( 121), INT8_C( 38), -INT8_C( 96), INT8_C( 38), -INT8_C( 70), + -INT8_C( 4), INT8_C( 48), -INT8_C( 99), INT8_C( 89), INT8_C( 0), INT8_C( 14), INT8_C( 1), -INT8_C( 7), + -INT8_C( 47), INT8_C( 74), INT8_C( 115), -INT8_C( 112), INT8_C( 97), INT8_C( 39), -INT8_C( 55), INT8_C( 28) } }, + { + { { INT8_C( 8), -INT8_C( 21), -INT8_C( 62), -INT8_C( 124), INT8_C( 88), -INT8_C( 43), -INT8_C( 112), -INT8_C( 58), + -INT8_C( 30), INT8_C( 87), INT8_C( 78), INT8_C( 8), -INT8_C( 9), INT8_C( 116), -INT8_C( 61), -INT8_C( 12) }, + { -INT8_C( 92), INT8_C( 96), INT8_C( 77), -INT8_C( 91), INT8_C( 111), INT8_C( 78), -INT8_C( 98), INT8_C( 64), + -INT8_C( 103), INT8_C( 17), -INT8_C( 48), -INT8_C( 6), INT8_C( 57), -INT8_C( 103), INT8_C( 22), INT8_C( 65) }, + { -INT8_C( 124), -INT8_C( 40), -INT8_C( 59), -INT8_C( 36), -INT8_C( 82), INT8_C( 86), -INT8_C( 93), -INT8_C( 112), + -INT8_C( 83), -INT8_C( 15), -INT8_C( 104), -INT8_C( 91), INT8_C( 101), INT8_C( 91), -INT8_C( 103), INT8_C( 9) } }, + { INT8_C( 8), -INT8_C( 21), -INT8_C( 62), -INT8_C( 124), INT8_C( 88), -INT8_C( 43), -INT8_C( 112), -INT8_C( 58), + -INT8_C( 30), INT8_C( 87), INT8_C( 78), INT8_C( 8), -INT8_C( 9), INT8_C( 116), -INT8_C( 61), -INT8_C( 12), + -INT8_C( 92), INT8_C( 96), INT8_C( 77), -INT8_C( 91), INT8_C( 111), INT8_C( 78), -INT8_C( 98), INT8_C( 64), + -INT8_C( 103), INT8_C( 17), -INT8_C( 48), -INT8_C( 6), INT8_C( 57), -INT8_C( 103), INT8_C( 22), INT8_C( 65), + -INT8_C( 124), -INT8_C( 40), -INT8_C( 59), -INT8_C( 36), -INT8_C( 82), INT8_C( 86), -INT8_C( 93), -INT8_C( 112), + -INT8_C( 83), -INT8_C( 15), -INT8_C( 104), -INT8_C( 91), INT8_C( 101), INT8_C( 91), -INT8_C( 103), INT8_C( 9) } }, + { + { { -INT8_C( 68), -INT8_C( 26), -INT8_C( 82), INT8_C( 43), INT8_C( 52), INT8_C( 76), INT8_C( 107), -INT8_C( 51), + INT8_C( 94), INT8_C( 60), -INT8_C( 57), -INT8_C( 105), -INT8_C( 43), -INT8_C( 34), -INT8_C( 40), INT8_C( 90) }, + { -INT8_C( 74), -INT8_C( 99), INT8_C( 54), INT8_C( 100), -INT8_C( 13), -INT8_C( 39), -INT8_C( 12), -INT8_C( 95), + -INT8_C( 54), -INT8_C( 115), INT8_C( 70), INT8_C( 47), -INT8_C( 24), -INT8_C( 33), INT8_C( 57), -INT8_C( 92) }, + { -INT8_C( 59), -INT8_C( 25), -INT8_C( 49), -INT8_C( 7), INT8_C( 52), INT8_C( 59), -INT8_C( 57), -INT8_C( 110), + INT8_C( 119), -INT8_C( 114), INT8_C( 41), INT8_C( 76), INT8_C( 108), INT8_C( 1), -INT8_C( 90), INT8_C( 35) } }, + { -INT8_C( 68), -INT8_C( 26), -INT8_C( 82), INT8_C( 43), INT8_C( 52), INT8_C( 76), INT8_C( 107), -INT8_C( 51), + INT8_C( 94), INT8_C( 60), -INT8_C( 57), -INT8_C( 105), -INT8_C( 43), -INT8_C( 34), -INT8_C( 40), INT8_C( 90), + -INT8_C( 74), -INT8_C( 99), INT8_C( 54), INT8_C( 100), -INT8_C( 13), -INT8_C( 39), -INT8_C( 12), -INT8_C( 95), + -INT8_C( 54), -INT8_C( 115), INT8_C( 70), INT8_C( 47), -INT8_C( 24), -INT8_C( 33), INT8_C( 57), -INT8_C( 92), + -INT8_C( 59), -INT8_C( 25), -INT8_C( 49), -INT8_C( 7), INT8_C( 52), INT8_C( 59), -INT8_C( 57), -INT8_C( 110), + INT8_C( 119), -INT8_C( 114), INT8_C( 41), INT8_C( 76), INT8_C( 108), INT8_C( 1), -INT8_C( 90), INT8_C( 35) } }, + { + { { -INT8_C( 98), -INT8_C( 35), -INT8_C( 121), -INT8_C( 110), -INT8_C( 74), INT8_C( 124), INT8_C( 51), -INT8_C( 127), + INT8_C( 9), INT8_C( 121), -INT8_C( 80), -INT8_C( 15), INT8_C( 88), -INT8_C( 23), -INT8_C( 106), INT8_C( 29) }, + { -INT8_C( 47), INT8_C( 101), INT8_C( 22), INT8_C( 5), -INT8_C( 96), -INT8_C( 35), -INT8_C( 105), INT8_C( 23), + INT8_C( 108), -INT8_C( 64), INT8_C( 100), -INT8_C( 40), -INT8_C( 63), INT8_C( 10), -INT8_C( 5), INT8_C( 95) }, + { -INT8_C( 25), -INT8_C( 125), -INT8_C( 15), -INT8_C( 98), -INT8_C( 1), INT8_C( 36), INT8_C( 31), INT8_C( 8), + -INT8_C( 99), -INT8_C( 49), -INT8_C( 7), -INT8_C( 11), -INT8_C( 71), -INT8_C( 113), INT8_C( 18), -INT8_C( 118) } }, + { -INT8_C( 98), -INT8_C( 35), -INT8_C( 121), -INT8_C( 110), -INT8_C( 74), INT8_C( 124), INT8_C( 51), -INT8_C( 127), + INT8_C( 9), INT8_C( 121), -INT8_C( 80), -INT8_C( 15), INT8_C( 88), -INT8_C( 23), -INT8_C( 106), INT8_C( 29), + -INT8_C( 47), INT8_C( 101), INT8_C( 22), INT8_C( 5), -INT8_C( 96), -INT8_C( 35), -INT8_C( 105), INT8_C( 23), + INT8_C( 108), -INT8_C( 64), INT8_C( 100), -INT8_C( 40), -INT8_C( 63), INT8_C( 10), -INT8_C( 5), INT8_C( 95), + -INT8_C( 25), -INT8_C( 125), -INT8_C( 15), -INT8_C( 98), -INT8_C( 1), INT8_C( 36), INT8_C( 31), INT8_C( 8), + -INT8_C( 99), -INT8_C( 49), -INT8_C( 7), -INT8_C( 11), -INT8_C( 71), -INT8_C( 113), INT8_C( 18), -INT8_C( 118) } }, + { + { { -INT8_C( 11), INT8_C( 41), -INT8_C( 113), -INT8_C( 107), INT8_C( 6), INT8_C( 38), -INT8_C( 83), INT8_C( 114), + -INT8_C( 26), INT8_C( 17), INT8_C( 75), -INT8_C( 89), INT8_C( 27), INT8_C( 70), INT8_C( 6), INT8_C( 3) }, + { -INT8_C( 55), -INT8_C( 8), -INT8_C( 95), -INT8_C( 56), INT8_C( 28), -INT8_C( 64), -INT8_C( 48), -INT8_C( 70), + -INT8_C( 113), -INT8_C( 54), -INT8_C( 81), INT8_C( 72), INT8_C( 89), -INT8_C( 62), -INT8_C( 46), INT8_C( 78) }, + { -INT8_C( 21), INT8_C( 97), -INT8_C( 28), -INT8_C( 15), -INT8_C( 121), -INT8_C( 111), INT8_C( 100), INT8_C( 109), + -INT8_C( 94), -INT8_C( 81), INT8_C( 20), -INT8_C( 67), -INT8_C( 11), INT8_C( 27), -INT8_C( 64), -INT8_C( 65) } }, + { -INT8_C( 11), INT8_C( 41), -INT8_C( 113), -INT8_C( 107), INT8_C( 6), INT8_C( 38), -INT8_C( 83), INT8_C( 114), + -INT8_C( 26), INT8_C( 17), INT8_C( 75), -INT8_C( 89), INT8_C( 27), INT8_C( 70), INT8_C( 6), INT8_C( 3), + -INT8_C( 55), -INT8_C( 8), -INT8_C( 95), -INT8_C( 56), INT8_C( 28), -INT8_C( 64), -INT8_C( 48), -INT8_C( 70), + -INT8_C( 113), -INT8_C( 54), -INT8_C( 81), INT8_C( 72), INT8_C( 89), -INT8_C( 62), -INT8_C( 46), INT8_C( 78), + -INT8_C( 21), INT8_C( 97), -INT8_C( 28), -INT8_C( 15), -INT8_C( 121), -INT8_C( 111), INT8_C( 100), INT8_C( 109), + -INT8_C( 94), -INT8_C( 81), INT8_C( 20), -INT8_C( 67), -INT8_C( 11), INT8_C( 27), -INT8_C( 64), -INT8_C( 65) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_int8x16x3_t r_ = { { simde_vld1q_s8(test_vec[i].r[0]), + simde_vld1q_s8(test_vec[i].r[1]), + simde_vld1q_s8(test_vec[i].r[2]) } }; + + SIMDE_ALIGN_TO_16 int8_t a_[48]; + simde_vst1q_s8_x3(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_int8x16_t a = simde_test_arm_neon_random_i8x16(); + simde_int8x16_t b = simde_test_arm_neon_random_i8x16(); + simde_int8x16_t c = simde_test_arm_neon_random_i8x16(); + simde_int8x16x3_t d = {{a, b, c}}; + + simde_test_arm_neon_write_i8x16x3(2, d, SIMDE_TEST_VEC_POS_FIRST); + + int8_t buf[48]; + simde_vst1q_s8_x3(buf, d); + + simde_test_codegen_write_vi8(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1q_s16_x3 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + int16_t r[3][8]; + int16_t a[24]; + } test_vec[] = { + { + { { INT16_C( 24851), INT16_C( 12167), INT16_C( 22561), -INT16_C( 19991), -INT16_C( 26334), INT16_C( 31737), -INT16_C( 13221), INT16_C( 18122) }, + { -INT16_C( 20947), -INT16_C( 19145), -INT16_C( 25793), -INT16_C( 7902), INT16_C( 14154), INT16_C( 16542), INT16_C( 24402), INT16_C( 26111) }, + { -INT16_C( 31040), -INT16_C( 7532), INT16_C( 32478), INT16_C( 147), -INT16_C( 29673), INT16_C( 29308), INT16_C( 18008), -INT16_C( 31048) } }, + { INT16_C( 24851), INT16_C( 12167), INT16_C( 22561), -INT16_C( 19991), -INT16_C( 26334), INT16_C( 31737), -INT16_C( 13221), INT16_C( 18122), + -INT16_C( 20947), -INT16_C( 19145), -INT16_C( 25793), -INT16_C( 7902), INT16_C( 14154), INT16_C( 16542), INT16_C( 24402), INT16_C( 26111), + -INT16_C( 31040), -INT16_C( 7532), INT16_C( 32478), INT16_C( 147), -INT16_C( 29673), INT16_C( 29308), INT16_C( 18008), -INT16_C( 31048) } }, + { + { { -INT16_C( 4108), INT16_C( 13115), INT16_C( 23947), -INT16_C( 10988), -INT16_C( 19820), -INT16_C( 6635), INT16_C( 5137), -INT16_C( 11701) }, + { -INT16_C( 8037), INT16_C( 31156), INT16_C( 18270), INT16_C( 30074), -INT16_C( 2349), INT16_C( 11495), -INT16_C( 24772), INT16_C( 12466) }, + { -INT16_C( 4722), INT16_C( 6499), INT16_C( 30538), -INT16_C( 8209), INT16_C( 1065), INT16_C( 15301), INT16_C( 4377), -INT16_C( 19443) } }, + { -INT16_C( 4108), INT16_C( 13115), INT16_C( 23947), -INT16_C( 10988), -INT16_C( 19820), -INT16_C( 6635), INT16_C( 5137), -INT16_C( 11701), + -INT16_C( 8037), INT16_C( 31156), INT16_C( 18270), INT16_C( 30074), -INT16_C( 2349), INT16_C( 11495), -INT16_C( 24772), INT16_C( 12466), + -INT16_C( 4722), INT16_C( 6499), INT16_C( 30538), -INT16_C( 8209), INT16_C( 1065), INT16_C( 15301), INT16_C( 4377), -INT16_C( 19443) } }, + { + { { -INT16_C( 15887), INT16_C( 20269), -INT16_C( 22776), -INT16_C( 9276), -INT16_C( 21603), -INT16_C( 9977), -INT16_C( 18102), -INT16_C( 10231) }, + { INT16_C( 27814), -INT16_C( 3598), -INT16_C( 7709), INT16_C( 3536), -INT16_C( 27163), -INT16_C( 440), INT16_C( 21926), -INT16_C( 26702) }, + { -INT16_C( 8170), INT16_C( 7910), -INT16_C( 21881), INT16_C( 9721), INT16_C( 341), -INT16_C( 24578), INT16_C( 2234), INT16_C( 24952) } }, + { -INT16_C( 15887), INT16_C( 20269), -INT16_C( 22776), -INT16_C( 9276), -INT16_C( 21603), -INT16_C( 9977), -INT16_C( 18102), -INT16_C( 10231), + INT16_C( 27814), -INT16_C( 3598), -INT16_C( 7709), INT16_C( 3536), -INT16_C( 27163), -INT16_C( 440), INT16_C( 21926), -INT16_C( 26702), + -INT16_C( 8170), INT16_C( 7910), -INT16_C( 21881), INT16_C( 9721), INT16_C( 341), -INT16_C( 24578), INT16_C( 2234), INT16_C( 24952) } }, + { + { { INT16_C( 27252), INT16_C( 22610), INT16_C( 8779), INT16_C( 12389), -INT16_C( 21065), INT16_C( 24111), -INT16_C( 7934), INT16_C( 6389) }, + { -INT16_C( 9023), INT16_C( 18742), INT16_C( 12166), -INT16_C( 9106), INT16_C( 27696), -INT16_C( 5253), -INT16_C( 3212), -INT16_C( 5812) }, + { -INT16_C( 24995), -INT16_C( 22463), -INT16_C( 22848), INT16_C( 30681), INT16_C( 2131), INT16_C( 21973), -INT16_C( 13335), -INT16_C( 21651) } }, + { INT16_C( 27252), INT16_C( 22610), INT16_C( 8779), INT16_C( 12389), -INT16_C( 21065), INT16_C( 24111), -INT16_C( 7934), INT16_C( 6389), + -INT16_C( 9023), INT16_C( 18742), INT16_C( 12166), -INT16_C( 9106), INT16_C( 27696), -INT16_C( 5253), -INT16_C( 3212), -INT16_C( 5812), + -INT16_C( 24995), -INT16_C( 22463), -INT16_C( 22848), INT16_C( 30681), INT16_C( 2131), INT16_C( 21973), -INT16_C( 13335), -INT16_C( 21651) } }, + { + { { -INT16_C( 23641), INT16_C( 11764), INT16_C( 25298), INT16_C( 777), -INT16_C( 31282), INT16_C( 17390), INT16_C( 14968), -INT16_C( 10708) }, + { INT16_C( 28120), -INT16_C( 26498), INT16_C( 22291), INT16_C( 26127), -INT16_C( 6817), INT16_C( 18875), INT16_C( 10416), INT16_C( 22516) }, + { -INT16_C( 5941), -INT16_C( 25212), -INT16_C( 29110), INT16_C( 6304), -INT16_C( 29165), -INT16_C( 29861), -INT16_C( 30776), -INT16_C( 24479) } }, + { -INT16_C( 23641), INT16_C( 11764), INT16_C( 25298), INT16_C( 777), -INT16_C( 31282), INT16_C( 17390), INT16_C( 14968), -INT16_C( 10708), + INT16_C( 28120), -INT16_C( 26498), INT16_C( 22291), INT16_C( 26127), -INT16_C( 6817), INT16_C( 18875), INT16_C( 10416), INT16_C( 22516), + -INT16_C( 5941), -INT16_C( 25212), -INT16_C( 29110), INT16_C( 6304), -INT16_C( 29165), -INT16_C( 29861), -INT16_C( 30776), -INT16_C( 24479) } }, + { + { { -INT16_C( 7948), INT16_C( 1848), INT16_C( 18487), -INT16_C( 26771), INT16_C( 10285), -INT16_C( 8736), -INT16_C( 11184), INT16_C( 6964) }, + { -INT16_C( 18244), INT16_C( 1721), INT16_C( 22854), INT16_C( 22814), INT16_C( 31464), -INT16_C( 20251), INT16_C( 17921), -INT16_C( 2479) }, + { -INT16_C( 30426), INT16_C( 24317), INT16_C( 27601), -INT16_C( 267), -INT16_C( 10861), -INT16_C( 6949), INT16_C( 4009), INT16_C( 26111) } }, + { -INT16_C( 7948), INT16_C( 1848), INT16_C( 18487), -INT16_C( 26771), INT16_C( 10285), -INT16_C( 8736), -INT16_C( 11184), INT16_C( 6964), + -INT16_C( 18244), INT16_C( 1721), INT16_C( 22854), INT16_C( 22814), INT16_C( 31464), -INT16_C( 20251), INT16_C( 17921), -INT16_C( 2479), + -INT16_C( 30426), INT16_C( 24317), INT16_C( 27601), -INT16_C( 267), -INT16_C( 10861), -INT16_C( 6949), INT16_C( 4009), INT16_C( 26111) } }, + { + { { -INT16_C( 18232), INT16_C( 3691), -INT16_C( 30446), -INT16_C( 1432), INT16_C( 19715), INT16_C( 1450), -INT16_C( 1133), -INT16_C( 17669) }, + { -INT16_C( 1915), INT16_C( 22040), INT16_C( 3427), -INT16_C( 2219), INT16_C( 12514), -INT16_C( 29733), -INT16_C( 9664), INT16_C( 2288) }, + { INT16_C( 23443), -INT16_C( 23274), INT16_C( 32484), -INT16_C( 5985), INT16_C( 18891), INT16_C( 24557), -INT16_C( 6075), -INT16_C( 13799) } }, + { -INT16_C( 18232), INT16_C( 3691), -INT16_C( 30446), -INT16_C( 1432), INT16_C( 19715), INT16_C( 1450), -INT16_C( 1133), -INT16_C( 17669), + -INT16_C( 1915), INT16_C( 22040), INT16_C( 3427), -INT16_C( 2219), INT16_C( 12514), -INT16_C( 29733), -INT16_C( 9664), INT16_C( 2288), + INT16_C( 23443), -INT16_C( 23274), INT16_C( 32484), -INT16_C( 5985), INT16_C( 18891), INT16_C( 24557), -INT16_C( 6075), -INT16_C( 13799) } }, + { + { { INT16_C( 12768), INT16_C( 17440), INT16_C( 30014), INT16_C( 8251), INT16_C( 5798), -INT16_C( 6485), -INT16_C( 25616), -INT16_C( 31762) }, + { INT16_C( 1270), -INT16_C( 9688), -INT16_C( 14461), INT16_C( 20162), -INT16_C( 20719), INT16_C( 22189), -INT16_C( 14697), INT16_C( 30752) }, + { INT16_C( 16631), INT16_C( 13756), -INT16_C( 2122), INT16_C( 23637), INT16_C( 13), -INT16_C( 702), INT16_C( 12443), -INT16_C( 28287) } }, + { INT16_C( 12768), INT16_C( 17440), INT16_C( 30014), INT16_C( 8251), INT16_C( 5798), -INT16_C( 6485), -INT16_C( 25616), -INT16_C( 31762), + INT16_C( 1270), -INT16_C( 9688), -INT16_C( 14461), INT16_C( 20162), -INT16_C( 20719), INT16_C( 22189), -INT16_C( 14697), INT16_C( 30752), + INT16_C( 16631), INT16_C( 13756), -INT16_C( 2122), INT16_C( 23637), INT16_C( 13), -INT16_C( 702), INT16_C( 12443), -INT16_C( 28287) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_int16x8x3_t r_ = { { simde_vld1q_s16(test_vec[i].r[0]), + simde_vld1q_s16(test_vec[i].r[1]), + simde_vld1q_s16(test_vec[i].r[2]) } }; + + SIMDE_ALIGN_TO_16 int16_t a_[24]; + simde_vst1q_s16_x3(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_int16x8_t a = simde_test_arm_neon_random_i16x8(); + simde_int16x8_t b = simde_test_arm_neon_random_i16x8(); + simde_int16x8_t c = simde_test_arm_neon_random_i16x8(); + simde_int16x8x3_t d = {{a, b, c}}; + + simde_test_arm_neon_write_i16x8x3(2, d, SIMDE_TEST_VEC_POS_FIRST); + + int16_t buf[24]; + simde_vst1q_s16_x3(buf, d); + + simde_test_codegen_write_vi16(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1q_s32_x3 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + int32_t r[3][4]; + int32_t a[12]; + } test_vec[] = { + { + { { -INT32_C( 1217615564), -INT32_C( 2113524111), INT32_C( 1977136094), INT32_C( 1911421050) }, + { -INT32_C( 291002056), -INT32_C( 1387594592), -INT32_C( 1733587715), -INT32_C( 248894276) }, + { INT32_C( 1185453781), -INT32_C( 1563906364), -INT32_C( 602365854), -INT32_C( 783481448) } }, + { -INT32_C( 1217615564), -INT32_C( 2113524111), INT32_C( 1977136094), INT32_C( 1911421050), -INT32_C( 291002056), -INT32_C( 1387594592), -INT32_C( 1733587715), -INT32_C( 248894276), + INT32_C( 1185453781), -INT32_C( 1563906364), -INT32_C( 602365854), -INT32_C( 783481448) } }, + { + { { INT32_C( 1337980079), -INT32_C( 285406479), INT32_C( 1401333910), -INT32_C( 1455116076) }, + { INT32_C( 200338502), -INT32_C( 38946661), -INT32_C( 237386407), INT32_C( 2059544267) }, + { INT32_C( 214532635), INT32_C( 586860172), INT32_C( 1114996846), INT32_C( 2012002609) } }, + { INT32_C( 1337980079), -INT32_C( 285406479), INT32_C( 1401333910), -INT32_C( 1455116076), INT32_C( 200338502), -INT32_C( 38946661), -INT32_C( 237386407), INT32_C( 2059544267), + INT32_C( 214532635), INT32_C( 586860172), INT32_C( 1114996846), INT32_C( 2012002609) } }, + { + { { INT32_C( 1099095206), -INT32_C( 314691436), -INT32_C( 1059121163), INT32_C( 1480237373) }, + { -INT32_C( 1352399837), INT32_C( 970088138), INT32_C( 276514783), -INT32_C( 1484298495) }, + { -INT32_C( 655881661), INT32_C( 801449530), INT32_C( 2062591037), INT32_C( 1775446598) } }, + { INT32_C( 1099095206), -INT32_C( 314691436), -INT32_C( 1059121163), INT32_C( 1480237373), -INT32_C( 1352399837), INT32_C( 970088138), INT32_C( 276514783), -INT32_C( 1484298495), + -INT32_C( 655881661), INT32_C( 801449530), INT32_C( 2062591037), INT32_C( 1775446598) } }, + { + { { -INT32_C( 115787986), INT32_C( 1966271382), INT32_C( 864398642), INT32_C( 1490684949) }, + { INT32_C( 1345372694), INT32_C( 629208808), -INT32_C( 526356326), -INT32_C( 917867622) }, + { INT32_C( 1086481322), -INT32_C( 2135559090), -INT32_C( 1229702495), INT32_C( 1561300551) } }, + { -INT32_C( 115787986), INT32_C( 1966271382), INT32_C( 864398642), INT32_C( 1490684949), INT32_C( 1345372694), INT32_C( 629208808), -INT32_C( 526356326), -INT32_C( 917867622), + INT32_C( 1086481322), -INT32_C( 2135559090), -INT32_C( 1229702495), INT32_C( 1561300551) } }, + { + { { INT32_C( 967720785), -INT32_C( 799068619), INT32_C( 951123870), INT32_C( 469891698) }, + { -INT32_C( 1419918499), INT32_C( 1496060599), -INT32_C( 1810898867), -INT32_C( 1074717074) }, + { -INT32_C( 1812357282), INT32_C( 1801672909), -INT32_C( 911993769), INT32_C( 1826989326) } }, + { INT32_C( 967720785), -INT32_C( 799068619), INT32_C( 951123870), INT32_C( 469891698), -INT32_C( 1419918499), INT32_C( 1496060599), -INT32_C( 1810898867), -INT32_C( 1074717074), + -INT32_C( 1812357282), INT32_C( 1801672909), -INT32_C( 911993769), INT32_C( 1826989326) } }, + { + { { INT32_C( 538395241), -INT32_C( 1569111211), -INT32_C( 1841919709), INT32_C( 89204647) }, + { -INT32_C( 1801893177), -INT32_C( 117375838), INT32_C( 532849680), -INT32_C( 1299470263) }, + { INT32_C( 1070834410), INT32_C( 165760230), INT32_C( 2107316181), INT32_C( 109243711) } }, + { INT32_C( 538395241), -INT32_C( 1569111211), -INT32_C( 1841919709), INT32_C( 89204647), -INT32_C( 1801893177), -INT32_C( 117375838), INT32_C( 532849680), -INT32_C( 1299470263), + INT32_C( 1070834410), INT32_C( 165760230), INT32_C( 2107316181), INT32_C( 109243711) } }, + { + { { -INT32_C( 627434697), INT32_C( 684956184), -INT32_C( 2008574402), INT32_C( 674943550) }, + { INT32_C( 1533545845), INT32_C( 795101530), -INT32_C( 1599340447), INT32_C( 614871021) }, + { INT32_C( 1660829770), INT32_C( 428593883), -INT32_C( 1499344280), INT32_C( 449764517) } }, + { -INT32_C( 627434697), INT32_C( 684956184), -INT32_C( 2008574402), INT32_C( 674943550), INT32_C( 1533545845), INT32_C( 795101530), -INT32_C( 1599340447), INT32_C( 614871021), + INT32_C( 1660829770), INT32_C( 428593883), -INT32_C( 1499344280), INT32_C( 449764517) } }, + { + { { INT32_C( 1131755241), -INT32_C( 512501376), -INT32_C( 964616231), -INT32_C( 1712642226) }, + { INT32_C( 1123805543), INT32_C( 593266363), -INT32_C( 20316839), -INT32_C( 1021798183) }, + { INT32_C( 1309052366), INT32_C( 1076853094), -INT32_C( 418991975), INT32_C( 1065415127) } }, + { INT32_C( 1131755241), -INT32_C( 512501376), -INT32_C( 964616231), -INT32_C( 1712642226), INT32_C( 1123805543), INT32_C( 593266363), -INT32_C( 20316839), -INT32_C( 1021798183), + INT32_C( 1309052366), INT32_C( 1076853094), -INT32_C( 418991975), INT32_C( 1065415127) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_int32x4x3_t r_ = { { simde_vld1q_s32(test_vec[i].r[0]), + simde_vld1q_s32(test_vec[i].r[1]), + simde_vld1q_s32(test_vec[i].r[2]) } }; + + SIMDE_ALIGN_TO_16 int32_t a_[12]; + simde_vst1q_s32_x3(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_int32x4_t a = simde_test_arm_neon_random_i32x4(); + simde_int32x4_t b = simde_test_arm_neon_random_i32x4(); + simde_int32x4_t c = simde_test_arm_neon_random_i32x4(); + simde_int32x4x3_t d = {{a, b, c}}; + + simde_test_arm_neon_write_i32x4x3(2, d, SIMDE_TEST_VEC_POS_FIRST); + + int32_t buf[12]; + simde_vst1q_s32_x3(buf, d); + + simde_test_codegen_write_vi32(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1q_s64_x3 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + int64_t r[3][2]; + int64_t a[6]; + } test_vec[] = { + { + { { INT64_C( 6609838406304365787), -INT64_C( 1551647182802025509) }, + { -INT64_C( 8023891749326258434), INT64_C( 8660413965684747032) }, + { INT64_C( 7625377633300033652), -INT64_C( 7182795427406861236) } }, + { INT64_C( 6609838406304365787), -INT64_C( 1551647182802025509), -INT64_C( 8023891749326258434), INT64_C( 8660413965684747032), + INT64_C( 7625377633300033652), -INT64_C( 7182795427406861236) } }, + { + { { INT64_C( 764388120249600531), -INT64_C( 9194616457999543471) }, + { -INT64_C( 8515804154789661222), -INT64_C( 7624802511224705291) }, + { INT64_C( 2866889530816934092), -INT64_C( 4045783956378434737) } }, + { INT64_C( 764388120249600531), -INT64_C( 9194616457999543471), -INT64_C( 8515804154789661222), -INT64_C( 7624802511224705291), + INT64_C( 2866889530816934092), -INT64_C( 4045783956378434737) } }, + { + { { -INT64_C( 8018658470021574159), -INT64_C( 5185803795436426770) }, + { INT64_C( 3783095040767142274), INT64_C( 339855826956031491) }, + { -INT64_C( 3069506719337683397), INT64_C( 6861603315756010133) } }, + { -INT64_C( 8018658470021574159), -INT64_C( 5185803795436426770), INT64_C( 3783095040767142274), INT64_C( 339855826956031491), + -INT64_C( 3069506719337683397), INT64_C( 6861603315756010133) } }, + { + { { -INT64_C( 859281596229373703), INT64_C( 5108379452176638669) }, + { -INT64_C( 7548451879049750654), -INT64_C( 3654580023213914867) }, + { INT64_C( 425518936842043394), -INT64_C( 1534661601957393567) } }, + { -INT64_C( 859281596229373703), INT64_C( 5108379452176638669), -INT64_C( 7548451879049750654), -INT64_C( 3654580023213914867), + INT64_C( 425518936842043394), -INT64_C( 1534661601957393567) } }, + { + { { INT64_C( 6879971165932343264), -INT64_C( 1749488042864176618) }, + { -INT64_C( 8876945456046119791), INT64_C( 6691965853399823244) }, + { -INT64_C( 2871686040706469517), -INT64_C( 7992065252285845941) } }, + { INT64_C( 6879971165932343264), -INT64_C( 1749488042864176618), -INT64_C( 8876945456046119791), INT64_C( 6691965853399823244), + -INT64_C( 2871686040706469517), -INT64_C( 7992065252285845941) } }, + { + { { INT64_C( 4505051742951108830), -INT64_C( 8308279186545281317) }, + { -INT64_C( 730858942433660607), -INT64_C( 687578390011273755) }, + { -INT64_C( 3306910997839032533), -INT64_C( 7018336252069327373) } }, + { INT64_C( 4505051742951108830), -INT64_C( 8308279186545281317), -INT64_C( 730858942433660607), -INT64_C( 687578390011273755), + -INT64_C( 3306910997839032533), -INT64_C( 7018336252069327373) } }, + { + { { INT64_C( 5146906711526861774), -INT64_C( 565023854864592615) }, + { -INT64_C( 7981521355724742543), INT64_C( 1096687264171189309) }, + { INT64_C( 7984306362547427619), INT64_C( 813683247830595973) } }, + { INT64_C( 5146906711526861774), -INT64_C( 565023854864592615), -INT64_C( 7981521355724742543), INT64_C( 1096687264171189309), + INT64_C( 7984306362547427619), INT64_C( 813683247830595973) } }, + { + { { INT64_C( 5482762077568507880), INT64_C( 1108763933648794643) }, + { INT64_C( 7258221356856437495), INT64_C( 720576090530536026) }, + { INT64_C( 3997690289280021535), INT64_C( 8455208676079919195) } }, + { INT64_C( 5482762077568507880), INT64_C( 1108763933648794643), INT64_C( 7258221356856437495), INT64_C( 720576090530536026), + INT64_C( 3997690289280021535), INT64_C( 8455208676079919195) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_int64x2x3_t r_ = { { simde_vld1q_s64(test_vec[i].r[0]), + simde_vld1q_s64(test_vec[i].r[1]), + simde_vld1q_s64(test_vec[i].r[2]) } }; + + SIMDE_ALIGN_TO_16 int64_t a_[6]; + simde_vst1q_s64_x3(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_int64x2_t a = simde_test_arm_neon_random_i64x2(); + simde_int64x2_t b = simde_test_arm_neon_random_i64x2(); + simde_int64x2_t c = simde_test_arm_neon_random_i64x2(); + simde_int64x2x3_t d = {{a, b, c}}; + + simde_test_arm_neon_write_i64x2x3(2, d, SIMDE_TEST_VEC_POS_FIRST); + + int64_t buf[6]; + simde_vst1q_s64_x3(buf, d); + + simde_test_codegen_write_vi64(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1q_u8_x3 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + uint8_t r[3][16]; + uint8_t a[48]; + } test_vec[] = { + { + { { UINT8_C(217), UINT8_C(234), UINT8_C(193), UINT8_C(184), UINT8_C( 76), UINT8_C(123), UINT8_C( 28), UINT8_C(166), + UINT8_C(214), UINT8_C(210), UINT8_C(155), UINT8_C(248), UINT8_C(210), UINT8_C(156), UINT8_C( 3), UINT8_C(241) }, + { UINT8_C( 16), UINT8_C(147), UINT8_C( 31), UINT8_C( 52), UINT8_C( 57), UINT8_C(153), UINT8_C(107), UINT8_C(148), + UINT8_C(249), UINT8_C(246), UINT8_C(219), UINT8_C(119), UINT8_C(229), UINT8_C( 49), UINT8_C(236), UINT8_C(191) }, + { UINT8_C( 28), UINT8_C(173), UINT8_C(119), UINT8_C(104), UINT8_C( 40), UINT8_C(147), UINT8_C( 14), UINT8_C(254), + UINT8_C(101), UINT8_C(170), UINT8_C(247), UINT8_C( 55), UINT8_C( 70), UINT8_C(250), UINT8_C( 40), UINT8_C( 86) } }, + { UINT8_C(217), UINT8_C(234), UINT8_C(193), UINT8_C(184), UINT8_C( 76), UINT8_C(123), UINT8_C( 28), UINT8_C(166), + UINT8_C(214), UINT8_C(210), UINT8_C(155), UINT8_C(248), UINT8_C(210), UINT8_C(156), UINT8_C( 3), UINT8_C(241), + UINT8_C( 16), UINT8_C(147), UINT8_C( 31), UINT8_C( 52), UINT8_C( 57), UINT8_C(153), UINT8_C(107), UINT8_C(148), + UINT8_C(249), UINT8_C(246), UINT8_C(219), UINT8_C(119), UINT8_C(229), UINT8_C( 49), UINT8_C(236), UINT8_C(191), + UINT8_C( 28), UINT8_C(173), UINT8_C(119), UINT8_C(104), UINT8_C( 40), UINT8_C(147), UINT8_C( 14), UINT8_C(254), + UINT8_C(101), UINT8_C(170), UINT8_C(247), UINT8_C( 55), UINT8_C( 70), UINT8_C(250), UINT8_C( 40), UINT8_C( 86) } }, + { + { { UINT8_C(141), UINT8_C( 71), UINT8_C(138), UINT8_C(198), UINT8_C(224), UINT8_C(245), UINT8_C( 91), UINT8_C(217), + UINT8_C(236), UINT8_C( 54), UINT8_C( 80), UINT8_C(209), UINT8_C(104), UINT8_C( 60), UINT8_C(144), UINT8_C(132) }, + { UINT8_C(233), UINT8_C( 7), UINT8_C(236), UINT8_C( 17), UINT8_C(154), UINT8_C(250), UINT8_C( 16), UINT8_MAX, + UINT8_C(164), UINT8_C( 7), UINT8_C( 54), UINT8_C(234), UINT8_C( 1), UINT8_C( 94), UINT8_C( 65), UINT8_C(142) }, + { UINT8_C(165), UINT8_C(203), UINT8_C( 84), UINT8_C(133), UINT8_C(193), UINT8_C(175), UINT8_C( 94), UINT8_C(173), + UINT8_C(230), UINT8_C(174), UINT8_C(126), UINT8_C( 78), UINT8_C(234), UINT8_C( 15), UINT8_C(210), UINT8_C(211) } }, + { UINT8_C(141), UINT8_C( 71), UINT8_C(138), UINT8_C(198), UINT8_C(224), UINT8_C(245), UINT8_C( 91), UINT8_C(217), + UINT8_C(236), UINT8_C( 54), UINT8_C( 80), UINT8_C(209), UINT8_C(104), UINT8_C( 60), UINT8_C(144), UINT8_C(132), + UINT8_C(233), UINT8_C( 7), UINT8_C(236), UINT8_C( 17), UINT8_C(154), UINT8_C(250), UINT8_C( 16), UINT8_MAX, + UINT8_C(164), UINT8_C( 7), UINT8_C( 54), UINT8_C(234), UINT8_C( 1), UINT8_C( 94), UINT8_C( 65), UINT8_C(142), + UINT8_C(165), UINT8_C(203), UINT8_C( 84), UINT8_C(133), UINT8_C(193), UINT8_C(175), UINT8_C( 94), UINT8_C(173), + UINT8_C(230), UINT8_C(174), UINT8_C(126), UINT8_C( 78), UINT8_C(234), UINT8_C( 15), UINT8_C(210), UINT8_C(211) } }, + { + { { UINT8_C( 22), UINT8_C(190), UINT8_C(229), UINT8_C(177), UINT8_C(184), UINT8_C(245), UINT8_C(176), UINT8_C( 93), + UINT8_C(252), UINT8_C(231), UINT8_C( 71), UINT8_C(253), UINT8_C( 69), UINT8_C(136), UINT8_C(139), UINT8_C(235) }, + { UINT8_C( 84), UINT8_C(223), UINT8_C(112), UINT8_C( 21), UINT8_C(143), UINT8_C(207), UINT8_C(194), UINT8_C(117), + UINT8_C(125), UINT8_C( 64), UINT8_C(195), UINT8_C(104), UINT8_C( 79), UINT8_C(149), UINT8_C( 59), UINT8_C(102) }, + { UINT8_C( 83), UINT8_C( 32), UINT8_C( 23), UINT8_C( 11), UINT8_C( 21), UINT8_C(199), UINT8_C(104), UINT8_C( 17), + UINT8_C(174), UINT8_C(176), UINT8_C( 14), UINT8_C(244), UINT8_C( 56), UINT8_C(153), UINT8_C(223), UINT8_C(140) } }, + { UINT8_C( 22), UINT8_C(190), UINT8_C(229), UINT8_C(177), UINT8_C(184), UINT8_C(245), UINT8_C(176), UINT8_C( 93), + UINT8_C(252), UINT8_C(231), UINT8_C( 71), UINT8_C(253), UINT8_C( 69), UINT8_C(136), UINT8_C(139), UINT8_C(235), + UINT8_C( 84), UINT8_C(223), UINT8_C(112), UINT8_C( 21), UINT8_C(143), UINT8_C(207), UINT8_C(194), UINT8_C(117), + UINT8_C(125), UINT8_C( 64), UINT8_C(195), UINT8_C(104), UINT8_C( 79), UINT8_C(149), UINT8_C( 59), UINT8_C(102), + UINT8_C( 83), UINT8_C( 32), UINT8_C( 23), UINT8_C( 11), UINT8_C( 21), UINT8_C(199), UINT8_C(104), UINT8_C( 17), + UINT8_C(174), UINT8_C(176), UINT8_C( 14), UINT8_C(244), UINT8_C( 56), UINT8_C(153), UINT8_C(223), UINT8_C(140) } }, + { + { { UINT8_C(121), UINT8_C( 79), UINT8_C(161), UINT8_C( 8), UINT8_C( 30), UINT8_C( 99), UINT8_C(125), UINT8_C(156), + UINT8_C(164), UINT8_C( 64), UINT8_C( 4), UINT8_C(243), UINT8_C(213), UINT8_C( 63), UINT8_C( 89), UINT8_C( 40) }, + { UINT8_C( 96), UINT8_C(112), UINT8_C( 51), UINT8_C(117), UINT8_C( 56), UINT8_C(156), UINT8_C(135), UINT8_C(230), + UINT8_C( 76), UINT8_C(149), UINT8_C(218), UINT8_C(132), UINT8_C( 47), UINT8_C(185), UINT8_C( 17), UINT8_C(168) }, + { UINT8_C( 9), UINT8_C(178), UINT8_C(176), UINT8_C( 39), UINT8_C( 22), UINT8_C( 45), UINT8_C(195), UINT8_C(186), + UINT8_C(109), UINT8_C(199), UINT8_C(173), UINT8_C( 66), UINT8_C( 7), UINT8_C( 7), UINT8_C(106), UINT8_C(103) } }, + { UINT8_C(121), UINT8_C( 79), UINT8_C(161), UINT8_C( 8), UINT8_C( 30), UINT8_C( 99), UINT8_C(125), UINT8_C(156), + UINT8_C(164), UINT8_C( 64), UINT8_C( 4), UINT8_C(243), UINT8_C(213), UINT8_C( 63), UINT8_C( 89), UINT8_C( 40), + UINT8_C( 96), UINT8_C(112), UINT8_C( 51), UINT8_C(117), UINT8_C( 56), UINT8_C(156), UINT8_C(135), UINT8_C(230), + UINT8_C( 76), UINT8_C(149), UINT8_C(218), UINT8_C(132), UINT8_C( 47), UINT8_C(185), UINT8_C( 17), UINT8_C(168), + UINT8_C( 9), UINT8_C(178), UINT8_C(176), UINT8_C( 39), UINT8_C( 22), UINT8_C( 45), UINT8_C(195), UINT8_C(186), + UINT8_C(109), UINT8_C(199), UINT8_C(173), UINT8_C( 66), UINT8_C( 7), UINT8_C( 7), UINT8_C(106), UINT8_C(103) } }, + { + { { UINT8_C(119), UINT8_C(157), UINT8_C(220), UINT8_C(175), UINT8_C( 57), UINT8_C( 99), UINT8_C(150), UINT8_C(133), + UINT8_C(249), UINT8_C(112), UINT8_C( 10), UINT8_C( 40), UINT8_C( 42), UINT8_C( 27), UINT8_C(208), UINT8_C( 51) }, + { UINT8_C(205), UINT8_C(128), UINT8_C( 90), UINT8_C(227), UINT8_C(173), UINT8_C( 30), UINT8_C(157), UINT8_C( 26), + UINT8_C(229), UINT8_C( 75), UINT8_C( 92), UINT8_C(236), UINT8_C( 82), UINT8_C(198), UINT8_C( 83), UINT8_C(201) }, + { UINT8_C( 99), UINT8_C( 48), UINT8_C(121), UINT8_C(157), UINT8_C(147), UINT8_C( 15), UINT8_C( 34), UINT8_C(140), + UINT8_C(127), UINT8_C( 44), UINT8_C(180), UINT8_C(169), UINT8_C( 71), UINT8_C(132), UINT8_C(220), UINT8_C( 21) } }, + { UINT8_C(119), UINT8_C(157), UINT8_C(220), UINT8_C(175), UINT8_C( 57), UINT8_C( 99), UINT8_C(150), UINT8_C(133), + UINT8_C(249), UINT8_C(112), UINT8_C( 10), UINT8_C( 40), UINT8_C( 42), UINT8_C( 27), UINT8_C(208), UINT8_C( 51), + UINT8_C(205), UINT8_C(128), UINT8_C( 90), UINT8_C(227), UINT8_C(173), UINT8_C( 30), UINT8_C(157), UINT8_C( 26), + UINT8_C(229), UINT8_C( 75), UINT8_C( 92), UINT8_C(236), UINT8_C( 82), UINT8_C(198), UINT8_C( 83), UINT8_C(201), + UINT8_C( 99), UINT8_C( 48), UINT8_C(121), UINT8_C(157), UINT8_C(147), UINT8_C( 15), UINT8_C( 34), UINT8_C(140), + UINT8_C(127), UINT8_C( 44), UINT8_C(180), UINT8_C(169), UINT8_C( 71), UINT8_C(132), UINT8_C(220), UINT8_C( 21) } }, + { + { { UINT8_C( 4), UINT8_C( 55), UINT8_C(248), UINT8_C(177), UINT8_C( 85), UINT8_C(150), UINT8_C(203), UINT8_C( 58), + UINT8_C(225), UINT8_C( 39), UINT8_C( 39), UINT8_C( 51), UINT8_C(237), UINT8_C(122), UINT8_C(252), UINT8_C( 81) }, + { UINT8_C(170), UINT8_C(117), UINT8_C(238), UINT8_C( 62), UINT8_C(132), UINT8_C( 16), UINT8_C(202), UINT8_C( 4), + UINT8_C( 61), UINT8_C(127), UINT8_C(173), UINT8_C(132), UINT8_C( 3), UINT8_C(138), UINT8_C(153), UINT8_C( 8) }, + { UINT8_C(193), UINT8_C(146), UINT8_C(185), UINT8_C( 22), UINT8_C( 40), UINT8_C(133), UINT8_C( 80), UINT8_C( 9), + UINT8_C(172), UINT8_C(119), UINT8_C( 60), UINT8_C(154), UINT8_C(242), UINT8_C( 56), UINT8_C(235), UINT8_C(156) } }, + { UINT8_C( 4), UINT8_C( 55), UINT8_C(248), UINT8_C(177), UINT8_C( 85), UINT8_C(150), UINT8_C(203), UINT8_C( 58), + UINT8_C(225), UINT8_C( 39), UINT8_C( 39), UINT8_C( 51), UINT8_C(237), UINT8_C(122), UINT8_C(252), UINT8_C( 81), + UINT8_C(170), UINT8_C(117), UINT8_C(238), UINT8_C( 62), UINT8_C(132), UINT8_C( 16), UINT8_C(202), UINT8_C( 4), + UINT8_C( 61), UINT8_C(127), UINT8_C(173), UINT8_C(132), UINT8_C( 3), UINT8_C(138), UINT8_C(153), UINT8_C( 8), + UINT8_C(193), UINT8_C(146), UINT8_C(185), UINT8_C( 22), UINT8_C( 40), UINT8_C(133), UINT8_C( 80), UINT8_C( 9), + UINT8_C(172), UINT8_C(119), UINT8_C( 60), UINT8_C(154), UINT8_C(242), UINT8_C( 56), UINT8_C(235), UINT8_C(156) } }, + { + { { UINT8_C(174), UINT8_C(217), UINT8_C(218), UINT8_C( 50), UINT8_C(233), UINT8_C(165), UINT8_C( 54), UINT8_C( 38), + UINT8_C( 36), UINT8_C(228), UINT8_C(171), UINT8_C( 39), UINT8_C(110), UINT8_C( 68), UINT8_C( 47), UINT8_C( 47) }, + { UINT8_C(214), UINT8_C(233), UINT8_C( 69), UINT8_C(254), UINT8_C(110), UINT8_C(149), UINT8_C( 7), UINT8_C( 26), + UINT8_C( 13), UINT8_C( 67), UINT8_C(180), UINT8_MAX, UINT8_C(124), UINT8_C(159), UINT8_C(155), UINT8_C( 42) }, + { UINT8_C(120), UINT8_C(118), UINT8_C( 92), UINT8_C( 98), UINT8_C( 27), UINT8_C(147), UINT8_C(136), UINT8_C( 63), + UINT8_C(119), UINT8_C( 51), UINT8_C(102), UINT8_C(229), UINT8_C(120), UINT8_C(150), UINT8_C( 20), UINT8_C( 78) } }, + { UINT8_C(174), UINT8_C(217), UINT8_C(218), UINT8_C( 50), UINT8_C(233), UINT8_C(165), UINT8_C( 54), UINT8_C( 38), + UINT8_C( 36), UINT8_C(228), UINT8_C(171), UINT8_C( 39), UINT8_C(110), UINT8_C( 68), UINT8_C( 47), UINT8_C( 47), + UINT8_C(214), UINT8_C(233), UINT8_C( 69), UINT8_C(254), UINT8_C(110), UINT8_C(149), UINT8_C( 7), UINT8_C( 26), + UINT8_C( 13), UINT8_C( 67), UINT8_C(180), UINT8_MAX, UINT8_C(124), UINT8_C(159), UINT8_C(155), UINT8_C( 42), + UINT8_C(120), UINT8_C(118), UINT8_C( 92), UINT8_C( 98), UINT8_C( 27), UINT8_C(147), UINT8_C(136), UINT8_C( 63), + UINT8_C(119), UINT8_C( 51), UINT8_C(102), UINT8_C(229), UINT8_C(120), UINT8_C(150), UINT8_C( 20), UINT8_C( 78) } }, + { + { { UINT8_C(127), UINT8_C( 89), UINT8_C( 77), UINT8_C(237), UINT8_C(238), UINT8_C( 84), UINT8_C( 7), UINT8_C(251), + UINT8_C(152), UINT8_C(188), UINT8_C(250), UINT8_C( 20), UINT8_C( 91), UINT8_C(150), UINT8_C( 62), UINT8_C(212) }, + { UINT8_C( 12), UINT8_C(154), UINT8_C( 54), UINT8_C( 39), UINT8_C( 45), UINT8_C(190), UINT8_C(102), UINT8_C(164), + UINT8_C(242), UINT8_C(204), UINT8_C(137), UINT8_C(106), UINT8_C( 98), UINT8_C(157), UINT8_C(184), UINT8_C(225) }, + { UINT8_C(246), UINT8_C( 5), UINT8_C(206), UINT8_C(229), UINT8_C( 90), UINT8_C(214), UINT8_C(224), UINT8_C(242), + UINT8_C(146), UINT8_C(219), UINT8_C( 6), UINT8_C(237), UINT8_C(113), UINT8_C( 68), UINT8_C(193), UINT8_C(125) } }, + { UINT8_C(127), UINT8_C( 89), UINT8_C( 77), UINT8_C(237), UINT8_C(238), UINT8_C( 84), UINT8_C( 7), UINT8_C(251), + UINT8_C(152), UINT8_C(188), UINT8_C(250), UINT8_C( 20), UINT8_C( 91), UINT8_C(150), UINT8_C( 62), UINT8_C(212), + UINT8_C( 12), UINT8_C(154), UINT8_C( 54), UINT8_C( 39), UINT8_C( 45), UINT8_C(190), UINT8_C(102), UINT8_C(164), + UINT8_C(242), UINT8_C(204), UINT8_C(137), UINT8_C(106), UINT8_C( 98), UINT8_C(157), UINT8_C(184), UINT8_C(225), + UINT8_C(246), UINT8_C( 5), UINT8_C(206), UINT8_C(229), UINT8_C( 90), UINT8_C(214), UINT8_C(224), UINT8_C(242), + UINT8_C(146), UINT8_C(219), UINT8_C( 6), UINT8_C(237), UINT8_C(113), UINT8_C( 68), UINT8_C(193), UINT8_C(125) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_uint8x16x3_t r_ = { { simde_vld1q_u8(test_vec[i].r[0]), + simde_vld1q_u8(test_vec[i].r[1]), + simde_vld1q_u8(test_vec[i].r[2]) } }; + + SIMDE_ALIGN_TO_16 uint8_t a_[48]; + simde_vst1q_u8_x3(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_uint8x16_t a = simde_test_arm_neon_random_u8x16(); + simde_uint8x16_t b = simde_test_arm_neon_random_u8x16(); + simde_uint8x16_t c = simde_test_arm_neon_random_u8x16(); + simde_uint8x16x3_t d = {{a, b, c}}; + + simde_test_arm_neon_write_u8x16x3(2, d, SIMDE_TEST_VEC_POS_FIRST); + + uint8_t buf[48]; + simde_vst1q_u8_x3(buf, d); + + simde_test_codegen_write_vu8(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1q_u16_x3 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + uint16_t r[3][8]; + uint16_t a[24]; + } test_vec[] = { + { + { { UINT16_C(63454), UINT16_C( 3236), UINT16_C( 2742), UINT16_C(43184), UINT16_C(15062), UINT16_C(14610), UINT16_C(51927), UINT16_C(52762) }, + { UINT16_C(59856), UINT16_C(10931), UINT16_C(37823), UINT16_C(20764), UINT16_C( 8814), UINT16_C(57150), UINT16_C( 102), UINT16_C(17500) }, + { UINT16_C( 247), UINT16_C(44368), UINT16_C( 266), UINT16_C(57685), UINT16_C(26427), UINT16_C( 4634), UINT16_C(13362), UINT16_C( 736) } }, + { UINT16_C(63454), UINT16_C( 3236), UINT16_C( 2742), UINT16_C(43184), UINT16_C(15062), UINT16_C(14610), UINT16_C(51927), UINT16_C(52762), + UINT16_C(59856), UINT16_C(10931), UINT16_C(37823), UINT16_C(20764), UINT16_C( 8814), UINT16_C(57150), UINT16_C( 102), UINT16_C(17500), + UINT16_C( 247), UINT16_C(44368), UINT16_C( 266), UINT16_C(57685), UINT16_C(26427), UINT16_C( 4634), UINT16_C(13362), UINT16_C( 736) } }, + { + { { UINT16_C(37661), UINT16_C(56364), UINT16_C(18471), UINT16_C(38189), UINT16_C(27754), UINT16_C(53365), UINT16_C(53612), UINT16_C(25364) }, + { UINT16_C(26066), UINT16_C(56337), UINT16_C(26214), UINT16_C(41405), UINT16_C(55246), UINT16_C( 179), UINT16_C(37900), UINT16_C(10498) }, + { UINT16_C(11815), UINT16_C(19974), UINT16_C(13174), UINT16_C(57572), UINT16_C(22943), UINT16_C( 2992), UINT16_C(50218), UINT16_C(64623) } }, + { UINT16_C(37661), UINT16_C(56364), UINT16_C(18471), UINT16_C(38189), UINT16_C(27754), UINT16_C(53365), UINT16_C(53612), UINT16_C(25364), + UINT16_C(26066), UINT16_C(56337), UINT16_C(26214), UINT16_C(41405), UINT16_C(55246), UINT16_C( 179), UINT16_C(37900), UINT16_C(10498), + UINT16_C(11815), UINT16_C(19974), UINT16_C(13174), UINT16_C(57572), UINT16_C(22943), UINT16_C( 2992), UINT16_C(50218), UINT16_C(64623) } }, + { + { { UINT16_C(32809), UINT16_C(36825), UINT16_C(38630), UINT16_C(46128), UINT16_C(58478), UINT16_C(31412), UINT16_C(46712), UINT16_C(40867) }, + { UINT16_C(43492), UINT16_C(23278), UINT16_C(53981), UINT16_C(31802), UINT16_C(59947), UINT16_C(21896), UINT16_C(63407), UINT16_C(55378) }, + { UINT16_C(11127), UINT16_C(23912), UINT16_C(39105), UINT16_C(12050), UINT16_C(50812), UINT16_C(62633), UINT16_C(19837), UINT16_C(24980) } }, + { UINT16_C(32809), UINT16_C(36825), UINT16_C(38630), UINT16_C(46128), UINT16_C(58478), UINT16_C(31412), UINT16_C(46712), UINT16_C(40867), + UINT16_C(43492), UINT16_C(23278), UINT16_C(53981), UINT16_C(31802), UINT16_C(59947), UINT16_C(21896), UINT16_C(63407), UINT16_C(55378), + UINT16_C(11127), UINT16_C(23912), UINT16_C(39105), UINT16_C(12050), UINT16_C(50812), UINT16_C(62633), UINT16_C(19837), UINT16_C(24980) } }, + { + { { UINT16_C(33526), UINT16_C(54204), UINT16_C(63060), UINT16_C(32592), UINT16_C(55521), UINT16_C(37076), UINT16_C( 9935), UINT16_C(18024) }, + { UINT16_C(53329), UINT16_C( 5027), UINT16_C(46441), UINT16_C(58690), UINT16_C(60540), UINT16_C(63962), UINT16_C(28217), UINT16_C(12122) }, + { UINT16_C( 5872), UINT16_C(17411), UINT16_C(21261), UINT16_C(61123), UINT16_C(38699), UINT16_C(64126), UINT16_C(59070), UINT16_C( 3904) } }, + { UINT16_C(33526), UINT16_C(54204), UINT16_C(63060), UINT16_C(32592), UINT16_C(55521), UINT16_C(37076), UINT16_C( 9935), UINT16_C(18024), + UINT16_C(53329), UINT16_C( 5027), UINT16_C(46441), UINT16_C(58690), UINT16_C(60540), UINT16_C(63962), UINT16_C(28217), UINT16_C(12122), + UINT16_C( 5872), UINT16_C(17411), UINT16_C(21261), UINT16_C(61123), UINT16_C(38699), UINT16_C(64126), UINT16_C(59070), UINT16_C( 3904) } }, + { + { { UINT16_C(58295), UINT16_C( 8226), UINT16_C(26009), UINT16_C( 5381), UINT16_C(57169), UINT16_C(35342), UINT16_C(26701), UINT16_C(15801) }, + { UINT16_C(48255), UINT16_C(35969), UINT16_C(17423), UINT16_C(14970), UINT16_C(63708), UINT16_C(39476), UINT16_C(29918), UINT16_C(38313) }, + { UINT16_C(52312), UINT16_C(61877), UINT16_C(47921), UINT16_C(33286), UINT16_C( 5274), UINT16_C(59404), UINT16_C(50556), UINT16_C(64293) } }, + { UINT16_C(58295), UINT16_C( 8226), UINT16_C(26009), UINT16_C( 5381), UINT16_C(57169), UINT16_C(35342), UINT16_C(26701), UINT16_C(15801), + UINT16_C(48255), UINT16_C(35969), UINT16_C(17423), UINT16_C(14970), UINT16_C(63708), UINT16_C(39476), UINT16_C(29918), UINT16_C(38313), + UINT16_C(52312), UINT16_C(61877), UINT16_C(47921), UINT16_C(33286), UINT16_C( 5274), UINT16_C(59404), UINT16_C(50556), UINT16_C(64293) } }, + { + { { UINT16_C(42882), UINT16_C(37255), UINT16_C( 491), UINT16_C(51148), UINT16_C( 249), UINT16_C(55393), UINT16_C( 2933), UINT16_C(52589) }, + { UINT16_C( 9175), UINT16_C( 2238), UINT16_C(50398), UINT16_C(30858), UINT16_C(38616), UINT16_C(21600), UINT16_C(34395), UINT16_C(56656) }, + { UINT16_C(55085), UINT16_C( 6255), UINT16_C(15321), UINT16_C(53984), UINT16_C(16699), UINT16_C(45226), UINT16_C( 6220), UINT16_C( 9085) } }, + { UINT16_C(42882), UINT16_C(37255), UINT16_C( 491), UINT16_C(51148), UINT16_C( 249), UINT16_C(55393), UINT16_C( 2933), UINT16_C(52589), + UINT16_C( 9175), UINT16_C( 2238), UINT16_C(50398), UINT16_C(30858), UINT16_C(38616), UINT16_C(21600), UINT16_C(34395), UINT16_C(56656), + UINT16_C(55085), UINT16_C( 6255), UINT16_C(15321), UINT16_C(53984), UINT16_C(16699), UINT16_C(45226), UINT16_C( 6220), UINT16_C( 9085) } }, + { + { { UINT16_C(15163), UINT16_C( 6443), UINT16_C(46591), UINT16_C(55185), UINT16_C(62027), UINT16_C(42796), UINT16_C(31864), UINT16_C(42372) }, + { UINT16_C(62291), UINT16_C(11453), UINT16_C(40238), UINT16_C(27391), UINT16_C(43487), UINT16_C(11034), UINT16_C(39105), UINT16_C(64591) }, + { UINT16_C(31443), UINT16_C(54037), UINT16_C(42800), UINT16_C(31658), UINT16_C(54937), UINT16_C( 4386), UINT16_C(42834), UINT16_C(42678) } }, + { UINT16_C(15163), UINT16_C( 6443), UINT16_C(46591), UINT16_C(55185), UINT16_C(62027), UINT16_C(42796), UINT16_C(31864), UINT16_C(42372), + UINT16_C(62291), UINT16_C(11453), UINT16_C(40238), UINT16_C(27391), UINT16_C(43487), UINT16_C(11034), UINT16_C(39105), UINT16_C(64591), + UINT16_C(31443), UINT16_C(54037), UINT16_C(42800), UINT16_C(31658), UINT16_C(54937), UINT16_C( 4386), UINT16_C(42834), UINT16_C(42678) } }, + { + { { UINT16_C(29594), UINT16_C(51666), UINT16_C(53521), UINT16_C(61491), UINT16_C(19835), UINT16_C(15387), UINT16_C(27365), UINT16_C(47417) }, + { UINT16_C(20197), UINT16_C( 5516), UINT16_C(14069), UINT16_C(36496), UINT16_C(45837), UINT16_C(24479), UINT16_C(21850), UINT16_C(62469) }, + { UINT16_C(55497), UINT16_C(55997), UINT16_C(61609), UINT16_C( 9418), UINT16_C(58686), UINT16_C( 9057), UINT16_C(39504), UINT16_C(13788) } }, + { UINT16_C(29594), UINT16_C(51666), UINT16_C(53521), UINT16_C(61491), UINT16_C(19835), UINT16_C(15387), UINT16_C(27365), UINT16_C(47417), + UINT16_C(20197), UINT16_C( 5516), UINT16_C(14069), UINT16_C(36496), UINT16_C(45837), UINT16_C(24479), UINT16_C(21850), UINT16_C(62469), + UINT16_C(55497), UINT16_C(55997), UINT16_C(61609), UINT16_C( 9418), UINT16_C(58686), UINT16_C( 9057), UINT16_C(39504), UINT16_C(13788) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_uint16x8x3_t r_ = { { simde_vld1q_u16(test_vec[i].r[0]), + simde_vld1q_u16(test_vec[i].r[1]), + simde_vld1q_u16(test_vec[i].r[2]) } }; + + SIMDE_ALIGN_TO_16 uint16_t a_[24]; + simde_vst1q_u16_x3(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_uint16x8_t a = simde_test_arm_neon_random_u16x8(); + simde_uint16x8_t b = simde_test_arm_neon_random_u16x8(); + simde_uint16x8_t c = simde_test_arm_neon_random_u16x8(); + simde_uint16x8x3_t d = {{a, b, c}}; + + simde_test_arm_neon_write_u16x8x3(2, d, SIMDE_TEST_VEC_POS_FIRST); + + uint16_t buf[24]; + simde_vst1q_u16_x3(buf, d); + + simde_test_codegen_write_vu16(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1q_u32_x3 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + uint32_t r[3][4]; + uint32_t a[12]; + } test_vec[] = { + { + { { UINT32_C(3729418472), UINT32_C(2892815007), UINT32_C(3876261005), UINT32_C( 719065441) }, + { UINT32_C(2449775081), UINT32_C(3367489162), UINT32_C( 82516148), UINT32_C(2587478194) }, + { UINT32_C(3480781616), UINT32_C(3950765405), UINT32_C(1389529073), UINT32_C(2172497560) } }, + { UINT32_C(3729418472), UINT32_C(2892815007), UINT32_C(3876261005), UINT32_C( 719065441), UINT32_C(2449775081), UINT32_C(3367489162), UINT32_C( 82516148), UINT32_C(2587478194), + UINT32_C(3480781616), UINT32_C(3950765405), UINT32_C(1389529073), UINT32_C(2172497560) } }, + { + { { UINT32_C(3524493640), UINT32_C( 77253200), UINT32_C(2483586530), UINT32_C(2117026125) }, + { UINT32_C( 558737348), UINT32_C(2097990028), UINT32_C(3906002768), UINT32_C(3580448141) }, + { UINT32_C( 514292942), UINT32_C( 690110791), UINT32_C( 348007111), UINT32_C( 798158187) } }, + { UINT32_C(3524493640), UINT32_C( 77253200), UINT32_C(2483586530), UINT32_C(2117026125), UINT32_C( 558737348), UINT32_C(2097990028), UINT32_C(3906002768), UINT32_C(3580448141), + UINT32_C( 514292942), UINT32_C( 690110791), UINT32_C( 348007111), UINT32_C( 798158187) } }, + { + { { UINT32_C( 559014036), UINT32_C(4187905449), UINT32_C(3403771452), UINT32_C(2325695163) }, + { UINT32_C( 229132230), UINT32_C(1329056648), UINT32_C(1634006517), UINT32_C(1989211874) }, + { UINT32_C(2140660182), UINT32_C(2071475775), UINT32_C(1615157668), UINT32_C(1793779107) } }, + { UINT32_C( 559014036), UINT32_C(4187905449), UINT32_C(3403771452), UINT32_C(2325695163), UINT32_C( 229132230), UINT32_C(1329056648), UINT32_C(1634006517), UINT32_C(1989211874), + UINT32_C(2140660182), UINT32_C(2071475775), UINT32_C(1615157668), UINT32_C(1793779107) } }, + { + { { UINT32_C(3027735084), UINT32_C(1392815709), UINT32_C(2243192995), UINT32_C( 905725022) }, + { UINT32_C(1706332966), UINT32_C(1860185545), UINT32_C( 718153350), UINT32_C( 932493323) }, + { UINT32_C(2833976138), UINT32_C(1576791994), UINT32_C(3068374871), UINT32_C( 434888691) } }, + { UINT32_C(3027735084), UINT32_C(1392815709), UINT32_C(2243192995), UINT32_C( 905725022), UINT32_C(1706332966), UINT32_C(1860185545), UINT32_C( 718153350), UINT32_C( 932493323), + UINT32_C(2833976138), UINT32_C(1576791994), UINT32_C(3068374871), UINT32_C( 434888691) } }, + { + { { UINT32_C(1014931314), UINT32_C(1403674572), UINT32_C(2424141957), UINT32_C(2059866416) }, + { UINT32_C(3592598044), UINT32_C(4180942242), UINT32_C(3232700364), UINT32_C(1759091446) }, + { UINT32_C( 111433786), UINT32_C(1012485815), UINT32_C(4140619462), UINT32_C( 74552295) } }, + { UINT32_C(1014931314), UINT32_C(1403674572), UINT32_C(2424141957), UINT32_C(2059866416), UINT32_C(3592598044), UINT32_C(4180942242), UINT32_C(3232700364), UINT32_C(1759091446), + UINT32_C( 111433786), UINT32_C(1012485815), UINT32_C(4140619462), UINT32_C( 74552295) } }, + { + { { UINT32_C(3889861445), UINT32_C(2111901361), UINT32_C( 457019429), UINT32_C(1703155499) }, + { UINT32_C( 644556911), UINT32_C(1029883255), UINT32_C(2201235099), UINT32_C( 109553089) }, + { UINT32_C(3924713784), UINT32_C(2506608496), UINT32_C(2326897759), UINT32_C( 720319931) } }, + { UINT32_C(3889861445), UINT32_C(2111901361), UINT32_C( 457019429), UINT32_C(1703155499), UINT32_C( 644556911), UINT32_C(1029883255), UINT32_C(2201235099), UINT32_C( 109553089), + UINT32_C(3924713784), UINT32_C(2506608496), UINT32_C(2326897759), UINT32_C( 720319931) } }, + { + { { UINT32_C(3562036061), UINT32_C(3138564640), UINT32_C(2705213152), UINT32_C( 598263275) }, + { UINT32_C(2534250023), UINT32_C(3291247717), UINT32_C(3562003736), UINT32_C(1895710226) }, + { UINT32_C(3108261785), UINT32_C(3799340545), UINT32_C(2273555356), UINT32_C(2695572345) } }, + { UINT32_C(3562036061), UINT32_C(3138564640), UINT32_C(2705213152), UINT32_C( 598263275), UINT32_C(2534250023), UINT32_C(3291247717), UINT32_C(3562003736), UINT32_C(1895710226), + UINT32_C(3108261785), UINT32_C(3799340545), UINT32_C(2273555356), UINT32_C(2695572345) } }, + { + { { UINT32_C( 641185985), UINT32_C(1156277036), UINT32_C(1394096705), UINT32_C( 314775416) }, + { UINT32_C(1741359206), UINT32_C(4215881822), UINT32_C(1837288948), UINT32_C(3121425912) }, + { UINT32_C( 299910373), UINT32_C(3898002343), UINT32_C(2117889541), UINT32_C(3952148357) } }, + { UINT32_C( 641185985), UINT32_C(1156277036), UINT32_C(1394096705), UINT32_C( 314775416), UINT32_C(1741359206), UINT32_C(4215881822), UINT32_C(1837288948), UINT32_C(3121425912), + UINT32_C( 299910373), UINT32_C(3898002343), UINT32_C(2117889541), UINT32_C(3952148357) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_uint32x4x3_t r_ = { { simde_vld1q_u32(test_vec[i].r[0]), + simde_vld1q_u32(test_vec[i].r[1]), + simde_vld1q_u32(test_vec[i].r[2]) } }; + + SIMDE_ALIGN_TO_16 uint32_t a_[12]; + simde_vst1q_u32_x3(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_uint32x4_t a = simde_test_arm_neon_random_u32x4(); + simde_uint32x4_t b = simde_test_arm_neon_random_u32x4(); + simde_uint32x4_t c = simde_test_arm_neon_random_u32x4(); + simde_uint32x4x3_t d = {{a, b, c}}; + + simde_test_arm_neon_write_u32x4x3(2, d, SIMDE_TEST_VEC_POS_FIRST); + + uint32_t buf[12]; + simde_vst1q_u32_x3(buf, d); + + simde_test_codegen_write_vu32(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1q_u64_x3 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + uint64_t r[3][2]; + uint64_t a[6]; + } test_vec[] = { + { + { { UINT64_C(10403768809748126471), UINT64_C(17734060502469698409) }, + { UINT64_C(14834398439802469454), UINT64_C( 2395311478632291020) }, + { UINT64_C(10836760411903594551), UINT64_C(13318010972271042763) } }, + { UINT64_C(10403768809748126471), UINT64_C(17734060502469698409), UINT64_C(14834398439802469454), UINT64_C( 2395311478632291020), + UINT64_C(10836760411903594551), UINT64_C(13318010972271042763) } }, + { + { { UINT64_C( 407165896905054993), UINT64_C( 351445481845944997) }, + { UINT64_C( 1939145226926384933), UINT64_C( 557543611881218458) }, + { UINT64_C(11232970286156507813), UINT64_C(17675004353776860024) } }, + { UINT64_C( 407165896905054993), UINT64_C( 351445481845944997), UINT64_C( 1939145226926384933), UINT64_C( 557543611881218458), + UINT64_C(11232970286156507813), UINT64_C(17675004353776860024) } }, + { + { { UINT64_C(17801094752373318305), UINT64_C( 8074875839067128082) }, + { UINT64_C(17199865409659924258), UINT64_C(16659517911248145517) }, + { UINT64_C(13759871989849750177), UINT64_C(14564595739931373795) } }, + { UINT64_C(17801094752373318305), UINT64_C( 8074875839067128082), UINT64_C(17199865409659924258), UINT64_C(16659517911248145517), + UINT64_C(13759871989849750177), UINT64_C(14564595739931373795) } }, + { + { { UINT64_C( 948734087435218629), UINT64_C( 9137377986491342496) }, + { UINT64_C( 7737307891966453495), UINT64_C(14038347846904325984) }, + { UINT64_C(16741331480747095208), UINT64_C( 1360823877911945094) } }, + { UINT64_C( 948734087435218629), UINT64_C( 9137377986491342496), UINT64_C( 7737307891966453495), UINT64_C(14038347846904325984), + UINT64_C(16741331480747095208), UINT64_C( 1360823877911945094) } }, + { + { { UINT64_C( 3402212025738550852), UINT64_C( 3817938181475029564) }, + { UINT64_C(12173178261873687230), UINT64_C(11573951273137651312) }, + { UINT64_C(11911075881548534605), UINT64_C( 5599903492297622774) } }, + { UINT64_C( 3402212025738550852), UINT64_C( 3817938181475029564), UINT64_C(12173178261873687230), UINT64_C(11573951273137651312), + UINT64_C(11911075881548534605), UINT64_C( 5599903492297622774) } }, + { + { { UINT64_C( 8331450420443689684), UINT64_C(16789028647699655425) }, + { UINT64_C( 359531567795956463), UINT64_C( 9993554327186627540) }, + { UINT64_C( 5180300958306993006), UINT64_C( 8020526654460060619) } }, + { UINT64_C( 8331450420443689684), UINT64_C(16789028647699655425), UINT64_C( 359531567795956463), UINT64_C( 9993554327186627540), + UINT64_C( 5180300958306993006), UINT64_C( 8020526654460060619) } }, + { + { { UINT64_C( 8584077094592926221), UINT64_C( 5899868220857951903) }, + { UINT64_C( 5484161147315904910), UINT64_C( 8032451831478271882) }, + { UINT64_C(11776255538936561747), UINT64_C( 6955204696398710865) } }, + { UINT64_C( 8584077094592926221), UINT64_C( 5899868220857951903), UINT64_C( 5484161147315904910), UINT64_C( 8032451831478271882), + UINT64_C(11776255538936561747), UINT64_C( 6955204696398710865) } }, + { + { { UINT64_C( 8793084692815693882), UINT64_C( 1000078094486518287) }, + { UINT64_C( 7414456697634384445), UINT64_C(17432343130826006201) }, + { UINT64_C( 9210621483031470184), UINT64_C(10535555963185813357) } }, + { UINT64_C( 8793084692815693882), UINT64_C( 1000078094486518287), UINT64_C( 7414456697634384445), UINT64_C(17432343130826006201), + UINT64_C( 9210621483031470184), UINT64_C(10535555963185813357) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_uint64x2x3_t r_ = { { simde_vld1q_u64(test_vec[i].r[0]), + simde_vld1q_u64(test_vec[i].r[1]), + simde_vld1q_u64(test_vec[i].r[2]) } }; + + SIMDE_ALIGN_TO_16 uint64_t a_[6]; + simde_vst1q_u64_x3(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_uint64x2_t a = simde_test_arm_neon_random_u64x2(); + simde_uint64x2_t b = simde_test_arm_neon_random_u64x2(); + simde_uint64x2_t c = simde_test_arm_neon_random_u64x2(); + simde_uint64x2x3_t d = {{a, b, c}}; + + simde_test_arm_neon_write_u64x2x3(2, d, SIMDE_TEST_VEC_POS_FIRST); + + uint64_t buf[6]; + simde_vst1q_u64_x3(buf, d); + + simde_test_codegen_write_vu64(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +#endif /* !defined(SIMDE_BUG_INTEL_857088) */ + +SIMDE_TEST_FUNC_LIST_BEGIN +#if !defined(SIMDE_BUG_INTEL_857088) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1q_f32_x3) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1q_f64_x3) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1q_s8_x3) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1q_s16_x3) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1q_s32_x3) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1q_s64_x3) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1q_u8_x3) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1q_u16_x3) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1q_u32_x3) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1q_u64_x3) +#endif /* !defined(SIMDE_BUG_INTEL_857088) */ +SIMDE_TEST_FUNC_LIST_END + +#include "test-neon-footer.h" diff --git a/test/arm/neon/st1q_x4.c b/test/arm/neon/st1q_x4.c new file mode 100644 index 000000000..c0e180c76 --- /dev/null +++ b/test/arm/neon/st1q_x4.c @@ -0,0 +1,1214 @@ + +#include "test/test.h" +#define SIMDE_TEST_ARM_NEON_INSN st1q_x4 +#include "test-neon.h" +#include "../../../simde/arm/neon/st1q_x4.h" + +#if !defined(SIMDE_BUG_INTEL_857088) + +static int +test_simde_vst1q_f32_x4 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + simde_float32 r[4][4]; + simde_float32 a[16]; + } test_vec[] = { + { + { { SIMDE_FLOAT32_C( 415.30), SIMDE_FLOAT32_C( -128.97), SIMDE_FLOAT32_C( -764.36), SIMDE_FLOAT32_C( 567.37) }, + { SIMDE_FLOAT32_C( -242.35), SIMDE_FLOAT32_C( -382.14), SIMDE_FLOAT32_C( -602.24), SIMDE_FLOAT32_C( 885.83) }, + { SIMDE_FLOAT32_C( 450.10), SIMDE_FLOAT32_C( -580.76), SIMDE_FLOAT32_C( -43.35), SIMDE_FLOAT32_C( -176.72) }, + { SIMDE_FLOAT32_C( 697.79), SIMDE_FLOAT32_C( -514.98), SIMDE_FLOAT32_C( -539.79), SIMDE_FLOAT32_C( 81.80) } }, + { SIMDE_FLOAT32_C( 415.30), SIMDE_FLOAT32_C( -128.97), SIMDE_FLOAT32_C( -764.36), SIMDE_FLOAT32_C( 567.37), + SIMDE_FLOAT32_C( -242.35), SIMDE_FLOAT32_C( -382.14), SIMDE_FLOAT32_C( -602.24), SIMDE_FLOAT32_C( 885.83), + SIMDE_FLOAT32_C( 450.10), SIMDE_FLOAT32_C( -580.76), SIMDE_FLOAT32_C( -43.35), SIMDE_FLOAT32_C( -176.72), + SIMDE_FLOAT32_C( 697.79), SIMDE_FLOAT32_C( -514.98), SIMDE_FLOAT32_C( -539.79), SIMDE_FLOAT32_C( 81.80) } }, + { + { { SIMDE_FLOAT32_C( 667.61), SIMDE_FLOAT32_C( -256.69), SIMDE_FLOAT32_C( -137.14), SIMDE_FLOAT32_C( -987.69) }, + { SIMDE_FLOAT32_C( -283.13), SIMDE_FLOAT32_C( 43.43), SIMDE_FLOAT32_C( 498.39), SIMDE_FLOAT32_C( 225.83) }, + { SIMDE_FLOAT32_C( 942.57), SIMDE_FLOAT32_C( 724.97), SIMDE_FLOAT32_C( -337.87), SIMDE_FLOAT32_C( 623.53) }, + { SIMDE_FLOAT32_C( 700.19), SIMDE_FLOAT32_C( -982.34), SIMDE_FLOAT32_C( 865.96), SIMDE_FLOAT32_C( 115.48) } }, + { SIMDE_FLOAT32_C( 667.61), SIMDE_FLOAT32_C( -256.69), SIMDE_FLOAT32_C( -137.14), SIMDE_FLOAT32_C( -987.69), + SIMDE_FLOAT32_C( -283.13), SIMDE_FLOAT32_C( 43.43), SIMDE_FLOAT32_C( 498.39), SIMDE_FLOAT32_C( 225.83), + SIMDE_FLOAT32_C( 942.57), SIMDE_FLOAT32_C( 724.97), SIMDE_FLOAT32_C( -337.87), SIMDE_FLOAT32_C( 623.53), + SIMDE_FLOAT32_C( 700.19), SIMDE_FLOAT32_C( -982.34), SIMDE_FLOAT32_C( 865.96), SIMDE_FLOAT32_C( 115.48) } }, + { + { { SIMDE_FLOAT32_C( -111.31), SIMDE_FLOAT32_C( -898.40), SIMDE_FLOAT32_C( -317.15), SIMDE_FLOAT32_C( 646.34) }, + { SIMDE_FLOAT32_C( -280.54), SIMDE_FLOAT32_C( 80.61), SIMDE_FLOAT32_C( 532.18), SIMDE_FLOAT32_C( -830.44) }, + { SIMDE_FLOAT32_C( 499.86), SIMDE_FLOAT32_C( -511.17), SIMDE_FLOAT32_C( -7.16), SIMDE_FLOAT32_C( 197.65) }, + { SIMDE_FLOAT32_C( -26.15), SIMDE_FLOAT32_C( 453.05), SIMDE_FLOAT32_C( -720.54), SIMDE_FLOAT32_C( -358.54) } }, + { SIMDE_FLOAT32_C( -111.31), SIMDE_FLOAT32_C( -898.40), SIMDE_FLOAT32_C( -317.15), SIMDE_FLOAT32_C( 646.34), + SIMDE_FLOAT32_C( -280.54), SIMDE_FLOAT32_C( 80.61), SIMDE_FLOAT32_C( 532.18), SIMDE_FLOAT32_C( -830.44), + SIMDE_FLOAT32_C( 499.86), SIMDE_FLOAT32_C( -511.17), SIMDE_FLOAT32_C( -7.16), SIMDE_FLOAT32_C( 197.65), + SIMDE_FLOAT32_C( -26.15), SIMDE_FLOAT32_C( 453.05), SIMDE_FLOAT32_C( -720.54), SIMDE_FLOAT32_C( -358.54) } }, + { + { { SIMDE_FLOAT32_C( -803.64), SIMDE_FLOAT32_C( 142.31), SIMDE_FLOAT32_C( -346.23), SIMDE_FLOAT32_C( -86.77) }, + { SIMDE_FLOAT32_C( -814.25), SIMDE_FLOAT32_C( -847.83), SIMDE_FLOAT32_C( -860.93), SIMDE_FLOAT32_C( -871.68) }, + { SIMDE_FLOAT32_C( 877.13), SIMDE_FLOAT32_C( -198.80), SIMDE_FLOAT32_C( 751.84), SIMDE_FLOAT32_C( 577.32) }, + { SIMDE_FLOAT32_C( -181.14), SIMDE_FLOAT32_C( 617.81), SIMDE_FLOAT32_C( -307.19), SIMDE_FLOAT32_C( 707.55) } }, + { SIMDE_FLOAT32_C( -803.64), SIMDE_FLOAT32_C( 142.31), SIMDE_FLOAT32_C( -346.23), SIMDE_FLOAT32_C( -86.77), + SIMDE_FLOAT32_C( -814.25), SIMDE_FLOAT32_C( -847.83), SIMDE_FLOAT32_C( -860.93), SIMDE_FLOAT32_C( -871.68), + SIMDE_FLOAT32_C( 877.13), SIMDE_FLOAT32_C( -198.80), SIMDE_FLOAT32_C( 751.84), SIMDE_FLOAT32_C( 577.32), + SIMDE_FLOAT32_C( -181.14), SIMDE_FLOAT32_C( 617.81), SIMDE_FLOAT32_C( -307.19), SIMDE_FLOAT32_C( 707.55) } }, + { + { { SIMDE_FLOAT32_C( 719.41), SIMDE_FLOAT32_C( 375.66), SIMDE_FLOAT32_C( 353.89), SIMDE_FLOAT32_C( -561.13) }, + { SIMDE_FLOAT32_C( -543.72), SIMDE_FLOAT32_C( -113.93), SIMDE_FLOAT32_C( -391.58), SIMDE_FLOAT32_C( 956.14) }, + { SIMDE_FLOAT32_C( 374.90), SIMDE_FLOAT32_C( 601.26), SIMDE_FLOAT32_C( 153.79), SIMDE_FLOAT32_C( -651.25) }, + { SIMDE_FLOAT32_C( 54.31), SIMDE_FLOAT32_C( 433.24), SIMDE_FLOAT32_C( -9.79), SIMDE_FLOAT32_C( 250.67) } }, + { SIMDE_FLOAT32_C( 719.41), SIMDE_FLOAT32_C( 375.66), SIMDE_FLOAT32_C( 353.89), SIMDE_FLOAT32_C( -561.13), + SIMDE_FLOAT32_C( -543.72), SIMDE_FLOAT32_C( -113.93), SIMDE_FLOAT32_C( -391.58), SIMDE_FLOAT32_C( 956.14), + SIMDE_FLOAT32_C( 374.90), SIMDE_FLOAT32_C( 601.26), SIMDE_FLOAT32_C( 153.79), SIMDE_FLOAT32_C( -651.25), + SIMDE_FLOAT32_C( 54.31), SIMDE_FLOAT32_C( 433.24), SIMDE_FLOAT32_C( -9.79), SIMDE_FLOAT32_C( 250.67) } }, + { + { { SIMDE_FLOAT32_C( -424.44), SIMDE_FLOAT32_C( 643.98), SIMDE_FLOAT32_C( -836.09), SIMDE_FLOAT32_C( -238.69) }, + { SIMDE_FLOAT32_C( 796.14), SIMDE_FLOAT32_C( -697.03), SIMDE_FLOAT32_C( -110.38), SIMDE_FLOAT32_C( 673.28) }, + { SIMDE_FLOAT32_C( 104.17), SIMDE_FLOAT32_C( -358.53), SIMDE_FLOAT32_C( 250.60), SIMDE_FLOAT32_C( 923.03) }, + { SIMDE_FLOAT32_C( -740.72), SIMDE_FLOAT32_C( 943.41), SIMDE_FLOAT32_C( 630.57), SIMDE_FLOAT32_C( 978.68) } }, + { SIMDE_FLOAT32_C( -424.44), SIMDE_FLOAT32_C( 643.98), SIMDE_FLOAT32_C( -836.09), SIMDE_FLOAT32_C( -238.69), + SIMDE_FLOAT32_C( 796.14), SIMDE_FLOAT32_C( -697.03), SIMDE_FLOAT32_C( -110.38), SIMDE_FLOAT32_C( 673.28), + SIMDE_FLOAT32_C( 104.17), SIMDE_FLOAT32_C( -358.53), SIMDE_FLOAT32_C( 250.60), SIMDE_FLOAT32_C( 923.03), + SIMDE_FLOAT32_C( -740.72), SIMDE_FLOAT32_C( 943.41), SIMDE_FLOAT32_C( 630.57), SIMDE_FLOAT32_C( 978.68) } }, + { + { { SIMDE_FLOAT32_C( 319.07), SIMDE_FLOAT32_C( -15.53), SIMDE_FLOAT32_C( -582.45), SIMDE_FLOAT32_C( 775.35) }, + { SIMDE_FLOAT32_C( 870.54), SIMDE_FLOAT32_C( 25.97), SIMDE_FLOAT32_C( 731.48), SIMDE_FLOAT32_C( 245.44) }, + { SIMDE_FLOAT32_C( -372.76), SIMDE_FLOAT32_C( -114.73), SIMDE_FLOAT32_C( 594.19), SIMDE_FLOAT32_C( 681.55) }, + { SIMDE_FLOAT32_C( -681.49), SIMDE_FLOAT32_C( -415.61), SIMDE_FLOAT32_C( -67.78), SIMDE_FLOAT32_C( -105.93) } }, + { SIMDE_FLOAT32_C( 319.07), SIMDE_FLOAT32_C( -15.53), SIMDE_FLOAT32_C( -582.45), SIMDE_FLOAT32_C( 775.35), + SIMDE_FLOAT32_C( 870.54), SIMDE_FLOAT32_C( 25.97), SIMDE_FLOAT32_C( 731.48), SIMDE_FLOAT32_C( 245.44), + SIMDE_FLOAT32_C( -372.76), SIMDE_FLOAT32_C( -114.73), SIMDE_FLOAT32_C( 594.19), SIMDE_FLOAT32_C( 681.55), + SIMDE_FLOAT32_C( -681.49), SIMDE_FLOAT32_C( -415.61), SIMDE_FLOAT32_C( -67.78), SIMDE_FLOAT32_C( -105.93) } }, + { + { { SIMDE_FLOAT32_C( -771.63), SIMDE_FLOAT32_C( 96.13), SIMDE_FLOAT32_C( 655.38), SIMDE_FLOAT32_C( -975.48) }, + { SIMDE_FLOAT32_C( 399.10), SIMDE_FLOAT32_C( -454.99), SIMDE_FLOAT32_C( 697.80), SIMDE_FLOAT32_C( -496.73) }, + { SIMDE_FLOAT32_C( 186.48), SIMDE_FLOAT32_C( -51.60), SIMDE_FLOAT32_C( -573.70), SIMDE_FLOAT32_C( 445.75) }, + { SIMDE_FLOAT32_C( -108.20), SIMDE_FLOAT32_C( -943.13), SIMDE_FLOAT32_C( 424.44), SIMDE_FLOAT32_C( -789.12) } }, + { SIMDE_FLOAT32_C( -771.63), SIMDE_FLOAT32_C( 96.13), SIMDE_FLOAT32_C( 655.38), SIMDE_FLOAT32_C( -975.48), + SIMDE_FLOAT32_C( 399.10), SIMDE_FLOAT32_C( -454.99), SIMDE_FLOAT32_C( 697.80), SIMDE_FLOAT32_C( -496.73), + SIMDE_FLOAT32_C( 186.48), SIMDE_FLOAT32_C( -51.60), SIMDE_FLOAT32_C( -573.70), SIMDE_FLOAT32_C( 445.75), + SIMDE_FLOAT32_C( -108.20), SIMDE_FLOAT32_C( -943.13), SIMDE_FLOAT32_C( 424.44), SIMDE_FLOAT32_C( -789.12) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_float32x4x4_t r_ = { { simde_vld1q_f32(test_vec[i].r[0]), + simde_vld1q_f32(test_vec[i].r[1]), + simde_vld1q_f32(test_vec[i].r[2]), + simde_vld1q_f32(test_vec[i].r[3]) } }; + + SIMDE_ALIGN_TO_16 simde_float32 a_[16]; + simde_vst1q_f32_x4(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_float32x4_t a = simde_test_arm_neon_random_f32x4(-1000.0f, 1000.0f); + simde_float32x4_t b = simde_test_arm_neon_random_f32x4(-1000.0f, 1000.0f); + simde_float32x4_t c = simde_test_arm_neon_random_f32x4(-1000.0f, 1000.0f); + simde_float32x4_t d = simde_test_arm_neon_random_f32x4(-1000.0f, 1000.0f); + simde_float32x4x4_t e = {{a, b, c, d}}; + + simde_test_arm_neon_write_f32x4x4(2, e, SIMDE_TEST_VEC_POS_FIRST); + + simde_float32 buf[16]; + simde_vst1q_f32_x4(buf, e); + + simde_test_codegen_write_vf32(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1q_f64_x4 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + simde_float64 r[4][2]; + simde_float64 a[8]; + } test_vec[] = { + { + { { SIMDE_FLOAT64_C( 41.34), SIMDE_FLOAT64_C( 841.99) }, + { SIMDE_FLOAT64_C( 986.22), SIMDE_FLOAT64_C( -88.12) }, + { SIMDE_FLOAT64_C( -132.04), SIMDE_FLOAT64_C( 717.70) }, + { SIMDE_FLOAT64_C( -842.69), SIMDE_FLOAT64_C( 495.20) } }, + { SIMDE_FLOAT64_C( 41.34), SIMDE_FLOAT64_C( 841.99), SIMDE_FLOAT64_C( 986.22), SIMDE_FLOAT64_C( -88.12), + SIMDE_FLOAT64_C( -132.04), SIMDE_FLOAT64_C( 717.70), SIMDE_FLOAT64_C( -842.69), SIMDE_FLOAT64_C( 495.20) } }, + { + { { SIMDE_FLOAT64_C( -397.02), SIMDE_FLOAT64_C( 751.50) }, + { SIMDE_FLOAT64_C( 176.75), SIMDE_FLOAT64_C( -78.51) }, + { SIMDE_FLOAT64_C( -664.11), SIMDE_FLOAT64_C( -891.03) }, + { SIMDE_FLOAT64_C( 815.56), SIMDE_FLOAT64_C( -435.73) } }, + { SIMDE_FLOAT64_C( -397.02), SIMDE_FLOAT64_C( 751.50), SIMDE_FLOAT64_C( 176.75), SIMDE_FLOAT64_C( -78.51), + SIMDE_FLOAT64_C( -664.11), SIMDE_FLOAT64_C( -891.03), SIMDE_FLOAT64_C( 815.56), SIMDE_FLOAT64_C( -435.73) } }, + { + { { SIMDE_FLOAT64_C( 205.10), SIMDE_FLOAT64_C( 470.95) }, + { SIMDE_FLOAT64_C( -411.22), SIMDE_FLOAT64_C( -395.80) }, + { SIMDE_FLOAT64_C( -984.05), SIMDE_FLOAT64_C( -713.42) }, + { SIMDE_FLOAT64_C( 107.47), SIMDE_FLOAT64_C( 202.43) } }, + { SIMDE_FLOAT64_C( 205.10), SIMDE_FLOAT64_C( 470.95), SIMDE_FLOAT64_C( -411.22), SIMDE_FLOAT64_C( -395.80), + SIMDE_FLOAT64_C( -984.05), SIMDE_FLOAT64_C( -713.42), SIMDE_FLOAT64_C( 107.47), SIMDE_FLOAT64_C( 202.43) } }, + { + { { SIMDE_FLOAT64_C( 234.98), SIMDE_FLOAT64_C( 533.77) }, + { SIMDE_FLOAT64_C( -351.82), SIMDE_FLOAT64_C( -873.22) }, + { SIMDE_FLOAT64_C( 590.65), SIMDE_FLOAT64_C( -927.38) }, + { SIMDE_FLOAT64_C( -662.34), SIMDE_FLOAT64_C( -368.01) } }, + { SIMDE_FLOAT64_C( 234.98), SIMDE_FLOAT64_C( 533.77), SIMDE_FLOAT64_C( -351.82), SIMDE_FLOAT64_C( -873.22), + SIMDE_FLOAT64_C( 590.65), SIMDE_FLOAT64_C( -927.38), SIMDE_FLOAT64_C( -662.34), SIMDE_FLOAT64_C( -368.01) } }, + { + { { SIMDE_FLOAT64_C( 914.61), SIMDE_FLOAT64_C( -676.12) }, + { SIMDE_FLOAT64_C( 543.86), SIMDE_FLOAT64_C( -217.43) }, + { SIMDE_FLOAT64_C( -958.42), SIMDE_FLOAT64_C( 701.17) }, + { SIMDE_FLOAT64_C( -722.23), SIMDE_FLOAT64_C( -355.44) } }, + { SIMDE_FLOAT64_C( 914.61), SIMDE_FLOAT64_C( -676.12), SIMDE_FLOAT64_C( 543.86), SIMDE_FLOAT64_C( -217.43), + SIMDE_FLOAT64_C( -958.42), SIMDE_FLOAT64_C( 701.17), SIMDE_FLOAT64_C( -722.23), SIMDE_FLOAT64_C( -355.44) } }, + { + { { SIMDE_FLOAT64_C( 452.67), SIMDE_FLOAT64_C( 454.52) }, + { SIMDE_FLOAT64_C( 566.05), SIMDE_FLOAT64_C( 788.57) }, + { SIMDE_FLOAT64_C( 563.49), SIMDE_FLOAT64_C( 381.62) }, + { SIMDE_FLOAT64_C( -647.16), SIMDE_FLOAT64_C( -231.41) } }, + { SIMDE_FLOAT64_C( 452.67), SIMDE_FLOAT64_C( 454.52), SIMDE_FLOAT64_C( 566.05), SIMDE_FLOAT64_C( 788.57), + SIMDE_FLOAT64_C( 563.49), SIMDE_FLOAT64_C( 381.62), SIMDE_FLOAT64_C( -647.16), SIMDE_FLOAT64_C( -231.41) } }, + { + { { SIMDE_FLOAT64_C( -147.44), SIMDE_FLOAT64_C( -58.38) }, + { SIMDE_FLOAT64_C( 372.79), SIMDE_FLOAT64_C( -131.49) }, + { SIMDE_FLOAT64_C( 228.20), SIMDE_FLOAT64_C( -519.73) }, + { SIMDE_FLOAT64_C( -929.06), SIMDE_FLOAT64_C( -536.82) } }, + { SIMDE_FLOAT64_C( -147.44), SIMDE_FLOAT64_C( -58.38), SIMDE_FLOAT64_C( 372.79), SIMDE_FLOAT64_C( -131.49), + SIMDE_FLOAT64_C( 228.20), SIMDE_FLOAT64_C( -519.73), SIMDE_FLOAT64_C( -929.06), SIMDE_FLOAT64_C( -536.82) } }, + { + { { SIMDE_FLOAT64_C( -985.96), SIMDE_FLOAT64_C( -280.88) }, + { SIMDE_FLOAT64_C( -410.04), SIMDE_FLOAT64_C( 604.69) }, + { SIMDE_FLOAT64_C( -208.26), SIMDE_FLOAT64_C( -72.39) }, + { SIMDE_FLOAT64_C( -763.32), SIMDE_FLOAT64_C( -293.65) } }, + { SIMDE_FLOAT64_C( -985.96), SIMDE_FLOAT64_C( -280.88), SIMDE_FLOAT64_C( -410.04), SIMDE_FLOAT64_C( 604.69), + SIMDE_FLOAT64_C( -208.26), SIMDE_FLOAT64_C( -72.39), SIMDE_FLOAT64_C( -763.32), SIMDE_FLOAT64_C( -293.65) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_float64x2x4_t r_ = { { simde_vld1q_f64(test_vec[i].r[0]), + simde_vld1q_f64(test_vec[i].r[1]), + simde_vld1q_f64(test_vec[i].r[2]), + simde_vld1q_f64(test_vec[i].r[3]) } }; + + SIMDE_ALIGN_TO_16 simde_float64 a_[8]; + simde_vst1q_f64_x4(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_float64x2_t a = simde_test_arm_neon_random_f64x2(-1000.0, 1000.0); + simde_float64x2_t b = simde_test_arm_neon_random_f64x2(-1000.0, 1000.0); + simde_float64x2_t c = simde_test_arm_neon_random_f64x2(-1000.0, 1000.0); + simde_float64x2_t d = simde_test_arm_neon_random_f64x2(-1000.0, 1000.0); + simde_float64x2x4_t e = {{a, b, c, d}}; + + simde_test_arm_neon_write_f64x2x4(2, e, SIMDE_TEST_VEC_POS_FIRST); + + simde_float64 buf[8]; + simde_vst1q_f64_x4(buf, e); + + simde_test_codegen_write_vf64(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1q_s8_x4 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + int8_t r[4][16]; + int8_t a[64]; + } test_vec[] = { + { + { { INT8_C( 23), INT8_C( 29), -INT8_C( 65), -INT8_C( 63), INT8_C( 50), -INT8_C( 49), INT8_C( 88), INT8_MAX, + INT8_C( 36), -INT8_C( 70), -INT8_C( 112), INT8_C( 119), INT8_C( 74), INT8_C( 54), -INT8_C( 42), INT8_C( 116) }, + { INT8_C( 7), -INT8_C( 127), INT8_C( 3), INT8_C( 13), INT8_C( 52), -INT8_C( 120), INT8_C( 43), -INT8_C( 125), + -INT8_C( 85), -INT8_C( 34), -INT8_C( 94), -INT8_C( 83), -INT8_C( 62), -INT8_C( 21), -INT8_C( 8), -INT8_C( 38) }, + { INT8_C( 8), -INT8_C( 72), -INT8_C( 101), INT8_C( 58), -INT8_C( 121), -INT8_C( 13), -INT8_C( 71), -INT8_C( 85), + -INT8_C( 83), INT8_C( 74), INT8_C( 34), -INT8_C( 9), INT8_MIN, -INT8_C( 7), INT8_C( 108), -INT8_C( 121) }, + { INT8_C( 122), INT8_C( 111), -INT8_C( 108), -INT8_C( 82), -INT8_C( 9), -INT8_C( 65), INT8_C( 49), -INT8_C( 93), + -INT8_C( 99), -INT8_C( 44), INT8_C( 80), INT8_C( 96), -INT8_C( 65), INT8_C( 72), INT8_C( 58), -INT8_C( 57) } }, + { INT8_C( 23), INT8_C( 29), -INT8_C( 65), -INT8_C( 63), INT8_C( 50), -INT8_C( 49), INT8_C( 88), INT8_MAX, + INT8_C( 36), -INT8_C( 70), -INT8_C( 112), INT8_C( 119), INT8_C( 74), INT8_C( 54), -INT8_C( 42), INT8_C( 116), + INT8_C( 7), -INT8_C( 127), INT8_C( 3), INT8_C( 13), INT8_C( 52), -INT8_C( 120), INT8_C( 43), -INT8_C( 125), + -INT8_C( 85), -INT8_C( 34), -INT8_C( 94), -INT8_C( 83), -INT8_C( 62), -INT8_C( 21), -INT8_C( 8), -INT8_C( 38), + INT8_C( 8), -INT8_C( 72), -INT8_C( 101), INT8_C( 58), -INT8_C( 121), -INT8_C( 13), -INT8_C( 71), -INT8_C( 85), + -INT8_C( 83), INT8_C( 74), INT8_C( 34), -INT8_C( 9), INT8_MIN, -INT8_C( 7), INT8_C( 108), -INT8_C( 121), + INT8_C( 122), INT8_C( 111), -INT8_C( 108), -INT8_C( 82), -INT8_C( 9), -INT8_C( 65), INT8_C( 49), -INT8_C( 93), + -INT8_C( 99), -INT8_C( 44), INT8_C( 80), INT8_C( 96), -INT8_C( 65), INT8_C( 72), INT8_C( 58), -INT8_C( 57) } }, + { + { { INT8_C( 0), -INT8_C( 43), INT8_C( 2), -INT8_C( 121), -INT8_C( 56), -INT8_C( 69), INT8_C( 51), INT8_C( 118), + INT8_C( 5), INT8_C( 85), INT8_C( 109), -INT8_C( 123), INT8_C( 78), -INT8_C( 39), INT8_C( 12), -INT8_C( 56) }, + { INT8_C( 73), -INT8_C( 95), INT8_C( 119), INT8_C( 64), INT8_C( 96), -INT8_C( 88), -INT8_C( 29), -INT8_C( 2), + INT8_C( 124), INT8_C( 51), INT8_C( 94), INT8_C( 59), INT8_C( 124), -INT8_C( 104), INT8_C( 3), INT8_C( 124) }, + { INT8_C( 109), INT8_C( 5), INT8_C( 4), INT8_C( 53), -INT8_C( 64), INT8_C( 55), -INT8_C( 85), -INT8_C( 58), + -INT8_C( 116), INT8_C( 25), INT8_C( 75), -INT8_C( 37), -INT8_C( 14), INT8_C( 88), -INT8_C( 93), INT8_C( 59) }, + { -INT8_C( 7), INT8_C( 26), INT8_C( 124), INT8_C( 89), -INT8_C( 61), INT8_C( 95), INT8_C( 87), INT8_C( 63), + -INT8_C( 109), -INT8_C( 75), INT8_C( 123), INT8_C( 15), INT8_C( 77), INT8_C( 126), -INT8_C( 117), -INT8_C( 70) } }, + { INT8_C( 0), -INT8_C( 43), INT8_C( 2), -INT8_C( 121), -INT8_C( 56), -INT8_C( 69), INT8_C( 51), INT8_C( 118), + INT8_C( 5), INT8_C( 85), INT8_C( 109), -INT8_C( 123), INT8_C( 78), -INT8_C( 39), INT8_C( 12), -INT8_C( 56), + INT8_C( 73), -INT8_C( 95), INT8_C( 119), INT8_C( 64), INT8_C( 96), -INT8_C( 88), -INT8_C( 29), -INT8_C( 2), + INT8_C( 124), INT8_C( 51), INT8_C( 94), INT8_C( 59), INT8_C( 124), -INT8_C( 104), INT8_C( 3), INT8_C( 124), + INT8_C( 109), INT8_C( 5), INT8_C( 4), INT8_C( 53), -INT8_C( 64), INT8_C( 55), -INT8_C( 85), -INT8_C( 58), + -INT8_C( 116), INT8_C( 25), INT8_C( 75), -INT8_C( 37), -INT8_C( 14), INT8_C( 88), -INT8_C( 93), INT8_C( 59), + -INT8_C( 7), INT8_C( 26), INT8_C( 124), INT8_C( 89), -INT8_C( 61), INT8_C( 95), INT8_C( 87), INT8_C( 63), + -INT8_C( 109), -INT8_C( 75), INT8_C( 123), INT8_C( 15), INT8_C( 77), INT8_C( 126), -INT8_C( 117), -INT8_C( 70) } }, + { + { { -INT8_C( 125), -INT8_C( 113), -INT8_C( 16), INT8_C( 67), -INT8_C( 58), -INT8_C( 101), INT8_C( 9), INT8_C( 83), + -INT8_C( 76), INT8_C( 85), INT8_C( 46), -INT8_C( 89), -INT8_C( 83), -INT8_C( 47), -INT8_C( 30), -INT8_C( 90) }, + { -INT8_C( 20), INT8_C( 94), -INT8_C( 1), -INT8_C( 81), -INT8_C( 66), INT8_C( 87), -INT8_C( 18), INT8_C( 81), + INT8_C( 12), INT8_C( 105), INT8_C( 96), INT8_C( 90), -INT8_C( 25), -INT8_C( 21), INT8_C( 20), INT8_C( 106) }, + { INT8_C( 123), INT8_C( 4), -INT8_C( 82), INT8_C( 65), -INT8_C( 96), -INT8_C( 73), -INT8_C( 108), INT8_C( 84), + INT8_C( 12), -INT8_C( 62), -INT8_C( 5), -INT8_C( 71), -INT8_C( 108), -INT8_C( 34), INT8_C( 95), INT8_MIN }, + { INT8_C( 60), INT8_C( 95), INT8_C( 47), -INT8_C( 6), -INT8_C( 74), INT8_C( 29), INT8_C( 75), -INT8_C( 62), + -INT8_C( 121), -INT8_C( 85), INT8_C( 28), INT8_C( 110), -INT8_C( 105), INT8_C( 49), -INT8_C( 39), INT8_C( 18) } }, + { -INT8_C( 125), -INT8_C( 113), -INT8_C( 16), INT8_C( 67), -INT8_C( 58), -INT8_C( 101), INT8_C( 9), INT8_C( 83), + -INT8_C( 76), INT8_C( 85), INT8_C( 46), -INT8_C( 89), -INT8_C( 83), -INT8_C( 47), -INT8_C( 30), -INT8_C( 90), + -INT8_C( 20), INT8_C( 94), -INT8_C( 1), -INT8_C( 81), -INT8_C( 66), INT8_C( 87), -INT8_C( 18), INT8_C( 81), + INT8_C( 12), INT8_C( 105), INT8_C( 96), INT8_C( 90), -INT8_C( 25), -INT8_C( 21), INT8_C( 20), INT8_C( 106), + INT8_C( 123), INT8_C( 4), -INT8_C( 82), INT8_C( 65), -INT8_C( 96), -INT8_C( 73), -INT8_C( 108), INT8_C( 84), + INT8_C( 12), -INT8_C( 62), -INT8_C( 5), -INT8_C( 71), -INT8_C( 108), -INT8_C( 34), INT8_C( 95), INT8_MIN, + INT8_C( 60), INT8_C( 95), INT8_C( 47), -INT8_C( 6), -INT8_C( 74), INT8_C( 29), INT8_C( 75), -INT8_C( 62), + -INT8_C( 121), -INT8_C( 85), INT8_C( 28), INT8_C( 110), -INT8_C( 105), INT8_C( 49), -INT8_C( 39), INT8_C( 18) } }, + { + { { INT8_C( 53), -INT8_C( 121), INT8_C( 83), -INT8_C( 43), INT8_C( 62), -INT8_C( 24), INT8_C( 42), INT8_C( 75), + -INT8_C( 86), INT8_C( 37), INT8_C( 4), INT8_C( 62), INT8_C( 3), INT8_C( 100), -INT8_C( 66), INT8_C( 64) }, + { -INT8_C( 61), -INT8_C( 19), INT8_C( 58), INT8_C( 121), INT8_C( 11), -INT8_C( 122), INT8_C( 59), -INT8_C( 110), + INT8_C( 49), INT8_C( 88), INT8_C( 0), -INT8_C( 56), -INT8_C( 119), -INT8_C( 39), -INT8_C( 38), -INT8_C( 66) }, + { INT8_C( 96), INT8_C( 46), -INT8_C( 108), -INT8_C( 97), INT8_C( 22), -INT8_C( 66), -INT8_C( 22), -INT8_C( 64), + -INT8_C( 29), -INT8_C( 18), -INT8_C( 1), -INT8_C( 25), INT8_C( 82), -INT8_C( 67), INT8_C( 39), INT8_C( 21) }, + { -INT8_C( 85), INT8_C( 97), -INT8_C( 114), -INT8_C( 74), -INT8_C( 25), -INT8_C( 54), INT8_C( 72), INT8_C( 25), + INT8_C( 34), INT8_C( 72), -INT8_C( 31), -INT8_C( 85), INT8_C( 34), -INT8_C( 68), INT8_C( 105), -INT8_C( 126) } }, + { INT8_C( 53), -INT8_C( 121), INT8_C( 83), -INT8_C( 43), INT8_C( 62), -INT8_C( 24), INT8_C( 42), INT8_C( 75), + -INT8_C( 86), INT8_C( 37), INT8_C( 4), INT8_C( 62), INT8_C( 3), INT8_C( 100), -INT8_C( 66), INT8_C( 64), + -INT8_C( 61), -INT8_C( 19), INT8_C( 58), INT8_C( 121), INT8_C( 11), -INT8_C( 122), INT8_C( 59), -INT8_C( 110), + INT8_C( 49), INT8_C( 88), INT8_C( 0), -INT8_C( 56), -INT8_C( 119), -INT8_C( 39), -INT8_C( 38), -INT8_C( 66), + INT8_C( 96), INT8_C( 46), -INT8_C( 108), -INT8_C( 97), INT8_C( 22), -INT8_C( 66), -INT8_C( 22), -INT8_C( 64), + -INT8_C( 29), -INT8_C( 18), -INT8_C( 1), -INT8_C( 25), INT8_C( 82), -INT8_C( 67), INT8_C( 39), INT8_C( 21), + -INT8_C( 85), INT8_C( 97), -INT8_C( 114), -INT8_C( 74), -INT8_C( 25), -INT8_C( 54), INT8_C( 72), INT8_C( 25), + INT8_C( 34), INT8_C( 72), -INT8_C( 31), -INT8_C( 85), INT8_C( 34), -INT8_C( 68), INT8_C( 105), -INT8_C( 126) } }, + { + { { -INT8_C( 22), -INT8_C( 3), INT8_C( 33), INT8_C( 0), -INT8_C( 69), INT8_C( 11), -INT8_C( 64), -INT8_C( 97), + -INT8_C( 6), -INT8_C( 65), -INT8_C( 122), INT8_C( 76), INT8_C( 125), -INT8_C( 83), INT8_C( 98), INT8_C( 40) }, + { INT8_C( 14), -INT8_C( 16), -INT8_C( 34), -INT8_C( 10), -INT8_C( 70), INT8_C( 38), INT8_C( 15), -INT8_C( 36), + INT8_C( 110), -INT8_C( 16), -INT8_C( 121), -INT8_C( 112), -INT8_C( 84), -INT8_C( 15), INT8_C( 19), -INT8_C( 106) }, + { -INT8_C( 18), INT8_C( 52), -INT8_C( 106), -INT8_C( 86), INT8_C( 64), INT8_C( 87), INT8_C( 73), INT8_C( 58), + INT8_C( 22), -INT8_C( 49), -INT8_C( 122), -INT8_C( 109), INT8_C( 124), -INT8_C( 24), -INT8_C( 69), -INT8_C( 118) }, + { -INT8_C( 39), -INT8_C( 103), INT8_MIN, -INT8_C( 109), -INT8_C( 65), -INT8_C( 113), INT8_C( 112), INT8_C( 46), + INT8_MIN, -INT8_C( 9), -INT8_C( 66), INT8_C( 44), -INT8_C( 24), -INT8_C( 47), -INT8_C( 61), -INT8_C( 41) } }, + { -INT8_C( 22), -INT8_C( 3), INT8_C( 33), INT8_C( 0), -INT8_C( 69), INT8_C( 11), -INT8_C( 64), -INT8_C( 97), + -INT8_C( 6), -INT8_C( 65), -INT8_C( 122), INT8_C( 76), INT8_C( 125), -INT8_C( 83), INT8_C( 98), INT8_C( 40), + INT8_C( 14), -INT8_C( 16), -INT8_C( 34), -INT8_C( 10), -INT8_C( 70), INT8_C( 38), INT8_C( 15), -INT8_C( 36), + INT8_C( 110), -INT8_C( 16), -INT8_C( 121), -INT8_C( 112), -INT8_C( 84), -INT8_C( 15), INT8_C( 19), -INT8_C( 106), + -INT8_C( 18), INT8_C( 52), -INT8_C( 106), -INT8_C( 86), INT8_C( 64), INT8_C( 87), INT8_C( 73), INT8_C( 58), + INT8_C( 22), -INT8_C( 49), -INT8_C( 122), -INT8_C( 109), INT8_C( 124), -INT8_C( 24), -INT8_C( 69), -INT8_C( 118), + -INT8_C( 39), -INT8_C( 103), INT8_MIN, -INT8_C( 109), -INT8_C( 65), -INT8_C( 113), INT8_C( 112), INT8_C( 46), + INT8_MIN, -INT8_C( 9), -INT8_C( 66), INT8_C( 44), -INT8_C( 24), -INT8_C( 47), -INT8_C( 61), -INT8_C( 41) } }, + { + { { INT8_C( 6), INT8_C( 89), -INT8_C( 127), INT8_C( 70), -INT8_C( 80), -INT8_C( 54), INT8_MIN, -INT8_C( 57), + -INT8_C( 103), INT8_C( 6), INT8_C( 90), INT8_C( 21), -INT8_C( 17), INT8_C( 22), -INT8_C( 97), -INT8_C( 56) }, + { -INT8_C( 81), INT8_C( 32), INT8_C( 91), INT8_C( 111), -INT8_C( 81), -INT8_C( 53), -INT8_C( 99), INT8_C( 47), + -INT8_C( 61), INT8_C( 91), INT8_C( 92), -INT8_C( 85), INT8_C( 45), INT8_C( 31), -INT8_C( 126), INT8_C( 51) }, + { INT8_C( 120), INT8_C( 3), INT8_C( 121), INT8_C( 41), -INT8_C( 51), -INT8_C( 7), -INT8_C( 16), INT8_C( 102), + -INT8_C( 1), INT8_C( 74), INT8_C( 123), -INT8_C( 18), INT8_C( 96), INT8_C( 27), -INT8_C( 74), INT8_C( 16) }, + { INT8_C( 59), INT8_C( 18), INT8_MAX, -INT8_C( 22), -INT8_C( 35), INT8_C( 28), INT8_C( 26), -INT8_C( 96), + INT8_C( 119), INT8_C( 118), INT8_C( 76), -INT8_C( 92), -INT8_C( 107), -INT8_C( 50), -INT8_C( 41), INT8_C( 13) } }, + { INT8_C( 6), INT8_C( 89), -INT8_C( 127), INT8_C( 70), -INT8_C( 80), -INT8_C( 54), INT8_MIN, -INT8_C( 57), + -INT8_C( 103), INT8_C( 6), INT8_C( 90), INT8_C( 21), -INT8_C( 17), INT8_C( 22), -INT8_C( 97), -INT8_C( 56), + -INT8_C( 81), INT8_C( 32), INT8_C( 91), INT8_C( 111), -INT8_C( 81), -INT8_C( 53), -INT8_C( 99), INT8_C( 47), + -INT8_C( 61), INT8_C( 91), INT8_C( 92), -INT8_C( 85), INT8_C( 45), INT8_C( 31), -INT8_C( 126), INT8_C( 51), + INT8_C( 120), INT8_C( 3), INT8_C( 121), INT8_C( 41), -INT8_C( 51), -INT8_C( 7), -INT8_C( 16), INT8_C( 102), + -INT8_C( 1), INT8_C( 74), INT8_C( 123), -INT8_C( 18), INT8_C( 96), INT8_C( 27), -INT8_C( 74), INT8_C( 16), + INT8_C( 59), INT8_C( 18), INT8_MAX, -INT8_C( 22), -INT8_C( 35), INT8_C( 28), INT8_C( 26), -INT8_C( 96), + INT8_C( 119), INT8_C( 118), INT8_C( 76), -INT8_C( 92), -INT8_C( 107), -INT8_C( 50), -INT8_C( 41), INT8_C( 13) } }, + { + { { -INT8_C( 46), INT8_C( 80), INT8_C( 54), -INT8_C( 97), INT8_C( 73), INT8_C( 38), INT8_C( 6), INT8_C( 73), + INT8_C( 113), -INT8_C( 127), INT8_C( 55), -INT8_C( 47), -INT8_C( 100), -INT8_C( 18), -INT8_C( 31), -INT8_C( 41) }, + { INT8_C( 0), INT8_C( 96), -INT8_C( 62), -INT8_C( 35), INT8_C( 124), -INT8_C( 36), INT8_C( 126), -INT8_C( 12), + INT8_C( 82), -INT8_C( 54), -INT8_C( 104), -INT8_C( 25), -INT8_C( 104), INT8_C( 112), -INT8_C( 12), INT8_C( 106) }, + { -INT8_C( 64), INT8_C( 43), INT8_C( 10), INT8_C( 10), INT8_C( 81), INT8_C( 16), INT8_C( 83), -INT8_C( 62), + -INT8_C( 111), -INT8_C( 118), -INT8_C( 108), INT8_C( 46), INT8_C( 120), INT8_C( 117), INT8_C( 5), INT8_C( 120) }, + { -INT8_C( 42), -INT8_C( 57), INT8_C( 86), INT8_C( 82), -INT8_C( 93), -INT8_C( 44), INT8_C( 70), -INT8_C( 11), + -INT8_C( 98), -INT8_C( 33), -INT8_C( 36), INT8_C( 54), INT8_C( 79), -INT8_C( 47), -INT8_C( 95), INT8_C( 15) } }, + { -INT8_C( 46), INT8_C( 80), INT8_C( 54), -INT8_C( 97), INT8_C( 73), INT8_C( 38), INT8_C( 6), INT8_C( 73), + INT8_C( 113), -INT8_C( 127), INT8_C( 55), -INT8_C( 47), -INT8_C( 100), -INT8_C( 18), -INT8_C( 31), -INT8_C( 41), + INT8_C( 0), INT8_C( 96), -INT8_C( 62), -INT8_C( 35), INT8_C( 124), -INT8_C( 36), INT8_C( 126), -INT8_C( 12), + INT8_C( 82), -INT8_C( 54), -INT8_C( 104), -INT8_C( 25), -INT8_C( 104), INT8_C( 112), -INT8_C( 12), INT8_C( 106), + -INT8_C( 64), INT8_C( 43), INT8_C( 10), INT8_C( 10), INT8_C( 81), INT8_C( 16), INT8_C( 83), -INT8_C( 62), + -INT8_C( 111), -INT8_C( 118), -INT8_C( 108), INT8_C( 46), INT8_C( 120), INT8_C( 117), INT8_C( 5), INT8_C( 120), + -INT8_C( 42), -INT8_C( 57), INT8_C( 86), INT8_C( 82), -INT8_C( 93), -INT8_C( 44), INT8_C( 70), -INT8_C( 11), + -INT8_C( 98), -INT8_C( 33), -INT8_C( 36), INT8_C( 54), INT8_C( 79), -INT8_C( 47), -INT8_C( 95), INT8_C( 15) } }, + { + { { -INT8_C( 4), -INT8_C( 85), INT8_C( 25), INT8_C( 77), -INT8_C( 69), INT8_C( 108), INT8_C( 16), INT8_C( 76), + -INT8_C( 9), -INT8_C( 92), INT8_C( 122), INT8_C( 111), INT8_C( 25), INT8_MIN, -INT8_C( 24), -INT8_C( 17) }, + { INT8_C( 71), INT8_C( 62), INT8_C( 66), -INT8_C( 21), INT8_C( 18), -INT8_C( 120), -INT8_C( 32), -INT8_C( 80), + INT8_C( 103), -INT8_C( 67), -INT8_C( 26), -INT8_C( 74), -INT8_C( 114), -INT8_C( 121), -INT8_C( 58), -INT8_C( 118) }, + { INT8_C( 50), -INT8_C( 33), -INT8_C( 41), -INT8_C( 19), INT8_C( 76), -INT8_C( 25), INT8_C( 58), INT8_C( 67), + -INT8_C( 117), -INT8_C( 76), -INT8_C( 78), -INT8_C( 91), INT8_C( 52), -INT8_C( 102), -INT8_C( 108), INT8_C( 124) }, + { -INT8_C( 40), -INT8_C( 42), INT8_C( 103), -INT8_C( 22), INT8_C( 95), INT8_C( 71), -INT8_C( 102), -INT8_C( 58), + INT8_C( 4), -INT8_C( 127), INT8_C( 125), -INT8_C( 110), INT8_C( 8), INT8_C( 67), INT8_C( 28), INT8_C( 59) } }, + { -INT8_C( 4), -INT8_C( 85), INT8_C( 25), INT8_C( 77), -INT8_C( 69), INT8_C( 108), INT8_C( 16), INT8_C( 76), + -INT8_C( 9), -INT8_C( 92), INT8_C( 122), INT8_C( 111), INT8_C( 25), INT8_MIN, -INT8_C( 24), -INT8_C( 17), + INT8_C( 71), INT8_C( 62), INT8_C( 66), -INT8_C( 21), INT8_C( 18), -INT8_C( 120), -INT8_C( 32), -INT8_C( 80), + INT8_C( 103), -INT8_C( 67), -INT8_C( 26), -INT8_C( 74), -INT8_C( 114), -INT8_C( 121), -INT8_C( 58), -INT8_C( 118), + INT8_C( 50), -INT8_C( 33), -INT8_C( 41), -INT8_C( 19), INT8_C( 76), -INT8_C( 25), INT8_C( 58), INT8_C( 67), + -INT8_C( 117), -INT8_C( 76), -INT8_C( 78), -INT8_C( 91), INT8_C( 52), -INT8_C( 102), -INT8_C( 108), INT8_C( 124), + -INT8_C( 40), -INT8_C( 42), INT8_C( 103), -INT8_C( 22), INT8_C( 95), INT8_C( 71), -INT8_C( 102), -INT8_C( 58), + INT8_C( 4), -INT8_C( 127), INT8_C( 125), -INT8_C( 110), INT8_C( 8), INT8_C( 67), INT8_C( 28), INT8_C( 59) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_int8x16x4_t r_ = { { simde_vld1q_s8(test_vec[i].r[0]), + simde_vld1q_s8(test_vec[i].r[1]), + simde_vld1q_s8(test_vec[i].r[2]), + simde_vld1q_s8(test_vec[i].r[3]) } }; + + SIMDE_ALIGN_TO_16 int8_t a_[64]; + simde_vst1q_s8_x4(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_int8x16_t a = simde_test_arm_neon_random_i8x16(); + simde_int8x16_t b = simde_test_arm_neon_random_i8x16(); + simde_int8x16_t c = simde_test_arm_neon_random_i8x16(); + simde_int8x16_t d = simde_test_arm_neon_random_i8x16(); + simde_int8x16x4_t e = {{a, b, c, d}}; + + simde_test_arm_neon_write_i8x16x4(2, e, SIMDE_TEST_VEC_POS_FIRST); + + int8_t buf[64]; + simde_vst1q_s8_x4(buf, e); + + simde_test_codegen_write_vi8(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1q_s16_x4 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + int16_t r[4][8]; + int16_t a[32]; + } test_vec[] = { + { + { { -INT16_C( 3038), INT16_C( 28200), INT16_C( 25307), INT16_C( 26545), INT16_C( 25623), INT16_C( 19212), -INT16_C( 24322), -INT16_C( 10297) }, + { INT16_C( 11895), -INT16_C( 10559), INT16_C( 23670), INT16_C( 31388), INT16_C( 6621), -INT16_C( 6899), INT16_C( 10588), INT16_C( 32544) }, + { INT16_C( 18717), -INT16_C( 1555), -INT16_C( 24661), -INT16_C( 15776), INT16_C( 27651), INT16_C( 270), -INT16_C( 10996), -INT16_C( 31784) }, + { -INT16_C( 26108), INT16_C( 31321), -INT16_C( 2314), -INT16_C( 11276), INT16_C( 271), INT16_C( 27832), -INT16_C( 9941), INT16_C( 18667) } }, + { -INT16_C( 3038), INT16_C( 28200), INT16_C( 25307), INT16_C( 26545), INT16_C( 25623), INT16_C( 19212), -INT16_C( 24322), -INT16_C( 10297), + INT16_C( 11895), -INT16_C( 10559), INT16_C( 23670), INT16_C( 31388), INT16_C( 6621), -INT16_C( 6899), INT16_C( 10588), INT16_C( 32544), + INT16_C( 18717), -INT16_C( 1555), -INT16_C( 24661), -INT16_C( 15776), INT16_C( 27651), INT16_C( 270), -INT16_C( 10996), -INT16_C( 31784), + -INT16_C( 26108), INT16_C( 31321), -INT16_C( 2314), -INT16_C( 11276), INT16_C( 271), INT16_C( 27832), -INT16_C( 9941), INT16_C( 18667) } }, + { + { { -INT16_C( 10206), -INT16_C( 12991), -INT16_C( 24201), INT16_C( 31376), -INT16_C( 25075), INT16_C( 6780), INT16_C( 21619), INT16_C( 30621) }, + { -INT16_C( 2066), -INT16_C( 6927), -INT16_C( 6419), -INT16_C( 841), INT16_C( 28903), INT16_C( 4712), INT16_C( 21321), INT16_C( 27483) }, + { -INT16_C( 25556), -INT16_C( 23752), -INT16_C( 14274), INT16_C( 19230), -INT16_C( 26010), -INT16_C( 9627), INT16_C( 1006), -INT16_C( 8879) }, + { INT16_C( 17402), -INT16_C( 6207), INT16_C( 31017), INT16_C( 4323), INT16_C( 19689), INT16_C( 12835), INT16_C( 32415), -INT16_C( 13411) } }, + { -INT16_C( 10206), -INT16_C( 12991), -INT16_C( 24201), INT16_C( 31376), -INT16_C( 25075), INT16_C( 6780), INT16_C( 21619), INT16_C( 30621), + -INT16_C( 2066), -INT16_C( 6927), -INT16_C( 6419), -INT16_C( 841), INT16_C( 28903), INT16_C( 4712), INT16_C( 21321), INT16_C( 27483), + -INT16_C( 25556), -INT16_C( 23752), -INT16_C( 14274), INT16_C( 19230), -INT16_C( 26010), -INT16_C( 9627), INT16_C( 1006), -INT16_C( 8879), + INT16_C( 17402), -INT16_C( 6207), INT16_C( 31017), INT16_C( 4323), INT16_C( 19689), INT16_C( 12835), INT16_C( 32415), -INT16_C( 13411) } }, + { + { { -INT16_C( 10982), INT16_C( 22639), -INT16_C( 29282), INT16_C( 1188), INT16_C( 2343), INT16_C( 5598), INT16_C( 12300), INT16_C( 1778) }, + { -INT16_C( 19341), -INT16_C( 25363), -INT16_C( 11987), INT16_C( 5804), -INT16_C( 12515), -INT16_C( 17336), -INT16_C( 6835), INT16_C( 26760) }, + { -INT16_C( 2118), INT16_C( 22720), INT16_C( 25732), -INT16_C( 21667), INT16_C( 15214), INT16_C( 31424), -INT16_C( 19605), -INT16_C( 8575) }, + { INT16_C( 28263), -INT16_C( 27526), INT16_C( 10047), INT16_C( 23722), -INT16_C( 3338), INT16_C( 17433), -INT16_C( 24105), -INT16_C( 28244) } }, + { -INT16_C( 10982), INT16_C( 22639), -INT16_C( 29282), INT16_C( 1188), INT16_C( 2343), INT16_C( 5598), INT16_C( 12300), INT16_C( 1778), + -INT16_C( 19341), -INT16_C( 25363), -INT16_C( 11987), INT16_C( 5804), -INT16_C( 12515), -INT16_C( 17336), -INT16_C( 6835), INT16_C( 26760), + -INT16_C( 2118), INT16_C( 22720), INT16_C( 25732), -INT16_C( 21667), INT16_C( 15214), INT16_C( 31424), -INT16_C( 19605), -INT16_C( 8575), + INT16_C( 28263), -INT16_C( 27526), INT16_C( 10047), INT16_C( 23722), -INT16_C( 3338), INT16_C( 17433), -INT16_C( 24105), -INT16_C( 28244) } }, + { + { { INT16_C( 27800), INT16_C( 7402), INT16_C( 18385), INT16_C( 16327), -INT16_C( 30846), -INT16_C( 4423), INT16_C( 14906), -INT16_C( 24116) }, + { INT16_C( 18345), -INT16_C( 6091), -INT16_C( 8338), INT16_C( 25669), INT16_C( 24273), -INT16_C( 22360), INT16_C( 21759), -INT16_C( 26822) }, + { INT16_C( 9409), -INT16_C( 27981), INT16_C( 31339), -INT16_C( 4655), -INT16_C( 30207), INT16_C( 15579), -INT16_C( 22331), INT16_C( 28381) }, + { INT16_C( 5103), INT16_C( 23894), -INT16_C( 25614), -INT16_C( 15167), INT16_C( 27385), -INT16_C( 1940), -INT16_C( 22850), INT16_C( 32655) } }, + { INT16_C( 27800), INT16_C( 7402), INT16_C( 18385), INT16_C( 16327), -INT16_C( 30846), -INT16_C( 4423), INT16_C( 14906), -INT16_C( 24116), + INT16_C( 18345), -INT16_C( 6091), -INT16_C( 8338), INT16_C( 25669), INT16_C( 24273), -INT16_C( 22360), INT16_C( 21759), -INT16_C( 26822), + INT16_C( 9409), -INT16_C( 27981), INT16_C( 31339), -INT16_C( 4655), -INT16_C( 30207), INT16_C( 15579), -INT16_C( 22331), INT16_C( 28381), + INT16_C( 5103), INT16_C( 23894), -INT16_C( 25614), -INT16_C( 15167), INT16_C( 27385), -INT16_C( 1940), -INT16_C( 22850), INT16_C( 32655) } }, + { + { { INT16_C( 17098), INT16_C( 13585), -INT16_C( 7492), -INT16_C( 16861), -INT16_C( 403), INT16_C( 13050), -INT16_C( 10330), -INT16_C( 27232) }, + { -INT16_C( 2326), -INT16_C( 8718), -INT16_C( 19310), -INT16_C( 29791), INT16_C( 3358), -INT16_C( 9084), INT16_C( 5044), INT16_C( 32348) }, + { INT16_C( 27990), INT16_C( 4788), -INT16_C( 10416), -INT16_C( 16944), -INT16_C( 13611), INT16_C( 31983), -INT16_C( 28766), -INT16_C( 29679) }, + { INT16_C( 1157), INT16_C( 5993), INT16_C( 2744), -INT16_C( 10589), INT16_C( 10008), -INT16_C( 13134), INT16_C( 3642), -INT16_C( 28598) } }, + { INT16_C( 17098), INT16_C( 13585), -INT16_C( 7492), -INT16_C( 16861), -INT16_C( 403), INT16_C( 13050), -INT16_C( 10330), -INT16_C( 27232), + -INT16_C( 2326), -INT16_C( 8718), -INT16_C( 19310), -INT16_C( 29791), INT16_C( 3358), -INT16_C( 9084), INT16_C( 5044), INT16_C( 32348), + INT16_C( 27990), INT16_C( 4788), -INT16_C( 10416), -INT16_C( 16944), -INT16_C( 13611), INT16_C( 31983), -INT16_C( 28766), -INT16_C( 29679), + INT16_C( 1157), INT16_C( 5993), INT16_C( 2744), -INT16_C( 10589), INT16_C( 10008), -INT16_C( 13134), INT16_C( 3642), -INT16_C( 28598) } }, + { + { { -INT16_C( 388), -INT16_C( 13149), INT16_C( 29653), -INT16_C( 21623), INT16_C( 30782), -INT16_C( 8153), INT16_C( 14343), -INT16_C( 29588) }, + { -INT16_C( 10692), -INT16_C( 2908), INT16_C( 18400), -INT16_C( 1846), INT16_C( 32110), -INT16_C( 22332), INT16_C( 3979), INT16_C( 1849) }, + { -INT16_C( 9203), -INT16_C( 7213), INT16_C( 23631), -INT16_C( 29298), -INT16_C( 18988), -INT16_C( 9363), -INT16_C( 9491), INT16_C( 10856) }, + { INT16_C( 3248), -INT16_C( 28642), -INT16_C( 5805), -INT16_C( 15991), INT16_C( 19814), -INT16_C( 3735), -INT16_C( 23972), INT16_C( 27385) } }, + { -INT16_C( 388), -INT16_C( 13149), INT16_C( 29653), -INT16_C( 21623), INT16_C( 30782), -INT16_C( 8153), INT16_C( 14343), -INT16_C( 29588), + -INT16_C( 10692), -INT16_C( 2908), INT16_C( 18400), -INT16_C( 1846), INT16_C( 32110), -INT16_C( 22332), INT16_C( 3979), INT16_C( 1849), + -INT16_C( 9203), -INT16_C( 7213), INT16_C( 23631), -INT16_C( 29298), -INT16_C( 18988), -INT16_C( 9363), -INT16_C( 9491), INT16_C( 10856), + INT16_C( 3248), -INT16_C( 28642), -INT16_C( 5805), -INT16_C( 15991), INT16_C( 19814), -INT16_C( 3735), -INT16_C( 23972), INT16_C( 27385) } }, + { + { { -INT16_C( 13186), -INT16_C( 12723), -INT16_C( 9431), -INT16_C( 677), -INT16_C( 13936), INT16_C( 32217), INT16_C( 16803), INT16_C( 21415) }, + { -INT16_C( 14771), -INT16_C( 24349), INT16_C( 27823), INT16_C( 5473), -INT16_C( 13638), INT16_C( 5638), -INT16_C( 147), -INT16_C( 5248) }, + { -INT16_C( 12852), -INT16_C( 2631), INT16_C( 5544), INT16_C( 14578), -INT16_C( 13346), -INT16_C( 32330), INT16_C( 23820), INT16_C( 22996) }, + { -INT16_C( 18653), -INT16_C( 11527), INT16_C( 23076), -INT16_C( 8473), -INT16_C( 4571), -INT16_C( 27916), INT16_C( 30189), -INT16_C( 18051) } }, + { -INT16_C( 13186), -INT16_C( 12723), -INT16_C( 9431), -INT16_C( 677), -INT16_C( 13936), INT16_C( 32217), INT16_C( 16803), INT16_C( 21415), + -INT16_C( 14771), -INT16_C( 24349), INT16_C( 27823), INT16_C( 5473), -INT16_C( 13638), INT16_C( 5638), -INT16_C( 147), -INT16_C( 5248), + -INT16_C( 12852), -INT16_C( 2631), INT16_C( 5544), INT16_C( 14578), -INT16_C( 13346), -INT16_C( 32330), INT16_C( 23820), INT16_C( 22996), + -INT16_C( 18653), -INT16_C( 11527), INT16_C( 23076), -INT16_C( 8473), -INT16_C( 4571), -INT16_C( 27916), INT16_C( 30189), -INT16_C( 18051) } }, + { + { { INT16_C( 14146), -INT16_C( 5202), -INT16_C( 24244), INT16_C( 10787), -INT16_C( 9876), INT16_C( 31147), INT16_C( 32567), INT16_C( 23250) }, + { -INT16_C( 13258), INT16_C( 23085), INT16_C( 5158), INT16_C( 19256), INT16_C( 11522), -INT16_C( 3875), INT16_C( 23458), -INT16_C( 6999) }, + { INT16_C( 22674), -INT16_C( 8497), -INT16_C( 3079), INT16_C( 25864), -INT16_C( 19508), INT16_C( 990), -INT16_C( 20174), INT16_C( 26718) }, + { -INT16_C( 29827), -INT16_C( 23613), -INT16_C( 1121), -INT16_C( 23825), -INT16_C( 13272), -INT16_C( 13678), INT16_C( 15143), -INT16_C( 18001) } }, + { INT16_C( 14146), -INT16_C( 5202), -INT16_C( 24244), INT16_C( 10787), -INT16_C( 9876), INT16_C( 31147), INT16_C( 32567), INT16_C( 23250), + -INT16_C( 13258), INT16_C( 23085), INT16_C( 5158), INT16_C( 19256), INT16_C( 11522), -INT16_C( 3875), INT16_C( 23458), -INT16_C( 6999), + INT16_C( 22674), -INT16_C( 8497), -INT16_C( 3079), INT16_C( 25864), -INT16_C( 19508), INT16_C( 990), -INT16_C( 20174), INT16_C( 26718), + -INT16_C( 29827), -INT16_C( 23613), -INT16_C( 1121), -INT16_C( 23825), -INT16_C( 13272), -INT16_C( 13678), INT16_C( 15143), -INT16_C( 18001) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_int16x8x4_t r_ = { { simde_vld1q_s16(test_vec[i].r[0]), + simde_vld1q_s16(test_vec[i].r[1]), + simde_vld1q_s16(test_vec[i].r[2]), + simde_vld1q_s16(test_vec[i].r[3]) } }; + + SIMDE_ALIGN_TO_16 int16_t a_[32]; + simde_vst1q_s16_x4(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_int16x8_t a = simde_test_arm_neon_random_i16x8(); + simde_int16x8_t b = simde_test_arm_neon_random_i16x8(); + simde_int16x8_t c = simde_test_arm_neon_random_i16x8(); + simde_int16x8_t d = simde_test_arm_neon_random_i16x8(); + simde_int16x8x4_t e = {{a, b, c, d}}; + + simde_test_arm_neon_write_i16x8x4(2, e, SIMDE_TEST_VEC_POS_FIRST); + + int16_t buf[32]; + simde_vst1q_s16_x4(buf, e); + + simde_test_codegen_write_vi16(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1q_s32_x4 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + int32_t r[4][4]; + int32_t a[16]; + } test_vec[] = { + { + { { -INT32_C( 1936228717), INT32_C( 1056087921), -INT32_C( 2076061614), -INT32_C( 17981567) }, + { -INT32_C( 895307734), -INT32_C( 731082325), -INT32_C( 2053177763), -INT32_C( 851555015) }, + { INT32_C( 1029297868), -INT32_C( 931443851), -INT32_C( 1655915236), -INT32_C( 2019804836) }, + { -INT32_C( 1789837591), INT32_C( 745127375), -INT32_C( 189724741), INT32_C( 566358101) } }, + { -INT32_C( 1936228717), INT32_C( 1056087921), -INT32_C( 2076061614), -INT32_C( 17981567), -INT32_C( 895307734), -INT32_C( 731082325), -INT32_C( 2053177763), -INT32_C( 851555015), + INT32_C( 1029297868), -INT32_C( 931443851), -INT32_C( 1655915236), -INT32_C( 2019804836), -INT32_C( 1789837591), INT32_C( 745127375), -INT32_C( 189724741), INT32_C( 566358101) } }, + { + { { INT32_C( 996023238), -INT32_C( 2113676698), -INT32_C( 215986025), INT32_C( 1937423497) }, + { -INT32_C( 922170374), INT32_C( 1140158856), -INT32_C( 851925128), INT32_C( 1575942551) }, + { INT32_C( 2073578772), -INT32_C( 1090675673), INT32_C( 1974541804), -INT32_C( 739758887) }, + { -INT32_C( 2137198345), -INT32_C( 624717215), -INT32_C( 794297543), INT32_C( 153982709) } }, + { INT32_C( 996023238), -INT32_C( 2113676698), -INT32_C( 215986025), INT32_C( 1937423497), -INT32_C( 922170374), INT32_C( 1140158856), -INT32_C( 851925128), INT32_C( 1575942551), + INT32_C( 2073578772), -INT32_C( 1090675673), INT32_C( 1974541804), -INT32_C( 739758887), -INT32_C( 2137198345), -INT32_C( 624717215), -INT32_C( 794297543), INT32_C( 153982709) } }, + { + { { INT32_C( 176473571), INT32_C( 1304986209), INT32_C( 2042853791), -INT32_C( 1655919707) }, + { -INT32_C( 48371300), -INT32_C( 1260920709), -INT32_C( 779845668), -INT32_C( 119885547) }, + { -INT32_C( 670933130), -INT32_C( 2145006879), -INT32_C( 369498045), INT32_C( 814106260) }, + { -INT32_C( 1439849681), INT32_C( 1599997315), -INT32_C( 1724849532), INT32_C( 160500627) } }, + { INT32_C( 176473571), INT32_C( 1304986209), INT32_C( 2042853791), -INT32_C( 1655919707), -INT32_C( 48371300), -INT32_C( 1260920709), -INT32_C( 779845668), -INT32_C( 119885547), + -INT32_C( 670933130), -INT32_C( 2145006879), -INT32_C( 369498045), INT32_C( 814106260), -INT32_C( 1439849681), INT32_C( 1599997315), -INT32_C( 1724849532), INT32_C( 160500627) } }, + { + { { INT32_C( 1273074538), -INT32_C( 1597307043), -INT32_C( 2088122897), INT32_C( 984813323) }, + { INT32_C( 920969650), INT32_C( 1788166886), -INT32_C( 1224489436), INT32_C( 1002476753) }, + { -INT32_C( 2071551449), -INT32_C( 1742450263), INT32_C( 555527702), INT32_C( 1885065149) }, + { -INT32_C( 1767489616), -INT32_C( 1526711423), -INT32_C( 765721855), -INT32_C( 1106436713) } }, + { INT32_C( 1273074538), -INT32_C( 1597307043), -INT32_C( 2088122897), INT32_C( 984813323), INT32_C( 920969650), INT32_C( 1788166886), -INT32_C( 1224489436), INT32_C( 1002476753), + -INT32_C( 2071551449), -INT32_C( 1742450263), INT32_C( 555527702), INT32_C( 1885065149), -INT32_C( 1767489616), -INT32_C( 1526711423), -INT32_C( 765721855), -INT32_C( 1106436713) } }, + { + { { INT32_C( 1749193663), -INT32_C( 83859483), -INT32_C( 769844203), -INT32_C( 1673365268) }, + { INT32_C( 959703224), INT32_C( 635384612), -INT32_C( 822592713), INT32_C( 395117912) }, + { INT32_C( 2122305433), INT32_C( 1266253878), -INT32_C( 2011261284), -INT32_C( 953851889) }, + { INT32_C( 1828739145), -INT32_C( 1030561909), INT32_C( 1938917915), INT32_C( 696983184) } }, + { INT32_C( 1749193663), -INT32_C( 83859483), -INT32_C( 769844203), -INT32_C( 1673365268), INT32_C( 959703224), INT32_C( 635384612), -INT32_C( 822592713), INT32_C( 395117912), + INT32_C( 2122305433), INT32_C( 1266253878), -INT32_C( 2011261284), -INT32_C( 953851889), INT32_C( 1828739145), -INT32_C( 1030561909), INT32_C( 1938917915), INT32_C( 696983184) } }, + { + { { INT32_C( 614927085), INT32_C( 661594250), -INT32_C( 961573449), INT32_C( 932041966) }, + { -INT32_C( 1197175508), -INT32_C( 2005256595), INT32_C( 1375407041), INT32_C( 393905705) }, + { INT32_C( 456860049), -INT32_C( 129848767), INT32_C( 650048056), -INT32_C( 211989562) }, + { INT32_C( 1185612249), -INT32_C( 120707785), INT32_C( 1514785073), -INT32_C( 512638128) } }, + { INT32_C( 614927085), INT32_C( 661594250), -INT32_C( 961573449), INT32_C( 932041966), -INT32_C( 1197175508), -INT32_C( 2005256595), INT32_C( 1375407041), INT32_C( 393905705), + INT32_C( 456860049), -INT32_C( 129848767), INT32_C( 650048056), -INT32_C( 211989562), INT32_C( 1185612249), -INT32_C( 120707785), INT32_C( 1514785073), -INT32_C( 512638128) } }, + { + { { INT32_C( 654093540), -INT32_C( 1893843113), -INT32_C( 139076303), INT32_C( 32117288) }, + { INT32_C( 1246205203), -INT32_C( 331147845), INT32_C( 793152735), INT32_C( 873510992) }, + { -INT32_C( 1151726492), INT32_C( 2085255499), INT32_C( 2121596758), INT32_C( 612392465) }, + { -INT32_C( 1351628812), -INT32_C( 1130646819), -INT32_C( 1897144002), -INT32_C( 20710503) } }, + { INT32_C( 654093540), -INT32_C( 1893843113), -INT32_C( 139076303), INT32_C( 32117288), INT32_C( 1246205203), -INT32_C( 331147845), INT32_C( 793152735), INT32_C( 873510992), + -INT32_C( 1151726492), INT32_C( 2085255499), INT32_C( 2121596758), INT32_C( 612392465), -INT32_C( 1351628812), -INT32_C( 1130646819), -INT32_C( 1897144002), -INT32_C( 20710503) } }, + { + { { INT32_C( 1404640519), -INT32_C( 321977194), INT32_C( 359351043), -INT32_C( 1774589022) }, + { -INT32_C( 1891260238), -INT32_C( 1723080614), INT32_C( 1529296577), INT32_C( 962193969) }, + { -INT32_C( 1634987512), INT32_C( 445340438), INT32_C( 1093662367), -INT32_C( 1814599455) }, + { INT32_C( 1797463057), -INT32_C( 1123782916), -INT32_C( 703058779), INT32_C( 504328470) } }, + { INT32_C( 1404640519), -INT32_C( 321977194), INT32_C( 359351043), -INT32_C( 1774589022), -INT32_C( 1891260238), -INT32_C( 1723080614), INT32_C( 1529296577), INT32_C( 962193969), + -INT32_C( 1634987512), INT32_C( 445340438), INT32_C( 1093662367), -INT32_C( 1814599455), INT32_C( 1797463057), -INT32_C( 1123782916), -INT32_C( 703058779), INT32_C( 504328470) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_int32x4x4_t r_ = { { simde_vld1q_s32(test_vec[i].r[0]), + simde_vld1q_s32(test_vec[i].r[1]), + simde_vld1q_s32(test_vec[i].r[2]), + simde_vld1q_s32(test_vec[i].r[3]) } }; + + SIMDE_ALIGN_TO_16 int32_t a_[16]; + simde_vst1q_s32_x4(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_int32x4_t a = simde_test_arm_neon_random_i32x4(); + simde_int32x4_t b = simde_test_arm_neon_random_i32x4(); + simde_int32x4_t c = simde_test_arm_neon_random_i32x4(); + simde_int32x4_t d = simde_test_arm_neon_random_i32x4(); + simde_int32x4x4_t e = {{a, b, c, d}}; + + simde_test_arm_neon_write_i32x4x4(2, e, SIMDE_TEST_VEC_POS_FIRST); + + int32_t buf[16]; + simde_vst1q_s32_x4(buf, e); + + simde_test_codegen_write_vi32(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1q_s64_x4 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + int64_t r[4][2]; + int64_t a[8]; + } test_vec[] = { + { + { { -INT64_C( 7587359243922203772), INT64_C( 6751650433356784446) }, + { -INT64_C( 1620225745646725686), -INT64_C( 7985217434275570439) }, + { INT64_C( 8212278956811676522), INT64_C( 5074785455737720516) }, + { -INT64_C( 340707856987966184), INT64_C( 4524773829981701164) } }, + { -INT64_C( 7587359243922203772), INT64_C( 6751650433356784446), -INT64_C( 1620225745646725686), -INT64_C( 7985217434275570439), + INT64_C( 8212278956811676522), INT64_C( 5074785455737720516), -INT64_C( 340707856987966184), INT64_C( 4524773829981701164) } }, + { + { { -INT64_C( 7221355051344726236), -INT64_C( 5609206282383042459) }, + { -INT64_C( 1059379705422138034), -INT64_C( 5446552274779613352) }, + { INT64_C( 387260780414437868), INT64_C( 8176302869321288491) }, + { INT64_C( 3673546250696951365), INT64_C( 552191352224163173) } }, + { -INT64_C( 7221355051344726236), -INT64_C( 5609206282383042459), -INT64_C( 1059379705422138034), -INT64_C( 5446552274779613352), + INT64_C( 387260780414437868), INT64_C( 8176302869321288491), INT64_C( 3673546250696951365), INT64_C( 552191352224163173) } }, + { + { { -INT64_C( 5587511901970254640), -INT64_C( 5563089661754647242) }, + { INT64_C( 36793624674733430), INT64_C( 8574746655498559452) }, + { INT64_C( 3137703776386206290), INT64_C( 7554877375872565945) }, + { INT64_C( 2844087260506789085), INT64_C( 6716588930086432025) } }, + { -INT64_C( 5587511901970254640), -INT64_C( 5563089661754647242), INT64_C( 36793624674733430), INT64_C( 8574746655498559452), + INT64_C( 3137703776386206290), INT64_C( 7554877375872565945), INT64_C( 2844087260506789085), INT64_C( 6716588930086432025) } }, + { + { { INT64_C( 3605625705850084840), -INT64_C( 4963757481209065789) }, + { INT64_C( 2969749085465335236), INT64_C( 6665362027892528408) }, + { INT64_C( 4316492949278602812), INT64_C( 3705352466291769298) }, + { INT64_C( 7141716476213501923), INT64_C( 7034067520315655630) } }, + { INT64_C( 3605625705850084840), -INT64_C( 4963757481209065789), INT64_C( 2969749085465335236), INT64_C( 6665362027892528408), + INT64_C( 4316492949278602812), INT64_C( 3705352466291769298), INT64_C( 7141716476213501923), INT64_C( 7034067520315655630) } }, + { + { { -INT64_C( 1337289696520775490), INT64_C( 5971784580663763261) }, + { INT64_C( 7662982092711863209), -INT64_C( 6562788202939359386) }, + { INT64_C( 4479755619265020450), INT64_C( 9038104134752651691) }, + { INT64_C( 8860208931980554990), INT64_C( 1023427538657321384) } }, + { -INT64_C( 1337289696520775490), INT64_C( 5971784580663763261), INT64_C( 7662982092711863209), -INT64_C( 6562788202939359386), + INT64_C( 4479755619265020450), INT64_C( 9038104134752651691), INT64_C( 8860208931980554990), INT64_C( 1023427538657321384) } }, + { + { { INT64_C( 230378854400396788), -INT64_C( 2913112175757353663) }, + { INT64_C( 8488255937031832381), -INT64_C( 5191743531432750600) }, + { -INT64_C( 458840806809452731), -INT64_C( 8665875339453480965) }, + { INT64_C( 7919198918600629923), INT64_C( 7561619787648002678) } }, + { INT64_C( 230378854400396788), -INT64_C( 2913112175757353663), INT64_C( 8488255937031832381), -INT64_C( 5191743531432750600), + -INT64_C( 458840806809452731), -INT64_C( 8665875339453480965), INT64_C( 7919198918600629923), INT64_C( 7561619787648002678) } }, + { + { { INT64_C( 8445839720126454916), -INT64_C( 8775520181752806555) }, + { INT64_C( 3104912765428895796), INT64_C( 3626054855436888263) }, + { INT64_C( 7197213992634177521), -INT64_C( 8840765828378706970) }, + { -INT64_C( 1496809008778033574), -INT64_C( 1834047013502214227) } }, + { INT64_C( 8445839720126454916), -INT64_C( 8775520181752806555), INT64_C( 3104912765428895796), INT64_C( 3626054855436888263), + INT64_C( 7197213992634177521), -INT64_C( 8840765828378706970), -INT64_C( 1496809008778033574), -INT64_C( 1834047013502214227) } }, + { + { { -INT64_C( 8944092108469110146), -INT64_C( 7546735286549679250) }, + { INT64_C( 7201784351542375138), INT64_C( 7735859168682100352) }, + { INT64_C( 5649423650787994949), INT64_C( 3571162429139038907) }, + { -INT64_C( 7647912519495371325), INT64_C( 3118292933704063982) } }, + { -INT64_C( 8944092108469110146), -INT64_C( 7546735286549679250), INT64_C( 7201784351542375138), INT64_C( 7735859168682100352), + INT64_C( 5649423650787994949), INT64_C( 3571162429139038907), -INT64_C( 7647912519495371325), INT64_C( 3118292933704063982) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_int64x2x4_t r_ = { { simde_vld1q_s64(test_vec[i].r[0]), + simde_vld1q_s64(test_vec[i].r[1]), + simde_vld1q_s64(test_vec[i].r[2]), + simde_vld1q_s64(test_vec[i].r[3]) } }; + + SIMDE_ALIGN_TO_16 int64_t a_[8]; + simde_vst1q_s64_x4(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_int64x2_t a = simde_test_arm_neon_random_i64x2(); + simde_int64x2_t b = simde_test_arm_neon_random_i64x2(); + simde_int64x2_t c = simde_test_arm_neon_random_i64x2(); + simde_int64x2_t d = simde_test_arm_neon_random_i64x2(); + simde_int64x2x4_t e = {{a, b, c, d}}; + + simde_test_arm_neon_write_i64x2x4(2, e, SIMDE_TEST_VEC_POS_FIRST); + + int64_t buf[8]; + simde_vst1q_s64_x4(buf, e); + + simde_test_codegen_write_vi64(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1q_u8_x4 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + uint8_t r[4][16]; + uint8_t a[64]; + } test_vec[] = { + { + { { UINT8_C( 19), UINT8_C( 46), UINT8_C( 13), UINT8_C(244), UINT8_C(246), UINT8_C(115), UINT8_C( 66), UINT8_C(177), + UINT8_C( 38), UINT8_C( 80), UINT8_C(169), UINT8_C(116), UINT8_C(161), UINT8_C( 56), UINT8_C(165), UINT8_C(101) }, + { UINT8_C(109), UINT8_C(220), UINT8_C(223), UINT8_C(131), UINT8_C( 4), UINT8_C(188), UINT8_C( 24), UINT8_C(242), + UINT8_C( 88), UINT8_C( 35), UINT8_C(205), UINT8_C( 62), UINT8_C(137), UINT8_C( 20), UINT8_C(105), UINT8_C(156) }, + { UINT8_C( 66), UINT8_C(118), UINT8_C(144), UINT8_C( 57), UINT8_C(234), UINT8_C(211), UINT8_C(234), UINT8_C( 16), + UINT8_C( 35), UINT8_C(148), UINT8_C(132), UINT8_C(196), UINT8_C(204), UINT8_C( 42), UINT8_C( 41), UINT8_C( 58) }, + { UINT8_C( 6), UINT8_C( 8), UINT8_C(189), UINT8_C( 11), UINT8_C(197), UINT8_C(213), UINT8_C(253), UINT8_C( 29), + UINT8_C(248), UINT8_C(203), UINT8_C( 91), UINT8_C(129), UINT8_C(223), UINT8_C(196), UINT8_C( 30), UINT8_C( 33) } }, + { UINT8_C( 19), UINT8_C( 46), UINT8_C( 13), UINT8_C(244), UINT8_C(246), UINT8_C(115), UINT8_C( 66), UINT8_C(177), + UINT8_C( 38), UINT8_C( 80), UINT8_C(169), UINT8_C(116), UINT8_C(161), UINT8_C( 56), UINT8_C(165), UINT8_C(101), + UINT8_C(109), UINT8_C(220), UINT8_C(223), UINT8_C(131), UINT8_C( 4), UINT8_C(188), UINT8_C( 24), UINT8_C(242), + UINT8_C( 88), UINT8_C( 35), UINT8_C(205), UINT8_C( 62), UINT8_C(137), UINT8_C( 20), UINT8_C(105), UINT8_C(156), + UINT8_C( 66), UINT8_C(118), UINT8_C(144), UINT8_C( 57), UINT8_C(234), UINT8_C(211), UINT8_C(234), UINT8_C( 16), + UINT8_C( 35), UINT8_C(148), UINT8_C(132), UINT8_C(196), UINT8_C(204), UINT8_C( 42), UINT8_C( 41), UINT8_C( 58), + UINT8_C( 6), UINT8_C( 8), UINT8_C(189), UINT8_C( 11), UINT8_C(197), UINT8_C(213), UINT8_C(253), UINT8_C( 29), + UINT8_C(248), UINT8_C(203), UINT8_C( 91), UINT8_C(129), UINT8_C(223), UINT8_C(196), UINT8_C( 30), UINT8_C( 33) } }, + { + { { UINT8_C( 58), UINT8_C(174), UINT8_C( 90), UINT8_C( 36), UINT8_C(129), UINT8_C( 69), UINT8_C( 52), UINT8_C(164), + UINT8_C(217), UINT8_C(185), UINT8_C(105), UINT8_C(165), UINT8_C(227), UINT8_C(146), UINT8_C(223), UINT8_C(233) }, + { UINT8_C(155), UINT8_C(156), UINT8_C(244), UINT8_C( 96), UINT8_C(114), UINT8_C(242), UINT8_C(125), UINT8_C(106), + UINT8_C(189), UINT8_C(216), UINT8_C(236), UINT8_C(156), UINT8_C(156), UINT8_C( 10), UINT8_C(189), UINT8_C(214) }, + { UINT8_C(184), UINT8_C( 24), UINT8_C(251), UINT8_C( 58), UINT8_C( 93), UINT8_C( 47), UINT8_C(222), UINT8_C( 54), + UINT8_C(232), UINT8_C( 71), UINT8_C(219), UINT8_C(203), UINT8_C(218), UINT8_C(187), UINT8_C(181), UINT8_C(117) }, + { UINT8_C( 87), UINT8_C(169), UINT8_C(213), UINT8_C(201), UINT8_C(155), UINT8_C( 82), UINT8_C( 52), UINT8_C( 88), + UINT8_C( 42), UINT8_C( 32), UINT8_C(244), UINT8_C(198), UINT8_C( 42), UINT8_C(178), UINT8_C(156), UINT8_C(226) } }, + { UINT8_C( 58), UINT8_C(174), UINT8_C( 90), UINT8_C( 36), UINT8_C(129), UINT8_C( 69), UINT8_C( 52), UINT8_C(164), + UINT8_C(217), UINT8_C(185), UINT8_C(105), UINT8_C(165), UINT8_C(227), UINT8_C(146), UINT8_C(223), UINT8_C(233), + UINT8_C(155), UINT8_C(156), UINT8_C(244), UINT8_C( 96), UINT8_C(114), UINT8_C(242), UINT8_C(125), UINT8_C(106), + UINT8_C(189), UINT8_C(216), UINT8_C(236), UINT8_C(156), UINT8_C(156), UINT8_C( 10), UINT8_C(189), UINT8_C(214), + UINT8_C(184), UINT8_C( 24), UINT8_C(251), UINT8_C( 58), UINT8_C( 93), UINT8_C( 47), UINT8_C(222), UINT8_C( 54), + UINT8_C(232), UINT8_C( 71), UINT8_C(219), UINT8_C(203), UINT8_C(218), UINT8_C(187), UINT8_C(181), UINT8_C(117), + UINT8_C( 87), UINT8_C(169), UINT8_C(213), UINT8_C(201), UINT8_C(155), UINT8_C( 82), UINT8_C( 52), UINT8_C( 88), + UINT8_C( 42), UINT8_C( 32), UINT8_C(244), UINT8_C(198), UINT8_C( 42), UINT8_C(178), UINT8_C(156), UINT8_C(226) } }, + { + { { UINT8_C(202), UINT8_C(151), UINT8_C( 28), UINT8_C( 39), UINT8_C(199), UINT8_C(251), UINT8_C( 93), UINT8_C(175), + UINT8_C( 66), UINT8_C( 56), UINT8_C(123), UINT8_C( 28), UINT8_C(243), UINT8_C( 48), UINT8_C(145), UINT8_C( 75) }, + { UINT8_C(217), UINT8_C(102), UINT8_C( 20), UINT8_C(117), UINT8_C(184), UINT8_C( 72), UINT8_C(205), UINT8_C(226), + UINT8_C(104), UINT8_C(194), UINT8_C(168), UINT8_C(146), UINT8_C(116), UINT8_C( 69), UINT8_C(117), UINT8_C( 62) }, + { UINT8_C(220), UINT8_C(145), UINT8_C(101), UINT8_C(163), UINT8_C(140), UINT8_C(194), UINT8_C( 83), UINT8_C(207), + UINT8_C(250), UINT8_C(206), UINT8_C(235), UINT8_C(238), UINT8_C(254), UINT8_C(125), UINT8_C( 57), UINT8_C(215) }, + { UINT8_C(227), UINT8_C( 77), UINT8_C( 76), UINT8_C(156), UINT8_C(150), UINT8_C( 26), UINT8_C(126), UINT8_C(254), + UINT8_C(220), UINT8_C( 39), UINT8_C(145), UINT8_C( 80), UINT8_C(108), UINT8_C( 6), UINT8_C(142), UINT8_C( 72) } }, + { UINT8_C(202), UINT8_C(151), UINT8_C( 28), UINT8_C( 39), UINT8_C(199), UINT8_C(251), UINT8_C( 93), UINT8_C(175), + UINT8_C( 66), UINT8_C( 56), UINT8_C(123), UINT8_C( 28), UINT8_C(243), UINT8_C( 48), UINT8_C(145), UINT8_C( 75), + UINT8_C(217), UINT8_C(102), UINT8_C( 20), UINT8_C(117), UINT8_C(184), UINT8_C( 72), UINT8_C(205), UINT8_C(226), + UINT8_C(104), UINT8_C(194), UINT8_C(168), UINT8_C(146), UINT8_C(116), UINT8_C( 69), UINT8_C(117), UINT8_C( 62), + UINT8_C(220), UINT8_C(145), UINT8_C(101), UINT8_C(163), UINT8_C(140), UINT8_C(194), UINT8_C( 83), UINT8_C(207), + UINT8_C(250), UINT8_C(206), UINT8_C(235), UINT8_C(238), UINT8_C(254), UINT8_C(125), UINT8_C( 57), UINT8_C(215), + UINT8_C(227), UINT8_C( 77), UINT8_C( 76), UINT8_C(156), UINT8_C(150), UINT8_C( 26), UINT8_C(126), UINT8_C(254), + UINT8_C(220), UINT8_C( 39), UINT8_C(145), UINT8_C( 80), UINT8_C(108), UINT8_C( 6), UINT8_C(142), UINT8_C( 72) } }, + { + { { UINT8_C(151), UINT8_C(243), UINT8_C(236), UINT8_C( 36), UINT8_C(181), UINT8_C( 63), UINT8_C(243), UINT8_C(175), + UINT8_C( 13), UINT8_C(222), UINT8_C(157), UINT8_C( 11), UINT8_C( 91), UINT8_C(214), UINT8_C(226), UINT8_C( 63) }, + { UINT8_C( 36), UINT8_C( 47), UINT8_C(219), UINT8_C(186), UINT8_C( 73), UINT8_C( 89), UINT8_C(184), UINT8_C( 37), + UINT8_C(128), UINT8_C( 73), UINT8_C(117), UINT8_C(236), UINT8_C( 79), UINT8_C( 3), UINT8_C( 53), UINT8_C(231) }, + { UINT8_C(246), UINT8_C( 33), UINT8_C( 11), UINT8_C(171), UINT8_C( 96), UINT8_C(254), UINT8_C( 90), UINT8_C(109), + UINT8_C(220), UINT8_C(248), UINT8_C(120), UINT8_C( 56), UINT8_C(206), UINT8_C( 90), UINT8_C(119), UINT8_C(242) }, + { UINT8_C(137), UINT8_C( 82), UINT8_C(172), UINT8_C(210), UINT8_C(171), UINT8_C(101), UINT8_C(247), UINT8_C( 44), + UINT8_C(174), UINT8_C(108), UINT8_C( 24), UINT8_C(254), UINT8_C(111), UINT8_C( 77), UINT8_C(229), UINT8_C(101) } }, + { UINT8_C(151), UINT8_C(243), UINT8_C(236), UINT8_C( 36), UINT8_C(181), UINT8_C( 63), UINT8_C(243), UINT8_C(175), + UINT8_C( 13), UINT8_C(222), UINT8_C(157), UINT8_C( 11), UINT8_C( 91), UINT8_C(214), UINT8_C(226), UINT8_C( 63), + UINT8_C( 36), UINT8_C( 47), UINT8_C(219), UINT8_C(186), UINT8_C( 73), UINT8_C( 89), UINT8_C(184), UINT8_C( 37), + UINT8_C(128), UINT8_C( 73), UINT8_C(117), UINT8_C(236), UINT8_C( 79), UINT8_C( 3), UINT8_C( 53), UINT8_C(231), + UINT8_C(246), UINT8_C( 33), UINT8_C( 11), UINT8_C(171), UINT8_C( 96), UINT8_C(254), UINT8_C( 90), UINT8_C(109), + UINT8_C(220), UINT8_C(248), UINT8_C(120), UINT8_C( 56), UINT8_C(206), UINT8_C( 90), UINT8_C(119), UINT8_C(242), + UINT8_C(137), UINT8_C( 82), UINT8_C(172), UINT8_C(210), UINT8_C(171), UINT8_C(101), UINT8_C(247), UINT8_C( 44), + UINT8_C(174), UINT8_C(108), UINT8_C( 24), UINT8_C(254), UINT8_C(111), UINT8_C( 77), UINT8_C(229), UINT8_C(101) } }, + { + { { UINT8_C(110), UINT8_C(240), UINT8_C( 16), UINT8_C(206), UINT8_C(238), UINT8_C(107), UINT8_C( 59), UINT8_C(202), + UINT8_C( 99), UINT8_C(179), UINT8_C( 2), UINT8_C( 49), UINT8_C( 14), UINT8_C(121), UINT8_C( 36), UINT8_C(151) }, + { UINT8_C(203), UINT8_C(208), UINT8_C(106), UINT8_C(119), UINT8_C( 53), UINT8_C( 97), UINT8_C(163), UINT8_C(228), + UINT8_C(206), UINT8_C(187), UINT8_C(226), UINT8_C( 61), UINT8_C( 9), UINT8_C(199), UINT8_C(163), UINT8_C(119) }, + { UINT8_C(183), UINT8_C(179), UINT8_C( 70), UINT8_C(165), UINT8_C( 30), UINT8_C(129), UINT8_C(111), UINT8_C(129), + UINT8_C( 53), UINT8_C(114), UINT8_C(179), UINT8_C( 67), UINT8_C(235), UINT8_C(215), UINT8_C(218), UINT8_C(183) }, + { UINT8_C(167), UINT8_C( 68), UINT8_C( 46), UINT8_C(221), UINT8_C(166), UINT8_C(209), UINT8_C(193), UINT8_C(116), + UINT8_C(140), UINT8_C(163), UINT8_C(177), UINT8_C(149), UINT8_C(106), UINT8_C( 84), UINT8_C( 13), UINT8_C( 33) } }, + { UINT8_C(110), UINT8_C(240), UINT8_C( 16), UINT8_C(206), UINT8_C(238), UINT8_C(107), UINT8_C( 59), UINT8_C(202), + UINT8_C( 99), UINT8_C(179), UINT8_C( 2), UINT8_C( 49), UINT8_C( 14), UINT8_C(121), UINT8_C( 36), UINT8_C(151), + UINT8_C(203), UINT8_C(208), UINT8_C(106), UINT8_C(119), UINT8_C( 53), UINT8_C( 97), UINT8_C(163), UINT8_C(228), + UINT8_C(206), UINT8_C(187), UINT8_C(226), UINT8_C( 61), UINT8_C( 9), UINT8_C(199), UINT8_C(163), UINT8_C(119), + UINT8_C(183), UINT8_C(179), UINT8_C( 70), UINT8_C(165), UINT8_C( 30), UINT8_C(129), UINT8_C(111), UINT8_C(129), + UINT8_C( 53), UINT8_C(114), UINT8_C(179), UINT8_C( 67), UINT8_C(235), UINT8_C(215), UINT8_C(218), UINT8_C(183), + UINT8_C(167), UINT8_C( 68), UINT8_C( 46), UINT8_C(221), UINT8_C(166), UINT8_C(209), UINT8_C(193), UINT8_C(116), + UINT8_C(140), UINT8_C(163), UINT8_C(177), UINT8_C(149), UINT8_C(106), UINT8_C( 84), UINT8_C( 13), UINT8_C( 33) } }, + { + { { UINT8_C( 8), UINT8_C( 83), UINT8_C(198), UINT8_C( 38), UINT8_C(212), UINT8_C( 53), UINT8_C(168), UINT8_C( 9), + UINT8_C(167), UINT8_C( 91), UINT8_C( 76), UINT8_C(147), UINT8_C( 50), UINT8_C( 39), UINT8_C( 74), UINT8_C(217) }, + { UINT8_C(107), UINT8_C(120), UINT8_C(182), UINT8_C( 17), UINT8_C( 73), UINT8_C(119), UINT8_C(133), UINT8_C(213), + UINT8_C( 26), UINT8_C( 55), UINT8_C(107), UINT8_C(132), UINT8_C(139), UINT8_C(120), UINT8_C(165), UINT8_C(147) }, + { UINT8_C(203), UINT8_C(107), UINT8_C(186), UINT8_C(159), UINT8_C(161), UINT8_C( 98), UINT8_C(169), UINT8_C( 72), + UINT8_C(189), UINT8_C(245), UINT8_C(219), UINT8_C(239), UINT8_C( 28), UINT8_C( 37), UINT8_C(200), UINT8_C(136) }, + { UINT8_C(157), UINT8_C(127), UINT8_C(153), UINT8_C(230), UINT8_C(246), UINT8_C( 31), UINT8_C(188), UINT8_C( 17), + UINT8_C( 86), UINT8_C( 39), UINT8_C(149), UINT8_C(225), UINT8_C(159), UINT8_C( 59), UINT8_C(117), UINT8_C(106) } }, + { UINT8_C( 8), UINT8_C( 83), UINT8_C(198), UINT8_C( 38), UINT8_C(212), UINT8_C( 53), UINT8_C(168), UINT8_C( 9), + UINT8_C(167), UINT8_C( 91), UINT8_C( 76), UINT8_C(147), UINT8_C( 50), UINT8_C( 39), UINT8_C( 74), UINT8_C(217), + UINT8_C(107), UINT8_C(120), UINT8_C(182), UINT8_C( 17), UINT8_C( 73), UINT8_C(119), UINT8_C(133), UINT8_C(213), + UINT8_C( 26), UINT8_C( 55), UINT8_C(107), UINT8_C(132), UINT8_C(139), UINT8_C(120), UINT8_C(165), UINT8_C(147), + UINT8_C(203), UINT8_C(107), UINT8_C(186), UINT8_C(159), UINT8_C(161), UINT8_C( 98), UINT8_C(169), UINT8_C( 72), + UINT8_C(189), UINT8_C(245), UINT8_C(219), UINT8_C(239), UINT8_C( 28), UINT8_C( 37), UINT8_C(200), UINT8_C(136), + UINT8_C(157), UINT8_C(127), UINT8_C(153), UINT8_C(230), UINT8_C(246), UINT8_C( 31), UINT8_C(188), UINT8_C( 17), + UINT8_C( 86), UINT8_C( 39), UINT8_C(149), UINT8_C(225), UINT8_C(159), UINT8_C( 59), UINT8_C(117), UINT8_C(106) } }, + { + { { UINT8_C(166), UINT8_C( 47), UINT8_C( 9), UINT8_C( 71), UINT8_C(145), UINT8_C(178), UINT8_C(144), UINT8_C( 78), + UINT8_C(168), UINT8_C(107), UINT8_C( 61), UINT8_C(196), UINT8_C(145), UINT8_C( 5), UINT8_C( 76), UINT8_C( 46) }, + { UINT8_C(132), UINT8_C(230), UINT8_C( 21), UINT8_C(123), UINT8_C( 5), UINT8_C(209), UINT8_C(140), UINT8_C( 91), + UINT8_C(248), UINT8_C( 33), UINT8_C( 60), UINT8_C(151), UINT8_C( 92), UINT8_C(177), UINT8_C( 1), UINT8_C( 3) }, + { UINT8_C(224), UINT8_C( 10), UINT8_C( 74), UINT8_C(113), UINT8_C(189), UINT8_C(218), UINT8_C(191), UINT8_C(101), + UINT8_C( 70), UINT8_C(252), UINT8_C( 41), UINT8_C(215), UINT8_C( 2), UINT8_C(118), UINT8_C( 5), UINT8_C(134) }, + { UINT8_C( 92), UINT8_C( 26), UINT8_C( 1), UINT8_C( 97), UINT8_C(235), UINT8_C(141), UINT8_C(188), UINT8_C(227), + UINT8_C(175), UINT8_C(248), UINT8_C(122), UINT8_C( 11), UINT8_C(170), UINT8_C(123), UINT8_C( 14), UINT8_C(138) } }, + { UINT8_C(166), UINT8_C( 47), UINT8_C( 9), UINT8_C( 71), UINT8_C(145), UINT8_C(178), UINT8_C(144), UINT8_C( 78), + UINT8_C(168), UINT8_C(107), UINT8_C( 61), UINT8_C(196), UINT8_C(145), UINT8_C( 5), UINT8_C( 76), UINT8_C( 46), + UINT8_C(132), UINT8_C(230), UINT8_C( 21), UINT8_C(123), UINT8_C( 5), UINT8_C(209), UINT8_C(140), UINT8_C( 91), + UINT8_C(248), UINT8_C( 33), UINT8_C( 60), UINT8_C(151), UINT8_C( 92), UINT8_C(177), UINT8_C( 1), UINT8_C( 3), + UINT8_C(224), UINT8_C( 10), UINT8_C( 74), UINT8_C(113), UINT8_C(189), UINT8_C(218), UINT8_C(191), UINT8_C(101), + UINT8_C( 70), UINT8_C(252), UINT8_C( 41), UINT8_C(215), UINT8_C( 2), UINT8_C(118), UINT8_C( 5), UINT8_C(134), + UINT8_C( 92), UINT8_C( 26), UINT8_C( 1), UINT8_C( 97), UINT8_C(235), UINT8_C(141), UINT8_C(188), UINT8_C(227), + UINT8_C(175), UINT8_C(248), UINT8_C(122), UINT8_C( 11), UINT8_C(170), UINT8_C(123), UINT8_C( 14), UINT8_C(138) } }, + { + { { UINT8_C(134), UINT8_C( 89), UINT8_C(252), UINT8_C( 67), UINT8_C( 51), UINT8_C(187), UINT8_C(168), UINT8_C(121), + UINT8_C(184), UINT8_C(209), UINT8_C( 80), UINT8_C(186), UINT8_C( 71), UINT8_C( 86), UINT8_C( 64), UINT8_C(163) }, + { UINT8_C(112), UINT8_C( 66), UINT8_C( 4), UINT8_C( 92), UINT8_C(207), UINT8_C(192), UINT8_C( 63), UINT8_C(126), + UINT8_C(185), UINT8_C(186), UINT8_C(138), UINT8_C( 99), UINT8_C( 53), UINT8_C(152), UINT8_C(237), UINT8_C(187) }, + { UINT8_C(241), UINT8_C(233), UINT8_C(254), UINT8_C( 37), UINT8_C(165), UINT8_C(166), UINT8_C(158), UINT8_C( 93), + UINT8_C(120), UINT8_C(239), UINT8_C( 23), UINT8_C(191), UINT8_C( 69), UINT8_C( 87), UINT8_C( 99), UINT8_C(181) }, + { UINT8_C(153), UINT8_C(103), UINT8_C( 17), UINT8_C(105), UINT8_C( 40), UINT8_C( 81), UINT8_C(231), UINT8_C(225), + UINT8_C( 11), UINT8_C(113), UINT8_C( 68), UINT8_C( 64), UINT8_C( 10), UINT8_C( 49), UINT8_C(252), UINT8_C(251) } }, + { UINT8_C(134), UINT8_C( 89), UINT8_C(252), UINT8_C( 67), UINT8_C( 51), UINT8_C(187), UINT8_C(168), UINT8_C(121), + UINT8_C(184), UINT8_C(209), UINT8_C( 80), UINT8_C(186), UINT8_C( 71), UINT8_C( 86), UINT8_C( 64), UINT8_C(163), + UINT8_C(112), UINT8_C( 66), UINT8_C( 4), UINT8_C( 92), UINT8_C(207), UINT8_C(192), UINT8_C( 63), UINT8_C(126), + UINT8_C(185), UINT8_C(186), UINT8_C(138), UINT8_C( 99), UINT8_C( 53), UINT8_C(152), UINT8_C(237), UINT8_C(187), + UINT8_C(241), UINT8_C(233), UINT8_C(254), UINT8_C( 37), UINT8_C(165), UINT8_C(166), UINT8_C(158), UINT8_C( 93), + UINT8_C(120), UINT8_C(239), UINT8_C( 23), UINT8_C(191), UINT8_C( 69), UINT8_C( 87), UINT8_C( 99), UINT8_C(181), + UINT8_C(153), UINT8_C(103), UINT8_C( 17), UINT8_C(105), UINT8_C( 40), UINT8_C( 81), UINT8_C(231), UINT8_C(225), + UINT8_C( 11), UINT8_C(113), UINT8_C( 68), UINT8_C( 64), UINT8_C( 10), UINT8_C( 49), UINT8_C(252), UINT8_C(251) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_uint8x16x4_t r_ = { { simde_vld1q_u8(test_vec[i].r[0]), + simde_vld1q_u8(test_vec[i].r[1]), + simde_vld1q_u8(test_vec[i].r[2]), + simde_vld1q_u8(test_vec[i].r[3]) } }; + + SIMDE_ALIGN_TO_16 uint8_t a_[64]; + simde_vst1q_u8_x4(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_uint8x16_t a = simde_test_arm_neon_random_u8x16(); + simde_uint8x16_t b = simde_test_arm_neon_random_u8x16(); + simde_uint8x16_t c = simde_test_arm_neon_random_u8x16(); + simde_uint8x16_t d = simde_test_arm_neon_random_u8x16(); + simde_uint8x16x4_t e = {{a, b, c, d}}; + + simde_test_arm_neon_write_u8x16x4(2, e, SIMDE_TEST_VEC_POS_FIRST); + + uint8_t buf[64]; + simde_vst1q_u8_x4(buf, e); + + simde_test_codegen_write_vu8(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1q_u16_x4 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + uint16_t r[4][8]; + uint16_t a[32]; + } test_vec[] = { + { + { { UINT16_C(64027), UINT16_C(49184), UINT16_C(49057), UINT16_C( 6429), UINT16_C(13486), UINT16_C(62424), UINT16_C(15243), UINT16_C( 9640) }, + { UINT16_C(47779), UINT16_C(52110), UINT16_C(29963), UINT16_C( 5804), UINT16_C(61671), UINT16_C(61782), UINT16_C(21025), UINT16_C(15596) }, + { UINT16_C( 3405), UINT16_C(61180), UINT16_C( 6604), UINT16_C(31239), UINT16_C(57165), UINT16_C(55661), UINT16_C( 5403), UINT16_C(48894) }, + { UINT16_C(36047), UINT16_C(55945), UINT16_C(13569), UINT16_C(59632), UINT16_C(18213), UINT16_C(18137), UINT16_C(50841), UINT16_C(59011) } }, + { UINT16_C(64027), UINT16_C(49184), UINT16_C(49057), UINT16_C( 6429), UINT16_C(13486), UINT16_C(62424), UINT16_C(15243), UINT16_C( 9640), + UINT16_C(47779), UINT16_C(52110), UINT16_C(29963), UINT16_C( 5804), UINT16_C(61671), UINT16_C(61782), UINT16_C(21025), UINT16_C(15596), + UINT16_C( 3405), UINT16_C(61180), UINT16_C( 6604), UINT16_C(31239), UINT16_C(57165), UINT16_C(55661), UINT16_C( 5403), UINT16_C(48894), + UINT16_C(36047), UINT16_C(55945), UINT16_C(13569), UINT16_C(59632), UINT16_C(18213), UINT16_C(18137), UINT16_C(50841), UINT16_C(59011) } }, + { + { { UINT16_C(32723), UINT16_C(40916), UINT16_C(56217), UINT16_C(58905), UINT16_C(34491), UINT16_C(54975), UINT16_C(48539), UINT16_C(27540) }, + { UINT16_C( 7497), UINT16_C(19269), UINT16_C(13906), UINT16_C(30515), UINT16_C( 3453), UINT16_C( 5821), UINT16_C(16595), UINT16_C(42749) }, + { UINT16_C(53696), UINT16_C(22853), UINT16_C(24237), UINT16_C(26687), UINT16_C(65508), UINT16_C(32574), UINT16_C(53948), UINT16_C( 1770) }, + { UINT16_C(12527), UINT16_C(16721), UINT16_C(33894), UINT16_C(58296), UINT16_C(30097), UINT16_C(25849), UINT16_C(63158), UINT16_C(30218) } }, + { UINT16_C(32723), UINT16_C(40916), UINT16_C(56217), UINT16_C(58905), UINT16_C(34491), UINT16_C(54975), UINT16_C(48539), UINT16_C(27540), + UINT16_C( 7497), UINT16_C(19269), UINT16_C(13906), UINT16_C(30515), UINT16_C( 3453), UINT16_C( 5821), UINT16_C(16595), UINT16_C(42749), + UINT16_C(53696), UINT16_C(22853), UINT16_C(24237), UINT16_C(26687), UINT16_C(65508), UINT16_C(32574), UINT16_C(53948), UINT16_C( 1770), + UINT16_C(12527), UINT16_C(16721), UINT16_C(33894), UINT16_C(58296), UINT16_C(30097), UINT16_C(25849), UINT16_C(63158), UINT16_C(30218) } }, + { + { { UINT16_C(20424), UINT16_C(30159), UINT16_C( 3757), UINT16_C(37341), UINT16_C( 6925), UINT16_C(51729), UINT16_C(64493), UINT16_C(56528) }, + { UINT16_C( 8491), UINT16_C(37149), UINT16_C(54693), UINT16_C(14196), UINT16_C(28234), UINT16_C( 155), UINT16_C(42596), UINT16_C(11382) }, + { UINT16_C(17909), UINT16_C(41889), UINT16_C(32340), UINT16_C(24884), UINT16_C(17817), UINT16_C(34347), UINT16_C(64321), UINT16_C(27746) }, + { UINT16_C(32540), UINT16_C(49918), UINT16_C(29268), UINT16_C(40953), UINT16_C(38112), UINT16_C(17823), UINT16_C( 5690), UINT16_C(12401) } }, + { UINT16_C(20424), UINT16_C(30159), UINT16_C( 3757), UINT16_C(37341), UINT16_C( 6925), UINT16_C(51729), UINT16_C(64493), UINT16_C(56528), + UINT16_C( 8491), UINT16_C(37149), UINT16_C(54693), UINT16_C(14196), UINT16_C(28234), UINT16_C( 155), UINT16_C(42596), UINT16_C(11382), + UINT16_C(17909), UINT16_C(41889), UINT16_C(32340), UINT16_C(24884), UINT16_C(17817), UINT16_C(34347), UINT16_C(64321), UINT16_C(27746), + UINT16_C(32540), UINT16_C(49918), UINT16_C(29268), UINT16_C(40953), UINT16_C(38112), UINT16_C(17823), UINT16_C( 5690), UINT16_C(12401) } }, + { + { { UINT16_C( 4955), UINT16_C(45011), UINT16_C( 1937), UINT16_C(11025), UINT16_C(15437), UINT16_C(36529), UINT16_C( 5176), UINT16_C(21754) }, + { UINT16_C(63635), UINT16_C(59414), UINT16_C( 3947), UINT16_C(19335), UINT16_C( 9892), UINT16_C(56976), UINT16_C( 572), UINT16_C(38926) }, + { UINT16_C(57621), UINT16_C(42567), UINT16_C(22761), UINT16_C(14033), UINT16_C(33685), UINT16_C(52676), UINT16_C(48791), UINT16_C(10785) }, + { UINT16_C(14519), UINT16_C( 8722), UINT16_C(39239), UINT16_C(60269), UINT16_C(65216), UINT16_C(64714), UINT16_C(55296), UINT16_C( 5524) } }, + { UINT16_C( 4955), UINT16_C(45011), UINT16_C( 1937), UINT16_C(11025), UINT16_C(15437), UINT16_C(36529), UINT16_C( 5176), UINT16_C(21754), + UINT16_C(63635), UINT16_C(59414), UINT16_C( 3947), UINT16_C(19335), UINT16_C( 9892), UINT16_C(56976), UINT16_C( 572), UINT16_C(38926), + UINT16_C(57621), UINT16_C(42567), UINT16_C(22761), UINT16_C(14033), UINT16_C(33685), UINT16_C(52676), UINT16_C(48791), UINT16_C(10785), + UINT16_C(14519), UINT16_C( 8722), UINT16_C(39239), UINT16_C(60269), UINT16_C(65216), UINT16_C(64714), UINT16_C(55296), UINT16_C( 5524) } }, + { + { { UINT16_C(56506), UINT16_C(41915), UINT16_C(36148), UINT16_C(51673), UINT16_C(40208), UINT16_C(42902), UINT16_C(47195), UINT16_C( 4817) }, + { UINT16_C(58608), UINT16_C(14132), UINT16_C(41597), UINT16_C(15651), UINT16_C(60832), UINT16_C(41018), UINT16_C(52933), UINT16_C(32693) }, + { UINT16_C(28842), UINT16_C(57122), UINT16_C(64509), UINT16_C( 3496), UINT16_C(16280), UINT16_C(62644), UINT16_C(34551), UINT16_C(59142) }, + { UINT16_C(15210), UINT16_C(59166), UINT16_C(16861), UINT16_C(32037), UINT16_C(24366), UINT16_C(62493), UINT16_C(53805), UINT16_C(55411) } }, + { UINT16_C(56506), UINT16_C(41915), UINT16_C(36148), UINT16_C(51673), UINT16_C(40208), UINT16_C(42902), UINT16_C(47195), UINT16_C( 4817), + UINT16_C(58608), UINT16_C(14132), UINT16_C(41597), UINT16_C(15651), UINT16_C(60832), UINT16_C(41018), UINT16_C(52933), UINT16_C(32693), + UINT16_C(28842), UINT16_C(57122), UINT16_C(64509), UINT16_C( 3496), UINT16_C(16280), UINT16_C(62644), UINT16_C(34551), UINT16_C(59142), + UINT16_C(15210), UINT16_C(59166), UINT16_C(16861), UINT16_C(32037), UINT16_C(24366), UINT16_C(62493), UINT16_C(53805), UINT16_C(55411) } }, + { + { { UINT16_C(38466), UINT16_C(16567), UINT16_C(24465), UINT16_C(10829), UINT16_C( 670), UINT16_C(38174), UINT16_C( 9352), UINT16_C(62076) }, + { UINT16_C(39775), UINT16_C(15577), UINT16_C(65244), UINT16_C( 3001), UINT16_C(54877), UINT16_C(35839), UINT16_C(29352), UINT16_C(60259) }, + { UINT16_C( 6664), UINT16_C(39467), UINT16_C(30841), UINT16_C( 6340), UINT16_C(57978), UINT16_C( 685), UINT16_C(10758), UINT16_C(26356) }, + { UINT16_C(52933), UINT16_C(41378), UINT16_C(23756), UINT16_C(10924), UINT16_C(43826), UINT16_C(56245), UINT16_C( 6174), UINT16_C( 9926) } }, + { UINT16_C(38466), UINT16_C(16567), UINT16_C(24465), UINT16_C(10829), UINT16_C( 670), UINT16_C(38174), UINT16_C( 9352), UINT16_C(62076), + UINT16_C(39775), UINT16_C(15577), UINT16_C(65244), UINT16_C( 3001), UINT16_C(54877), UINT16_C(35839), UINT16_C(29352), UINT16_C(60259), + UINT16_C( 6664), UINT16_C(39467), UINT16_C(30841), UINT16_C( 6340), UINT16_C(57978), UINT16_C( 685), UINT16_C(10758), UINT16_C(26356), + UINT16_C(52933), UINT16_C(41378), UINT16_C(23756), UINT16_C(10924), UINT16_C(43826), UINT16_C(56245), UINT16_C( 6174), UINT16_C( 9926) } }, + { + { { UINT16_C(61746), UINT16_C(43968), UINT16_C(33897), UINT16_C(58563), UINT16_C(29030), UINT16_C(28134), UINT16_C(56219), UINT16_C(24787) }, + { UINT16_C(30121), UINT16_C(29953), UINT16_C(44753), UINT16_C( 1183), UINT16_C(21593), UINT16_C(30687), UINT16_C(42348), UINT16_C(40606) }, + { UINT16_C(24214), UINT16_C(65354), UINT16_C( 3555), UINT16_C(18915), UINT16_C(51838), UINT16_C( 6582), UINT16_C(35237), UINT16_C(20089) }, + { UINT16_C(31743), UINT16_C(53443), UINT16_C(25385), UINT16_C(33492), UINT16_C(46007), UINT16_C( 9466), UINT16_C(39000), UINT16_C(61122) } }, + { UINT16_C(61746), UINT16_C(43968), UINT16_C(33897), UINT16_C(58563), UINT16_C(29030), UINT16_C(28134), UINT16_C(56219), UINT16_C(24787), + UINT16_C(30121), UINT16_C(29953), UINT16_C(44753), UINT16_C( 1183), UINT16_C(21593), UINT16_C(30687), UINT16_C(42348), UINT16_C(40606), + UINT16_C(24214), UINT16_C(65354), UINT16_C( 3555), UINT16_C(18915), UINT16_C(51838), UINT16_C( 6582), UINT16_C(35237), UINT16_C(20089), + UINT16_C(31743), UINT16_C(53443), UINT16_C(25385), UINT16_C(33492), UINT16_C(46007), UINT16_C( 9466), UINT16_C(39000), UINT16_C(61122) } }, + { + { { UINT16_C( 3318), UINT16_C(55790), UINT16_C(53530), UINT16_C(38947), UINT16_C(55707), UINT16_C(16562), UINT16_C(11107), UINT16_C(25230) }, + { UINT16_C(21158), UINT16_C(53042), UINT16_C( 1973), UINT16_C(27730), UINT16_C(19642), UINT16_C( 5008), UINT16_C(21476), UINT16_C(55809) }, + { UINT16_C(61279), UINT16_C(31156), UINT16_C(55233), UINT16_C(23570), UINT16_C(50352), UINT16_C( 5021), UINT16_C(11247), UINT16_C(38517) }, + { UINT16_C(43133), UINT16_C(12901), UINT16_C(47023), UINT16_C(27039), UINT16_C(12035), UINT16_C(59260), UINT16_C(32386), UINT16_C(58050) } }, + { UINT16_C( 3318), UINT16_C(55790), UINT16_C(53530), UINT16_C(38947), UINT16_C(55707), UINT16_C(16562), UINT16_C(11107), UINT16_C(25230), + UINT16_C(21158), UINT16_C(53042), UINT16_C( 1973), UINT16_C(27730), UINT16_C(19642), UINT16_C( 5008), UINT16_C(21476), UINT16_C(55809), + UINT16_C(61279), UINT16_C(31156), UINT16_C(55233), UINT16_C(23570), UINT16_C(50352), UINT16_C( 5021), UINT16_C(11247), UINT16_C(38517), + UINT16_C(43133), UINT16_C(12901), UINT16_C(47023), UINT16_C(27039), UINT16_C(12035), UINT16_C(59260), UINT16_C(32386), UINT16_C(58050) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_uint16x8x4_t r_ = { { simde_vld1q_u16(test_vec[i].r[0]), + simde_vld1q_u16(test_vec[i].r[1]), + simde_vld1q_u16(test_vec[i].r[2]), + simde_vld1q_u16(test_vec[i].r[3]) } }; + + SIMDE_ALIGN_TO_16 uint16_t a_[32]; + simde_vst1q_u16_x4(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_uint16x8_t a = simde_test_arm_neon_random_u16x8(); + simde_uint16x8_t b = simde_test_arm_neon_random_u16x8(); + simde_uint16x8_t c = simde_test_arm_neon_random_u16x8(); + simde_uint16x8_t d = simde_test_arm_neon_random_u16x8(); + simde_uint16x8x4_t e = {{a, b, c, d}}; + + simde_test_arm_neon_write_u16x8x4(2, e, SIMDE_TEST_VEC_POS_FIRST); + + uint16_t buf[32]; + simde_vst1q_u16_x4(buf, e); + + simde_test_codegen_write_vu16(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1q_u32_x4 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + uint32_t r[4][4]; + uint32_t a[16]; + } test_vec[] = { + { + { { UINT32_C( 777746029), UINT32_C(4253773133), UINT32_C( 554772529), UINT32_C(3518465619) }, + { UINT32_C(3707968558), UINT32_C(3611796180), UINT32_C(1421853650), UINT32_C(2939584833) }, + { UINT32_C(1155371767), UINT32_C( 826370303), UINT32_C(3830600336), UINT32_C( 129305049) }, + { UINT32_C(4192581669), UINT32_C( 768683099), UINT32_C( 830574831), UINT32_C( 148944913) } }, + { UINT32_C( 777746029), UINT32_C(4253773133), UINT32_C( 554772529), UINT32_C(3518465619), UINT32_C(3707968558), UINT32_C(3611796180), UINT32_C(1421853650), UINT32_C(2939584833), + UINT32_C(1155371767), UINT32_C( 826370303), UINT32_C(3830600336), UINT32_C( 129305049), UINT32_C(4192581669), UINT32_C( 768683099), UINT32_C( 830574831), UINT32_C( 148944913) } }, + { + { { UINT32_C(1229765962), UINT32_C(3061484838), UINT32_C(3113929952), UINT32_C(4223684565) }, + { UINT32_C(1676977416), UINT32_C(3247490513), UINT32_C(1727140181), UINT32_C( 326030025) }, + { UINT32_C(3042818703), UINT32_C( 678221640), UINT32_C(2044790436), UINT32_C(1584701782) }, + { UINT32_C( 415328583), UINT32_C(2228834606), UINT32_C( 753584994), UINT32_C( 759126429) } }, + { UINT32_C(1229765962), UINT32_C(3061484838), UINT32_C(3113929952), UINT32_C(4223684565), UINT32_C(1676977416), UINT32_C(3247490513), UINT32_C(1727140181), UINT32_C( 326030025), + UINT32_C(3042818703), UINT32_C( 678221640), UINT32_C(2044790436), UINT32_C(1584701782), UINT32_C( 415328583), UINT32_C(2228834606), UINT32_C( 753584994), UINT32_C( 759126429) } }, + { + { { UINT32_C(1541577747), UINT32_C( 411258484), UINT32_C(2878432341), UINT32_C(1292436998) }, + { UINT32_C(2640693871), UINT32_C(2099330843), UINT32_C(2829650954), UINT32_C(2027284837) }, + { UINT32_C(4191467397), UINT32_C(1527863046), UINT32_C(3255215036), UINT32_C( 403640233) }, + { UINT32_C(4105532633), UINT32_C(3195131827), UINT32_C(1214651363), UINT32_C(2311076612) } }, + { UINT32_C(1541577747), UINT32_C( 411258484), UINT32_C(2878432341), UINT32_C(1292436998), UINT32_C(2640693871), UINT32_C(2099330843), UINT32_C(2829650954), UINT32_C(2027284837), + UINT32_C(4191467397), UINT32_C(1527863046), UINT32_C(3255215036), UINT32_C( 403640233), UINT32_C(4105532633), UINT32_C(3195131827), UINT32_C(1214651363), UINT32_C(2311076612) } }, + { + { { UINT32_C(4169372914), UINT32_C(2824049900), UINT32_C(3765066039), UINT32_C(1106803048) }, + { UINT32_C(2704649965), UINT32_C(1751099269), UINT32_C(3333473730), UINT32_C(4065292288) }, + { UINT32_C(4058763781), UINT32_C(2660843111), UINT32_C( 8323992), UINT32_C(1765963644) }, + { UINT32_C(2852812581), UINT32_C(3759302942), UINT32_C( 782680622), UINT32_C( 941749811) } }, + { UINT32_C(4169372914), UINT32_C(2824049900), UINT32_C(3765066039), UINT32_C(1106803048), UINT32_C(2704649965), UINT32_C(1751099269), UINT32_C(3333473730), UINT32_C(4065292288), + UINT32_C(4058763781), UINT32_C(2660843111), UINT32_C( 8323992), UINT32_C(1765963644), UINT32_C(2852812581), UINT32_C(3759302942), UINT32_C( 782680622), UINT32_C( 941749811) } }, + { + { { UINT32_C( 791219400), UINT32_C(3805200970), UINT32_C(1105415621), UINT32_C(3937019332) }, + { UINT32_C(3147085212), UINT32_C(1302046494), UINT32_C(2625323625), UINT32_C( 13933624) }, + { UINT32_C(4080074152), UINT32_C(2228616895), UINT32_C( 264616011), UINT32_C(2063167709) }, + { UINT32_C(1127583269), UINT32_C(2660290613), UINT32_C(1245383698), UINT32_C(1363873704) } }, + { UINT32_C( 791219400), UINT32_C(3805200970), UINT32_C(1105415621), UINT32_C(3937019332), UINT32_C(3147085212), UINT32_C(1302046494), UINT32_C(2625323625), UINT32_C( 13933624), + UINT32_C(4080074152), UINT32_C(2228616895), UINT32_C( 264616011), UINT32_C(2063167709), UINT32_C(1127583269), UINT32_C(2660290613), UINT32_C(1245383698), UINT32_C(1363873704) } }, + { + { { UINT32_C(3427040013), UINT32_C(3293649273), UINT32_C(2949846738), UINT32_C(2871643526) }, + { UINT32_C(2431606363), UINT32_C(1093566255), UINT32_C( 881617291), UINT32_C(2256918393) }, + { UINT32_C(3411200338), UINT32_C(3029312482), UINT32_C(1080320698), UINT32_C(2330758447) }, + { UINT32_C( 454745068), UINT32_C(3864807770), UINT32_C( 723183794), UINT32_C( 296853439) } }, + { UINT32_C(3427040013), UINT32_C(3293649273), UINT32_C(2949846738), UINT32_C(2871643526), UINT32_C(2431606363), UINT32_C(1093566255), UINT32_C( 881617291), UINT32_C(2256918393), + UINT32_C(3411200338), UINT32_C(3029312482), UINT32_C(1080320698), UINT32_C(2330758447), UINT32_C( 454745068), UINT32_C(3864807770), UINT32_C( 723183794), UINT32_C( 296853439) } }, + { + { { UINT32_C(1255933032), UINT32_C(1644129191), UINT32_C(4255278030), UINT32_C(3699937008) }, + { UINT32_C(3287786089), UINT32_C(2661897451), UINT32_C(4241081148), UINT32_C(3389881186) }, + { UINT32_C( 638970495), UINT32_C( 596120661), UINT32_C(1730226807), UINT32_C( 558148024) }, + { UINT32_C( 937704267), UINT32_C(3436547727), UINT32_C(3033046609), UINT32_C(2558448921) } }, + { UINT32_C(1255933032), UINT32_C(1644129191), UINT32_C(4255278030), UINT32_C(3699937008), UINT32_C(3287786089), UINT32_C(2661897451), UINT32_C(4241081148), UINT32_C(3389881186), + UINT32_C( 638970495), UINT32_C( 596120661), UINT32_C(1730226807), UINT32_C( 558148024), UINT32_C( 937704267), UINT32_C(3436547727), UINT32_C(3033046609), UINT32_C(2558448921) } }, + { + { { UINT32_C( 364876735), UINT32_C( 507004839), UINT32_C( 696670577), UINT32_C(1313524226) }, + { UINT32_C(2508533253), UINT32_C( 241261244), UINT32_C( 314714616), UINT32_C(3198828798) }, + { UINT32_C(2077452756), UINT32_C( 563743664), UINT32_C(1732911205), UINT32_C(4021654762) }, + { UINT32_C(2139372227), UINT32_C(2374886804), UINT32_C( 228544270), UINT32_C(1691044240) } }, + { UINT32_C( 364876735), UINT32_C( 507004839), UINT32_C( 696670577), UINT32_C(1313524226), UINT32_C(2508533253), UINT32_C( 241261244), UINT32_C( 314714616), UINT32_C(3198828798), + UINT32_C(2077452756), UINT32_C( 563743664), UINT32_C(1732911205), UINT32_C(4021654762), UINT32_C(2139372227), UINT32_C(2374886804), UINT32_C( 228544270), UINT32_C(1691044240) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_uint32x4x4_t r_ = { { simde_vld1q_u32(test_vec[i].r[0]), + simde_vld1q_u32(test_vec[i].r[1]), + simde_vld1q_u32(test_vec[i].r[2]), + simde_vld1q_u32(test_vec[i].r[3]) } }; + + SIMDE_ALIGN_TO_16 uint32_t a_[16]; + simde_vst1q_u32_x4(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_uint32x4_t a = simde_test_arm_neon_random_u32x4(); + simde_uint32x4_t b = simde_test_arm_neon_random_u32x4(); + simde_uint32x4_t c = simde_test_arm_neon_random_u32x4(); + simde_uint32x4_t d = simde_test_arm_neon_random_u32x4(); + simde_uint32x4x4_t e = {{a, b, c, d}}; + + simde_test_arm_neon_write_u32x4x4(2, e, SIMDE_TEST_VEC_POS_FIRST); + + uint32_t buf[16]; + simde_vst1q_u32_x4(buf, e); + + simde_test_codegen_write_vu32(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +static int +test_simde_vst1q_u64_x4 (SIMDE_MUNIT_TEST_ARGS) { +#if 1 + static const struct { + uint64_t r[4][2]; + uint64_t a[8]; + } test_vec[] = { + { + { { UINT64_C( 1046376256865541811), UINT64_C( 2842663500503240601) }, + { UINT64_C(16971591848766666598), UINT64_C( 2555726199694829187) }, + { UINT64_C( 7645154830612584289), UINT64_C( 2406717408223793115) }, + { UINT64_C(14132475126852815960), UINT64_C( 4493554335490709961) } }, + { UINT64_C( 1046376256865541811), UINT64_C( 2842663500503240601), UINT64_C(16971591848766666598), UINT64_C( 2555726199694829187), + UINT64_C( 7645154830612584289), UINT64_C( 2406717408223793115), UINT64_C(14132475126852815960), UINT64_C( 4493554335490709961) } }, + { + { { UINT64_C(14546735572732994470), UINT64_C( 9713822593035325170) }, + { UINT64_C( 6232942906307242363), UINT64_C( 5480859472757741557) }, + { UINT64_C(12504142917155313871), UINT64_C( 8729710001764601713) }, + { UINT64_C(12895130359564656913), UINT64_C( 4538946107388232459) } }, + { UINT64_C(14546735572732994470), UINT64_C( 9713822593035325170), UINT64_C( 6232942906307242363), UINT64_C( 5480859472757741557), + UINT64_C(12504142917155313871), UINT64_C( 8729710001764601713), UINT64_C(12895130359564656913), UINT64_C( 4538946107388232459) } }, + { + { { UINT64_C(15227940699794882540), UINT64_C(16684035439248780818) }, + { UINT64_C( 9073197930772807290), UINT64_C(17197886891449282301) }, + { UINT64_C( 4332719209429968874), UINT64_C(12057497588678366103) }, + { UINT64_C( 5801702103418133140), UINT64_C(14350835507703689528) } }, + { UINT64_C(15227940699794882540), UINT64_C(16684035439248780818), UINT64_C( 9073197930772807290), UINT64_C(17197886891449282301), + UINT64_C( 4332719209429968874), UINT64_C(12057497588678366103), UINT64_C( 5801702103418133140), UINT64_C(14350835507703689528) } }, + { + { { UINT64_C( 4428503697115626767), UINT64_C( 3286500290285191880) }, + { UINT64_C( 8970246061242481368), UINT64_C(12685759034636515689) }, + { UINT64_C( 2125240893948108955), UINT64_C(18440179056110544929) }, + { UINT64_C( 4388660888373763111), UINT64_C( 1599778953768377825) } }, + { UINT64_C( 4428503697115626767), UINT64_C( 3286500290285191880), UINT64_C( 8970246061242481368), UINT64_C(12685759034636515689), + UINT64_C( 2125240893948108955), UINT64_C(18440179056110544929), UINT64_C( 4388660888373763111), UINT64_C( 1599778953768377825) } }, + { + { { UINT64_C(11322565662516649135), UINT64_C( 514325010070319869) }, + { UINT64_C(15450542955734126171), UINT64_C( 3137193081579367927) }, + { UINT64_C(13024780340553572776), UINT64_C(12928140562377742466) }, + { UINT64_C( 3248588696812968777), UINT64_C(11736989735680241211) } }, + { UINT64_C(11322565662516649135), UINT64_C( 514325010070319869), UINT64_C(15450542955734126171), UINT64_C( 3137193081579367927), + UINT64_C(13024780340553572776), UINT64_C(12928140562377742466), UINT64_C( 3248588696812968777), UINT64_C(11736989735680241211) } }, + { + { { UINT64_C(16462212866855276810), UINT64_C(10496676084454935968) }, + { UINT64_C( 1724285869131533962), UINT64_C(13974583565284773202) }, + { UINT64_C(15927251924173370819), UINT64_C( 9808137389960678980) }, + { UINT64_C( 2522637916975983630), UINT64_C( 4988123076260581826) } }, + { UINT64_C(16462212866855276810), UINT64_C(10496676084454935968), UINT64_C( 1724285869131533962), UINT64_C(13974583565284773202), + UINT64_C(15927251924173370819), UINT64_C( 9808137389960678980), UINT64_C( 2522637916975983630), UINT64_C( 4988123076260581826) } }, + { + { { UINT64_C(17739242092454656788), UINT64_C(10540287370387915713) }, + { UINT64_C( 9619829281127239308), UINT64_C( 7212575619215716432) }, + { UINT64_C(13086586356635108083), UINT64_C( 5403961929900498663) }, + { UINT64_C( 5373401260314032969), UINT64_C(13459909942359920664) } }, + { UINT64_C(17739242092454656788), UINT64_C(10540287370387915713), UINT64_C( 9619829281127239308), UINT64_C( 7212575619215716432), + UINT64_C(13086586356635108083), UINT64_C( 5403961929900498663), UINT64_C( 5373401260314032969), UINT64_C(13459909942359920664) } }, + { + { { UINT64_C( 5503676258243871158), UINT64_C(15574211190333166618) }, + { UINT64_C( 681581696812108081), UINT64_C( 8973489082100388102) }, + { UINT64_C(18405799240516757693), UINT64_C( 991912169708136028) }, + { UINT64_C( 2719520097385883843), UINT64_C( 2846692134771437119) } }, + { UINT64_C( 5503676258243871158), UINT64_C(15574211190333166618), UINT64_C( 681581696812108081), UINT64_C( 8973489082100388102), + UINT64_C(18405799240516757693), UINT64_C( 991912169708136028), UINT64_C( 2719520097385883843), UINT64_C( 2846692134771437119) } }, + }; + + for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { + simde_uint64x2x4_t r_ = { { simde_vld1q_u64(test_vec[i].r[0]), + simde_vld1q_u64(test_vec[i].r[1]), + simde_vld1q_u64(test_vec[i].r[2]), + simde_vld1q_u64(test_vec[i].r[3]) } }; + + SIMDE_ALIGN_TO_16 uint64_t a_[8]; + simde_vst1q_u64_x4(a_, r_); + + simde_assert_equal_i(0, simde_memcmp(a_, test_vec[i].a, sizeof(test_vec[i].a))); + } + + return 0; +#else + for (int i = 0 ; i < 8 ; i++) { + simde_uint64x2_t a = simde_test_arm_neon_random_u64x2(); + simde_uint64x2_t b = simde_test_arm_neon_random_u64x2(); + simde_uint64x2_t c = simde_test_arm_neon_random_u64x2(); + simde_uint64x2_t d = simde_test_arm_neon_random_u64x2(); + simde_uint64x2x4_t e = {{a, b, c, d}}; + + simde_test_arm_neon_write_u64x2x4(2, e, SIMDE_TEST_VEC_POS_FIRST); + + uint64_t buf[8]; + simde_vst1q_u64_x4(buf, e); + + simde_test_codegen_write_vu64(2, sizeof(buf) / sizeof(buf[0]), buf, + SIMDE_TEST_VEC_POS_LAST); + } + return 1; +#endif +} + +#endif /* !defined(SIMDE_BUG_INTEL_857088) */ + +SIMDE_TEST_FUNC_LIST_BEGIN +#if !defined(SIMDE_BUG_INTEL_857088) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1q_f32_x4) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1q_f64_x4) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1q_s8_x4) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1q_s16_x4) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1q_s32_x4) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1q_s64_x4) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1q_u8_x4) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1q_u16_x4) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1q_u32_x4) +SIMDE_TEST_FUNC_LIST_ENTRY(vst1q_u64_x4) +#endif /* !defined(SIMDE_BUG_INTEL_857088) */ +SIMDE_TEST_FUNC_LIST_END + +#include "test-neon-footer.h"