VirtualBox

source: vbox/trunk/src/libs/softfloat-3e/testfloat/source/testLoops.h@ 106842

Last change on this file since 106842 was 94551, checked in by vboxsync, 3 years ago

libs/softfloat: Copied TestFloat-3e from vendor branch and to testfloat subdir. bugref:9898

  • Property svn:eol-style set to native
File size: 16.3 KB
Line 
1
2/*============================================================================
3
4This C header file is part of TestFloat, Release 3e, a package of programs for
5testing the correctness of floating-point arithmetic complying with the IEEE
6Standard for Floating-Point, by John R. Hauser.
7
8Copyright 2011, 2012, 2013, 2014, 2015, 2017 The Regents of the University of
9California. All rights reserved.
10
11Redistribution and use in source and binary forms, with or without
12modification, 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
25THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
26EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
27WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
28DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
29DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
30(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
31LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
32ON 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
34SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35
36=============================================================================*/
37
38#include <stdbool.h>
39#include <stdint.h>
40#include <stdio.h>
41#include "softfloat.h"
42
43extern bool testLoops_forever;
44
45extern uint_fast8_t *testLoops_trueFlagsPtr;
46extern uint_fast8_t (*testLoops_subjFlagsFunction)( void );
47
48/*----------------------------------------------------------------------------
49*----------------------------------------------------------------------------*/
50#ifdef FLOAT16
51void test_a_ui32_z_f16( float16_t ( uint32_t ), float16_t ( uint32_t ) );
52#endif
53void test_a_ui32_z_f32( float32_t ( uint32_t ), float32_t ( uint32_t ) );
54#ifdef FLOAT64
55void test_a_ui32_z_f64( float64_t ( uint32_t ), float64_t ( uint32_t ) );
56#endif
57#ifdef EXTFLOAT80
58void
59 test_a_ui32_z_extF80(
60 void ( uint32_t, extFloat80_t * ), void ( uint32_t, extFloat80_t * ) );
61#endif
62#ifdef FLOAT128
63void
64 test_a_ui32_z_f128(
65 void ( uint32_t, float128_t * ), void ( uint32_t, float128_t * )
66 );
67#endif
68#ifdef FLOAT16
69void test_a_ui64_z_f16( float16_t ( uint64_t ), float16_t ( uint64_t ) );
70#endif
71void test_a_ui64_z_f32( float32_t ( uint64_t ), float32_t ( uint64_t ) );
72#ifdef FLOAT64
73void test_a_ui64_z_f64( float64_t ( uint64_t ), float64_t ( uint64_t ) );
74#endif
75#ifdef EXTFLOAT80
76void
77 test_a_ui64_z_extF80(
78 void ( uint64_t, extFloat80_t * ), void ( uint64_t, extFloat80_t * ) );
79#endif
80#ifdef FLOAT128
81void
82 test_a_ui64_z_f128(
83 void ( uint64_t, float128_t * ), void ( uint64_t, float128_t * ) );
84#endif
85#ifdef FLOAT16
86void test_a_i32_z_f16( float16_t ( int32_t ), float16_t ( int32_t ) );
87#endif
88void test_a_i32_z_f32( float32_t ( int32_t ), float32_t ( int32_t ) );
89#ifdef FLOAT64
90void test_a_i32_z_f64( float64_t ( int32_t ), float64_t ( int32_t ) );
91#endif
92#ifdef EXTFLOAT80
93void
94 test_a_i32_z_extF80(
95 void ( int32_t, extFloat80_t * ), void ( int32_t, extFloat80_t * ) );
96#endif
97#ifdef FLOAT128
98void
99 test_a_i32_z_f128(
100 void ( int32_t, float128_t * ), void ( int32_t, float128_t * ) );
101#endif
102#ifdef FLOAT16
103void test_a_i64_z_f16( float16_t ( int64_t ), float16_t ( int64_t ) );
104#endif
105void test_a_i64_z_f32( float32_t ( int64_t ), float32_t ( int64_t ) );
106#ifdef FLOAT64
107void test_a_i64_z_f64( float64_t ( int64_t ), float64_t ( int64_t ) );
108#endif
109#ifdef EXTFLOAT80
110void
111 test_a_i64_z_extF80(
112 void ( int64_t, extFloat80_t * ), void ( int64_t, extFloat80_t * ) );
113#endif
114#ifdef FLOAT128
115void
116 test_a_i64_z_f128(
117 void ( int64_t, float128_t * ), void ( int64_t, float128_t * ) );
118#endif
119
120/*----------------------------------------------------------------------------
121*----------------------------------------------------------------------------*/
122#ifdef FLOAT16
123void
124 test_a_f16_z_ui32_rx(
125 uint_fast32_t ( float16_t, uint_fast8_t, bool ),
126 uint_fast32_t ( float16_t, uint_fast8_t, bool ),
127 uint_fast8_t,
128 bool
129 );
130void
131 test_a_f16_z_ui64_rx(
132 uint_fast64_t ( float16_t, uint_fast8_t, bool ),
133 uint_fast64_t ( float16_t, uint_fast8_t, bool ),
134 uint_fast8_t,
135 bool
136 );
137void
138 test_a_f16_z_i32_rx(
139 int_fast32_t ( float16_t, uint_fast8_t, bool ),
140 int_fast32_t ( float16_t, uint_fast8_t, bool ),
141 uint_fast8_t,
142 bool
143 );
144void
145 test_a_f16_z_i64_rx(
146 int_fast64_t ( float16_t, uint_fast8_t, bool ),
147 int_fast64_t ( float16_t, uint_fast8_t, bool ),
148 uint_fast8_t,
149 bool
150 );
151void
152 test_a_f16_z_ui32_x(
153 uint_fast32_t ( float16_t, bool ), uint_fast32_t ( float16_t, bool ), bool
154 );
155void
156 test_a_f16_z_ui64_x(
157 uint_fast64_t ( float16_t, bool ), uint_fast64_t ( float16_t, bool ), bool
158 );
159void
160 test_a_f16_z_i32_x(
161 int_fast32_t ( float16_t, bool ), int_fast32_t ( float16_t, bool ), bool
162 );
163void
164 test_a_f16_z_i64_x(
165 int_fast64_t ( float16_t, bool ), int_fast64_t ( float16_t, bool ), bool
166 );
167void test_a_f16_z_f32( float32_t ( float16_t ), float32_t ( float16_t ) );
168#ifdef FLOAT64
169void test_a_f16_z_f64( float64_t ( float16_t ), float64_t ( float16_t ) );
170#endif
171#ifdef EXTFLOAT80
172void
173 test_a_f16_z_extF80(
174 void ( float16_t, extFloat80_t * ), void ( float16_t, extFloat80_t * ) );
175#endif
176#ifdef FLOAT128
177void
178 test_a_f16_z_f128(
179 void ( float16_t, float128_t * ), void ( float16_t, float128_t * ) );
180#endif
181void test_az_f16( float16_t ( float16_t ), float16_t ( float16_t ) );
182void
183 test_az_f16_rx(
184 float16_t ( float16_t, uint_fast8_t, bool ),
185 float16_t ( float16_t, uint_fast8_t, bool ),
186 uint_fast8_t,
187 bool
188 );
189void
190 test_abz_f16(
191 float16_t ( float16_t, float16_t ), float16_t ( float16_t, float16_t ) );
192void
193 test_abcz_f16(
194 float16_t ( float16_t, float16_t, float16_t ),
195 float16_t ( float16_t, float16_t, float16_t )
196 );
197void
198 test_ab_f16_z_bool(
199 bool ( float16_t, float16_t ), bool ( float16_t, float16_t ) );
200#endif
201
202/*----------------------------------------------------------------------------
203*----------------------------------------------------------------------------*/
204void
205 test_a_f32_z_ui32_rx(
206 uint_fast32_t ( float32_t, uint_fast8_t, bool ),
207 uint_fast32_t ( float32_t, uint_fast8_t, bool ),
208 uint_fast8_t,
209 bool
210 );
211void
212 test_a_f32_z_ui64_rx(
213 uint_fast64_t ( float32_t, uint_fast8_t, bool ),
214 uint_fast64_t ( float32_t, uint_fast8_t, bool ),
215 uint_fast8_t,
216 bool
217 );
218void
219 test_a_f32_z_i32_rx(
220 int_fast32_t ( float32_t, uint_fast8_t, bool ),
221 int_fast32_t ( float32_t, uint_fast8_t, bool ),
222 uint_fast8_t,
223 bool
224 );
225void
226 test_a_f32_z_i64_rx(
227 int_fast64_t ( float32_t, uint_fast8_t, bool ),
228 int_fast64_t ( float32_t, uint_fast8_t, bool ),
229 uint_fast8_t,
230 bool
231 );
232void
233 test_a_f32_z_ui32_x(
234 uint_fast32_t ( float32_t, bool ), uint_fast32_t ( float32_t, bool ), bool
235 );
236void
237 test_a_f32_z_ui64_x(
238 uint_fast64_t ( float32_t, bool ), uint_fast64_t ( float32_t, bool ), bool
239 );
240void
241 test_a_f32_z_i32_x(
242 int_fast32_t ( float32_t, bool ), int_fast32_t ( float32_t, bool ), bool
243 );
244void
245 test_a_f32_z_i64_x(
246 int_fast64_t ( float32_t, bool ), int_fast64_t ( float32_t, bool ), bool
247 );
248#ifdef FLOAT16
249void test_a_f32_z_f16( float16_t ( float32_t ), float16_t ( float32_t ) );
250#endif
251#ifdef FLOAT64
252void test_a_f32_z_f64( float64_t ( float32_t ), float64_t ( float32_t ) );
253#endif
254#ifdef EXTFLOAT80
255void
256 test_a_f32_z_extF80(
257 void ( float32_t, extFloat80_t * ), void ( float32_t, extFloat80_t * ) );
258#endif
259#ifdef FLOAT128
260void
261 test_a_f32_z_f128(
262 void ( float32_t, float128_t * ), void ( float32_t, float128_t * ) );
263#endif
264void test_az_f32( float32_t ( float32_t ), float32_t ( float32_t ) );
265void
266 test_az_f32_rx(
267 float32_t ( float32_t, uint_fast8_t, bool ),
268 float32_t ( float32_t, uint_fast8_t, bool ),
269 uint_fast8_t,
270 bool
271 );
272void
273 test_abz_f32(
274 float32_t ( float32_t, float32_t ), float32_t ( float32_t, float32_t ) );
275void
276 test_abcz_f32(
277 float32_t ( float32_t, float32_t, float32_t ),
278 float32_t ( float32_t, float32_t, float32_t )
279 );
280void
281 test_ab_f32_z_bool(
282 bool ( float32_t, float32_t ), bool ( float32_t, float32_t ) );
283
284/*----------------------------------------------------------------------------
285*----------------------------------------------------------------------------*/
286#ifdef FLOAT64
287void
288 test_a_f64_z_ui32_rx(
289 uint_fast32_t ( float64_t, uint_fast8_t, bool ),
290 uint_fast32_t ( float64_t, uint_fast8_t, bool ),
291 uint_fast8_t,
292 bool
293 );
294void
295 test_a_f64_z_ui64_rx(
296 uint_fast64_t ( float64_t, uint_fast8_t, bool ),
297 uint_fast64_t ( float64_t, uint_fast8_t, bool ),
298 uint_fast8_t,
299 bool
300 );
301void
302 test_a_f64_z_i32_rx(
303 int_fast32_t ( float64_t, uint_fast8_t, bool ),
304 int_fast32_t ( float64_t, uint_fast8_t, bool ),
305 uint_fast8_t,
306 bool
307 );
308void
309 test_a_f64_z_i64_rx(
310 int_fast64_t ( float64_t, uint_fast8_t, bool ),
311 int_fast64_t ( float64_t, uint_fast8_t, bool ),
312 uint_fast8_t,
313 bool
314 );
315void
316 test_a_f64_z_ui32_x(
317 uint_fast32_t ( float64_t, bool ), uint_fast32_t ( float64_t, bool ), bool
318 );
319void
320 test_a_f64_z_ui64_x(
321 uint_fast64_t ( float64_t, bool ), uint_fast64_t ( float64_t, bool ), bool
322 );
323void
324 test_a_f64_z_i32_x(
325 int_fast32_t ( float64_t, bool ), int_fast32_t ( float64_t, bool ), bool
326 );
327void
328 test_a_f64_z_i64_x(
329 int_fast64_t ( float64_t, bool ), int_fast64_t ( float64_t, bool ), bool
330 );
331#ifdef FLOAT16
332void test_a_f64_z_f16( float16_t ( float64_t ), float16_t ( float64_t ) );
333#endif
334void test_a_f64_z_f32( float32_t ( float64_t ), float32_t ( float64_t ) );
335#ifdef EXTFLOAT80
336void
337 test_a_f64_z_extF80(
338 void ( float64_t, extFloat80_t * ), void ( float64_t, extFloat80_t * ) );
339#endif
340#ifdef FLOAT128
341void
342 test_a_f64_z_f128(
343 void ( float64_t, float128_t * ), void ( float64_t, float128_t * ) );
344#endif
345void test_az_f64( float64_t ( float64_t ), float64_t ( float64_t ) );
346void
347 test_az_f64_rx(
348 float64_t ( float64_t, uint_fast8_t, bool ),
349 float64_t ( float64_t, uint_fast8_t, bool ),
350 uint_fast8_t,
351 bool
352 );
353void
354 test_abz_f64(
355 float64_t ( float64_t, float64_t ), float64_t ( float64_t, float64_t ) );
356void
357 test_abcz_f64(
358 float64_t ( float64_t, float64_t, float64_t ),
359 float64_t ( float64_t, float64_t, float64_t )
360 );
361void
362 test_ab_f64_z_bool(
363 bool ( float64_t, float64_t ), bool ( float64_t, float64_t ) );
364#endif
365
366/*----------------------------------------------------------------------------
367*----------------------------------------------------------------------------*/
368#ifdef EXTFLOAT80
369void
370 test_a_extF80_z_ui32_rx(
371 uint_fast32_t ( const extFloat80_t *, uint_fast8_t, bool ),
372 uint_fast32_t ( const extFloat80_t *, uint_fast8_t, bool ),
373 uint_fast8_t,
374 bool
375 );
376void
377 test_a_extF80_z_ui64_rx(
378 uint_fast64_t ( const extFloat80_t *, uint_fast8_t, bool ),
379 uint_fast64_t ( const extFloat80_t *, uint_fast8_t, bool ),
380 uint_fast8_t,
381 bool
382 );
383void
384 test_a_extF80_z_i32_rx(
385 int_fast32_t ( const extFloat80_t *, uint_fast8_t, bool ),
386 int_fast32_t ( const extFloat80_t *, uint_fast8_t, bool ),
387 uint_fast8_t,
388 bool
389 );
390void
391 test_a_extF80_z_i64_rx(
392 int_fast64_t ( const extFloat80_t *, uint_fast8_t, bool ),
393 int_fast64_t ( const extFloat80_t *, uint_fast8_t, bool ),
394 uint_fast8_t,
395 bool
396 );
397void
398 test_a_extF80_z_ui32_x(
399 uint_fast32_t ( const extFloat80_t *, bool ),
400 uint_fast32_t ( const extFloat80_t *, bool ),
401 bool
402 );
403void
404 test_a_extF80_z_ui64_x(
405 uint_fast64_t ( const extFloat80_t *, bool ),
406 uint_fast64_t ( const extFloat80_t *, bool ),
407 bool
408 );
409void
410 test_a_extF80_z_i32_x(
411 int_fast32_t ( const extFloat80_t *, bool ),
412 int_fast32_t ( const extFloat80_t *, bool ),
413 bool
414 );
415void
416 test_a_extF80_z_i64_x(
417 int_fast64_t ( const extFloat80_t *, bool ),
418 int_fast64_t ( const extFloat80_t *, bool ),
419 bool
420 );
421#ifdef FLOAT16
422void
423 test_a_extF80_z_f16(
424 float16_t ( const extFloat80_t * ), float16_t ( const extFloat80_t * ) );
425#endif
426void
427 test_a_extF80_z_f32(
428 float32_t ( const extFloat80_t * ), float32_t ( const extFloat80_t * ) );
429#ifdef FLOAT64
430void
431 test_a_extF80_z_f64(
432 float64_t ( const extFloat80_t * ), float64_t ( const extFloat80_t * ) );
433#endif
434#ifdef FLOAT128
435void
436 test_a_extF80_z_f128(
437 void ( const extFloat80_t *, float128_t * ),
438 void ( const extFloat80_t *, float128_t * )
439 );
440#endif
441void
442 test_az_extF80(
443 void ( const extFloat80_t *, extFloat80_t * ),
444 void ( const extFloat80_t *, extFloat80_t * )
445 );
446void
447 test_az_extF80_rx(
448 void ( const extFloat80_t *, uint_fast8_t, bool, extFloat80_t * ),
449 void ( const extFloat80_t *, uint_fast8_t, bool, extFloat80_t * ),
450 uint_fast8_t,
451 bool
452 );
453void
454 test_abz_extF80(
455 void ( const extFloat80_t *, const extFloat80_t *, extFloat80_t * ),
456 void ( const extFloat80_t *, const extFloat80_t *, extFloat80_t * )
457 );
458void
459 test_ab_extF80_z_bool(
460 bool ( const extFloat80_t *, const extFloat80_t * ),
461 bool ( const extFloat80_t *, const extFloat80_t * )
462 );
463#endif
464
465/*----------------------------------------------------------------------------
466*----------------------------------------------------------------------------*/
467#ifdef FLOAT128
468void
469 test_a_f128_z_ui32_rx(
470 uint_fast32_t ( const float128_t *, uint_fast8_t, bool ),
471 uint_fast32_t ( const float128_t *, uint_fast8_t, bool ),
472 uint_fast8_t,
473 bool
474 );
475void
476 test_a_f128_z_ui64_rx(
477 uint_fast64_t ( const float128_t *, uint_fast8_t, bool ),
478 uint_fast64_t ( const float128_t *, uint_fast8_t, bool ),
479 uint_fast8_t,
480 bool
481 );
482void
483 test_a_f128_z_i32_rx(
484 int_fast32_t ( const float128_t *, uint_fast8_t, bool ),
485 int_fast32_t ( const float128_t *, uint_fast8_t, bool ),
486 uint_fast8_t,
487 bool
488 );
489void
490 test_a_f128_z_i64_rx(
491 int_fast64_t ( const float128_t *, uint_fast8_t, bool ),
492 int_fast64_t ( const float128_t *, uint_fast8_t, bool ),
493 uint_fast8_t,
494 bool
495 );
496void
497 test_a_f128_z_ui32_x(
498 uint_fast32_t ( const float128_t *, bool ),
499 uint_fast32_t ( const float128_t *, bool ),
500 bool
501 );
502void
503 test_a_f128_z_ui64_x(
504 uint_fast64_t ( const float128_t *, bool ),
505 uint_fast64_t ( const float128_t *, bool ),
506 bool
507 );
508void
509 test_a_f128_z_i32_x(
510 int_fast32_t ( const float128_t *, bool ),
511 int_fast32_t ( const float128_t *, bool ),
512 bool
513 );
514void
515 test_a_f128_z_i64_x(
516 int_fast64_t ( const float128_t *, bool ),
517 int_fast64_t ( const float128_t *, bool ),
518 bool
519 );
520#ifdef FLOAT16
521void
522 test_a_f128_z_f16(
523 float16_t ( const float128_t * ), float16_t ( const float128_t * ) );
524#endif
525void
526 test_a_f128_z_f32(
527 float32_t ( const float128_t * ), float32_t ( const float128_t * ) );
528#ifdef FLOAT64
529void
530 test_a_f128_z_f64(
531 float64_t ( const float128_t * ), float64_t ( const float128_t * ) );
532#endif
533#ifdef EXTFLOAT80
534void
535 test_a_f128_z_extF80(
536 void ( const float128_t *, extFloat80_t * ),
537 void ( const float128_t *, extFloat80_t * )
538 );
539#endif
540void
541 test_az_f128(
542 void ( const float128_t *, float128_t * ),
543 void ( const float128_t *, float128_t * )
544 );
545void
546 test_az_f128_rx(
547 void ( const float128_t *, uint_fast8_t, bool, float128_t * ),
548 void ( const float128_t *, uint_fast8_t, bool, float128_t * ),
549 uint_fast8_t,
550 bool
551 );
552void
553 test_abz_f128(
554 void ( const float128_t *, const float128_t *, float128_t * ),
555 void ( const float128_t *, const float128_t *, float128_t * )
556 );
557void
558 test_abcz_f128(
559 void
560 ( const float128_t *,
561 const float128_t *,
562 const float128_t *,
563 float128_t *
564 ),
565 void
566 ( const float128_t *,
567 const float128_t *,
568 const float128_t *,
569 float128_t *
570 )
571 );
572void
573 test_ab_f128_z_bool(
574 bool ( const float128_t *, const float128_t * ),
575 bool ( const float128_t *, const float128_t * )
576 );
577#endif
578
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette