about summary refs log tree commit diff
path: root/sysdeps/powerpc/powerpc32/fpu/s_lround.S
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-07-12 18:26:36 +0000
committerJakub Jelinek <jakub@redhat.com>2007-07-12 18:26:36 +0000
commit0ecb606cb6cf65de1d9fc8a919bceb4be476c602 (patch)
tree2ea1f8305970753e4a657acb2ccc15ca3eec8e2c /sysdeps/powerpc/powerpc32/fpu/s_lround.S
parent7d58530341304d403a6626d7f7a1913165fe2f32 (diff)
downloadglibc-0ecb606cb6cf65de1d9fc8a919bceb4be476c602.tar.gz
glibc-0ecb606cb6cf65de1d9fc8a919bceb4be476c602.tar.xz
glibc-0ecb606cb6cf65de1d9fc8a919bceb4be476c602.zip
2.5-18.1
Diffstat (limited to 'sysdeps/powerpc/powerpc32/fpu/s_lround.S')
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_lround.S59
1 files changed, 29 insertions, 30 deletions
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_lround.S b/sysdeps/powerpc/powerpc32/fpu/s_lround.S
index dcb97e373b..9c534ec2be 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 Free Software Foundation, Inc.
+   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
@@ -14,32 +14,18 @@
 
    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.  */
+   Software Foundation, Inc., 1 Franklin Street, Fifth Floor, Boston MA
+   02110-1301 USA.  */
 
 #include <sysdep.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
+#include <math_ldbl_opt.h>
 
 	.section	.rodata.cst8,"aM",@progbits,8
-	.align 3
+	.align	2
 .LC0:	/* 0.0 */
 	.long 0x00000000
-	.long 0
 .LC1:	/* 0.5 */
-	.long 0x3fe00000
-	.long 0
+	.long 0x3f000000
 
 	.section	".text"
 	
@@ -54,41 +40,51 @@ POINTFIVE.0:
    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
-	lfd	fp12,0(r9)
+	cfi_same_value (lr)
+	lfs	fp12,0(r9)
 #else
 	lis	r9,.LC0@ha
-	lfd	fp12,.LC0@l(r9)
+	lfs	fp12,.LC0@l(r9)
 #endif
 #ifdef SHARED
-	lwz	r9,.LC1@got(10)
-	lfd	fp10,0(r9)
+	lfs	fp10,.LC1-.LC0(r9)
 #else
 	lis	r9,.LC1@ha
-	lfd	fp10,.LC1@l(r9)
+	lfs	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	/* Insure the following load is in a different dispatch group */
-	nop	/* to avoid pipe stall on POWER4&5.  */
+	stfd	fp2,8(r1)
+	nop	/* Ensure the following load is in a different dispatch  */
+	nop	/* group to avoid pipe stall on POWER4&5.  */
 	nop
-	lwz	r3,-4(r1)
+	lwz	r3,12(r1)
+	addi	r1,r1,16
 	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)
@@ -98,3 +94,6 @@ 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