Go to file
Joseph Myers 00be2a5f39 Add C2x *_NORM_MAX constants to <float.h>.
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
2019-11-13 15:25:15 +00:00
config
contrib Make mklog more robust. 2019-11-08 08:39:17 +00:00
fixincludes
gcc Add C2x *_NORM_MAX constants to <float.h>. 2019-11-13 15:25:15 +00:00
gnattools
gotools
include GCN libgomp port 2019-11-13 12:38:04 +00:00
INSTALL
intl
libada
libatomic
libbacktrace
libcc1
libcpp PR c++/91370 - Implement P1041R4 and P1139R2 - Stronger Unicode reqs 2019-11-07 21:24:38 +01:00
libdecnumber
libffi
libgcc Support 64-bit double and 64-bit long double configurations. 2019-11-07 09:19:31 +00:00
libgfortran PR fortran/92470 Fixes for CFI_address 2019-11-13 12:13:57 +01:00
libgo libgo: fix DejaGNU testsuite compiler when using build sysroot 2019-11-11 23:28:54 +00:00
libgomp GCN Libgomp Plugin 2019-11-13 12:38:18 +00:00
libhsail-rt
libiberty
libitm
libobjc
liboffloadmic
libphobos
libquadmath
libsanitizer Enable libsanitizer build on riscv64 2019-11-13 09:45:15 +00:00
libssp
libstdc++-v3 Update link to "Why not LGPL". 2019-11-11 13:35:33 +00:00
libvtv
lto-plugin
maintainer-scripts
zlib
.dir-locals.el
.gitattributes
.gitignore
ABOUT-NLS
ar-lib
ChangeLog Bump minimum MPFR version to 3.1.0 2019-11-11 17:59:48 +02:00
ChangeLog.jit
ChangeLog.tree-ssa
compile
config-ml.in
config.guess
config.rpath
config.sub
configure Bump minimum MPFR version to 3.1.0 2019-11-11 17:59:48 +02:00
configure.ac Bump minimum MPFR version to 3.1.0 2019-11-11 17:59:48 +02:00
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.