fixed more binutils issues (newer gcc/libc)
[zpugcc/jano.git] / toolchain / gcc / newlib / libc / sys / sysvi386 / fpx.c
blobd55a1e30ff4f24d1875a221caf98f94a446375a5
1 #include <ieeefp.h>
2 #include <machine/registers.h>
5 fp_except _DEFUN(fpsetmask,(newmask),
6 fp_except newmask)
9 fp_except oldmask;
10 v60_tkcw_type tkcw;
12 sysv60(0, 8, &tkcw);
13 oldmask = tkcw.fp_trap;
14 tkcw.fp_trap = newmask;
15 sysv60(0, 8, &tkcw);
16 return oldmask;
20 fp_except _DEFUN_VOID(fpgetmask)
22 v60_tkcw_type tkcw;
23 sysv60(0, 8, &tkcw);
24 return tkcw.fp_trap;
28 fp_rnd _DEFUN_VOID(fpgetround)
30 v60_tkcw_type tkcw;
31 sysv60(0, 8, &tkcw);
32 return tkcw.fp_rounding;
35 fp_rnd _DEFUN(fpsetround,(rnd),
36 fp_rnd rnd)
38 fp_rnd oldrnd;
39 v60_tkcw_type tkcw;
41 sysv60(0, 8, &tkcw);
42 oldrnd = tkcw.fp_rounding;
43 tkcw.fp_rounding = rnd;
44 sysv60(0, 8, &tkcw);
45 return oldrnd;
52 fp_rdi _DEFUN_VOID(fpgetroundtoi)
54 v60_tkcw_type tkcw;
55 sysv60(0, 8, &tkcw);
56 return tkcw.integer_rounding;
59 fp_rdi _DEFUN(fpsetroundtoi,(rnd),
60 fp_rdi rnd)
62 fp_rdi oldrnd;
63 v60_tkcw_type tkcw;
65 sysv60(0, 8, &tkcw);
66 oldrnd = tkcw.integer_rounding;
67 tkcw.integer_rounding = rnd;
68 sysv60(0, 8, &tkcw);
69 return oldrnd;