This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch, master, updated. glibc-2.15-402-g11e0098


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  11e0098ef008db301a82b753dda466dc61cdd0bc (commit)
      from  e85b09d0642e546d3049a33bf1662404b374d376 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=11e0098ef008db301a82b753dda466dc61cdd0bc

commit 11e0098ef008db301a82b753dda466dc61cdd0bc
Author: Andreas Schwab <schwab@linux-m68k.org>
Date:   Thu Mar 15 15:16:31 2012 +0100

    Use double precision instead of scaling for powerpc __ieee754_hypotf

diff --git a/ChangeLog b/ChangeLog
index 5978824..2765185 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-03-15  Andreas Schwab  <schwab@linux-m68k.org>
+
+	* sysdeps/powerpc/fpu/e_hypotf.c: Use double precision instead of
+	scaling.
+	* sysdeps/powerpc/fpu/libm-test-ulps: Update.
+
 2012-03-15  Andreas Jaeger  <aj@suse.de>
 
 	[BZ #13852]
diff --git a/sysdeps/powerpc/fpu/e_hypotf.c b/sysdeps/powerpc/fpu/e_hypotf.c
index 3838f53..92e824d 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 Free Software Foundation, Inc.
+   Copyright (C) 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Adhemerval Zanella <azanella@br.ibm.com>, 2011
 
@@ -22,21 +22,13 @@
 
 
 static const float two30  = 1.0737418e09;
-static const float two50  = 1.1259000e15;
-static const float two60  = 1.1529221e18;
-static const float two126 = 8.5070592e+37;
-static const float twoM50 = 8.8817842e-16;
-static const float twoM60 = 6.7762644e-21;
-static const float pdnum  = 1.1754939e-38;
-
 
 /* __ieee754_hypotf(x,y)
- *
- * This a FP only version without any FP->INT conversion.
- * It is similar to default C version, making appropriates
- * overflow and underflows checks as well scaling when it
- * is needed.
- */
+
+   This a FP only version without any FP->INT conversion.
+   It is similar to default C version, making appropriates
+   overflow and underflows checks as using double precision
+   instead of scaling.  */
 
 #ifdef _ARCH_PWR7
 /* POWER7 isinf and isnan optimizations are fast. */
@@ -92,27 +84,7 @@ __ieee754_hypotf (float x, float y)
     {
       return x + y;
     }
-  if (x > two50)
-    {
-      x *= twoM60;
-      y *= twoM60;
-      return __ieee754_sqrtf (x * x + y * y) / twoM60;
-    }
-  if (y < twoM50)
-    {
-      if (y <= pdnum)
-	{
-	  x *= two126;
-	  y *= two126;
-	  return __ieee754_sqrtf (x * x + y * y) / two126;
-	}
-      else
-	{
-	  x *= two60;
-	  y *= two60;
-	  return __ieee754_sqrtf (x * x + y * y) / two60;
-	}
-    }
-  return __ieee754_sqrtf (x * x + y * y);
+
+  return __ieee754_sqrt ((double) x * x + (double) y * y);
 }
 strong_alias (__ieee754_hypotf, __hypotf_finite)
diff --git a/sysdeps/powerpc/fpu/libm-test-ulps b/sysdeps/powerpc/fpu/libm-test-ulps
index eaa734f..9e00029 100644
--- a/sysdeps/powerpc/fpu/libm-test-ulps
+++ b/sysdeps/powerpc/fpu/libm-test-ulps
@@ -1119,10 +1119,7 @@ ildouble: 1
 ldouble: 1
 Test "hypot (0x1.234566p-126, 0x1.234566p-126) == 1.891441686191081936598531534017449451173e-38":
 double: 1
-float: 6
 idouble: 1
-Test "hypot (0x3p125, 0x4p125) == 0x5p125":
-float: 1
 Test "hypot (12.4, -0.7) == 12.419742348374220601176836866763271":
 double: 1
 float: 1
@@ -2247,7 +2244,7 @@ ldouble: 1
 
 Function: "hypot":
 double: 1
-float: 6
+float: 1
 idouble: 1
 ifloat: 1
 ildouble: 1

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                          |    6 +++++
 sysdeps/powerpc/fpu/e_hypotf.c     |   44 ++++++-----------------------------
 sysdeps/powerpc/fpu/libm-test-ulps |    5 +---
 3 files changed, 15 insertions(+), 40 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]