From c730290fa0648fd3a754302588776b6a7a1f513f Mon Sep 17 00:00:00 2001 From: Rasmus Munk Larsen Date: Mon, 3 Apr 2023 13:56:41 -0700 Subject: [PATCH] Use the correct truncating intrinsic for double->int casting. --- Eigen/src/Core/arch/AVX/TypeCasting.h | 2 +- Eigen/src/Core/arch/AVX512/TypeCasting.h | 2 +- Eigen/src/Core/arch/SSE/TypeCasting.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Eigen/src/Core/arch/AVX/TypeCasting.h b/Eigen/src/Core/arch/AVX/TypeCasting.h index 2a611e497..386543e66 100644 --- a/Eigen/src/Core/arch/AVX/TypeCasting.h +++ b/Eigen/src/Core/arch/AVX/TypeCasting.h @@ -77,7 +77,7 @@ template<> EIGEN_STRONG_INLINE Packet8f pcast(const Packet4d } template<> EIGEN_STRONG_INLINE Packet8i pcast(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 <> diff --git a/Eigen/src/Core/arch/AVX512/TypeCasting.h b/Eigen/src/Core/arch/AVX512/TypeCasting.h index ca588e93c..02e633552 100644 --- a/Eigen/src/Core/arch/AVX512/TypeCasting.h +++ b/Eigen/src/Core/arch/AVX512/TypeCasting.h @@ -56,7 +56,7 @@ template<> EIGEN_STRONG_INLINE Packet16f pcast(const Packet } template<> EIGEN_STRONG_INLINE Packet16i pcast(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(const Packet16f& a) { diff --git a/Eigen/src/Core/arch/SSE/TypeCasting.h b/Eigen/src/Core/arch/SSE/TypeCasting.h index dd146187f..df5c72c42 100644 --- a/Eigen/src/Core/arch/SSE/TypeCasting.h +++ b/Eigen/src/Core/arch/SSE/TypeCasting.h @@ -101,8 +101,8 @@ template<> EIGEN_STRONG_INLINE Packet4f pcast(const Packet2d } template<> EIGEN_STRONG_INLINE Packet4i pcast(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))); }