From 646872cb3b0dfd0952ff4f0463bd7512c019a711 Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Tue, 24 May 2016 00:07:08 -0700 Subject: [PATCH] Worked around missing clang intrinsics --- Eigen/src/Core/arch/CUDA/PacketMathHalf.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Eigen/src/Core/arch/CUDA/PacketMathHalf.h b/Eigen/src/Core/arch/CUDA/PacketMathHalf.h index d629a470b..0530df001 100644 --- a/Eigen/src/Core/arch/CUDA/PacketMathHalf.h +++ b/Eigen/src/Core/arch/CUDA/PacketMathHalf.h @@ -595,12 +595,12 @@ template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet4h pset1(const } template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE half pfirst(const Packet4h& from) { - return raw_uint16_to_half(static_cast(_m_to_int(from.x))); + return raw_uint16_to_half(static_cast(_mm_cvtsi64_si32(from.x))); } template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet4h padd(const Packet4h& a, const Packet4h& b) { - __int64_t a64 = _m_to_int64(a.x); - __int64_t b64 = _m_to_int64(b.x); + __int64_t a64 = _mm_cvtm64_si64(a.x); + __int64_t b64 = _mm_cvtm64_si64(b.x); half h[4]; @@ -622,8 +622,8 @@ template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet4h padd(const P } template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet4h pmul(const Packet4h& a, const Packet4h& b) { - __int64_t a64 = _m_to_int64(a.x); - __int64_t b64 = _m_to_int64(b.x); + __int64_t a64 = _mm_cvtm64_si64(a.x); + __int64_t b64 = _mm_cvtm64_si64(b.x); half h[4]; @@ -646,23 +646,23 @@ template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet4h pmul(const P template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet4h pload(const half* from) { Packet4h result; - result.x = _m_from_int64(*reinterpret_cast(from)); + result.x = _mm_cvtsi64_m64(*reinterpret_cast(from)); return result; } template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet4h ploadu(const half* from) { Packet4h result; - result.x = _m_from_int64(*reinterpret_cast(from)); + result.x = _mm_cvtsi64_m64(*reinterpret_cast(from)); return result; } template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void pstore(half* to, const Packet4h& from) { - __int64_t r = _m_to_int64(from.x); + __int64_t r = _mm_cvtm64_si64(from.x); *(reinterpret_cast<__int64_t*>(to)) = r; } template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void pstoreu(half* to, const Packet4h& from) { - __int64_t r = _m_to_int64(from.x); + __int64_t r = _mm_cvtm64_si64(from.x); *(reinterpret_cast<__int64_t*>(to)) = r; } @@ -681,7 +681,7 @@ template<> EIGEN_DEVICE_FUNC inline Packet4h pgather(const half* template<> EIGEN_DEVICE_FUNC inline void pscatter(half* to, const Packet4h& from, Index stride) { - __int64_t a = _m_to_int64(from.x); + __int64_t a = _mm_cvtm64_si64(from.x); to[stride*0].x = static_cast(a); to[stride*1].x = static_cast(a >> 16); to[stride*2].x = static_cast(a >> 32);