about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAdhemerval Zanella <azanella@linux.vnet.ibm.com>2013-04-15 14:42:34 -0500
committerAdhemerval Zanella <azanella@linux.vnet.ibm.com>2013-04-16 08:53:57 -0500
commit8117c9baecf35c4bc44f56638c9e9e94c20f169c (patch)
tree069f1f250618c79ee068b56b505c92d02685330f
parent462bf827feb84f9d66651aa2e976a5bfb2e00e1a (diff)
downloadglibc-8117c9baecf35c4bc44f56638c9e9e94c20f169c.tar.gz
glibc-8117c9baecf35c4bc44f56638c9e9e94c20f169c.tar.xz
glibc-8117c9baecf35c4bc44f56638c9e9e94c20f169c.zip
PowerPC: finite/finitef multilib for PowerPC32
-rw-r--r--sysdeps/ieee754/dbl-64/s_finite.c1
-rw-r--r--sysdeps/ieee754/flt-32/s_finitef.c1
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile9
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/multiarch/s_finite-c.c13
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/multiarch/s_finite-power7.S (renamed from sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S)33
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/multiarch/s_finite.c51
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/multiarch/s_finitef-c.c11
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/multiarch/s_finitef.c32
-rw-r--r--sysdeps/powerpc/powerpc32/power7/fpu/s_finitef.S1
9 files changed, 117 insertions, 35 deletions
diff --git a/sysdeps/ieee754/dbl-64/s_finite.c b/sysdeps/ieee754/dbl-64/s_finite.c
index 47dad5df2c..b7fe951103 100644
--- a/sysdeps/ieee754/dbl-64/s_finite.c
+++ b/sysdeps/ieee754/dbl-64/s_finite.c
@@ -22,7 +22,6 @@ static char rcsid[] = "$NetBSD: s_finite.c,v 1.8 1995/05/10 20:47:17 jtc Exp $";
 #include <math.h>
 #include <math_private.h>
 
-#undef __finite
 int __finite(double x)
 {
 	int32_t hx;
diff --git a/sysdeps/ieee754/flt-32/s_finitef.c b/sysdeps/ieee754/flt-32/s_finitef.c
index dfdf4ad0b7..b7c7638e01 100644
--- a/sysdeps/ieee754/flt-32/s_finitef.c
+++ b/sysdeps/ieee754/flt-32/s_finitef.c
@@ -25,7 +25,6 @@ static char rcsid[] = "$NetBSD: s_finitef.c,v 1.4 1995/05/10 20:47:18 jtc Exp $"
 #include <math.h>
 #include <math_private.h>
 
-#undef __finitef
 int __finitef(float x)
 {
 	int32_t ix;
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
index 59ccf4fae1..5ac842f1f5 100644
--- a/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
@@ -3,7 +3,9 @@ sysdep_routines += s_isnan-power7 s_isnan-power6 s_isnan-power5 \
 		   s_isnan-ppc32 \
 		   s_isnanf-power7 s_isnanf-power6 s_isnanf-power5 \
 		   s_isnanf-ppc32 \
-		   s_copysign-power6 s_copysign-ppc32
+		   s_copysign-power6 s_copysign-ppc32 \
+		   s_finite-power7 s_finite-c \
+		   s_finitef-c
 
 libm-sysdep_routines += s_llrintf-power6 s_llrintf-power4 s_llrintf-c \
 			s_llrint-power6 s_llrint-power4 s_llrint-c \
@@ -25,7 +27,10 @@ libm-sysdep_routines += s_llrintf-power6 s_llrintf-power4 s_llrintf-c \
 			s_trunc-power5+ s_trunc-ppc32 \
 			s_truncf-power5+ s_truncf-ppc32 \
 			s_lround-power6x s_lround-power5+ s_lround-ppc32 \
-			s_lrint-power6x s_lrint-ppc32
+			s_lrint-power6x s_lrint-ppc32 \
+			s_finite-power7 s_finite-c \
+			s_finitef-c
 
 CFLAGS-s_llround.c = -fno-builtin-llroundf
+CFLAGS-s_lround.c = -fno-builtin-lroundf
 endif
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_finite-c.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_finite-c.c
new file mode 100644
index 0000000000..a4f4cba999
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_finite-c.c
@@ -0,0 +1,13 @@
+#include <math.h>
+
+#undef weak_alias
+#define weak_alias(a, b)
+#undef strong_alias
+#define strong_alias(a, b)
+
+#define __finite __finite_ppc32
+#undef hidden_def
+#define hidden_def(a) \
+  __hidden_ver1 (__finite_ppc32, __GI___finite, __finite_ppc32);
+
+#include <sysdeps/ieee754/dbl-64/s_finite.c>
diff --git a/sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_finite-power7.S
index b2ab5bfe7b..c9bebd6a7d 100644
--- a/sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_finite-power7.S
@@ -29,7 +29,7 @@
 	.section    ".text"
 	.type	    __finite, @function
 	.machine    power7
-ENTRY (__finite)
+ENTRY (__finite_power7)
 #ifdef SHARED
 	mflr	r11
 	cfi_register(lr,r11)
@@ -63,32 +63,5 @@ ENTRY (__finite)
 	bltlr	cr7	      /* LT means we have a denormal.  */
 	li	r3,0
 	blr
-	END (__finite)
-
-hidden_def (__finite)
-weak_alias (__finite, finite)
-
-/* It turns out that the 'double' version will also always work for
-   single-precision.  */
-strong_alias (__finite, __finitef)
-hidden_def (__finitef)
-weak_alias (__finitef, finitef)
-
-#ifdef NO_LONG_DOUBLE
-strong_alias (__finite, __finitel)
-weak_alias (__finite, finitel)
-#endif
-
-#ifdef IS_IN_libm
-# if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)
-compat_symbol (libm, finite, finitel, GLIBC_2_0)
-# endif
-# if LONG_DOUBLE_COMPAT (libm, GLIBC_2_1)
-compat_symbol (libm, __finite, __finitel, GLIBC_2_1)
-# endif
-#else
-# if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
-compat_symbol (libc, __finite, __finitel, GLIBC_2_0);
-compat_symbol (libc, finite, finitel, GLIBC_2_0);
-# endif
-#endif
+END (__finite_power7)
+weak_alias (__finite_power7, __finitef_power7)
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_finite.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_finite.c
new file mode 100644
index 0000000000..3a4795fa5c
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_finite.c
@@ -0,0 +1,51 @@
+/* Multiple versions of s_finite.
+   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 (__finite) __finite_ppc32 attribute_hidden;
+extern __typeof (__finite) __finite_power7 attribute_hidden;
+
+libc_ifunc (__finite,
+	    (hwcap & PPC_FEATURE_ARCH_2_06)
+	    ? __finite_power7
+            : __finite_ppc32);
+
+weak_alias (__finite, finite)
+
+#ifdef NO_LONG_DOUBLE
+strong_alias (__finite, __finitel)
+weak_alias (__finite, finitel)
+#endif
+
+#ifdef IS_IN_libm
+# if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)
+compat_symbol (libm, finite, finitel, GLIBC_2_0);
+# endif
+# if LONG_DOUBLE_COMPAT (libm, GLIBC_2_1)
+compat_symbol (libm, __finite, __finitel, GLIBC_2_1);
+# endif
+#else
+# if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
+compat_symbol (libc, __finite, __finitel, GLIBC_2_0);
+compat_symbol (libc, finite, finitel, GLIBC_2_0);
+# endif
+#endif
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_finitef-c.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_finitef-c.c
new file mode 100644
index 0000000000..5d05d14b8c
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_finitef-c.c
@@ -0,0 +1,11 @@
+#include <math.h>
+
+#undef weak_alias
+#define weak_alias(a, b)
+
+#define __finitef __finitef_ppc32
+#undef hidden_def
+#define hidden_def(a) \
+  __hidden_ver1 (__finitef_ppc32, __GI___finitef, __finitef_ppc32);
+
+#include <sysdeps/ieee754/flt-32/s_finitef.c>
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_finitef.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_finitef.c
new file mode 100644
index 0000000000..39397c44a4
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_finitef.c
@@ -0,0 +1,32 @@
+/* Multiple versions of s_finite.
+   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 (__finitef) __finitef_ppc32 attribute_hidden;
+extern __typeof (__finitef) __finitef_power7 attribute_hidden;
+
+libc_ifunc (__finitef,
+	    (hwcap & PPC_FEATURE_ARCH_2_06)
+	    ? __finitef_power7
+            : __finitef_ppc32);
+
+weak_alias (__finitef, finitef)
diff --git a/sysdeps/powerpc/powerpc32/power7/fpu/s_finitef.S b/sysdeps/powerpc/powerpc32/power7/fpu/s_finitef.S
deleted file mode 100644
index 54bd94176d..0000000000
--- a/sysdeps/powerpc/powerpc32/power7/fpu/s_finitef.S
+++ /dev/null
@@ -1 +0,0 @@
-/* This function uses the same code as s_finite.S.  */