From 29f3def30844dd13e79972fa03a50af68120f7ac Mon Sep 17 00:00:00 2001 From: Georg-Johann Lay Date: Thu, 7 Nov 2019 09:19:31 +0000 Subject: Support 64-bit double and 64-bit long double configurations. gcc/ Support 64-bit double and 64-bit long double configurations. PR target/92055 * config.gcc (tm_defines) [avr]: Set from --with-double=, --with-long-double=. * config/avr/t-multilib: Remove. * config/avr/t-avr: Output of genmultilib.awk is now fully dynamically generated and no more part of the repo. (HAVE_DOUBLE_MULTILIB, HAVE_LONG_DOUBLE_MULTILIB): New variables. Pass them down to... * config/avr/genmultilib.awk: ...here and handle them. * gcc/config/avr/avr.opt (-mdouble=, avr_double). New option and var. (-mlong-double=, avr_long_double). New option and var. * common/config/avr/avr-common.c (opts.h, diagnostic.h): Include. (TARGET_OPTION_OPTIMIZATION_TABLE) <-mdouble=, -mlong-double=>: Set default as requested by --with-double= (TARGET_HANDLE_OPTION): Define to this... (avr_handle_option): ...new hook worker. * config/avr/avr.h (DOUBLE_TYPE_SIZE): Define to avr_double. (LONG_DOUBLE_TYPE_SIZE): Define to avr_long_double. (avr_double_lib): New proto for spec function. (EXTRA_SPEC_FUNCTIONS) : Add. (DRIVER_SELF_SPECS): Call %:double-lib. * config/avr/avr.c (avr_option_override): Assert sizeof(long double) >= sizeof(double) for the target. * config/avr/avr-c.c (avr_cpu_cpp_builtins) [__HAVE_DOUBLE_MULTILIB__, __HAVE_LONG_DOUBLE_MULTILIB__] [__HAVE_DOUBLE64__, __HAVE_DOUBLE32__, __DEFAULT_DOUBLE__=] [__HAVE_LONG_DOUBLE64__, __HAVE_LONG_DOUBLE32__] [__HAVE_LONG_DOUBLE_IS_DOUBLE__, __DEFAULT_LONG_DOUBLE__=]: New built-in define depending on --with-double=, --with-long-double=. * config/avr/driver-avr.c (avr_double_lib): New spec function. * doc/invoke.tex (AVR Options) <-mdouble=,-mlong-double=>: Doc. * doc/install.texi (Cross-Compiler-Specific Options) <--with-double=, --with-long-double=>: Doc. libgcc/ Support 64-bit double and 64-bit long double configurations. PR target/92055 * config/avr/t-avr (HOST_LIBGCC2_CFLAGS): Only add -DF=SF if long double is a 32-bit type. * config/avr/t-avrlibc: Copy double64 and long-double64 multilib(s) from the vanilla one. * config/avr/t-copy-libgcc: New Makefile snip. From-SVN: r277908 --- libgcc/ChangeLog | 11 +++++++++++ libgcc/config.host | 3 +++ libgcc/config/avr/t-avr | 8 ++++++-- libgcc/config/avr/t-avrlibc | 31 +++++++++++++++++++++++++++++++ libgcc/config/avr/t-copy-libgcc | 13 +++++++++++++ 5 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 libgcc/config/avr/t-copy-libgcc (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index c528cec..ff26a0c 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,14 @@ +2019-11-07 Georg-Johann Lay + + Support 64-bit double and 64-bit long double configurations. + + PR target/92055 + * config/avr/t-avr (HOST_LIBGCC2_CFLAGS): Only add -DF=SF if + long double is a 32-bit type. + * config/avr/t-avrlibc: Copy double64 and long-double64 + multilib(s) from the vanilla one. + * config/avr/t-copy-libgcc: New Makefile snip. + 2019-11-04 Jozef Lawrynowicz * crtstuff.c: Define USE_TM_CLONE_REGISTRY to 0 if it's undefined and diff --git a/libgcc/config.host b/libgcc/config.host index 122113f..0b8eb4e 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -505,6 +505,9 @@ avr-*-*) tmake_file="$tmake_file ${cpu_type}/t-avrlibc" fi tm_file="$tm_file avr/avr-lib.h" + if test x${with_fixed_point} = xno; then + fixed_point=no + fi ;; bfin*-elf*) tmake_file="bfin/t-bfin bfin/t-crtlibid bfin/t-crtstuff t-libgcc-pic t-fdpbit" diff --git a/libgcc/config/avr/t-avr b/libgcc/config/avr/t-avr index c420c5d..e4f867b 100644 --- a/libgcc/config/avr/t-avr +++ b/libgcc/config/avr/t-avr @@ -112,10 +112,14 @@ LIB2FUNCS_EXCLUDE = \ _clrsbdi2 \ -# We do not have the DF type. +ifeq ($(long_double_type_size),32) +# We do not have the DFtype. +HOST_LIBGCC2_CFLAGS += -DDF=SF +endif + # Most of the C functions in libgcc2 use almost all registers, # so use -mcall-prologues for smaller code size. -HOST_LIBGCC2_CFLAGS += -DDF=SF -Dinhibit_libc -mcall-prologues -Os +HOST_LIBGCC2_CFLAGS += -Dinhibit_libc -mcall-prologues -Os # Extra 16-bit integer functions. intfuncs16 = _absvXX2 _addvXX3 _subvXX3 _mulvXX3 _negvXX2 _clrsbXX2 diff --git a/libgcc/config/avr/t-avrlibc b/libgcc/config/avr/t-avrlibc index d2c8b87..2424d66 100644 --- a/libgcc/config/avr/t-avrlibc +++ b/libgcc/config/avr/t-avrlibc @@ -64,3 +64,34 @@ LIB2FUNCS_EXCLUDE += \ _fixunssfsi _fixsfdi \ _fixunssfdi \ _floatdisf _floatundisf + +ifneq (,$(findstring avr,$(MULTISUBDIR))) + +# We are not in the avr2 (default) subdir, hence copying will work. +# In default dir, copying won'twork because the default multilib is +# built after all the others. + +ifneq (,$(findstring double64,$(MULTISUBDIR))) + +# We are in double64/libgcc or long-double64/libgcc: +# Just copy from the [long ]double=float multilib; we would remove any DFmode +# bits from this multilib variant, anyway, because the current assumption +# is that avr-libc hosts *all* the IEEE-double stuff. + +LIB2FUNCS_EXCLUDE := % +LIB1ASMFUNCS := +libgcc-objects := +libgcov-objects := +objects := + +t-copy-libgcc.dep: $(srcdir)/config/avr/t-copy-libgcc + -rm -f libgcc.a + -rm -f libgcov.a + cp $< $@ + +libgcc.a libgcov.a libgcc_tm.h: t-copy-libgcc.dep + +Makefile: t-copy-libgcc.dep + +endif +endif diff --git a/libgcc/config/avr/t-copy-libgcc b/libgcc/config/avr/t-copy-libgcc new file mode 100644 index 0000000..d34cbde --- /dev/null +++ b/libgcc/config/avr/t-copy-libgcc @@ -0,0 +1,13 @@ +# Only used with --with-avrlibc & (-mlong-double=64 | -mdouble=64) +# +# Inserted at the end of Makefile by magic[tm]. +# We need this *after* Makefile's rules so we can override them. + +libgcc.a: ../../libgcc/libgcc.a + cp $< $@ + +libgcov.a: ../../libgcc/libgcov.a + @: +ifeq ($(enable_gcov),yes) + cp $< $@ +endif -- cgit v1.1