From 2066ed91de31b118e20c40fdc74badac8d02dd22 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Wed, 7 Jul 2010 22:50:19 +0200 Subject: [PATCH] enabling aligned loads/store for complex is much more tricky, so the temporary fix is to always perform unaligned load/store --- Eigen/src/Core/arch/SSE/Complex.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Eigen/src/Core/arch/SSE/Complex.h b/Eigen/src/Core/arch/SSE/Complex.h index 4ecfc2f43..6c91386c6 100644 --- a/Eigen/src/Core/arch/SSE/Complex.h +++ b/Eigen/src/Core/arch/SSE/Complex.h @@ -261,12 +261,14 @@ template<> EIGEN_STRONG_INLINE Packet1cd ei_por (const Packet1cd& template<> EIGEN_STRONG_INLINE Packet1cd ei_pxor (const Packet1cd& a, const Packet1cd& b) { return Packet1cd(_mm_xor_pd(a.v,b.v)); } template<> EIGEN_STRONG_INLINE Packet1cd ei_pandnot(const Packet1cd& a, const Packet1cd& b) { return Packet1cd(_mm_andnot_pd(a.v,b.v)); } -template<> EIGEN_STRONG_INLINE Packet1cd ei_pload >(const std::complex* from) { EIGEN_DEBUG_ALIGNED_LOAD return Packet1cd(_mm_load_pd((const double*)from)); } +// FIXME force unaligned load, this is a temporary fix +template<> EIGEN_STRONG_INLINE Packet1cd ei_pload >(const std::complex* from) { EIGEN_DEBUG_ALIGNED_LOAD return Packet1cd(ei_ploadu((const double*)from)); } template<> EIGEN_STRONG_INLINE Packet1cd ei_ploadu >(const std::complex* from) { EIGEN_DEBUG_UNALIGNED_LOAD return Packet1cd(ei_ploadu((const double*)from)); } template<> EIGEN_STRONG_INLINE Packet1cd ei_pset1 >(const std::complex& from) { /* here we really have to use unaligned loads :( */ return ei_ploadu(&from); } -template<> EIGEN_STRONG_INLINE void ei_pstore >(std::complex * to, const Packet1cd& from) { EIGEN_DEBUG_ALIGNED_STORE _mm_store_pd((double*)to, from.v); } +// FIXME force unaligned store, this is a temporary fix +template<> EIGEN_STRONG_INLINE void ei_pstore >(std::complex * to, const Packet1cd& from) { EIGEN_DEBUG_ALIGNED_STORE ei_pstoreu((double*)to, from.v); } template<> EIGEN_STRONG_INLINE void ei_pstoreu >(std::complex * to, const Packet1cd& from) { EIGEN_DEBUG_UNALIGNED_STORE ei_pstoreu((double*)to, from.v); } template<> EIGEN_STRONG_INLINE void ei_prefetch >(const std::complex * addr) { _mm_prefetch((const char*)(addr), _MM_HINT_T0); } @@ -274,7 +276,7 @@ template<> EIGEN_STRONG_INLINE void ei_prefetch >(const std template<> EIGEN_STRONG_INLINE std::complex ei_pfirst(const Packet1cd& a) { EIGEN_ALIGN16 std::complex res; - _mm_store_pd((double*)&res, a.v); + ei_pstore(&res, a); return res; }