aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2002-09-21 09:10:36 -0700
committerRichard Henderson <rth@gcc.gnu.org>2002-09-21 09:10:36 -0700
commit3dc85dfb4af5543dc2b997d19e4c33260e58983b (patch)
treecf255ab7cc385de8be819f436b5513ec3c5357c2 /gcc/config
parent838dfd8a4ef2572d4831643b01d70f78ba6e7747 (diff)
downloadgcc-3dc85dfb4af5543dc2b997d19e4c33260e58983b.zip
gcc-3dc85dfb4af5543dc2b997d19e4c33260e58983b.tar.gz
gcc-3dc85dfb4af5543dc2b997d19e4c33260e58983b.tar.bz2
real.c (struct real_format): Move to real.h.
* real.c (struct real_format): Move to real.h. (real_format_for_mode): Rename from fmt_for_mode; update all users; initialize with ieee defaults. (real_to_target_fmt, real_from_target_fmt): New. (ieee_single_format, ieee_double_format, ieee_extended_motorola_format, ieee_extended_intel_96_format, ieee_extended_intel_128_format, ieee_quad_format, i370_single_format, i370_double_format, c4x_single_format, c4x_extended_format): Rename from s/_format//. (ieee_quad_format): Fix emin. (format_for_size, init_real_once): Remove. * real.h (struct real_format): Move from real.c. (real_format_for_mode): Declare. (real_to_target_fmt, real_from_target_fmt): Declare. (ieee_single_format, ieee_double_format, ieee_extended_motorola_format, ieee_extended_intel_96_format, ieee_extended_intel_128_format, ieee_quad_format, vax_f_format, vax_d_format, vax_g_format, i370_single_format, i370_double_format, c4x_single_format, c4x_extended_format): Declare. * toplev.c (do_compile): Don't call init_real_once. * defaults.h (INTEL_EXTENDED_IEEE_FORMAT): Remove. * doc/tm.texi (INTEL_EXTENDED_IEEE_FORMAT): Remove. * config/alpha/alpha.h (TARGET_FLOAT_FORMAT): Define. * config/alpha/osf5.h (LONG_DOUBLE_TYPE_SIZE): 64, if vax mode. * config/alpha/alpha.c (override_options): Set real_format_for_mode for VAX, if enabled. * config/c4x/c4x.c (c4x_override_options): Set real_format_for_mode for C4X. * config/i370/i370.h (OVERRIDE_OPTIONS): New. * config/i370/i370.c (override_options): New. * config/i370/i370-protos.h: Update. * config/i386/i386.c (override_options): Set real_format_for_mode for Intel 80-bit extended. * config/i386/i386.h (INTEL_EXTENDED_IEEE_FORMAT): Remove. * config/i960/i960.h (LONG_DOUBLE_TYPE_SIZE): Mind -mlong-double-64. (OVERRIDE_OPTIONS): Move code... * config/i960/i960.c (i960_initialize): ... here. Set real_format_for_mode for Intel 80-bit extended. * config/ia64/ia64.c (ia64_override_options): Set real_format_for_mode for Intel 80-bit extended, if enabled. * config/m68k/m68k.c (override_options): Set real_format_for_mode for Motorola 96-bit extended. * config/vax/vax.h (OVERRIDE_OPTIONS): New. * config/vax/vax.c (override_options): New. * config/vax/vax-protos.h: Update. From-SVN: r57388
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/alpha/alpha.c8
-rw-r--r--gcc/config/alpha/alpha.h4
-rw-r--r--gcc/config/alpha/osf5.h6
-rw-r--r--gcc/config/c4x/c4x.c5
-rw-r--r--gcc/config/i370/i370-protos.h2
-rw-r--r--gcc/config/i370/i370.c12
-rw-r--r--gcc/config/i370/i370.h2
-rw-r--r--gcc/config/i386/i386.c5
-rw-r--r--gcc/config/i386/i386.h6
-rw-r--r--gcc/config/i960/i960.c41
-rw-r--r--gcc/config/i960/i960.h44
-rw-r--r--gcc/config/ia64/hpux_longdouble.h3
-rw-r--r--gcc/config/ia64/ia64.c4
-rw-r--r--gcc/config/ia64/ia64.h5
-rw-r--r--gcc/config/m68k/m68k.c3
-rw-r--r--gcc/config/vax/vax-protos.h2
-rw-r--r--gcc/config/vax/vax.c12
-rw-r--r--gcc/config/vax/vax.h3
18 files changed, 113 insertions, 54 deletions
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index f7963be..d26cb54 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -567,6 +567,14 @@ override_options ()
/* Set up function hooks. */
init_machine_status = alpha_init_machine_status;
+
+ /* Tell the compiler when we're using VAX floating point. */
+ if (TARGET_FLOAT_VAX)
+ {
+ real_format_for_mode[SFmode - QFmode] = &vax_f_format;
+ real_format_for_mode[DFmode - QFmode] = &vax_g_format;
+ real_format_for_mode[TFmode - QFmode] = NULL;
+ }
}
/* Returns 1 if VALUE is a mask that contains full bytes of zero or ones. */
diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h
index cf20383..4e94e88 100644
--- a/gcc/config/alpha/alpha.h
+++ b/gcc/config/alpha/alpha.h
@@ -411,6 +411,10 @@ extern const char *alpha_tls_size_string; /* For -mtls-size= */
/* Define the size of `long long'. The default is the twice the word size. */
#define LONG_LONG_TYPE_SIZE 64
+/* We're IEEE unless someone says to use VAX. */
+#define TARGET_FLOAT_FORMAT \
+ (TARGET_FLOAT_VAX ? VAX_FLOAT_FORMAT : IEEE_FLOAT_FORMAT)
+
/* The two floating-point formats we support are S-floating, which is
4 bytes, and T-floating, which is 8 bytes. `float' is S and `double'
and `long double' are T. */
diff --git a/gcc/config/alpha/osf5.h b/gcc/config/alpha/osf5.h
index 59b3ae1..e483124 100644
--- a/gcc/config/alpha/osf5.h
+++ b/gcc/config/alpha/osf5.h
@@ -18,8 +18,12 @@
the Free Software Foundation, 59 Temple Place - Suite 330,
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 128
+#define LONG_DOUBLE_TYPE_SIZE (TARGET_FLOAT_VAX ? 64 : 128)
/* In Tru64 UNIX V5.1, Compaq introduced a new assembler
(/usr/lib/cmplrs/cc/adu) which currently (versions between 3.04.29 and
diff --git a/gcc/config/c4x/c4x.c b/gcc/config/c4x/c4x.c
index 83ab331..cbf0567 100644
--- a/gcc/config/c4x/c4x.c
+++ b/gcc/config/c4x/c4x.c
@@ -294,6 +294,11 @@ c4x_override_options ()
This provides compatibility with the old -mno-aliases option. */
if (! TARGET_ALIASES && ! flag_argument_noalias)
flag_argument_noalias = 1;
+
+ /* We're C4X floating point, not IEEE floating point. */
+ memset (real_format_for_mode, 0, sizeof real_format_for_mode);
+ real_format_for_mode[QFmode - QFmode] = &c4x_single_format;
+ real_format_for_mode[HFmode - QFmode] = &c4x_extended_format;
}
diff --git a/gcc/config/i370/i370-protos.h b/gcc/config/i370/i370-protos.h
index 8ca7ca6..a3f4acd 100644
--- a/gcc/config/i370/i370-protos.h
+++ b/gcc/config/i370/i370-protos.h
@@ -24,6 +24,8 @@ Boston, MA 02111-1307, USA. */
#ifndef GCC_I370_PROTOS_H
#define GCC_I370_PROTOS_H
+extern void override_options PARAMS ((void));
+
#ifdef RTX_CODE
extern int i370_branch_dest PARAMS ((rtx));
extern int i370_branch_length PARAMS ((rtx));
diff --git a/gcc/config/i370/i370.c b/gcc/config/i370/i370.c
index 92d2795..b4474db 100644
--- a/gcc/config/i370/i370.c
+++ b/gcc/config/i370/i370.c
@@ -315,6 +315,18 @@ static const unsigned char ebcasc[256] =
struct gcc_target targetm = TARGET_INITIALIZER;
+/* Set global variables as needed for the options enabled. */
+
+void
+override_options ()
+{
+ /* We're 370 floating point, not IEEE floating point. */
+ memset (real_format_for_mode, 0, sizeof real_format_for_mode);
+ real_format_for_mode[SFmode - QFmode] = &i370_single_format;
+ real_format_for_mode[DFmode - QFmode] = &i370_double_format;
+}
+
+
/* Map characters from one character set to another.
C is the character to be translated. */
diff --git a/gcc/config/i370/i370.h b/gcc/config/i370/i370.h
index d4c2939..a2aff67 100644
--- a/gcc/config/i370/i370.h
+++ b/gcc/config/i370/i370.h
@@ -76,6 +76,8 @@ extern int mvs_function_name_length;
{ "no-char-instructions", -1, N_("Do not generate char instructions")}, \
{ "", TARGET_DEFAULT, 0} }
+#define OVERRIDE_OPTIONS override_options ()
+
/* To use IBM supplied macro function prologue and epilogue, define the
following to 1. Should only be needed if IBM changes the definition
of their prologue and epilogue. */
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index f36206c..252c724 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -937,6 +937,11 @@ override_options ()
int const pta_size = ARRAY_SIZE (processor_alias_table);
+ /* By default our XFmode is the 80-bit extended format. If we have
+ use TFmode instead, it's also the 80-bit format, but with padding. */
+ real_format_for_mode[XFmode - QFmode] = &ieee_extended_intel_96_format;
+ real_format_for_mode[TFmode - QFmode] = &ieee_extended_intel_128_format;
+
#ifdef SUBTARGET_OVERRIDE_OPTIONS
SUBTARGET_OVERRIDE_OPTIONS;
#endif
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 2d46a9f..7cd3962 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -631,8 +631,7 @@ extern int x86_prefetch_sse;
/* Define for XFmode or TFmode extended real floating point support.
The XFmode is specified by i386 ABI, while TFmode may be faster
- due to alignment and simplifications in the address calculations.
- */
+ due to alignment and simplifications in the address calculations. */
#define LONG_DOUBLE_TYPE_SIZE (TARGET_128BIT_LONG_DOUBLE ? 128 : 96)
#define MAX_LONG_DOUBLE_TYPE_SIZE 128
#ifdef __x86_64__
@@ -640,9 +639,6 @@ extern int x86_prefetch_sse;
#else
#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 96
#endif
-/* Tell real.c that this is the 80-bit Intel extended float format
- packaged in a 128-bit or 96bit entity. */
-#define INTEL_EXTENDED_IEEE_FORMAT 1
/* Set the value of FLT_EVAL_METHOD in float.h. When using only the
FPU, assume that the fpcw is set to extended precision; when using
diff --git a/gcc/config/i960/i960.c b/gcc/config/i960/i960.c
index 7ebbb9e..7dbe852 100644
--- a/gcc/config/i960/i960.c
+++ b/gcc/config/i960/i960.c
@@ -100,11 +100,47 @@ static int ret_label = 0;
struct gcc_target targetm = TARGET_INITIALIZER;
-/* Initialize variables before compiling any files. */
+/* Override conflicting target switch options.
+ Doesn't actually detect if more than one -mARCH option is given, but
+ does handle the case of two blatantly conflicting -mARCH options.
+
+ Also initialize variables before compiling any files. */
void
i960_initialize ()
{
+ if (TARGET_K_SERIES && TARGET_C_SERIES)
+ {
+ warning ("conflicting architectures defined - using C series");
+ target_flags &= ~TARGET_FLAG_K_SERIES;
+ }
+ if (TARGET_K_SERIES && TARGET_MC)
+ {
+ warning ("conflicting architectures defined - using K series");
+ target_flags &= ~TARGET_FLAG_MC;
+ }
+ if (TARGET_C_SERIES && TARGET_MC)
+ {
+ warning ("conflicting architectures defined - using C series");
+ target_flags &= ~TARGET_FLAG_MC;
+ }
+ if (TARGET_IC_COMPAT3_0)
+ {
+ flag_short_enums = 1;
+ flag_signed_char = 1;
+ target_flags |= TARGET_FLAG_CLEAN_LINKAGE;
+ if (TARGET_IC_COMPAT2_0)
+ {
+ warning ("iC2.0 and iC3.0 are incompatible - using iC3.0");
+ target_flags &= ~TARGET_FLAG_IC_COMPAT2_0;
+ }
+ }
+ if (TARGET_IC_COMPAT2_0)
+ {
+ flag_signed_char = 1;
+ target_flags |= TARGET_FLAG_CLEAN_LINKAGE;
+ }
+
if (TARGET_IC_COMPAT2_0)
{
i960_maxbitalignment = 8;
@@ -115,6 +151,9 @@ i960_initialize ()
i960_maxbitalignment = 128;
i960_last_maxbitalignment = 8;
}
+
+ /* Tell the compiler which flavor of XFmode we're using. */
+ real_format_for_mode[XFmode - QFmode] = &ieee_extended_intel_96_format;
}
/* Return true if OP can be used as the source of an fp move insn. */
diff --git a/gcc/config/i960/i960.h b/gcc/config/i960/i960.h
index 37c9afb..a669cf4 100644
--- a/gcc/config/i960/i960.h
+++ b/gcc/config/i960/i960.h
@@ -335,44 +335,7 @@ extern int target_flags;
/* Override conflicting target switch options.
Doesn't actually detect if more than one -mARCH option is given, but
does handle the case of two blatantly conflicting -mARCH options. */
-#define OVERRIDE_OPTIONS \
-{ \
- if (TARGET_K_SERIES && TARGET_C_SERIES) \
- { \
- warning ("conflicting architectures defined - using C series"); \
- target_flags &= ~TARGET_FLAG_K_SERIES; \
- } \
- if (TARGET_K_SERIES && TARGET_MC) \
- { \
- warning ("conflicting architectures defined - using K series"); \
- target_flags &= ~TARGET_FLAG_MC; \
- } \
- if (TARGET_C_SERIES && TARGET_MC) \
- { \
- warning ("conflicting architectures defined - using C series");\
- target_flags &= ~TARGET_FLAG_MC; \
- } \
- if (TARGET_IC_COMPAT3_0) \
- { \
- flag_short_enums = 1; \
- flag_signed_char = 1; \
- target_flags |= TARGET_FLAG_CLEAN_LINKAGE; \
- if (TARGET_IC_COMPAT2_0) \
- { \
- warning ("iC2.0 and iC3.0 are incompatible - using iC3.0"); \
- target_flags &= ~TARGET_FLAG_IC_COMPAT2_0; \
- } \
- } \
- if (TARGET_IC_COMPAT2_0) \
- { \
- flag_signed_char = 1; \
- target_flags |= TARGET_FLAG_CLEAN_LINKAGE; \
- } \
- /* ??? See the LONG_DOUBLE_TYPE_SIZE definition below. */ \
- if (TARGET_LONG_DOUBLE_64) \
- warning ("the -mlong-double-64 option does not work yet");\
- i960_initialize (); \
-}
+#define OVERRIDE_OPTIONS i960_initialize ()
/* Don't enable anything by default. The user is expected to supply a -mARCH
option. If none is given, then -mka is added by CC1_SPEC. */
@@ -402,10 +365,7 @@ extern int target_flags;
/* Width in bits of a long double. Define to 96, and let
ROUND_TYPE_ALIGN adjust the alignment for speed. */
#define LONG_DOUBLE_TYPE_SIZE (TARGET_LONG_DOUBLE_64 ? 64 : 96)
-
-/* ??? This must be a constant, because real.c and real.h test it with #if. */
-#undef LONG_DOUBLE_TYPE_SIZE
-#define LONG_DOUBLE_TYPE_SIZE 96
+#define MAX_LONG_DOUBLE_TYPE_SIZE 96
/* Define this to set long double type size to use in libgcc2.c, which can
not depend on target_flags. */
diff --git a/gcc/config/ia64/hpux_longdouble.h b/gcc/config/ia64/hpux_longdouble.h
index bfc12d4..d1af4a0 100644
--- a/gcc/config/ia64/hpux_longdouble.h
+++ b/gcc/config/ia64/hpux_longdouble.h
@@ -18,8 +18,7 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* Tell real.c that we are not using INTEL_EXTENDED_IEEE_FORMAT */
-
+/* We are using IEEE quad precision, not a double-extended with padding. */
#undef INTEL_EXTENDED_IEEE_FORMAT
#define INTEL_EXTENDED_IEEE_FORMAT 0
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index c27a6fb..ad2d9b7 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -4182,6 +4182,10 @@ ia64_override_options ()
ia64_section_threshold = g_switch_set ? g_switch_value : IA64_DEFAULT_GVALUE;
init_machine_status = ia64_init_machine_status;
+
+ /* Tell the compiler which flavor of TFmode we're using. */
+ if (INTEL_EXTENDED_IEEE_FORMAT)
+ real_format_for_mode[TFmode - QFmode] = &ieee_extended_intel_128_format;
}
static enum attr_itanium_requires_unit0 ia64_safe_itanium_requires_unit0 PARAMS((rtx));
diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h
index 8c8708d..31dd3cd 100644
--- a/gcc/config/ia64/ia64.h
+++ b/gcc/config/ia64/ia64.h
@@ -381,9 +381,8 @@ while (0)
#define LONG_DOUBLE_TYPE_SIZE 128
-/* Tell real.c that this is the 80-bit Intel extended float format
- packaged in a 128-bit entity. */
-
+/* By default we use the 80-bit Intel extended float format packaged
+ in a 128-bit entity. */
#define INTEL_EXTENDED_IEEE_FORMAT 1
#define DEFAULT_SIGNED_CHAR 1
diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c
index cc03879..6114664 100644
--- a/gcc/config/m68k/m68k.c
+++ b/gcc/config/m68k/m68k.c
@@ -174,6 +174,9 @@ override_options ()
else
m68k_align_funcs = i;
}
+
+ /* Tell the compiler which flavor of XFmode we're using. */
+ real_format_for_mode[XFmode - QFmode] = &ieee_extended_motorola_format;
}
/* This function generates the assembly code for function entry.
diff --git a/gcc/config/vax/vax-protos.h b/gcc/config/vax/vax-protos.h
index f3a239d..059994f 100644
--- a/gcc/config/vax/vax-protos.h
+++ b/gcc/config/vax/vax-protos.h
@@ -18,6 +18,8 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+extern void override_options PARAMS ((void));
+
#ifdef RTX_CODE
extern const char *rev_cond_name PARAMS ((rtx));
extern void split_quadword_operands PARAMS ((rtx *, rtx *, int));
diff --git a/gcc/config/vax/vax.c b/gcc/config/vax/vax.c
index c00189f..1a83eba 100644
--- a/gcc/config/vax/vax.c
+++ b/gcc/config/vax/vax.c
@@ -66,6 +66,18 @@ static void vms_globalize_label PARAMS ((FILE *, const char *));
struct gcc_target targetm = TARGET_INITIALIZER;
+/* Set global variables as needed for the options enabled. */
+
+void
+override_options ()
+{
+ /* We're VAX floating point, not IEEE floating point. */
+ memset (real_format_for_mode, 0, sizeof real_format_for_mode);
+ real_format_for_mode[SFmode - QFmode] = &vax_f_format;
+ real_format_for_mode[DFmode - QFmode]
+ = (TARGET_G_FLOAT ? &vax_g_format : &vax_d_format);
+}
+
/* Generate the assembly code for function entry. FILE is a stdio
stream to output the code to. SIZE is an int: how many units of
temporary storage to allocate.
diff --git a/gcc/config/vax/vax.h b/gcc/config/vax/vax.h
index e51f064..6651a02 100644
--- a/gcc/config/vax/vax.h
+++ b/gcc/config/vax/vax.h
@@ -106,6 +106,9 @@ extern int target_flags;
#ifndef TARGET_DEFAULT
#define TARGET_DEFAULT (MASK_UNIX_ASM)
#endif
+
+#define OVERRIDE_OPTIONS override_options ()
+
/* Target machine storage layout */