Remove an unneeded fnstcw instruction.

Noticed by:	bde
This commit is contained in:
David Schultz 2007-01-05 07:15:26 +00:00
parent cc0d85b680
commit 3cb636ce18
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=165795
2 changed files with 11 additions and 14 deletions

View File

@ -72,16 +72,14 @@ feraiseexcept(int excepts)
int
fegetenv(fenv_t *envp)
{
int control;
/*
* fnstenv masks all exceptions, so we need to save and
* restore the control word to avoid this side effect.
*/
__fnstcw(&control);
__fnstenv(&envp->__x87);
__stmxcsr(&envp->__mxcsr);
__fldcw(control);
/*
* fnstenv masks all exceptions, so we need to restore the
* control word to avoid this side effect.
*/
__fldcw(envp->__x87.__control);
return (0);
}

View File

@ -117,19 +117,18 @@ feraiseexcept(int excepts)
int
fegetenv(fenv_t *envp)
{
int control, mxcsr;
int mxcsr;
/*
* fnstenv masks all exceptions, so we need to save and
* restore the control word to avoid this side effect.
*/
__fnstcw(&control);
__fnstenv(envp);
/*
* fnstenv masks all exceptions, so we need to restore
* the old control word to avoid this side effect.
*/
__fldcw(envp->__control);
if (__HAS_SSE()) {
__stmxcsr(&mxcsr);
__set_mxcsr(*envp, mxcsr);
}
__fldcw(control);
return (0);
}