mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
fix strict aliasing issue
This commit is contained in:
@@ -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)
|
template<> EIGEN_STRONG_INLINE std::complex<float> ei_pfirst<Packet2cf>(const Packet2cf& a)
|
||||||
{
|
{
|
||||||
union {
|
std::complex<float> res;
|
||||||
float res[2];
|
_mm_storel_pi((__m64*)&res, a.v);
|
||||||
double asDouble;
|
return res;
|
||||||
};
|
|
||||||
_mm_store_sd(&asDouble,_mm_castps_pd(a.v));
|
|
||||||
return *(std::complex<float>*)res;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template<> EIGEN_STRONG_INLINE Packet2cf ei_preverse(const Packet2cf& a) { return Packet2cf(_mm_castpd_ps(ei_preverse(_mm_castps_pd(a.v)))); }
|
template<> EIGEN_STRONG_INLINE Packet2cf ei_preverse(const Packet2cf& a) { return Packet2cf(_mm_castpd_ps(ei_preverse(_mm_castps_pd(a.v)))); }
|
||||||
|
|||||||
Reference in New Issue
Block a user