| 1 |
234 |
jeremybenn |
|
| 2 |
|
|
/*
|
| 3 |
|
|
===============================================================================
|
| 4 |
|
|
|
| 5 |
|
|
This C header file is part of TestFloat, Release 2a, a package of programs
|
| 6 |
|
|
for testing the correctness of floating-point arithmetic complying to the
|
| 7 |
|
|
IEC/IEEE Standard for Floating-Point.
|
| 8 |
|
|
|
| 9 |
|
|
Written by John R. Hauser. More information is available through the Web
|
| 10 |
|
|
page `http://HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/TestFloat.html'.
|
| 11 |
|
|
|
| 12 |
|
|
THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort
|
| 13 |
|
|
has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT
|
| 14 |
|
|
TIMES RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO
|
| 15 |
|
|
PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY
|
| 16 |
|
|
AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.
|
| 17 |
|
|
|
| 18 |
|
|
Derivative works are acceptable, even for commercial purposes, so long as
|
| 19 |
|
|
(1) they include prominent notice that the work is derivative, and (2) they
|
| 20 |
|
|
include prominent notice akin to these four paragraphs for those parts of
|
| 21 |
|
|
this code that are retained.
|
| 22 |
|
|
|
| 23 |
|
|
Modified for use with or1ksim's testsuite.
|
| 24 |
|
|
|
| 25 |
|
|
Contributor Julius Baxter <julius.baxter@orsoc.se>
|
| 26 |
|
|
|
| 27 |
|
|
===============================================================================
|
| 28 |
|
|
*/
|
| 29 |
|
|
|
| 30 |
|
|
/*
|
| 31 |
|
|
-------------------------------------------------------------------------------
|
| 32 |
|
|
The following macros are defined to indicate that the corresponding
|
| 33 |
|
|
functions exist.
|
| 34 |
|
|
-------------------------------------------------------------------------------
|
| 35 |
|
|
*/
|
| 36 |
|
|
#define SYST_INT32_TO_FLOAT32
|
| 37 |
|
|
#define SYST_FLOAT32_TO_INT32
|
| 38 |
|
|
#define SYST_FLOAT32_TO_INT32_ROUND_TO_ZERO
|
| 39 |
|
|
//#define SYST_FLOAT32_ROUND_TO_INT
|
| 40 |
|
|
#define SYST_FLOAT32_ADD
|
| 41 |
|
|
#define SYST_FLOAT32_SUB
|
| 42 |
|
|
#define SYST_FLOAT32_MUL
|
| 43 |
|
|
#define SYST_FLOAT32_DIV
|
| 44 |
|
|
#define SYST_FLOAT32_EQ
|
| 45 |
|
|
#define SYST_FLOAT32_LE
|
| 46 |
|
|
#define SYST_FLOAT32_LT
|
| 47 |
|
|
|
| 48 |
|
|
|
| 49 |
|
|
|
| 50 |
|
|
|
| 51 |
|
|
/*
|
| 52 |
|
|
-------------------------------------------------------------------------------
|
| 53 |
|
|
System function declarations. (Some of these functions may not exist.)
|
| 54 |
|
|
-------------------------------------------------------------------------------
|
| 55 |
|
|
*/
|
| 56 |
|
|
float32 syst_int32_to_float32( int32 );
|
| 57 |
|
|
int32 syst_float32_to_int32( float32 );
|
| 58 |
|
|
int32 syst_float32_to_int32_round_to_zero( float32 );
|
| 59 |
|
|
float32 syst_float32_round_to_int( float32 );
|
| 60 |
|
|
float32 syst_float32_add( float32, float32 );
|
| 61 |
|
|
float32 syst_float32_sub( float32, float32 );
|
| 62 |
|
|
float32 syst_float32_mul( float32, float32 );
|
| 63 |
|
|
float32 syst_float32_div( float32, float32 );
|
| 64 |
|
|
float32 syst_float32_rem( float32, float32 );
|
| 65 |
|
|
flag syst_float32_eq( float32, float32 );
|
| 66 |
|
|
flag syst_float32_le( float32, float32 );
|
| 67 |
|
|
flag syst_float32_lt( float32, float32 );
|
| 68 |
|
|
flag syst_float32_eq_signaling( float32, float32 );
|
| 69 |
|
|
flag syst_float32_le_quiet( float32, float32 );
|
| 70 |
|
|
flag syst_float32_lt_quiet( float32, float32 );
|
| 71 |
|
|
|
| 72 |
|
|
|