2002-09-05 19:51:26 +08:00
|
|
|
#include <fenv.h>
|
|
|
|
|
|
|
|
/* 7.6.4.1
|
|
|
|
The fegetenv function stores the current floating-point environment
|
2005-10-08 10:14:45 +08:00
|
|
|
in the object pointed to by envp. */
|
2002-09-05 19:51:26 +08:00
|
|
|
|
2005-08-25 16:39:54 +08:00
|
|
|
int fegetenv (fenv_t * envp)
|
2002-09-05 19:51:26 +08:00
|
|
|
{
|
|
|
|
__asm__ ("fnstenv %0;": "=m" (*envp));
|
2005-10-08 10:14:45 +08:00
|
|
|
/* fnstenv sets control word to non-stop for all exceptions, so we
|
|
|
|
need to reload our env to restore the original mask. */
|
|
|
|
__asm__ ("fldenv %0" : : "m" (*envp));
|
2005-08-25 16:39:54 +08:00
|
|
|
return 0;
|
2002-09-05 19:51:26 +08:00
|
|
|
}
|