]> sourceware.org Git - glibc.git/commitdiff
PowerPC: multiarch isnan/isnanf for PowerPC32
authorAdhemerval Zanella <azanella@linux.vnet.ibm.com>
Mon, 14 Oct 2013 18:28:13 +0000 (13:28 -0500)
committerAdhemerval Zanella <azanella@linux.vnet.ibm.com>
Fri, 6 Dec 2013 11:47:03 +0000 (05:47 -0600)
ChangeLog
sysdeps/powerpc/powerpc32/fpu/s_isnan.S
sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile
sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power5.S [new file with mode: 0644]
sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power6.S [new file with mode: 0644]
sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power7.S [new file with mode: 0644]
sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-ppc32.S [new file with mode: 0644]
sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan.c [new file with mode: 0644]
sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf-power5.S [new file with mode: 0644]
sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf-power6.S [new file with mode: 0644]
sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf.c [new file with mode: 0644]

index 3955aeb7168849ea97e4fdf4e296c207246df2de..01e895dad4fb6b6def36c2172a41a83a8240ba00 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
+2013-12-06  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
+
+       * sysdeps/powerpc/powerpc32/fpu/s_isnan.S (__isnan): Only implement
+       alias when __isnan is defined.
+       * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile: Add isnan
+       and isnanf multiarch implementations.
+       * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power5.S: New
+       file.
+       * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power6.S: New
+       file.
+       * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power7.S: New
+       file.
+       * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-ppc32.S: New
+       file.
+       * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan.c: New file:
+       multiarch isnan for PowerPC32.
+       * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf-power6.S:
+       New file.
+       * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf-power7.S:
+       New file.
+       * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf.c: New file:
+       multiarch isnanf for PowerPC32.
+
 2013-12-06  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
 
        * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile: Add sqrt
index 98d10daf6814c2db66629ff3eb8794215939c677..024252a5cad6e8f2acdfe60b17745f2bdb03d1a8 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)
index 842a34a18cc4d9e4ffca76d60b672ed5d7c0b517..dabde79bd840a13f4c4db15a66c06385b3416932 100644 (file)
@@ -1,6 +1,11 @@
 ifeq ($(subdir),math)
+sysdep_routines += s_isnan-power7 s_isnan-power6 s_isnan-power5 s_isnan-ppc32 \
+                  s_isnanf-power6 s_isnanf-power5
+
 libm-sysdep_routines += s_llrintf-power6 s_llrintf-ppc32 s_llrint-power6 \
                        s_llrint-ppc32 s_llround-power6 s_llround-power5+ \
                        s_llround-ppc32 w_sqrt-power5 w_sqrt-ppc32 \
-                       w_sqrtf-power5 w_sqrtf-ppc32
+                       w_sqrtf-power5 w_sqrtf-ppc32 s_isnan-power7 \
+                       s_isnan-power6 s_isnan-power5 s_isnan-ppc32 \
+                       s_isnanf-power6 s_isnanf-power5
 endif
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power5.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power5.S
new file mode 100644 (file)
index 0000000..206b3ce
--- /dev/null
@@ -0,0 +1,33 @@
+/* isnan().  PowerPC32/POWER5 version.
+   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 <sysdep.h>
+#include <math_ldbl_opt.h>
+
+#undef hidden_def
+#define hidden_def(name)
+#undef weak_alias
+#define weak_alias(name, alias)
+#undef strong_alias
+#define strong_alias(name, alias)
+#undef compat_symbol
+#define compat_symbol(lib, name, symbol, ver)
+
+#define __isnan __isnan_power5
+
+#include <sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S>
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power6.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power6.S
new file mode 100644 (file)
index 0000000..0c87918
--- /dev/null
@@ -0,0 +1,33 @@
+/* isnan().  PowerPC32/POWER6 version.
+   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 <sysdep.h>
+#include <math_ldbl_opt.h>
+
+#undef hidden_def
+#define hidden_def(name)
+#undef weak_alias
+#define weak_alias(name, alias)
+#undef strong_alias
+#define strong_alias(name, alias)
+#undef compat_symbol
+#define compat_symbol(lib, name, symbol, ver)
+
+#define __isnan __isnan_power6
+
+#include <sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S>
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power7.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power7.S
new file mode 100644 (file)
index 0000000..b82ab7f
--- /dev/null
@@ -0,0 +1,33 @@
+/* isnan().  PowerPC32/POWER7 version.
+   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 <sysdep.h>
+#include <math_ldbl_opt.h>
+
+#undef hidden_def
+#define hidden_def(name)
+#undef weak_alias
+#define weak_alias(name, alias)
+#undef strong_alias
+#define strong_alias(name, alias)
+#undef compat_symbol
+#define compat_symbol(lib, name, symbol, ver)
+
+#define __isnan __isnan_power7
+
+#include <sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S>
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-ppc32.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-ppc32.S
new file mode 100644 (file)
index 0000000..db13213
--- /dev/null
@@ -0,0 +1,32 @@
+/* isnan().  PowerPC32 default version.
+   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 <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 __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/power4/fpu/multiarch/s_isnan.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan.c
new file mode 100644 (file)
index 0000000..a45091f
--- /dev/null
@@ -0,0 +1,50 @@
+/* Multiple versions of 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
+
+#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/power4/fpu/multiarch/s_isnanf-power5.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf-power5.S
new file mode 100644 (file)
index 0000000..2483f9e
--- /dev/null
@@ -0,0 +1,28 @@
+/* isnanf().  PowerPC32/POWER5 version.
+   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 <sysdep.h>
+
+#undef hidden_def
+#define hidden_def(name)
+#undef weak_alias
+#define weak_alias(name, alias)
+
+#define __isnanf __isnanf_power5
+
+#include <sysdeps/powerpc/powerpc32/power5/fpu/s_isnanf.S>
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf-power6.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf-power6.S
new file mode 100644 (file)
index 0000000..20d8a0a
--- /dev/null
@@ -0,0 +1,28 @@
+/* isnanf().  PowerPC32/POWER6 version.
+   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 <sysdep.h>
+
+#undef hidden_def
+#define hidden_def(name)
+#undef weak_alias
+#define weak_alias(name, alias)
+
+#define __isnanf __isnanf_power6
+
+#include <sysdeps/powerpc/powerpc32/power6/fpu/s_isnanf.S>
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf.c
new file mode 100644 (file)
index 0000000..c59b5c9
--- /dev/null
@@ -0,0 +1,38 @@
+/* Multiple versions of 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"
+
+/* Both ppc32 and power7 isnan(double) work for float.  */
+extern __typeof (__isnanf) __isnan_ppc32 attribute_hidden;
+extern __typeof (__isnanf) __isnanf_power5 attribute_hidden;
+extern __typeof (__isnanf) __isnanf_power6 attribute_hidden;
+extern __typeof (__isnanf) __isnan_power7 attribute_hidden;
+
+libc_ifunc (__isnanf,
+           (hwcap & PPC_FEATURE_ARCH_2_06)
+           ? __isnan_power7 :
+             (hwcap & PPC_FEATURE_ARCH_2_05)
+             ? __isnanf_power6 :
+               (hwcap & PPC_FEATURE_POWER5)
+               ? __isnanf_power5
+            : __isnan_ppc32);
+
+weak_alias (__isnanf, isnanf)
This page took 0.123642 seconds and 5 git commands to generate.