11 #ifndef EIGEN_GEOMETRY_SSE_H 12 #define EIGEN_GEOMETRY_SSE_H 18 template<
class Derived,
class OtherDerived>
29 const __m128 mask = _mm_setr_ps(0.
f,0.
f,0.
f,-0.
f);
30 __m128 a = _a.
coeffs().template packet<AAlignment>(0);
31 __m128
b = _b.
coeffs().template packet<BAlignment>(0);
34 pstoret<float,Packet4f,ResAlignment>(
39 _mm_xor_ps(mask,_mm_add_ps(s1,s2))));
45 template<
class Derived>
54 const __m128 mask = _mm_setr_ps(-0.
f,-0.
f,-0.
f,0.
f);
55 pstoret<float,Packet4f,ResAlignment>(&res.
x(), _mm_xor_ps(mask, q.
coeffs().template packet<traits<Derived>::Alignment>(0)));
61 template<
typename VectorLhs,
typename VectorRhs>
68 run(
const VectorLhs& lhs,
const VectorRhs& rhs)
70 __m128 a = lhs.template packet<traits<VectorLhs>::Alignment>(0);
71 __m128
b = rhs.template packet<traits<VectorRhs>::Alignment>(0);
75 pstoret<float,Packet4f,ResAlignment>(&res.x(),_mm_sub_ps(mul1,mul2));
83 template<
class Derived,
class OtherDerived>
93 const Packet2d mask = _mm_castsi128_pd(_mm_set_epi32(0x0,0x0,0x80000000,0x0));
97 const double* a = _a.
coeffs().data();
115 #ifdef EIGEN_VECTORIZE_SSE3 117 pstoret<double,Packet2d,ResAlignment>(&res.
x(), _mm_addsub_pd(t1,
preverse(t2)));
119 pstoret<double,Packet2d,ResAlignment>(&res.
x(),
padd(t1,
pxor(mask,
preverse(t2))));
129 #ifdef EIGEN_VECTORIZE_SSE3 131 pstoret<double,Packet2d,ResAlignment>(&res.
z(),
preverse(_mm_addsub_pd(
preverse(t1), t2)));
133 pstoret<double,Packet2d,ResAlignment>(&res.
z(),
psub(t1,
pxor(mask,
preverse(t2))));
140 template<
class Derived>
149 const __m128d mask0 = _mm_setr_pd(-0.,-0.);
150 const __m128d mask2 = _mm_setr_pd(-0.,0.);
151 pstoret<double,Packet2d,ResAlignment>(&res.
x(), _mm_xor_pd(mask0, q.
coeffs().template packet<traits<Derived>::Alignment>(0)));
152 pstoret<double,Packet2d,ResAlignment>(&res.
z(), _mm_xor_pd(mask2, q.
coeffs().template packet<traits<Derived>::Alignment>(2)));
161 #endif // EIGEN_GEOMETRY_SSE_H static Quaternion< float > run(const QuaternionBase< Derived > &q)
static plain_matrix_type< VectorLhs >::type run(const VectorLhs &lhs, const VectorRhs &rhs)
EIGEN_DEVICE_FUNC Scalar z() const
static int f(const TensorMap< Tensor< int, 3 > > &tensor)
EIGEN_DEVICE_FUNC Packet padd(const Packet &a, const Packet &b)
EIGEN_DEVICE_FUNC const internal::traits< Derived >::Coefficients & coeffs() const
#define vec4f_swizzle1(v, p, q, r, s)
static Quaternion< float > run(const QuaternionBase< Derived > &_a, const QuaternionBase< OtherDerived > &_b)
EIGEN_DEVICE_FUNC const Scalar & q
Base class for quaternion expressions.
static Quaternion< double > run(const QuaternionBase< Derived > &q)
The quaternion class used to represent 3D orientations and rotations.
EIGEN_DEVICE_FUNC Packet psub(const Packet &a, const Packet &b)
EIGEN_STRONG_INLINE Packet2d pset1< Packet2d >(const double &from)
EIGEN_DEVICE_FUNC Packet pxor(const Packet &a, const Packet &b)
EIGEN_DEVICE_FUNC Scalar x() const
EIGEN_DEVICE_FUNC const Scalar & b
EIGEN_DEVICE_FUNC Packet pmul(const Packet &a, const Packet &b)
#define EIGEN_UNUSED_VARIABLE(var)
EIGEN_STRONG_INLINE Packet2cf preverse(const Packet2cf &a)
static Quaternion< double > run(const QuaternionBase< Derived > &_a, const QuaternionBase< OtherDerived > &_b)