This is the mail archive of the 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]

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

On 01/18/2013 08:29 AM, Siddhesh Poyarekar wrote:

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?


	[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))

Please use __glibc_unlikely here. Otherwise ok,


__feraiseexcept (cur_ex);

/* Test for exceptions raised since the hold. */

-- Andreas Jaeger aj@{,} Twitter/Identica: jaegerandi SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg) GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126

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