FreeBSD: add file descriptor tracking for _umtx_op
[valgrind.git] / none / tests / s390x / dfp-4.c
blob53fda01da0bf3ba6bb4098223fd8c31b8021ed0a
1 #include "dfp_utils.h"
2 #include <stdio.h>
4 #define CONV(opc, from, to, val) \
5 { \
6 pun_d##to out; \
7 printf("%-11s : ", "D" #from " -> D" #to); \
8 DFP_VAL_PRINT(val, pun_d##from); \
9 asm(".insn rrf," opc "0000,%[r1],%[r2],0,0" \
10 : [r1] "=f"(out.f) \
11 : [r2] "f"(val.f)); \
12 printf(" -> "); \
13 DFP_VAL_PRINT(out, pun_d##to); \
14 putchar('\n'); \
17 static const pun_d64 dd_A = {0x22340000000c0004}; /* 60000.4DD */
18 static const pun_d32 df_B = {0x2df00002}; /* 3.000002DF */
20 /* 100000000.000028DL */
21 static const pun_d128 dl_C = {{0x2206800000000000, 0x0000800000000028}};
23 int main(void)
25 CONV("0xb3d4", 32, 64, df_B); /* LDETR (load lengthened) */
26 CONV("0xb3dc", 64, 128, dd_A); /* LXDTR (load lengthened) */
27 CONV("0xb3d5", 64, 32, dd_A); /* LEDTR (load rounded) */
28 CONV("0xb3dd", 128, 64, dl_C); /* LDXTR (load rounded) */
29 return 0;