4 #include <stddef.h> /* size_t */
5 #include <stdio.h> /* printf */
8 typedef double reg_d64
;
9 typedef long double reg_d128
;
10 typedef union { unsigned int i
; reg_d32 f
; } pun_d32
;
11 typedef union { unsigned long i
; reg_d64 f
; } pun_d64
;
12 typedef union { unsigned long i
[2]; reg_d128 f
; } pun_d128
;
14 #define DFP_VAL_PRINT(op, type) \
16 enum { n = sizeof(type) }; \
17 union { type x; unsigned char i[n]; } u = { .x = op }; \
18 for (int k = 0; k < n; k++) \
19 printf("%02x", u.i[k]); \
22 #endif /* DFP_UTILS_H */