Subject: Re: FP emulation patch available

From: "Kevin D. Kissell" <[email-masked]>
Date: Mon, 13 Mar 2000 09:33:02 +0100

As Ralf just reminded me by email, the Algorithmics/MIPS
kernel FPU emulator is *not* SMP-safe.  It borrows an existing
(if seldom used) exception handler, and has only a single
set of emulated FPU registers.  I sort-of knew this, but
had not worried about it, since to the best of my knowledge
no one is building (or has built) SMP MIPS machines 
out of FPU-less processors.  Nevertheless, a compile-time
test, to blow up on any attempt at an SMP build of the 
emulator should always have been there, and is going in 
right away.

Does anyone out there actually need/want an SMP
version of the emulator?   It's not completely trivial,
but it would not be all that difficult to do...

            Regards,

            Kevin K.
__

Kevin D. Kissell
MIPS Technologies European Architecture Lab
[email-masked]
Tel. +33.4.78.38.70.67
FAX. +33.4.78.38.70.68

---

From: Alan Cox <[email-masked]>
Date: Mon, 13 Mar 2000 13:46:19 +0000 (GMT)

> but it would not be all that difficult to do...

If you dont do it please add

#ifdef CONFIG_SMP
#error "Not on this emulator"
#endif

to the emu code - for the person who didnt know 8)

---

From: Ralf Baechle <[email-masked]>
Date: Mon, 13 Mar 2000 14:46:57 -0300

> but it would not be all that difficult to do...

It should be fixed if it's going to be used as the base for the kernel
fp support we need also for the Origins.

  Ralf

---

From: Harald Koerfgen <[email-masked]>
Date: Mon, 13 Mar 2000 20:05:47 +0100 (MET)

> to the emu code - for the person who didnt know 8)

harry:~ > grep CONFIG_SMP linux/arch/mips/config.in
harry:~ > grep CONFIG_SMP linux/arch/mips64/config.in
   bool '  Multi-Processing support (Experimental)' CONFIG_SMP

SCNR :-).
-- 
Regards,
Harald

---

From: "William J. Earl" <[email-masked]>
Date: Mon, 13 Mar 2000 12:13:41 -0800 (PST)

> fp support we need also for the Origins.

      Yes, all MIPS CPUs with which I am familiar require at least some
kernel FP support for certain corner cases and workarounds.

---

From: "Andrew R. Baker" <[email-masked]>
Date: Tue, 14 Mar 2000 12:50:46 -0600 (CST)

> fp support we need also for the Origins.

This should not be an issue for the design I am using for the hardware fp
support.  It will have a different entry point into the operation
emulation code that will use the hardware registers instead of the
software fpu struct.  It will also only handle operations that should
produce an unimplemented exception (this is not quite all of the fp ops).
Ralf, from discussing this with you earlier, this should be SMP safe, but
it should be checked anyway.  I will try and get some code out this week.

-Andrew

---

From: "Kevin D. Kissell" <[email-masked]>
Date: Wed, 15 Mar 2000 15:35:17 +0100

Dominic Sweetman wrote:

> Andrew R. Baker ([email-masked]) writes:
>
> > ... It will also only handle operations that should produce an
> > unimplemented exception (this is not quite all of the fp ops).
>
> Denormalised operands (for example) will cause any computational
> operation to blow up (change sign, load, store and move will survive -
> can you think of much else?).  The requirement for MIPS hardware is
> something like "you can throw an unimplemented exception in response
> to any combination of operands and operation you don't like, so long
> as it's rare".  That's why a complete emulator is probably a good
> idea.
>
> Dominic Sweetman
> [email-masked]

OK, I'm convinced.  I believe I know how to make the Algorithmics
emulator SMP-safe *and* more efficient in the general case, thanks
in part to a suggestion from Ralf.  Time permitting, I will also wire it
up to the unimplemented operation handler.  Give me a week or so
to accumulate enough spare time...