This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] powerpc: Fix inline feraiseexcept, feclearexcept macros
- From: Andreas Schwab <schwab at suse dot de>
- To: Adhemerval Zanella <azanella at linux dot vnet dot ibm dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Mon, 26 Jan 2015 15:14:54 +0100
- Subject: Re: [PATCH] powerpc: Fix inline feraiseexcept, feclearexcept macros
- Authentication-results: sourceware.org; auth=none
- References: <54C2C558 dot 2050304 at linux dot vnet dot ibm dot com> <alpine dot DEB dot 2 dot 10 dot 1501240219420 dot 15542 at digraph dot polyomino dot org dot uk> <54C6449B dot 60609 at linux dot vnet dot ibm dot com>
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."