]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
s390: Remove bzero optimizations
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 10 Feb 2022 17:47:17 +0000 (14:47 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 23 Feb 2022 17:18:18 +0000 (14:18 -0300)
The symbol is not present in current POSIX specification and compiler
already generates memset call.

sysdeps/s390/Makefile
sysdeps/s390/bzero.c [deleted file]
sysdeps/s390/ifunc-memset.h
sysdeps/s390/memset-z900.S
sysdeps/s390/multiarch/ifunc-impl-list.c

index ade8663218c30ab2ba0ea2990b27ed32f3857912..5b6a96579c00d26c1596461d92506890d0bbab75 100644 (file)
@@ -66,7 +66,7 @@ endif
 endif
 
 ifeq ($(subdir),string)
-sysdep_routines += bzero memset memset-z900 \
+sysdep_routines += memset memset-z900 \
                   memcmp memcmp-z900 \
                   mempcpy memcpy memcpy-z900 \
                   memmove memmove-c \
diff --git a/sysdeps/s390/bzero.c b/sysdeps/s390/bzero.c
deleted file mode 100644 (file)
index 1f0a03e..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Multiple versions of bzero.
-   Copyright (C) 2018-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 <ifunc-memset.h>
-#if HAVE_MEMSET_IFUNC
-# include <string.h>
-# include <ifunc-resolve.h>
-
-# if HAVE_MEMSET_Z900_G5
-extern __typeof (__bzero) BZERO_Z900_G5 attribute_hidden;
-# endif
-
-# if HAVE_MEMSET_Z10
-extern __typeof (__bzero) BZERO_Z10 attribute_hidden;
-# endif
-
-# if HAVE_MEMSET_Z196
-extern __typeof (__bzero) BZERO_Z196 attribute_hidden;
-# endif
-
-s390_libc_ifunc_expr (__bzero, __bzero,
-                     ({
-                       s390_libc_ifunc_expr_stfle_init ();
-                       (HAVE_MEMSET_Z196 && S390_IS_Z196 (stfle_bits))
-                         ? BZERO_Z196
-                         : (HAVE_MEMSET_Z10 && S390_IS_Z10 (stfle_bits))
-                         ? BZERO_Z10
-                         : BZERO_DEFAULT;
-                     })
-                     )
-weak_alias (__bzero, bzero)
-#endif
index db15df9bc106e6ebbf473c158fcb1b85f83dbda2..7098332e92b49e685aaf338b9224b36a6aeae307 100644 (file)
 
 #if defined HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT
 # define MEMSET_DEFAULT                MEMSET_Z196
-# define BZERO_DEFAULT         BZERO_Z196
 # define HAVE_MEMSET_Z900_G5   0
 # define HAVE_MEMSET_Z10       0
 # define HAVE_MEMSET_Z196      1
 #elif defined HAVE_S390_MIN_Z10_ZARCH_ASM_SUPPORT
 # define MEMSET_DEFAULT                MEMSET_Z10
-# define BZERO_DEFAULT         BZERO_Z10
 # define HAVE_MEMSET_Z900_G5   0
 # define HAVE_MEMSET_Z10       1
 # define HAVE_MEMSET_Z196      HAVE_MEMSET_IFUNC
 #else
 # define MEMSET_DEFAULT                MEMSET_Z900_G5
-# define BZERO_DEFAULT         BZERO_Z900_G5
 # define HAVE_MEMSET_Z900_G5   1
 # define HAVE_MEMSET_Z10       HAVE_MEMSET_IFUNC
 # define HAVE_MEMSET_Z196      HAVE_MEMSET_IFUNC
 
 #if HAVE_MEMSET_Z900_G5
 # define MEMSET_Z900_G5                __memset_default
-# define BZERO_Z900_G5         __bzero_default
 #else
 # define MEMSET_Z900_G5                NULL
-# define BZERO_Z900_G5         NULL
 #endif
 
 #if HAVE_MEMSET_Z10
 # define MEMSET_Z10            __memset_z10
-# define BZERO_Z10             __bzero_z10
 #else
 # define MEMSET_Z10            NULL
-# define BZERO_Z10             NULL
 #endif
 
 #if HAVE_MEMSET_Z196
 # define MEMSET_Z196           __memset_z196
-# define BZERO_Z196            __bzero_z196
 #else
 # define MEMSET_Z196           NULL
-# define BZERO_Z196            NULL
 #endif
index d454743f754ded6c4d2d729a1ea3656020bb8734..7adb466bb145aa447cc1335f7a448c47bdcbf021 100644 (file)
 /* INPUT PARAMETERS - MEMSET
      %r2 = address of memory area
      %r3 = byte to fill memory with
-     %r4 = number of bytes to fill.
-
-   INPUT PARAMETERS - BZERO
-     %r2 = address of memory area
-     %r3 = number of bytes to fill.  */
+     %r4 = number of bytes to fill.  */
 
        .text
 
 #  define BRCTG        brct
 # endif /* ! defined __s390x__  */
 
-ENTRY(BZERO_Z900_G5)
-       LGR     %r4,%r3
-       xr      %r3,%r3
-       j       .L_Z900_G5_start
-END(BZERO_Z900_G5)
-
 ENTRY(MEMSET_Z900_G5)
 .L_Z900_G5_start:
 #if defined __s390x__
@@ -100,14 +90,6 @@ END(MEMSET_Z900_G5)
 #endif /*  HAVE_MEMSET_Z900_G5  */
 
 #if HAVE_MEMSET_Z10
-ENTRY(BZERO_Z10)
-       .machine "z10"
-       .machinemode "zarch_nohighgprs"
-       lgr     %r4,%r3
-       xr      %r3,%r3
-       j       .L_Z10_start
-END(BZERO_Z10)
-
 ENTRY(MEMSET_Z10)
 .L_Z10_start:
        .machine "z10"
@@ -141,14 +123,6 @@ END(MEMSET_Z10)
 #endif /* HAVE_MEMSET_Z10  */
 
 #if HAVE_MEMSET_Z196
-ENTRY(BZERO_Z196)
-       .machine "z196"
-       .machinemode "zarch_nohighgprs"
-       lgr     %r4,%r3
-       xr      %r3,%r3
-       j       .L_Z196_start
-END(BZERO_Z196)
-
 ENTRY(MEMSET_Z196)
 .L_Z196_start:
        .machine "z196"
@@ -204,10 +178,6 @@ END(__memset_mvcle)
 /* If we don't use ifunc, define an alias for memset here.
    Otherwise see sysdeps/s390/memset.c.  */
 strong_alias (MEMSET_DEFAULT, memset)
-/* Same for bzero.  If ifunc is used, see
-   sysdeps/s390/bzero.c.  */
-strong_alias (BZERO_DEFAULT, __bzero)
-weak_alias (__bzero, bzero)
 #endif
 
 #if defined SHARED && IS_IN (libc)
index 29598c2a6e6a861dd59eaeedd60b3bb637f593c9..c1902b2c269cd4f41215a97879e947b4d1c03816 100644 (file)
@@ -102,21 +102,6 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
 # endif
 # if HAVE_MEMSET_Z900_G5
              IFUNC_IMPL_ADD (array, i, memset, 1, MEMSET_Z900_G5)
-# endif
-             )
-
-  /* Note: bzero is implemented in memset.  */
-  IFUNC_IMPL (i, name, bzero,
-# if HAVE_MEMSET_Z196
-             IFUNC_IMPL_ADD (array, i, bzero,
-                             S390_IS_Z196 (stfle_bits), BZERO_Z196)
-# endif
-# if HAVE_MEMSET_Z10
-             IFUNC_IMPL_ADD (array, i, bzero,
-                             S390_IS_Z10 (stfle_bits), BZERO_Z10)
-# endif
-# if HAVE_MEMSET_Z900_G5
-             IFUNC_IMPL_ADD (array, i, bzero, 1, BZERO_Z900_G5)
 # endif
              )
 #endif /* HAVE_MEMSET_IFUNC */