From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 87917 invoked by alias); 29 Jun 2018 14:48:51 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 81483 invoked by uid 89); 29 Jun 2018 14:48:40 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.3 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1986 X-HELO: EUR04-VI1-obe.outbound.protection.outlook.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1VCxZ+7eAiVHR7/wy89luj2rLcvNHJ038v6rk3ItaOA=; b=RdXGxsI9fG4R10U+LI91XgOtM4p+mAEStCmZm6TFLEAnEHRd7gtIxPMXXGpU+o2Yu/SxwOa2CbVTHFyW8R6ZxDWP0N4W6iA5/d5ZaeAJ9bjnnYyJYbDHG7n1a4vvynv2Qq5jXRbLNx80iQCRpqL+hz1TsFJFMAKv6ezEPoaLrH4= From: Wilco Dijkstra To: "libc-alpha@sourceware.org" , Szabolcs Nagy CC: nd Subject: Re: [PATCH][AArch64] Inline mempcpy again Date: Fri, 29 Jun 2018 14:48:00 -0000 Message-ID: References: In-Reply-To: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Wilco.Dijkstra@arm.com; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-SW-Source: 2018-06/txt/msg00986.txt.bz2 ping From: Wilco Dijkstra Sent: 29 June 2017 17:20 To: libc-alpha@sourceware.org Cc: nd Subject: [PATCH][AArch64] Inline mempcpy again =A0=20 Recent changes removed the generic mempcpy inline.=A0 Given GCC still doesn't optimize mempcpy (PR70140), I am adding it again.=A0 Since string/string.h no longer includes an architecture specific header, do this inside include/string.h and for now only on AArch64. OK for commit? ChangeLog:=20 2017-06-29=A0 Wilco Dijkstra=A0 =A0=A0=A0=A0=A0=A0=A0 * include/string.h: (mempcpy): Redirect to __mempcpy_= inline.=A0=20 =A0=A0=A0=A0=A0=A0=A0 (__mempcpy): Likewise. =A0=A0=A0=A0=A0=A0=A0 (__mempcpy_inline): New inline function. =A0=A0=A0=A0=A0=A0=A0 * sysdeps/aarch64/string_private.h: Define _INLINE_me= mpcpy. -- diff --git a/include/string.h b/include/string.h index 069efd0b87010e5fdb64c87ced7af1dc4f54f232..46b90b8f346149f075fad026e56= 2dfb27b658969 100644 --- a/include/string.h +++ b/include/string.h @@ -197,4 +197,23 @@ extern char *__strncat_chk (char *__restrict __dest, =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0 size_t __len, size_t __destlen) __THROW; =A0#endif =A0 +#if defined __USE_GNU && defined __OPTIMIZE__ \ +=A0=A0=A0 && defined __extern_always_inline && __GNUC_PREREQ (3,2) \ +=A0=A0=A0 && defined _INLINE_mempcpy + +#undef mempcpy +#undef __mempcpy + +#define mempcpy(dest, src, n) __mempcpy_inline (dest, src, n) +#define __mempcpy(dest, src, n) __mempcpy_inline (dest, src, n) + +__extern_always_inline void * +__mempcpy_inline (void *__restrict __dest, +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 const void *__restrict __= src, size_t __n) +{ +=A0 return (char *) memcpy (__dest, __src, __n) + __n; +} + +#endif + =A0#endif diff --git a/sysdeps/aarch64/string_private.h b/sysdeps/aarch64/string_priv= ate.h index 09dedbf3db40cf06077a44af992b399a6b37b48d..8b8fdddcc17a3f69455e72efe9c= 3616d2d33abe2 100644 --- a/sysdeps/aarch64/string_private.h +++ b/sysdeps/aarch64/string_private.h @@ -18,3 +18,6 @@ =A0 =A0/* AArch64 implementations support efficient unaligned access.=A0 */ =A0#define _STRING_ARCH_unaligned 1 + +/* Inline mempcpy since GCC doesn't optimize it (PR70140).=A0 */ +#define _INLINE_mempcpy 1 =20=20=20=20