summaryrefslogtreecommitdiff
path: root/gcc/config/m68k/m68k-none.h
diff options
context:
space:
mode:
authordje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>1996-02-01 00:24:40 +0000
committerdje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>1996-02-01 00:24:40 +0000
commitd5ce9abeb6d0cde3eefd65e2a7a75b96309821b7 (patch)
treeb1f7827c82b9dda7087d4501af01d0b0173edb2a /gcc/config/m68k/m68k-none.h
parentfbe909161accb44a92b706e871ee22817876c629 (diff)
downloadgcc-d5ce9abeb6d0cde3eefd65e2a7a75b96309821b7.tar.gz
Rewrite to use EXTRA_SPECS.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@11148 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/m68k/m68k-none.h')
-rw-r--r--gcc/config/m68k/m68k-none.h203
1 files changed, 144 insertions, 59 deletions
diff --git a/gcc/config/m68k/m68k-none.h b/gcc/config/m68k/m68k-none.h
index f299330e27d..5f115c5fb70 100644
--- a/gcc/config/m68k/m68k-none.h
+++ b/gcc/config/m68k/m68k-none.h
@@ -1,5 +1,5 @@
/* Definitions of target machine for GNU compiler. "naked" 68020.
- Copyright (C) 1994 Free Software Foundation, Inc.
+ Copyright (C) 1994, 1996 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -20,88 +20,173 @@ Boston, MA 02111-1307, USA. */
#include "m68k/m68k.h"
-/* See m68k.h. 7 means 68020 with 68881. */
+/* Default to m68k (m68020). */
+#ifndef TARGET_CPU_DEFAULT
+#define TARGET_CPU_DEFAULT M68K_CPU_m68k
+#endif
+/* These are values set by the configure script in TARGET_CPU_DEFAULT.
+ They are ((desired value for TARGET_DEFAULT) << 4) + sequential integer.
+ See m68k.h for the values (it should really define MASK_FOO so we can
+ use them). */
+#define M68K_CPU_m68k ((7 << 4) + 0)
+#define M68K_CPU_m68000 ((0 << 4) + 1)
+#define M68K_CPU_m68010 ((0 << 4) + 1) /* make same as m68000 */
+#define M68K_CPU_m68020 ((7 << 4) + 2)
+#define M68K_CPU_m68030 ((7 << 4) + 3)
+#define M68K_CPU_m68040 ((01007 << 4) + 4)
+#define M68K_CPU_m68302 ((0 << 4) + 5)
+#define M68K_CPU_m68332 ((1 << 4) + 6)
+
+/* This is tested for below, so if target wants to override this, it
+ just set this first in cover file. */
#ifndef TARGET_DEFAULT
-#define TARGET_DEFAULT 7
+#define TARGET_DEFAULT (TARGET_CPU_DEFAULT >> 4)
#endif
-
-/* Names to predefine in the preprocessor for this target machine.
- Always define mc68000. Other definitions depend on switches given
- to the compiler:
-
- -m68000: define nothing else
- default, -m68020, -mc68020: define mc68020
- -m68030: define mc68030
- -m68040: define mc68040
- -m68020-40: define mc68020 mc68030 mc68040
- -m68302: define mc68302
- -m68332: define mc68332
- */
-
-#ifndef CPP_PREDEFINES
-#define CPP_PREDEFINES "-Dmc68000"
+
+/* Defaults for the various specs below.
+ These are collected here so we only test TARGET_CPU_DEFAULT once. */
+/* ??? CC1_CPU_DEFAULT_SPEC was copied over from the earlier version of
+ this file. However, it's not used anywhere here because it doesn't
+ seem to be necessary. */
+#if TARGET_CPU_DEFAULT == M68K_CPU_m68k || TARGET_CPU_DEFAULT == M68K_CPU_m68020
+#define CPP_CPU_DEFAULT_SPEC "%{!ansi:-Dmc68020 } -D__mc68020 -D__mc68020__"
+#define ASM_CPU_DEFAULT_SPEC "-mc68020"
+#define CC1_CPU_DEFAULT_SPEC "-m68020"
+#else
+#if TARGET_CPU_DEFAULT == M68K_CPU_m68000
+#define CPP_CPU_DEFAULT_SPEC "%{!ansi:-Dmc68000 } -D__mc68000 -D__mc68000__"
+#define ASM_CPU_DEFAULT_SPEC "-mc68000"
+#define CC1_CPU_DEFAULT_SPEC "-m68000"
+#else
+#if TARGET_CPU_DEFAULT == M68K_CPU_m68030
+#define CPP_CPU_DEFAULT_SPEC "%{!ansi:-Dmc68030 } -D__mc68030 -D__mc68030__"
+#define ASM_CPU_DEFAULT_SPEC "-mc68030"
+#define CC1_CPU_DEFAULT_SPEC "-m68030"
+#else
+#if TARGET_CPU_DEFAULT == M68K_CPU_m68040
+#define CPP_CPU_DEFAULT_SPEC "%{!ansi:-Dmc68040 } -D__mc68040 -D__mc68040__"
+#define ASM_CPU_DEFAULT_SPEC "-mc68040"
+#define CC1_CPU_DEFAULT_SPEC "-m68040"
+#else
+#if TARGET_CPU_DEFAULT == M68K_CPU_m68302
+#define CPP_CPU_DEFAULT_SPEC "%{!ansi:-Dmc68302 } -D__mc68302 -D__mc68302__"
+#define ASM_CPU_DEFAULT_SPEC "-mc68302"
+#define CC1_CPU_DEFAULT_SPEC "-m68000"
+#else
+#if TARGET_CPU_DEFAULT == M68K_CPU_m68332
+#define CPP_CPU_DEFAULT_SPEC "%{!ansi:-Dmc68332 } -D__mc68332 -D__mc68332__"
+#define ASM_CPU_DEFAULT_SPEC "-mc68332"
+#define CC1_CPU_DEFAULT_SPEC "-m68020 -mnobitfield %{!m68881:-msoft-float}"
+#else
+Unrecognized value in TARGET_CPU_DEFAULT.
#endif
+#endif
+#endif
+#endif
+#endif
+#endif
+
+/* Always define mc68000.
+ Remember that GCC will automatically add __mc68000 and __mc68000__. */
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES "-Dmc68000"
-#ifndef CPP_SPEC
-
+/* Define one of __HAVE_68881__, __HAVE_FPA__, or nothing (soft float), appropriately. */
+#undef CPP_FPU_SPEC
#if TARGET_DEFAULT & 02
-
-/* -m68881 is the default */
-#define CPP_SPEC \
-"%{!mc68000:%{!m68000:%{!m68332:%{!msoft-float:%{mfpa:-D__HAVE_FPA__ }%{!mfpa:-D__HAVE_68881__ }}}}}\
-%{!ansi:%{m68010:-Dmc68010 }%{m68020:-Dmc68020 }%{mc68020:-Dmc68020 }%{m68030:-Dmc68030 }%{m68040:-Dmc68040 }%{m68020-40:-Dmc68020 -Dmc68030 -Dmc68040 }%{m68302:-Dmc68302 }%{m68332:-Dmc68332 }%{!mc68000:%{!m68000:%{!m68010:%{!mc68020:%{!m68020:%{!m68030:%{!m68040:%{!m68020-40:%{!m68302:%{!m68332:-Dmc68020 }}}}}}}}}}}\
-%{m68010:-D__mc68010__ -D__mc68010 }%{m68020:-D__mc68020__ -D__mc68020 }%{mc68020:-D__mc68020__ -D__mc68020 }%{m68030:-D__mc68030__ -D__mc68030 }%{m68040:-D__mc68040__ -D__mc68040 }%{m68020-40:-D__mc68020__ -D__mc68030__ -D__mc68040__ -D__mc68020 -D__mc68030 -D__mc68040 }%{m68302:-D__mc68302__ -D__mc68302 }%{m68332:-D__mc68332__ -D__mc68332 }%{!mc68000:%{!m68000:%{!m68010:%{!mc68020:%{!m68020:%{!m68030:%{!m68040:%{!m68020-40:%{!m68302:%{!m68332:-D__mc68020__ -D__mc68020 }}}}}}}}}}"
-
+/* ??? Why isn't m68302 treated like m68000 here? */
+#define CPP_FPU_SPEC \
+"%{!mc68000:%{!m68000:%{!m68332:%{!msoft-float:%{mfpa:-D__HAVE_FPA__ }%{!mfpa:-D__HAVE_68881__ }}}}}"
#else
+/* This can't currently happen, but we code it anyway to show how it's done. */
#if TARGET_DEFAULT & 0100
-
-/* -mfpa is the default */
-#define CPP_SPEC \
-"%{!msoft-float:%{m68881:-D__HAVE_68881__ }%{!m68881:-D__HAVE_FPA__ }}\
-%{!ansi:%{m68010:-Dmc68010 }%{m68020:-Dmc68020 }%{mc68020:-Dmc68020 }%{m68030:-Dmc68030 }%{m68040:-Dmc68040 }%{m68020-40:-Dmc68020 -Dmc68030 -Dmc68040 }%{m68302:-Dmc68302 }%{m68332:-Dmc68332 }%{!mc68000:%{!m68000:%{!m68010:%{!mc68020:%{!m68020:%{!m68030:%{!m68040:%{!m68020-40:%{!m68302:%{!m68332:-Dmc68020 }}}}}}}}}}}\
-%{m68010:-D__mc68010__ -D__mc68010 }%{m68020:-D__mc68020__ -D__mc68020 }%{mc68020:-D__mc68020__ -D__mc68020 }%{m68030:-D__mc68030__ -D__mc68030 }%{m68040:-D__mc68040__ -D__mc68040 }%{m68020-40:-D__mc68020__ -D__mc68030__ -D__mc68040__ -D__mc68020 -D__mc68030 -D__mc68040 }%{m68302:-D__mc68302__ -D__mc68302 }%{m68332:-D__mc68332__ -D__mc68332 }%{!mc68000:%{!m68000:%{!m68010:%{!mc68020:%{!m68020:%{!m68030:%{!m68040:%{!m68020-40:%{!m68302:%{!m68332:-D__mc68020__ -D__mc68020 }}}}}}}}}}"
-
+#define CPP_FPU_SPEC \
+"%{!msoft-float:%{m68881:-D__HAVE_68881__ }%{!m68881:-D__HAVE_FPA__ }}"
#else
-
-/* -msoft-float is the default */
-#define CPP_SPEC \
-"%{m68881:-D__HAVE_68881__ }%{mfpa:-D__HAVE_FPA__ }\
-%{!ansi:%{m68010:-Dmc68010 }%{m68020:-Dmc68020 }%{mc68020:-Dmc68020 }%{m68030:-Dmc68030 }%{m68040:-Dmc68040 }%{m68020-40:-Dmc68020 -Dmc68030 -Dmc68040 }%{m68302:-Dmc68302 }%{m68332:-Dmc68332 }%{!mc68000:%{!m68000:%{!m68010:%{!mc68020:%{!m68020:%{!m68030:%{!m68040:%{!m68020-40:%{!m68302:%{!m68332:-Dmc68020 }}}}}}}}}}}\
-%{m68010:-D__mc68010__ -D__mc68010 }%{m68020:-D__mc68020__ -D__mc68020 }%{mc68020:-D__mc68020__ -D__mc68020 }%{m68030:-D__mc68030__ -D__mc68030 }%{m68040:-D__mc68040__ -D__mc68040 }%{m68020-40:-D__mc68020__ -D__mc68030__ -D__mc68040__ -D__mc68020 -D__mc68030 -D__mc68040 }%{m68302:-D__mc68302__ -D__mc68302 }%{m68332:-D__mc68332__ -D__mc68332 }%{!mc68000:%{!m68000:%{!m68010:%{!mc68020:%{!m68020:%{!m68030:%{!m68040:%{!m68020-40:%{!m68302:%{!m68332:-D__mc68020__ -D__mc68020 }}}}}}}}}}"
-
+#define CPP_FPU_SPEC \
+"%{m68881:-D__HAVE_68881__ }%{mfpa:-D__HAVE_FPA__ }"
#endif
#endif
-#endif
-
-/* Pass flags to gas indicating which type of processor we have. */
-
-#ifndef ASM_SPEC
-
-#define ASM_SPEC \
-"%{m68851}%{mno-68851}%{m68881}%{mno-68881}%{msoft-float:-mno-68881 }\
-%{m68000}%{mc68000}%{m68010}%{m68020}%{mc68020}%{m68030}%{m68040}%{m68020-40:-mc68040}%{m68302}%{m68332}%{!m68000:%{!mc68000:%{!m68010:%{!mc68020:%{!m68020:%{!m68030:%{!m68040:%{!m68020-40:%{!m68302:%{!m68332:-mc68020}}}}}}}}}}"
+/* Names to predefine in the preprocessor for this target machine.
+ Other definitions depend on what the default cpu is and switches
+ given to the compiler:
-#endif
+ -m68000: define nothing else
+ -m68020, -mc68020: define mc68020
+ -m68030: define mc68030
+ -m68040: define mc68040
+ -m68020-40: define mc68020 mc68030 mc68040
+ -m68302: define mc68302
+ -m68332: define mc68332
+ default: define as above appropriately
-#ifndef CC1_SPEC
+ GCC won't automatically add __'d versions, we have to mention them
+ explicitly. */
-#define CC1_SPEC \
- "%{m68000:%{!m68881:-msoft-float }}%{m68302:-m68000}%{m68332:-m68020 -mnobitfield %{!m68881:-msoft-float}}%{!m68000:%{!mc68000:%{!m68010:%{!mc68020:%{!m68020:%{!m68030:%{!m68040:%{!m68020-40:%{!m68302:%{!m68332:-m68020}}}}}}}}}}"
+#undef CPP_SPEC
+#define CPP_SPEC "\
+%(cpp_fpu) \
+%{!ansi:%{m68010:-Dmc68010 }%{m68020:-Dmc68020 }%{mc68020:-Dmc68020 }%{m68030:-Dmc68030 }%{m68040:-Dmc68040 }%{m68020-40:-Dmc68020 -Dmc68030 -Dmc68040 }%{m68302:-Dmc68302 }%{m68332:-Dmc68332 }} \
+%{m68010:-D__mc68010__ -D__mc68010 }%{m68020:-D__mc68020__ -D__mc68020 }%{mc68020:-D__mc68020__ -D__mc68020 }%{m68030:-D__mc68030__ -D__mc68030 }%{m68040:-D__mc68040__ -D__mc68040 }%{m68020-40:-D__mc68020__ -D__mc68030__ -D__mc68040__ -D__mc68020 -D__mc68030 -D__mc68040 }%{m68302:-D__mc68302__ -D__mc68302 }%{m68332:-D__mc68332__ -D__mc68332 } \
+%{!mc68000:%{!m68000:%{!m68010:%{!mc68020:%{!m68020:%{!m68030:%{!m68040:%{!m68020-40:%{!m68302:%{!m68332:%(cpp_cpu_default)}}}}}}}}}} \
+%(cpp_subtarget) \
+"
-#endif
+/* Pass flags to gas indicating which type of processor we have. */
+#undef ASM_SPEC
+#define ASM_SPEC "\
+%{m68851}%{mno-68851}%{m68881}%{mno-68881}%{msoft-float:-mno-68881 } \
+%{m68000}%{mc68000}%{m68010}%{m68020}%{mc68020}%{m68030}%{m68040}%{m68020-40:-mc68040 }%{m68302}%{m68332} \
+%{!m68000:%{!mc68000:%{!m68010:%{!mc68020:%{!m68020:%{!m68030:%{!m68040:%{!m68020-40:%{!m68302:%{!m68332:%(asm_cpu_default)}}}}}}}}}} \
+"
+
+#undef CC1_SPEC
+#define CC1_SPEC "\
+%{m68000:%{!m68881:-msoft-float }}%{m68302:-m68000 }%{m68332:-m68020 -mnobitfield %{!m68881:-msoft-float }} \
+"
+/* ??? Is this needed?
+%{!m68000:%{!mc68000:%{!m68010:%{!mc68020:%{!m68020:%{!m68030:%{!m68040:%{!m68020-40:%{!m68302:%{!m68332:%(cc1_cpu_default)}}}}}}}}}}
+*/
+
+/* This macro defines names of additional specifications to put in the specs
+ that can be used in various specifications like CC1_SPEC. Its definition
+ is an initializer with a subgrouping for each command option.
+
+ Each subgrouping contains a string constant, that defines the
+ specification name, and a string constant that used by the GNU CC driver
+ program.
+
+ Do not define this macro if it does not need to do anything. */
+
+#define EXTRA_SPECS \
+ { "cpp_cpu_default", CPP_CPU_DEFAULT_SPEC }, \
+ { "cpp_fpu", CPP_FPU_SPEC }, \
+ { "cpp_subtarget", CPP_SUBTARGET_SPEC }, \
+ { "asm_cpu_default", ASM_CPU_DEFAULT_SPEC }, \
+/*{ "cc1_cpu_default", CC1_CPU_DEFAULT__SPEC },*/ \
+ SUBTARGET_EXTRA_SPECS
+
+#define CPP_SUBTARGET_SPEC ""
+#define SUBTARGET_EXTRA_SPECS
+
/* Avoid building multilib libraries for the defaults.
t-m68kbare doesn't support -mfpa in the multilib'd libraries, so we don't
- either. */
-#if (TARGET_DEFAULT & 5) == 5
+ either.
+ For targets not handled here, just build the full set of multilibs.
+ The default is m68k 99.9% of the time anyway. */
+
+#if TARGET_CPU_DEFAULT == M68K_CPU_m68k || TARGET_CPU_DEFAULT == M68K_CPU_m68020
#if TARGET_DEFAULT & 2
#define MULTILIB_DEFAULTS { "m68020", "m68881" }
#else
#define MULTILIB_DEFAULTS { "m68020", "msoft-float" }
#endif
-#else
+#endif
+
+#if TARGET_CPU_DEFAULT == M68K_CPU_m68000 || TARGET_CPU_DEFAULT == M68K_CPU_m68302
#if TARGET_DEFAULT & 2
#define MULTILIB_DEFAULTS { "m68000", "m68881" }
#else