1 |
349 |
julius |
|
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 |
|
|
Include common integer types and flags.
|
33 |
|
|
-------------------------------------------------------------------------------
|
34 |
|
|
*/
|
35 |
|
|
#include "or1k-gcc.h"
|
36 |
|
|
|
37 |
|
|
// Include "uart.h" when we want to printt with UART
|
38 |
|
|
#include "uart.h"
|
39 |
|
|
|
40 |
|
|
// Set to 1 for very short test loops (just 10 tests)
|
41 |
|
|
#define V_SHORT_TESTS 0
|
42 |
|
|
|
43 |
|
|
/*
|
44 |
|
|
-------------------------------------------------------------------------------
|
45 |
|
|
If the `BITS64' macro is defined by the processor header file but the
|
46 |
|
|
version of SoftFloat being used/tested is the 32-bit one (`bits32'), the
|
47 |
|
|
`BITS64' macro must be undefined here.
|
48 |
|
|
-------------------------------------------------------------------------------
|
49 |
|
|
#undef BITS64
|
50 |
|
|
*/
|
51 |
|
|
|
52 |
|
|
/*
|
53 |
|
|
-------------------------------------------------------------------------------
|
54 |
|
|
The macro `LONG_DOUBLE_IS_FLOATX80' can be defined to indicate that the
|
55 |
|
|
C compiler supports the type `long double' as an extended double-precision
|
56 |
|
|
format. Alternatively, the macro `LONG_DOUBLE_IS_FLOAT128' can be defined
|
57 |
|
|
to indicate that `long double' is a quadruple-precision format. If neither
|
58 |
|
|
of these macros is defined, `long double' will be ignored.
|
59 |
|
|
-------------------------------------------------------------------------------
|
60 |
|
|
#define LONG_DOUBLE_IS_FLOATX80
|
61 |
|
|
*/
|
62 |
|
|
|
63 |
|
|
/*
|
64 |
|
|
-------------------------------------------------------------------------------
|
65 |
|
|
Symbolic Boolean literals.
|
66 |
|
|
-------------------------------------------------------------------------------
|
67 |
|
|
*/
|
68 |
|
|
enum {
|
69 |
|
|
FALSE = 0,
|
70 |
|
|
TRUE = 1
|
71 |
|
|
};
|
72 |
|
|
|