2002-03-05 04:03:57 +00:00
|
|
|
/*
|
|
|
|
* Written by J.T. Conklin, Apr 10, 1995
|
|
|
|
* Public domain.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <sys/cdefs.h>
|
|
|
|
__FBSDID("$FreeBSD$");
|
|
|
|
|
2002-09-14 18:07:03 +00:00
|
|
|
#include <machine/fsr.h>
|
2002-03-05 04:03:57 +00:00
|
|
|
#include <ieeefp.h>
|
|
|
|
|
|
|
|
fp_except_t
|
|
|
|
fpsetmask(mask)
|
|
|
|
fp_except_t mask;
|
|
|
|
{
|
|
|
|
fp_except_t old;
|
|
|
|
fp_except_t new;
|
|
|
|
|
2002-09-14 18:07:03 +00:00
|
|
|
__asm__("st %%fsr,%0" : "=m" (old));
|
2002-03-05 04:03:57 +00:00
|
|
|
|
|
|
|
new = old;
|
2002-09-14 18:07:03 +00:00
|
|
|
new &= ~FSR_TEM_MASK;
|
|
|
|
new |= FSR_TEM(mask & FSR_EXC_MASK);
|
2002-03-05 04:03:57 +00:00
|
|
|
|
2002-09-14 18:07:03 +00:00
|
|
|
__asm__("ld %0,%%fsr" : : "m" (new));
|
2002-03-05 04:03:57 +00:00
|
|
|
|
2002-09-14 18:07:03 +00:00
|
|
|
return (FSR_GET_TEM(old));
|
2002-03-05 04:03:57 +00:00
|
|
|
}
|