]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Add a macro nan_mix() and use it to get NaN results that are (bitwise)
authorBruce Evans <bde@FreeBSD.org>
Tue, 17 Jul 2018 07:42:14 +0000 (07:42 +0000)
committerBruce Evans <bde@FreeBSD.org>
Tue, 17 Jul 2018 07:42:14 +0000 (07:42 +0000)
commit6f1b8a07926a4a00060628d9ed70412b4842ed69
tree40e5caffb074701452ed19594163c12f57de94f8
parent15430057b36bca4b765fdb8e5ca56c5cc5e54982
Add a macro nan_mix() and use it to get NaN results that are (bitwise)
independent of the precision in most cases.  This is mainly to simplify
checking for errors.  r176266 did this for e_pow[f].c using a less
refined expression that often didn't work.  r176276 fixes an error in
the log message for r176266.  The main refinement is to always expand
to long double precision.  See old log messages (especially these 2)
and the comment on the macro for more general details.

Specific details:
- using nan_mix() consistently for the new and old pow*() functions was
  the only thing needed to make my consistency test for powl() vs pow()
  pass on amd64.

- catrig[fl].c already had all the refinements, but open-coded.

- e_atan2[fl].c, e_fmod[fl].c and s_remquo[fl] only had primitive NaN
  mixing.

- e_hypot[fl].c already had a different refined version of r176266.  Refine
  this further.  nan_mix() is not directly usable here since we want to
  clear the sign bit.

- e_remainder[f].c already had an earlier version of r176266.

- s_ccosh[f].c,/s_csinh[f].c already had a version equivalent to r176266.
  Refine this further.  nan_mix() is not directly usable here since the
  expression has to handle some non-NaN cases.

- s_csqrt.[fl]: the mixing was special and mostly wrong.  Partially fix the
  special version.

- s_ctanh[f].c already had a version of r176266.
31 files changed:
lib/msun/ld128/e_powl.c
lib/msun/ld80/e_powl.c
lib/msun/src/catrig.c
lib/msun/src/catrigf.c
lib/msun/src/catrigl.c
lib/msun/src/e_atan2.c
lib/msun/src/e_atan2f.c
lib/msun/src/e_atan2l.c
lib/msun/src/e_fmod.c
lib/msun/src/e_fmodf.c
lib/msun/src/e_fmodl.c
lib/msun/src/e_hypot.c
lib/msun/src/e_hypotf.c
lib/msun/src/e_hypotl.c
lib/msun/src/e_pow.c
lib/msun/src/e_powf.c
lib/msun/src/e_remainder.c
lib/msun/src/e_remainderf.c
lib/msun/src/math_private.h
lib/msun/src/s_ccosh.c
lib/msun/src/s_ccoshf.c
lib/msun/src/s_csinh.c
lib/msun/src/s_csinhf.c
lib/msun/src/s_csqrt.c
lib/msun/src/s_csqrtf.c
lib/msun/src/s_csqrtl.c
lib/msun/src/s_ctanh.c
lib/msun/src/s_ctanhf.c
lib/msun/src/s_remquo.c
lib/msun/src/s_remquof.c
lib/msun/src/s_remquol.c