kolibrios-fun/contrib/sdk/sources/newlib/libc/math/fetestexcept.c
Sergey Semyonov (Serge) 5a61e87775 newlib: update
git-svn-id: svn://kolibrios.org@5141 a494cfbc-eb01-0410-851d-a64ba20cac60
2014-09-24 10:20:09 +00:00

18 lines
527 B
C

#include <fenv.h>
/* 7.6.2.5
The fetestexcept function determines which of a specified subset of
the exception flags are currently set. The excepts argument
specifies the exception flags to be queried.
The fetestexcept function returns the value of the bitwise OR of the
exception macros corresponding to the currently set exceptions
included in excepts.
*/
int fetestexcept (int excepts)
{
unsigned short _sw;
__asm__ ("fnstsw %%ax" : "=a" (_sw));
return _sw & excepts & FE_ALL_EXCEPT;
}