Skip to content

Commit

Permalink
Added support for bitwise_andnot and bitwise_or
Browse files Browse the repository at this point in the history
  • Loading branch information
anutosh491 committed Oct 3, 2023
1 parent fb24126 commit ed18662
Showing 1 changed file with 81 additions and 0 deletions.
81 changes: 81 additions & 0 deletions include/xsimd/arch/xsimd_wasm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,87 @@ namespace xsimd
return wasm_v128_and(self, other);
}

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

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

// bitwise_andnot
template <class A>
inline batch<float, A> bitwise_andnot(batch<float, A> const& self, batch<float, A> const& other, requires_arch<wasm>) noexcept
{
return wasm_v128_andnot(other, self);
}

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

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

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

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

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

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

// broadcast
template <class A>
batch<float, A> inline broadcast(float val, requires_arch<wasm>) noexcept
Expand Down

0 comments on commit ed18662

Please sign in to comment.