]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
PowerPC: isnan/isnanf multilib for PowerPC32
authorAdhemerval Zanella <azanella@linux.vnet.ibm.com>
Thu, 11 Apr 2013 22:20:44 +0000 (17:20 -0500)
committerAdhemerval Zanella <azanella@linux.vnet.ibm.com>
Fri, 12 Apr 2013 12:23:33 +0000 (07:23 -0500)
13 files changed:
sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnan-power5.S [moved from sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S with 79% similarity]
sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnan-power6.S [moved from sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S with 79% similarity]
sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnan-power7.S [moved from sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S with 84% similarity]
sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnan-ppc32.S [new file with mode: 0644]
sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnan.c [new file with mode: 0644]
sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnanf-power5.S [moved from sysdeps/powerpc/powerpc32/power5/fpu/s_isnanf.S with 93% similarity]
sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnanf-power6.S [moved from sysdeps/powerpc/powerpc32/power6/fpu/s_isnanf.S with 93% similarity]
sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnanf-power7.S [new file with mode: 0644]
sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnanf-ppc32.S [new file with mode: 0644]
sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnanf.c [new file with mode: 0644]
sysdeps/powerpc/powerpc32/fpu/s_isnan.S
sysdeps/powerpc/powerpc32/power7/fpu/s_isnanf.S [deleted file]

index 1eae5b31c95cac239325f521c1799f6ecd26b369..c9003e36a6da57ac8e43888a776a7de05d98f914 100644 (file)
@@ -1,10 +1,19 @@
 ifeq ($(subdir),math)
+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
+
 libm-sysdep_routines += s_llrintf-power6 s_llrintf-power4 s_llrintf-c \
                        s_llrint-power6 s_llrint-power4 s_llrint-c \
                        s_llround-power6 s_llround-power5+ s_llround-power4 \
                        s_llround-c \
                        w_sqrt-power5 w_sqrt-power4 w_sqrt-c \
-                       w_sqrtf-power5 w_sqrtf-power4 w_sqrtf-c
+                       w_sqrtf-power5 w_sqrtf-power4 w_sqrtf-c \
+                       s_isnan-power7 s_isnan-power6 s_isnan-power5 \
+                       s_isnan-ppc32 \
+                       s_isnanf-power7 s_isnanf-power6 s_isnanf-power5 \
+                       s_isnanf-ppc32
 
 CFLAGS-s_llround.c = -fno-builtin-llroundf
 endif
similarity index 79%
rename from sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S
rename to sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnan-power5.S
index f2417fdf41d6565b4a7fe399068dc55af281e582..a42eaf216d5ef1ddacca8578e8c54db6a50be9de 100644 (file)
@@ -21,7 +21,7 @@
 
 /* int __isnan(x)  */
        .machine power5
-EALIGN (__isnan, 4, 0)
+EALIGN (__isnan_power5, 4, 0)
        stwu    r1,-32(r1)
        cfi_adjust_cfa_offset (32)
        ori     r1,r1,0
@@ -42,20 +42,4 @@ EALIGN (__isnan, 4, 0)
 L(NaN):
        li      r3,1            /* else return 1 */
        blr
-       END (__isnan)
-
-hidden_def (__isnan)
-weak_alias (__isnan, isnan)
-
-#ifdef NO_LONG_DOUBLE
-strong_alias (__isnan, __isnanl)
-weak_alias (__isnan, isnanl)
-#endif
-
-#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
-
+END (__isnan_power5)
similarity index 79%
rename from sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S
rename to sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnan-power6.S
index 2c095db1d4f3497842a726f9f084be5db8726ff5..62f9c4b2a718c48f5e84211c7bee8f6703473890 100644 (file)
@@ -21,7 +21,7 @@
 
 /* int __isnan(x)  */
        .machine power6
-EALIGN (__isnan, 4, 0)
+EALIGN (__isnan_power6, 4, 0)
        stwu    r1,-32(r1)
        cfi_adjust_cfa_offset (32)
        ori     r1,r1,0
@@ -42,20 +42,4 @@ EALIGN (__isnan, 4, 0)
 L(NaN):
        li      r3,1            /* else return 1 */
        blr
-       END (__isnan)
-
-hidden_def (__isnan)
-weak_alias (__isnan, isnan)
-
-#ifdef NO_LONG_DOUBLE
-strong_alias (__isnan, __isnanl)
-weak_alias (__isnan, isnanl)
-#endif
-
-#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
-
+END (__isnan_power6)
similarity index 84%
rename from sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S
rename to sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnan-power7.S
index 99ff1269610c9174632c72f6d119c7a783440573..54cc998d6cdd8b44ca68c11015c7b11eda48c322 100644 (file)
@@ -29,7 +29,7 @@
        .section    ".text"
        .type       __isnan, @function
        .machine    power7
-ENTRY (__isnan)
+ENTRY (__isnan_power7)
 #ifdef SHARED
        mflr    r11
        cfi_register(lr,r11)
@@ -66,25 +66,10 @@ ENTRY (__isnan)
 L(NaN):
        li      r3,1          /* x == NaN?  */
        blr
-       END (__isnan)
-
-hidden_def (__isnan)
-weak_alias (__isnan, isnan)
+END (__isnan_power7)
 
 /* It turns out that the 'double' version will also always work for
    single-precision.  */
-strong_alias (__isnan, __isnanf)
-hidden_def (__isnanf)
-weak_alias (__isnanf, isnanf)
-
-#ifdef NO_LONG_DOUBLE
-strong_alias (__isnan, __isnanl)
-weak_alias (__isnan, isnanl)
-#endif
-
-#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
+strong_alias (__isnan_power7, __isnanf_power7)
+hidden_def (__isnanf_power7)
+weak_alias (__isnanf_power7, isnanf_power7)
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnan-ppc32.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnan-ppc32.S
new file mode 100644 (file)
index 0000000..f844d10
--- /dev/null
@@ -0,0 +1,9 @@
+#include <sysdep.h>
+#include <math_ldbl_opt.h>
+
+#define __isnan __isnan_ppc32
+#undef hidden_def
+#define hidden_def(name)
+  strong_alias (__isnan_ppc32, __GI___isnan)
+
+#include <sysdeps/powerpc/powerpc32/fpu/s_isnan.S>
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnan.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnan.c
new file mode 100644 (file)
index 0000000..aea0031
--- /dev/null
@@ -0,0 +1,46 @@
+/* Multiple versions of s_isnan.
+   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 (__isnan) __isnan_ppc32 attribute_hidden;
+extern __typeof (__isnan) __isnan_power5 attribute_hidden;
+extern __typeof (__isnan) __isnan_power6 attribute_hidden;
+extern __typeof (__isnan) __isnan_power7 attribute_hidden;
+
+libc_ifunc (__isnan,
+           (hwcap & PPC_FEATURE_ARCH_2_06)
+           ? __isnan_power7 :
+             (hwcap & PPC_FEATURE_ARCH_2_05)
+             ? __isnan_power6 :
+               (hwcap & PPC_FEATURE_POWER5)
+               ? __isnan_power5
+            : __isnan_ppc32);
+
+weak_alias (__isnan, isnan)
+
+#ifdef NO_LONG_DOUBLE
+strong_alias (__isnan, __isnanl)
+weak_alias (__isnan, isnanl)
+#endif
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __isnan, isnanl, GLIBC_2_1);
+#endif
similarity index 93%
rename from sysdeps/powerpc/powerpc32/power5/fpu/s_isnanf.S
rename to sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnanf-power5.S
index 0373f0156c494630bd88fd17b06723727aa38f04..cfdae7d4d1d6746e29c2b6e07f3bff49cb7a6936 100644 (file)
@@ -21,7 +21,7 @@
 
 /* int __isnanf(x)  */
        .machine power5
-EALIGN (__isnanf, 4, 0)
+EALIGN (__isnanf_power5, 4, 0)
        stwu    r1,-32(r1)
        cfi_adjust_cfa_offset (32)
        stfs    fp1,28(r1)      /* copy FPR to GPR */
@@ -38,8 +38,4 @@ EALIGN (__isnanf, 4, 0)
 L(NaN):
        li      r3,1            /* else return 1 */
        blr
-       END (__isnanf)
-
-hidden_def (__isnanf)
-weak_alias (__isnanf, isnanf)
-
+END (__isnanf_power5)
similarity index 93%
rename from sysdeps/powerpc/powerpc32/power6/fpu/s_isnanf.S
rename to sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnanf-power6.S
index 483f0f9c0f15cd58bd0b95ec9e2d13afdfb19794..0890b350b066d0716d7d5eee36e33cdaff7f0321 100644 (file)
@@ -21,7 +21,7 @@
 
 /* int __isnanf(x)  */
        .machine power6
-EALIGN (__isnanf, 4, 0)
+EALIGN (__isnanf_power6, 4, 0)
        stwu    r1,-32(r1)
        cfi_adjust_cfa_offset (32)
        ori     r1,r1,0
@@ -38,7 +38,4 @@ EALIGN (__isnanf, 4, 0)
 L(NaN):
        li      r3,1            /* else return 1 */
        blr
-       END (__isnanf)
-
-hidden_def (__isnanf)
-weak_alias (__isnanf, isnanf)
+END (__isnanf_power6)
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnanf-power7.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnanf-power7.S
new file mode 100644 (file)
index 0000000..3fa2145
--- /dev/null
@@ -0,0 +1 @@
+/* This function uses the same code as s_isnan-power7.S.  */
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnanf-ppc32.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnanf-ppc32.S
new file mode 100644 (file)
index 0000000..d0db5cc
--- /dev/null
@@ -0,0 +1,14 @@
+#include <sysdep.h>
+#include <math_ldbl_opt.h>
+
+#undef weak_alias
+#define weak_alias(a, b)
+#undef compat_symbol
+#define compat_symbol(a, b, c, d)
+
+#define __isnan __isnanf_ppc32
+#undef hidden_def
+#define hidden_def(name) \
+  strong_alias (__isnanf_ppc32, __GI___isnanf)
+
+#include <sysdeps/powerpc/powerpc32/fpu/s_isnan.S>
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnanf.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnanf.c
new file mode 100644 (file)
index 0000000..21bca8d
--- /dev/null
@@ -0,0 +1,37 @@
+/* Multiple versions of s_isnanf.
+   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 <shlib-compat.h>
+#include "init-arch.h"
+
+extern __typeof (__isnanf) __isnanf_ppc32 attribute_hidden;
+extern __typeof (__isnanf) __isnanf_power5 attribute_hidden;
+extern __typeof (__isnanf) __isnanf_power6 attribute_hidden;
+extern __typeof (__isnanf) __isnanf_power7 attribute_hidden;
+
+libc_ifunc (__isnanf,
+           (hwcap & PPC_FEATURE_ARCH_2_06)
+           ? __isnanf_power7 :
+             (hwcap & PPC_FEATURE_ARCH_2_05)
+             ? __isnanf_power6 :
+               (hwcap & PPC_FEATURE_POWER5)
+               ? __isnanf_power5
+            : __isnanf_ppc32);
+
+weak_alias (__isnanf, isnanf)
index ac8b08856fd8569c8cbad89ba70999dbcbff54c5..5a78b51acd346daeed9e7e69293aa924029a8139 100644 (file)
@@ -37,9 +37,11 @@ weak_alias (__isnan, isnan)
 
 /* It turns out that the 'double' version will also always work for
    single-precision.  */
+#ifndef __isnan
 strong_alias (__isnan, __isnanf)
 hidden_def (__isnanf)
 weak_alias (__isnanf, isnanf)
+#endif
 
 #ifdef NO_LONG_DOUBLE
 strong_alias (__isnan, __isnanl)
diff --git a/sysdeps/powerpc/powerpc32/power7/fpu/s_isnanf.S b/sysdeps/powerpc/powerpc32/power7/fpu/s_isnanf.S
deleted file mode 100644 (file)
index b48c85e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/* This function uses the same code as s_isnan.S.  */