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