diff options
author | Adhemerval Zanella <azanella@linux.vnet.ibm.com> | 2013-04-15 15:03:11 -0500 |
---|---|---|
committer | Adhemerval Zanella <azanella@linux.vnet.ibm.com> | 2013-04-16 08:53:58 -0500 |
commit | 3a0fcf7173fb4985e9d9d696ed074079f938d70c (patch) | |
tree | 236f3d2bbece495081e5fb3220053bafc5e82267 | |
parent | 8117c9baecf35c4bc44f56638c9e9e94c20f169c (diff) | |
download | glibc-3a0fcf7173fb4985e9d9d696ed074079f938d70c.tar.gz |
PowerPC: isinf/isinff multilib for PowerPC32
-rw-r--r-- | sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile | 8 | ||||
-rw-r--r-- | sysdeps/powerpc/powerpc32/fpu/multiarch/s_isinf-c.c | 13 | ||||
-rw-r--r-- | sysdeps/powerpc/powerpc32/fpu/multiarch/s_isinf-power7.S (renamed from sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S) | 26 | ||||
-rw-r--r-- | sysdeps/powerpc/powerpc32/fpu/multiarch/s_isinf.c | 44 | ||||
-rw-r--r-- | sysdeps/powerpc/powerpc32/fpu/multiarch/s_isinff-c.c | 11 | ||||
-rw-r--r-- | sysdeps/powerpc/powerpc32/fpu/multiarch/s_isinff.c | 32 | ||||
-rw-r--r-- | sysdeps/powerpc/powerpc32/power7/fpu/s_isinff.S | 1 |
7 files changed, 109 insertions, 26 deletions
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile index 5ac842f1f5..372af26296 100644 --- a/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile +++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile @@ -5,7 +5,9 @@ sysdep_routines += s_isnan-power7 s_isnan-power6 s_isnan-power5 \ s_isnanf-ppc32 \ s_copysign-power6 s_copysign-ppc32 \ s_finite-power7 s_finite-c \ - s_finitef-c + s_finitef-c \ + s_isinf-power7 s_isinf-c \ + s_isinff-c libm-sysdep_routines += s_llrintf-power6 s_llrintf-power4 s_llrintf-c \ s_llrint-power6 s_llrint-power4 s_llrint-c \ @@ -29,7 +31,9 @@ libm-sysdep_routines += s_llrintf-power6 s_llrintf-power4 s_llrintf-c \ s_lround-power6x s_lround-power5+ s_lround-ppc32 \ s_lrint-power6x s_lrint-ppc32 \ s_finite-power7 s_finite-c \ - s_finitef-c + s_finitef-c \ + s_isinf-power7 s_isinf-c \ + s_isinff-c CFLAGS-s_llround.c = -fno-builtin-llroundf CFLAGS-s_lround.c = -fno-builtin-lroundf diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isinf-c.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isinf-c.c new file mode 100644 index 0000000000..794b0e1ea9 --- /dev/null +++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isinf-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 __isinf __isinf_ppc32 +#undef hidden_def +#define hidden_def(a) \ + __hidden_ver1 (__isinf_ppc32, __GI___isinf, __isinf_ppc32); + +#include <sysdeps/ieee754/dbl-64/s_isinf.c> diff --git a/sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isinf-power7.S index 3f8af60a55..0771ce2b68 100644 --- a/sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S +++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isinf-power7.S @@ -29,7 +29,7 @@ .section ".text" .type __isinf, @function .machine power7 -ENTRY (__isinf) +ENTRY (__isinf_power7) #ifdef SHARED mflr r11 cfi_register(lr,r11) @@ -62,25 +62,5 @@ ENTRY (__isinf) beqlr cr7 /* EQ means INF, otherwise -INF. */ li r3,-1 blr - END (__isinf) - -hidden_def (__isinf) -weak_alias (__isinf, isinf) - -/* It turns out that the 'double' version will also always work for - single-precision. */ -strong_alias (__isinf, __isinff) -hidden_def (__isinff) -weak_alias (__isinff, isinff) - -#ifdef NO_LONG_DOUBLE -strong_alias (__isinf, __isinfl) -weak_alias (__isinf, isinfl) -#endif - -#ifndef IS_IN_libm -# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0) -compat_symbol (libc, __isinf, __isinfl, GLIBC_2_0); -compat_symbol (libc, isinf, isinfl, GLIBC_2_0); -# endif -#endif +END (__isinf_power7) +weak_alias (__isinf_power7, __isinff_power7) diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isinf.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isinf.c new file mode 100644 index 0000000000..94a16424a2 --- /dev/null +++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isinf.c @@ -0,0 +1,44 @@ +/* Multiple versions of s_isinf. + 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 (__isinf) __isinf_ppc32 attribute_hidden; +extern __typeof (__isinf) __isinf_power7 attribute_hidden; + +libc_ifunc (__isinf, + (hwcap & PPC_FEATURE_ARCH_2_06) + ? __isinf_power7 + : __isinf_ppc32); + +weak_alias (__isinf, isinf) + +#ifdef NO_LONG_DOUBLE +strong_alias (__isinf, __isinfl) +weak_alias (__isinf, isinfl) +#endif + +#ifndef IS_IN_libm +# if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0) +compat_symbol (libc, __isinf, __isinfl, GLIBC_2_0); +compat_symbol (libc, isinf, isinfl, GLIBC_2_0); +# endif +#endif diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isinff-c.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isinff-c.c new file mode 100644 index 0000000000..9efb44f2d3 --- /dev/null +++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isinff-c.c @@ -0,0 +1,11 @@ +#include <math.h> + +#undef weak_alias +#define weak_alias(a, b) + +#define __isinff __isinff_ppc32 +#undef hidden_def +#define hidden_def(a) \ + __hidden_ver1 (__isinff_ppc32, __GI___isinff, __isinff_ppc32); + +#include <sysdeps/ieee754/flt-32/s_isinff.c> diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isinff.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isinff.c new file mode 100644 index 0000000000..670539177c --- /dev/null +++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isinff.c @@ -0,0 +1,32 @@ +/* Multiple versions of s_isinf. + 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 (__isinff) __isinff_ppc32 attribute_hidden; +extern __typeof (__isinff) __isinff_power7 attribute_hidden; + +libc_ifunc (__isinff, + (hwcap & PPC_FEATURE_ARCH_2_06) + ? __isinff_power7 + : __isinff_ppc32); + +weak_alias (__isinff, isinff) diff --git a/sysdeps/powerpc/powerpc32/power7/fpu/s_isinff.S b/sysdeps/powerpc/powerpc32/power7/fpu/s_isinff.S deleted file mode 100644 index be759e091e..0000000000 --- a/sysdeps/powerpc/powerpc32/power7/fpu/s_isinff.S +++ /dev/null @@ -1 +0,0 @@ -/* This function uses the same code as s_isinf.S. */ |