mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-01-24 14:45:14 +08:00
fix strict aliasing issue
This commit is contained in:
parent
8a96b0080d
commit
0dfc5b296b
@ -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)))); }
|
||||
|
Loading…
Reference in New Issue
Block a user