Sync usage with man page.
[netbsd-mini2440.git] / sys / arch / pmax / test / fp6.c
blob5f1e91a1557fe294cbbea042fd22cac50fd12809
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 %d", &arg[1], &arg[0], &arg[2]);
27 if (c < 0)
28 break;
29 if (c != 3) {
30 fprintf(stderr, "line %d: expected 3 args\n",
31 lineno);
32 goto skip;
35 uda.w[0] = arg[0];
36 uda.w[1] = arg[1];
37 udc.d = scalb(uda.d, arg[2]);
39 printf("line %d: scalb(%x,%x,%d) = %x,%x\n",
40 lineno, uda.w[1], uda.w[0], arg[2],
41 udc.w[1], udc.w[0]);
42 skip:
43 while ((c = getchar()) != EOF && c != '\n')
48 trapsignal(p, sig, code)
49 int p, sig, code;
51 printf("line %d: signal(%d, %x)\n", lineno, sig, code);