diff options
author | tmm <tmm@FreeBSD.org> | 2002-09-14 18:07:03 +0000 |
---|---|---|
committer | tmm <tmm@FreeBSD.org> | 2002-09-14 18:07:03 +0000 |
commit | c14b63a0b916969d4bd1cdaa0e58a7761edeab74 (patch) | |
tree | 15bf1e55a2a5f790a660810ee03a4e6ca0c94757 /lib/libc/sparc64 | |
parent | 6bea77d590307633b95e834cc12e81d7c2dfbb86 (diff) | |
download | FreeBSD-src-c14b63a0b916969d4bd1cdaa0e58a7761edeab74.zip FreeBSD-src-c14b63a0b916969d4bd1cdaa0e58a7761edeab74.tar.gz |
Use the macros from machine/fsr.h; some minor cleanups.
Diffstat (limited to 'lib/libc/sparc64')
-rw-r--r-- | lib/libc/sparc64/gen/fpsetmask.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/libc/sparc64/gen/fpsetmask.c b/lib/libc/sparc64/gen/fpsetmask.c index a1ef3be..9aefb13 100644 --- a/lib/libc/sparc64/gen/fpsetmask.c +++ b/lib/libc/sparc64/gen/fpsetmask.c @@ -6,6 +6,7 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); +#include <machine/fsr.h> #include <ieeefp.h> fp_except_t @@ -15,13 +16,13 @@ fpsetmask(mask) fp_except_t old; fp_except_t new; - __asm__("st %%fsr,%0" : "=m" (*&old)); + __asm__("st %%fsr,%0" : "=m" (old)); new = old; - new &= ~(0x1f << 23); - new |= ((mask & 0x1f) << 23); + new &= ~FSR_TEM_MASK; + new |= FSR_TEM(mask & FSR_EXC_MASK); - __asm__("ld %0,%%fsr" : : "m" (*&new)); + __asm__("ld %0,%%fsr" : : "m" (new)); - return (old >> 23) & 0x1f; + return (FSR_GET_TEM(old)); } |