Skip to content

Commit 29beb67

Browse files
Add support for xsimd::widen on WebAssembly
Related to #1179
1 parent f63bd07 commit 29beb67

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

include/xsimd/arch/xsimd_wasm.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1701,6 +1701,14 @@ namespace xsimd
17011701
return wasm_f64x2_trunc(self);
17021702
}
17031703

1704+
// widen
1705+
template <class A, class T>
1706+
XSIMD_INLINE std::array<batch<double, A>, 2> widen(batch<float, A> const& x, requires_arch<wasm>) noexcept
1707+
{
1708+
return { batch<double, A>(wasm_f64x2_promote_low_f32x4(x),
1709+
batch<double, A>(wasm_f64x2_promote_low_f32x4(wasm_i32x4_shuffle(x, x, 2, 3, 0, 1))) };
1710+
}
1711+
17041712
// zip_hi
17051713
template <class A>
17061714
XSIMD_INLINE batch<float, A> zip_hi(batch<float, A> const& self, batch<float, A> const& other, requires_arch<wasm>) noexcept

0 commit comments

Comments
 (0)