This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch azanella/multilib-ppc-v2 created. glibc-2.18-74-ge1203e7
- From: azanella at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 19 Aug 2013 11:42:04 -0000
- Subject: GNU C Library master sources branch azanella/multilib-ppc-v2 created. glibc-2.18-74-ge1203e7
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, azanella/multilib-ppc-v2 has been created
at e1203e7155841dd1ba4311f6444dc32f634c1897 (commit)
- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=e1203e7155841dd1ba4311f6444dc32f634c1897
commit e1203e7155841dd1ba4311f6444dc32f634c1897
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Tue Jun 11 07:32:09 2013 -0500
PowerPC: __fe_[no]mask_env cleanup
This patch remove compile warnings regarding ununsed variables.
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_mask.c b/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_mask.c
index 2ab5855..1d579bf 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_mask.c
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_mask.c
@@ -27,9 +27,8 @@ const fenv_t *
__fe_mask_env (void)
{
#if defined PR_SET_FPEXC && defined PR_FP_EXC_DISABLED
- int result;
INTERNAL_SYSCALL_DECL (err);
- result = INTERNAL_SYSCALL (prctl, err, 2, PR_SET_FPEXC, PR_FP_EXC_DISABLED);
+ INTERNAL_SYSCALL (prctl, err, 2, PR_SET_FPEXC, PR_FP_EXC_DISABLED);
#else
__set_errno (ENOSYS);
#endif
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_nomask.c b/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_nomask.c
index fd2ffb1..3bd514b 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_nomask.c
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_nomask.c
@@ -27,9 +27,8 @@ const fenv_t *
__fe_nomask_env (void)
{
#if defined PR_SET_FPEXC && defined PR_FP_EXC_PRECISE
- int result;
INTERNAL_SYSCALL_DECL (err);
- result = INTERNAL_SYSCALL (prctl, err, 2, PR_SET_FPEXC, PR_FP_EXC_PRECISE);
+ INTERNAL_SYSCALL (prctl, err, 2, PR_SET_FPEXC, PR_FP_EXC_PRECISE);
#else
__set_errno (ENOSYS);
#endif
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=d6bb2118d1d95d75e63fc7e6e402b992f801d96a
commit d6bb2118d1d95d75e63fc7e6e402b992f801d96a
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Fri Jun 7 09:37:39 2013 -0500
PowerPC: __ieee754_hypot[f] multilib for PowerPC64
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
index 521e514..0daa7e8 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
@@ -21,11 +21,15 @@ libm-sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \
s_isinf-power7 s_isinf-ppc64 s_logb-power7 \
s_logbf-power7 s_logbl-power7 s_logb-ppc64 \
s_logbf-ppc64 s_logbl-ppc64 s_modf-power5+ \
- s_modf-ppc64 s_modff-power5+ s_modff-ppc64
+ s_modf-ppc64 s_modff-power5+ s_modff-ppc64 \
+ e_hypot-ppc64 e_hypot-power7 e_hypotf-ppc64 \
+ e_hypotf-power7
CFLAGS-s_logbf-power7.c = -mcpu=power7
CFLAGS-s_logbl-power7.c = -mcpu=power7
CFLAGS-s_logb-power7.c = -mcpu=power7
CFLAGS-s_modf-power5+.c = -mcpu=power5+
CFLAGS-s_modff-power5+.c = -mcpu=power5+
+CFLAGS-e_hypot-power7.c = -mcpu=power7
+CFLAGS-e_hypotf-power7.c = -mcpu=power7
endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypot-power7.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypot-power7.c
new file mode 100644
index 0000000..91a42a2
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypot-power7.c
@@ -0,0 +1,26 @@
+/* __ieee_hypot() 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 <math.h>
+
+#undef strong_alias
+#define strong_alias(a, b)
+
+#define __ieee754_hypot __ieee754_hypot_power7
+
+#include <sysdeps/powerpc/fpu/e_hypot.c>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypot-ppc64.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypot-ppc64.c
new file mode 100644
index 0000000..9b0c1b0
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypot-ppc64.c
@@ -0,0 +1,26 @@
+/* __ieee_hypot() PowerPC64 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 <math.h>
+
+#undef strong_alias
+#define strong_alias(a, b)
+
+#define __ieee754_hypot __ieee754_hypot_ppc64
+
+#include <sysdeps/powerpc/fpu/e_hypot.c>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypot.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypot.c
new file mode 100644
index 0000000..faaf550
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypot.c
@@ -0,0 +1,32 @@
+/* Multiple versions of ieee754_hypot.
+ 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 (__ieee754_hypot) __ieee754_hypot_ppc64 attribute_hidden;
+extern __typeof (__ieee754_hypot) __ieee754_hypot_power7 attribute_hidden;
+
+libc_ifunc (__ieee754_hypot,
+ (hwcap & PPC_FEATURE_ARCH_2_06)
+ ? __ieee754_hypot_power7
+ : __ieee754_hypot_ppc64);
+
+strong_alias (__ieee754_hypot, __hypot_finite)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypotf-power7.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypotf-power7.c
new file mode 100644
index 0000000..849f33c
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypotf-power7.c
@@ -0,0 +1,26 @@
+/* __ieee_hypot() 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 <math.h>
+
+#undef strong_alias
+#define strong_alias(a, b)
+
+#define __ieee754_hypotf __ieee754_hypotf_power7
+
+#include <sysdeps/powerpc/fpu/e_hypotf.c>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypotf-ppc64.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypotf-ppc64.c
new file mode 100644
index 0000000..734cfe2
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypotf-ppc64.c
@@ -0,0 +1,26 @@
+/* __ieee_hypot() PowerPC64 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 <math.h>
+
+#undef strong_alias
+#define strong_alias(a, b)
+
+#define __ieee754_hypotf __ieee754_hypotf_ppc64
+
+#include <sysdeps/powerpc/fpu/e_hypotf.c>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypotf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypotf.c
new file mode 100644
index 0000000..5261302
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypotf.c
@@ -0,0 +1,32 @@
+/* Multiple versions of ieee754_hypot.
+ 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 (__ieee754_hypotf) __ieee754_hypotf_ppc64 attribute_hidden;
+extern __typeof (__ieee754_hypotf) __ieee754_hypotf_power7 attribute_hidden;
+
+libc_ifunc (__ieee754_hypotf,
+ (hwcap & PPC_FEATURE_ARCH_2_06)
+ ? __ieee754_hypotf_power7
+ : __ieee754_hypotf_ppc64);
+
+strong_alias (__ieee754_hypotf, __hypotf_finite)
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=e949d92ef0d33de95e72ece70346b56cf97ba9fb
commit e949d92ef0d33de95e72ece70346b56cf97ba9fb
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Fri Jun 7 09:37:12 2013 -0500
PowerPC: modf/modff multilib for PowerPC64
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
index eced9b0..521e514 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
@@ -4,7 +4,8 @@ sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \
s_llround-power6x s_llround-power5+ s_llround-ppc64 \
s_copysign-power6 s_copysign-ppc64 s_finite-power7 \
s_finite-ppc64 s_finitef-ppc64 s_isinff-ppc64 \
- s_isinf-power7 s_isinf-ppc64
+ s_isinf-power7 s_isinf-ppc64 s_modf-power5+ s_modf-ppc64 \
+ s_modff-power5+ s_modff-ppc64
libm-sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \
s_isnan-power5 s_isnan-ppc64 s_isnanf-ppc64 \
@@ -19,9 +20,12 @@ libm-sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \
s_finite-ppc64 s_finitef-ppc64 s_isinff-ppc64 \
s_isinf-power7 s_isinf-ppc64 s_logb-power7 \
s_logbf-power7 s_logbl-power7 s_logb-ppc64 \
- s_logbf-ppc64 s_logbl-ppc64
+ s_logbf-ppc64 s_logbl-ppc64 s_modf-power5+ \
+ s_modf-ppc64 s_modff-power5+ s_modff-ppc64
CFLAGS-s_logbf-power7.c = -mcpu=power7
CFLAGS-s_logbl-power7.c = -mcpu=power7
CFLAGS-s_logb-power7.c = -mcpu=power7
+CFLAGS-s_modf-power5+.c = -mcpu=power5+
+CFLAGS-s_modff-power5+.c = -mcpu=power5+
endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf-power5+.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf-power5+.c
new file mode 100644
index 0000000..12abb1a
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf-power5+.c
@@ -0,0 +1,19 @@
+/* PowerPC/POWER5+ implementation for modf.
+ 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 <sysdeps/powerpc/powerpc32/fpu/multiarch/s_modf-power5+.c>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf-ppc64.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf-ppc64.c
new file mode 100644
index 0000000..110083b
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf-ppc64.c
@@ -0,0 +1,29 @@
+/* PowerPC32 default implementation for modf.
+ 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>
+
+#undef weak_alias
+#define weak_alias(a,b)
+#undef strong_alias
+#define strong_alias(a,b)
+
+#define __modf __modf_ppc64
+
+#include <sysdeps/ieee754/dbl-64/s_modf.c>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf.c
new file mode 100644
index 0000000..931d0c3
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf.c
@@ -0,0 +1,44 @@
+/* Multiple versions of modf.
+ 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 (__modf) __modf_ppc64 attribute_hidden;
+extern __typeof (__modf) __modf_power5plus attribute_hidden;
+
+libc_ifunc (__modf,
+ (hwcap & PPC_FEATURE_POWER5_PLUS)
+ ? __modf_power5plus
+ : __modf_ppc64);
+
+weak_alias (__modf, modf)
+
+#ifdef NO_LONG_DOUBLE
+strong_alias (__modf, __modfl)
+weak_alias (__modf, modfl)
+#endif
+#ifdef IS_IN_libm
+# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __modf, modfl, GLIBC_2_0);
+# endif
+#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+compat_symbol (libc, __modf, modfl, GLIBC_2_0);
+#endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modff-power5+.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modff-power5+.c
new file mode 100644
index 0000000..51f35eb
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modff-power5+.c
@@ -0,0 +1,19 @@
+/* PowerPC/POWER5+ implementation for modff.
+ 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 <sysdeps/powerpc/powerpc32/fpu/multiarch/s_modff-power5+.c>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modff-ppc64.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modff-ppc64.c
new file mode 100644
index 0000000..281c97e
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modff-ppc64.c
@@ -0,0 +1,26 @@
+/* PowerPC32 default implementation for modff.
+ 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>
+
+#undef weak_alias
+#define weak_alias(a,b)
+
+#define __modff __modff_ppc64
+
+#include <sysdeps/ieee754/flt-32/s_modff.c>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modff.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modff.c
new file mode 100644
index 0000000..0629339
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modff.c
@@ -0,0 +1,30 @@
+/* Multiple versions of modff.
+ 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 "init-arch.h"
+
+extern __typeof (__modff) __modff_ppc64 attribute_hidden;
+extern __typeof (__modff) __modff_power5plus attribute_hidden;
+
+libc_ifunc (__modff,
+ (hwcap & PPC_FEATURE_POWER5_PLUS)
+ ? __modff_power5plus
+ : __modff_ppc64);
+
+weak_alias (__modff, modff)
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=c91ef9674ce88d80660a4512636e2f37282ee5ec
commit c91ef9674ce88d80660a4512636e2f37282ee5ec
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Fri Jun 7 09:36:35 2013 -0500
PowerPC: logb/logbf/logbl multilib for PowerPC64
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
index f5d98cd..eced9b0 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
@@ -17,5 +17,11 @@ libm-sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \
s_truncf-ppc64 s_copysign-power6 s_copysign-ppc64 \
s_llrint-power6x s_llrint-ppc64 s_finite-power7 \
s_finite-ppc64 s_finitef-ppc64 s_isinff-ppc64 \
- s_isinf-power7 s_isinf-ppc64
+ s_isinf-power7 s_isinf-ppc64 s_logb-power7 \
+ s_logbf-power7 s_logbl-power7 s_logb-ppc64 \
+ s_logbf-ppc64 s_logbl-ppc64
+
+CFLAGS-s_logbf-power7.c = -mcpu=power7
+CFLAGS-s_logbl-power7.c = -mcpu=power7
+CFLAGS-s_logb-power7.c = -mcpu=power7
endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb-power7.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb-power7.c
new file mode 100644
index 0000000..149a1be
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb-power7.c
@@ -0,0 +1,19 @@
+/* logb(). PowerPC64 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 <sysdeps/powerpc/powerpc32/fpu/multiarch/s_logb-power7.c>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb-ppc64.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb-ppc64.c
new file mode 100644
index 0000000..6e42fcb
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb-ppc64.c
@@ -0,0 +1,28 @@
+/* logb(). 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 <math.h>
+
+#undef weak_alias
+#define weak_alias(a, b)
+#undef strong_alias
+#define strong_alias(a, b)
+
+#define __logb __logb_ppc64
+
+#include <sysdeps/ieee754/dbl-64/s_logb.c>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb.c
new file mode 100644
index 0000000..e14bfa2
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb.c
@@ -0,0 +1,41 @@
+/* Multiple versions of logb.
+ 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 (__logb) __logb_ppc64 attribute_hidden;
+extern __typeof (__logb) __logb_power7 attribute_hidden;
+
+libc_ifunc (__logb,
+ (hwcap & PPC_FEATURE_ARCH_2_06)
+ ? __logb_power7
+ : __logb_ppc64);
+
+weak_alias (__logb, logb)
+
+#ifdef NO_LONG_DOUBLE
+strong_alias (__logb, __logbl)
+weak_alias (__logb, logbl)
+#endif
+
+#if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)
+compat_symbol (libm, logb, logbl, GLIBC_2_0);
+#endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbf-power7.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbf-power7.c
new file mode 100644
index 0000000..5f770c4
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbf-power7.c
@@ -0,0 +1,19 @@
+/* logbf(). PowerPC64/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 <sysdeps/powerpc/powerpc32/fpu/multiarch/s_logbf-power7.c>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbf-ppc64.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbf-ppc64.c
new file mode 100644
index 0000000..0794929
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbf-ppc64.c
@@ -0,0 +1,26 @@
+/* logbf(). PowerPC32 default implementation.
+ 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>
+
+#undef weak_alias
+#define weak_alias(a, b)
+
+#define __logbf __logbf_ppc64
+
+#include <sysdeps/ieee754/flt-32/s_logbf.c>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbf.c
new file mode 100644
index 0000000..a300125
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbf.c
@@ -0,0 +1,32 @@
+/* Multiple versions of logbf.
+ 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 (__logbf) __logbf_ppc64 attribute_hidden;
+extern __typeof (__logbf) __logbf_power7 attribute_hidden;
+
+libc_ifunc (__logbf,
+ (hwcap & PPC_FEATURE_ARCH_2_06)
+ ? __logbf_power7
+ : __logbf_ppc64);
+
+weak_alias (__logbf, logbf)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbl-power7.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbl-power7.c
new file mode 100644
index 0000000..b16eb48
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbl-power7.c
@@ -0,0 +1,19 @@
+/* logbl(). PowerPC64/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 <sysdeps/powerpc/powerpc32/fpu/multiarch/s_logbl-power7.c>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbl-ppc64.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbl-ppc64.c
new file mode 100644
index 0000000..0d0b9b9
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbl-ppc64.c
@@ -0,0 +1,21 @@
+/* logbl(). PowerPC32/POWER7 version.
+ Copyright (C) 2012-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/>. */
+
+#define __logbl __logbl_ppc64
+
+#include <sysdeps/ieee754/ldbl-128ibm/s_logbl.c>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbl.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbl.c
new file mode 100644
index 0000000..21af571
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbl.c
@@ -0,0 +1,32 @@
+/* Multiple versions of logbl.
+ 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 (__logbl) __logbl_ppc64 attribute_hidden;
+extern __typeof (__logbl) __logbl_power7 attribute_hidden;
+
+libc_ifunc (__logbl,
+ (hwcap & PPC_FEATURE_ARCH_2_06)
+ ? __logbl_power7
+ : __logbl_ppc64);
+
+long_double_symbol (libm, __logbl, logbl);
diff --git a/sysdeps/powerpc/powerpc64/power7/fpu/s_logb.c b/sysdeps/powerpc/powerpc64/power7/fpu/s_logb.c
deleted file mode 100644
index 2599c77..0000000
--- a/sysdeps/powerpc/powerpc64/power7/fpu/s_logb.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/powerpc/power7/fpu/s_logb.c>
diff --git a/sysdeps/powerpc/powerpc64/power7/fpu/s_logbf.c b/sysdeps/powerpc/powerpc64/power7/fpu/s_logbf.c
deleted file mode 100644
index 7a5a803..0000000
--- a/sysdeps/powerpc/powerpc64/power7/fpu/s_logbf.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/powerpc/power7/fpu/s_logbf.c>
diff --git a/sysdeps/powerpc/powerpc64/power7/fpu/s_logbl.c b/sysdeps/powerpc/powerpc64/power7/fpu/s_logbl.c
deleted file mode 100644
index 524ae2c..0000000
--- a/sysdeps/powerpc/powerpc64/power7/fpu/s_logbl.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/powerpc/power7/fpu/s_logbl.c>
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=299559059bf38031b8c95a38d161fba8617b16d6
commit 299559059bf38031b8c95a38d161fba8617b16d6
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Fri Jun 7 09:36:01 2013 -0500
PowerPC: isinf/isinff multilib for PowerPC64
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
index 728c60d..f5d98cd 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
@@ -3,7 +3,8 @@ sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \
s_isnan-power5 s_isnan-ppc64 s_isnanf-ppc64 \
s_llround-power6x s_llround-power5+ s_llround-ppc64 \
s_copysign-power6 s_copysign-ppc64 s_finite-power7 \
- s_finite-ppc64 s_finitef-ppc64
+ s_finite-ppc64 s_finitef-ppc64 s_isinff-ppc64 \
+ s_isinf-power7 s_isinf-ppc64
libm-sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \
s_isnan-power5 s_isnan-ppc64 s_isnanf-ppc64 \
@@ -15,5 +16,6 @@ libm-sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \
s_trunc-power5+ s_trunc-ppc64 s_truncf-power5+ \
s_truncf-ppc64 s_copysign-power6 s_copysign-ppc64 \
s_llrint-power6x s_llrint-ppc64 s_finite-power7 \
- s_finite-ppc64 s_finitef-ppc64
+ s_finite-ppc64 s_finitef-ppc64 s_isinff-ppc64 \
+ s_isinf-power7 s_isinf-ppc64
endif
diff --git a/sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power7.S
similarity index 75%
rename from sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S
rename to sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power7.S
index 1aea123..2516ffe 100644
--- a/sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power7.S
@@ -27,7 +27,7 @@
.section ".text"
.type __isinf, @function
.machine power7
-EALIGN (__isinf, 4, 0)
+EALIGN (__isinf_power7, 4, 0)
CALL_MCOUNT 0
lfd fp0,.LC0@toc(r2)
ftdiv cr7,fp1,fp0
@@ -46,25 +46,5 @@ EALIGN (__isinf, 4, 0)
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/powerpc64/fpu/multiarch/s_isinf-ppc64.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-ppc64.c
new file mode 100644
index 0000000..7d424e1
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-ppc64.c
@@ -0,0 +1,34 @@
+/* isinf(). 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 <math.h>
+
+#undef weak_alias
+#define weak_alias(a, b)
+#undef strong_alias
+#define strong_alias(a, b)
+
+#define __isinf __isinf_ppc64
+#ifdef SHARED
+# undef hidden_def
+# define hidden_def(a) \
+ __hidden_ver1 (__isinf_ppc64, __GI___isinf, __isinf_ppc64);
+#endif
+
+#include <sysdeps/ieee754/dbl-64/s_isinf.c>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c
new file mode 100644
index 0000000..994f977
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c
@@ -0,0 +1,44 @@
+/* Multiple versions of 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_ppc64 attribute_hidden;
+extern __typeof (__isinf) __isinf_power7 attribute_hidden;
+
+libc_ifunc (__isinf,
+ (hwcap & PPC_FEATURE_ARCH_2_06)
+ ? __isinf_power7
+ : __isinf_ppc64);
+
+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/powerpc64/fpu/multiarch/s_isinff-ppc64.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff-ppc64.c
new file mode 100644
index 0000000..24fffe4
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff-ppc64.c
@@ -0,0 +1,31 @@
+/* isinff(). 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 <math.h>
+
+#undef weak_alias
+#define weak_alias(a, b)
+
+#define __isinff __isinff_ppc64
+#ifdef SHARED
+# undef hidden_def
+# define hidden_def(a) \
+ __hidden_ver1 (__isinff_ppc64, __GI___isinff, __isinff_ppc64);
+#endif
+
+#include <sysdeps/ieee754/flt-32/s_isinff.c>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c
new file mode 100644
index 0000000..7825490
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c
@@ -0,0 +1,32 @@
+/* Multiple versions of 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_ppc64 attribute_hidden;
+extern __typeof (__isinff) __isinff_power7 attribute_hidden;
+
+libc_ifunc (__isinff,
+ (hwcap & PPC_FEATURE_ARCH_2_06)
+ ? __isinff_power7
+ : __isinff_ppc64);
+
+weak_alias (__isinff, isinff)
diff --git a/sysdeps/powerpc/powerpc64/power7/fpu/s_isinff.S b/sysdeps/powerpc/powerpc64/power7/fpu/s_isinff.S
deleted file mode 100644
index be759e0..0000000
--- a/sysdeps/powerpc/powerpc64/power7/fpu/s_isinff.S
+++ /dev/null
@@ -1 +0,0 @@
-/* This function uses the same code as s_isinf.S. */
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=27c9f38915ee2559268be4fab330d6f72fc4cb17
commit 27c9f38915ee2559268be4fab330d6f72fc4cb17
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Fri Jun 7 09:35:35 2013 -0500
PowerPC: finite/finitef multilib for PowerPC64
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
index 4e24ebe..728c60d 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
@@ -2,7 +2,8 @@ ifeq ($(subdir),math)
sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \
s_isnan-power5 s_isnan-ppc64 s_isnanf-ppc64 \
s_llround-power6x s_llround-power5+ s_llround-ppc64 \
- s_copysign-power6 s_copysign-ppc64
+ s_copysign-power6 s_copysign-ppc64 s_finite-power7 \
+ s_finite-ppc64 s_finitef-ppc64
libm-sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \
s_isnan-power5 s_isnan-ppc64 s_isnanf-ppc64 \
@@ -13,5 +14,6 @@ libm-sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \
s_round-ppc64 s_roundf-power5+ s_roundf-ppc64 \
s_trunc-power5+ s_trunc-ppc64 s_truncf-power5+ \
s_truncf-ppc64 s_copysign-power6 s_copysign-ppc64 \
- s_llrint-power6x s_llrint-ppc64
+ s_llrint-power6x s_llrint-ppc64 s_finite-power7 \
+ s_finite-ppc64 s_finitef-ppc64
endif
diff --git a/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power7.S
similarity index 73%
rename from sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S
rename to sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power7.S
index d0071c7..5963c49 100644
--- a/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power7.S
@@ -27,7 +27,7 @@
.section ".text"
.type __finite, @function
.machine power7
-EALIGN (__finite, 4, 0)
+EALIGN (__finite_power7, 4, 0)
CALL_MCOUNT 0
lfd fp0,.LC0@toc(r2)
ftdiv cr7,fp1,fp0
@@ -48,25 +48,5 @@ EALIGN (__finite, 4, 0)
bltlr cr7 /* LT means finite, other non-finite. */
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 IS_IN_libm
-# if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)
-compat_symbol (libm, __finite, __finitel, GLIBC_2_0)
-compat_symbol (libm, finite, finitel, GLIBC_2_0)
-# 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/powerpc64/fpu/multiarch/s_finite-ppc64.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-ppc64.c
new file mode 100644
index 0000000..e253412
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-ppc64.c
@@ -0,0 +1,34 @@
+/* finite(). 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 <math.h>
+
+#undef weak_alias
+#define weak_alias(a, b)
+#undef strong_alias
+#define strong_alias(a, b)
+
+#define __finite __finite_ppc64
+#ifdef SHARED
+# undef hidden_def
+# define hidden_def(a) \
+ __hidden_ver1 (__finite_ppc64, __GI___finite, __finite_ppc64);
+#endif
+
+#include <sysdeps/ieee754/dbl-64/s_finite.c>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c
new file mode 100644
index 0000000..66cc437
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c
@@ -0,0 +1,51 @@
+/* Multiple versions of 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_ppc64 attribute_hidden;
+extern __typeof (__finite) __finite_power7 attribute_hidden;
+
+libc_ifunc (__finite,
+ (hwcap & PPC_FEATURE_ARCH_2_06)
+ ? __finite_power7
+ : __finite_ppc64);
+
+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/powerpc64/fpu/multiarch/s_finitef-ppc64.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef-ppc64.c
new file mode 100644
index 0000000..74d296c
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef-ppc64.c
@@ -0,0 +1,32 @@
+/* finitef(). 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 <math.h>
+
+#undef weak_alias
+#define weak_alias(a, b)
+
+#define __finitef __finitef_ppc64
+#ifdef SHARED
+# undef hidden_def
+# define hidden_def(a) \
+ __hidden_ver1 (__finitef_ppc64, __GI___finitef, __finitef_ppc64);
+#endif
+
+#include <sysdeps/ieee754/flt-32/s_finitef.c>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef.c
new file mode 100644
index 0000000..1ad8296
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef.c
@@ -0,0 +1,31 @@
+/* Multiple versions of finitef.
+ 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 (__finitef) __finitef_ppc64 attribute_hidden;
+extern __typeof (__finitef) __finitef_power7 attribute_hidden;
+
+libc_ifunc (__finitef,
+ (hwcap & PPC_FEATURE_ARCH_2_06)
+ ? __finitef_power7
+ : __finitef_ppc64);
+
+weak_alias (__finitef, finitef)
diff --git a/sysdeps/powerpc/powerpc64/power7/fpu/s_finitef.S b/sysdeps/powerpc/powerpc64/power7/fpu/s_finitef.S
deleted file mode 100644
index 54bd941..0000000
--- a/sysdeps/powerpc/powerpc64/power7/fpu/s_finitef.S
+++ /dev/null
@@ -1 +0,0 @@
-/* This function uses the same code as s_finite.S. */
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=c0ee4712373af054edf4b354b7aaf403226bec31
commit c0ee4712373af054edf4b354b7aaf403226bec31
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Fri Jun 7 09:35:02 2013 -0500
PowerPC: llrint/llrintf multilib for PowerPC64
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
index eb8e5c0..4e24ebe 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
@@ -12,5 +12,6 @@ libm-sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \
s_floorf-power5+ s_floorf-ppc64 s_round-power5+ \
s_round-ppc64 s_roundf-power5+ s_roundf-ppc64 \
s_trunc-power5+ s_trunc-ppc64 s_truncf-power5+ \
- s_truncf-ppc64 s_copysign-power6 s_copysign-ppc64
+ s_truncf-ppc64 s_copysign-power6 s_copysign-ppc64 \
+ s_llrint-power6x s_llrint-ppc64
endif
diff --git a/sysdeps/powerpc/powerpc64/power6x/fpu/s_llrint.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-power6x.S
similarity index 70%
copy from sysdeps/powerpc/powerpc64/power6x/fpu/s_llrint.S
copy to sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-power6x.S
index 67d51ad..bcfd007 100644
--- a/sysdeps/powerpc/powerpc64/power6x/fpu/s_llrint.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-power6x.S
@@ -21,24 +21,9 @@
.machine "power6"
/* long long int[r3] __llrint (double x[fp1]) */
-ENTRY (__llrint)
+ENTRY (__llrint_power6x)
CALL_MCOUNT 0
fctid fp13,fp1
mftgpr r3,fp13
blr
- END (__llrint)
-
-strong_alias (__llrint, __lrint)
-weak_alias (__llrint, llrint)
-weak_alias (__lrint, lrint)
-
-#ifdef NO_LONG_DOUBLE
-strong_alias (__llrint, __llrintl)
-weak_alias (__llrint, llrintl)
-strong_alias (__lrint, __lrintl)
-weak_alias (__lrint, lrintl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llrint, llrintl, GLIBC_2_1)
-compat_symbol (libm, __lrint, lrintl, GLIBC_2_1)
-#endif
+END (__llrint_power6x)
diff --git a/sysdeps/powerpc/powerpc64/power6x/fpu/s_llrint.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-ppc64.S
similarity index 54%
copy from sysdeps/powerpc/powerpc64/power6x/fpu/s_llrint.S
copy to sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-ppc64.S
index 67d51ad..22fbe60 100644
--- a/sysdeps/powerpc/powerpc64/power6x/fpu/s_llrint.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-ppc64.S
@@ -1,5 +1,5 @@
-/* Round double to long int. POWER6x PowerPC64 version.
- Copyright (C) 2006-2013 Free Software Foundation, Inc.
+/* Round double to long int. 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
@@ -19,26 +19,13 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
- .machine "power6"
-/* long long int[r3] __llrint (double x[fp1]) */
-ENTRY (__llrint)
- CALL_MCOUNT 0
- fctid fp13,fp1
- mftgpr r3,fp13
- blr
- END (__llrint)
+#undef weak_alias
+#define weak_alias(a,b)
+#undef strong_alias
+#define strong_alias(a,b)
+#undef compat_symbol
+#define compat_symbol(a,b,c,d)
-strong_alias (__llrint, __lrint)
-weak_alias (__llrint, llrint)
-weak_alias (__lrint, lrint)
+#define __llrint __llrint_ppc64
-#ifdef NO_LONG_DOUBLE
-strong_alias (__llrint, __llrintl)
-weak_alias (__llrint, llrintl)
-strong_alias (__lrint, __lrintl)
-weak_alias (__lrint, lrintl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llrint, llrintl, GLIBC_2_1)
-compat_symbol (libm, __lrint, lrintl, GLIBC_2_1)
-#endif
+#include <sysdeps/powerpc/powerpc64/fpu/s_llrint.S>
diff --git a/sysdeps/powerpc/powerpc64/power6x/fpu/s_llrint.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint.c
similarity index 58%
rename from sysdeps/powerpc/powerpc64/power6x/fpu/s_llrint.S
rename to sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint.c
index 67d51ad..a6ea817 100644
--- a/sysdeps/powerpc/powerpc64/power6x/fpu/s_llrint.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint.c
@@ -1,5 +1,5 @@
-/* Round double to long int. POWER6x PowerPC64 version.
- Copyright (C) 2006-2013 Free Software Foundation, Inc.
+/* Multiple versions of llrint.
+ 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
@@ -16,20 +16,29 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
+/* Redefine lrint/__lrint so that the compiler won't complain about the type
+ mismatch with the IFUNC selector in strong_alias below. */
+#undef lrint
+#undef __lrint
+#define lrint lrint_copysign
+#define __lrint __lrint_copysign
+#include <math.h>
#include <math_ldbl_opt.h>
+#undef lrint
+#undef __lrint
+#include <shlib-compat.h>
+#include "init-arch.h"
- .machine "power6"
-/* long long int[r3] __llrint (double x[fp1]) */
-ENTRY (__llrint)
- CALL_MCOUNT 0
- fctid fp13,fp1
- mftgpr r3,fp13
- blr
- END (__llrint)
+extern __typeof (__llrint) __llrint_ppc64 attribute_hidden;
+extern __typeof (__llrint) __llrint_power6x attribute_hidden;
+
+libc_ifunc (__llrint,
+ (hwcap & PPC_FEATURE_POWER6_EXT)
+ ? __llrint_power6x
+ : __llrint_ppc64);
-strong_alias (__llrint, __lrint)
weak_alias (__llrint, llrint)
+strong_alias (__llrint, __lrint)
weak_alias (__lrint, lrint)
#ifdef NO_LONG_DOUBLE
@@ -39,6 +48,6 @@ strong_alias (__lrint, __lrintl)
weak_alias (__lrint, lrintl)
#endif
#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llrint, llrintl, GLIBC_2_1)
-compat_symbol (libm, __lrint, lrintl, GLIBC_2_1)
+compat_symbol (libm, __llrint, llrintl, GLIBC_2_1);
+compat_symbol (libm, __lrint, lrintl, GLIBC_2_1);
#endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrintf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrintf.c
new file mode 100644
index 0000000..e4bc363
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrintf.c
@@ -0,0 +1,42 @@
+/* Multiple versions of llrintf.
+ 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/>. */
+
+/* Redefine lrint/__lrint so that the compiler won't complain about the type
+ mismatch with the IFUNC selector in strong_alias below. */
+#undef lrintf
+#undef __lrintf
+#define lrintf lrintf_copysign
+#define __lrintf __lrintf_copysign
+#include <math.h>
+#undef lrintf
+#undef __lrintf
+
+#include "init-arch.h"
+
+/* The double-precision implementation also works for the single one. */
+extern __typeof (__llrintf) __llrint_ppc64 attribute_hidden;
+extern __typeof (__llrintf) __llrint_power6x attribute_hidden;
+
+libc_ifunc (__llrintf,
+ (hwcap & PPC_FEATURE_POWER6_EXT)
+ ? __llrint_power6x
+ : __llrint_ppc64);
+
+weak_alias (__llrintf, llrintf)
+strong_alias (__llrintf, __lrintf)
+weak_alias (__lrintf, lrintf)
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=3d9757d6f3e4a7a3a77fd98bba1cf5e4b6fe22f0
commit 3d9757d6f3e4a7a3a77fd98bba1cf5e4b6fe22f0
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Fri Jun 7 09:34:16 2013 -0500
PowerPC: copysign/copysignf multilib for PowerPC64
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
index b1cd4c8..eb8e5c0 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
@@ -1,7 +1,8 @@
ifeq ($(subdir),math)
sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \
s_isnan-power5 s_isnan-ppc64 s_isnanf-ppc64 \
- s_llround-power6x s_llround-power5+ s_llround-ppc64
+ s_llround-power6x s_llround-power5+ s_llround-ppc64 \
+ s_copysign-power6 s_copysign-ppc64
libm-sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \
s_isnan-power5 s_isnan-ppc64 s_isnanf-ppc64 \
@@ -11,5 +12,5 @@ libm-sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \
s_floorf-power5+ s_floorf-ppc64 s_round-power5+ \
s_round-ppc64 s_roundf-power5+ s_roundf-ppc64 \
s_trunc-power5+ s_trunc-ppc64 s_truncf-power5+ \
- s_truncf-ppc64
+ s_truncf-ppc64 s_copysign-power6 s_copysign-ppc64
endif
diff --git a/sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign-power6.S
similarity index 65%
rename from sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S
rename to sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign-power6.S
index b37dadb..c74117d 100644
--- a/sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign-power6.S
@@ -27,32 +27,8 @@
.section ".text"
.type __copysign, @function
.machine power6
-EALIGN (__copysign, 4, 0)
+EALIGN (__copysign_power6, 4, 0)
CALL_MCOUNT 0
fcpsgn fp1,fp2,fp1
blr
-END (__copysign)
-
-hidden_def (__copysign)
-weak_alias (__copysign, copysign)
-
-/* It turns out that the 'double' version will also always work for
- single-precision. */
-strong_alias (__copysign, __copysignf)
-hidden_def (__copysignf)
-weak_alias (__copysignf, copysignf)
-
-#ifdef NO_LONG_DOUBLE
-strong_alias (__copysign, __copysignl)
-weak_alias (__copysign, copysignl)
-#endif
-
-#ifdef IS_IN_libm
-# if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)
-compat_symbol (libm, copysign, copysignl, GLIBC_2_0)
-# endif
-#else
-# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
-compat_symbol (libc, copysign, copysignl, GLIBC_2_0);
-# endif
-#endif
+END (__copysign_power6)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign-ppc64.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign-ppc64.S
new file mode 100644
index 0000000..95672d7
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign-ppc64.S
@@ -0,0 +1,35 @@
+/* copysign(). PowerPC64 default 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>
+
+#undef weak_alias
+#define weak_alias(a,b)
+#undef strong_alias
+#define strong_alias(a,b)
+#undef compat_symbol
+#define compat_symbol(a, b, c, d)
+
+#define __copysign __copysign_ppc64
+#undef hidden_def
+#define hidden_def(name)
+ strong_alias (__copysign_ppc64, __GI___copysign)
+
+#include <sysdeps/powerpc/powerpc64/fpu/s_copysign.S>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign.c
new file mode 100644
index 0000000..ee7ce0a
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign.c
@@ -0,0 +1,51 @@
+/* Multiple versions of copysign.
+ 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/>. */
+
+/* Redefine copysign so that the compiler won't complain about the type
+ mismatch with the IFUNC selector in strong_alias below. */
+#undef __copysign
+#define __copysign __redirect_copysign
+#include <math.h>
+#include <math_ldbl_opt.h>
+#undef __copysign
+#include <shlib-compat.h>
+#include "init-arch.h"
+
+extern __typeof (__redirect_copysign) __copysign_ppc64 attribute_hidden;
+extern __typeof (__redirect_copysign) __copysign_power6 attribute_hidden;
+
+extern __typeof (__redirect_copysign) __libm_copysign;
+libc_ifunc (__libm_copysign,
+ (hwcap & PPC_FEATURE_ARCH_2_05)
+ ? __copysign_power6
+ : __copysign_ppc64);
+
+strong_alias (__libm_copysign, __copysign)
+weak_alias (__copysign, copysign)
+
+#ifdef NO_LONG_DOUBLE
+weak_alias (__copysign,copysignl)
+strong_alias(__copysign,__copysignl)
+#endif
+#ifdef IS_IN_libm
+# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __copysign, copysignl, GLIBC_2_0);
+# endif
+#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+compat_symbol (libc, __copysign, copysignl, GLIBC_2_0);
+#endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysignf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysignf.c
new file mode 100644
index 0000000..89c3c06
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysignf.c
@@ -0,0 +1,32 @@
+/* Multiple versions of copysignf.
+ 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"
+
+/* It's safe to use double-precision implementation for single-precision. */
+extern __typeof (__copysignf) __copysign_ppc64 attribute_hidden;
+extern __typeof (__copysignf) __copysign_power6 attribute_hidden;
+
+libc_ifunc (__copysignf,
+ (hwcap & PPC_FEATURE_ARCH_2_05)
+ ? __copysign_power6
+ : __copysign_ppc64);
+
+weak_alias (__copysignf, copysignf)
diff --git a/sysdeps/powerpc/powerpc64/power6/fpu/s_copysignf.S b/sysdeps/powerpc/powerpc64/power6/fpu/s_copysignf.S
deleted file mode 100644
index d4aa702..0000000
--- a/sysdeps/powerpc/powerpc64/power6/fpu/s_copysignf.S
+++ /dev/null
@@ -1 +0,0 @@
-/* This function uses the same code as s_copysign.S. */
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=b94b1bce8479f27eeb406251df55702263623ce4
commit b94b1bce8479f27eeb406251df55702263623ce4
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Fri Jun 7 09:33:39 2013 -0500
PowerPC: trunc/truncf multilib for PowerPC64
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
index cbb6c6a..b1cd4c8 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
@@ -9,5 +9,7 @@ libm-sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \
s_ceil-power5+ s_ceil-ppc64 s_ceilf-power5+ \
s_ceilf-ppc64 s_floor-power5+ s_floor-ppc64 \
s_floorf-power5+ s_floorf-ppc64 s_round-power5+ \
- s_round-ppc64 s_roundf-power5+ s_roundf-ppc64
+ s_round-ppc64 s_roundf-power5+ s_roundf-ppc64 \
+ s_trunc-power5+ s_trunc-ppc64 s_truncf-power5+ \
+ s_truncf-ppc64
endif
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_trunc.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc-power5+.S
similarity index 78%
copy from sysdeps/powerpc/powerpc64/power5+/fpu/s_trunc.S
copy to sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc-power5+.S
index f5803aa..c9b19f3 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_trunc.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc-power5+.S
@@ -20,18 +20,8 @@
#include <math_ldbl_opt.h>
.machine "power5"
-EALIGN (__trunc, 4, 0)
+EALIGN (__trunc_power5plus, 4, 0)
CALL_MCOUNT 0
friz fp1, fp1
blr
- END (__trunc)
-
-weak_alias (__trunc, trunc)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__trunc, truncl)
-strong_alias (__trunc, __truncl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __trunc, truncl, GLIBC_2_1)
-#endif
+END (__trunc_power5plus)
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_truncf.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc-ppc64.S
similarity index 68%
copy from sysdeps/powerpc/powerpc64/power5+/fpu/s_truncf.S
copy to sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc-ppc64.S
index aaaf975..5282609 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_truncf.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc-ppc64.S
@@ -1,5 +1,5 @@
-/* truncf function. PowerPC64/power5+ version.
- Copyright (C) 2006-2013 Free Software Foundation, Inc.
+/* trunc function. PowerPC64 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
@@ -17,14 +17,15 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <math_ldbl_opt.h>
- .machine "power5"
-EALIGN (__truncf, 4, 0)
- CALL_MCOUNT 0
- friz fp1, fp1 /* The rounding instructions are double. */
- frsp fp1, fp1 /* But we need to set ooverflow for float. */
- blr
- END (__truncf)
+#undef weak_alias
+#define weak_alias(a,b)
+#undef strong_alias
+#define strong_alias(a,b)
+#undef compat_symbol
+#define compat_symbol(a,b,c,d)
-weak_alias (__truncf, truncf)
+#define __trunc __trunc_ppc64
+#include <sysdeps/powerpc/powerpc64/fpu/s_trunc.S>
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_trunc.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc.c
similarity index 64%
rename from sysdeps/powerpc/powerpc64/power5+/fpu/s_trunc.S
rename to sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc.c
index f5803aa..a42687c 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_trunc.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc.c
@@ -1,5 +1,5 @@
-/* trunc function. PowerPC64/power5+ version.
- Copyright (C) 2006-2013 Free Software Foundation, Inc.
+/* Multiple versions of trunc.
+ 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
@@ -16,22 +16,25 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
+#include <math.h>
#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
+#include "init-arch.h"
- .machine "power5"
-EALIGN (__trunc, 4, 0)
- CALL_MCOUNT 0
- friz fp1, fp1
- blr
- END (__trunc)
+extern __typeof (__trunc) __trunc_ppc64 attribute_hidden;
+extern __typeof (__trunc) __trunc_power5plus attribute_hidden;
+
+libc_ifunc (__trunc,
+ (hwcap & PPC_FEATURE_POWER5_PLUS)
+ ? __trunc_power5plus
+ : __trunc_ppc64);
weak_alias (__trunc, trunc)
#ifdef NO_LONG_DOUBLE
-weak_alias (__trunc, truncl)
strong_alias (__trunc, __truncl)
+weak_alias (__trunc, truncl)
#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __trunc, truncl, GLIBC_2_1)
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __trunc, truncl, GLIBC_2_0);
#endif
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_truncf.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf-power5+.S
similarity index 93%
copy from sysdeps/powerpc/powerpc64/power5+/fpu/s_truncf.S
copy to sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf-power5+.S
index aaaf975..98fed9b 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_truncf.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf-power5+.S
@@ -19,12 +19,9 @@
#include <sysdep.h>
.machine "power5"
-EALIGN (__truncf, 4, 0)
+EALIGN (__truncf_power5plus, 4, 0)
CALL_MCOUNT 0
friz fp1, fp1 /* The rounding instructions are double. */
frsp fp1, fp1 /* But we need to set ooverflow for float. */
blr
- END (__truncf)
-
-weak_alias (__truncf, truncf)
-
+END (__truncf_power5plus)
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_truncf.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf-ppc64.S
similarity index 69%
copy from sysdeps/powerpc/powerpc64/power5+/fpu/s_truncf.S
copy to sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf-ppc64.S
index aaaf975..ba36dbb 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_truncf.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf-ppc64.S
@@ -1,5 +1,5 @@
-/* truncf function. PowerPC64/power5+ version.
- Copyright (C) 2006-2013 Free Software Foundation, Inc.
+/* truncf function. PowerPC64 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
@@ -17,14 +17,11 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <math_ldbl_opt.h>
- .machine "power5"
-EALIGN (__truncf, 4, 0)
- CALL_MCOUNT 0
- friz fp1, fp1 /* The rounding instructions are double. */
- frsp fp1, fp1 /* But we need to set ooverflow for float. */
- blr
- END (__truncf)
+#undef weak_alias
+#define weak_alias(a,b)
-weak_alias (__truncf, truncf)
+#define __truncf __truncf_ppc64
+#include <sysdeps/powerpc/powerpc64/fpu/s_truncf.S>
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_truncf.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf.c
similarity index 64%
rename from sysdeps/powerpc/powerpc64/power5+/fpu/s_truncf.S
rename to sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf.c
index aaaf975..4602583 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_truncf.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf.c
@@ -1,5 +1,5 @@
-/* truncf function. PowerPC64/power5+ version.
- Copyright (C) 2006-2013 Free Software Foundation, Inc.
+/* Multiple versions of truncf.
+ 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
@@ -16,15 +16,17 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
+#include <math.h>
+#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
+#include "init-arch.h"
- .machine "power5"
-EALIGN (__truncf, 4, 0)
- CALL_MCOUNT 0
- friz fp1, fp1 /* The rounding instructions are double. */
- frsp fp1, fp1 /* But we need to set ooverflow for float. */
- blr
- END (__truncf)
+extern __typeof (__truncf) __truncf_ppc64 attribute_hidden;
+extern __typeof (__truncf) __truncf_power5plus attribute_hidden;
-weak_alias (__truncf, truncf)
+libc_ifunc (__truncf,
+ (hwcap & PPC_FEATURE_POWER5_PLUS)
+ ? __truncf_power5plus
+ : __truncf_ppc64);
+weak_alias (__truncf, truncf)
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=e7d287bd5f25ac02f78202a2910c524d6ad661ab
commit e7d287bd5f25ac02f78202a2910c524d6ad661ab
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Fri Jun 7 09:33:03 2013 -0500
PowerPC: round/roundf multilib for PowerPC64
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
index 6ddef26..cbb6c6a 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
@@ -8,5 +8,6 @@ libm-sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \
s_llround-power6x s_llround-power5+ s_llround-ppc64 \
s_ceil-power5+ s_ceil-ppc64 s_ceilf-power5+ \
s_ceilf-ppc64 s_floor-power5+ s_floor-ppc64 \
- s_floorf-power5+ s_floorf-ppc64
+ s_floorf-power5+ s_floorf-ppc64 s_round-power5+ \
+ s_round-ppc64 s_roundf-power5+ s_roundf-ppc64
endif
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_round.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_round-power5+.S
similarity index 78%
copy from sysdeps/powerpc/powerpc64/power5+/fpu/s_round.S
copy to sysdeps/powerpc/powerpc64/fpu/multiarch/s_round-power5+.S
index 8fa7b62..6cb5f78 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_round.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_round-power5+.S
@@ -20,18 +20,8 @@
#include <math_ldbl_opt.h>
.machine "power5"
-EALIGN (__round, 4, 0)
+EALIGN (__round_power5plus, 4, 0)
CALL_MCOUNT 0
frin fp1, fp1
blr
- END (__round)
-
-weak_alias (__round, round)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__round, roundl)
-strong_alias (__round, __roundl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __round, roundl, GLIBC_2_1)
-#endif
+END (__round_power5plus)
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_roundf.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_round-ppc64.S
similarity index 68%
copy from sysdeps/powerpc/powerpc64/power5+/fpu/s_roundf.S
copy to sysdeps/powerpc/powerpc64/fpu/multiarch/s_round-ppc64.S
index 74abfc7..ed208dd 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_roundf.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_round-ppc64.S
@@ -1,5 +1,5 @@
-/* roundf function. PowerPC64/power5+ version.
- Copyright (C) 2006-2013 Free Software Foundation, Inc.
+/* round function. PowerPC64 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
@@ -17,14 +17,15 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <math_ldbl_opt.h>
- .machine "power5"
-EALIGN (__roundf, 4, 0)
- CALL_MCOUNT 0
- frin fp1, fp1 /* The rounding instructions are double. */
- frsp fp1, fp1 /* But we need to set ooverflow for float. */
- blr
- END (__roundf)
+#undef weak_alias
+#define weak_alias(a,b)
+#undef strong_alias
+#define strong_alias(a,b)
+#undef compat_symbol
+#define compat_symbol(a,b,c,d)
-weak_alias (__roundf, roundf)
+#define __round __round_ppc64
+#include <sysdeps/powerpc/powerpc64/fpu/s_round.S>
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_round.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_round.c
similarity index 64%
rename from sysdeps/powerpc/powerpc64/power5+/fpu/s_round.S
rename to sysdeps/powerpc/powerpc64/fpu/multiarch/s_round.c
index 8fa7b62..cfeac1f 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_round.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_round.c
@@ -1,5 +1,5 @@
-/* round function. PowerPC64/power5+ version.
- Copyright (C) 2006-2013 Free Software Foundation, Inc.
+/* Multiple versions of round.
+ 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
@@ -16,22 +16,25 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
+#include <math.h>
#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
+#include "init-arch.h"
- .machine "power5"
-EALIGN (__round, 4, 0)
- CALL_MCOUNT 0
- frin fp1, fp1
- blr
- END (__round)
+extern __typeof (__round) __round_ppc64 attribute_hidden;
+extern __typeof (__round) __round_power5plus attribute_hidden;
+
+libc_ifunc (__round,
+ (hwcap & PPC_FEATURE_POWER5_PLUS)
+ ? __round_power5plus
+ : __round_ppc64);
weak_alias (__round, round)
#ifdef NO_LONG_DOUBLE
-weak_alias (__round, roundl)
strong_alias (__round, __roundl)
+weak_alias (__round, roundl)
#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __round, roundl, GLIBC_2_1)
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __round, roundl, GLIBC_2_0);
#endif
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_roundf.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf-power5+.S
similarity index 93%
copy from sysdeps/powerpc/powerpc64/power5+/fpu/s_roundf.S
copy to sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf-power5+.S
index 74abfc7..30d9e99 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_roundf.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf-power5+.S
@@ -19,12 +19,9 @@
#include <sysdep.h>
.machine "power5"
-EALIGN (__roundf, 4, 0)
+EALIGN (__roundf_power5plus, 4, 0)
CALL_MCOUNT 0
frin fp1, fp1 /* The rounding instructions are double. */
frsp fp1, fp1 /* But we need to set ooverflow for float. */
blr
- END (__roundf)
-
-weak_alias (__roundf, roundf)
-
+END (__roundf_power5plus)
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_roundf.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf-ppc64.S
similarity index 69%
copy from sysdeps/powerpc/powerpc64/power5+/fpu/s_roundf.S
copy to sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf-ppc64.S
index 74abfc7..72968d0 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_roundf.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf-ppc64.S
@@ -1,5 +1,5 @@
-/* roundf function. PowerPC64/power5+ version.
- Copyright (C) 2006-2013 Free Software Foundation, Inc.
+/* roundf function. PowerPC64 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
@@ -17,14 +17,11 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <math_ldbl_opt.h>
- .machine "power5"
-EALIGN (__roundf, 4, 0)
- CALL_MCOUNT 0
- frin fp1, fp1 /* The rounding instructions are double. */
- frsp fp1, fp1 /* But we need to set ooverflow for float. */
- blr
- END (__roundf)
+#undef weak_alias
+#define weak_alias(a,b)
-weak_alias (__roundf, roundf)
+#define __roundf __roundf_ppc64
+#include <sysdeps/powerpc/powerpc64/fpu/s_roundf.S>
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_roundf.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf.c
similarity index 64%
rename from sysdeps/powerpc/powerpc64/power5+/fpu/s_roundf.S
rename to sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf.c
index 74abfc7..6377354 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_roundf.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf.c
@@ -1,5 +1,5 @@
-/* roundf function. PowerPC64/power5+ version.
- Copyright (C) 2006-2013 Free Software Foundation, Inc.
+/* Multiple versions of roundf.
+ 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
@@ -16,15 +16,17 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
+#include <math.h>
+#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
+#include "init-arch.h"
- .machine "power5"
-EALIGN (__roundf, 4, 0)
- CALL_MCOUNT 0
- frin fp1, fp1 /* The rounding instructions are double. */
- frsp fp1, fp1 /* But we need to set ooverflow for float. */
- blr
- END (__roundf)
+extern __typeof (__roundf) __roundf_ppc64 attribute_hidden;
+extern __typeof (__roundf) __roundf_power5plus attribute_hidden;
-weak_alias (__roundf, roundf)
+libc_ifunc (__roundf,
+ (hwcap & PPC_FEATURE_POWER5_PLUS)
+ ? __roundf_power5plus
+ : __roundf_ppc64);
+weak_alias (__roundf, roundf)
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=03e8dfb8abdd3b2097c38b413f437b64cbca9456
commit 03e8dfb8abdd3b2097c38b413f437b64cbca9456
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Fri Jun 7 09:32:28 2013 -0500
PowerPC: floor/floorf multilib for PowerPC64
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
index 91ed4d2..6ddef26 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
@@ -7,5 +7,6 @@ libm-sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \
s_isnan-power5 s_isnan-ppc64 s_isnanf-ppc64 \
s_llround-power6x s_llround-power5+ s_llround-ppc64 \
s_ceil-power5+ s_ceil-ppc64 s_ceilf-power5+ \
- s_ceilf-ppc64
+ s_ceilf-ppc64 s_floor-power5+ s_floor-ppc64 \
+ s_floorf-power5+ s_floorf-ppc64
endif
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_floor.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floor-power5+.S
similarity index 78%
copy from sysdeps/powerpc/powerpc64/power5+/fpu/s_floor.S
copy to sysdeps/powerpc/powerpc64/fpu/multiarch/s_floor-power5+.S
index 4e09d40..46e2f11 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_floor.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floor-power5+.S
@@ -20,18 +20,8 @@
#include <math_ldbl_opt.h>
.machine "power5"
-EALIGN (__floor, 4, 0)
+EALIGN (__floor_power5plus, 4, 0)
CALL_MCOUNT 0
frim fp1, fp1
blr
- END (__floor)
-
-weak_alias (__floor, floor)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__floor, floorl)
-strong_alias (__floor, __floorl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __floor, floorl, GLIBC_2_0)
-#endif
+END (__floor_power5plus)
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_floorf.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floor-ppc64.S
similarity index 68%
copy from sysdeps/powerpc/powerpc64/power5+/fpu/s_floorf.S
copy to sysdeps/powerpc/powerpc64/fpu/multiarch/s_floor-ppc64.S
index ae6ab62..50db6d8 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_floorf.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floor-ppc64.S
@@ -1,5 +1,5 @@
-/* floorf function. PowerPC64/power5+ version.
- Copyright (C) 2006-2013 Free Software Foundation, Inc.
+/* floor function. PowerPC64 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
@@ -17,14 +17,15 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <math_ldbl_opt.h>
- .machine "power5"
-EALIGN (__floorf, 4, 0)
- CALL_MCOUNT 0
- frim fp1, fp1 /* The rounding instructions are double. */
- frsp fp1, fp1 /* But we need to set ooverflow for float. */
- blr
- END (__floorf)
+#undef weak_alias
+#define weak_alias(a,b)
+#undef strong_alias
+#define strong_alias(a,b)
+#undef compat_symbol
+#define compat_symbol(a,b,c,d)
-weak_alias (__floorf, floorf)
+#define __floor __floor_ppc64
+#include <sysdeps/powerpc/powerpc64/fpu/s_floor.S>
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_floor.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floor.c
similarity index 67%
rename from sysdeps/powerpc/powerpc64/power5+/fpu/s_floor.S
rename to sysdeps/powerpc/powerpc64/fpu/multiarch/s_floor.c
index 4e09d40..12a1bae 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_floor.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floor.c
@@ -1,5 +1,5 @@
-/* floor function. PowerPC64/power5+ version.
- Copyright (C) 2006-2013 Free Software Foundation, Inc.
+/* Multiple versions of floor.
+ 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
@@ -16,22 +16,25 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
+#include <math.h>
#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
+#include "init-arch.h"
- .machine "power5"
-EALIGN (__floor, 4, 0)
- CALL_MCOUNT 0
- frim fp1, fp1
- blr
- END (__floor)
+extern __typeof (__floor) __floor_ppc64 attribute_hidden;
+extern __typeof (__floor) __floor_power5plus attribute_hidden;
+
+libc_ifunc (__floor,
+ (hwcap & PPC_FEATURE_POWER5_PLUS)
+ ? __floor_power5plus
+ : __floor_ppc64);
weak_alias (__floor, floor)
#ifdef NO_LONG_DOUBLE
-weak_alias (__floor, floorl)
strong_alias (__floor, __floorl)
+weak_alias (__floor, floorl)
#endif
#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __floor, floorl, GLIBC_2_0)
+compat_symbol (libm, __floor, floorl, GLIBC_2_0);
#endif
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_floorf.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf-power5+.S
similarity index 93%
copy from sysdeps/powerpc/powerpc64/power5+/fpu/s_floorf.S
copy to sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf-power5+.S
index ae6ab62..87e9ab6 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_floorf.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf-power5+.S
@@ -19,12 +19,9 @@
#include <sysdep.h>
.machine "power5"
-EALIGN (__floorf, 4, 0)
+EALIGN (__floorf_power5plus, 4, 0)
CALL_MCOUNT 0
frim fp1, fp1 /* The rounding instructions are double. */
frsp fp1, fp1 /* But we need to set ooverflow for float. */
blr
- END (__floorf)
-
-weak_alias (__floorf, floorf)
-
+END (__floorf_power5plus)
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_floorf.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf-ppc64.S
similarity index 69%
copy from sysdeps/powerpc/powerpc64/power5+/fpu/s_floorf.S
copy to sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf-ppc64.S
index ae6ab62..7c8b99c 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_floorf.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf-ppc64.S
@@ -1,5 +1,5 @@
-/* floorf function. PowerPC64/power5+ version.
- Copyright (C) 2006-2013 Free Software Foundation, Inc.
+/* floorf function. PowerPC64 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
@@ -17,14 +17,11 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <math_ldbl_opt.h>
- .machine "power5"
-EALIGN (__floorf, 4, 0)
- CALL_MCOUNT 0
- frim fp1, fp1 /* The rounding instructions are double. */
- frsp fp1, fp1 /* But we need to set ooverflow for float. */
- blr
- END (__floorf)
+#undef weak_alias
+#define weak_alias(a,b)
-weak_alias (__floorf, floorf)
+#define __floorf __floorf_ppc64
+#include <sysdeps/powerpc/powerpc64/fpu/s_floorf.S>
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_floorf.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf.c
similarity index 64%
rename from sysdeps/powerpc/powerpc64/power5+/fpu/s_floorf.S
rename to sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf.c
index ae6ab62..c7b753f 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_floorf.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf.c
@@ -1,5 +1,5 @@
-/* floorf function. PowerPC64/power5+ version.
- Copyright (C) 2006-2013 Free Software Foundation, Inc.
+/* Multiple versions of floorf.
+ 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
@@ -16,15 +16,17 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
+#include <math.h>
+#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
+#include "init-arch.h"
- .machine "power5"
-EALIGN (__floorf, 4, 0)
- CALL_MCOUNT 0
- frim fp1, fp1 /* The rounding instructions are double. */
- frsp fp1, fp1 /* But we need to set ooverflow for float. */
- blr
- END (__floorf)
+extern __typeof (__floorf) __floorf_ppc64 attribute_hidden;
+extern __typeof (__floorf) __floorf_power5plus attribute_hidden;
-weak_alias (__floorf, floorf)
+libc_ifunc (__floorf,
+ (hwcap & PPC_FEATURE_POWER5_PLUS)
+ ? __floorf_power5plus
+ : __floorf_ppc64);
+weak_alias (__floorf, floorf)
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=f1c365abb746a1cc85d6ef31f8cbc63d4f7be9db
commit f1c365abb746a1cc85d6ef31f8cbc63d4f7be9db
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Fri Jun 7 09:31:35 2013 -0500
PowerPC: ceil/ceilf multilib for PowerPC64
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
index f6953ea..91ed4d2 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
@@ -5,5 +5,7 @@ sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \
libm-sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \
s_isnan-power5 s_isnan-ppc64 s_isnanf-ppc64 \
- s_llround-power6x s_llround-power5+ s_llround-ppc64
+ s_llround-power6x s_llround-power5+ s_llround-ppc64 \
+ s_ceil-power5+ s_ceil-ppc64 s_ceilf-power5+ \
+ s_ceilf-ppc64
endif
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_ceil.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil-power5+.S
similarity index 79%
copy from sysdeps/powerpc/powerpc64/power5+/fpu/s_ceil.S
copy to sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil-power5+.S
index efb7c7f..576aa5d 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_ceil.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil-power5+.S
@@ -20,18 +20,8 @@
#include <math_ldbl_opt.h>
.machine "power5"
-EALIGN (__ceil, 4, 0)
+EALIGN (__ceil_power5plus, 4, 0)
CALL_MCOUNT 0
frip fp1, fp1
blr
- END (__ceil)
-
-weak_alias (__ceil, ceil)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__ceil, ceill)
-strong_alias (__ceil, __ceill)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __ceil, ceill, GLIBC_2_0)
-#endif
+END (__ceil_power5plus)
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_ceilf.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil-ppc64.S
similarity index 68%
copy from sysdeps/powerpc/powerpc64/power5+/fpu/s_ceilf.S
copy to sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil-ppc64.S
index 985a130..4539c17 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_ceilf.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil-ppc64.S
@@ -1,5 +1,5 @@
-/* ceilf function. PowerPC64/power5+ version.
- Copyright (C) 2006-2013 Free Software Foundation, Inc.
+/* ceil function. PowerPC64 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
@@ -17,14 +17,15 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <math_ldbl_opt.h>
- .machine "power5"
-EALIGN (__ceilf, 4, 0)
- CALL_MCOUNT 0
- frip fp1, fp1 /* The rounding instructions are double. */
- frsp fp1, fp1 /* But we need to set ooverflow for float. */
- blr
- END (__ceilf)
+#undef weak_alias
+#define weak_alias(a,b)
+#undef strong_alias
+#define strong_alias(a,b)
+#undef compat_symbol
+#define compat_symbol(a,b,c,d)
-weak_alias (__ceilf, ceilf)
+#define __ceil __ceil_ppc64
+#include <sysdeps/powerpc/powerpc64/fpu/s_ceil.S>
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_ceil.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil.c
similarity index 68%
rename from sysdeps/powerpc/powerpc64/power5+/fpu/s_ceil.S
rename to sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil.c
index efb7c7f..587c0dc 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_ceil.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil.c
@@ -1,5 +1,5 @@
-/* ceil function. PowerPC64/power5+ version.
- Copyright (C) 2006-2013 Free Software Foundation, Inc.
+/* Multiple versions of ceil.
+ 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
@@ -16,22 +16,25 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
+#include <math.h>
#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
+#include "init-arch.h"
- .machine "power5"
-EALIGN (__ceil, 4, 0)
- CALL_MCOUNT 0
- frip fp1, fp1
- blr
- END (__ceil)
+extern __typeof (__ceil) __ceil_ppc64 attribute_hidden;
+extern __typeof (__ceil) __ceil_power5plus attribute_hidden;
+
+libc_ifunc (__ceil,
+ (hwcap & PPC_FEATURE_POWER5_PLUS)
+ ? __ceil_power5plus
+ : __ceil_ppc64);
weak_alias (__ceil, ceil)
#ifdef NO_LONG_DOUBLE
-weak_alias (__ceil, ceill)
strong_alias (__ceil, __ceill)
+weak_alias (__ceil, ceill)
#endif
#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __ceil, ceill, GLIBC_2_0)
+compat_symbol (libm, __ceil, ceill, GLIBC_2_0);
#endif
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_ceilf.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf-power5+.S
similarity index 93%
copy from sysdeps/powerpc/powerpc64/power5+/fpu/s_ceilf.S
copy to sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf-power5+.S
index 985a130..81263dc 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_ceilf.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf-power5+.S
@@ -19,12 +19,9 @@
#include <sysdep.h>
.machine "power5"
-EALIGN (__ceilf, 4, 0)
+EALIGN (__ceilf_power5plus, 4, 0)
CALL_MCOUNT 0
frip fp1, fp1 /* The rounding instructions are double. */
frsp fp1, fp1 /* But we need to set ooverflow for float. */
blr
- END (__ceilf)
-
-weak_alias (__ceilf, ceilf)
-
+END (__ceilf_power5plus)
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_ceilf.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf-ppc64.S
similarity index 69%
copy from sysdeps/powerpc/powerpc64/power5+/fpu/s_ceilf.S
copy to sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf-ppc64.S
index 985a130..84bef47 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_ceilf.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf-ppc64.S
@@ -1,5 +1,5 @@
-/* ceilf function. PowerPC64/power5+ version.
- Copyright (C) 2006-2013 Free Software Foundation, Inc.
+/* ceilf function. PowerPC64 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
@@ -17,14 +17,11 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <math_ldbl_opt.h>
- .machine "power5"
-EALIGN (__ceilf, 4, 0)
- CALL_MCOUNT 0
- frip fp1, fp1 /* The rounding instructions are double. */
- frsp fp1, fp1 /* But we need to set ooverflow for float. */
- blr
- END (__ceilf)
+#undef weak_alias
+#define weak_alias(a,b)
-weak_alias (__ceilf, ceilf)
+#define __ceilf __ceilf_ppc64
+#include <sysdeps/powerpc/powerpc64/fpu/s_ceilf.S>
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_ceilf.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf.c
similarity index 64%
rename from sysdeps/powerpc/powerpc64/power5+/fpu/s_ceilf.S
rename to sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf.c
index 985a130..a651745 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_ceilf.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf.c
@@ -1,5 +1,5 @@
-/* ceilf function. PowerPC64/power5+ version.
- Copyright (C) 2006-2013 Free Software Foundation, Inc.
+/* Multiple versions of ceilf.
+ 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
@@ -16,15 +16,17 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
+#include <math.h>
+#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
+#include "init-arch.h"
- .machine "power5"
-EALIGN (__ceilf, 4, 0)
- CALL_MCOUNT 0
- frip fp1, fp1 /* The rounding instructions are double. */
- frsp fp1, fp1 /* But we need to set ooverflow for float. */
- blr
- END (__ceilf)
+extern __typeof (__ceilf) __ceilf_ppc64 attribute_hidden;
+extern __typeof (__ceilf) __ceilf_power5plus attribute_hidden;
-weak_alias (__ceilf, ceilf)
+libc_ifunc (__ceilf,
+ (hwcap & PPC_FEATURE_POWER5_PLUS)
+ ? __ceilf_power5plus
+ : __ceilf_ppc64);
+weak_alias (__ceilf, ceilf)
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=bfc9a59b43eec9a6bdc55b7b0b93a5b97a1d8fea
commit bfc9a59b43eec9a6bdc55b7b0b93a5b97a1d8fea
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Fri Jun 7 09:31:00 2013 -0500
PowerPC: llround multilib for PowerPC64
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
index ec2b1f0..f6953ea 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
@@ -1,7 +1,9 @@
ifeq ($(subdir),math)
sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \
- s_isnan-power5 s_isnan-ppc64 s_isnanf-ppc64
+ s_isnan-power5 s_isnan-ppc64 s_isnanf-ppc64 \
+ s_llround-power6x s_llround-power5+ s_llround-ppc64
libm-sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \
- s_isnan-power5 s_isnan-ppc64 s_isnanf-ppc64
+ s_isnan-power5 s_isnan-ppc64 s_isnanf-ppc64 \
+ s_llround-power6x s_llround-power5+ s_llround-ppc64
endif
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_llround.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power5+.S
similarity index 79%
rename from sysdeps/powerpc/powerpc64/power5+/fpu/s_llround.S
rename to sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power5+.S
index 28df006..103008e 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_llround.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power5+.S
@@ -30,7 +30,7 @@
round to zero instruction. */
.machine "power5"
-EALIGN (__llround, 4, 0)
+EALIGN (__llround_power5plus, 4, 0)
CALL_MCOUNT 0
frin fp2, fp1 /* Round to nearest +-0.5. */
fctidz fp3, fp2 /* Convert To Integer DW round toward 0. */
@@ -40,19 +40,4 @@ EALIGN (__llround, 4, 0)
nop
ld r3, -16(r1)
blr
- END (__llround)
-
-strong_alias (__llround, __lround)
-weak_alias (__llround, llround)
-weak_alias (__lround, lround)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__llround, llroundl)
-strong_alias (__llround, __llroundl)
-weak_alias (__lround, lroundl)
-strong_alias (__lround, __lroundl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llround, llroundl, GLIBC_2_1)
-compat_symbol (libm, __lround, lroundl, GLIBC_2_1)
-#endif
+END (__llround_power5plus)
diff --git a/sysdeps/powerpc/powerpc64/power6x/fpu/s_llround.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power6x.S
similarity index 78%
rename from sysdeps/powerpc/powerpc64/power6x/fpu/s_llround.S
rename to sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power6x.S
index 45aacea..1d5e135 100644
--- a/sysdeps/powerpc/powerpc64/power6x/fpu/s_llround.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power6x.S
@@ -30,25 +30,10 @@
round to zero instruction. */
.machine "power6"
-ENTRY (__llround)
+ENTRY (__llround_power6x)
CALL_MCOUNT 0
frin fp2,fp1 /* Round to nearest +-0.5. */
fctidz fp3,fp2 /* Convert To Integer DW round toward 0. */
mftgpr r3,fp3 /* Transfer integer to R3. */
blr
- END (__llround)
-
-strong_alias (__llround, __lround)
-weak_alias (__llround, llround)
-weak_alias (__lround, lround)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__llround, llroundl)
-strong_alias (__llround, __llroundl)
-weak_alias (__lround, lroundl)
-strong_alias (__lround, __lroundl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llround, llroundl, GLIBC_2_1)
-compat_symbol (libm, __lround, lroundl, GLIBC_2_1)
-#endif
+END (__llround_power6x)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-ppc64.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-ppc64.S
new file mode 100644
index 0000000..2078ea9
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-ppc64.S
@@ -0,0 +1,29 @@
+/* llround(). PowerPC64 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>
+
+#undef compat_symbol
+#define compat_symbol(a,b,c,d)
+
+#define __llround __llround_ppc64
+#define __lround __lround_ppc64
+
+#include <sysdeps/powerpc/powerpc64/fpu/s_llround.S>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround.c
new file mode 100644
index 0000000..5548969
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround.c
@@ -0,0 +1,44 @@
+/* Multiple versions of llround.
+ 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 (__llround) __llround_ppc64 attribute_hidden;
+extern __typeof (__llround) __llround_power5plus attribute_hidden;
+extern __typeof (__llround) __llround_power6x attribute_hidden;
+
+libc_ifunc (__llround,
+ (hwcap & PPC_FEATURE_POWER6_EXT)
+ ? __llround_power6x :
+ (hwcap & PPC_FEATURE_POWER5_PLUS)
+ ? __llround_power5plus
+ : __llround_ppc64);
+
+weak_alias (__llround, llround)
+
+#ifdef NO_LONG_DOUBLE
+weak_alias (__llround, llroundl)
+strong_alias (__llround, __llroundl)
+#endif
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __llround, llroundl, GLIBC_2_1);
+compat_symbol (libm, llround, lroundl, GLIBC_2_1);
+#endif
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=49d501d39a3f44f027604bb877d3f4479b579757
commit 49d501d39a3f44f027604bb877d3f4479b579757
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Fri Jun 7 09:29:45 2013 -0500
PowerPC: isnan/isnanf multilib for PowerPC64
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
new file mode 100644
index 0000000..ec2b1f0
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
@@ -0,0 +1,7 @@
+ifeq ($(subdir),math)
+sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \
+ s_isnan-power5 s_isnan-ppc64 s_isnanf-ppc64
+
+libm-sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \
+ s_isnan-power5 s_isnan-ppc64 s_isnanf-ppc64
+endif
diff --git a/sysdeps/powerpc/powerpc64/power5/fpu/s_isnan.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power5.S
similarity index 70%
rename from sysdeps/powerpc/powerpc64/power5/fpu/s_isnan.S
rename to sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power5.S
index 8319d6e..85b239b 100644
--- a/sysdeps/powerpc/powerpc64/power5/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power5.S
@@ -21,7 +21,7 @@
/* int __isnan(x) */
.machine power5
-EALIGN (__isnan, 4, 0)
+EALIGN (__isnan_power5, 4, 0)
CALL_MCOUNT 0
stfd fp1,-8(r1) /* copy FPR to GPR */
lis r0,0x7ff0
@@ -35,26 +35,4 @@ EALIGN (__isnan, 4, 0)
blelr+ cr7
li r3,1 /* else return 1 */
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
-
+END (__isnan_power5)
diff --git a/sysdeps/powerpc/powerpc64/power6/fpu/s_isnan.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power6.S
similarity index 69%
copy from sysdeps/powerpc/powerpc64/power6/fpu/s_isnan.S
copy to sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power6.S
index d4515d6..e883c0e 100644
--- a/sysdeps/powerpc/powerpc64/power6/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power6.S
@@ -21,7 +21,7 @@
/* int __isnan(x) */
.machine power6
-EALIGN (__isnan, 4, 0)
+EALIGN (__isnan_power6, 4, 0)
CALL_MCOUNT 0
stfd fp1,-8(r1) /* copy FPR to GPR */
ori r1,r1,0
@@ -34,26 +34,4 @@ EALIGN (__isnan, 4, 0)
blelr+ cr7
li r3,1 /* else return 1 */
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
-
+END (__isnan_power6)
diff --git a/sysdeps/powerpc/powerpc64/power6x/fpu/s_isnan.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power6x.S
similarity index 69%
rename from sysdeps/powerpc/powerpc64/power6x/fpu/s_isnan.S
rename to sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power6x.S
index d29fe9e..518aede 100644
--- a/sysdeps/powerpc/powerpc64/power6x/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power6x.S
@@ -21,7 +21,7 @@
/* int __isnan(x) */
.machine power6
-EALIGN (__isnan, 4, 0)
+EALIGN (__isnan_power6x, 4, 0)
CALL_MCOUNT 0
mftgpr r4,fp1 /* copy FPR to GPR */
lis r0,0x7ff0
@@ -33,26 +33,4 @@ EALIGN (__isnan, 4, 0)
blelr+ cr7
li r3,1 /* else return 1 */
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
-
+END (__isnan_power6x)
diff --git a/sysdeps/powerpc/powerpc64/power7/fpu/s_isnan.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power7.S
similarity index 75%
rename from sysdeps/powerpc/powerpc64/power7/fpu/s_isnan.S
rename to sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power7.S
index 3380bf9..cda98b8 100644
--- a/sysdeps/powerpc/powerpc64/power7/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power7.S
@@ -27,7 +27,7 @@
.section ".text"
.type __isnan, @function
.machine power7
-EALIGN (__isnan, 4, 0)
+EALIGN (__isnan_power7, 4, 0)
CALL_MCOUNT 0
lfd fp0,.LC0@toc(r2)
ftdiv cr7,fp1,fp0
@@ -44,25 +44,4 @@ EALIGN (__isnan, 4, 0)
blelr cr7 /* LE means not NaN. */
li r3,1 /* else return 1 */
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
+END (__isnan_power7)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-ppc64.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-ppc64.S
new file mode 100644
index 0000000..22abdef
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-ppc64.S
@@ -0,0 +1,33 @@
+/* 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>
+
+#undef weak_alias
+#define weak_alias(a,b)
+#undef strong_alias
+#define strong_alias(a,b)
+
+#define __isnan __isnan_ppc64
+#undef hidden_def
+#define hidden_def(name) \
+ .globl __GI___isnan ; .set __GI___isnan,__isnan_ppc64
+
+#include <sysdeps/powerpc/powerpc64/fpu/s_isnan.S>
diff --git a/sysdeps/powerpc/powerpc64/power6/fpu/s_isnan.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c
similarity index 59%
rename from sysdeps/powerpc/powerpc64/power6/fpu/s_isnan.S
rename to sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c
index d4515d6..70353df 100644
--- a/sysdeps/powerpc/powerpc64/power6/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c
@@ -1,5 +1,5 @@
-/* isnan(). PowerPC64 version.
- Copyright (C) 2008-2013 Free Software Foundation, Inc.
+/* 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
@@ -16,35 +16,30 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
+#include <math.h>
#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
+#include "init-arch.h"
+
+extern __typeof (__isnan) __isnan_ppc64 attribute_hidden;
+extern __typeof (__isnan) __isnan_power5 attribute_hidden;
+extern __typeof (__isnan) __isnan_power6 attribute_hidden;
+extern __typeof (__isnan) __isnan_power6x attribute_hidden;
+extern __typeof (__isnan) __isnan_power7 attribute_hidden;
+
+libc_ifunc (__isnan,
+ (hwcap & PPC_FEATURE_ARCH_2_06)
+ ? __isnan_power7 :
+ (hwcap & PPC_FEATURE_POWER6_EXT)
+ ? __isnan_power6x :
+ (hwcap & PPC_FEATURE_ARCH_2_05)
+ ? __isnan_power6 :
+ (hwcap & PPC_FEATURE_POWER5)
+ ? __isnan_power5
+ : __isnan_ppc64);
-/* int __isnan(x) */
- .machine power6
-EALIGN (__isnan, 4, 0)
- CALL_MCOUNT 0
- stfd fp1,-8(r1) /* copy FPR to GPR */
- ori r1,r1,0
- ld r4,-8(r1)
- lis r0,0x7ff0
- sldi r0,r0,32 /* const long r0 0x7ff00000 00000000 */
- clrldi r4,r4,1 /* x = fabs(x) */
- cmpd cr7,r4,r0 /* if (fabs(x) <= inf) */
- li r3,0 /* then return 0 */
- blelr+ cr7
- li r3,1 /* else return 1 */
- 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)
@@ -56,4 +51,3 @@ compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0);
compat_symbol (libc, isnan, isnanl, GLIBC_2_0);
# endif
#endif
-
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnanf-ppc64.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnanf-ppc64.S
new file mode 100644
index 0000000..b37250e
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnanf-ppc64.S
@@ -0,0 +1,33 @@
+/* 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>
+
+#undef weak_alias
+#define weak_alias(a,b)
+#undef strong_alias
+#define strong_alias(a,b)
+
+#define __isnan __isnanf_ppc64
+#undef hidden_def
+#define hidden_def(name) \
+ .globl __GI___isnanf ; .set __GI___isnanf,__isnanf_ppc64
+
+#include <sysdeps/powerpc/powerpc64/fpu/s_isnan.S>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnanf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnanf.c
new file mode 100644
index 0000000..3e80b69
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnanf.c
@@ -0,0 +1,40 @@
+/* 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 "init-arch.h"
+
+/* The double-precision implementation also works for the single one. */
+extern __typeof (__isnanf) __isnan_ppc64 attribute_hidden;
+extern __typeof (__isnanf) __isnan_power5 attribute_hidden;
+extern __typeof (__isnanf) __isnan_power6 attribute_hidden;
+extern __typeof (__isnanf) __isnan_power6x attribute_hidden;
+extern __typeof (__isnanf) __isnan_power7 attribute_hidden;
+
+libc_ifunc (__isnanf,
+ (hwcap & PPC_FEATURE_ARCH_2_06)
+ ? __isnan_power7 :
+ (hwcap & PPC_FEATURE_POWER6_EXT)
+ ? __isnan_power6x :
+ (hwcap & PPC_FEATURE_ARCH_2_05)
+ ? __isnan_power6 :
+ (hwcap & PPC_FEATURE_POWER5)
+ ? __isnan_power5
+ : __isnan_ppc64);
+
+weak_alias (__isnanf, isnanf)
diff --git a/sysdeps/powerpc/powerpc64/power7/fpu/s_isnanf.S b/sysdeps/powerpc/powerpc64/power7/fpu/s_isnanf.S
deleted file mode 100644
index b48c85e..0000000
--- a/sysdeps/powerpc/powerpc64/power7/fpu/s_isnanf.S
+++ /dev/null
@@ -1 +0,0 @@
-/* This function uses the same code as s_isnan.S. */
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=998176992c6a844f08b4c834f67a2f757e02b29e
commit 998176992c6a844f08b4c834f67a2f757e02b29e
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Fri Jun 7 09:28:46 2013 -0500
PowerPC: sqrt/sqrtf cleanup for PowerPC64
diff --git a/sysdeps/powerpc/powerpc64/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc64/fpu/e_sqrt.c
deleted file mode 100644
index 3cc0619..0000000
--- a/sysdeps/powerpc/powerpc64/fpu/e_sqrt.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Double-precision floating point square root.
- Copyright (C) 1997-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_private.h>
-
-#undef __ieee754_sqrt
-double
-__ieee754_sqrt (double x)
-{
- double z;
- __asm __volatile ("fsqrt %0,%1" : "=f" (z) : "f" (x));
- return z;
-}
-strong_alias (__ieee754_sqrt, __sqrt_finite)
diff --git a/sysdeps/powerpc/powerpc64/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc64/fpu/e_sqrtf.c
deleted file mode 100644
index 27d8b7c..0000000
--- a/sysdeps/powerpc/powerpc64/fpu/e_sqrtf.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Single-precision floating point square root.
- Copyright (C) 1997-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_private.h>
-
-#undef __ieee754_sqrtf
-float
-__ieee754_sqrtf (float x)
-{
- double z;
- __asm ("fsqrts %0,%1" : "=f" (z) : "f" (x));
- return z;
-}
-strong_alias (__ieee754_sqrtf, __sqrtf_finite)
diff --git a/sysdeps/powerpc/powerpc64/power4/fpu/w_sqrt.c b/sysdeps/powerpc/powerpc64/fpu/w_sqrt.c
similarity index 72%
rename from sysdeps/powerpc/powerpc64/power4/fpu/w_sqrt.c
rename to sysdeps/powerpc/powerpc64/fpu/w_sqrt.c
index 78bba57..99b7c0e 100644
--- a/sysdeps/powerpc/powerpc64/power4/fpu/w_sqrt.c
+++ b/sysdeps/powerpc/powerpc64/fpu/w_sqrt.c
@@ -22,33 +22,23 @@
#include <fenv_libc.h>
double
-__sqrt (double x) /* wrapper sqrt */
+__sqrt (double x)
{
double z;
-/* Power4 (ISA V2.0) and above implement sqrt in hardware. */
- __asm __volatile (
+ /* Power4 (ISA V2.0) and above implement sqrt in hardware. */
+ __asm __volatile (
" fsqrt %0,%1\n"
: "=f" (z)
: "f" (x));
-#ifdef _IEEE_LIBM
- return z;
-#else
- if (__builtin_expect (_LIB_VERSION == _IEEE_, 0))
- return z;
-
- if (__builtin_expect (x != x, 0))
- return z;
- if (__builtin_expect (x < 0.0, 0))
- return __kernel_standard (x, x, 26); /* sqrt(negative) */
- else
- return z;
-#endif
+ if (__builtin_expect (isless (x, 0.0), 0) && _LIB_VERSION != _IEEE_)
+ return __kernel_standard (x, x, 26); /* sqrt(negative) */
+ return z;
}
weak_alias (__sqrt, sqrt)
#ifdef NO_LONG_DOUBLE
- strong_alias (__sqrt, __sqrtl) weak_alias (__sqrt, sqrtl)
+strong_alias (__sqrt, __sqrtl) weak_alias (__sqrt, sqrtl)
#endif
#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
compat_symbol (libm, __sqrt, sqrtl, GLIBC_2_0);
diff --git a/sysdeps/powerpc/powerpc64/power4/fpu/w_sqrtf.c b/sysdeps/powerpc/powerpc64/fpu/w_sqrtf.c
similarity index 73%
rename from sysdeps/powerpc/powerpc64/power4/fpu/w_sqrtf.c
rename to sysdeps/powerpc/powerpc64/fpu/w_sqrtf.c
index 12d9f62..97eaf63 100644
--- a/sysdeps/powerpc/powerpc64/power4/fpu/w_sqrtf.c
+++ b/sysdeps/powerpc/powerpc64/fpu/w_sqrtf.c
@@ -26,28 +26,15 @@
float
__sqrtf (float x) /* wrapper sqrtf */
{
-#ifdef _IEEE_LIBM
- return __ieee754_sqrtf (x);
-#else
float z;
-/* Power4 (ISA V2.0) and above implement sqrtf in hardware. */
+ /* Power4 (ISA V2.0) and above implement sqrtf in hardware. */
__asm __volatile (
" fsqrts %0,%1\n"
: "=f" (z)
: "f" (x));
+ if (__builtin_expect (isless (x, 0.0f), 0) && _LIB_VERSION != _IEEE_)
+ return __kernel_standard_f (x, x, 126); /* sqrtf(negative) */
- if (__builtin_expect (_LIB_VERSION == _IEEE_, 0))
- return z;
-
- if (__builtin_expect (x != x, 0))
- return z;
-
- if (__builtin_expect (x < 0.0, 0))
- /* sqrtf(negative) */
- return (float) __kernel_standard ((double) x, (double) x, 126);
- else
- return z;
-#endif
+ return z;
}
-
weak_alias (__sqrtf, sqrtf)
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=43493177ab40076f7ac2718ee5dfd595723d3b26
commit 43493177ab40076f7ac2718ee5dfd595723d3b26
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Fri Jun 7 09:27:52 2013 -0500
PowerPC: change sysdeps fpu folder
This patch makes the fpu/multiarch folder appears in front of the
powerpc64/fpu folder.
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/Implies
deleted file mode 100644
index 6243d2e..0000000
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/Implies
+++ /dev/null
@@ -1,2 +0,0 @@
-# Override ldbl-opt with powerpc64 specific routines.
-powerpc/powerpc64/fpu
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=37e20383edb3acdabb76133ad60a3271bf8867f6
commit 37e20383edb3acdabb76133ad60a3271bf8867f6
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Fri Jun 7 09:27:09 2013 -0500
PowerPC: wordcopy functions multilib for PowerPC64
diff --git a/sysdeps/powerpc/powerpc64/multiarch/Makefile b/sysdeps/powerpc/powerpc64/multiarch/Makefile
index 73da34c..9a530a7 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc64/multiarch/Makefile
@@ -11,7 +11,9 @@ sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
strncmp-power4 strncmp-ppc64 strchr-power7 strchr-ppc64 \
strchrnul-power7 strchrnul-ppc64 wcschr-power7 \
wcschr-power6 wcschr-ppc64 wcsrchr-power7 wcsrchr-power6 \
- wcsrchr-ppc64 wcscpy-power7 wcscpy-power6 wcscpy-ppc64
+ wcsrchr-ppc64 wcscpy-power7 wcscpy-power6 wcscpy-ppc64 \
+ wordcopy-power7 wordcopy-power6 wordcopy-power5 \
+ wordcopy-power4 wordcopy-ppc64
CFLAGS-strncase-power7.c += -mcpu=power7 -funroll-loops
CFLAGS-strncase_l-power7.c += -mcpu=power7 -funroll-loops
@@ -21,4 +23,8 @@ CFLAGS-wcsrchr-power7.c += -mcpu=power7
CFLAGS-wcsrchr-power6.c += -mcpu=power6
CFLAGS-wcscpy-power7.c += -mcpu=power7
CFLAGS-wcscpy-power6.c += -mcpu=power6
+CFLAGS-wordcopy-power7.c += -mcpu=power7
+CFLAGS-wordcopy-power6.c += -mcpu=power6
+CFLAGS-wordcopy-power4.c += -mcpu=power4
+CFLAGS-wordcopy-power5.c += -mcpu=power5
endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wordcopy-power4.c b/sysdeps/powerpc/powerpc64/multiarch/wordcopy-power4.c
new file mode 100644
index 0000000..2611e93
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/wordcopy-power4.c
@@ -0,0 +1,18 @@
+/* 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 <sysdeps/powerpc/powerpc32/multiarch/wordcopy-power4.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wordcopy-power5.c b/sysdeps/powerpc/powerpc64/multiarch/wordcopy-power5.c
new file mode 100644
index 0000000..49a9d58
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/wordcopy-power5.c
@@ -0,0 +1,18 @@
+/* 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 <sysdeps/powerpc/powerpc32/multiarch/wordcopy-power5.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wordcopy-power6.c b/sysdeps/powerpc/powerpc64/multiarch/wordcopy-power6.c
new file mode 100644
index 0000000..3f073c3
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/wordcopy-power6.c
@@ -0,0 +1,18 @@
+/* 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 <sysdeps/powerpc/powerpc32/multiarch/wordcopy-power6.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wordcopy-power7.c b/sysdeps/powerpc/powerpc64/multiarch/wordcopy-power7.c
new file mode 100644
index 0000000..deb8de1
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/wordcopy-power7.c
@@ -0,0 +1,18 @@
+/* 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 <sysdeps/powerpc/powerpc32/multiarch/wordcopy-power7.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wordcopy-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/wordcopy-ppc64.c
new file mode 100644
index 0000000..43e64d1
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/wordcopy-ppc64.c
@@ -0,0 +1,23 @@
+/* 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/>. */
+
+#define WORDCOPY_FWD_ALIGNED _wordcopy_fwd_aligned_ppc64
+#define WORDCOPY_FWD_DEST_ALIGNED _wordcopy_fwd_dest_aligned_ppc64
+#define WORDCOPY_BWD_ALIGNED _wordcopy_bwd_aligned_ppc64
+#define WORDCOPY_BWD_DEST_ALIGNED _wordcopy_bwd_dest_aligned_ppc64
+
+#include <string/wordcopy.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wordcopy.c b/sysdeps/powerpc/powerpc64/multiarch/wordcopy.c
new file mode 100644
index 0000000..49f9bff
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/wordcopy.c
@@ -0,0 +1,118 @@
+/* Multiple versions of wordcopy functions.
+ 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/>. */
+
+#ifndef NOT_IN_libc
+# include <stddef.h>
+# include <memcopy.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+extern __typeof (_wordcopy_fwd_aligned) _wordcopy_fwd_aligned_ppc64
+attribute_hidden;
+extern __typeof (_wordcopy_fwd_aligned) _wordcopy_fwd_aligned_power4
+attribute_hidden;
+extern __typeof (_wordcopy_fwd_aligned) _wordcopy_fwd_aligned_power5
+attribute_hidden;
+extern __typeof (_wordcopy_fwd_aligned) _wordcopy_fwd_aligned_power6
+attribute_hidden;
+extern __typeof (_wordcopy_fwd_aligned) _wordcopy_fwd_aligned_power7
+attribute_hidden;
+
+libc_ifunc (_wordcopy_fwd_aligned,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? _wordcopy_fwd_aligned_power7 :
+ (hwcap & PPC_FEATURE_ARCH_2_05)
+ ? _wordcopy_fwd_aligned_power6 :
+ (hwcap & PPC_FEATURE_POWER5)
+ ? _wordcopy_fwd_aligned_power5 :
+ (hwcap & PPC_FEATURE_POWER4)
+ ? _wordcopy_fwd_aligned_power4
+ : _wordcopy_fwd_aligned_ppc64);
+
+
+extern __typeof (_wordcopy_fwd_dest_aligned) _wordcopy_fwd_dest_aligned_ppc64
+attribute_hidden;
+extern __typeof (_wordcopy_fwd_dest_aligned) _wordcopy_fwd_dest_aligned_power4
+attribute_hidden;
+extern __typeof (_wordcopy_fwd_dest_aligned) _wordcopy_fwd_dest_aligned_power5
+attribute_hidden;
+extern __typeof (_wordcopy_fwd_dest_aligned) _wordcopy_fwd_dest_aligned_power6
+attribute_hidden;
+extern __typeof (_wordcopy_fwd_dest_aligned) _wordcopy_fwd_dest_aligned_power7
+attribute_hidden;
+
+libc_ifunc (_wordcopy_fwd_dest_aligned,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? _wordcopy_fwd_dest_aligned_power7 :
+ (hwcap & PPC_FEATURE_ARCH_2_05)
+ ? _wordcopy_fwd_dest_aligned_power6 :
+ (hwcap & PPC_FEATURE_POWER5)
+ ? _wordcopy_fwd_dest_aligned_power5 :
+ (hwcap & PPC_FEATURE_POWER4)
+ ? _wordcopy_fwd_dest_aligned_power4
+ : _wordcopy_fwd_dest_aligned_ppc64);
+
+
+extern __typeof (_wordcopy_bwd_aligned) _wordcopy_bwd_aligned_ppc64
+attribute_hidden;
+extern __typeof (_wordcopy_bwd_aligned) _wordcopy_bwd_aligned_power4
+attribute_hidden;
+extern __typeof (_wordcopy_bwd_aligned) _wordcopy_bwd_aligned_power5
+attribute_hidden;
+extern __typeof (_wordcopy_bwd_aligned) _wordcopy_bwd_aligned_power6
+attribute_hidden;
+extern __typeof (_wordcopy_bwd_aligned) _wordcopy_bwd_aligned_power7
+attribute_hidden;
+
+libc_ifunc (_wordcopy_bwd_aligned,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? _wordcopy_bwd_aligned_power7 :
+ (hwcap & PPC_FEATURE_ARCH_2_05)
+ ? _wordcopy_bwd_aligned_power6 :
+ (hwcap & PPC_FEATURE_POWER5)
+ ? _wordcopy_bwd_aligned_power5 :
+ (hwcap & PPC_FEATURE_POWER4)
+ ? _wordcopy_bwd_aligned_power4
+ : _wordcopy_bwd_aligned_ppc64);
+
+
+extern __typeof (_wordcopy_bwd_dest_aligned) _wordcopy_bwd_dest_aligned_ppc64
+attribute_hidden;
+extern __typeof (_wordcopy_bwd_dest_aligned) _wordcopy_bwd_dest_aligned_power4
+attribute_hidden;
+extern __typeof (_wordcopy_bwd_dest_aligned) _wordcopy_bwd_dest_aligned_power5
+attribute_hidden;
+extern __typeof (_wordcopy_bwd_dest_aligned) _wordcopy_bwd_dest_aligned_power6
+attribute_hidden;
+extern __typeof (_wordcopy_bwd_dest_aligned) _wordcopy_bwd_dest_aligned_power7
+attribute_hidden;
+
+libc_ifunc (_wordcopy_bwd_dest_aligned,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? _wordcopy_bwd_dest_aligned_power7 :
+ (hwcap & PPC_FEATURE_ARCH_2_05)
+ ? _wordcopy_bwd_dest_aligned_power6 :
+ (hwcap & PPC_FEATURE_POWER5)
+ ? _wordcopy_bwd_dest_aligned_power5 :
+ (hwcap & PPC_FEATURE_POWER4)
+ ? _wordcopy_bwd_dest_aligned_power4
+ : _wordcopy_bwd_dest_aligned_ppc64);
+
+#else
+#include <string/wordcopy.c>
+#endif
diff --git a/sysdeps/powerpc/powerpc64/power4/wordcopy.c b/sysdeps/powerpc/powerpc64/power4/wordcopy.c
deleted file mode 100644
index f427b48..0000000
--- a/sysdeps/powerpc/powerpc64/power4/wordcopy.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../powerpc32/power4/wordcopy.c"
diff --git a/sysdeps/powerpc/powerpc64/power6/wordcopy.c b/sysdeps/powerpc/powerpc64/power6/wordcopy.c
deleted file mode 100644
index 7517893..0000000
--- a/sysdeps/powerpc/powerpc64/power6/wordcopy.c
+++ /dev/null
@@ -1,217 +0,0 @@
-/* _memcopy.c -- subroutines for memory copy functions.
- Copyright (C) 1991-2013 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Torbjorn Granlund (tege@sics.se).
-
- 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/>. */
-
-/* BE VERY CAREFUL IF YOU CHANGE THIS CODE...! */
-
-#include <stddef.h>
-#include <memcopy.h>
-
-/* _wordcopy_fwd_aligned -- Copy block beginning at SRCP to
- block beginning at DSTP with LEN `op_t' words (not LEN bytes!).
- Both SRCP and DSTP should be aligned for memory operations on `op_t's. */
-
-void
-_wordcopy_fwd_aligned (dstp, srcp, len)
- long int dstp;
- long int srcp;
- size_t len;
-{
- op_t a0, a1;
-
- if (len & 1)
- {
- ((op_t *) dstp)[0] = ((op_t *) srcp)[0];
-
- if (len == 1)
- return;
- srcp += OPSIZ;
- dstp += OPSIZ;
- len -= 1;
- }
-
- do
- {
- a0 = ((op_t *) srcp)[0];
- a1 = ((op_t *) srcp)[1];
- ((op_t *) dstp)[0] = a0;
- ((op_t *) dstp)[1] = a1;
-
- srcp += 2 * OPSIZ;
- dstp += 2 * OPSIZ;
- len -= 2;
- }
- while (len != 0);
-}
-
-#define fwd_align_merge(align) \
- do \
- { \
- a1 = ((op_t *) srcp)[1]; \
- a2 = ((op_t *) srcp)[2]; \
- ((op_t *) dstp)[0] = MERGE (a0, align*8, a1, (64-align*8)); \
- ((op_t *) dstp)[1] = MERGE (a1, align*8, a2, (64-align*8)); \
- a0 = a2; \
- srcp += 2 * OPSIZ; \
- dstp += 2 * OPSIZ; \
- len -= 2; \
- } \
- while (len != 0)
-
-
-/* _wordcopy_fwd_dest_aligned -- Copy block beginning at SRCP to
- block beginning at DSTP with LEN `op_t' words (not LEN bytes!).
- DSTP should be aligned for memory operations on `op_t's, but SRCP must
- *not* be aligned. */
-
-void
-_wordcopy_fwd_dest_aligned (dstp, srcp, len)
- long int dstp;
- long int srcp;
- size_t len;
-{
- op_t a0, a1, a2;
- int sh_1, sh_2;
- int align;
-
- /* Calculate how to shift a word read at the memory operation
- aligned srcp to make it aligned for copy. */
-
- align = srcp % OPSIZ;
- sh_1 = 8 * (srcp % OPSIZ);
- sh_2 = 8 * OPSIZ - sh_1;
-
- /* Make SRCP aligned by rounding it down to the beginning of the `op_t'
- it points in the middle of. */
- srcp &= -OPSIZ;
- a0 = ((op_t *) srcp)[0];
-
- if (len & 1)
- {
- a1 = ((op_t *) srcp)[1];
- ((op_t *) dstp)[0] = MERGE (a0, sh_1, a1, sh_2);
-
- if (len == 1)
- return;
-
- a0 = a1;
- srcp += OPSIZ;
- dstp += OPSIZ;
- len -= 1;
- }
-
- fwd_align_merge (align);
-
-}
-
-/* _wordcopy_bwd_aligned -- Copy block finishing right before
- SRCP to block finishing right before DSTP with LEN `op_t' words
- (not LEN bytes!). Both SRCP and DSTP should be aligned for memory
- operations on `op_t's. */
-
-void
-_wordcopy_bwd_aligned (dstp, srcp, len)
- long int dstp;
- long int srcp;
- size_t len;
-{
- op_t a0, a1;
-
- if (len & 1)
- {
- srcp -= OPSIZ;
- dstp -= OPSIZ;
- ((op_t *) dstp)[0] = ((op_t *) srcp)[0];
-
- if (len == 1)
- return;
- len -= 1;
- }
-
- do
- {
- srcp -= 2 * OPSIZ;
- dstp -= 2 * OPSIZ;
-
- a1 = ((op_t *) srcp)[1];
- a0 = ((op_t *) srcp)[0];
- ((op_t *) dstp)[1] = a1;
- ((op_t *) dstp)[0] = a0;
-
- len -= 2;
- }
- while (len != 0);
-}
-
-#define bwd_align_merge(align) \
- do \
- { \
- srcp -= 2 * OPSIZ; \
- dstp -= 2 * OPSIZ; \
- a1 = ((op_t *) srcp)[1]; \
- a0 = ((op_t *) srcp)[0]; \
- ((op_t *) dstp)[1] = MERGE (a1, align*8, a2, (64-align*8)); \
- ((op_t *) dstp)[0] = MERGE (a0, align*8, a1, (64-align*8)); \
- a2 = a0; \
- len -= 2; \
- } \
- while (len != 0)
-
-/* _wordcopy_bwd_dest_aligned -- Copy block finishing right
- before SRCP to block finishing right before DSTP with LEN `op_t'
- words (not LEN bytes!). DSTP should be aligned for memory
- operations on `op_t', but SRCP must *not* be aligned. */
-
-void
-_wordcopy_bwd_dest_aligned (dstp, srcp, len)
- long int dstp;
- long int srcp;
- size_t len;
-{
- op_t a0, a1, a2;
- int sh_1, sh_2;
- int align;
-
- /* Calculate how to shift a word read at the memory operation
- aligned srcp to make it aligned for copy. */
-
- align = srcp % OPSIZ;
- sh_1 = 8 * (srcp % OPSIZ);
- sh_2 = 8 * OPSIZ - sh_1;
-
- /* Make srcp aligned by rounding it down to the beginning of the op_t
- it points in the middle of. */
- srcp &= -OPSIZ;
- a2 = ((op_t *) srcp)[0];
-
- if (len & 1)
- {
- srcp -= OPSIZ;
- dstp -= OPSIZ;
- a1 = ((op_t *) srcp)[0];
- ((op_t *) dstp)[0] = MERGE (a1, sh_1, a2, sh_2);
-
- if (len == 1)
- return;
-
- a2 = a1;
- len -= 1;
- }
-
- bwd_align_merge (align);
-}
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=d28c7486c7d793ae7be6ff7589984a62ee15373e
commit d28c7486c7d793ae7be6ff7589984a62ee15373e
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Fri Jun 7 09:24:26 2013 -0500
PowerPC: wcscpy multilib for PowerPC64
diff --git a/sysdeps/powerpc/powerpc64/multiarch/Makefile b/sysdeps/powerpc/powerpc64/multiarch/Makefile
index 74b1586..73da34c 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc64/multiarch/Makefile
@@ -11,7 +11,7 @@ sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
strncmp-power4 strncmp-ppc64 strchr-power7 strchr-ppc64 \
strchrnul-power7 strchrnul-ppc64 wcschr-power7 \
wcschr-power6 wcschr-ppc64 wcsrchr-power7 wcsrchr-power6 \
- wcsrchr-ppc64
+ wcsrchr-ppc64 wcscpy-power7 wcscpy-power6 wcscpy-ppc64
CFLAGS-strncase-power7.c += -mcpu=power7 -funroll-loops
CFLAGS-strncase_l-power7.c += -mcpu=power7 -funroll-loops
@@ -19,4 +19,6 @@ CFLAGS-wcschr-power7.c += -mcpu=power7
CFLAGS-wcschr-power6.c += -mcpu=power6
CFLAGS-wcsrchr-power7.c += -mcpu=power7
CFLAGS-wcsrchr-power6.c += -mcpu=power6
+CFLAGS-wcscpy-power7.c += -mcpu=power7
+CFLAGS-wcscpy-power6.c += -mcpu=power6
endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
index e4a394a..724075f 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
@@ -147,6 +147,17 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
IFUNC_IMPL_ADD (array, i, wcsrchr, 1,
__wcsrchr_ppc64))
+ /* Support sysdeps/powerpc/powerpc64/multiarch/wcscpy.c. */
+ IFUNC_IMPL (i, name, wcscpy,
+ IFUNC_IMPL_ADD (array, i, wcscpy,
+ hwcap & PPC_FEATURE_HAS_VSX,
+ __wcscpy_power7)
+ IFUNC_IMPL_ADD (array, i, wcscpy,
+ hwcap & PPC_FEATURE_ARCH_2_05,
+ __wcscpy_power6)
+ IFUNC_IMPL_ADD (array, i, wcscpy, 1,
+ __wcscpy_ppc64))
+
#ifdef SHARED
/* Support sysdeps/powerpc/powerpc64/multiarch/memcpy.c. */
IFUNC_IMPL (i, name, memcpy,
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcscpy-power6.c b/sysdeps/powerpc/powerpc64/multiarch/wcscpy-power6.c
new file mode 100644
index 0000000..33f9b2c
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcscpy-power6.c
@@ -0,0 +1,20 @@
+/* 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/>. */
+
+#define WCSCPY __wcscpy_power6
+
+#include <sysdeps/powerpc/power6/wcscpy.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcscpy-power7.c b/sysdeps/powerpc/powerpc64/multiarch/wcscpy-power7.c
new file mode 100644
index 0000000..2dbec11
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcscpy-power7.c
@@ -0,0 +1,20 @@
+/* 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/>. */
+
+#define WCSCPY __wcscpy_power7
+
+#include <sysdeps/powerpc/power6/wcscpy.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcscpy-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/wcscpy-ppc64.c
new file mode 100644
index 0000000..6e59e3b
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcscpy-ppc64.c
@@ -0,0 +1,26 @@
+/* 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 <wchar.h>
+
+#ifndef NOT_IN_libc
+# define WCSCPY __wcscpy_ppc64
+#endif
+
+extern __typeof (wcscpy) __wcscpy_ppc64;
+
+#include <wcsmbs/wcscpy.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcscpy.c b/sysdeps/powerpc/powerpc64/multiarch/wcscpy.c
new file mode 100644
index 0000000..0ae9c48
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcscpy.c
@@ -0,0 +1,36 @@
+/* Multiple versions of wcscpy
+ 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/>. */
+
+#ifndef NOT_IN_libc
+# include <wchar.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+extern __typeof (wcscpy) __wcscpy_ppc64 attribute_hidden;
+extern __typeof (wcscpy) __wcscpy_power6 attribute_hidden;
+extern __typeof (wcscpy) __wcscpy_power7 attribute_hidden;
+
+libc_ifunc (wcscpy,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __wcscpy_power7 :
+ (hwcap & PPC_FEATURE_ARCH_2_05)
+ ? __wcscpy_power6
+ : __wcscpy_ppc64);
+#else
+#include <wcsmbs/wcscpy.c>
+#endif
diff --git a/sysdeps/powerpc/powerpc64/power6/wcscpy.c b/sysdeps/powerpc/powerpc64/power6/wcscpy.c
deleted file mode 100644
index 722c8f9..0000000
--- a/sysdeps/powerpc/powerpc64/power6/wcscpy.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/powerpc/power6/wcscpy.c>
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=172aa141b3bd815e0aec35210d65b92fa6723bea
commit 172aa141b3bd815e0aec35210d65b92fa6723bea
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Fri Jun 7 09:22:34 2013 -0500
PowerPC: wcsrchr multilib for PowerPC64
diff --git a/sysdeps/powerpc/powerpc64/multiarch/Makefile b/sysdeps/powerpc/powerpc64/multiarch/Makefile
index ede1f3b..74b1586 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc64/multiarch/Makefile
@@ -10,10 +10,13 @@ sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
strncase-power7 strncase_l-power7 strncmp-power7 \
strncmp-power4 strncmp-ppc64 strchr-power7 strchr-ppc64 \
strchrnul-power7 strchrnul-ppc64 wcschr-power7 \
- wcschr-power6 wcschr-ppc64
+ wcschr-power6 wcschr-ppc64 wcsrchr-power7 wcsrchr-power6 \
+ wcsrchr-ppc64
CFLAGS-strncase-power7.c += -mcpu=power7 -funroll-loops
CFLAGS-strncase_l-power7.c += -mcpu=power7 -funroll-loops
CFLAGS-wcschr-power7.c += -mcpu=power7
CFLAGS-wcschr-power6.c += -mcpu=power6
+CFLAGS-wcsrchr-power7.c += -mcpu=power7
+CFLAGS-wcsrchr-power6.c += -mcpu=power6
endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
index e28ed25..e4a394a 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
@@ -136,6 +136,17 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
IFUNC_IMPL_ADD (array, i, wcschr, 1,
__wcschr_ppc64))
+ /* Support sysdeps/powerpc/powerpc64/multiarch/wcschr.c. */
+ IFUNC_IMPL (i, name, wcsrchr,
+ IFUNC_IMPL_ADD (array, i, wcsrchr,
+ hwcap & PPC_FEATURE_HAS_VSX,
+ __wcsrchr_power7)
+ IFUNC_IMPL_ADD (array, i, wcsrchr,
+ hwcap & PPC_FEATURE_ARCH_2_05,
+ __wcsrchr_power6)
+ IFUNC_IMPL_ADD (array, i, wcsrchr, 1,
+ __wcsrchr_ppc64))
+
#ifdef SHARED
/* Support sysdeps/powerpc/powerpc64/multiarch/memcpy.c. */
IFUNC_IMPL (i, name, memcpy,
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-power6.c b/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-power6.c
new file mode 100644
index 0000000..68fe477
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-power6.c
@@ -0,0 +1,20 @@
+/* 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/>. */
+
+#define WCSRCHR __wcsrchr_power6
+
+#include <sysdeps/powerpc/power6/wcsrchr.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-power7.c b/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-power7.c
new file mode 100644
index 0000000..3422816
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-power7.c
@@ -0,0 +1,20 @@
+/* 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/>. */
+
+#define WCSRCHR __wcsrchr_power7
+
+#include <sysdeps/powerpc/power6/wcsrchr.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-ppc64.c
new file mode 100644
index 0000000..80e5ae7
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-ppc64.c
@@ -0,0 +1,26 @@
+/* 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 <wchar.h>
+
+#ifndef NOT_IN_libc
+# define WCSRCHR __wcsrchr_ppc64
+#endif
+
+extern __typeof (wcsrchr) __wcsrchr_ppc64;
+
+#include <wcsmbs/wcsrchr.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcsrchr.c b/sysdeps/powerpc/powerpc64/multiarch/wcsrchr.c
new file mode 100644
index 0000000..d62f0e1
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcsrchr.c
@@ -0,0 +1,36 @@
+/* Multiple versions of wcsrchr
+ 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/>. */
+
+#ifndef NOT_IN_libc
+# include <wchar.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+extern __typeof (wcsrchr) __wcsrchr_ppc64 attribute_hidden;
+extern __typeof (wcsrchr) __wcsrchr_power6 attribute_hidden;
+extern __typeof (wcsrchr) __wcsrchr_power7 attribute_hidden;
+
+libc_ifunc (wcsrchr,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __wcsrchr_power7 :
+ (hwcap & PPC_FEATURE_ARCH_2_05)
+ ? __wcsrchr_power6
+ : __wcsrchr_ppc64);
+#else
+#include <wcsmbs/wcsrchr.c>
+#endif
diff --git a/sysdeps/powerpc/powerpc64/power6/wcsrchr.c b/sysdeps/powerpc/powerpc64/power6/wcsrchr.c
deleted file mode 100644
index b86472d..0000000
--- a/sysdeps/powerpc/powerpc64/power6/wcsrchr.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/powerpc/power6/wcsrchr.c>
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=d23fe47a8b32475e3554f78692c0f41ebda505ed
commit d23fe47a8b32475e3554f78692c0f41ebda505ed
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Fri Jun 7 09:13:37 2013 -0500
PowerPC: wcschr multilib for PowerPC64
diff --git a/sysdeps/powerpc/powerpc64/multiarch/Makefile b/sysdeps/powerpc/powerpc64/multiarch/Makefile
index 2642bec..ede1f3b 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc64/multiarch/Makefile
@@ -9,8 +9,11 @@ sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
strcasecmp-power7 strcasecmp_l-power7 \
strncase-power7 strncase_l-power7 strncmp-power7 \
strncmp-power4 strncmp-ppc64 strchr-power7 strchr-ppc64 \
- strchrnul-power7 strchrnul-ppc64
+ strchrnul-power7 strchrnul-ppc64 wcschr-power7 \
+ wcschr-power6 wcschr-ppc64
CFLAGS-strncase-power7.c += -mcpu=power7 -funroll-loops
CFLAGS-strncase_l-power7.c += -mcpu=power7 -funroll-loops
+CFLAGS-wcschr-power7.c += -mcpu=power7
+CFLAGS-wcschr-power6.c += -mcpu=power6
endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
index 38de757..e28ed25 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
@@ -125,6 +125,17 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
IFUNC_IMPL_ADD (array, i, strncasecmp_l, 1,
__strncasecmp_l_ppc64))
+ /* Support sysdeps/powerpc/powerpc64/multiarch/wcschr.c. */
+ IFUNC_IMPL (i, name, wcschr,
+ IFUNC_IMPL_ADD (array, i, wcschr,
+ hwcap & PPC_FEATURE_HAS_VSX,
+ __wcschr_power7)
+ IFUNC_IMPL_ADD (array, i, wcschr,
+ hwcap & PPC_FEATURE_ARCH_2_05,
+ __wcschr_power6)
+ IFUNC_IMPL_ADD (array, i, wcschr, 1,
+ __wcschr_ppc64))
+
#ifdef SHARED
/* Support sysdeps/powerpc/powerpc64/multiarch/memcpy.c. */
IFUNC_IMPL (i, name, memcpy,
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcschr-power6.c b/sysdeps/powerpc/powerpc64/multiarch/wcschr-power6.c
new file mode 100644
index 0000000..a49e923
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcschr-power6.c
@@ -0,0 +1,26 @@
+/* PowerPC64 optimized implementation of wcschr.
+ 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 <wchar.h>
+
+#define WCSCHR __wcschr_power6
+
+#undef libc_hidden_def
+#define libc_hidden_def(name)
+
+#include <sysdeps/powerpc/power6/wcschr.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcschr-power7.c b/sysdeps/powerpc/powerpc64/multiarch/wcschr-power7.c
new file mode 100644
index 0000000..d7d8469
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcschr-power7.c
@@ -0,0 +1,26 @@
+/* wcschr.c - Wide Character Search for powerpc32/power7.
+ 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; see the file COPYING.LIB. If
+ not, see <http://www.gnu.org/licenses/>. */
+
+#include <wchar.h>
+
+#define WCSCHR __wcschr_power7
+
+#undef libc_hidden_def
+#define libc_hidden_def(name)
+
+#include <sysdeps/powerpc/power6/wcschr.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcschr-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/wcschr-ppc64.c
new file mode 100644
index 0000000..61341ce
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcschr-ppc64.c
@@ -0,0 +1,31 @@
+/* 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 <wchar.h>
+
+#ifndef NOT_IN_libc
+# ifdef SHARED
+# undef libc_hidden_def
+# define libc_hidden_def(name) \
+ __hidden_ver1 (__wcschr_ppc64, __GI_wcschr, __wcschr_ppc64);
+# endif
+# define WCSCHR __wcschr_ppc64
+#endif
+
+extern __typeof (wcschr) __wcschr_ppc64;
+
+#include <wcsmbs/wcschr.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcschr.c b/sysdeps/powerpc/powerpc64/multiarch/wcschr.c
new file mode 100644
index 0000000..676676d
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcschr.c
@@ -0,0 +1,38 @@
+/* Multiple versions of wcschr
+ 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/>. */
+
+#ifndef NOT_IN_libc
+# include <wchar.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+extern __typeof (wcschr) __wcschr_ppc64 attribute_hidden;
+extern __typeof (wcschr) __wcschr_power6 attribute_hidden;
+extern __typeof (wcschr) __wcschr_power7 attribute_hidden;
+
+libc_ifunc (wcschr,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __wcschr_power7 :
+ (hwcap & PPC_FEATURE_ARCH_2_05)
+ ? __wcschr_power6
+ : __wcschr_ppc64);
+#else
+#undef libc_hidden_def
+#define libc_hidden_def(a)
+#include <wcsmbs/wcschr.c>
+#endif
diff --git a/sysdeps/powerpc/powerpc64/power6/wcschr.c b/sysdeps/powerpc/powerpc64/power6/wcschr.c
deleted file mode 100644
index ae04a13..0000000
--- a/sysdeps/powerpc/powerpc64/power6/wcschr.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/powerpc/power6/wcschr.c>
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=0dda9c3b136e9100ff4c936519eeb4d2315dc546
commit 0dda9c3b136e9100ff4c936519eeb4d2315dc546
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Fri Jun 7 09:10:59 2013 -0500
PowerPC: strchrnul multilib for PowerPC64
diff --git a/sysdeps/powerpc/powerpc64/multiarch/Makefile b/sysdeps/powerpc/powerpc64/multiarch/Makefile
index efddeeb..2642bec 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc64/multiarch/Makefile
@@ -8,7 +8,8 @@ sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
strlen-ppc64 strnlen-power7 strnlen-ppc64 \
strcasecmp-power7 strcasecmp_l-power7 \
strncase-power7 strncase_l-power7 strncmp-power7 \
- strncmp-power4 strncmp-ppc64 strchr-power7 strchr-ppc64
+ strncmp-power4 strncmp-ppc64 strchr-power7 strchr-ppc64 \
+ strchrnul-power7 strchrnul-ppc64
CFLAGS-strncase-power7.c += -mcpu=power7 -funroll-loops
CFLAGS-strncase_l-power7.c += -mcpu=power7 -funroll-loops
diff --git a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
index c33e86a..38de757 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
@@ -179,6 +179,14 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
__strchr_power7)
IFUNC_IMPL_ADD (array, i, strchr, 1,
__strchr_ppc64))
+
+ /* Support sysdeps/powerpc/powerpc64/multiarch/strchrnul.c. */
+ IFUNC_IMPL (i, name, strchrnul,
+ IFUNC_IMPL_ADD (array, i, strchrnul,
+ hwcap & PPC_FEATURE_HAS_VSX,
+ __strchrnul_power7)
+ IFUNC_IMPL_ADD (array, i, strchrnul, 1,
+ __strchrnul_ppc64))
#endif
return i;
diff --git a/sysdeps/powerpc/powerpc64/power7/strchrnul.S b/sysdeps/powerpc/powerpc64/multiarch/strchrnul-power7.S
similarity index 96%
rename from sysdeps/powerpc/powerpc64/power7/strchrnul.S
rename to sysdeps/powerpc/powerpc64/multiarch/strchrnul-power7.S
index 9dbc51b..8bebf2d 100644
--- a/sysdeps/powerpc/powerpc64/power7/strchrnul.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strchrnul-power7.S
@@ -21,7 +21,7 @@
/* int [r3] strchrnul (char *s [r3], int c [r4]) */
.machine power7
-ENTRY (__strchrnul)
+ENTRY (__strchrnul_power7)
CALL_MCOUNT 2
dcbt 0,r3
clrrdi r8,r3,3 /* Align the address to doubleword boundary. */
@@ -110,6 +110,4 @@ L(done):
srdi r0,r0,3 /* Convert leading zeros to bytes. */
add r3,r8,r0 /* Return address of matching c/null byte. */
blr
-END (__strchrnul)
-weak_alias (__strchrnul,strchrnul)
-libc_hidden_builtin_def (__strchrnul)
+END (__strchrnul_power7)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strchrnul-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/strchrnul-ppc64.c
new file mode 100644
index 0000000..fdca068
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strchrnul-ppc64.c
@@ -0,0 +1,28 @@
+/* PowerPC32 default implementation of strchrnul.
+ 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 <string.h>
+
+#define STRCHRNUL __strchrnul_ppc64
+
+#undef weak_alias
+#define weak_alias(a,b )
+
+extern __typeof (strchrnul) __strchrnul_ppc64 attribute_hidden;
+
+#include <string/strchrnul.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strchrnul.c b/sysdeps/powerpc/powerpc64/multiarch/strchrnul.c
new file mode 100644
index 0000000..b4e4ce8
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strchrnul.c
@@ -0,0 +1,37 @@
+/* Multiple versions of strchrnul.
+ 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/>. */
+
+#ifndef NOT_IN_libc
+# include <string.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+extern __typeof (__strchrnul) __strchrnul_ppc64 attribute_hidden;
+extern __typeof (__strchrnul) __strchrnul_power7 attribute_hidden;
+
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
+ ifunc symbol properly. */
+libc_ifunc (__strchrnul,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strchrnul_power7
+ : __strchrnul_ppc64);
+
+weak_alias (__strchrnul, strchrnul)
+#else
+#include <string/strchrnul.c>
+#endif
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=3b7e274c42d50792b1c08a227db070159bd13c90
commit 3b7e274c42d50792b1c08a227db070159bd13c90
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Fri Jun 7 09:10:05 2013 -0500
PowerPC: strchr multilib for PowerPC64
diff --git a/sysdeps/powerpc/powerpc64/multiarch/Makefile b/sysdeps/powerpc/powerpc64/multiarch/Makefile
index 98edc9a..efddeeb 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc64/multiarch/Makefile
@@ -8,7 +8,7 @@ sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
strlen-ppc64 strnlen-power7 strnlen-ppc64 \
strcasecmp-power7 strcasecmp_l-power7 \
strncase-power7 strncase_l-power7 strncmp-power7 \
- strncmp-power4 strncmp-ppc64
+ strncmp-power4 strncmp-ppc64 strchr-power7 strchr-ppc64
CFLAGS-strncase-power7.c += -mcpu=power7 -funroll-loops
CFLAGS-strncase_l-power7.c += -mcpu=power7 -funroll-loops
diff --git a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
index 29ee8fe..c33e86a 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
@@ -171,6 +171,14 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
__strncmp_power7)
IFUNC_IMPL_ADD (array, i, strncmp, 1,
__strncmp_ppc64))
+
+ /* Support sysdeps/powerpc/powerpc64/multiarch/strchr.c. */
+ IFUNC_IMPL (i, name, strchr,
+ IFUNC_IMPL_ADD (array, i, strchr,
+ hwcap & PPC_FEATURE_HAS_VSX,
+ __strchr_power7)
+ IFUNC_IMPL_ADD (array, i, strchr, 1,
+ __strchr_ppc64))
#endif
return i;
diff --git a/sysdeps/powerpc/powerpc64/multiarch/rtld-strchr.S b/sysdeps/powerpc/powerpc64/multiarch/rtld-strchr.S
new file mode 100644
index 0000000..93f0eb4
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/rtld-strchr.S
@@ -0,0 +1,18 @@
+/* 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 <sysdeps/powerpc/powerpc64/strchr.S>
diff --git a/sysdeps/powerpc/powerpc64/power7/strchr.S b/sysdeps/powerpc/powerpc64/multiarch/strchr-power7.S
similarity index 98%
rename from sysdeps/powerpc/powerpc64/power7/strchr.S
rename to sysdeps/powerpc/powerpc64/multiarch/strchr-power7.S
index 3ffe7a1..eb82ad7 100644
--- a/sysdeps/powerpc/powerpc64/power7/strchr.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strchr-power7.S
@@ -21,7 +21,7 @@
/* int [r3] strchr (char *s [r3], int c [r4]) */
.machine power7
-ENTRY (strchr)
+ENTRY (__strchr_power7)
CALL_MCOUNT 2
dcbt 0,r3
clrrdi r8,r3,3 /* Align the address to doubleword boundary. */
@@ -196,6 +196,4 @@ L(done_null):
srdi r0,r0,3 /* Convert leading zeros to bytes. */
add r3,r8,r0 /* Return address of the matching null byte. */
blr
-END (strchr)
-weak_alias (strchr, index)
-libc_hidden_builtin_def (strchr)
+END (__strchr_power7)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strchr-ppc64.S b/sysdeps/powerpc/powerpc64/multiarch/strchr-ppc64.S
new file mode 100644
index 0000000..bb3c551
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strchr-ppc64.S
@@ -0,0 +1,40 @@
+/* PowerPC64 default implementation of strchr.
+ 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>
+
+#ifdef SHARED
+# undef ENTRY
+# define ENTRY(name) \
+ ENTRY_2(__strchr_ppc64) \
+ .align ALIGNARG(2); \
+ BODY_LABEL(__strchr_ppc64): \
+ cfi_startproc;
+
+# undef END
+# define END(name) \
+ cfi_endproc; \
+ TRACEBACK(__strchr_ppc64) \
+ END_2(__strchr_ppc64)
+
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name) \
+ .globl __GI_strchr; __GI_strchr = __strchr_ppc64
+#endif
+
+#include <sysdeps/powerpc/powerpc64/strchr.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strchr.c b/sysdeps/powerpc/powerpc64/multiarch/strchr.c
new file mode 100644
index 0000000..077c571
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strchr.c
@@ -0,0 +1,35 @@
+/* Multiple versions of strchr.
+ 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/>. */
+
+/* Define multiple versions only for definition in libc. */
+#if defined SHARED && !defined NOT_IN_libc
+# include <string.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+extern __typeof (strchr) __strchr_ppc64 attribute_hidden;
+extern __typeof (strchr) __strchr_power7 attribute_hidden;
+
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
+ ifunc symbol properly. */
+libc_ifunc (strchr,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strchr_power7
+ : __strchr_ppc64);
+weak_alias (strchr, index)
+#endif
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=cdf88b361caa301403b18c411a21df036c6bd509
commit cdf88b361caa301403b18c411a21df036c6bd509
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Fri Jun 7 09:08:14 2013 -0500
PowerPC: strncmp multilib for PowerPC64
diff --git a/sysdeps/powerpc/powerpc64/multiarch/Makefile b/sysdeps/powerpc/powerpc64/multiarch/Makefile
index 6d0fc53..98edc9a 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc64/multiarch/Makefile
@@ -7,7 +7,8 @@ sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
rawmemchr-power7 rawmemchr-ppc64 strlen-power7 \
strlen-ppc64 strnlen-power7 strnlen-ppc64 \
strcasecmp-power7 strcasecmp_l-power7 \
- strncase-power7 strncase_l-power7
+ strncase-power7 strncase_l-power7 strncmp-power7 \
+ strncmp-power4 strncmp-ppc64
CFLAGS-strncase-power7.c += -mcpu=power7 -funroll-loops
CFLAGS-strncase_l-power7.c += -mcpu=power7 -funroll-loops
diff --git a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
index d1e4357..29ee8fe 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
@@ -164,6 +164,13 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
__strlen_power7)
IFUNC_IMPL_ADD (array, i, strlen, 1,
__strlen_ppc64))
+
+ /* Support sysdeps/powerpc/powerpc64/multiarch/strncmp.c. */
+ IFUNC_IMPL (i, name, strncmp,
+ IFUNC_IMPL_ADD (array, i, strncmp, hwcap & PPC_FEATURE_HAS_VSX,
+ __strncmp_power7)
+ IFUNC_IMPL_ADD (array, i, strncmp, 1,
+ __strncmp_ppc64))
#endif
return i;
diff --git a/sysdeps/powerpc/powerpc64/power4/strncmp.S b/sysdeps/powerpc/powerpc64/multiarch/strncmp-power4.S
similarity index 98%
rename from sysdeps/powerpc/powerpc64/power4/strncmp.S
rename to sysdeps/powerpc/powerpc64/multiarch/strncmp-power4.S
index 1276e16..71112ab 100644
--- a/sysdeps/powerpc/powerpc64/power4/strncmp.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncmp-power4.S
@@ -22,7 +22,7 @@
/* int [r3] strncmp (const char *s1 [r3], const char *s2 [r4], size_t size [r5]) */
-EALIGN (strncmp, 4, 0)
+EALIGN (__strncmp_power4, 4, 0)
CALL_MCOUNT 3
#define rTMP r0
@@ -170,5 +170,4 @@ L(u4): sub rRTN, rWORD1, rWORD2
L(ux):
li rRTN, 0
blr
-END (strncmp)
-libc_hidden_builtin_def (strncmp)
+END (__strncmp_power4)
diff --git a/sysdeps/powerpc/powerpc64/power7/strncmp.S b/sysdeps/powerpc/powerpc64/multiarch/strncmp-power7.S
similarity index 98%
rename from sysdeps/powerpc/powerpc64/power7/strncmp.S
rename to sysdeps/powerpc/powerpc64/multiarch/strncmp-power7.S
index 77ecad5..013f9ea 100644
--- a/sysdeps/powerpc/powerpc64/power7/strncmp.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncmp-power7.S
@@ -24,7 +24,7 @@
const char *s2 [r4],
size_t size [r5]) */
-EALIGN (strncmp,5,0)
+EALIGN (__strncmp_power7,5,0)
CALL_MCOUNT 3
#define rTMP r0
@@ -174,5 +174,4 @@ L(u4): sub rRTN,rWORD1,rWORD2
L(ux):
li rRTN,0
blr
-END (strncmp)
-libc_hidden_builtin_def (strncmp)
+END (__strncmp_power7)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncmp-ppc64.S b/sysdeps/powerpc/powerpc64/multiarch/strncmp-ppc64.S
new file mode 100644
index 0000000..e461389
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncmp-ppc64.S
@@ -0,0 +1,40 @@
+/* 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>
+
+#if defined SHARED && !defined NOT_IN_libc
+# undef EALIGN
+# define EALIGN(name,alignt,words) \
+ ENTRY_2(__strncmp_ppc64) \
+ .align ALIGNARG(alignt); \
+ EALIGN_W_##words; \
+ BODY_LABEL(__strncmp_ppc64): \
+ cfi_startproc;
+
+# undef END
+# define END(name) \
+ cfi_endproc; \
+ TRACEBACK(__strncmp_ppc64) \
+ END_2(__strncmp_ppc64)
+
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name) \
+ .globl __GI_strncmp; __GI_strncmp = __strncmp_ppc64
+#endif
+
+#include <sysdeps/powerpc/powerpc64/strncmp.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncmp.c b/sysdeps/powerpc/powerpc64/multiarch/strncmp.c
new file mode 100644
index 0000000..25136ed
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncmp.c
@@ -0,0 +1,37 @@
+/* Multiple versions of strncmp.
+ 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/>. */
+
+/* Define multiple versions only for definition in libc. */
+#if defined SHARED && !defined NOT_IN_libc
+# include <string.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+extern __typeof (strncmp) __strncmp_ppc64 attribute_hidden;
+extern __typeof (strncmp) __strncmp_power4 attribute_hidden;
+extern __typeof (strncmp) __strncmp_power7 attribute_hidden;
+
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
+ ifunc symbol properly. */
+libc_ifunc (strncmp,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strncmp_power7 :
+ (hwcap & PPC_FEATURE_POWER4)
+ ? __strncmp_power4
+ : __strncmp_ppc64);
+#endif
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=91a0a632bbf3c47e31a35d0d7d3ca8d1068d602c
commit 91a0a632bbf3c47e31a35d0d7d3ca8d1068d602c
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Fri Jun 7 09:04:46 2013 -0500
PowerPC: strncasecmp multilib for PowerPC64
diff --git a/sysdeps/powerpc/powerpc64/multiarch/Makefile b/sysdeps/powerpc/powerpc64/multiarch/Makefile
index 0b998be..6d0fc53 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc64/multiarch/Makefile
@@ -6,5 +6,9 @@ sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
memchr-ppc64 memrchr-power7 memrchr-ppc64 \
rawmemchr-power7 rawmemchr-ppc64 strlen-power7 \
strlen-ppc64 strnlen-power7 strnlen-ppc64 \
- strcasecmp-power7 strcasecmp_l-power7
+ strcasecmp-power7 strcasecmp_l-power7 \
+ strncase-power7 strncase_l-power7
+
+CFLAGS-strncase-power7.c += -mcpu=power7 -funroll-loops
+CFLAGS-strncase_l-power7.c += -mcpu=power7 -funroll-loops
endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
index 5a06b8d..d1e4357 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
@@ -110,6 +110,21 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
IFUNC_IMPL_ADD (array, i, strcasecmp_l, 1,
__strcasecmp_l_ppc64))
+ /* Support sysdeps/powerpc/powerpc64/multiarch/strncase.c. */
+ IFUNC_IMPL (i, name, strncasecmp,
+ IFUNC_IMPL_ADD (array, i, strncasecmp,
+ hwcap & PPC_FEATURE_HAS_VSX,
+ __strncasecmp_power7)
+ IFUNC_IMPL_ADD (array, i, strncasecmp, 1, __strncasecmp_ppc64))
+
+ /* Support sysdeps/powerpc/powerpc64/multiarch/strncase_l.c. */
+ IFUNC_IMPL (i, name, strncasecmp_l,
+ IFUNC_IMPL_ADD (array, i, strncasecmp_l,
+ hwcap & PPC_FEATURE_HAS_VSX,
+ __strncasecmp_l_power7)
+ IFUNC_IMPL_ADD (array, i, strncasecmp_l, 1,
+ __strncasecmp_l_ppc64))
+
#ifdef SHARED
/* Support sysdeps/powerpc/powerpc64/multiarch/memcpy.c. */
IFUNC_IMPL (i, name, memcpy,
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncase-power7.c b/sysdeps/powerpc/powerpc64/multiarch/strncase-power7.c
new file mode 100644
index 0000000..de6ac40
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncase-power7.c
@@ -0,0 +1,24 @@
+/* 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 <string.h>
+
+#define __strncasecmp __strncasecmp_power7
+
+extern __typeof (strncasecmp) __strncasecmp_power7 attribute_hidden;
+
+#include <string/strncase.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncase.c b/sysdeps/powerpc/powerpc64/multiarch/strncase.c
new file mode 100644
index 0000000..eda698f
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncase.c
@@ -0,0 +1,41 @@
+/* Multiple versions of strncasecmp
+ 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/>. */
+
+#ifndef NOT_IN_libc
+# include <string.h>
+# define strncasecmp __strncasecmp_ppc64
+extern __typeof (__strncasecmp) __strncasecmp_ppc64 attribute_hidden;
+extern __typeof (__strncasecmp) __strncasecmp_power7 attribute_hidden;
+#endif
+
+#include <string/strncase.c>
+#undef strncasecmp
+
+#ifndef NOT_IN_libc
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
+ ifunc symbol properly. */
+extern __typeof (__strncasecmp) __libc_strncasecmp;
+libc_ifunc (__libc_strncasecmp,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strncasecmp_power7
+ : __strncasecmp_ppc64);
+weak_alias (__libc_strncasecmp, strncasecmp)
+#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncase_l-power7.c b/sysdeps/powerpc/powerpc64/multiarch/strncase_l-power7.c
new file mode 100644
index 0000000..10a49fc
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncase_l-power7.c
@@ -0,0 +1,25 @@
+/* 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 <string.h>
+
+#define __strncasecmp_l __strncasecmp_l_power7
+#define USE_IN_EXTENDED_LOCALE_MODEL 1
+
+extern __typeof (strncasecmp_l) __strncasecmp_l_power7 attribute_hidden;
+
+#include <string/strncase.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncase_l.c b/sysdeps/powerpc/powerpc64/multiarch/strncase_l.c
new file mode 100644
index 0000000..e52b948
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncase_l.c
@@ -0,0 +1,42 @@
+/* Multiple versions of strncasecmp_l
+ 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/>. */
+
+#ifndef NOT_IN_libc
+# include <string.h>
+# define strncasecmp_l __strncasecmp_l_ppc64
+extern __typeof (__strncasecmp_l) __strncasecmp_l_ppc64 attribute_hidden;
+extern __typeof (__strncasecmp_l) __strncasecmp_l_power7 attribute_hidden;
+#endif
+
+#include <string/strncase_l.c>
+#undef strncasecmp_l
+
+#ifndef NOT_IN_libc
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
+ ifunc symbol properly. */
+extern __typeof (__strncasecmp_l) __libc_strncasecmp_l;
+libc_ifunc (__libc_strncasecmp_l,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strncasecmp_l_power7
+ : __strncasecmp_l_ppc64);
+
+weak_alias (__libc_strncasecmp_l, strncasecmp_l)
+#endif
diff --git a/sysdeps/powerpc/powerpc64/power7/Makefile b/sysdeps/powerpc/powerpc64/power7/Makefile
index 40aacfa..b0f4520 100644
--- a/sysdeps/powerpc/powerpc64/power7/Makefile
+++ b/sysdeps/powerpc/powerpc64/power7/Makefile
@@ -3,8 +3,3 @@ ifeq ($(subdir),elf)
# optimization may require a TOC reference before relocations are resolved.
CFLAGS-rtld.c += -mno-vsx
endif
-
-ifeq ($(subdir),string)
-CFLAGS-strncase.c += -funroll-loops
-CFLAGS-strncase_l.c += -funroll-loops
-endif
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=32ab639ead8db7ba28af6c962bd301c7ba4714c6
commit 32ab639ead8db7ba28af6c962bd301c7ba4714c6
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Fri Jun 7 09:04:07 2013 -0500
PowerPC: strcasecmp multilib for PowerPC64
diff --git a/sysdeps/powerpc/powerpc64/multiarch/Makefile b/sysdeps/powerpc/powerpc64/multiarch/Makefile
index 6b63e5f..0b998be 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc64/multiarch/Makefile
@@ -5,5 +5,6 @@ sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
memset-ppc64 mempcpy-power7 mempcpy-ppc64 memchr-power7 \
memchr-ppc64 memrchr-power7 memrchr-ppc64 \
rawmemchr-power7 rawmemchr-ppc64 strlen-power7 \
- strlen-ppc64 strnlen-power7 strnlen-ppc64
+ strlen-ppc64 strnlen-power7 strnlen-ppc64 \
+ strcasecmp-power7 strcasecmp_l-power7
endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
index 1288d47..5a06b8d 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
@@ -95,6 +95,21 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
IFUNC_IMPL_ADD (array, i, strnlen, 1,
__strnlen_ppc64))
+ /* Support sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c. */
+ IFUNC_IMPL (i, name, strcasecmp,
+ IFUNC_IMPL_ADD (array, i, strcasecmp,
+ hwcap & PPC_FEATURE_HAS_VSX,
+ __strcasecmp_power7)
+ IFUNC_IMPL_ADD (array, i, strcasecmp, 1, __strcasecmp_ppc64))
+
+ /* Support sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c. */
+ IFUNC_IMPL (i, name, strcasecmp_l,
+ IFUNC_IMPL_ADD (array, i, strcasecmp_l,
+ hwcap & PPC_FEATURE_HAS_VSX,
+ __strcasecmp_l_power7)
+ IFUNC_IMPL_ADD (array, i, strcasecmp_l, 1,
+ __strcasecmp_l_ppc64))
+
#ifdef SHARED
/* Support sysdeps/powerpc/powerpc64/multiarch/memcpy.c. */
IFUNC_IMPL (i, name, memcpy,
diff --git a/sysdeps/powerpc/powerpc64/power7/strcasecmp.S b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp-power7.S
similarity index 96%
rename from sysdeps/powerpc/powerpc64/power7/strcasecmp.S
rename to sysdeps/powerpc/powerpc64/multiarch/strcasecmp-power7.S
index 9eee384..eb7ebd3 100644
--- a/sysdeps/powerpc/powerpc64/power7/strcasecmp.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp-power7.S
@@ -26,9 +26,8 @@
int [r3] strcasecmp_l (const char *s1 [r3], const char *s2 [r4],
__locale_t loc [r5]) */
-#ifndef STRCMP
-# define __STRCMP __strcasecmp
-# define STRCMP strcasecmp
+#ifndef __STRCMP
+# define __STRCMP __strcasecmp_power7
#endif
ENTRY (__STRCMP)
@@ -117,6 +116,3 @@ L(done):
extsw rRTN, r0
blr
END (__STRCMP)
-
-weak_alias (__STRCMP, STRCMP)
-libc_hidden_builtin_def (__STRCMP)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c
new file mode 100644
index 0000000..0187fb9
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c
@@ -0,0 +1,40 @@
+/* Multiple versions of strcasecmp.
+ 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/>. */
+
+#ifndef NOT_IN_libc
+# include <string.h>
+# define strcasecmp __strcasecmp_ppc64
+extern __typeof (__strcasecmp) __strcasecmp_ppc64 attribute_hidden;
+extern __typeof (__strcasecmp) __strcasecmp_power7 attribute_hidden;
+#endif
+
+#include <string/strcasecmp.c>
+#undef strcasecmp
+
+#ifndef NOT_IN_libc
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+extern __typeof (__strcasecmp) __libc_strcasecmp;
+libc_ifunc (__libc_strcasecmp,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strcasecmp_power7
+ : __strcasecmp_ppc64);
+
+weak_alias (__libc_strcasecmp, strcasecmp)
+#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l-power7.S b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l-power7.S
new file mode 100644
index 0000000..a61d6f4
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l-power7.S
@@ -0,0 +1,22 @@
+/* Optimized strcasecmp_l implementation for PowerPC64.
+ Copyright (C) 2011-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/>. */
+
+#define USE_IN_EXTENDED_LOCALE_MODEL
+#define __STRCMP __strcasecmp_l_power7
+
+#include "strcasecmp-power7.S"
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c
new file mode 100644
index 0000000..212789a
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c
@@ -0,0 +1,40 @@
+/* Multiple versions of strcasecmp.
+ 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/>. */
+
+#ifndef NOT_IN_libc
+# include <string.h>
+# define strcasecmp_l __strcasecmp_l_ppc64
+extern __typeof (__strcasecmp_l) __strcasecmp_l_ppc64 attribute_hidden;
+extern __typeof (__strcasecmp_l) __strcasecmp_l_power7 attribute_hidden;
+#endif
+
+#include <string/strcasecmp_l.c>
+#undef strcasecmp_l
+
+#ifndef NOT_IN_libc
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+extern __typeof (__strcasecmp_l) __libc_strcasecmp_l;
+libc_ifunc (__libc_strcasecmp_l,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strcasecmp_l_power7
+ : __strcasecmp_l_ppc64);
+
+weak_alias (__libc_strcasecmp_l, strcasecmp_l)
+#endif
diff --git a/sysdeps/powerpc/powerpc64/power7/strcasecmp_l.S b/sysdeps/powerpc/powerpc64/power7/strcasecmp_l.S
deleted file mode 100644
index c13c4eb..0000000
--- a/sysdeps/powerpc/powerpc64/power7/strcasecmp_l.S
+++ /dev/null
@@ -1,5 +0,0 @@
-#define USE_IN_EXTENDED_LOCALE_MODEL
-#define STRCMP strcasecmp_l
-#define __STRCMP __strcasecmp_l
-
-#include "strcasecmp.S"
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=59739d273b36b4f4597945eccb1788e987f1b702
commit 59739d273b36b4f4597945eccb1788e987f1b702
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Fri Jun 7 08:51:20 2013 -0500
PowerPC: strnlen multilib for PowerPC64
diff --git a/sysdeps/powerpc/powerpc64/multiarch/Makefile b/sysdeps/powerpc/powerpc64/multiarch/Makefile
index 10860ac..6b63e5f 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc64/multiarch/Makefile
@@ -5,5 +5,5 @@ sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
memset-ppc64 mempcpy-power7 mempcpy-ppc64 memchr-power7 \
memchr-ppc64 memrchr-power7 memrchr-ppc64 \
rawmemchr-power7 rawmemchr-ppc64 strlen-power7 \
- strlen-ppc64
+ strlen-ppc64 strnlen-power7 strnlen-ppc64
endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
index fae372e..1288d47 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
@@ -88,6 +88,13 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
IFUNC_IMPL_ADD (array, i, rawmemchr, 1,
__rawmemchr_ppc64))
+ /* Support sysdeps/powerpc/powerpc64/multiarch/strnlen.c. */
+ IFUNC_IMPL (i, name, strnlen,
+ IFUNC_IMPL_ADD (array, i, strnlen, hwcap & PPC_FEATURE_HAS_VSX,
+ __strnlen_power7)
+ IFUNC_IMPL_ADD (array, i, strnlen, 1,
+ __strnlen_ppc64))
+
#ifdef SHARED
/* Support sysdeps/powerpc/powerpc64/multiarch/memcpy.c. */
IFUNC_IMPL (i, name, memcpy,
diff --git a/sysdeps/powerpc/powerpc64/power7/strnlen.S b/sysdeps/powerpc/powerpc64/multiarch/strnlen-power7.S
similarity index 97%
rename from sysdeps/powerpc/powerpc64/power7/strnlen.S
rename to sysdeps/powerpc/powerpc64/multiarch/strnlen-power7.S
index 37c7dbf..bf29b95 100644
--- a/sysdeps/powerpc/powerpc64/power7/strnlen.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strnlen-power7.S
@@ -21,7 +21,7 @@
/* int [r3] strnlen (char *s [r3], int size [r4]) */
.machine power7
-ENTRY (__strnlen)
+ENTRY (__strnlen_power7)
CALL_MCOUNT 2
dcbt 0,r3
clrrdi r8,r3,3
@@ -165,6 +165,4 @@ L(loop_small):
cmpld r9,r7
bge L(end_max)
b L(loop_small)
-END (__strnlen)
-weak_alias (__strnlen, strnlen)
-libc_hidden_builtin_def (strnlen)
+END (__strnlen_power7)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strnlen-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/strnlen-ppc64.c
new file mode 100644
index 0000000..a4e7643
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strnlen-ppc64.c
@@ -0,0 +1,25 @@
+/* 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/>. */
+
+#define STRNLEN __strnlen_ppc64
+#ifdef SHARED
+# undef libc_hidden_def
+# define libc_hidden_def(name) \
+ __hidden_ver1 (__strnlen_ppc64, __GI_strnlen, __strnlen_ppc64);
+#endif
+
+#include <string/strnlen.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strnlen.c b/sysdeps/powerpc/powerpc64/multiarch/strnlen.c
new file mode 100644
index 0000000..0d8a76a
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strnlen.c
@@ -0,0 +1,36 @@
+/* Multiple versions of strnlen.
+ 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/>. */
+
+#ifndef NOT_IN_libc
+# include <string.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+extern __typeof (__strnlen) __strnlen_ppc64 attribute_hidden;
+extern __typeof (__strnlen) __strnlen_power7 attribute_hidden;
+
+libc_ifunc (__strnlen,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strnlen_power7
+ : __strnlen_ppc64);
+weak_alias (__strnlen, strnlen)
+libc_hidden_def (strnlen)
+
+#else
+#include <string/strnlen.c>
+#endif
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=2307cc90bb02febb6a6c50af70f622b9b5e1c967
commit 2307cc90bb02febb6a6c50af70f622b9b5e1c967
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Fri Jun 7 08:48:21 2013 -0500
PowerPC: strlen multilib for PowerPC64
diff --git a/sysdeps/powerpc/powerpc64/multiarch/Makefile b/sysdeps/powerpc/powerpc64/multiarch/Makefile
index 1cf8848..10860ac 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc64/multiarch/Makefile
@@ -4,5 +4,6 @@ sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
memcmp-ppc64 memset-power7 memset-power6 memset-power4 \
memset-ppc64 mempcpy-power7 mempcpy-ppc64 memchr-power7 \
memchr-ppc64 memrchr-power7 memrchr-ppc64 \
- rawmemchr-power7 rawmemchr-ppc64
+ rawmemchr-power7 rawmemchr-ppc64 strlen-power7 \
+ strlen-ppc64
endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
index 0f32134..fae372e 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
@@ -120,6 +120,13 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
IFUNC_IMPL_ADD (array, i, memset, hwcap & PPC_FEATURE_POWER4,
__memset_power4)
IFUNC_IMPL_ADD (array, i, memset, 1, __memset_ppc64))
+
+ /* Support sysdeps/powerpc/powerpc64/multiarch/strlen.c. */
+ IFUNC_IMPL (i, name, strlen,
+ IFUNC_IMPL_ADD (array, i, strlen, hwcap & PPC_FEATURE_HAS_VSX,
+ __strlen_power7)
+ IFUNC_IMPL_ADD (array, i, strlen, 1,
+ __strlen_ppc64))
#endif
return i;
diff --git a/sysdeps/powerpc/powerpc64/power7/strlen.S b/sysdeps/powerpc/powerpc64/multiarch/strlen-power7.S
similarity index 98%
rename from sysdeps/powerpc/powerpc64/power7/strlen.S
rename to sysdeps/powerpc/powerpc64/multiarch/strlen-power7.S
index 3432169..f0ad399 100644
--- a/sysdeps/powerpc/powerpc64/power7/strlen.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strlen-power7.S
@@ -21,7 +21,7 @@
/* int [r3] strlen (char *s [r3]) */
.machine power7
-ENTRY (strlen)
+ENTRY (__strlen_power7)
CALL_MCOUNT 1
dcbt 0,r3
clrrdi r4,r3,3 /* Align the address to doubleword boundary. */
@@ -92,5 +92,4 @@ L(done):
srdi r0,r0,3 /* Convert leading zeroes to bytes. */
add r3,r5,r0 /* Compute final length. */
blr
-END (strlen)
-libc_hidden_builtin_def (strlen)
+END (__strlen_power7)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strlen-ppc64.S b/sysdeps/powerpc/powerpc64/multiarch/strlen-ppc64.S
new file mode 100644
index 0000000..779c8a4
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strlen-ppc64.S
@@ -0,0 +1,40 @@
+/* Default strlen implementation for PowerPC64.
+ 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>
+
+#if defined SHARED && !defined NOT_IN_libc
+# undef ENTRY
+# define ENTRY(name) \
+ ENTRY_2(__strlen_ppc64) \
+ .align ALIGNARG(2); \
+ BODY_LABEL(__strlen_ppc64): \
+ cfi_startproc;
+
+# undef END
+# define END(name) \
+ cfi_endproc; \
+ TRACEBACK(__strlen_ppc64) \
+ END_2(__strlen_ppc64)
+
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name) \
+ .globl __GI_strlen; __GI_strlen = __strlen_ppc64
+#endif
+
+#include <sysdeps/powerpc/powerpc64/strlen.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strlen.c b/sysdeps/powerpc/powerpc64/multiarch/strlen.c
new file mode 100644
index 0000000..498a4fb
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strlen.c
@@ -0,0 +1,31 @@
+/* Multiple versions of strlen. PowerPC64 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/>. */
+
+#if defined SHARED && !defined NOT_IN_libc
+# include <string.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+extern __typeof (strlen) __strlen_ppc64 attribute_hidden;
+extern __typeof (strlen) __strlen_power7 attribute_hidden;
+
+libc_ifunc (strlen,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strlen_power7
+ : __strlen_ppc64);
+#endif
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=9efb05a29a2060c32df43748b4f58f16cdef76b3
commit 9efb05a29a2060c32df43748b4f58f16cdef76b3
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Fri Jun 7 08:45:17 2013 -0500
PowerPC: rawmemchr multilib for PowerPC64
diff --git a/sysdeps/powerpc/powerpc64/multiarch/Makefile b/sysdeps/powerpc/powerpc64/multiarch/Makefile
index 11e621f..1cf8848 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc64/multiarch/Makefile
@@ -3,5 +3,6 @@ sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
memcpy-power4 memcpy-ppc64 memcmp-power7 memcmp-power4 \
memcmp-ppc64 memset-power7 memset-power6 memset-power4 \
memset-ppc64 mempcpy-power7 mempcpy-ppc64 memchr-power7 \
- memchr-ppc64 memrchr-power7 memrchr-ppc64
+ memchr-ppc64 memrchr-power7 memrchr-ppc64 \
+ rawmemchr-power7 rawmemchr-ppc64
endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
index 9a15b01..0f32134 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
@@ -80,6 +80,14 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
IFUNC_IMPL_ADD (array, i, memrchr, 1,
__memrchr_ppc64))
+ /* Support sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c. */
+ IFUNC_IMPL (i, name, rawmemchr,
+ IFUNC_IMPL_ADD (array, i, rawmemchr,
+ hwcap & PPC_FEATURE_HAS_VSX,
+ __rawmemchr_power7)
+ IFUNC_IMPL_ADD (array, i, rawmemchr, 1,
+ __rawmemchr_ppc64))
+
#ifdef SHARED
/* Support sysdeps/powerpc/powerpc64/multiarch/memcpy.c. */
IFUNC_IMPL (i, name, memcpy,
diff --git a/sysdeps/powerpc/powerpc64/power7/rawmemchr.S b/sysdeps/powerpc/powerpc64/multiarch/rawmemchr-power7.S
similarity index 96%
rename from sysdeps/powerpc/powerpc64/power7/rawmemchr.S
rename to sysdeps/powerpc/powerpc64/multiarch/rawmemchr-power7.S
index 50a33d8..98a0622 100644
--- a/sysdeps/powerpc/powerpc64/power7/rawmemchr.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/rawmemchr-power7.S
@@ -21,7 +21,7 @@
/* int [r3] rawmemchr (void *s [r3], int c [r4]) */
.machine power7
-ENTRY (__rawmemchr)
+ENTRY (__rawmemchr_power7)
CALL_MCOUNT 2
dcbt 0,r3
clrrdi r8,r3,3 /* Align the address to doubleword boundary. */
@@ -95,6 +95,4 @@ L(done):
srdi r0,r0,3 /* Convert leading zeroes to bytes. */
add r3,r8,r0 /* Return address of the matching char. */
blr
-END (__rawmemchr)
-weak_alias (__rawmemchr,rawmemchr)
-libc_hidden_builtin_def (__rawmemchr)
+END (__rawmemchr_power7)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/rawmemchr-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/rawmemchr-ppc64.c
new file mode 100644
index 0000000..864d963
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/rawmemchr-ppc64.c
@@ -0,0 +1,32 @@
+/* PowerPC32 default implementation of rawmemchr.
+ 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 <string.h>
+
+#define RAWMEMCHR __rawmemchr_ppc64
+#undef weak_alias
+#define weak_alias(a, b)
+#ifdef SHARED
+# undef libc_hidden_def
+# define libc_hidden_def(name) \
+ __hidden_ver1 (__rawmemchr_ppc64, __GI___rawmemchr, __rawmemchr_ppc64);
+#endif
+
+extern __typeof (rawmemchr) __rawmemchr_ppc64 attribute_hidden;
+
+#include <string/rawmemchr.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c b/sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c
new file mode 100644
index 0000000..2e2d082
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c
@@ -0,0 +1,37 @@
+/* Multiple versions of rawmemchr.
+ 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/>. */
+
+#ifndef NOT_IN_libc
+# include <string.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+extern __typeof (__rawmemchr) __rawmemchr_ppc64 attribute_hidden;
+extern __typeof (__rawmemchr) __rawmemchr_power7 attribute_hidden;
+
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
+ ifunc symbol properly. */
+libc_ifunc (__rawmemchr,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __rawmemchr_power7
+ : __rawmemchr_ppc64);
+
+weak_alias (__rawmemchr, rawmemchr)
+#else
+#include <string/rawmemchr.c>
+#endif
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=061a25dc07315d8a6ecb8a649b94e6f7dfa1edca
commit 061a25dc07315d8a6ecb8a649b94e6f7dfa1edca
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Fri Jun 7 08:42:32 2013 -0500
PowerPC: memrchr multilib for PowerPC64
diff --git a/sysdeps/powerpc/powerpc64/multiarch/Makefile b/sysdeps/powerpc/powerpc64/multiarch/Makefile
index 1552c80..11e621f 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc64/multiarch/Makefile
@@ -3,5 +3,5 @@ sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
memcpy-power4 memcpy-ppc64 memcmp-power7 memcmp-power4 \
memcmp-ppc64 memset-power7 memset-power6 memset-power4 \
memset-ppc64 mempcpy-power7 mempcpy-ppc64 memchr-power7 \
- memchr-ppc64
+ memchr-ppc64 memrchr-power7 memrchr-ppc64
endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
index d5e8f18..9a15b01 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
@@ -72,6 +72,14 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
IFUNC_IMPL_ADD (array, i, memchr, 1,
__memchr_ppc64))
+ /* Support sysdeps/powerpc/powerpc64/multiarch/memrchr.c. */
+ IFUNC_IMPL (i, name, memrchr,
+ IFUNC_IMPL_ADD (array, i, memrchr,
+ hwcap & PPC_FEATURE_HAS_VSX,
+ __memrchr_power7)
+ IFUNC_IMPL_ADD (array, i, memrchr, 1,
+ __memrchr_ppc64))
+
#ifdef SHARED
/* Support sysdeps/powerpc/powerpc64/multiarch/memcpy.c. */
IFUNC_IMPL (i, name, memcpy,
diff --git a/sysdeps/powerpc/powerpc64/power7/memrchr.S b/sysdeps/powerpc/powerpc64/multiarch/memrchr-power7.S
similarity index 97%
rename from sysdeps/powerpc/powerpc64/power7/memrchr.S
rename to sysdeps/powerpc/powerpc64/multiarch/memrchr-power7.S
index d24fbbb..1424823 100644
--- a/sysdeps/powerpc/powerpc64/power7/memrchr.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memrchr-power7.S
@@ -21,7 +21,7 @@
/* int [r3] memrchr (char *s [r3], int byte [r4], int size [r5]) */
.machine power7
-ENTRY (__memrchr)
+ENTRY (__memrchr_power7)
CALL_MCOUNT
dcbt 0,r3
mr r7,r3
@@ -171,7 +171,4 @@ L(loop_small):
cmpld r8,r7
ble L(null)
b L(loop_small)
-
-END (__memrchr)
-weak_alias (__memrchr, memrchr)
-libc_hidden_builtin_def (memrchr)
+END (__memrchr_power7)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memrchr-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/memrchr-ppc64.c
new file mode 100644
index 0000000..942bb68
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/memrchr-ppc64.c
@@ -0,0 +1,25 @@
+/* PowerPC32 default implementation of memrchr.
+ 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/>. */
+
+#ifndef NOT_IN_libc
+# define MEMRCHR __memrchr_ppc64
+# include <string.h>
+extern void *__memrchr_ppc64 (const void *, int, size_t);
+#endif
+
+#include <string/memrchr.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memrchr.c b/sysdeps/powerpc/powerpc64/multiarch/memrchr.c
new file mode 100644
index 0000000..93bc1ef
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/memrchr.c
@@ -0,0 +1,37 @@
+/* Multiple versions of memrchr.
+ 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/>. */
+
+#ifndef NOT_IN_libc
+# include <string.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+extern __typeof (__memrchr) __memrchr_ppc64 attribute_hidden;
+extern __typeof (__memrchr) __memrchr_power7 attribute_hidden;
+
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
+ ifunc symbol properly. */
+libc_ifunc (__memrchr,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __memrchr_power7
+ : __memrchr_ppc64);
+
+weak_alias (__memrchr, memrchr)
+#else
+#include <string/memrchr.c>
+#endif
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=85caef984d94677cf6c8d57906fed7dbcc185a89
commit 85caef984d94677cf6c8d57906fed7dbcc185a89
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Fri Jun 7 08:37:14 2013 -0500
PowerPC: memchr multilib for PowerPC64
diff --git a/sysdeps/powerpc/powerpc64/multiarch/Makefile b/sysdeps/powerpc/powerpc64/multiarch/Makefile
index c37e8e2..1552c80 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc64/multiarch/Makefile
@@ -2,5 +2,6 @@ ifeq ($(subdir),string)
sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
memcpy-power4 memcpy-ppc64 memcmp-power7 memcmp-power4 \
memcmp-ppc64 memset-power7 memset-power6 memset-power4 \
- memset-ppc64 mempcpy-power7 mempcpy-ppc64
+ memset-ppc64 mempcpy-power7 mempcpy-ppc64 memchr-power7 \
+ memchr-ppc64
endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
index 4cb9576..d5e8f18 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
@@ -64,6 +64,14 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
IFUNC_IMPL_ADD (array, i, mempcpy, 1,
__mempcpy_ppc64))
+ /* Support sysdeps/powerpc/powerpc64/multiarch/memchr.c. */
+ IFUNC_IMPL (i, name, memchr,
+ IFUNC_IMPL_ADD (array, i, memchr,
+ hwcap & PPC_FEATURE_HAS_VSX,
+ __memchr_power7)
+ IFUNC_IMPL_ADD (array, i, memchr, 1,
+ __memchr_ppc64))
+
#ifdef SHARED
/* Support sysdeps/powerpc/powerpc64/multiarch/memcpy.c. */
IFUNC_IMPL (i, name, memcpy,
diff --git a/sysdeps/powerpc/powerpc64/power7/memchr.S b/sysdeps/powerpc/powerpc64/multiarch/memchr-power7.S
similarity index 98%
rename from sysdeps/powerpc/powerpc64/power7/memchr.S
rename to sysdeps/powerpc/powerpc64/multiarch/memchr-power7.S
index 3416897..f4cedd3 100644
--- a/sysdeps/powerpc/powerpc64/power7/memchr.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memchr-power7.S
@@ -21,7 +21,7 @@
/* int [r3] memchr (char *s [r3], int byte [r4], int size [r5]) */
.machine power7
-ENTRY (__memchr)
+ENTRY (__memchr_power7)
CALL_MCOUNT 2
dcbt 0,r3
clrrdi r8,r3,3
@@ -198,8 +198,4 @@ L(loop_small): /* loop_small has been unrolled. */
/* Save a branch and exit directly. */
li r3,0
blr
-
-
-END (__memchr)
-weak_alias (__memchr, memchr)
-libc_hidden_builtin_def (memchr)
+END (__memchr_power7)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memchr-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/memchr-ppc64.c
new file mode 100644
index 0000000..b95f28f
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/memchr-ppc64.c
@@ -0,0 +1,34 @@
+/* PowerPC32 default implementation of memchr.
+ 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 <string.h>
+
+#define MEMCHR __memchr_ppc64
+
+#undef weak_alias
+#define weak_alias(a, b)
+
+#ifdef SHARED
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name) \
+ __hidden_ver1 (__memchr_ppc64, __GI_memchr, __memchr_ppc64);
+#endif
+
+extern __typeof (memchr) __memchr_ppc64 attribute_hidden;
+
+#include <string/memchr.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memchr.c b/sysdeps/powerpc/powerpc64/multiarch/memchr.c
new file mode 100644
index 0000000..ee685df
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/memchr.c
@@ -0,0 +1,38 @@
+/* Multiple versions of memchr.
+ 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/>. */
+
+#ifndef NOT_IN_libc
+# include <string.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+extern __typeof (__memchr) __memchr_ppc64 attribute_hidden;
+extern __typeof (__memchr) __memchr_power7 attribute_hidden;
+
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
+ ifunc symbol properly. */
+libc_ifunc (__memchr,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __memchr_power7
+ : __memchr_ppc64);
+
+weak_alias (__memchr, memchr)
+libc_hidden_builtin_def (memchr)
+#else
+#include <string/memchr.c>
+#endif
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=e74bf3d127db538097f27c023bcae1b41ae9e902
commit e74bf3d127db538097f27c023bcae1b41ae9e902
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Fri Jun 7 08:36:43 2013 -0500
PowerPC: mempcpy multilib for PowerPC64
diff --git a/sysdeps/powerpc/powerpc64/multiarch/Makefile b/sysdeps/powerpc/powerpc64/multiarch/Makefile
index d407542..c37e8e2 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc64/multiarch/Makefile
@@ -2,5 +2,5 @@ ifeq ($(subdir),string)
sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
memcpy-power4 memcpy-ppc64 memcmp-power7 memcmp-power4 \
memcmp-ppc64 memset-power7 memset-power6 memset-power4 \
- memset-ppc64
+ memset-ppc64 mempcpy-power7 mempcpy-ppc64
endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
index 6c26abc..4cb9576 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
@@ -56,6 +56,14 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
__bzero_power4)
IFUNC_IMPL_ADD (array, i, bzero, 1, __bzero_ppc64))
+ /* Support sysdeps/powerpc/powerpc64/multiarch/mempcpy.c. */
+ IFUNC_IMPL (i, name, mempcpy,
+ IFUNC_IMPL_ADD (array, i, mempcpy,
+ hwcap & PPC_FEATURE_HAS_VSX,
+ __mempcpy_power7)
+ IFUNC_IMPL_ADD (array, i, mempcpy, 1,
+ __mempcpy_ppc64))
+
#ifdef SHARED
/* Support sysdeps/powerpc/powerpc64/multiarch/memcpy.c. */
IFUNC_IMPL (i, name, memcpy,
diff --git a/sysdeps/powerpc/powerpc64/power7/mempcpy.S b/sysdeps/powerpc/powerpc64/multiarch/mempcpy-power7.S
similarity index 98%
rename from sysdeps/powerpc/powerpc64/power7/mempcpy.S
rename to sysdeps/powerpc/powerpc64/multiarch/mempcpy-power7.S
index f20be93..3e9fcc9 100644
--- a/sysdeps/powerpc/powerpc64/power7/mempcpy.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/mempcpy-power7.S
@@ -24,7 +24,7 @@
Returns 'dst' + 'len'. */
.machine power7
-EALIGN (__mempcpy, 5, 0)
+EALIGN (__mempcpy_power7, 5, 0)
CALL_MCOUNT 3
cmpldi cr1,5,31
@@ -449,7 +449,4 @@ L(end_unaligned_loop):
add 3,3,5
blr
-END_GEN_TB (__mempcpy,TB_TOCLESS)
-libc_hidden_def (__mempcpy)
-weak_alias (__mempcpy, mempcpy)
-libc_hidden_builtin_def (mempcpy)
+END_GEN_TB (__mempcpy_power7,TB_TOCLESS)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/mempcpy-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/mempcpy-ppc64.c
new file mode 100644
index 0000000..198c224
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/mempcpy-ppc64.c
@@ -0,0 +1,32 @@
+/* PowerPC32 default implementation of mempcpy.
+ 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/>. */
+
+#define MEMPCPY __mempcpy_ppc64
+
+#undef libc_hidden_def
+#define libc_hidden_def(name)
+#undef weak_alias
+#define weak_alias(a, b)
+
+#if defined SHARED
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name) \
+ __hidden_ver1 (__mempcpy_ppc64, __GI_mempcpy, __mempcpy_ppc64);
+#endif
+
+#include <string/mempcpy.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/mempcpy.c b/sysdeps/powerpc/powerpc64/multiarch/mempcpy.c
new file mode 100644
index 0000000..60d4c87
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/mempcpy.c
@@ -0,0 +1,38 @@
+/* Multiple versions of mempcpy.
+ 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/>. */
+
+#ifndef NOT_IN_libc
+# include <string.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+extern __typeof (__mempcpy) __mempcpy_ppc64 attribute_hidden;
+extern __typeof (__mempcpy) __mempcpy_power7 attribute_hidden;
+
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
+ ifunc symbol properly. */
+libc_ifunc (__mempcpy,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __mempcpy_power7
+ : __mempcpy_ppc64);
+
+weak_alias (__mempcpy, mempcpy)
+libc_hidden_def (mempcpy)
+#else
+# include <string/mempcpy.c>
+#endif
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=a3063c79bfa6c4d3f0c95095855133f49718db41
commit a3063c79bfa6c4d3f0c95095855133f49718db41
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Fri Jun 7 08:36:08 2013 -0500
PowerPC: memset/bzero multilib for PowerPC64
diff --git a/sysdeps/powerpc/powerpc64/memset.S b/sysdeps/powerpc/powerpc64/memset.S
index 6acf149..f574902 100644
--- a/sysdeps/powerpc/powerpc64/memset.S
+++ b/sysdeps/powerpc/powerpc64/memset.S
@@ -247,6 +247,7 @@ L(medium_28t):
END_GEN_TB (memset,TB_TOCLESS)
libc_hidden_builtin_def (memset)
+#ifndef NO_BZERO_IMPL
/* Copied from bzero.S to prevent the linker from inserting a stub
between bzero and memset. */
ENTRY (__bzero)
@@ -257,3 +258,4 @@ ENTRY (__bzero)
END_GEN_TB (__bzero,TB_TOCLESS)
weak_alias (__bzero, bzero)
+#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/Makefile b/sysdeps/powerpc/powerpc64/multiarch/Makefile
index 4dd2f38..d407542 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc64/multiarch/Makefile
@@ -1,5 +1,6 @@
ifeq ($(subdir),string)
sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
memcpy-power4 memcpy-ppc64 memcmp-power7 memcmp-power4 \
- memcmp-ppc64
+ memcmp-ppc64 memset-power7 memset-power6 memset-power4 \
+ memset-ppc64
endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/bzero.c b/sysdeps/powerpc/powerpc64/multiarch/bzero.c
new file mode 100644
index 0000000..4d4c4a8
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/bzero.c
@@ -0,0 +1,40 @@
+/* Multiple versions of bzero. PowerPC64 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/>. */
+
+/* Define multiple versions only for definition in libc. */
+#ifndef NOT_IN_libc
+# include <string.h>
+# include <strings.h>
+# include "init-arch.h"
+
+extern __typeof (bzero) __bzero_ppc64 attribute_hidden;
+extern __typeof (bzero) __bzero_power4 attribute_hidden;
+extern __typeof (bzero) __bzero_power6 attribute_hidden;
+extern __typeof (bzero) __bzero_power7 attribute_hidden;
+
+libc_ifunc (__bzero,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __bzero_power7 :
+ (hwcap & PPC_FEATURE_ARCH_2_05)
+ ? __bzero_power6 :
+ (hwcap & PPC_FEATURE_POWER4)
+ ? __bzero_power4
+ : __bzero_ppc64);
+
+weak_alias (__bzero, bzero)
+#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
index c1938ac..6c26abc 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
@@ -46,6 +46,16 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
else if (hwcap & PPC_FEATURE_POWER5)
hwcap |= PPC_FEATURE_POWER4;
+ /* Support sysdeps/powerpc/powerpc64/multiarch/bzero.c. */
+ IFUNC_IMPL (i, name, bzero,
+ IFUNC_IMPL_ADD (array, i, bzero, hwcap & PPC_FEATURE_HAS_VSX,
+ __bzero_power7)
+ IFUNC_IMPL_ADD (array, i, bzero, hwcap & PPC_FEATURE_ARCH_2_05,
+ __bzero_power6)
+ IFUNC_IMPL_ADD (array, i, bzero, hwcap & PPC_FEATURE_POWER4,
+ __bzero_power4)
+ IFUNC_IMPL_ADD (array, i, bzero, 1, __bzero_ppc64))
+
#ifdef SHARED
/* Support sysdeps/powerpc/powerpc64/multiarch/memcpy.c. */
IFUNC_IMPL (i, name, memcpy,
@@ -68,6 +78,16 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
IFUNC_IMPL_ADD (array, i, memcmp, hwcap & PPC_FEATURE_POWER4,
__memcmp_power4)
IFUNC_IMPL_ADD (array, i, memcmp, 1, __memcmp_ppc64))
+
+ /* Support sysdeps/powerpc/powerpc64/multiarch/memset.c. */
+ IFUNC_IMPL (i, name, memset,
+ IFUNC_IMPL_ADD (array, i, memset, hwcap & PPC_FEATURE_HAS_VSX,
+ __memset_power7)
+ IFUNC_IMPL_ADD (array, i, memset, hwcap & PPC_FEATURE_ARCH_2_05,
+ __memset_power6)
+ IFUNC_IMPL_ADD (array, i, memset, hwcap & PPC_FEATURE_POWER4,
+ __memset_power4)
+ IFUNC_IMPL_ADD (array, i, memset, 1, __memset_ppc64))
#endif
return i;
diff --git a/sysdeps/powerpc/powerpc64/power4/memset.S b/sysdeps/powerpc/powerpc64/multiarch/memset-power4.S
similarity index 96%
rename from sysdeps/powerpc/powerpc64/power4/memset.S
rename to sysdeps/powerpc/powerpc64/multiarch/memset-power4.S
index dbecee8..e0ed2ca 100644
--- a/sysdeps/powerpc/powerpc64/power4/memset.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memset-power4.S
@@ -26,7 +26,7 @@
to 0, to take advantage of the dcbz instruction. */
.machine power4
-EALIGN (memset, 5, 0)
+EALIGN (__memset_power4, 5, 0)
CALL_MCOUNT 3
#define rTMP r0
@@ -232,16 +232,13 @@ L(medium_27f):
L(medium_28t):
std rCHR, -8(rMEMP)
blr
-END_GEN_TB (memset,TB_TOCLESS)
-libc_hidden_builtin_def (memset)
+END_GEN_TB (__memset_power4,TB_TOCLESS)
/* Copied from bzero.S to prevent the linker from inserting a stub
between bzero and memset. */
-ENTRY (__bzero)
- CALL_MCOUNT 3
- mr r5,r4
- li r4,0
- b L(_memset)
-END_GEN_TB (__bzero,TB_TOCLESS)
-
-weak_alias (__bzero, bzero)
+ENTRY (__bzero_power4)
+ CALL_MCOUNT 3
+ mr r5,r4
+ li r4,0
+ b L(_memset)
+END_GEN_TB (__bzero_power4,TB_TOCLESS)
diff --git a/sysdeps/powerpc/powerpc64/power6/memset.S b/sysdeps/powerpc/powerpc64/multiarch/memset-power6.S
similarity index 97%
rename from sysdeps/powerpc/powerpc64/power6/memset.S
rename to sysdeps/powerpc/powerpc64/multiarch/memset-power6.S
index 541a45f..4e9ddfc 100644
--- a/sysdeps/powerpc/powerpc64/power6/memset.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memset-power6.S
@@ -26,7 +26,7 @@
to 0, to take advantage of the dcbz instruction. */
.machine power6
-EALIGN (memset, 7, 0)
+EALIGN (__memset_power6, 7, 0)
CALL_MCOUNT 3
#define rTMP r0
@@ -376,16 +376,13 @@ L(medium_27f):
L(medium_28t):
std rCHR, -8(rMEMP)
blr
-END_GEN_TB (memset,TB_TOCLESS)
-libc_hidden_builtin_def (memset)
+END_GEN_TB (__memset_power6,TB_TOCLESS)
/* Copied from bzero.S to prevent the linker from inserting a stub
between bzero and memset. */
-ENTRY (__bzero)
- CALL_MCOUNT 3
- mr r5,r4
- li r4,0
- b L(_memset)
-END_GEN_TB (__bzero,TB_TOCLESS)
-
-weak_alias (__bzero, bzero)
+ENTRY (__bzero_power6)
+ CALL_MCOUNT 3
+ mr r5,r4
+ li r4,0
+ b L(_memset)
+END_GEN_TB (__bzero_power6,TB_TOCLESS)
diff --git a/sysdeps/powerpc/powerpc64/power7/memset.S b/sysdeps/powerpc/powerpc64/multiarch/memset-power7.S
similarity index 96%
rename from sysdeps/powerpc/powerpc64/power7/memset.S
rename to sysdeps/powerpc/powerpc64/multiarch/memset-power7.S
index b24cfa1..5103c7a 100644
--- a/sysdeps/powerpc/powerpc64/power7/memset.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memset-power7.S
@@ -23,7 +23,7 @@
Returns 's'. */
.machine power7
-EALIGN (memset, 5, 0)
+EALIGN (__memset_power7, 5, 0)
CALL_MCOUNT 3
L(_memset):
@@ -380,16 +380,13 @@ L(small):
stw 4,4(10)
blr
-END_GEN_TB (memset,TB_TOCLESS)
-libc_hidden_builtin_def (memset)
+END_GEN_TB (__memset_power7,TB_TOCLESS)
/* Copied from bzero.S to prevent the linker from inserting a stub
between bzero and memset. */
-ENTRY (__bzero)
- CALL_MCOUNT 3
- mr r5,r4
- li r4,0
- b L(_memset)
-END_GEN_TB (__bzero,TB_TOCLESS)
-
-weak_alias (__bzero, bzero)
+ENTRY (__bzero_power7)
+ CALL_MCOUNT 3
+ mr r5,r4
+ li r4,0
+ b L(_memset)
+END_GEN_TB (__bzero_power7,TB_TOCLESS)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S b/sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S
new file mode 100644
index 0000000..ae71e2e
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S
@@ -0,0 +1,54 @@
+/* Default memset/bzero implementation for PowerPC64.
+ 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>
+
+#if defined SHARED && !defined NOT_IN_libc
+
+/* Copied from bzero.S to prevent the linker from inserting a stub
+ between bzero and memset. */
+ENTRY (__bzero_ppc64)
+ CALL_MCOUNT 3
+ mr r5,r4
+ li r4,0
+ b L(_memset)
+END_GEN_TB (__bzero_ppc64,TB_TOCLESS)
+
+# undef EALIGN
+# define EALIGN(name, alignt, words) \
+ ENTRY_2(__memset_ppc64) \
+ .align ALIGNARG(alignt); \
+ EALIGN_W_##words; \
+ BODY_LABEL(__memset_ppc64): \
+ cfi_startproc;
+
+# undef END_GEN_TB
+# define END_GEN_TB(name, mask) \
+ cfi_endproc; \
+ TRACEBACK_MASK(__memset_ppc64,mask) \
+ END_2(__memset_ppc64)
+
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name) \
+ .globl __GI_memset; __GI_memset = __memset_ppc64
+
+/* Do not implement __bzero at powerpc64/memset.S. */
+# define NO_BZERO_IMPL
+#endif
+
+#include <sysdeps/powerpc/powerpc64/memset.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memset.c b/sysdeps/powerpc/powerpc64/multiarch/memset.c
new file mode 100644
index 0000000..f9772a7
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/memset.c
@@ -0,0 +1,40 @@
+/* Multiple versions of memset.
+ 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/>. */
+
+/* Define multiple versions only for definition in libc. */
+#if defined SHARED && !defined NOT_IN_libc
+# include <string.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+extern __typeof (memset) __memset_ppc64 attribute_hidden;
+extern __typeof (memset) __memset_power4 attribute_hidden;
+extern __typeof (memset) __memset_power6 attribute_hidden;
+extern __typeof (memset) __memset_power7 attribute_hidden;
+
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
+ ifunc symbol properly. */
+libc_ifunc (memset,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __memset_power7 :
+ (hwcap & PPC_FEATURE_ARCH_2_05)
+ ? __memset_power6 :
+ (hwcap & PPC_FEATURE_POWER4)
+ ? __memset_power4
+ : __memset_ppc64);
+#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/rtld-memset.c b/sysdeps/powerpc/powerpc64/multiarch/rtld-memset.c
new file mode 100644
index 0000000..c74a770
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/rtld-memset.c
@@ -0,0 +1,18 @@
+/* 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 <sysdeps/powerpc/powerpc64/rtld-memset.c>
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=d2d61faa04015ec6fea277bb55197feadf2eb9a8
commit d2d61faa04015ec6fea277bb55197feadf2eb9a8
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Fri Jun 7 08:35:16 2013 -0500
PowerPC: memcmp multilib for PowerPC64
diff --git a/sysdeps/powerpc/powerpc64/multiarch/Makefile b/sysdeps/powerpc/powerpc64/multiarch/Makefile
index 7467021..4dd2f38 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc64/multiarch/Makefile
@@ -1,4 +1,5 @@
ifeq ($(subdir),string)
sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
- memcpy-power4 memcpy-ppc64
+ memcpy-power4 memcpy-ppc64 memcmp-power7 memcmp-power4 \
+ memcmp-ppc64
endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
index c7994f9..c1938ac 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
@@ -60,6 +60,14 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
IFUNC_IMPL_ADD (array, i, memcpy, hwcap & PPC_FEATURE_POWER4,
__memcpy_power4)
IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_ppc64))
+
+ /* Support sysdeps/powerpc/powerpc64/multiarch/memcmp.c. */
+ IFUNC_IMPL (i, name, memcmp,
+ IFUNC_IMPL_ADD (array, i, memcmp, hwcap & PPC_FEATURE_HAS_VSX,
+ __memcmp_power7)
+ IFUNC_IMPL_ADD (array, i, memcmp, hwcap & PPC_FEATURE_POWER4,
+ __memcmp_power4)
+ IFUNC_IMPL_ADD (array, i, memcmp, 1, __memcmp_ppc64))
#endif
return i;
diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S
similarity index 99%
rename from sysdeps/powerpc/powerpc64/power4/memcmp.S
rename to sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S
index 69caedc..969283c 100644
--- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S
@@ -21,7 +21,7 @@
/* int [r3] memcmp (const char *s1 [r3], const char *s2 [r4], size_t size [r5]) */
.machine power4
-EALIGN (memcmp, 4, 0)
+EALIGN (__memcmp_power4, 4, 0)
CALL_MCOUNT 3
#define rTMP r0
@@ -971,6 +971,4 @@ L(duzeroLength):
li rRTN,0
blr
-END (memcmp)
-libc_hidden_builtin_def (memcmp)
-weak_alias (memcmp, bcmp)
+END (__memcmp_power4)
diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S
similarity index 99%
rename from sysdeps/powerpc/powerpc64/power7/memcmp.S
rename to sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S
index f190c64..da8ce83 100644
--- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S
@@ -23,7 +23,7 @@
size_t size [r5]) */
.machine power7
-EALIGN (memcmp,4,0)
+EALIGN (__memcmp_power7,4,0)
CALL_MCOUNT 3
#define rTMP r0
@@ -973,6 +973,4 @@ L(duzeroLength):
li rRTN,0
blr
-END (memcmp)
-libc_hidden_builtin_def (memcmp)
-weak_alias (memcmp,bcmp)
+END (__memcmp_power7)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/memcmp-ppc64.c
new file mode 100644
index 0000000..29fb26d
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-ppc64.c
@@ -0,0 +1,33 @@
+/* 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 <string.h>
+
+#define MEMCMP __memcmp_ppc64
+#undef weak_alias
+#define weak_alias(name, aliasname) \
+ extern __typeof (__memcmp_ppc64) aliasname \
+ __attribute__ ((weak, alias ("__memcmp_ppc64")));
+#if !defined(NOT_IN_libc) && defined(SHARED)
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name) \
+ __hidden_ver1(__memcmp_ppc64, __GI_memcmp, __memcmp_ppc64);
+#endif
+
+extern __typeof (memcmp) __memcmp_ppc64 attribute_hidden;
+
+#include <string/memcmp.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp.c b/sysdeps/powerpc/powerpc64/multiarch/memcmp.c
new file mode 100644
index 0000000..7bfdf93
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp.c
@@ -0,0 +1,39 @@
+/* Multiple versions of memcmp. PowerPC64 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/>. */
+
+/* Define multiple versions only for definition in libc. */
+#ifndef NOT_IN_libc
+# include <string.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+extern __typeof (memcmp) __memcmp_ppc64 attribute_hidden;
+extern __typeof (memcmp) __memcmp_power4 attribute_hidden;
+extern __typeof (memcmp) __memcmp_power7 attribute_hidden;
+
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
+ ifunc symbol properly. */
+libc_ifunc (memcmp,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __memcmp_power7 :
+ (hwcap & PPC_FEATURE_POWER4)
+ ? __memcmp_power4
+ : __memcmp_ppc64);
+#else
+#include <string/memcmp.c>
+#endif
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=c1473299d9cd3fd33a380f77bbbfa92547deb421
commit c1473299d9cd3fd33a380f77bbbfa92547deb421
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Fri Jun 7 08:34:46 2013 -0500
PowerPC: memcpy multilib for PowerPC64
diff --git a/sysdeps/powerpc/powerpc64/multiarch/Makefile b/sysdeps/powerpc/powerpc64/multiarch/Makefile
new file mode 100644
index 0000000..7467021
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/Makefile
@@ -0,0 +1,4 @@
+ifeq ($(subdir),string)
+sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
+ memcpy-power4 memcpy-ppc64
+endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
new file mode 100644
index 0000000..c7994f9
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
@@ -0,0 +1,66 @@
+/* Enumerate available IFUNC implementations of a function. PowerPC64 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 <assert.h>
+#include <string.h>
+#include <wchar.h>
+#include <ldsodefs.h>
+#include <ifunc-impl-list.h>
+
+/* Maximum number of IFUNC implementations. */
+#define MAX_IFUNC 6
+
+size_t
+__libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+ size_t max)
+{
+ assert (max >= MAX_IFUNC);
+
+ size_t i = 0;
+
+ unsigned long int hwcap = GLRO(dl_hwcap);
+ /* hwcap contains only the latest supported ISA, the code checks which is
+ and fills the previous supported ones. */
+ if (hwcap & PPC_FEATURE_ARCH_2_06)
+ hwcap |= PPC_FEATURE_ARCH_2_05 | PPC_FEATURE_POWER5_PLUS |
+ PPC_FEATURE_POWER5 | PPC_FEATURE_POWER4;
+ else if (hwcap & PPC_FEATURE_ARCH_2_05)
+ hwcap |= PPC_FEATURE_POWER5_PLUS | PPC_FEATURE_POWER5 | PPC_FEATURE_POWER4;
+ else if (hwcap & PPC_FEATURE_POWER5_PLUS)
+ hwcap |= PPC_FEATURE_POWER5 | PPC_FEATURE_POWER4;
+ else if (hwcap & PPC_FEATURE_POWER5)
+ hwcap |= PPC_FEATURE_POWER4;
+
+#ifdef SHARED
+ /* Support sysdeps/powerpc/powerpc64/multiarch/memcpy.c. */
+ IFUNC_IMPL (i, name, memcpy,
+ IFUNC_IMPL_ADD (array, i, memcpy, hwcap & PPC_FEATURE_HAS_VSX,
+ __memcpy_power7)
+ IFUNC_IMPL_ADD (array, i, memcpy, hwcap & PPC_FEATURE_ARCH_2_06,
+ __memcpy_a2)
+ IFUNC_IMPL_ADD (array, i, memcpy, hwcap & PPC_FEATURE_ARCH_2_05,
+ __memcpy_power6)
+ IFUNC_IMPL_ADD (array, i, memcpy, hwcap & PPC_FEATURE_CELL_BE,
+ __memcpy_cell)
+ IFUNC_IMPL_ADD (array, i, memcpy, hwcap & PPC_FEATURE_POWER4,
+ __memcpy_power4)
+ IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_ppc64))
+#endif
+
+ return i;
+}
diff --git a/sysdeps/powerpc/powerpc64/multiarch/init-arch.h b/sysdeps/powerpc/powerpc64/multiarch/init-arch.h
new file mode 100644
index 0000000..e3ddadd
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/init-arch.h
@@ -0,0 +1,18 @@
+/* This file is part of the GNU C Library.
+ Copyright (C) 2013 Free Software Foundation, Inc.
+
+ 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 <sysdeps/powerpc/powerpc32/multiarch/init-arch.h>
diff --git a/sysdeps/powerpc/powerpc64/a2/memcpy.S b/sysdeps/powerpc/powerpc64/multiarch/memcpy-a2.S
similarity index 99%
rename from sysdeps/powerpc/powerpc64/a2/memcpy.S
rename to sysdeps/powerpc/powerpc64/multiarch/memcpy-a2.S
index 84c82bb..7363b5f 100644
--- a/sysdeps/powerpc/powerpc64/a2/memcpy.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcpy-a2.S
@@ -30,7 +30,7 @@
.machine a2
-EALIGN (memcpy, 5, 0)
+EALIGN (__memcpy_a2, 5, 0)
CALL_MCOUNT 3
dcbt 0,r4 /* Prefetch ONE SRC cacheline */
@@ -520,5 +520,4 @@ L(endloop2_128):
b L(lessthancacheline)
-END_GEN_TB (memcpy,TB_TOCLESS)
-libc_hidden_builtin_def (memcpy)
+END_GEN_TB (__memcpy_a2,TB_TOCLESS)
diff --git a/sysdeps/powerpc/powerpc64/cell/memcpy.S b/sysdeps/powerpc/powerpc64/multiarch/memcpy-cell.S
similarity index 98%
rename from sysdeps/powerpc/powerpc64/cell/memcpy.S
rename to sysdeps/powerpc/powerpc64/multiarch/memcpy-cell.S
index a271965..c8dd87f 100644
--- a/sysdeps/powerpc/powerpc64/cell/memcpy.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcpy-cell.S
@@ -39,7 +39,7 @@
.align 7
-EALIGN (memcpy, 5, 0)
+EALIGN (__memcpy_cell, 5, 0)
CALL_MCOUNT 3
dcbt 0,r4 /* Prefetch ONE SRC cacheline */
@@ -238,5 +238,4 @@ EALIGN (memcpy, 5, 0)
stb r0,0(r6)
1: blr
-END_GEN_TB (memcpy,TB_TOCLESS)
-libc_hidden_builtin_def (memcpy)
+END_GEN_TB (__memcpy_cell,TB_TOCLESS)
diff --git a/sysdeps/powerpc/powerpc64/power4/memcpy.S b/sysdeps/powerpc/powerpc64/multiarch/memcpy-power4.S
similarity index 99%
rename from sysdeps/powerpc/powerpc64/power4/memcpy.S
rename to sysdeps/powerpc/powerpc64/multiarch/memcpy-power4.S
index 4317c7e..75b2914 100644
--- a/sysdeps/powerpc/powerpc64/power4/memcpy.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcpy-power4.S
@@ -34,7 +34,7 @@
Each case has a optimized unrolled loop. */
.machine power4
-EALIGN (memcpy, 5, 0)
+EALIGN (__memcpy_power4, 5, 0)
CALL_MCOUNT 3
cmpldi cr1,5,31
@@ -411,5 +411,4 @@ EALIGN (memcpy, 5, 0)
ld 31,-8(1)
ld 3,-16(1)
blr
-END_GEN_TB (memcpy,TB_TOCLESS)
-libc_hidden_builtin_def (memcpy)
+END_GEN_TB (__memcpy_power4,TB_TOCLESS)
diff --git a/sysdeps/powerpc/powerpc64/power6/memcpy.S b/sysdeps/powerpc/powerpc64/multiarch/memcpy-power6.S
similarity index 99%
rename from sysdeps/powerpc/powerpc64/power6/memcpy.S
rename to sysdeps/powerpc/powerpc64/multiarch/memcpy-power6.S
index db29e2b..f30d3ba 100644
--- a/sysdeps/powerpc/powerpc64/power6/memcpy.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcpy-power6.S
@@ -41,7 +41,7 @@
for the destination. */
.machine "power6"
-EALIGN (memcpy, 7, 0)
+EALIGN (__memcpy_power6, 7, 0)
CALL_MCOUNT 3
cmpldi cr1,5,31
@@ -419,7 +419,7 @@ L(dus_tail):
/* At least 6 bytes left and the source is word aligned. This allows
some speculative loads up front. */
/* We need to special case the fall-through because the biggest delays
- are due to address computation not being ready in time for the
+ are due to address computation not being ready in time for then
AGEN. */
lwz 6,0(12)
lwz 7,4(12)
@@ -1163,5 +1163,4 @@ L(du_done):
ld 31,-8(1)
ld 3,-16(1)
blr
-END_GEN_TB (memcpy,TB_TOCLESS)
-libc_hidden_builtin_def (memcpy)
+END_GEN_TB (__memcpy_power6,TB_TOCLESS)
diff --git a/sysdeps/powerpc/powerpc64/power7/memcpy.S b/sysdeps/powerpc/powerpc64/multiarch/memcpy-power7.S
similarity index 99%
rename from sysdeps/powerpc/powerpc64/power7/memcpy.S
rename to sysdeps/powerpc/powerpc64/multiarch/memcpy-power7.S
index 800a9f1..e6ee4e2 100644
--- a/sysdeps/powerpc/powerpc64/power7/memcpy.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcpy-power7.S
@@ -24,7 +24,7 @@
Returns 'dst'. */
.machine power7
-EALIGN (memcpy, 5, 0)
+EALIGN (__memcpy_power7, 5, 0)
CALL_MCOUNT 3
cmpldi cr1,5,31
@@ -500,5 +500,4 @@ L(end_unaligned_loop):
ld 3,-16(1)
blr
-END_GEN_TB (memcpy,TB_TOCLESS)
-libc_hidden_builtin_def (memcpy)
+END_GEN_TB (__memcpy_power7,TB_TOCLESS)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcpy-ppc64.S b/sysdeps/powerpc/powerpc64/multiarch/memcpy-ppc64.S
new file mode 100644
index 0000000..df24449
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcpy-ppc64.S
@@ -0,0 +1,41 @@
+/* Default memcpy implementation for PowerPC64.
+ 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>
+
+#if defined SHARED && !defined NOT_IN_libc
+# undef EALIGN
+# define EALIGN(name, alignt, words) \
+ ENTRY_2(__memcpy_ppc64) \
+ .align ALIGNARG(alignt); \
+ EALIGN_W_##words; \
+ BODY_LABEL(__memcpy_ppc64): \
+ cfi_startproc;
+
+# undef END_GEN_TB
+# define END_GEN_TB(name, mask) \
+ cfi_endproc; \
+ TRACEBACK_MASK(__memcpy_ppc64,mask) \
+ END_2(__memcpy_ppc64)
+
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name) \
+ .globl __GI_memcpy; __GI_memcpy = __memcpy_ppc64
+#endif
+
+#include <sysdeps/powerpc/powerpc64/memcpy.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcpy.c b/sysdeps/powerpc/powerpc64/multiarch/memcpy.c
new file mode 100644
index 0000000..b91a0e4
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcpy.c
@@ -0,0 +1,48 @@
+/* Multiple versions of memcpy. PowerPC64 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/>. */
+
+/* Define multiple versions only for the definition in lib and for
+ DSO. In static binaries we need memcpy before the initialization
+ happened. */
+#if defined SHARED && !defined NOT_IN_libc
+# include <string.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+extern __typeof (memcpy) __memcpy_ppc64 attribute_hidden;
+extern __typeof (memcpy) __memcpy_power4 attribute_hidden;
+extern __typeof (memcpy) __memcpy_cell attribute_hidden;
+extern __typeof (memcpy) __memcpy_power6 attribute_hidden;
+extern __typeof (memcpy) __memcpy_a2 attribute_hidden;
+extern __typeof (memcpy) __memcpy_power7 attribute_hidden;
+
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
+ ifunc symbol properly. */
+libc_ifunc (memcpy,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __memcpy_power7 :
+ (hwcap & PPC_FEATURE_ARCH_2_06)
+ ? __memcpy_a2 :
+ (hwcap & PPC_FEATURE_ARCH_2_05)
+ ? __memcpy_power6 :
+ (hwcap & PPC_FEATURE_CELL_BE)
+ ? __memcpy_cell :
+ (hwcap & PPC_FEATURE_POWER4)
+ ? __memcpy_power4
+ : __memcpy_ppc64);
+#endif
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=33b11643f5567705318b3570fad18b4be3210402
commit 33b11643f5567705318b3570fad18b4be3210402
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Wed Jun 5 09:46:41 2013 -0500
PowerPC: __ieee754_hypot/__iee754_hypotf multilib for PowerPC32
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
index 2fcd4f2..7d13757 100644
--- a/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
@@ -26,7 +26,8 @@ libm-sysdep_routines += s_llrintf-power6 s_llrintf-power4 s_llrintf-ppc32 \
s_lrint-ppc32 s_modf-power5+ s_modf-ppc32 \
s_modff-power5+ s_modff-ppc32 s_logbl-power7 \
s_logbl-ppc32 s_logb-power7 s_logb-ppc32 \
- s_logbf-power7 s_logbf-ppc32
+ s_logbf-power7 s_logbf-ppc32 e_hypot-power7 \
+ e_hypot-ppc32 e_hypotf-power7 e_hypotf-ppc32
CFLAGS-s_llround.c = -fno-builtin-llroundf
CFLAGS-s_modf-power5+.c = -mcpu=power5+
@@ -34,4 +35,6 @@ CFLAGS-s_modff-power5+.c = -mcpu=power5+
CFLAGS-s_logbl-power7.c = -mcpu=power7
CFLAGS-s_logb-power7.c = -mcpu=power7
CFLAGS-s_logbf-power7.c = -mcpu=power7
+CFLAGS-e_hypot-power7.c = -mcpu=power7
+CFLAGS-e_hypotf-power7.c = -mcpu=power7
endif
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/e_hypot-power7.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/e_hypot-power7.c
new file mode 100644
index 0000000..91a42a2
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/e_hypot-power7.c
@@ -0,0 +1,26 @@
+/* __ieee_hypot() 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 <math.h>
+
+#undef strong_alias
+#define strong_alias(a, b)
+
+#define __ieee754_hypot __ieee754_hypot_power7
+
+#include <sysdeps/powerpc/fpu/e_hypot.c>
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/e_hypot-ppc32.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/e_hypot-ppc32.c
new file mode 100644
index 0000000..35ae97d
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/e_hypot-ppc32.c
@@ -0,0 +1,26 @@
+/* __ieee_hypot() PowerPC32 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 <math.h>
+
+#undef strong_alias
+#define strong_alias(a, b)
+
+#define __ieee754_hypot __ieee754_hypot_ppc32
+
+#include <sysdeps/powerpc/fpu/e_hypot.c>
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/e_hypot.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/e_hypot.c
new file mode 100644
index 0000000..c179ca2
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/e_hypot.c
@@ -0,0 +1,32 @@
+/* Multiple versions of ieee754_hypot.
+ 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 (__ieee754_hypot) __ieee754_hypot_ppc32 attribute_hidden;
+extern __typeof (__ieee754_hypot) __ieee754_hypot_power7 attribute_hidden;
+
+libc_ifunc (__ieee754_hypot,
+ (hwcap & PPC_FEATURE_ARCH_2_06)
+ ? __ieee754_hypot_power7
+ : __ieee754_hypot_ppc32);
+
+strong_alias (__ieee754_hypot, __hypot_finite)
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/e_hypotf-power7.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/e_hypotf-power7.c
new file mode 100644
index 0000000..64cba4e
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/e_hypotf-power7.c
@@ -0,0 +1,26 @@
+/* __ieee754_hypot 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 <math.h>
+
+#undef strong_alias
+#define strong_alias(a, b)
+
+#define __ieee754_hypotf __ieee754_hypotf_power7
+
+#include <sysdeps/powerpc/fpu/e_hypotf.c>
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/e_hypotf-ppc32.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/e_hypotf-ppc32.c
new file mode 100644
index 0000000..9a52322
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/e_hypotf-ppc32.c
@@ -0,0 +1,26 @@
+/* __ieee_hypot() PowerPC32 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 <math.h>
+
+#undef strong_alias
+#define strong_alias(a, b)
+
+#define __ieee754_hypotf __ieee754_hypotf_ppc32
+
+#include <sysdeps/ieee754/flt-32/e_hypotf.c>
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/e_hypotf.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/e_hypotf.c
new file mode 100644
index 0000000..d5c61cd
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/e_hypotf.c
@@ -0,0 +1,32 @@
+/* Multiple versions of ieee754_hypotf.
+ 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 (__ieee754_hypotf) __ieee754_hypotf_ppc32 attribute_hidden;
+extern __typeof (__ieee754_hypotf) __ieee754_hypotf_power7 attribute_hidden;
+
+libc_ifunc (__ieee754_hypotf,
+ (hwcap & PPC_FEATURE_ARCH_2_06)
+ ? __ieee754_hypotf_power7
+ : __ieee754_hypotf_ppc32);
+
+strong_alias (__ieee754_hypotf, __hypotf_finite)
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=ca5f5bf65567985a5be2fee49a21fdd0de176f5b
commit ca5f5bf65567985a5be2fee49a21fdd0de176f5b
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Wed Jun 5 09:22:01 2013 -0500
PowerPC: logb/logbf/logbl multilib for PowerPC32
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_logbl.c b/sysdeps/ieee754/ldbl-128ibm/s_logbl.c
index 6cbfcfa..b205680 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_logbl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_logbl.c
@@ -43,5 +43,6 @@ __logbl (long double x)
}
return (long double) (rhx - 1023);
}
-
+#ifndef __logbl
long_double_symbol (libm, __logbl, logbl);
+#endif
diff --git a/sysdeps/powerpc/powerpc32/power7/fpu/s_logb.c b/sysdeps/powerpc/power7/fpu/s_logb.c
similarity index 100%
rename from sysdeps/powerpc/powerpc32/power7/fpu/s_logb.c
rename to sysdeps/powerpc/power7/fpu/s_logb.c
diff --git a/sysdeps/powerpc/powerpc32/power7/fpu/s_logbf.c b/sysdeps/powerpc/power7/fpu/s_logbf.c
similarity index 98%
rename from sysdeps/powerpc/powerpc32/power7/fpu/s_logbf.c
rename to sysdeps/powerpc/power7/fpu/s_logbf.c
index 05726f2..f984d14 100644
--- a/sysdeps/powerpc/powerpc32/power7/fpu/s_logbf.c
+++ b/sysdeps/powerpc/power7/fpu/s_logbf.c
@@ -16,7 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include "math_private.h"
+#include <math.h>
/* This implementation avoids FP to INT conversions by using VSX
bitwise instructions over FP values. */
diff --git a/sysdeps/powerpc/powerpc32/power7/fpu/s_logbl.c b/sysdeps/powerpc/power7/fpu/s_logbl.c
similarity index 96%
rename from sysdeps/powerpc/powerpc32/power7/fpu/s_logbl.c
rename to sysdeps/powerpc/power7/fpu/s_logbl.c
index e008ed0..9b4731b 100644
--- a/sysdeps/powerpc/powerpc32/power7/fpu/s_logbl.c
+++ b/sysdeps/powerpc/power7/fpu/s_logbl.c
@@ -58,13 +58,14 @@ __logbl (long double x)
{
/* POSIX specifies that denormal number is treated as
though it were normalized. */
- int64_t lx, hx;
+ int64_t hx;
- GET_LDOUBLE_WORDS64 (hx, lx, x);
+ GET_LDOUBLE_MSW64 (hx, x);
return (long double) (-1023 - (__builtin_clzll (hx) - 12));
}
/* Test to avoid logb_downward (0.0) == -0.0. */
return ret == -0.0 ? 0.0 : ret;
}
-
+#ifndef __logbl
long_double_symbol (libm, __logbl, logbl);
+#endif
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
index 7a6e3fc..2fcd4f2 100644
--- a/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
@@ -24,9 +24,14 @@ libm-sysdep_routines += s_llrintf-power6 s_llrintf-power4 s_llrintf-ppc32 \
s_copysign-power6 s_copysign-ppc32 s_lround-power6x \
s_lround-power5+ s_lround-ppc32 s_lrint-power6x \
s_lrint-ppc32 s_modf-power5+ s_modf-ppc32 \
- s_modff-power5+ s_modff-ppc32
+ s_modff-power5+ s_modff-ppc32 s_logbl-power7 \
+ s_logbl-ppc32 s_logb-power7 s_logb-ppc32 \
+ s_logbf-power7 s_logbf-ppc32
CFLAGS-s_llround.c = -fno-builtin-llroundf
CFLAGS-s_modf-power5+.c = -mcpu=power5+
CFLAGS-s_modff-power5+.c = -mcpu=power5+
+CFLAGS-s_logbl-power7.c = -mcpu=power7
+CFLAGS-s_logb-power7.c = -mcpu=power7
+CFLAGS-s_logbf-power7.c = -mcpu=power7
endif
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_logb-power7.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_logb-power7.c
new file mode 100644
index 0000000..d856431
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_logb-power7.c
@@ -0,0 +1,28 @@
+/* logb(). 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 <math.h>
+
+#undef weak_alias
+#define weak_alias(a, b)
+#undef strong_alias
+#define strong_alias(a, b)
+
+#define __logb __logb_power7
+
+#include <sysdeps/powerpc/power7/fpu/s_logb.c>
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_logb-ppc32.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_logb-ppc32.c
new file mode 100644
index 0000000..9190ec9
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_logb-ppc32.c
@@ -0,0 +1,28 @@
+/* logb(). 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 <math.h>
+
+#undef weak_alias
+#define weak_alias(a, b)
+#undef strong_alias
+#define strong_alias(a, b)
+
+#define __logb __logb_ppc32
+
+#include <sysdeps/ieee754/dbl-64/s_logb.c>
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_logb.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_logb.c
new file mode 100644
index 0000000..c8eaf93
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_logb.c
@@ -0,0 +1,41 @@
+/* Multiple versions of logb.
+ 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 (__logb) __logb_ppc32 attribute_hidden;
+extern __typeof (__logb) __logb_power7 attribute_hidden;
+
+libc_ifunc (__logb,
+ (hwcap & PPC_FEATURE_ARCH_2_06)
+ ? __logb_power7
+ : __logb_ppc32);
+
+weak_alias (__logb, logb)
+
+#ifdef NO_LONG_DOUBLE
+strong_alias (__logb, __logbl)
+weak_alias (__logb, logbl)
+#endif
+
+#if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)
+compat_symbol (libm, logb, logbl, GLIBC_2_0);
+#endif
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_logbf-power7.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_logbf-power7.c
new file mode 100644
index 0000000..f454c75
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_logbf-power7.c
@@ -0,0 +1,26 @@
+/* logbf(). 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 <math.h>
+
+#undef weak_alias
+#define weak_alias(a, b)
+
+#define __logbf __logbf_power7
+
+#include <sysdeps/powerpc/power7/fpu/s_logbf.c>
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_logbf-ppc32.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_logbf-ppc32.c
new file mode 100644
index 0000000..7d51041
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_logbf-ppc32.c
@@ -0,0 +1,26 @@
+/* logbf(). PowerPC32 default implementation.
+ 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>
+
+#undef weak_alias
+#define weak_alias(a, b)
+
+#define __logbf __logbf_ppc32
+
+#include <sysdeps/ieee754/flt-32/s_logbf.c>
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_logbf.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_logbf.c
new file mode 100644
index 0000000..cf66af4
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_logbf.c
@@ -0,0 +1,32 @@
+/* Multiple versions of logbf.
+ 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 (__logbf) __logbf_ppc32 attribute_hidden;
+extern __typeof (__logbf) __logbf_power7 attribute_hidden;
+
+libc_ifunc (__logbf,
+ (hwcap & PPC_FEATURE_ARCH_2_06)
+ ? __logbf_power7
+ : __logbf_ppc32);
+
+weak_alias (__logbf, logbf)
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_logbl-power7.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_logbl-power7.c
new file mode 100644
index 0000000..b5adcd2
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_logbl-power7.c
@@ -0,0 +1,21 @@
+/* logbl(). 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/>. */
+
+#define __logbl __logbl_power7
+
+#include <sysdeps/powerpc/power7/fpu/s_logbl.c>
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_logbl-ppc32.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_logbl-ppc32.c
new file mode 100644
index 0000000..3308957
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_logbl-ppc32.c
@@ -0,0 +1,21 @@
+/* logbl(). PowerPC32/POWER7 version.
+ Copyright (C) 2012-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/>. */
+
+#define __logbl __logbl_ppc32
+
+#include <sysdeps/ieee754/ldbl-128ibm/s_logbl.c>
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_logbl.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_logbl.c
new file mode 100644
index 0000000..acc6700
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_logbl.c
@@ -0,0 +1,32 @@
+/* Multiple versions of logbl.
+ 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 (__logbl) __logbl_ppc32 attribute_hidden;
+extern __typeof (__logbl) __logbl_power7 attribute_hidden;
+
+libc_ifunc (__logbl,
+ (hwcap & PPC_FEATURE_ARCH_2_06)
+ ? __logbl_power7
+ : __logbl_ppc32);
+
+long_double_symbol (libm, __logbl, logbl);
diff --git a/sysdeps/powerpc/powerpc64/power7/fpu/s_logb.c b/sysdeps/powerpc/powerpc64/power7/fpu/s_logb.c
index ff3a9e0..2599c77 100644
--- a/sysdeps/powerpc/powerpc64/power7/fpu/s_logb.c
+++ b/sysdeps/powerpc/powerpc64/power7/fpu/s_logb.c
@@ -1 +1 @@
-#include <sysdeps/powerpc/powerpc32/power7/fpu/s_logb.c>
+#include <sysdeps/powerpc/power7/fpu/s_logb.c>
diff --git a/sysdeps/powerpc/powerpc64/power7/fpu/s_logbf.c b/sysdeps/powerpc/powerpc64/power7/fpu/s_logbf.c
index e79a28f..7a5a803 100644
--- a/sysdeps/powerpc/powerpc64/power7/fpu/s_logbf.c
+++ b/sysdeps/powerpc/powerpc64/power7/fpu/s_logbf.c
@@ -1 +1 @@
-#include <sysdeps/powerpc/powerpc32/power7/fpu/s_logbf.c>
+#include <sysdeps/powerpc/power7/fpu/s_logbf.c>
diff --git a/sysdeps/powerpc/powerpc64/power7/fpu/s_logbl.c b/sysdeps/powerpc/powerpc64/power7/fpu/s_logbl.c
index 463e411..524ae2c 100644
--- a/sysdeps/powerpc/powerpc64/power7/fpu/s_logbl.c
+++ b/sysdeps/powerpc/powerpc64/power7/fpu/s_logbl.c
@@ -1 +1 @@
-#include <sysdeps/powerpc/powerpc32/power7/fpu/s_logbl.c>
+#include <sysdeps/powerpc/power7/fpu/s_logbl.c>
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=8de6d90bf90b20c2b2e7134cbbee4c0df7042b17
commit 8de6d90bf90b20c2b2e7134cbbee4c0df7042b17
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Wed Jun 5 09:20:50 2013 -0500
PowerPC: modf/modff multilib for PowerPC32
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
index cba3170..7a6e3fc 100644
--- a/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
@@ -3,7 +3,8 @@ sysdep_routines += s_isnan-power7 s_isnan-power6 s_isnan-power5 s_isnan-ppc32 \
s_isnanf-power6 s_isnanf-power5 s_isnanf-ppc32 \
s_isinf-power7 s_isinf-ppc32 s_isinff-ppc32 \
s_finite-power7 s_finite-ppc32 s_finitef-ppc32 \
- s_copysign-power6 s_copysign-ppc32
+ s_copysign-power6 s_copysign-ppc32 s_modf-power5+ \
+ s_modf-ppc32 s_modff-power5+ s_modff-ppc32
libm-sysdep_routines += s_llrintf-power6 s_llrintf-power4 s_llrintf-ppc32 \
s_llrint-power6 s_llrint-power4 s_llrint-ppc32 \
@@ -22,7 +23,10 @@ libm-sysdep_routines += s_llrintf-power6 s_llrintf-power4 s_llrintf-ppc32 \
s_trunc-ppc32 s_truncf-power5+ s_truncf-ppc32 \
s_copysign-power6 s_copysign-ppc32 s_lround-power6x \
s_lround-power5+ s_lround-ppc32 s_lrint-power6x \
- s_lrint-ppc32
+ s_lrint-ppc32 s_modf-power5+ s_modf-ppc32 \
+ s_modff-power5+ s_modff-ppc32
CFLAGS-s_llround.c = -fno-builtin-llroundf
+CFLAGS-s_modf-power5+.c = -mcpu=power5+
+CFLAGS-s_modff-power5+.c = -mcpu=power5+
endif
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_modf-power5+.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_modf-power5+.c
new file mode 100644
index 0000000..ec0b42c
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_modf-power5+.c
@@ -0,0 +1,31 @@
+/* PowerPC/POWER5+ implementation for modf.
+ 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>
+
+#undef weak_alias
+#define weak_alias(a,b)
+#undef strong_alias
+#define strong_alias(a,b)
+#undef compat_symbol
+#define compat_symbol(a,b,c,d)
+
+#define __modf __modf_power5plus
+
+#include <sysdeps/powerpc/power5+/fpu/s_modf.c>
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_modf-ppc32.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_modf-ppc32.c
new file mode 100644
index 0000000..666bf66
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_modf-ppc32.c
@@ -0,0 +1,29 @@
+/* PowerPC32 default implementation for modf.
+ 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>
+
+#undef weak_alias
+#define weak_alias(a,b)
+#undef strong_alias
+#define strong_alias(a,b)
+
+#define __modf __modf_ppc32
+
+#include <sysdeps/ieee754/dbl-64/s_modf.c>
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_modf.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_modf.c
new file mode 100644
index 0000000..3f98083
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_modf.c
@@ -0,0 +1,44 @@
+/* Multiple versions of modf.
+ 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 (__modf) __modf_ppc32 attribute_hidden;
+extern __typeof (__modf) __modf_power5plus attribute_hidden;
+
+libc_ifunc (__modf,
+ (hwcap & PPC_FEATURE_POWER5_PLUS)
+ ? __modf_power5plus
+ : __modf_ppc32);
+
+weak_alias (__modf, modf)
+
+#ifdef NO_LONG_DOUBLE
+strong_alias (__modf, __modfl)
+weak_alias (__modf, modfl)
+#endif
+#ifdef IS_IN_libm
+# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __modf, modfl, GLIBC_2_0);
+# endif
+#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+compat_symbol (libc, __modf, modfl, GLIBC_2_0);
+#endif
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_modff-power5+.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_modff-power5+.c
new file mode 100644
index 0000000..e729a38
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_modff-power5+.c
@@ -0,0 +1,27 @@
+/* PowerPC/POWER5+ implementation for modff.
+ 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>
+
+#undef weak_alias
+#define weak_alias(a,b)
+
+#define __modff __modff_power5plus
+
+#include <sysdeps/powerpc/power5+/fpu/s_modff.c>
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_modff-ppc32.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_modff-ppc32.c
new file mode 100644
index 0000000..08476b4
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_modff-ppc32.c
@@ -0,0 +1,26 @@
+/* PowerPC32 default implementation for modff.
+ 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>
+
+#undef weak_alias
+#define weak_alias(a,b)
+
+#define __modff __modff_ppc32
+
+#include <sysdeps/ieee754/flt-32/s_modff.c>
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_modff.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_modff.c
new file mode 100644
index 0000000..0e591ba
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_modff.c
@@ -0,0 +1,30 @@
+/* Multiple versions of modff.
+ 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 "init-arch.h"
+
+extern __typeof (__modff) __modff_ppc32 attribute_hidden;
+extern __typeof (__modff) __modff_power5plus attribute_hidden;
+
+libc_ifunc (__modff,
+ (hwcap & PPC_FEATURE_POWER5_PLUS)
+ ? __modff_power5plus
+ : __modff_ppc32);
+
+weak_alias (__modff, modff)
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=2dabe217ef7c675392235476385f912c8b4e7df5
commit 2dabe217ef7c675392235476385f912c8b4e7df5
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Wed Jun 5 09:19:56 2013 -0500
PowerPC: lrint/lrintf multilib for PowerPC32
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
index a9b2fc3..cba3170 100644
--- a/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
@@ -21,7 +21,8 @@ libm-sysdep_routines += s_llrintf-power6 s_llrintf-power4 s_llrintf-ppc32 \
s_roundf-power5+ s_roundf-ppc32 s_trunc-power5+ \
s_trunc-ppc32 s_truncf-power5+ s_truncf-ppc32 \
s_copysign-power6 s_copysign-ppc32 s_lround-power6x \
- s_lround-power5+ s_lround-ppc32
+ s_lround-power5+ s_lround-ppc32 s_lrint-power6x \
+ s_lrint-ppc32
CFLAGS-s_llround.c = -fno-builtin-llroundf
endif
diff --git a/sysdeps/powerpc/powerpc32/power6x/fpu/s_lrint.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_lrint-power6x.S
similarity index 76%
copy from sysdeps/powerpc/powerpc32/power6x/fpu/s_lrint.S
copy to sysdeps/powerpc/powerpc32/fpu/multiarch/s_lrint-power6x.S
index d0cc159..f752895 100644
--- a/sysdeps/powerpc/powerpc32/power6x/fpu/s_lrint.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_lrint-power6x.S
@@ -21,21 +21,8 @@
.machine "power6"
/* long int[r3] __lrint (double x[fp1]) */
-ENTRY (__lrint)
+ENTRY (__lrint_power6x)
fctiw fp13,fp1
mftgpr r3,fp13
blr
- END (__lrint)
-
-weak_alias (__lrint, lrint)
-
-strong_alias (__lrint, __lrintf)
-weak_alias (__lrint, lrintf)
-
-#ifdef NO_LONG_DOUBLE
-strong_alias (__lrint, __lrintl)
-weak_alias (__lrint, lrintl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __lrint, lrintl, GLIBC_2_1)
-#endif
+END (__lrint_power6x)
diff --git a/sysdeps/powerpc/powerpc32/power6x/fpu/s_lrint.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_lrint-ppc32.S
similarity index 59%
copy from sysdeps/powerpc/powerpc32/power6x/fpu/s_lrint.S
copy to sysdeps/powerpc/powerpc32/fpu/multiarch/s_lrint-ppc32.S
index d0cc159..bdece6f 100644
--- a/sysdeps/powerpc/powerpc32/power6x/fpu/s_lrint.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_lrint-ppc32.S
@@ -1,5 +1,5 @@
-/* Round double to long int. POWER6x PowerPC32 version.
- Copyright (C) 2006-2013 Free Software Foundation, Inc.
+/* Round double to long int. 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
@@ -19,23 +19,13 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
- .machine "power6"
-/* long int[r3] __lrint (double x[fp1]) */
-ENTRY (__lrint)
- fctiw fp13,fp1
- mftgpr r3,fp13
- blr
- END (__lrint)
+#undef weak_alias
+#define weak_alias(a,b)
+#undef strong_alias
+#define strong_alias(a,b)
+#undef compat_symbol
+#define compat_symbol(a,b,c,d)
-weak_alias (__lrint, lrint)
+#define __lrint __lrint_ppc32
-strong_alias (__lrint, __lrintf)
-weak_alias (__lrint, lrintf)
-
-#ifdef NO_LONG_DOUBLE
-strong_alias (__lrint, __lrintl)
-weak_alias (__lrint, lrintl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __lrint, lrintl, GLIBC_2_1)
-#endif
+#include <sysdeps/powerpc/powerpc32/fpu/s_lrint.S>
diff --git a/sysdeps/powerpc/powerpc32/power6x/fpu/s_lrint.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_lrint.c
similarity index 68%
copy from sysdeps/powerpc/powerpc32/power6x/fpu/s_lrint.S
copy to sysdeps/powerpc/powerpc32/fpu/multiarch/s_lrint.c
index d0cc159..03cf83e 100644
--- a/sysdeps/powerpc/powerpc32/power6x/fpu/s_lrint.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_lrint.c
@@ -1,5 +1,5 @@
-/* Round double to long int. POWER6x PowerPC32 version.
- Copyright (C) 2006-2013 Free Software Foundation, Inc.
+/* Multiple versions of lrint.
+ 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
@@ -16,26 +16,25 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
+#include <math.h>
#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
+#include "init-arch.h"
- .machine "power6"
-/* long int[r3] __lrint (double x[fp1]) */
-ENTRY (__lrint)
- fctiw fp13,fp1
- mftgpr r3,fp13
- blr
- END (__lrint)
+extern __typeof (__lrint) __lrint_ppc32 attribute_hidden;
+extern __typeof (__lrint) __lrint_power6x attribute_hidden;
-weak_alias (__lrint, lrint)
+libc_ifunc (__lrint,
+ (hwcap & PPC_FEATURE_POWER6_EXT) ?
+ __lrint_power6x
+ : __lrint_ppc32);
-strong_alias (__lrint, __lrintf)
-weak_alias (__lrint, lrintf)
+weak_alias (__lrint, lrint)
#ifdef NO_LONG_DOUBLE
-strong_alias (__lrint, __lrintl)
weak_alias (__lrint, lrintl)
+strong_alias (__lrint, __lrintl)
#endif
#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __lrint, lrintl, GLIBC_2_1)
+compat_symbol (libm, __lrint, lrintl, GLIBC_2_1);
#endif
diff --git a/sysdeps/powerpc/powerpc32/power6x/fpu/s_lrint.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_lrintf.c
similarity index 56%
rename from sysdeps/powerpc/powerpc32/power6x/fpu/s_lrint.S
rename to sysdeps/powerpc/powerpc32/fpu/multiarch/s_lrintf.c
index d0cc159..204b8fb 100644
--- a/sysdeps/powerpc/powerpc32/power6x/fpu/s_lrint.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_lrintf.c
@@ -1,5 +1,5 @@
-/* Round double to long int. POWER6x PowerPC32 version.
- Copyright (C) 2006-2013 Free Software Foundation, Inc.
+/* Multiple versions of lrintf.
+ 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
@@ -16,26 +16,16 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
+#include <math.h>
+#include "init-arch.h"
- .machine "power6"
-/* long int[r3] __lrint (double x[fp1]) */
-ENTRY (__lrint)
- fctiw fp13,fp1
- mftgpr r3,fp13
- blr
- END (__lrint)
+/* It's safe to use double-precision implementation for single-precision. */
+extern __typeof (__lrintf) __lrint_ppc32 attribute_hidden;
+extern __typeof (__lrintf) __lrint_power6x attribute_hidden;
-weak_alias (__lrint, lrint)
+libc_ifunc (__lrintf,
+ (hwcap & PPC_FEATURE_POWER6_EXT) ?
+ __lrint_power6x
+ : __lrint_ppc32);
-strong_alias (__lrint, __lrintf)
-weak_alias (__lrint, lrintf)
-
-#ifdef NO_LONG_DOUBLE
-strong_alias (__lrint, __lrintl)
-weak_alias (__lrint, lrintl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __lrint, lrintl, GLIBC_2_1)
-#endif
+weak_alias (__lrintf, lrintf)
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=c6d71c037685eddc73db40ea8d20c00865944d09
commit c6d71c037685eddc73db40ea8d20c00865944d09
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Wed Jun 5 09:18:58 2013 -0500
PowerPC: lround/lrounf multilib for PowerPC32
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
index afe1210..a9b2fc3 100644
--- a/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
@@ -20,7 +20,8 @@ libm-sysdep_routines += s_llrintf-power6 s_llrintf-power4 s_llrintf-ppc32 \
s_floorf-ppc32 s_round-power5+ s_round-ppc32 \
s_roundf-power5+ s_roundf-ppc32 s_trunc-power5+ \
s_trunc-ppc32 s_truncf-power5+ s_truncf-ppc32 \
- s_copysign-power6 s_copysign-ppc32
+ s_copysign-power6 s_copysign-ppc32 s_lround-power6x \
+ s_lround-power5+ s_lround-ppc32
CFLAGS-s_llround.c = -fno-builtin-llroundf
endif
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_lround.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_lround-power5+.S
similarity index 84%
rename from sysdeps/powerpc/powerpc32/power5+/fpu/s_lround.S
rename to sysdeps/powerpc/powerpc32/fpu/multiarch/s_lround-power5+.S
index d4da625..5e664be 100644
--- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_lround.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_lround-power5+.S
@@ -15,6 +15,7 @@
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>
@@ -29,7 +30,7 @@
round to zero instruction. */
.machine "power5"
-ENTRY (__lround)
+ENTRY (__lround_power5plus)
stwu r1,-16(r1)
cfi_adjust_cfa_offset (16)
frin fp2,fp1
@@ -41,17 +42,4 @@ ENTRY (__lround)
lwz r3,12(r1)
addi r1,r1,16
blr
- END (__lround)
-
-weak_alias (__lround, lround)
-
-strong_alias (__lround, __lroundf)
-weak_alias (__lround, lroundf)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__lround, lroundl)
-strong_alias (__lround, __lroundl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __lround, lroundl, GLIBC_2_1)
-#endif
+END (__lround_power5plus)
diff --git a/sysdeps/powerpc/powerpc32/power6x/fpu/s_lround.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_lround-power6x.S
similarity index 83%
rename from sysdeps/powerpc/powerpc32/power6x/fpu/s_lround.S
rename to sysdeps/powerpc/powerpc32/fpu/multiarch/s_lround-power6x.S
index 0a04051..49c5a71 100644
--- a/sysdeps/powerpc/powerpc32/power6x/fpu/s_lround.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_lround-power6x.S
@@ -30,22 +30,9 @@
round to zero instruction. */
.machine "power6"
-ENTRY (__lround)
+ENTRY (__lround_power6x)
frin fp2,fp1 /* Pre-round +-0.5. */
fctiwz fp3,fp2 /* Convert To Integer Word lround toward 0. */
mftgpr r3,fp3 /* Transfer fpr3 to r3. */
blr
- END (__lround)
-
-weak_alias (__lround, lround)
-
-strong_alias (__lround, __lroundf)
-weak_alias (__lround, lroundf)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__lround, lroundl)
-strong_alias (__lround, __lroundl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __lround, lroundl, GLIBC_2_1)
-#endif
+END (__lround_power6x)
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_lround-ppc32.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_lround-ppc32.S
new file mode 100644
index 0000000..8124cd7
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_lround-ppc32.S
@@ -0,0 +1,31 @@
+/* lround function. 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 strong_alias
+#define strong_alias(a,b)
+#undef compat_symbol
+#define compat_symbol(a,b,c,d)
+
+#define __lround __lround_ppc32
+
+#include <sysdeps/powerpc/powerpc32/fpu/s_lround.S>
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_lround.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_lround.c
new file mode 100644
index 0000000..f21a7e8
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_lround.c
@@ -0,0 +1,43 @@
+/* Multiple versions of lround.
+ 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 (__lround) __lround_ppc32 attribute_hidden;
+extern __typeof (__lround) __lround_power5plus attribute_hidden;
+extern __typeof (__lround) __lround_power6x attribute_hidden;
+
+libc_ifunc (__lround,
+ (hwcap & PPC_FEATURE_POWER6_EXT) ?
+ __lround_power6x
+ : (hwcap & PPC_FEATURE_POWER5_PLUS) ?
+ __lround_power5plus
+ : __lround_ppc32);
+
+weak_alias (__lround, lround)
+
+#ifdef NO_LONG_DOUBLE
+weak_alias (__lround, lroundl)
+strong_alias (__lround, __lroundl)
+#endif
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __lround, lroundl, GLIBC_2_1);
+#endif
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_lroundf.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_lroundf.c
new file mode 100644
index 0000000..3080637
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_lroundf.c
@@ -0,0 +1,34 @@
+/* Multiple versions of lroundf.
+ 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 "init-arch.h"
+
+/* It's safe to use double-precision implementation for single-precision. */
+extern __typeof (__lroundf) __lround_ppc32 attribute_hidden;
+extern __typeof (__lroundf) __lround_power5plus attribute_hidden;
+extern __typeof (__lroundf) __lround_power6x attribute_hidden;
+
+libc_ifunc (__lroundf,
+ (hwcap & PPC_FEATURE_POWER6_EXT) ?
+ __lround_power6x
+ : (hwcap & PPC_FEATURE_POWER5_PLUS) ?
+ __lround_power5plus
+ : __lround_ppc32);
+
+weak_alias (__lroundf, lroundf)
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=ca13e07a5d07ed2a65c15c70b17993aecba1e887
commit ca13e07a5d07ed2a65c15c70b17993aecba1e887
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Wed Jun 5 09:18:11 2013 -0500
PowerPC: copysign/copysignf multilib for PowerPC32
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
index d7850a1..afe1210 100644
--- a/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
@@ -2,7 +2,8 @@ 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 \
s_isinf-power7 s_isinf-ppc32 s_isinff-ppc32 \
- s_finite-power7 s_finite-ppc32 s_finitef-ppc32
+ s_finite-power7 s_finite-ppc32 s_finitef-ppc32 \
+ s_copysign-power6 s_copysign-ppc32
libm-sysdep_routines += s_llrintf-power6 s_llrintf-power4 s_llrintf-ppc32 \
s_llrint-power6 s_llrint-power4 s_llrint-ppc32 \
@@ -18,7 +19,8 @@ libm-sysdep_routines += s_llrintf-power6 s_llrintf-power4 s_llrintf-ppc32 \
s_floor-power5+ s_floor-ppc32 s_floorf-power5+ \
s_floorf-ppc32 s_round-power5+ s_round-ppc32 \
s_roundf-power5+ s_roundf-ppc32 s_trunc-power5+ \
- s_trunc-ppc32 s_truncf-power5+ s_truncf-ppc32
+ s_trunc-ppc32 s_truncf-power5+ s_truncf-ppc32 \
+ s_copysign-power6 s_copysign-ppc32
CFLAGS-s_llround.c = -fno-builtin-llroundf
endif
diff --git a/sysdeps/powerpc/powerpc32/power6/fpu/s_copysign.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_copysign-power6.S
similarity index 65%
rename from sysdeps/powerpc/powerpc32/power6/fpu/s_copysign.S
rename to sysdeps/powerpc/powerpc32/fpu/multiarch/s_copysign-power6.S
index 1b8d73a..7aa28e1 100644
--- a/sysdeps/powerpc/powerpc32/power6/fpu/s_copysign.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_copysign-power6.S
@@ -27,32 +27,8 @@
.section ".text"
.type __copysign, @function
.machine power6
-EALIGN (__copysign, 4, 0)
+EALIGN (__copysign_power6, 4, 0)
CALL_MCOUNT
fcpsgn fp1,fp2,fp1
blr
-END (__copysign)
-
-hidden_def (__copysign)
-weak_alias (__copysign, copysign)
-
-/* It turns out that the 'double' version will also always work for
- single-precision. */
-strong_alias (__copysign, __copysignf)
-hidden_def (__copysignf)
-weak_alias (__copysignf, copysignf)
-
-#ifdef NO_LONG_DOUBLE
-strong_alias (__copysign, __copysignl)
-weak_alias (__copysign, copysignl)
-#endif
-
-#ifdef IS_IN_libm
-# if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)
-compat_symbol (libm, copysign, copysignl, GLIBC_2_0)
-# endif
-#else
-# if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
-compat_symbol (libc, copysign, copysignl, GLIBC_2_0);
-# endif
-#endif
+END (__copysign_power6)
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_copysign-ppc32.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_copysign-ppc32.S
new file mode 100644
index 0000000..be31939
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_copysign-ppc32.S
@@ -0,0 +1,35 @@
+/* copysign(). PowerPC32 default 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>
+
+#undef weak_alias
+#define weak_alias(a,b)
+#undef strong_alias
+#define strong_alias(a,b)
+#undef compat_symbol
+#define compat_symbol(a, b, c, d)
+
+#define __copysign __copysign_ppc32
+#undef hidden_def
+#define hidden_def(name)
+ strong_alias (__copysign_ppc32, __GI___copysign)
+
+#include <sysdeps/powerpc/powerpc32/fpu/s_copysign.S>
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_copysign.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_copysign.c
new file mode 100644
index 0000000..a4b5239
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_copysign.c
@@ -0,0 +1,51 @@
+/* Multiple versions of copysign.
+ 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/>. */
+
+/* Redefine copysign so that the compiler won't complain about the type
+ mismatch with the IFUNC selector in strong_alias below. */
+#undef __copysign
+#define __copysign __redirect_copysign
+#include <math.h>
+#include <math_ldbl_opt.h>
+#undef __copysign
+#include <shlib-compat.h>
+#include "init-arch.h"
+
+extern __typeof (__redirect_copysign) __copysign_ppc32 attribute_hidden;
+extern __typeof (__redirect_copysign) __copysign_power6 attribute_hidden;
+
+extern __typeof (__redirect_copysign) __libm_copysign;
+libc_ifunc (__libm_copysign,
+ (hwcap & PPC_FEATURE_ARCH_2_05)
+ ? __copysign_power6
+ : __copysign_ppc32);
+
+strong_alias (__libm_copysign, __copysign)
+weak_alias (__copysign, copysign)
+
+#ifdef NO_LONG_DOUBLE
+weak_alias (__copysign,copysignl)
+strong_alias(__copysign,__copysignl)
+#endif
+#ifdef IS_IN_libm
+# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __copysign, copysignl, GLIBC_2_0);
+# endif
+#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+compat_symbol (libc, __copysign, copysignl, GLIBC_2_0);
+#endif
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_copysignf.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_copysignf.c
new file mode 100644
index 0000000..7c5ef4f
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_copysignf.c
@@ -0,0 +1,32 @@
+/* Multiple versions of copysignf.
+ 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"
+
+/* It's safe to use double-precision implementation for single-precision. */
+extern __typeof (__copysignf) __copysign_ppc32 attribute_hidden;
+extern __typeof (__copysignf) __copysign_power6 attribute_hidden;
+
+libc_ifunc (__copysignf,
+ (hwcap & PPC_FEATURE_ARCH_2_05)
+ ? __copysign_power6
+ : __copysign_ppc32);
+
+weak_alias (__copysignf, copysignf)
diff --git a/sysdeps/powerpc/powerpc32/power6/fpu/s_copysignf.S b/sysdeps/powerpc/powerpc32/power6/fpu/s_copysignf.S
deleted file mode 100644
index d4aa702..0000000
--- a/sysdeps/powerpc/powerpc32/power6/fpu/s_copysignf.S
+++ /dev/null
@@ -1 +0,0 @@
-/* This function uses the same code as s_copysign.S. */
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=346cd293a66cb41557bbe865b36b72da4ff95cc9
commit 346cd293a66cb41557bbe865b36b72da4ff95cc9
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Wed Jun 5 09:17:15 2013 -0500
PowerPC: trunc/truncf multilib for PowerPC32
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
index 54a3e39..d7850a1 100644
--- a/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
@@ -17,7 +17,8 @@ libm-sysdep_routines += s_llrintf-power6 s_llrintf-power4 s_llrintf-ppc32 \
s_ceil-ppc32 s_ceilf-power5+ s_ceilf-ppc32 \
s_floor-power5+ s_floor-ppc32 s_floorf-power5+ \
s_floorf-ppc32 s_round-power5+ s_round-ppc32 \
- s_roundf-power5+ s_roundf-ppc32
+ s_roundf-power5+ s_roundf-ppc32 s_trunc-power5+ \
+ s_trunc-ppc32 s_truncf-power5+ s_truncf-ppc32
CFLAGS-s_llround.c = -fno-builtin-llroundf
endif
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_trunc.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_trunc-power5+.S
similarity index 78%
copy from sysdeps/powerpc/powerpc32/power5+/fpu/s_trunc.S
copy to sysdeps/powerpc/powerpc32/fpu/multiarch/s_trunc-power5+.S
index 2d4ec5a..d9fc987 100644
--- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_trunc.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_trunc-power5+.S
@@ -20,17 +20,7 @@
#include <math_ldbl_opt.h>
.machine "power5"
-EALIGN (__trunc, 4, 0)
+EALIGN (__trunc_power5plus, 4, 0)
friz fp1, fp1
blr
- END (__trunc)
-
-weak_alias (__trunc, trunc)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__trunc, truncl)
-strong_alias (__trunc, __truncl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __trunc, truncl, GLIBC_2_1)
-#endif
+END (__trunc_power5plus)
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_truncf.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_trunc-ppc32.S
similarity index 68%
copy from sysdeps/powerpc/powerpc32/power5+/fpu/s_truncf.S
copy to sysdeps/powerpc/powerpc32/fpu/multiarch/s_trunc-ppc32.S
index 0ca5b5c..541b4ed 100644
--- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_truncf.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_trunc-ppc32.S
@@ -1,5 +1,5 @@
-/* truncf function. PowerPC32/power5+ version.
- Copyright (C) 2006-2013 Free Software Foundation, Inc.
+/* trunc function. 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
@@ -17,13 +17,15 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <math_ldbl_opt.h>
- .machine "power5"
-EALIGN (__truncf, 4, 0)
- friz fp1, fp1 /* The rounding instructions are double. */
- frsp fp1, fp1 /* But we need to set ooverflow for float. */
- blr
- END (__truncf)
+#undef weak_alias
+#define weak_alias(a,b)
+#undef strong_alias
+#define strong_alias(a,b)
+#undef compat_symbol
+#define compat_symbol(a,b,c,d)
-weak_alias (__truncf, truncf)
+#define __trunc __trunc_ppc32
+#include <sysdeps/powerpc/powerpc32/fpu/s_trunc.S>
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_trunc.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_trunc.c
similarity index 67%
rename from sysdeps/powerpc/powerpc32/power5+/fpu/s_trunc.S
rename to sysdeps/powerpc/powerpc32/fpu/multiarch/s_trunc.c
index 2d4ec5a..1fdef37 100644
--- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_trunc.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_trunc.c
@@ -1,5 +1,5 @@
-/* trunc function. PowerPC32/power5+ version.
- Copyright (C) 2006-2013 Free Software Foundation, Inc.
+/* Multiple versions of trunc.
+ 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
@@ -16,21 +16,25 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
+#include <math.h>
#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
+#include "init-arch.h"
- .machine "power5"
-EALIGN (__trunc, 4, 0)
- friz fp1, fp1
- blr
- END (__trunc)
+extern __typeof (__trunc) __trunc_ppc32 attribute_hidden;
+extern __typeof (__trunc) __trunc_power5plus attribute_hidden;
+
+libc_ifunc (__trunc,
+ (hwcap & PPC_FEATURE_POWER5_PLUS)
+ ? __trunc_power5plus
+ : __trunc_ppc32);
weak_alias (__trunc, trunc)
#ifdef NO_LONG_DOUBLE
-weak_alias (__trunc, truncl)
strong_alias (__trunc, __truncl)
+weak_alias (__trunc, truncl)
#endif
#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __trunc, truncl, GLIBC_2_1)
+compat_symbol (libm, __trunc, truncl, GLIBC_2_1);
#endif
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_truncf.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_truncf-power5+.S
similarity index 87%
copy from sysdeps/powerpc/powerpc32/power5+/fpu/s_truncf.S
copy to sysdeps/powerpc/powerpc32/fpu/multiarch/s_truncf-power5+.S
index 0ca5b5c..35cd65a 100644
--- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_truncf.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_truncf-power5+.S
@@ -19,11 +19,8 @@
#include <sysdep.h>
.machine "power5"
-EALIGN (__truncf, 4, 0)
+EALIGN (__truncf_power5plus, 4, 0)
friz fp1, fp1 /* The rounding instructions are double. */
- frsp fp1, fp1 /* But we need to set ooverflow for float. */
+ frsp fp1, fp1 /* But we need to set overflow for float. */
blr
- END (__truncf)
-
-weak_alias (__truncf, truncf)
-
+END (__truncf_power5plus)
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_truncf.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_truncf-ppc32.S
similarity index 70%
copy from sysdeps/powerpc/powerpc32/power5+/fpu/s_truncf.S
copy to sysdeps/powerpc/powerpc32/fpu/multiarch/s_truncf-ppc32.S
index 0ca5b5c..a83f413 100644
--- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_truncf.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_truncf-ppc32.S
@@ -1,5 +1,5 @@
-/* truncf function. PowerPC32/power5+ version.
- Copyright (C) 2006-2013 Free Software Foundation, Inc.
+/* truncf function. 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
@@ -17,13 +17,11 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <math_ldbl_opt.h>
- .machine "power5"
-EALIGN (__truncf, 4, 0)
- friz fp1, fp1 /* The rounding instructions are double. */
- frsp fp1, fp1 /* But we need to set ooverflow for float. */
- blr
- END (__truncf)
+#undef weak_alias
+#define weak_alias(a,b)
-weak_alias (__truncf, truncf)
+#define __truncf __truncf_ppc32
+#include <sysdeps/powerpc/powerpc32/fpu/s_truncf.S>
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_truncf.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_truncf.c
similarity index 64%
rename from sysdeps/powerpc/powerpc32/power5+/fpu/s_truncf.S
rename to sysdeps/powerpc/powerpc32/fpu/multiarch/s_truncf.c
index 0ca5b5c..779a614 100644
--- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_truncf.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_truncf.c
@@ -1,5 +1,5 @@
-/* truncf function. PowerPC32/power5+ version.
- Copyright (C) 2006-2013 Free Software Foundation, Inc.
+/* Multiple versions of truncf.
+ 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
@@ -16,14 +16,17 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
+#include <math.h>
+#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
+#include "init-arch.h"
- .machine "power5"
-EALIGN (__truncf, 4, 0)
- friz fp1, fp1 /* The rounding instructions are double. */
- frsp fp1, fp1 /* But we need to set ooverflow for float. */
- blr
- END (__truncf)
+extern __typeof (__truncf) __truncf_ppc32 attribute_hidden;
+extern __typeof (__truncf) __truncf_power5plus attribute_hidden;
-weak_alias (__truncf, truncf)
+libc_ifunc (__truncf,
+ (hwcap & PPC_FEATURE_POWER5_PLUS)
+ ? __truncf_power5plus
+ : __truncf_ppc32);
+weak_alias (__truncf, truncf)
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=c1ae9884b4532a61f09fec9e672d14bdb1de1978
commit c1ae9884b4532a61f09fec9e672d14bdb1de1978
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Wed Jun 5 09:16:13 2013 -0500
PowerPC: round/roundf multilib for PowerPC32
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
index 63f3807..54a3e39 100644
--- a/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
@@ -16,7 +16,8 @@ libm-sysdep_routines += s_llrintf-power6 s_llrintf-power4 s_llrintf-ppc32 \
s_finite-ppc32 s_finitef-ppc32 s_ceil-power5+ \
s_ceil-ppc32 s_ceilf-power5+ s_ceilf-ppc32 \
s_floor-power5+ s_floor-ppc32 s_floorf-power5+ \
- s_floorf-ppc32
+ s_floorf-ppc32 s_round-power5+ s_round-ppc32 \
+ s_roundf-power5+ s_roundf-ppc32
CFLAGS-s_llround.c = -fno-builtin-llroundf
endif
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_round.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_round-power5+.S
similarity index 78%
copy from sysdeps/powerpc/powerpc32/power5+/fpu/s_round.S
copy to sysdeps/powerpc/powerpc32/fpu/multiarch/s_round-power5+.S
index 3cc72d3..276ba45 100644
--- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_round.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_round-power5+.S
@@ -20,17 +20,7 @@
#include <math_ldbl_opt.h>
.machine "power5"
-EALIGN (__round, 4, 0)
+EALIGN (__round_power5plus, 4, 0)
frin fp1, fp1
blr
- END (__round)
-
-weak_alias (__round, round)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__round, roundl)
-strong_alias (__round, __roundl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __round, roundl, GLIBC_2_1)
-#endif
+END (__round_power5plus)
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_roundf.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_round-ppc32.S
similarity index 68%
copy from sysdeps/powerpc/powerpc32/power5+/fpu/s_roundf.S
copy to sysdeps/powerpc/powerpc32/fpu/multiarch/s_round-ppc32.S
index 8bd2d0a..889318a 100644
--- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_roundf.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_round-ppc32.S
@@ -1,5 +1,5 @@
-/* roundf function. PowerPC32/power5+ version.
- Copyright (C) 2006-2013 Free Software Foundation, Inc.
+/* round function. 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
@@ -17,13 +17,15 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <math_ldbl_opt.h>
- .machine "power5"
-EALIGN (__roundf, 4, 0)
- frin fp1, fp1 /* The rounding instructions are double. */
- frsp fp1, fp1 /* But we need to set ooverflow for float. */
- blr
- END (__roundf)
+#undef weak_alias
+#define weak_alias(a,b)
+#undef strong_alias
+#define strong_alias(a,b)
+#undef compat_symbol
+#define compat_symbol(a,b,c,d)
-weak_alias (__roundf, roundf)
+#define __round __round_ppc32
+#include <sysdeps/powerpc/powerpc32/fpu/s_round.S>
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_round.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_round.c
similarity index 67%
rename from sysdeps/powerpc/powerpc32/power5+/fpu/s_round.S
rename to sysdeps/powerpc/powerpc32/fpu/multiarch/s_round.c
index 3cc72d3..c21dfaf 100644
--- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_round.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_round.c
@@ -1,5 +1,5 @@
-/* round function. PowerPC32/power5+ version.
- Copyright (C) 2006-2013 Free Software Foundation, Inc.
+/* Multiple versions of round.
+ 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
@@ -16,21 +16,25 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
+#include <math.h>
#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
+#include "init-arch.h"
- .machine "power5"
-EALIGN (__round, 4, 0)
- frin fp1, fp1
- blr
- END (__round)
+extern __typeof (__round) __round_ppc32 attribute_hidden;
+extern __typeof (__round) __round_power5plus attribute_hidden;
+
+libc_ifunc (__round,
+ (hwcap & PPC_FEATURE_POWER5_PLUS)
+ ? __round_power5plus
+ : __round_ppc32);
weak_alias (__round, round)
#ifdef NO_LONG_DOUBLE
-weak_alias (__round, roundl)
strong_alias (__round, __roundl)
+weak_alias (__round, roundl)
#endif
#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __round, roundl, GLIBC_2_1)
+compat_symbol (libm, __round, roundl, GLIBC_2_1);
#endif
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_roundf.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_roundf-power5+.S
similarity index 87%
copy from sysdeps/powerpc/powerpc32/power5+/fpu/s_roundf.S
copy to sysdeps/powerpc/powerpc32/fpu/multiarch/s_roundf-power5+.S
index 8bd2d0a..644d976 100644
--- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_roundf.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_roundf-power5+.S
@@ -19,11 +19,8 @@
#include <sysdep.h>
.machine "power5"
-EALIGN (__roundf, 4, 0)
+EALIGN (__roundf_power5plus, 4, 0)
frin fp1, fp1 /* The rounding instructions are double. */
- frsp fp1, fp1 /* But we need to set ooverflow for float. */
+ frsp fp1, fp1 /* But we need to set overflow for float. */
blr
- END (__roundf)
-
-weak_alias (__roundf, roundf)
-
+END (__roundf_power5plus)
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_roundf.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_roundf-ppc32.S
similarity index 70%
copy from sysdeps/powerpc/powerpc32/power5+/fpu/s_roundf.S
copy to sysdeps/powerpc/powerpc32/fpu/multiarch/s_roundf-ppc32.S
index 8bd2d0a..9787c5c 100644
--- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_roundf.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_roundf-ppc32.S
@@ -1,5 +1,5 @@
-/* roundf function. PowerPC32/power5+ version.
- Copyright (C) 2006-2013 Free Software Foundation, Inc.
+/* roundf function. 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
@@ -17,13 +17,11 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <math_ldbl_opt.h>
- .machine "power5"
-EALIGN (__roundf, 4, 0)
- frin fp1, fp1 /* The rounding instructions are double. */
- frsp fp1, fp1 /* But we need to set ooverflow for float. */
- blr
- END (__roundf)
+#undef weak_alias
+#define weak_alias(a,b)
-weak_alias (__roundf, roundf)
+#define __roundf __roundf_ppc32
+#include <sysdeps/powerpc/powerpc32/fpu/s_roundf.S>
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_roundf.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_roundf.c
similarity index 64%
rename from sysdeps/powerpc/powerpc32/power5+/fpu/s_roundf.S
rename to sysdeps/powerpc/powerpc32/fpu/multiarch/s_roundf.c
index 8bd2d0a..94e66e1 100644
--- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_roundf.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_roundf.c
@@ -1,5 +1,5 @@
-/* roundf function. PowerPC32/power5+ version.
- Copyright (C) 2006-2013 Free Software Foundation, Inc.
+/* Multiple versions of roundf.
+ 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
@@ -16,14 +16,17 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
+#include <math.h>
+#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
+#include "init-arch.h"
- .machine "power5"
-EALIGN (__roundf, 4, 0)
- frin fp1, fp1 /* The rounding instructions are double. */
- frsp fp1, fp1 /* But we need to set ooverflow for float. */
- blr
- END (__roundf)
+extern __typeof (__roundf) __roundf_ppc32 attribute_hidden;
+extern __typeof (__roundf) __roundf_power5plus attribute_hidden;
-weak_alias (__roundf, roundf)
+libc_ifunc (__roundf,
+ (hwcap & PPC_FEATURE_POWER5_PLUS)
+ ? __roundf_power5plus
+ : __roundf_ppc32);
+weak_alias (__roundf, roundf)
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=023ec00af5202a434b48d99d29a85c4626773b40
commit 023ec00af5202a434b48d99d29a85c4626773b40
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Wed Jun 5 09:15:35 2013 -0500
PowerPC: floor/floorf multilib for PowerPC32
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
index 9021e02..63f3807 100644
--- a/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
@@ -14,7 +14,9 @@ libm-sysdep_routines += s_llrintf-power6 s_llrintf-power4 s_llrintf-ppc32 \
s_isnanf-power5 s_isnanf-ppc32 s_isinf-power7 \
s_isinf-ppc32 s_isinff-ppc32 s_finite-power7 \
s_finite-ppc32 s_finitef-ppc32 s_ceil-power5+ \
- s_ceil-ppc32 s_ceilf-power5+ s_ceilf-ppc32
+ s_ceil-ppc32 s_ceilf-power5+ s_ceilf-ppc32 \
+ s_floor-power5+ s_floor-ppc32 s_floorf-power5+ \
+ s_floorf-ppc32
CFLAGS-s_llround.c = -fno-builtin-llroundf
endif
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_floor.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_floor-power5+.S
similarity index 78%
copy from sysdeps/powerpc/powerpc32/power5+/fpu/s_floor.S
copy to sysdeps/powerpc/powerpc32/fpu/multiarch/s_floor-power5+.S
index 215c67c..c9515df 100644
--- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_floor.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_floor-power5+.S
@@ -20,17 +20,7 @@
#include <math_ldbl_opt.h>
.machine "power5"
-EALIGN (__floor, 4, 0)
+EALIGN (__floor_power5plus, 4, 0)
frim fp1, fp1
blr
- END (__floor)
-
-weak_alias (__floor, floor)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__floor, floorl)
-strong_alias (__floor, __floorl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __floor, floorl, GLIBC_2_0)
-#endif
+END (__floor_power5plus)
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_floorf.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_floor-ppc32.S
similarity index 68%
copy from sysdeps/powerpc/powerpc32/power5+/fpu/s_floorf.S
copy to sysdeps/powerpc/powerpc32/fpu/multiarch/s_floor-ppc32.S
index eb228da..bfc6c0b 100644
--- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_floorf.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_floor-ppc32.S
@@ -1,5 +1,5 @@
-/* floorf function. PowerPC32/power5+ version.
- Copyright (C) 2006-2013 Free Software Foundation, Inc.
+/* floor function. 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
@@ -17,13 +17,15 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <math_ldbl_opt.h>
- .machine "power5"
-EALIGN (__floorf, 4, 0)
- frim fp1, fp1 /* The rounding instructions are double. */
- frsp fp1, fp1 /* But we need to set ooverflow for float. */
- blr
- END (__floorf)
+#undef weak_alias
+#define weak_alias(a,b)
+#undef strong_alias
+#define strong_alias(a,b)
+#undef compat_symbol
+#define compat_symbol(a,b,c,d)
-weak_alias (__floorf, floorf)
+#define __floor __floor_ppc32
+#include <sysdeps/powerpc/powerpc32/fpu/s_floor.S>
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_floor.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_floor.c
similarity index 67%
rename from sysdeps/powerpc/powerpc32/power5+/fpu/s_floor.S
rename to sysdeps/powerpc/powerpc32/fpu/multiarch/s_floor.c
index 215c67c..c56e067 100644
--- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_floor.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_floor.c
@@ -1,5 +1,5 @@
-/* floor function. PowerPC32/power5+ version.
- Copyright (C) 2006-2013 Free Software Foundation, Inc.
+/* Multiple versions of floor.
+ 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
@@ -16,21 +16,25 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
+#include <math.h>
#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
+#include "init-arch.h"
- .machine "power5"
-EALIGN (__floor, 4, 0)
- frim fp1, fp1
- blr
- END (__floor)
+extern __typeof (__floor) __floor_ppc32 attribute_hidden;
+extern __typeof (__floor) __floor_power5plus attribute_hidden;
+
+libc_ifunc (__floor,
+ (hwcap & PPC_FEATURE_POWER5_PLUS)
+ ? __floor_power5plus
+ : __floor_ppc32);
weak_alias (__floor, floor)
#ifdef NO_LONG_DOUBLE
-weak_alias (__floor, floorl)
strong_alias (__floor, __floorl)
+weak_alias (__floor, floorl)
#endif
#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __floor, floorl, GLIBC_2_0)
+compat_symbol (libm, __floor, floorl, GLIBC_2_0);
#endif
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_floorf.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_floorf-power5+.S
similarity index 93%
copy from sysdeps/powerpc/powerpc32/power5+/fpu/s_floorf.S
copy to sysdeps/powerpc/powerpc32/fpu/multiarch/s_floorf-power5+.S
index eb228da..bece550 100644
--- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_floorf.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_floorf-power5+.S
@@ -19,11 +19,8 @@
#include <sysdep.h>
.machine "power5"
-EALIGN (__floorf, 4, 0)
+EALIGN (__floorf_power5plus, 4, 0)
frim fp1, fp1 /* The rounding instructions are double. */
frsp fp1, fp1 /* But we need to set ooverflow for float. */
blr
- END (__floorf)
-
-weak_alias (__floorf, floorf)
-
+END (__floorf_power5plus)
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_floorf.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_floorf-ppc32.S
similarity index 70%
copy from sysdeps/powerpc/powerpc32/power5+/fpu/s_floorf.S
copy to sysdeps/powerpc/powerpc32/fpu/multiarch/s_floorf-ppc32.S
index eb228da..5ea62cc 100644
--- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_floorf.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_floorf-ppc32.S
@@ -1,5 +1,5 @@
-/* floorf function. PowerPC32/power5+ version.
- Copyright (C) 2006-2013 Free Software Foundation, Inc.
+/* floorf function. 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
@@ -17,13 +17,11 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <math_ldbl_opt.h>
- .machine "power5"
-EALIGN (__floorf, 4, 0)
- frim fp1, fp1 /* The rounding instructions are double. */
- frsp fp1, fp1 /* But we need to set ooverflow for float. */
- blr
- END (__floorf)
+#undef weak_alias
+#define weak_alias(a,b)
-weak_alias (__floorf, floorf)
+#define __floorf __floorf_ppc32
+#include <sysdeps/powerpc/powerpc32/fpu/s_floorf.S>
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_floorf.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_floorf.c
similarity index 64%
rename from sysdeps/powerpc/powerpc32/power5+/fpu/s_floorf.S
rename to sysdeps/powerpc/powerpc32/fpu/multiarch/s_floorf.c
index eb228da..df73148 100644
--- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_floorf.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_floorf.c
@@ -1,5 +1,5 @@
-/* floorf function. PowerPC32/power5+ version.
- Copyright (C) 2006-2013 Free Software Foundation, Inc.
+/* Multiple versions of floorf.
+ 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
@@ -16,14 +16,17 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
+#include <math.h>
+#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
+#include "init-arch.h"
- .machine "power5"
-EALIGN (__floorf, 4, 0)
- frim fp1, fp1 /* The rounding instructions are double. */
- frsp fp1, fp1 /* But we need to set ooverflow for float. */
- blr
- END (__floorf)
+extern __typeof (__floorf) __floorf_ppc32 attribute_hidden;
+extern __typeof (__floorf) __floorf_power5plus attribute_hidden;
-weak_alias (__floorf, floorf)
+libc_ifunc (__floorf,
+ (hwcap & PPC_FEATURE_POWER5_PLUS)
+ ? __floorf_power5plus
+ : __floorf_ppc32);
+weak_alias (__floorf, floorf)
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=60f663d657161bd93cafa4746e3339bd9a29c81b
commit 60f663d657161bd93cafa4746e3339bd9a29c81b
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Wed Jun 5 09:10:06 2013 -0500
PowerPC: ceil/ceilf multilib for PowerPC32
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
index 3bf3e52..9021e02 100644
--- a/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
@@ -13,7 +13,8 @@ libm-sysdep_routines += s_llrintf-power6 s_llrintf-power4 s_llrintf-ppc32 \
s_isnan-power5 s_isnan-ppc32 s_isnanf-power6 \
s_isnanf-power5 s_isnanf-ppc32 s_isinf-power7 \
s_isinf-ppc32 s_isinff-ppc32 s_finite-power7 \
- s_finite-ppc32 s_finitef-ppc32
+ s_finite-ppc32 s_finitef-ppc32 s_ceil-power5+ \
+ s_ceil-ppc32 s_ceilf-power5+ s_ceilf-ppc32
CFLAGS-s_llround.c = -fno-builtin-llroundf
endif
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_ceil.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_ceil-power5+.S
similarity index 79%
copy from sysdeps/powerpc/powerpc32/power5+/fpu/s_ceil.S
copy to sysdeps/powerpc/powerpc32/fpu/multiarch/s_ceil-power5+.S
index 0469831..6f76b2f 100644
--- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_ceil.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_ceil-power5+.S
@@ -20,17 +20,7 @@
#include <math_ldbl_opt.h>
.machine "power5"
-EALIGN (__ceil, 4, 0)
+EALIGN (__ceil_power5plus, 4, 0)
frip fp1, fp1
blr
- END (__ceil)
-
-weak_alias (__ceil, ceil)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__ceil, ceill)
-strong_alias (__ceil, __ceill)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __ceil, ceill, GLIBC_2_0)
-#endif
+END (__ceil_power5plus)
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_ceilf.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_ceil-ppc32.S
similarity index 68%
copy from sysdeps/powerpc/powerpc32/power5+/fpu/s_ceilf.S
copy to sysdeps/powerpc/powerpc32/fpu/multiarch/s_ceil-ppc32.S
index 43f74a1..d5c9d42 100644
--- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_ceilf.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_ceil-ppc32.S
@@ -1,5 +1,5 @@
-/* ceilf function. PowerPC32/power5+ version.
- Copyright (C) 2006-2013 Free Software Foundation, Inc.
+/* ceil function. 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
@@ -17,13 +17,15 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <math_ldbl_opt.h>
- .machine "power5"
-EALIGN (__ceilf, 4, 0)
- frip fp1, fp1 /* The rounding instructions are double. */
- frsp fp1, fp1 /* But we need to set ooverflow for float. */
- blr
- END (__ceilf)
+#undef weak_alias
+#define weak_alias(a,b)
+#undef strong_alias
+#define strong_alias(a,b)
+#undef compat_symbol
+#define compat_symbol(a,b,c,d)
-weak_alias (__ceilf, ceilf)
+#define __ceil __ceil_ppc32
+#include <sysdeps/powerpc/powerpc32/fpu/s_ceil.S>
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_ceil.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_ceil.c
similarity index 68%
rename from sysdeps/powerpc/powerpc32/power5+/fpu/s_ceil.S
rename to sysdeps/powerpc/powerpc32/fpu/multiarch/s_ceil.c
index 0469831..a4e31d1 100644
--- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_ceil.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_ceil.c
@@ -1,5 +1,5 @@
-/* ceil function. PowerPC32/power5+ version.
- Copyright (C) 2006-2013 Free Software Foundation, Inc.
+/* Multiple versions of ceil.
+ 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
@@ -16,21 +16,25 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
+#include <math.h>
#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
+#include "init-arch.h"
- .machine "power5"
-EALIGN (__ceil, 4, 0)
- frip fp1, fp1
- blr
- END (__ceil)
+extern __typeof (__ceil) __ceil_ppc32 attribute_hidden;
+extern __typeof (__ceil) __ceil_power5plus attribute_hidden;
+
+libc_ifunc (__ceil,
+ (hwcap & PPC_FEATURE_POWER5_PLUS)
+ ? __ceil_power5plus
+ : __ceil_ppc32);
weak_alias (__ceil, ceil)
#ifdef NO_LONG_DOUBLE
-weak_alias (__ceil, ceill)
strong_alias (__ceil, __ceill)
+weak_alias (__ceil, ceill)
#endif
#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __ceil, ceill, GLIBC_2_0)
+compat_symbol (libm, __ceil, ceill, GLIBC_2_0);
#endif
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_ceilf.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_ceilf-power5+.S
similarity index 93%
copy from sysdeps/powerpc/powerpc32/power5+/fpu/s_ceilf.S
copy to sysdeps/powerpc/powerpc32/fpu/multiarch/s_ceilf-power5+.S
index 43f74a1..eef69b4 100644
--- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_ceilf.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_ceilf-power5+.S
@@ -19,11 +19,8 @@
#include <sysdep.h>
.machine "power5"
-EALIGN (__ceilf, 4, 0)
+EALIGN (__ceilf_power5plus, 4, 0)
frip fp1, fp1 /* The rounding instructions are double. */
frsp fp1, fp1 /* But we need to set ooverflow for float. */
blr
- END (__ceilf)
-
-weak_alias (__ceilf, ceilf)
-
+END (__ceilf_power5plus)
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_ceilf.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_ceilf-ppc32.S
similarity index 70%
copy from sysdeps/powerpc/powerpc32/power5+/fpu/s_ceilf.S
copy to sysdeps/powerpc/powerpc32/fpu/multiarch/s_ceilf-ppc32.S
index 43f74a1..da0a504 100644
--- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_ceilf.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_ceilf-ppc32.S
@@ -1,5 +1,5 @@
-/* ceilf function. PowerPC32/power5+ version.
- Copyright (C) 2006-2013 Free Software Foundation, Inc.
+/* ceilf function. 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
@@ -17,13 +17,11 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <math_ldbl_opt.h>
- .machine "power5"
-EALIGN (__ceilf, 4, 0)
- frip fp1, fp1 /* The rounding instructions are double. */
- frsp fp1, fp1 /* But we need to set ooverflow for float. */
- blr
- END (__ceilf)
+#undef weak_alias
+#define weak_alias(a,b)
-weak_alias (__ceilf, ceilf)
+#define __ceilf __ceilf_ppc32
+#include <sysdeps/powerpc/powerpc32/fpu/s_ceilf.S>
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_ceilf.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_ceilf.c
similarity index 64%
rename from sysdeps/powerpc/powerpc32/power5+/fpu/s_ceilf.S
rename to sysdeps/powerpc/powerpc32/fpu/multiarch/s_ceilf.c
index 43f74a1..e8f66f9 100644
--- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_ceilf.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_ceilf.c
@@ -1,5 +1,5 @@
-/* ceilf function. PowerPC32/power5+ version.
- Copyright (C) 2006-2013 Free Software Foundation, Inc.
+/* Multiple versions of ceilf.
+ 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
@@ -16,14 +16,17 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
+#include <math.h>
+#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
+#include "init-arch.h"
- .machine "power5"
-EALIGN (__ceilf, 4, 0)
- frip fp1, fp1 /* The rounding instructions are double. */
- frsp fp1, fp1 /* But we need to set ooverflow for float. */
- blr
- END (__ceilf)
+extern __typeof (__ceilf) __ceilf_ppc32 attribute_hidden;
+extern __typeof (__ceilf) __ceilf_power5plus attribute_hidden;
-weak_alias (__ceilf, ceilf)
+libc_ifunc (__ceilf,
+ (hwcap & PPC_FEATURE_POWER5_PLUS)
+ ? __ceilf_power5plus
+ : __ceilf_ppc32);
+weak_alias (__ceilf, ceilf)
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=3d461012598036e92b5fe1d2853418ff4e3816d1
commit 3d461012598036e92b5fe1d2853418ff4e3816d1
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Wed Jun 5 09:07:35 2013 -0500
PowerPC: finite/finitef multilib for PowerPC32
diff --git a/sysdeps/ieee754/dbl-64/s_finite.c b/sysdeps/ieee754/dbl-64/s_finite.c
index 47dad5d..b7fe951 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 dfdf4ad..b7c7638 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 7a2ceff..3bf3e52 100644
--- a/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
@@ -2,9 +2,7 @@ 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 \
s_isinf-power7 s_isinf-ppc32 s_isinff-ppc32 \
- s_finite-power7 s_finite-c s_finitef-c s_copysign-power6 \
- s_copysign-ppc32 s_modf-power5+ s_modf-c s_modff-power5+ \
- s_modff-c
+ s_finite-power7 s_finite-ppc32 s_finitef-ppc32
libm-sysdep_routines += s_llrintf-power6 s_llrintf-power4 s_llrintf-ppc32 \
s_llrint-power6 s_llrint-power4 s_llrint-ppc32 \
@@ -14,7 +12,8 @@ libm-sysdep_routines += s_llrintf-power6 s_llrintf-power4 s_llrintf-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 s_isinf-power7 \
- s_isinf-ppc32 s_isinff-ppc32
+ s_isinf-ppc32 s_isinff-ppc32 s_finite-power7 \
+ s_finite-ppc32 s_finitef-ppc32
CFLAGS-s_llround.c = -fno-builtin-llroundf
endif
diff --git a/sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_finite-power7.S
similarity index 71%
rename from sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S
rename to sysdeps/powerpc/powerpc32/fpu/multiarch/s_finite-power7.S
index b2ab5bf..c9bebd6 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-ppc32.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_finite-ppc32.c
new file mode 100644
index 0000000..5ff982f
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_finite-ppc32.c
@@ -0,0 +1,34 @@
+/* finite(). 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 <math.h>
+
+#undef weak_alias
+#define weak_alias(a, b)
+#undef strong_alias
+#define strong_alias(a, b)
+
+#define __finite __finite_ppc32
+#ifdef SHARED
+# undef hidden_def
+# define hidden_def(a) \
+ __hidden_ver1 (__finite_ppc32, __GI___finite, __finite_ppc32);
+#endif
+
+#include <sysdeps/ieee754/dbl-64/s_finite.c>
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 0000000..85a6341
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_finite.c
@@ -0,0 +1,51 @@
+/* Multiple versions of 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-ppc32.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_finitef-ppc32.c
new file mode 100644
index 0000000..e070d90
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_finitef-ppc32.c
@@ -0,0 +1,32 @@
+/* finitef(). 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 <math.h>
+
+#undef weak_alias
+#define weak_alias(a, b)
+
+#define __finitef __finitef_ppc32
+#ifdef SHARED
+# undef hidden_def
+# define hidden_def(a) \
+ __hidden_ver1 (__finitef_ppc32, __GI___finitef, __finitef_ppc32);
+#endif
+
+#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 0000000..5ffc1d7
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_finitef.c
@@ -0,0 +1,31 @@
+/* Multiple versions of finitef.
+ 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 (__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 54bd941..0000000
--- a/sysdeps/powerpc/powerpc32/power7/fpu/s_finitef.S
+++ /dev/null
@@ -1 +0,0 @@
-/* This function uses the same code as s_finite.S. */
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=d39e4e65b32271a1db2a2780a41e05ab8a11e47d
commit d39e4e65b32271a1db2a2780a41e05ab8a11e47d
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Wed Jun 5 09:06:48 2013 -0500
PowerPC: isinf/isinff multilib for PowerPC32
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
index de2cbda..7a2ceff 100644
--- a/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
@@ -1,6 +1,10 @@
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
+ s_isnanf-power6 s_isnanf-power5 s_isnanf-ppc32 \
+ s_isinf-power7 s_isinf-ppc32 s_isinff-ppc32 \
+ s_finite-power7 s_finite-c s_finitef-c s_copysign-power6 \
+ s_copysign-ppc32 s_modf-power5+ s_modf-c s_modff-power5+ \
+ s_modff-c
libm-sysdep_routines += s_llrintf-power6 s_llrintf-power4 s_llrintf-ppc32 \
s_llrint-power6 s_llrint-power4 s_llrint-ppc32 \
@@ -9,7 +13,8 @@ libm-sysdep_routines += s_llrintf-power6 s_llrintf-power4 s_llrintf-ppc32 \
w_sqrt-ppc32 w_sqrtf-power5 w_sqrtf-power4 \
w_sqrtf-ppc32 s_isnan-power7 s_isnan-power6 \
s_isnan-power5 s_isnan-ppc32 s_isnanf-power6 \
- s_isnanf-power5 s_isnanf-ppc32
+ s_isnanf-power5 s_isnanf-ppc32 s_isinf-power7 \
+ s_isinf-ppc32 s_isinff-ppc32
CFLAGS-s_llround.c = -fno-builtin-llroundf
endif
diff --git a/sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isinf-power7.S
similarity index 78%
rename from sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S
rename to sysdeps/powerpc/powerpc32/fpu/multiarch/s_isinf-power7.S
index 3f8af60..0771ce2 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-ppc32.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isinf-ppc32.c
new file mode 100644
index 0000000..ab68384
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isinf-ppc32.c
@@ -0,0 +1,34 @@
+/* isinf(). 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 <math.h>
+
+#undef weak_alias
+#define weak_alias(a, b)
+#undef strong_alias
+#define strong_alias(a, b)
+
+#define __isinf __isinf_ppc32
+#ifdef SHARED
+# undef hidden_def
+# define hidden_def(a) \
+ __hidden_ver1 (__isinf_ppc32, __GI___isinf, __isinf_ppc32);
+#endif
+
+#include <sysdeps/ieee754/dbl-64/s_isinf.c>
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 0000000..afbae86
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isinf.c
@@ -0,0 +1,44 @@
+/* Multiple versions of 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-ppc32.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isinff-ppc32.c
new file mode 100644
index 0000000..09786c4
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isinff-ppc32.c
@@ -0,0 +1,31 @@
+/* isinff(). 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 <math.h>
+
+#undef weak_alias
+#define weak_alias(a, b)
+
+#define __isinff __isinff_ppc32
+#ifdef SHARED
+# undef hidden_def
+# define hidden_def(a) \
+ __hidden_ver1 (__isinff_ppc32, __GI___isinff, __isinff_ppc32);
+#endif
+
+#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 0000000..6090d3a
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isinff.c
@@ -0,0 +1,32 @@
+/* Multiple versions of 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 be759e0..0000000
--- a/sysdeps/powerpc/powerpc32/power7/fpu/s_isinff.S
+++ /dev/null
@@ -1 +0,0 @@
-/* This function uses the same code as s_isinf.S. */
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=bf5a5665733995bf4784b15530e3858104481214
commit bf5a5665733995bf4784b15530e3858104481214
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Wed Jun 5 08:58:48 2013 -0500
PowerPC: isnan/isnanf multilib for PowerPC32
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/power5/fpu/s_isnan.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnan-power5.S
similarity index 77%
rename from sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S
rename to sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnan-power5.S
index f2417fd..ba28c4d 100644
--- a/sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnan-power5.S
@@ -1,4 +1,4 @@
-/* isnan(). PowerPC32 version.
+/* isnan(). PowerPC32/POWER5 version.
Copyright (C) 2008-2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -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)
diff --git a/sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnan-power6.S
similarity index 77%
rename from sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S
rename to sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnan-power6.S
index 2c095db..eebe69f 100644
--- a/sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnan-power6.S
@@ -1,4 +1,4 @@
-/* isnan(). PowerPC32 version.
+/* isnan(). PowerPC32/POWER6 version.
Copyright (C) 2008-2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -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)
diff --git a/sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnan-power7.S
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 99ff126..54cc998 100644
--- a/sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnan-power7.S
@@ -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/power5/fpu/s_isnanf.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnan-ppc32.S
similarity index 57%
copy from sysdeps/powerpc/powerpc32/power5/fpu/s_isnanf.S
copy to sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnan-ppc32.S
index 0373f01..774f99c 100644
--- a/sysdeps/powerpc/powerpc32/power5/fpu/s_isnanf.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnan-ppc32.S
@@ -1,5 +1,6 @@
-/* isnan(). PowerPC32 version.
- Copyright (C) 2008-2013 Free Software Foundation, Inc.
+/* 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
@@ -19,27 +20,9 @@
#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)
+#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/s_isnan.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnan.c
similarity index 63%
copy from sysdeps/powerpc/powerpc32/fpu/s_isnan.S
copy to sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnan.c
index 98d10da..a45091f 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnan.c
@@ -1,5 +1,5 @@
-/* isnan(). PowerPC32 version.
- Copyright (C) 2008-2013 Free Software Foundation, Inc.
+/* 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
@@ -16,31 +16,27 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
+#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);
-/* int __isnan(x) */
- .machine power4
-EALIGN (__isnan, 4, 0)
- mffs fp0
- mtfsb0 4*cr6+lt /* reset_fpscr_bit (FPSCR_VE) */
- fcmpu cr7,fp1,fp1
- mtfsf 255,fp0
- li r3,0
- beqlr+ cr7 /* (x == x) then not a NAN */
- li r3,1 /* else must be a 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)
@@ -52,4 +48,3 @@ 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/fpu/multiarch/s_isnanf-power5.S
similarity index 90%
copy from sysdeps/powerpc/powerpc32/power5/fpu/s_isnanf.S
copy to sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnanf-power5.S
index 0373f01..640f992 100644
--- a/sysdeps/powerpc/powerpc32/power5/fpu/s_isnanf.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnanf-power5.S
@@ -1,4 +1,4 @@
-/* isnan(). PowerPC32 version.
+/* isnanf(). PowerPC32/POWER5 version.
Copyright (C) 2008-2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -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)
diff --git a/sysdeps/powerpc/powerpc32/power6/fpu/s_isnanf.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnanf-power6.S
similarity index 90%
rename from sysdeps/powerpc/powerpc32/power6/fpu/s_isnanf.S
rename to sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnanf-power6.S
index 483f0f9..4345c5a 100644
--- a/sysdeps/powerpc/powerpc32/power6/fpu/s_isnanf.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnanf-power6.S
@@ -1,4 +1,4 @@
-/* isnanf(). PowerPC32 version.
+/* isnanf(). PowerPC32/POWER6 version.
Copyright (C) 2008-2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -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/power5/fpu/s_isnanf.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnanf-ppc32.S
similarity index 61%
copy from sysdeps/powerpc/powerpc32/power5/fpu/s_isnanf.S
copy to sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnanf-ppc32.S
index 0373f01..e1fd2f3 100644
--- a/sysdeps/powerpc/powerpc32/power5/fpu/s_isnanf.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnanf-ppc32.S
@@ -1,4 +1,4 @@
-/* isnan(). PowerPC32 version.
+/* Default isnanf implementation for PowerPC32.
Copyright (C) 2008-2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -19,27 +19,14 @@
#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)
+#undef weak_alias
+#define weak_alias(a, b)
+#undef compat_symbol
+#define compat_symbol(a, b, c, d)
-hidden_def (__isnanf)
-weak_alias (__isnanf, isnanf)
+#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/power5/fpu/s_isnanf.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnanf.c
similarity index 54%
rename from sysdeps/powerpc/powerpc32/power5/fpu/s_isnanf.S
rename to sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnanf.c
index 0373f01..5647841 100644
--- a/sysdeps/powerpc/powerpc32/power5/fpu/s_isnanf.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_isnanf.c
@@ -1,5 +1,5 @@
-/* isnan(). PowerPC32 version.
- Copyright (C) 2008-2013 Free Software Foundation, Inc.
+/* 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
@@ -16,30 +16,22 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
+#include <math.h>
+#include <shlib-compat.h>
+#include "init-arch.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)
+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;
-hidden_def (__isnanf)
-weak_alias (__isnanf, isnanf)
+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/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. */
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=6040ea16e8b81242767e57197faaf4beb3be8200
commit 6040ea16e8b81242767e57197faaf4beb3be8200
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Wed Jun 5 08:58:01 2013 -0500
PowerPC: sqrt/sqrtf multilib for PowerPC32
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
index 7c50805..22e07ce 100644
--- a/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
@@ -2,7 +2,9 @@ ifeq ($(subdir),math)
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
+ s_llround-ppc32 w_sqrt-power5 w_sqrt-power4 \
+ w_sqrt-ppc32 w_sqrtf-power5 w_sqrtf-power4 \
+ w_sqrtf-ppc32
CFLAGS-s_llround.c = -fno-builtin-llroundf
endif
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/w_sqrt.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/w_sqrt-power4.S
similarity index 91%
rename from sysdeps/powerpc/powerpc32/power4/fpu/w_sqrt.S
rename to sysdeps/powerpc/powerpc32/fpu/multiarch/w_sqrt-power4.S
index 3648e4a..35e638f 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/w_sqrt.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/w_sqrt-power4.S
@@ -1,4 +1,4 @@
-/* sqrt function. PowerPC32 version.
+/* sqrt function. PowerPC32/POWER4 version.
Copyright (C) 2007-2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -45,7 +45,7 @@
.section ".text"
.machine power4
-EALIGN (__sqrt, 5, 0)
+EALIGN (__sqrt_power4, 5, 0)
fsqrt fp2,fp1
mcrfs cr1,4
bso- cr1,.Lw_sqrt
@@ -95,15 +95,4 @@ EALIGN (__sqrt, 5, 0)
bl __kernel_standard@plt
fmr fp12,fp1
b .L4
- END (__sqrt)
-
-weak_alias (__sqrt, sqrt)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__sqrt, sqrtl)
-strong_alias (__sqrt, __sqrtl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __sqrt, sqrtl, GLIBC_2_0)
-#endif
-
+END(__sqrt_power4)
diff --git a/sysdeps/powerpc/powerpc32/power5/fpu/w_sqrt.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/w_sqrt-power5.S
similarity index 90%
rename from sysdeps/powerpc/powerpc32/power5/fpu/w_sqrt.S
rename to sysdeps/powerpc/powerpc32/fpu/multiarch/w_sqrt-power5.S
index ed11d5a..fcb3043 100644
--- a/sysdeps/powerpc/powerpc32/power5/fpu/w_sqrt.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/w_sqrt-power5.S
@@ -1,4 +1,4 @@
-/* sqrt function. PowerPC32 version.
+/* sqrt function. PowerPC32/POWER5 version.
Copyright (C) 2007-2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -43,8 +43,8 @@
this is the best we can do. */
.section ".text"
- .machine power4
-EALIGN (__sqrt, 5, 0)
+ .machine power5
+EALIGN (__sqrt_power5, 5, 0)
fabs fp0,fp1
fsqrt fp2,fp1
fcmpu cr1,fp0,fp1
@@ -93,15 +93,4 @@ EALIGN (__sqrt, 5, 0)
bl __kernel_standard@plt
fmr fp12,fp1
b .L4
- END (__sqrt)
-
-weak_alias (__sqrt, sqrt)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__sqrt, sqrtl)
-strong_alias (__sqrt, __sqrtl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __sqrt, sqrtl, GLIBC_2_0)
-#endif
-
+END (__sqrt_power5)
diff --git a/sysdeps/powerpc/fpu/w_sqrt.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/w_sqrt-ppc32.c
similarity index 51%
copy from sysdeps/powerpc/fpu/w_sqrt.c
copy to sysdeps/powerpc/powerpc32/fpu/multiarch/w_sqrt-ppc32.c
index 70f28dd..5d07a7b 100644
--- a/sysdeps/powerpc/fpu/w_sqrt.c
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/w_sqrt-ppc32.c
@@ -1,5 +1,5 @@
-/* Double-precision floating point square root wrapper.
- Copyright (C) 2004-2013 Free Software Foundation, Inc.
+/* PowerPC32 default implementation for sqrt.
+ 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
@@ -17,32 +17,14 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
-#include <math_private.h>
-#include <fenv_libc.h>
-#include <math_ldbl_opt.h>
-double
-__sqrt (double x) /* wrapper sqrt */
-{
-#ifdef _IEEE_LIBM
- return __ieee754_sqrt (x);
-#else
- double z;
- z = __ieee754_sqrt (x);
- if (_LIB_VERSION == _IEEE_ || (x != x))
- return z;
+/* The PPC32 default implementation will fallback to __ieee754_sqrt symbol
+ from sysdeps/powerpc/fpu/e_sqrt.c */
- if (x < 0.0)
- return __kernel_standard (x, x, 26); /* sqrt(negative) */
- else
- return z;
-#endif
-}
+#define __sqrtf __sqrtf_ppc32
+#undef weak_alias
+#define weak_alias(a, b)
+#undef strong_alias
+#define strong_alias(a, b)
-weak_alias (__sqrt, sqrt)
-#ifdef NO_LONG_DOUBLE
- strong_alias (__sqrt, __sqrtl) weak_alias (__sqrt, sqrtl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __sqrt, sqrtl, GLIBC_2_0);
-#endif
+#include <math/w_sqrtf.c>
diff --git a/sysdeps/powerpc/fpu/w_sqrt.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/w_sqrt.c
similarity index 63%
copy from sysdeps/powerpc/fpu/w_sqrt.c
copy to sysdeps/powerpc/powerpc32/fpu/multiarch/w_sqrt.c
index 70f28dd..f77eeb2 100644
--- a/sysdeps/powerpc/fpu/w_sqrt.c
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/w_sqrt.c
@@ -1,5 +1,5 @@
-/* Double-precision floating point square root wrapper.
- Copyright (C) 2004-2013 Free Software Foundation, Inc.
+/* Multiple versions of sqrt.
+ 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
@@ -17,31 +17,26 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
-#include <math_private.h>
-#include <fenv_libc.h>
#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
+#include "init-arch.h"
-double
-__sqrt (double x) /* wrapper sqrt */
-{
-#ifdef _IEEE_LIBM
- return __ieee754_sqrt (x);
-#else
- double z;
- z = __ieee754_sqrt (x);
- if (_LIB_VERSION == _IEEE_ || (x != x))
- return z;
-
- if (x < 0.0)
- return __kernel_standard (x, x, 26); /* sqrt(negative) */
- else
- return z;
-#endif
-}
+extern __typeof (__sqrt) __sqrt_ppc32 attribute_hidden;
+extern __typeof (__sqrt) __sqrt_power4 attribute_hidden;
+extern __typeof (__sqrt) __sqrt_power5 attribute_hidden;
+
+libc_ifunc (__sqrt,
+ (hwcap & PPC_FEATURE_POWER5)
+ ? __sqrt_power5 :
+ (hwcap & PPC_FEATURE_POWER4)
+ ? __sqrt_power4
+ : __sqrt_ppc32);
weak_alias (__sqrt, sqrt)
+
#ifdef NO_LONG_DOUBLE
- strong_alias (__sqrt, __sqrtl) weak_alias (__sqrt, sqrtl)
+strong_alias (__sqrt, __sqrtl)
+weak_alias (__sqrt, sqrtl)
#endif
#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
compat_symbol (libm, __sqrt, sqrtl, GLIBC_2_0);
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/w_sqrtf.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/w_sqrtf-power4.S
similarity index 96%
rename from sysdeps/powerpc/powerpc32/power4/fpu/w_sqrtf.S
rename to sysdeps/powerpc/powerpc32/fpu/multiarch/w_sqrtf-power4.S
index 153843c..f3524a2 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/w_sqrtf.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/w_sqrtf-power4.S
@@ -1,4 +1,4 @@
-/* sqrtf function. PowerPC32 version.
+/* sqrtf function. PowerPC32/POWER4 version.
Copyright (C) 2007-2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -45,7 +45,7 @@
.section ".text"
.machine power4
-EALIGN (__sqrtf, 5, 0)
+EALIGN (__sqrtf_power4, 5, 0)
fsqrts fp2,fp1
mcrfs cr1,4
bso- cr1,.Lw_sqrtf
@@ -95,7 +95,4 @@ EALIGN (__sqrtf, 5, 0)
bl __kernel_standard@plt
fmr fp12,fp1
b .L4
- END (__sqrtf)
-
-weak_alias (__sqrtf, sqrtf)
-
+END (__sqrtf_power4)
diff --git a/sysdeps/powerpc/powerpc32/power5/fpu/w_sqrtf.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/w_sqrtf-power5.S
similarity index 95%
rename from sysdeps/powerpc/powerpc32/power5/fpu/w_sqrtf.S
rename to sysdeps/powerpc/powerpc32/fpu/multiarch/w_sqrtf-power5.S
index 2049172..aae9e91 100644
--- a/sysdeps/powerpc/powerpc32/power5/fpu/w_sqrtf.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/w_sqrtf-power5.S
@@ -1,4 +1,4 @@
-/* sqrtf function. PowerPC32 version.
+/* sqrtf function. PowerPC32/POWER5 version.
Copyright (C) 2007-2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -43,8 +43,8 @@
this is the best we can do. */
.section ".text"
- .machine power4
-EALIGN (__sqrtf, 5, 0)
+ .machine power5
+EALIGN (__sqrtf_power5, 5, 0)
fabs fp0,fp1
fsqrts fp2,fp1
fcmpu cr1,fp0,fp1
@@ -93,7 +93,4 @@ EALIGN (__sqrtf, 5, 0)
bl __kernel_standard@plt
fmr fp12,fp1
b .L4
- END (__sqrtf)
-
-weak_alias (__sqrtf, sqrtf)
-
+END (__sqrtf_power5)
diff --git a/sysdeps/powerpc/fpu/w_sqrt.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/w_sqrtf-ppc32.c
similarity index 51%
copy from sysdeps/powerpc/fpu/w_sqrt.c
copy to sysdeps/powerpc/powerpc32/fpu/multiarch/w_sqrtf-ppc32.c
index 70f28dd..3702e44 100644
--- a/sysdeps/powerpc/fpu/w_sqrt.c
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/w_sqrtf-ppc32.c
@@ -1,5 +1,5 @@
-/* Double-precision floating point square root wrapper.
- Copyright (C) 2004-2013 Free Software Foundation, Inc.
+/* PowerPC32 default implementation for sqrtf.
+ 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
@@ -17,32 +17,14 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
-#include <math_private.h>
-#include <fenv_libc.h>
-#include <math_ldbl_opt.h>
-double
-__sqrt (double x) /* wrapper sqrt */
-{
-#ifdef _IEEE_LIBM
- return __ieee754_sqrt (x);
-#else
- double z;
- z = __ieee754_sqrt (x);
- if (_LIB_VERSION == _IEEE_ || (x != x))
- return z;
+/* The PPC32 default implementation will fallback to __ieee754_sqrt symbol
+ from sysdeps/powerpc/fpu/e_sqrt.c */
- if (x < 0.0)
- return __kernel_standard (x, x, 26); /* sqrt(negative) */
- else
- return z;
-#endif
-}
+#define __sqrt __sqrt_ppc32
+#undef weak_alias
+#define weak_alias(a, b)
+#undef strong_alias
+#define strong_alias(a, b)
-weak_alias (__sqrt, sqrt)
-#ifdef NO_LONG_DOUBLE
- strong_alias (__sqrt, __sqrtl) weak_alias (__sqrt, sqrtl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __sqrt, sqrtl, GLIBC_2_0);
-#endif
+#include <math/w_sqrt.c>
diff --git a/sysdeps/powerpc/fpu/w_sqrt.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/w_sqrtf.c
similarity index 53%
rename from sysdeps/powerpc/fpu/w_sqrt.c
rename to sysdeps/powerpc/powerpc32/fpu/multiarch/w_sqrtf.c
index 70f28dd..8af86c4 100644
--- a/sysdeps/powerpc/fpu/w_sqrt.c
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/w_sqrtf.c
@@ -1,5 +1,5 @@
-/* Double-precision floating point square root wrapper.
- Copyright (C) 2004-2013 Free Software Foundation, Inc.
+/* Multiple versions of sqrtf.
+ 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
@@ -17,32 +17,19 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
-#include <math_private.h>
-#include <fenv_libc.h>
#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
+#include "init-arch.h"
-double
-__sqrt (double x) /* wrapper sqrt */
-{
-#ifdef _IEEE_LIBM
- return __ieee754_sqrt (x);
-#else
- double z;
- z = __ieee754_sqrt (x);
- if (_LIB_VERSION == _IEEE_ || (x != x))
- return z;
+extern __typeof (__sqrtf) __sqrtf_ppc32 attribute_hidden;
+extern __typeof (__sqrtf) __sqrtf_power4 attribute_hidden;
+extern __typeof (__sqrtf) __sqrtf_power5 attribute_hidden;
- if (x < 0.0)
- return __kernel_standard (x, x, 26); /* sqrt(negative) */
- else
- return z;
-#endif
-}
+libc_ifunc (__sqrtf,
+ (hwcap & PPC_FEATURE_POWER5)
+ ? __sqrtf_power5 :
+ (hwcap & PPC_FEATURE_POWER4)
+ ? __sqrtf_power4
+ : __sqrtf_ppc32);
-weak_alias (__sqrt, sqrt)
-#ifdef NO_LONG_DOUBLE
- strong_alias (__sqrt, __sqrtl) weak_alias (__sqrt, sqrtl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __sqrt, sqrtl, GLIBC_2_0);
-#endif
+weak_alias (__sqrtf, sqrtf)
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=7b6b84060289193bcb9d8bcec488664cec6dd39b
commit 7b6b84060289193bcb9d8bcec488664cec6dd39b
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Wed Jun 5 08:57:09 2013 -0500
PowerPC: llround multilib for PowerPC32
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
index 8119417..7c50805 100644
--- a/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
@@ -1,4 +1,8 @@
ifeq ($(subdir),math)
libm-sysdep_routines += s_llrintf-power6 s_llrintf-power4 s_llrintf-ppc32 \
- s_llrint-power6 s_llrint-power4 s_llrint-ppc32
+ s_llrint-power6 s_llrint-power4 s_llrint-ppc32 \
+ s_llround-power6 s_llround-power5+ s_llround-power4 \
+ s_llround-ppc32
+
+CFLAGS-s_llround.c = -fno-builtin-llroundf
endif
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-power4.S
similarity index 89%
rename from sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S
rename to sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-power4.S
index 631180f..1080771 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-power4.S
@@ -1,4 +1,4 @@
-/* llround function. PowerPC32 on PowerPC64 version.
+/* llround function. PowerPC32/POWER4 version.
Copyright (C) 2004-2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -46,7 +46,8 @@
is greater/less than +-2^52 we don't need to bias the number with
+-0.5. */
-ENTRY (__llround)
+ .machine power4
+ENTRY (__llround_power4)
stwu r1,-16(r1)
cfi_adjust_cfa_offset (16)
#ifdef SHARED
@@ -92,17 +93,4 @@ ENTRY (__llround)
.Lnobias:
fmr fp3,fp1
b .Lconvert
- END (__llround)
-
-weak_alias (__llround, llround)
-
-strong_alias (__llround, __llroundf)
-weak_alias (__llround, llroundf)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__llround, llroundl)
-strong_alias (__llround, __llroundl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llround, llroundl, GLIBC_2_1)
-#endif
+END (__llround_power4)
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-power5+.S
similarity index 81%
rename from sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S
rename to sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-power5+.S
index ecd37c3..90765de 100644
--- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-power5+.S
@@ -1,4 +1,4 @@
-/* lround function. POWER5+, PowerPC32 version.
+/* lround function. PowerPC32/POWER5+ version.
Copyright (C) 2006-2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -30,7 +30,7 @@
round to zero instruction. */
.machine "power5"
-ENTRY (__llround)
+ENTRY (__llround_power5)
stwu r1,-16(r1)
cfi_adjust_cfa_offset (16)
frin fp2,fp1
@@ -43,17 +43,4 @@ ENTRY (__llround)
lwz r3,8(r1)
addi r1,r1,16
blr
- END (__llround)
-
-weak_alias (__llround, llround)
-
-strong_alias (__llround, __llroundf)
-weak_alias (__llround, llroundf)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__llround, llroundl)
-strong_alias (__llround, __llroundl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llround, llroundl, GLIBC_2_1)
-#endif
+END (__llround_power5)
diff --git a/sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-power6.S
similarity index 80%
rename from sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S
rename to sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-power6.S
index 0ff04cb..fa61586 100644
--- a/sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-power6.S
@@ -1,4 +1,4 @@
-/* lround function. POWER5+, PowerPC32 version.
+/* lround function. PowerPC32/POWER6 version.
Copyright (C) 2006-2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -29,8 +29,8 @@
instruction before we use the Floating Convert to Integer Word with
round to zero instruction. */
- .machine "power5"
-ENTRY (__llround)
+ .machine "power6"
+ENTRY (__llround_power6)
stwu r1,-16(r1)
cfi_adjust_cfa_offset (16)
frin fp2,fp1
@@ -43,17 +43,4 @@ ENTRY (__llround)
lwz r3,8(r1)
addi r1,r1,16
blr
- END (__llround)
-
-weak_alias (__llround, llround)
-
-strong_alias (__llround, __llroundf)
-weak_alias (__llround, llroundf)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__llround, llroundl)
-strong_alias (__llround, __llroundl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llround, llroundl, GLIBC_2_1)
-#endif
+END (__llround_power6)
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-ppc32.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-ppc32.c
new file mode 100644
index 0000000..fad664e
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround-ppc32.c
@@ -0,0 +1,32 @@
+/* llround function. PowerPC32 default version.
+ Copyright (C) 2004-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>
+
+#undef __llround
+#define __llround __llround_ppc32
+
+#undef weak_alias
+#define weak_alias(a,b)
+#undef strong_alias
+#define strong_alias(a,b)
+#undef compat_symbol
+#define compat_symbol(a,b,c,d)
+
+#include <sysdeps/powerpc/fpu/s_llround.c>
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround.c
new file mode 100644
index 0000000..9ca54e0
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llround.c
@@ -0,0 +1,46 @@
+/* Multiple versions of llround.
+ 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 (__llround) __llround_ppc32 attribute_hidden;
+extern __typeof (__llround) __llround_power4 attribute_hidden;
+extern __typeof (__llround) __llround_power5 attribute_hidden;
+extern __typeof (__llround) __llround_power6 attribute_hidden;
+
+libc_ifunc (__llround,
+ (hwcap & PPC_FEATURE_ARCH_2_05)
+ ? __llround_power6 :
+ (hwcap & PPC_FEATURE_POWER5_PLUS)
+ ? __llround_power5 :
+ (hwcap & PPC_FEATURE_POWER4)
+ ? __llround_power4
+ : __llround_ppc32);
+
+weak_alias (__llround, llround)
+
+#ifdef NO_LONG_DOUBLE
+strong_alias (__llround, __llroundl)
+weak_alias (__llround, llroundl)
+#endif
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __llround, llroundl, GLIBC_2_1);
+#endif
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llroundf.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llroundf.c
new file mode 100644
index 0000000..629048d
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llroundf.c
@@ -0,0 +1,37 @@
+/* Multiple versions of llroundf.
+ 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 "init-arch.h"
+
+/* It's safe to use double-precision implementation for single-precision. */
+extern __typeof (__llroundf) __llround_ppc32 attribute_hidden;
+extern __typeof (__llroundf) __llround_power4 attribute_hidden;
+extern __typeof (__llroundf) __llround_power5 attribute_hidden;
+extern __typeof (__llroundf) __llround_power6 attribute_hidden;
+
+libc_ifunc (__llroundf,
+ (hwcap & PPC_FEATURE_ARCH_2_05)
+ ? __llround_power6 :
+ (hwcap & PPC_FEATURE_POWER5_PLUS)
+ ? __llround_power5 :
+ (hwcap & PPC_FEATURE_POWER4)
+ ? __llround_power4
+ : __llround_ppc32);
+
+weak_alias (__llroundf, llroundf)
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/s_llroundf.S b/sysdeps/powerpc/powerpc32/power4/fpu/s_llroundf.S
deleted file mode 100644
index 72d6181..0000000
--- a/sysdeps/powerpc/powerpc32/power4/fpu/s_llroundf.S
+++ /dev/null
@@ -1 +0,0 @@
-/* __llroundf is in s_llround.S */
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_llroundf.S b/sysdeps/powerpc/powerpc32/power5+/fpu/s_llroundf.S
deleted file mode 100644
index 030d2fd..0000000
--- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_llroundf.S
+++ /dev/null
@@ -1 +0,0 @@
-/* __llroundf is in s_llround.S */
diff --git a/sysdeps/powerpc/powerpc32/power6/fpu/s_llroundf.S b/sysdeps/powerpc/powerpc32/power6/fpu/s_llroundf.S
deleted file mode 100644
index 030d2fd..0000000
--- a/sysdeps/powerpc/powerpc32/power6/fpu/s_llroundf.S
+++ /dev/null
@@ -1 +0,0 @@
-/* __llroundf is in s_llround.S */
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=3ba4a168079242511ce242e00c44f0661a4c0c67
commit 3ba4a168079242511ce242e00c44f0661a4c0c67
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Wed Jun 5 08:56:27 2013 -0500
PowerPC: llrint/llrintf multilib for PowerPC32
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
new file mode 100644
index 0000000..8119417
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
@@ -0,0 +1,4 @@
+ifeq ($(subdir),math)
+libm-sysdep_routines += s_llrintf-power6 s_llrintf-power4 s_llrintf-ppc32 \
+ s_llrint-power6 s_llrint-power4 s_llrint-ppc32
+endif
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/s_llrint.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llrint-power4.S
similarity index 78%
rename from sysdeps/powerpc/powerpc32/power4/fpu/s_llrint.S
rename to sysdeps/powerpc/powerpc32/fpu/multiarch/s_llrint-power4.S
index 55b2850..2d1f201 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/s_llrint.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llrint-power4.S
@@ -1,4 +1,4 @@
-/* Round double to long int. PowerPC32 on PowerPC64 version.
+/* Round double to long int. PowerPC32/POWER4 version.
Copyright (C) 2004-2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -20,7 +20,8 @@
#include <math_ldbl_opt.h>
/* long long int[r3, r4] __llrint (double x[fp1]) */
-ENTRY (__llrint)
+ .machine power4
+ENTRY (__llrint_power4)
CALL_MCOUNT
stwu r1,-16(r1)
cfi_adjust_cfa_offset (16)
@@ -33,14 +34,4 @@ ENTRY (__llrint)
lwz r4,12(r1)
addi r1,r1,16
blr
- END (__llrint)
-
-weak_alias (__llrint, llrint)
-
-#ifdef NO_LONG_DOUBLE
-strong_alias (__llrint, __llrintl)
-weak_alias (__llrint, llrintl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llrint, llrintl, GLIBC_2_1)
-#endif
+END (__llrint_power4)
diff --git a/sysdeps/powerpc/powerpc32/power6/fpu/s_llrint.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llrint-power6.S
similarity index 78%
copy from sysdeps/powerpc/powerpc32/power6/fpu/s_llrint.S
copy to sysdeps/powerpc/powerpc32/fpu/multiarch/s_llrint-power6.S
index 3344b31..8a0ffd6 100644
--- a/sysdeps/powerpc/powerpc32/power6/fpu/s_llrint.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llrint-power6.S
@@ -1,4 +1,4 @@
-/* Round double to long int. PowerPC32 on PowerPC64 version.
+/* Round double to long int. PowerPC32/POWER6 version.
Copyright (C) 2004-2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -20,7 +20,8 @@
#include <math_ldbl_opt.h>
/* long long int[r3, r4] __llrint (double x[fp1]) */
-ENTRY (__llrint)
+ .machine power6
+ENTRY (__llrint_power6)
CALL_MCOUNT
stwu r1,-16(r1)
cfi_adjust_cfa_offset (16)
@@ -33,14 +34,4 @@ ENTRY (__llrint)
lwz r4,12(r1)
addi r1,r1,16
blr
- END (__llrint)
-
-weak_alias (__llrint, llrint)
-
-#ifdef NO_LONG_DOUBLE
-strong_alias (__llrint, __llrintl)
-weak_alias (__llrint, llrintl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llrint, llrintl, GLIBC_2_1)
-#endif
+END (__llrint_power6)
diff --git a/sysdeps/powerpc/powerpc32/power6/fpu/s_llrintf.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llrint-ppc32.c
similarity index 58%
copy from sysdeps/powerpc/powerpc32/power6/fpu/s_llrintf.S
copy to sysdeps/powerpc/powerpc32/fpu/multiarch/s_llrint-ppc32.c
index 7f64f8d..ed1d685 100644
--- a/sysdeps/powerpc/powerpc32/power6/fpu/s_llrintf.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llrint-ppc32.c
@@ -1,5 +1,5 @@
-/* Round float to long int. PowerPC32 on PowerPC64 version.
- Copyright (C) 2004-2013 Free Software Foundation, Inc.
+/* Round double to long int. 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
@@ -16,23 +16,16 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
+#include <math_ldbl_opt.h>
-/* long long int[r3, r4] __llrintf (float x[fp1]) */
-ENTRY (__llrintf)
- CALL_MCOUNT
- stwu r1,-16(r1)
- cfi_adjust_cfa_offset (16)
- fctid fp13,fp1
- stfd fp13,8(r1)
-/* Insure the following load is in a different dispatch group by
- inserting "group ending nop". */
- ori r1,r1,0
- lwz r3,8(r1)
- lwz r4,12(r1)
- addi r1,r1,16
- blr
- END (__llrintf)
+#undef __llrint
+#define __llrint __llrint_ppc32
-weak_alias (__llrintf, llrintf)
+#undef weak_alias
+#define weak_alias(a, b)
+#undef strong_alias
+#define strong_alias(a, b)
+#undef compat_symbol
+#define compat_symbol(a, b, c, d)
+#include <sysdeps/powerpc/powerpc32/fpu/s_llrint.c>
diff --git a/sysdeps/powerpc/powerpc32/power6/fpu/s_llrint.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llrint.c
similarity index 62%
rename from sysdeps/powerpc/powerpc32/power6/fpu/s_llrint.S
rename to sysdeps/powerpc/powerpc32/fpu/multiarch/s_llrint.c
index 3344b31..15a9c10 100644
--- a/sysdeps/powerpc/powerpc32/power6/fpu/s_llrint.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llrint.c
@@ -1,5 +1,5 @@
-/* Round double to long int. PowerPC32 on PowerPC64 version.
- Copyright (C) 2004-2013 Free Software Foundation, Inc.
+/* Multiple versions of llrint.
+ 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
@@ -16,24 +16,21 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
+#include <math.h>
#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
+#include "init-arch.h"
-/* long long int[r3, r4] __llrint (double x[fp1]) */
-ENTRY (__llrint)
- CALL_MCOUNT
- stwu r1,-16(r1)
- cfi_adjust_cfa_offset (16)
- fctid fp13,fp1
- stfd fp13,8(r1)
-/* Insure the following load is in a different dispatch group by
- inserting "group ending nop". */
- ori r1,r1,0
- lwz r3,8(r1)
- lwz r4,12(r1)
- addi r1,r1,16
- blr
- END (__llrint)
+extern __typeof (__llrint) __llrint_ppc32 attribute_hidden;
+extern __typeof (__llrint) __llrint_power4 attribute_hidden;
+extern __typeof (__llrint) __llrint_power6 attribute_hidden;
+
+libc_ifunc (__llrint,
+ (hwcap & PPC_FEATURE_ARCH_2_05)
+ ? __llrint_power6 :
+ (hwcap & PPC_FEATURE_POWER4)
+ ? __llrint_power4
+ : __llrint_ppc32);
weak_alias (__llrint, llrint)
@@ -42,5 +39,5 @@ strong_alias (__llrint, __llrintl)
weak_alias (__llrint, llrintl)
#endif
#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llrint, llrintl, GLIBC_2_1)
+compat_symbol (libm, __llrint, llrintl, GLIBC_2_1);
#endif
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/s_llrintf.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llrintf-power4.S
similarity index 89%
copy from sysdeps/powerpc/powerpc32/power4/fpu/s_llrintf.S
copy to sysdeps/powerpc/powerpc32/fpu/multiarch/s_llrintf-power4.S
index cc80fcb..02799fd 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/s_llrintf.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llrintf-power4.S
@@ -1,4 +1,4 @@
-/* Round float to long int. PowerPC32 on PowerPC64 version.
+/* Round float to long int. PowerPC32/POWER4 version.
Copyright (C) 2004-2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -19,7 +19,8 @@
#include <sysdep.h>
/* long long int[r3, r4] __llrintf (float x[fp1]) */
-ENTRY (__llrintf)
+ .machine power4
+ENTRY (__llrintf_power4)
CALL_MCOUNT
stwu r1,-16(r1)
cfi_adjust_cfa_offset (16)
@@ -32,7 +33,4 @@ ENTRY (__llrintf)
lwz r4,12(r1)
addi r1,r1,16
blr
- END (__llrintf)
-
-weak_alias (__llrintf, llrintf)
-
+END (__llrintf_power4)
diff --git a/sysdeps/powerpc/powerpc32/power6/fpu/s_llrintf.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llrintf-power6.S
similarity index 89%
copy from sysdeps/powerpc/powerpc32/power6/fpu/s_llrintf.S
copy to sysdeps/powerpc/powerpc32/fpu/multiarch/s_llrintf-power6.S
index 7f64f8d..07af3cc 100644
--- a/sysdeps/powerpc/powerpc32/power6/fpu/s_llrintf.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llrintf-power6.S
@@ -1,4 +1,4 @@
-/* Round float to long int. PowerPC32 on PowerPC64 version.
+/* Round float to long int. PowerPC32/POWER6 version.
Copyright (C) 2004-2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -19,7 +19,8 @@
#include <sysdep.h>
/* long long int[r3, r4] __llrintf (float x[fp1]) */
-ENTRY (__llrintf)
+ .machine power6
+ENTRY (__llrintf_power6)
CALL_MCOUNT
stwu r1,-16(r1)
cfi_adjust_cfa_offset (16)
@@ -32,7 +33,4 @@ ENTRY (__llrintf)
lwz r4,12(r1)
addi r1,r1,16
blr
- END (__llrintf)
-
-weak_alias (__llrintf, llrintf)
-
+END (__llrintf_power6)
diff --git a/sysdeps/powerpc/powerpc32/power6/fpu/s_llrintf.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llrintf-ppc32.c
similarity index 63%
rename from sysdeps/powerpc/powerpc32/power6/fpu/s_llrintf.S
rename to sysdeps/powerpc/powerpc32/fpu/multiarch/s_llrintf-ppc32.c
index 7f64f8d..2ea3c4a 100644
--- a/sysdeps/powerpc/powerpc32/power6/fpu/s_llrintf.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llrintf-ppc32.c
@@ -1,4 +1,4 @@
-/* Round float to long int. PowerPC32 on PowerPC64 version.
+/* Round float to long int. PowerPC32 default version.
Copyright (C) 2004-2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -16,23 +16,12 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
+#include <math.h>
-/* long long int[r3, r4] __llrintf (float x[fp1]) */
-ENTRY (__llrintf)
- CALL_MCOUNT
- stwu r1,-16(r1)
- cfi_adjust_cfa_offset (16)
- fctid fp13,fp1
- stfd fp13,8(r1)
-/* Insure the following load is in a different dispatch group by
- inserting "group ending nop". */
- ori r1,r1,0
- lwz r3,8(r1)
- lwz r4,12(r1)
- addi r1,r1,16
- blr
- END (__llrintf)
+#undef __llrintf
+#define __llrintf __llrintf_ppc32
-weak_alias (__llrintf, llrintf)
+#undef weak_alias
+#define weak_alias(a,b)
+#include <sysdeps/powerpc/powerpc32/fpu/s_llrintf.c>
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/s_llrintf.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llrintf.c
similarity index 59%
rename from sysdeps/powerpc/powerpc32/power4/fpu/s_llrintf.S
rename to sysdeps/powerpc/powerpc32/fpu/multiarch/s_llrintf.c
index cc80fcb..d4aeed1 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/s_llrintf.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_llrintf.c
@@ -1,5 +1,5 @@
-/* Round float to long int. PowerPC32 on PowerPC64 version.
- Copyright (C) 2004-2013 Free Software Foundation, Inc.
+/* Multiple versions of llrintf.
+ 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
@@ -16,23 +16,19 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
+#include <math.h>
+#include <shlib-compat.h>
+#include "init-arch.h"
-/* long long int[r3, r4] __llrintf (float x[fp1]) */
-ENTRY (__llrintf)
- CALL_MCOUNT
- stwu r1,-16(r1)
- cfi_adjust_cfa_offset (16)
- fctid fp13,fp1
- stfd fp13,8(r1)
- nop /* Insure the following load is in a different dispatch group */
- nop /* to avoid pipe stall on POWER4&5. */
- nop
- lwz r3,8(r1)
- lwz r4,12(r1)
- addi r1,r1,16
- blr
- END (__llrintf)
+extern __typeof (__llrintf) __llrintf_ppc32 attribute_hidden;
+extern __typeof (__llrintf) __llrintf_power4 attribute_hidden;
+extern __typeof (__llrintf) __llrintf_power6 attribute_hidden;
-weak_alias (__llrintf, llrintf)
+libc_ifunc (__llrintf,
+ (hwcap & PPC_FEATURE_ARCH_2_05)
+ ? __llrintf_power6 :
+ (hwcap & PPC_FEATURE_POWER4)
+ ? __llrintf_power4
+ : __llrintf_ppc32);
+weak_alias (__llrintf, llrintf)
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=42cd0fcdf457a5039e66dbc6662af4125fa74fcf
commit 42cd0fcdf457a5039e66dbc6662af4125fa74fcf
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Wed Jun 5 08:55:21 2013 -0500
PowerPC: change sysdeps fpu folder
This patch makes the fpu/multiarch folder appears in front of the
powerpc/fpu folder.
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/Implies
deleted file mode 100644
index 9f70f79..0000000
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/Implies
+++ /dev/null
@@ -1,2 +0,0 @@
-# Override ldbl-opt with powerpc32 specific routines.
-powerpc/powerpc32/fpu
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=f6f2830a4ebe1c1a85e6d729bf81aa8bd93f2e15
commit f6f2830a4ebe1c1a85e6d729bf81aa8bd93f2e15
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Wed Jun 5 08:54:43 2013 -0500
PowerPC: wordcopy multilib functions for PowerPC32
diff --git a/string/wordcopy.c b/string/wordcopy.c
index 726894b..51c1fad 100644
--- a/string/wordcopy.c
+++ b/string/wordcopy.c
@@ -26,11 +26,12 @@
block beginning at DSTP with LEN `op_t' words (not LEN bytes!).
Both SRCP and DSTP should be aligned for memory operations on `op_t's. */
+#ifndef WORDCOPY_FWD_ALIGNED
+# define WORDCOPY_FWD_ALIGNED _wordcopy_fwd_aligned
+#endif
+
void
-_wordcopy_fwd_aligned (dstp, srcp, len)
- long int dstp;
- long int srcp;
- size_t len;
+WORDCOPY_FWD_ALIGNED (long int dstp, long int srcp, size_t len)
{
op_t a0, a1;
@@ -134,11 +135,12 @@ _wordcopy_fwd_aligned (dstp, srcp, len)
DSTP should be aligned for memory operations on `op_t's, but SRCP must
*not* be aligned. */
+#ifndef WORDCOPY_FWD_DEST_ALIGNED
+# define WORDCOPY_FWD_DEST_ALIGNED _wordcopy_fwd_dest_aligned
+#endif
+
void
-_wordcopy_fwd_dest_aligned (dstp, srcp, len)
- long int dstp;
- long int srcp;
- size_t len;
+WORDCOPY_FWD_DEST_ALIGNED (long int dstp, long int srcp, size_t len)
{
op_t a0, a1, a2, a3;
int sh_1, sh_2;
@@ -221,11 +223,12 @@ _wordcopy_fwd_dest_aligned (dstp, srcp, len)
(not LEN bytes!). Both SRCP and DSTP should be aligned for memory
operations on `op_t's. */
+#ifndef WORDCOPY_BWD_ALIGNED
+# define WORDCOPY_BWD_ALIGNED _wordcopy_bwd_aligned
+#endif
+
void
-_wordcopy_bwd_aligned (dstp, srcp, len)
- long int dstp;
- long int srcp;
- size_t len;
+WORDCOPY_BWD_ALIGNED (long int dstp, long int srcp, size_t len)
{
op_t a0, a1;
@@ -329,11 +332,12 @@ _wordcopy_bwd_aligned (dstp, srcp, len)
words (not LEN bytes!). DSTP should be aligned for memory
operations on `op_t', but SRCP must *not* be aligned. */
+#ifndef WORDCOPY_BWD_DEST_ALIGNED
+# define WORDCOPY_BWD_DEST_ALIGNED _wordcopy_bwd_dest_aligned
+#endif
+
void
-_wordcopy_bwd_dest_aligned (dstp, srcp, len)
- long int dstp;
- long int srcp;
- size_t len;
+WORDCOPY_BWD_DEST_ALIGNED (long int dstp, long int srcp, size_t len)
{
op_t a0, a1, a2, a3;
int sh_1, sh_2;
diff --git a/sysdeps/powerpc/powerpc32/power4/wordcopy.c b/sysdeps/powerpc/power4/wordcopy.c
similarity index 87%
rename from sysdeps/powerpc/powerpc32/power4/wordcopy.c
rename to sysdeps/powerpc/power4/wordcopy.c
index 5d857f6..f4ba355 100644
--- a/sysdeps/powerpc/powerpc32/power4/wordcopy.c
+++ b/sysdeps/powerpc/power4/wordcopy.c
@@ -26,11 +26,12 @@
block beginning at DSTP with LEN `op_t' words (not LEN bytes!).
Both SRCP and DSTP should be aligned for memory operations on `op_t's. */
+#ifndef WORDCOPY_FWD_ALIGNED
+# define WORDCOPY_FWD_ALIGNED _wordcopy_fwd_aligned
+#endif
+
void
-_wordcopy_fwd_aligned (dstp, srcp, len)
- long int dstp;
- long int srcp;
- size_t len;
+WORDCOPY_FWD_ALIGNED (long int dstp, long int srcp, size_t len)
{
op_t a0, a1;
@@ -64,11 +65,12 @@ _wordcopy_fwd_aligned (dstp, srcp, len)
DSTP should be aligned for memory operations on `op_t's, but SRCP must
*not* be aligned. */
+#ifndef WORDCOPY_FWD_DEST_ALIGNED
+# define WORDCOPY_FWD_DEST_ALIGNED _wordcopy_fwd_dest_aligned
+#endif
+
void
-_wordcopy_fwd_dest_aligned (dstp, srcp, len)
- long int dstp;
- long int srcp;
- size_t len;
+WORDCOPY_FWD_DEST_ALIGNED (long int dstp, long int srcp, size_t len)
{
op_t a0, a1, a2;
int sh_1, sh_2;
@@ -118,11 +120,12 @@ _wordcopy_fwd_dest_aligned (dstp, srcp, len)
(not LEN bytes!). Both SRCP and DSTP should be aligned for memory
operations on `op_t's. */
+#ifndef WORDCOPY_BWD_ALIGNED
+# define WORDCOPY_BWD_ALIGNED _wordcopy_bwd_aligned
+#endif
+
void
-_wordcopy_bwd_aligned (dstp, srcp, len)
- long int dstp;
- long int srcp;
- size_t len;
+WORDCOPY_BWD_ALIGNED (long int dstp, long int srcp, size_t len)
{
op_t a0, a1;
@@ -157,11 +160,12 @@ _wordcopy_bwd_aligned (dstp, srcp, len)
words (not LEN bytes!). DSTP should be aligned for memory
operations on `op_t', but SRCP must *not* be aligned. */
+#ifndef WORDCOPY_BWD_DEST_ALIGNED
+# define WORDCOPY_BWD_DEST_ALIGNED _wordcopy_bwd_dest_aligned
+#endif
+
void
-_wordcopy_bwd_dest_aligned (dstp, srcp, len)
- long int dstp;
- long int srcp;
- size_t len;
+WORDCOPY_BWD_DEST_ALIGNED (long int dstp, long int srcp, size_t len)
{
op_t a0, a1, a2;
int sh_1, sh_2;
diff --git a/sysdeps/powerpc/powerpc32/power6/wordcopy.c b/sysdeps/powerpc/power6/wordcopy.c
similarity index 90%
rename from sysdeps/powerpc/powerpc32/power6/wordcopy.c
rename to sysdeps/powerpc/power6/wordcopy.c
index 4106e5c..a6add27 100644
--- a/sysdeps/powerpc/powerpc32/power6/wordcopy.c
+++ b/sysdeps/powerpc/power6/wordcopy.c
@@ -27,11 +27,12 @@
block beginning at DSTP with LEN `op_t' words (not LEN bytes!).
Both SRCP and DSTP should be aligned for memory operations on `op_t's. */
+#ifndef WORDCOPY_FWD_ALIGNED
+# define WORDCOPY_FWD_ALIGNED _wordcopy_fwd_aligned
+#endif
+
void
-_wordcopy_fwd_aligned (dstp, srcp, len)
- long int dstp;
- long int srcp;
- size_t len;
+WORDCOPY_FWD_ALIGNED (long int dstp, long int srcp, size_t len)
{
op_t a0, a1;
@@ -65,6 +66,10 @@ _wordcopy_fwd_aligned (dstp, srcp, len)
DSTP should be aligned for memory operations on `op_t's, but SRCP must
*not* be aligned. */
+#ifndef WORDCOPY_FWD_DEST_ALIGNED
+# define WORDCOPY_FWD_DEST_ALIGNED _wordcopy_fwd_dest_aligned
+#endif
+
#define fwd_align_merge(align) \
do \
{ \
@@ -80,10 +85,7 @@ _wordcopy_fwd_aligned (dstp, srcp, len)
while (len != 0)
void
-_wordcopy_fwd_dest_aligned (dstp, srcp, len)
- long int dstp;
- long int srcp;
- size_t len;
+WORDCOPY_FWD_DEST_ALIGNED (long int dstp, long int srcp, size_t len)
{
op_t a0, a1, a2;
int sh_1, sh_2;
@@ -124,11 +126,12 @@ _wordcopy_fwd_dest_aligned (dstp, srcp, len)
(not LEN bytes!). Both SRCP and DSTP should be aligned for memory
operations on `op_t's. */
+#ifndef WORDCOPY_BWD_ALIGNED
+# define WORDCOPY_BWD_ALIGNED _wordcopy_bwd_aligned
+#endif
+
void
-_wordcopy_bwd_aligned (dstp, srcp, len)
- long int dstp;
- long int srcp;
- size_t len;
+WORDCOPY_BWD_ALIGNED (long int dstp, long int srcp, size_t len)
{
op_t a0, a1;
@@ -158,6 +161,16 @@ _wordcopy_bwd_aligned (dstp, srcp, len)
while (len != 0);
}
+
+/* _wordcopy_bwd_dest_aligned -- Copy block finishing right
+ before SRCP to block finishing right before DSTP with LEN `op_t'
+ words (not LEN bytes!). DSTP should be aligned for memory
+ operations on `op_t', but SRCP must *not* be aligned. */
+
+#ifndef WORDCOPY_BWD_DEST_ALIGNED
+# define WORDCOPY_BWD_DEST_ALIGNED _wordcopy_bwd_dest_aligned
+#endif
+
#define bwd_align_merge(align) \
do \
{ \
@@ -172,16 +185,8 @@ _wordcopy_bwd_aligned (dstp, srcp, len)
} \
while (len != 0)
-/* _wordcopy_bwd_dest_aligned -- Copy block finishing right
- before SRCP to block finishing right before DSTP with LEN `op_t'
- words (not LEN bytes!). DSTP should be aligned for memory
- operations on `op_t', but SRCP must *not* be aligned. */
-
void
-_wordcopy_bwd_dest_aligned (dstp, srcp, len)
- long int dstp;
- long int srcp;
- size_t len;
+WORDCOPY_BWD_DEST_ALIGNED (long int dstp, long int srcp, size_t len)
{
op_t a0, a1, a2;
int sh_1, sh_2;
diff --git a/sysdeps/powerpc/powerpc32/multiarch/Makefile b/sysdeps/powerpc/powerpc32/multiarch/Makefile
index 3c6d09e..57994be 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/multiarch/Makefile
@@ -10,7 +10,9 @@ sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
strncase-power7 strncase_l-power7 strchrnul-power7 \
strchrnul-ppc32 strchr-power7 strchr-ppc32 wcschr-power7 \
wcschr-power6 wcschr-ppc32 wcsrchr-power7 wcsrchr-power6 \
- wcsrchr-ppc32
+ wcsrchr-ppc32 wcscpy-power7 wcscpy-power6 wcscpy-ppc32 \
+ wordcopy-power7 wordcopy-power6 wordcopy-power5 \
+ wordcopy-power4 wordcopy-ppc32
CFLAGS-strncase-power7.c += -mcpu=power7 -funroll-loops
CFLAGS-strncase_l-power7.c += -mcpu=power7 -funroll-loops
@@ -18,4 +20,6 @@ CFLAGS-wcschr-power7.c += -mcpu=power7
CFLAGS-wcschr-power6.c += -mcpu=power6
CFLAGS-wcsrchr-power7.c += -mcpu=power7
CFLAGS-wcsrchr-power6.c += -mcpu=power6
+CFLAGS-wcscpy-power7.c += -mcpu=power7
+CFLAGS-wcscpy-power6.c += -mcpu=power6
endif
diff --git a/sysdeps/powerpc/powerpc32/multiarch/wordcopy-power4.c b/sysdeps/powerpc/powerpc32/multiarch/wordcopy-power4.c
new file mode 100644
index 0000000..866f549
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/wordcopy-power4.c
@@ -0,0 +1,23 @@
+/* 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/>. */
+
+#define WORDCOPY_FWD_ALIGNED _wordcopy_fwd_aligned_power4
+#define WORDCOPY_FWD_DEST_ALIGNED _wordcopy_fwd_dest_aligned_power4
+#define WORDCOPY_BWD_ALIGNED _wordcopy_bwd_aligned_power4
+#define WORDCOPY_BWD_DEST_ALIGNED _wordcopy_bwd_dest_aligned_power4
+
+#include <sysdeps/powerpc/power4/wordcopy.c>
diff --git a/sysdeps/powerpc/powerpc32/multiarch/wordcopy-power5.c b/sysdeps/powerpc/powerpc32/multiarch/wordcopy-power5.c
new file mode 100644
index 0000000..7652180
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/wordcopy-power5.c
@@ -0,0 +1,23 @@
+/* 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/>. */
+
+#define WORDCOPY_FWD_ALIGNED _wordcopy_fwd_aligned_power5
+#define WORDCOPY_FWD_DEST_ALIGNED _wordcopy_fwd_dest_aligned_power5
+#define WORDCOPY_BWD_ALIGNED _wordcopy_bwd_aligned_power5
+#define WORDCOPY_BWD_DEST_ALIGNED _wordcopy_bwd_dest_aligned_power5
+
+#include <sysdeps/powerpc/power4/wordcopy.c>
diff --git a/sysdeps/powerpc/powerpc32/multiarch/wordcopy-power6.c b/sysdeps/powerpc/powerpc32/multiarch/wordcopy-power6.c
new file mode 100644
index 0000000..b8edd10
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/wordcopy-power6.c
@@ -0,0 +1,23 @@
+/* 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/>. */
+
+#define WORDCOPY_FWD_ALIGNED _wordcopy_fwd_aligned_power6
+#define WORDCOPY_FWD_DEST_ALIGNED _wordcopy_fwd_dest_aligned_power6
+#define WORDCOPY_BWD_ALIGNED _wordcopy_bwd_aligned_power6
+#define WORDCOPY_BWD_DEST_ALIGNED _wordcopy_bwd_dest_aligned_power6
+
+#include <sysdeps/powerpc/power6/wordcopy.c>
diff --git a/sysdeps/powerpc/powerpc32/multiarch/wordcopy-power7.c b/sysdeps/powerpc/powerpc32/multiarch/wordcopy-power7.c
new file mode 100644
index 0000000..e7999c3
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/wordcopy-power7.c
@@ -0,0 +1,23 @@
+/* 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/>. */
+
+#define WORDCOPY_FWD_ALIGNED _wordcopy_fwd_aligned_power7
+#define WORDCOPY_FWD_DEST_ALIGNED _wordcopy_fwd_dest_aligned_power7
+#define WORDCOPY_BWD_ALIGNED _wordcopy_bwd_aligned_power7
+#define WORDCOPY_BWD_DEST_ALIGNED _wordcopy_bwd_dest_aligned_power7
+
+#include <sysdeps/powerpc/power6/wordcopy.c>
diff --git a/sysdeps/powerpc/powerpc32/multiarch/wordcopy-ppc32.c b/sysdeps/powerpc/powerpc32/multiarch/wordcopy-ppc32.c
new file mode 100644
index 0000000..3e8c471
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/wordcopy-ppc32.c
@@ -0,0 +1,23 @@
+/* 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/>. */
+
+#define WORDCOPY_FWD_ALIGNED _wordcopy_fwd_aligned_ppc32
+#define WORDCOPY_FWD_DEST_ALIGNED _wordcopy_fwd_dest_aligned_ppc32
+#define WORDCOPY_BWD_ALIGNED _wordcopy_bwd_aligned_ppc32
+#define WORDCOPY_BWD_DEST_ALIGNED _wordcopy_bwd_dest_aligned_ppc32
+
+#include <string/wordcopy.c>
diff --git a/sysdeps/powerpc/powerpc32/multiarch/wordcopy.c b/sysdeps/powerpc/powerpc32/multiarch/wordcopy.c
new file mode 100644
index 0000000..5723766
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/wordcopy.c
@@ -0,0 +1,118 @@
+/* Multiple versions of wordcopy functions.
+ 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/>. */
+
+#ifndef NOT_IN_libc
+# include <stddef.h>
+# include <memcopy.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+extern __typeof (_wordcopy_fwd_aligned) _wordcopy_fwd_aligned_ppc32
+attribute_hidden;
+extern __typeof (_wordcopy_fwd_aligned) _wordcopy_fwd_aligned_power4
+attribute_hidden;
+extern __typeof (_wordcopy_fwd_aligned) _wordcopy_fwd_aligned_power5
+attribute_hidden;
+extern __typeof (_wordcopy_fwd_aligned) _wordcopy_fwd_aligned_power6
+attribute_hidden;
+extern __typeof (_wordcopy_fwd_aligned) _wordcopy_fwd_aligned_power7
+attribute_hidden;
+
+libc_ifunc (_wordcopy_fwd_aligned,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? _wordcopy_fwd_aligned_power7 :
+ (hwcap & PPC_FEATURE_ARCH_2_05)
+ ? _wordcopy_fwd_aligned_power6 :
+ (hwcap & PPC_FEATURE_POWER5)
+ ? _wordcopy_fwd_aligned_power5 :
+ (hwcap & PPC_FEATURE_POWER4)
+ ? _wordcopy_fwd_aligned_power4
+ : _wordcopy_fwd_aligned_ppc32);
+
+
+extern __typeof (_wordcopy_fwd_dest_aligned) _wordcopy_fwd_dest_aligned_ppc32
+attribute_hidden;
+extern __typeof (_wordcopy_fwd_dest_aligned) _wordcopy_fwd_dest_aligned_power4
+attribute_hidden;
+extern __typeof (_wordcopy_fwd_dest_aligned) _wordcopy_fwd_dest_aligned_power5
+attribute_hidden;
+extern __typeof (_wordcopy_fwd_dest_aligned) _wordcopy_fwd_dest_aligned_power6
+attribute_hidden;
+extern __typeof (_wordcopy_fwd_dest_aligned) _wordcopy_fwd_dest_aligned_power7
+attribute_hidden;
+
+libc_ifunc (_wordcopy_fwd_dest_aligned,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? _wordcopy_fwd_dest_aligned_power7 :
+ (hwcap & PPC_FEATURE_ARCH_2_05)
+ ? _wordcopy_fwd_dest_aligned_power6 :
+ (hwcap & PPC_FEATURE_POWER5)
+ ? _wordcopy_fwd_dest_aligned_power5 :
+ (hwcap & PPC_FEATURE_POWER4)
+ ? _wordcopy_fwd_dest_aligned_power4
+ : _wordcopy_fwd_dest_aligned_ppc32);
+
+
+extern __typeof (_wordcopy_bwd_aligned) _wordcopy_bwd_aligned_ppc32
+attribute_hidden;
+extern __typeof (_wordcopy_bwd_aligned) _wordcopy_bwd_aligned_power4
+attribute_hidden;
+extern __typeof (_wordcopy_bwd_aligned) _wordcopy_bwd_aligned_power5
+attribute_hidden;
+extern __typeof (_wordcopy_bwd_aligned) _wordcopy_bwd_aligned_power6
+attribute_hidden;
+extern __typeof (_wordcopy_bwd_aligned) _wordcopy_bwd_aligned_power7
+attribute_hidden;
+
+libc_ifunc (_wordcopy_bwd_aligned,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? _wordcopy_bwd_aligned_power7 :
+ (hwcap & PPC_FEATURE_ARCH_2_05)
+ ? _wordcopy_bwd_aligned_power6 :
+ (hwcap & PPC_FEATURE_POWER5)
+ ? _wordcopy_bwd_aligned_power5 :
+ (hwcap & PPC_FEATURE_POWER4)
+ ? _wordcopy_bwd_aligned_power4
+ : _wordcopy_bwd_aligned_ppc32);
+
+
+extern __typeof (_wordcopy_bwd_dest_aligned) _wordcopy_bwd_dest_aligned_ppc32
+attribute_hidden;
+extern __typeof (_wordcopy_bwd_dest_aligned) _wordcopy_bwd_dest_aligned_power4
+attribute_hidden;
+extern __typeof (_wordcopy_bwd_dest_aligned) _wordcopy_bwd_dest_aligned_power5
+attribute_hidden;
+extern __typeof (_wordcopy_bwd_dest_aligned) _wordcopy_bwd_dest_aligned_power6
+attribute_hidden;
+extern __typeof (_wordcopy_bwd_dest_aligned) _wordcopy_bwd_dest_aligned_power7
+attribute_hidden;
+
+libc_ifunc (_wordcopy_bwd_dest_aligned,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? _wordcopy_bwd_dest_aligned_power7 :
+ (hwcap & PPC_FEATURE_ARCH_2_05)
+ ? _wordcopy_bwd_dest_aligned_power6 :
+ (hwcap & PPC_FEATURE_POWER5)
+ ? _wordcopy_bwd_dest_aligned_power5 :
+ (hwcap & PPC_FEATURE_POWER4)
+ ? _wordcopy_bwd_dest_aligned_power4
+ : _wordcopy_bwd_dest_aligned_ppc32);
+
+#else
+#include <string/wordcopy.c>
+#endif
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=8fc9141c7dd81dd416d6ec3c338f81de0395aa34
commit 8fc9141c7dd81dd416d6ec3c338f81de0395aa34
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Wed Jun 5 08:48:51 2013 -0500
PowerPC: wcscpy multilib for PowerPC32
diff --git a/sysdeps/powerpc/powerpc32/power6/wcscpy.c b/sysdeps/powerpc/power6/wcscpy.c
similarity index 96%
rename from sysdeps/powerpc/powerpc32/power6/wcscpy.c
rename to sysdeps/powerpc/power6/wcscpy.c
index 5950ef3..fccb19e 100644
--- a/sysdeps/powerpc/powerpc32/power6/wcscpy.c
+++ b/sysdeps/powerpc/power6/wcscpy.c
@@ -19,12 +19,13 @@
#include <stddef.h>
#include <wchar.h>
+#ifndef WCSCPY
+# define WCSCPY wcscpy
+#endif
/* Copy SRC to DEST. */
wchar_t *
-wcscpy (dest, src)
- wchar_t *dest;
- const wchar_t *src;
+WCSCPY (wchar_t *dest, const wchar_t *src)
{
wint_t c,d;
wchar_t *wcp, *wcp2;
diff --git a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
index b5ddd5c..3f41762 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
@@ -146,6 +146,17 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
IFUNC_IMPL_ADD (array, i, wcsrchr, 1,
__wcsrchr_ppc32))
+ /* Support sysdeps/powerpc/powerpc32/multiarch/wcscpy.c. */
+ IFUNC_IMPL (i, name, wcscpy,
+ IFUNC_IMPL_ADD (array, i, wcscpy,
+ hwcap & PPC_FEATURE_HAS_VSX,
+ __wcscpy_power7)
+ IFUNC_IMPL_ADD (array, i, wcscpy,
+ hwcap & PPC_FEATURE_ARCH_2_05,
+ __wcscpy_power6)
+ IFUNC_IMPL_ADD (array, i, wcscpy, 1,
+ __wcscpy_ppc32))
+
#ifdef SHARED
/* Support sysdeps/powerpc/powerpc32/multiarch/memset.c. */
IFUNC_IMPL (i, name, memset,
diff --git a/sysdeps/powerpc/powerpc32/multiarch/wcscpy-power6.c b/sysdeps/powerpc/powerpc32/multiarch/wcscpy-power6.c
new file mode 100644
index 0000000..33f9b2c
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/wcscpy-power6.c
@@ -0,0 +1,20 @@
+/* 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/>. */
+
+#define WCSCPY __wcscpy_power6
+
+#include <sysdeps/powerpc/power6/wcscpy.c>
diff --git a/sysdeps/powerpc/powerpc32/multiarch/wcscpy-power7.c b/sysdeps/powerpc/powerpc32/multiarch/wcscpy-power7.c
new file mode 100644
index 0000000..2dbec11
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/wcscpy-power7.c
@@ -0,0 +1,20 @@
+/* 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/>. */
+
+#define WCSCPY __wcscpy_power7
+
+#include <sysdeps/powerpc/power6/wcscpy.c>
diff --git a/wcsmbs/wcscpy.c b/sysdeps/powerpc/powerpc32/multiarch/wcscpy-ppc32.c
similarity index 55%
copy from wcsmbs/wcscpy.c
copy to sysdeps/powerpc/powerpc32/multiarch/wcscpy-ppc32.c
index 3b1e0c6..c56b519 100644
--- a/wcsmbs/wcscpy.c
+++ b/sysdeps/powerpc/powerpc32/multiarch/wcscpy-ppc32.c
@@ -1,6 +1,5 @@
-/* Copyright (C) 1995-2013 Free Software Foundation, Inc.
+/* Copyright (C) 2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -16,43 +15,12 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <stddef.h>
#include <wchar.h>
+#ifndef NOT_IN_libc
+# define WCSCPY __wcscpy_ppc32
+#endif
-/* Copy SRC to DEST. */
-wchar_t *
-wcscpy (dest, src)
- wchar_t *dest;
- const wchar_t *src;
-{
- wint_t c;
- wchar_t *wcp;
+extern __typeof (wcscpy) __wcscpy_ppc32;
- if (__alignof__ (wchar_t) >= sizeof (wchar_t))
- {
- const ptrdiff_t off = dest - src - 1;
-
- wcp = (wchar_t *) src;
-
- do
- {
- c = *wcp++;
- wcp[off] = c;
- }
- while (c != L'\0');
- }
- else
- {
- wcp = dest;
-
- do
- {
- c = *src++;
- *wcp++ = c;
- }
- while (c != L'\0');
- }
-
- return dest;
-}
+#include <wcsmbs/wcscpy.c>
diff --git a/wcsmbs/wcscpy.c b/sysdeps/powerpc/powerpc32/multiarch/wcscpy.c
similarity index 53%
copy from wcsmbs/wcscpy.c
copy to sysdeps/powerpc/powerpc32/multiarch/wcscpy.c
index 3b1e0c6..9e41688 100644
--- a/wcsmbs/wcscpy.c
+++ b/sysdeps/powerpc/powerpc32/multiarch/wcscpy.c
@@ -1,6 +1,6 @@
-/* Copyright (C) 1995-2013 Free Software Foundation, Inc.
+/* Multiple versions of wcscpy
+ Copyright (C) 2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -16,43 +16,21 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <stddef.h>
-#include <wchar.h>
-
-
-/* Copy SRC to DEST. */
-wchar_t *
-wcscpy (dest, src)
- wchar_t *dest;
- const wchar_t *src;
-{
- wint_t c;
- wchar_t *wcp;
-
- if (__alignof__ (wchar_t) >= sizeof (wchar_t))
- {
- const ptrdiff_t off = dest - src - 1;
-
- wcp = (wchar_t *) src;
-
- do
- {
- c = *wcp++;
- wcp[off] = c;
- }
- while (c != L'\0');
- }
- else
- {
- wcp = dest;
-
- do
- {
- c = *src++;
- *wcp++ = c;
- }
- while (c != L'\0');
- }
-
- return dest;
-}
+#ifndef NOT_IN_libc
+# include <wchar.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+extern __typeof (wcscpy) __wcscpy_ppc32 attribute_hidden;
+extern __typeof (wcscpy) __wcscpy_power6 attribute_hidden;
+extern __typeof (wcscpy) __wcscpy_power7 attribute_hidden;
+
+libc_ifunc (wcscpy,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __wcscpy_power7 :
+ (hwcap & PPC_FEATURE_ARCH_2_05)
+ ? __wcscpy_power6
+ : __wcscpy_ppc32);
+#else
+#include <wcsmbs/wcscpy.c>
+#endif
diff --git a/sysdeps/powerpc/powerpc64/power6/wcscpy.c b/sysdeps/powerpc/powerpc64/power6/wcscpy.c
index 57b706a..722c8f9 100644
--- a/sysdeps/powerpc/powerpc64/power6/wcscpy.c
+++ b/sysdeps/powerpc/powerpc64/power6/wcscpy.c
@@ -1 +1 @@
-#include "../../powerpc32/power6/wcscpy.c"
+#include <sysdeps/powerpc/power6/wcscpy.c>
diff --git a/wcsmbs/wcscpy.c b/wcsmbs/wcscpy.c
index 3b1e0c6..8ee2ed3 100644
--- a/wcsmbs/wcscpy.c
+++ b/wcsmbs/wcscpy.c
@@ -21,8 +21,12 @@
/* Copy SRC to DEST. */
+#ifndef WCSCPY
+# define WCSCPY wcscpy
+#endif
+
wchar_t *
-wcscpy (dest, src)
+WCSCPY (dest, src)
wchar_t *dest;
const wchar_t *src;
{
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=86cb8df8df606a161046b9b923d1430159bdfbe4
commit 86cb8df8df606a161046b9b923d1430159bdfbe4
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Wed Jun 5 08:46:32 2013 -0500
PowerPC: wcsrchr multilib for PowerPC32
diff --git a/sysdeps/powerpc/power6/wcschr.c b/sysdeps/powerpc/power6/wcschr.c
new file mode 100644
index 0000000..7d8b5bd
--- /dev/null
+++ b/sysdeps/powerpc/power6/wcschr.c
@@ -0,0 +1,89 @@
+/* wcschr.c - Wide Character Search for powerpc32/power6.
+ Copyright (C) 2012-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; see the file COPYING.LIB. If
+ not, see <http://www.gnu.org/licenses/>. */
+
+#include <wchar.h>
+
+#ifndef WCSCHR
+# define WCSCHR wcschr
+#endif
+
+/* Find the first occurrence of WC in WCS. */
+wchar_t *
+WCSCHR (register const wchar_t *wcs, register const wchar_t wc)
+{
+ register const wchar_t *wcs2 = wcs + 1;
+
+ if (*wcs == wc)
+ return (wchar_t *) wcs;
+ if (*wcs == L'\0')
+ return NULL;
+
+ do
+ {
+ wcs += 2;
+
+ if (*wcs2 == wc)
+ return (wchar_t *) wcs2;
+ if (*wcs2 == L'\0')
+ return NULL;
+ wcs2 += 2;
+
+ if (*wcs == wc)
+ return (wchar_t *) wcs;
+ if (*wcs == L'\0')
+ return NULL;
+ wcs += 2;
+
+ if (*wcs2 == wc)
+ return (wchar_t *) wcs2;
+ if (*wcs2 == L'\0')
+ return NULL;
+ wcs2 += 2;
+
+ if (*wcs == wc)
+ return (wchar_t *) wcs;
+ if (*wcs == L'\0')
+ return NULL;
+ wcs += 2;
+
+ if (*wcs2 == wc)
+ return (wchar_t *) wcs2;
+ if (*wcs2 == L'\0')
+ return NULL;
+ wcs2 += 2;
+
+ if (*wcs == wc)
+ return (wchar_t *) wcs;
+ if (*wcs == L'\0')
+ return NULL;
+ wcs += 2;
+
+ if (*wcs2 == wc)
+ return (wchar_t *) wcs2;
+ if (*wcs2 == L'\0')
+ return NULL;
+ wcs2 += 2;
+
+ if (*wcs == wc)
+ return (wchar_t *) wcs;
+ }
+ while (*wcs != L'\0');
+
+ return NULL;
+}
+libc_hidden_def (wcschr)
diff --git a/sysdeps/powerpc/powerpc32/power6/wcsrchr.c b/sysdeps/powerpc/power6/wcsrchr.c
similarity index 95%
rename from sysdeps/powerpc/powerpc32/power6/wcsrchr.c
rename to sysdeps/powerpc/power6/wcsrchr.c
index 8d26af0..a738cc2 100644
--- a/sysdeps/powerpc/powerpc32/power6/wcsrchr.c
+++ b/sysdeps/powerpc/power6/wcsrchr.c
@@ -18,12 +18,13 @@
#include <wchar.h>
+#ifndef WCSRCHR
+# define WCSRCHR wcsrchr
+#endif
/* Find the last occurrence of WC in WCS. */
wchar_t *
-wcsrchr (wcs, wc)
- const wchar_t *wcs;
- const wchar_t wc;
+WCSRCHR (const wchar_t *wcs, const wchar_t wc)
{
const wchar_t *wcs2 = wcs + 1;
const wchar_t *retval = NULL;
diff --git a/sysdeps/powerpc/powerpc32/multiarch/Makefile b/sysdeps/powerpc/powerpc32/multiarch/Makefile
index 83b26a5..3c6d09e 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/multiarch/Makefile
@@ -8,8 +8,14 @@ sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
strnlen-power7 strnlen-ppc32 strncmp-power7 strncmp-power4 \
strncmp-ppc32 strcasecmp-power7 strcasecmp_l-power7 \
strncase-power7 strncase_l-power7 strchrnul-power7 \
- strchrnul-ppc32 strchr-power7 strchr-ppc32
+ strchrnul-ppc32 strchr-power7 strchr-ppc32 wcschr-power7 \
+ wcschr-power6 wcschr-ppc32 wcsrchr-power7 wcsrchr-power6 \
+ wcsrchr-ppc32
CFLAGS-strncase-power7.c += -mcpu=power7 -funroll-loops
CFLAGS-strncase_l-power7.c += -mcpu=power7 -funroll-loops
+CFLAGS-wcschr-power7.c += -mcpu=power7
+CFLAGS-wcschr-power6.c += -mcpu=power6
+CFLAGS-wcsrchr-power7.c += -mcpu=power7
+CFLAGS-wcsrchr-power6.c += -mcpu=power6
endif
diff --git a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
index e8f2c30..b5ddd5c 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
@@ -135,6 +135,17 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
IFUNC_IMPL_ADD (array, i, wcschr, 1,
__wcschr_ppc32))
+ /* Support sysdeps/powerpc/powerpc32/multiarch/wcsrchr.c. */
+ IFUNC_IMPL (i, name, wcsrchr,
+ IFUNC_IMPL_ADD (array, i, wcsrchr,
+ hwcap & PPC_FEATURE_HAS_VSX,
+ __wcsrchr_power7)
+ IFUNC_IMPL_ADD (array, i, wcsrchr,
+ hwcap & PPC_FEATURE_ARCH_2_05,
+ __wcsrchr_power6)
+ IFUNC_IMPL_ADD (array, i, wcsrchr, 1,
+ __wcsrchr_ppc32))
+
#ifdef SHARED
/* Support sysdeps/powerpc/powerpc32/multiarch/memset.c. */
IFUNC_IMPL (i, name, memset,
diff --git a/wcsmbs/wcsrchr.c b/sysdeps/powerpc/powerpc32/multiarch/wcsrchr-power6.c
similarity index 64%
copy from wcsmbs/wcsrchr.c
copy to sysdeps/powerpc/powerpc32/multiarch/wcsrchr-power6.c
index e30b851..68fe477 100644
--- a/wcsmbs/wcsrchr.c
+++ b/sysdeps/powerpc/powerpc32/multiarch/wcsrchr-power6.c
@@ -1,6 +1,5 @@
-/* Copyright (C) 1995-2013 Free Software Foundation, Inc.
+/* Copyright (C) 2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -16,21 +15,6 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <wchar.h>
+#define WCSRCHR __wcsrchr_power6
-
-/* Find the last occurrence of WC in WCS. */
-wchar_t *
-wcsrchr (wcs, wc)
- const wchar_t *wcs;
- const wchar_t wc;
-{
- const wchar_t *retval = NULL;
-
- do
- if (*wcs == wc)
- retval = wcs;
- while (*wcs++ != L'\0');
-
- return (wchar_t *) retval;
-}
+#include <sysdeps/powerpc/power6/wcsrchr.c>
diff --git a/wcsmbs/wcsrchr.c b/sysdeps/powerpc/powerpc32/multiarch/wcsrchr-power7.c
similarity index 64%
copy from wcsmbs/wcsrchr.c
copy to sysdeps/powerpc/powerpc32/multiarch/wcsrchr-power7.c
index e30b851..3422816 100644
--- a/wcsmbs/wcsrchr.c
+++ b/sysdeps/powerpc/powerpc32/multiarch/wcsrchr-power7.c
@@ -1,6 +1,5 @@
-/* Copyright (C) 1995-2013 Free Software Foundation, Inc.
+/* Copyright (C) 2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -16,21 +15,6 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <wchar.h>
+#define WCSRCHR __wcsrchr_power7
-
-/* Find the last occurrence of WC in WCS. */
-wchar_t *
-wcsrchr (wcs, wc)
- const wchar_t *wcs;
- const wchar_t wc;
-{
- const wchar_t *retval = NULL;
-
- do
- if (*wcs == wc)
- retval = wcs;
- while (*wcs++ != L'\0');
-
- return (wchar_t *) retval;
-}
+#include <sysdeps/powerpc/power6/wcsrchr.c>
diff --git a/wcsmbs/wcsrchr.c b/sysdeps/powerpc/powerpc32/multiarch/wcsrchr-ppc32.c
similarity index 66%
copy from wcsmbs/wcsrchr.c
copy to sysdeps/powerpc/powerpc32/multiarch/wcsrchr-ppc32.c
index e30b851..f1ef823 100644
--- a/wcsmbs/wcsrchr.c
+++ b/sysdeps/powerpc/powerpc32/multiarch/wcsrchr-ppc32.c
@@ -1,6 +1,5 @@
-/* Copyright (C) 1995-2013 Free Software Foundation, Inc.
+/* Copyright (C) 2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -18,19 +17,10 @@
#include <wchar.h>
+#ifndef NOT_IN_libc
+# define WCSRCHR __wcsrchr_ppc32
+#endif
-/* Find the last occurrence of WC in WCS. */
-wchar_t *
-wcsrchr (wcs, wc)
- const wchar_t *wcs;
- const wchar_t wc;
-{
- const wchar_t *retval = NULL;
+extern __typeof (wcsrchr) __wcsrchr_ppc32;
- do
- if (*wcs == wc)
- retval = wcs;
- while (*wcs++ != L'\0');
-
- return (wchar_t *) retval;
-}
+#include <wcsmbs/wcsrchr.c>
diff --git a/wcsmbs/wcsrchr.c b/sysdeps/powerpc/powerpc32/multiarch/wcsrchr.c
similarity index 55%
copy from wcsmbs/wcsrchr.c
copy to sysdeps/powerpc/powerpc32/multiarch/wcsrchr.c
index e30b851..dff3a5d 100644
--- a/wcsmbs/wcsrchr.c
+++ b/sysdeps/powerpc/powerpc32/multiarch/wcsrchr.c
@@ -1,6 +1,6 @@
-/* Copyright (C) 1995-2013 Free Software Foundation, Inc.
+/* Multiple versions of wcsrchr
+ Copyright (C) 2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -16,21 +16,21 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <wchar.h>
-
-
-/* Find the last occurrence of WC in WCS. */
-wchar_t *
-wcsrchr (wcs, wc)
- const wchar_t *wcs;
- const wchar_t wc;
-{
- const wchar_t *retval = NULL;
-
- do
- if (*wcs == wc)
- retval = wcs;
- while (*wcs++ != L'\0');
-
- return (wchar_t *) retval;
-}
+#ifndef NOT_IN_libc
+# include <wchar.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+extern __typeof (wcsrchr) __wcsrchr_ppc32 attribute_hidden;
+extern __typeof (wcsrchr) __wcsrchr_power6 attribute_hidden;
+extern __typeof (wcsrchr) __wcsrchr_power7 attribute_hidden;
+
+libc_ifunc (wcsrchr,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __wcsrchr_power7 :
+ (hwcap & PPC_FEATURE_ARCH_2_05)
+ ? __wcsrchr_power6
+ : __wcsrchr_ppc32);
+#else
+#include <wcsmbs/wcsrchr.c>
+#endif
diff --git a/sysdeps/powerpc/powerpc64/power6/wcsrchr.c b/sysdeps/powerpc/powerpc64/power6/wcsrchr.c
index 2327c05..b86472d 100644
--- a/sysdeps/powerpc/powerpc64/power6/wcsrchr.c
+++ b/sysdeps/powerpc/powerpc64/power6/wcsrchr.c
@@ -1 +1 @@
-#include "../../powerpc32/power6/wcsrchr.c"
+#include <sysdeps/powerpc/power6/wcsrchr.c>
diff --git a/wcsmbs/wcsrchr.c b/wcsmbs/wcsrchr.c
index e30b851..5b7ca49 100644
--- a/wcsmbs/wcsrchr.c
+++ b/wcsmbs/wcsrchr.c
@@ -20,8 +20,12 @@
/* Find the last occurrence of WC in WCS. */
+#ifndef WCSRCHR
+# define WCSRCHR wcsrchr
+#endif
+
wchar_t *
-wcsrchr (wcs, wc)
+WCSRCHR (wcs, wc)
const wchar_t *wcs;
const wchar_t wc;
{
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=4efc2b6a01a967c8b5d90277a91a958967bffaf1
commit 4efc2b6a01a967c8b5d90277a91a958967bffaf1
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Wed Jun 5 08:43:28 2013 -0500
PowerPC: wcschr multilib for PowerPC32
diff --git a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
index 35d6c7c..e8f2c30 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
@@ -124,6 +124,16 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
__strchr_power7)
IFUNC_IMPL_ADD (array, i, strchr, 1,
__strchr_ppc32))
+ /* Support sysdeps/powerpc/powerpc32/multiarch/wcschr.c. */
+ IFUNC_IMPL (i, name, wcschr,
+ IFUNC_IMPL_ADD (array, i, wcschr,
+ hwcap & PPC_FEATURE_HAS_VSX,
+ __wcschr_power7)
+ IFUNC_IMPL_ADD (array, i, wcschr,
+ hwcap & PPC_FEATURE_ARCH_2_05,
+ __wcschr_power6)
+ IFUNC_IMPL_ADD (array, i, wcschr, 1,
+ __wcschr_ppc32))
#ifdef SHARED
/* Support sysdeps/powerpc/powerpc32/multiarch/memset.c. */
diff --git a/sysdeps/powerpc/powerpc32/multiarch/wcschr-power6.c b/sysdeps/powerpc/powerpc32/multiarch/wcschr-power6.c
new file mode 100644
index 0000000..54d9972
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/wcschr-power6.c
@@ -0,0 +1,26 @@
+/* wcschr.c - Wide Character Search for powerpc32/power6.
+ 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; see the file COPYING.LIB. If
+ not, see <http://www.gnu.org/licenses/>. */
+
+#include <wchar.h>
+
+#define WCSCHR __wcschr_power6
+
+#undef libc_hidden_def
+#define libc_hidden_def(name)
+
+#include <sysdeps/powerpc/power6/wcschr.c>
diff --git a/sysdeps/powerpc/powerpc32/multiarch/wcschr-power7.c b/sysdeps/powerpc/powerpc32/multiarch/wcschr-power7.c
new file mode 100644
index 0000000..d7d8469
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/wcschr-power7.c
@@ -0,0 +1,26 @@
+/* wcschr.c - Wide Character Search for powerpc32/power7.
+ 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; see the file COPYING.LIB. If
+ not, see <http://www.gnu.org/licenses/>. */
+
+#include <wchar.h>
+
+#define WCSCHR __wcschr_power7
+
+#undef libc_hidden_def
+#define libc_hidden_def(name)
+
+#include <sysdeps/powerpc/power6/wcschr.c>
diff --git a/sysdeps/powerpc/powerpc32/multiarch/wcschr-ppc32.c b/sysdeps/powerpc/powerpc32/multiarch/wcschr-ppc32.c
new file mode 100644
index 0000000..5afc124
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/wcschr-ppc32.c
@@ -0,0 +1,31 @@
+/* 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 <wchar.h>
+
+#ifndef NOT_IN_libc
+# ifdef SHARED
+# undef libc_hidden_def
+# define libc_hidden_def(name) \
+ __hidden_ver1 (__wcschr_ppc32, __GI_wcschr, __wcschr_ppc32);
+# endif
+# define WCSCHR __wcschr_ppc32
+#endif
+
+extern __typeof (wcschr) __wcschr_ppc32;
+
+#include <wcsmbs/wcschr.c>
diff --git a/sysdeps/powerpc/powerpc32/multiarch/wcschr.c b/sysdeps/powerpc/powerpc32/multiarch/wcschr.c
new file mode 100644
index 0000000..a4718a5
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/wcschr.c
@@ -0,0 +1,38 @@
+/* Multiple versions of wcschr
+ 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/>. */
+
+#ifndef NOT_IN_libc
+# include <wchar.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+extern __typeof (wcschr) __wcschr_ppc32 attribute_hidden;
+extern __typeof (wcschr) __wcschr_power6 attribute_hidden;
+extern __typeof (wcschr) __wcschr_power7 attribute_hidden;
+
+libc_ifunc (wcschr,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __wcschr_power7 :
+ (hwcap & PPC_FEATURE_ARCH_2_05)
+ ? __wcschr_power6
+ : __wcschr_ppc32);
+#else
+#undef libc_hidden_def
+#define libc_hidden_def(a)
+#include <wcsmbs/wcschr.c>
+#endif
diff --git a/sysdeps/powerpc/powerpc32/power6/wcschr.c b/sysdeps/powerpc/powerpc32/power6/wcschr.c
deleted file mode 100644
index 1ba64e1..0000000
--- a/sysdeps/powerpc/powerpc32/power6/wcschr.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/* wcschr.c - Wide Character Search for powerpc32/power6.
- Copyright (C) 2012-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; see the file COPYING.LIB. If
- not, see <http://www.gnu.org/licenses/>. */
-
-#include <wchar.h>
-
-
-/* Find the first occurrence of WC in WCS. */
-wchar_t *
-wcschr (wcs, wc)
- const wchar_t *wcs;
- const wchar_t wc;
-{
- const wchar_t *wcs2 = wcs + 1;
-
- if (*wcs == wc)
- return (wchar_t *) wcs;
- if (*wcs == L'\0')
- return NULL;
-
- do
- {
- wcs += 2;
-
- if (*wcs2 == wc)
- return (wchar_t *) wcs2;
- if (*wcs2 == L'\0')
- return NULL;
- wcs2 += 2;
-
- if (*wcs == wc)
- return (wchar_t *) wcs;
- if (*wcs == L'\0')
- return NULL;
- wcs += 2;
-
- if (*wcs2 == wc)
- return (wchar_t *) wcs2;
- if (*wcs2 == L'\0')
- return NULL;
- wcs2 += 2;
-
- if (*wcs == wc)
- return (wchar_t *) wcs;
- if (*wcs == L'\0')
- return NULL;
- wcs += 2;
-
- if (*wcs2 == wc)
- return (wchar_t *) wcs2;
- if (*wcs2 == L'\0')
- return NULL;
- wcs2 += 2;
-
- if (*wcs == wc)
- return (wchar_t *) wcs;
- if (*wcs == L'\0')
- return NULL;
- wcs += 2;
-
- if (*wcs2 == wc)
- return (wchar_t *) wcs2;
- if (*wcs2 == L'\0')
- return NULL;
- wcs2 += 2;
-
- if (*wcs == wc)
- return (wchar_t *) wcs;
- }
- while (*wcs != L'\0');
-
- return NULL;
-}
-libc_hidden_def (wcschr)
diff --git a/sysdeps/powerpc/powerpc64/power6/wcschr.c b/sysdeps/powerpc/powerpc64/power6/wcschr.c
index 9136c02..ae04a13 100644
--- a/sysdeps/powerpc/powerpc64/power6/wcschr.c
+++ b/sysdeps/powerpc/powerpc64/power6/wcschr.c
@@ -1 +1 @@
-#include "../../powerpc32/power6/wcschr.c"
+#include <sysdeps/powerpc/power6/wcschr.c>
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=06e247cb0b92f962b99cd72e089acd27386f636d
commit 06e247cb0b92f962b99cd72e089acd27386f636d
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Wed Jun 5 08:36:26 2013 -0500
PowerPC: strchr multilib for PowerPC32
diff --git a/sysdeps/powerpc/powerpc32/multiarch/Makefile b/sysdeps/powerpc/powerpc32/multiarch/Makefile
index d469746..83b26a5 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/multiarch/Makefile
@@ -8,7 +8,7 @@ sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
strnlen-power7 strnlen-ppc32 strncmp-power7 strncmp-power4 \
strncmp-ppc32 strcasecmp-power7 strcasecmp_l-power7 \
strncase-power7 strncase_l-power7 strchrnul-power7 \
- strchrnul-ppc32
+ strchrnul-ppc32 strchr-power7 strchr-ppc32
CFLAGS-strncase-power7.c += -mcpu=power7 -funroll-loops
CFLAGS-strncase_l-power7.c += -mcpu=power7 -funroll-loops
diff --git a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
index b813875..35d6c7c 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
@@ -117,6 +117,14 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
IFUNC_IMPL_ADD (array, i, strchrnul, 1,
__strchrnul_ppc32))
+ /* Support sysdeps/powerpc/powerpc32/multiarch/strchr.c. */
+ IFUNC_IMPL (i, name, strchr,
+ IFUNC_IMPL_ADD (array, i, strchr,
+ hwcap & PPC_FEATURE_HAS_VSX,
+ __strchr_power7)
+ IFUNC_IMPL_ADD (array, i, strchr, 1,
+ __strchr_ppc32))
+
#ifdef SHARED
/* Support sysdeps/powerpc/powerpc32/multiarch/memset.c. */
IFUNC_IMPL (i, name, memset,
diff --git a/sysdeps/powerpc/powerpc32/multiarch/rtld-strchr.S b/sysdeps/powerpc/powerpc32/multiarch/rtld-strchr.S
new file mode 100644
index 0000000..d75786c
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/rtld-strchr.S
@@ -0,0 +1,18 @@
+/* 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 <sysdeps/powerpc/powerpc32/strchr.S>
diff --git a/sysdeps/powerpc/powerpc32/power7/strchr.S b/sysdeps/powerpc/powerpc32/multiarch/strchr-power7.S
similarity index 98%
rename from sysdeps/powerpc/powerpc32/power7/strchr.S
rename to sysdeps/powerpc/powerpc32/multiarch/strchr-power7.S
index 0ecadb2..32bc5bb 100644
--- a/sysdeps/powerpc/powerpc32/power7/strchr.S
+++ b/sysdeps/powerpc/powerpc32/multiarch/strchr-power7.S
@@ -21,7 +21,7 @@
/* int [r3] strchr (char *s [r3], int c [r4]) */
.machine power7
-ENTRY (strchr)
+ENTRY (__strchr_power7)
CALL_MCOUNT
dcbt 0,r3
clrrwi r8,r3,2 /* Align the address to word boundary. */
@@ -195,6 +195,4 @@ L(done_null):
srwi r0,r0,3 /* Convert leading zeros to bytes. */
add r3,r8,r0 /* Return address of the matching null byte. */
blr
-END (strchr)
-weak_alias (strchr, index)
-libc_hidden_builtin_def (strchr)
+END (__strchr_power7)
diff --git a/sysdeps/powerpc/powerpc32/multiarch/strchr-ppc32.S b/sysdeps/powerpc/powerpc32/multiarch/strchr-ppc32.S
new file mode 100644
index 0000000..7f49ae0
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/strchr-ppc32.S
@@ -0,0 +1,41 @@
+/* PowerPC32 default implementation of strchr.
+ 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>
+
+#ifdef SHARED
+# undef ENTRY
+# define ENTRY(name) \
+ .globl C_SYMBOL_NAME(__strchr_ppc32); \
+ .type C_SYMBOL_NAME(__strchr_ppc32),@function; \
+ .align ALIGNARG(2); \
+ C_LABEL(__strchr_ppc32) \
+ cfi_startproc; \
+ CALL_MCOUNT
+
+# undef END
+# define END(name) \
+ cfi_endproc; \
+ ASM_SIZE_DIRECTIVE(__strchr_ppc32) \
+
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name) \
+ .globl __GI_strchr; __GI_strchr = __strchr_ppc32
+#endif
+
+#include <sysdeps/powerpc/powerpc32/strchr.S>
diff --git a/sysdeps/powerpc/powerpc32/multiarch/strchr.c b/sysdeps/powerpc/powerpc32/multiarch/strchr.c
new file mode 100644
index 0000000..b22a686
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/strchr.c
@@ -0,0 +1,35 @@
+/* Multiple versions of strchr.
+ 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/>. */
+
+/* Define multiple versions only for definition in libc. */
+#if defined SHARED && !defined NOT_IN_libc
+# include <string.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+extern __typeof (strchr) __strchr_ppc32 attribute_hidden;
+extern __typeof (strchr) __strchr_power7 attribute_hidden;
+
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
+ ifunc symbol properly. */
+libc_ifunc (strchr,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strchr_power7
+ : __strchr_ppc32);
+weak_alias (strchr, index)
+#endif
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=98d6bf89fffeb5cbb499dd1ed70c870e93c9d075
commit 98d6bf89fffeb5cbb499dd1ed70c870e93c9d075
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Wed Jun 5 08:34:20 2013 -0500
PowerPC: strchrnul multilib for PowerPC32
diff --git a/string/strchrnul.c b/string/strchrnul.c
index 1f63572..6ca0e63 100644
--- a/string/strchrnul.c
+++ b/string/strchrnul.c
@@ -26,10 +26,13 @@
#undef __strchrnul
#undef strchrnul
+#ifndef STRCHRNUL
+# define STRCHRNUL __strchrnul
+#endif
/* Find the first occurrence of C in S or the final NUL byte. */
char *
-__strchrnul (s, c_in)
+STRCHRNUL (s, c_in)
const char *s;
int c_in;
{
diff --git a/sysdeps/powerpc/powerpc32/multiarch/Makefile b/sysdeps/powerpc/powerpc32/multiarch/Makefile
index 9051c62..d469746 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/multiarch/Makefile
@@ -7,7 +7,8 @@ sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
rawmemchr-ppc32 strnlen-power7 strlen-power7 strlen-ppc32 \
strnlen-power7 strnlen-ppc32 strncmp-power7 strncmp-power4 \
strncmp-ppc32 strcasecmp-power7 strcasecmp_l-power7 \
- strncase-power7 strncase_l-power7
+ strncase-power7 strncase_l-power7 strchrnul-power7 \
+ strchrnul-ppc32
CFLAGS-strncase-power7.c += -mcpu=power7 -funroll-loops
CFLAGS-strncase_l-power7.c += -mcpu=power7 -funroll-loops
diff --git a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
index 358129b..b813875 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
@@ -109,6 +109,14 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
IFUNC_IMPL_ADD (array, i, strncasecmp_l, 1,
__strncasecmp_l_ppc32))
+ /* Support sysdeps/powerpc/powerpc32/multiarch/strchrnul.c. */
+ IFUNC_IMPL (i, name, strchrnul,
+ IFUNC_IMPL_ADD (array, i, strchrnul,
+ hwcap & PPC_FEATURE_HAS_VSX,
+ __strchrnul_power7)
+ IFUNC_IMPL_ADD (array, i, strchrnul, 1,
+ __strchrnul_ppc32))
+
#ifdef SHARED
/* Support sysdeps/powerpc/powerpc32/multiarch/memset.c. */
IFUNC_IMPL (i, name, memset,
diff --git a/sysdeps/powerpc/powerpc32/power7/strchrnul.S b/sysdeps/powerpc/powerpc32/multiarch/strchrnul-power7.S
similarity index 96%
rename from sysdeps/powerpc/powerpc32/power7/strchrnul.S
rename to sysdeps/powerpc/powerpc32/multiarch/strchrnul-power7.S
index d4cacab..fff6be7 100644
--- a/sysdeps/powerpc/powerpc32/power7/strchrnul.S
+++ b/sysdeps/powerpc/powerpc32/multiarch/strchrnul-power7.S
@@ -21,7 +21,7 @@
/* int [r3] strchrnul (char *s [r3], int c [r4]) */
.machine power7
-ENTRY (__strchrnul)
+ENTRY (__strchrnul_power7)
CALL_MCOUNT
dcbt 0,r3
clrrwi r8,r3,2 /* Align the address to word boundary. */
@@ -109,6 +109,4 @@ L(done):
srwi r0,r0,3 /* Convert leading zeros to bytes. */
add r3,r8,r0 /* Return address of matching c/null byte. */
blr
-END (__strchrnul)
-weak_alias (__strchrnul,strchrnul)
-libc_hidden_builtin_def (__strchrnul)
+END (__strchrnul_power7)
diff --git a/sysdeps/powerpc/powerpc32/multiarch/strchrnul-ppc32.c b/sysdeps/powerpc/powerpc32/multiarch/strchrnul-ppc32.c
new file mode 100644
index 0000000..1bb54f6
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/strchrnul-ppc32.c
@@ -0,0 +1,28 @@
+/* PowerPC32 default implementation of strchrnul.
+ 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 <string.h>
+
+#define STRCHRNUL __strchrnul_ppc32
+
+#undef weak_alias
+#define weak_alias(a,b )
+
+extern __typeof (strchrnul) __strchrnul_ppc32 attribute_hidden;
+
+#include <string/strchrnul.c>
diff --git a/sysdeps/powerpc/powerpc32/multiarch/strchrnul.c b/sysdeps/powerpc/powerpc32/multiarch/strchrnul.c
new file mode 100644
index 0000000..b7f97fa
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/strchrnul.c
@@ -0,0 +1,37 @@
+/* Multiple versions of strchrnul.
+ 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/>. */
+
+#ifndef NOT_IN_libc
+# include <string.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+extern __typeof (__strchrnul) __strchrnul_ppc32 attribute_hidden;
+extern __typeof (__strchrnul) __strchrnul_power7 attribute_hidden;
+
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
+ ifunc symbol properly. */
+libc_ifunc (__strchrnul,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strchrnul_power7
+ : __strchrnul_ppc32);
+
+weak_alias (__strchrnul, strchrnul)
+#else
+#include <string/strchrnul.c>
+#endif
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=34f9721d1e59f0d06a74ca291011bd672e93382c
commit 34f9721d1e59f0d06a74ca291011bd672e93382c
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Wed Jun 5 08:31:31 2013 -0500
PowerPC: strncasecmp multilib for PowerPC32
diff --git a/sysdeps/powerpc/powerpc32/multiarch/Makefile b/sysdeps/powerpc/powerpc32/multiarch/Makefile
index a520f08..9051c62 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/multiarch/Makefile
@@ -6,5 +6,9 @@ sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
memchr-ppc32 memrchr-power7 memrchr-ppc32 rawmemchr-power7 \
rawmemchr-ppc32 strnlen-power7 strlen-power7 strlen-ppc32 \
strnlen-power7 strnlen-ppc32 strncmp-power7 strncmp-power4 \
- strncmp-ppc32 strcasecmp-power7 strcasecmp_l-power7
+ strncmp-ppc32 strcasecmp-power7 strcasecmp_l-power7 \
+ strncase-power7 strncase_l-power7
+
+CFLAGS-strncase-power7.c += -mcpu=power7 -funroll-loops
+CFLAGS-strncase_l-power7.c += -mcpu=power7 -funroll-loops
endif
diff --git a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
index 13c2a48..358129b 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
@@ -94,6 +94,21 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
IFUNC_IMPL_ADD (array, i, strcasecmp_l, 1,
__strcasecmp_l_ppc32))
+ /* Support sysdeps/powerpc/powerpc32/multiarch/strncase.c. */
+ IFUNC_IMPL (i, name, strncasecmp,
+ IFUNC_IMPL_ADD (array, i, strncasecmp,
+ hwcap & PPC_FEATURE_HAS_VSX,
+ __strncasecmp_power7)
+ IFUNC_IMPL_ADD (array, i, strncasecmp, 1, __strncasecmp_ppc32))
+
+ /* Support sysdeps/powerpc/powerpc32/multiarch/strncase_l.c. */
+ IFUNC_IMPL (i, name, strncasecmp_l,
+ IFUNC_IMPL_ADD (array, i, strncasecmp_l,
+ hwcap & PPC_FEATURE_HAS_VSX,
+ __strncasecmp_l_power7)
+ IFUNC_IMPL_ADD (array, i, strncasecmp_l, 1,
+ __strncasecmp_l_ppc32))
+
#ifdef SHARED
/* Support sysdeps/powerpc/powerpc32/multiarch/memset.c. */
IFUNC_IMPL (i, name, memset,
diff --git a/sysdeps/powerpc/powerpc32/multiarch/strncase-power7.c b/sysdeps/powerpc/powerpc32/multiarch/strncase-power7.c
new file mode 100644
index 0000000..4aaa638
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/strncase-power7.c
@@ -0,0 +1,26 @@
+/* Optimized strcasecmp_l implememtation for POWER7.
+ 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 <string.h>
+
+#define __strncasecmp __strncasecmp_power7
+
+extern __typeof (strncasecmp) __strncasecmp_power7 attribute_hidden;
+
+#include <string/strncase.c>
diff --git a/sysdeps/powerpc/powerpc32/multiarch/strncase.c b/sysdeps/powerpc/powerpc32/multiarch/strncase.c
new file mode 100644
index 0000000..cb9259d
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/strncase.c
@@ -0,0 +1,41 @@
+/* Multiple versions of strncasecmp.
+ 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/>. */
+
+#ifndef NOT_IN_libc
+# include <string.h>
+# define strncasecmp __strncasecmp_ppc32
+extern __typeof (__strncasecmp) __strncasecmp_ppc32 attribute_hidden;
+extern __typeof (__strncasecmp) __strncasecmp_power7 attribute_hidden;
+#endif
+
+#include <string/strncase.c>
+#undef strncasecmp
+
+#ifndef NOT_IN_libc
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
+ ifunc symbol properly. */
+extern __typeof (__strncasecmp) __libc_strncasecmp;
+libc_ifunc (__libc_strncasecmp,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strncasecmp_power7
+ : __strncasecmp_ppc32);
+weak_alias (__libc_strncasecmp, strncasecmp)
+#endif
diff --git a/sysdeps/powerpc/powerpc32/multiarch/strncase_l-power7.c b/sysdeps/powerpc/powerpc32/multiarch/strncase_l-power7.c
new file mode 100644
index 0000000..f96c5ab
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/strncase_l-power7.c
@@ -0,0 +1,26 @@
+/* Optimized strcasecmp_l implememtation for POWER7.
+ 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 <string.h>
+
+#define __strncasecmp_l __strncasecmp_l_power7
+#define USE_IN_EXTENDED_LOCALE_MODEL 1
+
+extern __typeof (strncasecmp_l) __strncasecmp_l_power7 attribute_hidden;
+
+#include <string/strncase.c>
diff --git a/sysdeps/powerpc/powerpc32/multiarch/strncase_l.c b/sysdeps/powerpc/powerpc32/multiarch/strncase_l.c
new file mode 100644
index 0000000..97a31a1
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/strncase_l.c
@@ -0,0 +1,42 @@
+/* Multiple versions of strncasecmp_l.
+ 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/>. */
+
+#ifndef NOT_IN_libc
+# include <string.h>
+# define strncasecmp_l __strncasecmp_l_ppc32
+extern __typeof (__strncasecmp_l) __strncasecmp_l_ppc32 attribute_hidden;
+extern __typeof (__strncasecmp_l) __strncasecmp_l_power7 attribute_hidden;
+#endif
+
+#include <string/strncase_l.c>
+#undef strncasecmp_l
+
+#ifndef NOT_IN_libc
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
+ ifunc symbol properly. */
+extern __typeof (__strncasecmp_l) __libc_strncasecmp_l;
+libc_ifunc (__libc_strncasecmp_l,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strncasecmp_l_power7
+ : __strncasecmp_l_ppc32);
+
+weak_alias (__libc_strncasecmp_l, strncasecmp_l)
+#endif
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=12df341ed514630deb5c967d6ec6c0ea8b16efb9
commit 12df341ed514630deb5c967d6ec6c0ea8b16efb9
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Wed Jun 5 08:30:34 2013 -0500
PowerPC: strcasecmp multilib for PowerPC32
diff --git a/sysdeps/powerpc/powerpc32/multiarch/Makefile b/sysdeps/powerpc/powerpc32/multiarch/Makefile
index 1c2add3..a520f08 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/multiarch/Makefile
@@ -6,5 +6,5 @@ sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
memchr-ppc32 memrchr-power7 memrchr-ppc32 rawmemchr-power7 \
rawmemchr-ppc32 strnlen-power7 strlen-power7 strlen-ppc32 \
strnlen-power7 strnlen-ppc32 strncmp-power7 strncmp-power4 \
- strncmp-ppc32
+ strncmp-ppc32 strcasecmp-power7 strcasecmp_l-power7
endif
diff --git a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
index 72d2784..13c2a48 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
@@ -79,6 +79,21 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
IFUNC_IMPL_ADD (array, i, rawmemchr, 1,
__rawmemchr_ppc32))
+ /* Support sysdeps/powerpc/powerpc32/multiarch/strcasecmp.c. */
+ IFUNC_IMPL (i, name, strcasecmp,
+ IFUNC_IMPL_ADD (array, i, strcasecmp,
+ hwcap & PPC_FEATURE_HAS_VSX,
+ __strcasecmp_power7)
+ IFUNC_IMPL_ADD (array, i, strcasecmp, 1, __strcasecmp_ppc32))
+
+ /* Support sysdeps/powerpc/powerpc32/multiarch/strcasecmp_l.c. */
+ IFUNC_IMPL (i, name, strcasecmp_l,
+ IFUNC_IMPL_ADD (array, i, strcasecmp_l,
+ hwcap & PPC_FEATURE_HAS_VSX,
+ __strcasecmp_l_power7)
+ IFUNC_IMPL_ADD (array, i, strcasecmp_l, 1,
+ __strcasecmp_l_ppc32))
+
#ifdef SHARED
/* Support sysdeps/powerpc/powerpc32/multiarch/memset.c. */
IFUNC_IMPL (i, name, memset,
diff --git a/sysdeps/powerpc/powerpc32/power7/strcasecmp.S b/sysdeps/powerpc/powerpc32/multiarch/strcasecmp-power7.S
similarity index 98%
rename from sysdeps/powerpc/powerpc32/power7/strcasecmp.S
rename to sysdeps/powerpc/powerpc32/multiarch/strcasecmp-power7.S
index 7f0046c..5f48271 100644
--- a/sysdeps/powerpc/powerpc32/power7/strcasecmp.S
+++ b/sysdeps/powerpc/powerpc32/multiarch/strcasecmp-power7.S
@@ -27,8 +27,8 @@
__locale_t loc [r5]) */
#ifndef STRCMP
-# define __STRCMP __strcasecmp
-# define STRCMP strcasecmp
+# define __STRCMP __strcasecmp_power7
+# define STRCMP strcasecmp_power7
#endif
ENTRY (__STRCMP)
diff --git a/sysdeps/powerpc/powerpc32/multiarch/strcasecmp.c b/sysdeps/powerpc/powerpc32/multiarch/strcasecmp.c
new file mode 100644
index 0000000..b1380c3
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/strcasecmp.c
@@ -0,0 +1,41 @@
+/* Multiple versions of strcasecmp.
+ 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/>. */
+
+#ifndef NOT_IN_libc
+# include <string.h>
+# define strcasecmp __strcasecmp_ppc32
+
+extern __typeof (__strcasecmp) __strcasecmp_ppc32 attribute_hidden;
+extern __typeof (__strcasecmp) __strcasecmp_power7 attribute_hidden;
+#endif
+
+#include <string/strcasecmp.c>
+#undef strcasecmp
+
+#ifndef NOT_IN_libc
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+extern __typeof (__strcasecmp) __libc_strcasecmp;
+libc_ifunc (__libc_strcasecmp,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strcasecmp_power7
+ : __strcasecmp_ppc32);
+
+weak_alias (__libc_strcasecmp, strcasecmp)
+#endif
diff --git a/sysdeps/powerpc/powerpc32/multiarch/strcasecmp_l-power7.S b/sysdeps/powerpc/powerpc32/multiarch/strcasecmp_l-power7.S
new file mode 100644
index 0000000..09792cb
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/strcasecmp_l-power7.S
@@ -0,0 +1,23 @@
+/* Default strcasecmp implementation for PowerPC32.
+ Copyright (C) 2011-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/>. */
+
+#define USE_IN_EXTENDED_LOCALE_MODEL
+#define STRCMP strcasecmp_l_power7
+#define __STRCMP __strcasecmp_l_power7
+
+#include "strcasecmp-power7.S"
diff --git a/sysdeps/powerpc/powerpc32/multiarch/strcasecmp_l.c b/sysdeps/powerpc/powerpc32/multiarch/strcasecmp_l.c
new file mode 100644
index 0000000..ba2f0ee
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/strcasecmp_l.c
@@ -0,0 +1,41 @@
+/* Multiple versions of strcasecmp.
+ 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/>. */
+
+#ifndef NOT_IN_libc
+# include <string.h>
+# define strcasecmp_l __strcasecmp_l_ppc32
+
+extern __typeof (__strcasecmp_l) __strcasecmp_l_ppc32 attribute_hidden;
+extern __typeof (__strcasecmp_l) __strcasecmp_l_power7 attribute_hidden;
+#endif
+
+#include <string/strcasecmp_l.c>
+#undef strcasecmp_l
+
+#ifndef NOT_IN_libc
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+extern __typeof (__strcasecmp_l) __libc_strcasecmp_l;
+libc_ifunc (__libc_strcasecmp_l,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strcasecmp_l_power7
+ : __strcasecmp_l_ppc32);
+
+weak_alias (__libc_strcasecmp_l, strcasecmp_l)
+#endif
diff --git a/sysdeps/powerpc/powerpc32/power7/Makefile b/sysdeps/powerpc/powerpc32/power7/Makefile
deleted file mode 100644
index 5e8f4a2..0000000
--- a/sysdeps/powerpc/powerpc32/power7/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-ifeq ($(subdir),string)
-CFLAGS-strncase.c += -funroll-loops
-CFLAGS-strncase_l.c += -funroll-loops
-endif
diff --git a/sysdeps/powerpc/powerpc32/power7/strcasecmp_l.S b/sysdeps/powerpc/powerpc32/power7/strcasecmp_l.S
deleted file mode 100644
index c13c4eb..0000000
--- a/sysdeps/powerpc/powerpc32/power7/strcasecmp_l.S
+++ /dev/null
@@ -1,5 +0,0 @@
-#define USE_IN_EXTENDED_LOCALE_MODEL
-#define STRCMP strcasecmp_l
-#define __STRCMP __strcasecmp_l
-
-#include "strcasecmp.S"
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=f77d306901d8a2db9e1adfbc5e870b3feacb9620
commit f77d306901d8a2db9e1adfbc5e870b3feacb9620
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Wed Jun 5 08:24:15 2013 -0500
PowerPC: strncmp multilib for PowerPC32
diff --git a/sysdeps/powerpc/powerpc32/multiarch/Makefile b/sysdeps/powerpc/powerpc32/multiarch/Makefile
index 5ccd8ff..1c2add3 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/multiarch/Makefile
@@ -5,5 +5,6 @@ sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
memset-ppc32 mempcpy-power7 mempcpy-ppc32 memchr-power7 \
memchr-ppc32 memrchr-power7 memrchr-ppc32 rawmemchr-power7 \
rawmemchr-ppc32 strnlen-power7 strlen-power7 strlen-ppc32 \
- strnlen-power7 strnlen-ppc32
+ strnlen-power7 strnlen-ppc32 strncmp-power7 strncmp-power4 \
+ strncmp-ppc32
endif
diff --git a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
index 5d0080e..72d2784 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
@@ -132,6 +132,13 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
__strnlen_power7)
IFUNC_IMPL_ADD (array, i, strnlen, 1,
__strnlen_ppc32))
+
+ /* Support sysdeps/powerpc/powerpc32/multiarch/strncmp.c. */
+ IFUNC_IMPL (i, name, strncmp,
+ IFUNC_IMPL_ADD (array, i, strncmp, hwcap & PPC_FEATURE_HAS_VSX,
+ __strncmp_power7)
+ IFUNC_IMPL_ADD (array, i, strncmp, 1,
+ __strncmp_ppc32))
#endif
return i;
diff --git a/sysdeps/powerpc/powerpc32/power4/strncmp.S b/sysdeps/powerpc/powerpc32/multiarch/strncmp-power4.S
similarity index 98%
rename from sysdeps/powerpc/powerpc32/power4/strncmp.S
rename to sysdeps/powerpc/powerpc32/multiarch/strncmp-power4.S
index 724d908..ffbd11e 100644
--- a/sysdeps/powerpc/powerpc32/power4/strncmp.S
+++ b/sysdeps/powerpc/powerpc32/multiarch/strncmp-power4.S
@@ -22,7 +22,8 @@
/* int [r3] strncmp (const char *s1 [r3], const char *s2 [r4], size_t size [r5]) */
-EALIGN (strncmp, 4, 0)
+ .machine power4
+EALIGN (__strncmp_power4, 4, 0)
#define rTMP r0
#define rRTN r3
@@ -166,5 +167,4 @@ L(u4): sub rRTN, rWORD1, rWORD2
L(ux):
li rRTN, 0
blr
-END (strncmp)
-libc_hidden_builtin_def (strncmp)
+END (__strncmp_power4)
diff --git a/sysdeps/powerpc/powerpc32/power7/strncmp.S b/sysdeps/powerpc/powerpc32/multiarch/strncmp-power7.S
similarity index 98%
rename from sysdeps/powerpc/powerpc32/power7/strncmp.S
rename to sysdeps/powerpc/powerpc32/multiarch/strncmp-power7.S
index fdae44d..c2cb8cd 100644
--- a/sysdeps/powerpc/powerpc32/power7/strncmp.S
+++ b/sysdeps/powerpc/powerpc32/multiarch/strncmp-power7.S
@@ -24,7 +24,8 @@
const char *s2 [r4],
size_t size [r5]) */
-EALIGN (strncmp,5,0)
+ .machine power7
+EALIGN (__strncmp_power7,5,0)
#define rTMP r0
#define rRTN r3
@@ -170,5 +171,4 @@ L(u4): sub rRTN,rWORD1,rWORD2
L(ux):
li rRTN,0
blr
-END (strncmp)
-libc_hidden_builtin_def (strncmp)
+END (__strncmp_power7)
diff --git a/sysdeps/powerpc/powerpc32/multiarch/strncmp-ppc32.S b/sysdeps/powerpc/powerpc32/multiarch/strncmp-ppc32.S
new file mode 100644
index 0000000..0fc6df6
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/strncmp-ppc32.S
@@ -0,0 +1,40 @@
+/* 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>
+
+#if defined SHARED && !defined NOT_IN_libc
+# undef EALIGN
+# define EALIGN(name, alignt, words) \
+ .globl C_SYMBOL_NAME(__strncmp_ppc32); \
+ .type C_SYMBOL_NAME(__strncmp_ppc32),@function; \
+ .align ALIGNARG(alignt); \
+ EALIGN_W_##words; \
+ C_LABEL(__strncmp_ppc32) \
+ cfi_startproc;
+
+# undef END
+# define END(name) \
+ cfi_endproc; \
+ ASM_SIZE_DIRECTIVE(__strncmp_ppc32)
+
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name) \
+ .globl __GI_strncmp; __GI_strncmp = __strncmp_ppc32
+#endif
+
+#include <sysdeps/powerpc/powerpc32/strncmp.S>
diff --git a/sysdeps/powerpc/powerpc32/multiarch/strncmp.c b/sysdeps/powerpc/powerpc32/multiarch/strncmp.c
new file mode 100644
index 0000000..32b96dc
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/strncmp.c
@@ -0,0 +1,37 @@
+/* Multiple versions of strncmp.
+ 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/>. */
+
+/* Define multiple versions only for definition in libc. */
+#if defined SHARED && !defined NOT_IN_libc
+# include <string.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+extern __typeof (strncmp) __strncmp_ppc32 attribute_hidden;
+extern __typeof (strncmp) __strncmp_power4 attribute_hidden;
+extern __typeof (strncmp) __strncmp_power7 attribute_hidden;
+
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
+ ifunc symbol properly. */
+libc_ifunc (strncmp,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strncmp_power7 :
+ (hwcap & PPC_FEATURE_POWER4)
+ ? __strncmp_power4
+ : __strncmp_ppc32);
+#endif
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=352e47519cacaf980d5497c72760ffc13dd7fdc1
commit 352e47519cacaf980d5497c72760ffc13dd7fdc1
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Wed Jun 5 08:11:02 2013 -0500
PowerPC: strnlen multilib for PowerPC32
diff --git a/sysdeps/powerpc/powerpc32/multiarch/Makefile b/sysdeps/powerpc/powerpc32/multiarch/Makefile
index 0c0eb5d..5ccd8ff 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/multiarch/Makefile
@@ -4,5 +4,6 @@ sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
memcmp-ppc32 memset-power7 memset-power6 memset-power4 \
memset-ppc32 mempcpy-power7 mempcpy-ppc32 memchr-power7 \
memchr-ppc32 memrchr-power7 memrchr-ppc32 rawmemchr-power7 \
- rawmemchr-ppc32 strnlen-power7 strlen-power7 strlen-ppc32
+ rawmemchr-ppc32 strnlen-power7 strlen-power7 strlen-ppc32 \
+ strnlen-power7 strnlen-ppc32
endif
diff --git a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
index 33a023d..5d0080e 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
@@ -126,6 +126,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
__strlen_power7)
IFUNC_IMPL_ADD (array, i, strlen, 1,
__strlen_ppc32))
+ /* Support sysdeps/powerpc/powerpc32/multiarch/strnlen.c. */
+ IFUNC_IMPL (i, name, strnlen,
+ IFUNC_IMPL_ADD (array, i, strnlen, hwcap & PPC_FEATURE_HAS_VSX,
+ __strnlen_power7)
+ IFUNC_IMPL_ADD (array, i, strnlen, 1,
+ __strnlen_ppc32))
#endif
return i;
diff --git a/sysdeps/powerpc/powerpc32/multiarch/rtld-strnlen.c b/sysdeps/powerpc/powerpc32/multiarch/rtld-strnlen.c
new file mode 100644
index 0000000..11a7203
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/rtld-strnlen.c
@@ -0,0 +1,18 @@
+/* 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 <string/strnlen.c>
diff --git a/sysdeps/powerpc/powerpc32/power7/strnlen.S b/sysdeps/powerpc/powerpc32/multiarch/strnlen-power7.S
similarity index 97%
rename from sysdeps/powerpc/powerpc32/power7/strnlen.S
rename to sysdeps/powerpc/powerpc32/multiarch/strnlen-power7.S
index ed08836..63ac821 100644
--- a/sysdeps/powerpc/powerpc32/power7/strnlen.S
+++ b/sysdeps/powerpc/powerpc32/multiarch/strnlen-power7.S
@@ -21,7 +21,7 @@
/* int [r3] strnlen (char *s [r3], int size [r4]) */
.machine power7
-ENTRY (__strnlen)
+ENTRY (__strnlen_power7)
CALL_MCOUNT
dcbt 0,r3
clrrwi r8,r3,2 /* Align the address to word boundary. */
@@ -164,6 +164,4 @@ L(loop_small):
cmplw r9,r7
bge L(end_max)
b L(loop_small)
-END (__strnlen)
-weak_alias (__strnlen, strnlen)
-libc_hidden_builtin_def (strnlen)
+END (__strnlen_power7)
diff --git a/sysdeps/powerpc/powerpc32/multiarch/strnlen-ppc32.c b/sysdeps/powerpc/powerpc32/multiarch/strnlen-ppc32.c
new file mode 100644
index 0000000..660c973
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/strnlen-ppc32.c
@@ -0,0 +1,26 @@
+/* Default strnlen implementation for PowerPC32.
+ 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/>. */
+
+#define STRNLEN __strnlen_ppc32
+#ifdef SHARED
+# undef libc_hidden_def
+# define libc_hidden_def(name) \
+ __hidden_ver1 (__strnlen_ppc32, __GI_strnlen, __strnlen_ppc32);
+#endif
+
+#include <string/strnlen.c>
diff --git a/sysdeps/powerpc/powerpc32/multiarch/strnlen.c b/sysdeps/powerpc/powerpc32/multiarch/strnlen.c
new file mode 100644
index 0000000..5816a04
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/strnlen.c
@@ -0,0 +1,33 @@
+/* Multiple versions of strnlen.
+ 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/>. */
+
+#ifndef NOT_IN_libc
+# include <string.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+extern __typeof (__strnlen) __strnlen_ppc32 attribute_hidden;
+extern __typeof (__strnlen) __strnlen_power7 attribute_hidden;
+
+libc_ifunc (__strnlen,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strnlen_power7
+ : __strnlen_ppc32);
+weak_alias (__strnlen, strnlen)
+libc_hidden_def (strnlen)
+#endif
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=08c82d500baf204ac9ba8579b7dd6c0aaf3de379
commit 08c82d500baf204ac9ba8579b7dd6c0aaf3de379
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Wed Jun 5 08:07:17 2013 -0500
PowerPC: strlen multilib for PowerPC32
diff --git a/sysdeps/powerpc/powerpc32/multiarch/Makefile b/sysdeps/powerpc/powerpc32/multiarch/Makefile
index ab482ba..0c0eb5d 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/multiarch/Makefile
@@ -4,5 +4,5 @@ sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
memcmp-ppc32 memset-power7 memset-power6 memset-power4 \
memset-ppc32 mempcpy-power7 mempcpy-ppc32 memchr-power7 \
memchr-ppc32 memrchr-power7 memrchr-ppc32 rawmemchr-power7 \
- rawmemchr-ppc32
+ rawmemchr-ppc32 strnlen-power7 strlen-power7 strlen-ppc32
endif
diff --git a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
index 7d65f52..33a023d 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
@@ -120,6 +120,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
IFUNC_IMPL_ADD (array, i, mempcpy, 1,
__mempcpy_ppc32))
+ /* Support sysdeps/powerpc/powerpc32/multiarch/strlen.c. */
+ IFUNC_IMPL (i, name, strlen,
+ IFUNC_IMPL_ADD (array, i, strlen, hwcap & PPC_FEATURE_HAS_VSX,
+ __strlen_power7)
+ IFUNC_IMPL_ADD (array, i, strlen, 1,
+ __strlen_ppc32))
#endif
return i;
diff --git a/sysdeps/powerpc/powerpc32/power7/strlen.S b/sysdeps/powerpc/powerpc32/multiarch/strlen-power7.S
similarity index 98%
rename from sysdeps/powerpc/powerpc32/power7/strlen.S
rename to sysdeps/powerpc/powerpc32/multiarch/strlen-power7.S
index b71a10f..858a0c9 100644
--- a/sysdeps/powerpc/powerpc32/power7/strlen.S
+++ b/sysdeps/powerpc/powerpc32/multiarch/strlen-power7.S
@@ -21,7 +21,7 @@
/* int [r3] strlen (char *s [r3]) */
.machine power7
-ENTRY (strlen)
+ENTRY (__strlen_power7)
CALL_MCOUNT
dcbt 0,r3
clrrwi r4,r3,2 /* Align the address to word boundary. */
@@ -91,5 +91,4 @@ L(done):
srwi r0,r0,3 /* Convert leading zeroes to bytes. */
add r3,r5,r0 /* Compute final length. */
blr
-END (strlen)
-libc_hidden_builtin_def (strlen)
+END (__strlen_power7)
diff --git a/sysdeps/powerpc/powerpc32/multiarch/strlen-ppc32.S b/sysdeps/powerpc/powerpc32/multiarch/strlen-ppc32.S
new file mode 100644
index 0000000..7b5c76f
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/strlen-ppc32.S
@@ -0,0 +1,41 @@
+/* Default strlen implementation for PowerPC32.
+ 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/>. */
+
+#if defined SHARED && !defined NOT_IN_libc
+
+#include <sysdep.h>
+
+# undef ENTRY
+# define ENTRY(name) \
+ .globl C_SYMBOL_NAME(__strlen_ppc32); \
+ .type C_SYMBOL_NAME(__strlen_ppc32),@function; \
+ C_LABEL(__strlen_ppc32) \
+ cfi_startproc;
+
+# undef END
+# define END(name) \
+ cfi_endproc; \
+ ASM_SIZE_DIRECTIVE(__strlen_ppc32)
+
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name) \
+ .globl __GI_strlen; __GI_strlen = __strlen_ppc32
+
+#endif
+
+#include <sysdeps/powerpc/powerpc32/strlen.S>
diff --git a/sysdeps/powerpc/powerpc32/multiarch/strlen.c b/sysdeps/powerpc/powerpc32/multiarch/strlen.c
new file mode 100644
index 0000000..8fce99b
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/strlen.c
@@ -0,0 +1,31 @@
+/* Multiple versions of strlen.
+ 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/>. */
+
+#if defined SHARED && !defined NOT_IN_libc
+# include <string.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+extern __typeof (strlen) __strlen_ppc32 attribute_hidden;
+extern __typeof (strlen) __strlen_power7 attribute_hidden;
+
+libc_ifunc (strlen,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strlen_power7
+ : __strlen_ppc32);
+#endif
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=406915b233484b557999b531c3238913ad356091
commit 406915b233484b557999b531c3238913ad356091
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Wed Jun 5 07:59:09 2013 -0500
PowerPC: rawmemchr multilib for PowerPC32
diff --git a/string/rawmemchr.c b/string/rawmemchr.c
index 30fbe87..3b6e19b 100644
--- a/string/rawmemchr.c
+++ b/string/rawmemchr.c
@@ -46,11 +46,13 @@
#include <sys/types.h>
#undef memchr
-
+#ifndef RAWMEMCHR
+# define RAWMEMCHR __rawmemchr
+#endif
/* Find the first occurrence of C in S. */
__ptr_t
-__rawmemchr (s, c_in)
+RAWMEMCHR (s, c_in)
const __ptr_t s;
int c_in;
{
diff --git a/sysdeps/powerpc/powerpc32/multiarch/Makefile b/sysdeps/powerpc/powerpc32/multiarch/Makefile
index fde4fbf..ab482ba 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/multiarch/Makefile
@@ -3,5 +3,6 @@ sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
memcpy-power4 memcpy-ppc32 memcmp-power7 memcmp-power4 \
memcmp-ppc32 memset-power7 memset-power6 memset-power4 \
memset-ppc32 mempcpy-power7 mempcpy-ppc32 memchr-power7 \
- memchr-ppc32 memrchr-power7 memrchr-ppc32
+ memchr-ppc32 memrchr-power7 memrchr-ppc32 rawmemchr-power7 \
+ rawmemchr-ppc32
endif
diff --git a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
index 4b3dd75..7d65f52 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
@@ -71,6 +71,14 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
IFUNC_IMPL_ADD (array, i, memrchr, 1,
__memrchr_ppc32))
+ /* Support sysdeps/powerpc/powerpc32/multiarch/rawmemchr.c. */
+ IFUNC_IMPL (i, name, rawmemchr,
+ IFUNC_IMPL_ADD (array, i, rawmemchr,
+ hwcap & PPC_FEATURE_HAS_VSX,
+ __rawmemchr_power7)
+ IFUNC_IMPL_ADD (array, i, rawmemchr, 1,
+ __rawmemchr_ppc32))
+
#ifdef SHARED
/* Support sysdeps/powerpc/powerpc32/multiarch/memset.c. */
IFUNC_IMPL (i, name, memset,
diff --git a/sysdeps/powerpc/powerpc32/power7/rawmemchr.S b/sysdeps/powerpc/powerpc32/multiarch/rawmemchr-power7.S
similarity index 96%
rename from sysdeps/powerpc/powerpc32/power7/rawmemchr.S
rename to sysdeps/powerpc/powerpc32/multiarch/rawmemchr-power7.S
index a80c74a..b495393 100644
--- a/sysdeps/powerpc/powerpc32/power7/rawmemchr.S
+++ b/sysdeps/powerpc/powerpc32/multiarch/rawmemchr-power7.S
@@ -21,7 +21,7 @@
/* int [r3] rawmemchr (void *s [r3], int c [r4]) */
.machine power7
-ENTRY (__rawmemchr)
+ENTRY (__rawmemchr_power7)
CALL_MCOUNT
dcbt 0,r3
clrrwi r8,r3,2 /* Align the address to word boundary. */
@@ -94,6 +94,4 @@ L(done):
srwi r0,r0,3 /* Convert leading zeroes to bytes. */
add r3,r8,r0 /* Return address of the matching char. */
blr
-END (__rawmemchr)
-weak_alias (__rawmemchr,rawmemchr)
-libc_hidden_builtin_def (__rawmemchr)
+END (__rawmemchr_power7)
diff --git a/sysdeps/powerpc/powerpc32/multiarch/rawmemchr-ppc32.c b/sysdeps/powerpc/powerpc32/multiarch/rawmemchr-ppc32.c
new file mode 100644
index 0000000..a0a9504
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/rawmemchr-ppc32.c
@@ -0,0 +1,32 @@
+/* PowerPC32 default implementation of rawmemchr.
+ 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 <string.h>
+
+#define RAWMEMCHR __rawmemchr_ppc32
+#undef weak_alias
+#define weak_alias(a, b)
+#ifdef SHARED
+# undef libc_hidden_def
+# define libc_hidden_def(name) \
+ __hidden_ver1 (__rawmemchr_ppc32, __GI___rawmemchr, __rawmemchr_ppc32);
+#endif
+
+extern __typeof (rawmemchr) __rawmemchr_ppc32 attribute_hidden;
+
+#include <string/rawmemchr.c>
diff --git a/sysdeps/powerpc/powerpc32/multiarch/rawmemchr.c b/sysdeps/powerpc/powerpc32/multiarch/rawmemchr.c
new file mode 100644
index 0000000..b033f47
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/rawmemchr.c
@@ -0,0 +1,37 @@
+/* Multiple versions of rawmemchr.
+ 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/>. */
+
+#ifndef NOT_IN_libc
+# include <string.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+extern __typeof (__rawmemchr) __rawmemchr_ppc32 attribute_hidden;
+extern __typeof (__rawmemchr) __rawmemchr_power7 attribute_hidden;
+
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
+ ifunc symbol properly. */
+libc_ifunc (__rawmemchr,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __rawmemchr_power7
+ : __rawmemchr_ppc32);
+
+weak_alias (__rawmemchr, rawmemchr)
+#else
+#include <string/rawmemchr.c>
+#endif
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=45280f1a7f77f67485118a56e63970fc72de186d
commit 45280f1a7f77f67485118a56e63970fc72de186d
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Wed Jun 5 07:56:43 2013 -0500
PowerPC: memrchr multilib for PowerPC32
diff --git a/sysdeps/powerpc/powerpc32/multiarch/Makefile b/sysdeps/powerpc/powerpc32/multiarch/Makefile
index 9feb3c6..fde4fbf 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/multiarch/Makefile
@@ -3,5 +3,5 @@ sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
memcpy-power4 memcpy-ppc32 memcmp-power7 memcmp-power4 \
memcmp-ppc32 memset-power7 memset-power6 memset-power4 \
memset-ppc32 mempcpy-power7 mempcpy-ppc32 memchr-power7 \
- memchr-ppc32
+ memchr-ppc32 memrchr-power7 memrchr-ppc32
endif
diff --git a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
index 279cc0b..4b3dd75 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
@@ -63,6 +63,13 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
__memchr_power7)
IFUNC_IMPL_ADD (array, i, memchr, 1,
__memchr_ppc32))
+ /* Support sysdeps/powerpc/powerpc32/multiarch/memrchr.c. */
+ IFUNC_IMPL (i, name, memrchr,
+ IFUNC_IMPL_ADD (array, i, memrchr,
+ hwcap & PPC_FEATURE_HAS_VSX,
+ __memrchr_power7)
+ IFUNC_IMPL_ADD (array, i, memrchr, 1,
+ __memrchr_ppc32))
#ifdef SHARED
/* Support sysdeps/powerpc/powerpc32/multiarch/memset.c. */
diff --git a/sysdeps/powerpc/powerpc32/power7/memrchr.S b/sysdeps/powerpc/powerpc32/multiarch/memrchr-power7.S
similarity index 97%
rename from sysdeps/powerpc/powerpc32/power7/memrchr.S
rename to sysdeps/powerpc/powerpc32/multiarch/memrchr-power7.S
index d1e3fda..0aaf017 100644
--- a/sysdeps/powerpc/powerpc32/power7/memrchr.S
+++ b/sysdeps/powerpc/powerpc32/multiarch/memrchr-power7.S
@@ -21,7 +21,7 @@
/* int [r3] memrchr (char *s [r3], int byte [r4], int size [r5]) */
.machine power7
-ENTRY (__memrchr)
+ENTRY (__memrchr_power7)
CALL_MCOUNT
dcbt 0,r3
mr r7,r3
@@ -170,6 +170,4 @@ L(loop_small):
ble L(null)
b L(loop_small)
-END (__memrchr)
-weak_alias (__memrchr, memrchr)
-libc_hidden_builtin_def (memrchr)
+END (__memrchr_power7)
diff --git a/sysdeps/powerpc/powerpc32/multiarch/memrchr-ppc32.c b/sysdeps/powerpc/powerpc32/multiarch/memrchr-ppc32.c
new file mode 100644
index 0000000..19ae015
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/memrchr-ppc32.c
@@ -0,0 +1,25 @@
+/* PowerPC32 default implementation of memrchr.
+ 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/>. */
+
+#ifndef NOT_IN_libc
+# define MEMRCHR __memrchr_ppc32
+# include <string.h>
+extern void *__memrchr_ppc32 (const void *, int, size_t);
+#endif
+
+#include <string/memrchr.c>
diff --git a/sysdeps/powerpc/powerpc32/multiarch/memrchr.c b/sysdeps/powerpc/powerpc32/multiarch/memrchr.c
new file mode 100644
index 0000000..c3dde9c
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/memrchr.c
@@ -0,0 +1,37 @@
+/* Multiple versions of memrchr.
+ 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/>. */
+
+#ifndef NOT_IN_libc
+# include <string.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+extern __typeof (__memrchr) __memrchr_ppc32 attribute_hidden;
+extern __typeof (__memrchr) __memrchr_power7 attribute_hidden;
+
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
+ ifunc symbol properly. */
+libc_ifunc (__memrchr,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __memrchr_power7
+ : __memrchr_ppc32);
+
+weak_alias (__memrchr, memrchr)
+#else
+#include <string/memrchr.c>
+#endif
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=a2a1e78887ec120e3cf8c8a375c1c425c7de2929
commit a2a1e78887ec120e3cf8c8a375c1c425c7de2929
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Wed Jun 5 07:54:37 2013 -0500
PowerPC: memchr multilib for PowerPC32
diff --git a/string/memchr.c b/string/memchr.c
index 2427c4b..a4a65c7 100644
--- a/string/memchr.c
+++ b/string/memchr.c
@@ -50,10 +50,13 @@
#undef memchr
#undef __memchr
+#ifndef MEMCHR
+# define MEMCHR __memchr
+#endif
/* Search no more than N bytes of S for C. */
__ptr_t
-__memchr (s, c_in, n)
+MEMCHR (s, c_in, n)
const __ptr_t s;
int c_in;
size_t n;
diff --git a/sysdeps/powerpc/powerpc32/multiarch/Makefile b/sysdeps/powerpc/powerpc32/multiarch/Makefile
index 34a0cdc..9feb3c6 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/multiarch/Makefile
@@ -2,5 +2,6 @@ ifeq ($(subdir),string)
sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
memcpy-power4 memcpy-ppc32 memcmp-power7 memcmp-power4 \
memcmp-ppc32 memset-power7 memset-power6 memset-power4 \
- memset-ppc32 mempcpy-power7 mempcpy-ppc32
+ memset-ppc32 mempcpy-power7 mempcpy-ppc32 memchr-power7 \
+ memchr-ppc32
endif
diff --git a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
index e50e144..279cc0b 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
@@ -56,6 +56,14 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
__bzero_power4)
IFUNC_IMPL_ADD (array, i, bzero, 1, __bzero_ppc32))
+ /* Support sysdeps/powerpc/powerpc32/multiarch/memchr.c. */
+ IFUNC_IMPL (i, name, memchr,
+ IFUNC_IMPL_ADD (array, i, memchr,
+ hwcap & PPC_FEATURE_HAS_VSX,
+ __memchr_power7)
+ IFUNC_IMPL_ADD (array, i, memchr, 1,
+ __memchr_ppc32))
+
#ifdef SHARED
/* Support sysdeps/powerpc/powerpc32/multiarch/memset.c. */
IFUNC_IMPL (i, name, memset,
diff --git a/sysdeps/powerpc/powerpc32/power7/memchr.S b/sysdeps/powerpc/powerpc32/multiarch/memchr-power7.S
similarity index 98%
rename from sysdeps/powerpc/powerpc32/power7/memchr.S
rename to sysdeps/powerpc/powerpc32/multiarch/memchr-power7.S
index 369e5e0..b7aa903 100644
--- a/sysdeps/powerpc/powerpc32/power7/memchr.S
+++ b/sysdeps/powerpc/powerpc32/multiarch/memchr-power7.S
@@ -21,7 +21,7 @@
/* int [r3] memchr (char *s [r3], int byte [r4], int size [r5]) */
.machine power7
-ENTRY (__memchr)
+ENTRY (__memchr_power7)
CALL_MCOUNT
dcbt 0,r3
clrrwi r8,r3,2
@@ -200,6 +200,4 @@ L(loop_small): /* loop_small has been unrolled. */
li r3,0
blr
-END (__memchr)
-weak_alias (__memchr, memchr)
-libc_hidden_builtin_def (memchr)
+END (__memchr_power7)
diff --git a/sysdeps/powerpc/powerpc32/multiarch/memchr-ppc32.c b/sysdeps/powerpc/powerpc32/multiarch/memchr-ppc32.c
new file mode 100644
index 0000000..68a9b4a
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/memchr-ppc32.c
@@ -0,0 +1,34 @@
+/* PowerPC32 default implementation of memchr.
+ 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 <string.h>
+
+#define MEMCHR __memchr_ppc32
+
+#undef weak_alias
+#define weak_alias(a, b)
+
+#ifdef SHARED
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name) \
+ __hidden_ver1 (__memchr_ppc32, __GI_memchr, __memchr_ppc32);
+#endif
+
+extern __typeof (memchr) __memchr_ppc32 attribute_hidden;
+
+#include <string/memchr.c>
diff --git a/sysdeps/powerpc/powerpc32/multiarch/memchr.c b/sysdeps/powerpc/powerpc32/multiarch/memchr.c
new file mode 100644
index 0000000..0e619d4
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/memchr.c
@@ -0,0 +1,38 @@
+/* Multiple versions of memchr.
+ 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/>. */
+
+#ifndef NOT_IN_libc
+# include <string.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+extern __typeof (__memchr) __memchr_ppc32 attribute_hidden;
+extern __typeof (__memchr) __memchr_power7 attribute_hidden;
+
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
+ ifunc symbol properly. */
+libc_ifunc (__memchr,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __memchr_power7
+ : __memchr_ppc32);
+
+weak_alias (__memchr, memchr)
+libc_hidden_builtin_def (memchr)
+#else
+#include <string/memchr.c>
+#endif
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=f8f39c7a379b548eaafa06f37595b7a60def9758
commit f8f39c7a379b548eaafa06f37595b7a60def9758
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Wed Jun 5 07:51:58 2013 -0500
PowerPC: mempcpy multilib for PowerPC32
diff --git a/string/mempcpy.c b/string/mempcpy.c
index c0d2448..a626c9c 100644
--- a/string/mempcpy.c
+++ b/string/mempcpy.c
@@ -24,8 +24,12 @@
#undef mempcpy
#undef __mempcpy
+#ifndef MEMPCPY
+# define MEMPCPY __mempcpy
+#endif
+
void *
-__mempcpy (void *dest, const void *src, size_t len)
+MEMPCPY (void *dest, const void *src, size_t len)
{
return memcpy (dest, src, len) + len;
}
diff --git a/sysdeps/powerpc/powerpc32/multiarch/Makefile b/sysdeps/powerpc/powerpc32/multiarch/Makefile
index f3778a7..34a0cdc 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/multiarch/Makefile
@@ -2,5 +2,5 @@ ifeq ($(subdir),string)
sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
memcpy-power4 memcpy-ppc32 memcmp-power7 memcmp-power4 \
memcmp-ppc32 memset-power7 memset-power6 memset-power4 \
- memset-ppc32
+ memset-ppc32 mempcpy-power7 mempcpy-ppc32
endif
diff --git a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
index 45943cf..e50e144 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
@@ -88,6 +88,15 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
IFUNC_IMPL_ADD (array, i, memcmp, hwcap & PPC_FEATURE_POWER4,
__memcmp_power4)
IFUNC_IMPL_ADD (array, i, memcmp, 1, __memcmp_ppc32))
+
+ /* Support sysdeps/powerpc/powerpc32/multiarch/mempcpy.c. */
+ IFUNC_IMPL (i, name, mempcpy,
+ IFUNC_IMPL_ADD (array, i, mempcpy,
+ hwcap & PPC_FEATURE_HAS_VSX,
+ __mempcpy_power7)
+ IFUNC_IMPL_ADD (array, i, mempcpy, 1,
+ __mempcpy_ppc32))
+
#endif
return i;
diff --git a/sysdeps/powerpc/powerpc32/power7/mempcpy.S b/sysdeps/powerpc/powerpc32/multiarch/mempcpy-power7.S
similarity index 98%
rename from sysdeps/powerpc/powerpc32/power7/mempcpy.S
rename to sysdeps/powerpc/powerpc32/multiarch/mempcpy-power7.S
index 5ad4edb..0cc37ae 100644
--- a/sysdeps/powerpc/powerpc32/power7/mempcpy.S
+++ b/sysdeps/powerpc/powerpc32/multiarch/mempcpy-power7.S
@@ -23,7 +23,7 @@
Returns 'dst' + 'len'. */
.machine power7
-EALIGN (__mempcpy, 5, 0)
+EALIGN (__mempcpy_power7, 5, 0)
CALL_MCOUNT
stwu 1,-32(1)
@@ -462,7 +462,4 @@ L(end_unaligned_loop):
addi 1,1,32
blr
-END (__mempcpy)
-libc_hidden_def (__mempcpy)
-weak_alias (__mempcpy, mempcpy)
-libc_hidden_builtin_def (mempcpy)
+END (__mempcpy_power7)
diff --git a/string/mempcpy.c b/sysdeps/powerpc/powerpc32/multiarch/mempcpy-ppc32.c
similarity index 58%
copy from string/mempcpy.c
copy to sysdeps/powerpc/powerpc32/multiarch/mempcpy-ppc32.c
index c0d2448..0e9a129 100644
--- a/string/mempcpy.c
+++ b/sysdeps/powerpc/powerpc32/multiarch/mempcpy-ppc32.c
@@ -1,9 +1,6 @@
-/* Copy memory to memory until the specified number of bytes
- has been copied, return pointer to following byte.
- Overlap is NOT handled correctly.
- Copyright (C) 1991-2013 Free Software Foundation, Inc.
+/* PowerPC32 default implementation of mempcpy.
+ Copyright (C) 2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Torbjorn Granlund (tege@sics.se).
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -19,16 +16,17 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <string.h>
+#define MEMPCPY __mempcpy_ppc32
-#undef mempcpy
-#undef __mempcpy
+#undef libc_hidden_def
+#define libc_hidden_def(name)
+#undef weak_alias
+#define weak_alias(a, b)
-void *
-__mempcpy (void *dest, const void *src, size_t len)
-{
- return memcpy (dest, src, len) + len;
-}
-libc_hidden_def (__mempcpy)
-weak_alias (__mempcpy, mempcpy)
-libc_hidden_builtin_def (mempcpy)
+#if defined SHARED
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name) \
+ __hidden_ver1 (__mempcpy_ppc32, __GI_mempcpy, __mempcpy_ppc32);
+#endif
+
+#include <string/mempcpy.c>
diff --git a/string/mempcpy.c b/sysdeps/powerpc/powerpc32/multiarch/mempcpy.c
similarity index 56%
copy from string/mempcpy.c
copy to sysdeps/powerpc/powerpc32/multiarch/mempcpy.c
index c0d2448..0696e6c 100644
--- a/string/mempcpy.c
+++ b/sysdeps/powerpc/powerpc32/multiarch/mempcpy.c
@@ -1,9 +1,6 @@
-/* Copy memory to memory until the specified number of bytes
- has been copied, return pointer to following byte.
- Overlap is NOT handled correctly.
- Copyright (C) 1991-2013 Free Software Foundation, Inc.
+/* Multiple versions of mempcpy.
+ Copyright (C) 2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Torbjorn Granlund (tege@sics.se).
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -19,16 +16,23 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <string.h>
+#ifndef NOT_IN_libc
+# include <string.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
-#undef mempcpy
-#undef __mempcpy
+extern __typeof (__mempcpy) __mempcpy_ppc32 attribute_hidden;
+extern __typeof (__mempcpy) __mempcpy_power7 attribute_hidden;
+
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
+ ifunc symbol properly. */
+libc_ifunc (__mempcpy,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __mempcpy_power7
+ : __mempcpy_ppc32);
-void *
-__mempcpy (void *dest, const void *src, size_t len)
-{
- return memcpy (dest, src, len) + len;
-}
-libc_hidden_def (__mempcpy)
weak_alias (__mempcpy, mempcpy)
-libc_hidden_builtin_def (mempcpy)
+libc_hidden_def (mempcpy)
+#else
+# include <string/mempcpy.c>
+#endif
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=1b5d1d4dc092a2e6080a84579bc84dd46e48361c
commit 1b5d1d4dc092a2e6080a84579bc84dd46e48361c
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Wed Jun 5 07:48:57 2013 -0500
PowerPC: memset/bzero multilib for PowerPC32
diff --git a/sysdeps/powerpc/powerpc32/multiarch/Makefile b/sysdeps/powerpc/powerpc32/multiarch/Makefile
index c74e600..f3778a7 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/multiarch/Makefile
@@ -1,5 +1,6 @@
ifeq ($(subdir),string)
sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
memcpy-power4 memcpy-ppc32 memcmp-power7 memcmp-power4 \
- memcmp-ppc32
+ memcmp-ppc32 memset-power7 memset-power6 memset-power4 \
+ memset-ppc32
endif
diff --git a/sysdeps/powerpc/powerpc32/multiarch/bzero.c b/sysdeps/powerpc/powerpc32/multiarch/bzero.c
new file mode 100644
index 0000000..4a14a18
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/bzero.c
@@ -0,0 +1,68 @@
+/* Multiple versions of bzero.
+ 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/>. */
+
+/* Define multiple versions only for definition in libc. */
+#ifndef NOT_IN_libc
+# include <string.h>
+# include <strings.h>
+# include "init-arch.h"
+
+extern __typeof (memset) __memset_ppc32 attribute_hidden;
+extern __typeof (memset) __memset_power4 attribute_hidden;
+extern __typeof (memset) __memset_power6 attribute_hidden;
+extern __typeof (memset) __memset_power7 attribute_hidden;
+
+__typeof(bzero) __bzero_ppc32 attribute_hidden;
+void
+__bzero_ppc32 (void *s, size_t n)
+{
+ __memset_ppc32 (s, 0, n);
+}
+
+__typeof(bzero) __bzero_power4 attribute_hidden;
+void
+__bzero_power4 (void *s, size_t n)
+{
+ __memset_power4 (s, 0, n);
+}
+
+__typeof(bzero) __bzero_power6 attribute_hidden;
+void
+__bzero_power6 (void *s, size_t n)
+{
+ __memset_power6 (s, 0, n);
+}
+
+__typeof(bzero) __bzero_power7 attribute_hidden;
+void
+__bzero_power7 (void *s, size_t n)
+{
+ __memset_power7 (s, 0, n);
+}
+
+libc_ifunc (__bzero,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __bzero_power7 :
+ (hwcap & PPC_FEATURE_ARCH_2_05)
+ ? __bzero_power6 :
+ (hwcap & PPC_FEATURE_POWER4)
+ ? __bzero_power4
+ : __bzero_ppc32);
+
+weak_alias (__bzero, bzero)
+#endif
diff --git a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
index 800aff7..45943cf 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
@@ -46,7 +46,27 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
else if (hwcap & PPC_FEATURE_POWER5)
hwcap |= PPC_FEATURE_POWER4;
+ /* Support sysdeps/powerpc/powerpc32/multiarch/bzero.c. */
+ IFUNC_IMPL (i, name, bzero,
+ IFUNC_IMPL_ADD (array, i, bzero, hwcap & PPC_FEATURE_HAS_VSX,
+ __bzero_power7)
+ IFUNC_IMPL_ADD (array, i, bzero, hwcap & PPC_FEATURE_ARCH_2_05,
+ __bzero_power6)
+ IFUNC_IMPL_ADD (array, i, bzero, hwcap & PPC_FEATURE_POWER4,
+ __bzero_power4)
+ IFUNC_IMPL_ADD (array, i, bzero, 1, __bzero_ppc32))
+
#ifdef SHARED
+ /* Support sysdeps/powerpc/powerpc32/multiarch/memset.c. */
+ IFUNC_IMPL (i, name, memset,
+ IFUNC_IMPL_ADD (array, i, memset, hwcap & PPC_FEATURE_HAS_VSX,
+ __memset_power7)
+ IFUNC_IMPL_ADD (array, i, memset, hwcap & PPC_FEATURE_ARCH_2_05,
+ __memset_power6)
+ IFUNC_IMPL_ADD (array, i, memset, hwcap & PPC_FEATURE_POWER4,
+ __memset_power4)
+ IFUNC_IMPL_ADD (array, i, memset, 1, __memset_ppc32))
+
/* Support sysdeps/powerpc/powerpc32/multiarch/memcpy.c. */
IFUNC_IMPL (i, name, memcpy,
IFUNC_IMPL_ADD (array, i, memcpy, hwcap & PPC_FEATURE_HAS_VSX,
diff --git a/sysdeps/powerpc/powerpc32/power4/memset.S b/sysdeps/powerpc/powerpc32/multiarch/memset-power4.S
similarity index 98%
rename from sysdeps/powerpc/powerpc32/power4/memset.S
rename to sysdeps/powerpc/powerpc32/multiarch/memset-power4.S
index c2d288b..ceb5888 100644
--- a/sysdeps/powerpc/powerpc32/power4/memset.S
+++ b/sysdeps/powerpc/powerpc32/multiarch/memset-power4.S
@@ -1,4 +1,4 @@
-/* Optimized memset implementation for PowerPC64.
+/* Optimized memset implementation for PowerPC32.
Copyright (C) 1997-2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -26,7 +26,7 @@
to 0, to take advantage of the dcbz instruction. */
.machine power4
-EALIGN (memset, 5, 0)
+EALIGN (__memset_power4, 5, 0)
CALL_MCOUNT
#define rTMP r0
@@ -222,5 +222,4 @@ L(medium_28t):
stw rCHR, -4(rMEMP)
stw rCHR, -8(rMEMP)
blr
-END (memset)
-libc_hidden_builtin_def (memset)
+END (__memset_power4)
diff --git a/sysdeps/powerpc/powerpc32/power6/memset.S b/sysdeps/powerpc/powerpc32/multiarch/memset-power6.S
similarity index 99%
rename from sysdeps/powerpc/powerpc32/power6/memset.S
rename to sysdeps/powerpc/powerpc32/multiarch/memset-power6.S
index ce06630..493c1ef 100644
--- a/sysdeps/powerpc/powerpc32/power6/memset.S
+++ b/sysdeps/powerpc/powerpc32/multiarch/memset-power6.S
@@ -26,7 +26,7 @@
to 0, to take advantage of the dcbz instruction. */
.machine power6
-EALIGN (memset, 7, 0)
+EALIGN (__memset_power6, 7, 0)
CALL_MCOUNT
#define rTMP r0
@@ -535,5 +535,4 @@ L(medium_28t):
stw rCHR, -4(rMEMP)
stw rCHR, -8(rMEMP)
blr
-END (memset)
-libc_hidden_builtin_def (memset)
+END (__memset_power6)
diff --git a/sysdeps/powerpc/powerpc32/power7/memset.S b/sysdeps/powerpc/powerpc32/multiarch/memset-power7.S
similarity index 99%
rename from sysdeps/powerpc/powerpc32/power7/memset.S
rename to sysdeps/powerpc/powerpc32/multiarch/memset-power7.S
index 360ea71..f8adb0b 100644
--- a/sysdeps/powerpc/powerpc32/power7/memset.S
+++ b/sysdeps/powerpc/powerpc32/multiarch/memset-power7.S
@@ -23,7 +23,7 @@
Returns 's'. */
.machine power7
-EALIGN (memset, 5, 0)
+EALIGN (__memset_power7, 5, 0)
CALL_MCOUNT
.align 4
@@ -426,6 +426,4 @@ L(small):
stw 4,0(10)
stw 4,4(10)
blr
-
-END (memset)
-libc_hidden_builtin_def (memset)
+END (__memset_power7)
diff --git a/sysdeps/powerpc/powerpc32/multiarch/memset-ppc32.S b/sysdeps/powerpc/powerpc32/multiarch/memset-ppc32.S
new file mode 100644
index 0000000..775a85a
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/memset-ppc32.S
@@ -0,0 +1,41 @@
+/* Default memset implementation for PowerPC32.
+ Copyright (C) 1997-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>
+
+#if defined SHARED && !defined NOT_IN_libc
+# undef EALIGN
+# define EALIGN(name, alignt, words) \
+ .globl C_SYMBOL_NAME(__memset_ppc32); \
+ .type C_SYMBOL_NAME(__memset_ppc32),@function; \
+ .align ALIGNARG(alignt); \
+ EALIGN_W_##words; \
+ C_LABEL(__memset_ppc32) \
+ cfi_startproc;
+
+# undef END
+# define END(name) \
+ cfi_endproc; \
+ ASM_SIZE_DIRECTIVE(__memset_ppc32)
+
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name) \
+ .globl __GI_memset; __GI_memset = __memset_ppc32
+#endif
+
+#include <sysdeps/powerpc/powerpc32/memset.S>
diff --git a/sysdeps/powerpc/powerpc32/multiarch/memset.c b/sysdeps/powerpc/powerpc32/multiarch/memset.c
new file mode 100644
index 0000000..b4c63d5
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/memset.c
@@ -0,0 +1,40 @@
+/* Multiple versions of memset.
+ 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/>. */
+
+/* Define multiple versions only for definition in libc. */
+#if defined SHARED && !defined NOT_IN_libc
+# include <string.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+extern __typeof (memset) __memset_ppc32 attribute_hidden;
+extern __typeof (memset) __memset_power4 attribute_hidden;
+extern __typeof (memset) __memset_power6 attribute_hidden;
+extern __typeof (memset) __memset_power7 attribute_hidden;
+
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
+ ifunc symbol properly. */
+libc_ifunc (memset,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __memset_power7 :
+ (hwcap & PPC_FEATURE_ARCH_2_05)
+ ? __memset_power6 :
+ (hwcap & PPC_FEATURE_POWER4)
+ ? __memset_power4
+ : __memset_ppc32);
+#endif
diff --git a/sysdeps/powerpc/powerpc32/multiarch/rtld-memset.S b/sysdeps/powerpc/powerpc32/multiarch/rtld-memset.S
new file mode 100644
index 0000000..efd2780
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/rtld-memset.S
@@ -0,0 +1,18 @@
+/* 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 <sysdeps/powerpc/powerpc32/memset.S>
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=e6007cc70b60187933d5610bfb58aeeb0a506364
commit e6007cc70b60187933d5610bfb58aeeb0a506364
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Wed Jun 5 07:46:29 2013 -0500
PowerPC: memcmp multilib for PowerPC32
diff --git a/string/memcmp.c b/string/memcmp.c
index dd76145..d7c57db 100644
--- a/string/memcmp.c
+++ b/string/memcmp.c
@@ -29,6 +29,10 @@
#undef memcmp
+#ifndef MEMCMP
+# define MEMCMP memcmp
+#endif
+
#ifdef _LIBC
# include <memcopy.h>
@@ -304,7 +308,7 @@ memcmp_not_common_alignment (srcp1, srcp2, len)
}
int
-memcmp (s1, s2, len)
+MEMCMP (s1, s2, len)
const __ptr_t s1;
const __ptr_t s2;
size_t len;
diff --git a/sysdeps/powerpc/powerpc32/multiarch/Makefile b/sysdeps/powerpc/powerpc32/multiarch/Makefile
index d8d84f5..c74e600 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/multiarch/Makefile
@@ -1,4 +1,5 @@
ifeq ($(subdir),string)
sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
- memcpy-power4 memcpy-ppc32
+ memcpy-power4 memcpy-ppc32 memcmp-power7 memcmp-power4 \
+ memcmp-ppc32
endif
diff --git a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
index 3bf0447..800aff7 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
@@ -60,6 +60,14 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
IFUNC_IMPL_ADD (array, i, memcpy, hwcap & PPC_FEATURE_POWER4,
__memcpy_power4)
IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_ppc32))
+
+ /* Support sysdeps/powerpc/powerpc32/multiarch/memcmp.c. */
+ IFUNC_IMPL (i, name, memcmp,
+ IFUNC_IMPL_ADD (array, i, memcmp, hwcap & PPC_FEATURE_HAS_VSX,
+ __memcmp_power7)
+ IFUNC_IMPL_ADD (array, i, memcmp, hwcap & PPC_FEATURE_POWER4,
+ __memcmp_power4)
+ IFUNC_IMPL_ADD (array, i, memcmp, 1, __memcmp_ppc32))
#endif
return i;
diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/multiarch/memcmp-power4.S
similarity index 99%
rename from sysdeps/powerpc/powerpc32/power4/memcmp.S
rename to sysdeps/powerpc/powerpc32/multiarch/memcmp-power4.S
index d7050a2..5cff2ae 100644
--- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/multiarch/memcmp-power4.S
@@ -1,4 +1,4 @@
-/* Optimized strcmp implementation for PowerPC64.
+/* Optimized strcmp implementation for PowerPC32/POWER4.
Copyright (C) 2003-2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -21,7 +21,7 @@
/* int [r3] memcmp (const char *s1 [r3], const char *s2 [r4], size_t size [r5]) */
.machine power4
-EALIGN (memcmp, 4, 0)
+EALIGN (__memcmp_power4, 4, 0)
CALL_MCOUNT
#define rTMP r0
@@ -977,7 +977,4 @@ L(dureturn25):
lwz r24,20(r1)
lwz 1,0(1)
blr
-END (memcmp)
-
-libc_hidden_builtin_def (memcmp)
-weak_alias (memcmp, bcmp)
+END (__memcmp_power4)
diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/multiarch/memcmp-power7.S
similarity index 99%
rename from sysdeps/powerpc/powerpc32/power7/memcmp.S
rename to sysdeps/powerpc/powerpc32/multiarch/memcmp-power7.S
index f764b7c..5d63634 100644
--- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/multiarch/memcmp-power7.S
@@ -23,7 +23,7 @@
size_t size [r5]) */
.machine power7
-EALIGN (memcmp,4,0)
+EALIGN (__memcmp_power7,4,0)
CALL_MCOUNT
#define rTMP r0
@@ -980,6 +980,4 @@ L(dureturn25):
lwz r24,20(r1)
lwz 1,0(1)
blr
-END (memcmp)
-libc_hidden_builtin_def (memcmp)
-weak_alias (memcmp,bcmp)
+END (__memcmp_power7)
diff --git a/sysdeps/powerpc/powerpc32/multiarch/memcmp-ppc32.c b/sysdeps/powerpc/powerpc32/multiarch/memcmp-ppc32.c
new file mode 100644
index 0000000..460419d
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/memcmp-ppc32.c
@@ -0,0 +1,34 @@
+/* Default memcmp implementation for PowerPC32.
+ 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 <string.h>
+
+#define MEMCMP __memcmp_ppc32
+#undef weak_alias
+#define weak_alias(name, aliasname) \
+ extern __typeof (__memcmp_ppc32) aliasname \
+ __attribute__ ((weak, alias ("__memcmp_ppc32")));
+#if !defined(NOT_IN_libc) && defined(SHARED)
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name) \
+ __hidden_ver1(__memcmp_ppc32, __GI_memcmp, __memcmp_ppc32);
+#endif
+
+extern __typeof (memcmp) __memcmp_ppc32 attribute_hidden;
+
+#include <string/memcmp.c>
diff --git a/sysdeps/powerpc/powerpc32/multiarch/memcmp.c b/sysdeps/powerpc/powerpc32/multiarch/memcmp.c
new file mode 100644
index 0000000..36fd32d
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/memcmp.c
@@ -0,0 +1,39 @@
+/* Multiple versions of memcmp.
+ 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/>. */
+
+/* Define multiple versions only for definition in libc. */
+#ifndef NOT_IN_libc
+# include <string.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+extern __typeof (memcmp) __memcmp_ppc32 attribute_hidden;
+extern __typeof (memcmp) __memcmp_power4 attribute_hidden;
+extern __typeof (memcmp) __memcmp_power7 attribute_hidden;
+
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
+ ifunc symbol properly. */
+libc_ifunc (memcmp,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __memcmp_power7 :
+ (hwcap & PPC_FEATURE_POWER4)
+ ? __memcmp_power4
+ : __memcmp_ppc32);
+#else
+#include <string/memcmp.c>
+#endif
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=d2baa8f27227ccabd4a9ee6b653fb5b33ab3f47d
commit d2baa8f27227ccabd4a9ee6b653fb5b33ab3f47d
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Wed Jun 5 07:15:23 2013 -0500
PowerPC: memcpy multilib for PowerPC32
diff --git a/string/memcpy.c b/string/memcpy.c
index 3be8e35..a5b97ef 100644
--- a/string/memcpy.c
+++ b/string/memcpy.c
@@ -24,8 +24,12 @@
#undef memcpy
+#ifndef MEMCPY
+# define MEMCPY memcpy
+#endif
+
void *
-memcpy (dstpp, srcpp, len)
+MEMCPY (dstpp, srcpp, len)
void *dstpp;
const void *srcpp;
size_t len;
diff --git a/sysdeps/powerpc/powerpc32/multiarch/Makefile b/sysdeps/powerpc/powerpc32/multiarch/Makefile
index af8d496..d8d84f5 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/multiarch/Makefile
@@ -1,3 +1,4 @@
ifeq ($(subdir),string)
-sysdep_routines +=
+sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
+ memcpy-power4 memcpy-ppc32
endif
diff --git a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
index f4e55ae..3bf0447 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
@@ -46,5 +46,21 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
else if (hwcap & PPC_FEATURE_POWER5)
hwcap |= PPC_FEATURE_POWER4;
+#ifdef SHARED
+ /* Support sysdeps/powerpc/powerpc32/multiarch/memcpy.c. */
+ IFUNC_IMPL (i, name, memcpy,
+ IFUNC_IMPL_ADD (array, i, memcpy, hwcap & PPC_FEATURE_HAS_VSX,
+ __memcpy_power7)
+ IFUNC_IMPL_ADD (array, i, memcpy, hwcap & PPC_FEATURE_ARCH_2_06,
+ __memcpy_a2)
+ IFUNC_IMPL_ADD (array, i, memcpy, hwcap & PPC_FEATURE_ARCH_2_05,
+ __memcpy_power6)
+ IFUNC_IMPL_ADD (array, i, memcpy, hwcap & PPC_FEATURE_CELL_BE,
+ __memcpy_cell)
+ IFUNC_IMPL_ADD (array, i, memcpy, hwcap & PPC_FEATURE_POWER4,
+ __memcpy_power4)
+ IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_ppc32))
+#endif
+
return i;
}
diff --git a/sysdeps/powerpc/powerpc32/a2/memcpy.S b/sysdeps/powerpc/powerpc32/multiarch/memcpy-a2.S
similarity index 99%
rename from sysdeps/powerpc/powerpc32/a2/memcpy.S
rename to sysdeps/powerpc/powerpc32/multiarch/memcpy-a2.S
index f2f63b1..67e0f1b 100644
--- a/sysdeps/powerpc/powerpc32/a2/memcpy.S
+++ b/sysdeps/powerpc/powerpc32/multiarch/memcpy-a2.S
@@ -23,7 +23,7 @@
#define ZERO_AHEAD 2 /* no cache lines DST zeroing ahead */
.machine a2
-EALIGN (memcpy, 5, 0)
+EALIGN (__memcpy_a2, 5, 0)
CALL_MCOUNT
dcbt 0,r4 /* Prefetch ONE SRC cacheline */
@@ -523,5 +523,4 @@ L(endloop2_128):
b L(lessthancacheline)
-END (memcpy)
-libc_hidden_builtin_def (memcpy)
+END (__memcpy_a2)
diff --git a/sysdeps/powerpc/powerpc32/cell/memcpy.S b/sysdeps/powerpc/powerpc32/multiarch/memcpy-cell.S
similarity index 98%
rename from sysdeps/powerpc/powerpc32/cell/memcpy.S
rename to sysdeps/powerpc/powerpc32/multiarch/memcpy-cell.S
index f3605d7..8b0bf40 100644
--- a/sysdeps/powerpc/powerpc32/cell/memcpy.S
+++ b/sysdeps/powerpc/powerpc32/multiarch/memcpy-cell.S
@@ -39,7 +39,7 @@
.align 7
-EALIGN (memcpy, 5, 0)
+EALIGN (__memcpy_cell, 5, 0)
CALL_MCOUNT
dcbt 0,r4 /* Prefetch ONE SRC cacheline */
@@ -238,5 +238,4 @@ EALIGN (memcpy, 5, 0)
stb r0,0(r6)
1: blr
-END (memcpy)
-libc_hidden_builtin_def (memcpy)
+END (__memcpy_cell)
diff --git a/sysdeps/powerpc/powerpc32/power4/memcpy.S b/sysdeps/powerpc/powerpc32/multiarch/memcpy-power4.S
similarity index 98%
rename from sysdeps/powerpc/powerpc32/power4/memcpy.S
rename to sysdeps/powerpc/powerpc32/multiarch/memcpy-power4.S
index d914663..a9b4e6c 100644
--- a/sysdeps/powerpc/powerpc32/power4/memcpy.S
+++ b/sysdeps/powerpc/powerpc32/multiarch/memcpy-power4.S
@@ -1,4 +1,4 @@
-/* Optimized memcpy implementation for PowerPC32 on PowerPC64.
+/* Optimized memcpy implementation for PowerPC32.
Copyright (C) 2003-2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -32,7 +32,7 @@
Each case has an optimized unrolled loop. */
.machine power4
-EALIGN (memcpy, 5, 0)
+EALIGN (__memcpy_power4, 5, 0)
CALL_MCOUNT
stwu 1,-32(1)
@@ -418,6 +418,4 @@ EALIGN (memcpy, 5, 0)
lwz 31,24(1)
addi 1,1,32
blr
-END (memcpy)
-
-libc_hidden_builtin_def (memcpy)
+END (__memcpy_power4)
diff --git a/sysdeps/powerpc/powerpc32/power6/memcpy.S b/sysdeps/powerpc/powerpc32/multiarch/memcpy-power6.S
similarity index 99%
rename from sysdeps/powerpc/powerpc32/power6/memcpy.S
rename to sysdeps/powerpc/powerpc32/multiarch/memcpy-power6.S
index c3d55b7..4e39046 100644
--- a/sysdeps/powerpc/powerpc32/power6/memcpy.S
+++ b/sysdeps/powerpc/powerpc32/multiarch/memcpy-power6.S
@@ -32,7 +32,7 @@
Each case has an optimized unrolled loop. */
.machine power6
-EALIGN (memcpy, 5, 0)
+EALIGN (__memcpy_power6, 5, 0)
CALL_MCOUNT
stwu 1,-32(1)
@@ -835,6 +835,4 @@ L(wdus_0):
lwz 31,24(1)
addi 1,1,32
blr
-END (memcpy)
-
-libc_hidden_builtin_def (memcpy)
+END (__memcpy_power6)
diff --git a/sysdeps/powerpc/powerpc32/power7/memcpy.S b/sysdeps/powerpc/powerpc32/multiarch/memcpy-power7.S
similarity index 99%
rename from sysdeps/powerpc/powerpc32/power7/memcpy.S
rename to sysdeps/powerpc/powerpc32/multiarch/memcpy-power7.S
index 7f00778..00e9fd7 100644
--- a/sysdeps/powerpc/powerpc32/power7/memcpy.S
+++ b/sysdeps/powerpc/powerpc32/multiarch/memcpy-power7.S
@@ -23,7 +23,7 @@
Returns 'dst'. */
.machine power7
-EALIGN (memcpy, 5, 0)
+EALIGN (__memcpy_power7, 5, 0)
CALL_MCOUNT
stwu 1,-32(1)
@@ -520,5 +520,4 @@ L(end_unaligned_loop):
addi 1,1,32
blr
-END (memcpy)
-libc_hidden_builtin_def (memcpy)
+END (__memcpy_power7)
diff --git a/sysdeps/powerpc/powerpc32/multiarch/memcpy-ppc32.c b/sysdeps/powerpc/powerpc32/multiarch/memcpy-ppc32.c
new file mode 100644
index 0000000..8157bed
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/memcpy-ppc32.c
@@ -0,0 +1,30 @@
+/* Default memcpy for PowerPC32.
+ 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 <string.h>
+
+#define MEMCPY __memcpy_ppc32
+#if defined SHARED && !defined NOT_IN_libc
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name) \
+ __hidden_ver1(__memcpy_ppc32, __GI_memcpy, __memcpy_ppc32);
+#endif
+
+extern __typeof (memcpy) __memcpy_ppc32 attribute_hidden;
+
+#include <string/memcpy.c>
diff --git a/sysdeps/powerpc/powerpc32/multiarch/memcpy.c b/sysdeps/powerpc/powerpc32/multiarch/memcpy.c
new file mode 100644
index 0000000..572cc69
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/memcpy.c
@@ -0,0 +1,50 @@
+/* Multiple versions of memcpy.
+ 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/>. */
+
+/* Define multiple versions only for the definition in lib and for
+ DSO. In static binaries we need memcpy before the initialization
+ happened. */
+#if defined SHARED && !defined NOT_IN_libc
+# include <string.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+extern __typeof (memcpy) __memcpy_ppc32 attribute_hidden;
+extern __typeof (memcpy) __memcpy_power4 attribute_hidden;
+extern __typeof (memcpy) __memcpy_cell attribute_hidden;
+extern __typeof (memcpy) __memcpy_power6 attribute_hidden;
+extern __typeof (memcpy) __memcpy_a2 attribute_hidden;
+extern __typeof (memcpy) __memcpy_power7 attribute_hidden;
+
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
+ ifunc symbol properly. */
+libc_ifunc (memcpy,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __memcpy_power7 :
+ (hwcap & PPC_FEATURE_ARCH_2_06)
+ ? __memcpy_a2 :
+ (hwcap & PPC_FEATURE_ARCH_2_05)
+ ? __memcpy_power6 :
+ (hwcap & PPC_FEATURE_CELL_BE)
+ ? __memcpy_cell :
+ (hwcap & PPC_FEATURE_POWER4)
+ ? __memcpy_power4
+ : __memcpy_ppc32);
+#else
+#include <string/memcpy.c>
+#endif
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=1aaea127a19a6d9a7c517f93619b4abd69ecc0f4
commit 1aaea127a19a6d9a7c517f93619b4abd69ecc0f4
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Wed Jun 5 07:13:56 2013 -0500
PowerPC: initial support for multilib for PowerPC32
This patch add a empty Makefile, the C IFUNC helper macros, and a empty
available IFUNC implementation enumeration.
diff --git a/sysdeps/powerpc/powerpc32/multiarch/Makefile b/sysdeps/powerpc/powerpc32/multiarch/Makefile
new file mode 100644
index 0000000..af8d496
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/Makefile
@@ -0,0 +1,3 @@
+ifeq ($(subdir),string)
+sysdep_routines +=
+endif
diff --git a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
new file mode 100644
index 0000000..f4e55ae
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
@@ -0,0 +1,50 @@
+/* Enumerate available IFUNC implementations of a function. PowerPC32 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 <assert.h>
+#include <string.h>
+#include <wchar.h>
+#include <ldsodefs.h>
+#include <ifunc-impl-list.h>
+
+/* Maximum number of IFUNC implementations. */
+#define MAX_IFUNC 6
+
+size_t
+__libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+ size_t max)
+{
+ assert (max >= MAX_IFUNC);
+
+ size_t i = 0;
+
+ unsigned long int hwcap = GLRO(dl_hwcap);
+ /* hwcap contains only the latest supported ISA, the code checks which is
+ and fills the previous supported ones. */
+ if (hwcap & PPC_FEATURE_ARCH_2_06)
+ hwcap |= PPC_FEATURE_ARCH_2_05 | PPC_FEATURE_POWER5_PLUS |
+ PPC_FEATURE_POWER5 | PPC_FEATURE_POWER4;
+ else if (hwcap & PPC_FEATURE_ARCH_2_05)
+ hwcap |= PPC_FEATURE_POWER5_PLUS | PPC_FEATURE_POWER5 | PPC_FEATURE_POWER4;
+ else if (hwcap & PPC_FEATURE_POWER5_PLUS)
+ hwcap |= PPC_FEATURE_POWER5 | PPC_FEATURE_POWER4;
+ else if (hwcap & PPC_FEATURE_POWER5)
+ hwcap |= PPC_FEATURE_POWER4;
+
+ return i;
+}
diff --git a/sysdeps/powerpc/powerpc32/multiarch/init-arch.h b/sysdeps/powerpc/powerpc32/multiarch/init-arch.h
new file mode 100644
index 0000000..490c0b4
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/init-arch.h
@@ -0,0 +1,52 @@
+/* This file is part of the GNU C Library.
+ Copyright (C) 2013 Free Software Foundation, Inc.
+
+ 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 <ldsodefs.h>
+
+/* The code checks if _rtld_global_ro was realocated before trying to access
+ the dl_hwcap field. The assembly is to make the compiler not optimize the
+ test (&_rtld_global_ro != NULL), which is always true in ISO C (but not
+ in that case since _rtld_global_ro might not been realocated yet). */
+#if defined(SHARED) && !defined(IS_IN_rtld)
+# define __GLRO(value) \
+ ({ volatile void **__p = (volatile void**)(&_rtld_global_ro); \
+ unsigned long int __ret; \
+ asm ("# x in %0" : "+r" (__p)); \
+ __ret = (__p) ? GLRO(value) : 0; \
+ __ret; })
+#else
+# define __GLRO(value) GLRO(value)
+#endif
+
+/* dl_hwcap contains only the latest supported ISA, the macro checks which is
+ and fills the previous ones. */
+#define INIT_ARCH() \
+ unsigned long int hwcap = __GLRO(dl_hwcap); \
+ if (hwcap & PPC_FEATURE_ARCH_2_06) \
+ hwcap |= PPC_FEATURE_ARCH_2_05 | \
+ PPC_FEATURE_POWER5_PLUS | \
+ PPC_FEATURE_POWER5 | \
+ PPC_FEATURE_POWER4; \
+ else if (hwcap & PPC_FEATURE_ARCH_2_05) \
+ hwcap |= PPC_FEATURE_POWER5_PLUS | \
+ PPC_FEATURE_POWER5 | \
+ PPC_FEATURE_POWER4; \
+ else if (hwcap & PPC_FEATURE_POWER5_PLUS) \
+ hwcap |= PPC_FEATURE_POWER5 | \
+ PPC_FEATURE_POWER4; \
+ else if (hwcap & PPC_FEATURE_POWER5) \
+ hwcap |= PPC_FEATURE_POWER4;
-----------------------------------------------------------------------
hooks/post-receive
--
GNU C Library master sources