Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/xsimd/arch/xsimd_neon64.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1551,7 +1551,7 @@ namespace xsimd
/*********
* widen *
*********/
template <class A, class T>
template <class A>
XSIMD_INLINE std::array<batch<double, A>, 2> widen(batch<float, A> const& x, requires_arch<neon64>) noexcept
{
return { batch<double, A>(vcvt_f64_f32(vget_low_f32(x))), batch<double, A>(vcvt_high_f64_f32(x)) };
Expand Down
15 changes: 15 additions & 0 deletions include/xsimd/arch/xsimd_vsx.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <type_traits>

#include "../types/xsimd_vsx_register.hpp"
#include "./common/xsimd_common_cast.hpp"

#include <endian.h>

Expand Down Expand Up @@ -873,6 +874,20 @@ namespace xsimd
return vec_trunc(self.data);
}

// widen
template <class A>
XSIMD_INLINE std::array<batch<double, A>, 2> widen(batch<float, A> const& x, requires_arch<vsx>) noexcept
{
return { batch<double, A>(vec_doublel(x.data)), batch<double, A>(vec_doubleh(x.data)) };
}
template <class A, class T, class = typename std::enable_if<std::is_scalar<T>::value>::type>
XSIMD_INLINE std::array<batch<widen_t<T>, A>, 2> widen(batch<T, A> const& x, requires_arch<vsx>) 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<widen_t<T>, A>(vec_mergel(even, odd)), batch<widen_t<T>, A>(vec_mergeh(even, odd)) };
}

// zip_hi
template <class A, class T, class = typename std::enable_if<std::is_scalar<T>::value>::type>
XSIMD_INLINE batch<T, A> zip_hi(batch<T, A> const& self, batch<T, A> const& other, requires_arch<vsx>) noexcept
Expand Down
Loading