6 _DEFUN_VOID(fpgetround
)
9 ieee_flags("get", "direction","", &out
);
10 if (strcmp(out
,"nearest") == 0) return FP_RN
;
11 if (strcmp(out
,"negative") == 0) return FP_RM
;
12 if (strcmp(out
,"positive") == 0) return FP_RP
;
13 if (strcmp(out
,"tozero") == 0) return FP_RZ
;
19 _DEFUN(fpsetround
,(new),
22 fp_rnd old
= fpgetround();
28 ieee_flags("set", "direction", "nearest", &dummy
);
31 ieee_flags("set", "direction", "negative", &dummy
);
34 ieee_flags("set", "direction", "positive", &dummy
);
37 ieee_flags("set", "direction", "tozero", &dummy
);
47 _DEFUN_VOID(fpgetmask
)
52 int i
= ieee_flags("get","exception","",&out
);
53 if (i
& 1) r
|= FP_X_IMP
;
54 if (i
& 2) r
|= FP_X_DX
;
55 if (i
& 4) r
|= FP_X_UFL
;
56 if (i
& 8) r
|= FP_X_OFL
;
57 if (i
& 16) r
|= FP_X_INV
;
63 _DEFUN(fpsetmask
,(mask
),
66 fp_except old
= fpgetmask();
69 ieee_flags("clear","exception", "all", &out
);
73 ieee_flags("set","exception","inexact", &out
);
75 ieee_flags("set","exception","division", &out
);
77 ieee_flags("set","exception","underflow", &out
);
79 ieee_flags("set","exception","overflow", &out
);
81 ieee_flags("set","exception","invalid", &out
);
88 _DEFUN(fpsetsticky
,(mask
),
91 return fpsetmask(mask
);
95 _DEFUN_VOID(fpgetsticky
)
101 _DEFUN(fpsetroundtoi
,(rdi_mode
),
110 _DEFUN_VOID(fpgetroundtoi
)