Skip to contentSkip to conversation

FP emulation patch available

DISCUSSION Kevin D. Kissell 6 participants 7 messages Mar 13, 2000 – Mar 15, 2000 1 message not in the archive MIPS

lore
Share & tools
lore
#0 lore raw

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 protected]
Tel. +33.4.78.38.70.67
FAX. +33.4.78.38.70.68

#1 lore raw
Quoted 3 lines

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...

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)

#2 lore raw
Quoted 11 lines · On 13-Mar-00 Alan Cox wrote:
Quoted 3 lines

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...

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)

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 :-).

Signature · 2 lines
Regards,
Harald
#3 lore raw
In reply to Kevin D. Kissell
Quoted 3 lines · Kevin D. Kissell

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...

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

#4 lore raw
Quoted 8 lines · Ralf Baechle
Quoted 3 lines · Kevin D. Kissell

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...

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.

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

#5 lore raw
In reply to Ralf Baechle
Quoted 8 lines · Ralf Baechle
Quoted 3 lines · Kevin D. Kissell

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...

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.

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

#7 lore raw
In reply to a message not in the archive
Quoted 13 lines · Dominic Sweetman
Quoted 2 lines · Andrew R. Baker

... 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.

Quoted 2 lines

Dominic Sweetman
[email protected]

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...