This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Cleanup __ieee754_sqrt(f)
On Thu, 21 Sep 2017, Wilco Dijkstra wrote:
> Joseph Myers wrote:
> > On Fri, 15 Sep 2017, Wilco Dijkstra wrote:
>
> > > This patch cleans up the many uses of __ieee754_sqrt(f) in GLIBC.
> > > We can compile all of the math functions with -fno-math-errno which
> >
> > I don't think that's appropriate for compiling testcases that test errno
> > setting (even if in fact the use of -fno-builtin means it works for them).
> > That is, unlike -frounding-math which is OK globally, -fno-math-errno
> > should be handled more like the other options that are used for building
> > glibc itself but not tests.
>
> 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)
(not tested).
> I'll add those too then. While looking at this, there are also sqrt
> inlines in a few math_private.h guarded by !__GNUC_PREREQ (3, 2). I
> couldn't find a mention in any docs, what is the current minimum GCC
> version for using GLIBC headers? It looks we could get rid of quite a
> lot of redundant math cruft.
math_private.h is a purely internal header and I don't see any
conditionals there on GCC versions before GCC 7. For purely internal
sources, not shared with gnulib or other external projects, the relevant
version is the general minimum version for building glibc documented in
install.texi (currently 4.9).
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).
(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.)
--
Joseph S. Myers
joseph@codesourcery.com