From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/1395 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Re: musl libc, memcpy Date: Wed, 1 Aug 2012 02:19:05 -0400 Message-ID: <20120801061904.GD544@brightrain.aerifal.cx> References: <20120730204100.GY544@brightrain.aerifal.cx> <20120801042722.GB544@brightrain.aerifal.cx> <20120801054011.GC544@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="xesSdrSSBC0PokLI" X-Trace: dough.gmane.org 1343801941 29507 80.91.229.3 (1 Aug 2012 06:19:01 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 1 Aug 2012 06:19:01 +0000 (UTC) Cc: Kim Walisch To: musl@lists.openwall.com Original-X-From: musl-return-1396-gllmg-musl=m.gmane.org@lists.openwall.com Wed Aug 01 08:19:01 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1SwSGn-000186-0c for gllmg-musl@plane.gmane.org; Wed, 01 Aug 2012 08:18:57 +0200 Original-Received: (qmail 8117 invoked by uid 550); 1 Aug 2012 06:18:56 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 8109 invoked from network); 1 Aug 2012 06:18:56 -0000 Content-Disposition: inline In-Reply-To: <20120801054011.GC544@brightrain.aerifal.cx> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:1395 Archived-At: --xesSdrSSBC0PokLI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Aug 01, 2012 at 01:40:11AM -0400, Rich Felker wrote: > On Wed, Aug 01, 2012 at 12:27:22AM -0400, Rich Felker wrote: > > I'm attaching a (possibly buggy; not heavily tested) rep-movsd-based > > version. I'd be interested in hearing how it performs. > > And here is the attachment... And here's a version that might be faster; reportedly, rep movsd works better when the destination address is aligned. Rich --xesSdrSSBC0PokLI Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="memcpy.s" .global xmemcpy .type xmemcpy,@function xmemcpy: push %esi push %edi mov 12(%esp),%edi mov 16(%esp),%esi mov 20(%esp),%ecx mov %edi,%eax cmp $4,%ecx jc 1f test $3,%edi jz 1f 2: movsb dec %ecx test $3,%edi jnz 2b 1: mov %ecx,%edx shr $2,%ecx rep movsl and $3,%edx jz 1f 2: movsb dec %edx jnz 2b 1: pop %edi pop %esi ret --xesSdrSSBC0PokLI--