Bug 497723 - forgot to restore callgrind output cleanup
[valgrind.git] / none / tests / s390x / dfp_utils.h
blobb12fef7eb7f7ca69f8516c9dc684608f6bfe7c4d
1 #ifndef DFP_UTILS_H
2 #define DFP_UTILS_H
4 #include <stddef.h> /* size_t */
5 #include <stdio.h> /* printf */
7 typedef float reg_d32;
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) \
15 { \
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 */