Expand PMF_FN_* macros.
[netbsd-mini2440.git] / sys / arch / pmax / test / fp2.c
blob7f2aa34e859d38fae8e7fa996b0d6f6f1d17c424
1 #include <stdio.h>
2 #include <ctype.h>
3 #include <math.h>
5 int lineno;
7 union {
8 unsigned w[2];
9 double d;
10 } uda, udb, udc;
13 * Read test vectors from file and test the fp emulation by
14 * comparing it with the hardware.
16 main(argc, argv)
17 int argc;
18 char **argv;
20 register char *cp;
21 register int c;
22 char buf[10];
23 unsigned arg[4];
25 for (lineno = 1; ; lineno++) {
26 c = scanf("%x %x %x %x", &arg[1], &arg[0], &arg[3], &arg[2]);
27 if (c < 0)
28 break;
29 if (c != 4) {
30 fprintf(stderr, "line %d: expected 4 args\n",
31 lineno);
32 goto skip;
35 uda.w[0] = arg[0];
36 uda.w[1] = arg[1];
37 udb.w[0] = arg[2];
38 udb.w[1] = arg[3];
39 udc.d = copysign(uda.d, udb.d);
41 printf("line %d: copysign(%x,%x %x,%x) = %x,%x\n",
42 lineno,
43 uda.w[1], uda.w[0],
44 udb.w[1], udb.w[0],
45 udc.w[1], udc.w[0]);
46 skip:
47 while ((c = getchar()) != EOF && c != '\n')
52 trapsignal(p, sig, code)
53 int p, sig, code;
55 printf("line %d: signal(%d, %x)\n", lineno, sig, code);