Home | History | Annotate | Line # | Download | only in gen
fpgetmask.c revision 1.1
      1 /*	$NetBSD: fpgetmask.c,v 1.1 2004/07/24 19:09:29 chs Exp $	*/
      2 
      3 /*	$OpenBSD: fpgetmask.c,v 1.3 2002/10/21 18:41:05 mickey Exp $	*/
      4 
      5 /*
      6  * Written by Miodrag Vallat.  Public domain
      7  */
      8 
      9 #include <sys/types.h>
     10 #include <ieeefp.h>
     11 
     12 fp_except
     13 fpgetmask(void)
     14 {
     15 	uint64_t fpsr;
     16 
     17 	__asm__ __volatile__("fstd %%fr0,0(%1)" : "=m" (fpsr) : "r" (&fpsr));
     18 	return ((fpsr >> 32) & 0x1f);
     19 }
     20