home *** CD-ROM | disk | FTP | other *** search
- This kit contains a set of floating point routines for use with gcc on a
- native 68000 processor. Both single and double floats are implemented. The
- kit is a port of a floating point package for 80x86 processors, originally
- written by Peter S. Housel for the minix-pc c compiler. Some 68000 specific
- optimizations have been done during the port, f.i. i tried to do almost every-
- thing in the 68000 register set, and shifts are reduced by swapping register
- halfs whereever possible (shifting is expensive on a plain 68000). However,
- please note that the whole package is not a speed daemon. Especially the
- single float procedures are *slow* - i haven't put much effort in this part,
- for example more things could be done in registers here.
-
- As an addition to the original packet this one supports denormalized numbers
- as demanded by IEEE. For those of you not familar with the concept of denor-
- malized number here is a short description :
-
- Due to the implied '1' bit at the top position of normalized numbers there is
- a gap between zero and the first normalized number:
- 0 =>1
- I IIIIIII I I I I I I I
- <-gap->
- The effect of this is the result of calculations with very small numbers tend
- to be zero ("flush to zero" effect). To avoid this IEEE 754 demands a special
- format for numbers in that gap, called "denormalized numbers". Denormalized
- numbers have the smallest possible binary exponent (-1022) but have an implied
- zero bit at the top position of the mantissa rather then a '1' bit, giving
- you more bits (52 or 23) for filling the gap :
- 0 =>1
- IIIIIIIIIIIIIII I I I I I I I
- <----->
- denormalized
- numbers
- Normalized numbers have a binary exponent ranging from 0x001 to 0x3fe (0x0fe
- for single floats). The exponent value 0x3ff (0xff) is used to represent NaN's
- and infinity. The value 0x000 represents a denormalized number. Note carefully
- that the exponent values 0x000 and 0x001 describe the same binary exponent
- value, -1022, but the implied bit on the mantissa top has another value.
- The "special" number zero is represented by a 0x000 exponent and a zero
- mantissa; note that IEEE explicitly allows 0.0 to have a sign.
-
- NaN's, infinities and signed zero values are not supported by the routines in
- this kit; that's left as an exercise to the reader 8-) (should not be too
- difficult, just time consuming).
-
- For a description of the implementation of the routines in detail, see the
- NOTES files in P.Housels original posting to comp.os.minix; he has also a
- fairly good list of literature references on this theme.
-
- Since there's always another bug, mail me if you have found one. I'll try
- to get bugs corrected (well, as far as my time allows that 8-).
-
- Enjoy,
- -Kai-Uwe Bloem- I5110401@DBSTU1.BITNET (will change RSN)
- Europe: ...!unido!dbstu1.bitnet!i5110401
- US: ...!cornellc.ccs.cornell.edu!dbstu1.bitnet!i5110401
- I5110401%DBSTU1.BITNET@cornellc.ccs.cornell.edu
-