SoftFloat is a free, high-quality software implementation of the IEC/IEEE
Standard for Binary Floating-point Arithmetic.
(IEC is the
International Electrotechnical Commission,
an international standards body.)
SoftFloat is completely faithful to the IEEE Standard, while at the same
time being relatively fast.
All functions dictated by the standard are supported except for conversions
to and from decimal.
SoftFloat fully implements the four most common floating-point formats:
SoftFloat is distributed in the form of ISO/ANSI C source code and should be
compilable with almost any ISO-compliant C compiler.
Old-style compilers are not supported.
Using the GNU C Compiler (
gcc), the package has been compiled
and tested for several platforms.
Target-specific code is provided for 386 and SPARC processors.
Other machines can be targeted using these two as examples.
SoftFloat's code for the extended double-precision and quadruple-precision
formats depends on the existence of a 64-bit integer type
More information about SoftFloat can be found in the following text files from the SoftFloat package:
The current version of SoftFloat is
The following archives contain all the source code and documentation for
Once compiled, SoftFloat can be tested using the
program of TestFloat:
|TestFloat is a program for testing that an implementation of floating-point conforms to the IEC/IEEE Standard for Binary Floating-point Arithmetic.|
The following table shows the speeds of some of SoftFloat's functions on
machines of different strength.
For this table, SoftFloat was compiled using the GNU C Compiler with only
ordinary optimization turned on
(floating-point) directory of the
Freely Distributable LIBM
(fdlibm), an implementation of the
|Sun Microsystems' Numerical Computation Guide, which covers the IEEE Standard in detail.|
|My article ``Handling floating-point exceptions in numeric programs'', explaining how the exception handling features of the IEEE Standard can be applied to real programs.|
SoftFloat was written by me, John R. Hauser. The original version of this code was created as part of the Spert project at the International Computer Science Institute. Funding for that project was provided in part by the National Science Foundation under grant MIP-9311980.
Bugs in SoftFloat and other comments can be reported to me at