Subject: Re: FPE & libm
To: Christopher R. Bowman <crb@Glue.umd.edu>
From: Ken Nakata <kenn@romulus.rutgers.edu>
List: port-m68k
Date: 02/01/1996 20:19:14
> On Thu, 1 Feb 1996, Ken Nakata wrote:
> > I'm thinking of stripping m68k FPE down a bit; especially, I want to
> > pull the implemented transcendental functions out of FPE.
> > 
> > Why don't we do the same thing they do for i386 port?  I.e. having the
> > default libm not calling most FP instructions.  Of course, it's
> > *theoretically* slower than calculating everything in the kernel...
> > We could provide the user with two sets of libm, one directly using
> > 68881 instructions, the other not (= default).
> 
> I don't quite understand what exactly is being proposed here.  Could
> you explain a little more?

Oops, I'm sorry for confusion.  It seems only I was clear on what I
was saying.

Currently, m68k FPE's goal is to emulate every unprivilleged 68881
instruction.  My proposal is, instead of doing so, we (well, mostly I,
I admit) could save a significant amount of effort by following i386
port's strategy in FP emulation; NetBSD/i386's FPE is derived from
linux, and it emulates only fadd, fsub, fmul, and fdiv, whereas the
real 387, 486DX and Pentium do much more.  The rest is taken care of
by libm.  You can build a libm that directly uses i387 instructions,
but the default one does not.

If we do the same thing, m68k FPE does not need any more new
instructions to be added, so I could concentrate on making the
existing instructions more stable and reliable, instead of adding more
instruction emulations (thus making more bugs).  We could provide
users with two version of libms; one which uses 68881 instructions,
the other which does not.  Those with FPU-less machines should use the
latter libm, whereas those with FPU can use either one (of course, the
first libm is faster, so no one with a real FPU would want to use the
latter).

I hope it's clearer now.

ken