15 #ifndef EIGEN_MATH_FUNCTIONS_SSE_H 16 #define EIGEN_MATH_FUNCTIONS_SSE_H 19 #include "../../InternalHeaderCheck.h" 25 EIGEN_INSTANTIATE_GENERIC_MATH_FUNCS_FLOAT(Packet4f)
26 EIGEN_INSTANTIATE_GENERIC_MATH_FUNCS_DOUBLE(Packet2d)
33 EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet4f psqrt<Packet4f>(
const Packet4f& x) {
34 return _mm_sqrt_ps(x);
37 EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet2d psqrt<Packet2d>(
const Packet2d& x) {
38 return _mm_sqrt_pd(x);
41 EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet16b psqrt<Packet16b>(
const Packet16b& x) {
48 EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet4f prsqrt<Packet4f>(
const Packet4f& x) {
49 return generic_rsqrt_newton_step<Packet4f, 1>::run(x, _mm_rsqrt_ps(x));
52 #ifdef EIGEN_VECTORIZE_FMA 57 EIGEN_STRONG_INLINE Packet4f preciprocal<Packet4f>(
const Packet4f& x) {
58 return generic_reciprocal_newton_step<Packet4f, 1>::run(x, _mm_rcp_ps(x));
69 EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
float sqrt(
const float& x) {
70 return internal::pfirst(internal::Packet4f(_mm_sqrt_ss(_mm_set_ss(x))));
74 EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
double sqrt(
const double& x) {
75 #if EIGEN_COMP_GNUC_STRICT 78 return internal::pfirst(internal::Packet2d(__builtin_ia32_sqrtsd(_mm_set_sd(x))));
80 return internal::pfirst(internal::Packet2d(_mm_sqrt_pd(_mm_set_sd(x))));
88 #endif // EIGEN_MATH_FUNCTIONS_SSE_H const Eigen::CwiseUnaryOp< Eigen::internal::scalar_sqrt_op< typename Derived::Scalar >, const Derived > sqrt(const Eigen::ArrayBase< Derived > &x)
Namespace containing all symbols from the Eigen library.
Definition: B01_Experimental.dox:1