mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-06-04 18:54:00 +08:00
[mq]: Mingw32 fix
intrin.h is not required nor supported by mingw32. It is present (and supported) on mingw-w64 builds, even those for 32-bit systems, but here too it's not required on 32-bit systems. So if we're on mingw, and it's 64-bit, then and only then is the intrin.h inclusion necessary.
This commit is contained in:
parent
c49c013c47
commit
7a7ca99a31
37
Eigen/Core
37
Eigen/Core
@ -93,28 +93,29 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// include files
|
// include files
|
||||||
#if (defined __GNUC__) && (defined __MINGW32__)
|
|
||||||
#include <intrin.h>
|
// This extern "C" works around a MINGW-w64 bug
|
||||||
//including intrin.h works around a MINGW bug http://sourceforge.net/tracker/?func=detail&atid=102435&aid=2962480&group_id=2435
|
// https://sourceforge.net/tracker/index.php?func=detail&aid=3018394&group_id=202880&atid=983354
|
||||||
//in essence, intrin.h is included by windows.h and also declares intrinsics (just as emmintrin.h etc. below do). However,
|
// In essence, intrin.h is included by windows.h and also declares intrinsics (just as emmintrin.h etc. below do).
|
||||||
//intrin.h uses an extern "C" declaration, and g++ thus complains of duplicate declarations with conflicting linkage. The linkage for intrinsics
|
// However, intrin.h uses an extern "C" declaration, and g++ thus complains of duplicate declarations
|
||||||
//doesn't matter, but at that stage the compiler doesn't know; so, to avoid compile errors when windows.h is included after Eigen/Core,
|
// with conflicting linkage. The linkage for intrinsics doesn't matter, but at that stage the compiler doesn't know;
|
||||||
//include intrin here.
|
// so, to avoid compile errors when windows.h is included after Eigen/Core, ensure intrinsics are extern "C" here too.
|
||||||
#endif
|
extern "C" {
|
||||||
#include <emmintrin.h>
|
#include <emmintrin.h>
|
||||||
#include <xmmintrin.h>
|
#include <xmmintrin.h>
|
||||||
#ifdef EIGEN_VECTORIZE_SSE3
|
#ifdef EIGEN_VECTORIZE_SSE3
|
||||||
#include <pmmintrin.h>
|
#include <pmmintrin.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef EIGEN_VECTORIZE_SSSE3
|
#ifdef EIGEN_VECTORIZE_SSSE3
|
||||||
#include <tmmintrin.h>
|
#include <tmmintrin.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef EIGEN_VECTORIZE_SSE4_1
|
#ifdef EIGEN_VECTORIZE_SSE4_1
|
||||||
#include <smmintrin.h>
|
#include <smmintrin.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef EIGEN_VECTORIZE_SSE4_2
|
#ifdef EIGEN_VECTORIZE_SSE4_2
|
||||||
#include <nmmintrin.h>
|
#include <nmmintrin.h>
|
||||||
#endif
|
#endif
|
||||||
|
} // end extern "C"
|
||||||
#elif defined __ALTIVEC__
|
#elif defined __ALTIVEC__
|
||||||
#define EIGEN_VECTORIZE
|
#define EIGEN_VECTORIZE
|
||||||
#define EIGEN_VECTORIZE_ALTIVEC
|
#define EIGEN_VECTORIZE_ALTIVEC
|
||||||
|
Loading…
x
Reference in New Issue
Block a user