diff options
Diffstat (limited to 'vec_qpx_double4.h')
-rw-r--r-- | vec_qpx_double4.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/vec_qpx_double4.h b/vec_qpx_double4.h index 5bf830f..684c161 100644 --- a/vec_qpx_double4.h +++ b/vec_qpx_double4.h @@ -531,11 +531,16 @@ namespace vecmathlib { } real_t prod() const { - return (*this)[0] * (*this)[1] * (*this)[2] * (*this)[3]; + // return (*this)[0] * (*this)[1] * (*this)[2] * (*this)[3]; + realvec_t x = vec_xmul(v, v); + return x[1] * x[3]; } real_t sum() const { - return (*this)[0] + (*this)[1] + (*this)[2] + (*this)[3]; + // return (*this)[0] + (*this)[1] + (*this)[2] + (*this)[3]; + realvec_t c1 = vec_logical(v, v, 0b1111); + realvec_t x = vec_xxmadd(v, c1, v); + return x[0] + x[2]; } |