From d3114a96da64de8ea987f7c1714f8ad4a2474f4e Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Wed, 25 Mar 2015 16:33:48 -0500 Subject: [svn-r26591] Description: Bring r26492 from autotools_rework branch back to trunk: Remove the FP_TO_ULLONG_ACCURATE and FP_TO_ULLONG_RIGHT_MAXIMUM macros/defines, which were added to address problems with older PGI compilers and HP-UX systems and are no longer supported. Tested on: Linux/32 2.6.18 (jam) w/serial & parallel (daily tested on branch for >1 week) --- config/cmake/ConfigureChecks.cmake | 16 ----- config/cmake/ConversionTests.c | 48 ------------- config/cmake/H5pubconf.h.in | 8 --- configure | 133 ------------------------------------- configure.ac | 81 ---------------------- src/H5T.c | 2 - src/H5Tconv.c | 4 -- src/H5Tpkg.h | 13 +--- src/H5config.h.in | 8 --- test/dt_arith.c | 24 +------ 10 files changed, 4 insertions(+), 333 deletions(-) diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 915ec56..fad780c 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -260,22 +260,6 @@ ENDMACRO (H5MiscConversionTest) # ---------------------------------------------------------------------- # Set the flag to indicate that the machine can accurately convert -# 'float' or 'double' to 'unsigned long long' values. -# (This flag should be set for all machines, except for PGI compiler -# where round-up happens when the fraction of float-point value is greater -# than 0.5. -# -H5ConversionTests (H5_FP_TO_ULLONG_ACCURATE "Checking IF accurately roundup converting floating-point to unsigned long long values" ) -# ---------------------------------------------------------------------- -# Set the flag to indicate that the machine can accurately convert -# 'float', 'double' or 'long double' to 'unsigned long long' values. -# (This flag should be set for all machines, except for HP-UX machines -# where the maximal number for unsigned long long is 0x7fffffffffffffff -# during conversion. -# -H5ConversionTests (H5_FP_TO_ULLONG_RIGHT_MAXIMUM "Checking IF right maximum converting floating-point to unsigned long long values" ) -# ---------------------------------------------------------------------- -# Set the flag to indicate that the machine can accurately convert # 'long double' to 'unsigned int' values. (This flag should be set for # all machines, except for some Intel compilers on some Linux.) # diff --git a/config/cmake/ConversionTests.c b/config/cmake/ConversionTests.c index 82342a4..3b9b416 100644 --- a/config/cmake/ConversionTests.c +++ b/config/cmake/ConversionTests.c @@ -13,54 +13,6 @@ done: #endif -#ifdef H5_FP_TO_ULLONG_ACCURATE_TEST - -int main(void) -{ - float f = 111.60f; - double d = 222.55L; - unsigned long long l1 = (unsigned long long)f; - unsigned long long l2 = (unsigned long long)d; - int ret = 0; - - if(l1 == 112) - ret = 1; - if(l2 == 223) - ret = 1; - -done: - exit(ret); -} - -#endif - -#ifdef H5_FP_TO_ULLONG_RIGHT_MAXIMUM_TEST -int main(void) -{ - float f = 9701917572145405952.00f; - double d1 = 9701917572145405952.00L; - long double d2 = 9701917572145405952.00L; - double d3 = 2e40L; - unsigned long long l1 = (unsigned long long)f; - unsigned long long l2 = (unsigned long long)d1; - unsigned long long l3 = (unsigned long long)d2; - unsigned long long l4; - unsigned long long l5 = 0x7fffffffffffffffULL; - int ret = 0; - - if(l1 <= l5 || l2 <= l5 || l3 <= l5) - ret = 1; - - l4 = (unsigned long long)d3; - if(l4 <= l5) - ret = 1; - -done: - exit(ret); -} - -#endif - #ifdef H5_LDOUBLE_TO_LONG_SPECIAL_TEST int main(void) diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index 588450a..3c7c893 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -78,14 +78,6 @@ integer values. */ #cmakedefine H5_FP_TO_INTEGER_OVERFLOW_WORKS @H5_FP_TO_INTEGER_OVERFLOW_WORKS@ -/* Define if your system roundup accurately converting floating-point to - unsigned long long values. */ -#cmakedefine H5_FP_TO_ULLONG_ACCURATE @H5_FP_TO_ULLONG_ACCURATE@ - -/* Define if your system has right maximum convert floating-point to unsigned - long long values. */ -#cmakedefine H5_FP_TO_ULLONG_RIGHT_MAXIMUM @H5_FP_TO_ULLONG_RIGHT_MAXIMUM@ - /* Define to 1 if you have the `alarm' function. */ #cmakedefine H5_HAVE_ALARM @H5_HAVE_ALARM@ diff --git a/configure b/configure index 042085f..d33dbca 100755 --- a/configure +++ b/configure @@ -28152,139 +28152,6 @@ esac ## ---------------------------------------------------------------------- ## Set the flag to indicate that the machine can accurately convert -## 'float' or 'double' to 'unsigned long long' values. -## (This flag should be set for all machines, except for PGI compiler -## where round-up happens when the fraction of float-point value is greater -## than 0.5. -## -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if accurately roundup converting floating-point to unsigned long long values" >&5 -$as_echo_n "checking if accurately roundup converting floating-point to unsigned long long values... " >&6; } - -if ${hdf5_cv_fp_to_ullong_accurate+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - int main(void) - { - float f = 111.60f; - double d = 222.55L; - unsigned long long l1 = (unsigned long long)f; - unsigned long long l2 = (unsigned long long)d; - int ret = 0; - - if(l1 == 112) - ret = 1; - if(l2 == 223) - ret = 1; - -done: - exit(ret); - } - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - hdf5_cv_fp_to_ullong_accurate=yes -else - hdf5_cv_fp_to_ullong_accurate=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi - - -if test ${hdf5_cv_fp_to_ullong_accurate} = "yes"; then - -$as_echo "#define FP_TO_ULLONG_ACCURATE 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - -## ---------------------------------------------------------------------- -## Set the flag to indicate that the machine can accurately convert -## 'float', 'double' or 'long double' to 'unsigned long long' values. -## (This flag should be set for all machines, except for HP-UX machines -## where the maximal number for unsigned long long is 0x7fffffffffffffff -## during conversion. -## -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if right maximum converting floating-point to unsigned long long values" >&5 -$as_echo_n "checking if right maximum converting floating-point to unsigned long long values... " >&6; } - -if ${hdf5_cv_fp_to_ullong_right_maximum+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - int main(void) - { - float f = 9701917572145405952.00f; - double d1 = 9701917572145405952.00L; - long double d2 = 9701917572145405952.00L; - double d3 = 2e40L; - unsigned long long l1 = (unsigned long long)f; - unsigned long long l2 = (unsigned long long)d1; - unsigned long long l3 = (unsigned long long)d2; - unsigned long long l4; - unsigned long long l5 = 0x7fffffffffffffffULL; - int ret = 0; - - if(l1 <= l5 || l2 <= l5 || l3 <= l5) - ret = 1; - - l4 = (unsigned long long)d3; - if(l4 <= l5) - ret = 1; - -done: - exit(ret); - } - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - hdf5_cv_fp_to_ullong_right_maximum=yes -else - hdf5_cv_fp_to_ullong_right_maximum=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi - - -if test ${hdf5_cv_fp_to_ullong_right_maximum} = "yes"; then - -$as_echo "#define FP_TO_ULLONG_RIGHT_MAXIMUM 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - -## ---------------------------------------------------------------------- -## Set the flag to indicate that the machine can accurately convert ## 'long double' to 'unsigned int' values. (This flag should be set for ## all machines, except for some Intel compilers on some Linux.) ## diff --git a/configure.ac b/configure.ac index bf74348..4777ce2 100644 --- a/configure.ac +++ b/configure.ac @@ -2576,87 +2576,6 @@ esac ## ---------------------------------------------------------------------- ## Set the flag to indicate that the machine can accurately convert -## 'float' or 'double' to 'unsigned long long' values. -## (This flag should be set for all machines, except for PGI compiler -## where round-up happens when the fraction of float-point value is greater -## than 0.5. -## -AC_MSG_CHECKING([if accurately roundup converting floating-point to unsigned long long values]) - -AC_CACHE_VAL([hdf5_cv_fp_to_ullong_accurate], - [AC_TRY_RUN([ - int main(void) - { - float f = 111.60f; - double d = 222.55L; - unsigned long long l1 = (unsigned long long)f; - unsigned long long l2 = (unsigned long long)d; - int ret = 0; - - if(l1 == 112) - ret = 1; - if(l2 == 223) - ret = 1; - -done: - exit(ret); - } - ], [hdf5_cv_fp_to_ullong_accurate=yes], [hdf5_cv_fp_to_ullong_accurate=no],)]) - -if test ${hdf5_cv_fp_to_ullong_accurate} = "yes"; then - AC_DEFINE([FP_TO_ULLONG_ACCURATE], [1], - [Define if your system roundup accurately converting floating-point to unsigned long long values.]) - AC_MSG_RESULT([yes]) -else - AC_MSG_RESULT([no]) -fi - -## ---------------------------------------------------------------------- -## Set the flag to indicate that the machine can accurately convert -## 'float', 'double' or 'long double' to 'unsigned long long' values. -## (This flag should be set for all machines, except for HP-UX machines -## where the maximal number for unsigned long long is 0x7fffffffffffffff -## during conversion. -## -AC_MSG_CHECKING([if right maximum converting floating-point to unsigned long long values]) - -AC_CACHE_VAL([hdf5_cv_fp_to_ullong_right_maximum], - [AC_TRY_RUN([ - int main(void) - { - float f = 9701917572145405952.00f; - double d1 = 9701917572145405952.00L; - long double d2 = 9701917572145405952.00L; - double d3 = 2e40L; - unsigned long long l1 = (unsigned long long)f; - unsigned long long l2 = (unsigned long long)d1; - unsigned long long l3 = (unsigned long long)d2; - unsigned long long l4; - unsigned long long l5 = 0x7fffffffffffffffULL; - int ret = 0; - - if(l1 <= l5 || l2 <= l5 || l3 <= l5) - ret = 1; - - l4 = (unsigned long long)d3; - if(l4 <= l5) - ret = 1; - -done: - exit(ret); - } - ], [hdf5_cv_fp_to_ullong_right_maximum=yes], [hdf5_cv_fp_to_ullong_right_maximum=no],)]) - -if test ${hdf5_cv_fp_to_ullong_right_maximum} = "yes"; then - AC_DEFINE([FP_TO_ULLONG_RIGHT_MAXIMUM], [1], - [Define if your system has right maximum convert floating-point to unsigned long long values.]) - AC_MSG_RESULT([yes]) -else - AC_MSG_RESULT([no]) -fi - -## ---------------------------------------------------------------------- -## Set the flag to indicate that the machine can accurately convert ## 'long double' to 'unsigned int' values. (This flag should be set for ## all machines, except for some Intel compilers on some Linux.) ## diff --git a/src/H5T.c b/src/H5T.c index d9b5d57..d955490 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -1291,10 +1291,8 @@ H5T_init_interface(void) #endif /* H5T_CONV_INTERNAL_LDOUBLE_LLONG */ /* From floats to unsigned long long */ -#if H5T_CONV_INTERNAL_FP_ULLONG status |= H5T_register(H5T_PERS_HARD, "flt_ullong", native_float, native_ullong, H5T__conv_float_ullong, H5AC_dxpl_id, FALSE); status |= H5T_register(H5T_PERS_HARD, "dbl_ullong", native_double, native_ullong, H5T__conv_double_ullong, H5AC_dxpl_id, FALSE); -#endif /* H5T_CONV_INTERNAL_FP_ULLONG */ #if H5T_CONV_INTERNAL_LDOUBLE_ULLONG status |= H5T_register(H5T_PERS_HARD, "ldbl_ullong", native_ldouble, native_ullong, H5T__conv_ldouble_ullong, H5AC_dxpl_id, FALSE); #endif /* H5T_CONV_INTERNAL_LDOUBLE_ULLONG */ diff --git a/src/H5Tconv.c b/src/H5Tconv.c index d5e5d6e..09e2ec4 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -8692,7 +8692,6 @@ H5_GCC_DIAG_ON(float-equal) * *------------------------------------------------------------------------- */ -#if H5T_CONV_INTERNAL_FP_ULLONG herr_t H5T__conv_float_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, @@ -8701,7 +8700,6 @@ H5T__conv_float_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, { H5T_CONV_Fx(FLOAT, ULLONG, float, unsigned long long, 0, ULLONG_MAX); } -#endif /*H5T_CONV_INTERNAL_FP_ULLONG*/ /*------------------------------------------------------------------------- @@ -8748,7 +8746,6 @@ H5_GCC_DIAG_ON(float-equal) * *------------------------------------------------------------------------- */ -#if H5T_CONV_INTERNAL_FP_ULLONG herr_t H5T__conv_double_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, @@ -8757,7 +8754,6 @@ H5T__conv_double_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, { H5T_CONV_Fx(DOUBLE, ULLONG, double, unsigned long long, 0, ULLONG_MAX); } -#endif /*H5T_CONV_INTERNAL_FP_ULLONG*/ /*------------------------------------------------------------------------- diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h index ad0f6a3..71ede65 100644 --- a/src/H5Tpkg.h +++ b/src/H5Tpkg.h @@ -172,21 +172,10 @@ #define H5T_CONV_INTERNAL_LDOUBLE_LLONG 1 #endif -/* Define an internal macro for converting floating numbers to unsigned long long. PGI compiler does - * roundup when the source fraction part is greater than 0.5. HP-UX compilers set the maximal number - * for unsigned long long as 0x7fffffffffffffff during conversion. */ -#if (H5_WANT_DATA_ACCURACY && H5_FP_TO_ULLONG_ACCURATE && defined(H5_FP_TO_ULLONG_RIGHT_MAXIMUM)) || \ - (!H5_WANT_DATA_ACCURACY) -#define H5T_CONV_INTERNAL_FP_ULLONG 1 -#else -#define H5T_CONV_INTERNAL_FP_ULLONG 0 -#endif - /* Define an internal macro for converting long double to unsigned long long. SGI compilers give some * incorrect conversions. Mac OS 10.4 gives incorrect conversions. HP-UX 11.00 compiler generates * floating exception. */ -#if (H5_WANT_DATA_ACCURACY && \ - H5_FP_TO_ULLONG_ACCURATE && defined(H5_FP_TO_ULLONG_RIGHT_MAXIMUM) && defined(H5_LDOUBLE_TO_LLONG_ACCURATE)) || \ +#if (H5_WANT_DATA_ACCURACY && defined(H5_LDOUBLE_TO_LLONG_ACCURATE)) || \ (!H5_WANT_DATA_ACCURACY) #define H5T_CONV_INTERNAL_LDOUBLE_ULLONG 1 #else diff --git a/src/H5config.h.in b/src/H5config.h.in index 7c2ebc0..3465fba 100644 --- a/src/H5config.h.in +++ b/src/H5config.h.in @@ -41,14 +41,6 @@ integer values. */ #undef FP_TO_INTEGER_OVERFLOW_WORKS -/* Define if your system roundup accurately converting floating-point to - unsigned long long values. */ -#undef FP_TO_ULLONG_ACCURATE - -/* Define if your system has right maximum convert floating-point to unsigned - long long values. */ -#undef FP_TO_ULLONG_RIGHT_MAXIMUM - /* Define to 1 if you have the `alarm' function. */ #undef HAVE_ALARM diff --git a/test/dt_arith.c b/test/dt_arith.c index 3a489d1..9c045d5 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -5268,26 +5268,8 @@ run_fp_int_conv(const char *name) nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_FLOAT, H5T_NATIVE_LLONG); nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_LLONG); } -#ifdef H5_FP_TO_ULLONG_RIGHT_MAXIMUM nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_FLOAT, H5T_NATIVE_ULLONG); nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_ULLONG); -#else /*H5_FP_TO_ULLONG_RIGHT_MAXIMUM*/ - { - char str[256]; /*hello string */ - - HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", - name, "float", "unsigned long long"); - printf("%-70s", str); - SKIPPED(); - HDputs(" Test skipped due to hardware conversion error."); - - HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", - name, "double", "unsigned long long"); - printf("%-70s", str); - SKIPPED(); - HDputs(" Test skipped due to hardware conversion error."); - } -#endif /*H5_FP_TO_ULLONG_RIGHT_MAXIMUM*/ #endif #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE @@ -5352,9 +5334,9 @@ run_fp_int_conv(const char *name) #endif } #endif /*H5_LDOUBLE_TO_LLONG_ACCURATE*/ -#if defined(H5_FP_TO_ULLONG_RIGHT_MAXIMUM) && defined(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_FP_TO_ULLONG_RIGHT_MAXIMUM && H5_LDOUBLE_TO_LLONG_ACCURATE*/ +#else /*H5_LDOUBLE_TO_LLONG_ACCURATE*/ { char str[256]; /*string */ @@ -5368,7 +5350,7 @@ run_fp_int_conv(const char *name) HDputs(" Test skipped due to disabled long double."); #endif } -#endif /*H5_FP_TO_ULLONG_RIGHT_MAXIMUM && H5_LDOUBLE_TO_LLONG_ACCURATE*/ +#endif /*H5_LDOUBLE_TO_LLONG_ACCURATE*/ #endif #endif #ifndef H5_VMS -- cgit v0.12