diff options
author | Joseph Myers <joseph@codesourcery.com> | 2017-10-20 21:42:51 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2017-10-20 21:42:51 +0000 |
commit | 797ba44ba27521261f94cc521f1c2ca74f650147 (patch) | |
tree | abb21792a6b788673af4c3d13643731823c604a9 /sysdeps/ia64/bits | |
parent | 8f6f5362727dc93360fe37e6d4e964f386b7b8e7 (diff) | |
download | glibc-797ba44ba27521261f94cc521f1c2ca74f650147.tar.gz |
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.
Diffstat (limited to 'sysdeps/ia64/bits')
-rw-r--r-- | sysdeps/ia64/bits/floatn.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sysdeps/ia64/bits/floatn.h b/sysdeps/ia64/bits/floatn.h index dbb6eb2325..a88d0f9297 100644 --- a/sysdeps/ia64/bits/floatn.h +++ b/sysdeps/ia64/bits/floatn.h @@ -99,4 +99,6 @@ typedef __float128 _Float128; #endif +#include <bits/floatn-common.h> + #endif /* _BITS_FLOATN_H */ |