Fix bug #859: pexp(NaN) returned Inf instead of NaN

This commit is contained in:
Gael Guennebaud
2014-10-20 11:38:51 +02:00
parent b4a9b3f496
commit aa5f79206f
4 changed files with 27 additions and 21 deletions

View File

@@ -167,7 +167,7 @@ Packet4f pexp<Packet4f>(const Packet4f& _x)
emm0 = _mm_cvttps_epi32(fx);
emm0 = _mm_add_epi32(emm0, p4i_0x7f);
emm0 = _mm_slli_epi32(emm0, 23);
return pmul(y, Packet4f(_mm_castsi128_ps(emm0)));
return pmax(pmul(y, Packet4f(_mm_castsi128_ps(emm0))), _x);
}
template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED
Packet2d pexp<Packet2d>(const Packet2d& _x)