diff options
author | 2010-06-15 08:29:21 -0400 | |
---|---|---|
committer | 2010-06-15 08:29:21 -0400 | |
commit | 134ca4acb3860c2521ef73508023b9c9d8cac4ec (patch) | |
tree | 9a36d043abe56e6ac48b7b985510c8c82c4d973a /Eigen/src/Core/arch/SSE/MathFunctions.h | |
parent | 7958797648059abbceb3af61ddaa040263c1d318 (diff) |
packet math functions:
- take const Packet& args like the other packet funcs
- SSE specializations: make them be actual template specializations
Diffstat (limited to 'Eigen/src/Core/arch/SSE/MathFunctions.h')
-rw-r--r-- | Eigen/src/Core/arch/SSE/MathFunctions.h | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/Eigen/src/Core/arch/SSE/MathFunctions.h b/Eigen/src/Core/arch/SSE/MathFunctions.h index 99662eb6d..79f9e39dd 100644 --- a/Eigen/src/Core/arch/SSE/MathFunctions.h +++ b/Eigen/src/Core/arch/SSE/MathFunctions.h @@ -30,8 +30,10 @@ #ifndef EIGEN_MATH_FUNCTIONS_SSE_H #define EIGEN_MATH_FUNCTIONS_SSE_H -static EIGEN_DONT_INLINE EIGEN_UNUSED Packet4f ei_plog(Packet4f x) +template<> EIGEN_DONT_INLINE EIGEN_UNUSED +Packet4f ei_plog<Packet4f>(const Packet4f& _x) { + Packet4f x = _x; _EIGEN_DECLARE_CONST_Packet4f(1 , 1.0f); _EIGEN_DECLARE_CONST_Packet4f(half, 0.5f); _EIGEN_DECLARE_CONST_Packet4i(0x7f, 0x7f); @@ -108,8 +110,10 @@ static EIGEN_DONT_INLINE EIGEN_UNUSED Packet4f ei_plog(Packet4f x) return _mm_or_ps(x, invalid_mask); // negative arg will be NAN } -static EIGEN_DONT_INLINE EIGEN_UNUSED Packet4f ei_pexp(Packet4f x) +template<> EIGEN_DONT_INLINE EIGEN_UNUSED +Packet4f ei_pexp<Packet4f>(const Packet4f& _x) { + Packet4f x = _x; _EIGEN_DECLARE_CONST_Packet4f(1 , 1.0f); _EIGEN_DECLARE_CONST_Packet4f(half, 0.5f); _EIGEN_DECLARE_CONST_Packet4i(0x7f, 0x7f); @@ -181,8 +185,10 @@ static EIGEN_DONT_INLINE EIGEN_UNUSED Packet4f ei_pexp(Packet4f x) surprising but correct result. */ -static EIGEN_DONT_INLINE EIGEN_UNUSED Packet4f ei_psin(Packet4f x) +template<> EIGEN_DONT_INLINE EIGEN_UNUSED +Packet4f ei_psin<Packet4f>(const Packet4f& _x) { + Packet4f x = _x; _EIGEN_DECLARE_CONST_Packet4f(1 , 1.0f); _EIGEN_DECLARE_CONST_Packet4f(half, 0.5f); @@ -280,8 +286,10 @@ static EIGEN_DONT_INLINE EIGEN_UNUSED Packet4f ei_psin(Packet4f x) } /* almost the same as ei_psin */ -static EIGEN_DONT_INLINE EIGEN_UNUSED Packet4f ei_pcos(Packet4f x) +template<> EIGEN_DONT_INLINE EIGEN_UNUSED +Packet4f ei_pcos<Packet4f>(const Packet4f& _x) { + Packet4f x = _x; _EIGEN_DECLARE_CONST_Packet4f(1 , 1.0f); _EIGEN_DECLARE_CONST_Packet4f(half, 0.5f); @@ -367,7 +375,8 @@ static EIGEN_DONT_INLINE EIGEN_UNUSED Packet4f ei_pcos(Packet4f x) // This is Quake3's fast inverse square root. // For detail see here: http://www.beyond3d.com/content/articles/8/ -static EIGEN_UNUSED Packet4f ei_psqrt(Packet4f _x) +template<> EIGEN_UNUSED +Packet4f ei_psqrt<Packet4f>(const Packet4f& _x) { Packet4f half = ei_pmul(_x, ei_pset1(.5f)); |