Use Intel cast intrinsics, since MSVC does not allow direct casting.

Reported by David Winkler.
This commit is contained in:
Christoph Hertzberg 2018-08-24 19:04:33 +02:00
parent a709c8efb4
commit ad4a08fb68

View File

@ -634,13 +634,13 @@ template<> EIGEN_STRONG_INLINE Packet8d preverse(const Packet8d& a)
template<> EIGEN_STRONG_INLINE Packet16f pabs(const Packet16f& a) template<> EIGEN_STRONG_INLINE Packet16f pabs(const Packet16f& a)
{ {
// _mm512_abs_ps intrinsic not found, so hack around it // _mm512_abs_ps intrinsic not found, so hack around it
return (__m512)_mm512_and_si512((__m512i)a, _mm512_set1_epi32(0x7fffffff)); return _mm512_castsi512_ps(_mm512_and_si512(_mm512_castps_si512(a), _mm512_set1_epi32(0x7fffffff)));
} }
template <> template <>
EIGEN_STRONG_INLINE Packet8d pabs(const Packet8d& a) { EIGEN_STRONG_INLINE Packet8d pabs(const Packet8d& a) {
// _mm512_abs_ps intrinsic not found, so hack around it // _mm512_abs_ps intrinsic not found, so hack around it
return (__m512d)_mm512_and_si512((__m512i)a, return _mm512_castsi512_pd(_mm512_and_si512(_mm512_castpd_si512(a),
_mm512_set1_epi64(0x7fffffffffffffff)); _mm512_set1_epi64(0x7fffffffffffffff)));
} }
#ifdef EIGEN_VECTORIZE_AVX512DQ #ifdef EIGEN_VECTORIZE_AVX512DQ