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 rsa/2.17_backports_v3 created. glibc-2.17-27-g01c3d9b


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, rsa/2.17_backports_v3 has been created
        at  01c3d9bb14a1e90159d6999cf3469e62c0c5d4b2 (commit)

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=01c3d9bb14a1e90159d6999cf3469e62c0c5d4b2

commit 01c3d9bb14a1e90159d6999cf3469e62c0c5d4b2
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date:   Fri May 3 15:00:31 2013 -0500

    PowerPC: Add time vDSO support
    
    PowerPC kernel now provides a vDSO implementation for time syscall
    (commit fcb41a2030abe0eb716ef0798035ef9562097f42). This patch changes
    time syscall wrapper to use the vDSO when available. It also changes
    the default non vDSO time on PowerPC to use sysdeps/posix/time.c
    (since gettimeofday is a vDSO call).
    (cherry picked from commit 83e7640f6bf68708ecf0b09d83c670203167271e)

diff --git a/ChangeLog b/ChangeLog
index 10e84d1..5e72136 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2013-04-30  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
+
+	* sysdeps/unix/sysv/linux/powerpc/Versions: Add __vdso_time symbol.
+	* sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h: Add __vdso_time
+	definition.
+	(VDSO_IFUNC_RET): Cast to void * to silence compiler warning.
+	* sysdeps/unix/sysv/linux/powerpc/init-first.c
+	(_libc_vdso_platform_setup): Add __vdso_time initialization.
+	* sysdeps/unix/sysv/linux/powerpc/time.c: New file: time implementation
+	for PowerPC using vDSO where is avaliable or gettimeofday as a fallback.
+
 2013-04-26  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
 
 	* sysdeps/powerpc/power5/fpu/s_modf.c: Moved to ...
diff --git a/sysdeps/unix/sysv/linux/powerpc/Versions b/sysdeps/unix/sysv/linux/powerpc/Versions
index 396a423..289c4fe 100644
--- a/sysdeps/unix/sysv/linux/powerpc/Versions
+++ b/sysdeps/unix/sysv/linux/powerpc/Versions
@@ -4,5 +4,6 @@ libc {
     __vdso_clock_gettime;
     __vdso_clock_getres;
     __vdso_getcpu;
+    __vdso_time;
   }
 }
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h b/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h
index e4ae630..f7f635e 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h
@@ -32,14 +32,16 @@ extern void *__vdso_get_tbfreq;
 
 extern void *__vdso_getcpu;
 
+extern void *__vdso_time;
+
 /* This macro is needed for PPC64 to return a skeleton OPD entry of a vDSO
    symbol.  This works because _dl_vdso_vsym always return the function
    address, and no vDSO symbols use the TOC or chain pointers from the OPD
    so we can allow them to be garbage.  */
 #if defined(__PPC64__) || defined(__powerpc64__)
-#define VDSO_IFUNC_RET(value)  &value
+#define VDSO_IFUNC_RET(value)  ((void *) &(value))
 #else
-#define VDSO_IFUNC_RET(value)  value
+#define VDSO_IFUNC_RET(value)  ((void *) (value))
 #endif
 
 #endif
diff --git a/sysdeps/unix/sysv/linux/powerpc/init-first.c b/sysdeps/unix/sysv/linux/powerpc/init-first.c
index 5587e2a..3cefd9b 100644
--- a/sysdeps/unix/sysv/linux/powerpc/init-first.c
+++ b/sysdeps/unix/sysv/linux/powerpc/init-first.c
@@ -28,7 +28,7 @@ void *__vdso_clock_gettime;
 void *__vdso_clock_getres;
 void *__vdso_get_tbfreq;
 void *__vdso_getcpu;
-
+void *__vdso_time;
 
 static inline void
 _libc_vdso_platform_setup (void)
@@ -44,6 +44,8 @@ _libc_vdso_platform_setup (void)
   __vdso_get_tbfreq = _dl_vdso_vsym ("__kernel_get_tbfreq", &linux2615);
 
   __vdso_getcpu = _dl_vdso_vsym ("__kernel_getcpu", &linux2615);
+
+  __vdso_time = _dl_vdso_vsym ("__kernel_time", &linux2615);
 }
 
 # define VDSO_SETUP _libc_vdso_platform_setup
diff --git a/sysdeps/unix/sysv/linux/powerpc/time.c b/sysdeps/unix/sysv/linux/powerpc/time.c
new file mode 100644
index 0000000..66b4eb3
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/time.c
@@ -0,0 +1,62 @@
+/* time system call for Linux/PowerPC.
+   Copyright (C) 2013 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/>.  */
+
+#ifdef SHARED
+
+# include <time.h>
+# include <sysdep.h>
+# include <bits/libc-vdso.h>
+
+void *time_ifunc (void) asm ("time");
+
+static time_t
+time_syscall (time_t *t)
+{
+  struct timeval tv;
+  time_t result;
+
+  if (INLINE_VSYSCALL (gettimeofday, 2, &tv, NULL) < 0)
+    result = (time_t) -1;
+  else
+    result = (time_t) tv.tv_sec;
+
+  if (t != NULL)
+    *t = result;
+  return result;
+}
+
+void *
+time_ifunc (void)
+{
+  /* If the vDSO is not available we fall back to the syscall.  */
+  return (__vdso_time ? VDSO_IFUNC_RET (__vdso_time)
+	  : time_syscall);
+}
+asm (".type time, %gnu_indirect_function");
+
+/* This is doing "libc_hidden_def (time)" but the compiler won't
+ * let us do it in C because it doesn't know we're defining time
+ * here in this file.  */
+asm (".globl __GI_time\n"
+     "__GI_time = time");
+
+#else
+
+#include <sysdeps/posix/time.c>
+
+#endif

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

commit 599fefcc3e7fbf65d9c441bf1b336b272c39f262
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date:   Fri Apr 26 13:00:56 2013 -0500

    PowerPC: modf optimization fix
    
    This patch fix the 3c0265394d9ffedff2b0de508602dc52e077ce5c commits
    by correctly setting minimum architecture for modf PPC optimization
    to power5+ instead of power5 (since only on power5+ round/ceil will
    be inline to inline assembly).
    (cherry picked from commit aa630f590c9c7d070a7cdf3a2a88069ad6b63de9)

diff --git a/ChangeLog b/ChangeLog
index 3b1a5bc..10e84d1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2013-04-26  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
+
+	* sysdeps/powerpc/power5/fpu/s_modf.c: Moved to ...
+	* sysdeps/powerpc/power5+/fpu/s_modf.c: ... this.
+	* sysdeps/powerpc/power5/fpu/s_modff.c: Moved to ...
+	* sysdeps/powerpc/power5+/fpu/s_modff.c: ... this.
+	* sysdeps/powerpc/powerpc32/power5+/Implies: Add powerpc/power5+ and
+	powerpc/power5+/fpu folders.
+	* sysdeps/powerpc/powerpc64/power5+/Implies: Likewise.
+
 2013-04-23  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
 
 	* sysdeps/powerpc/power5/fpu/s_modf.c: New file: modf optimization for
diff --git a/sysdeps/powerpc/power5/fpu/s_modf.c b/sysdeps/powerpc/power5+/fpu/s_modf.c
similarity index 100%
rename from sysdeps/powerpc/power5/fpu/s_modf.c
rename to sysdeps/powerpc/power5+/fpu/s_modf.c
diff --git a/sysdeps/powerpc/power5/fpu/s_modff.c b/sysdeps/powerpc/power5+/fpu/s_modff.c
similarity index 100%
rename from sysdeps/powerpc/power5/fpu/s_modff.c
rename to sysdeps/powerpc/power5+/fpu/s_modff.c
diff --git a/sysdeps/powerpc/powerpc32/power5+/Implies b/sysdeps/powerpc/powerpc32/power5+/Implies
index a51d2fd..02d222d 100644
--- a/sysdeps/powerpc/powerpc32/power5+/Implies
+++ b/sysdeps/powerpc/powerpc32/power5+/Implies
@@ -1,2 +1,4 @@
+powerpc/power5+/fpu
+powerpc/power5+
 powerpc/powerpc32/power5/fpu
 powerpc/powerpc32/power5
diff --git a/sysdeps/powerpc/powerpc64/power5+/Implies b/sysdeps/powerpc/powerpc64/power5+/Implies
index a01a13a..565bc94 100644
--- a/sysdeps/powerpc/powerpc64/power5+/Implies
+++ b/sysdeps/powerpc/powerpc64/power5+/Implies
@@ -1,2 +1,4 @@
+powerpc/power5+/fpu
+powerpc/power5+
 powerpc/powerpc64/power5/fpu
 powerpc/powerpc64/power5

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

commit 51c33bd233d00d77f268ec28565506a6cd1e7d10
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date:   Mon Mar 25 16:10:06 2013 -0500

    PowerPC: modf optimization
    
    This patch implements modf/modff optimization for POWER by focus
    on FP operations instead of relying in integer ones.
    (backported from commit 3c0265394d9ffedff2b0de508602dc52e077ce5c)
    
    This backport does not include the benchmark tests from the original
    commit.

diff --git a/ChangeLog b/ChangeLog
index 8a23a3d..3b1a5bc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2013-04-23  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
+
+	* sysdeps/powerpc/power5/fpu/s_modf.c: New file: modf optimization for
+	POWER.
+	* sysdeps/powerpc/power5/fpu/s_modff.c: New file: modff optimization
+	for POWER.
+	* sysdeps/powerpc/powerpc64/power5/Implies: Add powerpc/power5 and
+	powerpc/power5/fpu folders.
+	* sysdeps/powerpc/powerpc32/power5/Implies: Likewise.
+
 2013-04-02  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
 
 	* sysdeps/powerpc/powerpc32/fpu/s_rint.S: Remove branch prediction
diff --git a/sysdeps/powerpc/power5/fpu/s_modf.c b/sysdeps/powerpc/power5/fpu/s_modf.c
new file mode 100644
index 0000000..b45bf66
--- /dev/null
+++ b/sysdeps/powerpc/power5/fpu/s_modf.c
@@ -0,0 +1,58 @@
+/* Copyright (C) 2013 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If
+   not, see <http://www.gnu.org/licenses/>.  */
+
+#include <math.h>
+#include <math_private.h>
+#include <math_ldbl_opt.h>
+
+double
+__modf (double x, double *iptr)
+{
+  if (__builtin_isinf (x))
+    {
+      *iptr = x;
+      return __copysign (0.0, x);
+    }
+  else if (__builtin_isnan (x))
+    {
+      *iptr = NAN;
+      return NAN;
+    }
+
+  if (x >= 0.0)
+    {
+      *iptr = __floor (x);
+      return (x - *iptr);
+    }
+  else
+    {
+      *iptr = __ceil (x);
+      return (x - *iptr);
+    }
+}
+weak_alias (__modf, modf)
+#ifdef NO_LONG_DOUBLE
+strong_alias (__modf, __modfl)
+weak_alias (__modf, modfl)
+#endif
+#ifdef IS_IN_libm
+# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __modf, modfl, GLIBC_2_0);
+# endif
+#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+compat_symbol (libc, __modf, modfl, GLIBC_2_0);
+#endif
diff --git a/sysdeps/powerpc/power5/fpu/s_modff.c b/sysdeps/powerpc/power5/fpu/s_modff.c
new file mode 100644
index 0000000..55759cd
--- /dev/null
+++ b/sysdeps/powerpc/power5/fpu/s_modff.c
@@ -0,0 +1,46 @@
+/* Copyright (C) 2013 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If
+   not, see <http://www.gnu.org/licenses/>.  */
+
+#include <math.h>
+#include <math_private.h>
+
+float
+__modff (float x, float *iptr)
+{
+  if (__builtin_isinff (x))
+    {
+      *iptr = x;
+      return __copysignf (0.0, x);
+    }
+  else if (__builtin_isnanf (x))
+    {
+      *iptr = NAN;
+      return NAN;
+    }
+
+  if (x >= 0.0)
+    {
+      *iptr = __floorf (x);
+      return (x - *iptr);
+    }
+  else
+    {
+      *iptr = __ceilf (x);
+      return (x - *iptr);
+    }
+}
+weak_alias (__modff, modff)
diff --git a/sysdeps/powerpc/powerpc32/power5/Implies b/sysdeps/powerpc/powerpc32/power5/Implies
index 17139bf..17949d4 100644
--- a/sysdeps/powerpc/powerpc32/power5/Implies
+++ b/sysdeps/powerpc/powerpc32/power5/Implies
@@ -1,2 +1,4 @@
+powerpc/power5/fpu
+powerpc/power5
 powerpc/powerpc32/power4/fpu
 powerpc/powerpc32/power4
diff --git a/sysdeps/powerpc/powerpc64/power5/Implies b/sysdeps/powerpc/powerpc64/power5/Implies
index bedb20b..b36831e 100644
--- a/sysdeps/powerpc/powerpc64/power5/Implies
+++ b/sysdeps/powerpc/powerpc64/power5/Implies
@@ -1,2 +1,4 @@
+powerpc/power5/fpu
+powerpc/power5
 powerpc/powerpc64/power4/fpu
 powerpc/powerpc64/power4

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

commit 812d5041cc894813365567180a443cb00ecad723
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date:   Tue Apr 2 07:08:09 2013 -0500

    Add missing ChangeLog from commit 60c414c346a1d5ef0510ffbdc0ab75f288ee4d3f
    (cherry picked from commit ab0f1aa99467436c38c1a3a419200f8e07cd12a5)

diff --git a/ChangeLog b/ChangeLog
index 3eee9be..8a23a3d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2013-04-02  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
+
+	* sysdeps/powerpc/powerpc32/fpu/s_rint.S: Remove branch prediction
+	instructions.
+	* sysdeps/powerpc/powerpc32/fpu/s_rintf.S: Likewise.
+	* sysdeps/powerpc/powerpc64/fpu/s_rint.S: Likewise.
+	* sysdeps/powerpc/powerpc64/fpu/s_rintf.S: Likewise.
+	* benchtests/Makefile: Add rint benchtest.
+	* benchtests/rint-inputs: Input for rint benchtest.
+
 2013-03-28  Alan Modra  <amodra@gmail.com>
 
 	* sysdeps/powerpc/powerpc32/start.S (cfi_startproc, cfi_endproc):

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

commit 987322bc0b170570a7bd539480252453fcc7a6f5
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date:   Fri Mar 29 18:15:28 2013 -0500

    PowerPC: remove branch prediction from rint implementation
    
    The branch prediction hints is actually hurts performance in this case.
    The assembly implementation make two assumptions: 1. 'fabs (x) < 2^52'
    is unlikely and 2. 'x > 0.0' is unlike (if 1. is true). Since it a
    general floating point function, expected input is not bounded and then
    it is better to let the hardware handle the branches.
    
    (backported from commit 60c414c346a1d5ef0510ffbdc0ab75f288ee4d3f)
    
    This backport does not include the benchmark tests from the original
    commit.

diff --git a/sysdeps/powerpc/powerpc32/fpu/s_rint.S b/sysdeps/powerpc/powerpc32/fpu/s_rint.S
index 0ab9e6c..c28e7f6 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_rint.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_rint.S
@@ -45,14 +45,14 @@ ENTRY (__rint)
 	fsub	fp12,fp13,fp13	/* generate 0.0  */
 	fcmpu	cr7,fp0,fp13	/* if (fabs(x) > TWO52)  */
 	fcmpu	cr6,fp1,fp12	/* if (x > 0.0)  */
-	bnllr-	cr7
-	bng-	cr6,.L4
+	bnllr	cr7
+	bng	cr6,.L4
 	fadd	fp1,fp1,fp13	/* x+= TWO52;  */
 	fsub	fp1,fp1,fp13	/* x-= TWO52;  */
 	fabs	fp1,fp1		/* if (x == 0.0)  */
 	blr			/* x = 0.0; */
 .L4:
-	bnllr-	cr6		/* if (x < 0.0)  */
+	bnllr	cr6		/* if (x < 0.0)  */
 	fsub	fp1,fp1,fp13	/* x-= TWO52;  */
 	fadd	fp1,fp1,fp13	/* x+= TWO52;  */
 	fnabs	fp1,fp1		/* if (x == 0.0)  */
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_rintf.S b/sysdeps/powerpc/powerpc32/fpu/s_rintf.S
index ddb47db..69aed9c 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_rintf.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_rintf.S
@@ -41,14 +41,14 @@ ENTRY (__rintf)
 	fsubs	fp12,fp13,fp13	/* generate 0.0  */
 	fcmpu	cr7,fp0,fp13	/* if (fabs(x) > TWO23)  */
 	fcmpu	cr6,fp1,fp12	/* if (x > 0.0)  */
-	bnllr-	cr7
-	bng-	cr6,.L4
+	bnllr	cr7
+	bng	cr6,.L4
 	fadds	fp1,fp1,fp13	/* x+= TWO23;  */
 	fsubs	fp1,fp1,fp13	/* x-= TWO23;  */
 	fabs	fp1,fp1		/* if (x == 0.0)  */
 	blr			/* x = 0.0; */
 .L4:
-	bnllr-	cr6		/* if (x < 0.0)  */
+	bnllr	cr6		/* if (x < 0.0)  */
 	fsubs	fp1,fp1,fp13	/* x-= TWO23;  */
 	fadds	fp1,fp1,fp13	/* x+= TWO23;  */
 	fnabs	fp1,fp1		/* if (x == 0.0)  */
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_rint.S b/sysdeps/powerpc/powerpc64/fpu/s_rint.S
index db62405..560905a 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_rint.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_rint.S
@@ -34,14 +34,14 @@ EALIGN (__rint, 4, 0)
 	fsub	fp12,fp13,fp13	/* generate 0.0  */
 	fcmpu	cr7,fp0,fp13	/* if (fabs(x) > TWO52)  */
 	fcmpu	cr6,fp1,fp12	/* if (x > 0.0)  */
-	bnllr-	cr7
-	bng-	cr6,.L4
+	bnllr	cr7
+	bng	cr6,.L4
 	fadd	fp1,fp1,fp13	/* x+= TWO52;  */
 	fsub	fp1,fp1,fp13	/* x-= TWO52;  */
 	fabs	fp1,fp1		/* if (x == 0.0)  */
 	blr			/* x = 0.0; */
 .L4:
-	bnllr-	cr6		/* if (x < 0.0)  */
+	bnllr	cr6		/* if (x < 0.0)  */
 	fsub	fp1,fp1,fp13	/* x-= TWO52;  */
 	fadd	fp1,fp1,fp13	/* x+= TWO52;  */
 	fnabs	fp1,fp1		/* if (x == 0.0)  */
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_rintf.S b/sysdeps/powerpc/powerpc64/fpu/s_rintf.S
index 248649d..c120d91 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_rintf.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_rintf.S
@@ -30,14 +30,14 @@ EALIGN (__rintf, 4, 0)
 	fsubs	fp12,fp13,fp13	/* generate 0.0  */
 	fcmpu	cr7,fp0,fp13	/* if (fabs(x) > TWO23)  */
 	fcmpu	cr6,fp1,fp12	/* if (x > 0.0)  */
-	bnllr-	cr7
-	bng-	cr6,.L4
+	bnllr	cr7
+	bng	cr6,.L4
 	fadds	fp1,fp1,fp13	/* x+= TWO23;  */
 	fsubs	fp1,fp1,fp13	/* x-= TWO23;  */
 	fabs	fp1,fp1		/* if (x == 0.0)  */
 	blr			/* x = 0.0; */
 .L4:
-	bnllr-	cr6		/* if (x < 0.0)  */
+	bnllr	cr6		/* if (x < 0.0)  */
 	fsubs	fp1,fp1,fp13	/* x-= TWO23;  */
 	fadds	fp1,fp1,fp13	/* x+= TWO23;  */
 	fnabs	fp1,fp1		/* if (x == 0.0)  */

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

commit ace889170837e550871cf0d33f88ba2470c7d834
Author: Alan Modra <amodra@gmail.com>
Date:   Thu Mar 28 12:16:28 2013 -0500

    PowerPC: .eh_frame info in crt1.o isn't useful and triggers gold bug 14675.
    
    The .eh_frame info in crt1.o isn't useful and this patch prevents it from
    being generated on PowerPC.  It triggers the following gold bug:
    
    http://sourceware.org/bugzilla/show_bug.cgi?id=14675
    (cherry picked from commit b0f1246ab45b6d27e2bba64aa8dfe407ac740537)

diff --git a/ChangeLog b/ChangeLog
index 0216652..3eee9be 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2013-03-28  Alan Modra  <amodra@gmail.com>
+
+	* sysdeps/powerpc/powerpc32/start.S (cfi_startproc, cfi_endproc):
+	Define as empty.
+	* sysdeps/powerpc/powerpc64/start.S (cfi_startproc, cfi_endproc):
+	Likewise.
+
 2013-03-25  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
 
 	* sysdeps/powerpc/fpu/s_llround.c: Fix libm ABI issue with missing
diff --git a/sysdeps/powerpc/powerpc32/start.S b/sysdeps/powerpc/powerpc32/start.S
index 4935e64..2e454c0 100644
--- a/sysdeps/powerpc/powerpc32/start.S
+++ b/sysdeps/powerpc/powerpc32/start.S
@@ -37,6 +37,13 @@
 #include <sysdep.h>
 #include "bp-sym.h"
 
+/* We do not want .eh_frame info for crt1.o since crt1.o is linked
+   before crtbegin.o, the file defining __EH_FRAME_BEGIN__.  */
+#undef cfi_startproc
+#define cfi_startproc
+#undef cfi_endproc
+#define cfi_endproc
+
  /* These are the various addresses we require.  */
 #ifdef PIC
 	.section ".data"
diff --git a/sysdeps/powerpc/powerpc64/start.S b/sysdeps/powerpc/powerpc64/start.S
index d9c92d1..aadaf0f 100644
--- a/sysdeps/powerpc/powerpc64/start.S
+++ b/sysdeps/powerpc/powerpc64/start.S
@@ -37,6 +37,13 @@
 #include <sysdep.h>
 #include "bp-sym.h"
 
+/* We do not want .eh_frame info for crt1.o since crt1.o is linked
+   before crtbegin.o, the file defining __EH_FRAME_BEGIN__.  */
+#undef cfi_startproc
+#define cfi_startproc
+#undef cfi_endproc
+#define cfi_endproc
+
  /* These are the various addresses we require.  */
 #ifdef PIC
 	.section ".data.rel.ro.local","aw"

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

commit dad835a11f370afd2dae4bac554fa64fac5a8c6e
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date:   Tue Mar 26 10:01:57 2013 -0300

    PowerPC: fix libm ABI issue for llroundl
    (cherry picked from commit fce14d4e9c6e08ad8c825fe88d8cbdac5c739565)

diff --git a/ChangeLog b/ChangeLog
index b66cbb4..0216652 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-03-25  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
+
+	* sysdeps/powerpc/fpu/s_llround.c: Fix libm ABI issue with missing
+	llroundl symbol when building for PPC32.
+
 2013-03-21  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
 
 	* sysdeps/powerpc/fpu/w_sqrt.c (compat_symbol): Add sqrtl compat
diff --git a/sysdeps/powerpc/fpu/s_llround.c b/sysdeps/powerpc/fpu/s_llround.c
index c30400b..988ef9f 100644
--- a/sysdeps/powerpc/fpu/s_llround.c
+++ b/sysdeps/powerpc/fpu/s_llround.c
@@ -17,6 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <math.h>
+#include <math_ldbl_opt.h>
 
 /* I think that what this routine is supposed to do is round a value
    to the nearest integer, with values exactly on the boundary rounded
@@ -47,3 +48,6 @@ weak_alias (__llround, llround)
 strong_alias (__llround, __llroundl)
 weak_alias (__llround, llroundl)
 #endif
+#if LONG_DOUBLE_COMPAT (libm, GLIBC_2_1)
+compat_symbol (libm, __llround, llroundl, GLIBC_2_1);
+#endif

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

commit 45045c44fabde9152ab1a0b4ed06419a3621f535
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date:   Thu Mar 21 14:15:45 2013 -0300

    PowerPC: fix sqrtl ABI issue
    
    This patch fixes a sqrtl ABI issue when building for powerpc64.
    (cherry picked from commit b5784d95bb94eda59b08aca735406908e209f638)

diff --git a/ChangeLog b/ChangeLog
index af4974a..b66cbb4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-03-21  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
+
+	* sysdeps/powerpc/fpu/w_sqrt.c (compat_symbol): Add sqrtl compat
+	symbol.
+
 2013-03-15  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
 
 	* sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h (VDSO_IFUNC_RET): Add
diff --git a/sysdeps/powerpc/fpu/w_sqrt.c b/sysdeps/powerpc/fpu/w_sqrt.c
index c8ee010..c2d0187 100644
--- a/sysdeps/powerpc/fpu/w_sqrt.c
+++ b/sysdeps/powerpc/fpu/w_sqrt.c
@@ -19,6 +19,7 @@
 #include <math.h>
 #include <math_private.h>
 #include <fenv_libc.h>
+#include <math_ldbl_opt.h>
 
 double
 __sqrt (double x)		/* wrapper sqrt */
@@ -42,3 +43,6 @@ weak_alias (__sqrt, sqrt)
 #ifdef NO_LONG_DOUBLE
   strong_alias (__sqrt, __sqrtl) weak_alias (__sqrt, sqrtl)
 #endif
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __sqrt, sqrtl, GLIBC_2_0);
+#endif

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

commit 3f38cbfa2a44bf510122d3fcb0f0504a208dbf5e
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date:   Fri Mar 15 10:58:56 2013 -0300

    PowerPC: gettimeofday optimization by using IFUNC
    (backported from commit ef26eece6331a1f6d959818e37c438cc7ce68e53)

diff --git a/ChangeLog b/ChangeLog
index c070d94..af4974a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2013-03-15  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
+
+	* sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h (VDSO_IFUNC_RET): Add
+	macro to return vdso values correctly in IFUNC implementations.
+	* sysdeps/unix/sysv/linux/powerpc/gettimeofday.c (__gettimeofday):
+	Optimization by using IFUNC.
+
 2013-03-08  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
 
 	* sysdeps/ieee754/ldbl-128ibm/math_ldbl.h (ldbl_pack): Rename to
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h b/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h
index cda8491..e4ae630 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h
@@ -32,6 +32,16 @@ extern void *__vdso_get_tbfreq;
 
 extern void *__vdso_getcpu;
 
+/* This macro is needed for PPC64 to return a skeleton OPD entry of a vDSO
+   symbol.  This works because _dl_vdso_vsym always return the function
+   address, and no vDSO symbols use the TOC or chain pointers from the OPD
+   so we can allow them to be garbage.  */
+#if defined(__PPC64__) || defined(__powerpc64__)
+#define VDSO_IFUNC_RET(value)  &value
+#else
+#define VDSO_IFUNC_RET(value)  value
+#endif
+
 #endif
 
 #endif /* _LIBC_VDSO_H */
diff --git a/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c b/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
index 7376135..4f4abbd 100644
--- a/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
+++ b/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
@@ -15,26 +15,48 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <bp-checks.h>
-#include <stddef.h>
 #include <sys/time.h>
-#include <time.h>
-#include <hp-timing.h>
 
-#include <bits/libc-vdso.h>
+#ifdef SHARED
 
-/* Get the current time of day and timezone information,
-   putting it into *TV and *TZ.  If TZ is NULL, *TZ is not filled.
-   Returns 0 on success, -1 on errors.  */
+# include <dl-vdso.h>
+# include <bits/libc-vdso.h>
+
+void *gettimeofday_ifunc (void) __asm__ ("__gettimeofday");
+
+static int
+__gettimeofday_syscall (struct timeval *tv, struct timezone *tz)
+{
+  return INLINE_SYSCALL (gettimeofday, 2, tv, tz);
+}
+
+void *
+gettimeofday_ifunc (void)
+{
+  /* If the vDSO is not available we fall back syscall.  */
+  return (__vdso_gettimeofday ? VDSO_IFUNC_RET (__vdso_gettimeofday)
+	  : __gettimeofday_syscall);
+}
+asm (".type __gettimeofday, %gnu_indirect_function");
+
+/* This is doing "libc_hidden_def (__gettimeofday)" but the compiler won't
+   let us do it in C because it doesn't know we're defining __gettimeofday
+   here in this file.  */
+asm (".globl __GI___gettimeofday\n"
+     "__GI___gettimeofday = __gettimeofday");
+
+#else
+
+# include <sysdep.h>
+# include <errno.h>
 
 int
-__gettimeofday (tv, tz)
-     struct timeval *tv;
-     struct timezone *tz;
+__gettimeofday (struct timeval *tv, struct timezone *tz)
 {
-  return INLINE_VSYSCALL (gettimeofday, 2, CHECK_1 (tv), CHECK_1 (tz));
+  return INLINE_SYSCALL (gettimeofday, 2, tv, tz);
 }
 libc_hidden_def (__gettimeofday)
+
+#endif
 weak_alias (__gettimeofday, gettimeofday)
 libc_hidden_weak (gettimeofday)

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

commit c00f26c0eaba5a9680aac0f98de4b6e385a8cb82
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date:   Fri Mar 8 11:07:15 2013 -0300

    PowerPC: unify math_ldbl.h implementations
    
    This patch removes redudant definition from PowerPC specific
    math_ldbl, using the definitions from ieee754 math_ldbl.h.
    (backported from commit edf66e57fc2bac083ecc9756a5fe47f9041ed3bb)

diff --git a/ChangeLog b/ChangeLog
index 0535e0f..c070d94 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2013-03-08  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
+
+	* sysdeps/ieee754/ldbl-128ibm/math_ldbl.h (ldbl_pack): Rename to
+	default_ldbl_pack and using as default implementation.
+	(ldbl_unpack): Rename to default_ldbl_unpack and using as default
+	implementation.
+	* sysdeps/powerpc/fpu/math_ldbl.h (ldbl_extract_mantissa): Remove
+	redundant definition.
+	(ldbl_insert_mantissa): Likewise.
+	(ldbl_canonicalize): Likewise.
+	(ldbl_nearbyint): Likewise.
+	(ldbl_pack): Rename to ldbl_pack_ppc.
+	(ldbl_unpack): Rename to ldbl_unpack_ppc.
+	* sysdeps/unix/sysv/linux/powerpc/Implies: Remove file.
+	* sysdeps/powerpc/Implies: Add ieee754/ldbl-opt after ieee754/ldbl-128ibm.
+
 2013-03-08  Siddhesh Poyarekar  <siddhesh@redhat.com>
 
 	* sysdeps/powerpc/powerpc32/power4/fpu/mpa.c: Move file...
diff --git a/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h b/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h
index be9ac71..1cce1fc 100644
--- a/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h
+++ b/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h
@@ -125,7 +125,7 @@ ldbl_insert_mantissa (int sign, int exp, int64_t hi64, u_int64_t lo64)
 /* Handy utility functions to pack/unpack/cononicalize and find the nearbyint
    of long double implemented as double double.  */
 static inline long double
-ldbl_pack (double a, double aa)
+default_ldbl_pack (double a, double aa)
 {
   union ibm_extended_long_double u;
   u.dd[0] = a;
@@ -134,7 +134,7 @@ ldbl_pack (double a, double aa)
 }
 
 static inline void
-ldbl_unpack (long double l, double *a, double *aa)
+default_ldbl_unpack (long double l, double *a, double *aa)
 {
   union ibm_extended_long_double u;
   u.d = l;
@@ -142,6 +142,12 @@ ldbl_unpack (long double l, double *a, double *aa)
   *aa = u.dd[1];
 }
 
+#ifndef ldbl_pack
+# define ldbl_pack   default_ldbl_pack
+#endif
+#ifndef ldbl_unpack
+# define ldbl_unpack default_ldbl_unpack
+#endif
 
 /* Convert a finite long double to canonical form.
    Does not handle +/-Inf properly.  */
diff --git a/sysdeps/powerpc/Implies b/sysdeps/powerpc/Implies
index 7ccf9a7..78dba95 100644
--- a/sysdeps/powerpc/Implies
+++ b/sysdeps/powerpc/Implies
@@ -1,4 +1,5 @@
 # On PowerPC we use the IBM extended long double format.
 ieee754/ldbl-128ibm
+ieee754/ldbl-opt
 ieee754/dbl-64
 ieee754/flt-32
diff --git a/sysdeps/powerpc/fpu/math_ldbl.h b/sysdeps/powerpc/fpu/math_ldbl.h
index 6cd6d0b..36378c0 100644
--- a/sysdeps/powerpc/fpu/math_ldbl.h
+++ b/sysdeps/powerpc/fpu/math_ldbl.h
@@ -2,132 +2,12 @@
 #error "Never use <math_ldbl.h> directly; include <math_private.h> instead."
 #endif
 
-#include <sysdeps/ieee754/ldbl-128/math_ldbl.h>
-#include <ieee754.h>
-  
-static inline void
-ldbl_extract_mantissa (int64_t *hi64, u_int64_t *lo64, int *exp, long double x)
-{
-  /* We have 105 bits of mantissa plus one implicit digit.  Since
-     106 bits are representable we use the first implicit digit for
-     the number before the decimal point and the second implicit bit
-     as bit 53 of the mantissa.  */
-  unsigned long long hi, lo;
-  int ediff;
-  union ibm_extended_long_double eldbl;
-  eldbl.d = x;
-  *exp = eldbl.ieee.exponent - IBM_EXTENDED_LONG_DOUBLE_BIAS;
-
-  lo = ((long long)eldbl.ieee.mantissa2 << 32) | eldbl.ieee.mantissa3;
-  hi = ((long long)eldbl.ieee.mantissa0 << 32) | eldbl.ieee.mantissa1;
-  /* If the lower double is not a denomal or zero then set the hidden
-     53rd bit.  */
-  if (eldbl.ieee.exponent2 > 0x001)
-    {
-      lo |= (1ULL << 52);
-      lo = lo << 7; /* pre-shift lo to match ieee854.  */
-      /* The lower double is normalized separately from the upper.  We
-	 may need to adjust the lower manitissa to reflect this.  */
-      ediff = eldbl.ieee.exponent - eldbl.ieee.exponent2;
-      if (ediff > 53)
-	lo = lo >> (ediff-53);
-    }
-  hi |= (1ULL << 52);
-  
-  if ((eldbl.ieee.negative != eldbl.ieee.negative2)
-      && ((eldbl.ieee.exponent2 != 0) && (lo != 0LL)))
-    {
-      hi--;
-      lo = (1ULL << 60) - lo;
-      if (hi < (1ULL << 52))
-	{
-	  /* we have a borrow from the hidden bit, so shift left 1.  */
-	  hi = (hi << 1) | (lo >> 59);
-	  lo = 0xfffffffffffffffLL & (lo << 1);
-	  *exp = *exp - 1;
-	}
-    }
-  *lo64 = (hi << 60) | lo;
-  *hi64 = hi >> 4;
-}
-
-static inline long double
-ldbl_insert_mantissa (int sign, int exp, int64_t hi64, u_int64_t lo64)
-{
-  union ibm_extended_long_double u;
-  unsigned long hidden2, lzcount;
-  unsigned long long hi, lo;
-
-  u.ieee.negative = sign;
-  u.ieee.negative2 = sign;
-  u.ieee.exponent = exp + IBM_EXTENDED_LONG_DOUBLE_BIAS;
-  u.ieee.exponent2 = exp-53 + IBM_EXTENDED_LONG_DOUBLE_BIAS;
-  /* Expect 113 bits (112 bits + hidden) right justified in two longs.
-     The low order 53 bits (52 + hidden) go into the lower double */ 
-  lo = (lo64 >> 7)& ((1ULL << 53) - 1);
-  hidden2 = (lo64 >> 59) &  1ULL;
-  /* The high order 53 bits (52 + hidden) go into the upper double */
-  hi = (lo64 >> 60) & ((1ULL << 11) - 1);
-  hi |= (hi64 << 4);
-
-  if (lo != 0LL)
-    {
-      /* hidden2 bit of low double controls rounding of the high double.
-	 If hidden2 is '1' then round up hi and adjust lo (2nd mantissa)
-	 plus change the sign of the low double to compensate.  */
-      if (hidden2)
-	{
-	  hi++;
-	  u.ieee.negative2 = !sign;
-	  lo = (1ULL << 53) - lo;
-	}
-      /* The hidden bit of the lo mantissa is zero so we need to
-	 normalize the it for the low double.  Shift it left until the
-	 hidden bit is '1' then adjust the 2nd exponent accordingly.  */ 
-
-      if (sizeof (lo) == sizeof (long))
-	lzcount = __builtin_clzl (lo);
-      else if ((lo >> 32) != 0)
-	lzcount = __builtin_clzl ((long) (lo >> 32));
-      else
-	lzcount = __builtin_clzl ((long) lo) + 32;
-      lzcount = lzcount - 11;
-      if (lzcount > 0)
-	{
-	  int expnt2 = u.ieee.exponent2 - lzcount;
-	  if (expnt2 >= 1)
-	    {
-	      /* Not denormal.  Normalize and set low exponent.  */
-	      lo = lo << lzcount;
-	      u.ieee.exponent2 = expnt2;
-	    }
-	  else
-	    {
-	      /* Is denormal.  */
-	      lo = lo << (lzcount + expnt2);
-	      u.ieee.exponent2 = 0;
-	    }
-	}
-    }
-  else
-    {
-      u.ieee.negative2 = 0;
-      u.ieee.exponent2 = 0;
-    }
-
-  u.ieee.mantissa3 = lo & ((1ULL << 32) - 1);
-  u.ieee.mantissa2 = (lo >> 32) & ((1ULL << 20) - 1);
-  u.ieee.mantissa1 = hi & ((1ULL << 32) - 1);
-  u.ieee.mantissa0 = (hi >> 32) & ((1ULL << 20) - 1);
-  return u.d;
-}
-  
-/* gcc generates disgusting code to pack and unpack long doubles.
-   This tells gcc that pack/unpack is really a nop.  We use fr1/fr2
-   because those are the regs used to pass/return a single
-   long double arg.  */
+/* GCC does not optimize the default ldbl_pack code to not spill register
+   in the stack. The following optimization tells gcc that pack/unpack
+   is really a nop.  We use fr1/fr2 because those are the regs used to
+   pass/return a single long double arg.  */
 static inline long double
-ldbl_pack (double a, double aa)
+ldbl_pack_ppc (double a, double aa)
 {
   register long double x __asm__ ("fr1");
   register double xh __asm__ ("fr1");
@@ -139,7 +19,7 @@ ldbl_pack (double a, double aa)
 }
 
 static inline void
-ldbl_unpack (long double l, double *a, double *aa)
+ldbl_unpack_ppc (long double l, double *a, double *aa)
 {
   register long double x __asm__ ("fr1");
   register double xh __asm__ ("fr1");
@@ -150,40 +30,7 @@ ldbl_unpack (long double l, double *a, double *aa)
   *aa = xl;
 }
 
+#define ldbl_pack   ldbl_pack_ppc
+#define ldbl_unpack ldbl_unpack_ppc
 
-/* Convert a finite long double to canonical form.
-   Does not handle +/-Inf properly.  */
-static inline void
-ldbl_canonicalize (double *a, double *aa)
-{
-  double xh, xl;
-
-  xh = *a + *aa;
-  xl = (*a - xh) + *aa;
-  *a = xh;
-  *aa = xl;
-}
-
-/* Simple inline nearbyint (double) function .
-   Only works in the default rounding mode
-   but is useful in long double rounding functions.  */
-static inline double
-ldbl_nearbyint (double a)
-{
-  double two52 = 0x10000000000000LL;
-
-  if (__builtin_expect ((__builtin_fabs (a) < two52), 1))
-    {
-      if (__builtin_expect ((a > 0.0), 1))
-	{
-	  a += two52;
-	  a -= two52;
-	}
-      else if (__builtin_expect ((a < 0.0), 1))
-	{
-	  a = two52 - a;
-	  a = -(a - two52);
-	}
-    }
-  return a;
-}
+#include <sysdeps/ieee754/ldbl-128ibm/math_ldbl.h>
diff --git a/sysdeps/unix/sysv/linux/powerpc/Implies b/sysdeps/unix/sysv/linux/powerpc/Implies
deleted file mode 100644
index ff27cdb..0000000
--- a/sysdeps/unix/sysv/linux/powerpc/Implies
+++ /dev/null
@@ -1,4 +0,0 @@
-# Make sure these routines come before ldbl-opt.
-ieee754/ldbl-128ibm
-# These supply the ABI compatibility for when long double was double.
-ieee754/ldbl-opt

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

commit 66bf22e129f0b8621903a8b0489b2684e70fad65
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Fri Mar 8 11:38:41 2013 +0530

    Consolidate copies of mp code in powerpc
    
    Retain a single copy of the mp code in power4 instead of the two
    identical copies in powerpc32 and powerpc64.
    (backported from commit 6d9145d817e570cd986bb088cf2af0bf51ac7dde)

diff --git a/ChangeLog b/ChangeLog
index 1d00d5b..0535e0f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2013-03-08  Siddhesh Poyarekar  <siddhesh@redhat.com>
+
+	* sysdeps/powerpc/powerpc32/power4/fpu/mpa.c: Move file...
+	* sysdeps/powerpc/power4/fpu/mpa.c: ... here.
+	* sysdeps/powerpc/powerpc32/power4/fpu/Makefile: Move file...
+	* sysdeps/powerpc/power4/fpu/Makefile: ... here.
+	* sysdeps/powerpc/powerpc64/power4/fpu/mpa.c: Remove file.
+	* sysdeps/powerpc/powerpc64/power4/fpu/Makefile: Remove file.
+	* sysdeps/powerpc/powerpc32/power4/Implies: New file.
+	* sysdeps/powerpc/powerpc64/power4/Implies: New file.
+
 2013-02-28  Adhemerval Zanella  <azanella@linux.vnet.ibm.com> 
 
 	[BZ #15055] 
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/Makefile b/sysdeps/powerpc/power4/fpu/Makefile
similarity index 100%
rename from sysdeps/powerpc/powerpc32/power4/fpu/Makefile
rename to sysdeps/powerpc/power4/fpu/Makefile
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/mpa.c b/sysdeps/powerpc/power4/fpu/mpa.c
similarity index 100%
rename from sysdeps/powerpc/powerpc32/power4/fpu/mpa.c
rename to sysdeps/powerpc/power4/fpu/mpa.c
diff --git a/sysdeps/powerpc/powerpc32/power4/Implies b/sysdeps/powerpc/powerpc32/power4/Implies
new file mode 100644
index 0000000..a372141
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/power4/Implies
@@ -0,0 +1,2 @@
+powerpc/power4/fpu
+powerpc/power4
diff --git a/sysdeps/powerpc/powerpc64/power4/Implies b/sysdeps/powerpc/powerpc64/power4/Implies
new file mode 100644
index 0000000..a372141
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/power4/Implies
@@ -0,0 +1,2 @@
+powerpc/power4/fpu
+powerpc/power4
diff --git a/sysdeps/powerpc/powerpc64/power4/fpu/Makefile b/sysdeps/powerpc/powerpc64/power4/fpu/Makefile
deleted file mode 100644
index f8bb3ef..0000000
--- a/sysdeps/powerpc/powerpc64/power4/fpu/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-# Makefile fragment for POWER4/5/5+ platforms with FPU.
-
-ifeq ($(subdir),math)
-CFLAGS-mpa.c += --param max-unroll-times=4 -funroll-loops -fpeel-loops
-endif
diff --git a/sysdeps/powerpc/powerpc64/power4/fpu/mpa.c b/sysdeps/powerpc/powerpc64/power4/fpu/mpa.c
deleted file mode 100644
index d15680e..0000000
--- a/sysdeps/powerpc/powerpc64/power4/fpu/mpa.c
+++ /dev/null
@@ -1,548 +0,0 @@
-
-/*
- * IBM Accurate Mathematical Library
- * written by International Business Machines Corp.
- * Copyright (C) 2001, 2006 Free Software Foundation
- *
- * This program 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.
- *
- * This program 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 this program; if not, see <http://www.gnu.org/licenses/>.
- */
-/************************************************************************/
-/*  MODULE_NAME: mpa.c                                                  */
-/*                                                                      */
-/*  FUNCTIONS:                                                          */
-/*               mcr                                                    */
-/*               acr                                                    */
-/*               cr                                                     */
-/*               cpy                                                    */
-/*               cpymn                                                  */
-/*               norm                                                   */
-/*               denorm                                                 */
-/*               mp_dbl                                                 */
-/*               dbl_mp                                                 */
-/*               add_magnitudes                                         */
-/*               sub_magnitudes                                         */
-/*               add                                                    */
-/*               sub                                                    */
-/*               mul                                                    */
-/*               inv                                                    */
-/*               dvd                                                    */
-/*                                                                      */
-/* Arithmetic functions for multiple precision numbers.                 */
-/* Relative errors are bounded                                          */
-/************************************************************************/
-
-
-#include "endian.h"
-#include "mpa.h"
-#include "mpa2.h"
-#include <sys/param.h>	/* For MIN() */
-/* mcr() compares the sizes of the mantissas of two multiple precision  */
-/* numbers. Mantissas are compared regardless of the signs of the       */
-/* numbers, even if x->d[0] or y->d[0] are zero. Exponents are also     */
-/* disregarded.                                                         */
-static int mcr(const mp_no *x, const mp_no *y, int p) {
-  long i;
-  long p2 = p;
-  for (i=1; i<=p2; i++) {
-    if      (X[i] == Y[i])  continue;
-    else if (X[i] >  Y[i])  return  1;
-    else                    return -1; }
-  return 0;
-}
-
-
-
-/* acr() compares the absolute values of two multiple precision numbers */
-int __acr(const mp_no *x, const mp_no *y, int p) {
-  long i;
-
-  if      (X[0] == ZERO) {
-    if    (Y[0] == ZERO) i= 0;
-    else                 i=-1;
-  }
-  else if (Y[0] == ZERO) i= 1;
-  else {
-    if      (EX >  EY)   i= 1;
-    else if (EX <  EY)   i=-1;
-    else                 i= mcr(x,y,p);
-  }
-
-  return i;
-}
-
-
-/* cr90 compares the values of two multiple precision numbers           */
-int  __cr(const mp_no *x, const mp_no *y, int p) {
-  int i;
-
-  if      (X[0] > Y[0])  i= 1;
-  else if (X[0] < Y[0])  i=-1;
-  else if (X[0] < ZERO ) i= __acr(y,x,p);
-  else                   i= __acr(x,y,p);
-
-  return i;
-}
-
-
-/* Copy a multiple precision number. Set *y=*x. x=y is permissible.      */
-void __cpy(const mp_no *x, mp_no *y, int p) {
-  long i;
-
-  EY = EX;
-  for (i=0; i <= p; i++)    Y[i] = X[i];
-
-  return;
-}
-
-
-/* Copy a multiple precision number x of precision m into a */
-/* multiple precision number y of precision n. In case n>m, */
-/* the digits of y beyond the m'th are set to zero. In case */
-/* n<m, the digits of x beyond the n'th are ignored.        */
-/* x=y is permissible.                                      */
-
-void __cpymn(const mp_no *x, int m, mp_no *y, int n) {
-
-  long i,k;
-  long n2 = n;
-  long m2 = m;
-
-  EY = EX;     k=MIN(m2,n2);
-  for (i=0; i <= k; i++)    Y[i] = X[i];
-  for (   ; i <= n2; i++)    Y[i] = ZERO;
-
-  return;
-}
-
-/* Convert a multiple precision number *x into a double precision */
-/* number *y, normalized case  (|x| >= 2**(-1022))) */
-static void norm(const mp_no *x, double *y, int p)
-{
-  #define R  radixi.d
-  long i;
-#if 0
-  int k;
-#endif
-  double a,c,u,v,z[5];
-  if (p<5) {
-    if      (p==1) c = X[1];
-    else if (p==2) c = X[1] + R* X[2];
-    else if (p==3) c = X[1] + R*(X[2]  +   R* X[3]);
-    else if (p==4) c =(X[1] + R* X[2]) + R*R*(X[3] + R*X[4]);
-  }
-  else {
-    for (a=ONE, z[1]=X[1]; z[1] < TWO23; )
-        {a *= TWO;   z[1] *= TWO; }
-
-    for (i=2; i<5; i++) {
-      z[i] = X[i]*a;
-      u = (z[i] + CUTTER)-CUTTER;
-      if  (u > z[i])  u -= RADIX;
-      z[i] -= u;
-      z[i-1] += u*RADIXI;
-    }
-
-    u = (z[3] + TWO71) - TWO71;
-    if (u > z[3])   u -= TWO19;
-    v = z[3]-u;
-
-    if (v == TWO18) {
-      if (z[4] == ZERO) {
-        for (i=5; i <= p; i++) {
-          if (X[i] == ZERO)   continue;
-          else                {z[3] += ONE;   break; }
-        }
-      }
-      else              z[3] += ONE;
-    }
-
-    c = (z[1] + R *(z[2] + R * z[3]))/a;
-  }
-
-  c *= X[0];
-
-  for (i=1; i<EX; i++)   c *= RADIX;
-  for (i=1; i>EX; i--)   c *= RADIXI;
-
-  *y = c;
-  return;
-#undef R
-}
-
-/* Convert a multiple precision number *x into a double precision */
-/* number *y, denormalized case  (|x| < 2**(-1022))) */
-static void denorm(const mp_no *x, double *y, int p)
-{
-  long i,k;
-  long p2 = p;
-  double c,u,z[5];
-#if 0
-  double a,v;
-#endif
-
-#define R  radixi.d
-  if (EX<-44 || (EX==-44 && X[1]<TWO5))
-     { *y=ZERO; return; }
-
-  if      (p2==1) {
-    if      (EX==-42) {z[1]=X[1]+TWO10;  z[2]=ZERO;  z[3]=ZERO;  k=3;}
-    else if (EX==-43) {z[1]=     TWO10;  z[2]=X[1];  z[3]=ZERO;  k=2;}
-    else              {z[1]=     TWO10;  z[2]=ZERO;  z[3]=X[1];  k=1;}
-  }
-  else if (p2==2) {
-    if      (EX==-42) {z[1]=X[1]+TWO10;  z[2]=X[2];  z[3]=ZERO;  k=3;}
-    else if (EX==-43) {z[1]=     TWO10;  z[2]=X[1];  z[3]=X[2];  k=2;}
-    else              {z[1]=     TWO10;  z[2]=ZERO;  z[3]=X[1];  k=1;}
-  }
-  else {
-    if      (EX==-42) {z[1]=X[1]+TWO10;  z[2]=X[2];  k=3;}
-    else if (EX==-43) {z[1]=     TWO10;  z[2]=X[1];  k=2;}
-    else              {z[1]=     TWO10;  z[2]=ZERO;  k=1;}
-    z[3] = X[k];
-  }
-
-  u = (z[3] + TWO57) - TWO57;
-  if  (u > z[3])   u -= TWO5;
-
-  if (u==z[3]) {
-    for (i=k+1; i <= p2; i++) {
-      if (X[i] == ZERO)   continue;
-      else {z[3] += ONE;   break; }
-    }
-  }
-
-  c = X[0]*((z[1] + R*(z[2] + R*z[3])) - TWO10);
-
-  *y = c*TWOM1032;
-  return;
-
-#undef R
-}
-
-/* Convert a multiple precision number *x into a double precision number *y. */
-/* The result is correctly rounded to the nearest/even. *x is left unchanged */
-
-void __mp_dbl(const mp_no *x, double *y, int p) {
-#if 0
-  int i,k;
-  double a,c,u,v,z[5];
-#endif
-
-  if (X[0] == ZERO)  {*y = ZERO;  return; }
-
-  if      (EX> -42)                 norm(x,y,p);
-  else if (EX==-42 && X[1]>=TWO10)  norm(x,y,p);
-  else                              denorm(x,y,p);
-}
-
-
-/* dbl_mp() converts a double precision number x into a multiple precision  */
-/* number *y. If the precision p is too small the result is truncated. x is */
-/* left unchanged.                                                          */
-
-void __dbl_mp(double x, mp_no *y, int p) {
-
-  long i,n;
-  long p2 = p;
-  double u;
-
-  /* Sign */
-  if      (x == ZERO)  {Y[0] = ZERO;  return; }
-  else if (x >  ZERO)   Y[0] = ONE;
-  else                 {Y[0] = MONE;  x=-x;   }
-
-  /* Exponent */
-  for (EY=ONE; x >= RADIX; EY += ONE)   x *= RADIXI;
-  for (      ; x <  ONE;   EY -= ONE)   x *= RADIX;
-
-  /* Digits */
-  n=MIN(p2,4);
-  for (i=1; i<=n; i++) {
-    u = (x + TWO52) - TWO52;
-    if (u>x)   u -= ONE;
-    Y[i] = u;     x -= u;    x *= RADIX; }
-  for (   ; i<=p2; i++)     Y[i] = ZERO;
-  return;
-}
-
-
-/*  add_magnitudes() adds the magnitudes of *x & *y assuming that           */
-/*  abs(*x) >= abs(*y) > 0.                                                 */
-/* The sign of the sum *z is undefined. x&y may overlap but not x&z or y&z. */
-/* No guard digit is used. The result equals the exact sum, truncated.      */
-/* *x & *y are left unchanged.                                              */
-
-static void add_magnitudes(const mp_no *x, const mp_no *y, mp_no *z, int p) {
-
-  long i,j,k;
-  long p2 = p;
-
-  EZ = EX;
-
-  i=p2;    j=p2+ EY - EX;    k=p2+1;
-
-  if (j<1)
-     {__cpy(x,z,p);  return; }
-  else   Z[k] = ZERO;
-
-  for (; j>0; i--,j--) {
-    Z[k] += X[i] + Y[j];
-    if (Z[k] >= RADIX) {
-      Z[k]  -= RADIX;
-      Z[--k] = ONE; }
-    else
-      Z[--k] = ZERO;
-  }
-
-  for (; i>0; i--) {
-    Z[k] += X[i];
-    if (Z[k] >= RADIX) {
-      Z[k]  -= RADIX;
-      Z[--k] = ONE; }
-    else
-      Z[--k] = ZERO;
-  }
-
-  if (Z[1] == ZERO) {
-    for (i=1; i<=p2; i++)    Z[i] = Z[i+1]; }
-  else   EZ += ONE;
-}
-
-
-/*  sub_magnitudes() subtracts the magnitudes of *x & *y assuming that      */
-/*  abs(*x) > abs(*y) > 0.                                                  */
-/* The sign of the difference *z is undefined. x&y may overlap but not x&z  */
-/* or y&z. One guard digit is used. The error is less than one ulp.         */
-/* *x & *y are left unchanged.                                              */
-
-static void sub_magnitudes(const mp_no *x, const mp_no *y, mp_no *z, int p) {
-
-  long i,j,k;
-  long p2 = p;
-
-  EZ = EX;
-
-  if (EX == EY) {
-    i=j=k=p2;
-    Z[k] = Z[k+1] = ZERO; }
-  else {
-    j= EX - EY;
-    if (j > p2)  {__cpy(x,z,p);  return; }
-    else {
-      i=p2;   j=p2+1-j;   k=p2;
-      if (Y[j] > ZERO) {
-        Z[k+1] = RADIX - Y[j--];
-        Z[k]   = MONE; }
-      else {
-        Z[k+1] = ZERO;
-        Z[k]   = ZERO;   j--;}
-    }
-  }
-
-  for (; j>0; i--,j--) {
-    Z[k] += (X[i] - Y[j]);
-    if (Z[k] < ZERO) {
-      Z[k]  += RADIX;
-      Z[--k] = MONE; }
-    else
-      Z[--k] = ZERO;
-  }
-
-  for (; i>0; i--) {
-    Z[k] += X[i];
-    if (Z[k] < ZERO) {
-      Z[k]  += RADIX;
-      Z[--k] = MONE; }
-    else
-      Z[--k] = ZERO;
-  }
-
-  for (i=1; Z[i] == ZERO; i++) ;
-  EZ = EZ - i + 1;
-  for (k=1; i <= p2+1; )
-    Z[k++] = Z[i++];
-  for (; k <= p2; )
-    Z[k++] = ZERO;
-
-  return;
-}
-
-
-/* Add two multiple precision numbers. Set *z = *x + *y. x&y may overlap  */
-/* but not x&z or y&z. One guard digit is used. The error is less than    */
-/* one ulp. *x & *y are left unchanged.                                   */
-
-void __add(const mp_no *x, const mp_no *y, mp_no *z, int p) {
-
-  int n;
-
-  if      (X[0] == ZERO)     {__cpy(y,z,p);  return; }
-  else if (Y[0] == ZERO)     {__cpy(x,z,p);  return; }
-
-  if (X[0] == Y[0])   {
-    if (__acr(x,y,p) > 0)      {add_magnitudes(x,y,z,p);  Z[0] = X[0]; }
-    else                     {add_magnitudes(y,x,z,p);  Z[0] = Y[0]; }
-  }
-  else                       {
-    if ((n=__acr(x,y,p)) == 1) {sub_magnitudes(x,y,z,p);  Z[0] = X[0]; }
-    else if (n == -1)        {sub_magnitudes(y,x,z,p);  Z[0] = Y[0]; }
-    else                      Z[0] = ZERO;
-  }
-  return;
-}
-
-
-/* Subtract two multiple precision numbers. *z is set to *x - *y. x&y may */
-/* overlap but not x&z or y&z. One guard digit is used. The error is      */
-/* less than one ulp. *x & *y are left unchanged.                         */
-
-void __sub(const mp_no *x, const mp_no *y, mp_no *z, int p) {
-
-  int n;
-
-  if      (X[0] == ZERO)     {__cpy(y,z,p);  Z[0] = -Z[0];  return; }
-  else if (Y[0] == ZERO)     {__cpy(x,z,p);                 return; }
-
-  if (X[0] != Y[0])    {
-    if (__acr(x,y,p) > 0)      {add_magnitudes(x,y,z,p);  Z[0] =  X[0]; }
-    else                     {add_magnitudes(y,x,z,p);  Z[0] = -Y[0]; }
-  }
-  else                       {
-    if ((n=__acr(x,y,p)) == 1) {sub_magnitudes(x,y,z,p);  Z[0] =  X[0]; }
-    else if (n == -1)        {sub_magnitudes(y,x,z,p);  Z[0] = -Y[0]; }
-    else                      Z[0] = ZERO;
-  }
-  return;
-}
-
-
-/* Multiply two multiple precision numbers. *z is set to *x * *y. x&y      */
-/* may overlap but not x&z or y&z. In case p=1,2,3 the exact result is     */
-/* truncated to p digits. In case p>3 the error is bounded by 1.001 ulp.   */
-/* *x & *y are left unchanged.                                             */
-
-void __mul(const mp_no *x, const mp_no *y, mp_no *z, int p) {
-
-  long i, i1, i2, j, k, k2;
-  long p2 = p;
-  double u, zk, zk2;
-
-                      /* Is z=0? */
-  if (X[0]*Y[0]==ZERO)
-     { Z[0]=ZERO;  return; }
-
-                       /* Multiply, add and carry */
-  k2 = (p2<3) ? p2+p2 : p2+3;
-  zk = Z[k2]=ZERO;
-  for (k=k2; k>1; ) {
-    if (k > p2)  {i1=k-p2; i2=p2+1; }
-    else        {i1=1;   i2=k;   }
-#if 1
-    /* rearange this inner loop to allow the fmadd instructions to be
-       independent and execute in parallel on processors that have
-       dual symetrical FP pipelines.  */
-    if (i1 < (i2-1))
-    {
-	/* make sure we have at least 2 iterations */
-	if (((i2 - i1) & 1L) == 1L)
-	{
-                /* Handle the odd iterations case.  */
-		zk2 = x->d[i2-1]*y->d[i1];
-	}
-	else
-		zk2 = zero.d;
-	/* Do two multiply/adds per loop iteration, using independent
-           accumulators; zk and zk2.  */
-	for (i=i1,j=i2-1; i<i2-1; i+=2,j-=2) 
-	{
-		zk += x->d[i]*y->d[j];
-		zk2 += x->d[i+1]*y->d[j-1];
-	}
-	zk += zk2; /* final sum.  */
-    }
-    else
-    {
-        /* Special case when iterations is 1.  */
-	zk += x->d[i1]*y->d[i1];
-    }
-#else
-    /* The orginal code.  */
-    for (i=i1,j=i2-1; i<i2; i++,j--)  zk += X[i]*Y[j];
-#endif
-
-    u = (zk + CUTTER)-CUTTER;
-    if  (u > zk)  u -= RADIX;
-    Z[k]  = zk - u;
-    zk = u*RADIXI;
-    --k;
-  }
-  Z[k] = zk;
-
-                 /* Is there a carry beyond the most significant digit? */
-  if (Z[1] == ZERO) {
-    for (i=1; i<=p2; i++)  Z[i]=Z[i+1];
-    EZ = EX + EY - 1; }
-  else
-    EZ = EX + EY;
-
-  Z[0] = X[0] * Y[0];
-  return;
-}
-
-
-/* Invert a multiple precision number. Set *y = 1 / *x.                     */
-/* Relative error bound = 1.001*r**(1-p) for p=2, 1.063*r**(1-p) for p=3,   */
-/* 2.001*r**(1-p) for p>3.                                                  */
-/* *x=0 is not permissible. *x is left unchanged.                           */
-
-void __inv(const mp_no *x, mp_no *y, int p) {
-  long i;
-#if 0
-  int l;
-#endif
-  double t;
-  mp_no z,w;
-  static const int np1[] = {0,0,0,0,1,2,2,2,2,3,3,3,3,3,3,3,3,3,
-                            4,4,4,4,4,4,4,4,4,4,4,4,4,4,4};
-  const mp_no mptwo = {1,{1.0,2.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
-                         0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
-                         0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
-                         0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}};
-
-  __cpy(x,&z,p);  z.e=0;  __mp_dbl(&z,&t,p);
-  t=ONE/t;   __dbl_mp(t,y,p);    EY -= EX;
-
-  for (i=0; i<np1[p]; i++) {
-    __cpy(y,&w,p);
-    __mul(x,&w,y,p);
-    __sub(&mptwo,y,&z,p);
-    __mul(&w,&z,y,p);
-  }
-  return;
-}
-
-
-/* Divide one multiple precision number by another.Set *z = *x / *y. *x & *y */
-/* are left unchanged. x&y may overlap but not x&z or y&z.                   */
-/* Relative error bound = 2.001*r**(1-p) for p=2, 2.063*r**(1-p) for p=3     */
-/* and 3.001*r**(1-p) for p>3. *y=0 is not permissible.                      */
-
-void __dvd(const mp_no *x, const mp_no *y, mp_no *z, int p) {
-
-  mp_no w;
-
-  if (X[0] == ZERO)    Z[0] = ZERO;
-  else                {__inv(y,&w,p);   __mul(x,&w,z,p);}
-  return;
-}

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

commit 33c15e3ac353a5594efb9815f186d96b0f821f3f
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date:   Mon Mar 4 11:37:51 2013 -0300

    BZ #15055: Use __ieee754_sqrl in acoshl for lbdl-128ibm
    (backported from commit e0b780ad5b94209bf99bf498314bc5c160dc2a15)

diff --git a/ChangeLog b/ChangeLog
index 1fed1cc..1d00d5b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-02-28  Adhemerval Zanella  <azanella@linux.vnet.ibm.com> 
+
+	[BZ #15055] 
+	* sysdeps/ieee754/ldbl-128ibm/e_acoshl.c (__ieee754_acoshl): Use 
+	__ieee754_sqrl instead of __sqrl. 
+
 2013-01-18  Anton Blanchard  <anton@samba.org>
 	    Ryan S. Arnold  <rsa@linux.vnet.ibm.com>
 
diff --git a/NEWS b/NEWS
index 10c1ca6..c6380a7 100644
--- a/NEWS
+++ b/NEWS
@@ -8,7 +8,7 @@ using `glibc' in the "product" field.
 Version 2.17.1
 
 * The following bugs are resolved with this release:
-  15003, 15006, 15122, 15759.
+  15003, 15006, 15055, 15122, 15759.
 
 
 Version 2.17
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c b/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c
index 117bd0f..abc78a3 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c
@@ -52,7 +52,7 @@ __ieee754_acoshl(long double x)
 	    return __ieee754_logl(2.0*x-one/(x+__ieee754_sqrtl(t-one)));
 	} else {			/* 1<x<2 */
 	    t = x-one;
-	    return __log1p(t+__sqrtl(2.0*t+t*t));
+	    return __log1p(t+__ieee754_sqrtl(2.0*t+t*t));
 	}
 }
 strong_alias (__ieee754_acoshl, __acoshl_finite)

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

commit cdd522c7a59e8d16d8571feda997633faadf1b41
Author: Ryan S. Arnold <rsa@linux.vnet.ibm.com>
Date:   Fri Jan 18 07:52:18 2013 -0600

    Corrected ChangeLog date of __kernel_get_tbfreq fix.
    (cherry picked from commit 90567f30eb334328ae6e2b7901df539f1ba61921)

diff --git a/ChangeLog b/ChangeLog
index 56dd0e4..1fed1cc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,4 @@
-2013-01-15  Anton Blanchard  <anton@samba.org>
+2013-01-18  Anton Blanchard  <anton@samba.org>
 	    Ryan S. Arnold  <rsa@linux.vnet.ibm.com>
 
 	* sysdeps/unix/sysv/linux/powerpc/init-first.c: Rename

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

commit 51a8476450158fb522c791c73b7b56dc30a741fc
Author: Anton Blanchard <anton@samba.org>
Date:   Tue Jan 15 12:50:46 2013 -0600

    PowerPC: Rename __kernel_vdso_get_tbfreq to __kernel_get_tbfreq.
    
    In order for the __kernel_get_tbfreq vDSO call to work the
    INTERNAL_VSYSCALL_NCS macro needed to be updated to prevent it from
    assuming an integer return type (since the timebase frequency is a 64-bit
    value) by specifying the type of the return type as a macro parameter.  The
    macro then specifically declares the return value as a 'register' (or
    implied pair) of the denoted type.  The compiler is then informed that this
    register (or implied pair) is to be used for the return value.
    (cherry picked from commit 471a1672d4d55124de4db8273829f96cc14d424a)

diff --git a/ChangeLog b/ChangeLog
index b956949..56dd0e4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2013-01-15  Anton Blanchard  <anton@samba.org>
+	    Ryan S. Arnold  <rsa@linux.vnet.ibm.com>
+
+	* sysdeps/unix/sysv/linux/powerpc/init-first.c: Rename
+	__kernel_vdso_get_tbfreq to __kernel_get_tbfreq.
+	* sysdeps/unix/sysv/linux/powerpc/get_clockfreq.c: Add parameter to
+	INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK to specify return type.
+	* sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h
+	(INTERNAL_VSYSCALL_NCS): Change "=&r" in inline asm output regs list to
+	"+r" and remove output regs list as redundant.  Add explicit inline
+	asm to specify register of return val to work around compiler codegen
+	bug.  Remove (int) cast on return value.  Add return type parameter to
+	use in macro so that this macro does not truncate return value for
+	64-bit values.
+	(INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK): Add return type parameter and
+	pass to INTERNAL_VSYSCALL_NCS.
+	(INLINE_VSYSCALL): Add 'long int' as return type to
+	INTERNAL_VSYSCALL_NCS macro invocation.
+	(INTERNAL_VSYSCALL): Add 'long int' as return type to
+	INTERNAL_VSYSCALL_NCS macro invocation.
+	* sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h: Likewise.
+
 2013-01-09  Anton Blanchard  <anton@samba.org>
 
 	* sysdeps/unix/sysv/linux/powerpc/sched_getcpu.c: New file.
diff --git a/sysdeps/unix/sysv/linux/powerpc/get_clockfreq.c b/sysdeps/unix/sysv/linux/powerpc/get_clockfreq.c
index a863a27..021594c 100644
--- a/sysdeps/unix/sysv/linux/powerpc/get_clockfreq.c
+++ b/sysdeps/unix/sysv/linux/powerpc/get_clockfreq.c
@@ -41,7 +41,8 @@ __get_clockfreq (void)
   /* If we can use the vDSO to obtain the timebase even better.  */
 #ifdef SHARED
   INTERNAL_SYSCALL_DECL (err);
-  timebase_freq = INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK (get_tbfreq, err, 0);
+  timebase_freq =
+    INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK (get_tbfreq, err, hp_timing_t, 0);
   if (INTERNAL_SYSCALL_ERROR_P (timebase_freq, err)
       && INTERNAL_SYSCALL_ERRNO (timebase_freq, err) == ENOSYS)
 #endif
diff --git a/sysdeps/unix/sysv/linux/powerpc/init-first.c b/sysdeps/unix/sysv/linux/powerpc/init-first.c
index 6bcb7d5..5587e2a 100644
--- a/sysdeps/unix/sysv/linux/powerpc/init-first.c
+++ b/sysdeps/unix/sysv/linux/powerpc/init-first.c
@@ -41,7 +41,7 @@ _libc_vdso_platform_setup (void)
 
   __vdso_clock_getres = _dl_vdso_vsym ("__kernel_clock_getres", &linux2615);
 
-  __vdso_get_tbfreq = _dl_vdso_vsym ("__kernel_vdso_get_tbfreq", &linux2615);
+  __vdso_get_tbfreq = _dl_vdso_vsym ("__kernel_get_tbfreq", &linux2615);
 
   __vdso_getcpu = _dl_vdso_vsym ("__kernel_getcpu", &linux2615);
 }
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h b/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h
index da25c01..fa4116e 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h
@@ -60,7 +60,8 @@
 									      \
     if (__vdso_##name != NULL)						      \
       {									      \
-	sc_ret = INTERNAL_VSYSCALL_NCS (__vdso_##name, sc_err, nr, ##args);   \
+	sc_ret =							      \
+	  INTERNAL_VSYSCALL_NCS (__vdso_##name, sc_err, long int, nr, ##args);\
 	if (!INTERNAL_SYSCALL_ERROR_P (sc_ret, sc_err))			      \
 	  goto out;							      \
 	if (INTERNAL_SYSCALL_ERRNO (sc_ret, sc_err) != ENOSYS)		      \
@@ -90,7 +91,8 @@
 									      \
     if (__vdso_##name != NULL)						      \
       {									      \
-	v_ret = INTERNAL_VSYSCALL_NCS (__vdso_##name, err, nr, ##args);	      \
+	v_ret =								      \
+	  INTERNAL_VSYSCALL_NCS (__vdso_##name, err, long int, nr, ##args);   \
 	if (!INTERNAL_SYSCALL_ERROR_P (v_ret, err)			      \
 	    || INTERNAL_SYSCALL_ERRNO (v_ret, err) != ENOSYS)		      \
 	  goto out;							      \
@@ -104,12 +106,12 @@
   INTERNAL_SYSCALL (name, err, nr, ##args)
 # endif
 
-# define INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK(name, err, nr, args...)	      \
+# define INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK(name, err, type, nr, args...)  \
   ({									      \
-    long int sc_ret = ENOSYS;						      \
+    type sc_ret = ENOSYS;						      \
 									      \
     if (__vdso_##name != NULL)						      \
-      sc_ret = INTERNAL_VSYSCALL_NCS (__vdso_##name, err, nr, ##args);	      \
+      sc_ret = INTERNAL_VSYSCALL_NCS (__vdso_##name, err, type, nr, ##args);  \
     else								      \
       err = 1 << 28;							      \
     sc_ret;								      \
@@ -126,7 +128,7 @@
    function call, with the exception of LR (which is needed for the
    "sc; bnslr+" sequence) and CR (where only CR0.SO is clobbered to signal
    an error return status).  */
-# define INTERNAL_VSYSCALL_NCS(funcptr, err, nr, args...) \
+# define INTERNAL_VSYSCALL_NCS(funcptr, err, type, nr, args...) \
   ({									      \
     register void *r0  __asm__ ("r0");					      \
     register long int r3  __asm__ ("r3");				      \
@@ -139,18 +141,18 @@
     register long int r10 __asm__ ("r10");				      \
     register long int r11 __asm__ ("r11");				      \
     register long int r12 __asm__ ("r12");				      \
+    register type rval  __asm__ ("r3");					      \
     LOADARGS_##nr (funcptr, args);					      \
     __asm__ __volatile__						      \
       ("mtctr %0\n\t"							      \
        "bctrl\n\t"							      \
        "mfcr %0"							      \
-       : "=&r" (r0),							      \
-	 "=&r" (r3), "=&r" (r4), "=&r" (r5),  "=&r" (r6),  "=&r" (r7),	      \
-	 "=&r" (r8), "=&r" (r9), "=&r" (r10), "=&r" (r11), "=&r" (r12)	      \
-       : ASM_INPUT_##nr							      \
-       : "cr0", "ctr", "lr", "memory");					      \
+       : "+r" (r0), "+r" (r3), "+r" (r4), "+r" (r5),  "+r" (r6),  "+r" (r7),  \
+	 "+r" (r8), "+r" (r9), "+r" (r10), "+r" (r11), "+r" (r12)	      \
+       : : "cr0", "ctr", "lr", "memory");				      \
     err = (long int) r0;						      \
-    (int) r3;								      \
+    __asm__ __volatile__ ("" : "=r" (rval) : "r" (r3), "r" (r4));	      \
+    rval;								      \
   })
 
 # undef INLINE_SYSCALL
@@ -191,7 +193,7 @@
     register long int r10 __asm__ ("r10");				\
     register long int r11 __asm__ ("r11");				\
     register long int r12 __asm__ ("r12");				\
-    LOADARGS_##nr(name, args);					\
+    LOADARGS_##nr(name, args);						\
     __asm__ __volatile__						\
       ("sc   \n\t"							\
        "mfcr %0"							\
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h
index 059cf70..b4cdbbb 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h
@@ -75,7 +75,8 @@
 									      \
     if (__vdso_##name != NULL)						      \
       {									      \
-	sc_ret = INTERNAL_VSYSCALL_NCS (__vdso_##name, sc_err, nr, ##args);   \
+	sc_ret =							      \
+	  INTERNAL_VSYSCALL_NCS (__vdso_##name, sc_err, long int, nr, ##args);\
 	if (!INTERNAL_SYSCALL_ERROR_P (sc_ret, sc_err))			      \
 	  goto out;							      \
 	if (INTERNAL_SYSCALL_ERRNO (sc_ret, sc_err) != ENOSYS)		      \
@@ -105,7 +106,8 @@
 									      \
     if (__vdso_##name != NULL)						      \
       {									      \
-	v_ret = INTERNAL_VSYSCALL_NCS (__vdso_##name, err, nr, ##args);	      \
+	v_ret =								      \
+	  INTERNAL_VSYSCALL_NCS (__vdso_##name, err, long int, nr, ##args);   \
 	if (!INTERNAL_SYSCALL_ERROR_P (v_ret, err)			      \
 	    || INTERNAL_SYSCALL_ERRNO (v_ret, err) != ENOSYS)		      \
 	  goto out;							      \
@@ -121,12 +123,12 @@
 
 /* This version is for internal uses when there is no desire
    to set errno */
-#define INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK(name, err, nr, args...)	      \
+#define INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK(name, err, type, nr, args...)   \
   ({									      \
-    long int sc_ret = ENOSYS;						      \
+    type sc_ret = ENOSYS;						      \
 									      \
     if (__vdso_##name != NULL)						      \
-      sc_ret = INTERNAL_VSYSCALL_NCS (__vdso_##name, err, nr, ##args);	      \
+      sc_ret = INTERNAL_VSYSCALL_NCS (__vdso_##name, err, type, nr, ##args);  \
     else								      \
       err = 1 << 28;							      \
     sc_ret;								      \
@@ -142,7 +144,7 @@
    gave back in the non-error (CR0.SO cleared) case, otherwise (CR0.SO set)
    the negation of the return value in the kernel gets reverted.  */
 
-#define INTERNAL_VSYSCALL_NCS(funcptr, err, nr, args...) \
+#define INTERNAL_VSYSCALL_NCS(funcptr, err, type, nr, args...) \
   ({									\
     register void *r0  __asm__ ("r0");					\
     register long int r3  __asm__ ("r3");				\
@@ -151,20 +153,19 @@
     register long int r6  __asm__ ("r6");				\
     register long int r7  __asm__ ("r7");				\
     register long int r8  __asm__ ("r8");				\
+    register type rval  __asm__ ("r3");				        \
     LOADARGS_##nr (funcptr, args);					\
     __asm__ __volatile__						\
       ("mtctr %0\n\t"							\
        "bctrl\n\t"							\
        "mfcr  %0\n\t"							\
        "0:"								\
-       : "=&r" (r0),							\
-         "=&r" (r3), "=&r" (r4), "=&r" (r5),				\
-         "=&r" (r6), "=&r" (r7), "=&r" (r8)				\
-       : ASM_INPUT_##nr							\
-       : "r9", "r10", "r11", "r12",					\
-         "cr0", "ctr", "lr", "memory");					\
-	  err = (long int) r0;						\
-    r3;								\
+       : "+r" (r0), "+r" (r3), "+r" (r4), "+r" (r5),  "+r" (r6),        \
+         "+r" (r7), "+r" (r8)						\
+       : : "r9", "r10", "r11", "r12", "cr0", "ctr", "lr", "memory");	\
+    err = (long int) r0;						\
+    __asm__ __volatile__ ("" : "=r" (rval) : "r" (r3));		        \
+    rval;								\
   })
 
 #undef INLINE_SYSCALL

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

commit 08a894d5084cfdf81d720a437492e099495ec277
Author: Anton Blanchard <anton@samba.org>
Date:   Wed Jan 9 20:30:11 2013 -0600

    PowerPC: Change sched_getcpu to use vDSO getcpu instead of syscall.
    (cherry picked from commit d5e0b9bd6e296f3ec5263fa296d39f3fed9b8fa2)

diff --git a/ChangeLog b/ChangeLog
index b76e7dc..b956949 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2013-01-09  Anton Blanchard  <anton@samba.org>
+
+	* sysdeps/unix/sysv/linux/powerpc/sched_getcpu.c: New file.
+	* sysdeps/unix/sysv/linux/powerpc/Versions: Add __vdso_getcpu.
+	* sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h: Likewise.
+	* sysdeps/unix/sysv/linux/powerpc/init-first.c: Likewise.
+
 2013-02-08  Carlos O'Donell  <carlos@redhat.com>
 
 	[BZ #15006]
diff --git a/sysdeps/unix/sysv/linux/powerpc/Versions b/sysdeps/unix/sysv/linux/powerpc/Versions
index 1ef53b9..396a423 100644
--- a/sysdeps/unix/sysv/linux/powerpc/Versions
+++ b/sysdeps/unix/sysv/linux/powerpc/Versions
@@ -3,5 +3,6 @@ libc {
     __vdso_get_tbfreq;
     __vdso_clock_gettime;
     __vdso_clock_getres;
+    __vdso_getcpu;
   }
 }
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h b/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h
index 646e8c0..cda8491 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h
@@ -30,6 +30,8 @@ extern void *__vdso_clock_getres;
 
 extern void *__vdso_get_tbfreq;
 
+extern void *__vdso_getcpu;
+
 #endif
 
 #endif /* _LIBC_VDSO_H */
diff --git a/sysdeps/unix/sysv/linux/powerpc/init-first.c b/sysdeps/unix/sysv/linux/powerpc/init-first.c
index ba7ae29..6bcb7d5 100644
--- a/sysdeps/unix/sysv/linux/powerpc/init-first.c
+++ b/sysdeps/unix/sysv/linux/powerpc/init-first.c
@@ -27,6 +27,7 @@ void *__vdso_gettimeofday attribute_hidden;
 void *__vdso_clock_gettime;
 void *__vdso_clock_getres;
 void *__vdso_get_tbfreq;
+void *__vdso_getcpu;
 
 
 static inline void
@@ -41,6 +42,8 @@ _libc_vdso_platform_setup (void)
   __vdso_clock_getres = _dl_vdso_vsym ("__kernel_clock_getres", &linux2615);
 
   __vdso_get_tbfreq = _dl_vdso_vsym ("__kernel_vdso_get_tbfreq", &linux2615);
+
+  __vdso_getcpu = _dl_vdso_vsym ("__kernel_getcpu", &linux2615);
 }
 
 # define VDSO_SETUP _libc_vdso_platform_setup
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h b/sysdeps/unix/sysv/linux/powerpc/sched_getcpu.c
similarity index 67%
copy from sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h
copy to sysdeps/unix/sysv/linux/powerpc/sched_getcpu.c
index 646e8c0..617e6f1 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h
+++ b/sysdeps/unix/sysv/linux/powerpc/sched_getcpu.c
@@ -1,5 +1,4 @@
-/* Resolve function pointers to VDSO functions.
-   Copyright (C) 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2013 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
@@ -16,20 +15,16 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+#include <sched.h>
+#include <sysdep.h>
+#include <bits/libc-vdso.h>
 
-#ifndef _LIBC_VDSO_H
-#define _LIBC_VDSO_H
 
-#ifdef SHARED
+int
+sched_getcpu (void)
+{
+  unsigned int cpu;
+  int r = INLINE_VSYSCALL (getcpu, 3, &cpu, NULL, NULL);
 
-extern void *__vdso_gettimeofday attribute_hidden;
-
-extern void *__vdso_clock_gettime;
-
-extern void *__vdso_clock_getres;
-
-extern void *__vdso_get_tbfreq;
-
-#endif
-
-#endif /* _LIBC_VDSO_H */
+  return r == -1 ? r : cpu;
+}

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


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]