aboutsummaryrefslogtreecommitdiff
path: root/source/testfloat_ver.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/testfloat_ver.c')
-rw-r--r--source/testfloat_ver.c40
1 files changed, 35 insertions, 5 deletions
diff --git a/source/testfloat_ver.c b/source/testfloat_ver.c
index e5a74fd..39a4688 100644
--- a/source/testfloat_ver.c
+++ b/source/testfloat_ver.c
@@ -1,12 +1,12 @@
/*============================================================================
-This C source file is part of TestFloat, Release 3b, a package of programs for
+This C source file is part of TestFloat, Release 3c, a package of programs for
testing the correctness of floating-point arithmetic complying with the IEEE
Standard for Floating-Point, by John R. Hauser.
-Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of
-California. All rights reserved.
+Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017 The Regents of the
+University of California. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -71,8 +71,10 @@ int main( int argc, char *argv[] )
#endif
float32_t (*trueFunction_abz_f32)( float32_t, float32_t );
bool (*trueFunction_ab_f32_z_bool)( float32_t, float32_t );
+#ifdef FLOAT64
float64_t (*trueFunction_abz_f64)( float64_t, float64_t );
bool (*trueFunction_ab_f64_z_bool)( float64_t, float64_t );
+#endif
#ifdef EXTFLOAT80
void
(*trueFunction_abz_extF80)(
@@ -132,6 +134,10 @@ int main( int argc, char *argv[] )
" -rmin --Round to minimum (down).\n"
" -rmax --Round to maximum (up).\n"
" -rnear_maxMag --Round to nearest/maximum magnitude (nearest/away).\n"
+#ifdef FLOAT_ROUND_ODD
+" -rodd --Round to odd (jamming). (For rounding to an integer\n"
+" value, rounds to minimum magnitude instead.)\n"
+#endif
" -tininessbefore --Detect underflow tininess before rounding.\n"
" * -tininessafter --Detect underflow tininess after rounding.\n"
" * -notexact --Rounding to integer is not exact (no inexact\n"
@@ -156,7 +162,9 @@ int main( int argc, char *argv[] )
" f16 --Binary 16-bit floating-point (half-precision).\n"
#endif
" f32 --Binary 32-bit floating-point (single-precision).\n"
+#ifdef FLOAT64
" f64 --Binary 64-bit floating-point (double-precision).\n"
+#endif
#ifdef EXTFLOAT80
" extF80 --Binary 80-bit extended floating-point.\n"
#endif
@@ -208,6 +216,10 @@ int main( int argc, char *argv[] )
|| ! strcmp( argPtr, "rnearest_maxMag" )
) {
roundingCode = ROUND_NEAR_MAXMAG;
+#ifdef FLOAT_ROUND_ODD
+ } else if ( ! strcmp( argPtr, "rodd" ) ) {
+ roundingCode = ROUND_ODD;
+#endif
} else if ( ! strcmp( argPtr, "tininessbefore" ) ) {
tininessCode = TININESS_BEFORE_ROUNDING;
} else if ( ! strcmp( argPtr, "tininessafter" ) ) {
@@ -277,9 +289,11 @@ int main( int argc, char *argv[] )
case UI32_TO_F32:
ver_a_ui32_z_f32( ui32_to_f32 );
break;
+#ifdef FLOAT64
case UI32_TO_F64:
ver_a_ui32_z_f64( ui32_to_f64 );
break;
+#endif
#ifdef EXTFLOAT80
case UI32_TO_EXTF80:
ver_a_ui32_z_extF80( ui32_to_extF80M );
@@ -298,9 +312,11 @@ int main( int argc, char *argv[] )
case UI64_TO_F32:
ver_a_ui64_z_f32( ui64_to_f32 );
break;
+#ifdef FLOAT64
case UI64_TO_F64:
ver_a_ui64_z_f64( ui64_to_f64 );
break;
+#endif
#ifdef EXTFLOAT80
case UI64_TO_EXTF80:
ver_a_ui64_z_extF80( ui64_to_extF80M );
@@ -319,9 +335,11 @@ int main( int argc, char *argv[] )
case I32_TO_F32:
ver_a_i32_z_f32( i32_to_f32 );
break;
+#ifdef FLOAT64
case I32_TO_F64:
ver_a_i32_z_f64( i32_to_f64 );
break;
+#endif
#ifdef EXTFLOAT80
case I32_TO_EXTF80:
ver_a_i32_z_extF80( i32_to_extF80M );
@@ -340,9 +358,11 @@ int main( int argc, char *argv[] )
case I64_TO_F32:
ver_a_i64_z_f32( i64_to_f32 );
break;
+#ifdef FLOAT64
case I64_TO_F64:
ver_a_i64_z_f64( i64_to_f64 );
break;
+#endif
#ifdef EXTFLOAT80
case I64_TO_EXTF80:
ver_a_i64_z_extF80( i64_to_extF80M );
@@ -371,9 +391,11 @@ int main( int argc, char *argv[] )
case F16_TO_F32:
ver_a_f16_z_f32( f16_to_f32 );
break;
+#ifdef FLOAT64
case F16_TO_F64:
ver_a_f16_z_f64( f16_to_f64 );
break;
+#endif
#ifdef EXTFLOAT80
case F16_TO_EXTF80:
ver_a_f16_z_extF80( f16_to_extF80M );
@@ -450,9 +472,11 @@ int main( int argc, char *argv[] )
ver_a_f32_z_f16( f32_to_f16 );
break;
#endif
+#ifdef FLOAT64
case F32_TO_F64:
ver_a_f32_z_f64( f32_to_f64 );
break;
+#endif
#ifdef EXTFLOAT80
case F32_TO_EXTF80:
ver_a_f32_z_extF80( f32_to_extF80M );
@@ -511,6 +535,7 @@ int main( int argc, char *argv[] )
break;
/*--------------------------------------------------------------------
*--------------------------------------------------------------------*/
+#ifdef FLOAT64
case F64_TO_UI32:
ver_a_f64_z_ui32_rx( f64_to_ui32, roundingMode, exact );
break;
@@ -587,6 +612,7 @@ int main( int argc, char *argv[] )
ver_ab_f64_z_bool:
ver_ab_f64_z_bool( trueFunction_ab_f64_z_bool );
break;
+#endif
/*--------------------------------------------------------------------
*--------------------------------------------------------------------*/
#ifdef EXTFLOAT80
@@ -610,9 +636,11 @@ int main( int argc, char *argv[] )
case EXTF80_TO_F32:
ver_a_extF80_z_f32( extF80M_to_f32 );
break;
+#ifdef FLOAT64
case EXTF80_TO_F64:
ver_a_extF80_z_f64( extF80M_to_f64 );
break;
+#endif
#ifdef FLOAT128
case EXTF80_TO_F128:
ver_a_extF80_z_f128( extF80M_to_f128M );
@@ -685,9 +713,11 @@ int main( int argc, char *argv[] )
case F128_TO_F32:
ver_a_f128_z_f32( f128M_to_f32 );
break;
+#ifdef FLOAT64
case F128_TO_F64:
ver_a_f128_z_f64( f128M_to_f64 );
break;
+#endif
#ifdef EXTFLOAT80
case F128_TO_EXTF80:
ver_a_f128_z_extF80( f128M_to_extF80M );
@@ -745,9 +775,9 @@ int main( int argc, char *argv[] )
/*------------------------------------------------------------------------
*------------------------------------------------------------------------*/
optionError:
- fail( "`%s' option requires numeric argument", *argv );
+ fail( "'%s' option requires numeric argument", *argv );
invalidArg:
- fail( "Invalid argument `%s'", *argv );
+ fail( "Invalid argument '%s'", *argv );
}