VirtualBox

source: vbox/trunk/src/libs/softfloat-3e/testfloat/source/testfloat_ver.c@ 107850

Last change on this file since 107850 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: 25.5 KB
Line 
1
2/*============================================================================
3
4This C source 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, 2016, 2017, 2018 The Regents of the
9University of California. 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 <string.h>
41#include <stdlib.h>
42#include <stdio.h>
43#include <signal.h>
44#include "platform.h"
45#include "fail.h"
46#include "softfloat.h"
47#include "functions.h"
48#include "verCases.h"
49#include "writeCase.h"
50#include "verLoops.h"
51
52static void catchSIGINT( int signalCode )
53{
54
55 if ( verCases_stop ) exit( EXIT_FAILURE );
56 verCases_stop = true;
57
58}
59
60int main( int argc, char *argv[] )
61{
62 bool exact;
63 int functionCode, roundingCode, tininessCode;
64 const char *argPtr;
65 long i;
66 int functionAttribs;
67 uint_fast8_t roundingMode;
68#ifdef FLOAT16
69 float16_t (*trueFunction_abz_f16)( float16_t, float16_t );
70 bool (*trueFunction_ab_f16_z_bool)( float16_t, float16_t );
71#endif
72 float32_t (*trueFunction_abz_f32)( float32_t, float32_t );
73 bool (*trueFunction_ab_f32_z_bool)( float32_t, float32_t );
74#ifdef FLOAT64
75 float64_t (*trueFunction_abz_f64)( float64_t, float64_t );
76 bool (*trueFunction_ab_f64_z_bool)( float64_t, float64_t );
77#endif
78#ifdef EXTFLOAT80
79 void
80 (*trueFunction_abz_extF80)(
81 const extFloat80_t *, const extFloat80_t *, extFloat80_t * );
82 bool
83 (*trueFunction_ab_extF80_z_bool)(
84 const extFloat80_t *, const extFloat80_t * );
85#endif
86#ifdef FLOAT128
87 void
88 (*trueFunction_abz_f128)(
89 const float128_t *, const float128_t *, float128_t * );
90 bool
91 (*trueFunction_ab_f128_z_bool)( const float128_t *, const float128_t * );
92#endif
93
94 /*------------------------------------------------------------------------
95 *------------------------------------------------------------------------*/
96 fail_programName = "testfloat_ver";
97 if ( argc <= 1 ) goto writeHelpMessage;
98 softfloat_detectTininess = softfloat_tininess_afterRounding;
99#ifdef EXTFLOAT80
100 extF80_roundingPrecision = 80;
101#endif
102 roundingMode = softfloat_round_near_even;
103 exact = false;
104 verCases_maxErrorCount = 20;
105 verLoops_trueFlagsPtr = &softfloat_exceptionFlags;
106 functionCode = 0;
107 roundingCode = ROUND_NEAR_EVEN;
108 tininessCode = TININESS_AFTER_ROUNDING;
109 for (;;) {
110 --argc;
111 if ( ! argc ) break;
112 argPtr = *++argv;
113 if ( ! argPtr ) break;
114 if ( argPtr[0] == '-' ) ++argPtr;
115 if (
116 ! strcmp( argPtr, "help" ) || ! strcmp( argPtr, "-help" )
117 || ! strcmp( argPtr, "h" )
118 ) {
119 writeHelpMessage:
120 fputs(
121"testfloat_ver [<option>...] <function>\n"
122" <option>: (* is default)\n"
123" -help --Write this message and exit.\n"
124" -errors <num> --Stop after <num> errors.\n"
125" * -errors 20\n"
126" -checkNaNs --Check for specific NaN results.\n"
127" -checkInvInts --Check for specific invalid integer results.\n"
128" -checkAll --Same as both '-checkNaNs' and '-checkInvInts'.\n"
129#ifdef EXTFLOAT80
130" -precision32 --For extF80, rounding precision is 32 bits.\n"
131" -precision64 --For extF80, rounding precision is 64 bits.\n"
132" * -precision80 --For extF80, rounding precision is 80 bits.\n"
133#endif
134" * -rnear_even --Round to nearest/even.\n"
135" -rminMag --Round to minimum magnitude (toward zero).\n"
136" -rmin --Round to minimum (down).\n"
137" -rmax --Round to maximum (up).\n"
138" -rnear_maxMag --Round to nearest/maximum magnitude (nearest/away).\n"
139#ifdef FLOAT_ROUND_ODD
140" -rodd --Round to odd (jamming). (For rounding to an integer\n"
141" value, rounds to minimum magnitude instead.)\n"
142#endif
143" -tininessbefore --Detect underflow tininess before rounding.\n"
144" * -tininessafter --Detect underflow tininess after rounding.\n"
145" * -notexact --Rounding to integer is not exact (no inexact\n"
146" exceptions).\n"
147" -exact --Rounding to integer is exact (raising inexact\n"
148" exceptions).\n"
149" <function>:\n"
150" <int>_to_<float> <float>_add <float>_eq\n"
151" <float>_to_<int> <float>_sub <float>_le\n"
152" <float>_to_<float> <float>_mul <float>_lt\n"
153" <float>_roundToInt <float>_mulAdd <float>_eq_signaling\n"
154" <float>_div <float>_le_quiet\n"
155" <float>_rem <float>_lt_quiet\n"
156" <float>_sqrt\n"
157" <int>:\n"
158" ui32 --Unsigned 32-bit integer.\n"
159" ui64 --Unsigned 64-bit integer.\n"
160" i32 --Signed 32-bit integer.\n"
161" i64 --Signed 64-bit integer.\n"
162" <float>:\n"
163#ifdef FLOAT16
164" f16 --Binary 16-bit floating-point (half-precision).\n"
165#endif
166" f32 --Binary 32-bit floating-point (single-precision).\n"
167#ifdef FLOAT64
168" f64 --Binary 64-bit floating-point (double-precision).\n"
169#endif
170#ifdef EXTFLOAT80
171" extF80 --Binary 80-bit extended floating-point.\n"
172#endif
173#ifdef FLOAT128
174" f128 --Binary 128-bit floating-point (quadruple-precision).\n"
175#endif
176 ,
177 stdout
178 );
179 return EXIT_SUCCESS;
180 } else if ( ! strcmp( argPtr, "errors" ) ) {
181 if ( argc < 2 ) goto optionError;
182 i = strtol( argv[1], (char **) &argPtr, 10 );
183 if ( *argPtr ) goto optionError;
184 verCases_maxErrorCount = i;
185 --argc;
186 ++argv;
187 } else if (
188 ! strcmp( argPtr, "checkNaNs" ) || ! strcmp( argPtr, "checknans" )
189 ) {
190 verCases_checkNaNs = true;
191 } else if (
192 ! strcmp( argPtr, "checkInvInts" )
193 || ! strcmp( argPtr, "checkinvints" )
194 ) {
195 verCases_checkInvInts = true;
196 } else if (
197 ! strcmp( argPtr, "checkAll" ) || ! strcmp( argPtr, "checkall" )
198 ) {
199 verCases_checkNaNs = true;
200 verCases_checkInvInts = true;
201#ifdef EXTFLOAT80
202 } else if ( ! strcmp( argPtr, "precision32" ) ) {
203 extF80_roundingPrecision = 32;
204 } else if ( ! strcmp( argPtr, "precision64" ) ) {
205 extF80_roundingPrecision = 64;
206 } else if ( ! strcmp( argPtr, "precision80" ) ) {
207 extF80_roundingPrecision = 80;
208#endif
209 } else if (
210 ! strcmp( argPtr, "rnear_even" )
211 || ! strcmp( argPtr, "rneareven" )
212 || ! strcmp( argPtr, "rnearest_even" )
213 ) {
214 roundingCode = ROUND_NEAR_EVEN;
215 } else if (
216 ! strcmp( argPtr, "rminmag" ) || ! strcmp( argPtr, "rminMag" )
217 ) {
218 roundingCode = ROUND_MINMAG;
219 } else if ( ! strcmp( argPtr, "rmin" ) ) {
220 roundingCode = ROUND_MIN;
221 } else if ( ! strcmp( argPtr, "rmax" ) ) {
222 roundingCode = ROUND_MAX;
223 } else if (
224 ! strcmp( argPtr, "rnear_maxmag" )
225 || ! strcmp( argPtr, "rnear_maxMag" )
226 || ! strcmp( argPtr, "rnearmaxmag" )
227 || ! strcmp( argPtr, "rnearest_maxmag" )
228 || ! strcmp( argPtr, "rnearest_maxMag" )
229 ) {
230 roundingCode = ROUND_NEAR_MAXMAG;
231#ifdef FLOAT_ROUND_ODD
232 } else if ( ! strcmp( argPtr, "rodd" ) ) {
233 roundingCode = ROUND_ODD;
234#endif
235 } else if ( ! strcmp( argPtr, "tininessbefore" ) ) {
236 tininessCode = TININESS_BEFORE_ROUNDING;
237 } else if ( ! strcmp( argPtr, "tininessafter" ) ) {
238 tininessCode = TININESS_AFTER_ROUNDING;
239 } else if ( ! strcmp( argPtr, "notexact" ) ) {
240 exact = false;
241 } else if ( ! strcmp( argPtr, "exact" ) ) {
242 exact = true;
243 } else {
244 functionCode = 1;
245 while ( strcmp( argPtr, functionInfos[functionCode].namePtr ) ) {
246 ++functionCode;
247 if ( functionCode == NUM_FUNCTIONS ) goto invalidArg;
248 }
249 functionAttribs = functionInfos[functionCode].attribs;
250 if (
251 (functionAttribs & FUNC_ARG_EXACT)
252 && ! (functionAttribs & FUNC_ARG_ROUNDINGMODE)
253 ) {
254 goto invalidArg;
255 }
256 }
257 }
258 if ( ! functionCode ) fail( "Function argument required" );
259 /*------------------------------------------------------------------------
260 *------------------------------------------------------------------------*/
261 verCases_functionNamePtr = functionInfos[functionCode].namePtr;
262#ifdef EXTFLOAT80
263 verCases_roundingPrecision =
264 functionAttribs & FUNC_EFF_ROUNDINGPRECISION ? extF80_roundingPrecision
265 : 0;
266#endif
267 verCases_roundingCode =
268 functionAttribs & (FUNC_ARG_ROUNDINGMODE | FUNC_EFF_ROUNDINGMODE)
269 ? roundingCode
270 : 0;
271#ifdef EXTFLOAT80
272 verCases_tininessCode =
273 (functionAttribs & FUNC_EFF_TININESSMODE)
274 || ((functionAttribs & FUNC_EFF_TININESSMODE_REDUCEDPREC)
275 && extF80_roundingPrecision
276 && (extF80_roundingPrecision < 80))
277 ? tininessCode
278 : 0;
279#else
280 verCases_tininessCode =
281 functionAttribs & FUNC_EFF_TININESSMODE ? tininessCode : 0;
282#endif
283 verCases_usesExact = ((functionAttribs & FUNC_ARG_EXACT) != 0);
284 verCases_exact = exact;
285 roundingMode = roundingModes[roundingCode];
286 softfloat_roundingMode = roundingMode;
287 softfloat_detectTininess = tininessModes[tininessCode];
288 signal( SIGINT, catchSIGINT );
289 signal( SIGTERM, catchSIGINT );
290 fputs( "Testing ", stderr );
291 verCases_writeFunctionName( stderr );
292 fputs( ".\n", stderr );
293 switch ( functionCode ) {
294 /*--------------------------------------------------------------------
295 *--------------------------------------------------------------------*/
296#ifdef FLOAT16
297 case UI32_TO_F16:
298 ver_a_ui32_z_f16( ui32_to_f16 );
299 break;
300#endif
301 case UI32_TO_F32:
302 ver_a_ui32_z_f32( ui32_to_f32 );
303 break;
304#ifdef FLOAT64
305 case UI32_TO_F64:
306 ver_a_ui32_z_f64( ui32_to_f64 );
307 break;
308#endif
309#ifdef EXTFLOAT80
310 case UI32_TO_EXTF80:
311 ver_a_ui32_z_extF80( ui32_to_extF80M );
312 break;
313#endif
314#ifdef FLOAT128
315 case UI32_TO_F128:
316 ver_a_ui32_z_f128( ui32_to_f128M );
317 break;
318#endif
319#ifdef FLOAT16
320 case UI64_TO_F16:
321 ver_a_ui64_z_f16( ui64_to_f16 );
322 break;
323#endif
324 case UI64_TO_F32:
325 ver_a_ui64_z_f32( ui64_to_f32 );
326 break;
327#ifdef FLOAT64
328 case UI64_TO_F64:
329 ver_a_ui64_z_f64( ui64_to_f64 );
330 break;
331#endif
332#ifdef EXTFLOAT80
333 case UI64_TO_EXTF80:
334 ver_a_ui64_z_extF80( ui64_to_extF80M );
335 break;
336#endif
337#ifdef FLOAT128
338 case UI64_TO_F128:
339 ver_a_ui64_z_f128( ui64_to_f128M );
340 break;
341#endif
342#ifdef FLOAT16
343 case I32_TO_F16:
344 ver_a_i32_z_f16( i32_to_f16 );
345 break;
346#endif
347 case I32_TO_F32:
348 ver_a_i32_z_f32( i32_to_f32 );
349 break;
350#ifdef FLOAT64
351 case I32_TO_F64:
352 ver_a_i32_z_f64( i32_to_f64 );
353 break;
354#endif
355#ifdef EXTFLOAT80
356 case I32_TO_EXTF80:
357 ver_a_i32_z_extF80( i32_to_extF80M );
358 break;
359#endif
360#ifdef FLOAT128
361 case I32_TO_F128:
362 ver_a_i32_z_f128( i32_to_f128M );
363 break;
364#endif
365#ifdef FLOAT16
366 case I64_TO_F16:
367 ver_a_i64_z_f16( i64_to_f16 );
368 break;
369#endif
370 case I64_TO_F32:
371 ver_a_i64_z_f32( i64_to_f32 );
372 break;
373#ifdef FLOAT64
374 case I64_TO_F64:
375 ver_a_i64_z_f64( i64_to_f64 );
376 break;
377#endif
378#ifdef EXTFLOAT80
379 case I64_TO_EXTF80:
380 ver_a_i64_z_extF80( i64_to_extF80M );
381 break;
382#endif
383#ifdef FLOAT128
384 case I64_TO_F128:
385 ver_a_i64_z_f128( i64_to_f128M );
386 break;
387#endif
388 /*--------------------------------------------------------------------
389 *--------------------------------------------------------------------*/
390#ifdef FLOAT16
391 case F16_TO_UI32:
392 ver_a_f16_z_ui32_rx( f16_to_ui32, roundingMode, exact );
393 break;
394 case F16_TO_UI64:
395 ver_a_f16_z_ui64_rx( f16_to_ui64, roundingMode, exact );
396 break;
397 case F16_TO_I32:
398 ver_a_f16_z_i32_rx( f16_to_i32, roundingMode, exact );
399 break;
400 case F16_TO_I64:
401 ver_a_f16_z_i64_rx( f16_to_i64, roundingMode, exact );
402 break;
403 case F16_TO_F32:
404 ver_a_f16_z_f32( f16_to_f32 );
405 break;
406#ifdef FLOAT64
407 case F16_TO_F64:
408 ver_a_f16_z_f64( f16_to_f64 );
409 break;
410#endif
411#ifdef EXTFLOAT80
412 case F16_TO_EXTF80:
413 ver_a_f16_z_extF80( f16_to_extF80M );
414 break;
415#endif
416#ifdef FLOAT128
417 case F16_TO_F128:
418 ver_a_f16_z_f128( f16_to_f128M );
419 break;
420#endif
421 case F16_ROUNDTOINT:
422 ver_az_f16_rx( f16_roundToInt, roundingMode, exact );
423 break;
424 case F16_ADD:
425 trueFunction_abz_f16 = f16_add;
426 goto ver_abz_f16;
427 case F16_SUB:
428 trueFunction_abz_f16 = f16_sub;
429 goto ver_abz_f16;
430 case F16_MUL:
431 trueFunction_abz_f16 = f16_mul;
432 goto ver_abz_f16;
433 case F16_DIV:
434 trueFunction_abz_f16 = f16_div;
435 goto ver_abz_f16;
436 case F16_REM:
437 trueFunction_abz_f16 = f16_rem;
438 ver_abz_f16:
439 ver_abz_f16( trueFunction_abz_f16 );
440 break;
441 case F16_MULADD:
442 ver_abcz_f16( f16_mulAdd );
443 break;
444 case F16_SQRT:
445 ver_az_f16( f16_sqrt );
446 break;
447 case F16_EQ:
448 trueFunction_ab_f16_z_bool = f16_eq;
449 goto ver_ab_f16_z_bool;
450 case F16_LE:
451 trueFunction_ab_f16_z_bool = f16_le;
452 goto ver_ab_f16_z_bool;
453 case F16_LT:
454 trueFunction_ab_f16_z_bool = f16_lt;
455 goto ver_ab_f16_z_bool;
456 case F16_EQ_SIGNALING:
457 trueFunction_ab_f16_z_bool = f16_eq_signaling;
458 goto ver_ab_f16_z_bool;
459 case F16_LE_QUIET:
460 trueFunction_ab_f16_z_bool = f16_le_quiet;
461 goto ver_ab_f16_z_bool;
462 case F16_LT_QUIET:
463 trueFunction_ab_f16_z_bool = f16_lt_quiet;
464 ver_ab_f16_z_bool:
465 ver_ab_f16_z_bool( trueFunction_ab_f16_z_bool );
466 break;
467#endif
468 /*--------------------------------------------------------------------
469 *--------------------------------------------------------------------*/
470 case F32_TO_UI32:
471 ver_a_f32_z_ui32_rx( f32_to_ui32, roundingMode, exact );
472 break;
473 case F32_TO_UI64:
474 ver_a_f32_z_ui64_rx( f32_to_ui64, roundingMode, exact );
475 break;
476 case F32_TO_I32:
477 ver_a_f32_z_i32_rx( f32_to_i32, roundingMode, exact );
478 break;
479 case F32_TO_I64:
480 ver_a_f32_z_i64_rx( f32_to_i64, roundingMode, exact );
481 break;
482#ifdef FLOAT16
483 case F32_TO_F16:
484 ver_a_f32_z_f16( f32_to_f16 );
485 break;
486#endif
487#ifdef FLOAT64
488 case F32_TO_F64:
489 ver_a_f32_z_f64( f32_to_f64 );
490 break;
491#endif
492#ifdef EXTFLOAT80
493 case F32_TO_EXTF80:
494 ver_a_f32_z_extF80( f32_to_extF80M );
495 break;
496#endif
497#ifdef FLOAT128
498 case F32_TO_F128:
499 ver_a_f32_z_f128( f32_to_f128M );
500 break;
501#endif
502 case F32_ROUNDTOINT:
503 ver_az_f32_rx( f32_roundToInt, roundingMode, exact );
504 break;
505 case F32_ADD:
506 trueFunction_abz_f32 = f32_add;
507 goto ver_abz_f32;
508 case F32_SUB:
509 trueFunction_abz_f32 = f32_sub;
510 goto ver_abz_f32;
511 case F32_MUL:
512 trueFunction_abz_f32 = f32_mul;
513 goto ver_abz_f32;
514 case F32_DIV:
515 trueFunction_abz_f32 = f32_div;
516 goto ver_abz_f32;
517 case F32_REM:
518 trueFunction_abz_f32 = f32_rem;
519 ver_abz_f32:
520 ver_abz_f32( trueFunction_abz_f32 );
521 break;
522 case F32_MULADD:
523 ver_abcz_f32( f32_mulAdd );
524 break;
525 case F32_SQRT:
526 ver_az_f32( f32_sqrt );
527 break;
528 case F32_EQ:
529 trueFunction_ab_f32_z_bool = f32_eq;
530 goto ver_ab_f32_z_bool;
531 case F32_LE:
532 trueFunction_ab_f32_z_bool = f32_le;
533 goto ver_ab_f32_z_bool;
534 case F32_LT:
535 trueFunction_ab_f32_z_bool = f32_lt;
536 goto ver_ab_f32_z_bool;
537 case F32_EQ_SIGNALING:
538 trueFunction_ab_f32_z_bool = f32_eq_signaling;
539 goto ver_ab_f32_z_bool;
540 case F32_LE_QUIET:
541 trueFunction_ab_f32_z_bool = f32_le_quiet;
542 goto ver_ab_f32_z_bool;
543 case F32_LT_QUIET:
544 trueFunction_ab_f32_z_bool = f32_lt_quiet;
545 ver_ab_f32_z_bool:
546 ver_ab_f32_z_bool( trueFunction_ab_f32_z_bool );
547 break;
548 /*--------------------------------------------------------------------
549 *--------------------------------------------------------------------*/
550#ifdef FLOAT64
551 case F64_TO_UI32:
552 ver_a_f64_z_ui32_rx( f64_to_ui32, roundingMode, exact );
553 break;
554 case F64_TO_UI64:
555 ver_a_f64_z_ui64_rx( f64_to_ui64, roundingMode, exact );
556 break;
557 case F64_TO_I32:
558 ver_a_f64_z_i32_rx( f64_to_i32, roundingMode, exact );
559 break;
560 case F64_TO_I64:
561 ver_a_f64_z_i64_rx( f64_to_i64, roundingMode, exact );
562 break;
563#ifdef FLOAT16
564 case F64_TO_F16:
565 ver_a_f64_z_f16( f64_to_f16 );
566 break;
567#endif
568 case F64_TO_F32:
569 ver_a_f64_z_f32( f64_to_f32 );
570 break;
571#ifdef EXTFLOAT80
572 case F64_TO_EXTF80:
573 ver_a_f64_z_extF80( f64_to_extF80M );
574 break;
575#endif
576#ifdef FLOAT128
577 case F64_TO_F128:
578 ver_a_f64_z_f128( f64_to_f128M );
579 break;
580#endif
581 case F64_ROUNDTOINT:
582 ver_az_f64_rx( f64_roundToInt, roundingMode, exact );
583 break;
584 case F64_ADD:
585 trueFunction_abz_f64 = f64_add;
586 goto ver_abz_f64;
587 case F64_SUB:
588 trueFunction_abz_f64 = f64_sub;
589 goto ver_abz_f64;
590 case F64_MUL:
591 trueFunction_abz_f64 = f64_mul;
592 goto ver_abz_f64;
593 case F64_DIV:
594 trueFunction_abz_f64 = f64_div;
595 goto ver_abz_f64;
596 case F64_REM:
597 trueFunction_abz_f64 = f64_rem;
598 ver_abz_f64:
599 ver_abz_f64( trueFunction_abz_f64 );
600 break;
601 case F64_MULADD:
602 ver_abcz_f64( f64_mulAdd );
603 break;
604 case F64_SQRT:
605 ver_az_f64( f64_sqrt );
606 break;
607 case F64_EQ:
608 trueFunction_ab_f64_z_bool = f64_eq;
609 goto ver_ab_f64_z_bool;
610 case F64_LE:
611 trueFunction_ab_f64_z_bool = f64_le;
612 goto ver_ab_f64_z_bool;
613 case F64_LT:
614 trueFunction_ab_f64_z_bool = f64_lt;
615 goto ver_ab_f64_z_bool;
616 case F64_EQ_SIGNALING:
617 trueFunction_ab_f64_z_bool = f64_eq_signaling;
618 goto ver_ab_f64_z_bool;
619 case F64_LE_QUIET:
620 trueFunction_ab_f64_z_bool = f64_le_quiet;
621 goto ver_ab_f64_z_bool;
622 case F64_LT_QUIET:
623 trueFunction_ab_f64_z_bool = f64_lt_quiet;
624 ver_ab_f64_z_bool:
625 ver_ab_f64_z_bool( trueFunction_ab_f64_z_bool );
626 break;
627#endif
628 /*--------------------------------------------------------------------
629 *--------------------------------------------------------------------*/
630#ifdef EXTFLOAT80
631 case EXTF80_TO_UI32:
632 ver_a_extF80_z_ui32_rx( extF80M_to_ui32, roundingMode, exact );
633 break;
634 case EXTF80_TO_UI64:
635 ver_a_extF80_z_ui64_rx( extF80M_to_ui64, roundingMode, exact );
636 break;
637 case EXTF80_TO_I32:
638 ver_a_extF80_z_i32_rx( extF80M_to_i32, roundingMode, exact );
639 break;
640 case EXTF80_TO_I64:
641 ver_a_extF80_z_i64_rx( extF80M_to_i64, roundingMode, exact );
642 break;
643#ifdef FLOAT16
644 case EXTF80_TO_F16:
645 ver_a_extF80_z_f16( extF80M_to_f16 );
646 break;
647#endif
648 case EXTF80_TO_F32:
649 ver_a_extF80_z_f32( extF80M_to_f32 );
650 break;
651#ifdef FLOAT64
652 case EXTF80_TO_F64:
653 ver_a_extF80_z_f64( extF80M_to_f64 );
654 break;
655#endif
656#ifdef FLOAT128
657 case EXTF80_TO_F128:
658 ver_a_extF80_z_f128( extF80M_to_f128M );
659 break;
660#endif
661 case EXTF80_ROUNDTOINT:
662 ver_az_extF80_rx( extF80M_roundToInt, roundingMode, exact );
663 break;
664 case EXTF80_ADD:
665 trueFunction_abz_extF80 = extF80M_add;
666 goto ver_abz_extF80;
667 case EXTF80_SUB:
668 trueFunction_abz_extF80 = extF80M_sub;
669 goto ver_abz_extF80;
670 case EXTF80_MUL:
671 trueFunction_abz_extF80 = extF80M_mul;
672 goto ver_abz_extF80;
673 case EXTF80_DIV:
674 trueFunction_abz_extF80 = extF80M_div;
675 goto ver_abz_extF80;
676 case EXTF80_REM:
677 trueFunction_abz_extF80 = extF80M_rem;
678 ver_abz_extF80:
679 ver_abz_extF80( trueFunction_abz_extF80 );
680 break;
681 case EXTF80_SQRT:
682 ver_az_extF80( extF80M_sqrt );
683 break;
684 case EXTF80_EQ:
685 trueFunction_ab_extF80_z_bool = extF80M_eq;
686 goto ver_ab_extF80_z_bool;
687 case EXTF80_LE:
688 trueFunction_ab_extF80_z_bool = extF80M_le;
689 goto ver_ab_extF80_z_bool;
690 case EXTF80_LT:
691 trueFunction_ab_extF80_z_bool = extF80M_lt;
692 goto ver_ab_extF80_z_bool;
693 case EXTF80_EQ_SIGNALING:
694 trueFunction_ab_extF80_z_bool = extF80M_eq_signaling;
695 goto ver_ab_extF80_z_bool;
696 case EXTF80_LE_QUIET:
697 trueFunction_ab_extF80_z_bool = extF80M_le_quiet;
698 goto ver_ab_extF80_z_bool;
699 case EXTF80_LT_QUIET:
700 trueFunction_ab_extF80_z_bool = extF80M_lt_quiet;
701 ver_ab_extF80_z_bool:
702 ver_ab_extF80_z_bool( trueFunction_ab_extF80_z_bool );
703 break;
704#endif
705 /*--------------------------------------------------------------------
706 *--------------------------------------------------------------------*/
707#ifdef FLOAT128
708 case F128_TO_UI32:
709 ver_a_f128_z_ui32_rx( f128M_to_ui32, roundingMode, exact );
710 break;
711 case F128_TO_UI64:
712 ver_a_f128_z_ui64_rx( f128M_to_ui64, roundingMode, exact );
713 break;
714 case F128_TO_I32:
715 ver_a_f128_z_i32_rx( f128M_to_i32, roundingMode, exact );
716 break;
717 case F128_TO_I64:
718 ver_a_f128_z_i64_rx( f128M_to_i64, roundingMode, exact );
719 break;
720#ifdef FLOAT16
721 case F128_TO_F16:
722 ver_a_f128_z_f16( f128M_to_f16 );
723 break;
724#endif
725 case F128_TO_F32:
726 ver_a_f128_z_f32( f128M_to_f32 );
727 break;
728#ifdef FLOAT64
729 case F128_TO_F64:
730 ver_a_f128_z_f64( f128M_to_f64 );
731 break;
732#endif
733#ifdef EXTFLOAT80
734 case F128_TO_EXTF80:
735 ver_a_f128_z_extF80( f128M_to_extF80M );
736 break;
737#endif
738 case F128_ROUNDTOINT:
739 ver_az_f128_rx( f128M_roundToInt, roundingMode, exact );
740 break;
741 case F128_ADD:
742 trueFunction_abz_f128 = f128M_add;
743 goto ver_abz_f128;
744 case F128_SUB:
745 trueFunction_abz_f128 = f128M_sub;
746 goto ver_abz_f128;
747 case F128_MUL:
748 trueFunction_abz_f128 = f128M_mul;
749 goto ver_abz_f128;
750 case F128_DIV:
751 trueFunction_abz_f128 = f128M_div;
752 goto ver_abz_f128;
753 case F128_REM:
754 trueFunction_abz_f128 = f128M_rem;
755 ver_abz_f128:
756 ver_abz_f128( trueFunction_abz_f128 );
757 break;
758 case F128_MULADD:
759 ver_abcz_f128( f128M_mulAdd );
760 break;
761 case F128_SQRT:
762 ver_az_f128( f128M_sqrt );
763 break;
764 case F128_EQ:
765 trueFunction_ab_f128_z_bool = f128M_eq;
766 goto ver_ab_f128_z_bool;
767 case F128_LE:
768 trueFunction_ab_f128_z_bool = f128M_le;
769 goto ver_ab_f128_z_bool;
770 case F128_LT:
771 trueFunction_ab_f128_z_bool = f128M_lt;
772 goto ver_ab_f128_z_bool;
773 case F128_EQ_SIGNALING:
774 trueFunction_ab_f128_z_bool = f128M_eq_signaling;
775 goto ver_ab_f128_z_bool;
776 case F128_LE_QUIET:
777 trueFunction_ab_f128_z_bool = f128M_le_quiet;
778 goto ver_ab_f128_z_bool;
779 case F128_LT_QUIET:
780 trueFunction_ab_f128_z_bool = f128M_lt_quiet;
781 ver_ab_f128_z_bool:
782 ver_ab_f128_z_bool( trueFunction_ab_f128_z_bool );
783 break;
784#endif
785 }
786 verCases_exitWithStatus();
787 /*------------------------------------------------------------------------
788 *------------------------------------------------------------------------*/
789 optionError:
790 fail( "'%s' option requires numeric argument", *argv );
791 invalidArg:
792 fail( "Invalid argument '%s'", *argv );
793
794}
795
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