29e444
From ed81f668f7c9eff0692c3c81691a7380b55063ff Mon Sep 17 00:00:00 2001
29e444
From: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
29e444
Date: Fri, 17 May 2013 08:12:16 -0500
29e444
Subject: [PATCH 28/42] PowerPC: fix hypot/hypotf check for -INF (cherry
29e444
 picked from commit
29e444
 13d3b41a36c4f28d171a144f8a9baad3a8835981) (backported
29e444
 missing CL/NEWS from commit
29e444
 68191c1d59d40b3d9f5babef4f37f265920ff565)
29e444
29e444
---
29e444
 sysdeps/powerpc/fpu/e_hypot.c  | 6 +++---
29e444
 sysdeps/powerpc/fpu/e_hypotf.c | 6 +++---
29e444
 4 files changed, 14 insertions(+), 7 deletions(-)
29e444
12745e
diff --git glibc-2.17-c758a686/sysdeps/powerpc/fpu/e_hypot.c glibc-2.17-c758a686/sysdeps/powerpc/fpu/e_hypot.c
29e444
index cfadd5c..fc17bea 100644
12745e
--- glibc-2.17-c758a686/sysdeps/powerpc/fpu/e_hypot.c
12745e
+++ glibc-2.17-c758a686/sysdeps/powerpc/fpu/e_hypot.c
29e444
@@ -52,13 +52,13 @@ static const double pdnum   = 2.225073858507201e-308;
29e444
    ieee_double_shape_type gh_u2;                                  \
29e444
    gh_u1.value = (d1);                                            \
29e444
    gh_u2.value = (d2);                                            \
29e444
-   (i1) = gh_u1.parts.msw;                                        \
29e444
-   (i2) = gh_u2.parts.msw;                                        \
29e444
+   (i1) = gh_u1.parts.msw & 0x7fffffff;                           \
29e444
+   (i2) = gh_u2.parts.msw & 0x7fffffff;                           \
29e444
  } while (0)
29e444
 
29e444
 # define TEST_INF_NAN(x, y)                                      \
29e444
  do {                                                            \
29e444
-   int32_t hx, hy;                                               \
29e444
+   uint32_t hx, hy;                                              \
29e444
    GET_TW0_HIGH_WORD(x, y, hx, hy);                              \
29e444
    if (hy > hx) {                                                \
29e444
      uint32_t ht = hx; hx = hy; hy = ht;                         \
12745e
diff --git glibc-2.17-c758a686/sysdeps/powerpc/fpu/e_hypotf.c glibc-2.17-c758a686/sysdeps/powerpc/fpu/e_hypotf.c
29e444
index 92e824d..77c1b17 100644
12745e
--- glibc-2.17-c758a686/sysdeps/powerpc/fpu/e_hypotf.c
12745e
+++ glibc-2.17-c758a686/sysdeps/powerpc/fpu/e_hypotf.c
29e444
@@ -46,13 +46,13 @@ static const float two30  = 1.0737418e09;
29e444
    ieee_float_shape_type gf_u2;                                  \
29e444
    gf_u1.value = (f1);                                           \
29e444
    gf_u2.value = (f2);                                           \
29e444
-   (i1) = gf_u1.word;                                            \
29e444
-   (i2) = gf_u2.word;                                            \
29e444
+   (i1) = gf_u1.word & 0x7fffffff;                               \
29e444
+   (i2) = gf_u2.word & 0x7fffffff;                               \
29e444
  } while (0)
29e444
 
29e444
 # define TEST_INF_NAN(x, y)                                      \
29e444
  do {                                                            \
29e444
-   int32_t hx, hy;                                               \
29e444
+   uint32_t hx, hy;                                              \
29e444
    GET_TWO_FLOAT_WORD(x, y, hx, hy);                             \
29e444
    if (hy > hx) {                                                \
29e444
      uint32_t ht = hx; hx = hy; hy = ht;                         \
29e444
-- 
29e444
1.7.11.7
29e444