powerpc: Remove bcopy optimizations
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 10 Feb 2022 14:08:59 +0000 (11:08 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 23 Feb 2022 17:06:49 +0000 (14:06 -0300)
The symbols is not present in current POSIX specification and compiler
already generates memmove call.

sysdeps/powerpc/powerpc64/le/power10/memmove.S
sysdeps/powerpc/powerpc64/multiarch/Makefile
sysdeps/powerpc/powerpc64/multiarch/bcopy-ppc64.c [deleted file]
sysdeps/powerpc/powerpc64/multiarch/bcopy.c [deleted file]
sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
sysdeps/powerpc/powerpc64/multiarch/memmove-power10.S
sysdeps/powerpc/powerpc64/multiarch/memmove-power7.S
sysdeps/powerpc/powerpc64/power7/bcopy.c [deleted file]
sysdeps/powerpc/powerpc64/power7/memmove.S

index eda86b1..3024718 100644 (file)
@@ -305,16 +305,3 @@ L(tail1_bwd):
 
 END_GEN_TB (MEMMOVE,TB_TOCLESS)
 libc_hidden_builtin_def (memmove)
-
-/* void bcopy(const void *src [r3], void *dest [r4], size_t n [r5])
-   Implemented in this file to avoid linker create a stub function call
-   in the branch to '_memmove'.  */
-ENTRY_TOCLESS (__bcopy)
-       mr      r6,r3
-       mr      r3,r4
-       mr      r4,r6
-       b       L(_memmove)
-END (__bcopy)
-#ifndef __bcopy
-weak_alias (__bcopy, bcopy)
-#endif
index 626845a..6f2436b 100644 (file)
@@ -24,7 +24,7 @@ sysdep_routines += memcpy-power8-cached memcpy-power7 memcpy-a2 memcpy-power6 \
                   stpncpy-power8 stpncpy-power7 stpncpy-ppc64 \
                   strcmp-power8 strcmp-power7 strcmp-ppc64 \
                   strcat-power8 strcat-power7 strcat-ppc64 \
-                  memmove-power7 memmove-ppc64 wordcopy-ppc64 bcopy-ppc64 \
+                  memmove-power7 memmove-ppc64 wordcopy-ppc64 \
                   strncpy-power8 strstr-power7 strstr-ppc64 \
                   strspn-power8 strspn-ppc64 strcspn-power8 strcspn-ppc64 \
                   strlen-power8 strcasestr-power8 strcasestr-ppc64 \
diff --git a/sysdeps/powerpc/powerpc64/multiarch/bcopy-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/bcopy-ppc64.c
deleted file mode 100644 (file)
index fe68713..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/* PowerPC64 default bcopy.
-   Copyright (C) 2014-2022 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>
-
-extern __typeof (bcopy)   __bcopy_ppc attribute_hidden;
-extern __typeof (memmove) __memmove_ppc attribute_hidden;
-
-void __bcopy_ppc (const void *src, void *dest, size_t n)
-{
-  __memmove_ppc (dest, src, n);
-}
diff --git a/sysdeps/powerpc/powerpc64/multiarch/bcopy.c b/sysdeps/powerpc/powerpc64/multiarch/bcopy.c
deleted file mode 100644 (file)
index 84c6adf..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/* PowerPC64 multiarch bcopy.
-   Copyright (C) 2014-2022 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>
-#include "init-arch.h"
-
-extern __typeof (bcopy) __bcopy_ppc attribute_hidden;
-/* __bcopy_power7 symbol is implemented at memmove-power7.S  */
-extern __typeof (bcopy) __bcopy_power7 attribute_hidden;
-#ifdef __LITTLE_ENDIAN__
-extern __typeof (bcopy) __bcopy_power10 attribute_hidden;
-#endif
-
-libc_ifunc (bcopy,
-#ifdef __LITTLE_ENDIAN__
-           (hwcap2 & PPC_FEATURE2_ARCH_3_1
-            && hwcap2 & PPC_FEATURE2_HAS_ISEL
-            && hwcap & PPC_FEATURE_HAS_VSX)
-           ? __bcopy_power10 :
-#endif
-            (hwcap & PPC_FEATURE_HAS_VSX)
-            ? __bcopy_power7
-            : __bcopy_ppc);
index a0f9fce..280b861 100644 (file)
@@ -244,19 +244,6 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
                              __bzero_power4)
              IFUNC_IMPL_ADD (array, i, bzero, 1, __bzero_ppc))
 
-  /* Support sysdeps/powerpc/powerpc64/multiarch/bcopy.c.  */
-  IFUNC_IMPL (i, name, bcopy,
-#ifdef __LITTLE_ENDIAN__
-             IFUNC_IMPL_ADD (array, i, bcopy,
-                             hwcap2 & PPC_FEATURE2_ARCH_3_1
-                             && hwcap2 & PPC_FEATURE2_HAS_ISEL
-                             && hwcap & PPC_FEATURE_HAS_VSX,
-                             __bcopy_power10)
-#endif
-             IFUNC_IMPL_ADD (array, i, bcopy, hwcap & PPC_FEATURE_HAS_VSX,
-                             __bcopy_power7)
-             IFUNC_IMPL_ADD (array, i, bcopy, 1, __bcopy_ppc))
-
   /* Support sysdeps/powerpc/powerpc64/multiarch/mempcpy.c.  */
   IFUNC_IMPL (i, name, mempcpy,
              IFUNC_IMPL_ADD (array, i, mempcpy,
index e5df085..a66d289 100644 (file)
@@ -21,7 +21,4 @@
 #undef libc_hidden_builtin_def
 #define libc_hidden_builtin_def(name)
 
-#undef __bcopy
-#define __bcopy __bcopy_power10
-
 #include <sysdeps/powerpc/powerpc64/le/power10/memmove.S>
index a7b05eb..0a6c7cb 100644 (file)
@@ -21,7 +21,4 @@
 #undef libc_hidden_builtin_def
 #define libc_hidden_builtin_def(name)
 
-#undef __bcopy
-#define __bcopy __bcopy_power7
-
 #include <sysdeps/powerpc/powerpc64/power7/memmove.S>
diff --git a/sysdeps/powerpc/powerpc64/power7/bcopy.c b/sysdeps/powerpc/powerpc64/power7/bcopy.c
deleted file mode 100644 (file)
index 4a6a400..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/* Implemented at memmove.S  */
index 1d10a3d..5a1055c 100644 (file)
@@ -821,17 +821,3 @@ L(end_unaligned_loop_bwd):
        blr
 END_GEN_TB (MEMMOVE, TB_TOCLESS)
 libc_hidden_builtin_def (memmove)
-
-
-/* void bcopy(const void *src [r3], void *dest [r4], size_t n [r5])
-   Implemented in this file to avoid linker create a stub function call
-   in the branch to '_memmove'.  */
-ENTRY_TOCLESS (__bcopy)
-       mr      r6,r3
-       mr      r3,r4
-       mr      r4,r6
-       b       L(_memmove)
-END (__bcopy)
-#ifndef __bcopy
-weak_alias (__bcopy, bcopy)
-#endif