summaryrefslogtreecommitdiffstats
path: root/src/H5Tpkg.h
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2005-08-29 15:21:58 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2005-08-29 15:21:58 (GMT)
commitbd4312d0497592a665a25415ec2f9d3db9d9f6b2 (patch)
tree4c9e7590f44a1382ed651756835391245103efa6 /src/H5Tpkg.h
parent636b5829a9c5c8908f4eefa71f7b653f4f1697ea (diff)
downloadhdf5-bd4312d0497592a665a25415ec2f9d3db9d9f6b2.zip
hdf5-bd4312d0497592a665a25415ec2f9d3db9d9f6b2.tar.gz
hdf5-bd4312d0497592a665a25415ec2f9d3db9d9f6b2.tar.bz2
[svn-r11311] Purpose: New features.
Description: Added 2 new configure options, --enable-exception and --enable-accuracy. --enable-exception lets the library check whether user's exception handling functions are present during compiler data conversions and use them if they are. When it's disabled, this step is skipped to improve conversion speed. This step isn't implemented yet for soft conversions because there would be little gain in speed. --enable-accuracy guarantees data accuracy during data conversions. It means the library will choose compiler conversions only if the accurate data is secured. Otherwise, the library will go for the library's own conversions. If this option is disabled, the library uses compiler conversions in favor of their speed as long as they work even if data can be incorrect. Platforms tested: h5committest and fuss. Some systems may fail after this checkin.
Diffstat (limited to 'src/H5Tpkg.h')
-rw-r--r--src/H5Tpkg.h96
1 files changed, 96 insertions, 0 deletions
diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h
index 6854bc2..1f406e8 100644
--- a/src/H5Tpkg.h
+++ b/src/H5Tpkg.h
@@ -64,6 +64,102 @@
/* Macro to ease detecting atomic datatypes */
#define H5T_IS_ATOMIC(dt) (!(H5T_IS_COMPLEX((dt)->type) || (dt)->type==H5T_OPAQUE))
+
+/* Define an interim macro for converting between floating number(float and double) and floating number.
+ * All Cray compilers don't support denormalized floating values generating exception(?). */
+#if H5_CONVERT_DENORMAL_FLOAT
+#define FP_FP 1
+#endif /*H5_CONVERT_DENORMAL_FLOAT*/
+
+/* Define an interim macro for converting between floating number(float and double) and long double.
+ * All Cray compilers don't support denormalized floating values generating exception(?). NEC doesn't
+ * support long double. */
+#if H5_SIZEOF_LONG_DOUBLE && H5_CONVERT_DENORMAL_FLOAT
+#define FP_LDOUBLE 1
+#endif /*H5_SIZEOF_LONG_DOUBLE && H5_CONVERT_DENORMAL_FLOAT*/
+
+/* Define an interim macro for converting all integers to long double. SGI compilers give some
+ * incorrect conversions. */
+#if (H5_WANT_DATA_ACCURACY && H5_INTEGER_TO_LDOUBLE_ACCURATE) || (!H5_WANT_DATA_ACCURACY)
+#define INTEGER_LDOUBLE 1
+#endif
+
+/* Define an interim macro for converting unsigned (long) long to floating numbers.
+ * 64-bit Solaris does different rounding. */
+#if (H5_WANT_DATA_ACCURACY && H5_ULONG_TO_FP_BOTTOM_BIT_ACCURATE) || (!H5_WANT_DATA_ACCURACY)
+#define ULONG_FP 1
+#endif
+
+/* Define an interim macro for converting unsigned long to long double. SGI compilers give some
+ * incorrect conversions. 64-bit Solaris does different rounding. */
+#if (H5_WANT_DATA_ACCURACY && H5_INTEGER_TO_LDOUBLE_ACCURATE && H5_ULONG_TO_FP_BOTTOM_BIT_ACCURATE) || \
+ (!H5_WANT_DATA_ACCURACY)
+#define ULONG_LDOUBLE 1
+#endif
+
+/* Define an interim 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_ULONG_TO_FP_BOTTOM_BIT_ACCURATE) || \
+ (!H5_WANT_DATA_ACCURACY && H5_ULLONG_TO_FP_CAST_WORKS)
+#define ULLONG_FP 1
+#endif
+
+/* Define an interim 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. */
+#if (H5_WANT_DATA_ACCURACY && H5_ULLONG_TO_FP_CAST_WORKS && H5_ULONG_TO_FP_BOTTOM_BIT_ACCURATE && \
+ H5_ULLONG_TO_LDOUBLE_PRECISION) || (!H5_WANT_DATA_ACCURACY && H5_ULLONG_TO_FP_CAST_WORKS)
+#define ULLONG_LDOUBLE 1
+#endif
+
+/* Define an interim macro for converting long double to all integers. SGI compilers give some incorrect
+ * conversions. HP-UX 11.00 compiler generates floating exception. */
+#if (H5_WANT_DATA_ACCURACY && H5_LDOUBLE_TO_INTEGER_ACCURATE && H5_LDOUBLE_TO_INTEGER_WORKS) || \
+ (!H5_WANT_DATA_ACCURACY && H5_LDOUBLE_TO_INTEGER_WORKS)
+#define LDOUBLE_INTEGER 1
+#endif
+
+/* Define an interim macro for converting long double to unsigned int. SGI compilers give some incorrect
+ * conversions. HP-UX 11.00 compiler generates floating exception. Some Intel compilers on some Linux
+ * give incorrect values. */
+#if (H5_WANT_DATA_ACCURACY && H5_LDOUBLE_TO_INTEGER_ACCURATE && H5_LDOUBLE_TO_UINT_ACCURATE && \
+ H5_LDOUBLE_TO_INTEGER_WORKS) || (!H5_WANT_DATA_ACCURACY && H5_LDOUBLE_TO_INTEGER_WORKS)
+#define LDOUBLE_UINT 1
+#endif
+
+/* Define an interim macro for converting floating numbers to long long. The hard conversion on Windows
+ * .NET 2003 has a bug and gives wrong exception value. */
+#if (H5_WANT_DATA_ACCURACY && !H5_HW_FP_TO_LLONG_NOT_WORKS) || (!H5_WANT_DATA_ACCURACY)
+#define FP_LLONG 1
+#endif
+
+/* Define an interim macro for converting long double to long long. SGI compilers give some 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 && !H5_HW_FP_TO_LLONG_NOT_WORKS && H5_LDOUBLE_TO_INTEGER_ACCURATE && \
+ H5_LDOUBLE_TO_INTEGER_WORKS) || \
+ (!H5_WANT_DATA_ACCURACY && !H5_HW_FP_TO_LLONG_NOT_WORKS && H5_LDOUBLE_TO_INTEGER_WORKS)
+#define LDOUBLE_LLONG 1
+#endif
+
+/* Define an interim 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 && H5_FP_TO_ULLONG_RIGHT_MAXIMUM) || \
+ (!H5_WANT_DATA_ACCURACY)
+#define FP_ULLONG 1
+#endif
+
+/* Define an interim macro for converting long double to all integers. SGI compilers give some incorrect
+ * conversions. HP-UX 11.00 compiler generates floating exception. */
+#if (H5_WANT_DATA_ACCURACY && H5_LDOUBLE_TO_INTEGER_ACCURATE && H5_LDOUBLE_TO_INTEGER_WORKS && \
+ H5_FP_TO_ULLONG_ACCURATE && H5_FP_TO_ULLONG_RIGHT_MAXIMUM) || \
+ (!H5_WANT_DATA_ACCURACY && H5_LDOUBLE_TO_INTEGER_WORKS)
+#define LDOUBLE_ULLONG 1
+#endif
+
/* Statistics about a conversion function */
struct H5T_stats_t {
unsigned ncalls; /*num calls to conversion function */