Commit 7c0c6139 authored by Jö Fahlke's avatar Jö Fahlke

Implement min()/max() seperately for masks.

This is needed for gcc 6.3, see
https://gitlab.dune-project.org/extensions/dune-vectorclass/-/jobs/80147
parent b164085d
Pipeline #16232 passed with stage
in 6 minutes and 6 seconds
......@@ -274,19 +274,35 @@ namespace Dune {
}
template<class Vec>
auto max(ADLTag<5, VectorclassImpl::IsVector<Vec>::value>,
auto max(ADLTag<5, VectorclassImpl::IsVector<Vec>::value &&
!VectorclassImpl::IsMask<Vec>::value>,
Vec v1, Vec v2)
{
return Simd::cond(v1 < v2, v2, v1);
}
template<class Vec>
auto min(ADLTag<5, VectorclassImpl::IsVector<Vec>::value>,
auto max(ADLTag<5, VectorclassImpl::IsMask<Vec>::value>,
Vec v1, Vec v2)
{
return v1 | v2;
}
template<class Vec>
auto min(ADLTag<5, VectorclassImpl::IsVector<Vec>::value &&
!VectorclassImpl::IsMask<Vec>::value>,
Vec v1, Vec v2)
{
return Simd::cond(v1 < v2, v1, v2);
}
template<class Vec>
auto min(ADLTag<5, VectorclassImpl::IsMask<Vec>::value>,
Vec v1, Vec v2)
{
return v1 & v2;
}
template<class M, typename = std::enable_if_t<VectorclassImpl::IsMask<M>::value>>
bool anyTrue(ADLTag<5>, M mask) {
return horizontal_or(mask);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment