mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-09-12 09:23:12 +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)
|
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)))); }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user