From patchwork Thu Feb 10 19:58:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 51020 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 631D53858429 for ; Thu, 10 Feb 2022 19:59:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 631D53858429 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1644523190; bh=N2uKgEbbgL8lGF/+4fNfIAkl0W4efM8yc3xa2RkwyVU=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=d+5Uv/UKiPWRIaqFeYL1s17a/oyaKlK8GPFJ14VH8rx1KXR3UQYH8XeQGXth7w9n9 29+dQPA2ZtQQAJn/9N0qdkpGEn/n9CJ4aZVfc6V308N/h8mMECje+EuI9ozYyCTED0 zUU9v6GL1xL+t/z1gmILHdb1quzpwwwRHj4yIQ1I= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oo1-xc2e.google.com (mail-oo1-xc2e.google.com [IPv6:2607:f8b0:4864:20::c2e]) by sourceware.org (Postfix) with ESMTPS id 60E673858C20 for ; Thu, 10 Feb 2022 19:58:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 60E673858C20 Received: by mail-oo1-xc2e.google.com with SMTP id r15-20020a4ae5cf000000b002edba1d3349so7764926oov.3 for ; Thu, 10 Feb 2022 11:58:44 -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=N2uKgEbbgL8lGF/+4fNfIAkl0W4efM8yc3xa2RkwyVU=; b=Nf+qFch6Zc5AgdnoZvWB7adpa8w8BDu/iqtbm6AWQixRwH/8ZnMYc/d02jm1ezECw6 5jH+wHEu0nJp0+cNGR4nBfrMXhXyqkQBcGpPUk22x7G8dTi6tzBH/dPoT1vE7c72+xdt 4UYgmnaUpu9bezroreAnr+q/OymoPkGz5Fsu/8jS9onkzVQi7Q+todQEOC3QuzMiiemG SyDtpoAVIsJ2A3MfP+3/vE3iaJ4N7sisS9qn+KYC4SsJzFmn8RI5hq6R6rZNHCOaHdA2 hSywIwICcxUS3fPatAWYVAnT27hQju0QN4TAHUtBR8p62zSpIb2omAuZJP+qJpOPR4Rm yLCQ== X-Gm-Message-State: AOAM532TGxO16XUpy6fQqundSL+tb7yCasKnfkqh1kwNmVn/jhl+k+zS YHlR3tkAyD8idJCXhnmBEbRgIM7FoktgeQ== X-Google-Smtp-Source: ABdhPJz979iICE2+DtP6iLC9fdExCb7VC3PrOCWYgS13QsEvJZEpaRcASJxGCXg1OaqmB6k2+WVrzg== X-Received: by 2002:a4a:a5d0:: with SMTP id k16mr3305611oom.48.1644523123583; Thu, 10 Feb 2022 11:58:43 -0800 (PST) Received: from birita.. ([2804:431:c7ca:733:a925:765e:3799:3d34]) by smtp.gmail.com with ESMTPSA id bg34sm8859219oob.14.2022.02.10.11.58.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 11:58:43 -0800 (PST) To: libc-alpha@sourceware.org, Wilco Dijkstra , "H . J . Lu" , Noah Goldstein Subject: [PATCH 01/12] ia64: Remove bcopy Date: Thu, 10 Feb 2022 16:58:27 -0300 Message-Id: <20220210195838.1036012-2-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220210195838.1036012-1-adhemerval.zanella@linaro.org> References: <20220210195838.1036012-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" It just call memmove as the generic implementation. --- sysdeps/ia64/bcopy.S | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 sysdeps/ia64/bcopy.S diff --git a/sysdeps/ia64/bcopy.S b/sysdeps/ia64/bcopy.S deleted file mode 100644 index bdabf5acdc..0000000000 --- a/sysdeps/ia64/bcopy.S +++ /dev/null @@ -1,10 +0,0 @@ -#include - -ENTRY(bcopy) - .regstk 3, 0, 0, 0 - mov r8 = in0 - mov in0 = in1 - ;; - mov in1 = r8 - br.cond.sptk.many HIDDEN_BUILTIN_JUMPTARGET(memmove) -END(bcopy) From patchwork Thu Feb 10 19:58:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 51021 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 965FF3858406 for ; Thu, 10 Feb 2022 20:00:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 965FF3858406 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1644523232; bh=JyzfJAVKDrvPxhF6QF456gdpAZVih5Sf+l1H14OhewE=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=b5Ty90off1HHR/0B+zSca2iiD4KDDr99ijJOAj8CfPhBX/Wpu+KFBo+c6WvX88TVE GRt5beVDJoN3k9BbAZZdEjFxOTD0EZfCxPz9Md0MYD2Vy3t/iwACNZXAr0LhH0aBma cRwt0n1vYuG1HVBrhtHJvdmKHNYw7TaYRfJUPE6o= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oo1-xc30.google.com (mail-oo1-xc30.google.com [IPv6:2607:f8b0:4864:20::c30]) by sourceware.org (Postfix) with ESMTPS id F18D13858404 for ; Thu, 10 Feb 2022 19:58:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F18D13858404 Received: by mail-oo1-xc30.google.com with SMTP id o128-20020a4a4486000000b003181707ed40so7664065ooa.11 for ; Thu, 10 Feb 2022 11:58:45 -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=JyzfJAVKDrvPxhF6QF456gdpAZVih5Sf+l1H14OhewE=; b=noche2C30qp2h14FzUZtN5nlXNbrCpfbkso4ijrUE6dg1lycQeEsWetyy3DCKvjz4Y M7f4ei5PJxx6/WW+AHO9sq+OCtpFBGsuDMWCN85RnSpi7Z/tXYAfjQEb5tH+Lmtwm/Jq t6HgGirjdgNBpPKXBMwV0OlWlvv60ZRah4Fzaug41wpuUCxKGZy42CBeWoKIeYiltpjH gz2tCJbpQeh1YEZj6fa+uhzb0Kuw/t/QLdcfRmhbKMb+/s+ibJfLfM8ezVjq7/Lt8DKv r4SIwNLL8Nn81NbKYOXWYhPN0kRmyHkPimfb14314+nJOGF+lsmScNF79+xVgNYtdsTG 1OXQ== X-Gm-Message-State: AOAM5318u441Kjyk4dHRHP05tesF4lEN0CZpIDEh22btR6sTGX5bDPfK B9yvhYbv3rbvcP8inchTRMPTo+bvfP82wg== X-Google-Smtp-Source: ABdhPJz5mHi6Lzz2miB/7ELkJhhynEcp1k9bmOYOddyG4xCCn//aS2xjEg81W08tDLHtV/0Xb11izQ== X-Received: by 2002:a05:6870:9543:: with SMTP id v3mr1357567oal.136.1644523125214; Thu, 10 Feb 2022 11:58:45 -0800 (PST) Received: from birita.. ([2804:431:c7ca:733:a925:765e:3799:3d34]) by smtp.gmail.com with ESMTPSA id bg34sm8859219oob.14.2022.02.10.11.58.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 11:58:44 -0800 (PST) To: libc-alpha@sourceware.org, Wilco Dijkstra , "H . J . Lu" , Noah Goldstein Subject: [PATCH 02/12] powerpc: Remove bcopy optimizations Date: Thu, 10 Feb 2022 16:58:28 -0300 Message-Id: <20220210195838.1036012-3-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220210195838.1036012-1-adhemerval.zanella@linaro.org> References: <20220210195838.1036012-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.0 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-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" The symbols is not present in current POSIX specification and compiler already generates memmove call. --- .../powerpc/powerpc64/le/power10/memmove.S | 13 ------- sysdeps/powerpc/powerpc64/multiarch/Makefile | 2 +- .../powerpc/powerpc64/multiarch/bcopy-ppc64.c | 27 ------------- sysdeps/powerpc/powerpc64/multiarch/bcopy.c | 38 ------------------- .../powerpc64/multiarch/ifunc-impl-list.c | 13 ------- .../powerpc64/multiarch/memmove-power10.S | 3 -- .../powerpc64/multiarch/memmove-power7.S | 3 -- sysdeps/powerpc/powerpc64/power7/bcopy.c | 1 - sysdeps/powerpc/powerpc64/power7/memmove.S | 14 ------- 9 files changed, 1 insertion(+), 113 deletions(-) delete mode 100644 sysdeps/powerpc/powerpc64/multiarch/bcopy-ppc64.c delete mode 100644 sysdeps/powerpc/powerpc64/multiarch/bcopy.c delete mode 100644 sysdeps/powerpc/powerpc64/power7/bcopy.c diff --git a/sysdeps/powerpc/powerpc64/le/power10/memmove.S b/sysdeps/powerpc/powerpc64/le/power10/memmove.S index eda86b194e..3024718fdf 100644 --- a/sysdeps/powerpc/powerpc64/le/power10/memmove.S +++ b/sysdeps/powerpc/powerpc64/le/power10/memmove.S @@ -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 diff --git a/sysdeps/powerpc/powerpc64/multiarch/Makefile b/sysdeps/powerpc/powerpc64/multiarch/Makefile index 626845a43c..6f2436b660 100644 --- a/sysdeps/powerpc/powerpc64/multiarch/Makefile +++ b/sysdeps/powerpc/powerpc64/multiarch/Makefile @@ -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 index fe68713ad7..0000000000 --- a/sysdeps/powerpc/powerpc64/multiarch/bcopy-ppc64.c +++ /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 - . */ - -#include - -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 index 84c6adfd6e..0000000000 --- a/sysdeps/powerpc/powerpc64/multiarch/bcopy.c +++ /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 - . */ - -#include -#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); diff --git a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c index a0f9fce25d..280b8616b2 100644 --- a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c +++ b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c @@ -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, diff --git a/sysdeps/powerpc/powerpc64/multiarch/memmove-power10.S b/sysdeps/powerpc/powerpc64/multiarch/memmove-power10.S index e5df0851c0..a66d2892c4 100644 --- a/sysdeps/powerpc/powerpc64/multiarch/memmove-power10.S +++ b/sysdeps/powerpc/powerpc64/multiarch/memmove-power10.S @@ -21,7 +21,4 @@ #undef libc_hidden_builtin_def #define libc_hidden_builtin_def(name) -#undef __bcopy -#define __bcopy __bcopy_power10 - #include diff --git a/sysdeps/powerpc/powerpc64/multiarch/memmove-power7.S b/sysdeps/powerpc/powerpc64/multiarch/memmove-power7.S index a7b05ebfa9..0a6c7cb96e 100644 --- a/sysdeps/powerpc/powerpc64/multiarch/memmove-power7.S +++ b/sysdeps/powerpc/powerpc64/multiarch/memmove-power7.S @@ -21,7 +21,4 @@ #undef libc_hidden_builtin_def #define libc_hidden_builtin_def(name) -#undef __bcopy -#define __bcopy __bcopy_power7 - #include diff --git a/sysdeps/powerpc/powerpc64/power7/bcopy.c b/sysdeps/powerpc/powerpc64/power7/bcopy.c deleted file mode 100644 index 4a6a400e7a..0000000000 --- a/sysdeps/powerpc/powerpc64/power7/bcopy.c +++ /dev/null @@ -1 +0,0 @@ -/* Implemented at memmove.S */ diff --git a/sysdeps/powerpc/powerpc64/power7/memmove.S b/sysdeps/powerpc/powerpc64/power7/memmove.S index 1d10a3d593..5a1055c097 100644 --- a/sysdeps/powerpc/powerpc64/power7/memmove.S +++ b/sysdeps/powerpc/powerpc64/power7/memmove.S @@ -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 From patchwork Thu Feb 10 19:58:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 51022 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6934B3858427 for ; Thu, 10 Feb 2022 20:01:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6934B3858427 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1644523274; bh=PA5nUyiLN2rp1LHo39owGx6WO49ggu3yS+t8t9cl5sU=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=DBCwOm0BWR8DFH2Is8QnqnUvuszXsss34zNtXri0JamPv20Xjnm8yb7s5/H1+pLkW 15uI9Dh7JyenZh2h8uBM4+cBYtAiseGmtCWciyqwZHGOkUvP1UNC2oaKiPX9a+CIzc GGNzoTcgI8SuhWXhvKPUeaLZAhgmgz0Ce9yjg5Cg= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oo1-xc2d.google.com (mail-oo1-xc2d.google.com [IPv6:2607:f8b0:4864:20::c2d]) by sourceware.org (Postfix) with ESMTPS id 82355385842D for ; Thu, 10 Feb 2022 19:58:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 82355385842D Received: by mail-oo1-xc2d.google.com with SMTP id o192-20020a4a2cc9000000b00300af40d795so7683663ooo.13 for ; Thu, 10 Feb 2022 11:58:47 -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=PA5nUyiLN2rp1LHo39owGx6WO49ggu3yS+t8t9cl5sU=; b=CBw/wGPmWCzWeJCWHLG63ACxOcYwx7LHEPqG7031bvPgxKXR/Fn8v95shFX11WC2xp rIh9J8NFbH2YXUaxmzN98oPzCnNKeS6VnUIwsfMsqcYXZzNXfgX+0p/TL/+aSPH+T8// G1IHhp65Hg7RfmBIVV5D2gZmD8cOuEcy5t+pieUdkdvKI0LgWUpS3fUkUCYF8e3H4x7x TxzkAjQmGNVkRMevYRfzwAZy/5XVbBV90a+WuaBtpqvfaZu4cV6fwQNG2MSdnHWYUwuE GK/VOrACr3c0plREiAgMbShVbJTH5flYOoibOeMChedaa6hXv3AsyXPbmLAA6oKhcUrT Fx7A== X-Gm-Message-State: AOAM533MtOqdL4DGKDTQhWuxP9iqxkd/bmllA0LiIWw/MAofb4dhORBT cVseRiaM/gGxJI2PBf1bOSONBVgtLj7FKQ== X-Google-Smtp-Source: ABdhPJwJG8x5ZMmXDTiFMtKz51TsmD7v0Q7QXDV+Ki7ujCAvnhCA+eYR+atby1ipJ3fx7TgdJeXokQ== X-Received: by 2002:a05:6870:d88c:: with SMTP id dv12mr1284333oab.113.1644523126765; Thu, 10 Feb 2022 11:58:46 -0800 (PST) Received: from birita.. ([2804:431:c7ca:733:a925:765e:3799:3d34]) by smtp.gmail.com with ESMTPSA id bg34sm8859219oob.14.2022.02.10.11.58.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 11:58:46 -0800 (PST) To: libc-alpha@sourceware.org, Wilco Dijkstra , "H . J . Lu" , Noah Goldstein Subject: [PATCH 03/12] i386: Remove bcopy optimizations Date: Thu, 10 Feb 2022 16:58:29 -0300 Message-Id: <20220210195838.1036012-4-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220210195838.1036012-1-adhemerval.zanella@linaro.org> References: <20220210195838.1036012-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, KAM_STOCKGEN, 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-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" The symbols is not present in current POSIX specification and compiler already generates memmove call. --- sysdeps/i386/bcopy.S | 4 --- sysdeps/i386/i686/bcopy.S | 3 -- sysdeps/i386/i686/multiarch/Makefile | 6 ++-- sysdeps/i386/i686/multiarch/bcopy-ia32.S | 20 ------------- .../i686/multiarch/bcopy-sse2-unaligned.S | 4 --- sysdeps/i386/i686/multiarch/bcopy-ssse3-rep.S | 4 --- sysdeps/i386/i686/multiarch/bcopy-ssse3.S | 4 --- sysdeps/i386/i686/multiarch/bcopy.c | 30 ------------------- sysdeps/i386/i686/multiarch/ifunc-impl-list.c | 10 ------- 9 files changed, 3 insertions(+), 82 deletions(-) delete mode 100644 sysdeps/i386/bcopy.S delete mode 100644 sysdeps/i386/i686/bcopy.S delete mode 100644 sysdeps/i386/i686/multiarch/bcopy-ia32.S delete mode 100644 sysdeps/i386/i686/multiarch/bcopy-sse2-unaligned.S delete mode 100644 sysdeps/i386/i686/multiarch/bcopy-ssse3-rep.S delete mode 100644 sysdeps/i386/i686/multiarch/bcopy-ssse3.S delete mode 100644 sysdeps/i386/i686/multiarch/bcopy.c diff --git a/sysdeps/i386/bcopy.S b/sysdeps/i386/bcopy.S deleted file mode 100644 index 12b8ddb886..0000000000 --- a/sysdeps/i386/bcopy.S +++ /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 index 15ef9419a4..0000000000 --- a/sysdeps/i386/i686/bcopy.S +++ /dev/null @@ -1,3 +0,0 @@ -#define USE_AS_BCOPY -#define memmove bcopy -#include diff --git a/sysdeps/i386/i686/multiarch/Makefile b/sysdeps/i386/i686/multiarch/Makefile index c4897922d7..02fa02658e 100644 --- a/sysdeps/i386/i686/multiarch/Makefile +++ b/sysdeps/i386/i686/multiarch/Makefile @@ -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 index e0fadc0f3f..0000000000 --- a/sysdeps/i386/i686/multiarch/bcopy-ia32.S +++ /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 - . */ - -#define bcopy __bcopy_ia32 -#include diff --git a/sysdeps/i386/i686/multiarch/bcopy-sse2-unaligned.S b/sysdeps/i386/i686/multiarch/bcopy-sse2-unaligned.S deleted file mode 100644 index efef2a10dd..0000000000 --- a/sysdeps/i386/i686/multiarch/bcopy-sse2-unaligned.S +++ /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 index cbc8b420e8..0000000000 --- a/sysdeps/i386/i686/multiarch/bcopy-ssse3-rep.S +++ /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 index 36aac44b9c..0000000000 --- a/sysdeps/i386/i686/multiarch/bcopy-ssse3.S +++ /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 index bc2c2ac55d..0000000000 --- a/sysdeps/i386/i686/multiarch/bcopy.c +++ /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 - . */ - -/* Define multiple versions only for the definition in libc. */ -#if IS_IN (libc) -# define bcopy __redirect_bcopy -# include -# undef bcopy - -# define SYMBOL_NAME bcopy -# include "ifunc-memmove.h" - -libc_ifunc_redirected (__redirect_bcopy, bcopy, IFUNC_SELECTOR ()); -#endif diff --git a/sysdeps/i386/i686/multiarch/ifunc-impl-list.c b/sysdeps/i386/i686/multiarch/ifunc-impl-list.c index 6883b3d226..5c7a42dc97 100644 --- a/sysdeps/i386/i686/multiarch/ifunc-impl-list.c +++ b/sysdeps/i386/i686/multiarch/ifunc-impl-list.c @@ -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), From patchwork Thu Feb 10 19:58:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 51023 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 232B13858439 for ; Thu, 10 Feb 2022 20:01:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 232B13858439 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1644523316; bh=9/a/DUubaIwor2TrF7KuLESSqQh/gsJ69MGljQ3O4e8=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=TQcEieNC2e0DgJzCDa3eknZit/Ungxng55Tv4nUqbzdG3lY5BRPfxQTr0nZLeTpdd WYdwipPobF1bB+7AlWrnewOit83+QpxUdS+/bmz92Ja5wM46bgmpsrKlnSmG1urhhL v7y8Apt6AoU9RxpFJtLUXxfD6jr1rRmDd6yQrJ+4= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oi1-x22b.google.com (mail-oi1-x22b.google.com [IPv6:2607:f8b0:4864:20::22b]) by sourceware.org (Postfix) with ESMTPS id 2255F3858C20 for ; Thu, 10 Feb 2022 19:58:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2255F3858C20 Received: by mail-oi1-x22b.google.com with SMTP id u13so7173712oie.5 for ; Thu, 10 Feb 2022 11:58:49 -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=9/a/DUubaIwor2TrF7KuLESSqQh/gsJ69MGljQ3O4e8=; b=rpRSGXOiLG8NarEKWpXk+oxY80P7AiMzXvHK0KAzOYjSzX5031vHryMN6RRVUGdt4d 0oAT2Lg7iV7oTfncYQatuce/SutPIfml+y9zbnNCLihG46vawhIxnwMmN0l9gELaEqhN wXXAn/vMw1W8I8lQMeFIng8aQL0MjEUwZ4CnwoQNeB46gBPDBPs7A7WzT1BmQY3P6+ZA FFOE3Zlqn/kxg3vKy+yI8P94TKysswR1Cgu6eq9BqS03yLWNsdF19P3KCa3q2Hkk71tR e4w+lHcMCzYOiwK1PmYEvhSiQvP4dGtPNaxRfEUZY/hAfy6p/Ns9qhpQXH2JyBNvTb/A f1VA== X-Gm-Message-State: AOAM530drDQu/+vpRnL1Dj6X/dsIP38l2mmPALkh+zu+QAFgWYsRtdF5 EFTwByr4+duyFuLz1PuDUCK35eA9VStj0g== X-Google-Smtp-Source: ABdhPJwgNnbkU8s+Igrqwq1Nu0HXfnPHXBgag1ke+M0VuJbaCvSmSANS4S5K1El2ohUPWRadlg/Gig== X-Received: by 2002:a05:6808:11c5:: with SMTP id p5mr1720927oiv.59.1644523128475; Thu, 10 Feb 2022 11:58:48 -0800 (PST) Received: from birita.. ([2804:431:c7ca:733:a925:765e:3799:3d34]) by smtp.gmail.com with ESMTPSA id bg34sm8859219oob.14.2022.02.10.11.58.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 11:58:48 -0800 (PST) To: libc-alpha@sourceware.org, Wilco Dijkstra , "H . J . Lu" , Noah Goldstein Subject: [PATCH 04/12] x86_64: Remove bcopy optimizations Date: Thu, 10 Feb 2022 16:58:30 -0300 Message-Id: <20220210195838.1036012-5-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220210195838.1036012-1-adhemerval.zanella@linaro.org> References: <20220210195838.1036012-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" The symbols is not present in current POSIX specification and compiler already generates memmove call. --- sysdeps/x86_64/multiarch/bcopy.S | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 sysdeps/x86_64/multiarch/bcopy.S diff --git a/sysdeps/x86_64/multiarch/bcopy.S b/sysdeps/x86_64/multiarch/bcopy.S deleted file mode 100644 index 639f02bde3..0000000000 --- a/sysdeps/x86_64/multiarch/bcopy.S +++ /dev/null @@ -1,7 +0,0 @@ -#include - - .text -ENTRY(bcopy) - xchg %rdi, %rsi - jmp __libc_memmove /* Branch to IFUNC memmove. */ -END(bcopy) From patchwork Thu Feb 10 19:58:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 51024 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E0B8A3858427 for ; Thu, 10 Feb 2022 20:02:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E0B8A3858427 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1644523357; bh=lv+6JbiqPBvWIFaxHaXaIr7Dpnzch6MlsausK7JqMtQ=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=GMsV3Q9Iz0DO1IKXR2RFG6pdbS3rdkXUt6gH8LK9aFyZfLY0ppIkDNUF3VPtVrU9v XDksYnZrc4tRXezGmjqpN5+NVIyA9km+bsrYnPpnm2rsx4fCxiHu1XIkJfTxye11IC t7OGzcsx3pxAYH3LXSw/UQgM7d+0wF3lXAvBH3QA= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oo1-xc29.google.com (mail-oo1-xc29.google.com [IPv6:2607:f8b0:4864:20::c29]) by sourceware.org (Postfix) with ESMTPS id D834D3858429 for ; Thu, 10 Feb 2022 19:58:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D834D3858429 Received: by mail-oo1-xc29.google.com with SMTP id f11-20020a4abb0b000000b002e9abf6bcbcso7760308oop.0 for ; Thu, 10 Feb 2022 11:58:50 -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=lv+6JbiqPBvWIFaxHaXaIr7Dpnzch6MlsausK7JqMtQ=; b=eHxO3kcm9EdqXVgIxDZiX3EQBS1uWQfAAr2Segv9RVF3mm8TCBN2hC0ctmYE3sdKFJ WDXbL6cFA1nfDAbJmL1uL0B6y7XqOJKHfzhhoxY6UrohETt1mTtvVdSTFUi5K1nVvk6b jNhcxC8+b69cwFXi+351SBuH1UKg51xQGDclJFtmAEmnpDIblYBFbnR9ClXjMaekg8WJ LvB8G475vk+DsTp755awh06qpRvdVddTaQ/fIstRZqDiknnENhDFMC5zD/N+JknJ+9pW t8ueWv+1YYUBtcTu2LPPAvDgypVPNrbjKBd7+JBCMIaUsA2cLi/ulBVr8Eo03Azk8vGl /K+w== X-Gm-Message-State: AOAM530fQM7e66+T1YwZJoRPTOyYAPPXb2po/HkbxBjj2lVnqlWewmxx xHb3koxlqkM8sWmkrNPu/64sw5gWEYP7PA== X-Google-Smtp-Source: ABdhPJyABeBYPRKH2uFvasxsui7m2d2T44RtXK2bihZn1/oqAObI/TFGF18Q1+/ziF3lBozrxoKJEw== X-Received: by 2002:a05:6870:d411:: with SMTP id i17mr1329938oag.272.1644523130120; Thu, 10 Feb 2022 11:58:50 -0800 (PST) Received: from birita.. ([2804:431:c7ca:733:a925:765e:3799:3d34]) by smtp.gmail.com with ESMTPSA id bg34sm8859219oob.14.2022.02.10.11.58.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 11:58:49 -0800 (PST) To: libc-alpha@sourceware.org, Wilco Dijkstra , "H . J . Lu" , Noah Goldstein Subject: [PATCH 05/12] alpha: Remove bzero optimization Date: Thu, 10 Feb 2022 16:58:31 -0300 Message-Id: <20220210195838.1036012-6-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220210195838.1036012-1-adhemerval.zanella@linaro.org> References: <20220210195838.1036012-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.1 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-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" The symbols is not present in current POSIX specification and compiler already generates memmove call. --- sysdeps/alpha/bzero.S | 109 ------------------------------------------ 1 file changed, 109 deletions(-) delete mode 100644 sysdeps/alpha/bzero.S diff --git a/sysdeps/alpha/bzero.S b/sysdeps/alpha/bzero.S deleted file mode 100644 index 4821778622..0000000000 --- a/sysdeps/alpha/bzero.S +++ /dev/null @@ -1,109 +0,0 @@ -/* Copyright (C) 1996-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 - . */ - -/* Fill a block of memory with zeros. Optimized for the Alpha architecture: - - - memory accessed as aligned quadwords only - - destination memory not read unless needed for good cache behaviour - - basic blocks arranged to optimize branch prediction for full-quadword - aligned memory blocks. - - partial head and tail quadwords constructed with byte-mask instructions - - This is generally scheduled for the EV5 (got to look out for my own - interests :-), but with EV4 needs in mind. There *should* be no more - stalls for the EV4 than there are for the EV5. -*/ - - -#include - - .set noat - .set noreorder - - .text - .type __bzero, @function - .globl __bzero - .usepv __bzero, USEPV_PROF - - cfi_startproc - - /* On entry to this basic block: - t3 == loop counter - t4 == bytes in partial final word - a0 == possibly misaligned destination pointer */ - - .align 3 -bzero_loop: - beq t3, $tail # - blbc t3, 0f # skip single store if count even - - stq_u zero, 0(a0) # e0 : store one word - subq t3, 1, t3 # .. e1 : - addq a0, 8, a0 # e0 : - beq t3, $tail # .. e1 : - -0: stq_u zero, 0(a0) # e0 : store two words - subq t3, 2, t3 # .. e1 : - stq_u zero, 8(a0) # e0 : - addq a0, 16, a0 # .. e1 : - bne t3, 0b # e1 : - -$tail: bne t4, 1f # is there a tail to do? - ret # no - -1: ldq_u t0, 0(a0) # yes, load original data - mskqh t0, t4, t0 # - stq_u t0, 0(a0) # - ret # - -__bzero: -#ifdef PROF - ldgp gp, 0(pv) - lda AT, _mcount - jsr AT, (AT), _mcount -#endif - - mov a0, v0 # e0 : move return value in place - beq a1, $done # .. e1 : early exit for zero-length store - and a0, 7, t1 # e0 : - addq a1, t1, a1 # e1 : add dest misalignment to count - srl a1, 3, t3 # e0 : loop = count >> 3 - and a1, 7, t4 # .. e1 : find number of bytes in tail - unop # : - beq t1, bzero_loop # e1 : aligned head, jump right in - - ldq_u t0, 0(a0) # e0 : load original data to mask into - cmpult a1, 8, t2 # .. e1 : is this a sub-word set? - bne t2, $oneq # e1 : - - mskql t0, a0, t0 # e0 : we span words. finish this partial - subq t3, 1, t3 # e0 : - addq a0, 8, a0 # .. e1 : - stq_u t0, -8(a0) # e0 : - br bzero_loop # .. e1 : - - .align 3 -$oneq: - mskql t0, a0, t2 # e0 : - mskqh t0, a1, t3 # e0 : - or t2, t3, t0 # e1 : - stq_u t0, 0(a0) # e0 : - -$done: ret - - cfi_endproc -weak_alias (__bzero, bzero) From patchwork Thu Feb 10 19:58:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 51029 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CFE7D385842B for ; Thu, 10 Feb 2022 20:06:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CFE7D385842B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1644523576; bh=rbaOaESU0xM3jstDgSDs/SYsFJU7f3pS4YnLJenRfeY=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=q/NK5VWMUlUxyTdL4POeLcsFCjXJEsG/9K4aQqImA503aji/XYM2oFTJAi+jEwzIr m2cH80NjwdSA1Oxa10t8x3jF4ZXBk9oBDv2GztP00dw7PSTA8+SeujubG8zASZ2dwF 12p9XLJ2qXBVpYzFY0Q5B9f8PRN7m8ACfM4LPBZ4= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oo1-xc2c.google.com (mail-oo1-xc2c.google.com [IPv6:2607:f8b0:4864:20::c2c]) by sourceware.org (Postfix) with ESMTPS id 80EE93858417 for ; Thu, 10 Feb 2022 19:58:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 80EE93858417 Received: by mail-oo1-xc2c.google.com with SMTP id q145-20020a4a3397000000b002e85c7234b1so7726002ooq.8 for ; Thu, 10 Feb 2022 11:58:52 -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=rbaOaESU0xM3jstDgSDs/SYsFJU7f3pS4YnLJenRfeY=; b=BcoVwH9K5xX+SBqVTsRf+vPvmkBgWcJVzQ67fdG+tq2jN4MNGc+4Lw1rGra4lj09Zd T+7j94npy3lEODgSn3glyS2HJsxtpbOrmCdqqRaxohdgnobewXawMbYeVlb2Pg3SzuDa rxJFRd1POLIAJjFjUGF4C7M3UIQMOZMEji/ynpQy9d0VkCg1MzlLFv6bz+gitFE7rbmz J7mkXkRPFsTIAuIIcB2A1OCCRbLSxg2FttS9beKNBiW98PLWQN1D/0YJ0GrXwwEcjH1C 2q8LqTvVJ3Otn5Wun1kBe7FEm95aDWKkC3pt2pJMFmU71En2mljPDeCN+yix1WYVJx4j Wy1g== X-Gm-Message-State: AOAM532s0UMXDpNWSKavS+TX147b9iSLHjouTtq8/dbf7zn8TT+DS8o+ NwijKePS1QzReGQ723Az1sxntgbptufZQA== X-Google-Smtp-Source: ABdhPJz75QWYxi1hZVAZpDPXUHl6biRmMyMjb+i5mxh550ZL7YlV70SKSYziOiwGHKZs9p8Ihnj/4w== X-Received: by 2002:a05:6870:3845:: with SMTP id z5mr1280277oal.42.1644523131694; Thu, 10 Feb 2022 11:58:51 -0800 (PST) Received: from birita.. ([2804:431:c7ca:733:a925:765e:3799:3d34]) by smtp.gmail.com with ESMTPSA id bg34sm8859219oob.14.2022.02.10.11.58.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 11:58:51 -0800 (PST) To: libc-alpha@sourceware.org, Wilco Dijkstra , "H . J . Lu" , Noah Goldstein Subject: [PATCH 06/12] ia64: Remove bzero optimization Date: Thu, 10 Feb 2022 16:58:32 -0300 Message-Id: <20220210195838.1036012-7-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220210195838.1036012-1-adhemerval.zanella@linaro.org> References: <20220210195838.1036012-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.7 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, SCC_5_SHORT_WORD_LINES, 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-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" The symbol is not present current POSIX specification and compiler already generates memset call. --- sysdeps/ia64/bzero.S | 312 ------------------------------------------- 1 file changed, 312 deletions(-) delete mode 100644 sysdeps/ia64/bzero.S diff --git a/sysdeps/ia64/bzero.S b/sysdeps/ia64/bzero.S deleted file mode 100644 index cd01abb436..0000000000 --- a/sysdeps/ia64/bzero.S +++ /dev/null @@ -1,312 +0,0 @@ -/* Optimized version of the standard bzero() function. - This file is part of the GNU C Library. - Copyright (C) 2000-2022 Free Software Foundation, Inc. - - 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 - . */ - -/* Return: dest - - Inputs: - in0: dest - in1: count - - The algorithm is fairly straightforward: set byte by byte until we - we get to a 16B-aligned address, then loop on 128 B chunks using an - early store as prefetching, then loop on 32B chucks, then clear remaining - words, finally clear remaining bytes. - Since a stf.spill f0 can store 16B in one go, we use this instruction - to get peak speed. */ - -#include -#undef ret - -#define dest in0 -#define cnt in1 - -#define tmp r31 -#define save_lc r30 -#define ptr0 r29 -#define ptr1 r28 -#define ptr2 r27 -#define ptr3 r26 -#define ptr9 r24 -#define loopcnt r23 -#define linecnt r22 -#define bytecnt r21 - -// This routine uses only scratch predicate registers (p6 - p15) -#define p_scr p6 // default register for same-cycle branches -#define p_unalgn p9 -#define p_y p11 -#define p_n p12 -#define p_yy p13 -#define p_nn p14 - -#define movi0 mov - -#define MIN1 15 -#define MIN1P1HALF 8 -#define LINE_SIZE 128 -#define LSIZE_SH 7 // shift amount -#define PREF_AHEAD 8 - -#define USE_FLP -#if defined(USE_INT) -#define store st8 -#define myval r0 -#elif defined(USE_FLP) -#define store stf8 -#define myval f0 -#endif - -.align 64 -ENTRY(bzero) -{ .mmi - .prologue - alloc tmp = ar.pfs, 2, 0, 0, 0 - lfetch.nt1 [dest] - .save ar.lc, save_lc - movi0 save_lc = ar.lc -} { .mmi - .body - mov ret0 = dest // return value - nop.m 0 - cmp.eq p_scr, p0 = cnt, r0 -;; } -{ .mmi - and ptr2 = -(MIN1+1), dest // aligned address - and tmp = MIN1, dest // prepare to check for alignment - tbit.nz p_y, p_n = dest, 0 // Do we have an odd address? (M_B_U) -} { .mib - mov ptr1 = dest - nop.i 0 -(p_scr) br.ret.dpnt.many rp // return immediately if count = 0 -;; } -{ .mib - cmp.ne p_unalgn, p0 = tmp, r0 -} { .mib // NB: # of bytes to move is 1 - sub bytecnt = (MIN1+1), tmp // higher than loopcnt - cmp.gt p_scr, p0 = 16, cnt // is it a minimalistic task? -(p_scr) br.cond.dptk.many .move_bytes_unaligned // go move just a few (M_B_U) -;; } -{ .mmi -(p_unalgn) add ptr1 = (MIN1+1), ptr2 // after alignment -(p_unalgn) add ptr2 = MIN1P1HALF, ptr2 // after alignment -(p_unalgn) tbit.nz.unc p_y, p_n = bytecnt, 3 // should we do a st8 ? -;; } -{ .mib -(p_y) add cnt = -8, cnt -(p_unalgn) tbit.nz.unc p_yy, p_nn = bytecnt, 2 // should we do a st4 ? -} { .mib -(p_y) st8 [ptr2] = r0,-4 -(p_n) add ptr2 = 4, ptr2 -;; } -{ .mib -(p_yy) add cnt = -4, cnt -(p_unalgn) tbit.nz.unc p_y, p_n = bytecnt, 1 // should we do a st2 ? -} { .mib -(p_yy) st4 [ptr2] = r0,-2 -(p_nn) add ptr2 = 2, ptr2 -;; } -{ .mmi - mov tmp = LINE_SIZE+1 // for compare -(p_y) add cnt = -2, cnt -(p_unalgn) tbit.nz.unc p_yy, p_nn = bytecnt, 0 // should we do a st1 ? -} { .mmi - nop.m 0 -(p_y) st2 [ptr2] = r0,-1 -(p_n) add ptr2 = 1, ptr2 -;; } - -{ .mmi -(p_yy) st1 [ptr2] = r0 - cmp.gt p_scr, p0 = tmp, cnt // is it a minimalistic task? -} { .mbb -(p_yy) add cnt = -1, cnt -(p_scr) br.cond.dpnt.many .fraction_of_line // go move just a few -;; } -{ .mib - nop.m 0 - shr.u linecnt = cnt, LSIZE_SH - nop.b 0 -;; } - - .align 32 -.l1b: // ------------------// L1B: store ahead into cache lines; fill later -{ .mmi - and tmp = -(LINE_SIZE), cnt // compute end of range - mov ptr9 = ptr1 // used for prefetching - and cnt = (LINE_SIZE-1), cnt // remainder -} { .mmi - mov loopcnt = PREF_AHEAD-1 // default prefetch loop - cmp.gt p_scr, p0 = PREF_AHEAD, linecnt // check against actual value -;; } -{ .mmi -(p_scr) add loopcnt = -1, linecnt - add ptr2 = 16, ptr1 // start of stores (beyond prefetch stores) - add ptr1 = tmp, ptr1 // first address beyond total range -;; } -{ .mmi - add tmp = -1, linecnt // next loop count - movi0 ar.lc = loopcnt -;; } -.pref_l1b: -{ .mib - stf.spill [ptr9] = f0, 128 // Do stores one cache line apart - nop.i 0 - br.cloop.dptk.few .pref_l1b -;; } -{ .mmi - add ptr0 = 16, ptr2 // Two stores in parallel - movi0 ar.lc = tmp -;; } -.l1bx: - { .mmi - stf.spill [ptr2] = f0, 32 - stf.spill [ptr0] = f0, 32 - ;; } - { .mmi - stf.spill [ptr2] = f0, 32 - stf.spill [ptr0] = f0, 32 - ;; } - { .mmi - stf.spill [ptr2] = f0, 32 - stf.spill [ptr0] = f0, 64 - cmp.lt p_scr, p0 = ptr9, ptr1 // do we need more prefetching? - ;; } -{ .mmb - stf.spill [ptr2] = f0, 32 -(p_scr) stf.spill [ptr9] = f0, 128 - br.cloop.dptk.few .l1bx -;; } -{ .mib - cmp.gt p_scr, p0 = 8, cnt // just a few bytes left ? -(p_scr) br.cond.dpnt.many .move_bytes_from_alignment -;; } - -.fraction_of_line: -{ .mib - add ptr2 = 16, ptr1 - shr.u loopcnt = cnt, 5 // loopcnt = cnt / 32 -;; } -{ .mib - cmp.eq p_scr, p0 = loopcnt, r0 - add loopcnt = -1, loopcnt -(p_scr) br.cond.dpnt.many .store_words -;; } -{ .mib - and cnt = 0x1f, cnt // compute the remaining cnt - movi0 ar.lc = loopcnt -;; } - .align 32 -.l2: // -----------------------------// L2A: store 32B in 2 cycles -{ .mmb - store [ptr1] = myval, 8 - store [ptr2] = myval, 8 -;; } { .mmb - store [ptr1] = myval, 24 - store [ptr2] = myval, 24 - br.cloop.dptk.many .l2 -;; } -.store_words: -{ .mib - cmp.gt p_scr, p0 = 8, cnt // just a few bytes left ? -(p_scr) br.cond.dpnt.many .move_bytes_from_alignment // Branch -;; } - -{ .mmi - store [ptr1] = myval, 8 // store - cmp.le p_y, p_n = 16, cnt // - add cnt = -8, cnt // subtract -;; } -{ .mmi -(p_y) store [ptr1] = myval, 8 // store -(p_y) cmp.le.unc p_yy, p_nn = 16, cnt -(p_y) add cnt = -8, cnt // subtract -;; } -{ .mmi // store -(p_yy) store [ptr1] = myval, 8 -(p_yy) add cnt = -8, cnt // subtract -;; } - -.move_bytes_from_alignment: -{ .mib - cmp.eq p_scr, p0 = cnt, r0 - tbit.nz.unc p_y, p0 = cnt, 2 // should we terminate with a st4 ? -(p_scr) br.cond.dpnt.few .restore_and_exit -;; } -{ .mib -(p_y) st4 [ptr1] = r0,4 - tbit.nz.unc p_yy, p0 = cnt, 1 // should we terminate with a st2 ? -;; } -{ .mib -(p_yy) st2 [ptr1] = r0,2 - tbit.nz.unc p_y, p0 = cnt, 0 // should we terminate with a st1 ? -;; } - -{ .mib -(p_y) st1 [ptr1] = r0 -;; } -.restore_and_exit: -{ .mib - nop.m 0 - movi0 ar.lc = save_lc - br.ret.sptk.many rp -;; } - -.move_bytes_unaligned: -{ .mmi - .pred.rel "mutex",p_y, p_n - .pred.rel "mutex",p_yy, p_nn -(p_n) cmp.le p_yy, p_nn = 4, cnt -(p_y) cmp.le p_yy, p_nn = 5, cnt -(p_n) add ptr2 = 2, ptr1 -} { .mmi -(p_y) add ptr2 = 3, ptr1 -(p_y) st1 [ptr1] = r0, 1 // fill 1 (odd-aligned) byte -(p_y) add cnt = -1, cnt // [15, 14 (or less) left] -;; } -{ .mmi -(p_yy) cmp.le.unc p_y, p0 = 8, cnt - add ptr3 = ptr1, cnt // prepare last store - movi0 ar.lc = save_lc -} { .mmi -(p_yy) st2 [ptr1] = r0, 4 // fill 2 (aligned) bytes -(p_yy) st2 [ptr2] = r0, 4 // fill 2 (aligned) bytes -(p_yy) add cnt = -4, cnt // [11, 10 (o less) left] -;; } -{ .mmi -(p_y) cmp.le.unc p_yy, p0 = 8, cnt - add ptr3 = -1, ptr3 // last store - tbit.nz p_scr, p0 = cnt, 1 // will there be a st2 at the end ? -} { .mmi -(p_y) st2 [ptr1] = r0, 4 // fill 2 (aligned) bytes -(p_y) st2 [ptr2] = r0, 4 // fill 2 (aligned) bytes -(p_y) add cnt = -4, cnt // [7, 6 (or less) left] -;; } -{ .mmi -(p_yy) st2 [ptr1] = r0, 4 // fill 2 (aligned) bytes -(p_yy) st2 [ptr2] = r0, 4 // fill 2 (aligned) bytes - // [3, 2 (or less) left] - tbit.nz p_y, p0 = cnt, 0 // will there be a st1 at the end ? -} { .mmi -(p_yy) add cnt = -4, cnt -;; } -{ .mmb -(p_scr) st2 [ptr1] = r0 // fill 2 (aligned) bytes -(p_y) st1 [ptr3] = r0 // fill last byte (using ptr3) - br.ret.sptk.many rp -;; } -END(bzero) From patchwork Thu Feb 10 19:58:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 51025 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CAB8F385842C for ; Thu, 10 Feb 2022 20:03:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CAB8F385842C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1644523404; bh=4JD/D9cETRR18sm564rsErRuG/3uHz3QYN4+ytrBydA=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=bxFj3LUtiCPEp4WFus1aeKsVkmVS8s8QUviqCPPCR2rctRqc7NK/PsVyYHwka4YO8 bH5f9/6e9/xq/PVnam6tys3essyRaxRjT9VAaOmwIcETpfgnO7ZlfZ2vlBP4yiKYaN BE4CpFokOBb6pf61/tTKCVFaTKVCPA9IcmHdw9JA= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oi1-x229.google.com (mail-oi1-x229.google.com [IPv6:2607:f8b0:4864:20::229]) by sourceware.org (Postfix) with ESMTPS id 2F8B03858C2C for ; Thu, 10 Feb 2022 19:58:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2F8B03858C2C Received: by mail-oi1-x229.google.com with SMTP id u3so7120555oiv.12 for ; Thu, 10 Feb 2022 11:58:54 -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=4JD/D9cETRR18sm564rsErRuG/3uHz3QYN4+ytrBydA=; b=NmJ3FvYPR4ECxGqO51azI4WtwDNwmxXGaOVFLaVeZkJXVLepsyPmqVmzmrROSN4zlW L/RbS2FL51tXcJTexgj8cGYIQELAU1GpC/wmN/T1KcsKfblCOMWMBNhlOGyC3qFTtBZv i1WFwvVWZ5BcK/jrbbkqle9wR3SQTVMG5QWxwMJTDSVt6ioMLiMVbqSn5nYVPK1SsJT8 K7lVYxmYl9jgAUPNONp5WimldLqs7prlhfAdv7Vjh4/XAUTseRK/d3Ty8QYQ0y/+XGpa dH2bkfoC7e/5Vh5GpVJyJXpzY92dhp44a3F+ebpFXKK+dFk9OeoSzed6EHcfXpLzfXIN DaFg== X-Gm-Message-State: AOAM530ELtTAuYmaMbXtTfTanbMEulnwphHwQJct9Y5r9QlsTW+R8jmv JNkqPnOh6ZmZaKXutCsu6f+hZ4yTtT2LzQ== X-Google-Smtp-Source: ABdhPJx38SuCtsHTKY+WXjZeosf4roSr4DLlwZQQld8p2a6ZiRlnnKYxWJhF6ezO48m4DG5uWR5bfQ== X-Received: by 2002:a05:6808:1a22:: with SMTP id bk34mr1680411oib.301.1644523133360; Thu, 10 Feb 2022 11:58:53 -0800 (PST) Received: from birita.. ([2804:431:c7ca:733:a925:765e:3799:3d34]) by smtp.gmail.com with ESMTPSA id bg34sm8859219oob.14.2022.02.10.11.58.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 11:58:53 -0800 (PST) To: libc-alpha@sourceware.org, Wilco Dijkstra , "H . J . Lu" , Noah Goldstein Subject: [PATCH 07/12] Remove bzero optimization Date: Thu, 10 Feb 2022 16:58:33 -0300 Message-Id: <20220210195838.1036012-8-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220210195838.1036012-1-adhemerval.zanella@linaro.org> References: <20220210195838.1036012-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, KAM_STOCKGEN, 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-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" The symbol is not present in current POSIX specification and compiler already generates memset call. --- sysdeps/sparc/sparc32/bzero.c | 1 - sysdeps/sparc/sparc32/memset.S | 37 ++++++++----------- sysdeps/sparc/sparc32/sparcv9/bzero.c | 1 - .../sparc/sparc32/sparcv9/multiarch/bzero.c | 1 - .../sparc32/sparcv9/multiarch/memset-ultra1.S | 1 - sysdeps/sparc/sparc64/bzero.c | 1 - sysdeps/sparc/sparc64/memset.S | 30 ++++++--------- sysdeps/sparc/sparc64/multiarch/bzero.c | 33 ----------------- .../sparc/sparc64/multiarch/ifunc-impl-list.c | 9 ----- .../sparc/sparc64/multiarch/ifunc-memset.h | 2 +- .../sparc/sparc64/multiarch/memset-niagara1.S | 5 +-- .../sparc/sparc64/multiarch/memset-niagara4.S | 6 +-- .../sparc/sparc64/multiarch/memset-niagara7.S | 7 ---- .../sparc/sparc64/multiarch/memset-ultra1.S | 1 - 14 files changed, 30 insertions(+), 105 deletions(-) delete mode 100644 sysdeps/sparc/sparc32/bzero.c delete mode 100644 sysdeps/sparc/sparc32/sparcv9/bzero.c delete mode 100644 sysdeps/sparc/sparc32/sparcv9/multiarch/bzero.c delete mode 100644 sysdeps/sparc/sparc64/bzero.c delete mode 100644 sysdeps/sparc/sparc64/multiarch/bzero.c diff --git a/sysdeps/sparc/sparc32/bzero.c b/sysdeps/sparc/sparc32/bzero.c deleted file mode 100644 index 37f0f6f993..0000000000 --- a/sysdeps/sparc/sparc32/bzero.c +++ /dev/null @@ -1 +0,0 @@ -/* bzero is in memset.S */ diff --git a/sysdeps/sparc/sparc32/memset.S b/sysdeps/sparc/sparc32/memset.S index d222fa7506..b1b67cb2d1 100644 --- a/sysdeps/sparc/sparc32/memset.S +++ b/sysdeps/sparc/sparc32/memset.S @@ -42,25 +42,6 @@ .text .align 4 -ENTRY(__bzero) - b 1f - mov %g0, %g3 - -3: cmp %o2, 3 - be 2f - stb %g3, [%o0] - - cmp %o2, 2 - be 2f - stb %g3, [%o0 + 0x01] - - stb %g3, [%o0 + 0x02] -2: sub %o2, 4, %o2 - add %o1, %o2, %o1 - b 4f - sub %o0, %o2, %o0 -END(__bzero) - ENTRY(memset) and %o1, 0xff, %g3 sll %g3, 8, %g2 @@ -73,7 +54,7 @@ ENTRY(memset) mov %o0, %g1 andcc %o0, 3, %o2 - bne 3b + bne 3f 4: andcc %o0, 4, %g0 be 2f @@ -146,7 +127,19 @@ ENTRY(memset) stb %g3, [%o0 + 6] 0: retl nop + +3: cmp %o2, 3 + be 2f + stb %g3, [%o0] + + cmp %o2, 2 + be 2f + stb %g3, [%o0 + 0x01] + + stb %g3, [%o0 + 0x02] +2: sub %o2, 4, %o2 + add %o1, %o2, %o1 + b 4b + sub %o0, %o2, %o0 END(memset) libc_hidden_builtin_def (memset) - -weak_alias (__bzero, bzero) diff --git a/sysdeps/sparc/sparc32/sparcv9/bzero.c b/sysdeps/sparc/sparc32/sparcv9/bzero.c deleted file mode 100644 index 37f0f6f993..0000000000 --- a/sysdeps/sparc/sparc32/sparcv9/bzero.c +++ /dev/null @@ -1 +0,0 @@ -/* bzero is in memset.S */ diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/bzero.c b/sysdeps/sparc/sparc32/sparcv9/multiarch/bzero.c deleted file mode 100644 index cf6803ef44..0000000000 --- a/sysdeps/sparc/sparc32/sparcv9/multiarch/bzero.c +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/memset-ultra1.S b/sysdeps/sparc/sparc32/sparcv9/multiarch/memset-ultra1.S index 6038611134..2dda6f1ed6 100644 --- a/sysdeps/sparc/sparc32/sparcv9/multiarch/memset-ultra1.S +++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/memset-ultra1.S @@ -25,6 +25,5 @@ # define weak_alias(x, y) # define memset __memset_ultra1 -# define __bzero __bzero_ultra1 # include #endif diff --git a/sysdeps/sparc/sparc64/bzero.c b/sysdeps/sparc/sparc64/bzero.c deleted file mode 100644 index 37f0f6f993..0000000000 --- a/sysdeps/sparc/sparc64/bzero.c +++ /dev/null @@ -1 +0,0 @@ -/* bzero is in memset.S */ diff --git a/sysdeps/sparc/sparc64/memset.S b/sysdeps/sparc/sparc64/memset.S index a7f8361fa3..33ecbc93fe 100644 --- a/sysdeps/sparc/sparc64/memset.S +++ b/sysdeps/sparc/sparc64/memset.S @@ -31,6 +31,16 @@ stx source, [base - offset - 0x08]; \ stx source, [base - offset - 0x00]; +#define ZERO_BLOCKS(base, offset, source) \ + stx source, [base - offset - 0x38]; \ + stx source, [base - offset - 0x30]; \ + stx source, [base - offset - 0x28]; \ + stx source, [base - offset - 0x20]; \ + stx source, [base - offset - 0x18]; \ + stx source, [base - offset - 0x10]; \ + stx source, [base - offset - 0x08]; \ + stx source, [base - offset - 0x00]; + /* Well, memset is a lot easier to get right than bcopy... */ .text .align 32 @@ -174,22 +184,7 @@ ENTRY(memset) nop ba,pt %xcc, 18b ldd [%o0], %f0 -END(memset) -libc_hidden_builtin_def (memset) -#define ZERO_BLOCKS(base, offset, source) \ - stx source, [base - offset - 0x38]; \ - stx source, [base - offset - 0x30]; \ - stx source, [base - offset - 0x28]; \ - stx source, [base - offset - 0x20]; \ - stx source, [base - offset - 0x18]; \ - stx source, [base - offset - 0x10]; \ - stx source, [base - offset - 0x08]; \ - stx source, [base - offset - 0x00]; - - .text - .align 32 -ENTRY(__bzero) #ifndef USE_BPR srl %o1, 0, %o1 #endif @@ -307,6 +302,5 @@ ENTRY(__bzero) stb %g0, [%o0 - 1] 0: retl mov %o5, %o0 -END(__bzero) - -weak_alias (__bzero, bzero) +END(memset) +libc_hidden_builtin_def (memset) diff --git a/sysdeps/sparc/sparc64/multiarch/bzero.c b/sysdeps/sparc/sparc64/multiarch/bzero.c deleted file mode 100644 index 409d66a864..0000000000 --- a/sysdeps/sparc/sparc64/multiarch/bzero.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Multiple versions of bzero. SPARC64/Linux version. - 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 - . */ - -#if IS_IN (libc) -# define bzero __redirect_bzero -# include -# undef bzero - -# include - -# define SYMBOL_NAME bzero -# include "ifunc-memset.h" - -sparc_libc_ifunc_redirected (__redirect_bzero, __bzero, IFUNC_SELECTOR) -weak_alias (__bzero, bzero) - -#endif diff --git a/sysdeps/sparc/sparc64/multiarch/ifunc-impl-list.c b/sysdeps/sparc/sparc64/multiarch/ifunc-impl-list.c index 05926e605b..9be12f9130 100644 --- a/sysdeps/sparc/sparc64/multiarch/ifunc-impl-list.c +++ b/sysdeps/sparc/sparc64/multiarch/ifunc-impl-list.c @@ -61,15 +61,6 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, __mempcpy_ultra3) IFUNC_IMPL_ADD (array, i, mempcpy, 1, __mempcpy_ultra1)); - IFUNC_IMPL (i, name, bzero, - IFUNC_IMPL_ADD (array, i, bzero, hwcap & HWCAP_SPARC_ADP, - __bzero_niagara7) - IFUNC_IMPL_ADD (array, i, bzero, hwcap & HWCAP_SPARC_CRYPTO, - __bzero_niagara4) - IFUNC_IMPL_ADD (array, i, bzero, hwcap & HWCAP_SPARC_BLKINIT, - __bzero_niagara1) - IFUNC_IMPL_ADD (array, i, bzero, 1, __bzero_ultra1)); - IFUNC_IMPL (i, name, memset, IFUNC_IMPL_ADD (array, i, memset, hwcap & HWCAP_SPARC_ADP, __memset_niagara7) diff --git a/sysdeps/sparc/sparc64/multiarch/ifunc-memset.h b/sysdeps/sparc/sparc64/multiarch/ifunc-memset.h index 56893b6883..0a2f16b3f1 100644 --- a/sysdeps/sparc/sparc64/multiarch/ifunc-memset.h +++ b/sysdeps/sparc/sparc64/multiarch/ifunc-memset.h @@ -1,4 +1,4 @@ -/* Common definition for memset/bzero implementation. +/* Common definition for memset implementation. 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. diff --git a/sysdeps/sparc/sparc64/multiarch/memset-niagara1.S b/sysdeps/sparc/sparc64/multiarch/memset-niagara1.S index 13432effc1..7865691eca 100644 --- a/sysdeps/sparc/sparc64/multiarch/memset-niagara1.S +++ b/sysdeps/sparc/sparc64/multiarch/memset-niagara1.S @@ -45,9 +45,6 @@ ENTRY(__memset_niagara1) sllx %o2, 32, %g1 ba,pt %XCC, 1f or %g1, %o2, %o2 -END(__memset_niagara1) - -ENTRY(__bzero_niagara1) clr %o2 1: # ifndef USE_BRP @@ -171,6 +168,6 @@ ENTRY(__bzero_niagara1) 90: retl mov %o3, %o0 -END(__bzero_niagara1) +END(__memset_niagara1) #endif diff --git a/sysdeps/sparc/sparc64/multiarch/memset-niagara4.S b/sysdeps/sparc/sparc64/multiarch/memset-niagara4.S index 1ccf24e516..d6fbd83009 100644 --- a/sysdeps/sparc/sparc64/multiarch/memset-niagara4.S +++ b/sysdeps/sparc/sparc64/multiarch/memset-niagara4.S @@ -39,10 +39,6 @@ ENTRY(__memset_niagara4) sllx %o2, 32, %g1 ba,pt %icc, 1f or %g1, %o2, %o4 -END(__memset_niagara4) - - .align 32 -ENTRY(__bzero_niagara4) clr %o4 1: cmp %o1, 16 ble %icc, .Ltiny @@ -118,6 +114,6 @@ ENTRY(__bzero_niagara4) bne,pt %icc, 1b add %o0, 0x30, %o0 ba,a,pt %icc, .Lpostloop -END(__bzero_niagara4) +END(__memset_niagara4) #endif diff --git a/sysdeps/sparc/sparc64/multiarch/memset-niagara7.S b/sysdeps/sparc/sparc64/multiarch/memset-niagara7.S index 491b203ff9..6fcbf56675 100644 --- a/sysdeps/sparc/sparc64/multiarch/memset-niagara7.S +++ b/sysdeps/sparc/sparc64/multiarch/memset-niagara7.S @@ -99,13 +99,6 @@ .text .align 32 -ENTRY(__bzero_niagara7) - /* bzero (dst, size) */ - mov %o1, %o2 - mov 0, %o1 - /* fall through into memset code */ -END(__bzero_niagara7) - ENTRY(__memset_niagara7) /* memset (src, c, size) */ mov %o0, %o5 /* copy sp1 before using it */ diff --git a/sysdeps/sparc/sparc64/multiarch/memset-ultra1.S b/sysdeps/sparc/sparc64/multiarch/memset-ultra1.S index e0d3424307..3c3add791e 100644 --- a/sysdeps/sparc/sparc64/multiarch/memset-ultra1.S +++ b/sysdeps/sparc/sparc64/multiarch/memset-ultra1.S @@ -25,6 +25,5 @@ # define weak_alias(x, y) # define memset __memset_ultra1 -# define __bzero __bzero_ultra1 # include #endif From patchwork Thu Feb 10 19:58:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 51026 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D17CC385842B for ; Thu, 10 Feb 2022 20:04:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D17CC385842B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1644523446; bh=TRFUgy6I3nW+mR25qKD5LCyRiru0+CwHKbosHWjLg1M=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=rSAr8fBbmVhp//c0ZZj4g0VPjzp2CA0JkIJcCN8YYqbib9JBeo+00yEIvSCqKSpcU 3wSb5VgQbG1i34HD0Q+RW5+ShFQYX+eFJcL+Rbx8C+dcm1cz4dJ+iC4R6lx9NUKrWB Gjhczq0xHa2cQVr1DsNeYyECyTNEwEhfalYdvLOc= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oo1-xc2a.google.com (mail-oo1-xc2a.google.com [IPv6:2607:f8b0:4864:20::c2a]) by sourceware.org (Postfix) with ESMTPS id D5178385840E for ; Thu, 10 Feb 2022 19:58:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D5178385840E Received: by mail-oo1-xc2a.google.com with SMTP id c7-20020a4ad207000000b002e7ab4185d2so7706930oos.6 for ; Thu, 10 Feb 2022 11:58:55 -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=TRFUgy6I3nW+mR25qKD5LCyRiru0+CwHKbosHWjLg1M=; b=Pw6UGhDJJArUufBTbmhSrM6/5IYQFMrY7uvY8kGmVIT+ioFD+zuaB30+gzsYLeCKW6 f8mgHFE0tfJ1x2f+YLQnooyvVK9fZs7vE25RCSaFw0FI9XylAVpAefxCE9dNuakbCM3a al7LccIHslJ1wf26G12HR5PnPNuZ9r6NPnhZ+C8O3fCOl2zdd3wWFNMTgfZ7ZOPOsrsS PSTk6V562jhoSy65HZ5QXvZqizYQz2Se38ZEnTJ0VMxS2NWlZe9w64IyGeDCugRH8jfi unL+Xin0NtRNOxTPOLS6GjQo4gke/mdYDwkkbf7hz1WSRYMR7Gv504dDUPNzVJytx1V0 YCzw== X-Gm-Message-State: AOAM533I0ci72XvIw9C12jqA/DjJmIi/o33PodjORGHgzPc9/pdLvWj+ Pq4ZLFJk7a0tSv+jixwwFwVh0A1/G2zPrA== X-Google-Smtp-Source: ABdhPJz2Ub5UHhhPFoWoWz1WGKqSCqBPyT6xzb55TZESmsLwMDroWH4K3mBlL4y2O0iS9eKn6+Jhlw== X-Received: by 2002:a05:6870:e606:: with SMTP id q6mr1302136oag.110.1644523134938; Thu, 10 Feb 2022 11:58:54 -0800 (PST) Received: from birita.. ([2804:431:c7ca:733:a925:765e:3799:3d34]) by smtp.gmail.com with ESMTPSA id bg34sm8859219oob.14.2022.02.10.11.58.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 11:58:54 -0800 (PST) To: libc-alpha@sourceware.org, Wilco Dijkstra , "H . J . Lu" , Noah Goldstein Subject: [PATCH 08/12] powerpc: Remove powerpc32 bzero optimizations Date: Thu, 10 Feb 2022 16:58:34 -0300 Message-Id: <20220210195838.1036012-9-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220210195838.1036012-1-adhemerval.zanella@linaro.org> References: <20220210195838.1036012-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.3 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, TVD_SUBJ_WIPE_DEBT, 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-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" The symbol is not present in current POSIX specification and compiler already generates memset call. --- sysdeps/powerpc/powerpc32/bzero.S | 27 -------------- .../powerpc32/power4/multiarch/Makefile | 4 +- .../powerpc32/power4/multiarch/bzero-power6.S | 25 ------------- .../powerpc32/power4/multiarch/bzero-power7.S | 25 ------------- .../powerpc32/power4/multiarch/bzero-ppc32.S | 34 ----------------- .../powerpc32/power4/multiarch/bzero.c | 37 ------------------- .../power4/multiarch/ifunc-impl-list.c | 8 ---- 7 files changed, 2 insertions(+), 158 deletions(-) delete mode 100644 sysdeps/powerpc/powerpc32/bzero.S delete mode 100644 sysdeps/powerpc/powerpc32/power4/multiarch/bzero-power6.S delete mode 100644 sysdeps/powerpc/powerpc32/power4/multiarch/bzero-power7.S delete mode 100644 sysdeps/powerpc/powerpc32/power4/multiarch/bzero-ppc32.S delete mode 100644 sysdeps/powerpc/powerpc32/power4/multiarch/bzero.c diff --git a/sysdeps/powerpc/powerpc32/bzero.S b/sysdeps/powerpc/powerpc32/bzero.S deleted file mode 100644 index 9cc03c92df..0000000000 --- a/sysdeps/powerpc/powerpc32/bzero.S +++ /dev/null @@ -1,27 +0,0 @@ -/* Optimized bzero `implementation' for PowerPC. - Copyright (C) 1997-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 - -ENTRY (__bzero) - - mr r5,r4 - li r4,0 - b memset@local -END (__bzero) -weak_alias (__bzero, bzero) diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/Makefile b/sysdeps/powerpc/powerpc32/power4/multiarch/Makefile index 5c68f07d19..b2f9deefb8 100644 --- a/sysdeps/powerpc/powerpc32/power4/multiarch/Makefile +++ b/sysdeps/powerpc/powerpc32/power4/multiarch/Makefile @@ -1,8 +1,8 @@ ifeq ($(subdir),string) sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \ memcpy-ppc32 memcmp-power7 memcmp-ppc32 memset-power7 \ - memset-power6 memset-ppc32 bzero-power7 bzero-power6 \ - bzero-ppc32 mempcpy-power7 mempcpy-ppc32 memchr-power7 \ + memset-power6 memset-ppc32 \ + mempcpy-power7 mempcpy-ppc32 memchr-power7 \ memchr-ppc32 memrchr-power7 memrchr-ppc32 rawmemchr-power7 \ rawmemchr-ppc32 strlen-power7 strlen-ppc32 strnlen-power7 \ strnlen-ppc32 strncmp-power7 strncmp-ppc32 \ diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/bzero-power6.S b/sysdeps/powerpc/powerpc32/power4/multiarch/bzero-power6.S deleted file mode 100644 index b352433283..0000000000 --- a/sysdeps/powerpc/powerpc32/power4/multiarch/bzero-power6.S +++ /dev/null @@ -1,25 +0,0 @@ -/* Optimized bzero implementation for PowerPC32/POWER6. - Copyright (C) 2010-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 - -ENTRY (__bzero_power6) - mr r5,r4 - li r4,0 - b __memset_power6@local -END (__bzero_power6) diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/bzero-power7.S b/sysdeps/powerpc/powerpc32/power4/multiarch/bzero-power7.S deleted file mode 100644 index 80c8ffe55a..0000000000 --- a/sysdeps/powerpc/powerpc32/power4/multiarch/bzero-power7.S +++ /dev/null @@ -1,25 +0,0 @@ -/* Optimized bzero implementation for PowerPC32/POWER7. - Copyright (C) 2010-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 - -ENTRY (__bzero_power7) - mr r5,r4 - li r4,0 - b __memset_power7@local -END (__bzero_power7) diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/bzero-ppc32.S b/sysdeps/powerpc/powerpc32/power4/multiarch/bzero-ppc32.S deleted file mode 100644 index 86711e8e22..0000000000 --- a/sysdeps/powerpc/powerpc32/power4/multiarch/bzero-ppc32.S +++ /dev/null @@ -1,34 +0,0 @@ -/* Optimized bzero implementation for PowerPC32/PPC32. - Copyright (C) 2010-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 - -/* memset ifunc selector is not built for static and memset@local - for shared builds makes the linker point the call to the ifunc - selector. */ -#ifdef SHARED -# define MEMSET __memset_ppc -#else -# define MEMSET memset -#endif - -ENTRY (__bzero_ppc) - mr r5,r4 - li r4,0 - b MEMSET@local -END (__bzero_ppc) diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/bzero.c b/sysdeps/powerpc/powerpc32/power4/multiarch/bzero.c deleted file mode 100644 index 5d9270289f..0000000000 --- a/sysdeps/powerpc/powerpc32/power4/multiarch/bzero.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Multiple versions of bzero. - Copyright (C) 2013-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 - . */ - -/* Define multiple versions only for definition in libc. */ -#if IS_IN (libc) -# include -# include -# include "init-arch.h" - -extern __typeof (bzero) __bzero_ppc attribute_hidden; -extern __typeof (bzero) __bzero_power6 attribute_hidden; -extern __typeof (bzero) __bzero_power7 attribute_hidden; - -libc_ifunc (__bzero, - (hwcap & PPC_FEATURE_HAS_VSX) - ? __bzero_power7 : - (hwcap & PPC_FEATURE_ARCH_2_05) - ? __bzero_power6 - : __bzero_ppc); - -weak_alias (__bzero, bzero) -#endif diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc32/power4/multiarch/ifunc-impl-list.c index 9832f366bb..01890367a4 100644 --- a/sysdeps/powerpc/powerpc32/power4/multiarch/ifunc-impl-list.c +++ b/sysdeps/powerpc/powerpc32/power4/multiarch/ifunc-impl-list.c @@ -73,14 +73,6 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, __memset_power6) IFUNC_IMPL_ADD (array, i, memset, 1, __memset_ppc)) - /* Support sysdeps/powerpc/powerpc32/power4/multiarch/bzero.c. */ - IFUNC_IMPL (i, name, bzero, - IFUNC_IMPL_ADD (array, i, bzero, hwcap & PPC_FEATURE_HAS_VSX, - __bzero_power7) - IFUNC_IMPL_ADD (array, i, bzero, hwcap & PPC_FEATURE_ARCH_2_05, - __bzero_power6) - IFUNC_IMPL_ADD (array, i, bzero, 1, __bzero_ppc)) - /* Support sysdeps/powerpc/powerpc32/power4/multiarch/strlen.c. */ IFUNC_IMPL (i, name, strlen, IFUNC_IMPL_ADD (array, i, strlen, hwcap & PPC_FEATURE_HAS_VSX, From patchwork Thu Feb 10 19:58:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 51027 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B0C01385842F for ; Thu, 10 Feb 2022 20:04:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B0C01385842F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1644523488; bh=nZRiaUwcAq1WVOL6S1Lt2UJCg/Xk+W+lAZ4nbGaHlaA=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=GMD6Dj/r++/ExO1ihbba9UuWzTw7oUBNrw7Igw2r6xgYKALxnPcJ51J+1Eibu/7mW BCbZ27Iuy0U20IPTcsoZ1gF2pLsVHHF0qV3KtrqmpX/dC+U9CEsjo70O12lG/OeUPS luEtHiGGz4TR+JdartI421N50aPHZINc0kSp3Vu0= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oi1-x234.google.com (mail-oi1-x234.google.com [IPv6:2607:f8b0:4864:20::234]) by sourceware.org (Postfix) with ESMTPS id 67639385842F for ; Thu, 10 Feb 2022 19:58:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 67639385842F Received: by mail-oi1-x234.google.com with SMTP id s24so7184867oic.6 for ; Thu, 10 Feb 2022 11:58:57 -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=nZRiaUwcAq1WVOL6S1Lt2UJCg/Xk+W+lAZ4nbGaHlaA=; b=fARffnWSTJoTUDUYJc/mSk3UqkG8rDx6NOIRVVlGWCTqZIbf982SWXiyFld9fHXCku Yr4NdTjPan0+LRddlTwwKuR5awYP5eRRqg0w0ioTwLeZK90ENpYwJEoLL34FYxtMi+C5 u6ZKqtjKXxnWxjVHqJhmGkWbwubfvZCOxYcl4SHMNJnBOB2ZiHnif3AH99P9vmaloyWQ Sj8SHOUxhog6C9O8eD6A4ADGd83h9UmO23XFPOXKH+cidN3GPj6D0EBroepLdQOzdAOo ev1slyZ3t92BFZrVKs0lG9niZI1zy+JRnBHoj5Rtw19z2gFTBN8DRNFI/FIWh10kuoEH AoEA== X-Gm-Message-State: AOAM532gcdi5K3QpXNlC8NWqL/zdHBUy4/yXfy7z7yiVGKKuTtc/O+tJ arajFKMyu2RckduGMU/aRIUH93XtlU3FxA== X-Google-Smtp-Source: ABdhPJws1CmietXQADpJ/kh3j1MM1qTP8jHgpYT4h/QWuVG20NNQiH/b6LoWqqpYJzIn2gJN5aeo+w== X-Received: by 2002:a05:6808:ec2:: with SMTP id q2mr1708617oiv.310.1644523136583; Thu, 10 Feb 2022 11:58:56 -0800 (PST) Received: from birita.. ([2804:431:c7ca:733:a925:765e:3799:3d34]) by smtp.gmail.com with ESMTPSA id bg34sm8859219oob.14.2022.02.10.11.58.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 11:58:56 -0800 (PST) To: libc-alpha@sourceware.org, Wilco Dijkstra , "H . J . Lu" , Noah Goldstein Subject: [PATCH 09/12] powerpc: Remove powerpc64 bzero optimizations Date: Thu, 10 Feb 2022 16:58:35 -0300 Message-Id: <20220210195838.1036012-10-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220210195838.1036012-1-adhemerval.zanella@linaro.org> References: <20220210195838.1036012-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.3 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, TVD_SUBJ_WIPE_DEBT, 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-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" The symbol is not present in current POSIX specification and compiler already generates memset call. --- sysdeps/powerpc/powerpc64/bzero.S | 20 ------- sysdeps/powerpc/powerpc64/le/power10/memset.S | 12 ----- sysdeps/powerpc/powerpc64/memset.S | 13 ----- sysdeps/powerpc/powerpc64/multiarch/bzero.c | 54 ------------------- .../powerpc64/multiarch/ifunc-impl-list.c | 21 -------- .../powerpc64/multiarch/memset-power10.S | 3 -- .../powerpc64/multiarch/memset-power4.S | 3 -- .../powerpc64/multiarch/memset-power6.S | 3 -- .../powerpc64/multiarch/memset-power7.S | 2 - .../powerpc64/multiarch/memset-power8.S | 3 -- .../powerpc64/multiarch/memset-ppc64.S | 16 +----- sysdeps/powerpc/powerpc64/power4/memset.S | 12 ----- sysdeps/powerpc/powerpc64/power6/memset.S | 12 ----- sysdeps/powerpc/powerpc64/power7/memset.S | 12 ----- sysdeps/powerpc/powerpc64/power8/memset.S | 12 ----- 15 files changed, 1 insertion(+), 197 deletions(-) delete mode 100644 sysdeps/powerpc/powerpc64/bzero.S delete mode 100644 sysdeps/powerpc/powerpc64/multiarch/bzero.c diff --git a/sysdeps/powerpc/powerpc64/bzero.S b/sysdeps/powerpc/powerpc64/bzero.S deleted file mode 100644 index a7ca73cc39..0000000000 --- a/sysdeps/powerpc/powerpc64/bzero.S +++ /dev/null @@ -1,20 +0,0 @@ -/* Optimized bzero `implementation' for PowerPC64. - Copyright (C) 1997-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 - . */ - -/* This code was moved into memset.S to solve a double stub call problem. - @local would have worked but it is not supported in PowerPC64 asm. */ diff --git a/sysdeps/powerpc/powerpc64/le/power10/memset.S b/sysdeps/powerpc/powerpc64/le/power10/memset.S index bee6d8b31b..0f43b002bf 100644 --- a/sysdeps/powerpc/powerpc64/le/power10/memset.S +++ b/sysdeps/powerpc/powerpc64/le/power10/memset.S @@ -242,15 +242,3 @@ L(bcdz_tail): END_GEN_TB (MEMSET,TB_TOCLESS) libc_hidden_builtin_def (memset) - -/* Copied from bzero.S to prevent the linker from inserting a stub - between bzero and memset. */ -ENTRY_TOCLESS (__bzero) - CALL_MCOUNT 2 - mr r5,r4 - li r4,0 - b L(_memset) -END (__bzero) -#ifndef __bzero -weak_alias (__bzero, bzero) -#endif diff --git a/sysdeps/powerpc/powerpc64/memset.S b/sysdeps/powerpc/powerpc64/memset.S index 34ee8ffca4..b813cd3c6b 100644 --- a/sysdeps/powerpc/powerpc64/memset.S +++ b/sysdeps/powerpc/powerpc64/memset.S @@ -253,16 +253,3 @@ L(medium_28t): blr END_GEN_TB (MEMSET,TB_TOCLESS) libc_hidden_builtin_def (memset) - -#ifndef NO_BZERO_IMPL -/* Copied from bzero.S to prevent the linker from inserting a stub - between bzero and memset. */ -ENTRY (__bzero) - CALL_MCOUNT 3 - mr r5,r4 - li r4,0 - b L(_memset) -END_GEN_TB (__bzero,TB_TOCLESS) - -weak_alias (__bzero, bzero) -#endif diff --git a/sysdeps/powerpc/powerpc64/multiarch/bzero.c b/sysdeps/powerpc/powerpc64/multiarch/bzero.c deleted file mode 100644 index f83d6da55b..0000000000 --- a/sysdeps/powerpc/powerpc64/multiarch/bzero.c +++ /dev/null @@ -1,54 +0,0 @@ -/* Multiple versions of bzero. PowerPC64 version. - Copyright (C) 2013-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 - . */ - -/* Define multiple versions only for definition in libc. */ -#if IS_IN (libc) -# include -# include -# include "init-arch.h" - -extern __typeof (bzero) __bzero_ppc attribute_hidden; -extern __typeof (bzero) __bzero_power4 attribute_hidden; -extern __typeof (bzero) __bzero_power6 attribute_hidden; -extern __typeof (bzero) __bzero_power7 attribute_hidden; -extern __typeof (bzero) __bzero_power8 attribute_hidden; -# ifdef __LITTLE_ENDIAN__ -extern __typeof (bzero) __bzero_power10 attribute_hidden; -# endif - -libc_ifunc (__bzero, -# ifdef __LITTLE_ENDIAN__ - (hwcap2 & PPC_FEATURE2_ARCH_3_1 - && hwcap2 & PPC_FEATURE2_HAS_ISEL - && hwcap & PPC_FEATURE_HAS_VSX) - ? __bzero_power10 : -# endif - (hwcap2 & PPC_FEATURE2_ARCH_2_07 - && hwcap & PPC_FEATURE_HAS_ALTIVEC) - ? __bzero_power8 : - (hwcap & PPC_FEATURE_HAS_VSX) - ? __bzero_power7 : - (hwcap & PPC_FEATURE_ARCH_2_05 - && hwcap & PPC_FEATURE_HAS_ALTIVEC) - ? __bzero_power6 : - (hwcap & PPC_FEATURE_POWER4) - ? __bzero_power4 - : __bzero_ppc); - -weak_alias (__bzero, bzero) -#endif diff --git a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c index 280b8616b2..ac533a9886 100644 --- a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c +++ b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c @@ -223,27 +223,6 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, __memcmp_power4) IFUNC_IMPL_ADD (array, i, memcmp, 1, __memcmp_ppc)) - /* Support sysdeps/powerpc/powerpc64/multiarch/bzero.c. */ - IFUNC_IMPL (i, name, bzero, -#ifdef __LITTLE_ENDIAN__ - IFUNC_IMPL_ADD (array, i, bzero, - hwcap2 & PPC_FEATURE2_ARCH_3_1 - && hwcap2 & PPC_FEATURE2_HAS_ISEL - && hwcap & PPC_FEATURE_HAS_VSX, - __bzero_power10) -#endif - IFUNC_IMPL_ADD (array, i, bzero, hwcap2 & PPC_FEATURE2_ARCH_2_07 - && hwcap & PPC_FEATURE_HAS_ALTIVEC, - __bzero_power8) - IFUNC_IMPL_ADD (array, i, bzero, hwcap & PPC_FEATURE_HAS_VSX, - __bzero_power7) - IFUNC_IMPL_ADD (array, i, bzero, hwcap & PPC_FEATURE_ARCH_2_05 - && hwcap & PPC_FEATURE_HAS_ALTIVEC, - __bzero_power6) - IFUNC_IMPL_ADD (array, i, bzero, hwcap & PPC_FEATURE_POWER4, - __bzero_power4) - IFUNC_IMPL_ADD (array, i, bzero, 1, __bzero_ppc)) - /* Support sysdeps/powerpc/powerpc64/multiarch/mempcpy.c. */ IFUNC_IMPL (i, name, mempcpy, IFUNC_IMPL_ADD (array, i, mempcpy, diff --git a/sysdeps/powerpc/powerpc64/multiarch/memset-power10.S b/sysdeps/powerpc/powerpc64/multiarch/memset-power10.S index ead0b67926..ba5bee1c7a 100644 --- a/sysdeps/powerpc/powerpc64/multiarch/memset-power10.S +++ b/sysdeps/powerpc/powerpc64/multiarch/memset-power10.S @@ -21,7 +21,4 @@ #undef libc_hidden_builtin_def #define libc_hidden_builtin_def(name) -#undef __bzero -#define __bzero __bzero_power10 - #include diff --git a/sysdeps/powerpc/powerpc64/multiarch/memset-power4.S b/sysdeps/powerpc/powerpc64/multiarch/memset-power4.S index 6f5631d03d..4ee567c6f9 100644 --- a/sysdeps/powerpc/powerpc64/multiarch/memset-power4.S +++ b/sysdeps/powerpc/powerpc64/multiarch/memset-power4.S @@ -21,7 +21,4 @@ #undef libc_hidden_builtin_def #define libc_hidden_builtin_def(name) -#undef __bzero -#define __bzero __bzero_power4 - #include diff --git a/sysdeps/powerpc/powerpc64/multiarch/memset-power6.S b/sysdeps/powerpc/powerpc64/multiarch/memset-power6.S index b81f4f0d64..9f5e7d1b37 100644 --- a/sysdeps/powerpc/powerpc64/multiarch/memset-power6.S +++ b/sysdeps/powerpc/powerpc64/multiarch/memset-power6.S @@ -21,7 +21,4 @@ #undef libc_hidden_builtin_def #define libc_hidden_builtin_def(name) -#undef __bzero -#define __bzero __bzero_power6 - #include diff --git a/sysdeps/powerpc/powerpc64/multiarch/memset-power7.S b/sysdeps/powerpc/powerpc64/multiarch/memset-power7.S index a8ca12db83..6fd92d5afc 100644 --- a/sysdeps/powerpc/powerpc64/multiarch/memset-power7.S +++ b/sysdeps/powerpc/powerpc64/multiarch/memset-power7.S @@ -21,6 +21,4 @@ #undef libc_hidden_builtin_def #define libc_hidden_builtin_def(name) -#undef __bzero -#define __bzero __bzero_power7 #include diff --git a/sysdeps/powerpc/powerpc64/multiarch/memset-power8.S b/sysdeps/powerpc/powerpc64/multiarch/memset-power8.S index b06587aa2d..43cc5c7339 100644 --- a/sysdeps/powerpc/powerpc64/multiarch/memset-power8.S +++ b/sysdeps/powerpc/powerpc64/multiarch/memset-power8.S @@ -21,7 +21,4 @@ #undef libc_hidden_builtin_def #define libc_hidden_builtin_def(name) -#undef __bzero -#define __bzero __bzero_power8 - #include diff --git a/sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S b/sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S index 876954d36b..30b25ef15f 100644 --- a/sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S +++ b/sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S @@ -1,4 +1,4 @@ -/* Default memset/bzero implementation for PowerPC64. +/* Default memset implementation for PowerPC64. Copyright (C) 2013-2022 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -18,17 +18,6 @@ #include -/* Copied from bzero.S to prevent the linker from inserting a stub - between bzero and memset. NOTE: this code should be positioned - before ENTRY/END_GEN_TB redefinition. */ -ENTRY (__bzero_ppc) - CALL_MCOUNT 3 - mr r5,r4 - li r4,0 - b L(_memset) -END_GEN_TB (__bzero_ppc,TB_TOCLESS) - - #if defined SHARED && IS_IN (libc) # define MEMSET __memset_ppc @@ -36,7 +25,4 @@ END_GEN_TB (__bzero_ppc,TB_TOCLESS) # define libc_hidden_builtin_def(name) #endif -/* Do not implement __bzero at powerpc64/memset.S. */ -#define NO_BZERO_IMPL - #include diff --git a/sysdeps/powerpc/powerpc64/power4/memset.S b/sysdeps/powerpc/powerpc64/power4/memset.S index dfc136261b..0f14a5198a 100644 --- a/sysdeps/powerpc/powerpc64/power4/memset.S +++ b/sysdeps/powerpc/powerpc64/power4/memset.S @@ -237,15 +237,3 @@ L(medium_28t): blr END_GEN_TB (MEMSET,TB_TOCLESS) libc_hidden_builtin_def (memset) - -/* Copied from bzero.S to prevent the linker from inserting a stub - between bzero and memset. */ -ENTRY_TOCLESS (__bzero) - CALL_MCOUNT 3 - mr r5,r4 - li r4,0 - b L(_memset) -END (__bzero) -#ifndef __bzero -weak_alias (__bzero, bzero) -#endif diff --git a/sysdeps/powerpc/powerpc64/power6/memset.S b/sysdeps/powerpc/powerpc64/power6/memset.S index 7ad82c38e6..140a756348 100644 --- a/sysdeps/powerpc/powerpc64/power6/memset.S +++ b/sysdeps/powerpc/powerpc64/power6/memset.S @@ -381,15 +381,3 @@ L(medium_28t): blr END_GEN_TB (MEMSET,TB_TOCLESS) libc_hidden_builtin_def (memset) - -/* Copied from bzero.S to prevent the linker from inserting a stub - between bzero and memset. */ -ENTRY_TOCLESS (__bzero) - CALL_MCOUNT 3 - mr r5,r4 - li r4,0 - b L(_memset) -END (__bzero) -#ifndef __bzero -weak_alias (__bzero, bzero) -#endif diff --git a/sysdeps/powerpc/powerpc64/power7/memset.S b/sysdeps/powerpc/powerpc64/power7/memset.S index 31aa0f91cf..358199a805 100644 --- a/sysdeps/powerpc/powerpc64/power7/memset.S +++ b/sysdeps/powerpc/powerpc64/power7/memset.S @@ -384,15 +384,3 @@ L(small): END_GEN_TB (MEMSET,TB_TOCLESS) libc_hidden_builtin_def (memset) - -/* Copied from bzero.S to prevent the linker from inserting a stub - between bzero and memset. */ -ENTRY_TOCLESS (__bzero) - CALL_MCOUNT 3 - mr r5,r4 - li r4,0 - b L(_memset) -END (__bzero) -#ifndef __bzero -weak_alias (__bzero, bzero) -#endif diff --git a/sysdeps/powerpc/powerpc64/power8/memset.S b/sysdeps/powerpc/powerpc64/power8/memset.S index 9ecb6f3067..70cace14ef 100644 --- a/sysdeps/powerpc/powerpc64/power8/memset.S +++ b/sysdeps/powerpc/powerpc64/power8/memset.S @@ -504,15 +504,3 @@ L(LE7_tail5): END_GEN_TB (MEMSET,TB_TOCLESS) libc_hidden_builtin_def (memset) - -/* Copied from bzero.S to prevent the linker from inserting a stub - between bzero and memset. */ -ENTRY_TOCLESS (__bzero) - CALL_MCOUNT 3 - mr r5,r4 - li r4,0 - b L(_memset) -END (__bzero) -#ifndef __bzero -weak_alias (__bzero, bzero) -#endif From patchwork Thu Feb 10 19:58:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 51028 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 21A4C3858429 for ; Thu, 10 Feb 2022 20:05:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 21A4C3858429 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1644523535; bh=Yt3lt6lIeEr2ojbW4K+xitpaiNOiBUcq9E316BwvqzE=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=AlPK2iuwxBc1ZP9H25+HwZOjGfIujw+IDtsVy8FIfvC5AvmgIP8X1HeKeAej2tkkr X8XwFPB2LJchqlYC5HLfiDxJlsfK9KnXIe8/ioxZXKQGDMmZnfBgjlDLe6rSuHtM4S Qlhp+oAau+MWqxOdddd+unEnfdoAWOjcmhbPs1pk= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oi1-x22a.google.com (mail-oi1-x22a.google.com [IPv6:2607:f8b0:4864:20::22a]) by sourceware.org (Postfix) with ESMTPS id E5AE2385843E for ; Thu, 10 Feb 2022 19:58:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E5AE2385843E Received: by mail-oi1-x22a.google.com with SMTP id s24so7184939oic.6 for ; Thu, 10 Feb 2022 11:58:58 -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=7NfWWoI0O3JU/CK1wQLydb3ijXKCH9vXQiqjgvYBQ0xr9kOTJOOlZHkTrw2189pPuS CfQ7PKqL1M7s0UOkgHr+Fyk9hYjb05X0NkiuqFXP3eMmAh+D0G7Qc3JuJWxFq+dOhPE3 1ac4nj0QYOcY91sheaq0tJ0WcWpQ39JtYc97bP27z//WF/aonJREULbRQ1LooNw3bJOz MSrjhTokgprx7iyZosOw54FfITtn7RRNCDZJVUKIqMB1e0Jg1nKQHXGG5UKZsX+UNSpl JhsF7T3pzwwxEZPvivGEZ1HS6dTYNBKUq7bLiatbFci36X8gV5bOiRaTW8XO0LPJsKI3 pEUg== X-Gm-Message-State: AOAM530NSn2UAE+PpRJR9JA0s598RP+olXPXPJK279TmBEHxtOHeILGS 1Jbfc6738ytprqNpySZLTqh22nw7v0jgTQ== X-Google-Smtp-Source: ABdhPJyhhjzpHAXwa+UYv7+nk3gekXSL3QFiI+FsqSCcnOUW0H1h8m86otPqSERJUjVOw+wYRXBUBA== X-Received: by 2002:a05:6808:9b3:: with SMTP id e19mr1867214oig.90.1644523138222; Thu, 10 Feb 2022 11:58:58 -0800 (PST) Received: from birita.. ([2804:431:c7ca:733:a925:765e:3799:3d34]) by smtp.gmail.com with ESMTPSA id bg34sm8859219oob.14.2022.02.10.11.58.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 11:58:58 -0800 (PST) To: libc-alpha@sourceware.org, Wilco Dijkstra , "H . J . Lu" , Noah Goldstein Subject: [PATCH 10/12] s390: Remove bzero optimizations Date: Thu, 10 Feb 2022 16:58:36 -0300 Message-Id: <20220210195838.1036012-11-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220210195838.1036012-1-adhemerval.zanella@linaro.org> References: <20220210195838.1036012-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.2 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-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" 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 */ From patchwork Thu Feb 10 19:58:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 51030 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 988FB385840E for ; Thu, 10 Feb 2022 20:06:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 988FB385840E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1644523618; bh=H5EsMQeOltNOy6JkihNotVFTgekkfOUZOAlVxQGNgLE=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=x+ne4/sO8REgLnNDbMxhv5aStEn2NBTxXGYRiqEh+DxEzvjmjTg4wvhujxTOxwENr H+u0YO60507TLn0y4B/ZPmWgGXBlivmN9nSt9zM9Ea+1rouWfXYw0WkB9M7bTf0a08 391hQqjwppDoQ0fLk39eRuHHGOtyFkvG2Rb2esr8= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oi1-x231.google.com (mail-oi1-x231.google.com [IPv6:2607:f8b0:4864:20::231]) by sourceware.org (Postfix) with ESMTPS id BBF403858433 for ; Thu, 10 Feb 2022 19:59:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BBF403858433 Received: by mail-oi1-x231.google.com with SMTP id r27so7183134oiw.4 for ; Thu, 10 Feb 2022 11:59:00 -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=H5EsMQeOltNOy6JkihNotVFTgekkfOUZOAlVxQGNgLE=; b=6PjutytgNZaSQyZakDXhj0Mw9bNM5SPcK1GMY8Q733B7oTdumpMbJKRk/LrdupbeDS hwyyr7KH3dbBBDf5SfPlT0RTK2MxpasDni6aYP0KsY7rUCmMgwOdbgt570Ija7/+0YDC QVJujjajV37X5qsDlwKER5+5bnSpKTfi6gXuu+DwjyDl9KN2KlSD1EfeJ9gdAbYM2dsB D7P19zKiLm56SJFSlktmQct6MQEH8N9iBGrgdCcVc62TRZgQR+WKzeZXbSvi426x/U5c teHmfpe0Z1ju8d5j1wxT5f8PVC6hJTyKGNp+GZBWAr1a4125kB1gb50VB/62f8YUUU+L Nr+g== X-Gm-Message-State: AOAM5328lfT649tzT8IBaZwzUL+BZm5glhlWg0FRCtlQ5owIWrI0QmDH YIQr8OiW+KjX2mbHET05St02hACj44fPXw== X-Google-Smtp-Source: ABdhPJxzElrnAQhgwZvx+gRxx7GvRPXR6ZnI1VZzaM4gCGOnLo1BDez8+rBZiXEyyGM4XqIOHPFX8A== X-Received: by 2002:a05:6808:1508:: with SMTP id u8mr1722318oiw.4.1644523139869; Thu, 10 Feb 2022 11:58:59 -0800 (PST) Received: from birita.. ([2804:431:c7ca:733:a925:765e:3799:3d34]) by smtp.gmail.com with ESMTPSA id bg34sm8859219oob.14.2022.02.10.11.58.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 11:58:59 -0800 (PST) To: libc-alpha@sourceware.org, Wilco Dijkstra , "H . J . Lu" , Noah Goldstein Subject: [PATCH 11/12] i686: Remove bzero optimizations Date: Thu, 10 Feb 2022 16:58:37 -0300 Message-Id: <20220210195838.1036012-12-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220210195838.1036012-1-adhemerval.zanella@linaro.org> References: <20220210195838.1036012-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, KAM_STOCKGEN, 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-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" The symbol is not present in current POSIX specification and compiler already generates memset call. --- sysdeps/i386/bzero.S | 5 --- sysdeps/i386/i586/bzero.S | 4 -- sysdeps/i386/i586/memset.S | 16 ++------ sysdeps/i386/i686/bzero.S | 4 -- sysdeps/i386/i686/memset.S | 23 +++--------- sysdeps/i386/i686/multiarch/Makefile | 6 +-- sysdeps/i386/i686/multiarch/bzero-ia32.S | 37 ------------------- sysdeps/i386/i686/multiarch/bzero-sse2-rep.S | 3 -- sysdeps/i386/i686/multiarch/bzero-sse2.S | 3 -- sysdeps/i386/i686/multiarch/bzero.c | 32 ---------------- sysdeps/i386/i686/multiarch/ifunc-impl-list.c | 8 ---- sysdeps/i386/i686/multiarch/memset-sse2-rep.S | 24 +++--------- sysdeps/i386/i686/multiarch/memset-sse2.S | 24 +++--------- sysdeps/i386/memset.S | 14 +------ 14 files changed, 22 insertions(+), 181 deletions(-) delete mode 100644 sysdeps/i386/bzero.S delete mode 100644 sysdeps/i386/i586/bzero.S delete mode 100644 sysdeps/i386/i686/bzero.S delete mode 100644 sysdeps/i386/i686/multiarch/bzero-ia32.S delete mode 100644 sysdeps/i386/i686/multiarch/bzero-sse2-rep.S delete mode 100644 sysdeps/i386/i686/multiarch/bzero-sse2.S delete mode 100644 sysdeps/i386/i686/multiarch/bzero.c diff --git a/sysdeps/i386/bzero.S b/sysdeps/i386/bzero.S deleted file mode 100644 index c8dd47b4da..0000000000 --- a/sysdeps/i386/bzero.S +++ /dev/null @@ -1,5 +0,0 @@ -#define USE_AS_BZERO -#define memset __bzero -#include "memset.S" - -weak_alias (__bzero, bzero) diff --git a/sysdeps/i386/i586/bzero.S b/sysdeps/i386/i586/bzero.S deleted file mode 100644 index 2a106719a4..0000000000 --- a/sysdeps/i386/i586/bzero.S +++ /dev/null @@ -1,4 +0,0 @@ -#define USE_AS_BZERO -#define memset __bzero -#include -weak_alias (__bzero, bzero) diff --git a/sysdeps/i386/i586/memset.S b/sysdeps/i386/i586/memset.S index ae09c3b40a..672af41398 100644 --- a/sysdeps/i386/i586/memset.S +++ b/sysdeps/i386/i586/memset.S @@ -23,15 +23,11 @@ #define PARMS 4+4 /* space for 1 saved reg */ #define RTN PARMS #define DEST RTN -#ifdef USE_AS_BZERO -# define LEN DEST+4 -#else -# define CHR DEST+4 -# define LEN CHR+4 -#endif +#define CHR DEST+4 +#define LEN CHR+4 .text -#if defined SHARED && IS_IN (libc) && !defined USE_AS_BZERO +#if defined SHARED && IS_IN (libc) ENTRY (__memset_chk) movl 12(%esp), %eax cmpl %eax, 16(%esp) @@ -46,15 +42,11 @@ ENTRY (memset) movl DEST(%esp), %edi cfi_rel_offset (edi, 0) movl LEN(%esp), %edx -#ifdef USE_AS_BZERO - xorl %eax, %eax /* we fill with 0 */ -#else movb CHR(%esp), %al movb %al, %ah movl %eax, %ecx shll $16, %eax movw %cx, %ax -#endif cld /* If less than 36 bytes to write, skip tricky code (it wouldn't work). */ @@ -100,10 +92,8 @@ L(2): shrl $2, %ecx /* convert byte count to longword count */ rep stosb -#ifndef USE_AS_BZERO /* Load result (only if used as memset). */ movl DEST(%esp), %eax /* start address of destination is result */ -#endif popl %edi cfi_adjust_cfa_offset (-4) cfi_restore (edi) diff --git a/sysdeps/i386/i686/bzero.S b/sysdeps/i386/i686/bzero.S deleted file mode 100644 index c7898f18e0..0000000000 --- a/sysdeps/i386/i686/bzero.S +++ /dev/null @@ -1,4 +0,0 @@ -#define USE_AS_BZERO -#define memset __bzero -#include -weak_alias (__bzero, bzero) diff --git a/sysdeps/i386/i686/memset.S b/sysdeps/i386/i686/memset.S index fd5b26aeae..3cb86c016d 100644 --- a/sysdeps/i386/i686/memset.S +++ b/sysdeps/i386/i686/memset.S @@ -21,18 +21,13 @@ #include "asm-syntax.h" #define PARMS 4+4 /* space for 1 saved reg */ -#ifdef USE_AS_BZERO -# define DEST PARMS -# define LEN DEST+4 -#else -# define RTN PARMS -# define DEST RTN -# define CHR DEST+4 -# define LEN CHR+4 -#endif +#define RTN PARMS +#define DEST RTN +#define CHR DEST+4 +#define LEN CHR+4 .text -#if defined SHARED && IS_IN (libc) && !defined USE_AS_BZERO +#if defined SHARED && IS_IN (libc) ENTRY_CHK (__memset_chk) movl 12(%esp), %eax cmpl %eax, 16(%esp) @@ -46,11 +41,7 @@ ENTRY (memset) cfi_adjust_cfa_offset (4) movl DEST(%esp), %edx movl LEN(%esp), %ecx -#ifdef USE_AS_BZERO - xorl %eax, %eax /* fill with 0 */ -#else movzbl CHR(%esp), %eax -#endif jecxz 1f movl %edx, %edi cfi_rel_offset (edi, 0) @@ -70,9 +61,7 @@ ENTRY (memset) 2: movl %ecx, %edx shrl $2, %ecx andl $3, %edx -#ifndef USE_AS_BZERO imul $0x01010101, %eax -#endif rep stosl movl %edx, %ecx @@ -80,9 +69,7 @@ ENTRY (memset) stosb 1: -#ifndef USE_AS_BZERO movl DEST(%esp), %eax /* start address of destination is result */ -#endif popl %edi cfi_adjust_cfa_offset (-4) cfi_restore (edi) diff --git a/sysdeps/i386/i686/multiarch/Makefile b/sysdeps/i386/i686/multiarch/Makefile index 02fa02658e..9fe5ea8639 100644 --- a/sysdeps/i386/i686/multiarch/Makefile +++ b/sysdeps/i386/i686/multiarch/Makefile @@ -1,9 +1,9 @@ ifeq ($(subdir),string) gen-as-const-headers += locale-defines.sym -sysdep_routines += bzero-sse2 memset-sse2 memcpy-ssse3 mempcpy-ssse3 \ +sysdep_routines += memset-sse2 memcpy-ssse3 mempcpy-ssse3 \ memmove-ssse3 memcpy-ssse3-rep mempcpy-ssse3-rep \ memmove-ssse3-rep \ - memset-sse2-rep bzero-sse2-rep strcmp-ssse3 \ + memset-sse2-rep strcmp-ssse3 \ strcmp-sse4 strncmp-c strncmp-ssse3 strncmp-sse4 \ memcmp-ssse3 memcmp-sse4 varshift \ strlen-sse2 strlen-sse2-bsf strncpy-c strcpy-ssse3 \ @@ -21,7 +21,7 @@ sysdep_routines += bzero-sse2 memset-sse2 memcpy-ssse3 mempcpy-ssse3 \ memcpy-sse2-unaligned \ mempcpy-sse2-unaligned memmove-sse2-unaligned \ strcspn-c strpbrk-c strspn-c \ - bzero-ia32 rawmemchr-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/bzero-ia32.S b/sysdeps/i386/i686/multiarch/bzero-ia32.S deleted file mode 100644 index 96afe9bad1..0000000000 --- a/sysdeps/i386/i686/multiarch/bzero-ia32.S +++ /dev/null @@ -1,37 +0,0 @@ -/* bzero 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 - . */ - -#include - -#if IS_IN (libc) -# define __bzero __bzero_ia32 - -# ifdef SHARED -# undef libc_hidden_builtin_def -/* IFUNC doesn't work with the hidden functions in shared library since - they will be called without setting up EBX needed for PLT which is - used by IFUNC. */ -# define libc_hidden_builtin_def(name) \ - .globl __GI___bzero; __GI___bzero = __bzero -# endif - -# undef weak_alias -# define weak_alias(original, alias) - -# include -#endif diff --git a/sysdeps/i386/i686/multiarch/bzero-sse2-rep.S b/sysdeps/i386/i686/multiarch/bzero-sse2-rep.S deleted file mode 100644 index 507b288bb3..0000000000 --- a/sysdeps/i386/i686/multiarch/bzero-sse2-rep.S +++ /dev/null @@ -1,3 +0,0 @@ -#define USE_AS_BZERO -#define __memset_sse2_rep __bzero_sse2_rep -#include "memset-sse2-rep.S" diff --git a/sysdeps/i386/i686/multiarch/bzero-sse2.S b/sysdeps/i386/i686/multiarch/bzero-sse2.S deleted file mode 100644 index 8d04512e4e..0000000000 --- a/sysdeps/i386/i686/multiarch/bzero-sse2.S +++ /dev/null @@ -1,3 +0,0 @@ -#define USE_AS_BZERO -#define __memset_sse2 __bzero_sse2 -#include "memset-sse2.S" diff --git a/sysdeps/i386/i686/multiarch/bzero.c b/sysdeps/i386/i686/multiarch/bzero.c deleted file mode 100644 index 7fd0ddd576..0000000000 --- a/sysdeps/i386/i686/multiarch/bzero.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Multiple versions of bzero. - 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 - . */ - -/* Define multiple versions only for the definition in libc. */ -#if IS_IN (libc) -# define bzero __redirect_bzero -# include -# undef bzero - -# define SYMBOL_NAME bzero -# include "ifunc-memset.h" - -libc_ifunc_redirected (__redirect_bzero, __bzero, IFUNC_SELECTOR ()); - -weak_alias (__bzero, bzero) -#endif diff --git a/sysdeps/i386/i686/multiarch/ifunc-impl-list.c b/sysdeps/i386/i686/multiarch/ifunc-impl-list.c index 5c7a42dc97..c014f52bf9 100644 --- a/sysdeps/i386/i686/multiarch/ifunc-impl-list.c +++ b/sysdeps/i386/i686/multiarch/ifunc-impl-list.c @@ -36,14 +36,6 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, size_t i = 0; - /* Support sysdeps/i386/i686/multiarch/bzero.S. */ - IFUNC_IMPL (i, name, bzero, - IFUNC_IMPL_ADD (array, i, bzero, CPU_FEATURE_USABLE (SSE2), - __bzero_sse2_rep) - IFUNC_IMPL_ADD (array, i, bzero, CPU_FEATURE_USABLE (SSE2), - __bzero_sse2) - IFUNC_IMPL_ADD (array, i, bzero, 1, __bzero_ia32)) - /* Support sysdeps/i386/i686/multiarch/memchr.S. */ IFUNC_IMPL (i, name, memchr, IFUNC_IMPL_ADD (array, i, memchr, CPU_FEATURE_USABLE (SSE2), diff --git a/sysdeps/i386/i686/multiarch/memset-sse2-rep.S b/sysdeps/i386/i686/multiarch/memset-sse2-rep.S index 37a10575e7..28df7836e0 100644 --- a/sysdeps/i386/i686/multiarch/memset-sse2-rep.S +++ b/sysdeps/i386/i686/multiarch/memset-sse2-rep.S @@ -32,16 +32,10 @@ #define PUSH(REG) pushl REG; CFI_PUSH (REG) #define POP(REG) popl REG; CFI_POP (REG) -#ifdef USE_AS_BZERO -# define DEST PARMS -# define LEN DEST+4 -# define SETRTNVAL -#else -# define DEST PARMS -# define CHR DEST+4 -# define LEN CHR+4 -# define SETRTNVAL movl DEST(%esp), %eax -#endif +#define DEST PARMS +#define CHR DEST+4 +#define LEN CHR+4 +#define SETRTNVAL movl DEST(%esp), %eax #ifdef PIC # define ENTRANCE PUSH (%ebx); @@ -78,7 +72,7 @@ #endif .section .text.sse2,"ax",@progbits -#if defined SHARED && IS_IN (libc) && !defined USE_AS_BZERO +#if defined SHARED && IS_IN (libc) ENTRY (__memset_chk_sse2_rep) movl 12(%esp), %eax cmpl %eax, 16(%esp) @@ -89,16 +83,12 @@ ENTRY (__memset_sse2_rep) ENTRANCE movl LEN(%esp), %ecx -#ifdef USE_AS_BZERO - xor %eax, %eax -#else movzbl CHR(%esp), %eax movb %al, %ah /* Fill the whole EAX with pattern. */ movl %eax, %edx shl $16, %eax or %edx, %eax -#endif movl DEST(%esp), %edx cmp $32, %ecx jae L(32bytesormore) @@ -228,12 +218,8 @@ L(write_3bytes): /* ECX > 32 and EDX is 4 byte aligned. */ L(32bytesormore): /* Fill xmm0 with the pattern. */ -#ifdef USE_AS_BZERO - pxor %xmm0, %xmm0 -#else movd %eax, %xmm0 pshufd $0, %xmm0, %xmm0 -#endif testl $0xf, %edx jz L(aligned_16) /* ECX > 32 and EDX is not 16 byte aligned. */ diff --git a/sysdeps/i386/i686/multiarch/memset-sse2.S b/sysdeps/i386/i686/multiarch/memset-sse2.S index 455519c7ac..4e8414fd51 100644 --- a/sysdeps/i386/i686/multiarch/memset-sse2.S +++ b/sysdeps/i386/i686/multiarch/memset-sse2.S @@ -32,16 +32,10 @@ #define PUSH(REG) pushl REG; CFI_PUSH (REG) #define POP(REG) popl REG; CFI_POP (REG) -#ifdef USE_AS_BZERO -# define DEST PARMS -# define LEN DEST+4 -# define SETRTNVAL -#else -# define DEST PARMS -# define CHR DEST+4 -# define LEN CHR+4 -# define SETRTNVAL movl DEST(%esp), %eax -#endif +#define DEST PARMS +#define CHR DEST+4 +#define LEN CHR+4 +#define SETRTNVAL movl DEST(%esp), %eax #ifdef PIC # define ENTRANCE PUSH (%ebx); @@ -78,7 +72,7 @@ #endif .section .text.sse2,"ax",@progbits -#if defined SHARED && IS_IN (libc) && !defined USE_AS_BZERO +#if defined SHARED && IS_IN (libc) ENTRY (__memset_chk_sse2) movl 12(%esp), %eax cmpl %eax, 16(%esp) @@ -89,16 +83,12 @@ ENTRY (__memset_sse2) ENTRANCE movl LEN(%esp), %ecx -#ifdef USE_AS_BZERO - xor %eax, %eax -#else movzbl CHR(%esp), %eax movb %al, %ah /* Fill the whole EAX with pattern. */ movl %eax, %edx shl $16, %eax or %edx, %eax -#endif movl DEST(%esp), %edx cmp $32, %ecx jae L(32bytesormore) @@ -228,12 +218,8 @@ L(write_3bytes): /* ECX > 32 and EDX is 4 byte aligned. */ L(32bytesormore): /* Fill xmm0 with the pattern. */ -#ifdef USE_AS_BZERO - pxor %xmm0, %xmm0 -#else movd %eax, %xmm0 pshufd $0, %xmm0, %xmm0 -#endif testl $0xf, %edx jz L(aligned_16) /* ECX > 32 and EDX is not 16 byte aligned. */ diff --git a/sysdeps/i386/memset.S b/sysdeps/i386/memset.S index f470511b64..db2753eb2f 100644 --- a/sysdeps/i386/memset.S +++ b/sysdeps/i386/memset.S @@ -30,15 +30,11 @@ #define POP(REG) popl REG; CFI_POP (REG) #define STR1 8 -#ifdef USE_AS_BZERO -#define N STR1+4 -#else #define STR2 STR1+4 #define N STR2+4 -#endif .text -#if defined SHARED && IS_IN (libc) && !defined USE_AS_BZERO +#if defined SHARED && IS_IN (libc) ENTRY (__memset_chk) movl 12(%esp), %eax cmpl %eax, 16(%esp) @@ -49,20 +45,12 @@ ENTRY (memset) PUSH (%edi) movl N(%esp), %ecx movl STR1(%esp), %edi -#ifdef USE_AS_BZERO - xor %eax, %eax -#else movzbl STR2(%esp), %eax mov %edi, %edx -#endif rep stosb -#ifndef USE_AS_BZERO mov %edx, %eax -#endif POP (%edi) ret END (memset) -#ifndef USE_AS_BZERO libc_hidden_builtin_def (memset) -#endif From patchwork Thu Feb 10 19:58:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 51031 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3AB733858439 for ; Thu, 10 Feb 2022 20:07:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3AB733858439 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1644523665; bh=KIPXmN0v+Mhz2fvRWEQ6ztrO3jdWY6xD9dZvmYAHlqI=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=TTKW78BIJMe8AFKQfkt9eGudDV40cSvMNBhfFZGR9BPdNsG7uQpu0sQDFZ2Jlx4ng +iNGiG9hO1cZ7k9cDJPywtP9GPt91hqE4HCPFSRBatZudhM8xFRcNzsBuor1IrWfPG BgVkwyijfD9n7ylUtH1wuXb2HXjzg4ToKQ3JefLY= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oi1-x231.google.com (mail-oi1-x231.google.com [IPv6:2607:f8b0:4864:20::231]) by sourceware.org (Postfix) with ESMTPS id 61B97385842B for ; Thu, 10 Feb 2022 19:59:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 61B97385842B Received: by mail-oi1-x231.google.com with SMTP id q8so7167332oiw.7 for ; Thu, 10 Feb 2022 11:59:02 -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=KIPXmN0v+Mhz2fvRWEQ6ztrO3jdWY6xD9dZvmYAHlqI=; b=ze4GuOuE2WSuis1ADQ4y43K6k/N0dS933tvoU/vQAnDJOeiyNFGSg6nADSMq1+Bq/Q 4M1J8QkYuAFEkKSSzsYF3ERmoxFxzaQaWs5Cfoa4Z2FgDGB/C4v/hfN8ZssFupLxU+96 s5z6+9yCi9syVZrSUNzimCWyCrPQthRrjrB09bvF4MoXW+T7uoMYrXzfPya1sy5vw5KM vFk10vqZRLJWcQgoGp9v/vhCYhgBd6eafLrq9upyTc5aIahSchVQI2MsTd02gwNFRFaO KR4rlowlHICTChP9QwpwA3F0FCXWMn7z4wp2xfVigZvmlSKisPmLYoM+7fiHtVttfgU3 8yqQ== X-Gm-Message-State: AOAM530dGfp16Qs9P990xf/Vbs9D04lDuP2nBIiUqYB6tPFXqeU9dzKY Hp4kaR5Z5QTpM6VMhCaG4aLcfGpQ3g3B0g== X-Google-Smtp-Source: ABdhPJwotMuSSRqfLm8SCNIvHHXOMeFPjN/7yPoLfFZEc0o7E4yCQdFevaznM9idmNau3RqpALHrfA== X-Received: by 2002:a05:6808:170b:: with SMTP id bc11mr1660455oib.173.1644523141600; Thu, 10 Feb 2022 11:59:01 -0800 (PST) Received: from birita.. ([2804:431:c7ca:733:a925:765e:3799:3d34]) by smtp.gmail.com with ESMTPSA id bg34sm8859219oob.14.2022.02.10.11.59.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 11:59:01 -0800 (PST) To: libc-alpha@sourceware.org, Wilco Dijkstra , "H . J . Lu" , Noah Goldstein Subject: [PATCH 12/12] x86_64: Remove bzero optimizations Date: Thu, 10 Feb 2022 16:58:38 -0300 Message-Id: <20220210195838.1036012-13-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220210195838.1036012-1-adhemerval.zanella@linaro.org> References: <20220210195838.1036012-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, KAM_STOCKGEN, 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-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" The symbol is not present in current POSIX specification and compiler already generates memset call. --- sysdeps/x86_64/bzero.S | 1 - sysdeps/x86_64/memset.S | 10 +- sysdeps/x86_64/multiarch/Makefile | 1 - sysdeps/x86_64/multiarch/bzero.c | 106 ------------------ sysdeps/x86_64/multiarch/ifunc-impl-list.c | 42 ------- .../memset-avx2-unaligned-erms-rtm.S | 1 - .../multiarch/memset-avx2-unaligned-erms.S | 6 - .../multiarch/memset-avx512-unaligned-erms.S | 3 - .../multiarch/memset-evex-unaligned-erms.S | 3 - .../multiarch/memset-sse2-unaligned-erms.S | 5 - .../multiarch/memset-vec-unaligned-erms.S | 56 +-------- 11 files changed, 2 insertions(+), 232 deletions(-) delete mode 100644 sysdeps/x86_64/bzero.S delete mode 100644 sysdeps/x86_64/multiarch/bzero.c diff --git a/sysdeps/x86_64/bzero.S b/sysdeps/x86_64/bzero.S deleted file mode 100644 index f96d567fd8..0000000000 --- a/sysdeps/x86_64/bzero.S +++ /dev/null @@ -1 +0,0 @@ -/* Implemented in memset.S. */ diff --git a/sysdeps/x86_64/memset.S b/sysdeps/x86_64/memset.S index af26e9cedc..a6eea61a4d 100644 --- a/sysdeps/x86_64/memset.S +++ b/sysdeps/x86_64/memset.S @@ -1,4 +1,4 @@ -/* memset/bzero -- set memory area to CH/0 +/* memset -- set memory area to CH/0 Optimized version for x86-64. Copyright (C) 2002-2022 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -35,9 +35,6 @@ punpcklwd %xmm0, %xmm0; \ pshufd $0, %xmm0, %xmm0 -# define BZERO_ZERO_VEC0() \ - pxor %xmm0, %xmm0 - # define WMEMSET_SET_VEC0_AND_SET_RETURN(d, r) \ movd d, %xmm0; \ pshufd $0, %xmm0, %xmm0; \ @@ -56,10 +53,6 @@ # define MEMSET_SYMBOL(p,s) memset #endif -#ifndef BZERO_SYMBOL -# define BZERO_SYMBOL(p,s) __bzero -#endif - #ifndef WMEMSET_SYMBOL # define WMEMSET_CHK_SYMBOL(p,s) p # define WMEMSET_SYMBOL(p,s) __wmemset @@ -70,7 +63,6 @@ libc_hidden_builtin_def (memset) #if IS_IN (libc) -weak_alias (__bzero, bzero) libc_hidden_def (__wmemset) weak_alias (__wmemset, wmemset) libc_hidden_weak (wmemset) diff --git a/sysdeps/x86_64/multiarch/Makefile b/sysdeps/x86_64/multiarch/Makefile index e7b413edad..4274bfdd0d 100644 --- a/sysdeps/x86_64/multiarch/Makefile +++ b/sysdeps/x86_64/multiarch/Makefile @@ -1,7 +1,6 @@ ifeq ($(subdir),string) sysdep_routines += \ - bzero \ memchr-avx2 \ memchr-avx2-rtm \ memchr-evex \ diff --git a/sysdeps/x86_64/multiarch/bzero.c b/sysdeps/x86_64/multiarch/bzero.c deleted file mode 100644 index 58a14b2c33..0000000000 --- a/sysdeps/x86_64/multiarch/bzero.c +++ /dev/null @@ -1,106 +0,0 @@ -/* Multiple versions of bzero. - All versions must be listed in ifunc-impl-list.c. - Copyright (C) 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 - . */ - -/* Define multiple versions only for the definition in libc. */ -#if IS_IN (libc) -# define __bzero __redirect___bzero -# include -# undef __bzero - -# define SYMBOL_NAME __bzero -# include - -extern __typeof (REDIRECT_NAME) OPTIMIZE1 (sse2_unaligned) - attribute_hidden; -extern __typeof (REDIRECT_NAME) OPTIMIZE1 (sse2_unaligned_erms) - attribute_hidden; -extern __typeof (REDIRECT_NAME) OPTIMIZE1 (avx2_unaligned) attribute_hidden; -extern __typeof (REDIRECT_NAME) OPTIMIZE1 (avx2_unaligned_erms) - attribute_hidden; -extern __typeof (REDIRECT_NAME) OPTIMIZE1 (avx2_unaligned_rtm) - attribute_hidden; -extern __typeof (REDIRECT_NAME) OPTIMIZE1 (avx2_unaligned_erms_rtm) - attribute_hidden; -extern __typeof (REDIRECT_NAME) OPTIMIZE1 (evex_unaligned) - attribute_hidden; -extern __typeof (REDIRECT_NAME) OPTIMIZE1 (evex_unaligned_erms) - attribute_hidden; -extern __typeof (REDIRECT_NAME) OPTIMIZE1 (avx512_unaligned) - attribute_hidden; -extern __typeof (REDIRECT_NAME) OPTIMIZE1 (avx512_unaligned_erms) - attribute_hidden; - -static inline void * -IFUNC_SELECTOR (void) -{ - const struct cpu_features* cpu_features = __get_cpu_features (); - - if (CPU_FEATURE_USABLE_P (cpu_features, AVX512F) - && !CPU_FEATURES_ARCH_P (cpu_features, Prefer_No_AVX512)) - { - if (CPU_FEATURE_USABLE_P (cpu_features, AVX512VL) - && CPU_FEATURE_USABLE_P (cpu_features, AVX512BW) - && CPU_FEATURE_USABLE_P (cpu_features, BMI2)) - { - if (CPU_FEATURE_USABLE_P (cpu_features, ERMS)) - return OPTIMIZE1 (avx512_unaligned_erms); - - return OPTIMIZE1 (avx512_unaligned); - } - } - - if (CPU_FEATURE_USABLE_P (cpu_features, AVX2)) - { - if (CPU_FEATURE_USABLE_P (cpu_features, AVX512VL) - && CPU_FEATURE_USABLE_P (cpu_features, AVX512BW) - && CPU_FEATURE_USABLE_P (cpu_features, BMI2)) - { - if (CPU_FEATURE_USABLE_P (cpu_features, ERMS)) - return OPTIMIZE1 (evex_unaligned_erms); - - return OPTIMIZE1 (evex_unaligned); - } - - if (CPU_FEATURE_USABLE_P (cpu_features, RTM)) - { - if (CPU_FEATURE_USABLE_P (cpu_features, ERMS)) - return OPTIMIZE1 (avx2_unaligned_erms_rtm); - - return OPTIMIZE1 (avx2_unaligned_rtm); - } - - if (!CPU_FEATURES_ARCH_P (cpu_features, Prefer_No_VZEROUPPER)) - { - if (CPU_FEATURE_USABLE_P (cpu_features, ERMS)) - return OPTIMIZE1 (avx2_unaligned_erms); - - return OPTIMIZE1 (avx2_unaligned); - } - } - - if (CPU_FEATURE_USABLE_P (cpu_features, ERMS)) - return OPTIMIZE1 (sse2_unaligned_erms); - - return OPTIMIZE1 (sse2_unaligned); -} - -libc_ifunc_redirected (__redirect___bzero, __bzero, IFUNC_SELECTOR ()); - -weak_alias (__bzero, bzero) -#endif diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c index a594f4176e..68a56797d4 100644 --- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c +++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c @@ -300,48 +300,6 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, __memset_avx512_no_vzeroupper) ) - /* Support sysdeps/x86_64/multiarch/bzero.c. */ - IFUNC_IMPL (i, name, bzero, - IFUNC_IMPL_ADD (array, i, bzero, 1, - __bzero_sse2_unaligned) - IFUNC_IMPL_ADD (array, i, bzero, 1, - __bzero_sse2_unaligned_erms) - IFUNC_IMPL_ADD (array, i, bzero, - CPU_FEATURE_USABLE (AVX2), - __bzero_avx2_unaligned) - IFUNC_IMPL_ADD (array, i, bzero, - CPU_FEATURE_USABLE (AVX2), - __bzero_avx2_unaligned_erms) - IFUNC_IMPL_ADD (array, i, bzero, - (CPU_FEATURE_USABLE (AVX2) - && CPU_FEATURE_USABLE (RTM)), - __bzero_avx2_unaligned_rtm) - IFUNC_IMPL_ADD (array, i, bzero, - (CPU_FEATURE_USABLE (AVX2) - && CPU_FEATURE_USABLE (RTM)), - __bzero_avx2_unaligned_erms_rtm) - IFUNC_IMPL_ADD (array, i, bzero, - (CPU_FEATURE_USABLE (AVX512VL) - && CPU_FEATURE_USABLE (AVX512BW) - && CPU_FEATURE_USABLE (BMI2)), - __bzero_evex_unaligned) - IFUNC_IMPL_ADD (array, i, bzero, - (CPU_FEATURE_USABLE (AVX512VL) - && CPU_FEATURE_USABLE (AVX512BW) - && CPU_FEATURE_USABLE (BMI2)), - __bzero_evex_unaligned_erms) - IFUNC_IMPL_ADD (array, i, bzero, - (CPU_FEATURE_USABLE (AVX512VL) - && CPU_FEATURE_USABLE (AVX512BW) - && CPU_FEATURE_USABLE (BMI2)), - __bzero_avx512_unaligned_erms) - IFUNC_IMPL_ADD (array, i, bzero, - (CPU_FEATURE_USABLE (AVX512VL) - && CPU_FEATURE_USABLE (AVX512BW) - && CPU_FEATURE_USABLE (BMI2)), - __bzero_avx512_unaligned) - ) - /* Support sysdeps/x86_64/multiarch/rawmemchr.c. */ IFUNC_IMPL (i, name, rawmemchr, IFUNC_IMPL_ADD (array, i, rawmemchr, diff --git a/sysdeps/x86_64/multiarch/memset-avx2-unaligned-erms-rtm.S b/sysdeps/x86_64/multiarch/memset-avx2-unaligned-erms-rtm.S index 5a5ee6f672..8ac3e479bb 100644 --- a/sysdeps/x86_64/multiarch/memset-avx2-unaligned-erms-rtm.S +++ b/sysdeps/x86_64/multiarch/memset-avx2-unaligned-erms-rtm.S @@ -5,7 +5,6 @@ #define SECTION(p) p##.avx.rtm #define MEMSET_SYMBOL(p,s) p##_avx2_##s##_rtm -#define BZERO_SYMBOL(p,s) p##_avx2_##s##_rtm #define WMEMSET_SYMBOL(p,s) p##_avx2_##s##_rtm #include "memset-avx2-unaligned-erms.S" diff --git a/sysdeps/x86_64/multiarch/memset-avx2-unaligned-erms.S b/sysdeps/x86_64/multiarch/memset-avx2-unaligned-erms.S index a093a2831f..c0bf2875d0 100644 --- a/sysdeps/x86_64/multiarch/memset-avx2-unaligned-erms.S +++ b/sysdeps/x86_64/multiarch/memset-avx2-unaligned-erms.S @@ -14,9 +14,6 @@ vmovd d, %xmm0; \ movq r, %rax; -# define BZERO_ZERO_VEC0() \ - vpxor %xmm0, %xmm0, %xmm0 - # define WMEMSET_SET_VEC0_AND_SET_RETURN(d, r) \ MEMSET_SET_VEC0_AND_SET_RETURN(d, r) @@ -32,9 +29,6 @@ # ifndef MEMSET_SYMBOL # define MEMSET_SYMBOL(p,s) p##_avx2_##s # endif -# ifndef BZERO_SYMBOL -# define BZERO_SYMBOL(p,s) p##_avx2_##s -# endif # ifndef WMEMSET_SYMBOL # define WMEMSET_SYMBOL(p,s) p##_avx2_##s # endif diff --git a/sysdeps/x86_64/multiarch/memset-avx512-unaligned-erms.S b/sysdeps/x86_64/multiarch/memset-avx512-unaligned-erms.S index 727c92133a..5241216a77 100644 --- a/sysdeps/x86_64/multiarch/memset-avx512-unaligned-erms.S +++ b/sysdeps/x86_64/multiarch/memset-avx512-unaligned-erms.S @@ -19,9 +19,6 @@ vpbroadcastb d, %VEC0; \ movq r, %rax -# define BZERO_ZERO_VEC0() \ - vpxorq %XMM0, %XMM0, %XMM0 - # define WMEMSET_SET_VEC0_AND_SET_RETURN(d, r) \ vpbroadcastd d, %VEC0; \ movq r, %rax diff --git a/sysdeps/x86_64/multiarch/memset-evex-unaligned-erms.S b/sysdeps/x86_64/multiarch/memset-evex-unaligned-erms.S index 5d8fa78f05..6370021506 100644 --- a/sysdeps/x86_64/multiarch/memset-evex-unaligned-erms.S +++ b/sysdeps/x86_64/multiarch/memset-evex-unaligned-erms.S @@ -19,9 +19,6 @@ vpbroadcastb d, %VEC0; \ movq r, %rax -# define BZERO_ZERO_VEC0() \ - vpxorq %XMM0, %XMM0, %XMM0 - # define WMEMSET_SET_VEC0_AND_SET_RETURN(d, r) \ vpbroadcastd d, %VEC0; \ movq r, %rax diff --git a/sysdeps/x86_64/multiarch/memset-sse2-unaligned-erms.S b/sysdeps/x86_64/multiarch/memset-sse2-unaligned-erms.S index 329c58ee46..684cc248d7 100644 --- a/sysdeps/x86_64/multiarch/memset-sse2-unaligned-erms.S +++ b/sysdeps/x86_64/multiarch/memset-sse2-unaligned-erms.S @@ -22,7 +22,6 @@ #if IS_IN (libc) # define MEMSET_SYMBOL(p,s) p##_sse2_##s -# define BZERO_SYMBOL(p,s) MEMSET_SYMBOL (p, s) # define WMEMSET_SYMBOL(p,s) p##_sse2_##s # ifdef SHARED @@ -30,10 +29,6 @@ # define libc_hidden_builtin_def(name) # endif -# undef weak_alias -# define weak_alias(original, alias) \ - .weak bzero; bzero = __bzero - # undef strong_alias # define strong_alias(ignored1, ignored2) #endif diff --git a/sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S b/sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S index 7c94fcdae1..a018077df0 100644 --- a/sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S +++ b/sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S @@ -1,4 +1,4 @@ -/* memset/bzero with unaligned store and rep stosb +/* memset with unaligned store and rep stosb Copyright (C) 2016-2022 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -26,10 +26,6 @@ #include -#ifndef BZERO_SYMBOL -# define BZERO_SYMBOL(p,s) MEMSET_SYMBOL (p, s) -#endif - #ifndef MEMSET_CHK_SYMBOL # define MEMSET_CHK_SYMBOL(p,s) MEMSET_SYMBOL(p, s) #endif @@ -133,31 +129,6 @@ ENTRY (WMEMSET_SYMBOL (__wmemset, unaligned)) END (WMEMSET_SYMBOL (__wmemset, unaligned)) #endif -ENTRY (BZERO_SYMBOL(__bzero, unaligned)) -#if VEC_SIZE > 16 - BZERO_ZERO_VEC0 () -#endif - mov %RDI_LP, %RAX_LP - mov %RSI_LP, %RDX_LP -#ifndef USE_LESS_VEC_MASK_STORE - xorl %esi, %esi -#endif - cmp $VEC_SIZE, %RDX_LP - jb L(less_vec_no_vdup) -#ifdef USE_LESS_VEC_MASK_STORE - xorl %esi, %esi -#endif -#if VEC_SIZE <= 16 - BZERO_ZERO_VEC0 () -#endif - cmp $(VEC_SIZE * 2), %RDX_LP - ja L(more_2x_vec) - /* From VEC and to 2 * VEC. No branch when size == VEC_SIZE. */ - VMOVU %VEC(0), (%rdi) - VMOVU %VEC(0), (VEC_SIZE * -1)(%rdi, %rdx) - VZEROUPPER_RETURN -END (BZERO_SYMBOL(__bzero, unaligned)) - #if defined SHARED && IS_IN (libc) ENTRY_CHK (MEMSET_CHK_SYMBOL (__memset_chk, unaligned)) cmp %RDX_LP, %RCX_LP @@ -215,31 +186,6 @@ END (__memset_erms) END (MEMSET_SYMBOL (__memset, erms)) # endif -ENTRY_P2ALIGN (BZERO_SYMBOL(__bzero, unaligned_erms), 6) -# if VEC_SIZE > 16 - BZERO_ZERO_VEC0 () -# endif - mov %RDI_LP, %RAX_LP - mov %RSI_LP, %RDX_LP -# ifndef USE_LESS_VEC_MASK_STORE - xorl %esi, %esi -# endif - cmp $VEC_SIZE, %RDX_LP - jb L(less_vec_no_vdup) -# ifdef USE_LESS_VEC_MASK_STORE - xorl %esi, %esi -# endif -# if VEC_SIZE <= 16 - BZERO_ZERO_VEC0 () -# endif - cmp $(VEC_SIZE * 2), %RDX_LP - ja L(stosb_more_2x_vec) - /* From VEC and to 2 * VEC. No branch when size == VEC_SIZE. */ - VMOVU %VEC(0), (%rdi) - VMOVU %VEC(0), (VEC_SIZE * -1)(%rdi, %rdx) - VZEROUPPER_RETURN -END (BZERO_SYMBOL(__bzero, unaligned_erms)) - # if defined SHARED && IS_IN (libc) ENTRY_CHK (MEMSET_CHK_SYMBOL (__memset_chk, unaligned_erms)) cmp %RDX_LP, %RCX_LP