1*c2ff854cSchristos /* $NetBSD: fpgetmask.c,v 1.6 2012/03/21 00:38:34 christos Exp $ */ 24e067afcSperry 3a0c13050Sjtc /* 4a0c13050Sjtc * Written by J.T. Conklin, Apr 10, 1995 5a0c13050Sjtc * Public domain. 6a0c13050Sjtc */ 7a0c13050Sjtc 85d3e8294Sthorpej #include <sys/cdefs.h> 988c3eadbSlukem #if defined(LIBC_SCCS) && !defined(lint) 10*c2ff854cSchristos __RCSID("$NetBSD: fpgetmask.c,v 1.6 2012/03/21 00:38:34 christos Exp $"); 1188c3eadbSlukem #endif /* LIBC_SCCS and not lint */ 125d3e8294Sthorpej 135d3e8294Sthorpej #include "namespace.h" 145d3e8294Sthorpej 15a0c13050Sjtc #include <ieeefp.h> 16a0c13050Sjtc 175d3e8294Sthorpej #ifdef __weak_alias __weak_alias(fpgetmask,_fpgetmask)185d3e8294Sthorpej__weak_alias(fpgetmask,_fpgetmask) 195d3e8294Sthorpej #endif 205d3e8294Sthorpej 21a0c13050Sjtc fp_except 22*c2ff854cSchristos fpgetmask(void) 23a0c13050Sjtc { 24*c2ff854cSchristos unsigned int x; 25a0c13050Sjtc 26ce666bb8Sperry __asm("st %%fsr,%0" : "=m" (*&x)); 27a0c13050Sjtc return (x >> 23) & 0x1f; 28a0c13050Sjtc } 29