From 516db2c3b97345553c3489681fba67f52a8eda6b Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Mon, 21 Jul 2008 12:40:56 +0000 Subject: [PATCH] Fix compilation issues with icc and g++ < 4.1. Those include: - conflicts with operator * overloads - discard the use of ei_pdiv for interger (g++ handles operators on __m128* types, this is why it worked) - weird behavior of icc in fixed size Block() constructor complaining the initializer of m_blockRows and m_blockCols were missing while we are in fixed size (maybe this hide deeper problem since this is a recent one, but icc gives only little feedback) --- Eigen/src/Core/Block.h | 9 ++++++--- Eigen/src/Core/Functors.h | 3 +++ Eigen/src/Core/arch/SSE/PacketMath.h | 2 ++ Eigen/src/Core/util/StaticAssert.h | 3 ++- Eigen/src/Geometry/AngleAxis.h | 2 +- 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/Eigen/src/Core/Block.h b/Eigen/src/Core/Block.h index b185e90cf..9e15261b3 100644 --- a/Eigen/src/Core/Block.h +++ b/Eigen/src/Core/Block.h @@ -111,9 +111,10 @@ template= 0 && BlockRows >= 1 && startRow + BlockRows <= matrix.rows() && startCol >= 0 && BlockCols >= 1 && startCol + BlockCols <= matrix.cols()); } @@ -233,8 +234,10 @@ template class Block= 0 && BlockRows >= 1 && startRow + BlockRows <= matrix.rows() && startCol >= 0 && BlockCols >= 1 && startCol + BlockCols <= matrix.cols()); diff --git a/Eigen/src/Core/Functors.h b/Eigen/src/Core/Functors.h index 41049940f..cb14585f6 100644 --- a/Eigen/src/Core/Functors.h +++ b/Eigen/src/Core/Functors.h @@ -141,6 +141,9 @@ struct ei_functor_traits > { enum { Cost = 2 * NumTraits::MulCost, PacketAccess = ei_packet_traits::size>1 + #ifdef EIGEN_VECTORIZE_SSE + && NumTraits::HasFloatingPoint + #endif }; }; diff --git a/Eigen/src/Core/arch/SSE/PacketMath.h b/Eigen/src/Core/arch/SSE/PacketMath.h index 114ed49e2..148835732 100644 --- a/Eigen/src/Core/arch/SSE/PacketMath.h +++ b/Eigen/src/Core/arch/SSE/PacketMath.h @@ -61,6 +61,8 @@ template<> inline __m128i ei_pmul(const __m128i& a, const __m128i& b) template<> inline __m128 ei_pdiv(const __m128& a, const __m128& b) { return _mm_div_ps(a,b); } template<> inline __m128d ei_pdiv(const __m128d& a, const __m128d& b) { return _mm_div_pd(a,b); } +template<> inline __m128i ei_pdiv(const __m128i& a, const __m128i& b) +{ ei_assert(false && "packet integer division are not supported by SSE"); } // for some weird raisons, it has to be overloaded for packet integer template<> inline __m128i ei_pmadd(const __m128i& a, const __m128i& b, const __m128i& c) { return ei_padd(ei_pmul(a,b), c); } diff --git a/Eigen/src/Core/util/StaticAssert.h b/Eigen/src/Core/util/StaticAssert.h index 751f8f878..3584926af 100644 --- a/Eigen/src/Core/util/StaticAssert.h +++ b/Eigen/src/Core/util/StaticAssert.h @@ -64,7 +64,8 @@ unaligned_load_and_store_operations_unimplemented_on_AltiVec, scalar_type_must_be_floating_point, default_writting_to_selfadjoint_not_supported, - writting_to_triangular_part_with_unit_diag_is_not_supported + writting_to_triangular_part_with_unit_diag_is_not_supported, + this_method_is_only_for_fixed_size }; }; diff --git a/Eigen/src/Geometry/AngleAxis.h b/Eigen/src/Geometry/AngleAxis.h index ca53140fb..ba3e9f46e 100644 --- a/Eigen/src/Geometry/AngleAxis.h +++ b/Eigen/src/Geometry/AngleAxis.h @@ -74,7 +74,7 @@ public: inline AngleAxis(const QuaternionType& q) { *this = q; } /** Constructs and initialize the angle-axis rotation from a 3x3 rotation matrix. */ template - inline AngleAxis(const MatrixBase& m) { *this = m; } + inline explicit AngleAxis(const MatrixBase& m) { *this = m; } Scalar angle() const { return m_angle; } Scalar& angle() { return m_angle; }