lkml.org 
[lkml]   [1997]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: MMX bogomips fun
Date
Illuminati Primus  <vermont@gate.net> wrote:
> I wonder.. how fast would linux be if it was optimized for MMX? Will GCC
> support MMX optimizations sometime? I have been thinking it could
> probably speed up checksumming and other repetitive calculations.. Or

It _could_ speed up this kind of calculations, if carefully
hand-optimized, yes. But I think MMX is over-rated.

MMX is a set of basic arithmetic instructions (add, multiply...) on
64-bit registers that do four 16-bit ops or eight 8-bit ops in
parallel, i.e. SIMD processing. That can help if you operate on really
independent data (as with some graphics calculations, you can do
several pixels in parallel) or with things like checksumming if the
algorithm requires no overflow handling (e.g. IP header checksum),
etc.

Now the big gotcha: The 64-bit registers used for MMX are the FPU
registers. If you have floating point and MMX ops in the same task,
you have to FSAVE/FRSTOR them. This is a _very_ expensive operation
(124+70 cycles in the best case). It's only justified if a block of
MMX operations saves more cycles, compared to regular operations.
So it won't help for the simple calculations described above.

olaf
--
___ Olaf.Titz@inka.de or @{stud,informatik}.uni-karlsruhe.de ____
__ o <URL:http://www.inka.de/~bigred/> <IRC:praetorius>
__/<_ >> Just as long as the wheels keep on turning round
_)>(_)______________ I will live for the groove 'til the sun goes down << ____
\
 
 \ /
  Last update: 2005-03-22 13:38    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site