aboutsummaryrefslogtreecommitdiff
path: root/gcc/config.gcc
diff options
context:
space:
mode:
authorGeorg-Johann Lay <avr@gjlay.de>2019-11-07 09:19:31 +0000
committerGeorg-Johann Lay <gjl@gcc.gnu.org>2019-11-07 09:19:31 +0000
commit29f3def30844dd13e79972fa03a50af68120f7ac (patch)
tree270260e9909fa2a95f28ea376624c6c735ad5f73 /gcc/config.gcc
parent76bc24ff68284d90bc8d334b72c9690382747add (diff)
downloadgcc-29f3def30844dd13e79972fa03a50af68120f7ac.zip
gcc-29f3def30844dd13e79972fa03a50af68120f7ac.tar.gz
gcc-29f3def30844dd13e79972fa03a50af68120f7ac.tar.bz2
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) <double-lib>: 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
Diffstat (limited to 'gcc/config.gcc')
-rw-r--r--gcc/config.gcc82
1 files changed, 82 insertions, 0 deletions
diff --git a/gcc/config.gcc b/gcc/config.gcc
index d74bcbb..72f65640 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -1287,6 +1287,88 @@ avr-*-*)
tm_file="${tm_file} ${cpu_type}/avrlibc.h"
tm_defines="${tm_defines} WITH_AVRLIBC"
fi
+ case y${with_double} in
+ y | y32)
+ avr_double=32
+ tm_defines="${tm_defines} HAVE_DOUBLE32"
+ ;;
+ y64)
+ avr_double=64
+ tm_defines="${tm_defines} HAVE_DOUBLE64"
+ ;;
+ y64,32)
+ avr_double=64
+ avr_double_multilib=1
+ tm_defines="${tm_defines} HAVE_DOUBLE32"
+ tm_defines="${tm_defines} HAVE_DOUBLE64"
+ tm_defines="${tm_defines} HAVE_DOUBLE_MULTILIB"
+ ;;
+ y32,64)
+ avr_double=32
+ avr_double_multilib=1
+ tm_defines="${tm_defines} HAVE_DOUBLE32"
+ tm_defines="${tm_defines} HAVE_DOUBLE64"
+ tm_defines="${tm_defines} HAVE_DOUBLE_MULTILIB"
+ ;;
+ *)
+ echo "Error: --with-double= can only be used with: '32', '32,64', '64,32', '64'" 1>&2
+ exit 1
+ ;;
+ esac
+ case y${with_long_double} in
+ y | y32)
+ avr_long_double=32
+ tm_defines="${tm_defines} HAVE_LONG_DOUBLE32"
+ ;;
+ y64)
+ avr_long_double=64
+ tm_defines="${tm_defines} HAVE_LONG_DOUBLE64"
+ ;;
+ y64,32)
+ avr_long_double=64
+ avr_long_double_multilib=1
+ tm_defines="${tm_defines} HAVE_LONG_DOUBLE32"
+ tm_defines="${tm_defines} HAVE_LONG_DOUBLE64"
+ tm_defines="${tm_defines} HAVE_LONG_DOUBLE_MULTILIB"
+ ;;
+ y32,64)
+ avr_long_double=32
+ avr_long_double_multilib=1
+ tm_defines="${tm_defines} HAVE_LONG_DOUBLE32"
+ tm_defines="${tm_defines} HAVE_LONG_DOUBLE64"
+ tm_defines="${tm_defines} HAVE_LONG_DOUBLE_MULTILIB"
+ ;;
+ ydouble)
+ avr_long_double=${avr_double}
+ tm_defines="${tm_defines} HAVE_LONG_DOUBLE_IS_DOUBLE"
+ if test y${avr_double_multilib} = y1; then
+ tm_defines="${tm_defines} HAVE_LONG_DOUBLE32"
+ tm_defines="${tm_defines} HAVE_LONG_DOUBLE64"
+ else
+ tm_defines="${tm_defines} HAVE_LONG_DOUBLE${avr_long_double}"
+ fi
+ ;;
+ *)
+ echo "Error: --with-long_double= can only be used with: '32', '32,64', '64,32', '64', 'double'" 1>&2
+ exit 1
+ ;;
+ esac
+ if test ${avr_long_double}x${avr_long_double_multilib}y${avr_double_multilib}z = 32xy1z; then
+ if test y${with_long_double} != ydouble; then
+ echo "Error: --with-double=${with_double} requests a multilib for double, but long double is always 32 bits wide due to --with-long-double=${with_long_double}" 1>&2
+ exit 1
+ fi
+ fi
+ if test ${avr_double}x${avr_long_double_multilib}y${avr_double_multilib}z = 64x1yz; then
+ echo "Error: --with-long-double=${with_long_double} requests a multilib for long double, but double is always 64 bits wide due to --with-double=64" 1>&2
+ exit 1
+ fi
+ if test y${avr_double}${avr_long_double} = y6432; then
+ echo "Error: double default of 64 bits from --with-double=${with_double} conflicts with default of 32 bits for long double from --with-long-double=${with_long_double}" 1>&2
+ exit 1
+ fi
+ tm_defines="${tm_defines} WITH_DOUBLE${avr_double}"
+ tm_defines="${tm_defines} WITH_LONG_DOUBLE${avr_long_double}"
tmake_file="${tmake_file} avr/t-avr avr/t-multilib"
use_gcc_stdint=wrap
extra_gcc_objs="driver-avr.o avr-devices.o"