aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/arch/SSE/MathFunctions.h
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <benoitjacob@google.com>2016-02-10 11:11:49 -0500
committerGravatar Benoit Jacob <benoitjacob@google.com>2016-02-10 11:11:49 -0500
commite6ee18d6b46229b0028c454db5f389001649bd45 (patch)
tree1f473ffb644c0155a564ba170a08969108e30775 /Eigen/src/Core/arch/SSE/MathFunctions.h
parent2ac59e5d36452156d842964e675fb82818b5d46c (diff)
Make the GCC workaround for sqrt GCC-only; detect Emscripten as non-GCC
Diffstat (limited to 'Eigen/src/Core/arch/SSE/MathFunctions.h')
-rw-r--r--Eigen/src/Core/arch/SSE/MathFunctions.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/Eigen/src/Core/arch/SSE/MathFunctions.h b/Eigen/src/Core/arch/SSE/MathFunctions.h
index 67cc3b3ba..5236f5b9a 100644
--- a/Eigen/src/Core/arch/SSE/MathFunctions.h
+++ b/Eigen/src/Core/arch/SSE/MathFunctions.h
@@ -531,7 +531,9 @@ template<>
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
double sqrt(const double &x)
{
-#if EIGEN_COMP_GNUC && !defined(EMSCRIPTEN)
+#if EIGEN_COMP_GNUC_STRICT
+ // This works around a GCC bug generating poor code for _mm_sqrt_pd
+ // See https://bitbucket.org/eigen/eigen/commits/14f468dba4d350d7c19c9b93072e19f7b3df563b
return internal::pfirst(internal::Packet2d(__builtin_ia32_sqrtsd(_mm_set_sd(x))));
#else
return internal::pfirst(internal::Packet2d(_mm_sqrt_pd(_mm_set_sd(x))));