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]

Re: [PATCH] powerpc: Fix inline feraiseexcept, feclearexcept macros


Adhemerval Zanella <azanella@linux.vnet.ibm.com> writes:

> diff --git a/sysdeps/powerpc/bits/fenvinline.h b/sysdeps/powerpc/bits/fenvinline.h
> index 35c2114..999c6b2 100644
> --- a/sysdeps/powerpc/bits/fenvinline.h
> +++ b/sysdeps/powerpc/bits/fenvinline.h
> @@ -34,29 +34,41 @@
>  
>  /* Inline definition for feraiseexcept.  */
>  #  define feraiseexcept(__excepts) \
> -  ((__builtin_constant_p (__excepts)					      \
> -    && ((__excepts) & ((__excepts)-1)) == 0				      \
> -    && (__excepts) != FE_INVALID)					      \
> -   ? ((__excepts) != 0							      \
> -      ? (__extension__ ({ __asm__ __volatile__				      \
> -			  ("mtfsb1 %s0"					      \
> -			   : : "i#*X"(__builtin_ffs (__excepts)));	      \
> -			  0; }))					      \
> -      : 0)								      \
> -   : (feraiseexcept) (__excepts))
> +  (__extension__  ({ 							      \
> +    int __e = __excepts;						      \
> +    int __ret;								      \
> +    if (__builtin_constant_p (__e)					      \
> +        && ((__e & (__e-1)) == 0)					      \

> +        && (__e != FE_INVALID))						      \

Please also add the missing space around the operator while you are
changing it, and remove the redundant pair of parens.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


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