aboutsummaryrefslogtreecommitdiff
path: root/math/math.h
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2017-10-31 16:01:51 +0000
committerJoseph Myers <joseph@codesourcery.com>2017-10-31 16:01:51 +0000
commit540af6e2f172a016719d3970433b9f6aeb0097f6 (patch)
tree01fe47b8d33f0de641ba55e0bcaa70f7eea285e4 /math/math.h
parent58af72b4e29d6e3bab230d10e42b1c74a8e5d7ab (diff)
downloadglibc-540af6e2f172a016719d3970433b9f6aeb0097f6.tar
glibc-540af6e2f172a016719d3970433b9f6aeb0097f6.tar.gz
glibc-540af6e2f172a016719d3970433b9f6aeb0097f6.tar.bz2
glibc-540af6e2f172a016719d3970433b9f6aeb0097f6.zip
Adjust __MATH_EVAL_FMT2 definition to handle _Float16 better.
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.
Diffstat (limited to 'math/math.h')
-rw-r--r--math/math.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/math/math.h b/math/math.h
index 125d845c86..326fd8ebe1 100644
--- a/math/math.h
+++ b/math/math.h
@@ -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