This is the mail archive of the 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 v4 3/3] Cleanup __ieee754_sqrt(f/l)

On Thu, 15 Mar 2018, Wilco Dijkstra wrote:

> Finally remove the now unused target specific__ieee754_sqrt(f/l) inlines.

OK.  To be clear:

> 	* sysdeps/generic/math-type-macros.h (M_SQRT): Use __builtin_sqrt(f).

This ChangeLog entry isn't correct, it's sqrt not __builtin_sqrt that is 
used after the patch.  (And actually this particular change is logically 
like the ones in patch 2 - it's one of the changes that causes 
__ieee754_sqrt to be unused by arranging for direct use of sqrt, rather 
than one removing an inline that is now unused.)

Also, for the commit message: the removals from 
sysdeps/sparc/fpu/bits/mathinline.h include removals of 
user-visible-for-old-GCC sqrt inlines.  Removing those is desirable, under 
the general principle of leaving such inlining to the compiler rather than 
trying to do it in installed headers, especially when only very old 
compilers are affected, but it's logically separate from changing how 
things are built inside glibc.

Also: I believe this change would slightly pessimize calls to the 
out-of-line sqrt function wrappers in the case where __ieee754_sqrt would 
previously have been inlined in those wrappers but now those inlines are 
being removed.  I consider that explicitly OK, because on such 
architectures the compiler should have inlined sqrt calls (even with 
-fmath-error, GCC generates code that uses the sqrt instruction and only 
calls the out-of-line function when needed to set errno - so on such 
architectures, the out-of-line function should normally never be called 
except for negative input, which is not what we care about optimizing).

Joseph S. Myers

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