diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2009-10-27 15:45:24 -0400 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2009-10-27 15:45:24 -0400 |
commit | 6219f9acfa61e54baf266f816b7eaf9ffbd9841e (patch) | |
tree | c689fa44e90c15814deb40d67fe55966d45ed7a2 /Eigen/src/Geometry/arch | |
parent | 611d2b0b1d64880ff207368a901c7faba73a78c5 (diff) |
* rename new Quat class to Quaternion, remove existing Quaternion
* add Copyright line for Mathieu
* cast() was broken (compile errors) and needed anyway to be in QuaternionBase
* it's VectorBlock<T,3>, don't pass additional parameter 1, it has different meaning!!
* make it compile with GCC (put 'typename' at the right location)
Diffstat (limited to 'Eigen/src/Geometry/arch')
-rw-r--r-- | Eigen/src/Geometry/arch/Geometry_SSE.h | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/Eigen/src/Geometry/arch/Geometry_SSE.h b/Eigen/src/Geometry/arch/Geometry_SSE.h index c608e4843..1b8f6aead 100644 --- a/Eigen/src/Geometry/arch/Geometry_SSE.h +++ b/Eigen/src/Geometry/arch/Geometry_SSE.h @@ -26,31 +26,12 @@ #ifndef EIGEN_GEOMETRY_SSE_H #define EIGEN_GEOMETRY_SSE_H -template<> inline Quaternion<float> -ei_quaternion_product<EiArch_SSE,float>(const Quaternion<float>& _a, const Quaternion<float>& _b) -{ - const __m128 mask = _mm_castsi128_ps(_mm_setr_epi32(0,0,0,0x80000000)); - Quaternion<float> res; - __m128 a = _a.coeffs().packet<Aligned>(0); - __m128 b = _b.coeffs().packet<Aligned>(0); - __m128 flip1 = _mm_xor_ps(_mm_mul_ps(ei_vec4f_swizzle1(a,1,2,0,2), - ei_vec4f_swizzle1(b,2,0,1,2)),mask); - __m128 flip2 = _mm_xor_ps(_mm_mul_ps(ei_vec4f_swizzle1(a,3,3,3,1), - ei_vec4f_swizzle1(b,0,1,2,1)),mask); - ei_pstore(&res.x(), - _mm_add_ps(_mm_sub_ps(_mm_mul_ps(a,ei_vec4f_swizzle1(b,3,3,3,3)), - _mm_mul_ps(ei_vec4f_swizzle1(a,2,0,1,0), - ei_vec4f_swizzle1(b,1,2,0,0))), - _mm_add_ps(flip1,flip2))); - return res; -} - template<class Derived, class OtherDerived> struct ei_quat_product<EiArch_SSE, Derived, OtherDerived, float, Aligned> { - inline static Quat<float> run(const QuaternionBase<Derived>& _a, const QuaternionBase<OtherDerived>& _b) + inline static Quaternion<float> run(const QuaternionBase<Derived>& _a, const QuaternionBase<OtherDerived>& _b) { const __m128 mask = _mm_castsi128_ps(_mm_setr_epi32(0,0,0,0x80000000)); - Quat<float> res; + Quaternion<float> res; __m128 a = _a.coeffs().packet<Aligned>(0); __m128 b = _b.coeffs().packet<Aligned>(0); __m128 flip1 = _mm_xor_ps(_mm_mul_ps(ei_vec4f_swizzle1(a,1,2,0,2), |