2002-06-13 12:20:48 +02: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 04:35:34 +02:00
|
|
|
void fegetexceptflag (fexcept_t * flagp, int excepts)
|
2002-06-13 12:20:48 +02:00
|
|
|
{
|
|
|
|
unsigned short _sw;
|
|
|
|
__asm__ ("fnstsw %%ax;": "=a" (_sw));
|
|
|
|
*flagp = _sw & excepts & FE_ALL_EXCEPT;
|
|
|
|
}
|