diff options
Diffstat (limited to 'winsup/cygwin/fenv.cc')
-rw-r--r-- | winsup/cygwin/fenv.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/winsup/cygwin/fenv.cc b/winsup/cygwin/fenv.cc index 5443681f9..f025a1774 100644 --- a/winsup/cygwin/fenv.cc +++ b/winsup/cygwin/fenv.cc @@ -295,9 +295,8 @@ fegetexceptflag (fexcept_t *flagp, int excepts) if (use_sse) __asm__ volatile ("stmxcsr %0" : "=m" (mxcsr) : ); - /* Mask undesired bits out and set result struct. */ - flagp->_fpu_exceptions = (sw & excepts); - flagp->_sse_exceptions = (mxcsr & excepts); + /* Mask undesired bits out and set result. */ + *flagp = (sw | mxcsr) & excepts; return 0; } @@ -317,9 +316,9 @@ fesetexceptflag (const fexcept_t *flagp, int excepts) /* Set/Clear desired exception bits. */ fenv._fpu._fpu_sw &= ~excepts; - fenv._fpu._fpu_sw |= (excepts & flagp->_fpu_exceptions); + fenv._fpu._fpu_sw |= excepts & *flagp; fenv._sse_mxcsr &= ~excepts; - fenv._sse_mxcsr |= (excepts & flagp->_sse_exceptions); + fenv._sse_mxcsr |= excepts & *flagp; /* Set back into FPU state. */ return fesetenv (&fenv); |