Switch to truncated casting when converting floating point types to integer. This ensures that vectorized casts are consistent with scalar casts

This commit is contained in:
Benoit Steiner
2015-02-27 09:27:30 -08:00
parent 573b377110
commit 05089aba75
2 changed files with 21 additions and 1 deletions

View File

@@ -24,7 +24,7 @@ struct type_casting_traits<float, int> {
};
template<> EIGEN_STRONG_INLINE Packet4i pcast<Packet4f, Packet4i>(const Packet4f& a) {
return _mm_cvtps_epi32(a);
return _mm_cvttps_epi32(a);
}