gcc/libgcc
Joseph Myers 9a79452d4c Remove LIBGCC2_LONG_DOUBLE_TYPE_SIZE target macro.
This patch removes the target macro LIBGCC2_LONG_DOUBLE_TYPE_SIZE.

After recent changes, this macro was used in two ways in libgcc: to
determine the mode of long double in dfp-bit.h, and to determine
whether a particular mode has excess precision for use in complex
multiplication.

The former is concerned specifically with long double: it relates to
use of strtold for converting between decimal and binary floating
point.  This is replaced by comparing __LDBL_MANT_DIG__ with the
appropriate __LIBGCC_*_MANT_DIG__ macro.  The latter is replaced
__LIBGCC_*_EXCESS_PRECISION__ predefined macros.

Remarks:

* Comparing (__LDBL_MANT_DIG__ == __LIBGCC_XF_MANT_DIG__) is more
  fragile than it looks; it's possible for XFmode to have 53-bit
  mantissa (TARGET_96_ROUND_53_LONG_DOUBLE, on FreeBSD and
  DragonFlyBSD 32-bit), in which case such a comparison would not
  distinguish XFmode and DFmode as possible modes for long double.
  Fortunately, no target supporting that form of XFmode also supports
  long double = double (but if some target did, we'd need e.g. an
  additional macro giving the exponent range of each mode).

  Furthermore, this code doesn't actually get used for x86 (or any
  other target with XFmode support), because x86 uses BID not DPD and
  BID has its own conversion code (which handles conversions for both
  XFmode and TFmode without needing to go via strtold).  And FreeBSD
  and DragonFlyBSD aren't among the targets with DFP support.  So
  while in principle this code is fragile and it's a deficiency that
  it can't support both XFmode and TFmode at once (something that
  can't be solved with the string conversion approach without libc
  having TS 18661 functions such as strtof128), all these issues
  should not be a problem in practice.

* If other cases of excess precision are supported in future, the code
  for defining __LIBGCC_*_EXCESS_PRECISION__ may need updating.
  Although the most likely such cases might not actually involve
  excess precision for any mode used in libgcc - FLT_EVAL_METHOD being
  32 to do _Float16 arithmetic on _Float32 should have the effect of
  _Complex _Float16 arithmetic using __mulsc3 and __divsc3, rather
  than currently nonexistent __mulhc3 and __divhc3 as in bug 63250 for
  ARM.

* As has been noted in the context of simultaneous support for
  __float128 and __ibm128 on Power, the semantics of macros such as
  LONG_DOUBLE_TYPE_SIZE are problematic because they rely on a
  poorly-defined precision value for floating-point modes (which seems
  to be intended as the number of significant bits in the
  representation, e.g. 80 for XFmode which may be either 12 or 16
  bytes) uniquely identifying a mode (although defining an arbitrarily
  different value for one of the modes you wish to distinguish may
  work as a hack).  It would be cleaner to have a target hook that
  gives a machine mode directly for float, double and long double,
  rather than going via these precision values.  By eliminating all
  use of these macros (FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE,
  LONG_DOUBLE_TYPE_SIZE) from code built for the target, this patch
  facilitates such a conversion to a hook (which I suppose would take
  some suitable enum as an argument to identify which of the three
  types to return a mode for).

  (The issue of multiple type support for DFP conversions would apply
  in that Power case.
  <https://gcc.gnu.org/ml/gcc-patches/2014-07/msg01084.html> doesn't
  seem to touch on it, but it would seem reasonable to punt on it
  initially as hard to fix.  There would also be the issue of getting
  functions such as __powikf2, __mulkc3, __divkc3 defined, but that's
  rather easier to address.)

Bootstrapped with no regressions on x86_64-unknown-linux-gnu.

gcc:
	* doc/tm.texi.in (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove.
	* doc/tm.texi: Regenerate.
	* system.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Poison.
	* config/alpha/alpha.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove.
	* config/i386/i386-interix.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE):
	Remove.
	* config/i386/i386.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove.
	* config/i386/rtemself.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove.
	* config/ia64/ia64.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove.
	* config/m68k/m68k.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove.
	* config/m68k/netbsd-elf.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE):
	Remove.
	* config/mips/mips.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove.
	* config/mips/n32-elf.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove.
	* config/msp430/msp430.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove.
	* config/rl78/rl78.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove.
	* config/rs6000/rs6000.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove.
	* config/rx/rx.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove.
	* config/s390/s390.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove.
	* config/sparc/freebsd.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove.
	* config/sparc/linux.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove.
	* config/sparc/linux64.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove.
	* config/sparc/netbsd-elf.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE):
	Remove.

gcc/c-family:
	* c-cppbuiltin.c (c_cpp_builtins): Define
	__LIBGCC_*_EXCESS_PRECISION__ macros for supported floating-point
	modes.

libgcc:
	* dfp-bit.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove.
	(__LIBGCC_XF_MANT_DIG__): Define if not already defined.
	(LONG_DOUBLE_HAS_XF_MODE): Define in terms of
	__LIBGCC_XF_MANT_DIG__.
	(__LIBGCC_TF_MANT_DIG__): Define if not already defined.
	(LONG_DOUBLE_HAS_TF_MODE): Define in terms of
	__LIBGCC_TF_MANT_DIG__.
	* libgcc2.c (NOTRUNC): Define in terms of
	__LIBGCC_*_EXCESS_PRECISION__, not LIBGCC2_LONG_DOUBLE_TYPE_SIZE.
	* libgcc2.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Remove.

From-SVN: r215491
2014-09-23 01:48:46 +01:00
..
config re PR target/63312 (FAIL: gcc.dg/torture/float128-exact-underflow.c -O0 execution test) 2014-09-22 12:08:03 +01:00
soft-fp float128-mul-underflow.c, [...]: New tests. 2014-02-12 23:24:49 +00:00
ChangeLog Remove LIBGCC2_LONG_DOUBLE_TYPE_SIZE target macro. 2014-09-23 01:48:46 +01:00
Makefile.in crtstuff.c (USE_EH_FRAME_REGISTRY): Let USE_EH_FRAME_REGISTRY_ALWAYS override USE_PT_GNU_EH_FRAME. 2014-09-22 00:49:01 +00:00
config.host config.gcc (powerpc-wrs-vxworksmils): New configuration. 2014-09-19 08:11:55 +00:00
config.in Use i386-cpuinfo.c on all i386 targets 2012-05-10 08:51:39 +00:00
configure crtstuff.c (USE_EH_FRAME_REGISTRY): Let USE_EH_FRAME_REGISTRY_ALWAYS override USE_PT_GNU_EH_FRAME. 2014-09-22 00:49:01 +00:00
configure.ac crtstuff.c (USE_EH_FRAME_REGISTRY): Let USE_EH_FRAME_REGISTRY_ALWAYS override USE_PT_GNU_EH_FRAME. 2014-09-22 00:49:01 +00:00
crtstuff.c crtstuff.c (USE_EH_FRAME_REGISTRY): Let USE_EH_FRAME_REGISTRY_ALWAYS override USE_PT_GNU_EH_FRAME. 2014-09-22 00:49:01 +00:00
dfp-bit.c Update copyright years in libgcc/ 2014-01-02 22:25:22 +00:00
dfp-bit.h Remove LIBGCC2_LONG_DOUBLE_TYPE_SIZE target macro. 2014-09-23 01:48:46 +01:00
divmod.c Update copyright years in libgcc/ 2014-01-02 22:25:22 +00:00
empty.mk
emutls.c Update copyright years in libgcc/ 2014-01-02 22:25:22 +00:00
enable-execute-stack-empty.c enable-execute-stack-empty.c (__enable_execute_stack): Add prototype. 2011-06-22 13:20:07 +02:00
enable-execute-stack-mprotect.c config.gcc (*-*-dragonfly*): New target. 2014-05-21 12:08:58 +01:00
fixed-bit.c Update copyright years in libgcc/ 2014-01-02 22:25:22 +00:00
fixed-bit.h Remove LIBGCC2_HAS_?F_MODE target macros. 2014-09-12 13:05:18 +01:00
fixed-obj.mk Makefile.in (fixed-funcs,fixed-conv-funcs): filter-out LIB2FUNCS_EXCLUDE before adding them to libgcc-objects, libgcc-s-objects. 2012-08-23 15:41:03 +00:00
floatunsidf.c Move libgcc2 to toplevel libgcc 2011-11-02 15:23:48 +00:00
floatunsisf.c Move libgcc2 to toplevel libgcc 2011-11-02 15:23:48 +00:00
floatunsitf.c Move libgcc2 to toplevel libgcc 2011-11-02 15:23:48 +00:00
floatunsixf.c Move libgcc2 to toplevel libgcc 2011-11-02 15:23:48 +00:00
fp-bit.c Remove no-longer-needed fp-bit target macros. 2014-09-08 13:22:56 +01:00
fp-bit.h Update copyright years in libgcc/ 2014-01-02 22:25:22 +00:00
gbl-ctors.h Update copyright years in libgcc/ 2014-01-02 22:25:22 +00:00
gen-fixed.sh
generic-morestack-thread.c Update copyright years in libgcc/ 2014-01-02 22:25:22 +00:00
generic-morestack.c Use -fbuilding-libgcc for more target macros used in libgcc. 2014-09-05 13:03:46 +01:00
generic-morestack.h Update copyright years in libgcc/ 2014-01-02 22:25:22 +00:00
gstdint.h
gthr-posix.h Update copyright years in libgcc/ 2014-01-02 22:25:22 +00:00
gthr-single.h Update copyright years in libgcc/ 2014-01-02 22:25:22 +00:00
gthr.h Update copyright years in libgcc/ 2014-01-02 22:25:22 +00:00
libgcc-std.ver.in Update copyright years in libgcc/ 2014-01-02 22:25:22 +00:00
libgcc2.c Remove LIBGCC2_LONG_DOUBLE_TYPE_SIZE target macro. 2014-09-23 01:48:46 +01:00
libgcc2.h Remove LIBGCC2_LONG_DOUBLE_TYPE_SIZE target macro. 2014-09-23 01:48:46 +01:00
libgcov-driver-system.c libgcov-driver.c (struct gcov_filename_aux): Rename ... 2014-07-27 07:22:47 +00:00
libgcov-driver.c Makefile.in (LIBGCOV_INTERFACE): Add _gcov_dump from ... 2014-09-17 20:13:17 +00:00
libgcov-interface.c Makefile.in (LIBGCOV_INTERFACE): Add _gcov_dump from ... 2014-09-17 20:13:17 +00:00
libgcov-merge.c Add gcov-tool: an offline gcda profile processing tool Support. 2014-07-11 05:48:07 +00:00
libgcov-profiler.c Use -fbuilding-libgcc for more target macros used in libgcc. 2014-09-05 13:03:46 +01:00
libgcov-util.c libgcov-driver.c (struct gcov_filename_aux): Rename ... 2014-07-27 07:22:47 +00:00
libgcov.h Makefile.in (LIBGCOV_INTERFACE): Add _gcov_dump from ... 2014-09-17 20:13:17 +00:00
memcmp.c Move libgcc2 to toplevel libgcc 2011-11-02 15:23:48 +00:00
memcpy.c Move libgcc2 to toplevel libgcc 2011-11-02 15:23:48 +00:00
memmove.c Move libgcc2 to toplevel libgcc 2011-11-02 15:23:48 +00:00
memset.c Move libgcc2 to toplevel libgcc 2011-11-02 15:23:48 +00:00
mkheader.sh Update copyright years in libgcc/ 2014-01-02 22:25:22 +00:00
mkmap-flat.awk Update copyright years in libgcc/ 2014-01-02 22:25:22 +00:00
mkmap-symver.awk Update copyright years in libgcc/ 2014-01-02 22:25:22 +00:00
shared-object.mk shared-object.mk (c_flags-$o): Save c_flags. 2011-06-21 14:26:13 +00:00
siditi-object.mk Move libgcc2 to toplevel libgcc 2011-11-02 15:23:48 +00:00
static-object.mk Makefile.in (vis_hide, [...]): Do not make definitions depend on --enable-shared. 2012-08-22 09:36:23 +01:00
sync.c Update copyright years in libgcc/ 2014-01-02 22:25:22 +00:00
udivmod.c Update copyright years in libgcc/ 2014-01-02 22:25:22 +00:00
udivmodsi4.c Update copyright years in libgcc/ 2014-01-02 22:25:22 +00:00
unwind-arm-common.inc Update copyright years in libgcc/ 2014-01-02 22:25:22 +00:00
unwind-c.c Update copyright years in libgcc/ 2014-01-02 22:25:22 +00:00
unwind-compat.c Update copyright years in libgcc/ 2014-01-02 22:25:22 +00:00
unwind-compat.h Update copyright years in libgcc/ 2014-01-02 22:25:22 +00:00
unwind-dw2-fde-compat.c Update copyright years in libgcc/ 2014-01-02 22:25:22 +00:00
unwind-dw2-fde-dip.c config.gcc (*-*-dragonfly*): New target. 2014-05-21 12:08:58 +01:00
unwind-dw2-fde.c Update copyright years in libgcc/ 2014-01-02 22:25:22 +00:00
unwind-dw2-fde.h Update copyright years in libgcc/ 2014-01-02 22:25:22 +00:00
unwind-dw2.c Use -fbuilding-libgcc for more target macros used in libgcc. 2014-09-05 13:03:46 +01:00
unwind-dw2.h Use -fbuilding-libgcc for more target macros used in libgcc. 2014-09-05 13:03:46 +01:00
unwind-generic.h Update copyright years in libgcc/ 2014-01-02 22:25:22 +00:00
unwind-pe.h Update copyright years in libgcc/ 2014-01-02 22:25:22 +00:00
unwind-seh.c re PR libgcc/61585 (Subscript-out-of-range in unwind-seh.c?) 2014-06-23 18:20:31 +02:00
unwind-sjlj.c Use -fbuilding-libgcc for more target macros used in libgcc. 2014-09-05 13:03:46 +01:00
unwind.inc Update copyright years in libgcc/ 2014-01-02 22:25:22 +00:00
vtv_end.c Update copyright years in libgcc/ 2014-01-02 22:25:22 +00:00
vtv_end_preinit.c Update copyright years in libgcc/ 2014-01-02 22:25:22 +00:00
vtv_start.c Update copyright years in libgcc/ 2014-01-02 22:25:22 +00:00
vtv_start_preinit.c Update copyright years in libgcc/ 2014-01-02 22:25:22 +00:00