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, ibm/2.13/master, updated. glibc-2.13-44-gb2b4f00


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, ibm/2.13/master has been updated
       via  b2b4f0081c799b64eaad99616f55bd1759550d02 (commit)
       via  9aaaf1363c43f84c47ba6e35586a2ae8f8d44cba (commit)
       via  3380772a3c7f5c5dfc23604c7699b1e02624f049 (commit)
       via  47a1ab537d97add9091078a9659e0999532ac2dd (commit)
       via  3368cae07962e837739572c1212a13cc70015d55 (commit)
       via  14f5085ae9d956563e8b1ce73f398bfc15b92683 (commit)
       via  da5da702f3b6ecf48281a53b48257c02c7fe9c03 (commit)
       via  41f2ffe0862d97aa84f1495d6f6be3a8030a2a5f (commit)
       via  e320d3f7977c04d8f7e62e0e3fa214f61f78a3f6 (commit)
      from  ab2cceea626dd984d65b301b3588ae80d42f220b (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=b2b4f0081c799b64eaad99616f55bd1759550d02

commit b2b4f0081c799b64eaad99616f55bd1759550d02
Author: Ryan S. Arnold <rsa@linux.vnet.ibm.com>
Date:   Tue Jan 10 15:40:14 2012 -0600

    Fixed whitespace in ChangeLog that prevented a push.

diff --git a/ChangeLog b/ChangeLog
index f3a2632..4d60ebd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -19,7 +19,7 @@
 2011-11-18  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
 
 	* math/libm-test.inc: Added more nerabyint tests.
-	* sysdeps/powerpc/powerpc32/fpu/s_nearbyint.S: New file: nearbyint 
+	* sysdeps/powerpc/powerpc32/fpu/s_nearbyint.S: New file: nearbyint
 	optimized for PPC32.
 	* sysdeps/powerpc/powerpc32/fpu/s_nearbyintf.S: New file: nearbyintf
 	optimized for PPC32.

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=9aaaf1363c43f84c47ba6e35586a2ae8f8d44cba

commit 9aaaf1363c43f84c47ba6e35586a2ae8f8d44cba
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date:   Fri Dec 30 15:41:20 2011 -0500

    Fix for AIO stack size (backported from 'master' branch)

diff --git a/nptl/Versions b/nptl/Versions
index 5a88420..6a10375 100644
--- a/nptl/Versions
+++ b/nptl/Versions
@@ -255,6 +255,6 @@ libpthread {
   GLIBC_PRIVATE {
     __pthread_initialize_minimal;
     __pthread_clock_gettime; __pthread_clock_settime;
-    __pthread_unwind;
+    __pthread_unwind; __pthread_get_minstack;
   }
 }
diff --git a/nptl/nptl-init.c b/nptl/nptl-init.c
index 851bab2..628e7d7 100644
--- a/nptl/nptl-init.c
+++ b/nptl/nptl-init.c
@@ -408,7 +408,7 @@ __pthread_initialize_minimal_internal (void)
 
   /* Make sure it meets the minimum size that allocate_stack
      (allocatestack.c) will demand, which depends on the page size.  */
-  const uintptr_t pagesz = __sysconf (_SC_PAGESIZE);
+  const uintptr_t pagesz = GLRO(dl_pagesize);
   const size_t minstack = pagesz + __static_tls_size + MINIMAL_REST_STACK;
   if (limit.rlim_cur < minstack)
     limit.rlim_cur = minstack;
@@ -450,3 +450,13 @@ __pthread_initialize_minimal_internal (void)
 }
 strong_alias (__pthread_initialize_minimal_internal,
 	      __pthread_initialize_minimal)
+
+
+size_t
+__pthread_get_minstack (const pthread_attr_t *attr)
+{
+  struct pthread_attr *iattr = (struct pthread_attr *) attr;
+
+  return (GLRO(dl_pagesize) + __static_tls_size + PTHREAD_STACK_MIN
+         + iattr->guardsize);
+}
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
index 43ca44c..eb553a0 100644
--- a/nptl/pthreadP.h
+++ b/nptl/pthreadP.h
@@ -397,6 +397,7 @@ weak_function;
 
 extern void __pthread_init_static_tls (struct link_map *) attribute_hidden;
 
+extern size_t __pthread_get_minstack (const pthread_attr_t *attr);
 
 /* Namespace save aliases.  */
 extern int __pthread_getschedparam (pthread_t thread_id, int *policy,
diff --git a/nptl/sysdeps/unix/sysv/linux/aio_misc.h b/nptl/sysdeps/unix/sysv/linux/aio_misc.h
index 2bf7c17..7288ff1 100644
--- a/nptl/sysdeps/unix/sysv/linux/aio_misc.h
+++ b/nptl/sysdeps/unix/sysv/linux/aio_misc.h
@@ -46,8 +46,8 @@ __aio_create_helper_thread (pthread_t *threadp, void *(*tf) (void *),
   pthread_attr_init (&attr);
   pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED);
 
-  /* Don't set the stacksize to PTHREAD_STACK_MIN.  Let it default, otherwise
-     the stack may be too small if TLS is in use.  */
+  /* The helper thread needs only very little resources.  */
+  (void) pthread_attr_setstacksize (&attr, __pthread_get_minstack (&attr));
 
   /* Block all signals in the helper thread.  To do this thoroughly we
      temporarily have to block all signals here.  */
diff --git a/nptl/sysdeps/unix/sysv/linux/timer_routines.c b/nptl/sysdeps/unix/sysv/linux/timer_routines.c
index b159316..d75f45b 100644
--- a/nptl/sysdeps/unix/sysv/linux/timer_routines.c
+++ b/nptl/sysdeps/unix/sysv/linux/timer_routines.c
@@ -165,7 +165,7 @@ __start_helper_thread (void)
      and should go away automatically when canceled.  */
   pthread_attr_t attr;
   (void) pthread_attr_init (&attr);
-  (void) pthread_attr_setstacksize (&attr, PTHREAD_STACK_MIN);
+  (void) pthread_attr_setstacksize (&attr, __pthread_get_minstack (&attr));
 
   /* Block all signals in the helper thread but SIGSETXID.  To do this
      thoroughly we temporarily have to block all signals here.  The

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=3380772a3c7f5c5dfc23604c7699b1e02624f049

commit 3380772a3c7f5c5dfc23604c7699b1e02624f049
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date:   Thu Dec 29 19:15:10 2011 -0500

    PowerPC - Optimization for str[n]casecmp functions
    
    This patch provides throughput boost for the strcasecmp function
    (25% on ppc32 and 40% on ppc64) and strncasecmp (15% on both ppc32
    and ppc64) for POWER7. The optimization is done by manually
    (strcasecmp) or automatically (strncasecmp) unrolling the test loop
    to avoid CPU stalls caused by a test followed by a load.

diff --git a/ChangeLog b/ChangeLog
index f81b0c5..f3a2632 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2011-11-16  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
+
+	* sysdeps/powerpc/Makefile: Added locale-defines.sym generation.
+	* sysdeps/powerpc/locale-defines.sym: Locale definitions for strcasecmp
+	optimized code.
+	* sysdeps/powerpc/powerpc32/power7/Makefile: New file: added unroll-loop
+	option for strncasecmp/strncasecmp_l compilation.
+	* sysdeps/powerpc/powerpc32/power7/strcasecmp.S: New file: strcasecmp
+	optimization for PPC32.
+	* sysdeps/powerpc/powerpc32/power7/strcasecmp_l.S: New file: strcasecmp_l
+	optimization for PPC32.
+	* sysdeps/powerpc/powerpc64/power7/Makefile: Added unroll-loop option for
+	strncasecmp/strncasecmp_l compilation.
+	* sysdeps/powerpc/powerpc64/power7/strcasecmp.S: New file: strcasecmp
+	optimization for PPC64.
+	* sysdeps/powerpc/powerpc64/power7/strcasecmp_l.S: New file: strcasecmp_l
+	optimization for PPC64.
+
 2011-11-18  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
 
 	* math/libm-test.inc: Added more nerabyint tests.
diff --git a/sysdeps/powerpc/Makefile b/sysdeps/powerpc/Makefile
index e43ca70..23a9a16 100644
--- a/sysdeps/powerpc/Makefile
+++ b/sysdeps/powerpc/Makefile
@@ -23,4 +23,6 @@ endif
 ifeq ($(subdir),csu)
 # get offset to rtld_global._dl_hwcap
 gen-as-const-headers += rtld-global-offsets.sym
+# get offset to __locale_struct.__ctype_tolower
+gen-as-const-headers += locale-defines.sym
 endif
diff --git a/sysdeps/powerpc/locale-defines.sym b/sysdeps/powerpc/locale-defines.sym
new file mode 100644
index 0000000..af64b92
--- /dev/null
+++ b/sysdeps/powerpc/locale-defines.sym
@@ -0,0 +1,5 @@
+#include <locale/localeinfo.h>
+
+--
+
+LOCALE_CTYPE_TOLOWER	offsetof (struct __locale_struct, __ctype_tolower)
diff --git a/sysdeps/powerpc/powerpc32/power7/Makefile b/sysdeps/powerpc/powerpc32/power7/Makefile
new file mode 100644
index 0000000..5e8f4a2
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/power7/Makefile
@@ -0,0 +1,4 @@
+ifeq ($(subdir),string)
+CFLAGS-strncase.c += -funroll-loops
+CFLAGS-strncase_l.c += -funroll-loops
+endif
diff --git a/sysdeps/powerpc/powerpc32/power7/strcasecmp.S b/sysdeps/powerpc/powerpc32/power7/strcasecmp.S
new file mode 100644
index 0000000..5d84fce
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/power7/strcasecmp.S
@@ -0,0 +1,132 @@
+/* Optimized strcasecmp implementation for PowerPC32.
+   Copyright (C) 2011 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sysdep.h>
+#include <bp-sym.h>
+#include <bp-asm.h>
+#include <locale-defines.h>
+
+/* int [r3] strcasecmp (const char *s1 [r3], const char *s2 [r4] )
+
+   or if defined USE_IN_EXTENDED_LOCALE_MODEL:
+
+   int [r3] strcasecmp_l (const char *s1 [r3], const char *s2 [r4],
+                          __locale_t loc [r5]) */
+
+#ifndef STRCMP
+# define __STRCMP __strcasecmp
+# define STRCMP   strcasecmp
+#endif
+
+ENTRY (BP_SYM (__STRCMP))
+
+#define rRTN	r3	/* Return value */
+#define rSTR1	r5	/* 1st string */
+#define rSTR2	r4	/* 2nd string */
+#define rLOCARG	r5	/* 3rd argument: locale_t */
+#define rCHAR1	r6	/* Byte readed from 1st string */
+#define rCHAR2	r7	/* Byte readed from 2nd string */
+#define rADDR1	r8	/* Address of tolower(rCHAR1) */
+#define rADDR2	r12	/* Address of tolower(rCHAR2) */
+#define rLWR1	r8	/* Byte tolower(rCHAR1) */
+#define rLWR2	r12	/* Byte tolower(rCHAR2) */
+#define rTMP	r0
+#define rGOT	r9	/* Address of the Global Offset Table */
+#define rLOC	r11	/* Default locale address */
+
+	cmpw    cr7, r3, r4
+#ifndef USE_IN_EXTENDED_LOCALE_MODEL
+# ifdef SHARED
+	mflr	rTMP
+	bcl	20,31,.L1
+.L1:	mflr	rGOT
+	addis	rGOT, rGOT, _GLOBAL_OFFSET_TABLE_-.L1@ha
+	addi 	rGOT, rGOT, _GLOBAL_OFFSET_TABLE_-.L1@l
+	lwz	rLOC, __libc_tsd_LOCALE@got@tprel(rGOT)
+	add 	rLOC, rLOC, __libc_tsd_LOCALE@tls
+	lwz	rLOC, 0(rLOC)
+	mtlr	rTMP
+# else
+	lis	rTMP,_GLOBAL_OFFSET_TABLE_@ha
+	la	rLOC,_GLOBAL_OFFSET_TABLE_@l(rTMP)
+	lwz	rLOC, __libc_tsd_LOCALE@got@tprel(rGOT)
+	add	rLOC, rLOC, __libc_tsd_LOCALE@tls
+	lwz	rLOC, 0(rLOC)
+# endif /* SHARED */
+#else
+	mr	rLOC, rLOCARG
+#endif
+	mr	rSTR1, rRTN
+	lwz	rLOC, LOCALE_CTYPE_TOLOWER(rLOC)
+	li	rRTN, 0
+	beqlr	cr7
+
+	/* Unrolling loop for POWER: loads are done with 'lbz' plus
+	offset and string descriptors are only updated in the end
+	of loop unrolling. */
+
+L(loop):
+	lbz	rCHAR1, 0(rSTR1)	/* Load char from s1 */
+	lbz	rCHAR2, 0(rSTR2)	/* Load char from s2 */
+	sldi	rADDR1, rCHAR1, 2	/* Calculate address for tolower(*s1) */
+	sldi	rADDR2, rCHAR2, 2	/* Calculate address for tolower(*s2) */
+	lwzx	rLWR1, rLOC, rADDR1	/* Load tolower(*s1) */
+	lwzx	rLWR2, rLOC, rADDR2	/* Load tolower(*s2) */
+	cmpwi	cr7, rCHAR1, 0		/* *s1 == '\0' ? */
+	subf.	r3, rLWR2, rLWR1
+	bnelr
+	beqlr	cr7
+	lbz	rCHAR1, 1(rSTR1)
+	lbz	rCHAR2, 1(rSTR2)
+	sldi	rADDR1, rCHAR1, 2
+	sldi	rADDR2, rCHAR2, 2
+	lwzx	rLWR1, rLOC, rADDR1
+	lwzx	rLWR2, rLOC, rADDR2
+	cmpwi	cr7, rCHAR1, 0
+	subf.	r3, rLWR2, rLWR1
+	bnelr
+	beqlr	cr7
+	lbz	rCHAR1, 2(rSTR1)
+	lbz	rCHAR2, 2(rSTR2)
+	sldi	rADDR1, rCHAR1, 2
+	sldi	rADDR2, rCHAR2, 2
+	lwzx	rLWR1, rLOC, rADDR1
+	lwzx	rLWR2, rLOC, rADDR2
+	cmpwi	cr7, rCHAR1, 0
+	subf.	r3, rLWR2, rLWR1
+	bnelr
+	beqlr	cr7
+	lbz	rCHAR1, 3(rSTR1)
+	lbz	rCHAR2, 3(rSTR2)
+	/* Increment both string descriptors */
+	addi	rSTR1, rSTR1, 4
+	addi	rSTR2, rSTR2, 4
+	sldi	rADDR1, rCHAR1, 2
+	sldi	rADDR2, rCHAR2, 2
+	lwzx	rLWR1, rLOC, rADDR1
+	lwzx	rLWR2, rLOC, rADDR2
+	cmpwi	cr7, rCHAR1, 0
+	subf.	r3, rLWR2, rLWR1
+	bnelr
+	bne	cr7,L(loop)
+	blr
+END (BP_SYM (__STRCMP))
+
+weak_alias (BP_SYM (__STRCMP), BP_SYM (STRCMP))
+libc_hidden_builtin_def (__STRCMP)
diff --git a/sysdeps/powerpc/powerpc32/power7/strcasecmp_l.S b/sysdeps/powerpc/powerpc32/power7/strcasecmp_l.S
new file mode 100644
index 0000000..c13c4eb
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/power7/strcasecmp_l.S
@@ -0,0 +1,5 @@
+#define USE_IN_EXTENDED_LOCALE_MODEL
+#define STRCMP   strcasecmp_l
+#define __STRCMP __strcasecmp_l
+
+#include "strcasecmp.S"
diff --git a/sysdeps/powerpc/powerpc64/power7/Makefile b/sysdeps/powerpc/powerpc64/power7/Makefile
index b0f4520..40aacfa 100644
--- a/sysdeps/powerpc/powerpc64/power7/Makefile
+++ b/sysdeps/powerpc/powerpc64/power7/Makefile
@@ -3,3 +3,8 @@ ifeq ($(subdir),elf)
 # optimization may require a TOC reference before relocations are resolved.
 CFLAGS-rtld.c += -mno-vsx
 endif
+
+ifeq ($(subdir),string)
+CFLAGS-strncase.c += -funroll-loops
+CFLAGS-strncase_l.c += -funroll-loops
+endif
diff --git a/sysdeps/powerpc/powerpc64/power7/strcasecmp.S b/sysdeps/powerpc/powerpc64/power7/strcasecmp.S
new file mode 100644
index 0000000..1477b2e
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/power7/strcasecmp.S
@@ -0,0 +1,125 @@
+/* Optimized strcasecmp implementation for PowerPC64.
+   Copyright (C) 2011 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sysdep.h>
+#include <bp-sym.h>
+#include <bp-asm.h>
+#include <locale-defines.h>
+
+/* int [r3] strcasecmp (const char *s1 [r3], const char *s2 [r4] )
+
+   or if defined USE_IN_EXTENDED_LOCALE_MODEL:
+
+   int [r3] strcasecmp_l (const char *s1 [r3], const char *s2 [r4],
+                          __locale_t loc [r5]) */
+
+#ifndef STRCMP
+# define __STRCMP __strcasecmp
+# define STRCMP   strcasecmp
+#endif
+
+ENTRY (BP_SYM (__STRCMP))
+	CALL_MCOUNT 2
+
+#define rRTN	r3	/* Return value */
+#define rSTR1	r5	/* 1st string */
+#define rSTR2	r4	/* 2nd string */
+#define rLOCARG	r5	/* 3rd argument: locale_t */
+#define rCHAR1	r6	/* Byte readed from 1st string */
+#define rCHAR2	r7	/* Byte readed from 2nd string */
+#define rADDR1	r8	/* Address of tolower(rCHAR1) */
+#define rADDR2	r12	/* Address of tolower(rCHAR2) */
+#define rLWR1	r8	/* Word tolower(rCHAR1) */
+#define rLWR2	r12	/* Word tolower(rCHAR2) */
+#define rTMP	r9
+#define rLOC	r11	/* Default locale address */
+
+	cmpd	cr7, r3, r4
+#ifndef USE_IN_EXTENDED_LOCALE_MODEL
+	ld 	rTMP, __libc_tsd_LOCALE@got@tprel(r2)
+	add 	rLOC, rTMP, __libc_tsd_LOCALE@tls
+	ld	rLOC, 0(rLOC)
+#else
+	mr	rLOC, rLOCARG
+#endif
+	ld	rLOC, LOCALE_CTYPE_TOLOWER(rLOC)
+	mr	rSTR1, rRTN
+	li	rRTN, 0
+	beqlr	cr7
+
+
+	/* Unrolling loop for POWER: loads are done with 'lbz' plus
+	offset and string descriptors are only updated in the end
+	of loop unrolling. */
+
+	lbz	rCHAR1, 0(rSTR1)	/* Load char from s1 */
+	lbz	rCHAR2, 0(rSTR2)	/* Load char from s2 */
+L(loop):
+	cmpdi	rCHAR1, 0		/* *s1 == '\0' ? */
+	sldi	rADDR1, rCHAR1, 2	/* Calculate address for tolower(*s1) */
+	sldi	rADDR2, rCHAR2, 2	/* Calculate address for tolower(*s2) */
+	lwzx	rLWR1, rLOC, rADDR1	/* Load tolower(*s1) */
+	lwzx	rLWR2, rLOC, rADDR2	/* Load tolower(*s2) */
+	cmpw	cr1, rLWR1, rLWR2	/* r = tolower(*s1) == tolower(*s2) ? */
+	crorc	4*cr1+eq,eq,4*cr1+eq	/* (*s1 != '\0') || (r == 1) */
+	beq	cr1, L(done)
+	lbz	rCHAR1, 1(rSTR1)
+	lbz	rCHAR2, 1(rSTR2)
+	cmpdi	rCHAR1, 0
+	sldi	rADDR1, rCHAR1, 2
+	sldi	rADDR2, rCHAR2, 2
+	lwzx	rLWR1, rLOC, rADDR1
+	lwzx	rLWR2, rLOC, rADDR2
+	cmpw	cr1, rLWR1, rLWR2
+	crorc	4*cr1+eq,eq,4*cr1+eq
+	beq	cr1, L(done)
+	lbz	rCHAR1, 2(rSTR1)
+	lbz	rCHAR2, 2(rSTR2)
+	cmpdi	rCHAR1, 0
+	sldi	rADDR1, rCHAR1, 2
+	sldi	rADDR2, rCHAR2, 2
+	lwzx	rLWR1, rLOC, rADDR1
+	lwzx	rLWR2, rLOC, rADDR2
+	cmpw	cr1, rLWR1, rLWR2
+	crorc	4*cr1+eq,eq,4*cr1+eq
+	beq	cr1, L(done)
+	lbz	rCHAR1, 3(rSTR1)
+	lbz	rCHAR2, 3(rSTR2)
+	cmpdi	rCHAR1, 0
+	/* Increment both string descriptors */
+	addi	rSTR1, rSTR1, 4
+	addi	rSTR2, rSTR2, 4
+	sldi	rADDR1, rCHAR1, 2
+	sldi	rADDR2, rCHAR2, 2
+	lwzx	rLWR1, rLOC, rADDR1
+	lwzx	rLWR2, rLOC, rADDR2
+	cmpw	cr1, rLWR1, rLWR2
+	crorc	4*cr1+eq,eq,4*cr1+eq
+	beq     cr1,L(done)
+	lbz	rCHAR1, 0(rSTR1)	/* Load char from s1 */
+	lbz	rCHAR2, 0(rSTR2)	/* Load char from s2 */
+	b	L(loop)
+L(done):
+	subf	r0, rLWR2, rLWR1
+	extsw	rRTN, r0
+	blr
+END (BP_SYM (__STRCMP))
+
+weak_alias (BP_SYM (__STRCMP), BP_SYM (STRCMP))
+libc_hidden_builtin_def (__STRCMP)
diff --git a/sysdeps/powerpc/powerpc64/power7/strcasecmp_l.S b/sysdeps/powerpc/powerpc64/power7/strcasecmp_l.S
new file mode 100644
index 0000000..c13c4eb
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/power7/strcasecmp_l.S
@@ -0,0 +1,5 @@
+#define USE_IN_EXTENDED_LOCALE_MODEL
+#define STRCMP   strcasecmp_l
+#define __STRCMP __strcasecmp_l
+
+#include "strcasecmp.S"

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=47a1ab537d97add9091078a9659e0999532ac2dd

commit 47a1ab537d97add9091078a9659e0999532ac2dd
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date:   Thu Dec 29 19:10:41 2011 -0500

    PowerPC - Optimization for nearbyint[f]
    
    This patch provides throughput boost for the nearbyint[f] functions
    for POWER. For POWER7, it improves performance for nearbyintf from
    5 (ppc32) to 6 times (ppc64) and for nearbyint from 2.5 up to 5
    times. For POWER6 it improves nearbyintf up to 2x (ppc64) and
    nearbyint up to 4x.

diff --git a/ChangeLog b/ChangeLog
index 4ff91c1..f81b0c5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2011-11-18  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
+
+	* math/libm-test.inc: Added more nerabyint tests.
+	* sysdeps/powerpc/powerpc32/fpu/s_nearbyint.S: New file: nearbyint 
+	optimized for PPC32.
+	* sysdeps/powerpc/powerpc32/fpu/s_nearbyintf.S: New file: nearbyintf
+	optimized for PPC32.
+	* sysdeps/powerpc/powerpc64/fpu/s_nearbyint.S: New file: nearbyint
+	optimized for PPC64.
+	* sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S: New file: nearbyintf
+	optimized for PPC64.
+
 2011-10-22  Andreas Schwab  <schwab@linux-m68k.org>
 
 	* sysdeps/ieee754/ldbl-128ibm/s_atanl.c: Include <math.h> before
diff --git a/math/libm-test.inc b/math/libm-test.inc
index c6ed7a3..54dbdf1 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -4607,6 +4607,10 @@ nearbyint_test (void)
   TEST_f_f (nearbyint, minus_infty, minus_infty);
   TEST_f_f (nearbyint, nan_value, nan_value);
 
+  /* Subnormal values */
+  TEST_f_f (nearbyint, -8.98847e+307, -8.98847e+307);
+  TEST_f_f (nearbyint, -4.45015e-308, minus_zero);
+
   /* Default rounding mode is round to nearest.  */
   TEST_f_f (nearbyint, 0.5, 0.0);
   TEST_f_f (nearbyint, 1.5, 2.0);
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_nearbyint.S b/sysdeps/powerpc/powerpc32/fpu/s_nearbyint.S
new file mode 100644
index 0000000..0102aa3
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/s_nearbyint.S
@@ -0,0 +1,80 @@
+/* Round to int floating-point values.  PowerPC32 version.
+   Copyright (C) 2011 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Adhemerval Zanella <azanella@br.ibm.com>, 2011
+
+   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, write to the Free
+   Software Foundation, Inc., 1 Franklin Street, Fifth Floor, Boston MA
+   02110-1301 USA.  */
+
+/* This has been coded in assembler because GCC makes such a mess of it
+   when it's coded in C.  */
+
+#include <sysdep.h>
+#include <math_ldbl_opt.h>
+
+
+/* double [fp1] nearbyint(double [fp1] x) */
+
+	.section	.rodata.cst4,"aM",@progbits,4
+	.align	2
+.LC0:	/* 2**52 */
+	.long 0x59800000	/* TWO52: 2**52 */
+
+	.section	".text"
+ENTRY (__nearbyint)
+#ifdef SHARED
+	mflr	r11
+	cfi_register(lr,r11)
+	bcl	20,31,1f
+1:	mflr	r9
+	addis	r9,r9,.LC0-1b@ha
+	lfs	fp13,.LC0-1b@l(r9)
+	mtlr	r11
+	cfi_same_value (lr)
+#else
+	lis	r9,.LC0@ha
+	lfs	fp13,.LC0@l(r9)
+#endif
+	fabs	fp0,fp1
+	fsub    fp12,fp13,fp13	/* generate 0.0  */
+	fcmpu	cr7,fp0,fp13	/* if (fabs(x) > TWO52 */
+	bgelr	cr7
+	fcmpu	cr7,fp1,fp12	/* if (x > 0.0 */
+	ble	cr7,L(lessthanzero)
+	mtfsb0	4*cr7+lt	/* Disable FE_INEXACT exception */
+	fadd	fp0,fp1,fp13	/* x += TWO52 */
+	fsub	fp1,fp0,fp13	/* x -= TWO52 */
+	fabs	fp1,fp1		/* if (x == 0.0 */
+	mtfsb0	4*cr1+eq	/* Clear any FE_INEXACT exception */
+	blr
+L(lessthanzero):
+	bgelr	cr7
+	mtfsb0	4*cr7+lt	/* Disable FE_INEXACT exception */
+	fsub	fp0,fp13,fp1	/* x -= TWO52 */
+	fsub	fp0,fp0,fp13	/* x += TWO52 */
+	fneg	fp1,fp0		/* if (x == 0.0) */
+	mtfsb0	4*cr1+eq	/* Clear any FE_INEXACT exception */
+	blr
+END (__nearbyint)
+
+weak_alias (__nearbyint, nearbyint)
+
+#ifdef NO_LONG_DOUBLE
+weak_alias (__nearbyint, nearbyintl)
+strong_alias (__nearbyint, __nearbyintl)
+#endif
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __nearbyint, nearbyintl, GLIBC_2_0)
+#endif
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_nearbyintf.S b/sysdeps/powerpc/powerpc32/fpu/s_nearbyintf.S
new file mode 100644
index 0000000..5190228
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/s_nearbyintf.S
@@ -0,0 +1,70 @@
+/* Round to int floating-point values.  PowerPC32 version.
+   Copyright (C) 2011 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Adhemerval Zanella <azanella@br.ibm.com>, 2011
+
+   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, write to the Free
+   Software Foundation, Inc., 1 Franklin Street, Fifth Floor, Boston MA
+   02110-1301 USA.  */
+
+/* This has been coded in assembler because GCC makes such a mess of it
+   when it's coded in C.  */
+
+#include <sysdep.h>
+
+
+/* float [fp1] nearbyintf(float [fp1] x) */
+
+	.section	.rodata.cst4,"aM",@progbits,4
+	.align	2
+.LC0:
+	.long 0x4B000000	/* TWO23: 2**23 */
+
+	.section	".text"
+ENTRY (__nearbyintf)
+#ifdef SHARED
+	mflr	r11
+	cfi_register(lr,r11)
+	bcl	20,31,1f
+1:	mflr	r9
+	addis	r9,r9,.LC0-1b@ha
+	lfs	fp13,.LC0-1b@l(r9)
+	mtlr	r11
+	cfi_same_value (lr)
+#else
+	lis	r9,.LC0@ha
+	lfs	fp13,.LC0@l(r9)
+#endif
+	fabs	fp0,fp1
+	fsub    fp12,fp13,fp13		/* generate 0.0  */
+	fcmpu	cr7,fp0,fp13		/* if (fabs(x) > TWO23 */
+	bgelr	cr7
+	fcmpu	cr7,fp1,fp12		/* if (x > 0.0 */
+	ble	cr7,L(lessthanzero)
+	mtfsb0	4*cr7+lt		/* Disable FE_INEXACT exception */
+	fadds	fp0,fp1,fp13		/* x += TWO23 */
+	fsubs	fp1,fp0,fp13		/* x -= TWO23 */
+	mtfsb0	4*cr1+eq		/* Clear any FE_INEXACT exception */
+	blr
+L(lessthanzero):
+	bgelr	cr7
+	mtfsb0	4*cr7+lt		/* Disable FE_INEXACT exception */
+	fsubs	fp0,fp13,fp1		/* x -= TWO23 */
+	fsubs	fp0,fp0,fp13		/* x += TWO23 */
+	fneg	fp1,fp0			/* if (x == 0.0) */
+	mtfsb0	4*cr1+eq		/* Clear any FE_INEXACT exception */
+	blr
+END (__nearbyintf)
+
+weak_alias (__nearbyintf, nearbyintf)
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_nearbyint.S b/sysdeps/powerpc/powerpc64/fpu/s_nearbyint.S
new file mode 100644
index 0000000..436160f
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/s_nearbyint.S
@@ -0,0 +1,68 @@
+/* Round to int floating-point values.  PowerPC64 version.
+   Copyright (C) 2011 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Adhemerval Zanella <azanella@br.ibm.com>, 2011
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* This has been coded in assembler because GCC makes such a mess of it
+   when it's coded in C.  */
+
+#include <sysdep.h>
+#include <math_ldbl_opt.h>
+
+
+/* double [fp1] nearbyint(double [fp1] x) */
+
+	.section	".toc","aw"
+.LC0:	/* 2**52 */
+	.tc FD_43300000_0[TC],0x4330000000000000
+	.section	".text"
+
+EALIGN (__nearbyint, 4, 0)
+	CALL_MCOUNT 0
+	fabs	fp0,fp1
+	lfd	fp13,.LC0@toc(2)
+	fcmpu	cr7,fp0,fp13	/* if (fabs(x) > TWO52)  */
+	bgelr	cr7
+	fsub	fp12,fp13,fp13	/* generate 0.0 */
+	fcmpu	cr7,fp1,fp12	/* if (x > 0.0) */
+	ble	cr7, L(lessthanzero)
+	mtfsb0	4*cr7+lt	/* Disable FE_INEXACT exception */
+	fadd	fp1,fp1,fp13	/* x+= TWO52 */
+	fsub	fp1,fp1,fp13	/* x-= TWO52 */
+	fabs	fp1,fp1		/* if (x == 0.0) */
+	mtfsb0	4*cr1+eq	/* Clear any FE_INEXACT exception */
+	blr			/* x = 0.0; */
+L(lessthanzero):
+	bgelr	cr7		/* if (x < 0.0) */
+	mtfsb0	4*cr7+lt
+	fsub	fp1,fp1,fp13	/* x -= TWO52 */
+	fadd	fp1,fp1,fp13	/* x += TWO52 */
+	fnabs	fp1,fp1		/* if (x == 0.0) */
+	mtfsb0	4*cr1+eq
+	blr			/* x = -0.0; */
+END (__nearbyint)
+
+weak_alias (__nearbyint, nearbyint)
+
+#ifdef NO_LONG_DOUBLE
+weak_alias (__nearbyint, nearbyint)
+strong_alias (__nearbyint, __nearbyintl)
+#endif
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __nearbyint, nearbyintl, GLIBC_2_0)
+#endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S b/sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S
new file mode 100644
index 0000000..c337e79
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S
@@ -0,0 +1,59 @@
+/* Round to int floating-point values.  PowerPC64 version.
+   Copyright (C) 2011 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Adhemerval Zanella <azanella@br.ibm.com>, 2011
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* This has been coded in assembler because GCC makes such a mess of it
+   when it's coded in C.  */
+
+#include <sysdep.h>
+
+
+/* float [fp1] nearbyintf(float [fp1]) */
+
+	.section	".toc","aw"
+.LC0:	/* 2**23 */
+	.tc FD_4b000000_0[TC],0x4b00000000000000
+	.section	".text"
+
+EALIGN (__nearbyintf, 4, 0)
+	CALL_MCOUNT 0
+	fabs	fp0,fp1
+	lfs	fp13,.LC0@toc(2)
+	fcmpu	cr7,fp0,fp13	/* if (fabs(x) > TWO52)  */
+	bgelr	cr7
+	fsubs	fp12,fp13,fp13	/* generate 0.0 */
+	fcmpu	cr7,fp1,fp12	/* if (x > 0.0)  */
+	ble	cr7, L(lessthanzero)
+	mtfsb0	4*cr7+lt	/* Disable FE_INEXACT exception */
+	fadds	fp1,fp1,fp13	/* x += TWO23 */
+	fsubs	fp1,fp1,fp13	/* x -= TWO23 */
+	fabs	fp1,fp1		/* if (x == 0.0) */
+	mtfsb0	4*cr1+eq	/* Clear pending FE_INEXACT exception */
+	blr			/* x = 0.0; */
+L(lessthanzero):
+	bgelr	cr7		/* if (x < 0.0) */
+	mtfsb0	4*cr7+lt	/* Disable FE_INEXACT exception */
+	fsubs	fp1,fp1,fp13	/* x -= TWO23 */
+	fadds	fp1,fp1,fp13	/* x += TWO23 */
+	fnabs	fp1,fp1		/* if (x == 0.0) */
+	mtfsb0	4*cr1+eq	/* Clear pending FE_INEXACT exception */
+	blr			/* x = -0.0; */
+END (__nearbyintf)
+
+weak_alias (__nearbyintf, nearbyintf)

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=3368cae07962e837739572c1212a13cc70015d55

commit 3368cae07962e837739572c1212a13cc70015d55
Author: Andreas Schwab <schwab@linux-m68k.org>
Date:   Thu Dec 29 18:44:57 2011 -0500

    Fix compilation due to __nan defines
    
    Backport of commit #ee2aafe08e68c88412b7dcfa4b1e0d11789348f8

diff --git a/ChangeLog b/ChangeLog
index e103e34..4ff91c1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-10-22  Andreas Schwab  <schwab@linux-m68k.org>
+
+	* sysdeps/ieee754/ldbl-128ibm/s_atanl.c: Include <math.h> before
+	"math_private.h".
+
 2011-12-06  Andreas Schwab  <schwab@linux-m68k.org>
 
 	[BZ #13472]
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_atanl.c b/sysdeps/ieee754/ldbl-128ibm/s_atanl.c
index b6195f1..8c8c6d7 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_atanl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_atanl.c
@@ -58,7 +58,7 @@
     License along with this library; if not, write to the Free Software
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA */
 
-
+#include <math.h>
 #include "math_private.h"
 #include <math_ldbl_opt.h>
 

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=14f5085ae9d956563e8b1ce73f398bfc15b92683

commit 14f5085ae9d956563e8b1ce73f398bfc15b92683
Author: Andreas Schwab <schwab@linux-m68k.org>
Date:   Thu Dec 29 18:38:27 2011 -0500

    Fix a wrong constant in powerpc hypot implementation
    
    Backport of commit #850fb039cec802072f70ed9763927881bbbf639c

diff --git a/ChangeLog b/ChangeLog
index 63e7ed6..e103e34 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-12-06  Andreas Schwab  <schwab@linux-m68k.org>
+
+	[BZ #13472]
+	* sysdeps/powerpc/fpu/e_hypot.c (twoM600): Correct value.
+
 2011-11-07  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
 
 	* sysdeps/powerpc/fpu/math_private.h: Using inline assembly version
diff --git a/sysdeps/powerpc/fpu/e_hypot.c b/sysdeps/powerpc/fpu/e_hypot.c
index a8d67d8..3731c58 100644
--- a/sysdeps/powerpc/fpu/e_hypot.c
+++ b/sysdeps/powerpc/fpu/e_hypot.c
@@ -26,7 +26,7 @@ static const double two500  = 3.2733906078961419e+150;
 static const double two600  = 4.149515568880993e+180;
 static const double two1022 = 4.49423283715579e+307;
 static const double twoM500 = 3.054936363499605e-151;
-static const double twoM600 = 4.616489308892868e-128;
+static const double twoM600 = 2.4099198651028841e-181;
 static const double pdnum   = 2.225073858507201e-308;
 
 /* __ieee754_hypot(x,y)

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=da5da702f3b6ecf48281a53b48257c02c7fe9c03

commit da5da702f3b6ecf48281a53b48257c02c7fe9c03
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date:   Thu Dec 29 18:36:35 2011 -0500

    PowerPC: Arithmetic function optimizations for POWER
    
    This patch creates inline assembly functions that use intrinsic PPC
    floating point instructions when the platform supports them but rely on
    the internal GLIBC functions when the instructions are not implemented
    (for instance, on POWER4).

diff --git a/ChangeLog b/ChangeLog
index db727b3..63e7ed6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2011-11-07  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
+
+	* sysdeps/powerpc/fpu/math_private.h: Using inline assembly version
+	of math functions ceil, trunc, floor, round, and sqrt, when
+	avaliable on the platform.
+	* sysdeps/powerpc/fpu/e_sqrt.c: Undefine __ieee754_sqrt to avoid
+	name clash.
+	* sysdeps/powerpc/fpu/e_sqrtf.c: Likewise.
+	* sysdeps/powerpc/powerpc64/fpu/e_sqrt.c: Likewise.
+	* sysdeps/powerpc/powerpc64/fpu/e_sqrtf.c: Likewise.
+
 2011-10-12  Ulrich Drepper  <drepper@gmail.com>
 
 	Add integration with gcc's -ffinite-math-only and optimize wrapper
diff --git a/sysdeps/powerpc/fpu/e_sqrt.c b/sysdeps/powerpc/fpu/e_sqrt.c
index f9ded25..d59bd08 100644
--- a/sysdeps/powerpc/fpu/e_sqrt.c
+++ b/sysdeps/powerpc/fpu/e_sqrt.c
@@ -154,6 +154,7 @@ __slow_ieee754_sqrt (double x)
   return f_wash (x);
 }
 
+#undef __ieee754_sqrt
 double
 __ieee754_sqrt (double x)
 {
diff --git a/sysdeps/powerpc/fpu/e_sqrtf.c b/sysdeps/powerpc/fpu/e_sqrtf.c
index 965faee..9c6b860 100644
--- a/sysdeps/powerpc/fpu/e_sqrtf.c
+++ b/sysdeps/powerpc/fpu/e_sqrtf.c
@@ -130,7 +130,7 @@ __slow_ieee754_sqrtf (float x)
   return f_washf (x);
 }
 
-
+#undef __ieee754_sqrtf
 float
 __ieee754_sqrtf (float x)
 {
diff --git a/sysdeps/powerpc/fpu/math_private.h b/sysdeps/powerpc/fpu/math_private.h
index 90021c6..c4dd217 100644
--- a/sysdeps/powerpc/fpu/math_private.h
+++ b/sysdeps/powerpc/fpu/math_private.h
@@ -1,5 +1,5 @@
 /* Private inline math functions for powerpc.
-   Copyright (C) 2006
+   Copyright (C) 2006, 2011
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -25,12 +25,145 @@
 #include <ldsodefs.h>
 #include <dl-procinfo.h>
 
+#include <math/math_private.h>
+
 # if __WORDSIZE == 64 || defined _ARCH_PWR4
 #  define __CPU_HAS_FSQRT 1
+
+#ifndef __ieee754_sqrt
+# define __ieee754_sqrt(x)		\
+  ({ double __z;			\
+     __asm __volatile (			\
+	"	fsqrt %0,%1\n"		\
+		: "=f" (__z)		\
+		: "f"(x));		\
+     __z; })
+#endif
+#ifndef __ieee754_sqrtf
+# define __ieee754_sqrtf(x)		\
+  ({ float __z;				\
+     __asm __volatile (			\
+	"	fsqrts %0,%1\n"		\
+		: "=f" (__z)		\
+		: "f"(x));		\
+     __z; })
+#endif
+
 # else
 #  define __CPU_HAS_FSQRT ((GLRO(dl_hwcap) & PPC_FEATURE_64) != 0)
+# endif	// __WORDSIZE == 64 || defined _ARCH_PWR4
+
+
+#if defined _ARCH_PWR5X
+
+# ifndef __round
+#  define __round(x)			\
+    ({ double __z;			\
+      __asm __volatile (		\
+	"	frin %0,%1\n"		\
+		: "=f" (__z)		\
+		: "f" (x));		\
+     __z; })
+# endif
+# ifndef __roundf
+#  define __roundf(x)			\
+    ({ float __z;			\
+     __asm __volatile (			\
+	"	frin %0,%1\n"		\
+	"	frsp %0,%0\n"		\
+		: "=f" (__z)		\
+		: "f" (x));		\
+     __z; })
+# endif
+
+# ifndef __trunc
+#  define __trunc(x)			\
+    ({ double __z;			\
+     __asm __volatile (			\
+	"	friz %0,%1\n"		\
+		: "=f" (__z)		\
+		: "f" (x));		\
+     __z; })
+# endif
+# ifndef __truncf
+#  define __truncf(x)			\
+    ({ float __z;			\
+     __asm __volatile (			\
+	"	friz %0,%1\n"		\
+	"	frsp %0,%0\n"		\
+		: "=f" (__z)		\
+		: "f" (x));		\
+     __z; })
+# endif
+
+# ifndef __ceil
+#  define __ceil(x)			\
+    ({ double __z;			\
+     __asm __volatile (			\
+	"	frip %0,%1\n"		\
+		: "=f" (__z)		\
+		: "f" (x));		\
+     __z; })
+# endif
+# ifndef __ceilf
+#  define __ceilf(x)			\
+    ({ float __z;			\
+     __asm __volatile (			\
+	"	frip %0,%1\n"		\
+	"	frsp %0,%0\n"		\
+		: "=f" (__z)		\
+		: "f" (x));		\
+     __z; })
 # endif
 
+# ifndef __floor
+#  define __floor(x)			\
+    ({ double __z;			\
+     __asm __volatile (			\
+	"	frim %0,%1\n"		\
+		: "=f" (__z)		\
+		: "f" (x));		\
+     __z; })
+# endif
+# ifndef __floorf
+#  define __floorf(x)			\
+    ({ float __z;			\
+     __asm __volatile (			\
+	"	frim %0,%1\n"		\
+	"	frsp %0,%0\n"		\
+		: "=f" (__z)		\
+		: "f" (x));		\
+     __z; })
+# endif
+
+#endif	/* defined _ARCH_PWR5X */
+
+
+#if defined _ARCH_PWR6
+
+# ifndef __copysign
+#  define __copysign(x, y)		\
+    ({ double __z;			\
+     __asm __volatile (			\
+	"	fcpsgn %0,%1,%2\n"	\
+		: "=f" (__z)		\
+		: "f" (y), "f" (x));	\
+     __z; })
+# endif
+# ifndef __copysignf
+#  define __copysignf(x, y)		\
+    ({ float __z;			\
+     __asm __volatile (			\
+	"	fcpsgn %0,%1,%2\n"	\
+	"	frsp %0,%0\n"		\
+		: "=f" (__z)		\
+		: "f" (y), "f" (x));	\
+     __z; })
+# endif
+
+#endif /* defined _ARCH_PWR6 */
+
+
 # ifndef __LIBC_INTERNAL_MATH_INLINES
 extern double __slow_ieee754_sqrt (double);
 __inline double
@@ -78,6 +211,4 @@ __ieee754_sqrtf (float __x)
 }
 #endif /* __LIBC_INTERNAL_MATH_INLINES */
 
-#include <math/math_private.h>
-
 #endif /* _PPC_MATH_PRIVATE_H_ */
diff --git a/sysdeps/powerpc/powerpc64/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc64/fpu/e_sqrt.c
index 314abba..66d04ce 100644
--- a/sysdeps/powerpc/powerpc64/fpu/e_sqrt.c
+++ b/sysdeps/powerpc/powerpc64/fpu/e_sqrt.c
@@ -20,6 +20,7 @@
 #include <math.h>
 #include <math_private.h>
 
+#undef __ieee754_sqrt
 double
 __ieee754_sqrt (double x)
 {
diff --git a/sysdeps/powerpc/powerpc64/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc64/fpu/e_sqrtf.c
index 7157214..847a2e4 100644
--- a/sysdeps/powerpc/powerpc64/fpu/e_sqrtf.c
+++ b/sysdeps/powerpc/powerpc64/fpu/e_sqrtf.c
@@ -20,6 +20,7 @@
 #include <math.h>
 #include <math_private.h>
 
+#undef __ieee754_sqrtf
 float
 __ieee754_sqrtf (float x)
 {

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=41f2ffe0862d97aa84f1495d6f6be3a8030a2a5f

commit 41f2ffe0862d97aa84f1495d6f6be3a8030a2a5f
Author: Ulrich Drepper <drepper@gmail.com>
Date:   Thu Dec 29 18:36:05 2011 -0500

    Optimize libm
    
    libm is now somewhat integrated with gcc's -ffinite-math-only option
    and lots of the wrapper functions have been optimized.
    
    Backport of commit #0ac5ae2335292908f39031b1ea9fe8edce433c0f

diff --git a/ChangeLog b/ChangeLog
index 05aeb78..db727b3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2011-10-12  Ulrich Drepper  <drepper@gmail.com>
+
+	Add integration with gcc's -ffinite-math-only and optimize wrapper
+	functions in libm.
+	* sysdeps/powerpc/fpu/e_hypot.c: Add __*_finite alias.
+	* sysdeps/powerpc/fpu/e_hypotf.c: Likewise.
+	* sysdeps/powerpc/fpu/e_sqrt.c: Likewise.
+	* sysdeps/powerpc/fpu/e_sqrtf.c: Likewise.
+	* sysdeps/powerpc/powerpc64/fpu/e_sqrt.c: Likewise.
+	* sysdeps/powerpc/powerpc64/fpu/e_sqrtf.c: Likewise.
+	* sysdeps/ieee754/dbl-64/halfulp.c: Likewise.
+
 2011-09-15  Andreas Schwab  <schwab@redhat.com>
 
 	* sysdeps/powerpc/fpu/e_hypot.c (__ieee754_hypot): Use
diff --git a/sysdeps/ieee754/dbl-64/halfulp.c b/sysdeps/ieee754/dbl-64/halfulp.c
index 478a4ba..42b21fb 100644
--- a/sysdeps/ieee754/dbl-64/halfulp.c
+++ b/sysdeps/ieee754/dbl-64/halfulp.c
@@ -1,7 +1,7 @@
 /*
  * IBM Accurate Mathematical Library
  * written by International Business Machines Corp.
- * Copyright (C) 2001, 2005 Free Software Foundation
+ * Copyright (C) 2001, 2005, 2011 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
@@ -40,13 +40,11 @@
 #include "dla.h"
 #include "math_private.h"
 
-double __ieee754_sqrt(double x);
-
 static const int4 tab54[32] = {
    262143, 11585, 1782, 511, 210, 107, 63, 42,
        30,    22,   17,  14,  12,  10,  9,  7,
-        7,     6,    5,   5,   5,   4,  4,  4,
-        3,     3,    3,   3,   3,   3,  3,  3 };
+	7,     6,    5,   5,   5,   4,  4,  4,
+	3,     3,    3,   3,   3,   3,  3,  3 };
 
 
 double __halfulp(double x, double y)
@@ -64,12 +62,12 @@ double __halfulp(double x, double y)
     z = (double) k;
     return (z*y == -1075.0)?0: -10.0;
   }
-                              /* if y > 0  */
+			      /* if y > 0  */
   v.x = y;
     if (v.i[LOW_HALF] != 0) return -10.0;
 
   v.x=x;
-                              /*  case where x = 2**n for some integer n */
+			      /*  case where x = 2**n for some integer n */
   if (((v.i[HIGH_HALF]&0x000fffff)|v.i[LOW_HALF]) == 0) {
     k=(v.i[HIGH_HALF]>>20)-1023;
     return (((double) k)*y == -1075.0)?0:-10.0;
@@ -90,7 +88,7 @@ double __halfulp(double x, double y)
   k = -k;
   if (k>5) return -10.0;
 
-                            /*   now treat x        */
+			    /*   now treat x        */
   while (k>0) {
     z = __ieee754_sqrt(x);
     EMULV(z,z,u,uu,j1,j2,j3,j4,j5);
@@ -111,11 +109,11 @@ double __halfulp(double x, double y)
   m = (k&0x000fffff)|0x00100000;
   m = m>>(20-l);                       /*   m is the odd integer of x    */
 
-            /*   now check whether the length of m**n is at most 54 bits */
+	    /*   now check whether the length of m**n is at most 54 bits */
 
   if  (m > tab54[n-3]) return -10.0;
 
-             /* yes, it is - now compute x**n by simple multiplications  */
+	     /* yes, it is - now compute x**n by simple multiplications  */
 
   u = x;
   for (k=1;k<n;k++) u = u*x;
diff --git a/sysdeps/powerpc/fpu/e_hypot.c b/sysdeps/powerpc/fpu/e_hypot.c
index afbcc18..a8d67d8 100644
--- a/sysdeps/powerpc/fpu/e_hypot.c
+++ b/sysdeps/powerpc/fpu/e_hypot.c
@@ -115,3 +115,4 @@ __ieee754_hypot (double x, double y)
     }
   return __ieee754_sqrt (x * x + y * y);
 }
+strong_alias (__ieee754_hypot, __hypot_finite)
diff --git a/sysdeps/powerpc/fpu/e_hypotf.c b/sysdeps/powerpc/fpu/e_hypotf.c
index 02ad773..915738c 100644
--- a/sysdeps/powerpc/fpu/e_hypotf.c
+++ b/sysdeps/powerpc/fpu/e_hypotf.c
@@ -116,3 +116,4 @@ __ieee754_hypotf (float x, float y)
     }
   return __ieee754_sqrtf (x * x + y * y);
 }
+strong_alias (__ieee754_hypotf, __hypotf_finite)
diff --git a/sysdeps/powerpc/fpu/e_sqrt.c b/sysdeps/powerpc/fpu/e_sqrt.c
index e95b786..f9ded25 100644
--- a/sysdeps/powerpc/fpu/e_sqrt.c
+++ b/sysdeps/powerpc/fpu/e_sqrt.c
@@ -1,5 +1,5 @@
 /* Double-precision floating point square root.
-   Copyright (C) 1997, 2002, 2003, 2004, 2008 Free Software Foundation, Inc.
+   Copyright (C) 1997, 2002-2004, 2008, 2011 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
@@ -46,21 +46,15 @@ extern const float __t_sqrt[1024];
    generated guesses (which mostly runs on the integer unit, while the
    Newton-Raphson is running on the FPU).  */
 
-#ifdef __STDC__
 double
 __slow_ieee754_sqrt (double x)
-#else
-double
-__slow_ieee754_sqrt (x)
-     double x;
-#endif
 {
   const float inf = a_inf.value;
 
   if (x > 0)
     {
       /* schedule the EXTRACT_WORDS to get separation between the store
-         and the load.  */
+	 and the load.  */
       ieee_double_shape_type ew_u;
       ieee_double_shape_type iw_u;
       ew_u.value = (x);
@@ -147,7 +141,7 @@ __slow_ieee754_sqrt (x)
   else if (x < 0)
     {
       /* For some reason, some PowerPC32 processors don't implement
-         FE_INVALID_SQRT.  */
+	 FE_INVALID_SQRT.  */
 #ifdef FE_INVALID_SQRT
       feraiseexcept (FE_INVALID_SQRT);
 
@@ -160,14 +154,8 @@ __slow_ieee754_sqrt (x)
   return f_wash (x);
 }
 
-#ifdef __STDC__
 double
 __ieee754_sqrt (double x)
-#else
-double
-__ieee754_sqrt (x)
-     double x;
-#endif
 {
   double z;
 
@@ -175,7 +163,7 @@ __ieee754_sqrt (x)
   if (__CPU_HAS_FSQRT)
     {
       /* Volatile is required to prevent the compiler from moving the
-         fsqrt instruction above the branch.  */
+	 fsqrt instruction above the branch.  */
       __asm __volatile ("	fsqrt	%0,%1\n"
 				:"=f" (z):"f" (x));
     }
@@ -184,3 +172,4 @@ __ieee754_sqrt (x)
 
   return z;
 }
+strong_alias (__ieee754_sqrt, __sqrt_finite)
diff --git a/sysdeps/powerpc/fpu/e_sqrtf.c b/sysdeps/powerpc/fpu/e_sqrtf.c
index ca44fac..965faee 100644
--- a/sysdeps/powerpc/fpu/e_sqrtf.c
+++ b/sysdeps/powerpc/fpu/e_sqrtf.c
@@ -1,5 +1,5 @@
 /* Single-precision floating point square root.
-   Copyright (C) 1997, 2003, 2004, 2008 Free Software Foundation, Inc.
+   Copyright (C) 1997, 2003, 2004, 2008, 2011 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
@@ -46,14 +46,8 @@ extern const float __t_sqrt[1024];
    generated guesses (which mostly runs on the integer unit, while the
    Newton-Raphson is running on the FPU).  */
 
-#ifdef __STDC__
 float
 __slow_ieee754_sqrtf (float x)
-#else
-float
-__slow_ieee754_sqrtf (x)
-     float x;
-#endif
 {
   const float inf = a_inf.value;
 
@@ -123,7 +117,7 @@ __slow_ieee754_sqrtf (x)
   else if (x < 0)
     {
       /* For some reason, some PowerPC32 processors don't implement
-         FE_INVALID_SQRT.  */
+	 FE_INVALID_SQRT.  */
 #ifdef FE_INVALID_SQRT
       feraiseexcept (FE_INVALID_SQRT);
 
@@ -137,14 +131,8 @@ __slow_ieee754_sqrtf (x)
 }
 
 
-#ifdef __STDC__
 float
 __ieee754_sqrtf (float x)
-#else
-float
-__ieee754_sqrtf (x)
-     float x;
-#endif
 {
   double z;
 
@@ -152,7 +140,7 @@ __ieee754_sqrtf (x)
   if (__CPU_HAS_FSQRT)
     {
       /* Volatile is required to prevent the compiler from moving the
-         fsqrt instruction above the branch.  */
+	 fsqrt instruction above the branch.  */
       __asm __volatile ("	fsqrts	%0,%1\n"
 				:"=f" (z):"f" (x));
     }
@@ -161,3 +149,4 @@ __ieee754_sqrtf (x)
 
   return z;
 }
+strong_alias (__ieee754_sqrtf, __sqrtf_finite)
diff --git a/sysdeps/powerpc/powerpc64/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc64/fpu/e_sqrt.c
index 0a229cb..314abba 100644
--- a/sysdeps/powerpc/powerpc64/fpu/e_sqrt.c
+++ b/sysdeps/powerpc/powerpc64/fpu/e_sqrt.c
@@ -1,5 +1,5 @@
 /* Double-precision floating point square root.
-   Copyright (C) 1997, 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1997, 2002-2004, 2006, 2011 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
@@ -27,3 +27,4 @@ __ieee754_sqrt (double x)
   __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
index 0f17a64..7157214 100644
--- a/sysdeps/powerpc/powerpc64/fpu/e_sqrtf.c
+++ b/sysdeps/powerpc/powerpc64/fpu/e_sqrtf.c
@@ -1,5 +1,5 @@
 /* Single-precision floating point square root.
-   Copyright (C) 1997, 2003, 2004, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1997, 2003, 2004, 2006, 2011 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
@@ -27,3 +27,4 @@ __ieee754_sqrtf (float x)
   __asm ("fsqrts %0,%1" : "=f" (z) : "f" (x));
   return z;
 }
+strong_alias (__ieee754_sqrtf, __sqrtf_finite)

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=e320d3f7977c04d8f7e62e0e3fa214f61f78a3f6

commit e320d3f7977c04d8f7e62e0e3fa214f61f78a3f6
Author: Andreas Schwab <schwab@redhat.com>
Date:   Thu Dec 29 18:35:19 2011 -0500

    Fix PLT uses in libm on powerpc
    
    Backport of commit #edc121be8b53da57950daf6f42a619b5826f30b6

diff --git a/ChangeLog b/ChangeLog
index 88cccd8..05aeb78 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2011-09-15  Andreas Schwab  <schwab@redhat.com>
+
+	* sysdeps/powerpc/fpu/e_hypot.c (__ieee754_hypot): Use
+	__ieee754_sqrt instead of sqrt.
+	* sysdeps/powerpc/fpu/e_hypotf.c (__ieee754_hypotf): Use
+	__ieee754_sqrtf instead of sqrtf.
+	* sysdeps/powerpc/fpu/e_rem_pio2f.c (__ieee754_rem_pio2f): Use
+	__floorf instead of floorf.
+	* sysdeps/powerpc/fpu/k_rem_pio2f.c (__fp_kernel_rem_pio2f): Use
+	__floorf, __truncf instead of floorf, truncf.
+
 2011-08-18  David Flaherty  <flaherty@linux.vnet.ibm.com>
 
 	* sysdeps/ieee754/ldbl-128ibm/s_fmal.c: New file which checks
diff --git a/sysdeps/powerpc/fpu/e_hypot.c b/sysdeps/powerpc/fpu/e_hypot.c
index f5300ef..afbcc18 100644
--- a/sysdeps/powerpc/fpu/e_hypot.c
+++ b/sysdeps/powerpc/fpu/e_hypot.c
@@ -96,22 +96,22 @@ __ieee754_hypot (double x, double y)
     {
       x *= twoM600;
       y *= twoM600;
-      return sqrt (x * x + y * y) / twoM600;
+      return __ieee754_sqrt (x * x + y * y) / twoM600;
     }
   if (y < twoM500)
     {
       if (y <= pdnum)
-       {
-         x *= two1022;
-         y *= two1022;
-         return sqrt (x * x + y * y) / two1022;
-       }
+	{
+	  x *= two1022;
+	  y *= two1022;
+	  return __ieee754_sqrt (x * x + y * y) / two1022;
+	}
       else
-       {
-         x *= two600;
-         y *= two600;
-         return sqrt (x * x + y * y) / two600;
-       }
+	{
+	  x *= two600;
+	  y *= two600;
+	  return __ieee754_sqrt (x * x + y * y) / two600;
+	}
     }
-  return sqrt (x * x + y * y);
+  return __ieee754_sqrt (x * x + y * y);
 }
diff --git a/sysdeps/powerpc/fpu/e_hypotf.c b/sysdeps/powerpc/fpu/e_hypotf.c
index 0476498..02ad773 100644
--- a/sysdeps/powerpc/fpu/e_hypotf.c
+++ b/sysdeps/powerpc/fpu/e_hypotf.c
@@ -97,22 +97,22 @@ __ieee754_hypotf (float x, float y)
     {
       x *= twoM60;
       y *= twoM60;
-      return sqrtf (x * x + y * y) / twoM60;
+      return __ieee754_sqrtf (x * x + y * y) / twoM60;
     }
   if (y < twoM50)
     {
       if (y <= pdnum)
-       {
-         x *= two126;
-         y *= two126;
-         return sqrtf (x * x + y * y) / two126;
-       }
+	{
+	  x *= two126;
+	  y *= two126;
+	  return __ieee754_sqrtf (x * x + y * y) / two126;
+	}
       else
-       {
-         x *= two60;
-         y *= two60;
-         return sqrtf (x * x + y * y) / two60;
-       }
+	{
+	  x *= two60;
+	  y *= two60;
+	  return __ieee754_sqrtf (x * x + y * y) / two60;
+	}
     }
-  return sqrtf (x * x + y * y);
+  return __ieee754_sqrtf (x * x + y * y);
 }
diff --git a/sysdeps/powerpc/fpu/e_rem_pio2f.c b/sysdeps/powerpc/fpu/e_rem_pio2f.c
index 24ac936..e4427e4 100644
--- a/sysdeps/powerpc/fpu/e_rem_pio2f.c
+++ b/sysdeps/powerpc/fpu/e_rem_pio2f.c
@@ -78,83 +78,83 @@ __ieee754_rem_pio2f (float x, float *y)
   if (ax < pio3_4)
     {
       if (x > 0)
-       {
-         z = x - pio2_1;
-         if (!__float_and_test28 (ax, pio2_24b))
-           {
-             y[0] = z - pio2_1t;
-             y[1] = (z - y[0]) - pio2_1t;
-           }
-         else
-           {
-             z -= pio2_2;
-             y[0] = z - pio2_2t;
-             y[1] = (z - y[0]) - pio2_2t;
-           }
-         return 1;
-       }
+	{
+	  z = x - pio2_1;
+	  if (!__float_and_test28 (ax, pio2_24b))
+	    {
+	      y[0] = z - pio2_1t;
+	      y[1] = (z - y[0]) - pio2_1t;
+	    }
+	  else
+	    {
+	      z -= pio2_2;
+	      y[0] = z - pio2_2t;
+	      y[1] = (z - y[0]) - pio2_2t;
+	    }
+	  return 1;
+	}
       else
-       {
-         z = x + pio2_1;
-         if (!__float_and_test28 (ax, pio2_24b))
-           {
-             y[0] = z + pio2_1t;
-             y[1] = (z - y[0]) + pio2_1t;
-           }
-         else
-           {
-             z += pio2_2;
-             y[0] = z + pio2_2t;
-             y[1] = (z - y[0]) + pio2_2t;
-           }
-         return -1;
-       }
+	{
+	  z = x + pio2_1;
+	  if (!__float_and_test28 (ax, pio2_24b))
+	    {
+	      y[0] = z + pio2_1t;
+	      y[1] = (z - y[0]) + pio2_1t;
+	    }
+	  else
+	    {
+	      z += pio2_2;
+	      y[0] = z + pio2_2t;
+	      y[1] = (z - y[0]) + pio2_2t;
+	    }
+	  return -1;
+	}
     }
   if (ax <= pio2_2e7)
     {
-      n = floorf (ax * invpio2 + half);
+      n = __floorf (ax * invpio2 + half);
       i = (int32_t) n;
       r = ax - n * pio2_1;
-      w = n * pio2_1t;         /* 1st round good to 40 bit */
+      w = n * pio2_1t;		/* 1st round good to 40 bit */
       if (i < 32 && !__float_and_test24 (ax, npio2_hw[i - 1]))
-       {
-         y[0] = r - w;
-       }
+	{
+	  y[0] = r - w;
+	}
       else
-       {
-         float i, j;
-         j = __float_and8 (ax);
-         y[0] = r - w;
-         i = __float_and8 (y[0]);
-         if (j / i > 256.0 || j / i < 3.9062500e-3)
-           {                   /* 2nd iterations needed, good to 57 */
-             t = r;
-             w = n * pio2_2;
-             r = t - w;
-             w = n * pio2_2t - ((t - r) - w);
-             y[0] = r - w;
-             i = __float_and8 (y[0]);
-             if (j / i > 33554432 || j / i < 2.9802322e-8)
-               {               /* 3rd iteration needed, 74 bits acc */
-                 t = r;
-                 w = n * pio2_3;
-                 r = t - w;
-                 w = n * pio2_3t - ((t - r) - w);
-                 y[0] = r - w;
-               }
-           }
-       }
+	{
+	  float i, j;
+	  j = __float_and8 (ax);
+	  y[0] = r - w;
+	  i = __float_and8 (y[0]);
+	  if (j / i > 256.0 || j / i < 3.9062500e-3)
+	    {			/* 2nd iterations needed, good to 57 */
+	      t = r;
+	      w = n * pio2_2;
+	      r = t - w;
+	      w = n * pio2_2t - ((t - r) - w);
+	      y[0] = r - w;
+	      i = __float_and8 (y[0]);
+	      if (j / i > 33554432 || j / i < 2.9802322e-8)
+		{		/* 3rd iteration needed, 74 bits acc */
+		  t = r;
+		  w = n * pio2_3;
+		  r = t - w;
+		  w = n * pio2_3t - ((t - r) - w);
+		  y[0] = r - w;
+		}
+	    }
+	}
       y[1] = (r - y[0]) - w;
       if (x < 0)
-       {
-         y[0] = -y[0];
-         y[1] = -y[1];
-         return -i;
-       }
+	{
+	  y[0] = -y[0];
+	  y[1] = -y[1];
+	  return -i;
+	}
       else
-       {
-         return i;
-       }
+	{
+	  return i;
+	}
     }
 
   /* all other (large) arguments */
@@ -168,11 +168,11 @@ __ieee754_rem_pio2f (float x, float *y)
   e0 = __float_and8 (ax / 128.0);
   z = ax / e0;
 
-  tx[0] = floorf (z);
+  tx[0] = __floorf (z);
   z = (z - tx[0]) * two8;
-  tx[1] = floorf (z);
+  tx[1] = __floorf (z);
   z = (z - tx[1]) * two8;
-  tx[2] = floorf (z);
+  tx[2] = __floorf (z);
 
   nx = 3;
   while (tx[nx - 1] == zero)
diff --git a/sysdeps/powerpc/fpu/k_rem_pio2f.c b/sysdeps/powerpc/fpu/k_rem_pio2f.c
index a94ca13..7090605 100644
--- a/sysdeps/powerpc/fpu/k_rem_pio2f.c
+++ b/sysdeps/powerpc/fpu/k_rem_pio2f.c
@@ -79,17 +79,17 @@ static const float two_over_pi[] = {
 
 
 static const float PIo2[] = {
-  1.5703125000e+00,            /* 0x3fc90000 */
-  4.5776367188e-04,            /* 0x39f00000 */
-  2.5987625122e-05,            /* 0x37da0000 */
-  7.5437128544e-08,            /* 0x33a20000 */
-  6.0026650317e-11,            /* 0x2e840000 */
-  7.3896444519e-13,            /* 0x2b500000 */
-  5.3845816694e-15,            /* 0x27c20000 */
-  5.6378512969e-18,            /* 0x22d00000 */
-  8.3009228831e-20,            /* 0x1fc40000 */
-  3.2756352257e-22,            /* 0x1bc60000 */
-  6.3331015649e-25,            /* 0x17440000 */
+  1.5703125000e+00,		/* 0x3fc90000 */
+  4.5776367188e-04,		/* 0x39f00000 */
+  2.5987625122e-05,		/* 0x37da0000 */
+  7.5437128544e-08,		/* 0x33a20000 */
+  6.0026650317e-11,		/* 0x2e840000 */
+  7.3896444519e-13,		/* 0x2b500000 */
+  5.3845816694e-15,		/* 0x27c20000 */
+  5.6378512969e-18,		/* 0x22d00000 */
+  8.3009228831e-20,		/* 0x1fc40000 */
+  3.2756352257e-22,		/* 0x1bc60000 */
+  6.3331015649e-25,		/* 0x17440000 */
 };
 
 
@@ -126,7 +126,7 @@ __fp_kernel_rem_pio2f (float *x, float *y, float e0, int32_t nx)
   for (i = 0; i <= jk; i++)
     {
       for (j = 0, fw = 0.0; j <= jx; j++)
-       fw += x[j] * f[jx + i - j];
+	fw += x[j] * f[jx + i - j];
       q[i] = fw;
     }
 
@@ -135,19 +135,19 @@ recompute:
   /* distill q[] into iq[] reversingly */
   for (i = 0, j = jz, z = q[jz]; j > 0; i++, j--)
     {
-      fw = truncf (twon8 * z);
+      fw = __truncf (twon8 * z);
       iq[i] = (int32_t) (z - two8 * fw);
       z = q[j - 1] + fw;
     }
 
   /* compute n */
-  z = __scalbnf (z, q0);       /* actual value of z */
-  z -= 8.0 * floorf (z * 0.125);       /* trim off integer >= 8 */
+  z = __scalbnf (z, q0);	/* actual value of z */
+  z -= 8.0 * __floorf (z * 0.125);	/* trim off integer >= 8 */
   n = (int32_t) z;
-  z -= truncf (z);
+  z -= __truncf (z);
   ih = 0;
   if (q0 > 0)
-    {                          /* need iq[jz-1] to determine n */
+    {				/* need iq[jz-1] to determine n */
       i = (iq[jz - 1] >> (8 - q0));
       n += i;
       iq[jz - 1] -= i << (8 - q0);
@@ -159,41 +159,41 @@ recompute:
     ih = 2;
 
   if (ih > 0)
-    {                          /* q > 0.5 */
+    {				/* q > 0.5 */
       n += 1;
       carry = 0;
       for (i = 0; i < jz; i++)
-       {                       /* compute 1-q */
-         j = iq[i];
-         if (carry == 0)
-           {
-             if (j != 0)
-               {
-                 carry = 1;
-                 iq[i] = 0x100 - j;
-               }
-           }
-         else
-           iq[i] = 0xff - j;
-       }
+	{			/* compute 1-q */
+	  j = iq[i];
+	  if (carry == 0)
+	    {
+	      if (j != 0)
+		{
+		  carry = 1;
+		  iq[i] = 0x100 - j;
+		}
+	    }
+	  else
+	    iq[i] = 0xff - j;
+	}
       if (q0 > 0)
-       {                       /* rare case: chance is 1 in 12 */
-         switch (q0)
-           {
-           case 1:
-             iq[jz - 1] &= 0x7f;
-             break;
-           case 2:
-             iq[jz - 1] &= 0x3f;
-             break;
-           }
-       }
+	{			/* rare case: chance is 1 in 12 */
+	  switch (q0)
+	    {
+	    case 1:
+	      iq[jz - 1] &= 0x7f;
+	      break;
+	    case 2:
+	      iq[jz - 1] &= 0x3f;
+	      break;
+	    }
+	}
       if (ih == 2)
-       {
-         z = one - z;
-         if (carry != 0)
-           z -= __scalbnf (one, q0);
-       }
+	{
+	  z = one - z;
+	  if (carry != 0)
+	    z -= __scalbnf (one, q0);
+	}
     }
 
   /* check if recomputation is needed */
@@ -201,21 +201,21 @@ recompute:
     {
       j = 0;
       for (i = jz - 1; i >= jk; i--)
-       j |= iq[i];
+	j |= iq[i];
       if (j == 0)
-       {                       /* need recomputation */
-         for (k = 1; iq[jk - k] == 0; k++);    /* k = no. of terms needed */
+	{			/* need recomputation */
+	  for (k = 1; iq[jk - k] == 0; k++);	/* k = no. of terms needed */
 
-         for (i = jz + 1; i <= jz + k; i++)
-           {                   /* add q[jz+1] to q[jz+k] */
-             f[jx + i] = two_over_pi[jv + i];
-             for (j = 0, fw = 0.0; j <= jx; j++)
-               fw += x[j] * f[jx + i - j];
-             q[i] = fw;
-           }
-         jz += k;
-         goto recompute;
-       }
+	  for (i = jz + 1; i <= jz + k; i++)
+	    {			/* add q[jz+1] to q[jz+k] */
+	      f[jx + i] = two_over_pi[jv + i];
+	      for (j = 0, fw = 0.0; j <= jx; j++)
+		fw += x[j] * f[jx + i - j];
+	      q[i] = fw;
+	    }
+	  jz += k;
+	  goto recompute;
+	}
     }
 
   /* chop off zero terms */
@@ -224,24 +224,24 @@ recompute:
       jz -= 1;
       q0 -= 8;
       while (iq[jz] == 0)
-       {
-         jz--;
-         q0 -= 8;
-       }
+	{
+	  jz--;
+	  q0 -= 8;
+	}
     }
   else
-    {                          /* break z into 8-bit if necessary */
+    {				/* break z into 8-bit if necessary */
       z = __scalbnf (z, -q0);
       if (z >= two8)
-       {
-         fw = truncf (twon8 * z);
-         iq[jz] = (int32_t) (z - two8 * fw);
-         jz += 1;
-         q0 += 8;
-         iq[jz] = (int32_t) fw;
-       }
+	{
+	  fw = __truncf (twon8 * z);
+	  iq[jz] = (int32_t) (z - two8 * fw);
+	  jz += 1;
+	  q0 += 8;
+	  iq[jz] = (int32_t) fw;
+	}
       else
-       iq[jz] = (int32_t) z;
+	iq[jz] = (int32_t) z;
     }
 
   /* convert integer "bit" chunk to floating-point value */
@@ -256,7 +256,7 @@ recompute:
   for (i = jz; i >= 0; i--)
     {
       for (fw = 0.0, k = 0; k <= jp && k <= jz - i; k++)
-       fw += PIo2[k] * q[i + k];
+	fw += PIo2[k] * q[i + k];
       fq[jz - i] = fw;
     }
 

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

Summary of changes:
 ChangeLog                                       |   74 +++++++++++
 math/libm-test.inc                              |    4 +
 nptl/Versions                                   |    2 +-
 nptl/nptl-init.c                                |   12 ++-
 nptl/pthreadP.h                                 |    1 +
 nptl/sysdeps/unix/sysv/linux/aio_misc.h         |    4 +-
 nptl/sysdeps/unix/sysv/linux/timer_routines.c   |    2 +-
 sysdeps/ieee754/dbl-64/halfulp.c                |   18 ++--
 sysdeps/ieee754/ldbl-128ibm/s_atanl.c           |    2 +-
 sysdeps/powerpc/Makefile                        |    2 +
 sysdeps/powerpc/fpu/e_hypot.c                   |   27 ++--
 sysdeps/powerpc/fpu/e_hypotf.c                  |   25 ++--
 sysdeps/powerpc/fpu/e_rem_pio2f.c               |  138 +++++++++++-----------
 sysdeps/powerpc/fpu/e_sqrt.c                    |   22 +---
 sysdeps/powerpc/fpu/e_sqrtf.c                   |   21 +---
 sysdeps/powerpc/fpu/k_rem_pio2f.c               |  148 +++++++++++-----------
 sysdeps/powerpc/fpu/math_private.h              |  137 ++++++++++++++++++++-
 sysdeps/powerpc/locale-defines.sym              |    5 +
 sysdeps/powerpc/powerpc32/fpu/s_nearbyint.S     |   80 ++++++++++++
 sysdeps/powerpc/powerpc32/fpu/s_nearbyintf.S    |   70 +++++++++++
 sysdeps/powerpc/powerpc32/power7/Makefile       |    4 +
 sysdeps/powerpc/powerpc32/power7/strcasecmp.S   |  132 ++++++++++++++++++++
 sysdeps/powerpc/powerpc32/power7/strcasecmp_l.S |    5 +
 sysdeps/powerpc/powerpc64/fpu/e_sqrt.c          |    4 +-
 sysdeps/powerpc/powerpc64/fpu/e_sqrtf.c         |    4 +-
 sysdeps/powerpc/powerpc64/fpu/s_nearbyint.S     |   68 +++++++++++
 sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S    |   59 +++++++++
 sysdeps/powerpc/powerpc64/power7/Makefile       |    5 +
 sysdeps/powerpc/powerpc64/power7/strcasecmp.S   |  125 +++++++++++++++++++
 sysdeps/powerpc/powerpc64/power7/strcasecmp_l.S |    5 +
 30 files changed, 984 insertions(+), 221 deletions(-)
 create mode 100644 sysdeps/powerpc/locale-defines.sym
 create mode 100644 sysdeps/powerpc/powerpc32/fpu/s_nearbyint.S
 create mode 100644 sysdeps/powerpc/powerpc32/fpu/s_nearbyintf.S
 create mode 100644 sysdeps/powerpc/powerpc32/power7/Makefile
 create mode 100644 sysdeps/powerpc/powerpc32/power7/strcasecmp.S
 create mode 100644 sysdeps/powerpc/powerpc32/power7/strcasecmp_l.S
 create mode 100644 sysdeps/powerpc/powerpc64/fpu/s_nearbyint.S
 create mode 100644 sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S
 create mode 100644 sysdeps/powerpc/powerpc64/power7/strcasecmp.S
 create mode 100644 sysdeps/powerpc/powerpc64/power7/strcasecmp_l.S


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]