summaryrefslogtreecommitdiff
path: root/sysdeps/powerpc/fpu/e_hypotf.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/powerpc/fpu/e_hypotf.c')
-rw-r--r--sysdeps/powerpc/fpu/e_hypotf.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/sysdeps/powerpc/fpu/e_hypotf.c b/sysdeps/powerpc/fpu/e_hypotf.c
index 48360828c3..72b46ad9da 100644
--- a/sysdeps/powerpc/fpu/e_hypotf.c
+++ b/sysdeps/powerpc/fpu/e_hypotf.c
@@ -1,5 +1,5 @@
/* Pythagorean addition using floats
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Adhemerval Zanella <azanella@br.ibm.com>, 2011
@@ -31,10 +31,11 @@
#ifdef _ARCH_PWR7
/* POWER7 isinf and isnan optimizations are fast. */
# define TEST_INF_NAN(x, y) \
- if (isinff(x) || isinff(y)) \
+ if ((isinff(x) || isinff(y)) \
+ && !issignaling (x) && !issignaling (y)) \
return INFINITY; \
if (isnanf(x) || isnanf(y)) \
- return NAN;
+ return x + y;
# else
/* For POWER6 and below isinf/isnan triggers LHS and PLT calls are
* costly (especially for POWER6). */
@@ -56,9 +57,10 @@
uint32_t ht = hx; hx = hy; hy = ht; \
} \
if (hx >= 0x7f800000) { \
- if (hx == 0x7f800000 || hy == 0x7f800000) \
+ if ((hx == 0x7f800000 || hy == 0x7f800000) \
+ && !issignaling (x) && !issignaling (y)) \
return INFINITY; \
- return NAN; \
+ return x + y; \
} \
} while (0)
#endif
@@ -69,6 +71,6 @@ __ieee754_hypotf (float x, float y)
{
TEST_INF_NAN (x, y);
- return __ieee754_sqrt ((double) x * x + (double) y * y);
+ return sqrt ((double) x * x + (double) y * y);
}
strong_alias (__ieee754_hypotf, __hypotf_finite)