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.20-569-gd4d0ecb


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  d4d0ecb24474928b9dfcce6c3f09694fab2400b6 (commit)
       via  08cee2a464f614a6d4275b5af6c52481f1aa16e6 (commit)
      from  5fe8e3597562ac8e0e3df1399ebf804f72e7f661 (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://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=d4d0ecb24474928b9dfcce6c3f09694fab2400b6

commit d4d0ecb24474928b9dfcce6c3f09694fab2400b6
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date:   Tue Jan 27 06:37:10 2015 -0600

    powerpc: Fix fesetexceptflag [BZ#17885]
    
    This patch fixes a bug introduced by 18f2945ae9216cfc, where it optimizes
    the FPSCR set by just issuing a mtfs instruction if new flag is different
    from older one.  The issue is a typo, where the new flag should the the
    new value, instead of the old one.
    
    It fixes BZ#17885.

diff --git a/ChangeLog b/ChangeLog
index 2e31200..52f8c11 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2015-01-28  Adhemerval Zanellla  <azanella@linux.vnet.ibm.com>
 
+	[BZ #17885]
+	* sysdeps/powerpc/fpu/fsetexcptflg.c (__fesetexceptflag): Fix correct
+	value to set as new flag.
+
 	[BZ #16576]
 	* sysdeps/powerpc/fpu/math_private.h [__CPU_HAS_FSQRT]: Remove define
 	and use _ARCH_PPCSQ instead.
diff --git a/NEWS b/NEWS
index 2e25c5c..1dcfc7d 100644
--- a/NEWS
+++ b/NEWS
@@ -18,7 +18,7 @@ Version 2.21
   17657, 17658, 17664, 17665, 17668, 17682, 17702, 17717, 17719, 17722,
   17723, 17724, 17725, 17732, 17733, 17744, 17745, 17746, 17747, 17748,
   17775, 17777, 17780, 17781, 17782, 17791, 17793, 17796, 17797, 17803,
-  17806, 17834, 17844, 17848, 17868, 17869, 17870
+  17806, 17834, 17844, 17848, 17868, 17869, 17870, 17885
 
 * A new semaphore algorithm has been implemented in generic C code for all
   machines. Previous custom assembly implementations of semaphore were
diff --git a/sysdeps/powerpc/fpu/fsetexcptflg.c b/sysdeps/powerpc/fpu/fsetexcptflg.c
index 5d99bf2..836d839 100644
--- a/sysdeps/powerpc/fpu/fsetexcptflg.c
+++ b/sysdeps/powerpc/fpu/fsetexcptflg.c
@@ -40,7 +40,7 @@ __fesetexceptflag (const fexcept_t *flagp, int excepts)
      This may cause floating-point exceptions if the restored state
      requests it.  */
   if (n.l != u.l)
-    fesetenv_register (u.fenv);
+    fesetenv_register (n.fenv);
 
   /* Deal with FE_INVALID_SOFTWARE not being implemented on some chips.  */
   if (flag & FE_INVALID)

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=08cee2a464f614a6d4275b5af6c52481f1aa16e6

commit 08cee2a464f614a6d4275b5af6c52481f1aa16e6
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date:   Tue Jan 27 13:16:39 2015 -0500

    powerpc: Fix fsqrt build in libm [BZ#16576]
    
    Some powerpc64 processors (e5500 core for instance) does not provide the
    fsqrt instruction, however current check to use in math_private.h is
    __WORDSIZE and _ARCH_PWR4 (ISA 2.02).  This is patch change it to use
    the compiler flag _ARCH_PPCSQ (which is the same condition GCC uses to
    decide whether to generate fsqrt instruction).
    
    It fixes BZ#16576.

diff --git a/ChangeLog b/ChangeLog
index c6227b7..2e31200 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2015-01-28  Adhemerval Zanellla  <azanella@linux.vnet.ibm.com>
+
+	[BZ #16576]
+	* sysdeps/powerpc/fpu/math_private.h [__CPU_HAS_FSQRT]: Remove define
+	and use _ARCH_PPCSQ instead.
+	(__ieee754_sqrt): Likewise.
+	(__ieee754_sqrtf): Likewise.
+	* sysdeps/powerpc/fpu/e_sqrt.c (__slow_ieee754_sqrt): Build only if
+	_ARCH_PPCSQ is defined.
+	(__ieee754_sqrt): Use _ARCH_PPCSQ to select wheter to use hardware
+	fsqrt instruction.
+	* sysdeps/powerpc/fpu/e_sqrtf.c (__ieee754_sqrtf): Build only if
+	_ARCH_PPCSQ is defined.
+	(__ieee754_sqrtf): Use _ARCH_PPCSQ to select wheter to use hardware
+	fsqrts instruction.
+	* sysdeps/powerpc/powerpc64/fpu/e_sqrt.c: Remove file.
+
 2015-01-27  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
 
 	* iconv/loop.c: Suppress array out of bound warning caused by GCC
diff --git a/NEWS b/NEWS
index 36b369f..2e25c5c 100644
--- a/NEWS
+++ b/NEWS
@@ -10,15 +10,15 @@ Version 2.21
 * The following bugs are resolved with this release:
 
   6652, 10672, 12674, 12847, 12926, 13862, 14132, 14138, 14171, 14498,
-  15215, 15378, 15884, 16009, 16418, 16191, 16469, 16617, 16619, 16657,
-  16740, 16857, 17192, 17266, 17273, 17344, 17363, 17370, 17371, 17411,
-  17460, 17475, 17485, 17501, 17506, 17508, 17522, 17555, 17570, 17571,
-  17572, 17573, 17574, 17582, 17583, 17584, 17585, 17589, 17594, 17601,
-  17608, 17616, 17625, 17630, 17633, 17634, 17635, 17647, 17653, 17657,
-  17658, 17664, 17665, 17668, 17682, 17702, 17717, 17719, 17722, 17723,
-  17724, 17725, 17732, 17733, 17744, 17745, 17746, 17747, 17748, 17775,
-  17777, 17780, 17781, 17782, 17791, 17793, 17796, 17797, 17803, 17806,
-  17834, 17844, 17848, 17868, 17869, 17870
+  15215, 15378, 15884, 16009, 16418, 16191, 16469, 16576, 16617, 16619,
+  16657, 16740, 16857, 17192, 17266, 17273, 17344, 17363, 17370, 17371,
+  17411, 17460, 17475, 17485, 17501, 17506, 17508, 17522, 17555, 17570,
+  17571, 17572, 17573, 17574, 17582, 17583, 17584, 17585, 17589, 17594,
+  17601, 17608, 17616, 17625, 17630, 17633, 17634, 17635, 17647, 17653,
+  17657, 17658, 17664, 17665, 17668, 17682, 17702, 17717, 17719, 17722,
+  17723, 17724, 17725, 17732, 17733, 17744, 17745, 17746, 17747, 17748,
+  17775, 17777, 17780, 17781, 17782, 17791, 17793, 17796, 17797, 17803,
+  17806, 17834, 17844, 17848, 17868, 17869, 17870
 
 * A new semaphore algorithm has been implemented in generic C code for all
   machines. Previous custom assembly implementations of semaphore were
diff --git a/sysdeps/powerpc/fpu/e_sqrt.c b/sysdeps/powerpc/fpu/e_sqrt.c
index ba77ae5..0934faa 100644
--- a/sysdeps/powerpc/fpu/e_sqrt.c
+++ b/sysdeps/powerpc/fpu/e_sqrt.c
@@ -24,6 +24,7 @@
 #include <sysdep.h>
 #include <ldsodefs.h>
 
+#ifndef _ARCH_PPCSQ
 static const double almost_half = 0.5000000000000001;	/* 0.5 + 2^-53 */
 static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
 static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
@@ -152,6 +153,7 @@ __slow_ieee754_sqrt (double x)
     }
   return f_wash (x);
 }
+#endif /* _ARCH_PPCSQ  */
 
 #undef __ieee754_sqrt
 double
@@ -159,16 +161,11 @@ __ieee754_sqrt (double x)
 {
   double z;
 
-  /* If the CPU is 64-bit we can use the optional FP instructions.  */
-  if (__CPU_HAS_FSQRT)
-    {
-      /* Volatile is required to prevent the compiler from moving the
-	 fsqrt instruction above the branch.  */
-      __asm __volatile ("	fsqrt	%0,%1\n"
-				:"=f" (z):"f" (x));
-    }
-  else
-    z = __slow_ieee754_sqrt (x);
+#ifdef _ARCH_PPCSQ
+  asm ("fsqrt %0,%1\n" :"=f" (z):"f" (x));
+#else
+  z = __slow_ieee754_sqrt (x);
+#endif
 
   return z;
 }
diff --git a/sysdeps/powerpc/fpu/e_sqrtf.c b/sysdeps/powerpc/fpu/e_sqrtf.c
index 5cf47f7..034b6f5 100644
--- a/sysdeps/powerpc/fpu/e_sqrtf.c
+++ b/sysdeps/powerpc/fpu/e_sqrtf.c
@@ -24,6 +24,7 @@
 #include <sysdep.h>
 #include <ldsodefs.h>
 
+#ifndef _ARCH_PPCSQ
 static const float almost_half = 0.50000006;	/* 0.5 + 2^-24 */
 static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
 static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
@@ -128,6 +129,7 @@ __slow_ieee754_sqrtf (float x)
     }
   return f_washf (x);
 }
+#endif /* _ARCH_PPCSQ  */
 
 #undef __ieee754_sqrtf
 float
@@ -135,16 +137,11 @@ __ieee754_sqrtf (float x)
 {
   double z;
 
-  /* If the CPU is 64-bit we can use the optional FP instructions.  */
-  if (__CPU_HAS_FSQRT)
-    {
-      /* Volatile is required to prevent the compiler from moving the
-	 fsqrt instruction above the branch.  */
-      __asm __volatile ("	fsqrts	%0,%1\n"
-				:"=f" (z):"f" (x));
-    }
-  else
-    z = __slow_ieee754_sqrtf (x);
+#ifdef _ARCH_PPCSQ
+  asm ("fsqrts	%0,%1\n" :"=f" (z):"f" (x));
+#else
+  z = __slow_ieee754_sqrtf (x);
+#endif
 
   return z;
 }
diff --git a/sysdeps/powerpc/fpu/math_private.h b/sysdeps/powerpc/fpu/math_private.h
index 6631535..37e7456 100644
--- a/sysdeps/powerpc/fpu/math_private.h
+++ b/sysdeps/powerpc/fpu/math_private.h
@@ -25,26 +25,17 @@
 #include <fenv_private.h>
 #include_next <math_private.h>
 
-# if __WORDSIZE == 64 || defined _ARCH_PWR4
-#  define __CPU_HAS_FSQRT 1
-# else
-#  define __CPU_HAS_FSQRT ((GLRO(dl_hwcap) & PPC_FEATURE_64) != 0)
-# endif
-
 extern double __slow_ieee754_sqrt (double);
 extern __always_inline double
 __ieee754_sqrt (double __x)
 {
   double __z;
 
-  if (__CPU_HAS_FSQRT)
-    {
-      /* Volatile is required to prevent the compiler from moving the
-         fsqrt instruction above the branch.  */
-      __asm __volatile ("fsqrt	%0,%1" : "=f" (__z) : "f" (__x));
-    }
-  else
-     __z = __slow_ieee754_sqrt(__x);
+#ifdef _ARCH_PPCSQ
+   asm ("fsqrt	%0,%1" : "=f" (__z) : "f" (__x));
+#else
+   __z = __slow_ieee754_sqrt(__x);
+#endif
 
   return __z;
 }
@@ -55,14 +46,11 @@ __ieee754_sqrtf (float __x)
 {
   float __z;
 
-  if (__CPU_HAS_FSQRT)
-    {
-      /* Volatile is required to prevent the compiler from moving the
-         fsqrts instruction above the branch.  */
-      __asm __volatile ("fsqrts	%0,%1" : "=f" (__z) : "f" (__x));
-    }
-  else
-     __z = __slow_ieee754_sqrtf(__x);
+#ifdef _ARCH_PPCSQ
+  asm ("fsqrts	%0,%1" : "=f" (__z) : "f" (__x));
+#else
+   __z = __slow_ieee754_sqrtf(__x);
+#endif
 
   return __z;
 }
diff --git a/sysdeps/powerpc/powerpc64/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc64/fpu/e_sqrt.c
deleted file mode 100644
index 796388e..0000000
--- a/sysdeps/powerpc/powerpc64/fpu/e_sqrt.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Double-precision floating point square root.
-   Copyright (C) 1997-2015 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <math.h>
-#include <math_private.h>
-
-#undef __ieee754_sqrt
-double
-__ieee754_sqrt (double x)
-{
-  double z;
-  __asm __volatile ("fsqrt %0,%1" : "=f" (z) : "f" (x));
-  return z;
-}
-strong_alias (__ieee754_sqrt, __sqrt_finite)
diff --git a/sysdeps/powerpc/powerpc64/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc64/fpu/e_sqrtf.c
deleted file mode 100644
index 5502525..0000000
--- a/sysdeps/powerpc/powerpc64/fpu/e_sqrtf.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Single-precision floating point square root.
-   Copyright (C) 1997-2015 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <math.h>
-#include <math_private.h>
-
-#undef __ieee754_sqrtf
-float
-__ieee754_sqrtf (float x)
-{
-  double z;
-  __asm ("fsqrts %0,%1" : "=f" (z) : "f" (x));
-  return z;
-}
-strong_alias (__ieee754_sqrtf, __sqrtf_finite)

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

Summary of changes:
 ChangeLog                               |   21 ++++++++++++++++++++
 NEWS                                    |   18 ++++++++--------
 sysdeps/powerpc/fpu/e_sqrt.c            |   17 ++++++---------
 sysdeps/powerpc/fpu/e_sqrtf.c           |   17 ++++++---------
 sysdeps/powerpc/fpu/fsetexcptflg.c      |    2 +-
 sysdeps/powerpc/fpu/math_private.h      |   32 +++++++++---------------------
 sysdeps/powerpc/powerpc64/fpu/e_sqrt.c  |   30 -----------------------------
 sysdeps/powerpc/powerpc64/fpu/e_sqrtf.c |   30 -----------------------------
 8 files changed, 55 insertions(+), 112 deletions(-)
 delete mode 100644 sysdeps/powerpc/powerpc64/fpu/e_sqrt.c
 delete mode 100644 sysdeps/powerpc/powerpc64/fpu/e_sqrtf.c


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]