From 0d227d85b4180002a26e55123677b41d2469e9a7 Mon Sep 17 00:00:00 2001 From: serge-sans-paille Date: Sat, 1 Nov 2025 15:59:36 +0100 Subject: [PATCH 1/2] Fix widen implementation on arm64 --- include/xsimd/arch/xsimd_neon64.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/xsimd/arch/xsimd_neon64.hpp b/include/xsimd/arch/xsimd_neon64.hpp index 7cb531be9..565747446 100644 --- a/include/xsimd/arch/xsimd_neon64.hpp +++ b/include/xsimd/arch/xsimd_neon64.hpp @@ -1551,7 +1551,7 @@ namespace xsimd /********* * widen * *********/ - template + template XSIMD_INLINE std::array, 2> widen(batch const& x, requires_arch) noexcept { return { batch(vcvt_f64_f32(vget_low_f32(x))), batch(vcvt_high_f64_f32(x)) }; From a8ef17e15c0ab1ea902208a9c1a9c8411803a40f Mon Sep 17 00:00:00 2001 From: serge-sans-paille Date: Sat, 1 Nov 2025 12:22:08 +0100 Subject: [PATCH 2/2] Add support for xsimd::widen on PowerPC/VSX Related to #1179 --- include/xsimd/arch/xsimd_vsx.hpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/xsimd/arch/xsimd_vsx.hpp b/include/xsimd/arch/xsimd_vsx.hpp index 593346d4c..1ed91e0df 100644 --- a/include/xsimd/arch/xsimd_vsx.hpp +++ b/include/xsimd/arch/xsimd_vsx.hpp @@ -17,6 +17,7 @@ #include #include "../types/xsimd_vsx_register.hpp" +#include "./common/xsimd_common_cast.hpp" #include @@ -873,6 +874,20 @@ namespace xsimd return vec_trunc(self.data); } + // widen + template + XSIMD_INLINE std::array, 2> widen(batch const& x, requires_arch) noexcept + { + return { batch(vec_doublel(x.data)), batch(vec_doubleh(x.data)) }; + } + template ::value>::type> + XSIMD_INLINE std::array, A>, 2> widen(batch const& x, requires_arch) noexcept + { + auto even = vec_mule(x.data, vec_splats(T(1))); // x0, x2, x4, x6 + auto odd = vec_mulo(x.data, vec_splats(T(1))); // x1, x3, x5, x7 + return { batch, A>(vec_mergel(even, odd)), batch, A>(vec_mergeh(even, odd)) }; + } + // zip_hi template ::value>::type> XSIMD_INLINE batch zip_hi(batch const& self, batch const& other, requires_arch) noexcept