Subject: Re: ns32k toolchain
To: Perry E. Metzger <perry@piermont.com>
From: Ian Dall <ian@beware.dropbear.id.au>
List: port-pc532
Date: 08/04/2002 23:10:34
"Perry E. Metzger" <perry@piermont.com> writes:

> Ian Dall <ian@beware.dropbear.id.au> writes:
> > The 32081 and 32381 only impliment a subset of ieee fp. There are enough
> > hooks to allow software emulation of the missing bits. Essentially, by
> > default, the fpu traps on NaN, Inf, and denormal operands, divide by zero
> > etc. If you want to get the right answers, you need to do the right thing
> > with those traps, which is what my handler does. It does not do full
> > fp emulation and will not suffice if you don't have a fpu, so it fills
> > a different niche to a softfloat library.
> 
> This is very similar to what many modern FPUs do, actually. The Alpha
> port, for instance, handles things like denorms with a separate
> library that Ross Harvey wrote. We might want to use the same library
> code where possible across ports for this sort of thing.

There is certianly some code which is machine independant, though
I don't think it is as easilly seperated as I might hope. The current
library for the pc532 is approximately:

sibyl:-ieee-1.4 $ pc532-netbsd-size *.o
   text    data     bss     dec     hex filename
    168       0       0     168      a8 ieee_dze.o
   5288       4      88    5380    1504 ieee_handler.o
   2392       0       0    2392     958 ieee_invop.o
    496       0       0     496     1f0 ieee_ovfl.o
   2632       4       0    2636     a4c ieee_subnormal.o

ieee_handler.o is almost entirely machine dependant - instruction
decoding, getting and setting fpu state etc. The rest, totalling
roughly 50%, is mostly machine independent, but it is not as clean as
I might hope. I think it would be hard to make the seperation cleaner
without addtitional overhead.

Ian