diff options
-rw-r--r-- | vec_sse_double2.h | 10 | ||||
-rw-r--r-- | vec_sse_float4.h | 6 |
2 files changed, 4 insertions, 12 deletions
diff --git a/vec_sse_double2.h b/vec_sse_double2.h index cc107b2..2467c7f 100644 --- a/vec_sse_double2.h +++ b/vec_sse_double2.h @@ -108,24 +108,18 @@ namespace vecmathlib { bool all() const { - // return (*this)[0] && (*this)[1]; #if defined __AVX__ return ! (! *this).any(); #else - boolvec x = *this; - x = x && _mm_shuffle_pd(x.v, x.v, _MM_SHUFFLE2(0,1)); - return x[0]; + return (*this)[0] && (*this)[1]; #endif } bool any() const { - // return (*this)[0] || (*this)[1]; #if defined __AVX__ return ! _mm_testz_pd(v, v); #else - boolvec x = *this; - x = x || _mm_shuffle_pd(x.v, x.v, _MM_SHUFFLE2(0,1)); - return x[0]; + return (*this)[0] || (*this)[1]; #endif } diff --git a/vec_sse_float4.h b/vec_sse_float4.h index dc3ecb6..b514146 100644 --- a/vec_sse_float4.h +++ b/vec_sse_float4.h @@ -117,8 +117,7 @@ namespace vecmathlib { #else boolvec x = *this; x = x && _mm_shuffle_ps(x.v, x.v, _MM_SHUFFLE(1,0,3,2)); - x = x && _mm_shuffle_ps(x.v, x.v, _MM_SHUFFLE(2,3,0,1)); - return x[0]; + return x[0] && x[2]; #endif } bool any() const @@ -129,8 +128,7 @@ namespace vecmathlib { #else boolvec x = *this; x = x || _mm_shuffle_ps(x.v, x.v, _MM_SHUFFLE(1,0,3,2)); - x = x || _mm_shuffle_ps(x.v, x.v, _MM_SHUFFLE(2,3,0,1)); - return x[0]; + return x[0] || x[2]; #endif } |