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] Cleanup __ieee754_sqrt(f)


Joseph Myers wrote:
> On Thu, 21 Sep 2017, Wilco Dijkstra wrote:
> > So how can I differentiate between testcases and math functions in the
> > makefile?
>
> I think you want something like:
> 
> $(if $(filter testsuite,$(in-module)),,-fno-math-errno)

Well I finally got it to work using o-iterator. However given there is no
list of non-test files, I ended up having to add -fno-math-errno to all files,
and then -fmath-errno override to all test files... I'll post a patch.

> For installed headers, the minimum is probably 2.7 (or the minimum that 
> supported the architecture in question if later), but some headers may 
> well use features that don't work on 2.7, and we're not that concerned 
> about *optimizations* in installed headers for very old versions if the 
> headers will still work without the optimizations (see the discussion 
> starting at <https://sourceware.org/ml/libc-alpha/2015-05/msg00526.html> -
> from which I think removing any header optimizations for pre-4.3 GCC would 
> be fine - which would allow removing lots of bits/mathinline.h 
> optimizations, for example).

Yes I meant removing the various mathinlines.h. It looks like pretty much all
can be removed, assuming we don't care about 20 year old inlines for m68k
or x87.

> (Note that e.g. the definitions of C99 type-generic comparison macros in 
> bits/mathinline.h for old GCC are *not* optimizations, they're needed to 
> make the feature available at all on compilers without the built-in 
> functions.  One could argue whether that's necessary at all now - and if 
> it is, it could be done in a machine-independent way - but that would be 
> separate from removing obsolete optimizations.)

What I've done for these is to improve the generic version so that it is
used from the first GCC version where it worked for all targets. I noticed
the tests were failing for signalling NaNs, so seem untested until now.
With my improved version they are now fully inlined, so much faster due to
avoiding 2 slow calls to __fpclassify. This of course assumes older GCC's
emit the right equality comparison on all targets, which might be optimistic
but then again there is only so much one can do...

Wilco

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