mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Make preciprocal IEEE compliant w.r.t. 1/0 and 1/inf.
This commit is contained in:
@@ -148,11 +148,17 @@ Packet4f prsqrt<Packet4f>(const Packet4f& _x) {
|
||||
return pselect<Packet4f>(not_normal_finite_mask, y_approx, y_newton);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef EIGEN_VECTORIZE_FMA
|
||||
// Trying to speed up reciprocal using Newton-Raphson is counterproductive
|
||||
// unless FMA is available. Without FMA pdiv(pset1<Packet>(Scalar(1),a) is
|
||||
// 30% faster.
|
||||
template<> EIGEN_STRONG_INLINE Packet4f preciprocal<Packet4f>(const Packet4f& a) {
|
||||
return generic_reciprocal_newton_step<Packet4f, /*Steps=*/1>::run(a, _mm_rcp_ps(a));
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// Hyperbolic Tangent function.
|
||||
|
||||
Reference in New Issue
Block a user