Subject: Re: optimizations [for non-debugging] amd64 kernels
To: Blair Sadewitz <blair.sadewitz@gmail.com>
From: Andrew Doran <ad@netbsd.org>
List: port-amd64
Date: 09/11/2007 12:25:49
On Tue, Sep 11, 2007 at 07:09:31AM -0400, Blair Sadewitz wrote:

> Also, at:
> 
> http://bahar.aydogan.net/~blair/amd64-string.diff
> 
> is an enhancement for x86_64 memcpy/bzero/bcopy functions in
> common/libc.  This is authored by fuyuki@hadaly.org and is a slight
> modification of the latest version (<see
> http://www.hadaly.org/fuyuki>) of what was originally posted in a PR
> back around Jan/Feb.
...
> I'd appreciate it if someone who actually knew x86_64 assembly would
> take a look at this and/or if others would test it so we could get it
> in the tree at some point.

The setup and teardown for stos/movs/cmps are really expensive and for small
strings (like under 512 bytes) you're better off with really simple loops
using the arithemetic instructions.

Andrew