diff options
author | Jordan Henderson <jhenderson@hdfgroup.org> | 2024-02-06 01:15:03 (GMT) |
---|---|---|
committer | Jordan Henderson <jhenderson@hdfgroup.org> | 2024-02-29 23:14:15 (GMT) |
commit | a793f30e2c5885d92d31484dc3d7319374c4d58b (patch) | |
tree | ccf9b1c89063726daaf501f5ee3ffbb1bf1da6d6 /tools/src/h5ls | |
parent | 662ee679e0198efc984c778b86db470366706e2a (diff) | |
download | hdf5-a793f30e2c5885d92d31484dc3d7319374c4d58b.zip hdf5-a793f30e2c5885d92d31484dc3d7319374c4d58b.tar.gz hdf5-a793f30e2c5885d92d31484dc3d7319374c4d58b.tar.bz2 |
Add support for _Float16 16-bit floating point type
Diffstat (limited to 'tools/src/h5ls')
-rw-r--r-- | tools/src/h5ls/h5ls.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c index 04c5ff3..bc0781c 100644 --- a/tools/src/h5ls/h5ls.c +++ b/tools/src/h5ls/h5ls.c @@ -427,6 +427,11 @@ print_native_type(h5tools_str_t *buffer, hid_t type, int ind) else if (H5Tequal(type, H5T_NATIVE_ULLONG) == true) { h5tools_str_append(buffer, "native unsigned long long"); } +#ifdef H5_HAVE__FLOAT16 + else if (H5Tequal(type, H5T_NATIVE_FLOAT16) == true) { + h5tools_str_append(buffer, "native _Float16"); + } +#endif else if (H5Tequal(type, H5T_NATIVE_FLOAT) == true) { h5tools_str_append(buffer, "native float"); } @@ -551,7 +556,13 @@ print_native_type(h5tools_str_t *buffer, hid_t type, int ind) static bool print_ieee_type(h5tools_str_t *buffer, hid_t type, int ind) { - if (H5Tequal(type, H5T_IEEE_F32BE) == true) { + if (H5Tequal(type, H5T_IEEE_F16BE) == true) { + h5tools_str_append(buffer, "IEEE 16-bit big-endian float"); + } + else if (H5Tequal(type, H5T_IEEE_F16LE) == true) { + h5tools_str_append(buffer, "IEEE 16-bit little-endian float"); + } + else if (H5Tequal(type, H5T_IEEE_F32BE) == true) { h5tools_str_append(buffer, "IEEE 32-bit big-endian float"); } else if (H5Tequal(type, H5T_IEEE_F32LE) == true) { |