about summary refs log tree commit diff
path: root/sysdeps/powerpc
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/powerpc')
-rw-r--r--sysdeps/powerpc/fpu/e_hypot.c10
-rw-r--r--sysdeps/powerpc/fpu/e_hypotf.c10
2 files changed, 12 insertions, 8 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)
 
diff --git a/sysdeps/powerpc/fpu/e_hypotf.c b/sysdeps/powerpc/fpu/e_hypotf.c
index 48360828c3..c18281503c 100644
--- a/sysdeps/powerpc/fpu/e_hypotf.c
+++ b/sysdeps/powerpc/fpu/e_hypotf.c
@@ -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