diff options
author | das <das@FreeBSD.org> | 2011-10-21 06:25:31 +0000 |
---|---|---|
committer | das <das@FreeBSD.org> | 2011-10-21 06:25:31 +0000 |
commit | 818507cb9092d3f7bab606b884cb7353484070a9 (patch) | |
tree | 63bd56bb6e999cae44e95db3aa86ff4a7748a112 /lib/msun/i387 | |
parent | ac69ef07dae6c1a1fdce2e73a4bdc340f5a91011 (diff) | |
download | FreeBSD-src-818507cb9092d3f7bab606b884cb7353484070a9.zip FreeBSD-src-818507cb9092d3f7bab606b884cb7353484070a9.tar.gz |
Bugfix: feenableexcept() and fedisableexcept() should just return the
old exception mask, not mask | ~FE_ALL_EXCEPT.
MFC after: 2 weeks
Diffstat (limited to 'lib/msun/i387')
-rw-r--r-- | lib/msun/i387/fenv.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/msun/i387/fenv.c b/lib/msun/i387/fenv.c index fafe220..6f51ba2 100644 --- a/lib/msun/i387/fenv.c +++ b/lib/msun/i387/fenv.c @@ -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); |