Last change
on this file since 577 was
444,
checked in by satin@…, 6 years ago
|
add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc
|
File size:
986 bytes
|
Rev | Line | |
---|
[444] | 1 | #include <ieeefp.h> |
---|
| 2 | #include <machine/registers.h> |
---|
| 3 | |
---|
| 4 | |
---|
| 5 | fp_except fpsetmask (fp_except newmask) |
---|
| 6 | |
---|
| 7 | { |
---|
| 8 | fp_except oldmask; |
---|
| 9 | v60_tkcw_type tkcw; |
---|
| 10 | |
---|
| 11 | sysv60(0, 8, &tkcw); |
---|
| 12 | oldmask = tkcw.fp_trap; |
---|
| 13 | tkcw.fp_trap = newmask; |
---|
| 14 | sysv60(0, 8, &tkcw); |
---|
| 15 | return oldmask; |
---|
| 16 | |
---|
| 17 | } |
---|
| 18 | |
---|
| 19 | fp_except fpgetmask (void) |
---|
| 20 | { |
---|
| 21 | v60_tkcw_type tkcw; |
---|
| 22 | sysv60(0, 8, &tkcw); |
---|
| 23 | return tkcw.fp_trap; |
---|
| 24 | } |
---|
| 25 | |
---|
| 26 | |
---|
| 27 | fp_rnd fpgetround (void) |
---|
| 28 | { |
---|
| 29 | v60_tkcw_type tkcw; |
---|
| 30 | sysv60(0, 8, &tkcw); |
---|
| 31 | return tkcw.fp_rounding; |
---|
| 32 | } |
---|
| 33 | |
---|
| 34 | fp_rnd fpsetround (fp_rnd rnd) |
---|
| 35 | { |
---|
| 36 | fp_rnd oldrnd; |
---|
| 37 | v60_tkcw_type tkcw; |
---|
| 38 | |
---|
| 39 | sysv60(0, 8, &tkcw); |
---|
| 40 | oldrnd = tkcw.fp_rounding; |
---|
| 41 | tkcw.fp_rounding = rnd; |
---|
| 42 | sysv60(0, 8, &tkcw); |
---|
| 43 | return oldrnd; |
---|
| 44 | } |
---|
| 45 | |
---|
| 46 | |
---|
| 47 | |
---|
| 48 | |
---|
| 49 | |
---|
| 50 | fp_rdi fpgetroundtoi (void) |
---|
| 51 | { |
---|
| 52 | v60_tkcw_type tkcw; |
---|
| 53 | sysv60(0, 8, &tkcw); |
---|
| 54 | return tkcw.integer_rounding; |
---|
| 55 | } |
---|
| 56 | |
---|
| 57 | fp_rdi fpsetroundtoi (fp_rdi rnd) |
---|
| 58 | { |
---|
| 59 | fp_rdi oldrnd; |
---|
| 60 | v60_tkcw_type tkcw; |
---|
| 61 | |
---|
| 62 | sysv60(0, 8, &tkcw); |
---|
| 63 | oldrnd = tkcw.integer_rounding; |
---|
| 64 | tkcw.integer_rounding = rnd; |
---|
| 65 | sysv60(0, 8, &tkcw); |
---|
| 66 | return oldrnd; |
---|
| 67 | } |
---|
| 68 | |
---|
| 69 | |
---|
| 70 | |
---|
Note: See
TracBrowser
for help on using the repository browser.