From 3979f6d8aad001174160774b49b747430a7686b5 Mon Sep 17 00:00:00 2001 From: Hauke Heibel Date: Wed, 4 Nov 2009 15:49:22 +0100 Subject: [PATCH] Let's try to stick to the original code, thus activate the fix of #62 only for 64 bit builds. --- Eigen/src/Core/arch/SSE/PacketMath.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Eigen/src/Core/arch/SSE/PacketMath.h b/Eigen/src/Core/arch/SSE/PacketMath.h index c1d7e5786..f588a8621 100644 --- a/Eigen/src/Core/arch/SSE/PacketMath.h +++ b/Eigen/src/Core/arch/SSE/PacketMath.h @@ -220,12 +220,17 @@ template<> EIGEN_STRONG_INLINE void ei_pstoreu(double* to, const Packet2 template<> EIGEN_STRONG_INLINE void ei_pstoreu(float* to, const Packet4f& from) { ei_pstoreu((double*)to, _mm_castps_pd(from)); } template<> EIGEN_STRONG_INLINE void ei_pstoreu(int* to, const Packet4i& from) { ei_pstoreu((double*)to, _mm_castsi128_pd(from)); } -#ifdef _MSC_VER <= 1500 +#if (_MSC_VER <= 1500) && defined(_WIN64) // The temporary variable fixes an internal compilation error. // Direct of the struct members fixed bug #62. template<> EIGEN_STRONG_INLINE float ei_pfirst(const Packet4f& a) { return a.m128_f32[0]; } template<> EIGEN_STRONG_INLINE double ei_pfirst(const Packet2d& a) { return a.m128d_f64[0]; } template<> EIGEN_STRONG_INLINE int ei_pfirst(const Packet4i& a) { int x = _mm_cvtsi128_si32(a); return x; } +#elif (_MSC_VER <= 1500) +// The temporary variable fixes an internal compilation error. +template<> EIGEN_STRONG_INLINE float ei_pfirst(const Packet4f& a) { float x = _mm_cvtss_f32(a); return x; } +template<> EIGEN_STRONG_INLINE double ei_pfirst(const Packet2d& a) { double x = _mm_cvtsd_f64(a); return x; } +template<> EIGEN_STRONG_INLINE int ei_pfirst(const Packet4i& a) { int x = _mm_cvtsi128_si32(a); return x; } #else template<> EIGEN_STRONG_INLINE float ei_pfirst(const Packet4f& a) { return _mm_cvtss_f32(a); } template<> EIGEN_STRONG_INLINE double ei_pfirst(const Packet2d& a) { return _mm_cvtsd_f64(a); }