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:
single precision
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:
README.txt
-
Package Overview for SoftFloat |
|
SoftFloat.txt
-
SoftFloat |
|
SoftFloat-source.txt
-
SoftFloat |
|
SoftFloat-history.txt
-
History of Major Changes to SoftFloat, up to |
The current version of SoftFloat is
The following archives contain all the source code and documentation for
zip archive,
SoftFloat-2b.zip [115 kB].
|
|
compress'ed tar archive,
SoftFloat-2b.tar.Z [165 kB].
|
Once compiled, SoftFloat can be tested using the testsoftfloat
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 gcc -O2)
| speed (MFLOPS) | ||||||||||||||||
| single | double | extended double |
quadruple | |||||||||||||
| add | mul | div | add | mul | div | add | mul | div | add | mul | div | |||||
| 1.20 | 1.40 | 0.88 | 0.66 | 0.70 | 0.33 | 0.52 | 0.66 | 0.19 | 0.32 | 0.25 | 0.13 | |||||
| 3.61 | 4.68 | 2.99 | 2.77 | 2.69 | 1.30 | 1.82 | 2.17 | 0.65 | 1.29 | 0.87 | 0.47 | |||||
|
The
fp
(floating-point) directory of the
Netlib Repository.
Includes |
|
|
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
jhauser@jhauser.us.