diff options
author | Gael Guennebaud <g.gael@free.fr> | 2018-10-11 10:13:13 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2018-10-11 10:13:13 +0200 |
commit | 97e2c808e9acb9ef044fae14f7f4233bbb5020b6 (patch) | |
tree | c68c2e8d5e07d1f62694e8daf9360a7331abdb87 /Eigen/src/Core/arch/AVX512/MathFunctions.h | |
parent | b3f66d29a51614eab5809355593c9a7a3854a6ae (diff) |
Fix avx512 plog(NaN) to return NaN instead of +inf
Diffstat (limited to 'Eigen/src/Core/arch/AVX512/MathFunctions.h')
-rw-r--r-- | Eigen/src/Core/arch/AVX512/MathFunctions.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Eigen/src/Core/arch/AVX512/MathFunctions.h b/Eigen/src/Core/arch/AVX512/MathFunctions.h index 554788ffc..f26b49c95 100644 --- a/Eigen/src/Core/arch/AVX512/MathFunctions.h +++ b/Eigen/src/Core/arch/AVX512/MathFunctions.h @@ -64,11 +64,9 @@ plog<Packet16f>(const Packet16f& _x) { _EIGEN_DECLARE_CONST_Packet16f(cephes_log_q2, 0.693359375f); // invalid_mask is set to true when x is NaN - __mmask16 invalid_mask = - _mm512_cmp_ps_mask(x, _mm512_setzero_ps(), _CMP_NGE_UQ); - __mmask16 iszero_mask = - _mm512_cmp_ps_mask(x, _mm512_setzero_ps(), _CMP_EQ_UQ); - + __mmask16 invalid_mask = _mm512_cmp_ps_mask(x, _mm512_setzero_ps(), _CMP_NGE_UQ); + __mmask16 iszero_mask = _mm512_cmp_ps_mask(x, _mm512_setzero_ps(), _CMP_EQ_OQ); + // Truncate input values to the minimum positive normal. x = pmax(x, p16f_min_norm_pos); |