Make sure frexp() returns correct for argument 0.0
commita62597cfcaf5fc9c435dd723872145cc39d65887
authorErik Lindahl <erik.lindahl@gmail.com>
Tue, 24 Nov 2020 08:23:37 +0000 (24 08:23 +0000)
committerPaul Bauer <paul.bauer.q@gmail.com>
Tue, 24 Nov 2020 08:23:37 +0000 (24 08:23 +0000)
treea4663a138d6e36bb5da6e92a4bb3b055c8409bab
parenta30cf2a9ff42e025590f2c27b3d57715ae25dc9c
Make sure frexp() returns correct for argument 0.0

Previous functions in gromacs have never called frexp
with argument 0.0, but cbrt() needs this. This will not
have caused any bugs, but since it results in FP
exceptions in debug builds we want to have it fixed
so our unit tests work.

This change adds the correct behavior for all x86
SIMD instruction sets, and it has also been tested
on all of them in both single and double, with the
exception for MIC (which should be correct, but we
cannot test it).

The ARM SIMD flavors have not yet been fixed yet
since the ARM build fails due to an apparent nblib
error. Once that is fixed, I will add it in a separate
change and close the issue.

Refs #3773.
23 files changed:
src/gromacs/simd/impl_arm_neon/impl_arm_neon_simd_float.h
src/gromacs/simd/impl_arm_neon_asimd/impl_arm_neon_asimd_simd_double.h
src/gromacs/simd/impl_arm_sve/impl_arm_sve_simd_double.h
src/gromacs/simd/impl_arm_sve/impl_arm_sve_simd_float.h
src/gromacs/simd/impl_ibm_vmx/impl_ibm_vmx_simd_float.h
src/gromacs/simd/impl_ibm_vsx/impl_ibm_vsx_simd_double.h
src/gromacs/simd/impl_ibm_vsx/impl_ibm_vsx_simd_float.h
src/gromacs/simd/impl_reference/impl_reference_simd_double.h
src/gromacs/simd/impl_reference/impl_reference_simd_float.h
src/gromacs/simd/impl_x86_avx2_256/impl_x86_avx2_256_simd_double.h
src/gromacs/simd/impl_x86_avx2_256/impl_x86_avx2_256_simd_float.h
src/gromacs/simd/impl_x86_avx_256/impl_x86_avx_256_simd_double.h
src/gromacs/simd/impl_x86_avx_256/impl_x86_avx_256_simd_float.h
src/gromacs/simd/impl_x86_avx_512/impl_x86_avx_512_simd_double.h
src/gromacs/simd/impl_x86_avx_512/impl_x86_avx_512_simd_float.h
src/gromacs/simd/impl_x86_mic/impl_x86_mic_simd_double.h
src/gromacs/simd/impl_x86_mic/impl_x86_mic_simd_float.h
src/gromacs/simd/impl_x86_sse2/impl_x86_sse2_simd_double.h
src/gromacs/simd/impl_x86_sse2/impl_x86_sse2_simd_float.h
src/gromacs/simd/simd_math.h
src/gromacs/simd/tests/simd.cpp
src/gromacs/simd/tests/simd.h
src/gromacs/simd/tests/simd_floatingpoint.cpp