lkml.org 
[lkml]   [1996]   [Apr]   [19]   [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)
   Date: 	Fri, 19 Apr 1996 09:14:11 +0300 (EET DST)
From: Linus Torvalds <torvalds@cs.helsinki.fi>

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:

...save FPU state...expensive, but cheap compared to clearing 4K bytes...
1:
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 <rlk@tiac.net> http://www.tiac.net/users/rlk/

Member of the League for Programming Freedom -- mail lpf@uunet.uu.net
Tall Clubs International -- tci-request@aptinc.com or 1-800-521-2512


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