From 421e3005ca16627f4fefc51956811c1ca74377f6 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Wed, 27 Feb 2019 15:15:51 -0300 Subject: powerpc: Use generic wcschr optimization This patch removes the power6 wcschr optimization and uses generic implementation instead. Currently, both power6 and power7 IFUNC variant resulting binary are essentially the same and the generic implementation with unrolling loop set to 8 also results in similar performance. Checked on powerpc64-linux-gnu. * sysdeps/powerpc/Makefile [$(subdir) == wcsmbs] (CFLAGS-wcschr.c): New rule. * sysdeps/powerpc/power6/wcschr.c: Remove file. * sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-power6.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-power7.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-ppc32.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/wcschr.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/wcschr-power6.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/wcschr-power7.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/wcschr-ppc64.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/wcschr.c: Likewise. * sysdeps/powerpc/powerpc64/power6/wcschr.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/Makefile [$(subdir) == wcsmbs] (sysdeps_routines): Remove wcschr-power6 and wcschr-power7. (CFLAGS-wcschr-power7.c, CFLAGS-wcschr-power6.c): Remove rule. * sysdeps/powerpc/powerpc64/multiarch/Makefile: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/ifunc-impl-list.c: Remove wcschr optimizations. * sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c: Likewise. --- sysdeps/powerpc/powerpc64/multiarch/Makefile | 5 +-- .../powerpc/powerpc64/multiarch/ifunc-impl-list.c | 11 ------ .../powerpc/powerpc64/multiarch/wcschr-power6.c | 19 ---------- .../powerpc/powerpc64/multiarch/wcschr-power7.c | 19 ---------- sysdeps/powerpc/powerpc64/multiarch/wcschr-ppc64.c | 18 --------- sysdeps/powerpc/powerpc64/multiarch/wcschr.c | 43 ---------------------- sysdeps/powerpc/powerpc64/power6/wcschr.c | 1 - 7 files changed, 1 insertion(+), 115 deletions(-) delete mode 100644 sysdeps/powerpc/powerpc64/multiarch/wcschr-power6.c delete mode 100644 sysdeps/powerpc/powerpc64/multiarch/wcschr-power7.c delete mode 100644 sysdeps/powerpc/powerpc64/multiarch/wcschr-ppc64.c delete mode 100644 sysdeps/powerpc/powerpc64/multiarch/wcschr.c delete mode 100644 sysdeps/powerpc/powerpc64/power6/wcschr.c (limited to 'sysdeps/powerpc/powerpc64') diff --git a/sysdeps/powerpc/powerpc64/multiarch/Makefile b/sysdeps/powerpc/powerpc64/multiarch/Makefile index 3913ef580e..c70f4a2b5a 100644 --- a/sysdeps/powerpc/powerpc64/multiarch/Makefile +++ b/sysdeps/powerpc/powerpc64/multiarch/Makefile @@ -39,11 +39,8 @@ CFLAGS-strncase_l-power7.c += -mcpu=power7 -funroll-loops endif ifeq ($(subdir),wcsmbs) -sysdep_routines += wcschr-power7 wcschr-power6 wcschr-ppc64 \ - wcsrchr-power7 wcsrchr-power6 wcsrchr-ppc64 +sysdep_routines += wcsrchr-power7 wcsrchr-power6 wcsrchr-ppc64 -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 06d33d71e0..9b1e4d141d 100644 --- a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c +++ b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c @@ -260,17 +260,6 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_IMPL_ADD (array, i, strncasecmp_l, 1, __strncasecmp_l_ppc)) - /* 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_ppc)) - /* Support sysdeps/powerpc/powerpc64/multiarch/wcschr.c. */ IFUNC_IMPL (i, name, wcsrchr, IFUNC_IMPL_ADD (array, i, wcsrchr, diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcschr-power6.c b/sysdeps/powerpc/powerpc64/multiarch/wcschr-power6.c deleted file mode 100644 index 029608c512..0000000000 --- a/sysdeps/powerpc/powerpc64/multiarch/wcschr-power6.c +++ /dev/null @@ -1,19 +0,0 @@ -/* wcschr.c - Wide Character Search for powerpc64/power6. - Copyright (C) 2013-2019 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 . */ - -#include diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcschr-power7.c b/sysdeps/powerpc/powerpc64/multiarch/wcschr-power7.c deleted file mode 100644 index 9b11103976..0000000000 --- a/sysdeps/powerpc/powerpc64/multiarch/wcschr-power7.c +++ /dev/null @@ -1,19 +0,0 @@ -/* wcschr.c - Wide Character Search for powerpc64/power7. - Copyright (C) 2013-2019 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 . */ - -#include diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcschr-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/wcschr-ppc64.c deleted file mode 100644 index f956fc0aa2..0000000000 --- a/sysdeps/powerpc/powerpc64/multiarch/wcschr-ppc64.c +++ /dev/null @@ -1,18 +0,0 @@ -/* Copyright (C) 2013-2019 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 - . */ - -#include diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcschr.c b/sysdeps/powerpc/powerpc64/multiarch/wcschr.c deleted file mode 100644 index 0a279f0dd2..0000000000 --- a/sysdeps/powerpc/powerpc64/multiarch/wcschr.c +++ /dev/null @@ -1,43 +0,0 @@ -/* Multiple versions of wcschr - Copyright (C) 2013-2019 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 - . */ - -#if IS_IN (libc) -# define wcschr __redirect_wcschr -# define __wcschr __redirect___wcschr -# include -# include -# include "init-arch.h" - -extern __typeof (wcschr) __wcschr_ppc attribute_hidden; -extern __typeof (wcschr) __wcschr_power6 attribute_hidden; -extern __typeof (wcschr) __wcschr_power7 attribute_hidden; -# undef wcschr -# undef __wcschr - -libc_ifunc_redirected (__redirect___wcschr, __wcschr, - (hwcap & PPC_FEATURE_HAS_VSX) - ? __wcschr_power7 - : (hwcap & PPC_FEATURE_ARCH_2_05) - ? __wcschr_power6 - : __wcschr_ppc); -weak_alias (__wcschr, wcschr) -#else -#undef libc_hidden_def -#define libc_hidden_def(a) -#include -#endif diff --git a/sysdeps/powerpc/powerpc64/power6/wcschr.c b/sysdeps/powerpc/powerpc64/power6/wcschr.c deleted file mode 100644 index ae04a130cc..0000000000 --- a/sysdeps/powerpc/powerpc64/power6/wcschr.c +++ /dev/null @@ -1 +0,0 @@ -#include -- cgit v1.2.3-65-gdbad