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

Andreas Jaeger aj@suse.com
Fri Jan 18 08:24:00 GMT 2013


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



More information about the Libc-alpha mailing list