This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH 24/36] PowerPC: isnan/isnanf multilib for PowerPC32
- From: Adhemerval Zanella <azanella at linux dot vnet dot ibm dot com>
- To: "GNU C. Library" <libc-alpha at sourceware dot org>
- Date: Mon, 19 Aug 2013 18:28:43 -0300
- Subject: [PATCH 24/36] PowerPC: isnan/isnanf multilib for PowerPC32
- References: <52127ABC dot 40008 at linux dot vnet dot ibm dot com>
2013-08-19 Adhemerval Zanella <azanella@linux.vnet.ibm.com>
* sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S: Move to ...
* sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnan-power5.S: ... here.
(__isnan): Rename symbol to __isnan_power5 and remove strong_alias,
weak_alias and compat_symbol definitions.
* sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S: Move to ...
* sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnan-power6.S: ... here.
(__isnan): Rename symbol to __isnan_power5 and remove strong_alias,
weak_alias and compat_symbol definitions.
* sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S: Move to ...
* sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnan-power5.S: ... here.
(__isnan): Rename symbol to __isnan_power5 and remove strong_alias,
weak_alias and compat_symbol definitions.
* sysdeps/powerpc/powerpc32/power5/fpu/s_isnanf.S: Move to ...
* sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnanf-power5.S: ... here.
(__isnanf): Rename symbol to __isnanf_power5 and remove weak_alias
definition.
* sysdeps/powerpc/powerpc32/power6/fpu/s_isnanf.S: Move to ...
* sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnanf-power6.S: ... here.
(__isnanf): Rename symbol to __isnanf_power5 and remove weak_alias
definition.
* sysdeps/powerpc/powerpc32/power7/fpu/s_isnanf.S: Remove unneeded
file.
* sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnan-ppc32.S: New file:
default isnan implementation for PPC32.
* sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnanf-ppc32.S: New file:
default isnanf implementation for PPC32.
* sysdeps/powerpc/powerpc32/fpu/s_isnan.S: Add define guard to avoid
alias between isnan and isnanf.
* sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnan.c: New file:
multiarch isnan for PPC32.
* sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnanf.c: New file:
multiarch isnanf for PPC32.
* sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile: Add isnan and
isnanf objects.
--
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
index 22e07ce..de2cbda 100644
--- a/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
@@ -1,10 +1,15 @@
ifeq ($(subdir),math)
+sysdep_routines += s_isnan-power7 s_isnan-power6 s_isnan-power5 s_isnan-ppc32 \
+ s_isnanf-power6 s_isnanf-power5 s_isnanf-ppc32
+
libm-sysdep_routines += s_llrintf-power6 s_llrintf-power4 s_llrintf-ppc32 \
s_llrint-power6 s_llrint-power4 s_llrint-ppc32 \
s_llround-power6 s_llround-power5+ s_llround-power4 \
s_llround-ppc32 w_sqrt-power5 w_sqrt-power4 \
w_sqrt-ppc32 w_sqrtf-power5 w_sqrtf-power4 \
- w_sqrtf-ppc32
+ w_sqrtf-ppc32 s_isnan-power7 s_isnan-power6 \
+ s_isnan-power5 s_isnan-ppc32 s_isnanf-power6 \
+ s_isnanf-power5 s_isnanf-ppc32
CFLAGS-s_llround.c = -fno-builtin-llroundf
endif
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnan-power5.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnan-power5.S
new file mode 100644
index 0000000..ba28c4d
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnan-power5.S
@@ -0,0 +1,45 @@
+/* isnan(). PowerPC32/POWER5 version.
+ Copyright (C) 2008-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>
+
+/* int __isnan(x) */
+ .machine power5
+EALIGN (__isnan_power5, 4, 0)
+ stwu r1,-32(r1)
+ cfi_adjust_cfa_offset (32)
+ ori r1,r1,0
+ stfd fp1,24(r1) /* copy FPR to GPR */
+ ori r1,r1,0
+ lwz r4,24(r1)
+ lwz r5,28(r1)
+ lis r0,0x7ff0 /* const long r0 0x7ff00000 00000000 */
+ clrlwi r4,r4,1 /* x = fabs(x) */
+ cmpw cr7,r4,r0 /* if (fabs(x) =< inf) */
+ cmpwi cr6,r5,0
+ li r3,0 /* then return 0 */
+ addi r1,r1,32
+ cfi_adjust_cfa_offset (-32)
+ bltlr+ cr7
+ bgt- cr7,L(NaN)
+ beqlr+ cr6
+L(NaN):
+ li r3,1 /* else return 1 */
+ blr
+END (__isnan_power5)
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnan-power6.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnan-power6.S
new file mode 100644
index 0000000..eebe69f
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnan-power6.S
@@ -0,0 +1,45 @@
+/* isnan(). PowerPC32/POWER6 version.
+ Copyright (C) 2008-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>
+
+/* int __isnan(x) */
+ .machine power6
+EALIGN (__isnan_power6, 4, 0)
+ stwu r1,-32(r1)
+ cfi_adjust_cfa_offset (32)
+ ori r1,r1,0
+ stfd fp1,24(r1) /* copy FPR to GPR */
+ ori r1,r1,0
+ lwz r4,24(r1)
+ lwz r5,28(r1)
+ lis r0,0x7ff0 /* const long r0 0x7ff00000 00000000 */
+ clrlwi r4,r4,1 /* x = fabs(x) */
+ cmpw cr7,r4,r0 /* if (fabs(x) =< inf) */
+ cmpwi cr6,r5,0
+ li r3,0 /* then return 0 */
+ addi r1,r1,32
+ cfi_adjust_cfa_offset (-32)
+ bltlr+ cr7
+ bgt- cr7,L(NaN)
+ beqlr+ cr6
+L(NaN):
+ li r3,1 /* else return 1 */
+ blr
+END (__isnan_power6)
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnan-power7.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnan-power7.S
new file mode 100644
index 0000000..54cc998
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnan-power7.S
@@ -0,0 +1,75 @@
+/* isnan(). PowerPC32/POWER7 version.
+ Copyright (C) 2010-2013 Free Software Foundation, Inc.
+ Contributed by Luis Machado <luisgpm@br.ibm.com>.
+ 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>
+
+/* int __isnan(x) */
+ .section .rodata.cst8,"aM",@progbits,8
+ .align 3
+.LC0: /* 1.0 */
+ .quad 0x3ff0000000000000
+
+ .section ".text"
+ .type __isnan, @function
+ .machine power7
+ENTRY (__isnan_power7)
+#ifdef SHARED
+ mflr r11
+ cfi_register(lr,r11)
+
+ SETUP_GOT_ACCESS(r9,got_label)
+ addis r9,r9,.LC0-got_label@ha
+ lfd fp0,.LC0-got_label@l(r9)
+
+ mtlr r11
+ cfi_same_value (lr)
+#else
+ lis r9,.LC0@ha
+ lfd fp0,.LC0@l(r9)
+#endif
+ ftdiv cr7,fp1,fp0
+ li r3,0
+ bflr 30 /* If not NaN or Inf, finish. */
+
+ /* We have -INF/+INF/NaN or a denormal. */
+
+ stwu r1,-16(r1) /* Allocate stack space. */
+ stfd fp1,8(r1) /* Transfer FP to GPR's. */
+ ori 2,2,0 /* Force a new dispatch group. */
+ lwz r4,8(r1) /* Load the upper half of the FP value. */
+ lwz r5,12(r1) /* Load the lower half of the FP value. */
+ addi r1,r1,16 /* Reset the stack pointer. */
+ lis r0,0x7ff0 /* Load the upper portion for an INF/NaN. */
+ clrlwi r4,r4,1 /* r4 = abs(r4). */
+ cmpw cr7,r4,r0 /* if (abs(r4) <= inf). */
+ cmpwi cr6,r5,0 /* r5 == 0x00000000? */
+ bltlr cr7 /* LT means we have a denormal. */
+ bgt cr7,L(NaN) /* GT means we have a NaN. */
+ beqlr cr6 /* EQ means we have +/-INF. */
+L(NaN):
+ li r3,1 /* x == NaN? */
+ blr
+END (__isnan_power7)
+
+/* It turns out that the 'double' version will also always work for
+ single-precision. */
+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
index 0000000..774f99c
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnan-ppc32.S
@@ -0,0 +1,28 @@
+/* isnan(). PowerPC32 default version.
+ Copyright (C) 2013 Free Software Foundation, Inc.
+ Contributed by Luis Machado <luisgpm@br.ibm.com>.
+ 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>
+
+#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
index 0000000..a45091f
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnan.c
@@ -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/fpu/multiarch/s_isnanf-power5.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnanf-power5.S
new file mode 100644
index 0000000..640f992
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnanf-power5.S
@@ -0,0 +1,41 @@
+/* isnanf(). PowerPC32/POWER5 version.
+ Copyright (C) 2008-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>
+
+/* int __isnanf(x) */
+ .machine power5
+EALIGN (__isnanf_power5, 4, 0)
+ stwu r1,-32(r1)
+ cfi_adjust_cfa_offset (32)
+ stfs fp1,28(r1) /* copy FPR to GPR */
+ nop
+ nop
+ lwz r4,28(r1)
+ lis r0,0x7f80 /* const long r0 0x7f800000 */
+ clrlwi r4,r4,1 /* x = fabs(x) */
+ cmpw cr7,r4,r0 /* if (fabs(x) =< inf) */
+ li r3,0 /* then return 0 */
+ addi r1,r1,32
+ cfi_adjust_cfa_offset (-32)
+ blelr+ cr7
+L(NaN):
+ li r3,1 /* else return 1 */
+ blr
+END (__isnanf_power5)
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnanf-power6.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnanf-power6.S
new file mode 100644
index 0000000..4345c5a
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnanf-power6.S
@@ -0,0 +1,41 @@
+/* isnanf(). PowerPC32/POWER6 version.
+ Copyright (C) 2008-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>
+
+/* int __isnanf(x) */
+ .machine power6
+EALIGN (__isnanf_power6, 4, 0)
+ stwu r1,-32(r1)
+ cfi_adjust_cfa_offset (32)
+ ori r1,r1,0
+ stfs fp1,24(r1) /* copy FPR to GPR */
+ ori r1,r1,0
+ lwz r4,24(r1)
+ lis r0,0x7f80 /* const long r0 0x7f800000 */
+ clrlwi r4,r4,1 /* x = fabs(x) */
+ cmpw cr7,r4,r0 /* if (fabs(x) =< inf) */
+ li r3,0 /* then return 0 */
+ addi r1,r1,32
+ cfi_adjust_cfa_offset (-32)
+ blelr+ cr7
+L(NaN):
+ li r3,1 /* else return 1 */
+ blr
+END (__isnanf_power6)
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
index 0000000..e1fd2f3
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnanf-ppc32.S
@@ -0,0 +1,32 @@
+/* Default isnanf implementation for PowerPC32.
+ Copyright (C) 2008-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 __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
index 0000000..5647841
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnanf.c
@@ -0,0 +1,37 @@
+/* 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"
+
+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)
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_isnan.S b/sysdeps/powerpc/powerpc32/fpu/s_isnan.S
index 98d10da..024252a 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_isnan.S
@@ -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/power5/fpu/s_isnan.S b/sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S
deleted file mode 100644
index f2417fd..0000000
--- a/sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S
+++ /dev/null
@@ -1,61 +0,0 @@
-/* isnan(). PowerPC32 version.
- Copyright (C) 2008-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>
-
-/* int __isnan(x) */
- .machine power5
-EALIGN (__isnan, 4, 0)
- stwu r1,-32(r1)
- cfi_adjust_cfa_offset (32)
- ori r1,r1,0
- stfd fp1,24(r1) /* copy FPR to GPR */
- ori r1,r1,0
- lwz r4,24(r1)
- lwz r5,28(r1)
- lis r0,0x7ff0 /* const long r0 0x7ff00000 00000000 */
- clrlwi r4,r4,1 /* x = fabs(x) */
- cmpw cr7,r4,r0 /* if (fabs(x) =< inf) */
- cmpwi cr6,r5,0
- li r3,0 /* then return 0 */
- addi r1,r1,32
- cfi_adjust_cfa_offset (-32)
- bltlr+ cr7
- bgt- cr7,L(NaN)
- beqlr+ cr6
-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
-
diff --git a/sysdeps/powerpc/powerpc32/power5/fpu/s_isnanf.S b/sysdeps/powerpc/powerpc32/power5/fpu/s_isnanf.S
deleted file mode 100644
index 0373f01..0000000
--- a/sysdeps/powerpc/powerpc32/power5/fpu/s_isnanf.S
+++ /dev/null
@@ -1,45 +0,0 @@
-/* isnan(). PowerPC32 version.
- Copyright (C) 2008-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>
-
-/* int __isnanf(x) */
- .machine power5
-EALIGN (__isnanf, 4, 0)
- stwu r1,-32(r1)
- cfi_adjust_cfa_offset (32)
- stfs fp1,28(r1) /* copy FPR to GPR */
- nop
- nop
- lwz r4,28(r1)
- lis r0,0x7f80 /* const long r0 0x7f800000 */
- clrlwi r4,r4,1 /* x = fabs(x) */
- cmpw cr7,r4,r0 /* if (fabs(x) =< inf) */
- li r3,0 /* then return 0 */
- addi r1,r1,32
- cfi_adjust_cfa_offset (-32)
- blelr+ cr7
-L(NaN):
- li r3,1 /* else return 1 */
- blr
- END (__isnanf)
-
-hidden_def (__isnanf)
-weak_alias (__isnanf, isnanf)
-
diff --git a/sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S b/sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S
deleted file mode 100644
index 2c095db..0000000
--- a/sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S
+++ /dev/null
@@ -1,61 +0,0 @@
-/* isnan(). PowerPC32 version.
- Copyright (C) 2008-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>
-
-/* int __isnan(x) */
- .machine power6
-EALIGN (__isnan, 4, 0)
- stwu r1,-32(r1)
- cfi_adjust_cfa_offset (32)
- ori r1,r1,0
- stfd fp1,24(r1) /* copy FPR to GPR */
- ori r1,r1,0
- lwz r4,24(r1)
- lwz r5,28(r1)
- lis r0,0x7ff0 /* const long r0 0x7ff00000 00000000 */
- clrlwi r4,r4,1 /* x = fabs(x) */
- cmpw cr7,r4,r0 /* if (fabs(x) =< inf) */
- cmpwi cr6,r5,0
- li r3,0 /* then return 0 */
- addi r1,r1,32
- cfi_adjust_cfa_offset (-32)
- bltlr+ cr7
- bgt- cr7,L(NaN)
- beqlr+ cr6
-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
-
diff --git a/sysdeps/powerpc/powerpc32/power6/fpu/s_isnanf.S b/sysdeps/powerpc/powerpc32/power6/fpu/s_isnanf.S
deleted file mode 100644
index 483f0f9..0000000
--- a/sysdeps/powerpc/powerpc32/power6/fpu/s_isnanf.S
+++ /dev/null
@@ -1,44 +0,0 @@
-/* isnanf(). PowerPC32 version.
- Copyright (C) 2008-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>
-
-/* int __isnanf(x) */
- .machine power6
-EALIGN (__isnanf, 4, 0)
- stwu r1,-32(r1)
- cfi_adjust_cfa_offset (32)
- ori r1,r1,0
- stfs fp1,24(r1) /* copy FPR to GPR */
- ori r1,r1,0
- lwz r4,24(r1)
- lis r0,0x7f80 /* const long r0 0x7f800000 */
- clrlwi r4,r4,1 /* x = fabs(x) */
- cmpw cr7,r4,r0 /* if (fabs(x) =< inf) */
- li r3,0 /* then return 0 */
- addi r1,r1,32
- cfi_adjust_cfa_offset (-32)
- blelr+ cr7
-L(NaN):
- li r3,1 /* else return 1 */
- blr
- END (__isnanf)
-
-hidden_def (__isnanf)
-weak_alias (__isnanf, isnanf)
diff --git a/sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S b/sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S
deleted file mode 100644
index 99ff126..0000000
--- a/sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S
+++ /dev/null
@@ -1,90 +0,0 @@
-/* isnan(). PowerPC32/POWER7 version.
- Copyright (C) 2010-2013 Free Software Foundation, Inc.
- Contributed by Luis Machado <luisgpm@br.ibm.com>.
- 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>
-
-/* int __isnan(x) */
- .section .rodata.cst8,"aM",@progbits,8
- .align 3
-.LC0: /* 1.0 */
- .quad 0x3ff0000000000000
-
- .section ".text"
- .type __isnan, @function
- .machine power7
-ENTRY (__isnan)
-#ifdef SHARED
- mflr r11
- cfi_register(lr,r11)
-
- SETUP_GOT_ACCESS(r9,got_label)
- addis r9,r9,.LC0-got_label@ha
- lfd fp0,.LC0-got_label@l(r9)
-
- mtlr r11
- cfi_same_value (lr)
-#else
- lis r9,.LC0@ha
- lfd fp0,.LC0@l(r9)
-#endif
- ftdiv cr7,fp1,fp0
- li r3,0
- bflr 30 /* If not NaN or Inf, finish. */
-
- /* We have -INF/+INF/NaN or a denormal. */
-
- stwu r1,-16(r1) /* Allocate stack space. */
- stfd fp1,8(r1) /* Transfer FP to GPR's. */
- ori 2,2,0 /* Force a new dispatch group. */
- lwz r4,8(r1) /* Load the upper half of the FP value. */
- lwz r5,12(r1) /* Load the lower half of the FP value. */
- addi r1,r1,16 /* Reset the stack pointer. */
- lis r0,0x7ff0 /* Load the upper portion for an INF/NaN. */
- clrlwi r4,r4,1 /* r4 = abs(r4). */
- cmpw cr7,r4,r0 /* if (abs(r4) <= inf). */
- cmpwi cr6,r5,0 /* r5 == 0x00000000? */
- bltlr cr7 /* LT means we have a denormal. */
- bgt cr7,L(NaN) /* GT means we have a NaN. */
- beqlr cr6 /* EQ means we have +/-INF. */
-L(NaN):
- li r3,1 /* x == NaN? */
- blr
- END (__isnan)
-
-hidden_def (__isnan)
-weak_alias (__isnan, isnan)
-
-/* 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
diff --git a/sysdeps/powerpc/powerpc32/power7/fpu/s_isnanf.S b/sysdeps/powerpc/powerpc32/power7/fpu/s_isnanf.S
deleted file mode 100644
index b48c85e..0000000
--- a/sysdeps/powerpc/powerpc32/power7/fpu/s_isnanf.S
+++ /dev/null
@@ -1 +0,0 @@
-/* This function uses the same code as s_isnan.S. */
--
1.7.1