Home | History | Annotate | Line # | Download | only in gen
      1  1.9     joerg /*	$NetBSD: fpgetsticky.c,v 1.9 2014/09/17 11:02:55 joerg Exp $	*/
      2  1.2  jonathan 
      3  1.1       jtc /*
      4  1.1       jtc  * Written by J.T. Conklin, Apr 11, 1995
      5  1.1       jtc  * Public domain.
      6  1.1       jtc  */
      7  1.1       jtc 
      8  1.3   thorpej #include <sys/cdefs.h>
      9  1.4     lukem #if defined(LIBC_SCCS) && !defined(lint)
     10  1.9     joerg __RCSID("$NetBSD: fpgetsticky.c,v 1.9 2014/09/17 11:02:55 joerg Exp $");
     11  1.4     lukem #endif /* LIBC_SCCS and not lint */
     12  1.3   thorpej 
     13  1.3   thorpej #include "namespace.h"
     14  1.3   thorpej 
     15  1.1       jtc #include <ieeefp.h>
     16  1.3   thorpej 
     17  1.3   thorpej #ifdef __weak_alias
     18  1.3   thorpej __weak_alias(fpgetsticky,_fpgetsticky)
     19  1.3   thorpej #endif
     20  1.1       jtc 
     21  1.1       jtc fp_except
     22  1.6      matt fpgetsticky(void)
     23  1.1       jtc {
     24  1.6      matt 	fp_except x;
     25  1.1       jtc 
     26  1.9     joerg 	__asm(".set push; .set noat; cfc1 %0,$31; .set pop" : "=r" (x));
     27  1.8      matt 	return (x >> 2) & 0x1f;
     28  1.1       jtc }
     29