This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH][BZ #14496] Fix application of the SIMD FP exception mask
- From: Andreas Jaeger <aj at suse dot com>
- To: Siddhesh Poyarekar <siddhesh at redhat dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Fri, 18 Jan 2013 09:24:02 +0100
- Subject: Re: [PATCH][BZ #14496] Fix application of the SIMD FP exception mask
- References: <20130118072917.GO25252@spoyarek.pnq.redhat.com>
On 01/18/2013 08:29 AM, Siddhesh Poyarekar wrote:
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))
Please use __glibc_unlikely here. Otherwise ok,
Andreas
__feraiseexcept (cur_ex);
/* Test for exceptions raised since the hold. */
--
Andreas Jaeger aj@{suse.com,opensuse.org} 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