Skip to content

Commit

Permalink
Added support for neq operation
Browse files Browse the repository at this point in the history
  • Loading branch information
anutosh491 committed Oct 11, 2023
1 parent ac009da commit 856e0c2
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions include/xsimd/arch/xsimd_wasm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,39 @@ namespace xsimd
return wasm_f64x2_mul(self, other);
}

// neq
template <class A>
inline batch_bool<float, A> neq(batch<float, A> const& self, batch<float, A> const& other, requires_arch<wasm>) noexcept
{
return wasm_f32x4_ne(self, other);
}
template <class A, class T, class = typename std::enable_if<std::is_integral<T>::value, void>::type>
inline batch_bool<T, A> neq(batch<T, A> const& self, batch<T, A> const& other, requires_arch<wasm>) noexcept
{
return ~(self == other);
}
template <class A>
inline batch_bool<float, A> neq(batch_bool<float, A> const& self, batch_bool<float, A> const& other, requires_arch<wasm>) noexcept
{
return wasm_f32x4_ne(self, other);
}
template <class A, class T, class = typename std::enable_if<std::is_integral<T>::value, void>::type>
inline batch_bool<T, A> neq(batch_bool<T, A> const& self, batch_bool<T, A> const& other, requires_arch<wasm>) noexcept
{
return ~(self == other);
}

template <class A>
inline batch_bool<double, A> neq(batch<double, A> const& self, batch<double, A> const& other, requires_arch<wasm>) noexcept
{
return wasm_f64x2_ne(self, other);
}
template <class A>
inline batch_bool<double, A> neq(batch_bool<double, A> const& self, batch_bool<double, A> const& other, requires_arch<wasm>) noexcept
{
return wasm_f64x2_ne(self, other);
}

// select
template <class A>
inline batch<float, A> select(batch_bool<float, A> const& cond, batch<float, A> const& true_br, batch<float, A> const& false_br, requires_arch<wasm>) noexcept
Expand Down

0 comments on commit 856e0c2

Please sign in to comment.