From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x336.google.com (mail-ot1-x336.google.com [IPv6:2607:f8b0:4864:20::336]) by sourceware.org (Postfix) with ESMTPS id 097CA3948A74 for ; Wed, 23 Feb 2022 14:09:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 097CA3948A74 Received: by mail-ot1-x336.google.com with SMTP id w3-20020a056830060300b005ad10e3becaso12052028oti.3 for ; Wed, 23 Feb 2022 06:09:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Yt3lt6lIeEr2ojbW4K+xitpaiNOiBUcq9E316BwvqzE=; b=iu+tPDI6b8MNsJKXulMx1Gye7i4B0iJLWVT3+kf9Vpg15kzjJEbTWY0GH2R0ufIfzR GZGvmcJVBYZ+duQH/RX33v7RPdz85rMTY3vGgNh+d4v+3fORBrdnlQpS3MJFiNnLWAg+ 6wDbduG5ycJsDJjXscYi/GCkxW7z5e2gIfX8LI3B219erE6MmI36Y1g9pjNZLlXvKbnH cUBf0J04w+kaUIKjbNvDs2nxfJB8sfC0bCD/J87xDhnwqPE2E4Mmlgc67kScMVNRtppp zcJEjkP1o1D3qoNdQDN6o2ZtA7bmNdYRcvA9LpYwdGv61wwVOPTYp5uQRrITotAReyH2 L/EQ== X-Gm-Message-State: AOAM532zjxE7eQ+2rCIAjBbH0WWQSYBtNVJjIChpbvy9OBFquLkEapu4 kldgMGJMXgFFTuqbQHF8kjDLk4SBHjBuYg== X-Google-Smtp-Source: ABdhPJwlPicZSo//bmabXJAGOLU3YxzhatfWaN31wMAx1KIHZud7d2Tzm+vSXtNEXurFfBBX/8ETzA== X-Received: by 2002:a9d:60cd:0:b0:5ad:4854:747c with SMTP id b13-20020a9d60cd000000b005ad4854747cmr7873405otk.240.1645625380959; Wed, 23 Feb 2022 06:09:40 -0800 (PST) Received: from birita.. ([2804:431:c7ca:cb36:52bd:55cf:8e44:571]) by smtp.gmail.com with ESMTPSA id o22sm8801734otp.21.2022.02.23.06.09.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Feb 2022 06:09:40 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH v2 10/11] s390: Remove bzero optimizations Date: Wed, 23 Feb 2022 11:09:20 -0300 Message-Id: <20220223140921.2768062-11-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220223140921.2768062-1-adhemerval.zanella@linaro.org> References: <20220223140921.2768062-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Feb 2022 14:09:44 -0000 The symbol is not present in current POSIX specification and compiler already generates memset call. --- sysdeps/s390/Makefile | 2 +- sysdeps/s390/bzero.c | 47 ------------------------ sysdeps/s390/ifunc-memset.h | 9 ----- sysdeps/s390/memset-z900.S | 32 +--------------- sysdeps/s390/multiarch/ifunc-impl-list.c | 15 -------- 5 files changed, 2 insertions(+), 103 deletions(-) delete mode 100644 sysdeps/s390/bzero.c diff --git a/sysdeps/s390/Makefile b/sysdeps/s390/Makefile index ade8663218..5b6a96579c 100644 --- a/sysdeps/s390/Makefile +++ b/sysdeps/s390/Makefile @@ -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 index 1f0a03e2ed..0000000000 --- a/sysdeps/s390/bzero.c +++ /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 - . */ - -#include -#if HAVE_MEMSET_IFUNC -# include -# include - -# 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 diff --git a/sysdeps/s390/ifunc-memset.h b/sysdeps/s390/ifunc-memset.h index db15df9bc1..7098332e92 100644 --- a/sysdeps/s390/ifunc-memset.h +++ b/sysdeps/s390/ifunc-memset.h @@ -25,19 +25,16 @@ #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 @@ -51,24 +48,18 @@ #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 diff --git a/sysdeps/s390/memset-z900.S b/sysdeps/s390/memset-z900.S index d454743f75..7adb466bb1 100644 --- a/sysdeps/s390/memset-z900.S +++ b/sysdeps/s390/memset-z900.S @@ -24,11 +24,7 @@ /* 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 @@ -47,12 +43,6 @@ # 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) diff --git a/sysdeps/s390/multiarch/ifunc-impl-list.c b/sysdeps/s390/multiarch/ifunc-impl-list.c index 29598c2a6e..c1902b2c26 100644 --- a/sysdeps/s390/multiarch/ifunc-impl-list.c +++ b/sysdeps/s390/multiarch/ifunc-impl-list.c @@ -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 */ -- 2.32.0