summary refs log tree commit diff
path: root/sysdeps/powerpc/powerpc32/fpu
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-12-22 20:10:10 +0000
committerUlrich Drepper <drepper@redhat.com>2004-12-22 20:10:10 +0000
commita334319f6530564d22e775935d9c91663623a1b4 (patch)
treeb5877475619e4c938e98757d518bb1e9cbead751 /sysdeps/powerpc/powerpc32/fpu
parent0ecb606cb6cf65de1d9fc8a919bceb4be476c602 (diff)
downloadglibc-a334319f6530564d22e775935d9c91663623a1b4.tar.gz
glibc-a334319f6530564d22e775935d9c91663623a1b4.tar.xz
glibc-a334319f6530564d22e775935d9c91663623a1b4.zip
(CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
Diffstat (limited to 'sysdeps/powerpc/powerpc32/fpu')
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/Dist2
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S29
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/fprrest.S7
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/fprsave.S25
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_ceil.S65
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_ceilf.S61
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_copysign.S22
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_copysignl.S50
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_fabs.S5
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_fabsl.S36
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_fdim.c5
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_floor.S45
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_floorf.S41
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_fmax.S5
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_fmin.S5
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_isnan.c7
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_llrint.c8
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_lrint.S14
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_lround.S59
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_rint.S49
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_rintf.S46
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_round.S73
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_roundf.S69
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_trunc.S64
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_truncf.S60
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/setjmp-common.S50
26 files changed, 396 insertions, 506 deletions
diff --git a/sysdeps/powerpc/powerpc32/fpu/Dist b/sysdeps/powerpc/powerpc32/fpu/Dist
new file mode 100644
index 0000000000..375e57172e
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/Dist
@@ -0,0 +1,2 @@
+fprrest.S
+fprsave.S
diff --git a/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S b/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S
index 404f403855..a2415b9542 100644
--- a/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S
+++ b/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S
@@ -1,5 +1,5 @@
 /* longjmp for PowerPC.
-   Copyright (C) 1995-99, 2000, 2003-2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1995-99, 2000, 2003, 2004 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
@@ -14,15 +14,16 @@
 
    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.  */
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #include <sysdep.h>
 #define _ASM
+#define _SETJMP_H
 #ifdef __NO_VMX__
 # include <novmxsetjmp.h>
 #else
-# include <jmpbuf-offsets.h>
+# include <bits/setjmp.h>
 #endif
 #include <bp-sym.h>
 #include <bp-asm.h>
@@ -33,25 +34,15 @@ ENTRY (BP_SYM (__longjmp))
 #ifndef __NO_VMX__
 # ifdef PIC
 	mflr    r6
-	cfi_register (lr,r6)
-#  ifdef HAVE_ASM_PPC_REL16
-	bcl	20,31,1f
-1:	mflr	r5
-	addis	r5,r5,_GLOBAL_OFFSET_TABLE_-1b@ha
-	addi	r5,r5,_GLOBAL_OFFSET_TABLE_-1b@l
-#  else
 	bl      _GLOBAL_OFFSET_TABLE_@local-4
 	mflr    r5
-#  endif
 #  ifdef SHARED
 	lwz     r5,_rtld_global_ro@got(r5)
 	mtlr    r6
-	cfi_same_value (lr)
 	lwz     r5,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET(r5)
 #  else
-	lwz     r5,_dl_hwcap@got(r5)
+	lwz     r5,_rtld_global_ro@got(r5)
 	mtlr    r6
-	cfi_same_value (lr)
 	lwz     r5,0(r5)
 #  endif
 # else
@@ -114,11 +105,7 @@ aligned_restore_vmx:
 	lvx	v31,0,r6
 L(no_vmx):
 #endif
-#ifdef PTR_DEMANGLE
-	lwz r24,(JB_GPR1*4)(r3)
-#else
 	lwz r1,(JB_GPR1*4)(r3)
-#endif
 	lwz r0,(JB_LR*4)(r3)
 	lwz r14,((JB_GPRS+0)*4)(r3)
 	lfd fp14,((JB_FPRS+0*2)*4)(r3)
@@ -134,10 +121,6 @@ L(no_vmx):
 	lfd fp19,((JB_FPRS+5*2)*4)(r3)
 	lwz r20,((JB_GPRS+6)*4)(r3)
 	lfd fp20,((JB_FPRS+6*2)*4)(r3)
-#ifdef PTR_DEMANGLE
-	PTR_DEMANGLE3 (r1, r24, r25)
-	PTR_DEMANGLE2 (r0, r25)
-#endif
 	mtlr r0
 	lwz r21,((JB_GPRS+7)*4)(r3)
 	lfd fp21,((JB_FPRS+7*2)*4)(r3)
diff --git a/sysdeps/powerpc/powerpc32/fpu/fprrest.S b/sysdeps/powerpc/powerpc32/fpu/fprrest.S
index 2f6c6deb2e..42317809eb 100644
--- a/sysdeps/powerpc/powerpc32/fpu/fprrest.S
+++ b/sysdeps/powerpc/powerpc32/fpu/fprrest.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2001, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001 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
@@ -13,8 +13,8 @@
 
    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., 51 Franklin Street, Fifth Floor, Boston MA
-   02110-1301 USA.  */
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 /*
     Floating Point Registers (FPRs) restore routine
@@ -92,4 +92,3 @@ C_TEXT(_restfpr_29):	lwz	r0,8(r1)	#get return address from frame
 			lfd	fp30,-16(r1)	#restore f30
 			lfd	fp31,-8(r1)	#restore f31
 			blr			#return
-END (_restfpr_all)
diff --git a/sysdeps/powerpc/powerpc32/fpu/fprsave.S b/sysdeps/powerpc/powerpc32/fpu/fprsave.S
index c05178775d..d7bc1ab7dc 100644
--- a/sysdeps/powerpc/powerpc32/fpu/fprsave.S
+++ b/sysdeps/powerpc/powerpc32/fpu/fprsave.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2001, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001 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
@@ -13,8 +13,8 @@
 
    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., 51 Franklin Street, Fifth Floor, Boston MA
-   02110-1301 USA.  */
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 /*
     Floating Point Registers (FPRs) save routine
@@ -27,86 +27,67 @@ ENTRY(_savefpr_all)
 		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_14)
 C_TEXT(_savef14):
 C_TEXT(_savefpr_14):	stfd	fp14,-144(r1)
-			cfi_offset(fp14,-144)
 		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef15)
 		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_15)
 C_TEXT(_savef15):
 C_TEXT(_savefpr_15):	stfd	fp15,-136(r1)
-			cfi_offset(fp15,-136)
 		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef16)
 		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_16)
 C_TEXT(_savef16):
 C_TEXT(_savefpr_16):	stfd	fp16,-128(r1)
-			cfi_offset(fp16,-128)
 		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef17)
 		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_17)
 C_TEXT(_savef17):
 C_TEXT(_savefpr_17):	stfd	fp17,-120(r1)
-			cfi_offset(fp17,-120)
 		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef18)
 		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_18)
 C_TEXT(_savef18):
 C_TEXT(_savefpr_18):	stfd	fp18,-112(r1)
-			cfi_offset(fp18,-112)
 		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef19)
 		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_19)
 C_TEXT(_savef19):
 C_TEXT(_savefpr_19):	stfd	fp19,-104(r1)
-			cfi_offset(fp19,-104)
 		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef20)
 		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_20)
 C_TEXT(_savef20):
 C_TEXT(_savefpr_20):	stfd	fp20,-96(r1)
-			cfi_offset(fp20,-96)
 		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef21)
 		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_21)
 C_TEXT(_savef21):
 C_TEXT(_savefpr_21):	stfd	fp21,-88(r1)
-			cfi_offset(fp21,-88)
 		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef22)
 		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_22)
 C_TEXT(_savef22):
 C_TEXT(_savefpr_22):	stfd	fp22,-80(r1)
-			cfi_offset(fp22,-80)
 		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef23)
 		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_23)
 C_TEXT(_savef23):
 C_TEXT(_savefpr_23):	stfd	fp23,-72(r1)
-			cfi_offset(fp23,-72)
 		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef24)
 		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_24)
 C_TEXT(_savef24):
 C_TEXT(_savefpr_24):	stfd	fp24,-64(r1)
-			cfi_offset(fp24,-64)
 		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef25)
 		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_25)
 C_TEXT(_savef25):
 C_TEXT(_savefpr_25):	stfd	fp25,-56(r1)
-			cfi_offset(fp25,-56)
 		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef26)
 		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_26)
 C_TEXT(_savef26):
 C_TEXT(_savefpr_26):	stfd	fp26,-48(r1)
-			cfi_offset(fp26,-48)
 		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef27)
 		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_27)
 C_TEXT(_savef27):
 C_TEXT(_savefpr_27):	stfd	fp27,-40(r1)
-			cfi_offset(fp27,-40)
 		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef28)
 		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_28)
 C_TEXT(_savef28):
 C_TEXT(_savefpr_28):	stfd	fp28,-32(r1)
-			cfi_offset(fp28,-32)
 		ASM_GLOBAL_DIRECTIVE C_TEXT(_savef29)
 		ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_29)
 C_TEXT(_savef29):
 C_TEXT(_savefpr_29):	stfd	fp29,-24(r1)	#save f29
 			stfd	fp30,-16(r1)	#save f30
 			stfd	fp31,-8(r1)	#save f31
-			cfi_offset(fp29,-24)
-			cfi_offset(fp30,-16)
-			cfi_offset(fp31,-8)
 			stw	r0,8(r1)	#save LR in callers frame
 			blr			#return
-END (_savefpr_all)
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_ceil.S b/sysdeps/powerpc/powerpc32/fpu/s_ceil.S
index bc74d302fb..d211314bbf 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_ceil.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_ceil.S
@@ -1,5 +1,5 @@
 /* ceil function.  PowerPC32 version.
-   Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2004 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
@@ -14,39 +14,46 @@
 
    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.  */
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #include <sysdep.h>
-#include <math_ldbl_opt.h>
 
-	.section	.rodata.cst4,"aM",@progbits,4
-	.align	2
+	.section	.rodata
+	.align 3
+	.type	TWO52.0,@object
+	.size	TWO52.0,8
+TWO52.0:
+	.long 0x43300000
+	.long 0
+	.type	NEGZERO.0,@object
+	.size	NEGZERO.0,8
+NEGZERO.0:
+	.long 0x80000000
+	.long 0
+
+	.section	.rodata.cst8,"aM",@progbits,8
+	.align 3
 .LC0:	/* 2**52 */
-	.long 0x59800000
+	.long 0x43300000
+	.long 0
+.LC1:	/* -0.0 */
+	.long 0x80000000
+	.long 0
 
 	.section	".text"
 ENTRY (__ceil)
 	mffs	fp11		/* Save current FPU rounding mode.  */
 #ifdef SHARED
 	mflr	r11
-	cfi_register(lr,r11)
-# ifdef HAVE_ASM_PPC_REL16
-	bcl	20,31,1f
-1:	mflr	r9
-	addis	r9,r9,.LC0-1b@ha
-	lfs	fp13,.LC0-1b@l(r9)
-# else
 	bl	_GLOBAL_OFFSET_TABLE_@local-4
 	mflr	r10
 	lwz	r9,.LC0@got(10)
-	lfs	fp13,0(r9)
-# endif
 	mtlr	r11
-	cfi_same_value (lr)
+	lfd	fp13,0(r9)
 #else
 	lis	r9,.LC0@ha
-	lfs	fp13,.LC0@l(r9)
+	lfd	fp13,.LC0@l(r9)
 #endif
 	fabs	fp0,fp1
 	fsub	fp12,fp13,fp13	/* generate 0.0  */
@@ -57,18 +64,27 @@ ENTRY (__ceil)
 	ble-	cr6,.L4
 	fadd	fp1,fp1,fp13	/* x+= TWO52;  */
 	fsub	fp1,fp1,fp13	/* x-= TWO52;  */
-	fabs	fp1,fp1		/* if (x == 0.0)  */
-				/* x = 0.0; */
+.L9:	
 	mtfsf	0x01,fp11	/* restore previous rounding mode.  */
 	blr
 .L4:
 	bge-	cr6,.L9		/* if (x < 0.0)  */
 	fsub	fp1,fp1,fp13	/* x-= TWO52;  */
 	fadd	fp1,fp1,fp13	/* x+= TWO52;  */
-	fnabs	fp1,fp1		/* if (x == 0.0)  */
-				/* x = -0.0; */
-.L9:
+	fcmpu	cr5,fp1,fp12	/* if (x > 0.0)  */
 	mtfsf	0x01,fp11	/* restore previous rounding mode.  */
+	bnelr+	cr5
+#ifdef SHARED
+	mflr	r11
+	bl	_GLOBAL_OFFSET_TABLE_@local-4
+	mflr	r10
+	lwz	r9,.LC1@got(10)
+	mtlr	r11
+	lfd	fp1,0(r9)
+#else
+	lis	r9,.LC1@ha
+	lfd	fp1,.LC1@l(r9)
+#endif
 	blr
 	END (__ceil)
 
@@ -78,6 +94,3 @@ weak_alias (__ceil, ceil)
 weak_alias (__ceil, ceill)
 strong_alias (__ceil, __ceill)
 #endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __ceil, ceill, GLIBC_2_0)
-#endif
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_ceilf.S b/sysdeps/powerpc/powerpc32/fpu/s_ceilf.S
index 47a75ec0c3..4439dc2338 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_ceilf.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_ceilf.S
@@ -1,5 +1,5 @@
 /* float ceil function.  PowerPC32 version.
-   Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2004 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
@@ -14,38 +14,46 @@
 
    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.  */
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #include <sysdep.h>
 
-	.section	.rodata.cst4,"aM",@progbits,4
-	.align	2
+	.section	.rodata
+	.align 3
+	.type	TWO52.0,@object
+	.size	TWO52.0,8
+TWO52.0:
+	.long 0x43300000
+	.long 0
+	.type	NEGZERO.0,@object
+	.size	NEGZERO.0,8
+NEGZERO.0:
+	.long 0x80000000
+	.long 0
+
+	.section	.rodata.cst8,"aM",@progbits,8
+	.align 3
 .LC0:	/* 2**23 */
-	.long 0x4b000000
+	.long 0x41600000
+	.long 0
+.LC1:	/* -0.0 */
+	.long 0x80000000
+	.long 0
 
 	.section	".text"
 ENTRY (__ceilf)
 	mffs	fp11		/* Save current FPU rounding mode.  */
 #ifdef SHARED
 	mflr	r11
-	cfi_register(lr,r11)
-# ifdef HAVE_ASM_PPC_REL16
-	bcl	20,31,1f
-1:	mflr	r9
-	addis	r9,r9,.LC0-1b@ha
-	lfs	fp13,.LC0-1b@l(r9)
-# else
 	bl	_GLOBAL_OFFSET_TABLE_@local-4
 	mflr	r10
 	lwz	r9,.LC0@got(10)
-	lfs	fp13,0(r9)
-# endif
 	mtlr	r11
-	cfi_same_value (lr)
+	lfd	fp13,0(r9)
 #else
 	lis	r9,.LC0@ha
-	lfs	fp13,.LC0@l(r9)
+	lfd	fp13,.LC0@l(r9)
 #endif
 	fabs	fp0,fp1
 	fsubs	fp12,fp13,fp13	/* generate 0.0  */
@@ -56,18 +64,27 @@ ENTRY (__ceilf)
 	ble-	cr6,.L4
 	fadds	fp1,fp1,fp13	/* x+= TWO23;  */
 	fsubs	fp1,fp1,fp13	/* x-= TWO23;  */
-	fabs	fp1,fp1		/* if (x == 0.0)  */
-				/* x = 0.0; */
+.L9:	
 	mtfsf	0x01,fp11	/* restore previous rounding mode.  */
 	blr
 .L4:
 	bge-	cr6,.L9		/* if (x < 0.0)  */
 	fsubs	fp1,fp1,fp13	/* x-= TWO23;  */
 	fadds	fp1,fp1,fp13	/* x+= TWO23;  */
-	fnabs	fp1,fp1		/* if (x == 0.0)  */
-				/* x = -0.0; */
-.L9:
+	fcmpu	cr5,fp1,fp12	/* if (x > 0.0)  */
 	mtfsf	0x01,fp11	/* restore previous rounding mode.  */
+	bnelr+	cr5
+#ifdef SHARED
+	mflr	r11
+	bl	_GLOBAL_OFFSET_TABLE_@local-4
+	mflr	r10
+	lwz	r9,.LC1@got(10)
+	mtlr	r11
+	lfd	fp1,0(r9)
+#else
+	lis	r9,.LC1@ha
+	lfd	fp1,.LC1@l(r9)
+#endif
 	blr
 	END (__ceilf)
 
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_copysign.S b/sysdeps/powerpc/powerpc32/fpu/s_copysign.S
index dd68b0869c..933435da3d 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_copysign.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_copysign.S
@@ -1,5 +1,5 @@
 /* Copy a sign bit between floating-point values.
-   Copyright (C) 1997, 1999, 2000, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1999, 2000 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
@@ -14,26 +14,23 @@
 
    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.  */
+   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>
 
 ENTRY(__copysign)
 /* double [f1] copysign (double [f1] x, double [f2] y);
    copysign(x,y) returns a value with the magnitude of x and
    with the sign bit of y.  */
 	stwu	r1,-16(r1)
-	cfi_adjust_cfa_offset (16)
 	stfd	fp2,8(r1)
 	lwz	r3,8(r1)
 	cmpwi   r3,0
 	addi    r1,r1,16
-	cfi_adjust_cfa_offset (-16)
 	blt     L(0)
 	fabs    fp1,fp1
 	blr
@@ -41,20 +38,13 @@ L(0):	fnabs   fp1,fp1
 	blr
 	END (__copysign)
 
-weak_alias (__copysign,copysign)
+weak_alias(__copysign,copysign)
 
 /* It turns out that it's safe to use this code even for single-precision.  */
-weak_alias (__copysign,copysignf)
+weak_alias(__copysign,copysignf)
 strong_alias(__copysign,__copysignf)
 
 #ifdef NO_LONG_DOUBLE
-weak_alias (__copysign,copysignl)
+weak_alias(__copysign,copysignl)
 strong_alias(__copysign,__copysignl)
 #endif
-#ifdef IS_IN_libm
-# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __copysign, copysignl, GLIBC_2_0)
-# endif
-#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
-compat_symbol (libc, __copysign, copysignl, GLIBC_2_0)
-#endif
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_copysignl.S b/sysdeps/powerpc/powerpc32/fpu/s_copysignl.S
deleted file mode 100644
index 64b6a45437..0000000000
--- a/sysdeps/powerpc/powerpc32/fpu/s_copysignl.S
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Copy a sign bit between floating-point values.
-   IBM extended format long double version.
-   Copyright (C) 2006 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 <math_ldbl_opt.h>
-
-ENTRY(__copysignl)
-/* long double [f1,f2] copysign (long double [f1,f2] x, long double [f3,f4] y);
-   copysign(x,y) returns a value with the magnitude of x and
-   with the sign bit of y.  */
-	stwu	r1,-16(r1)
-	cfi_adjust_cfa_offset (16)
-	stfd	fp3,8(r1)
-	fmr	fp0,fp1
-	fabs	fp1,fp1
-	fcmpu	cr7,fp0,fp1
-	lwz	r3,8(r1)
-	cmpwi	cr6,r3,0
-	addi	r1,r1,16
-	cfi_adjust_cfa_offset (-16)
-	beq	cr7,L(0)
-	fneg	fp2,fp2
-L(0):	bgelr	cr6
-	fneg	fp1,fp1
-	fneg	fp2,fp2
-	blr
-END (__copysignl)
-
-#ifdef IS_IN_libm
-long_double_symbol (libm, __copysignl, copysignl)
-#else
-long_double_symbol (libc, __copysignl, copysignl)
-#endif
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_fabs.S b/sysdeps/powerpc/powerpc32/fpu/s_fabs.S
deleted file mode 100644
index 53d21301ee..0000000000
--- a/sysdeps/powerpc/powerpc32/fpu/s_fabs.S
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/powerpc/fpu/s_fabs.S>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __fabs, fabsl, GLIBC_2_0)
-#endif
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_fabsl.S b/sysdeps/powerpc/powerpc32/fpu/s_fabsl.S
deleted file mode 100644
index 3655e5b2f3..0000000000
--- a/sysdeps/powerpc/powerpc32/fpu/s_fabsl.S
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Copy a sign bit between floating-point values.
-   IBM extended format long double version.
-   Copyright (C) 2004, 2006 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 <math_ldbl_opt.h>
-
-ENTRY(__fabsl)
-/* long double [f1,f2] fabs (long double [f1,f2] x);
-   fabs(x,y) returns a value with the magnitude of x and
-   with the sign bit of y.  */
-	fmr	fp0,fp1
-	fabs	fp1,fp1
-	fcmpu	cr1,fp0,fp1
-	beqlr	cr1
-	fneg	fp2,fp2
-	blr
-END (__fabsl)
-
-long_double_symbol (libm, __fabsl, fabsl)
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_fdim.c b/sysdeps/powerpc/powerpc32/fpu/s_fdim.c
deleted file mode 100644
index e34b51ee54..0000000000
--- a/sysdeps/powerpc/powerpc32/fpu/s_fdim.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/powerpc/fpu/s_fdim.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __fdim, fdiml, GLIBC_2_1);
-#endif
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_floor.S b/sysdeps/powerpc/powerpc32/fpu/s_floor.S
index a29e4791ea..143f907b18 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_floor.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_floor.S
@@ -1,5 +1,5 @@
 /* Floor function.  PowerPC32 version.
-   Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2004 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
@@ -14,39 +14,38 @@
 
    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.  */
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #include <sysdep.h>
-#include <math_ldbl_opt.h>
 
-	.section	.rodata.cst4,"aM",@progbits,4
-	.align	2
+	.section	.rodata
+	.align 3
+	.type	TWO52.0,@object
+	.size	TWO52.0,8
+TWO52.0:
+	.long 0x43300000
+	.long 0
+
+	.section	.rodata.cst8,"aM",@progbits,8
+	.align 3
 .LC0:	/* 2**52 */
-	.long 0x59800000
+	.long 0x43300000
+	.long 0
 
 	.section	".text"
 ENTRY (__floor)
 	mffs	fp11		/* Save current FPU rounding mode.  */
 #ifdef SHARED
 	mflr	r11
-	cfi_register(lr,r11)
-# ifdef HAVE_ASM_PPC_REL16
-	bcl	20,31,1f
-1:	mflr	r9
-	addis	r9,r9,.LC0-1b@ha
-	lfs	fp13,.LC0-1b@l(r9)
-# else
 	bl	_GLOBAL_OFFSET_TABLE_@local-4
 	mflr	r10
 	lwz	r9,.LC0@got(10)
-	lfs	fp13,0(r9)
-# endif
 	mtlr	r11
-	cfi_same_value (lr)
+	lfd	fp13,0(r9)
 #else
 	lis	r9,.LC0@ha
-	lfs	fp13,.LC0@l(r9)
+	lfd	fp13,.LC0@l(r9)
 #endif
 	fabs	fp0,fp1
 	fsub	fp12,fp13,fp13	/* generate 0.0  */
@@ -57,16 +56,15 @@ ENTRY (__floor)
 	ble-	cr6,.L4
 	fadd	fp1,fp1,fp13	/* x+= TWO52;  */
 	fsub	fp1,fp1,fp13	/* x-= TWO52;  */
-	fabs	fp1,fp1		/* if (x == 0.0)  */
-				/* x = 0.0; */
+	fcmpu	cr5,fp1,fp12	/* if (x > 0.0)  */
 	mtfsf	0x01,fp11	/* restore previous rounding mode.  */
+	bnelr+	cr5
+	fmr	fp1,fp12	/* x must be +0.0 for the 0.0 case.  */
 	blr
 .L4:
 	bge-	cr6,.L9		/* if (x < 0.0)  */
 	fsub	fp1,fp1,fp13	/* x-= TWO52;  */
 	fadd	fp1,fp1,fp13	/* x+= TWO52;  */
-	fnabs	fp1,fp1		/* if (x == 0.0)  */
-				/* x = -0.0; */
 .L9:
 	mtfsf	0x01,fp11	/* restore previous rounding mode.  */	
 	blr
@@ -78,6 +76,3 @@ weak_alias (__floor, floor)
 weak_alias (__floor, floorl)
 strong_alias (__floor, __floorl)
 #endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __floor, floorl, GLIBC_2_0)
-#endif
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_floorf.S b/sysdeps/powerpc/powerpc32/fpu/s_floorf.S
index 99fbdc5f86..154bc30ff7 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_floorf.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_floorf.S
@@ -1,5 +1,5 @@
 /* float Floor function.  PowerPC32 version.
-   Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2004 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
@@ -14,38 +14,38 @@
 
    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., 51 Franklin Street, Fifth Floor, Boston MA
-   02110-1301 USA.  */
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #include <sysdep.h>
 
-	.section	.rodata.cst4,"aM",@progbits,4
-	.align	2
+	.section	.rodata
+	.align 3
+	.type	TWO23.0,@object
+	.size	TWO23.0,8
+TWO23.0:
+	.long 0x41600000
+	.long 0
+
+	.section	.rodata.cst8,"aM",@progbits,8
+	.align 3
 .LC0:	/* 2**23 */
-	.long 0x4b000000
+	.long 0x41600000
+	.long 0
 
 	.section	".text"
 ENTRY (__floorf)
 	mffs	fp11		/* Save current FPU rounding mode.  */
 #ifdef SHARED
 	mflr	r11
-	cfi_register(lr,r11)
-# ifdef HAVE_ASM_PPC_REL16
-	bcl	20,31,1f
-1:	mflr	r9
-	addis	r9,r9,.LC0-1b@ha
-	lfs	fp13,.LC0-1b@l(r9)
-# else
 	bl	_GLOBAL_OFFSET_TABLE_@local-4
 	mflr	r10
 	lwz	r9,.LC0@got(10)
-	lfs	fp13,0(r9)
-# endif
 	mtlr	r11
-	cfi_same_value (lr)
+	lfd	fp13,0(r9)
 #else
 	lis	r9,.LC0@ha
-	lfs	fp13,.LC0@l(r9)
+	lfd	fp13,.LC0@l(r9)
 #endif
 	fabs	fp0,fp1
 	fsubs	fp12,fp13,fp13	/* generate 0.0  */
@@ -56,16 +56,15 @@ ENTRY (__floorf)
 	ble-	cr6,.L4
 	fadds	fp1,fp1,fp13	/* x+= TWO23;  */
 	fsubs	fp1,fp1,fp13	/* x-= TWO23;  */
-	fabs	fp1,fp1		/* if (x == 0.0)  */
-				/* x = 0.0; */
+	fcmpu	cr5,fp1,fp12	/* if (x > 0.0)  */
 	mtfsf	0x01,fp11	/* restore previous rounding mode.  */
+	bnelr+	cr5
+	fmr	fp1,fp12	/* x must be +0.0 for the 0.0 case.  */
 	blr
 .L4:
 	bge-	cr6,.L9		/* if (x < 0.0)  */
 	fsubs	fp1,fp1,fp13	/* x-= TWO23;  */
 	fadds	fp1,fp1,fp13	/* x+= TWO23;  */
-	fnabs	fp1,fp1		/* if (x == 0.0)  */
-				/* x = -0.0; */
 .L9:
 	mtfsf	0x01,fp11	/* restore previous rounding mode.  */	
 	blr
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_fmax.S b/sysdeps/powerpc/powerpc32/fpu/s_fmax.S
deleted file mode 100644
index 69735761ab..0000000000
--- a/sysdeps/powerpc/powerpc32/fpu/s_fmax.S
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/powerpc/fpu/s_fmax.S>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __fmax, fmaxl, GLIBC_2_1)
-#endif
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_fmin.S b/sysdeps/powerpc/powerpc32/fpu/s_fmin.S
deleted file mode 100644
index 6d4a0a946c..0000000000
--- a/sysdeps/powerpc/powerpc32/fpu/s_fmin.S
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/powerpc/fpu/s_fmin.S>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __fmin, fminl, GLIBC_2_1)
-#endif
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_isnan.c b/sysdeps/powerpc/powerpc32/fpu/s_isnan.c
deleted file mode 100644
index 397717ba9c..0000000000
--- a/sysdeps/powerpc/powerpc32/fpu/s_isnan.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <sysdeps/powerpc/fpu/s_isnan.c>
-#ifndef IS_IN_libm
-# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
-compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0);
-compat_symbol (libc, isnan, isnanl, GLIBC_2_0);
-# endif
-#endif
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_llrint.c b/sysdeps/powerpc/powerpc32/fpu/s_llrint.c
index cb96be7c9b..7fdc296b0b 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_llrint.c
+++ b/sysdeps/powerpc/powerpc32/fpu/s_llrint.c
@@ -1,5 +1,5 @@
 /* Round a double value to a long long in the current rounding mode.
-   Copyright (C) 1997, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1997 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
@@ -17,8 +17,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#include <math.h>
-#include <math_ldbl_opt.h>
+#include "math.h"
 
 long long int
 __llrint (double x)
@@ -30,6 +29,3 @@ weak_alias (__llrint, llrint)
 strong_alias (__llrint, __llrintl)
 weak_alias (__llrint, llrintl)
 #endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llrint, llrintl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_lrint.S b/sysdeps/powerpc/powerpc32/fpu/s_lrint.S
index da0a1e505a..57d56c48cd 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_lrint.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_lrint.S
@@ -1,5 +1,5 @@
 /* Round double to long int.  PowerPC32 version.
-   Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2004 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
@@ -18,18 +18,15 @@
    02111-1307 USA.  */
 
 #include <sysdep.h>
-#include <math_ldbl_opt.h>
 
 /* long int[r3] __lrint (double x[fp1])  */
-ENTRY (__lrint)
-	stwu	r1,-16(r1)
+ENTRY (__lrint)	
 	fctiw	fp13,fp1
-	stfd	fp13,8(r1)
+	stfd	fp13,-8(r1)
 	nop	/* Insure the following load is in a different dispatch group */
 	nop	/* to avoid pipe stall on POWER4&5.  */
 	nop
-	lwz	r3,12(r1)
-	addi	r1,r1,16
+	lwz	r3,-4(r1)	
 	blr
 	END (__lrint)
 
@@ -42,6 +39,3 @@ weak_alias (__lrint, lrintf)
 strong_alias (__lrint, __lrintl)
 weak_alias (__lrint, lrintl)
 #endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __lrint, lrintl, GLIBC_2_1)
-#endif
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_lround.S b/sysdeps/powerpc/powerpc32/fpu/s_lround.S
index 9c534ec2be..dcb97e373b 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_lround.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_lround.S
@@ -1,5 +1,5 @@
 /* lround function.  PowerPC32 version.
-   Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2004 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
@@ -14,18 +14,32 @@
 
    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.  */
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #include <sysdep.h>
-#include <math_ldbl_opt.h>
+
+	.section	.rodata
+	.align 3
+	.type	NEGZERO.0,@object
+	.size	NEGZERO.0,8
+NEGZERO.0:
+	.long 0x00000000
+	.long 0
+	.type	POINTFIVE.0,@object
+	.size	POINTFIVE.0,8
+POINTFIVE.0:
+	.long 0x3fe00000
+	.long 0
 
 	.section	.rodata.cst8,"aM",@progbits,8
-	.align	2
+	.align 3
 .LC0:	/* 0.0 */
 	.long 0x00000000
+	.long 0
 .LC1:	/* 0.5 */
-	.long 0x3f000000
+	.long 0x3fe00000
+	.long 0
 
 	.section	".text"
 	
@@ -40,51 +54,41 @@
    to the integer value.  */
 
 ENTRY (__lround)
-	stwu    r1,-16(r1)
-	cfi_adjust_cfa_offset (16)
 #ifdef SHARED
 	mflr	r11
-	cfi_register(lr,r11)
-# ifdef HAVE_ASM_PPC_REL16
-	bcl	20,31,1f
-1:	mflr	r9
-	addis	r9,r9,.LC0-1b@ha
-	addi	r9,r9,.LC0-1b@l
-# else
 	bl	_GLOBAL_OFFSET_TABLE_@local-4
 	mflr	r10
 	lwz	r9,.LC0@got(10)
-# endif
 	mtlr	r11
-	cfi_same_value (lr)
-	lfs	fp12,0(r9)
+	lfd	fp12,0(r9)
 #else
 	lis	r9,.LC0@ha
-	lfs	fp12,.LC0@l(r9)
+	lfd	fp12,.LC0@l(r9)
 #endif
 #ifdef SHARED
-	lfs	fp10,.LC1-.LC0(r9)
+	lwz	r9,.LC1@got(10)
+	lfd	fp10,0(r9)
 #else
 	lis	r9,.LC1@ha
-	lfs	fp10,.LC1@l(r9)
+	lfd	fp10,.LC1@l(r9)
 #endif
 	fcmpu	cr6,fp1,fp12	/* if (x > 0.0)  */
 	ble-	cr6,.L4
 	fadd	fp1,fp1,fp10	/* x+= 0.5;  */
 .L9:
 	fctiwz	fp2,fp1		/* Convert To Integer DW lround toward 0.  */
-	stfd	fp2,8(r1)
-	nop	/* Ensure the following load is in a different dispatch  */
-	nop	/* group to avoid pipe stall on POWER4&5.  */
+	stfd	fp2,-8(r1)
+	nop	/* Insure the following load is in a different dispatch group */
+	nop	/* to avoid pipe stall on POWER4&5.  */
 	nop
-	lwz	r3,12(r1)
-	addi	r1,r1,16
+	lwz	r3,-4(r1)
 	blr
 .L4:
 	fsub	fp1,fp1,fp10	/* x-= 0.5;  */
 	b	.L9
 	END (__lround)
 
+strong_alias (__lround, __lround)
 weak_alias (__lround, lround)
 
 strong_alias (__lround, __lroundf)
@@ -94,6 +98,3 @@ weak_alias (__lround, lroundf)
 weak_alias (__lround, lroundl)
 strong_alias (__lround, __lroundl)
 #endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __lround, lroundl, GLIBC_2_1)
-#endif
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_rint.S b/sysdeps/powerpc/powerpc32/fpu/s_rint.S
index c8dca313ae..dee25f204f 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_rint.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_rint.S
@@ -1,5 +1,5 @@
 /* Round to int floating-point values.  PowerPC32 version.
-   Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2004 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
@@ -14,41 +14,40 @@
 
    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.  */
+   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>
 
-	.section	.rodata.cst4,"aM",@progbits,4
-	.align	2
+	.section	.rodata
+	.align 3
+	.type	TWO52.0,@object
+	.size	TWO52.0,8
+TWO52.0:
+	.long 0x43300000
+	.long 0
+
+	.section	.rodata.cst8,"aM",@progbits,8
+	.align 3
 .LC0:	/* 2**52 */
-	.long 0x59800000
+	.long 0x43300000
+	.long 0
 
 	.section	".text"
 ENTRY (__rint)
 #ifdef SHARED
 	mflr	r11
-	cfi_register(lr,r11)
-# ifdef HAVE_ASM_PPC_REL16
-	bcl	20,31,1f
-1:	mflr	r9
-	addis	r9,r9,.LC0-1b@ha
-	lfs	fp13,.LC0-1b@l(r9)
-# else
 	bl	_GLOBAL_OFFSET_TABLE_@local-4
 	mflr	r10
 	lwz	r9,.LC0@got(10)
-	lfs	fp13,0(r9)
-# endif
 	mtlr	r11
-	cfi_same_value (lr)
+	lfd	fp13,0(r9)
 #else
 	lis	r9,.LC0@ha
-	lfs	fp13,.LC0@l(r9)
+	lfd	fp13,.LC0@l(r9)
 #endif
 	fabs	fp0,fp1
 	fsub	fp12,fp13,fp13	/* generate 0.0  */
@@ -58,14 +57,13 @@ ENTRY (__rint)
 	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; */
+	blr
 .L4:
 	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)  */
-	blr			/* x = -0.0; */
+	fsub	fp1,fp13,fp1	/* x = TWO52 - x;  */
+	fsub	fp0,fp1,fp13	/* x = - (x - TWO52);  */
+	fneg	fp1,fp0
+	blr
 	END (__rint)
 
 weak_alias (__rint, rint)
@@ -74,6 +72,3 @@ weak_alias (__rint, rint)
 weak_alias (__rint, rintl)
 strong_alias (__rint, __rintl)
 #endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __rint, rintl, GLIBC_2_0)
-#endif
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_rintf.S b/sysdeps/powerpc/powerpc32/fpu/s_rintf.S
index 7771cb2bc8..cebf6423af 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_rintf.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_rintf.S
@@ -1,5 +1,5 @@
 /* Round float to int floating-point values.  PowerPC32 version.
-   Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2004 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
@@ -14,37 +14,38 @@
 
    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.  */
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #include <sysdep.h>
 
-	.section	.rodata.cst4,"aM",@progbits,4
-	.align	2
+
+	.section	.rodata
+	.align 3
+	.type	TWO23.0,@object
+	.size	TWO23.0,8
+TWO23.0:
+	.long 0x41600000
+	.long 0
+
+	.section	.rodata.cst8,"aM",@progbits,8
+	.align 3
 .LC0:	/* 2**23 */
-	.long 0x4b000000
+	.long 0x41600000
+	.long 0
 
 	.section	".text"
 ENTRY (__rintf)
 #ifdef SHARED
 	mflr	r11
-	cfi_register(lr,r11)
-# ifdef HAVE_ASM_PPC_REL16
-	bcl	20,31,1f
-1:	mflr	r9
-	addis	r9,r9,.LC0-1b@ha
-	lfs	fp13,.LC0-1b@l(r9)
-# else
 	bl	_GLOBAL_OFFSET_TABLE_@local-4
 	mflr	r10
 	lwz	r9,.LC0@got(10)
-	lfs	fp13,0(r9)
-# endif
 	mtlr	r11
-	cfi_same_value (lr)
+	lfd	fp13,0(r9)
 #else
 	lis	r9,.LC0@ha
-	lfs	fp13,.LC0@l(r9)
+	lfd	fp13,.LC0@l(r9)
 #endif
 	fabs	fp0,fp1
 	fsubs	fp12,fp13,fp13	/* generate 0.0  */
@@ -54,14 +55,13 @@ ENTRY (__rintf)
 	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; */
+	blr
 .L4:
 	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)  */
-	blr			/* x = -0.0; */
+	fsubs	fp1,fp13,fp1	/* x = TWO23 - x;  */
+	fsubs	fp0,fp1,fp13	/* x = - (x - TWO23);  */
+	fneg	fp1,fp0
+	blr
 	END (__rintf)
 
 weak_alias (__rintf, rintf)
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_round.S b/sysdeps/powerpc/powerpc32/fpu/s_round.S
index 590c87ad8c..13fc74f001 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_round.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_round.S
@@ -1,5 +1,5 @@
 /* round function.  PowerPC32 version.
-   Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2004 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
@@ -14,18 +14,40 @@
 
    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.  */
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #include <sysdep.h>
-#include <math_ldbl_opt.h>
+
+	.section	.rodata
+	.align 3
+	.type	TWO52.0,@object
+	.size	TWO52.0,8
+TWO52.0:
+	.long 0x43300000
+	.long 0
+	.type	POINTFIVE.0,@object
+	.size	POINTFIVE.0,8
+POINTFIVE.0:
+	.long 0x3fe00000
+	.long 0
+	.type	NEGZERO.0,@object
+	.size	NEGZERO.0,8
+NEGZERO.0:
+	.long 0x80000000
+	.long 0
 
 	.section	.rodata.cst8,"aM",@progbits,8
-	.align	2
+	.align 3
 .LC0:	/* 2**52 */
-	.long 0x59800000
+	.long 0x43300000
+	.long 0
 .LC1:	/* 0.5 */
-	.long 0x3f000000
+	.long 0x3fe00000
+	.long 0
+.LC2:	/* -0.0 */
+	.long 0x80000000
+	.long 0
 
 /* double [fp1] round (double x [fp1])
    IEEE 1003.1 round function.  IEEE specifies "round to the nearest 
@@ -37,28 +59,18 @@
    "Round toward Zero" mode and round by adding +-0.5 before rounding
    to the integer value.  */
 
-	.section	".text"
 ENTRY (__round)
 	mffs	fp11		/* Save current FPU rounding mode.  */
 #ifdef SHARED
 	mflr	r11
-	cfi_register(lr,r11)
-# ifdef HAVE_ASM_PPC_REL16
-	bcl	20,31,1f
-1:	mflr	r9
-	addis	r9,r9,.LC0-1b@ha
-	addi	r9,r9,.LC0-1b@l
-# else
 	bl	_GLOBAL_OFFSET_TABLE_@local-4
 	mflr	r10
 	lwz	r9,.LC0@got(10)
-# endif
 	mtlr	r11
-	cfi_same_value (lr)
-	lfs	fp13,0(r9)
+	lfd	fp13,0(r9)
 #else
 	lis	r9,.LC0@ha
-	lfs	fp13,.LC0@l(r9)
+	lfd	fp13,.LC0@l(r9)
 #endif
 	fabs	fp0,fp1
 	fsub	fp12,fp13,fp13	/* generate 0.0  */
@@ -67,17 +79,17 @@ ENTRY (__round)
 	bnllr-	cr7
 	mtfsfi	7,1		/* Set rounding mode toward 0.  */
 #ifdef SHARED
-	lfs	fp10,.LC1-.LC0(r9)
+	lwz	r9,.LC1@got(10)
+	lfd	fp10,0(r9)
 #else
 	lis	r9,.LC1@ha
-	lfs	fp10,.LC1@l(r9)
+	lfd	fp10,.LC1@l(r9)
 #endif
 	ble-	cr6,.L4
 	fadd	fp1,fp1,fp10	/* x+= 0.5;  */
 	fadd	fp1,fp1,fp13	/* x+= TWO52;  */
 	fsub	fp1,fp1,fp13	/* x-= TWO52;  */
-	fabs	fp1,fp1		/* if (x == 0.0)  */
-				/* x = 0.0; */
+.L9:	
 	mtfsf	0x01,fp11	/* restore previous rounding mode.  */
 	blr
 .L4:
@@ -85,10 +97,16 @@ ENTRY (__round)
 	bge-	cr6,.L9		/* if (x < 0.0)  */
 	fsub	fp1,fp9,fp13	/* x-= TWO52;  */
 	fadd	fp1,fp1,fp13	/* x+= TWO52;  */
-	fnabs	fp1,fp1		/* if (x == 0.0)  */
-				/* x = -0.0; */
-.L9:
+	fcmpu	cr5,fp1,fp12	/* if (x > 0.0)  */
 	mtfsf	0x01,fp11	/* restore previous rounding mode.  */
+	bnelr+	cr5
+#ifdef SHARED
+	lwz	r9,.LC2@got(10)
+	lfd	fp1,0(r9)
+#else
+	lis	r9,.LC2@ha
+	lfd	fp1,.LC2@l(r9)
+#endif
 	blr
 	END (__round)
 
@@ -98,6 +116,3 @@ weak_alias (__round, round)
 weak_alias (__round, roundl)
 strong_alias (__round, __roundl)
 #endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __round, roundl, GLIBC_2_1)
-#endif
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_roundf.S b/sysdeps/powerpc/powerpc32/fpu/s_roundf.S
index 7e99bca315..ea8aaf3add 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_roundf.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_roundf.S
@@ -1,5 +1,5 @@
 /* roundf  function.  PowerPC32 version.
-   Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2004 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
@@ -14,17 +14,40 @@
 
    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.  */
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #include <sysdep.h>
 
+	.section	.rodata
+	.align 3
+	.type	TWO23.0,@object
+	.size	TWO23.0,8
+TWO23.0:
+	.long 0x43300000
+	.long 0
+	.type	POINTFIVE.0,@object
+	.size	POINTFIVE.0,8
+POINTFIVE.0:
+	.long 0x3fe00000
+	.long 0
+	.type	NEGZERO.0,@object
+	.size	NEGZERO.0,8
+NEGZERO.0:
+	.long 0x80000000
+	.long 0
+
 	.section	.rodata.cst8,"aM",@progbits,8
-	.align	2
+	.align 3
 .LC0:	/* 2**23 */
-	.long 0x4b000000
+	.long 0x41600000
+	.long 0
 .LC1:	/* 0.5 */
-	.long 0x3f000000
+	.long 0x3fe00000
+	.long 0
+.LC2:	/* -0.0 */
+	.long 0x80000000
+	.long 0
 
 /* float [fp1] roundf  (float x [fp1])
    IEEE 1003.1 round function.  IEEE specifies "round to the nearest 
@@ -36,28 +59,18 @@
    "Round toward Zero" mode and round by adding +-0.5 before rounding
    to the integer value.  */
 
-	.section	".text"
 ENTRY (__roundf )
 	mffs	fp11		/* Save current FPU rounding mode.  */
 #ifdef SHARED
 	mflr	r11
-	cfi_register(lr,r11)
-# ifdef HAVE_ASM_PPC_REL16
-	bcl	20,31,1f
-1:	mflr	r9
-	addis	r9,r9,.LC0-1b@ha
-	addi	r9,r9,.LC0-1b@l
-# else
 	bl	_GLOBAL_OFFSET_TABLE_@local-4
 	mflr	r10
 	lwz	r9,.LC0@got(10)
-# endif
 	mtlr	r11
-	cfi_same_value (lr)
-	lfs	fp13,0(r9)
+	lfd	fp13,0(r9)
 #else
 	lis	r9,.LC0@ha
-	lfs	fp13,.LC0@l(r9)
+	lfd	fp13,.LC0@l(r9)
 #endif
 	fabs	fp0,fp1
 	fsubs	fp12,fp13,fp13	/* generate 0.0  */
@@ -66,17 +79,17 @@ ENTRY (__roundf )
 	bnllr-	cr7
 	mtfsfi	7,1		/* Set rounding mode toward 0.  */
 #ifdef SHARED
-	lfs	fp10,.LC1-.LC0(r9)
+	lwz	r9,.LC1@got(10)
+	lfd	fp10,0(r9)
 #else
 	lis	r9,.LC1@ha
-	lfs	fp10,.LC1@l(r9)
+	lfd	fp10,.LC1@l(r9)
 #endif
 	ble-	cr6,.L4
 	fadds	fp1,fp1,fp10	/* x+= 0.5;  */
 	fadds	fp1,fp1,fp13	/* x+= TWO23;  */
 	fsubs	fp1,fp1,fp13	/* x-= TWO23;  */
-	fabs	fp1,fp1		/* if (x == 0.0)  */
-				/* x = 0.0; */
+.L9:	
 	mtfsf	0x01,fp11	/* restore previous rounding mode.  */
 	blr
 .L4:
@@ -84,10 +97,16 @@ ENTRY (__roundf )
 	bge-	cr6,.L9		/* if (x < 0.0)  */
 	fsubs	fp1,fp9,fp13	/* x-= TWO23;  */
 	fadds	fp1,fp1,fp13	/* x+= TWO23;  */
-	fnabs	fp1,fp1		/* if (x == 0.0)  */
-				/* x = -0.0; */
-.L9:
+	fcmpu	cr5,fp1,fp12	/* if (x > 0.0)  */
 	mtfsf	0x01,fp11	/* restore previous rounding mode.  */
+	bnelr+	cr5
+#ifdef SHARED
+	lwz	r9,.LC2@got(10)
+	lfd	fp1,0(r9)
+#else
+	lis	r9,.LC2@ha
+	lfd	fp1,.LC2@l(r9)
+#endif
 	blr
 	END (__roundf)
 
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_trunc.S b/sysdeps/powerpc/powerpc32/fpu/s_trunc.S
index 5bc0856b9f..a4be651f8c 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_trunc.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_trunc.S
@@ -1,5 +1,5 @@
 /* trunc function.  PowerPC32 version.
-   Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2004 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
@@ -14,16 +14,32 @@
 
    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.  */
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #include <sysdep.h>
-#include <math_ldbl_opt.h>
 
-	.section	.rodata.cst4,"aM",@progbits,4
-	.align	2
+	.section	.rodata
+	.align 3
+	.type	TWO52.0,@object
+	.size	TWO52.0,8
+TWO52.0:
+	.long 0x43300000
+	.long 0
+	.type	NEGZERO.0,@object
+	.size	NEGZERO.0,8
+NEGZERO.0:
+	.long 0x80000000
+	.long 0
+
+	.section	.rodata.cst8,"aM",@progbits,8
+	.align 3
 .LC0:	/* 2**52 */
-	.long 0x59800000
+	.long 0x43300000
+	.long 0
+.LC1:	/* -0.0 */
+	.long 0x80000000
+	.long 0
 
 /* double [fp1] trunc (double x [fp1])
    IEEE 1003.1 trunc function.  IEEE specifies "trunc to the integer
@@ -32,28 +48,18 @@
    We set "round toward Zero" mode and trunc by adding +-2**52 then
    subtracting +-2**52.  */
 
-	.section	".text"
 ENTRY (__trunc)
 	mffs	fp11		/* Save current FPU rounding mode.  */
 #ifdef SHARED
 	mflr	r11
-	cfi_register(lr,r11)
-# ifdef HAVE_ASM_PPC_REL16
-	bcl	20,31,1f
-1:	mflr	r9
-	addis	r9,r9,.LC0-1b@ha
-	lfs	fp13,.LC0-1b@l(r9)
-# else
 	bl	_GLOBAL_OFFSET_TABLE_@local-4
 	mflr	r10
 	lwz	r9,.LC0@got(10)
-	lfs	fp13,0(r9)
-# endif
 	mtlr	r11
-	cfi_same_value (lr)
+	lfd	fp13,0(r9)
 #else
 	lis	r9,.LC0@ha
-	lfs	fp13,.LC0@l(r9)
+	lfd	fp13,.LC0@l(r9)
 #endif
 	fabs	fp0,fp1
 	fsub	fp12,fp13,fp13	/* generate 0.0  */
@@ -64,18 +70,23 @@ ENTRY (__trunc)
 	ble-	cr6,.L4
 	fadd	fp1,fp1,fp13	/* x+= TWO52;  */
 	fsub	fp1,fp1,fp13	/* x-= TWO52;  */
-	fabs	fp1,fp1		/* if (x == 0.0)  */
-				/* x = 0.0; */
-	mtfsf	0x01,fp11	/* restore previous rounding mode.  */
+.L9:	
+	mtfsf	0x01,fp11	/* restore previous truncing mode.  */
 	blr
 .L4:
 	bge-	cr6,.L9		/* if (x < 0.0)  */
 	fsub	fp1,fp1,fp13	/* x-= TWO52;  */
 	fadd	fp1,fp1,fp13	/* x+= TWO52;  */
-	fnabs	fp1,fp1		/* if (x == 0.0)  */
-				/* x = -0.0; */
-.L9:
+	fcmpu	cr5,fp1,fp12	/* if (x > 0.0)  */
 	mtfsf	0x01,fp11	/* restore previous rounding mode.  */
+	bnelr+	cr5
+#ifdef SHARED
+	lwz	r9,.LC1@got(10)
+	lfd	fp1,0(r9)
+#else
+	lis	r9,.LC1@ha
+	lfd	fp1,.LC1@l(r9)
+#endif
 	blr
 	END (__trunc)
 
@@ -85,6 +96,3 @@ weak_alias (__trunc, trunc)
 weak_alias (__trunc, truncl)
 strong_alias (__trunc, __truncl)
 #endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __trunc, truncl, GLIBC_2_1)
-#endif
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_truncf.S b/sysdeps/powerpc/powerpc32/fpu/s_truncf.S
index e2e3bd6740..9a8dae931b 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_truncf.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_truncf.S
@@ -1,5 +1,5 @@
 /* truncf function.  PowerPC32 version.
-   Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2004 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
@@ -14,15 +14,32 @@
 
    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.  */
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #include <sysdep.h>
 
-	.section	.rodata.cst4,"aM",@progbits,4
-	.align	2
+	.section	.rodata
+	.align 3
+	.type	TWO23.0,@object
+	.size	TWO23.0,8
+TWO23.0:
+	.long 0x41600000
+	.long 0
+	.type	NEGZERO.0,@object
+	.size	NEGZERO.0,8
+NEGZERO.0:
+	.long 0x80000000
+	.long 0
+
+	.section	.rodata.cst8,"aM",@progbits,8
+	.align 3
 .LC0:	/* 2**23 */
-	.long 0x4b000000
+	.long 0x41600000
+	.long 0
+.LC1:	/* -0.0 */
+	.long 0x80000000
+	.long 0
 
 /* float [fp1] truncf (float x [fp1])
    IEEE 1003.1 trunc function.  IEEE specifies "trunc to the integer
@@ -31,28 +48,18 @@
    We set "round toward Zero" mode and trunc by adding +-2**23 then
    subtracting +-2**23.  */
 
-	.section	".text"
 ENTRY (__truncf)
 	mffs	fp11		/* Save current FPU rounding mode.  */
 #ifdef SHARED
 	mflr	r11
-	cfi_register(lr,r11)
-# ifdef HAVE_ASM_PPC_REL16
-	bcl	20,31,1f
-1:	mflr	r9
-	addis	r9,r9,.LC0-1b@ha
-	lfs	fp13,.LC0-1b@l(r9)
-# else
 	bl	_GLOBAL_OFFSET_TABLE_@local-4
 	mflr	r10
 	lwz	r9,.LC0@got(10)
-	lfs	fp13,0(r9)
-# endif
 	mtlr	r11
-	cfi_same_value (lr)
+	lfd	fp13,0(r9)
 #else
 	lis	r9,.LC0@ha
-	lfs	fp13,.LC0@l(r9)
+	lfd	fp13,.LC0@l(r9)
 #endif
 	fabs	fp0,fp1
 	fsubs	fp12,fp13,fp13	/* generate 0.0  */
@@ -63,18 +70,23 @@ ENTRY (__truncf)
 	ble-	cr6,.L4
 	fadds	fp1,fp1,fp13	/* x+= TWO23;  */
 	fsubs	fp1,fp1,fp13	/* x-= TWO23;  */
-	fabs	fp1,fp1		/* if (x == 0.0)  */
-				/* x = 0.0; */
-	mtfsf	0x01,fp11	/* restore previous rounding mode.  */
+.L9:	
+	mtfsf	0x01,fp11	/* restore previous truncing mode.  */
 	blr
 .L4:
 	bge-	cr6,.L9		/* if (x < 0.0)  */
 	fsubs	fp1,fp1,fp13	/* x-= TWO23;  */
 	fadds	fp1,fp1,fp13	/* x+= TWO23;  */
-	fnabs	fp1,fp1		/* if (x == 0.0)  */
-				/* x = -0.0; */
-.L9:
+	fcmpu	cr5,fp1,fp12	/* if (x > 0.0)  */
 	mtfsf	0x01,fp11	/* restore previous rounding mode.  */
+	bnelr+	cr5
+#ifdef SHARED
+	lwz	r9,.LC1@got(10)
+	lfd	fp1,0(r9)
+#else
+	lis	r9,.LC1@ha
+	lfd	fp1,.LC1@l(r9)
+#endif
 	blr
 	END (__truncf)
 
diff --git a/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S b/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S
index 851480d2ef..77ee05f487 100644
--- a/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S
+++ b/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S
@@ -1,5 +1,5 @@
 /* setjmp for PowerPC.
-   Copyright (C) 1995-2000, 2003-2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1995-99, 2000, 2003, 2004 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
@@ -14,15 +14,16 @@
 
    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.  */
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #include <sysdep.h>
 #define _ASM
+#define _SETJMP_H
 #ifdef __NO_VMX__
 # include <novmxsetjmp.h>
 #else
-# include <jmpbuf-offsets.h>
+# include <bits/setjmp.h>
 #endif
 #include <bp-sym.h>
 #include <bp-asm.h>
@@ -31,19 +32,10 @@
 ENTRY (BP_SYM (__sigsetjmp))
 	CHECK_BOUNDS_BOTH_WIDE_LIT (r3, r8, r9, JB_SIZE)
 
-#ifdef PTR_MANGLE
-	mr   r5,r1
-	PTR_MANGLE(r5, r6)
-	stw  r5,(JB_GPR1*4)(3)
-#else
 	stw  r1,(JB_GPR1*4)(3)
-#endif
 	mflr r0
 	stw  r14,((JB_GPRS+0)*4)(3)
 	stfd fp14,((JB_FPRS+0*2)*4)(3)
-#ifdef PTR_MANGLE
-	PTR_MANGLE2 (r0, r6)
-#endif
 	stw  r0,(JB_LR*4)(3)
 	stw  r15,((JB_GPRS+1)*4)(3)
 	stfd fp15,((JB_FPRS+1*2)*4)(3)
@@ -82,31 +74,23 @@ ENTRY (BP_SYM (__sigsetjmp))
 	stw  r31,((JB_GPRS+17)*4)(3)
 	stfd fp31,((JB_FPRS+17*2)*4)(3)
 #ifndef __NO_VMX__
-# ifdef PIC
+#ifdef PIC
 	mflr    r6
-	cfi_register(lr,r6)
-#  ifdef HAVE_ASM_PPC_REL16
-	bcl	20,31,1f
-1:	mflr	r5
-	addis	r5,r5,_GLOBAL_OFFSET_TABLE_-1b@ha
-	addi	r5,r5,_GLOBAL_OFFSET_TABLE_-1b@l
-#  else
 	bl      _GLOBAL_OFFSET_TABLE_@local-4
 	mflr    r5
-#  endif
-	mtlr	r6
-	cfi_same_value (lr)
-#  ifdef SHARED
+#ifdef SHARED
 	lwz     r5,_rtld_global_ro@got(r5)
+	mtlr    r6
 	lwz     r5,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET(r5)
-#  else
-	lwz     r5,_dl_hwcap@got(r5)
+#else
+	lwz     r5,_rtld_global_ro@got(r5)
+	mtlr    r6
 	lwz     r5,0(r5)
-#  endif
-# else
-	lis	r6,_dl_hwcap@ha
-	lwz     r5,_dl_hwcap@l(r6)
-# endif
+#endif
+#else
+	lis	r5,_dl_hwcap@ha
+	lwz     r5,_dl_hwcap@l(r5)
+#endif
 	andis.	r5,r5,(PPC_FEATURE_HAS_ALTIVEC >> 16)
 	beq	L(no_vmx)
 	la	r5,((JB_VRS)*4)(3)
@@ -180,5 +164,5 @@ L(aligned_save_vmx):
 	stvx	31,0,r6
 L(no_vmx):
 #endif
-	b BP_SYM (__sigjmp_save@local)
+	b JUMPTARGET (BP_SYM (__sigjmp_save))
 END (BP_SYM (__sigsetjmp))