diff options
author | Christoph Hertzberg <chtz@informatik.uni-bremen.de> | 2021-04-06 16:49:57 +0200 |
---|---|---|
committer | David Tellenbach <david.tellenbach@me.com> | 2021-04-07 11:25:27 +0000 |
commit | 6197ce1a3544f52e881a112ede9679d84fafebf3 (patch) | |
tree | fc070e2a3577d55d48b7718abe1a42797cd29666 /Eigen/src | |
parent | 22edb468236d19ed3f3d700ff37da342035e26d0 (diff) |
Replace `-2147483648` by `-0.0f` or `-0.0` constants (this should fix #2189).
Also, remove unnecessary `pgather` operations.
Diffstat (limited to 'Eigen/src')
-rw-r--r-- | Eigen/src/LU/arch/InverseSize4.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Eigen/src/LU/arch/InverseSize4.h b/Eigen/src/LU/arch/InverseSize4.h index df0fe0e7d..5a8d0c114 100644 --- a/Eigen/src/LU/arch/InverseSize4.h +++ b/Eigen/src/LU/arch/InverseSize4.h @@ -141,8 +141,8 @@ struct compute_inverse_size4<Architecture::Target, float, MatrixType, ResultType iC = psub(iC, pmul(vec4f_swizzle2(A, A, 1, 0, 3, 2), vec4f_swizzle2(DC, DC, 2, 1, 2, 1))); iC = psub(pmul(B, vec4f_duplane(dC, 0)), iC); - const int bits[4] = {0, -2147483648, -2147483648, 0}; - const Packet4f p4f_sign_PNNP = preinterpret<Packet4f, Packet4i>(pgather<int, Packet4i>(bits, static_cast<Eigen::Index>(1))); + const float sign_mask[4] = {0.0f, -0.0f, -0.0f, 0.0f}; + const Packet4f p4f_sign_PNNP = pset<Packet4f>(sign_mask); rd = pxor(rd, p4f_sign_PNNP); iA = pmul(iA, rd); iB = pmul(iB, rd); @@ -323,12 +323,12 @@ struct compute_inverse_size4<Architecture::Target, double, MatrixType, ResultTyp iC1 = psub(pmul(B1, dC), iC1); iC2 = psub(pmul(B2, dC), iC2); - const int bits1[4] = {0, -2147483648, 0, 0}; - const int bits2[4] = {0, 0, 0, -2147483648}; - const Packet2d _Sign_NP = preinterpret<Packet2d, Packet4i>(pgather<int, Packet4i>(bits1, static_cast<Eigen::Index>(1))); - const Packet2d _Sign_PN = preinterpret<Packet2d, Packet4i>(pgather<int, Packet4i>(bits2, static_cast<Eigen::Index>(1))); - d1 = pxor(rd, _Sign_PN); - d2 = pxor(rd, _Sign_NP); + const double sign_mask1[2] = {0.0, -0.0}; + const double sign_mask2[2] = {-0.0, 0.0}; + const Packet2d sign_PN = pset<Packet2d>(sign_mask1); + const Packet2d sign_NP = pset<Packet2d>(sign_mask2); + d1 = pxor(rd, sign_PN); + d2 = pxor(rd, sign_NP); Index res_stride = result.outerStride(); double *res = result.data(); |