1 |
|
---|
2 | /*============================================================================
|
---|
3 |
|
---|
4 | This C header file is part of TestFloat, Release 3e, a package of programs for
|
---|
5 | testing the correctness of floating-point arithmetic complying with the IEEE
|
---|
6 | Standard for Floating-Point, by John R. Hauser.
|
---|
7 |
|
---|
8 | Copyright 2011, 2012, 2013, 2014, 2015, 2017 The Regents of the University of
|
---|
9 | California. All rights reserved.
|
---|
10 |
|
---|
11 | Redistribution and use in source and binary forms, with or without
|
---|
12 | modification, are permitted provided that the following conditions are met:
|
---|
13 |
|
---|
14 | 1. Redistributions of source code must retain the above copyright notice,
|
---|
15 | this list of conditions, and the following disclaimer.
|
---|
16 |
|
---|
17 | 2. Redistributions in binary form must reproduce the above copyright notice,
|
---|
18 | this list of conditions, and the following disclaimer in the documentation
|
---|
19 | and/or other materials provided with the distribution.
|
---|
20 |
|
---|
21 | 3. Neither the name of the University nor the names of its contributors may
|
---|
22 | be used to endorse or promote products derived from this software without
|
---|
23 | specific prior written permission.
|
---|
24 |
|
---|
25 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
---|
26 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
---|
27 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
---|
28 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
---|
29 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
---|
30 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
---|
31 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
---|
32 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
---|
33 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
---|
34 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
---|
35 |
|
---|
36 | =============================================================================*/
|
---|
37 |
|
---|
38 | #include <stdbool.h>
|
---|
39 | #include <stdint.h>
|
---|
40 | #include <signal.h>
|
---|
41 | #include "softfloat.h"
|
---|
42 |
|
---|
43 | extern volatile sig_atomic_t genLoops_stop;
|
---|
44 |
|
---|
45 | extern bool genLoops_forever;
|
---|
46 | extern bool genLoops_givenCount;
|
---|
47 | extern uint_fast64_t genLoops_count;
|
---|
48 | extern uint_fast8_t *genLoops_trueFlagsPtr;
|
---|
49 |
|
---|
50 | void gen_a_ui32( void );
|
---|
51 | void gen_a_ui64( void );
|
---|
52 | void gen_a_i32( void );
|
---|
53 | void gen_a_i64( void );
|
---|
54 | #ifdef FLOAT16
|
---|
55 | void gen_a_f16( void );
|
---|
56 | void gen_ab_f16( void );
|
---|
57 | void gen_abc_f16( void );
|
---|
58 | #endif
|
---|
59 | void gen_a_f32( void );
|
---|
60 | void gen_ab_f32( void );
|
---|
61 | void gen_abc_f32( void );
|
---|
62 | #ifdef FLOAT64
|
---|
63 | void gen_a_f64( void );
|
---|
64 | void gen_ab_f64( void );
|
---|
65 | void gen_abc_f64( void );
|
---|
66 | #endif
|
---|
67 | #ifdef EXTFLOAT80
|
---|
68 | void gen_a_extF80( void );
|
---|
69 | void gen_ab_extF80( void );
|
---|
70 | void gen_abc_extF80( void );
|
---|
71 | #endif
|
---|
72 | #ifdef FLOAT128
|
---|
73 | void gen_a_f128( void );
|
---|
74 | void gen_ab_f128( void );
|
---|
75 | void gen_abc_f128( void );
|
---|
76 | #endif
|
---|
77 |
|
---|
78 | #ifdef FLOAT16
|
---|
79 | void gen_a_ui32_z_f16( float16_t ( uint32_t ) );
|
---|
80 | #endif
|
---|
81 | void gen_a_ui32_z_f32( float32_t ( uint32_t ) );
|
---|
82 | #ifdef FLOAT64
|
---|
83 | void gen_a_ui32_z_f64( float64_t ( uint32_t ) );
|
---|
84 | #endif
|
---|
85 | #ifdef EXTFLOAT80
|
---|
86 | void gen_a_ui32_z_extF80( void ( uint32_t, extFloat80_t * ) );
|
---|
87 | #endif
|
---|
88 | #ifdef FLOAT128
|
---|
89 | void gen_a_ui32_z_f128( void ( uint32_t, float128_t * ) );
|
---|
90 | #endif
|
---|
91 | #ifdef FLOAT16
|
---|
92 | void gen_a_ui64_z_f16( float16_t ( uint64_t ) );
|
---|
93 | #endif
|
---|
94 | void gen_a_ui64_z_f32( float32_t ( uint64_t ) );
|
---|
95 | #ifdef FLOAT64
|
---|
96 | void gen_a_ui64_z_f64( float64_t ( uint64_t ) );
|
---|
97 | #endif
|
---|
98 | #ifdef EXTFLOAT80
|
---|
99 | void gen_a_ui64_z_extF80( void ( uint64_t, extFloat80_t * ) );
|
---|
100 | #endif
|
---|
101 | #ifdef FLOAT128
|
---|
102 | void gen_a_ui64_z_f128( void ( uint64_t, float128_t * ) );
|
---|
103 | #endif
|
---|
104 | #ifdef FLOAT16
|
---|
105 | void gen_a_i32_z_f16( float16_t ( int32_t ) );
|
---|
106 | #endif
|
---|
107 | void gen_a_i32_z_f32( float32_t ( int32_t ) );
|
---|
108 | #ifdef FLOAT64
|
---|
109 | void gen_a_i32_z_f64( float64_t ( int32_t ) );
|
---|
110 | #endif
|
---|
111 | #ifdef EXTFLOAT80
|
---|
112 | void gen_a_i32_z_extF80( void ( int32_t, extFloat80_t * ) );
|
---|
113 | #endif
|
---|
114 | #ifdef FLOAT128
|
---|
115 | void gen_a_i32_z_f128( void ( int32_t, float128_t * ) );
|
---|
116 | #endif
|
---|
117 | #ifdef FLOAT16
|
---|
118 | void gen_a_i64_z_f16( float16_t ( int64_t ) );
|
---|
119 | #endif
|
---|
120 | void gen_a_i64_z_f32( float32_t ( int64_t ) );
|
---|
121 | #ifdef FLOAT64
|
---|
122 | void gen_a_i64_z_f64( float64_t ( int64_t ) );
|
---|
123 | #endif
|
---|
124 | #ifdef EXTFLOAT80
|
---|
125 | void gen_a_i64_z_extF80( void ( int64_t, extFloat80_t * ) );
|
---|
126 | #endif
|
---|
127 | #ifdef FLOAT128
|
---|
128 | void gen_a_i64_z_f128( void ( int64_t, float128_t * ) );
|
---|
129 | #endif
|
---|
130 |
|
---|
131 | #ifdef FLOAT16
|
---|
132 | void
|
---|
133 | gen_a_f16_z_ui32_rx(
|
---|
134 | uint_fast32_t ( float16_t, uint_fast8_t, bool ), uint_fast8_t, bool );
|
---|
135 | void
|
---|
136 | gen_a_f16_z_ui64_rx(
|
---|
137 | uint_fast64_t ( float16_t, uint_fast8_t, bool ), uint_fast8_t, bool );
|
---|
138 | void
|
---|
139 | gen_a_f16_z_i32_rx(
|
---|
140 | int_fast32_t ( float16_t, uint_fast8_t, bool ), uint_fast8_t, bool );
|
---|
141 | void
|
---|
142 | gen_a_f16_z_i64_rx(
|
---|
143 | int_fast64_t ( float16_t, uint_fast8_t, bool ), uint_fast8_t, bool );
|
---|
144 | void gen_a_f16_z_ui32_x( uint_fast32_t ( float16_t, bool ), bool );
|
---|
145 | void gen_a_f16_z_ui64_x( uint_fast64_t ( float16_t, bool ), bool );
|
---|
146 | void gen_a_f16_z_i32_x( int_fast32_t ( float16_t, bool ), bool );
|
---|
147 | void gen_a_f16_z_i64_x( int_fast64_t ( float16_t, bool ), bool );
|
---|
148 | void gen_a_f16_z_f32( float32_t ( float16_t ) );
|
---|
149 | #ifdef FLOAT64
|
---|
150 | void gen_a_f16_z_f64( float64_t ( float16_t ) );
|
---|
151 | #endif
|
---|
152 | #ifdef EXTFLOAT80
|
---|
153 | void gen_a_f16_z_extF80( void ( float16_t, extFloat80_t * ) );
|
---|
154 | #endif
|
---|
155 | #ifdef FLOAT128
|
---|
156 | void gen_a_f16_z_f128( void ( float16_t, float128_t * ) );
|
---|
157 | #endif
|
---|
158 | void gen_az_f16( float16_t ( float16_t ) );
|
---|
159 | void
|
---|
160 | gen_az_f16_rx(
|
---|
161 | float16_t ( float16_t, uint_fast8_t, bool ), uint_fast8_t, bool );
|
---|
162 | void gen_abz_f16( float16_t ( float16_t, float16_t ) );
|
---|
163 | void gen_abcz_f16( float16_t ( float16_t, float16_t, float16_t ) );
|
---|
164 | void gen_ab_f16_z_bool( bool ( float16_t, float16_t ) );
|
---|
165 | #endif
|
---|
166 |
|
---|
167 | void
|
---|
168 | gen_a_f32_z_ui32_rx(
|
---|
169 | uint_fast32_t ( float32_t, uint_fast8_t, bool ), uint_fast8_t, bool );
|
---|
170 | void
|
---|
171 | gen_a_f32_z_ui64_rx(
|
---|
172 | uint_fast64_t ( float32_t, uint_fast8_t, bool ), uint_fast8_t, bool );
|
---|
173 | void
|
---|
174 | gen_a_f32_z_i32_rx(
|
---|
175 | int_fast32_t ( float32_t, uint_fast8_t, bool ), uint_fast8_t, bool );
|
---|
176 | void
|
---|
177 | gen_a_f32_z_i64_rx(
|
---|
178 | int_fast64_t ( float32_t, uint_fast8_t, bool ), uint_fast8_t, bool );
|
---|
179 | void gen_a_f32_z_ui32_x( uint_fast32_t ( float32_t, bool ), bool );
|
---|
180 | void gen_a_f32_z_ui64_x( uint_fast64_t ( float32_t, bool ), bool );
|
---|
181 | void gen_a_f32_z_i32_x( int_fast32_t ( float32_t, bool ), bool );
|
---|
182 | void gen_a_f32_z_i64_x( int_fast64_t ( float32_t, bool ), bool );
|
---|
183 | #ifdef FLOAT16
|
---|
184 | void gen_a_f32_z_f16( float16_t ( float32_t ) );
|
---|
185 | #endif
|
---|
186 | #ifdef FLOAT64
|
---|
187 | void gen_a_f32_z_f64( float64_t ( float32_t ) );
|
---|
188 | #endif
|
---|
189 | #ifdef EXTFLOAT80
|
---|
190 | void gen_a_f32_z_extF80( void ( float32_t, extFloat80_t * ) );
|
---|
191 | #endif
|
---|
192 | #ifdef FLOAT128
|
---|
193 | void gen_a_f32_z_f128( void ( float32_t, float128_t * ) );
|
---|
194 | #endif
|
---|
195 | void gen_az_f32( float32_t ( float32_t ) );
|
---|
196 | void
|
---|
197 | gen_az_f32_rx(
|
---|
198 | float32_t ( float32_t, uint_fast8_t, bool ), uint_fast8_t, bool );
|
---|
199 | void gen_abz_f32( float32_t ( float32_t, float32_t ) );
|
---|
200 | void gen_abcz_f32( float32_t ( float32_t, float32_t, float32_t ) );
|
---|
201 | void gen_ab_f32_z_bool( bool ( float32_t, float32_t ) );
|
---|
202 |
|
---|
203 | #ifdef FLOAT64
|
---|
204 | void
|
---|
205 | gen_a_f64_z_ui32_rx(
|
---|
206 | uint_fast32_t ( float64_t, uint_fast8_t, bool ), uint_fast8_t, bool );
|
---|
207 | void
|
---|
208 | gen_a_f64_z_ui64_rx(
|
---|
209 | uint_fast64_t ( float64_t, uint_fast8_t, bool ), uint_fast8_t, bool );
|
---|
210 | void
|
---|
211 | gen_a_f64_z_i32_rx(
|
---|
212 | int_fast32_t ( float64_t, uint_fast8_t, bool ), uint_fast8_t, bool );
|
---|
213 | void
|
---|
214 | gen_a_f64_z_i64_rx(
|
---|
215 | int_fast64_t ( float64_t, uint_fast8_t, bool ), uint_fast8_t, bool );
|
---|
216 | void gen_a_f64_z_ui32_x( uint_fast32_t ( float64_t, bool ), bool );
|
---|
217 | void gen_a_f64_z_ui64_x( uint_fast64_t ( float64_t, bool ), bool );
|
---|
218 | void gen_a_f64_z_i32_x( int_fast32_t ( float64_t, bool ), bool );
|
---|
219 | void gen_a_f64_z_i64_x( int_fast64_t ( float64_t, bool ), bool );
|
---|
220 | #ifdef FLOAT16
|
---|
221 | void gen_a_f64_z_f16( float16_t ( float64_t ) );
|
---|
222 | #endif
|
---|
223 | void gen_a_f64_z_f32( float32_t ( float64_t ) );
|
---|
224 | #ifdef EXTFLOAT80
|
---|
225 | void gen_a_f64_z_extF80( void ( float64_t, extFloat80_t * ) );
|
---|
226 | #endif
|
---|
227 | #ifdef FLOAT128
|
---|
228 | void gen_a_f64_z_f128( void ( float64_t, float128_t * ) );
|
---|
229 | #endif
|
---|
230 | void gen_az_f64( float64_t ( float64_t ) );
|
---|
231 | void
|
---|
232 | gen_az_f64_rx(
|
---|
233 | float64_t ( float64_t, uint_fast8_t, bool ), uint_fast8_t, bool );
|
---|
234 | void gen_abz_f64( float64_t ( float64_t, float64_t ) );
|
---|
235 | void gen_abcz_f64( float64_t ( float64_t, float64_t, float64_t ) );
|
---|
236 | void gen_ab_f64_z_bool( bool ( float64_t, float64_t ) );
|
---|
237 | #endif
|
---|
238 |
|
---|
239 | #ifdef EXTFLOAT80
|
---|
240 | void
|
---|
241 | gen_a_extF80_z_ui32_rx(
|
---|
242 | uint_fast32_t ( const extFloat80_t *, uint_fast8_t, bool ),
|
---|
243 | uint_fast8_t,
|
---|
244 | bool
|
---|
245 | );
|
---|
246 | void
|
---|
247 | gen_a_extF80_z_ui64_rx(
|
---|
248 | uint_fast64_t ( const extFloat80_t *, uint_fast8_t, bool ),
|
---|
249 | uint_fast8_t,
|
---|
250 | bool
|
---|
251 | );
|
---|
252 | void
|
---|
253 | gen_a_extF80_z_i32_rx(
|
---|
254 | int_fast32_t ( const extFloat80_t *, uint_fast8_t, bool ),
|
---|
255 | uint_fast8_t,
|
---|
256 | bool
|
---|
257 | );
|
---|
258 | void
|
---|
259 | gen_a_extF80_z_i64_rx(
|
---|
260 | int_fast64_t ( const extFloat80_t *, uint_fast8_t, bool ),
|
---|
261 | uint_fast8_t,
|
---|
262 | bool
|
---|
263 | );
|
---|
264 | void
|
---|
265 | gen_a_extF80_z_ui32_x( uint_fast32_t ( const extFloat80_t *, bool ), bool );
|
---|
266 | void
|
---|
267 | gen_a_extF80_z_ui64_x( uint_fast64_t ( const extFloat80_t *, bool ), bool );
|
---|
268 | void gen_a_extF80_z_i32_x( int_fast32_t ( const extFloat80_t *, bool ), bool );
|
---|
269 | void gen_a_extF80_z_i64_x( int_fast64_t ( const extFloat80_t *, bool ), bool );
|
---|
270 | #ifdef FLOAT16
|
---|
271 | void gen_a_extF80_z_f16( float16_t ( const extFloat80_t * ) );
|
---|
272 | #endif
|
---|
273 | void gen_a_extF80_z_f32( float32_t ( const extFloat80_t * ) );
|
---|
274 | #ifdef FLOAT64
|
---|
275 | void gen_a_extF80_z_f64( float64_t ( const extFloat80_t * ) );
|
---|
276 | #endif
|
---|
277 | #ifdef FLOAT128
|
---|
278 | void gen_a_extF80_z_f128( void ( const extFloat80_t *, float128_t * ) );
|
---|
279 | #endif
|
---|
280 | void gen_az_extF80( void ( const extFloat80_t *, extFloat80_t * ) );
|
---|
281 | void
|
---|
282 | gen_az_extF80_rx(
|
---|
283 | void ( const extFloat80_t *, uint_fast8_t, bool, extFloat80_t * ),
|
---|
284 | uint_fast8_t,
|
---|
285 | bool
|
---|
286 | );
|
---|
287 | void
|
---|
288 | gen_abz_extF80(
|
---|
289 | void ( const extFloat80_t *, const extFloat80_t *, extFloat80_t * ) );
|
---|
290 | void
|
---|
291 | gen_ab_extF80_z_bool( bool ( const extFloat80_t *, const extFloat80_t * ) );
|
---|
292 | #endif
|
---|
293 |
|
---|
294 | #ifdef FLOAT128
|
---|
295 | void
|
---|
296 | gen_a_f128_z_ui32_rx(
|
---|
297 | uint_fast32_t ( const float128_t *, uint_fast8_t, bool ),
|
---|
298 | uint_fast8_t,
|
---|
299 | bool
|
---|
300 | );
|
---|
301 | void
|
---|
302 | gen_a_f128_z_ui64_rx(
|
---|
303 | uint_fast64_t ( const float128_t *, uint_fast8_t, bool ),
|
---|
304 | uint_fast8_t,
|
---|
305 | bool
|
---|
306 | );
|
---|
307 | void
|
---|
308 | gen_a_f128_z_i32_rx(
|
---|
309 | int_fast32_t ( const float128_t *, uint_fast8_t, bool ),
|
---|
310 | uint_fast8_t,
|
---|
311 | bool
|
---|
312 | );
|
---|
313 | void
|
---|
314 | gen_a_f128_z_i64_rx(
|
---|
315 | int_fast64_t ( const float128_t *, uint_fast8_t, bool ),
|
---|
316 | uint_fast8_t,
|
---|
317 | bool
|
---|
318 | );
|
---|
319 | void gen_a_f128_z_ui32_x( uint_fast32_t ( const float128_t *, bool ), bool );
|
---|
320 | void gen_a_f128_z_ui64_x( uint_fast64_t ( const float128_t *, bool ), bool );
|
---|
321 | void gen_a_f128_z_i32_x( int_fast32_t ( const float128_t *, bool ), bool );
|
---|
322 | void gen_a_f128_z_i64_x( int_fast64_t ( const float128_t *, bool ), bool );
|
---|
323 | #ifdef FLOAT16
|
---|
324 | void gen_a_f128_z_f16( float16_t ( const float128_t * ) );
|
---|
325 | #endif
|
---|
326 | void gen_a_f128_z_f32( float32_t ( const float128_t * ) );
|
---|
327 | #ifdef FLOAT64
|
---|
328 | void gen_a_f128_z_f64( float64_t ( const float128_t * ) );
|
---|
329 | #endif
|
---|
330 | #ifdef EXTFLOAT80
|
---|
331 | void gen_a_f128_z_extF80( void ( const float128_t *, extFloat80_t * ) );
|
---|
332 | #endif
|
---|
333 | void gen_az_f128( void ( const float128_t *, float128_t * ) );
|
---|
334 | void
|
---|
335 | gen_az_f128_rx(
|
---|
336 | void ( const float128_t *, uint_fast8_t, bool, float128_t * ),
|
---|
337 | uint_fast8_t,
|
---|
338 | bool
|
---|
339 | );
|
---|
340 | void
|
---|
341 | gen_abz_f128( void ( const float128_t *, const float128_t *, float128_t * ) );
|
---|
342 | void
|
---|
343 | gen_abcz_f128(
|
---|
344 | void
|
---|
345 | (
|
---|
346 | const float128_t *,
|
---|
347 | const float128_t *,
|
---|
348 | const float128_t *,
|
---|
349 | float128_t *
|
---|
350 | )
|
---|
351 | );
|
---|
352 | void gen_ab_f128_z_bool( bool ( const float128_t *, const float128_t * ) );
|
---|
353 | #endif
|
---|
354 |
|
---|