This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[m68k] Convert CPP_SPEC to TARGET_CPU_CPP_BUILTINS
- From: Bernardo Innocenti <bernie at develer dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Richard Henderson <rth at redhat dot com>, Gunther Nikl <gni at gecko dot de>
- Date: Sun, 14 Sep 2003 22:35:17 +0200
- Subject: [m68k] Convert CPP_SPEC to TARGET_CPU_CPP_BUILTINS
- Organization: Develer S.r.l.
Converts m68k target predefines from CPP_SPEC to new-style
TARGET_CPU_CPP_BUILTINS.
2003-09-12 Bernardo Innocenti <bernie@develer.com>
* config/m68k/m68k.h (TARGET_CPU_CPP_BUILTINS): Add target
predefines.
* config/m68k/m68k-none.h (CPP_CPU_DEFAULT_SPEC): Kill all
definitions.
* config/m68k/m68k-none.h (CPP_FPU_SPEC): Remove.
* config/m68k/m68k-none.h (CPP_SPEC): Remove target predefines.
diff -Nru gcc-3.4-20030910.orig/gcc/config/m68k/m68k.h gcc-3.4-20030910/gcc/config/m68k/m68k.h
--- gcc-3.4-20030910.orig/gcc/config/m68k/m68k.h 2003-09-14 20:41:29.000000000 +0200
+++ gcc-3.4-20030910/gcc/config/m68k/m68k.h 2003-09-14 19:02:00.000000000 +0200
@@ -28,10 +27,52 @@
#define TARGET_CPU_CPP_BUILTINS() \
do \
{ \
- builtin_define ("__mc68000__"); \
- if (TARGET_68020) \
- builtin_define ("__mc68020__"); \
builtin_define ("__m68k__"); \
+ builtin_define_std ("mc68000"); \
+ if (TARGET_68020) \
+ { \
+ builtin_define_std ("mc68020"); \
+ builtin_define_std ("mc68030"); \
+ } \
+ if (TARGET_68040 || TARGET_68040_ONLY) \
+ builtin_define_std ("mc68040"); \
+ if (TARGET_68060) \
+ builtin_define_std ("mc68060"); \
+ if (TARGET_68881) \
+ builtin_define ("__HAVE_68881__"); \
+ if (TARGET_CPU32) \
+ { \
+ builtin_define_std ("mc68332"); \
+ builtin_define_std ("mcpu32"); \
+ } \
+ if (TARGET_COLDFIRE) \
+ builtin_define ("__mcoldfire__"); \
+ if (TARGET_5200) \
+ builtin_define ("__mcf5200__"); \
+ if (TARGET_528x) \
+ { \
+ builtin_define ("__mcf528x__"); \
+ builtin_define ("__mcf5200__"); \
+ } \
+ if (TARGET_CFV3) \
+ { \
+ builtin_define ("__mcf5300__"); \
+ builtin_define ("__mcf5307__"); \
+ } \
+ if (TARGET_CFV4) \
+ { \
+ builtin_define ("__mcf5400__"); \
+ builtin_define ("__mcf5407__"); \
+ } \
+ if (TARGET_CF_HWDIV) \
+ builtin_define ("__mcfhwdiv__"); \
+ if (flag_pic) \
+ { \
+ builtin_define ("__PIC__"); \
+ builtin_define ("__pic__"); \
+ } \
+ if (TARGET_ID_SHARED_LIBRARY) \
+ builtin_define ("__ID_SHARED_LIBRARY__"); \
builtin_assert ("cpu=m68k"); \
builtin_assert ("machine=m68k"); \
} \
@@ -155,7 +196,7 @@
#define MASK_CF_HWDIV 0x40000
#define TARGET_CF_HWDIV (target_flags & MASK_CF_HWDIV)
-/* Compile for mcf582 */
+/* Compile for mcf528x */
#define MASK_528x 0x80000
#define TARGET_528x (target_flags & MASK_528x)
diff -Nru gcc-3.4-20030910.orig/gcc/config/m68k/m68k-none.h gcc-3.4-20030910/gcc/config/m68k/m68k-none.h
--- gcc-3.4-20030910.orig/gcc/config/m68k/m68k-none.h 2003-09-14 20:41:29.000000000 +0200
+++ gcc-3.4-20030910/gcc/config/m68k/m68k-none.h 2003-09-12 19:34:06.000000000 +0200
@@ -48,32 +48,26 @@
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 "-m68302"
#else
#if TARGET_CPU_DEFAULT == M68K_CPU_m68332
-#define CPP_CPU_DEFAULT_SPEC "%{!ansi:-Dmc68332 -Dmcpu32 } -D__mc68332 -D__mc68332__ -D__mcpu32 -D__mcpu32__"
#define ASM_CPU_DEFAULT_SPEC "-mc68332"
#define CC1_CPU_DEFAULT_SPEC "-m68332"
#else
@@ -84,55 +78,6 @@
#endif
#endif
#endif
-
-/* Define __HAVE_68881__ or nothing (soft float), appropriately. */
-#undef CPP_FPU_SPEC
-#if TARGET_DEFAULT & MASK_68881
-#define CPP_FPU_SPEC "\
-%{!mc68000:%{!m68000:%{!m68302:%{!mcpu32:%{!m68332:%{!m5200:%{!m5206e:%{!m528x:%{!m5307:%{!m5407:%{!msoft-float:%{!mno-68881:-D__HAVE_68881__ }}}}}}}}}}}} \
-%{m68881:-D__HAVE_68881__ }"
-#else
-#define CPP_FPU_SPEC "\
-%{m68881:-D__HAVE_68881__ }"
-#endif
-
-/* 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:
-
- -m68000, -mc68000: define nothing else
- -m68010: define mc68010
- -m68020, -mc68020: define mc68020
- -m68030: define mc68030
- -m68040: define mc68040
- -m68060: define mc68060
- -m68020-40: define mc68020 mc68030 mc68040
- -m68020-60: define mc68020 mc68030 mc68040 mc68060
- -m68302: define mc68302
- -m68332: define mc68332 mcpu32
- -mcpu32: define mcpu32
- -m5200: define mcoldfire mcf5200
- -m5206e: define mcoldfire mcf5200 mcf5206e
- -m528x: define mcoldfire mc5200 mc528x
- -m5307: define mcoldfire mc5300 mc5307
- -m5407: define mcoldfire mc5400 mc5407
-
- default: define as above appropriately
-
- GCC won't automatically add __'d versions, we have to mention them
- explicitly. */
-
-#undef CPP_SPEC
-#define CPP_SPEC "\
-%(cpp_fpu)%{!ansi:%{m68302:-Dmc68302 }%{m68010:-Dmc68010 }%{m68020:-Dmc68020 }%{mc68020:-Dmc68020 }%{m68030:-Dmc68030 }%{m68040:-Dmc68040 }%{m68020-40:-Dmc68020 -Dmc68030 -Dmc68040 }%{m68020-60:-Dmc68020 -Dmc68030 -Dmc68040 -Dmc68060 }%{m68060:-Dmc68060 }%{mcpu32:-Dmcpu32 } %{m68332:-Dmc68332 -Dmcpu32 }%{m5200:-Dmcoldfire -Dmcf5200 }%{m5206e:-Dmcoldfire -Dmcf5200 -Dmcf5206e }%{m528x:-Dmcoldfire -Dmcf5200 -Dmcf528x }%{m5307:-Dmcoldfire -Dmcf5300 -Dmcf5307 }%{m5407: -Dmcoldfire -Dmcf5400 -Dmcf5407 }} \
-%{m68302:-D__mc68302__ -D__mc68302 }%{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 }%{m68020-60:-D__mc68020__ -D__mc68030__ -D__mc68040__ -D__mc68020 -D__mc68030 -D__mc68040 -D__mc68060__ -D__mc68060 }%{m68060:-D__mc68060__ -D__mc68060 }%{mcpu32:-D__mcpu32__ -D__mcpu32 }%{m68332:-D__mc68332__ -D__mc68332 -D__mcpu32__ -D__mcpu32 }%{m5200:-D__mcf5200__ -D__mcf5200 -D__mcoldfire__ } \
-%{m5206e:-D__mcoldfire__ -D__mcf5200__ -D__mcf5200 -D__mcf5206e__ -D__mcf5206e } \
-%{m528x:-D__mcoldfire__ -D__mcf5200__ -D__mcf5200 -D__mcf528x__ -D__mcf528x } \
-%{m5307:-D__mcoldfire__ -D__mcf5300__ -D__mcf5300 -D__mcf5307__ -D__mcf5307 } \
-%{m5407:-D__mcoldfire__ -D__mcf5400__ -D__mcf5400 -D__mcf5407__ -D__mcf5407 } \
-%{!mc68000:%{!m68000:%{!m68302:%{!m68010:%{!mc68020:%{!m68020:%{!m68030:%{!m68040:%{!m68020-40:%{!m68020-60:%{!m68060:%{!mcpu32: %{!m68332:%{!m5200:%{!m5206e:%{!m528x:%{!m5307:%{!m5407:%(cpp_cpu_default)}}}}}}}}}}}}}}}}}} \
-%(cpp_subtarget) \
-"
/* Pass flags to gas indicating which type of processor we have. */
@@ -160,11 +105,9 @@
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 },*/ \
+ { "cc1_cpu_default", CC1_CPU_DEFAULT_SPEC }, \
SUBTARGET_EXTRA_SPECS
#define CPP_SUBTARGET_SPEC ""
--
// Bernardo Innocenti - Develer S.r.l., R&D dept.
\X/ http://www.develer.com/
Please don't send Word attachments - http://www.gnu.org/philosophy/no-word-attachments.html