Message ID | 20230201170406.303978-12-adhemerval.zanella@linaro.org (mailing list archive) |
---|---|
State | Superseded |
Headers |
Return-Path: <libc-alpha-bounces+patchwork=sourceware.org@sourceware.org> 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 A036D3895FD6 for <patchwork@sourceware.org>; Wed, 1 Feb 2023 17:06:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A036D3895FD6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675271180; bh=LLY0Tmc+7FJfLueVKTzcdxBygnFQ693kzbq1+1nrLr8=; 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=HlDZwnOI+SWw54zTbfxtM4k2lAQ1cMzVuiFRrLOpP3N3zPJE84x5ilV/RMymADydS 6IB5xkhh7+TnkdAoNeuJ5q35LWCRbsR2E7dc8GLedvxIHMDNqIe9HV8+of58b9c6Db Ii1ESzb48LX7hqgdnvk2V8ru3rbdif2Dw2d36fuw= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-ot1-x32a.google.com (mail-ot1-x32a.google.com [IPv6:2607:f8b0:4864:20::32a]) by sourceware.org (Postfix) with ESMTPS id 9859E3858C2F for <libc-alpha@sourceware.org>; Wed, 1 Feb 2023 17:04:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9859E3858C2F Received: by mail-ot1-x32a.google.com with SMTP id p24-20020a056830131800b0068d4b30536aso37237otq.9 for <libc-alpha@sourceware.org>; Wed, 01 Feb 2023 09:04:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LLY0Tmc+7FJfLueVKTzcdxBygnFQ693kzbq1+1nrLr8=; b=o2ekUSl3rAMdaU1N+/OPJl0vgdyUW27RMndfyztuLkbp1jqSIKhF8qlnsoJEYfPuoa 9DfnXruJnP4sPxaJXgnA6egCcc4+9sczfVO34vab0G6jTiwWJGrUanp+aoQKMqGeopOU sdFo85kGoNEY86iQTk9rJKGRzEdpCHd+5CuQPkUwNxNG7kQPImpylWoKr5b8zk4da7wp K6WpjDYhcASvPfAI5+9mRpe7evSJBQpqvGA1haRwFmgs9WL1YPHwnSy5vn/LjT4L1gIN sTonh/mzotBHKN5UmBHfwy3p6tIMjimVWTIl09Qwnq2pDc4Rp7bIVU5yQ9a3i3MGxqMB RExA== X-Gm-Message-State: AO0yUKU6qlfgROsVDJgSHw7XbzHA1NTGzpQ08nDmxr9QaI1oRMhipOG1 qWBTEEgjPND+qHj1hDYZxITt16301sPj6JxdzqU= X-Google-Smtp-Source: AK7set+rcFg2U0lxlwB/RBGa75d8rnRU0UO4nlwDSy/viPtNRBF/x03dlBujSG6qeeCy3mcSNTDQAw== X-Received: by 2002:a9d:82a:0:b0:68b:e020:e67e with SMTP id 39-20020a9d082a000000b0068be020e67emr3427102oty.12.1675271081009; Wed, 01 Feb 2023 09:04:41 -0800 (PST) Received: from mandiga.. ([2804:1b3:a7c2:1887:d2ed:98c2:d2cc:bf06]) by smtp.gmail.com with ESMTPSA id b17-20020a056830311100b006863ccbf067sm8077090ots.74.2023.02.01.09.04.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 09:04:40 -0800 (PST) To: libc-alpha@sourceware.org, Richard Henderson <richard.henderson@linaro.org>, Noah Goldstein <goldstein.w.n@gmail.com>, Jeff Law <jeffreyalaw@gmail.com>, Xi Ruoyao <xry111@xry111.site> Subject: [PATCH v11 11/29] string: Improve generic strcpy Date: Wed, 1 Feb 2023 14:03:48 -0300 Message-Id: <20230201170406.303978-12-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230201170406.303978-1-adhemerval.zanella@linaro.org> References: <20230201170406.303978-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.8 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 autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list <libc-alpha.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> From: Adhemerval Zanella via Libc-alpha <libc-alpha@sourceware.org> Reply-To: Adhemerval Zanella <adhemerval.zanella@linaro.org> Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" <libc-alpha-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
Improve generic string routines
|
|
Checks
Context | Check | Description |
---|---|---|
dj/TryBot-apply_patch | success | Patch applied to master at the time it was sent |
Commit Message
Adhemerval Zanella
Feb. 1, 2023, 5:03 p.m. UTC
Now that stpcpy is vectorized based on op_t, it should be better to call it instead of strlen plus memcpy. Checked on x86_64-linux-gnu, i686-linux-gnu, powerpc64-linux-gnu, and powerpc-linux-gnu by removing the arch-specific assembly implementation and disabling multi-arch (it covers both LE and BE for 64 and 32 bits). --- string/strcpy.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
Comments
On 2/1/23 07:03, Adhemerval Zanella wrote: > Now that stpcpy is vectorized based on op_t, it should be better to > call it instead of strlen plus memcpy. > > Checked on x86_64-linux-gnu, i686-linux-gnu, powerpc64-linux-gnu, > and powerpc-linux-gnu by removing the arch-specific assembly > implementation and disabling multi-arch (it covers both LE and BE > for 64 and 32 bits). > --- > string/strcpy.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) Reviewed-by: Richard Henderson <richard.henderson@linaro.org> r~
diff --git a/string/strcpy.c b/string/strcpy.c index 0345c71d15..d945d8fdf0 100644 --- a/string/strcpy.c +++ b/string/strcpy.c @@ -19,6 +19,9 @@ #include <string.h> #undef strcpy +/* Disable internal stpcpy optimization, otherwise the __stpcpy might it + generate a strcpy call. */ +#undef __stpcpy #ifndef STRCPY # define STRCPY strcpy @@ -28,6 +31,7 @@ char * STRCPY (char *dest, const char *src) { - return memcpy (dest, src, strlen (src) + 1); + __stpcpy (dest, src); + return dest; } libc_hidden_builtin_def (strcpy)