Home | History | Annotate | Line # | Download | only in notes
testfloat-source.txt revision 1.1
      1  1.1  ross 
      2  1.1  ross TestFloat Release 2a Source Documentation
      3  1.1  ross 
      4  1.1  ross John R. Hauser
      5  1.1  ross 1998 December 16
      6  1.1  ross 
      7  1.1  ross 
      8  1.1  ross -------------------------------------------------------------------------------
      9  1.1  ross Introduction
     10  1.1  ross 
     11  1.1  ross TestFloat is a program for testing that a floating-point implementation
     12  1.1  ross conforms to the IEC/IEEE Standard for Binary Floating-Point Arithmetic.
     13  1.1  ross All standard operations supported by the system can be tested, except for
     14  1.1  ross conversions to and from decimal.  Any of the following machine formats can
     15  1.1  ross be tested:  single precision, double precision, extended double precision,
     16  1.1  ross and/or quadruple precision.  Testing extended double-precision or quadruple-
     17  1.1  ross precision formats requires a C compiler that supports 64-bit integer
     18  1.1  ross arithmetic.
     19  1.1  ross 
     20  1.1  ross This document gives information needed for compiling and/or porting
     21  1.1  ross TestFloat.
     22  1.1  ross 
     23  1.1  ross The source code for TestFloat is intended to be relatively machine-
     24  1.1  ross independent.  TestFloat is written in C, and should be compilable using
     25  1.1  ross any ISO/ANSI C compiler.  At the time of this writing, the program has
     26  1.1  ross been successfully compiled using the GNU C Compiler (`gcc') for several
     27  1.1  ross platforms.  Because ISO/ANSI C does not provide access to some features
     28  1.1  ross of IEC/IEEE floating-point such as the exception flags, porting TestFloat
     29  1.1  ross unfortunately involves some machine-dependent coding.
     30  1.1  ross 
     31  1.1  ross TestFloat depends on SoftFloat, which is a software implementation of
     32  1.1  ross floating-point that conforms to the IEC/IEEE Standard.  SoftFloat is not
     33  1.1  ross included with the TestFloat sources.  It can be obtained from the Web
     34  1.1  ross page `http://HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/SoftFloat.html'.
     35  1.1  ross 
     36  1.1  ross In addition to a program for testing a machine's floating-point, the
     37  1.1  ross TestFloat package includes a variant for testing SoftFloat called
     38  1.1  ross `testsoftfloat'.  The sources for both programs are intermixed, and both are
     39  1.1  ross described here.
     40  1.1  ross 
     41  1.1  ross The first release of TestFloat (Release 1) was called _FloatTest_.  The old
     42  1.1  ross name has been obsolete for some time.
     43  1.1  ross 
     44  1.1  ross 
     45  1.1  ross -------------------------------------------------------------------------------
     46  1.1  ross Limitations
     47  1.1  ross 
     48  1.1  ross TestFloat as written requires an ISO/ANSI-style C compiler.  No attempt has
     49  1.1  ross been made to accomodate compilers that are not ISO-conformant.  Older ``K&R-
     50  1.1  ross style'' compilers are not adequate for compiling TestFloat.  All testing I
     51  1.1  ross have done so far has been with the GNU C Compiler.  Compilation with other
     52  1.1  ross compilers should be possible but has not been tested.
     53  1.1  ross 
     54  1.1  ross The TestFloat sources assume that source code file names can be longer than
     55  1.1  ross 8 characters.  In order to compile under an MS-DOS-style system, many of the
     56  1.1  ross source files will need to be renamed, and the source and makefiles edited
     57  1.1  ross appropriately.  Once compiled, the TestFloat program does not depend on the
     58  1.1  ross existence of long file names.
     59  1.1  ross 
     60  1.1  ross The underlying machine is assumed to be binary with a word size that is a
     61  1.1  ross power of 2.  Bytes are 8 bits.  Testing of extended double-precision and
     62  1.1  ross quadruple-precision formats depends on the C compiler implementing a 64-bit
     63  1.1  ross integer type.  If the largest integer type supported by the C compiler is
     64  1.1  ross 32 bits, only single- and double-precision operations can be tested.
     65  1.1  ross 
     66  1.1  ross 
     67  1.1  ross -------------------------------------------------------------------------------
     68  1.1  ross Contents
     69  1.1  ross 
     70  1.1  ross     Introduction
     71  1.1  ross     Limitations
     72  1.1  ross     Contents
     73  1.1  ross     Legal Notice
     74  1.1  ross     TestFloat Source Directory Structure
     75  1.1  ross     Target-Independent Modules
     76  1.1  ross     Target-Specific Modules
     77  1.1  ross     Target-Specific Header Files
     78  1.1  ross         processors/*.h
     79  1.1  ross         testfloat/*/milieu.h
     80  1.1  ross     Target-Specific Floating-Point Subroutines
     81  1.1  ross     Steps to Creating the TestFloat Executables
     82  1.1  ross     Improving the Random Number Generator
     83  1.1  ross     Contact Information
     84  1.1  ross 
     85  1.1  ross 
     86  1.1  ross 
     87  1.1  ross -------------------------------------------------------------------------------
     88  1.1  ross Legal Notice
     89  1.1  ross 
     90  1.1  ross TestFloat was written by John R. Hauser.
     91  1.1  ross 
     92  1.1  ross THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE.  Although reasonable effort
     93  1.1  ross has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT
     94  1.1  ross TIMES RESULT IN INCORRECT BEHAVIOR.  USE OF THIS SOFTWARE IS RESTRICTED TO
     95  1.1  ross PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY
     96  1.1  ross AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.
     97  1.1  ross 
     98  1.1  ross 
     99  1.1  ross -------------------------------------------------------------------------------
    100  1.1  ross TestFloat Source Directory Structure
    101  1.1  ross 
    102  1.1  ross Because TestFloat is targeted to multiple platforms, its source code
    103  1.1  ross is slightly scattered between target-specific and target-independent
    104  1.1  ross directories and files.  The directory structure is as follows:
    105  1.1  ross 
    106  1.1  ross     processors
    107  1.1  ross     testfloat
    108  1.1  ross         templates
    109  1.1  ross         386-Win32-gcc
    110  1.1  ross         SPARC-Solaris-gcc
    111  1.1  ross 
    112  1.1  ross The two topmost directories and their contents are:
    113  1.1  ross 
    114  1.1  ross     testfloat    - Most of the source code needed for TestFloat.
    115  1.1  ross     processors   - Target-specific header files that are not specific to
    116  1.1  ross                        TestFloat.
    117  1.1  ross 
    118  1.1  ross Within the `testfloat' directory are subdirectories for each of the
    119  1.1  ross targeted platforms.  The TestFloat source code is distributed with targets
    120  1.1  ross `386-Win32-gcc' and `SPARC-Solaris-gcc' (and perhaps others) already
    121  1.1  ross prepared.  These can be used as examples for porting to new targets.  Source
    122  1.1  ross files that are not within these target-specific subdirectories are intended
    123  1.1  ross to be target-independent.
    124  1.1  ross 
    125  1.1  ross The naming convention used for the target-specific directories is
    126  1.1  ross `<processor>-<executable-type>-<compiler>'.  The names of the supplied
    127  1.1  ross target directories should be interpreted as follows:
    128  1.1  ross 
    129  1.1  ross   <processor>:
    130  1.1  ross     386          - Intel 386-compatible processor.
    131  1.1  ross     SPARC        - SPARC processor (as used by Sun machines).
    132  1.1  ross   <executable-type>:
    133  1.1  ross     Win32        - Microsoft Win32 executable.
    134  1.1  ross     Solaris      - Sun Solaris executable.
    135  1.1  ross   <compiler>:
    136  1.1  ross     gcc          - GNU C Compiler.
    137  1.1  ross 
    138  1.1  ross You do not need to maintain this convention if you do not want to.
    139  1.1  ross 
    140  1.1  ross Alongside the supplied target-specific directories there is a `templates'
    141  1.1  ross directory containing a set of ``generic'' target-specific source files.
    142  1.1  ross A new target directory can be created by copying the `templates' directory
    143  1.1  ross and editing the files inside.  (Complete instructions for porting TestFloat
    144  1.1  ross to a new target are in the section _Steps_to_Creating_the_TestFloat_
    145  1.1  ross _Executables_.)  Note that the `templates' directory will not work as a
    146  1.1  ross target directory without some editing.  To avoid confusion, it would be wise
    147  1.1  ross to refrain from editing the files inside `templates' directly.
    148  1.1  ross 
    149  1.1  ross In addition to the distributed sources, TestFloat depends on the existence
    150  1.1  ross of an appropriately-compiled SoftFloat binary and the corresponding header
    151  1.1  ross file `softfloat.h'.  SoftFloat is not included with the TestFloat sources.
    152  1.1  ross It can be obtained from the Web page `http://HTTP.CS.Berkeley.EDU/~jhauser/
    153  1.1  ross arithmetic/SoftFloat.html'.
    154  1.1  ross 
    155  1.1  ross As distributed, the makefiles for TestFloat assume the existence of three
    156  1.1  ross sibling directories:
    157  1.1  ross 
    158  1.1  ross     processors
    159  1.1  ross     softfloat
    160  1.1  ross     testfloat
    161  1.1  ross 
    162  1.1  ross Only the `processors' and `testfloat' directories are included in the
    163  1.1  ross TestFloat package.  The `softfloat' directory is assumed to contain a
    164  1.1  ross target-specific subdirectory within which the SoftFloat header file and
    165  1.1  ross compiled binary can be found.  (See the source documentation accompanying
    166  1.1  ross SoftFloat.)  The `processors' directory distributed with TestFloat is
    167  1.1  ross intended to be identical to that included with the SoftFloat source.
    168  1.1  ross 
    169  1.1  ross These are the defaults, but other organizations of the sources are possible.
    170  1.1  ross The TestFloat makefiles and `milieu.h' files (see below) are easily edited
    171  1.1  ross to accomodate other arrangements.
    172  1.1  ross 
    173  1.1  ross 
    174  1.1  ross -------------------------------------------------------------------------------
    175  1.1  ross Target-Independent Modules
    176  1.1  ross 
    177  1.1  ross The TestFloat program is composed of a number of modules, some target-
    178  1.1  ross specific and some target-independent.  The target-independent modules are as
    179  1.1  ross follows:
    180  1.1  ross 
    181  1.1  ross -- The `fail' module provides a common routine for writing an error message
    182  1.1  ross    and aborting.
    183  1.1  ross 
    184  1.1  ross -- The `random' module generates random integer values.
    185  1.1  ross 
    186  1.1  ross -- The `writeHex' module defines routines for writing the various types in
    187  1.1  ross    the hexadecimal form used by TestFloat.
    188  1.1  ross 
    189  1.1  ross -- The `testCases' module generates test cases for the various types.
    190  1.1  ross 
    191  1.1  ross -- The `testLoops' module contains various routines for exercising two
    192  1.1  ross    implementations of a function and reporting any differences observed.
    193  1.1  ross 
    194  1.1  ross -- The `slowfloat' module provides the simple floating-point implementation
    195  1.1  ross    used by `testsoftfloat' for comparing against SoftFloat.  The heart
    196  1.1  ross    of `slowfloat' is found in either `slowfloat-32' or `slowfloat-64',
    197  1.1  ross    depending on whether the `BITS64' macro is defined.
    198  1.1  ross 
    199  1.1  ross -- The `systfloat' module gives a SoftFloat-like interface to the machine's
    200  1.1  ross    floating-point.
    201  1.1  ross 
    202  1.1  ross -- The `testFunction' module implements `testfloat's main loop for testing a
    203  1.1  ross    function for all of the relevant rounding modes and rounding precisions.
    204  1.1  ross    (The `testsoftfloat' program contains its own version of this code.)
    205  1.1  ross 
    206  1.1  ross -- The `testfloat' and `testsoftfloat' modules are the main modules for the
    207  1.1  ross    `testfloat' and `testsoftfloat' programs.
    208  1.1  ross 
    209  1.1  ross Except possibly for `systfloat', these modules should not need to be
    210  1.1  ross modified.
    211  1.1  ross 
    212  1.1  ross The `systfloat' module uses the floating-point operations of the C language
    213  1.1  ross to access a machine's floating-point.  Unfortunately, some IEC/IEEE
    214  1.1  ross floating-point operations are not accessible within ISO/ANSI C.  The
    215  1.1  ross following machine functions cannot be tested unless an alternate `systfloat'
    216  1.1  ross module is provided:
    217  1.1  ross 
    218  1.1  ross     <float>_to_int32 (rounded according to rounding mode)
    219  1.1  ross     <float>_to_int64 (rounded according to rounding mode)
    220  1.1  ross     <float>_round_to_int
    221  1.1  ross     <float>_rem
    222  1.1  ross     <float>_sqrt, except float64_sqrt
    223  1.1  ross     <float>_eq_signaling
    224  1.1  ross     <float>_le_quiet
    225  1.1  ross     <float>_lt_quiet
    226  1.1  ross 
    227  1.1  ross The `-list' option to `testfloat' will show the operations the program is
    228  1.1  ross prepared to test.  The section _Target-Specific_Floating-Point_Subroutines_
    229  1.1  ross later in this document explains how to create a target-specific `systfloat'
    230  1.1  ross module to change the set of testable functions.
    231  1.1  ross 
    232  1.1  ross 
    233  1.1  ross -------------------------------------------------------------------------------
    234  1.1  ross Target-Specific Modules
    235  1.1  ross 
    236  1.1  ross No target-specific modules are needed for `testsoftfloat'.
    237  1.1  ross 
    238  1.1  ross The `testfloat' program uses two target-specific modules:
    239  1.1  ross 
    240  1.1  ross -- The `systmodes' module defines functions for setting the modes
    241  1.1  ross    controlling the system's floating-point, including the rounding mode and
    242  1.1  ross    the rounding precision for extended double precision.
    243  1.1  ross 
    244  1.1  ross -- The `systflags' module provides a function for clearing and examining the
    245  1.1  ross    system's floating-point exception flags.
    246  1.1  ross 
    247  1.1  ross These modules must be supplied for each target.  They can be implemented in
    248  1.1  ross any way desired, so long as all is reflected in the target's makefile.  For
    249  1.1  ross the targets that come with the distributed source, each of these modules is
    250  1.1  ross implemented as a single assembly language or C language source file.
    251  1.1  ross 
    252  1.1  ross 
    253  1.1  ross -------------------------------------------------------------------------------
    254  1.1  ross Target-Specific Header Files
    255  1.1  ross 
    256  1.1  ross The purpose of the two target-specific header files is detailed below.
    257  1.1  ross In the following, the `*' symbol is used in place of the name of a specific
    258  1.1  ross target, such as `386-Win32-gcc' or `SPARC-Solaris-gcc', or in place of some
    259  1.1  ross other text as explained below.
    260  1.1  ross 
    261  1.1  ross - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    262  1.1  ross processors/*.h
    263  1.1  ross 
    264  1.1  ross The target-specific `processors' header file defines integer types
    265  1.1  ross of various sizes, and also defines certain C preprocessor macros that
    266  1.1  ross characterize the target.  The two examples supplied are `386-gcc.h' and
    267  1.1  ross `SPARC-gcc.h'.  The naming convention used for processor header files is
    268  1.1  ross `<processor>-<compiler>.h'.  The `processors' header file used to compile
    269  1.1  ross TestFloat should be the same as that used to compile SoftFloat.
    270  1.1  ross 
    271  1.1  ross If 64-bit integers are supported by the compiler, the macro name `BITS64'
    272  1.1  ross should be defined here along with the corresponding 64-bit integer
    273  1.1  ross types.  In addition, the function-like macro `LIT64' must be defined for
    274  1.1  ross constructing 64-bit integer literals (constants).  The `LIT64' macro is used
    275  1.1  ross consistently in the TestFloat code to annotate 64-bit literals.
    276  1.1  ross 
    277  1.1  ross If an inlining attribute (such as an `inline' keyword) is provided by the
    278  1.1  ross compiler, the macro `INLINE' should be defined to the appropriate keyword.
    279  1.1  ross If not, `INLINE' can be set to the keyword `static'.  The `INLINE' macro
    280  1.1  ross appears in the TestFloat source code before every function that should be
    281  1.1  ross inlined by the compiler.
    282  1.1  ross 
    283  1.1  ross For maximum flexibility, the TestFloat source files do not include the
    284  1.1  ross `processors' header file directly; rather, this file is included by the
    285  1.1  ross target-specific `milieu.h' header, and `milieu.h' is included by the source
    286  1.1  ross files.
    287  1.1  ross 
    288  1.1  ross - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    289  1.1  ross testfloat/*/milieu.h
    290  1.1  ross 
    291  1.1  ross The `milieu.h' header file provides declarations that are needed to
    292  1.1  ross compile TestFloat.  In particular, it is through this header file that
    293  1.1  ross the appropriate `processors' header is included to characterize the target
    294  1.1  ross processor.  In addition, deviations from ISO/ANSI C by the compiler (such as
    295  1.1  ross names not properly declared in system header files) are corrected in this
    296  1.1  ross header if possible.
    297  1.1  ross 
    298  1.1  ross If the preprocessor macro `BITS64' is defined in the `processors' header
    299  1.1  ross file but only the 32-bit version of SoftFloat is actually used, the `BITS64'
    300  1.1  ross macro should be undefined here after the `processors' header has defined it.
    301  1.1  ross 
    302  1.1  ross If the C compiler implements the `long double' floating-point type of C
    303  1.1  ross as extended double precision, then `LONG_DOUBLE_IS_FLOATX80' should be
    304  1.1  ross defined here.  Alternatively, if the C `long double' type is implemented as
    305  1.1  ross quadruple precision, `LONG_DOUBLE_IS_FLOAT128' should be defined.  At most
    306  1.1  ross one of these macros should be defined.  A C compiler is allowed to implement
    307  1.1  ross `long double' the same as `double', in which case neither of these macros
    308  1.1  ross should be defined.
    309  1.1  ross 
    310  1.1  ross - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    311  1.1  ross 
    312  1.1  ross 
    313  1.1  ross -------------------------------------------------------------------------------
    314  1.1  ross Target-Specific Floating-Point Subroutines
    315  1.1  ross 
    316  1.1  ross This section applies only to `testfloat' and not to `testsoftfloat'.
    317  1.1  ross 
    318  1.1  ross By default, TestFloat tests a machine's floating-point by testing the
    319  1.1  ross floating-point operations of the C language.  Unfortunately, some IEC/IEEE
    320  1.1  ross floating-point operations are not defined within ISO/ANSI C.  If a machine
    321  1.1  ross implements such ``non-C'' operations, target-specific subroutines for
    322  1.1  ross the operations can be supplied to allow TestFloat to test these machine
    323  1.1  ross features.  Typically, such subroutines will need to be written in assembly
    324  1.1  ross language, although equivalent functions can sometimes be found among the
    325  1.1  ross system's software libraries.
    326  1.1  ross 
    327  1.1  ross The following machine functions cannot be tested by TestFloat unless target-
    328  1.1  ross specific subroutines are supplied for them:
    329  1.1  ross 
    330  1.1  ross     <float>_to_int32 (rounded according to rounding mode)
    331  1.1  ross     <float>_to_int64 (rounded according to rounding mode)
    332  1.1  ross     <float>_round_to_int
    333  1.1  ross     <float>_rem
    334  1.1  ross     <float>_sqrt, except float64_sqrt
    335  1.1  ross     <float>_eq_signaling
    336  1.1  ross     <float>_le_quiet
    337  1.1  ross     <float>_lt_quiet
    338  1.1  ross 
    339  1.1  ross In addition to these, none of the `floatx80' functions can be tested by
    340  1.1  ross default if the C `long double' type is something other than extended double
    341  1.1  ross precision; and likewise, none of the `float128' functions can be tested by
    342  1.1  ross default if `long double' is not quadruple precision.  Since `long double'
    343  1.1  ross cannot be both extended double precision and quadruple precision at the
    344  1.1  ross same time, at least one of these types cannot be tested by TestFloat without
    345  1.1  ross appropriate subroutines being supplied for that type.  (On the other hand,
    346  1.1  ross few systems implement _both_ extended double-precision and quadruple-
    347  1.1  ross precision floating-point; and unless a system does implement both, it does
    348  1.1  ross not need both tested.)
    349  1.1  ross 
    350  1.1  ross Note that the `-list' option to `testfloat' will show the operations
    351  1.1  ross TestFloat is prepared to test.
    352  1.1  ross 
    353  1.1  ross TestFloat's `systfloat' module supplies the system version of the functions
    354  1.1  ross to be tested.  The names of the `systfloat' subroutines are the same as the
    355  1.1  ross function names used as arguments to the `testfloat' command but with `syst_'
    356  1.1  ross prefixed--thus, for example, `syst_float32_add' and `syst_int32_to_float32'.
    357  1.1  ross The default `systfloat' module maps these system functions to the standard
    358  1.1  ross C operations; so `syst_float32_add', for example, is implemented using the
    359  1.1  ross C `+' operation for the single-precision `float' type.  For each system
    360  1.1  ross function supplied by `systfloat', a corresponding `SYST_<function>'
    361  1.1  ross preprocessor macro is defined in `systfloat.h' to indicate that the function
    362  1.1  ross exists to be tested (e.g., `SYST_FLOAT32_ADD').  The `systfloat.h' header
    363  1.1  ross file also declares function prototypes for the `systfloat' functions.
    364  1.1  ross 
    365  1.1  ross (The `systfloat.h' file that comes with the TestFloat package declares
    366  1.1  ross prototypes for all of the possible `systfloat' functions, whether defined in
    367  1.1  ross `systfloat' or not.  There is no penalty for declaring a function prototype
    368  1.1  ross that is never used.)
    369  1.1  ross 
    370  1.1  ross A target-specific version of the `systfloat' module can easily be created to
    371  1.1  ross replace the generic one.  This in fact has been done for the example targets
    372  1.1  ross `386-Win32-gcc' and `SPARC-Solaris-gcc'.  For each target, an assembly
    373  1.1  ross language `systfloat.S' has been created in the target directory along with
    374  1.1  ross a corresponding `systfloat.h' header file defining the `SYST_<function>'
    375  1.1  ross macros for the functions implemented.  The makefiles of the targets have
    376  1.1  ross been edited to use these target-specific versions of `systfloat' rather than
    377  1.1  ross the generic one.
    378  1.1  ross 
    379  1.1  ross The `systfloat' modules of the example targets have been written entirely
    380  1.1  ross in assembly language in order to bypass any peculiarities of the C compiler.
    381  1.1  ross Although this is probably a good idea, it is certainly not required.
    382  1.1  ross 
    383  1.1  ross 
    384  1.1  ross -------------------------------------------------------------------------------
    385  1.1  ross Steps to Creating the TestFloat Executables
    386  1.1  ross 
    387  1.1  ross Porting and/or compiling TestFloat involves the following steps:
    388  1.1  ross 
    389  1.1  ross 1. Port SoftFloat and create a SoftFloat binary.  (Refer to the
    390  1.1  ross    documentation accompanying SoftFloat.)
    391  1.1  ross 
    392  1.1  ross 2. If one does not already exist, create an appropriate target-specific
    393  1.1  ross    subdirectory under `testfloat' by copying the given `templates'
    394  1.1  ross    directory.  The remaining steps occur within the target-specific
    395  1.1  ross    subdirectory.
    396  1.1  ross 
    397  1.1  ross 3. Edit the files `milieu.h' and `Makefile' to reflect the current
    398  1.1  ross    environment.
    399  1.1  ross 
    400  1.1  ross 4. Make `testsoftfloat' by executing `make testsoftfloat' (or `make
    401  1.1  ross    testsoftfloat.exe', or whatever the `testsoftfloat' executable is
    402  1.1  ross    called).  Verify that SoftFloat is working correctly by testing it with
    403  1.1  ross    `testsoftfloat'.
    404  1.1  ross 
    405  1.1  ross If you only wanted `testsoftfloat', you are done.  The steps for `testfloat'
    406  1.1  ross continue:
    407  1.1  ross 
    408  1.1  ross 5. In the target-specific subdirectory, implement the `systmodes' and
    409  1.1  ross    `systflags' modules.  (The `syst_float_set_rounding_precision' function
    410  1.1  ross    need not do anything if the system does not support extended double
    411  1.1  ross    precision.)
    412  1.1  ross 
    413  1.1  ross 6. If the target machine supports standard floating-point functions that are
    414  1.1  ross    not accessible within ISO/ANSI C, or if the C compiler cannot be trusted
    415  1.1  ross    to use the machine's floating-point directly, create a target-specific
    416  1.1  ross    `systfloat' module.
    417  1.1  ross 
    418  1.1  ross 7. In the target-specific subdirectory, execute `make'.
    419  1.1  ross 
    420  1.1  ross 
    421  1.1  ross -------------------------------------------------------------------------------
    422  1.1  ross Improving the Random Number Generator
    423  1.1  ross 
    424  1.1  ross If you are serious about using TestFloat for testing floating-point, you
    425  1.1  ross should consider replacing the supplied `random.c' with a better target-
    426  1.1  ross specific one.  The standard C `rand' function is rather poor on some
    427  1.1  ross systems, and consequently `random.c' has been written to assume very little
    428  1.1  ross about the quality of `rand'.  As a result, the `rand' function is called
    429  1.1  ross more frequently than it might need to be, shortening the time before
    430  1.1  ross the random number generator repeats, and possibly wasting time as well.
    431  1.1  ross If `rand' is better on your system, or if another better random number
    432  1.1  ross generator is available (such as `rand48' on most Unix systems), TestFloat
    433  1.1  ross can be improved by overriding the given `random.c' with a target-specific
    434  1.1  ross one.
    435  1.1  ross 
    436  1.1  ross 
    437  1.1  ross -------------------------------------------------------------------------------
    438  1.1  ross Contact Information
    439  1.1  ross 
    440  1.1  ross At the time of this writing, the most up-to-date information about
    441  1.1  ross TestFloat and the latest release can be found at the Web page `http://
    442  1.1  ross HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/TestFloat.html'.
    443  1.1  ross 
    444  1.1  ross 
    445