aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/arch/SSE/Complex.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2010-07-22 13:16:53 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2010-07-22 13:16:53 +0200
commit0dfc5b296be31a06a630ff389344a54b2be507ba (patch)
treeab1ef6287f053863fdf250dba2df23aa7f6248c6 /Eigen/src/Core/arch/SSE/Complex.h
parent8a96b0080db7dbf99068fd6b9b92e1699fd176cf (diff)
fix strict aliasing issue
Diffstat (limited to 'Eigen/src/Core/arch/SSE/Complex.h')
-rw-r--r--Eigen/src/Core/arch/SSE/Complex.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/Eigen/src/Core/arch/SSE/Complex.h b/Eigen/src/Core/arch/SSE/Complex.h
index 8c0fd9a7f..919ed2a05 100644
--- a/Eigen/src/Core/arch/SSE/Complex.h
+++ b/Eigen/src/Core/arch/SSE/Complex.h
@@ -109,12 +109,9 @@ template<> EIGEN_STRONG_INLINE Packet2cf ei_pset1<Packet2cf>(const std::complex<
template<> EIGEN_STRONG_INLINE std::complex<float> ei_pfirst<Packet2cf>(const Packet2cf& a)
{
- union {
- float res[2];
- double asDouble;
- };
- _mm_store_sd(&asDouble,_mm_castps_pd(a.v));
- return *(std::complex<float>*)res;
+ std::complex<float> res;
+ _mm_storel_pi((__m64*)&res, a.v);
+ return res;
}
template<> EIGEN_STRONG_INLINE Packet2cf ei_preverse(const Packet2cf& a) { return Packet2cf(_mm_castpd_ps(ei_preverse(_mm_castps_pd(a.v)))); }