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] Replace ABS macros with fabs


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


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