[lkml]   [1996]   [Apr]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Ideas for reducing memory copying and zeroing times (fwd)
   Date: 	Fri, 19 Apr 1996 09:14:11 +0300 (EET DST)
From: Linus Torvalds <>

No, the fastest, and shortest way to do it is

.. dest in %edi ..
movl $1024,%ecx
xorl %eax,%eax
rep; stosl

Which is in fact exactly how linux does it..

Not on the Pentium, it isn't. This is: FPU state...expensive, but cheap compared to clearing 4K bytes...
fstl (%edi)
addl $8, %edi
subl $8, %ecx
jne 1b
...restore FPU state...

(Hint: the above _really_ flies on a PPro. Intel optimized it to do
cache-line accesses, it seems. They did the right thing)

Pity they didn't make it do the right thing on the Pentium...

Robert Krawitz <>

Member of the League for Programming Freedom -- mail
Tall Clubs International -- or 1-800-521-2512

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