From 44c8f498e56539a943e2da138c433680a981a4f1 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Fri, 20 Mar 2015 11:30:33 -0500 Subject: [svn-r26499] Description: Remove ULLONG_TO_FP_CAST_WORKS macro/define, as it only applies to older platforms we aren't supporting any longer. Tested on: MacOSX/64 10.10.2 (amazon) w/serial & parallel (h5committest not required on this branch) --- config/cmake/ConfigureChecks.cmake | 9 --------- config/cmake/H5pubconf.h.in | 4 ---- configure.ac | 18 ------------------ src/H5T.c | 2 -- src/H5Tconv.c | 4 ---- src/H5Tpkg.h | 13 ++----------- src/H5Ztrans.c | 21 ++------------------- test/dt_arith.c | 30 +++--------------------------- test/dtransform.c | 10 ---------- 9 files changed, 7 insertions(+), 104 deletions(-) diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 7978c27..2b68779 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -260,15 +260,6 @@ ENDMACRO (H5MiscConversionTest) # ---------------------------------------------------------------------- # Set the flag to indicate that the machine can _compile_ -# 'unsigned long long' to 'float' and 'double' typecasts. -# (This flag should be set for all machines.) -# -if (H5_ULLONG_TO_FP_CAST_WORKS MATCHES ^H5_ULLONG_TO_FP_CAST_WORKS$) - set (H5_ULLONG_TO_FP_CAST_WORKS 1 CACHE INTERNAL "Checking IF compiling unsigned long long to floating-point typecasts work") - message (STATUS "Checking IF compiling unsigned long long to floating-point typecasts work... yes") -endif (H5_ULLONG_TO_FP_CAST_WORKS MATCHES ^H5_ULLONG_TO_FP_CAST_WORKS$) -# ---------------------------------------------------------------------- -# Set the flag to indicate that the machine can _compile_ # 'long long' to 'float' and 'double' typecasts. # (This flag should be set for all machines.) # diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index 8d587a2..f51e49d 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -656,10 +656,6 @@ /* Define to 1 if your declares `struct tm'. */ #cmakedefine H5_TM_IN_SYS_TIME @H5_TM_IN_SYS_TIME@ -/* Define if your system can compile unsigned long long to floating-point - casts. */ -#cmakedefine H5_ULLONG_TO_FP_CAST_WORKS @H5_ULLONG_TO_FP_CAST_WORKS@ - /* Define if your system can convert unsigned long long to long double with correct precision. */ #cmakedefine H5_ULLONG_TO_LDOUBLE_PRECISION @H5_ULLONG_TO_LDOUBLE_PRECISION@ diff --git a/configure.ac b/configure.ac index 8e385bd..eab7883 100644 --- a/configure.ac +++ b/configure.ac @@ -2444,24 +2444,6 @@ esac ## ---------------------------------------------------------------------- ## Set the flag to indicate that the machine can _compile_ -## 'unsigned long long' to 'float' and 'double' typecasts. -## (This flag should be set for all machines, except for under Windows when -## compiled with Visual Studio 6, where the macro value is set in the -## src/H5pubconf.h file) -## -AC_MSG_CHECKING([if compiling unsigned long long to floating-point typecasts work]) -AC_CACHE_VAL([hdf5_cv_ullong_to_fp_cast_works], [hdf5_cv_ullong_to_fp_cast_works=yes]) - -if test ${hdf5_cv_ullong_to_fp_cast_works} = "yes"; then - AC_DEFINE([ULLONG_TO_FP_CAST_WORKS], [1], - [Define if your system can compile unsigned long long to floating-point casts.]) - AC_MSG_RESULT([yes]) -else - AC_MSG_RESULT([no]) -fi - -## ---------------------------------------------------------------------- -## Set the flag to indicate that the machine can _compile_ ## 'long long' to 'float' and 'double' typecasts. ## (This flag should be set for all machines, except for under Windows when ## compiled with Visual Studio 6, where the macro value is set in the diff --git a/src/H5T.c b/src/H5T.c index 9af35f8..2f45840 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -1232,10 +1232,8 @@ H5T_init_interface(void) #endif /* H5T_CONV_INTERNAL_LLONG_LDOUBLE */ /* From unsigned long long to floats */ -#if H5T_CONV_INTERNAL_ULLONG_FP status |= H5T_register(H5T_PERS_HARD, "ullong_flt", native_ullong, native_float, H5T__conv_ullong_float, H5AC_dxpl_id, FALSE); status |= H5T_register(H5T_PERS_HARD, "ullong_dbl", native_ullong, native_double, H5T__conv_ullong_double, H5AC_dxpl_id, FALSE); -#endif /* H5T_CONV_INTERNAL_ULLONG_FP */ #ifdef H5T_CONV_INTERNAL_ULLONG_LDOUBLE status |= H5T_register(H5T_PERS_HARD, "ullong_ldbl", native_ullong, native_ldouble, H5T__conv_ullong_ldouble, H5AC_dxpl_id, FALSE); #endif /* H5T_CONV_INTERNAL_ULLONG_LDOUBLE */ diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 29d2520..d142bde 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -7932,7 +7932,6 @@ H5T__conv_llong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * *------------------------------------------------------------------------- */ -#if H5T_CONV_INTERNAL_ULLONG_FP herr_t H5T__conv_ullong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, @@ -7941,7 +7940,6 @@ H5T__conv_ullong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, { H5T_CONV_xF(ULLONG, FLOAT, unsigned long long, float, -, -); } -#endif /*H5T_CONV_INTERNAL_ULLONG_FP*/ /*------------------------------------------------------------------------- @@ -7959,7 +7957,6 @@ H5T__conv_ullong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * *------------------------------------------------------------------------- */ -#if H5T_CONV_INTERNAL_ULLONG_FP herr_t H5T__conv_ullong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, @@ -7968,7 +7965,6 @@ H5T__conv_ullong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, { H5T_CONV_xF(ULLONG, DOUBLE, unsigned long long, double, -, -); } -#endif /*H5T_CONV_INTERNAL_ULLONG_FP*/ /*------------------------------------------------------------------------- diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h index a4f8b8c..ffcfe0a 100644 --- a/src/H5Tpkg.h +++ b/src/H5Tpkg.h @@ -130,22 +130,13 @@ #define H5T_CONV_INTERNAL_LLONG_LDOUBLE 1 #endif -/* Define an internal macro for converting unsigned long long to floating numbers. SGI compilers give - * some incorect conversion. 64-bit Solaris does different rounding. Windows Visual Studio 6 does - * not support unsigned long long. */ -#if (H5_WANT_DATA_ACCURACY && H5_ULLONG_TO_FP_CAST_WORKS) || \ - (!H5_WANT_DATA_ACCURACY && H5_ULLONG_TO_FP_CAST_WORKS) -#define H5T_CONV_INTERNAL_ULLONG_FP 1 -#endif - /* Define an internal macro for converting unsigned long long to long double. SGI compilers give * some incorect conversion. 64-bit Solaris does different rounding. Windows Visual Studio 6 does * not support unsigned long long. For FreeBSD(sleipnir), the last 2 bytes of mantissa are lost when * compiler tries to do the conversion. For Cygwin, compiler doesn't do rounding correctly. * Mac OS 10.4 gives some incorrect result. */ -#if (H5_WANT_DATA_ACCURACY && H5_ULLONG_TO_FP_CAST_WORKS && \ - defined(H5_ULLONG_TO_LDOUBLE_PRECISION) && defined(H5_LLONG_TO_LDOUBLE_CORRECT)) || (!H5_WANT_DATA_ACCURACY && \ - H5_ULLONG_TO_FP_CAST_WORKS) +#if (H5_WANT_DATA_ACCURACY && \ + defined(H5_ULLONG_TO_LDOUBLE_PRECISION) && defined(H5_LLONG_TO_LDOUBLE_CORRECT)) || (!H5_WANT_DATA_ACCURACY) #define H5T_CONV_INTERNAL_ULLONG_LDOUBLE 1 #endif diff --git a/src/H5Ztrans.c b/src/H5Ztrans.c index 1b8c096..7d46d70 100644 --- a/src/H5Ztrans.c +++ b/src/H5Ztrans.c @@ -160,23 +160,6 @@ static void H5Z_print(H5Z_node *tree, FILE *stream); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Unexpected type conversion operation") \ } -/* Due to the undefined nature of embedding macros/conditionals within macros, we employ - * this clever little hack. We always compile in the code for the type conversion, even if - * it isn't supported in the compiler. To avoid errors, we define ULLONG_TO_FP_XFORM_TYPE_OP_ERROR on - * unsupported compilers, which will cause the code to execute HGOTO_ERROR and skip the code - * that does the actual conversion */ - - -#ifndef H5_ULLONG_TO_FP_CAST_WORKS -#define H5Z_XFORM_ULL_DO_OP1(RESL,RESR,TYPE,OP,SIZE) \ -{ \ - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Cannot convert from unsigned long long to double: required for data transform") \ -} -#else -#define H5Z_XFORM_ULL_DO_OP1(RESL,RESR,TYPE,OP,SIZE) \ - H5Z_XFORM_DO_OP1(RESL,RESR,TYPE,OP,SIZE) -#endif - /* Windows Intel 8.1 compiler has error converting long long to double. * Hard code it in. */ @@ -213,7 +196,7 @@ static void H5Z_print(H5Z_node *tree, FILE *stream); else if((TYPE) == H5T_NATIVE_LLONG) \ H5Z_XFORM_LL_DO_OP1((RESL), (RESR), long long, OP, (SIZE)) \ else if((TYPE) == H5T_NATIVE_ULLONG) \ - H5Z_XFORM_ULL_DO_OP1((RESL), (RESR), unsigned long long, OP, (SIZE)) \ + H5Z_XFORM_DO_OP1((RESL), (RESR), unsigned long long, OP, (SIZE)) \ else if((TYPE) == H5T_NATIVE_FLOAT) \ H5Z_XFORM_DO_OP1((RESL), (RESR), float, OP, (SIZE)) \ else if((TYPE) == H5T_NATIVE_DOUBLE) \ @@ -245,7 +228,7 @@ static void H5Z_print(H5Z_node *tree, FILE *stream); else if((TYPE) == H5T_NATIVE_LLONG) \ H5Z_XFORM_LL_DO_OP1((RESL), (RESR), long long, OP, (SIZE)) \ else if((TYPE) == H5T_NATIVE_ULLONG) \ - H5Z_XFORM_ULL_DO_OP1((RESL), (RESR), unsigned long long, OP, (SIZE)) \ + H5Z_XFORM_DO_OP1((RESL), (RESR), unsigned long long, OP, (SIZE)) \ else if((TYPE) == H5T_NATIVE_FLOAT) \ H5Z_XFORM_DO_OP1((RESL), (RESR), float, OP, (SIZE)) \ else if((TYPE) == H5T_NATIVE_DOUBLE) \ diff --git a/test/dt_arith.c b/test/dt_arith.c index 4964383..2991e12 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -3877,12 +3877,10 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) HDmemcpy(aligned, saved+j*sizeof(long long), sizeof(long long)); hw_float = (float)(*((long long*)aligned)); break; -#ifdef H5_ULLONG_TO_FP_CAST_WORKS case INT_ULLONG: HDmemcpy(aligned, saved+j*sizeof(unsigned long long), sizeof(unsigned long long)); hw_float = (float)(*((unsigned long long*)aligned)); break; -#endif /* H5_ULLONG_TO_FP_CAST_WORKS */ case FLT_FLOAT: case FLT_DOUBLE: case FLT_LDOUBLE: @@ -3930,12 +3928,10 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) HDmemcpy(aligned, saved+j*sizeof(long long), sizeof(long long)); hw_double = (double)(*((long long*)aligned)); break; -#ifdef H5_ULLONG_TO_FP_CAST_WORKS case INT_ULLONG: HDmemcpy(aligned, saved+j*sizeof(unsigned long long), sizeof(unsigned long long)); hw_double = (double)(*((unsigned long long*)aligned)); break; -#endif /* H5_ULLONG_TO_FP_CAST_WORKS */ case FLT_FLOAT: case FLT_DOUBLE: case FLT_LDOUBLE: @@ -3984,12 +3980,10 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) HDmemcpy(aligned, saved+j*sizeof(long long), sizeof(long long)); hw_ldouble = (long double)(*((long long*)aligned)); break; -#ifdef H5_ULLONG_TO_FP_CAST_WORKS case INT_ULLONG: HDmemcpy(aligned, saved+j*sizeof(unsigned long long), sizeof(unsigned long long)); hw_ldouble = (long double)(*((unsigned long long*)aligned)); break; -#endif /* H5_ULLONG_TO_FP_CAST_WORKS */ case FLT_FLOAT: case FLT_DOUBLE: case FLT_LDOUBLE: @@ -5120,26 +5114,8 @@ run_int_fp_conv(const char *name) nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_LLONG, H5T_NATIVE_FLOAT); nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_LLONG, H5T_NATIVE_DOUBLE); -#ifdef H5_ULLONG_TO_FP_CAST_WORKS nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_ULLONG, H5T_NATIVE_FLOAT); nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_ULLONG, H5T_NATIVE_DOUBLE); -#else /* H5_ULLONG_TO_FP_CAST_WORKS */ - { - char str[256]; /*hello string */ - - HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", - name, "unsigned long long", "float"); - printf("%-70s", str); - SKIPPED(); - HDputs(" Test skipped due to compiler not handling conversion."); - - HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", - name, "unsigned long long", "double"); - printf("%-70s", str); - SKIPPED(); - HDputs(" Test skipped due to compiler not handling conversion."); - } -#endif /* H5_ULLONG_TO_FP_CAST_WORKS */ #endif #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE @@ -5183,9 +5159,9 @@ run_int_fp_conv(const char *name) HDputs(" Test skipped due to compiler error in handling conversion."); } #endif /* H5_LLONG_TO_LDOUBLE_CORRECT */ -#if H5_ULLONG_TO_FP_CAST_WORKS && H5_ULLONG_TO_LDOUBLE_PRECISION && H5_LLONG_TO_LDOUBLE_CORRECT +#if H5_ULLONG_TO_LDOUBLE_PRECISION && H5_LLONG_TO_LDOUBLE_CORRECT nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_ULLONG, H5T_NATIVE_LDOUBLE); -#else /* H5_ULLONG_TO_FP_CAST_WORKS && H5_ULLONG_TO_LDOUBLE_PRECISION && H5_LLONG_TO_LDOUBLE_CORRECT */ +#else /* H5_ULLONG_TO_LDOUBLE_PRECISION && H5_LLONG_TO_LDOUBLE_CORRECT */ { char str[256]; /*hello string */ @@ -5195,7 +5171,7 @@ run_int_fp_conv(const char *name) SKIPPED(); HDputs(" Test skipped due to compiler not handling conversion."); } -#endif /* H5_ULLONG_TO_FP_CAST_WORKS && H5_ULLONG_TO_LDOUBLE_PRECISION && H5_LLONG_TO_LDOUBLE_CORRECT */ +#endif /* H5_ULLONG_TO_LDOUBLE_PRECISION && H5_LLONG_TO_LDOUBLE_CORRECT */ #endif #endif diff --git a/test/dtransform.c b/test/dtransform.c index d80c21a..520055d 100644 --- a/test/dtransform.c +++ b/test/dtransform.c @@ -305,12 +305,7 @@ int main(void) SKIPPED() #endif -#ifdef H5_ULLONG_TO_FP_CAST_WORKS TEST_TYPE_CONTIG(dxpl_id_utrans_inv, unsigned long long, H5T_NATIVE_ULLONG, "ullong", transformData, 0); -#else - TESTING("contiguous, with type conversion (float->ullong)") - SKIPPED() -#endif TEST_TYPE_CONTIG(dxpl_id_c_to_f, float, H5T_NATIVE_FLOAT, "float", windchillFfloat, 1); TEST_TYPE_CONTIG(dxpl_id_c_to_f, double, H5T_NATIVE_DOUBLE, "double", windchillFfloat, 1); #if H5_SIZEOF_LONG_DOUBLE!=0 @@ -333,12 +328,7 @@ int main(void) SKIPPED() #endif -#ifdef H5_ULLONG_TO_FP_CAST_WORKS TEST_TYPE_CHUNK(dxpl_id_utrans_inv, unsigned long long, H5T_NATIVE_ULLONG, "ullong", transformData, 0); -#else - TESTING("chunked, with type conversion (float->ullong)") - SKIPPED() -#endif TEST_TYPE_CHUNK(dxpl_id_c_to_f, float, H5T_NATIVE_FLOAT, "float", windchillFfloat, 1); TEST_TYPE_CHUNK(dxpl_id_c_to_f, double, H5T_NATIVE_DOUBLE, "double", windchillFfloat, 1); #if H5_SIZEOF_LONG_DOUBLE!=0 -- cgit v0.12