diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2008-12-15 21:20:40 +0000 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2008-12-15 21:20:40 +0000 |
commit | 0a220721d11880170495e0770d2bdc28b588e489 (patch) | |
tree | b08f134ace85f0573b3c21923c5574060ad3d71b /Eigen | |
parent | 1ad751b991619a9b665b851356e3aa0f0f03be82 (diff) |
Finally work around enough of MSVC preprocessor dumbness so that it actually detects SSE2
Diffstat (limited to 'Eigen')
-rw-r--r-- | Eigen/Core | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Eigen/Core b/Eigen/Core index 3d325c716..8189304d6 100644 --- a/Eigen/Core +++ b/Eigen/Core @@ -13,7 +13,17 @@ #ifndef EIGEN_DONT_VECTORIZE #define EIGEN_HAVE__SSE2__BUT_NOT_OLD_GCC ((defined __SSE2__) && ( (!defined __GNUC__) || EIGEN_GNUC_AT_LEAST(4,2) )) - #define EIGEN_HAVE_MSVC_SSE2 ((defined(_M_IX86_FP)) && (_M_IX86_FP >= 2)) // the parentheses around defined are really needed by MSVC + + // Now check for SSE2 with MSVC. Normally we'd formulate this in 1 line using defined() but this triggers MSVC bugs. + #ifdef _M_IX86_FP + #if (_M_IX86_FP >= 2) + #define EIGEN_HAVE_MSVC_SSE2 1 + #endif + #endif + #ifndef EIGEN_HAVE_MSVC_SSE2 + #define EIGEN_HAVE_MSVC_SSE2 0 + #endif + #if (EIGEN_HAVE__SSE2__BUT_NOT_OLD_GCC || EIGEN_HAVE_MSVC_SSE2) #define EIGEN_VECTORIZE #define EIGEN_VECTORIZE_SSE |