diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/H5T.c | 8 | ||||
-rw-r--r-- | src/H5Tconv.c | 8 | ||||
-rw-r--r-- | src/H5Tpkg.h | 31 |
3 files changed, 47 insertions, 0 deletions
@@ -1276,16 +1276,20 @@ H5T_init(void) H5T__register_int(H5T_PERS_HARD, "llong_flt", native_llong, native_float, H5T__conv_llong_float); status |= H5T__register_int(H5T_PERS_HARD, "llong_dbl", native_llong, native_double, H5T__conv_llong_double); +#ifdef H5T_CONV_INTERNAL_LLONG_LDOUBLE status |= H5T__register_int(H5T_PERS_HARD, "llong_ldbl", native_llong, native_ldouble, H5T__conv_llong_ldouble); +#endif /* H5T_CONV_INTERNAL_LLONG_LDOUBLE */ /* From unsigned long long to floats */ status |= H5T__register_int(H5T_PERS_HARD, "ullong_flt", native_ullong, native_float, H5T__conv_ullong_float); status |= H5T__register_int(H5T_PERS_HARD, "ullong_dbl", native_ullong, native_double, H5T__conv_ullong_double); +#ifdef H5T_CONV_INTERNAL_ULLONG_LDOUBLE status |= H5T__register_int(H5T_PERS_HARD, "ullong_ldbl", native_ullong, native_ldouble, H5T__conv_ullong_ldouble); +#endif /* H5T_CONV_INTERNAL_ULLONG_LDOUBLE */ /* From floats to char */ status |= @@ -1349,16 +1353,20 @@ H5T_init(void) H5T__register_int(H5T_PERS_HARD, "flt_llong", native_float, native_llong, H5T__conv_float_llong); status |= H5T__register_int(H5T_PERS_HARD, "dbl_llong", native_double, native_llong, H5T__conv_double_llong); +#ifdef H5T_CONV_INTERNAL_LDOUBLE_LLONG status |= H5T__register_int(H5T_PERS_HARD, "ldbl_llong", native_ldouble, native_llong, H5T__conv_ldouble_llong); +#endif /* H5T_CONV_INTERNAL_LDOUBLE_LLONG */ /* From floats to unsigned long long */ status |= H5T__register_int(H5T_PERS_HARD, "flt_ullong", native_float, native_ullong, H5T__conv_float_ullong); status |= H5T__register_int(H5T_PERS_HARD, "dbl_ullong", native_double, native_ullong, H5T__conv_double_ullong); +#if H5T_CONV_INTERNAL_LDOUBLE_ULLONG status |= H5T__register_int(H5T_PERS_HARD, "ldbl_ullong", native_ldouble, native_ullong, H5T__conv_ldouble_ullong); +#endif /* H5T_CONV_INTERNAL_LDOUBLE_ULLONG */ /* * The special no-op conversion is the fastest, so we list it last. The diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 55725b3..8118eb0 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -7656,12 +7656,14 @@ H5T__conv_llong_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne * *------------------------------------------------------------------------- */ +#ifdef H5T_CONV_INTERNAL_LLONG_LDOUBLE herr_t H5T__conv_llong_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(LLONG, LDOUBLE, long long, long double, -, -); } +#endif /* H5T_CONV_INTERNAL_LLONG_LDOUBLE */ /*------------------------------------------------------------------------- * Function: H5T__conv_ullong_float @@ -7716,12 +7718,14 @@ H5T__conv_ullong_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t n * *------------------------------------------------------------------------- */ +#ifdef H5T_CONV_INTERNAL_ULLONG_LDOUBLE herr_t H5T__conv_ullong_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(ULLONG, LDOUBLE, unsigned long long, long double, -, -); } +#endif /*H5T_CONV_INTERNAL_ULLONG_LDOUBLE*/ /*------------------------------------------------------------------------- * Function: H5T__conv_float_schar @@ -8352,6 +8356,7 @@ H5T__conv_double_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t n * *------------------------------------------------------------------------- */ +#ifdef H5T_CONV_INTERNAL_LDOUBLE_LLONG herr_t H5T__conv_ldouble_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) @@ -8360,6 +8365,7 @@ H5T__conv_ldouble_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t n H5T_CONV_Fx(LDOUBLE, LLONG, long double, long long, LLONG_MIN, LLONG_MAX); H5_GCC_CLANG_DIAG_ON("float-equal") } +#endif /*H5T_CONV_INTERNAL_LDOUBLE_LLONG*/ /*------------------------------------------------------------------------- * Function: H5T__conv_ldouble_ullong @@ -8374,6 +8380,7 @@ H5T__conv_ldouble_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t n * *------------------------------------------------------------------------- */ +#ifdef H5T_CONV_INTERNAL_LDOUBLE_ULLONG herr_t H5T__conv_ldouble_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) @@ -8382,6 +8389,7 @@ H5T__conv_ldouble_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t H5T_CONV_Fx(LDOUBLE, ULLONG, long double, unsigned long long, 0, ULLONG_MAX); H5_GCC_CLANG_DIAG_ON("float-equal") } +#endif /*H5T_CONV_INTERNAL_LDOUBLE_ULLONG*/ /*------------------------------------------------------------------------- * Function: H5T__conv_f_i diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h index df16413..23fa960 100644 --- a/src/H5Tpkg.h +++ b/src/H5Tpkg.h @@ -112,6 +112,37 @@ /* (_not_ setting H5T_VISIT_SIMPLE and setting either H5T_VISIT_COMPLEX_FIRST or H5T_VISIT_COMPLEX_LAST will * mean visiting all nodes _except_ "simple" "leafs" in the "tree" */ +/* Define an internal macro for converting long long to long double. Mac OS 10.4 gives some + * incorrect conversions. */ +#if (H5_WANT_DATA_ACCURACY && defined(H5_LLONG_TO_LDOUBLE_CORRECT)) || (!H5_WANT_DATA_ACCURACY) +#define H5T_CONV_INTERNAL_LLONG_LDOUBLE 1 +#endif + +/* Define an internal macro for converting unsigned long long to long double. SGI compilers give + * some incorrect 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 && defined(H5_LLONG_TO_LDOUBLE_CORRECT)) || (!H5_WANT_DATA_ACCURACY) +#define H5T_CONV_INTERNAL_ULLONG_LDOUBLE 1 +#endif + +/* Define an internal macro for converting long double to long long. SGI compilers give some incorrect + * conversions. Mac OS 10.4 gives incorrect conversions. HP-UX 11.00 compiler generates floating exception. + * The hard conversion on Windows .NET 2003 has a bug and gives wrong exception value. */ +#if (H5_WANT_DATA_ACCURACY && defined(H5_LDOUBLE_TO_LLONG_ACCURATE)) || (!H5_WANT_DATA_ACCURACY) +#define H5T_CONV_INTERNAL_LDOUBLE_LLONG 1 +#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 && defined(H5_LDOUBLE_TO_LLONG_ACCURATE)) || (!H5_WANT_DATA_ACCURACY) +#define H5T_CONV_INTERNAL_LDOUBLE_ULLONG 1 +#else +#define H5T_CONV_INTERNAL_LDOUBLE_ULLONG 0 +#endif + /* Statistics about a conversion function */ struct H5T_stats_t { unsigned ncalls; /*num calls to conversion function */ |