diff options
author | 2015-11-01 10:49:27 +0100 | |
---|---|---|
committer | 2015-11-01 10:49:27 +0100 | |
commit | d46e2c10a60759e2b5a4b8e711832780215d768a (patch) | |
tree | eb7030bd6dfbfa55afac857acb8c4ed499bc237a /Eigen/src/Core/arch/AVX/PacketMath.h | |
parent | b32948c6427635aa91cd585a2eceecef8440fbd1 (diff) |
Add round, ceil and floor for SSE4.1/AVX (Bug #70)
Diffstat (limited to 'Eigen/src/Core/arch/AVX/PacketMath.h')
-rw-r--r-- | Eigen/src/Core/arch/AVX/PacketMath.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/Eigen/src/Core/arch/AVX/PacketMath.h b/Eigen/src/Core/arch/AVX/PacketMath.h index dfdb71abd..b313fb09a 100644 --- a/Eigen/src/Core/arch/AVX/PacketMath.h +++ b/Eigen/src/Core/arch/AVX/PacketMath.h @@ -66,7 +66,10 @@ template<> struct packet_traits<float> : default_packet_traits HasExp = 1, HasSqrt = 1, HasRsqrt = 1, - HasBlend = 1 + HasBlend = 1, + HasRound = 1, + HasFloor = 1, + HasCeil = 1 }; }; template<> struct packet_traits<double> : default_packet_traits @@ -83,7 +86,10 @@ template<> struct packet_traits<double> : default_packet_traits HasExp = 1, HasSqrt = 1, HasRsqrt = 1, - HasBlend = 1 + HasBlend = 1, + HasRound = 1, + HasFloor = 1, + HasCeil = 1 }; }; @@ -176,6 +182,15 @@ template<> EIGEN_STRONG_INLINE Packet4d pmin<Packet4d>(const Packet4d& a, const template<> EIGEN_STRONG_INLINE Packet8f pmax<Packet8f>(const Packet8f& a, const Packet8f& b) { return _mm256_max_ps(a,b); } template<> EIGEN_STRONG_INLINE Packet4d pmax<Packet4d>(const Packet4d& a, const Packet4d& b) { return _mm256_max_pd(a,b); } +template<> EIGEN_STRONG_INLINE Packet4f pround<Packet8f>(const Packet8f& a) { return _mm256_round_ps(a, 0); } +template<> EIGEN_STRONG_INLINE Packet2d pround<Packet4d>(const Packet4d& a) { return _mm256_round_pd(a, 0); } + +template<> EIGEN_STRONG_INLINE Packet4f pceil<Packet8f>(const Packet8f& a) { return _mm256_ceil_ps(a); } +template<> EIGEN_STRONG_INLINE Packet2d pceil<Packet4d>(const Packet4d& a) { return _mm256_ceil_pd(a); } + +template<> EIGEN_STRONG_INLINE Packet4f pfloor<Packet8f>(const Packet8f& a) { return _mm256_floor_ps(a); } +template<> EIGEN_STRONG_INLINE Packet2d pfloor<Packet4d>(const Packet4d& a) { return _mm256_floor_pd(a); } + template<> EIGEN_STRONG_INLINE Packet8f pand<Packet8f>(const Packet8f& a, const Packet8f& b) { return _mm256_and_ps(a,b); } template<> EIGEN_STRONG_INLINE Packet4d pand<Packet4d>(const Packet4d& a, const Packet4d& b) { return _mm256_and_pd(a,b); } |