]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Adjust __MATH_EVAL_FMT2 definition to handle _Float16 better.
authorJoseph Myers <joseph@codesourcery.com>
Tue, 31 Oct 2017 16:01:51 +0000 (16:01 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Tue, 31 Oct 2017 16:01:51 +0000 (16:01 +0000)
Continuing the preparation for additional _FloatN / _FloatNx type
support, this patch adds an additional case in the definition of
__MATH_EVAL_FMT2, as used in defining iseqsig: when
__FLT_EVAL_METHOD__ is 0 or 32, it adds 0.0f to the arguments, so that
the correct function would be selected in the case of _Float16
arguments with excess precision (were glibc to support _Float16, which
of course __MATH_TG and other facilities do not at present - and
_Float16 support is not part of what this patch series is aiming for,
but this particular fix is simple so is included anyway).

Tested for x86_64.

* math/math.h
[__FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == 32]
(__MATH_EVAL_FMT2): Define to add 0.0f.

ChangeLog
math/math.h

index 2bf841cfd18d96ba394f95da0cd9333d4d8ded46..52ee8ee2f19e9ea36635260bb1544d5b8ec21bce 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-10-31  Joseph Myers  <joseph@codesourcery.com>
+
+       * math/math.h
+       [__FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == 32]
+       (__MATH_EVAL_FMT2): Define to add 0.0f.
+
 2017-10-31  Alan Modra  <amodra@gmail.com>
 
        * sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf-power8.S: Don't
index 125d845c86477531e319ee58a306262535408ba1..326fd8ebe1330a8b2ee3896591b0709c4ca88705 100644 (file)
@@ -1144,6 +1144,8 @@ iszero (__T __val)
 #  define __MATH_EVAL_FMT2(x, y) ((x) + (y) + 0.0L)
 # elif __FLT_EVAL_METHOD__ == 1 || __FLT_EVAL_METHOD__ > 32
 #  define __MATH_EVAL_FMT2(x, y) ((x) + (y) + 0.0)
+# elif __FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == 32
+#  define __MATH_EVAL_FMT2(x, y) ((x) + (y) + 0.0f)
 # else
 #  define __MATH_EVAL_FMT2(x, y) ((x) + (y))
 # endif