From: Richard Henderson Date: Mon, 8 Mar 2004 03:21:46 +0000 (-0800) Subject: alpha.h (MASK_LONG_DOUBLE_128): New. X-Git-Tag: releases/gcc-3.3.4~188 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=23acb6d829320e2119ccb4cd7f348ed8df2ca863;p=thirdparty%2Fgcc.git alpha.h (MASK_LONG_DOUBLE_128): New. * config/alpha/alpha.h (MASK_LONG_DOUBLE_128): New. (TARGET_LONG_DOUBLE_128): New. (TARGET_SWITCHES): Add long-double-{128,64}. (TARGET_HAS_XFLOATING_LIBS): Default to TARGET_LONG_DOUBLE_128. (LONG_DOUBLE_TYPE_SIZE): Honor TARGET_LONG_DOUBLE_128. (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): New. (WIDEST_HARDWARE_FP_SIZE): New. (TARGET_CPU_CPP_BUILTINS): Define __LONG_DOUBLE_128__. * config/alpha/alpha.c (override_options): Clear MASK_LONG_DOUBLE_128 if TARGET_VAX_FLOAT. * config/alpha/osf5.h (LONG_DOUBLE_TYPE_SIZE): Remove. (TARGET_DEFAULT): Set MASK_LONG_DOUBLE_128. From-SVN: r79091 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ff9cb6461080..2e6081dc5460 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,18 @@ +2004-03-07 Richard Henderson + + * config/alpha/alpha.h (MASK_LONG_DOUBLE_128): New. + (TARGET_LONG_DOUBLE_128): New. + (TARGET_SWITCHES): Add long-double-{128,64}. + (TARGET_HAS_XFLOATING_LIBS): Default to TARGET_LONG_DOUBLE_128. + (LONG_DOUBLE_TYPE_SIZE): Honor TARGET_LONG_DOUBLE_128. + (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): New. + (WIDEST_HARDWARE_FP_SIZE): New. + (TARGET_CPU_CPP_BUILTINS): Define __LONG_DOUBLE_128__. + * config/alpha/alpha.c (override_options): Clear MASK_LONG_DOUBLE_128 + if TARGET_VAX_FLOAT. + * config/alpha/osf5.h (LONG_DOUBLE_TYPE_SIZE): Remove. + (TARGET_DEFAULT): Set MASK_LONG_DOUBLE_128. + 2004-03-08 Hans-Peter Nilsson PR target/14471 diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c index 3afb8b64c1d8..3a0bde446397 100644 --- a/gcc/config/alpha/alpha.c +++ b/gcc/config/alpha/alpha.c @@ -501,6 +501,9 @@ override_options () warning ("trap mode not supported for VAX floats"); alpha_fptm = ALPHA_FPTM_SU; } + if (target_flags_explicit & MASK_LONG_DOUBLE_128) + warning ("128-bit long double not supported for VAX floats"); + target_flags &= ~MASK_LONG_DOUBLE_128; } { diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h index 6b52700e7e8f..bba5abbd8f41 100644 --- a/gcc/config/alpha/alpha.h +++ b/gcc/config/alpha/alpha.h @@ -67,6 +67,8 @@ Boston, MA 02111-1307, USA. */ builtin_define ("_IEEE_FP"); \ if (TARGET_IEEE_WITH_INEXACT) \ builtin_define ("_IEEE_FP_INEXACT"); \ + if (TARGET_LONG_DOUBLE_128) \ + builtin_define ("__LONG_DOUBLE_128__"); \ \ /* Macros dependent on the C dialect. */ \ SUBTARGET_LANGUAGE_CPP_BUILTINS(); \ @@ -222,6 +224,11 @@ extern int alpha_tls_size; #define MASK_TLS_KERNEL (1 << 14) #define TARGET_TLS_KERNEL (target_flags & MASK_TLS_KERNEL) +/* This means use IEEE quad-format for long double. Assumes the + presence of the GEM support library routines. */ +#define MASK_LONG_DOUBLE_128 (1 << 16) +#define TARGET_LONG_DOUBLE_128 (target_flags & MASK_LONG_DOUBLE_128) + /* This means that the processor is an EV5, EV56, or PCA56. Unlike alpha_cpu this is not affected by -mtune= setting. */ #define MASK_CPU_EV5 (1 << 28) @@ -254,7 +261,7 @@ extern int alpha_tls_size; #define TARGET_CAN_FAULT_IN_PROLOGUE 0 #endif #ifndef TARGET_HAS_XFLOATING_LIBS -#define TARGET_HAS_XFLOATING_LIBS 0 +#define TARGET_HAS_XFLOATING_LIBS TARGET_LONG_DOUBLE_128 #endif #ifndef TARGET_PROFILING_NEEDS_GP #define TARGET_PROFILING_NEEDS_GP 0 @@ -312,6 +319,10 @@ extern int alpha_tls_size; N_("Emit 32-bit relocations to the small data areas")}, \ {"tls-kernel", MASK_TLS_KERNEL, \ N_("Emit rdval instead of rduniq for thread pointer")}, \ + {"long-double-128", MASK_LONG_DOUBLE_128, \ + N_("Use 128-bit long double")}, \ + {"long-double-64", -MASK_LONG_DOUBLE_128, \ + N_("Use 64-bit long double")}, \ {"", TARGET_DEFAULT | TARGET_CPU_DEFAULT \ | TARGET_DEFAULT_EXPLICIT_RELOCS, ""} } @@ -421,7 +432,18 @@ extern const char *alpha_tls_size_string; /* For -mtls-size= */ #define FLOAT_TYPE_SIZE 32 #define DOUBLE_TYPE_SIZE 64 -#define LONG_DOUBLE_TYPE_SIZE 64 +#define LONG_DOUBLE_TYPE_SIZE (TARGET_LONG_DOUBLE_128 ? 128 : 64) + +/* Define this to set long double type size to use in libgcc2.c, which can + not depend on target_flags. */ +#ifdef __LONG_DOUBLE_128__ +#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128 +#else +#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64 +#endif + +/* Work around target_flags dependency in ada/targtyps.c. */ +#define WIDEST_HARDWARE_FP_SIZE 64 #define WCHAR_TYPE "unsigned int" #define WCHAR_TYPE_SIZE 32 diff --git a/gcc/config/alpha/osf5.h b/gcc/config/alpha/osf5.h index e483124691e7..61cc8e27243a 100644 --- a/gcc/config/alpha/osf5.h +++ b/gcc/config/alpha/osf5.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler, for DEC Alpha on Tru64 5. - Copyright (C) 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2004 Free Software Foundation, Inc. This file is part of GNU CC. @@ -19,11 +19,8 @@ Boston, MA 02111-1307, USA. */ /* Tru64 5.1 uses IEEE QUAD format. */ -/* ??? However, since there is no support for VAX H_floating, we must - drop back to a 64-bit long double to avoid a crash looking for the - format associated with TFmode. */ -#undef LONG_DOUBLE_TYPE_SIZE -#define LONG_DOUBLE_TYPE_SIZE (TARGET_FLOAT_VAX ? 64 : 128) +#undef TARGET_DEFAULT +#define TARGET_DEFAULT MASK_FP | MASK_FPREGS | MASK_LONG_DOUBLE_128 /* In Tru64 UNIX V5.1, Compaq introduced a new assembler (/usr/lib/cmplrs/cc/adu) which currently (versions between 3.04.29 and