Skip to content

Commit

Permalink
add test implementation of setQnan for SimdArray
Browse files Browse the repository at this point in the history
this is one of the show-stoppers for the sqrt test, but there are still other strange errors.
  • Loading branch information
chr-engwer authored and mattkretz committed Dec 2, 2015
1 parent 95381b8 commit 7b207c8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions common/simdarray.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,9 @@ class alignas(
Vc_INTRINSIC void setZeroInverted() { data.setZeroInverted(); }
Vc_INTRINSIC void setZeroInverted(mask_type k) { data.setZeroInverted(internal_data(k)); }

Vc_INTRINSIC void setQnan() { data.setQnan(); }
Vc_INTRINSIC void setQnan(mask_type m) { data.setQnan(internal_data(m)); }

// internal: execute specified Operation
template <typename Op, typename... Args>
static Vc_INTRINSIC SimdArray fromOperation(Op op, Args &&... args)
Expand Down Expand Up @@ -614,6 +617,16 @@ class alignas(
data1.setZeroInverted(Split::hi(k));
}


Vc_INTRINSIC void setQnan() {
data0.setQnan();
data1.setQnan();
}
Vc_INTRINSIC void setQnan(const mask_type &m) {
data0.setQnan(Split::lo(m));
data1.setQnan(Split::hi(m));
}

// internal: execute specified Operation
template <typename Op, typename... Args>
static Vc_INTRINSIC SimdArray fromOperation(Op op, Args &&... args)
Expand Down
2 changes: 1 addition & 1 deletion tests/math.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ TEST_TYPES(Vec, testInf, (REAL_VECTORS)) //{{{1
VERIFY(none_of(Vc::isinf(nan)));
}

TEST_TYPES(Vec, testNaN, (REAL_VECTORS)) //{{{1
TEST_TYPES(Vec, testNaN, (REAL_VECTORS, SIMD_REAL_ARRAY_LIST)) //{{{1
{
typedef typename Vec::EntryType T;
typedef typename Vec::IndexType I;
Expand Down

0 comments on commit 7b207c8

Please sign in to comment.