[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: memcpy is not optimal implemented
From: |
Andrew Morton |
Subject: |
Re: memcpy is not optimal implemented |
Date: |
Fri, 16 Mar 2001 01:51:27 +0000 |
Ulrich Drepper wrote:
>
> "Wallner, Jens" <address@hidden> writes:
>
> > the currend memcpy function for i686 is not optimal implemented.
>
> That's not correct. The underlying assumptions are different.
On Intel chips, `rep;movsd' is *slower* than an open-coded
copy loop for all alignments except when source and dest
are both 8-byte-aligned.
When src and dest are 8-byte-aligned, movsd is about 20%
faster. When they're not, an open-coded copy can be
up to 50% faster, depending upon alignment.
On a K6-2, movsd is faster at all alignments.
These are _huge_ differences, and I suggest they outweigh
this sort of algorithmic tweaking.
There's a little app for playing with this at
http://www.uow.edu.au/~andrewm/linux/cptimer.tar.gz
if anyone's interested.