diff options
author | Raymond Lu <songyulu@hdfgroup.org> | 2005-02-25 20:26:32 (GMT) |
---|---|---|
committer | Raymond Lu <songyulu@hdfgroup.org> | 2005-02-25 20:26:32 (GMT) |
commit | 82ae8ac4e0ec0929e432c99361e68f5f60cb5553 (patch) | |
tree | 8efddab33d3eed5be9d584e70f55f8dddacfb1f2 /src/H5Tconv.c | |
parent | cffc51b94c8536e89cab61e68b6122a0e186524a (diff) | |
download | hdf5-82ae8ac4e0ec0929e432c99361e68f5f60cb5553.zip hdf5-82ae8ac4e0ec0929e432c99361e68f5f60cb5553.tar.gz hdf5-82ae8ac4e0ec0929e432c99361e68f5f60cb5553.tar.bz2 |
[svn-r10087] Purpose: New feature and test
Description: Somehow, the hardware conversions between "long double" and other native floating-point
types were left out.
Solution: Added the hardware conversion functions in H5Tconv.c and test cases in dtypes.c.
Platforms tested: h5committest and fuss.
Misc. update: updated MANIFEST to replace bin/reconfigure.sh with bin/reconfigure
Diffstat (limited to 'src/H5Tconv.c')
-rw-r--r-- | src/H5Tconv.c | 130 |
1 files changed, 128 insertions, 2 deletions
diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 156287e..891d6f8 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -6984,6 +6984,38 @@ done: /*------------------------------------------------------------------------- + * Function: H5T_conv_float_ldouble + * + * Purpose: Convert native `float' to native `long double' using hardware. + * This is a fast special case. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Raymond Lu + * Friday, Feb 25, 2005 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +herr_t +H5T_conv_float_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, + size_t nelmts, size_t buf_stride, + size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, + hid_t UNUSED dxpl_id) +{ + herr_t ret_value=SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(H5T_conv_float_ldouble, FAIL); + + H5T_CONV_fF(FLOAT, LDOUBLE, float, long double, -, -); + +done: + FUNC_LEAVE_NOAPI(ret_value); +} + + +/*------------------------------------------------------------------------- * Function: H5T_conv_double_float * * Purpose: Convert native `double' to native `float' using hardware. @@ -7023,6 +7055,102 @@ done: /*------------------------------------------------------------------------- + * Function: H5T_conv_double_ldouble + * + * Purpose: Convert native `double' to native `long double' using hardware. + * This is a fast special case. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Raymond Lu + * Friday, Feb 25, 2005 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +herr_t +H5T_conv_double_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, + size_t nelmts, size_t buf_stride, + size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, + hid_t UNUSED dxpl_id) +{ + herr_t ret_value=SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(H5T_conv_double_ldouble, FAIL); + + H5T_CONV_fF(DOUBLE, LDOUBLE, double, long double, -, -); + +done: + FUNC_LEAVE_NOAPI(ret_value); +} + + +/*------------------------------------------------------------------------- + * Function: H5T_conv_ldouble_float + * + * Purpose: Convert native `long double' to native `float' using hardware. + * This is a fast special case. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Raymond Lu + * Friday, Feb 25, 2005 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +herr_t +H5T_conv_ldouble_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, + size_t nelmts, size_t buf_stride, + size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, + hid_t UNUSED dxpl_id) +{ + herr_t ret_value=SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(H5T_conv_ldouble_float, FAIL); + + H5T_CONV_Ff(LDOUBLE, FLOAT, long double, float, -FLT_MAX, FLT_MAX); + +done: + FUNC_LEAVE_NOAPI(ret_value); +} + + +/*------------------------------------------------------------------------- + * Function: H5T_conv_ldouble_double + * + * Purpose: Convert native `long double' to native `double' using hardware. + * This is a fast special case. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Raymond Lu + * Friday, Feb 25, 2005 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +herr_t +H5T_conv_ldouble_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, + size_t nelmts, size_t buf_stride, + size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, + hid_t UNUSED dxpl_id) +{ + herr_t ret_value=SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(H5T_conv_ldouble_double, FAIL); + + H5T_CONV_Ff(LDOUBLE, DOUBLE, long double, double, -DBL_MAX, DBL_MAX); + +done: + FUNC_LEAVE_NOAPI(ret_value); +} + + +/*------------------------------------------------------------------------- * Function: H5T_conv_schar_float * * Purpose: Convert native signed char to native float using hardware. @@ -7886,7 +8014,6 @@ done: } -#ifdef H5_ULLONG_TO_FP_CAST_WORKS /*------------------------------------------------------------------------- * Function: H5T_conv_ullong_float * @@ -7981,7 +8108,6 @@ H5T_conv_ullong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, done: FUNC_LEAVE_NOAPI(ret_value); } -#endif /* H5_ULLONG_TO_FP_CAST_WORKS */ /*------------------------------------------------------------------------- |