11 #ifndef EIGEN_GEOMETRY_SIMD_H
12 #define EIGEN_GEOMETRY_SIMD_H
14 #include "../InternalHeaderCheck.h"
20 template<
class Derived,
class OtherDerived>
21 struct quat_product<Architecture::
Target, Derived, OtherDerived, float>
24 AAlignment = traits<Derived>::Alignment,
25 BAlignment = traits<OtherDerived>::Alignment,
26 ResAlignment = traits<Quaternion<float> >::Alignment
28 static inline Quaternion<float> run(
const QuaternionBase<Derived>& _a,
const QuaternionBase<OtherDerived>& _b)
30 evaluator<typename Derived::Coefficients> ae(_a.coeffs());
31 evaluator<typename OtherDerived::Coefficients> be(_b.coeffs());
32 Quaternion<float>
res;
33 const float neg_zero = numext::bit_cast<float>(0x80000000u);
34 const float arr[4] = {0.f, 0.f, 0.f, neg_zero};
36 Packet4f a = ae.template packet<AAlignment,Packet4f>(0);
37 Packet4f b = be.template packet<BAlignment,Packet4f>(0);
40 pstoret<float,Packet4f,ResAlignment>(
51 template<
class Derived>
52 struct quat_conj<Architecture::
Target, Derived, float>
55 ResAlignment = traits<Quaternion<float> >::Alignment
57 static inline Quaternion<float> run(
const QuaternionBase<Derived>& q)
59 evaluator<typename Derived::Coefficients> qe(q.coeffs());
60 Quaternion<float>
res;
61 const float neg_zero = numext::bit_cast<float>(0x80000000u);
62 const float arr[4] = {neg_zero, neg_zero, neg_zero,0.f};
64 pstoret<float,Packet4f,ResAlignment>(&
res.x(),
pxor(mask, qe.template packet<traits<Derived>::Alignment,
Packet4f>(0)));
70 template<
typename VectorLhs,
typename VectorRhs>
71 struct cross3_impl<Architecture::
Target,VectorLhs,VectorRhs,float,true>
74 ResAlignment = traits<typename plain_matrix_type<VectorLhs>::type>::Alignment
76 static inline typename plain_matrix_type<VectorLhs>::type
77 run(
const VectorLhs& lhs,
const VectorRhs& rhs)
79 evaluator<VectorLhs> lhs_eval(lhs);
80 evaluator<VectorRhs> rhs_eval(rhs);
85 typename plain_matrix_type<VectorLhs>::type
res;
86 pstoret<float,Packet4f,ResAlignment>(&
res.x(),
psub(mul1,mul2));
93 #if (defined EIGEN_VECTORIZE_SSE) || (EIGEN_ARCH_ARM64)
95 template<
class Derived,
class OtherDerived>
96 struct quat_product<Architecture::
Target, Derived, OtherDerived, double>
99 BAlignment = traits<OtherDerived>::Alignment,
100 ResAlignment = traits<Quaternion<double> >::Alignment
103 static inline Quaternion<double> run(
const QuaternionBase<Derived>& _a,
const QuaternionBase<OtherDerived>& _b)
105 Quaternion<double>
res;
107 evaluator<typename Derived::Coefficients> ae(_a.coeffs());
108 evaluator<typename OtherDerived::Coefficients> be(_b.coeffs());
110 const double*
a = _a.coeffs().data();
111 Packet2d b_xy = be.template packet<BAlignment,Packet2d>(0);
112 Packet2d b_zw = be.template packet<BAlignment,Packet2d>(2);
143 template<
class Derived>
144 struct quat_conj<Architecture::
Target, Derived, double>
147 ResAlignment = traits<Quaternion<double> >::Alignment
149 static inline Quaternion<double> run(
const QuaternionBase<Derived>& q)
151 evaluator<typename Derived::Coefficients> qe(q.coeffs());
152 Quaternion<double>
res;
153 const double neg_zero = numext::bit_cast<double>(0x8000000000000000ull);
154 const double arr1[2] = {neg_zero, neg_zero};
155 const double arr2[2] = {neg_zero, 0.0};
158 pstoret<double,Packet2d,ResAlignment>(&
res.x(),
pxor(mask0, qe.template packet<traits<Derived>::Alignment,
Packet2d>(0)));
159 pstoret<double,Packet2d,ResAlignment>(&
res.z(),
pxor(mask2, qe.template packet<traits<Derived>::Alignment,
Packet2d>(2)));
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
Packet padd(const Packet &a, const Packet &b)
Packet pmul(const Packet &a, const Packet &b)
Packet4f ploadu< Packet4f >(const float *from)
Packet psub(const Packet &a, const Packet &b)
Packet2d pset1< Packet2d >(const double &from)
Packet2d ploadu< Packet2d >(const double *from)
Packet8h pxor(const Packet8h &a, const Packet8h &b)
Packet paddsub(const Packet &a, const Packet &b)
Packet2cf preverse(const Packet2cf &a)
Packet4f vec4f_swizzle1(const Packet4f &a, int p, int q, int r, int s)