Subject: Re: Floating point hardware vs. software
To: None <port-i386@NetBSD.ORG>
From: John F. Woods <jfw@jfwhome.funhouse.com>
List: port-i386
Date: 02/03/1996 15:33:21
Thinking a bit about floating point emulation here, a couple of questions
occur to me: first, it shouldn't be marvelously hard for some sufficiently
motivated individual to code a true-BSD-copyright replacement which uses the
algorithms (but not code) of the GNU-copyright version. (Well, that's not
quite a question... ;-) Second, and a real question, is there any particular
reason for the emulator to be in the kernel? The 2.10BSD PDP-11 floating-point
emulation code ran entirely in user mode, except for some very simple
trampoline code for the instruction trap handler; said handler would determine
the instruction which trapped, and if it was a floating point handler, set up
a call to a user-mode handler (preregistered by the process from crt0).
This does mean that each process that needs emulation needs a copy of the
emulation library, but thanks to shared libraries, those copies can all be
the same copy (an option that wasn't present on 2.10BSD...). However, saving
kernel memory like this was probably more important for a PDP-11 (where each
8KB page represented a substantial fraction of the absolute maximum 4MB
physical memory capacity), but this provides the ability for programs which
need speed more than accuracy to use customized emulation libraries.