Next Previous Contents

5. The SoftFloat Library

SoftFloat is a software implementation of floating point that conforms to the IEC/IEEE standard for binary floating point arithmetic. As many as four formats are supported: single precision, double precision, extended double precision, and quadruple precision. All operations required by the standard are implemented, except for conversions to and from decimal. SoftFloat implements the following arithmetic operations:

1) Conversions among all the floating point formats, and also between 32-bit
integers and any of the floating point formats.
2) The add, subtract, multiply, divide, and square root operations for all
floating point formats.
3) The floating point remainder operation defined by the IEC/IEEE standard
for all floating point formats.
4) For each floating-point format, a ``round to integer'' operation that 
rounds to the nearest integer value in the same format.
5) Comparisons between two values in the same floating-point format.

All four rounding modes prescribed by the IEC/IEEE standard are implemented for all operations that require rounding.

All five exception flags (INEXACT, UNDERFLOW, OVERFLOW, DIVBYZERO, INVALID) required by the IEC/IEEE standard are implemented. In the terminology of the IEC/IEEE standard, SoftFloat can detect tininess for underflow either before or after rounding. Detecting tininess after rounding is better because it results in fewer spurious underflow signals. Like most systems, SoftFloat always detects loss of accuracy for underflow as an inexact result.

At the time of this writing, the most up-to-date information about SoftFloat and the latest release can be found at the Web page http://HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/softfloat.html.

Next Previous Contents