summaryrefslogtreecommitdiffstats
path: root/src/H5T.c
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2006-03-14 22:11:21 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2006-03-14 22:11:21 (GMT)
commita2a98a8135c3efee38b04b1d07e4602cdff1f1ef (patch)
tree926dbec855974eb9e4d799b33e55719e5db717be /src/H5T.c
parenta4c816eb75c20de14a5e557ffd76c33190152ce2 (diff)
downloadhdf5-a2a98a8135c3efee38b04b1d07e4602cdff1f1ef.zip
hdf5-a2a98a8135c3efee38b04b1d07e4602cdff1f1ef.tar.gz
hdf5-a2a98a8135c3efee38b04b1d07e4602cdff1f1ef.tar.bz2
[svn-r12091] Purpose: Support for VAX floating-point types.
Solution: Support VAX float and double types with new byte order. There're some details not yet included, 1. the alignment detection for VAX order in H5detect.c. 2. support for special values in library conversion functions. 3. the infinity for VAX in H5T_init_inf. 4. support for VAX types in printing hexadecimal format. Platforms tested: h5committest and fuss.
Diffstat (limited to 'src/H5T.c')
-rw-r--r--src/H5T.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/H5T.c b/src/H5T.c
index a939d69..d3c745a 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -55,6 +55,9 @@ hid_t H5T_IEEE_F32LE_g = FAIL;
hid_t H5T_IEEE_F64BE_g = FAIL;
hid_t H5T_IEEE_F64LE_g = FAIL;
+hid_t H5T_VAX_F32_g = FAIL;
+hid_t H5T_VAX_F64_g = FAIL;
+
hid_t H5T_STD_I8BE_g = FAIL;
hid_t H5T_STD_I8LE_g = FAIL;
hid_t H5T_STD_I16BE_g = FAIL;
@@ -347,6 +350,32 @@ static H5T_t *H5T_decode(const unsigned char *buf);
H5T_INIT_TYPE_DOUBLE_COMMON(H5T_ORDER_BE) \
}
+/* Define the code templates for VAX float for the "GUTS" in the H5T_INIT_TYPE macro */
+#define H5T_INIT_TYPE_FLOATVAX_CORE { \
+ H5T_INIT_TYPE_NUM_COMMON(H5T_ORDER_VAX) \
+ dt->shared->u.atomic.u.f.sign = 31; \
+ dt->shared->u.atomic.u.f.epos = 23; \
+ dt->shared->u.atomic.u.f.esize = 8; \
+ dt->shared->u.atomic.u.f.ebias = 0x81; \
+ dt->shared->u.atomic.u.f.mpos = 0; \
+ dt->shared->u.atomic.u.f.msize = 23; \
+ dt->shared->u.atomic.u.f.norm = H5T_NORM_IMPLIED; \
+ dt->shared->u.atomic.u.f.pad = H5T_PAD_ZERO; \
+}
+
+/* Define the code templates for VAX double for the "GUTS" in the H5T_INIT_TYPE macro */
+#define H5T_INIT_TYPE_DOUBLEVAX_CORE { \
+ H5T_INIT_TYPE_NUM_COMMON(H5T_ORDER_VAX) \
+ dt->shared->u.atomic.u.f.sign = 63; \
+ dt->shared->u.atomic.u.f.epos = 52; \
+ dt->shared->u.atomic.u.f.esize = 11; \
+ dt->shared->u.atomic.u.f.ebias = 0x0401; \
+ dt->shared->u.atomic.u.f.mpos = 0; \
+ dt->shared->u.atomic.u.f.msize = 52; \
+ dt->shared->u.atomic.u.f.norm = H5T_NORM_IMPLIED; \
+ dt->shared->u.atomic.u.f.pad = H5T_PAD_ZERO; \
+}
+
/* Define the code templates for standard signed integers for the "GUTS" in the H5T_INIT_TYPE macro */
#define H5T_INIT_TYPE_SINT_COMMON(ENDIANNESS) { \
H5T_INIT_TYPE_NUM_COMMON(ENDIANNESS) \
@@ -808,6 +837,17 @@ H5T_init_interface(void)
H5T_INIT_TYPE(DOUBLEBE,H5T_IEEE_F64BE_g,COPY,native_double,SET,8)
/*------------------------------------------------------------
+ * VAX Types
+ *------------------------------------------------------------
+ */
+
+ /* VAX 4-byte float */
+ H5T_INIT_TYPE(FLOATVAX,H5T_VAX_F32_g,COPY,native_double,SET,4)
+
+ /* VAX 8-byte double */
+ H5T_INIT_TYPE(DOUBLEVAX,H5T_VAX_F64_g,COPY,native_double,SET,8)
+
+ /*------------------------------------------------------------
* Other "standard" types
*------------------------------------------------------------
*/