From 1e286464ab90417a60f885a498f98be36e97bf29 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Wed, 6 May 2009 08:43:38 +0000 Subject: * compilation fixes for gcc 3.3 * test Part::swap --- Eigen/src/Core/arch/SSE/MathFunctions.h | 44 ++++++++++++++++----------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'Eigen/src/Core/arch/SSE/MathFunctions.h') diff --git a/Eigen/src/Core/arch/SSE/MathFunctions.h b/Eigen/src/Core/arch/SSE/MathFunctions.h index 5675594df..4caff0dfb 100644 --- a/Eigen/src/Core/arch/SSE/MathFunctions.h +++ b/Eigen/src/Core/arch/SSE/MathFunctions.h @@ -41,7 +41,7 @@ static EIGEN_DONT_INLINE EIGEN_UNUSED Packet4f ei_plog(Packet4f x) /* the smallest non denormalized float number */ _EIGEN_DECLARE_CONST_Packet4f_FROM_INT(min_norm_pos, 0x00800000); - /* natural logarithm computed for 4 simultaneous float + /* natural logarithm computed for 4 simultaneous float return NaN for x <= 0 */ _EIGEN_DECLARE_CONST_Packet4f(cephes_SQRTHF, 0.707106781186547524f); @@ -72,7 +72,7 @@ static EIGEN_DONT_INLINE EIGEN_UNUSED Packet4f ei_plog(Packet4f x) emm0 = _mm_sub_epi32(emm0, ei_p4i_0x7f); Packet4f e = ei_padd(_mm_cvtepi32_ps(emm0), ei_p4f_1); - /* part2: + /* part2: if( x < SQRTHF ) { e -= 1; x = x + x - 1.0; @@ -86,7 +86,7 @@ static EIGEN_DONT_INLINE EIGEN_UNUSED Packet4f ei_plog(Packet4f x) Packet4f x2 = ei_pmul(x,x); Packet4f x3 = ei_pmul(x2,x); - + Packet4f y, y1, y2; y = ei_pmadd(ei_p4f_cephes_log_p0, x, ei_p4f_cephes_log_p1); y1 = ei_pmadd(ei_p4f_cephes_log_p3, x, ei_p4f_cephes_log_p4); @@ -97,7 +97,7 @@ static EIGEN_DONT_INLINE EIGEN_UNUSED Packet4f ei_plog(Packet4f x) y = ei_pmadd(y, x3, y1); y = ei_pmadd(y, x3, y2); y = ei_pmul(y, x3); - + y1 = ei_pmul(e, ei_p4f_cephes_log_q1); tmp = ei_pmul(x2, ei_p4f_half); y = ei_padd(y, y1); @@ -142,7 +142,7 @@ static EIGEN_DONT_INLINE EIGEN_UNUSED Packet4f ei_pexp(Packet4f x) emm0 = _mm_cvttps_epi32(fx); tmp = _mm_cvtepi32_ps(emm0); /* if greater, substract 1 */ - Packet4f mask = _mm_cmpgt_ps(tmp, fx); + Packet4f mask = _mm_cmpgt_ps(tmp, fx); mask = _mm_and_ps(mask, ei_p4f_1); fx = ei_psub(tmp, mask); @@ -152,7 +152,7 @@ static EIGEN_DONT_INLINE EIGEN_UNUSED Packet4f ei_pexp(Packet4f x) x = ei_psub(x, z); z = ei_pmul(x,x); - + Packet4f y = ei_p4f_cephes_exp_p0; y = ei_pmadd(y, x, ei_p4f_cephes_exp_p1); y = ei_pmadd(y, x, ei_p4f_cephes_exp_p2); @@ -210,12 +210,12 @@ static EIGEN_DONT_INLINE EIGEN_UNUSED Packet4f ei_psin(Packet4f x) sign_bit = x; /* take the absolute value */ x = ei_pabs(x); - + /* take the modulo */ - + /* extract the sign bit (upper one) */ sign_bit = _mm_and_ps(sign_bit, ei_p4f_sign_mask); - + /* scale by 4/Pi */ y = ei_pmul(x, ei_p4f_cephes_FOPI); @@ -228,7 +228,7 @@ static EIGEN_DONT_INLINE EIGEN_UNUSED Packet4f ei_psin(Packet4f x) /* get the swap sign flag */ emm0 = _mm_and_si128(emm2, ei_p4i_4); emm0 = _mm_slli_epi32(emm0, 29); - /* get the polynom selection mask + /* get the polynom selection mask there is one polynom for 0 <= x <= Pi/4 and another one for Pi/4