]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
i386: Remove bcopy optimizations
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 10 Feb 2022 14:20:54 +0000 (11:20 -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.

14 files changed:
sysdeps/i386/bcopy.S [deleted file]
sysdeps/i386/i686/bcopy.S [deleted file]
sysdeps/i386/i686/memmove.S
sysdeps/i386/i686/multiarch/Makefile
sysdeps/i386/i686/multiarch/bcopy-ia32.S [deleted file]
sysdeps/i386/i686/multiarch/bcopy-sse2-unaligned.S [deleted file]
sysdeps/i386/i686/multiarch/bcopy-ssse3-rep.S [deleted file]
sysdeps/i386/i686/multiarch/bcopy-ssse3.S [deleted file]
sysdeps/i386/i686/multiarch/bcopy.c [deleted file]
sysdeps/i386/i686/multiarch/ifunc-impl-list.c
sysdeps/i386/i686/multiarch/memcpy-sse2-unaligned.S
sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S
sysdeps/i386/i686/multiarch/memcpy-ssse3.S
sysdeps/i386/memcpy.S

diff --git a/sysdeps/i386/bcopy.S b/sysdeps/i386/bcopy.S
deleted file mode 100644 (file)
index 12b8ddb..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#define USE_AS_MEMMOVE
-#define USE_AS_BCOPY
-#define MEMCPY         bcopy
-#include "memcpy.S"
diff --git a/sysdeps/i386/i686/bcopy.S b/sysdeps/i386/i686/bcopy.S
deleted file mode 100644 (file)
index 15ef941..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#define USE_AS_BCOPY
-#define memmove bcopy
-#include <sysdeps/i386/i686/memmove.S>
index 0301560bb8b8643cb9a8b499532a2c90f9c1dd66..bdc69d315aef011ea351c0f1326825f0a9605174 100644 (file)
 
        .text
 
-#ifdef USE_AS_BCOPY
-# define SRC   RTN
-# define DEST  SRC+4
-# define LEN   DEST+4
-#else
-# define DEST  RTN
-# define SRC   DEST+4
-# define LEN   SRC+4
-
-# if defined PIC && IS_IN (libc)
+#define DEST   RTN
+#define SRC    DEST+4
+#define LEN    SRC+4
+
+#if defined PIC && IS_IN (libc)
 ENTRY_CHK (__memmove_chk)
        movl    12(%esp), %eax
        cmpl    %eax, 16(%esp)
        jb      HIDDEN_JUMPTARGET (__chk_fail)
 END_CHK (__memmove_chk)
-# endif
 #endif
 
 ENTRY (memmove)
@@ -71,9 +65,7 @@ ENTRY (memmove)
        movsl
        movl    %edx, %esi
        cfi_restore (esi)
-#ifndef USE_AS_BCOPY
        movl    DEST(%esp), %eax
-#endif
 
        popl    %edi
        cfi_adjust_cfa_offset (-4)
@@ -103,9 +95,7 @@ ENTRY (memmove)
        movsl
        movl    %edx, %esi
        cfi_restore (esi)
-#ifndef USE_AS_BCOPY
        movl    DEST(%esp), %eax
-#endif
 
        cld
        popl    %edi
@@ -114,6 +104,4 @@ ENTRY (memmove)
 
        ret
 END (memmove)
-#ifndef USE_AS_BCOPY
 libc_hidden_builtin_def (memmove)
-#endif
index c4897922d710d37eda00cd8960e0ffa3e79381e1..02fa02658ef2007fb2e2e98ea2c5f47e35de2454 100644 (file)
@@ -2,7 +2,7 @@ ifeq ($(subdir),string)
 gen-as-const-headers += locale-defines.sym
 sysdep_routines += bzero-sse2 memset-sse2 memcpy-ssse3 mempcpy-ssse3 \
                   memmove-ssse3 memcpy-ssse3-rep mempcpy-ssse3-rep \
-                  memmove-ssse3-rep bcopy-ssse3 bcopy-ssse3-rep \
+                  memmove-ssse3-rep \
                   memset-sse2-rep bzero-sse2-rep strcmp-ssse3 \
                   strcmp-sse4 strncmp-c strncmp-ssse3 strncmp-sse4 \
                   memcmp-ssse3 memcmp-sse4 varshift \
@@ -18,10 +18,10 @@ sysdep_routines += bzero-sse2 memset-sse2 memcpy-ssse3 mempcpy-ssse3 \
                   strcasecmp_l-c strcasecmp-c strcasecmp_l-ssse3 \
                   strncase_l-c strncase-c strncase_l-ssse3 \
                   strcasecmp_l-sse4 strncase_l-sse4 \
-                  bcopy-sse2-unaligned memcpy-sse2-unaligned \
+                  memcpy-sse2-unaligned \
                   mempcpy-sse2-unaligned memmove-sse2-unaligned \
                   strcspn-c strpbrk-c strspn-c \
-                  bcopy-ia32 bzero-ia32 rawmemchr-ia32 \
+                  bzero-ia32 rawmemchr-ia32 \
                   memchr-ia32 memcmp-ia32 memcpy-ia32 memmove-ia32 \
                   mempcpy-ia32 memset-ia32 strcat-ia32 strchr-ia32 \
                   strrchr-ia32 strcpy-ia32 strcmp-ia32 strcspn-ia32 \
diff --git a/sysdeps/i386/i686/multiarch/bcopy-ia32.S b/sysdeps/i386/i686/multiarch/bcopy-ia32.S
deleted file mode 100644 (file)
index e0fadc0..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/* bcopy optimized for i686.
-   Copyright (C) 2017-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/>.  */
-
-#define bcopy __bcopy_ia32
-#include <sysdeps/i386/i686/bcopy.S>
diff --git a/sysdeps/i386/i686/multiarch/bcopy-sse2-unaligned.S b/sysdeps/i386/i686/multiarch/bcopy-sse2-unaligned.S
deleted file mode 100644 (file)
index efef2a1..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#define USE_AS_MEMMOVE
-#define USE_AS_BCOPY
-#define MEMCPY         __bcopy_sse2_unaligned
-#include "memcpy-sse2-unaligned.S"
diff --git a/sysdeps/i386/i686/multiarch/bcopy-ssse3-rep.S b/sysdeps/i386/i686/multiarch/bcopy-ssse3-rep.S
deleted file mode 100644 (file)
index cbc8b42..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#define USE_AS_MEMMOVE
-#define USE_AS_BCOPY
-#define MEMCPY         __bcopy_ssse3_rep
-#include "memcpy-ssse3-rep.S"
diff --git a/sysdeps/i386/i686/multiarch/bcopy-ssse3.S b/sysdeps/i386/i686/multiarch/bcopy-ssse3.S
deleted file mode 100644 (file)
index 36aac44..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#define USE_AS_MEMMOVE
-#define USE_AS_BCOPY
-#define MEMCPY         __bcopy_ssse3
-#include "memcpy-ssse3.S"
diff --git a/sysdeps/i386/i686/multiarch/bcopy.c b/sysdeps/i386/i686/multiarch/bcopy.c
deleted file mode 100644 (file)
index bc2c2ac..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Multiple versions of bcopy.
-   All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2017-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/>.  */
-
-/* Define multiple versions only for the definition in libc.  */
-#if IS_IN (libc)
-# define bcopy __redirect_bcopy
-# include <string.h>
-# undef bcopy
-
-# define SYMBOL_NAME bcopy
-# include "ifunc-memmove.h"
-
-libc_ifunc_redirected (__redirect_bcopy, bcopy, IFUNC_SELECTOR ());
-#endif
index 6883b3d226abde7d2d9fe319b39ea9eed41bb415..5c7a42dc97e01761d675b953f7b9dce8d2377680 100644 (file)
@@ -36,16 +36,6 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
 
   size_t i = 0;
 
-  /* Support sysdeps/i386/i686/multiarch/bcopy.S.  */
-  IFUNC_IMPL (i, name, bcopy,
-             IFUNC_IMPL_ADD (array, i, bcopy, CPU_FEATURE_USABLE (SSSE3),
-                             __bcopy_ssse3_rep)
-             IFUNC_IMPL_ADD (array, i, bcopy, CPU_FEATURE_USABLE (SSSE3),
-                             __bcopy_ssse3)
-             IFUNC_IMPL_ADD (array, i, bcopy, CPU_FEATURE_USABLE (SSE2),
-                             __bcopy_sse2_unaligned)
-             IFUNC_IMPL_ADD (array, i, bcopy, 1, __bcopy_ia32))
-
   /* Support sysdeps/i386/i686/multiarch/bzero.S.  */
   IFUNC_IMPL (i, name, bzero,
              IFUNC_IMPL_ADD (array, i, bzero, CPU_FEATURE_USABLE (SSE2),
index 72c97a9dbe511df1123585350167355e1f666cbb..ed1f3836a61d31936bc2685dd8a3cb5f70a09f40 100644 (file)
 #  define MEMCPY_CHK   __memcpy_chk_sse2_unaligned
 # endif
 
-# ifdef USE_AS_BCOPY
-#  define SRC          PARMS
-#  define DEST         SRC+4
-#  define LEN          DEST+4
-# else
-#  define DEST         PARMS
-#  define SRC          DEST+4
-#  define LEN          SRC+4
-# endif
+# define DEST          PARMS
+# define SRC           DEST+4
+# define LEN           SRC+4
 
 # define CFI_PUSH(REG)         \
   cfi_adjust_cfa_offset (4);           \
@@ -56,7 +50,7 @@
 # define RETURN        RETURN_END; CFI_PUSH (%ebx)
 
        .section .text.sse2,"ax",@progbits
-# if !defined USE_AS_BCOPY && defined SHARED
+# if defined SHARED
 ENTRY (MEMCPY_CHK)
        movl    12(%esp), %eax
        cmpl    %eax, 16(%esp)
@@ -671,7 +665,7 @@ L(len_5_8_bytes):
 
 L(return):
        movl    %edx, %eax
-# if !defined USE_AS_BCOPY && defined USE_AS_MEMPCPY
+# ifdef USE_AS_MEMPCPY
        movl    LEN(%esp), %ecx
        add     %ecx, %eax
 # endif
index 38fc56db71188e6b70d653e7394cdf26847b6b68..8e3c67d8e1c47d7320828d673239aef3413c2051 100644 (file)
 # define MEMCPY_CHK    __memcpy_chk_ssse3_rep
 #endif
 
-#ifdef USE_AS_BCOPY
-# define SRC           PARMS
-# define DEST          SRC+4
-# define LEN           DEST+4
-#else
-# define DEST          PARMS
-# define SRC           DEST+4
-# define LEN           SRC+4
-#endif
+#define DEST           PARMS
+#define SRC            DEST+4
+#define LEN            SRC+4
 
 #define CFI_PUSH(REG)                                          \
   cfi_adjust_cfa_offset (4);                                   \
@@ -99,7 +93,7 @@
 #endif
 
        .section .text.ssse3,"ax",@progbits
-#if !defined USE_AS_BCOPY && defined SHARED
+#ifdef SHARED
 ENTRY (MEMCPY_CHK)
        movl    12(%esp), %eax
        cmpl    %eax, 16(%esp)
@@ -1097,12 +1091,10 @@ L(fwd_write_4bytes):
        movl    -4(%eax), %ecx
        movl    %ecx, -4(%edx)
 L(fwd_write_0bytes):
-#ifndef USE_AS_BCOPY
-# ifdef USE_AS_MEMPCPY
+#ifdef USE_AS_MEMPCPY
        movl    %edx, %eax
-# else
+#else
        movl    DEST(%esp), %eax
-# endif
 #endif
        RETURN
 
@@ -1112,12 +1104,10 @@ L(fwd_write_5bytes):
        movl    -4(%eax), %eax
        movl    %ecx, -5(%edx)
        movl    %eax, -4(%edx)
-#ifndef USE_AS_BCOPY
-# ifdef USE_AS_MEMPCPY
+#ifdef USE_AS_MEMPCPY
        movl    %edx, %eax
-# else
+#else
        movl    DEST(%esp), %eax
-# endif
 #endif
        RETURN
 
@@ -1157,12 +1147,10 @@ L(fwd_write_9bytes):
 L(fwd_write_1bytes):
        movzbl  -1(%eax), %ecx
        movb    %cl, -1(%edx)
-#ifndef USE_AS_BCOPY
-# ifdef USE_AS_MEMPCPY
+#ifdef USE_AS_MEMPCPY
        movl    %edx, %eax
-# else
+#else
        movl    DEST(%esp), %eax
-# endif
 #endif
        RETURN
 
@@ -1203,12 +1191,10 @@ L(fwd_write_6bytes):
 L(fwd_write_2bytes):
        movzwl  -2(%eax), %ecx
        movw    %cx, -2(%edx)
-#ifndef USE_AS_BCOPY
-# ifdef USE_AS_MEMPCPY
+#ifdef USE_AS_MEMPCPY
        movl    %edx, %eax
-# else
+#else
        movl    DEST(%esp), %eax
-# endif
 #endif
        RETURN
 
@@ -1251,12 +1237,10 @@ L(fwd_write_3bytes):
        movzbl  -1(%eax), %eax
        movw    %cx, -3(%edx)
        movb    %al, -1(%edx)
-#ifndef USE_AS_BCOPY
-# ifdef USE_AS_MEMPCPY
+#ifdef USE_AS_MEMPCPY
        movl    %edx, %eax
-# else
+#else
        movl    DEST(%esp), %eax
-# endif
 #endif
        RETURN_END
 
@@ -1357,12 +1341,10 @@ L(copy_page_by_rep_left_1):
 L(copy_page_by_rep_exit):
        POP (%esi)
        POP (%edi)
-#ifndef USE_AS_BCOPY
        movl    DEST(%esp), %eax
-# ifdef USE_AS_MEMPCPY
+#ifdef USE_AS_MEMPCPY
        movl    LEN(%esp), %ecx
        add     %ecx, %eax
-# endif
 #endif
        RETURN
 
@@ -1401,12 +1383,10 @@ L(bk_write_4bytes):
        movl    (%eax), %ecx
        movl    %ecx, (%edx)
 L(bk_write_0bytes):
-#ifndef USE_AS_BCOPY
        movl    DEST(%esp), %eax
-# ifdef USE_AS_MEMPCPY
+#ifdef USE_AS_MEMPCPY
        movl    LEN(%esp), %ecx
        add     %ecx, %eax
-# endif
 #endif
        RETURN
 
@@ -1447,12 +1427,10 @@ L(bk_write_5bytes):
 L(bk_write_1bytes):
        movzbl  (%eax), %ecx
        movb    %cl, (%edx)
-#ifndef USE_AS_BCOPY
        movl    DEST(%esp), %eax
-# ifdef USE_AS_MEMPCPY
+#ifdef USE_AS_MEMPCPY
        movl    LEN(%esp), %ecx
        add     %ecx, %eax
-# endif
 #endif
        RETURN
 
@@ -1493,12 +1471,10 @@ L(bk_write_6bytes):
 L(bk_write_2bytes):
        movzwl  (%eax), %ecx
        movw    %cx, (%edx)
-#ifndef USE_AS_BCOPY
        movl    DEST(%esp), %eax
-# ifdef USE_AS_MEMPCPY
+#ifdef USE_AS_MEMPCPY
        movl    LEN(%esp), %ecx
        add     %ecx, %eax
-# endif
 #endif
        RETURN
 
@@ -1541,12 +1517,10 @@ L(bk_write_3bytes):
        movw    %cx, 1(%edx)
        movzbl  (%eax), %eax
        movb    %al, (%edx)
-#ifndef USE_AS_BCOPY
        movl    DEST(%esp), %eax
-# ifdef USE_AS_MEMPCPY
+#ifdef USE_AS_MEMPCPY
        movl    LEN(%esp), %ecx
        add     %ecx, %eax
-# endif
 #endif
        RETURN_END
 
index 62ae4a8d65b47cbf507252be4dbdb9cf54aad7c3..18c0913e5decc9e6ba721e4ee2c99ca9b60db69e 100644 (file)
 #  define MEMCPY_CHK   __memcpy_chk_ssse3
 # endif
 
-# ifdef USE_AS_BCOPY
-#  define SRC          PARMS
-#  define DEST         SRC+4
-#  define LEN          DEST+4
-# else
-#  define DEST         PARMS
-#  define SRC          DEST+4
-#  define LEN          SRC+4
-# endif
+# define DEST          PARMS
+# define SRC           DEST+4
+# define LEN           SRC+4
 
 # define CFI_PUSH(REG)         \
   cfi_adjust_cfa_offset (4);           \
@@ -88,7 +82,7 @@
 # endif
 
        .section .text.ssse3,"ax",@progbits
-# if !defined USE_AS_BCOPY && defined SHARED
+# ifdef SHARED
 ENTRY (MEMCPY_CHK)
        movl    12(%esp), %eax
        cmpl    %eax, 16(%esp)
@@ -1979,12 +1973,10 @@ L(fwd_write_12bytes):
 L(fwd_write_4bytes):
        movl    -4(%eax), %ecx
        movl    %ecx, -4(%edx)
-# ifndef USE_AS_BCOPY
-#  ifdef USE_AS_MEMPCPY
+# ifdef USE_AS_MEMPCPY
        movl    %edx, %eax
-#  else
+# else
        movl    DEST(%esp), %eax
-#  endif
 # endif
        RETURN
 
@@ -2005,12 +1997,10 @@ L(fwd_write_8bytes):
        movq    -8(%eax), %xmm0
        movq    %xmm0, -8(%edx)
 L(fwd_write_0bytes):
-# ifndef USE_AS_BCOPY
-#  ifdef USE_AS_MEMPCPY
+# ifdef USE_AS_MEMPCPY
        movl    %edx, %eax
-#  else
+# else
        movl    DEST(%esp), %eax
-#  endif
 # endif
        RETURN
 
@@ -2020,12 +2010,10 @@ L(fwd_write_5bytes):
        movl    -4(%eax), %eax
        movl    %ecx, -5(%edx)
        movl    %eax, -4(%edx)
-# ifndef USE_AS_BCOPY
-#  ifdef USE_AS_MEMPCPY
+# ifdef USE_AS_MEMPCPY
        movl    %edx, %eax
-#  else
+# else
        movl    DEST(%esp), %eax
-#  endif
 # endif
        RETURN
 
@@ -2049,12 +2037,10 @@ L(fwd_write_13bytes):
        movl    %ecx, -5(%edx)
        movzbl  -1(%eax), %ecx
        movb    %cl, -1(%edx)
-# ifndef USE_AS_BCOPY
-#  ifdef USE_AS_MEMPCPY
+# ifdef USE_AS_MEMPCPY
        movl    %edx, %eax
-#  else
+# else
        movl    DEST(%esp), %eax
-#  endif
 # endif
        RETURN
 
@@ -2077,12 +2063,10 @@ L(fwd_write_9bytes):
 L(fwd_write_1bytes):
        movzbl  -1(%eax), %ecx
        movb    %cl, -1(%edx)
-# ifndef USE_AS_BCOPY
-#  ifdef USE_AS_MEMPCPY
+# ifdef USE_AS_MEMPCPY
        movl    %edx, %eax
-#  else
+# else
        movl    DEST(%esp), %eax
-#  endif
 # endif
        RETURN
 
@@ -2107,12 +2091,10 @@ L(fwd_write_6bytes):
        movl    %ecx, -6(%edx)
        movzwl  -2(%eax), %ecx
        movw    %cx, -2(%edx)
-# ifndef USE_AS_BCOPY
-#  ifdef USE_AS_MEMPCPY
+# ifdef USE_AS_MEMPCPY
        movl    %edx, %eax
-#  else
+# else
        movl    DEST(%esp), %eax
-#  endif
 # endif
        RETURN
 
@@ -2135,12 +2117,10 @@ L(fwd_write_10bytes):
 L(fwd_write_2bytes):
        movzwl  -2(%eax), %ecx
        movw    %cx, -2(%edx)
-# ifndef USE_AS_BCOPY
-#  ifdef USE_AS_MEMPCPY
+# ifdef USE_AS_MEMPCPY
        movl    %edx, %eax
-#  else
+# else
        movl    DEST(%esp), %eax
-#  endif
 # endif
        RETURN
 
@@ -2167,12 +2147,10 @@ L(fwd_write_7bytes):
        movzbl  -1(%eax), %eax
        movw    %cx, -3(%edx)
        movb    %al, -1(%edx)
-# ifndef USE_AS_BCOPY
-#  ifdef USE_AS_MEMPCPY
+# ifdef USE_AS_MEMPCPY
        movl    %edx, %eax
-#  else
+# else
        movl    DEST(%esp), %eax
-#  endif
 # endif
        RETURN
 
@@ -2197,12 +2175,10 @@ L(fwd_write_3bytes):
        movzbl  -1(%eax), %eax
        movw    %cx, -3(%edx)
        movb    %al, -1(%edx)
-# ifndef USE_AS_BCOPY
-#  ifdef USE_AS_MEMPCPY
+# ifdef USE_AS_MEMPCPY
        movl    %edx, %eax
-#  else
+# else
        movl    DEST(%esp), %eax
-#  endif
 # endif
        RETURN
 
@@ -2217,12 +2193,10 @@ L(fwd_write_8bytes_align):
        movq    -8(%eax), %xmm0
        movq    %xmm0, -8(%edx)
 L(fwd_write_0bytes_align):
-# ifndef USE_AS_BCOPY
-#  ifdef USE_AS_MEMPCPY
+# ifdef USE_AS_MEMPCPY
        movl    %edx, %eax
-#  else
+# else
        movl    DEST(%esp), %eax
-#  endif
 # endif
        RETURN
 
@@ -2233,12 +2207,10 @@ L(fwd_write_32bytes_align):
 L(fwd_write_16bytes_align):
        movdqa  -16(%eax), %xmm0
        movdqa  %xmm0, -16(%edx)
-# ifndef USE_AS_BCOPY
-#  ifdef USE_AS_MEMPCPY
+# ifdef USE_AS_MEMPCPY
        movl    %edx, %eax
-#  else
+# else
        movl    DEST(%esp), %eax
-#  endif
 # endif
        RETURN
 
@@ -2248,12 +2220,10 @@ L(fwd_write_5bytes_align):
        movl    -4(%eax), %eax
        movl    %ecx, -5(%edx)
        movl    %eax, -4(%edx)
-# ifndef USE_AS_BCOPY
-#  ifdef USE_AS_MEMPCPY
+# ifdef USE_AS_MEMPCPY
        movl    %edx, %eax
-#  else
+# else
        movl    DEST(%esp), %eax
-#  endif
 # endif
        RETURN
 
@@ -2271,12 +2241,10 @@ L(fwd_write_13bytes_align):
        movl    %ecx, -5(%edx)
        movzbl  -1(%eax), %ecx
        movb    %cl, -1(%edx)
-# ifndef USE_AS_BCOPY
-#  ifdef USE_AS_MEMPCPY
+# ifdef USE_AS_MEMPCPY
        movl    %edx, %eax
-#  else
+# else
        movl    DEST(%esp), %eax
-#  endif
 # endif
        RETURN
 
@@ -2291,12 +2259,10 @@ L(fwd_write_21bytes_align):
        movl    %ecx, -5(%edx)
        movzbl  -1(%eax), %ecx
        movb    %cl, -1(%edx)
-# ifndef USE_AS_BCOPY
-#  ifdef USE_AS_MEMPCPY
+# ifdef USE_AS_MEMPCPY
        movl    %edx, %eax
-#  else
+# else
        movl    DEST(%esp), %eax
-#  endif
 # endif
        RETURN
 
@@ -2313,12 +2279,10 @@ L(fwd_write_9bytes_align):
 L(fwd_write_1bytes_align):
        movzbl  -1(%eax), %ecx
        movb    %cl, -1(%edx)
-# ifndef USE_AS_BCOPY
-#  ifdef USE_AS_MEMPCPY
+# ifdef USE_AS_MEMPCPY
        movl    %edx, %eax
-#  else
+# else
        movl    DEST(%esp), %eax
-#  endif
 # endif
        RETURN
 
@@ -2331,12 +2295,10 @@ L(fwd_write_17bytes_align):
        movdqa  %xmm0, -17(%edx)
        movzbl  -1(%eax), %ecx
        movb    %cl, -1(%edx)
-# ifndef USE_AS_BCOPY
-#  ifdef USE_AS_MEMPCPY
+# ifdef USE_AS_MEMPCPY
        movl    %edx, %eax
-#  else
+# else
        movl    DEST(%esp), %eax
-#  endif
 # endif
        RETURN
 
@@ -2355,12 +2317,10 @@ L(fwd_write_6bytes_align):
        movl    %ecx, -6(%edx)
        movzwl  -2(%eax), %ecx
        movw    %cx, -2(%edx)
-# ifndef USE_AS_BCOPY
-#  ifdef USE_AS_MEMPCPY
+# ifdef USE_AS_MEMPCPY
        movl    %edx, %eax
-#  else
+# else
        movl    DEST(%esp), %eax
-#  endif
 # endif
        RETURN
 
@@ -2375,12 +2335,10 @@ L(fwd_write_22bytes_align):
        movl    %ecx, -6(%edx)
        movzwl  -2(%eax), %ecx
        movw    %cx, -2(%edx)
-# ifndef USE_AS_BCOPY
-#  ifdef USE_AS_MEMPCPY
+# ifdef USE_AS_MEMPCPY
        movl    %edx, %eax
-#  else
+# else
        movl    DEST(%esp), %eax
-#  endif
 # endif
        RETURN
 
@@ -2397,12 +2355,10 @@ L(fwd_write_10bytes_align):
 L(fwd_write_2bytes_align):
        movzwl  -2(%eax), %ecx
        movw    %cx, -2(%edx)
-# ifndef USE_AS_BCOPY
-#  ifdef USE_AS_MEMPCPY
+# ifdef USE_AS_MEMPCPY
        movl    %edx, %eax
-#  else
+# else
        movl    DEST(%esp), %eax
-#  endif
 # endif
        RETURN
 
@@ -2415,12 +2371,10 @@ L(fwd_write_18bytes_align):
        movdqa  %xmm0, -18(%edx)
        movzwl  -2(%eax), %ecx
        movw    %cx, -2(%edx)
-# ifndef USE_AS_BCOPY
-#  ifdef USE_AS_MEMPCPY
+# ifdef USE_AS_MEMPCPY
        movl    %edx, %eax
-#  else
+# else
        movl    DEST(%esp), %eax
-#  endif
 # endif
        RETURN
 
@@ -2441,12 +2395,10 @@ L(fwd_write_7bytes_align):
        movzbl  -1(%eax), %eax
        movw    %cx, -3(%edx)
        movb    %al, -1(%edx)
-# ifndef USE_AS_BCOPY
-#  ifdef USE_AS_MEMPCPY
+# ifdef USE_AS_MEMPCPY
        movl    %edx, %eax
-#  else
+# else
        movl    DEST(%esp), %eax
-#  endif
 # endif
        RETURN
 
@@ -2463,12 +2415,10 @@ L(fwd_write_23bytes_align):
        movzbl  -1(%eax), %eax
        movw    %cx, -3(%edx)
        movb    %al, -1(%edx)
-# ifndef USE_AS_BCOPY
-#  ifdef USE_AS_MEMPCPY
+# ifdef USE_AS_MEMPCPY
        movl    %edx, %eax
-#  else
+# else
        movl    DEST(%esp), %eax
-#  endif
 # endif
        RETURN
 
@@ -2487,12 +2437,10 @@ L(fwd_write_3bytes_align):
        movzbl  -1(%eax), %eax
        movw    %cx, -3(%edx)
        movb    %al, -1(%edx)
-# ifndef USE_AS_BCOPY
-#  ifdef USE_AS_MEMPCPY
+# ifdef USE_AS_MEMPCPY
        movl    %edx, %eax
-#  else
+# else
        movl    DEST(%esp), %eax
-#  endif
 # endif
        RETURN
 
@@ -2507,12 +2455,10 @@ L(fwd_write_19bytes_align):
        movzbl  -1(%eax), %eax
        movw    %cx, -3(%edx)
        movb    %al, -1(%edx)
-# ifndef USE_AS_BCOPY
-#  ifdef USE_AS_MEMPCPY
+# ifdef USE_AS_MEMPCPY
        movl    %edx, %eax
-#  else
+# else
        movl    DEST(%esp), %eax
-#  endif
 # endif
        RETURN
 
@@ -2529,12 +2475,10 @@ L(fwd_write_12bytes_align):
 L(fwd_write_4bytes_align):
        movl    -4(%eax), %ecx
        movl    %ecx, -4(%edx)
-# ifndef USE_AS_BCOPY
-#  ifdef USE_AS_MEMPCPY
+# ifdef USE_AS_MEMPCPY
        movl    %edx, %eax
-#  else
+# else
        movl    DEST(%esp), %eax
-#  endif
 # endif
        RETURN
 
@@ -2547,12 +2491,10 @@ L(fwd_write_20bytes_align):
        movdqa  %xmm0, -20(%edx)
        movl    -4(%eax), %ecx
        movl    %ecx, -4(%edx)
-# ifndef USE_AS_BCOPY
-#  ifdef USE_AS_MEMPCPY
+# ifdef USE_AS_MEMPCPY
        movl    %edx, %eax
-#  else
+# else
        movl    DEST(%esp), %eax
-#  endif
 # endif
        RETURN_END
 
@@ -2646,12 +2588,10 @@ L(bk_write_4bytes):
        movl    (%eax), %ecx
        movl    %ecx, (%edx)
 L(bk_write_0bytes):
-# ifndef USE_AS_BCOPY
        movl    DEST(%esp), %eax
-#  ifdef USE_AS_MEMPCPY
+# ifdef USE_AS_MEMPCPY
        movl    LEN(%esp), %ecx
        add     %ecx, %eax
-#  endif
 # endif
        RETURN
 
@@ -2671,12 +2611,10 @@ L(bk_write_16bytes):
 L(bk_write_8bytes):
        movq    (%eax), %xmm0
        movq    %xmm0, (%edx)
-# ifndef USE_AS_BCOPY
        movl    DEST(%esp), %eax
-#  ifdef USE_AS_MEMPCPY
+# ifdef USE_AS_MEMPCPY
        movl    LEN(%esp), %ecx
        add     %ecx, %eax
-#  endif
 # endif
        RETURN
 
@@ -2702,12 +2640,10 @@ L(bk_write_5bytes):
 L(bk_write_1bytes):
        movzbl  (%eax), %ecx
        movb    %cl, (%edx)
-# ifndef USE_AS_BCOPY
        movl    DEST(%esp), %eax
-#  ifdef USE_AS_MEMPCPY
+# ifdef USE_AS_MEMPCPY
        movl    LEN(%esp), %ecx
        add     %ecx, %eax
-#  endif
 # endif
        RETURN
 
@@ -2729,12 +2665,10 @@ L(bk_write_9bytes):
        movq    %xmm0, 1(%edx)
        movzbl  (%eax), %ecx
        movb    %cl, (%edx)
-# ifndef USE_AS_BCOPY
        movl    DEST(%esp), %eax
-#  ifdef USE_AS_MEMPCPY
+# ifdef USE_AS_MEMPCPY
        movl    LEN(%esp), %ecx
        add     %ecx, %eax
-#  endif
 # endif
        RETURN
 
@@ -2759,12 +2693,10 @@ L(bk_write_6bytes):
        movl    %ecx, 2(%edx)
        movzwl  (%eax), %ecx
        movw    %cx, (%edx)
-# ifndef USE_AS_BCOPY
        movl    DEST(%esp), %eax
-#  ifdef USE_AS_MEMPCPY
+# ifdef USE_AS_MEMPCPY
        movl    LEN(%esp), %ecx
        add     %ecx, %eax
-#  endif
 # endif
        RETURN
 
@@ -2787,12 +2719,10 @@ L(bk_write_10bytes):
 L(bk_write_2bytes):
        movzwl  (%eax), %ecx
        movw    %cx, (%edx)
-# ifndef USE_AS_BCOPY
        movl    DEST(%esp), %eax
-#  ifdef USE_AS_MEMPCPY
+# ifdef USE_AS_MEMPCPY
        movl    LEN(%esp), %ecx
        add     %ecx, %eax
-#  endif
 # endif
        RETURN
 
@@ -2819,12 +2749,10 @@ L(bk_write_7bytes):
        movw    %cx, 1(%edx)
        movzbl  (%eax), %eax
        movb    %al, (%edx)
-# ifndef USE_AS_BCOPY
        movl    DEST(%esp), %eax
-#  ifdef USE_AS_MEMPCPY
+# ifdef USE_AS_MEMPCPY
        movl    LEN(%esp), %ecx
        add     %ecx, %eax
-#  endif
 # endif
        RETURN
 
@@ -2849,12 +2777,10 @@ L(bk_write_3bytes):
        movw    %cx, 1(%edx)
        movzbl  (%eax), %eax
        movb    %al, (%edx)
-# ifndef USE_AS_BCOPY
        movl    DEST(%esp), %eax
-#  ifdef USE_AS_MEMPCPY
+# ifdef USE_AS_MEMPCPY
        movl    LEN(%esp), %ecx
        add     %ecx, %eax
-#  endif
 # endif
        RETURN_END
 
index 0eca548e3e62d7051207c9ee76cbdf005f9a1422..fc197e92a8779159004c303c4d93f0b404f5da9d 100644 (file)
 # define MEMCPY_CHK    __memcpy_chk
 #endif
 
-#ifdef USE_AS_BCOPY
-# define STR2          12
-# define STR1          STR2+4
-# define N                     STR1+4
-#else
-# define STR1          12
-# define STR2          STR1+4
-# define N                     STR2+4
-#endif
+#define STR1           12
+#define STR2           STR1+4
+#define N              STR2+4
 
 #define CFI_PUSH(REG)                                          \
   cfi_adjust_cfa_offset (4);                                   \
@@ -46,7 +40,7 @@
 #define POP(REG)       popl REG; CFI_POP (REG)
 
        .text
-#if defined SHARED && IS_IN (libc) && !defined USE_AS_BCOPY
+#if defined SHARED && IS_IN (libc)
 ENTRY (MEMCPY_CHK)
        movl    12(%esp), %eax
        cmpl    %eax, 16(%esp)
@@ -90,6 +84,4 @@ L(bwd_write_0bytes):
 
 END (MEMCPY)
 
-#ifndef USE_AS_BCOPY
 libc_hidden_builtin_def (MEMCPY)
-#endif