Fix float-to-double warning

This commit is contained in:
Gael Guennebaud 2018-10-16 09:19:45 +02:00
parent a39e0f7438
commit 0f780bb0b4

View File

@ -274,7 +274,7 @@ psqrt<Packet16f>(const Packet16f& _x) {
template <>
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet8d
psqrt<Packet8d>(const Packet8d& _x) {
Packet8d neg_half = pmul(_x, pset1<Packet8d>(-.5f));
Packet8d neg_half = pmul(_x, pset1<Packet8d>(-.5));
__mmask16 denormal_mask = _mm512_kand(
_mm512_cmp_pd_mask(_x, pset1<Packet8d>((std::numeric_limits<double>::min)()),
_CMP_LT_OQ),
@ -283,10 +283,10 @@ psqrt<Packet8d>(const Packet8d& _x) {
Packet8d x = _mm512_rsqrt14_pd(_x);
// Do a single step of Newton's iteration.
x = pmul(x, pmadd(neg_half, pmul(x, x), pset1<Packet8d>(1.5f)));
x = pmul(x, pmadd(neg_half, pmul(x, x), pset1<Packet8d>(1.5)));
// Do a second step of Newton's iteration.
x = pmul(x, pmadd(neg_half, pmul(x, x), pset1<Packet8d>(1.5f)));
x = pmul(x, pmadd(neg_half, pmul(x, x), pset1<Packet8d>(1.5)));
return _mm512_mask_blend_pd(denormal_mask, pmul(_x,x), _mm512_setzero_pd());
}