diff options
author | dfr <dfr@FreeBSD.org> | 1998-12-23 11:50:52 +0000 |
---|---|---|
committer | dfr <dfr@FreeBSD.org> | 1998-12-23 11:50:52 +0000 |
commit | 0d57a81a8be9e9b63084d2b57eaadc0e1d57f2b7 (patch) | |
tree | 1138e6074d535cddfb8dae7e5fd33e3a8508ef1b /lib/libc/alpha/gen/fpgetround.c | |
parent | cb8b246a394601b9e5228fd27edfb6682da216ab (diff) | |
download | FreeBSD-src-0d57a81a8be9e9b63084d2b57eaadc0e1d57f2b7.zip FreeBSD-src-0d57a81a8be9e9b63084d2b57eaadc0e1d57f2b7.tar.gz |
Implement fpsetmask() and other fp*() functions. Programs should use
#include <ieeefp.h>
to access these functions instead of the i386 specific
#include <machine/floatingpoint.h>
Submitted by: Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
Diffstat (limited to 'lib/libc/alpha/gen/fpgetround.c')
-rw-r--r-- | lib/libc/alpha/gen/fpgetround.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/libc/alpha/gen/fpgetround.c b/lib/libc/alpha/gen/fpgetround.c index 39b9b47..46976c2 100644 --- a/lib/libc/alpha/gen/fpgetround.c +++ b/lib/libc/alpha/gen/fpgetround.c @@ -33,6 +33,7 @@ #include <sys/types.h> #include <ieeefp.h> +#include <machine/fpu.h> fp_rnd fpgetround() @@ -40,10 +41,8 @@ fpgetround() double fpcrval; u_int64_t old; - __asm__("trapb"); - __asm__("mf_fpcr %0" : "=f" (fpcrval)); - __asm__("trapb"); + GET_FPCR(fpcrval); old = *(u_int64_t *)&fpcrval; - return ((old >> 58) & 0x3); + return ((old & FPCR_DYN_MASK) >> FPCR_DYN_SHIFT); } |