From patchwork Tue Mar 8 13:51:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lu, Hongjiu" X-Patchwork-Id: 11255 Received: (qmail 18014 invoked by alias); 8 Mar 2016 13:51:52 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 17946 invoked by uid 89); 8 Mar 2016 13:51:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.5 required=5.0 tests=AWL, BAYES_05, KAM_LAZY_DOMAIN_SECURITY, NO_DNS_FOR_FROM, RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=239, Hx-spam-relays-external:192.55.52.120, H*RU:mga04.intel.com, Hx-spam-relays-external:mga04.intel.com X-HELO: mga04.intel.com X-ExtLoop1: 1 Date: Tue, 8 Mar 2016 05:51:43 -0800 From: "H.J. Lu" To: GNU C Library Subject: Re: [PATCH] Define _HAVE_STRING_ARCH_mempcpy to 1 for x86 Message-ID: <20160308135143.GA3849@intel.com> Reply-To: "H.J. Lu" References: <20160307205735.GA3204@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20160307205735.GA3204@intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) On Mon, Mar 07, 2016 at 12:57:35PM -0800, H.J. Lu wrote: > Since x86 has an optimized mempcpy and GCC can inline mempcpy on x86, > define _HAVE_STRING_ARCH_mempcpy to 1 for x86. > > If duplicated code between optimized memcpy and mempcpy is a concern, > we can add an entry point in memcpy and use it to implement mempcpy, > similar to the set of patches for __mempcpy_sse2_unaligned: > > https://sourceware.org/ml/libc-alpha/2016-03/msg00166.html > > OK for master? > This one actually works. Any objections? H.J. --- From 9e2ed19d8c644e357c06ab56178962877c4fea5c Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 8 Mar 2016 05:04:15 -0800 Subject: [PATCH] Define _HAVE_STRING_ARCH_mempcpy to 1 for x86 Since x86 has an optimized mempcpy and GCC can inline mempcpy on x86, define _HAVE_STRING_ARCH_mempcpy to 1 for x86. [BZ #19759] * sysdeps/x86/bits/string.h (_HAVE_STRING_ARCH_mempcpy): New. --- sysdeps/x86/bits/string.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sysdeps/x86/bits/string.h b/sysdeps/x86/bits/string.h index e4e019f..8dfce05 100644 --- a/sysdeps/x86/bits/string.h +++ b/sysdeps/x86/bits/string.h @@ -23,6 +23,9 @@ /* Use the unaligned string inline ABI. */ #define _STRING_INLINE_unaligned 1 +/* Don't inline mempcpy into memcpy as x86 has an optimized mempcpy. */ +#define _HAVE_STRING_ARCH_mempcpy 1 + /* Enable inline functions only for i486 or better when compiling for ia32. */ #if !defined __x86_64__ && (defined __i486__ || defined __pentium__ \