Skip to content

Commit

Permalink
Implemented isnan through emulation
Browse files Browse the repository at this point in the history
  • Loading branch information
anutosh491 committed Oct 9, 2023
1 parent cc85cca commit 2cdc462
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions include/xsimd/arch/xsimd_wasm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,18 @@ namespace xsimd
return wasm_f64x2_gt(self, other);
}

// isnan
template <class A>
inline batch_bool<float, A> isnan(batch<float, A> const& self, requires_arch<wasm>) noexcept
{
return wasm_v128_or(wasm_f32x4_ne(self, self), wasm_f32x4_ne(self, self));
}
template <class A>
inline batch_bool<double, A> isnan(batch<double, A> const& self, requires_arch<wasm>) noexcept
{
return wasm_v128_or(wasm_f64x2_ne(self, self), wasm_f64x2_ne(self, self));
}

// le
template <class A>
inline batch_bool<float, A> le(batch<float, A> const& self, batch<float, A> const& other, requires_arch<wasm>) noexcept
Expand Down

0 comments on commit 2cdc462

Please sign in to comment.