lkml.org 
[lkml]   [1996]   [Apr]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Ideas for reducing memory copying and zeroing times (fwd)
Jamie Lokier <jamie@rebellion.co.uk> writes:

>Linus writes:
>
>> No, the fastest, and shortest way to do it is
>>
>> .. dest in %edi ..
>> movl $1024,%ecx
>> xorl %eax,%eax
>> rep; stosl
>
>According to a 486 book nearby, `rep stosl' takes 5 cycles per write, if
>the memory is fast enough to keep up.

Look it up under "rep", not "stosd". The 486 book says it takes 4
cycles when used with rep. Compare that to "movsd" which takes only
three (go figure). Makes me think it would be interesting (but
possibly not useful) to do timings on something like this:

movl %edi,%esi
addl $4,%edi
xorl %eax,%eax
movl $1020,%ecx
movl %eax,(%esi)
rep; movsl

which is how we had to do it way back when on the Z80.

Tom.



\
 
 \ /
  Last update: 2005-03-22 13:36    [W:0.252 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site