This is the mail archive of the libc-alpha@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]

[PATCH 22/36] PowerPC: llround multilib for PowerPC32


2013-08-19  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>

	* sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S: Move to ...
	* sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-power4.S: ... here.
	(__lround): Rename symbol to __llround_power4 and remove strong_alias,
	weak_alias and compat_symbol definitions.
	* sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S : Move to ...
	* sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-power5+.S: ... here.
	(__lround): Rename symbol to __llrint_power5plus and remove strong_alias,
	weak_alias and compat_symbol definitions.
	* sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S: Move to ...
	* sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-power6.S: ... here.
	(__lround): Rename symbol to __llround_power6 and remove strong_alias,
	weak_alias and compat_symbol definitions.
	* sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-ppc32.c: New file:
	default llround implementation for PPC32.
	* sysdeps/powerpc/powerpc32/power4/fpu/s_llroundf.S: Remove unneeded
	file.
	* sysdeps/powerpc/powerpc32/power5+/fpu/s_llroundf.S: Likewise.
	* sysdeps/powerpc/powerpc32/power6/fpu/s_llroundf.S: Likewise.
	* sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround.c: New file:
	multiarch llround for PPC32.
	* sysdeps/powerpc/powerpc32/fpu/multiarch/s_llroundf.c: New file:
	multiarch llroundf for PPC32.
	* sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile: Add llround and
	llroundf objects.

--

diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
index 8119417..7c50805 100644
--- a/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
@@ -1,4 +1,8 @@
 ifeq ($(subdir),math)
 libm-sysdep_routines += s_llrintf-power6 s_llrintf-power4 s_llrintf-ppc32 \
-			s_llrint-power6 s_llrint-power4 s_llrint-ppc32
+			s_llrint-power6 s_llrint-power4 s_llrint-ppc32 \
+			s_llround-power6 s_llround-power5+ s_llround-power4 \
+			s_llround-ppc32
+
+CFLAGS-s_llround.c = -fno-builtin-llroundf
 endif
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-power4.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-power4.S
new file mode 100644
index 0000000..1080771
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-power4.S
@@ -0,0 +1,96 @@
+/* llround function.  PowerPC32/POWER4 version.
+   Copyright (C) 2004-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+#include <math_ldbl_opt.h>
+
+ .section .rodata.cst12,"aM",@progbits,12
+ .align 3
+ .LC0:   /* 0x1.0000000000000p+52 == 2^52 */
+	.long 0x43300000
+	.long 0x00000000
+	.long 0x3f000000 /* Use this for 0.5  */
+
+	.section	".text"
+
+/* long [r3] lround (float x [fp1])
+   IEEE 1003.1 lround function.  IEEE specifies "round to the nearest
+   integer value, rounding halfway cases away from zero, regardless of
+   the current rounding mode."  However PowerPC Architecture defines
+   "round to Nearest" as "Choose the best approximation. In case of a
+   tie, choose the one that is even (least significant bit o).".
+   So we can't use the PowerPC "round to Nearest" mode. Instead we set
+   "round toward Zero" mode and round by adding +-0.5 before rounding
+   to the integer value.
+
+   It is necessary to detect when x is (+-)0x1.fffffffffffffp-2
+   because adding +-0.5 in this case will cause an erroneous shift,
+   carry and round.  We simply return 0 if 0.5 > x > -0.5.  Likewise
+   if x is and odd number between +-(2^52 and 2^53-1) a shift and
+   carry will erroneously round if biased with +-0.5.  Therefore if x
+   is greater/less than +-2^52 we don't need to bias the number with
+   +-0.5.  */
+
+	.machine power4
+ENTRY (__llround_power4)
+	stwu    r1,-16(r1)
+	cfi_adjust_cfa_offset (16)
+#ifdef SHARED
+	mflr	r11
+	cfi_register(lr,r11)
+	SETUP_GOT_ACCESS(r9,got_label)
+	addis	r9,r9,.LC0-got_label@ha
+	addi	r9,r9,.LC0-got_label@l
+	mtlr	r11
+	cfi_same_value (lr)
+	lfd	fp9,0(r9)
+	lfs	fp10,8(r9)
+#else
+	lis r9,.LC0@ha
+	lfd fp9,.LC0@l(r9)	/* Load 2^52 into fpr9.  */
+	lfs fp10,.LC0@l+8(r9)	/* Load 0.5 into fpr10.  */
+#endif
+	fabs	fp2,fp1		/* Get the absolute value of x.  */
+	fsub	fp12,fp10,fp10	/* Compute 0.0 into fpr12.  */
+	fcmpu	cr6,fp2,fp10	/* if |x| < 0.5  */
+	fcmpu	cr7,fp2,fp9	/* if |x| >= 2^52  */
+	fcmpu	cr1,fp1,fp12	/* x is negative? x < 0.0  */
+	blt-	cr6,.Lretzero	/* 0.5 > x < -0.5 so just return 0.  */
+	bge-	cr7,.Lnobias	/* 2^52 > x < -2^52 just convert with no bias.  */
+	fadd	fp3,fp2,fp10	/* |x|+=0.5 bias to prepare to round.  */
+	bge	cr1,.Lconvert	/* x is positive so don't negate x.  */
+	fnabs	fp3,fp3		/* -(|x|+=0.5)  */
+.Lconvert:
+	fctidz	fp4,fp3		/* Convert to Integer double word round toward 0.  */
+	stfd	fp4,8(r1)
+	nop
+	nop
+	nop
+	lwz	r4,12(r1)	/* Load return as integer.  */
+	lwz	r3,8(r1)
+.Lout:
+	addi	r1,r1,16
+	blr
+.Lretzero:			/* 0.5 > x > -0.5  */
+	li	r3,0		/* return 0.  */
+	li	r4,0
+	b	.Lout
+.Lnobias:
+	fmr	fp3,fp1
+	b	.Lconvert
+END (__llround_power4)
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-power5+.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-power5+.S
new file mode 100644
index 0000000..90765de
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-power5+.S
@@ -0,0 +1,46 @@
+/* lround function.  PowerPC32/POWER5+ version.
+   Copyright (C) 2006-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+#include <math_ldbl_opt.h>
+
+/* long [r3] llround (float x [fp1])
+   IEEE 1003.1 lround function.  IEEE specifies "round to the nearest
+   integer value, rounding halfway cases away from zero, regardless of
+   the current rounding mode."  However PowerPC Architecture defines
+   "round to Nearest" as "Choose the best approximation. In case of a
+   tie, choose the one that is even (least significant bit o).".
+   So we pre-round using the V2.02 Floating Round to Integer Nearest
+   instruction before we use the Floating Convert to Integer Word with
+   round to zero instruction.  */
+
+	.machine	"power5"
+ENTRY (__llround_power5)
+	stwu    r1,-16(r1)
+	cfi_adjust_cfa_offset (16)
+	frin	fp2,fp1
+	fctidz	fp3,fp2		/* Convert To Integer Word lround toward 0.  */
+	stfd	fp3,8(r1)
+	nop	/* Ensure the following load is in a different dispatch  */
+	nop	/* group to avoid pipe stall on POWER4&5.  */
+	nop
+	lwz	r4,12(r1)
+	lwz	r3,8(r1)
+	addi	r1,r1,16
+	blr
+END (__llround_power5)
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-power6.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-power6.S
new file mode 100644
index 0000000..fa61586
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-power6.S
@@ -0,0 +1,46 @@
+/* lround function.  PowerPC32/POWER6 version.
+   Copyright (C) 2006-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+#include <math_ldbl_opt.h>
+
+/* long [r3] llround (float x [fp1])
+   IEEE 1003.1 lround function.  IEEE specifies "round to the nearest
+   integer value, rounding halfway cases away from zero, regardless of
+   the current rounding mode."  However PowerPC Architecture defines
+   "round to Nearest" as "Choose the best approximation. In case of a
+   tie, choose the one that is even (least significant bit o).".
+   So we pre-round using the V2.02 Floating Round to Integer Nearest
+   instruction before we use the Floating Convert to Integer Word with
+   round to zero instruction.  */
+
+	.machine	"power6"
+ENTRY (__llround_power6)
+	stwu    r1,-16(r1)
+	cfi_adjust_cfa_offset (16)
+	frin	fp2,fp1
+	fctidz	fp3,fp2		/* Convert To Integer Word lround toward 0.  */
+	stfd	fp3,8(r1)
+/* Insure the following load is in a different dispatch group by
+   inserting "group ending nop".  */
+	ori	r1,r1,0
+	lwz	r4,12(r1)
+	lwz	r3,8(r1)
+	addi	r1,r1,16
+	blr
+END (__llround_power6)
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-ppc32.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-ppc32.c
new file mode 100644
index 0000000..fad664e
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-ppc32.c
@@ -0,0 +1,32 @@
+/* llround function.  PowerPC32 default version.
+   Copyright (C) 2004-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <math.h>
+#include <math_ldbl_opt.h>
+
+#undef __llround
+#define __llround __llround_ppc32
+
+#undef weak_alias
+#define weak_alias(a,b)
+#undef strong_alias
+#define strong_alias(a,b)
+#undef compat_symbol
+#define compat_symbol(a,b,c,d)
+
+#include <sysdeps/powerpc/fpu/s_llround.c>
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround.c
new file mode 100644
index 0000000..9ca54e0
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround.c
@@ -0,0 +1,46 @@
+/* Multiple versions of llround.
+   Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <math.h>
+#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
+#include "init-arch.h"
+
+extern __typeof (__llround) __llround_ppc32 attribute_hidden;
+extern __typeof (__llround) __llround_power4 attribute_hidden;
+extern __typeof (__llround) __llround_power5 attribute_hidden;
+extern __typeof (__llround) __llround_power6 attribute_hidden;
+
+libc_ifunc (__llround,
+	    (hwcap & PPC_FEATURE_ARCH_2_05)
+	    ? __llround_power6 :
+	      (hwcap & PPC_FEATURE_POWER5_PLUS)
+	      ? __llround_power5 :
+		(hwcap & PPC_FEATURE_POWER4)
+		? __llround_power4
+            : __llround_ppc32);
+
+weak_alias (__llround, llround)
+
+#ifdef NO_LONG_DOUBLE
+strong_alias (__llround, __llroundl)
+weak_alias (__llround, llroundl)
+#endif
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __llround, llroundl, GLIBC_2_1);
+#endif
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llroundf.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llroundf.c
new file mode 100644
index 0000000..629048d
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llroundf.c
@@ -0,0 +1,37 @@
+/* Multiple versions of llroundf.
+   Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <math.h>
+#include "init-arch.h"
+
+/* It's safe to use double-precision implementation for single-precision.  */
+extern __typeof (__llroundf) __llround_ppc32 attribute_hidden;
+extern __typeof (__llroundf) __llround_power4 attribute_hidden;
+extern __typeof (__llroundf) __llround_power5 attribute_hidden;
+extern __typeof (__llroundf) __llround_power6 attribute_hidden;
+
+libc_ifunc (__llroundf,
+	    (hwcap & PPC_FEATURE_ARCH_2_05)
+	    ? __llround_power6 :
+	      (hwcap & PPC_FEATURE_POWER5_PLUS)
+	      ? __llround_power5 :
+		(hwcap & PPC_FEATURE_POWER4)
+		? __llround_power4
+            : __llround_ppc32);
+
+weak_alias (__llroundf, llroundf)
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S b/sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S
deleted file mode 100644
index 631180f..0000000
--- a/sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S
+++ /dev/null
@@ -1,108 +0,0 @@
-/* llround function.  PowerPC32 on PowerPC64 version.
-   Copyright (C) 2004-2013 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
-
- .section .rodata.cst12,"aM",@progbits,12
- .align 3
- .LC0:   /* 0x1.0000000000000p+52 == 2^52 */
-	.long 0x43300000
-	.long 0x00000000
-	.long 0x3f000000 /* Use this for 0.5  */
-
-	.section	".text"
-
-/* long [r3] lround (float x [fp1])
-   IEEE 1003.1 lround function.  IEEE specifies "round to the nearest
-   integer value, rounding halfway cases away from zero, regardless of
-   the current rounding mode."  However PowerPC Architecture defines
-   "round to Nearest" as "Choose the best approximation. In case of a
-   tie, choose the one that is even (least significant bit o).".
-   So we can't use the PowerPC "round to Nearest" mode. Instead we set
-   "round toward Zero" mode and round by adding +-0.5 before rounding
-   to the integer value.
-
-   It is necessary to detect when x is (+-)0x1.fffffffffffffp-2
-   because adding +-0.5 in this case will cause an erroneous shift,
-   carry and round.  We simply return 0 if 0.5 > x > -0.5.  Likewise
-   if x is and odd number between +-(2^52 and 2^53-1) a shift and
-   carry will erroneously round if biased with +-0.5.  Therefore if x
-   is greater/less than +-2^52 we don't need to bias the number with
-   +-0.5.  */
-
-ENTRY (__llround)
-	stwu    r1,-16(r1)
-	cfi_adjust_cfa_offset (16)
-#ifdef SHARED
-	mflr	r11
-	cfi_register(lr,r11)
-	SETUP_GOT_ACCESS(r9,got_label)
-	addis	r9,r9,.LC0-got_label@ha
-	addi	r9,r9,.LC0-got_label@l
-	mtlr	r11
-	cfi_same_value (lr)
-	lfd	fp9,0(r9)
-	lfs	fp10,8(r9)
-#else
-	lis r9,.LC0@ha
-	lfd fp9,.LC0@l(r9)	/* Load 2^52 into fpr9.  */
-	lfs fp10,.LC0@l+8(r9)	/* Load 0.5 into fpr10.  */
-#endif
-	fabs	fp2,fp1		/* Get the absolute value of x.  */
-	fsub	fp12,fp10,fp10	/* Compute 0.0 into fpr12.  */
-	fcmpu	cr6,fp2,fp10	/* if |x| < 0.5  */
-	fcmpu	cr7,fp2,fp9	/* if |x| >= 2^52  */
-	fcmpu	cr1,fp1,fp12	/* x is negative? x < 0.0  */
-	blt-	cr6,.Lretzero	/* 0.5 > x < -0.5 so just return 0.  */
-	bge-	cr7,.Lnobias	/* 2^52 > x < -2^52 just convert with no bias.  */
-	fadd	fp3,fp2,fp10	/* |x|+=0.5 bias to prepare to round.  */
-	bge	cr1,.Lconvert	/* x is positive so don't negate x.  */
-	fnabs	fp3,fp3		/* -(|x|+=0.5)  */
-.Lconvert:
-	fctidz	fp4,fp3		/* Convert to Integer double word round toward 0.  */
-	stfd	fp4,8(r1)
-	nop
-	nop
-	nop
-	lwz	r4,12(r1)	/* Load return as integer.  */
-	lwz	r3,8(r1)
-.Lout:
-	addi	r1,r1,16
-	blr
-.Lretzero:			/* 0.5 > x > -0.5  */
-	li	r3,0		/* return 0.  */
-	li	r4,0
-	b	.Lout
-.Lnobias:
-	fmr	fp3,fp1
-	b	.Lconvert
-	END (__llround)
-
-weak_alias (__llround, llround)
-
-strong_alias (__llround, __llroundf)
-weak_alias (__llround, llroundf)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__llround, llroundl)
-strong_alias (__llround, __llroundl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llround, llroundl, GLIBC_2_1)
-#endif
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/s_llroundf.S b/sysdeps/powerpc/powerpc32/power4/fpu/s_llroundf.S
deleted file mode 100644
index 72d6181..0000000
--- a/sysdeps/powerpc/powerpc32/power4/fpu/s_llroundf.S
+++ /dev/null
@@ -1 +0,0 @@
-/* __llroundf is in s_llround.S */
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S b/sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S
deleted file mode 100644
index ecd37c3..0000000
--- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S
+++ /dev/null
@@ -1,59 +0,0 @@
-/* lround function.  POWER5+, PowerPC32 version.
-   Copyright (C) 2006-2013 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
-
-/* long [r3] llround (float x [fp1])
-   IEEE 1003.1 lround function.  IEEE specifies "round to the nearest
-   integer value, rounding halfway cases away from zero, regardless of
-   the current rounding mode."  However PowerPC Architecture defines
-   "round to Nearest" as "Choose the best approximation. In case of a
-   tie, choose the one that is even (least significant bit o).".
-   So we pre-round using the V2.02 Floating Round to Integer Nearest
-   instruction before we use the Floating Convert to Integer Word with
-   round to zero instruction.  */
-
-	.machine	"power5"
-ENTRY (__llround)
-	stwu    r1,-16(r1)
-	cfi_adjust_cfa_offset (16)
-	frin	fp2,fp1
-	fctidz	fp3,fp2		/* Convert To Integer Word lround toward 0.  */
-	stfd	fp3,8(r1)
-	nop	/* Ensure the following load is in a different dispatch  */
-	nop	/* group to avoid pipe stall on POWER4&5.  */
-	nop
-	lwz	r4,12(r1)
-	lwz	r3,8(r1)
-	addi	r1,r1,16
-	blr
-	END (__llround)
-
-weak_alias (__llround, llround)
-
-strong_alias (__llround, __llroundf)
-weak_alias (__llround, llroundf)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__llround, llroundl)
-strong_alias (__llround, __llroundl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llround, llroundl, GLIBC_2_1)
-#endif
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_llroundf.S b/sysdeps/powerpc/powerpc32/power5+/fpu/s_llroundf.S
deleted file mode 100644
index 030d2fd..0000000
--- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_llroundf.S
+++ /dev/null
@@ -1 +0,0 @@
-/* __llroundf is in s_llround.S  */
diff --git a/sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S b/sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S
deleted file mode 100644
index 0ff04cb..0000000
--- a/sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S
+++ /dev/null
@@ -1,59 +0,0 @@
-/* lround function.  POWER5+, PowerPC32 version.
-   Copyright (C) 2006-2013 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
-
-/* long [r3] llround (float x [fp1])
-   IEEE 1003.1 lround function.  IEEE specifies "round to the nearest
-   integer value, rounding halfway cases away from zero, regardless of
-   the current rounding mode."  However PowerPC Architecture defines
-   "round to Nearest" as "Choose the best approximation. In case of a
-   tie, choose the one that is even (least significant bit o).".
-   So we pre-round using the V2.02 Floating Round to Integer Nearest
-   instruction before we use the Floating Convert to Integer Word with
-   round to zero instruction.  */
-
-	.machine	"power5"
-ENTRY (__llround)
-	stwu    r1,-16(r1)
-	cfi_adjust_cfa_offset (16)
-	frin	fp2,fp1
-	fctidz	fp3,fp2		/* Convert To Integer Word lround toward 0.  */
-	stfd	fp3,8(r1)
-/* Insure the following load is in a different dispatch group by
-   inserting "group ending nop".  */
-	ori	r1,r1,0
-	lwz	r4,12(r1)
-	lwz	r3,8(r1)
-	addi	r1,r1,16
-	blr
-	END (__llround)
-
-weak_alias (__llround, llround)
-
-strong_alias (__llround, __llroundf)
-weak_alias (__llround, llroundf)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__llround, llroundl)
-strong_alias (__llround, __llroundl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llround, llroundl, GLIBC_2_1)
-#endif
diff --git a/sysdeps/powerpc/powerpc32/power6/fpu/s_llroundf.S b/sysdeps/powerpc/powerpc32/power6/fpu/s_llroundf.S
deleted file mode 100644
index 030d2fd..0000000
--- a/sysdeps/powerpc/powerpc32/power6/fpu/s_llroundf.S
+++ /dev/null
@@ -1 +0,0 @@
-/* __llroundf is in s_llround.S  */
-- 
1.7.1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]