1 1.4 perry /* $NetBSD: fpgetsticky.c,v 1.4 2005/12/24 23:10:08 perry Exp $ */ 2 1.1 eeh 3 1.1 eeh /* 4 1.1 eeh * Written by J.T. Conklin, Apr 10, 1995 5 1.1 eeh * Public domain. 6 1.1 eeh */ 7 1.1 eeh 8 1.2 thorpej #include <sys/cdefs.h> 9 1.3 lukem #if defined(LIBC_SCCS) && !defined(lint) 10 1.4 perry __RCSID("$NetBSD: fpgetsticky.c,v 1.4 2005/12/24 23:10:08 perry Exp $"); 11 1.3 lukem #endif /* LIBC_SCCS and not lint */ 12 1.2 thorpej 13 1.2 thorpej #include "namespace.h" 14 1.2 thorpej 15 1.1 eeh #include <ieeefp.h> 16 1.2 thorpej 17 1.2 thorpej #ifdef __weak_alias 18 1.2 thorpej __weak_alias(fpgetsticky,_fpgetsticky) 19 1.2 thorpej #endif 20 1.1 eeh 21 1.1 eeh fp_except 22 1.1 eeh fpgetsticky() 23 1.1 eeh { 24 1.1 eeh int x; 25 1.1 eeh 26 1.4 perry __asm("st %%fsr,%0" : "=m" (*&x)); 27 1.1 eeh return (x >> 5) & 0x1f; 28 1.1 eeh } 29