kolibrios/contrib/sdk/sources/newlib/libc/math/feclearexcept.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

16 lines
412 B
C

#include <fenv.h>
/* 7.6.2.1
The feclearexcept function clears the supported exceptions
represented by its argument.
*/
int feclearexcept (int excepts)
{
fenv_t _env;
__asm__ volatile ("fnstenv %0;" : "=m" (_env)); /* get the env */
_env.__status_word &= ~(excepts & FE_ALL_EXCEPT); /* clear the except */
__asm__ volatile ("fldenv %0;" :: "m" (_env)); /*set the env */
return 0;
}