mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-10 02:39:03 +08:00
Use the correct truncating intrinsic for double->int casting.
This commit is contained in:
parent
766db02020
commit
c730290fa0
@ -77,7 +77,7 @@ template<> EIGEN_STRONG_INLINE Packet8f pcast<Packet4d, Packet8f>(const Packet4d
|
||||
}
|
||||
|
||||
template<> EIGEN_STRONG_INLINE Packet8i pcast<Packet4d, Packet8i>(const Packet4d& a, const Packet4d& b) {
|
||||
return _mm256_set_m128i(_mm256_cvtpd_epi32(b), _mm256_cvtpd_epi32(a));
|
||||
return _mm256_set_m128i(_mm256_cvttpd_epi32(b), _mm256_cvttpd_epi32(a));
|
||||
}
|
||||
|
||||
template <>
|
||||
|
@ -56,7 +56,7 @@ template<> EIGEN_STRONG_INLINE Packet16f pcast<Packet8d, Packet16f>(const Packet
|
||||
}
|
||||
|
||||
template<> EIGEN_STRONG_INLINE Packet16i pcast<Packet8d, Packet16i>(const Packet8d& a, const Packet8d& b) {
|
||||
return cat256i(_mm512_cvtpd_epi32(a), _mm512_cvtpd_epi32(b));
|
||||
return cat256i(_mm512_cvttpd_epi32(a), _mm512_cvttpd_epi32(b));
|
||||
}
|
||||
|
||||
template<> EIGEN_STRONG_INLINE Packet16i preinterpret<Packet16i, Packet16f>(const Packet16f& a) {
|
||||
|
@ -101,8 +101,8 @@ template<> EIGEN_STRONG_INLINE Packet4f pcast<Packet2d, Packet4f>(const Packet2d
|
||||
}
|
||||
|
||||
template<> EIGEN_STRONG_INLINE Packet4i pcast<Packet2d, Packet4i>(const Packet2d& a, const Packet2d& b) {
|
||||
return _mm_castps_si128(_mm_shuffle_ps(_mm_castsi128_ps(_mm_cvtpd_epi32(a)),
|
||||
_mm_castsi128_ps(_mm_cvtpd_epi32(b)),
|
||||
return _mm_castps_si128(_mm_shuffle_ps(_mm_castsi128_ps(_mm_cvttpd_epi32(a)),
|
||||
_mm_castsi128_ps(_mm_cvttpd_epi32(b)),
|
||||
(1 << 2) | (1 << 6)));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user