This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Replace ABS macros with fabs
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Wilco Dijkstra <wdijkstr at arm dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Tue, 28 Apr 2015 22:03:19 +0000
- Subject: Re: [PATCH] Replace ABS macros with fabs
- Authentication-results: sourceware.org; auth=none
- References: <000301d080d5$ba014860$2e03d920$ at com>
On Mon, 27 Apr 2015, Wilco Dijkstra wrote:
> GLIBC contains many uses of ABS macros which GCC is not able to optimize
> into fabs due to strict IEEE mode being used. On AArch64 GCC fails to
> use CSEL so several math functions contain many unnecessary and
> unpredictable branches. This patch removes the various ABS macros and
> replaces uses with fabs (or in one case abs) which is more efficient on
> all targets.
>
> OK for commit?
OK given testing with math/ tests on x86_64 (I think the math/ tests
provide sufficient evidence that nothing was actually relying on the signs
of results of those macros for zero arguments where use of fabs changes
it; I've encountered various cases where including <math.h> in dbl-64
files nonobviously required such an include to be added to
sysdeps/x86_64/fpu/multiarch files as well because of some sort of include
ordering issue, so think an x86_64 build test is a good idea for any patch
like this that adds <math.h> includes to dbl-64 files).
--
Joseph S. Myers
joseph@codesourcery.com