aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/powerpc/fpu/e_hypot.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/powerpc/fpu/e_hypot.c')
-rw-r--r--sysdeps/powerpc/fpu/e_hypot.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sysdeps/powerpc/fpu/e_hypot.c b/sysdeps/powerpc/fpu/e_hypot.c
index da0f2daed3..65314c6ff5 100644
--- a/sysdeps/powerpc/fpu/e_hypot.c
+++ b/sysdeps/powerpc/fpu/e_hypot.c
@@ -41,10 +41,11 @@ static const double pdnum = 2.225073858507201e-308;
#ifdef _ARCH_PWR7
/* POWER7 isinf and isnan optimization are fast. */
# define TEST_INF_NAN(x, y) \
- if (isinf(x) || isinf(y)) \
+ if ((isinf(x) || isinf(y)) \
+ && !issignaling (x) && !issignaling (y)) \
return INFINITY; \
if (isnan(x) || isnan(y)) \
- return NAN;
+ return x + y;
# else
/* For POWER6 and below isinf/isnan triggers LHS and PLT calls are
* costly (especially for POWER6). */
@@ -66,9 +67,10 @@ static const double pdnum = 2.225073858507201e-308;
uint32_t ht = hx; hx = hy; hy = ht; \
} \
if (hx >= 0x7ff00000) { \
- if (hx == 0x7ff00000 || hy == 0x7ff00000) \
+ if ((hx == 0x7ff00000 || hy == 0x7ff00000) \
+ && !issignaling (x) && !issignaling (y)) \
return INFINITY; \
- return NAN; \
+ return x + y; \
} \
} while (0)