glibc/sysdeps/x86
Joseph Myers a60eca2e55 Simplify HUGE_VAL definitions.
There are various bits/huge_val*.h headers to define HUGE_VAL and
related macros.  All of them use __builtin_huge_val etc. for GCC 3.3
and later.  Then there are various fallbacks, such as using a large
hex float constant for GCC 2.96 and later, or using unions (with or
without compound literals) to construct the bytes of an infinity, with
this last being the reason for having architecture-specific files.
Supporting TS 18661-3 _FloatN / _FloatNx types that have the same
format as other supported types will mean adding more such macros;
needing to add more headers for them doesn't seem very desirable.

The fallbacks based on bytes of the representation of an infinity do
not meet the standard requirements for a constant expression.  At
least one of them is also wrong: sysdeps/sh/bits/huge_val.h is
producing a mixed-endian representation which does not match what GCC
does.

This patch eliminates all those headers, defining the macros directly
in math.h.  For GCC 3.3 and later, the built-in functions are used as
now.  For other compilers, a large constant 1e10000 (with appropriate
suffix) is used.  This is like the fallback for GCC 2.96 and later,
but without using hex floats (which have no apparent advantage here).
It is unambiguously valid standard C for all floating-point formats
with infinities, which covers all formats supported by glibc or likely
to be supported by glibc in future (C90 DR#025 said that if a
floating-point format represents infinities, all real values lie
within the range of representable values, so the constraints for
constant expressions are not violated), but may generate compiler
warnings and wouldn't handle the TS 18661-1 FENV_ROUND pragma
correctly.  If someone is actually using a compiler with glibc that
does not claim to be GCC 3.3 or later, but which has a better way to
define the HUGE_VAL macros, we can always add compiler conditionals in
with alternative definitions.

I intend to make similar changes for INF and NAN.  The SNAN macros
already just use __builtin_nans etc. with no fallback for compilers
not claiming to be GCC 3.3 or later.

Tested for x86_64.

	* math/math.h: Do not include bits/huge_val.h, bits/huge_valf.h,
	bits/huge_vall.h or bits/huge_val_flt128.h.
	(HUGE_VAL): Define directly here.
	[__USE_ISOC99] (HUGE_VALF): Likewise.
	[__USE_ISOC99] (HUGE_VALL): Likewise.
	[__HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)]
	(HUGE_VAL_F128): Likewise.
	* math/Makefile (headers): Remove bits/huge_val.h,
	bits/huge_valf.h, bits/huge_vall.h and bits/huge_val_flt128.h.
	* bits/huge_val.h: Remove.
	* bits/huge_val_flt128.h: Likewise.
	* bits/huge_valf.h: Likewise.
	* bits/huge_vall.h: Likewise.
	* sysdeps/ia64/bits/huge_vall.h: Likewise.
	* sysdeps/ieee754/bits/huge_val.h: Likewise.
	* sysdeps/ieee754/bits/huge_valf.h: Likewise.
	* sysdeps/m68k/m680x0/bits/huge_vall.h: Likewise.
	* sysdeps/sh/bits/huge_val.h: Likewise.
	* sysdeps/sparc/bits/huge_vall.h: Likewise.
	* sysdeps/x86/bits/huge_vall.h: Likewise.
2017-08-31 15:50:50 +00:00
..
bits Simplify HUGE_VAL definitions. 2017-08-31 15:50:50 +00:00
fpu Consistently use uintN_t not u_intN_t in libm. 2017-08-03 19:55:04 +00:00
nptl/bits Move shared pthread definitions to common headers 2017-05-09 17:49:17 -03:00
cacheinfo.c tunables: Add IFUNC selection and cache sizes 2017-06-20 08:37:28 -07:00
cpu-features-offsets.sym Remove x86 ifunc-defines.sym and rtld-global-offsets.sym 2016-05-11 05:51:39 -07:00
cpu-features.c x86-64: Use _dl_runtime_resolve_opt only with AVX512F [BZ #21871] 2017-08-04 11:14:33 -07:00
cpu-features.h x86: Remove assembly versions of index_cpu_*/index_arch_* 2017-08-25 10:51:04 -07:00
cpu-tunables.c x86: Add IBT/SHSTK bits to cpu-features 2017-08-14 05:54:38 -07:00
dl-get-cpu-features.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
dl-hwcap.h x86: Set dl_platform and dl_hwcap from CPU features [BZ #21391] 2017-05-03 13:44:35 -07:00
dl-procinfo.c x86: Set dl_platform and dl_hwcap from CPU features [BZ #21391] 2017-05-03 13:44:35 -07:00
dl-procinfo.h x86: Set dl_platform and dl_hwcap from CPU features [BZ #21391] 2017-05-03 13:44:35 -07:00
dl-tunables.list x86: Rename glibc.tune.ifunc to glibc.tune.hwcaps 2017-06-21 10:21:37 -07:00
elide.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
float128-abi.h Add float128 support for x86_64, x86. 2017-06-26 22:02:24 +00:00
fpu_control.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
init-arch.h x86: Add macros to implement ifunce selection in C 2017-06-05 08:28:13 -07:00
libc-start.c Delay initialization of CPU features struct in static binaries 2017-05-31 06:38:33 +05:30
linkmap.h Rename bits/linkmap.h to linkmap.h (bug 14912). 2015-09-04 19:44:27 +00:00
Makefile Remove x86 ifunc-defines.sym and rtld-global-offsets.sym 2016-05-11 05:51:39 -07:00
math-tests.h Add float128 support for x86_64, x86. 2017-06-26 22:02:24 +00:00
string_private.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
tininess.h Use sysdeps/x86/tininess.h for i386 and x86_64 2012-10-30 20:38:31 -07:00
tst-get-cpu-features-static.c Add _dl_x86_cpu_features to rtld_global 2015-08-13 03:41:22 -07:00
tst-get-cpu-features.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
Versions Add _dl_x86_cpu_features to rtld_global 2015-08-13 03:41:22 -07:00