diff --git a/Vc/sse/mask.h b/Vc/sse/mask.h index 23c1ec2b1..42596a928 100644 --- a/Vc/sse/mask.h +++ b/Vc/sse/mask.h @@ -222,7 +222,7 @@ template class Mask friend reference; static Vc_INTRINSIC Vc_PURE value_type get(const Mask &m, int i) noexcept { - return MaskBool(m.d.m(i)); + return m.toInt() & (1 << i); } template static Vc_INTRINSIC void set(Mask &m, int i, diff --git a/tests/mask.cpp b/tests/mask.cpp index 0523c1c06..ca3f1e320 100644 --- a/tests/mask.cpp +++ b/tests/mask.cpp @@ -478,6 +478,17 @@ TEST_TYPES(V, testCompareOperators, AllVectors) /*{{{*/ VERIFY(!(k2 != k2)) << k << k2; } } + +TEST_TYPES(V, testMaskDefined, AllVectors) +{ + V a(1); + V b(2); + auto r = a < b; + auto s = a > b; + VERIFY(r[0] == true); + VERIFY(s[0] == false); +} + /*}}}*/ // vim: foldmethod=marker