Skip to content

Commit

Permalink
Added support for rounding off operations
Browse files Browse the repository at this point in the history
  • Loading branch information
anutosh491 committed Oct 16, 2023
1 parent 31d1816 commit e70a5c3
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions include/xsimd/arch/xsimd_wasm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,18 @@ namespace xsimd
return wasm_f64x2_splat(val);
}

// ceil
template <class A>
inline batch<float, A> ceil(batch<float, A> const& self, requires_arch<wasm>) noexcept
{
return wasm_f32x4_ceil(self);
}
template <class A>
inline batch<double, A> ceil(batch<double, A> const& self, requires_arch<wasm>) noexcept
{
return wasm_f64x2_ceil(self);
}

// div
template <class A>
inline batch<float, A> div(batch<float, A> const& self, batch<float, A> const& other, requires_arch<wasm>) noexcept
Expand Down Expand Up @@ -403,6 +415,19 @@ namespace xsimd
return wasm_f64x2_eq(self, other);
}

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

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

// ge
template <class A>
inline batch_bool<float, A> ge(batch<float, A> const& self, batch<float, A> const& other, requires_arch<wasm>) noexcept
Expand Down Expand Up @@ -957,6 +982,18 @@ namespace xsimd
{
return wasm_f64x2_sqrt(val);
}

// trunc
template <class A>
inline batch<float, A> trunc(batch<float, A> const& self, requires_arch<wasm>) noexcept
{
return wasm_f32x4_trunc(self);
}
template <class A>
inline batch<double, A> trunc(batch<double, A> const& self, requires_arch<wasm>) noexcept
{
return wasm_f64x2_trunc(self);
}
}
}

Expand Down

0 comments on commit e70a5c3

Please sign in to comment.