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