diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2023-06-12 21:12:57 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-12 21:12:57 (GMT) |
commit | 1e1dac1dac58fa18f6b7788346d1ba7d3315b0f9 (patch) | |
tree | bcf0ae160f0990da3c5f6984c495ec0657d05de6 /test/dt_arith.c | |
parent | d1d6a2187d2388e4b1c1a0f05f1f6773401f1187 (diff) | |
download | hdf5-1e1dac1dac58fa18f6b7788346d1ba7d3315b0f9.zip hdf5-1e1dac1dac58fa18f6b7788346d1ba7d3315b0f9.tar.gz hdf5-1e1dac1dac58fa18f6b7788346d1ba7d3315b0f9.tar.bz2 |
Remove long double conversion work-arounds (#3097)
Several options and public symbols that were provided to paper
over non-standard long double conversions between signed/unsigned
long and long long values were removed from the Autotools and
CMake. These were added twenty years ago, when C99 and 64-bit
platforms were less common and are no longer needed.
Autotools:
--enable-dconv-accuracy
CMake:
HDF5_WANT_DATA_ACCURACY
H5pubconf.h symbols:
H5_WANT_DATA_ACCURACY
H5_LDOUBLE_TO_LONG_SPECIAL
H5_LONG_TO_LDOUBLE_SPECIAL
H5_LDOUBLE_TO_LLONG_ACCURATE
H5_LLONG_TO_LDOUBLE_CORRECT
H5_DISABLE_SOME_LDOUBLE_CONV
Diffstat (limited to 'test/dt_arith.c')
-rw-r--r-- | test/dt_arith.c | 115 |
1 files changed, 3 insertions, 112 deletions
diff --git a/test/dt_arith.c b/test/dt_arith.c index c006c49..93e62cf 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -11,9 +11,6 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke - * Tuesday, December 9, 1997 - * * Purpose: Tests the data type interface (H5T) */ @@ -4845,20 +4842,7 @@ run_fp_tests(const char *name) #if H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE nerrors += test_conv_flt_1(name, TEST_DENORM, H5T_NATIVE_FLOAT, H5T_NATIVE_LDOUBLE); nerrors += test_conv_flt_1(name, TEST_DENORM, H5T_NATIVE_DOUBLE, H5T_NATIVE_LDOUBLE); -#ifndef H5_DISABLE_SOME_LDOUBLE_CONV nerrors += test_conv_flt_1(name, TEST_DENORM, H5T_NATIVE_LDOUBLE, H5T_NATIVE_FLOAT); -#else - { - char str[256]; /*string */ - - HDsnprintf(str, sizeof(str), "Testing %s denormalized %s -> %s conversions", name, "long double", - "float"); - HDprintf("%-70s", str); - SKIPPED(); - HDputs(" Test skipped due to the conversion problem on IBM ppc64le cpu."); - } -#endif - nerrors += test_conv_flt_1(name, TEST_DENORM, H5T_NATIVE_LDOUBLE, H5T_NATIVE_DOUBLE); #endif @@ -4868,20 +4852,8 @@ run_fp_tests(const char *name) #if H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE nerrors += test_conv_flt_1(name, TEST_SPECIAL, H5T_NATIVE_FLOAT, H5T_NATIVE_LDOUBLE); nerrors += test_conv_flt_1(name, TEST_SPECIAL, H5T_NATIVE_DOUBLE, H5T_NATIVE_LDOUBLE); -#ifndef H5_DISABLE_SOME_LDOUBLE_CONV nerrors += test_conv_flt_1(name, TEST_SPECIAL, H5T_NATIVE_LDOUBLE, H5T_NATIVE_FLOAT); nerrors += test_conv_flt_1(name, TEST_SPECIAL, H5T_NATIVE_LDOUBLE, H5T_NATIVE_DOUBLE); -#else - { - char str[256]; /*string */ - - HDsnprintf(str, sizeof(str), "Testing %s special %s -> %s conversions", name, "long double", - "float or double"); - HDprintf("%-70s", str); - SKIPPED(); - HDputs(" Test skipped due to the conversion problem on IBM ppc64le cpu."); - } -#endif #endif done: @@ -4947,47 +4919,12 @@ run_int_fp_conv(const char *name) nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_INT, H5T_NATIVE_LDOUBLE); nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_UINT, H5T_NATIVE_LDOUBLE); #if H5_SIZEOF_LONG != H5_SIZEOF_INT -#if !defined(H5_LONG_TO_LDOUBLE_SPECIAL) && !defined(H5_DISABLE_SOME_LDOUBLE_CONV) nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_LONG, H5T_NATIVE_LDOUBLE); nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_ULONG, H5T_NATIVE_LDOUBLE); -#else - { - char str[256]; /*string */ - - HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "(unsigned) long", - "long double"); - HDprintf("%-70s", str); - SKIPPED(); - HDputs(" Test skipped due to the special algorithm of hardware conversion."); - } -#endif #endif /* H5_SIZEOF_LONG!=H5_SIZEOF_INT */ #if H5_SIZEOF_LONG_LONG != H5_SIZEOF_LONG -#if H5_LLONG_TO_LDOUBLE_CORRECT nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_LLONG, H5T_NATIVE_LDOUBLE); -#else /* H5_LLONG_TO_LDOUBLE_CORRECT */ - { - char str[256]; /*hello string */ - - HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "long long", "long double"); - HDprintf("%-70s", str); - SKIPPED(); - HDputs(" Test skipped due to compiler error in handling conversion."); - } -#endif /* H5_LLONG_TO_LDOUBLE_CORRECT */ -#if H5_LLONG_TO_LDOUBLE_CORRECT nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_ULLONG, H5T_NATIVE_LDOUBLE); -#else /* H5_LLONG_TO_LDOUBLE_CORRECT */ - { - char str[256]; /*hello string */ - - HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "unsigned long long", - "long double"); - HDprintf("%-70s", str); - SKIPPED(); - HDputs(" Test skipped due to compiler not handling conversion."); - } -#endif /* H5_LLONG_TO_LDOUBLE_CORRECT */ #endif #endif @@ -5063,77 +5000,31 @@ run_fp_int_conv(const char *name) nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_UINT); } else { -#ifndef H5_DISABLE_SOME_LDOUBLE_CONV nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_SCHAR); nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_UCHAR); nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_SHORT); nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_USHORT); nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_INT); nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_UINT); -#else - char str[256]; /*string */ - - HDsnprintf(str, sizeof(str), "Testing %s special %s -> %s conversions", name, "long double", - "signed and unsigned char, short, int, long"); - HDprintf("%-70s", str); - SKIPPED(); - HDputs(" Test skipped due to the conversion problem on IBM ppc64le cpu."); -#endif } #if H5_SIZEOF_LONG != H5_SIZEOF_INT -#ifndef H5_LDOUBLE_TO_LONG_SPECIAL if (test_values != TEST_SPECIAL && test_values != TEST_NORMAL) { nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_LONG); nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_ULONG); } else { -#ifndef H5_DISABLE_SOME_LDOUBLE_CONV nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_LONG); nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_ULONG); -#endif - } -#else - { - char str[256]; /*string */ - - HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "long double", - "(unsigned) long"); - HDprintf("%-70s", str); - SKIPPED(); - HDputs(" Test skipped due to the special algorithm of hardware conversion."); } -#endif #endif /*H5_SIZEOF_LONG!=H5_SIZEOF_INT */ #if H5_SIZEOF_LONG_LONG != H5_SIZEOF_LONG -#ifdef H5_LDOUBLE_TO_LLONG_ACCURATE nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_LLONG); -#else /*H5_LDOUBLE_TO_LLONG_ACCURATE*/ - { - char str[256]; /*string */ - - HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "long double", "long long"); - HDprintf("%-70s", str); - SKIPPED(); - HDputs(" Test skipped due to hardware conversion error."); - } -#endif /*H5_LDOUBLE_TO_LLONG_ACCURATE*/ -#if defined(H5_LDOUBLE_TO_LLONG_ACCURATE) nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_ULLONG); -#else /*H5_LDOUBLE_TO_LLONG_ACCURATE*/ - { - char str[256]; /*string */ +#endif /* H5_SIZEOF_LONG_LONG != H5_SIZEOF_LONG */ - HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "long double", - "unsigned long long"); - HDprintf("%-70s", str); - SKIPPED(); - HDputs(" Test skipped due to hardware conversion error."); - } -#endif /*H5_LDOUBLE_TO_LLONG_ACCURATE*/ -#endif -#endif - } /* end for */ +#endif /* H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE */ + } /* end for */ return nerrors; } |