Skip to content
Snippets Groups Projects
Commit 577e6594 authored by Sergey Gorbunov's avatar Sergey Gorbunov
Browse files

L1: SIMD vectors: remove IsNanAny()

parent 57a9e906
No related branches found
No related tags found
1 merge request!939L1: cleanup SIMD vectors
......@@ -64,7 +64,7 @@ namespace L1NaN
template<typename T, typename std::enable_if<std::is_same<T, fvec>::value, T>::type* = nullptr>
bool IsNaN(T value)
{
return IsNanAny(value); // NOTE: Here we consider fvec a NaN if at least one of its words is NaN
return isnan(value).isNotEmpty(); // NOTE: Here we consider fvec a NaN if at least one of its words is NaN
}
}; // namespace L1NaN
......
......@@ -189,6 +189,15 @@ public:
friend fmask operator>=(const fvec& a, const fvec& b) { _opComp(a, b, >=) }
friend fmask operator==(const fvec& a, const fvec& b) { _opComp(a, b, ==) }
friend fmask isnan(const fvec& a)
{
fmask m;
for (int i = 0; i < size(); i++) {
m[i] = std::isnan(a[i[);
}
return m;
}
friend fvec iif(fmask a, fvec b, fvec c)
{
fvec z;
......@@ -277,16 +286,6 @@ inline bool IsHorizontallyEqual(const fvec& v)
return ret;
}
/// Checks, if any of the bands is NaN
inline bool IsNanAny(const fvec& v)
{
bool ret = false;
for (int i = 0; i < fvec::size(); i++) {
ret = ret || std::isnan(v[i]);
}
return ret;
}
#include "std_alloc.h"
......
......@@ -39,16 +39,6 @@ inline bool IsHorizontallyEqual(const fvec& v)
return ret;
}
/// Checks, if any of the bands is NaN
inline bool IsNanAny(const fvec& v)
{
bool ret = false;
for (size_t i = 0; i < fvec::size(); i++) {
ret = ret || std::isnan(v[i]);
}
return ret;
}
#include "std_alloc.h"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment