This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH][BZ #14496] Fix application of the SIMD FP exception mask


Hi,

The FP mask application in libc_feupdateenv_test_sse seems to be
inverted.  feraiseexception should be called when the FP mask bits are
cleared whiled currently it's called when the bits are set.  Attached
patch fixes this and also the performance regression in BZ #14496.
Verified that there are no regressions on x86_64.  OK to commit?

Siddhesh

	[BZ #14496]
	* sysdeps/i386/fpu/fenv_private.h (libc_feupdateenv_test_sse):
	Fix application of SIMD FP exception mask.

diff --git a/sysdeps/i386/fpu/fenv_private.h b/sysdeps/i386/fpu/fenv_private.h
index 03f4c97..20eb0a4 100644
--- a/sysdeps/i386/fpu/fenv_private.h
+++ b/sysdeps/i386/fpu/fenv_private.h
@@ -176,7 +176,7 @@ libc_feupdateenv_test_sse (fenv_t *e, int ex)
 
   /* Raise SIGFPE for any new exceptions since the hold.  Expect that
      the normal environment has all exceptions masked.  */
-  if (__builtin_expect ((old_mxcsr >> 7) & cur_ex, 0))
+  if (__builtin_expect (~(old_mxcsr >> 7) & cur_ex, 0))
     __feraiseexcept (cur_ex);
 
   /* Test for exceptions raised since the hold.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]