TestFloat is a program for testing whether a computer's floating-point conforms to the IEC/IEEE Standard for Binary Floating-point Arithmetic. TestFloat works by comparing the behavior of the machine's floating-point with that of the SoftFloat software implementation of floating-point. Any differences found are reported as probable errors in the machine's floating-point.
TestFloat performs relatively simple tests designed to check the fundamental soundness of the floating-point under test. All of the modes and special cases of the IEEE Standard are tested. However, TestFloat is not especially good at testing difficult rounding cases for divisions and square roots. It also makes no attempt to find bugs specific to SRT divisions and the like (such as the infamous Pentium divide bug). Pointers to software that tests for such failures are provided later on this page.
It is the responsibility of the user to verify that the discrepencies TestFloat finds actually represent faults in the system being tested. Unfortunately, TestFloat's output is not easily interpreted. Detailed knowledge of the IEEE Standard is required to use TestFloat responsibly.
The current version of TestFloat is
TestFloat has found at least one bug on more than half the computers I have run it on. The bugs that TestFloat finds are listed in a file included in the TestFloat package:
text file,
systemBugs.txt [16 kB].
|
I myself have run TestFloat on only a handful of machines. If you find bugs not on this list, feel free to drop me a note and I'll update the list.
The following archives contain everything you need for testing the
floating-point of an
Win32
zip archive,
TestFloat-2a-exe-386-Win32.zip [106 kB].
|
MS-DOS 80386 executable and documentation (older
zip archive,
TestFloat-2-exe-386-MSDOS-DPMI.zip [93 kB].
|
TestFloat is written in ISO/ANSI C and should be compilable with any
ISO-compliant C compiler.
Old-style compilers are not supported.
Using the GNU C Compiler (gcc), TestFloat has been compiled and
run on several platforms.
Because ISO C does not give full access to the features of IEEE
floating-point, porting TestFloat involves some target-dependent
programming.
The following files comprise
Documentation for using TestFloat.
text file,
testfloat.txt [36 kB].
|
Archive of all TestFloat source code and documentation. This includes target-specific code for 386's and SPARC's. (Other machines can be targeted using these two as examples.)
zip archive,
TestFloat-2a.zip [101 kB].
|
|
compress'ed tar archive,
TestFloat-2a.tar.Z [150 kB].
|
TestFloat requires SoftFloat, which is not included in the TestFloat archive.
| SoftFloat is a free, high-quality software implementation of floating-point that conforms to the IEC/IEEE Standard for Binary Floating-point Arithmetic. |
The TestFloat sources actually include two test programs, one for testing a machine's floating-point by comparing against SoftFloat, and another for testing SoftFloat itself. SoftFloat is tested by comparing it against yet another, different software floating-point that is simpler and also slower than SoftFloat. Although one can't be completely certain that the other floating-point is correct either, it's unlikely that it would make exactly the same mistakes as SoftFloat. Any unexpected discrepancies between the two floating-points are flagged as probable errors in one or the other.
| The UCBTEST suite includes programs for testing the rounding of multiplies, divides, and square roots, and also for testing the accuracy of basic transcendental functions. UCBTEST can be found in the NetLib Repository, under the fp (floating-point) directory. | |
| W. Kahan at U.C. Berkeley has made a few test programs available on the Web, notably the SRTEST program for testing SRT division. |
TestFloat was written by me,
John R. Hauser.
Bugs in TestFloat and other comments can be reported to me at
jh@jhauser.us.