Re: MMX emulator ?

Clifford Wolf (clifford@clifford.at)
Wed, 17 Jun 1998 11:24:09 +0200 (MEST)


On Wed, 17 Jun 1998, [iso-8859-1] Johan Myréen wrote:

> On Tue, 16 Jun 1998, Jeffrey Hundstad wrote:
>
> > > i = detect_MMMX();
> > > if !i then usenormalstuff=1;
> > > else usemmx=1;
>
> > If you can assume the MMX functions are there then EACH application
> > doesn't have to emulate all of the MMX stuff itself if it doesn't have
> > the REAL hardware.
>
> > This should be treated EXACTLY like the Floating Point hardware... at
> > least in my opinion.
>
> The 'normal stuff' in a real application that cared about
> decent speed would NOT be emulating the MMX instructions, but
> would do things differently. MMX is all about speed. I'd
> expect emulated MMX to be far slower than writing the code
> optimally using the instruction set available on a non-MMX
> CPU. And this is not counting the overhead from trapping the
> MMX opcodes.
>
> If writing an MMX emulator leads to application programmers
> being lazy and just doing MMX versions of their apps, because
> "MMX is always available on Linux", then you have made a great
> disservice to the users.

You are absolute right! Fact is that we don't have a MMX enabled compiler
at all (as far as i know). On my oppinion it should be in the competence
of the compiler to make a check if MMX is available (e.g. as part of
crtbegin.o) and than decide on the fly if the MMX code should be used or
not. The disadvantage of this is that the code would be a bit slower on
non-MMX CPUs becouse the checks ...

Whatever the solution will be: A MMX emulator in the kernel is senseless
and stupid becouse it would kill the performance as soon as it's used.
Very bad since MMX is an performance improvement!

- clifford

-- -- -- -- -- -- -- -- -- -- -- -- --
Clifford Wolf
magnet - Internet at Work IRC: efnet / clifford
Director of System Development http://www.clifford.at/
e-mail: c.wolf@magnet.at email: god@clifford.at

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu