2002-06-13 18:20:48 +08:00
|
|
|
#include <fenv.h>
|
|
|
|
|
|
|
|
|
|
|
|
/* 7.6.2.2
|
|
|
|
The fegetexceptflag function stores an implementation-defined
|
|
|
|
representation of the exception flags indicated by the argument
|
|
|
|
excepts in the object pointed to by the argument flagp. */
|
|
|
|
|
2005-08-25 16:39:54 +08:00
|
|
|
int fegetexceptflag (fexcept_t * flagp, int excepts)
|
2002-06-13 18:20:48 +08:00
|
|
|
{
|
|
|
|
unsigned short _sw;
|
|
|
|
__asm__ ("fnstsw %%ax;": "=a" (_sw));
|
|
|
|
*flagp = _sw & excepts & FE_ALL_EXCEPT;
|
2005-08-25 16:39:54 +08:00
|
|
|
return 0;
|
2002-06-13 18:20:48 +08:00
|
|
|
}
|