1/* $OpenBSD: fpgetmask.c,v 1.4 2014/04/18 15:09:52 guenther Exp $ */ 2 3/* 4 * Written by Miodrag Vallat. Public domain 5 */ 6 7#include <sys/types.h> 8#include <ieeefp.h> 9 10fp_except 11fpgetmask() 12{ 13 u_int64_t fpsr; 14 15 __asm__ volatile("fstd %%fr0,0(%1)" : "=m" (fpsr) : "r" (&fpsr)); 16 return ((fpsr >> 32) & 0x1f); 17} 18