* mingwex/fe*.c: Revert previous changes.
* include/fenv.h: Revert previous changes. Add Changelog entry for the reverted change.
This commit is contained in:
@@ -4,10 +4,12 @@
|
||||
The feclearexcept function clears the supported exceptions
|
||||
represented by its argument. */
|
||||
|
||||
void feclearexcept (int excepts)
|
||||
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;
|
||||
}
|
||||
|
@@ -4,8 +4,9 @@
|
||||
The fegetenv function stores the current floating-point environment
|
||||
in the object pointed to by envp. */
|
||||
|
||||
void fegetenv (fenv_t * envp)
|
||||
int fegetenv (fenv_t * envp)
|
||||
{
|
||||
__asm__ ("fnstenv %0;": "=m" (*envp));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -6,9 +6,10 @@
|
||||
representation of the exception flags indicated by the argument
|
||||
excepts in the object pointed to by the argument flagp. */
|
||||
|
||||
void fegetexceptflag (fexcept_t * flagp, int excepts)
|
||||
int fegetexceptflag (fexcept_t * flagp, int excepts)
|
||||
{
|
||||
unsigned short _sw;
|
||||
__asm__ ("fnstsw %%ax;": "=a" (_sw));
|
||||
*flagp = _sw & excepts & FE_ALL_EXCEPT;
|
||||
return 0;
|
||||
}
|
||||
|
@@ -8,11 +8,12 @@
|
||||
the inexact exception whenever it raises the overflow
|
||||
or underflow exception is implementation-defined. */
|
||||
|
||||
void feraiseexcept (int excepts)
|
||||
int feraiseexcept (int excepts)
|
||||
{
|
||||
fenv_t _env;
|
||||
__asm__ volatile ("fnstenv %0;" : "=m" (_env));
|
||||
_env.__status_word |= excepts & FE_ALL_EXCEPT;
|
||||
__asm__ volatile ("fldenv %0;"
|
||||
"fwait;" : : "m" (_env));
|
||||
return 0;
|
||||
}
|
||||
|
@@ -13,7 +13,7 @@
|
||||
|
||||
extern void (*_imp___fpreset)( void ) ;
|
||||
|
||||
void fesetenv (const fenv_t * envp)
|
||||
int fesetenv (const fenv_t * envp)
|
||||
{
|
||||
if (envp == FE_PC64_ENV)
|
||||
/*
|
||||
@@ -38,4 +38,6 @@ void fesetenv (const fenv_t * envp)
|
||||
|
||||
else
|
||||
__asm__ ("fldenv %0;" : : "m" (*envp));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -9,7 +9,7 @@
|
||||
represented by the argument excepts. This function does not raise
|
||||
exceptions, but only sets the state of the flags. */
|
||||
|
||||
void fesetexceptflag (const fexcept_t * flagp, int excepts)
|
||||
int fesetexceptflag (const fexcept_t * flagp, int excepts)
|
||||
{
|
||||
fenv_t _env;
|
||||
|
||||
@@ -18,4 +18,5 @@ void fesetexceptflag (const fexcept_t * flagp, int excepts)
|
||||
_env.__status_word &= ~excepts;
|
||||
_env.__status_word |= (*flagp & excepts);
|
||||
__asm__ volatile ("fldenv %0;" : : "m" (_env));
|
||||
return 0;
|
||||
}
|
||||
|
@@ -10,10 +10,11 @@
|
||||
|
||||
/* FIXME: this works but surely there must be a better way. */
|
||||
|
||||
void feupdateenv (const fenv_t * envp)
|
||||
int feupdateenv (const fenv_t * envp)
|
||||
{
|
||||
unsigned int _fexcept = fetestexcept (FE_ALL_EXCEPT); /*save excepts */
|
||||
fesetenv (envp); /* install the env */
|
||||
feraiseexcept (_fexcept); /* raise the execept */
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user