fpgetsticky.c revision 1.1
1/*	$NetBSD: fpgetsticky.c,v 1.1 2004/07/24 19:09:29 chs Exp $	*/
2
3/*	$OpenBSD: fpgetsticky.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
12fp_except
13fpgetsticky(void)
14{
15	uint64_t fpsr;
16
17	__asm__ __volatile__("fstd %%fr0,0(%1)" : "=m" (fpsr) : "r" (&fpsr));
18	return ((fpsr >> 59) & 0x1f);
19}
20