From e4c1b3c1d2b28094117e5a19e6181b0c7e5c3be2 Mon Sep 17 00:00:00 2001 From: Christoph Hertzberg Date: Mon, 23 Sep 2019 16:07:43 +0200 Subject: Fix implicit conversion warnings and use pnegate to negate packets --- .../Eigen/src/SpecialFunctions/BesselFunctionsImpl.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'unsupported/Eigen/src') diff --git a/unsupported/Eigen/src/SpecialFunctions/BesselFunctionsImpl.h b/unsupported/Eigen/src/SpecialFunctions/BesselFunctionsImpl.h index c7c4f2649..6d7c8bf7e 100644 --- a/unsupported/Eigen/src/SpecialFunctions/BesselFunctionsImpl.h +++ b/unsupported/Eigen/src/SpecialFunctions/BesselFunctionsImpl.h @@ -311,7 +311,7 @@ struct generic_i1e { // [-8, 8] and evaluate a branch based off of that. It's possible // in practice most elements are in this region. y = pselect(pcmp_le(y, pset1(8.0f)), y_le_eight, y_gt_eight); - return pselect(pcmp_lt(x, pset1(0.0f)), -y, y); + return pselect(pcmp_lt(x, pset1(0.0f)), pnegate(y), y); } }; @@ -392,7 +392,7 @@ struct generic_i1e { // [-8, 8] and evaluate a branch based off of that. It's possible // in practice most elements are in this region. y = pselect(pcmp_le(y, pset1(8.0)), y_le_eight, y_gt_eight); - return pselect(pcmp_lt(x, pset1(0.0f)), -y, y); + return pselect(pcmp_lt(x, pset1(0.0)), pnegate(y), y); } }; @@ -491,8 +491,8 @@ struct generic_k0e { T x_le_two = internal::pchebevl::run( pmadd(x, x, pset1(-2.0)), A); x_le_two = pmadd( - generic_i0::run(x), pmul( - pset1(-1.0), plog(pmul(pset1(0.5), x))), x_le_two); + generic_i0::run(x), pnegate( + plog(pmul(pset1(0.5), x))), x_le_two); x_le_two = pmul(pexp(x), x_le_two); T x_gt_two = pmul( internal::pchebevl::run( @@ -663,8 +663,8 @@ struct generic_k0 { T x_le_two = internal::pchebevl::run( pmadd(x, x, pset1(-2.0)), A); x_le_two = pmadd( - generic_i0::run(x), pmul( - pset1(-1.0), plog(pmul(pset1(0.5), x))), x_le_two); + generic_i0::run(x), pnegate( + plog(pmul(pset1(0.5), x))), x_le_two); x_le_two = pselect(pcmp_le(x, pset1(0.0)), MAXNUM, x_le_two); T x_gt_two = pmul( pmul( @@ -741,8 +741,8 @@ struct generic_k0 { T x_le_two = internal::pchebevl::run( pmadd(x, x, pset1(-2.0)), A); x_le_two = pmadd( - generic_i0::run(x), pmul( - pset1(-1.0), plog(pmul(pset1(0.5), x))), x_le_two); + generic_i0::run(x), pnegate( + plog(pmul(pset1(0.5), x))), x_le_two); x_le_two = pselect(pcmp_le(x, pset1(0.0)), MAXNUM, x_le_two); T x_gt_two = pmul( pmul( @@ -1572,7 +1572,7 @@ struct generic_j1 { // j1 is an odd function. This implementation differs from cephes to // take this fact in to account. Cephes returns -j1(x) for y > 2 range. y_gt_two = pselect( - pcmp_lt(x, pset1(0.0f)), pmul(pset1(-1.0f), y_gt_two), y_gt_two); + pcmp_lt(x, pset1(0.0f)), pnegate(y_gt_two), y_gt_two); return pselect(pcmp_le(y, pset1(2.0f)), y_le_two, y_gt_two); } }; @@ -1660,7 +1660,7 @@ struct generic_j1 { // j1 is an odd function. This implementation differs from cephes to // take this fact in to account. Cephes returns -j1(x) for y > 5 range. y_gt_five = pselect( - pcmp_lt(x, pset1(0.0f)), pmul(pset1(-1.0), y_gt_five), y_gt_five); + pcmp_lt(x, pset1(0.0)), pnegate(y_gt_five), y_gt_five); return pselect(pcmp_le(y, pset1(5.0)), y_le_five, y_gt_five); } }; -- cgit v1.2.3