]> git.ipfire.org Git - thirdparty/glibc.git/commit
Add bits/floatn.h defines for more _FloatN / _FloatNx types.
authorJoseph Myers <joseph@codesourcery.com>
Fri, 20 Oct 2017 21:42:51 +0000 (21:42 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Fri, 20 Oct 2017 21:42:51 +0000 (21:42 +0000)
commit797ba44ba27521261f94cc521f1c2ca74f650147
treeabb21792a6b788673af4c3d13643731823c604a9
parent8f6f5362727dc93360fe37e6d4e964f386b7b8e7
Add bits/floatn.h defines for more _FloatN / _FloatNx types.

The bits/floatn.h header currently only has defines relating to
_Float128.  This patch adds defines relating to other _FloatN /
_FloatNx types.

The approach taken is to add defines for all _FloatN / _FloatNx types
known to GCC, and to put them in a common bits/floatn-common.h header
included at the end of all the individual bits/floatn.h headers.  If
in future some defines become different for different glibc
configurations, they will move out into the separate bits/floatn.h
headers.

Some defines are expected always to be the same across glibc ports.
Corresponding defines are nevertheless put in this header.  The intent
is that where there are conditionals (in headers or in non-installed
files) that can just repeat the same or nearly the same logic for each
floating-point type, they should do so, even if in fact the cases for
some types could be unconditionally present or absent because the same
conditionals are true or false for all glibc configurations.  This
should make the glibc code with such conditionals easier to read,
because the reader can just see that the same conditionals are
repeated for each type, rather than seeing different conditionals for
different types and needing to reason, at each location with such
differences, why those differences are indeed correct there.  (Cases
involving per-format rather than per-type logic are more likely still
to need differences in how they handle different types.)

Having such defines and conditionals also helps in incremental
preparation for adding _Float32 / _Float64 / _Float32x / _Float64x
function aliases.  I intend subsequent patches to add such
conditionals corresponding to those already present for _Float128, as
well as making more architecture-specific function implementations use
common macros to define aliases in preparation for adding such _FloatN
/ _FloatNx aliases.

Tested for x86_64.

* bits/floatn-common.h: New file.
* math/Makefile (headers): Add bits/floatn-common.h.
* bits/floatn.h: Include <bits/floatn-common.h>.
* sysdeps/ia64/bits/floatn.h: Likewise.
* sysdeps/ieee754/ldbl-128/bits/floatn.h: Likewise.
* sysdeps/mips/ieee754/bits/floatn.h: Likewise.
* sysdeps/powerpc/bits/floatn.h: Likewise.
* sysdeps/x86/bits/floatn.h: Likewise.
ChangeLog
bits/floatn-common.h [new file with mode: 0644]
bits/floatn.h
math/Makefile
sysdeps/ia64/bits/floatn.h
sysdeps/ieee754/ldbl-128/bits/floatn.h
sysdeps/mips/ieee754/bits/floatn.h
sysdeps/powerpc/bits/floatn.h
sysdeps/x86/bits/floatn.h