Bugfix: feenableexcept() and fedisableexcept() should just return the

old exception mask, not mask | ~FE_ALL_EXCEPT.

MFC after:	2 weeks
This commit is contained in:
David Schultz 2011-10-21 06:25:31 +00:00
parent 4b80fe0308
commit 741ae1d017
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=226594
2 changed files with 8 additions and 8 deletions

View File

@ -135,12 +135,12 @@ __feenableexcept(int mask)
mask &= FE_ALL_EXCEPT;
__fnstcw(&control);
__stmxcsr(&mxcsr);
omask = (control | mxcsr >> _SSE_EMASK_SHIFT) & FE_ALL_EXCEPT;
omask = ~(control | mxcsr >> _SSE_EMASK_SHIFT) & FE_ALL_EXCEPT;
control &= ~mask;
__fldcw(control);
mxcsr &= ~(mask << _SSE_EMASK_SHIFT);
__ldmxcsr(mxcsr);
return (~omask);
return (omask);
}
int
@ -152,12 +152,12 @@ __fedisableexcept(int mask)
mask &= FE_ALL_EXCEPT;
__fnstcw(&control);
__stmxcsr(&mxcsr);
omask = (control | mxcsr >> _SSE_EMASK_SHIFT) & FE_ALL_EXCEPT;
omask = ~(control | mxcsr >> _SSE_EMASK_SHIFT) & FE_ALL_EXCEPT;
control |= mask;
__fldcw(control);
mxcsr |= mask << _SSE_EMASK_SHIFT;
__ldmxcsr(mxcsr);
return (~omask);
return (omask);
}
__weak_reference(__feenableexcept, feenableexcept);

View File

@ -192,14 +192,14 @@ __feenableexcept(int mask)
__stmxcsr(&mxcsr);
else
mxcsr = 0;
omask = (control | mxcsr >> _SSE_EMASK_SHIFT) & FE_ALL_EXCEPT;
omask = ~(control | mxcsr >> _SSE_EMASK_SHIFT) & FE_ALL_EXCEPT;
control &= ~mask;
__fldcw(control);
if (__HAS_SSE()) {
mxcsr &= ~(mask << _SSE_EMASK_SHIFT);
__ldmxcsr(mxcsr);
}
return (~omask);
return (omask);
}
int
@ -214,14 +214,14 @@ __fedisableexcept(int mask)
__stmxcsr(&mxcsr);
else
mxcsr = 0;
omask = (control | mxcsr >> _SSE_EMASK_SHIFT) & FE_ALL_EXCEPT;
omask = ~(control | mxcsr >> _SSE_EMASK_SHIFT) & FE_ALL_EXCEPT;
control |= mask;
__fldcw(control);
if (__HAS_SSE()) {
mxcsr |= mask << _SSE_EMASK_SHIFT;
__ldmxcsr(mxcsr);
}
return (~omask);
return (omask);
}
__weak_reference(__feenableexcept, feenableexcept);