]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
powerpc: Remove POWER7 strncasecmp optimization
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 2 May 2025 12:07:36 +0000 (09:07 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 6 May 2025 16:31:01 +0000 (13:31 -0300)
These routines are not extensively used (gnulib documentation even
recommend use a replacement [1]), and there is already a POWER8
version that uses proper vectorized instructions.

[1] https://www.gnu.org/software/gnulib/manual/gnulib.html#C-strings

Checked with a build for some powerpc variations.
Reviewed-by: Peter Bergner <bergner@linux.ibm.com>
12 files changed:
sysdeps/powerpc/powerpc32/power4/multiarch/Makefile
sysdeps/powerpc/powerpc32/power4/multiarch/ifunc-impl-list.c
sysdeps/powerpc/powerpc32/power4/multiarch/strncase-power7.c [deleted file]
sysdeps/powerpc/powerpc32/power4/multiarch/strncase.c [deleted file]
sysdeps/powerpc/powerpc32/power4/multiarch/strncase_l-power7.c [deleted file]
sysdeps/powerpc/powerpc32/power4/multiarch/strncase_l.c [deleted file]
sysdeps/powerpc/powerpc64/multiarch/Makefile
sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
sysdeps/powerpc/powerpc64/multiarch/strncase-power7.c [deleted file]
sysdeps/powerpc/powerpc64/multiarch/strncase.c
sysdeps/powerpc/powerpc64/multiarch/strncase_l-power7.c [deleted file]
sysdeps/powerpc/powerpc64/multiarch/strncase_l.c [deleted file]

index 0a4e82843528b7e43ee3df351783aa4f01f67bd0..3a49b855ca548b7754ba4c0dd47326edcde7a451 100644 (file)
@@ -6,12 +6,9 @@ sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
                   memchr-ppc32 memrchr-power7 memrchr-ppc32 rawmemchr-power7 \
                   rawmemchr-ppc32 strlen-power7 strlen-ppc32 strnlen-power7 \
                   strnlen-ppc32 \
-                  strcasecmp-power7 strcasecmp_l-power7 strncase-power7 \
-                  strncase_l-power7 strchrnul-power7 strchrnul-ppc32 \
+                  strcasecmp-power7 strcasecmp_l-power7 \
+                  strchrnul-power7 strchrnul-ppc32 \
                   strchr-power7 strchr-ppc32 \
                   wordcopy-power7 wordcopy-ppc32 \
                   memmove-power7 memmove-ppc
-
-CFLAGS-strncase-power7.c += -mcpu=power7 -funroll-loops
-CFLAGS-strncase_l-power7.c += -mcpu=power7 -funroll-loops
 endif
index 68a3f9d6577f834352f50b93841dfa31962f48f0..7537f3a5c2db5231ac8c525f04ceb249fa01f1fb 100644 (file)
@@ -138,21 +138,6 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
              IFUNC_IMPL_ADD (array, i, strcasecmp_l, 1,
                              __strcasecmp_l_ppc))
 
-  /* Support sysdeps/powerpc/powerpc32/power4/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_ppc))
-
-  /* Support sysdeps/powerpc/powerpc32/power4/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_ppc))
-
   /* Support sysdeps/powerpc/powerpc32/power4/multiarch/strchrnul.c.  */
   IFUNC_IMPL (i, name, strchrnul,
              IFUNC_IMPL_ADD (array, i, strchrnul,
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/strncase-power7.c b/sysdeps/powerpc/powerpc32/power4/multiarch/strncase-power7.c
deleted file mode 100644 (file)
index 5b45ed5..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Optimized strcasecmp_l implementation for POWER7.
-   Copyright (C) 2013-2025 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
-   <https://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/power4/multiarch/strncase.c b/sysdeps/powerpc/powerpc32/power4/multiarch/strncase.c
deleted file mode 100644 (file)
index 3cd6433..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Multiple versions of strncasecmp.
-   Copyright (C) 2013-2025 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
-   <https://www.gnu.org/licenses/>.  */
-
-#if IS_IN (libc)
-# include <string.h>
-# define strncasecmp __strncasecmp_ppc
-extern __typeof (__strncasecmp) __strncasecmp_ppc attribute_hidden;
-extern __typeof (__strncasecmp) __strncasecmp_power7 attribute_hidden;
-#endif
-
-#include <string/strncase.c>
-#undef strncasecmp
-
-#if IS_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_ppc);
-weak_alias (__libc_strncasecmp, strncasecmp)
-#endif
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/strncase_l-power7.c b/sysdeps/powerpc/powerpc32/power4/multiarch/strncase_l-power7.c
deleted file mode 100644 (file)
index d425680..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Optimized strcasecmp_l implementation for POWER7.
-   Copyright (C) 2013-2025 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
-   <https://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/power4/multiarch/strncase_l.c b/sysdeps/powerpc/powerpc32/power4/multiarch/strncase_l.c
deleted file mode 100644 (file)
index 388d482..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Multiple versions of strncasecmp_l.
-   Copyright (C) 2013-2025 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
-   <https://www.gnu.org/licenses/>.  */
-
-#if IS_IN (libc)
-# include <string.h>
-# define strncasecmp_l __strncasecmp_l_ppc
-extern __typeof (__strncasecmp_l) __strncasecmp_l_ppc attribute_hidden;
-extern __typeof (__strncasecmp_l) __strncasecmp_l_power7 attribute_hidden;
-#endif
-
-#include <string/strncase_l.c>
-#undef strncasecmp_l
-
-#if IS_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_ppc);
-
-weak_alias (__libc_strncasecmp_l, strncasecmp_l)
-#endif
index dc7c5b14ee615f1004dcb8563ff1d16b4252f87f..624439d8c3707501a8033d1182829a22829127d7 100644 (file)
@@ -11,7 +11,6 @@ sysdep_routines += memcpy-power8-cached memcpy-power7 memcpy-a2 memcpy-power6 \
                   strlen-power7 strlen-ppc64 \
                   strnlen-power8 strnlen-power7 strnlen-ppc64 \
                   strcasecmp-power7 strcasecmp_l-power7 \
-                  strncase-power7 strncase_l-power7 \
                   strncmp-power8 strncmp-ppc64 \
                   strchr-power8 strchr-power7 strchr-ppc64 \
                   strchrnul-power8 strchrnul-power7 strchrnul-ppc64 \
@@ -38,8 +37,6 @@ sysdep_routines += memchr-power10 memcmp-power10 memcpy-power10 \
                   stpcpy-power9 strlen-power9 strncpy-power9 stpncpy-power9 \
                   strlen-power10
 endif
-CFLAGS-strncase-power7.c += -mcpu=power7 -funroll-loops
-CFLAGS-strncase_l-power7.c += -mcpu=power7 -funroll-loops
 endif
 
 # Called during static initialization
index 0a31a5853cea8c758fbd9da9c7cf65f928c68ac3..f3acd38b221cf15b9a031f8e0a5f0dcd8135ac03 100644 (file)
@@ -311,19 +311,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
                              hwcap2 & PPC_FEATURE2_ARCH_2_07
                               && hwcap & PPC_FEATURE_HAS_ALTIVEC,
                              __strncasecmp_power8)
-             IFUNC_IMPL_ADD (array, i, strncasecmp,
-                             hwcap & PPC_FEATURE_ARCH_2_06,
-                             __strncasecmp_power7)
              IFUNC_IMPL_ADD (array, i, strncasecmp, 1, __strncasecmp_ppc))
 
-  /* Support sysdeps/powerpc/powerpc64/multiarch/strncase_l.c.  */
-  IFUNC_IMPL (i, name, strncasecmp_l,
-             IFUNC_IMPL_ADD (array, i, strncasecmp_l,
-                             hwcap & PPC_FEATURE_ARCH_2_06,
-                             __strncasecmp_l_power7)
-             IFUNC_IMPL_ADD (array, i, strncasecmp_l, 1,
-                             __strncasecmp_l_ppc))
-
   /* Support sysdeps/powerpc/powerpc64/multiarch/strrchr.c.  */
   IFUNC_IMPL (i, name, strrchr,
              IFUNC_IMPL_ADD (array, i, strrchr,
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncase-power7.c b/sysdeps/powerpc/powerpc64/multiarch/strncase-power7.c
deleted file mode 100644 (file)
index a5b0685..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Copyright (C) 2013-2025 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
-   <https://www.gnu.org/licenses/>.  */
-
-#include <string.h>
-
-#define __strncasecmp __strncasecmp_power7
-
-extern __typeof (strncasecmp) __strncasecmp_power7 attribute_hidden;
-
-#include <string/strncase.c>
index a83c11a6b045c1c8e514e2ea34c94f94015a160f..807b0af4e5f4a73c61051ca2a2c2936add81d939 100644 (file)
 extern __typeof (__strncasecmp) __libc_strncasecmp;
 
 extern __typeof (__strncasecmp) __strncasecmp_ppc attribute_hidden;
-extern __typeof (__strncasecmp) __strncasecmp_power7 attribute_hidden;
 extern __typeof (__strncasecmp) __strncasecmp_power8 attribute_hidden;
 
 libc_ifunc (__libc_strncasecmp,
             (hwcap2 & PPC_FEATURE2_ARCH_2_07
              && hwcap & PPC_FEATURE_HAS_ALTIVEC)
-             ? __strncasecmp_power8:
-            (hwcap & PPC_FEATURE_ARCH_2_06)
-             ? __strncasecmp_power7
-             : __strncasecmp_ppc);
+             ? __strncasecmp_power8
+            : __strncasecmp_ppc);
 
 weak_alias (__libc_strncasecmp, strncasecmp)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncase_l-power7.c b/sysdeps/powerpc/powerpc64/multiarch/strncase_l-power7.c
deleted file mode 100644 (file)
index e9c9022..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Copyright (C) 2013-2025 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
-   <https://www.gnu.org/licenses/>.  */
-
-#include <string.h>
-
-#define __strncasecmp_l __strncasecmp_l_power7
-
-#undef weak_alias
-#define weak_alias(a,b)
-
-#undef libc_hidden_def
-#define libc_hidden_def(name)
-
-extern __typeof (strncasecmp_l) __strncasecmp_l_power7 attribute_hidden;
-
-#include <string/strncase_l.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncase_l.c b/sysdeps/powerpc/powerpc64/multiarch/strncase_l.c
deleted file mode 100644 (file)
index 1f28448..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Multiple versions of strncasecmp_l
-   Copyright (C) 2013-2025 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
-   <https://www.gnu.org/licenses/>.  */
-
-#if IS_IN (libc)
-# include <string.h>
-# define strncasecmp_l __strncasecmp_l_ppc
-extern __typeof (__strncasecmp_l) __strncasecmp_l_ppc attribute_hidden;
-extern __typeof (__strncasecmp_l) __strncasecmp_l_power7 attribute_hidden;
-#endif
-
-#include <string/strncase_l.c>
-#undef strncasecmp_l
-
-#if IS_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_ARCH_2_06)
-             ? __strncasecmp_l_power7
-             : __strncasecmp_l_ppc);
-
-weak_alias (__libc_strncasecmp_l, strncasecmp_l)
-#endif