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 |
|
|
extern int8 slow_float_rounding_mode;
|
31 |
|
|
extern int8 slow_float_exception_flags;
|
32 |
|
|
extern int8 slow_float_detect_tininess;
|
33 |
|
|
#ifdef FLOATX80
|
34 |
|
|
extern int8 slow_floatx80_rounding_precision;
|
35 |
|
|
#endif
|
36 |
|
|
|
37 |
|
|
float32 slow_int32_to_float32( int32 );
|
38 |
|
|
float64 slow_int32_to_float64( int32 );
|
39 |
|
|
#ifdef FLOATX80
|
40 |
|
|
floatx80 slow_int32_to_floatx80( int32 );
|
41 |
|
|
#endif
|
42 |
|
|
#ifdef FLOAT128
|
43 |
|
|
float128 slow_int32_to_float128( int32 );
|
44 |
|
|
#endif
|
45 |
|
|
#ifdef BITS64
|
46 |
|
|
float32 slow_int64_to_float32( int64 );
|
47 |
|
|
float64 slow_int64_to_float64( int64 );
|
48 |
|
|
#ifdef FLOATX80
|
49 |
|
|
floatx80 slow_int64_to_floatx80( int64 );
|
50 |
|
|
#endif
|
51 |
|
|
#ifdef FLOAT128
|
52 |
|
|
float128 slow_int64_to_float128( int64 );
|
53 |
|
|
#endif
|
54 |
|
|
#endif
|
55 |
|
|
|
56 |
|
|
int32 slow_float32_to_int32( float32 );
|
57 |
|
|
int32 slow_float32_to_int32_round_to_zero( float32 );
|
58 |
|
|
#ifdef BITS64
|
59 |
|
|
int64 slow_float32_to_int64( float32 );
|
60 |
|
|
int64 slow_float32_to_int64_round_to_zero( float32 );
|
61 |
|
|
#endif
|
62 |
|
|
float64 slow_float32_to_float64( float32 );
|
63 |
|
|
#ifdef FLOATX80
|
64 |
|
|
floatx80 slow_float32_to_floatx80( float32 );
|
65 |
|
|
#endif
|
66 |
|
|
#ifdef FLOAT128
|
67 |
|
|
float128 slow_float32_to_float128( float32 );
|
68 |
|
|
#endif
|
69 |
|
|
|
70 |
|
|
float32 slow_float32_round_to_int( float32 );
|
71 |
|
|
float32 slow_float32_add( float32, float32 );
|
72 |
|
|
float32 slow_float32_sub( float32, float32 );
|
73 |
|
|
float32 slow_float32_mul( float32, float32 );
|
74 |
|
|
float32 slow_float32_div( float32, float32 );
|
75 |
|
|
float32 slow_float32_rem( float32, float32 );
|
76 |
|
|
float32 slow_float32_sqrt( float32 );
|
77 |
|
|
flag slow_float32_eq( float32, float32 );
|
78 |
|
|
flag slow_float32_le( float32, float32 );
|
79 |
|
|
flag slow_float32_lt( float32, float32 );
|
80 |
|
|
flag slow_float32_eq_signaling( float32, float32 );
|
81 |
|
|
flag slow_float32_le_quiet( float32, float32 );
|
82 |
|
|
flag slow_float32_lt_quiet( float32, float32 );
|
83 |
|
|
|
84 |
|
|
int32 slow_float64_to_int32( float64 );
|
85 |
|
|
int32 slow_float64_to_int32_round_to_zero( float64 );
|
86 |
|
|
#ifdef BITS64
|
87 |
|
|
int64 slow_float64_to_int64( float64 );
|
88 |
|
|
int64 slow_float64_to_int64_round_to_zero( float64 );
|
89 |
|
|
#endif
|
90 |
|
|
float32 slow_float64_to_float32( float64 );
|
91 |
|
|
#ifdef FLOATX80
|
92 |
|
|
floatx80 slow_float64_to_floatx80( float64 );
|
93 |
|
|
#endif
|
94 |
|
|
#ifdef FLOAT128
|
95 |
|
|
float128 slow_float64_to_float128( float64 );
|
96 |
|
|
#endif
|
97 |
|
|
|
98 |
|
|
float64 slow_float64_round_to_int( float64 );
|
99 |
|
|
float64 slow_float64_add( float64, float64 );
|
100 |
|
|
float64 slow_float64_sub( float64, float64 );
|
101 |
|
|
float64 slow_float64_mul( float64, float64 );
|
102 |
|
|
float64 slow_float64_div( float64, float64 );
|
103 |
|
|
float64 slow_float64_rem( float64, float64 );
|
104 |
|
|
float64 slow_float64_sqrt( float64 );
|
105 |
|
|
flag slow_float64_eq( float64, float64 );
|
106 |
|
|
flag slow_float64_le( float64, float64 );
|
107 |
|
|
flag slow_float64_lt( float64, float64 );
|
108 |
|
|
flag slow_float64_eq_signaling( float64, float64 );
|
109 |
|
|
flag slow_float64_le_quiet( float64, float64 );
|
110 |
|
|
flag slow_float64_lt_quiet( float64, float64 );
|
111 |
|
|
|
112 |
|
|
#ifdef FLOATX80
|
113 |
|
|
|
114 |
|
|
int32 slow_floatx80_to_int32( floatx80 );
|
115 |
|
|
int32 slow_floatx80_to_int32_round_to_zero( floatx80 );
|
116 |
|
|
#ifdef BITS64
|
117 |
|
|
int64 slow_floatx80_to_int64( floatx80 );
|
118 |
|
|
int64 slow_floatx80_to_int64_round_to_zero( floatx80 );
|
119 |
|
|
#endif
|
120 |
|
|
float32 slow_floatx80_to_float32( floatx80 );
|
121 |
|
|
float64 slow_floatx80_to_float64( floatx80 );
|
122 |
|
|
#ifdef FLOAT128
|
123 |
|
|
float128 slow_floatx80_to_float128( floatx80 );
|
124 |
|
|
#endif
|
125 |
|
|
|
126 |
|
|
floatx80 slow_floatx80_round_to_int( floatx80 );
|
127 |
|
|
floatx80 slow_floatx80_add( floatx80, floatx80 );
|
128 |
|
|
floatx80 slow_floatx80_sub( floatx80, floatx80 );
|
129 |
|
|
floatx80 slow_floatx80_mul( floatx80, floatx80 );
|
130 |
|
|
floatx80 slow_floatx80_div( floatx80, floatx80 );
|
131 |
|
|
floatx80 slow_floatx80_rem( floatx80, floatx80 );
|
132 |
|
|
floatx80 slow_floatx80_sqrt( floatx80 );
|
133 |
|
|
flag slow_floatx80_eq( floatx80, floatx80 );
|
134 |
|
|
flag slow_floatx80_le( floatx80, floatx80 );
|
135 |
|
|
flag slow_floatx80_lt( floatx80, floatx80 );
|
136 |
|
|
flag slow_floatx80_eq_signaling( floatx80, floatx80 );
|
137 |
|
|
flag slow_floatx80_le_quiet( floatx80, floatx80 );
|
138 |
|
|
flag slow_floatx80_lt_quiet( floatx80, floatx80 );
|
139 |
|
|
|
140 |
|
|
#endif
|
141 |
|
|
|
142 |
|
|
#ifdef FLOAT128
|
143 |
|
|
|
144 |
|
|
int32 slow_float128_to_int32( float128 );
|
145 |
|
|
int32 slow_float128_to_int32_round_to_zero( float128 );
|
146 |
|
|
#ifdef BITS64
|
147 |
|
|
int64 slow_float128_to_int64( float128 );
|
148 |
|
|
int64 slow_float128_to_int64_round_to_zero( float128 );
|
149 |
|
|
#endif
|
150 |
|
|
float32 slow_float128_to_float32( float128 );
|
151 |
|
|
float64 slow_float128_to_float64( float128 );
|
152 |
|
|
#ifdef FLOATX80
|
153 |
|
|
floatx80 slow_float128_to_floatx80( float128 );
|
154 |
|
|
#endif
|
155 |
|
|
|
156 |
|
|
float128 slow_float128_round_to_int( float128 );
|
157 |
|
|
float128 slow_float128_add( float128, float128 );
|
158 |
|
|
float128 slow_float128_sub( float128, float128 );
|
159 |
|
|
float128 slow_float128_mul( float128, float128 );
|
160 |
|
|
float128 slow_float128_div( float128, float128 );
|
161 |
|
|
float128 slow_float128_rem( float128, float128 );
|
162 |
|
|
float128 slow_float128_sqrt( float128 );
|
163 |
|
|
flag slow_float128_eq( float128, float128 );
|
164 |
|
|
flag slow_float128_le( float128, float128 );
|
165 |
|
|
flag slow_float128_lt( float128, float128 );
|
166 |
|
|
flag slow_float128_eq_signaling( float128, float128 );
|
167 |
|
|
flag slow_float128_le_quiet( float128, float128 );
|
168 |
|
|
flag slow_float128_lt_quiet( float128, float128 );
|
169 |
|
|
|
170 |
|
|
#endif
|
171 |
|
|
|