[lkml]   [1996]   [Apr]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Ideas for reducing memory copying and zeroing times (fwd)
Jamie Lokier <> 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.


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