1 /* $NetBSD: fpsetsticky.c,v 1.2 1998/01/09 03:15:19 perry Exp $ */ 2 3 /* 4 * Written by J.T. Conklin, Apr 10, 1995 5 * Public domain. 6 */ 7 8 #include <ieeefp.h> 9 10 fp_except 11 fpsetsticky(sticky) 12 fp_except sticky; 13 { 14 fp_except old; 15 fp_except new; 16 17 __asm__("st %%fsr,%0" : "=m" (*&old)); 18 19 new = old; 20 new &= ~(0x1f << 5); 21 new |= ((sticky & 0x1f) << 5); 22 23 __asm__("ld %0,%%fsr" : : "m" (*&new)); 24 25 return (old >> 5) & 0x1f; 26 } 27