[lkml]   [1997]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: MMX bogomips fun
    Illuminati Primus  <> 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),

    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.

    ___ or @{stud,informatik} ____
    __ o <URL:> <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    [W:3.263 / U:0.164 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site