00be2a5f39
C2x adds <float.h> constants FLT_NORM_MAX, DBL_NORM_MAX and LDBL_NORM_MAX. These are for the maximum "normalized" finite floating-point number, where the given definition of normalized is that all possible values with MANT_DIG significand digits (leading one not zero) can be represented with that exponent. The effect of that definition is that these macros are the same as the corresponding MAX macros for all formats except IBM long double, where the NORM_MAX value has exponent 1 smaller than the MAX one so that all 106 digits can be 1. This patch adds those macros to GCC. They are only defined for float, double and long double; C2x does not include such macros for DFP types, and while the integration of TS 18661-3 into C2x has not yet occurred, the draft proposed text does not add them for the _FloatN / _FloatNx types (where they would always be the same as the MAX macros). Bootstrapped with no regressions on x86_64-pc-linux-gnu. Also tested compilation of the new test for powerpc-linux-gnu to confirm the check of LDBL_NORM_MAX in the IBM long double case does get properly optimized out. gcc: * ginclude/float.c [__STDC_VERSION__ > 201710L] (FLT_NORM_MAX, DBL_NORM_MAX, LDBL_NORM_MAX): Define. * real.c (get_max_float): Add norm_max argument. * real.h (get_max_float): Update prototype. * builtins.c (fold_builtin_interclass_mathfn): Update calls to get_max_float. gcc/c-family: * c-cppbuiltin.c (builtin_define_float_constants): Also define NORM_MAX constants. Update call to get_max_float. (LAZY_HEX_FP_VALUES_CNT): Update value to include NORM_MAX constants. gcc/d: * d-target.cc (define_float_constants): Update call to get_max_float. gcc/testsuite: * gcc.dg/c11-float-3.c, gcc.dg/c2x-float-1.c: New tests. From-SVN: r278145 |
||
---|---|---|
config | ||
contrib | ||
fixincludes | ||
gcc | ||
gnattools | ||
gotools | ||
include | ||
INSTALL | ||
intl | ||
libada | ||
libatomic | ||
libbacktrace | ||
libcc1 | ||
libcpp | ||
libdecnumber | ||
libffi | ||
libgcc | ||
libgfortran | ||
libgo | ||
libgomp | ||
libhsail-rt | ||
libiberty | ||
libitm | ||
libobjc | ||
liboffloadmic | ||
libphobos | ||
libquadmath | ||
libsanitizer | ||
libssp | ||
libstdc++-v3 | ||
libvtv | ||
lto-plugin | ||
maintainer-scripts | ||
zlib | ||
.dir-locals.el | ||
.gitattributes | ||
.gitignore | ||
ABOUT-NLS | ||
ar-lib | ||
ChangeLog | ||
ChangeLog.jit | ||
ChangeLog.tree-ssa | ||
compile | ||
config-ml.in | ||
config.guess | ||
config.rpath | ||
config.sub | ||
configure | ||
configure.ac | ||
COPYING | ||
COPYING3 | ||
COPYING3.LIB | ||
COPYING.LIB | ||
COPYING.RUNTIME | ||
depcomp | ||
install-sh | ||
libtool-ldflags | ||
libtool.m4 | ||
lt~obsolete.m4 | ||
ltgcc.m4 | ||
ltmain.sh | ||
ltoptions.m4 | ||
ltsugar.m4 | ||
ltversion.m4 | ||
MAINTAINERS | ||
Makefile.def | ||
Makefile.in | ||
Makefile.tpl | ||
missing | ||
mkdep | ||
mkinstalldirs | ||
move-if-change | ||
multilib.am | ||
README | ||
symlink-tree | ||
test-driver | ||
ylwrap |
This directory contains the GNU Compiler Collection (GCC). The GNU Compiler Collection is free software. See the files whose names start with COPYING for copying permission. The manuals, and some of the runtime libraries, are under different terms; see the individual source files for details. The directory INSTALL contains copies of the installation information as HTML and plain text. The source of this information is gcc/doc/install.texi. The installation information includes details of what is included in the GCC sources and what files GCC installs. See the file gcc/doc/gcc.texi (together with other files that it includes) for usage and porting information. An online readable version of the manual is in the files gcc/doc/gcc.info*. See http://gcc.gnu.org/bugs/ for how to report bugs usefully. Copyright years on GCC source files may be listed using range notation, e.g., 1987-2012, indicating that every year in the range, inclusive, is a copyrightable year that could otherwise be listed individually.