Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/impl/vamp/vector/interface.hh
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,23 @@ namespace vamp
return D(apply<S::template max<0>>(d()->data, broadcast_scalar(other)));
}

template <typename T, typename allow_types<D>::template check<T> = true>
inline constexpr auto min(T o) const noexcept -> D
{
return min(o.data);
}

template <typename T, typename allow_types<DataT, typename S::VectorT>::template check<T> = true>
inline constexpr auto min(T other) const noexcept -> D
{
return D(apply<S::template min<0>>(d()->data, other));
}

inline constexpr auto min(typename S::ScalarT other) const noexcept -> D
{
return D(apply<S::template min<0>>(d()->data, broadcast_scalar(other)));
}

inline constexpr auto hsum() const noexcept -> typename S::ScalarT
{
return S::hsum(unpack::sum_(d()->data));
Expand Down
6 changes: 6 additions & 0 deletions src/impl/vamp/vector/isa/avx.hh
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,12 @@ namespace vamp
return _mm256_max_ps(v, other);
}

template <unsigned int = 0>
inline static constexpr auto min(VectorT v, VectorT other) noexcept -> VectorT
{
return _mm256_min_ps(v, other);
}

template <unsigned int = 0>
inline static constexpr auto hsum(VectorT v) noexcept -> ScalarT
{
Expand Down
6 changes: 6 additions & 0 deletions src/impl/vamp/vector/isa/neon.hh
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,12 @@ namespace vamp
return vmaxq_f32(v, other);
}

template <unsigned int = 0>
inline static constexpr auto min(VectorT v, VectorT other) noexcept -> VectorT
{
return vminq_f32(v, other);
}

template <unsigned int = 0>
inline static constexpr auto hsum(VectorT v) noexcept -> float
{
Expand Down
6 changes: 6 additions & 0 deletions src/impl/vamp/vector/isa/wasm.hh
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,12 @@ namespace vamp
return {wasm_f32x4_max(v.v, other.v)};
}

template <unsigned int = 0>
inline static constexpr auto min(VectorT v, VectorT other) noexcept -> VectorT
{
return {wasm_f32x4_min(v.v, other.v)};
}

template <unsigned int = 0>
inline static constexpr auto hsum(VectorT v) noexcept -> float
{
Expand Down
Loading