aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/m68k
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/m68k')
-rw-r--r--gcc/config/m68k/linux.h53
-rw-r--r--gcc/config/m68k/m68k-none.h29
-rw-r--r--gcc/config/m68k/m68k.h86
-rw-r--r--gcc/config/m68k/openbsd.h5
-rw-r--r--gcc/config/m68k/uclinux.h1
5 files changed, 80 insertions, 94 deletions
diff --git a/gcc/config/m68k/linux.h b/gcc/config/m68k/linux.h
index 99b8de22853..93de1235b29 100644
--- a/gcc/config/m68k/linux.h
+++ b/gcc/config/m68k/linux.h
@@ -20,7 +20,6 @@ along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
-#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (68k GNU/Linux with ELF)");
/* Default to m68040. */
@@ -29,22 +28,12 @@ Boston, MA 02110-1301, USA. */
#define ASM_CPU_DEFAULT_SPEC "-mcpu=68040"
#endif
-/* We override the ASM_SPEC from svr4.h because we must pass the right
- cpu option to the assembler. This can go away when we require the
- assembler to suppor the .cpu directive. */
+/* ASM_SPEC is set in m68k.h, so we have to set SUBTARGET_ASM_SPEC to
+ the svr4.h options. We have to undef ASM_SPEC here, so that m68k.h
+ does not complain. */
#undef ASM_SPEC
-#define ASM_SPEC \
- "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \
-%{m68851}%{mno-68851}%{m68881}%{mno-68881}%{msoft-float:-mno-float}\
-%{m68000}%{m68302}%{mc68000}%{m68010}%{m68020}%{mc68020}%{m68030}\
-%{m68040}%{m68020-40:-m68040} %{m68020-60:-m68040}\
-%{m68060}%{mcpu32}%{m68332}%{m5200}%{m5206e}%{m528x}%{m5307}%{m5407}%{mcfv4e}\
-%{mcpu=*:-mcpu=%*}\
-%{march=*:-march=%*}\
-%{!mc68000:%{!m68000:%{!m68302:%{!m68010:%{!mc68020:%{!m68020:\
- %{!m68030:%{!m68040:%{!m68020-40:%{!m68020-60:%{!m68060:%{!mcpu32:\
- %{!m68332:%{!m5200:%{!m5206e:%{!m528x:%{!m5307:%{!m5407:%{!mcfv4e:\
- %{!mcpu=*:%{!march=*:%(asm_cpu_default)}}}}}}}}}}}}}}}}}}}}}"
+#define SUBTARGET_ASM_SPEC \
+ "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*}"
/* Here are four prefixes that are used by asm_fprintf to
facilitate customization for alternate assembler syntaxes.
@@ -55,34 +44,19 @@ Boston, MA 02110-1301, USA. */
is supposed to include this prefix. Also note that this is NOT an
fprintf format string, it is a literal string */
-#undef REGISTER_PREFIX
#define REGISTER_PREFIX "%"
/* The prefix for local (compiler generated) labels.
These labels will not appear in the symbol table. */
-#undef LOCAL_LABEL_PREFIX
#define LOCAL_LABEL_PREFIX "."
/* The prefix to add to user-visible assembler symbols. */
-#undef USER_LABEL_PREFIX
#define USER_LABEL_PREFIX ""
#define ASM_COMMENT_START "|"
-#undef SIZE_TYPE
-#define SIZE_TYPE "unsigned int"
-
-#undef PTRDIFF_TYPE
-#define PTRDIFF_TYPE "int"
-
-#undef WCHAR_TYPE
-#define WCHAR_TYPE "long int"
-
-#undef WCHAR_TYPE_SIZE
-#define WCHAR_TYPE_SIZE BITS_PER_WORD
-
/* Target OS builtins. */
#define TARGET_OS_CPP_BUILTINS() \
do \
@@ -98,7 +72,6 @@ Boston, MA 02110-1301, USA. */
} \
while (0)
-#undef CPP_SPEC
#define CPP_SPEC \
"%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
@@ -120,7 +93,7 @@ Boston, MA 02110-1301, USA. */
#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
-#undef LINK_SPEC
+#undef LINK_SPEC
#define LINK_SPEC "-m m68kelf %{shared} \
%{!shared: \
%{!static: \
@@ -155,7 +128,6 @@ Boston, MA 02110-1301, USA. */
/* This is how to output an assembler line that says to advance the
location counter to a multiple of 2**LOG bytes. */
-#undef ASM_OUTPUT_ALIGN
#define ASM_OUTPUT_ALIGN(FILE,LOG) \
if ((LOG) > 0) \
fprintf ((FILE), "%s%u\n", ALIGN_ASM_OP, 1 << (LOG));
@@ -177,7 +149,6 @@ Boston, MA 02110-1301, USA. */
/* Output assembler code to FILE to increment profiler label # LABELNO
for profiling a function entry. */
-#undef FUNCTION_PROFILER
#define FUNCTION_PROFILER(FILE, LABELNO) \
{ \
asm_fprintf (FILE, "\tlea (%LLP%d,%Rpc),%Ra1\n", (LABELNO)); \
@@ -187,12 +158,6 @@ Boston, MA 02110-1301, USA. */
fprintf (FILE, "\tjbsr _mcount\n"); \
}
-/* How to renumber registers for dbx and gdb.
- On the Sun-3, the floating point registers have numbers
- 18 to 25, not 16 to 23 as they do in the compiler. */
-
-#define DBX_REGISTER_NUMBER(REGNO) ((REGNO) < 16 ? (REGNO) : (REGNO) + 2)
-
/* Do not break .stabs pseudos into continuations. */
#define DBX_CONTIN_LENGTH 0
@@ -202,14 +167,12 @@ Boston, MA 02110-1301, USA. */
pointer, or floating types, respectively. Reject fp0 if not using
a 68881 coprocessor. */
-#undef FUNCTION_VALUE_REGNO_P
#define FUNCTION_VALUE_REGNO_P(N) \
((N) == 0 || (N) == 8 || (TARGET_68881 && (N) == 16))
/* Define this to be true when FUNCTION_VALUE_REGNO_P is true for
more than one register. */
-#undef NEEDS_UNTYPED_CALL
#define NEEDS_UNTYPED_CALL 1
/* Define how to generate (in the callee) the output value of a
@@ -219,7 +182,6 @@ Boston, MA 02110-1301, USA. */
FUNCTION_DECL; otherwise, FUNC is 0. For m68k/SVR4 generate the
result in d0, a0, or fp0 as appropriate. */
-#undef FUNCTION_VALUE
#define FUNCTION_VALUE(VALTYPE, FUNC) \
m68k_function_value (VALTYPE, FUNC)
@@ -228,7 +190,6 @@ Boston, MA 02110-1301, USA. */
For m68k/SVR4 look for integer values in d0, pointer values in d0
(returned in both d0 and a0), and floating values in fp0. */
-#undef LIBCALL_VALUE
#define LIBCALL_VALUE(MODE) \
m68k_libcall_value (MODE)
@@ -276,6 +237,6 @@ Boston, MA 02110-1301, USA. */
/* glibc uses comments to hide section attributes. So setting
ASM_FILE_START_APP_OFF breaks it. */
-#undef TARGET_ASM_FILE_START_APP_OFF
+#define TARGET_ASM_FILE_START_APP_OFF false
#define MD_UNWIND_SUPPORT "config/m68k/linux-unwind.h"
diff --git a/gcc/config/m68k/m68k-none.h b/gcc/config/m68k/m68k-none.h
index 53a067f73c3..e15dfe43b8a 100644
--- a/gcc/config/m68k/m68k-none.h
+++ b/gcc/config/m68k/m68k-none.h
@@ -25,23 +25,9 @@ Boston, MA 02110-1301, USA. */
#define ASM_CPU_DEFAULT_SPEC "-mcpu=68020"
#endif
-/* Pass flags to gas indicating which type of processor we have. This
- can be simplified when we can rely on the assembler supporting .cpu
- and .arch directives. */
-
-#undef ASM_SPEC
-#define ASM_SPEC "\
-%{m68851}%{mno-68851} %{m68881}%{mno-68881} %{msoft-float:-mno-float} \
-%{m68000}%{m68302}%{mc68000}%{m68010}%{m68020}%{mc68020}%{m68030}\
-%{m68040}%{m68020-40:-m68040}%{m68020-60:-m68040}\
-%{m68060}%{mcpu32}%{m68332}%{m5200}%{m5206e}%{m528x}%{m5307}%{m5407}%{mcfv4e}\
-%{mcpu=*:-mcpu=%*}%{march=*:-march=%*}\
-%{!mc68000:%{!m68000:%{!m68302:%{!m68010:%{!mc68020:%{!m68020:\
-%{!m68030:%{!m68040:%{!m68020-40:%{!m68020-60:%{!m68060:%{!mcpu32:\
-%{!m68332:%{!m5200:%{!m5206e:%{!m528x:%{!m5307:%{!m5407:%{!mcfv4e:\
-%{!mcpu=*:%{!march=*:%(asm_cpu_default)}}}}}}}}}}}}}}}}}}}}} \
-%{fPIC:--pcrel} %{fpic:--pcrel} %{msep-data:--pcrel}\
-%{mid-shared-library:--pcrel}"
+#undef SUBTARGET_ASM_SPEC
+#define SUBTARGET_ASM_SPEC "%{fPIC:--pcrel} %{fpic:--pcrel} \
+ %{msep-data:--pcrel} %{mid-shared-library:--pcrel}"
/* cc1/cc1plus always receives all the -m flags. If the specs strings above
are consistent with the flags in m68k.opt, there should be no need for
@@ -49,12 +35,3 @@ Boston, MA 02110-1301, USA. */
#undef CC1_SPEC
#define CC1_SPEC ""
-
-
-/* Avoid building multilib libraries for the defaults.
- For targets not handled here, just build the full set of multilibs.
- The default is m68k 99.9% of the time anyway. */
-
-/* FIXME: Re-implement behaviour described above.
-
-#define MULTILIB_DEFAULTS ... */
diff --git a/gcc/config/m68k/m68k.h b/gcc/config/m68k/m68k.h
index 22bcdceefab..2d47ad1fe78 100644
--- a/gcc/config/m68k/m68k.h
+++ b/gcc/config/m68k/m68k.h
@@ -23,13 +23,15 @@ Boston, MA 02110-1301, USA. */
if-statements and ?: on it. This way we have compile-time error checking
for both the MOTOROLA and MIT code paths. We do rely on the host compiler
to optimize away all constant tests. */
-#ifdef MOTOROLA
-# undef MOTOROLA
-# define MOTOROLA 1 /* Use the Motorola assembly syntax. */
-# define TARGET_VERSION fprintf (stderr, " (68k, Motorola syntax)")
+#if MOTOROLA /* Use the Motorola assembly syntax. */
+# ifndef TARGET_VERSION
+# define TARGET_VERSION fprintf (stderr, " (68k, Motorola syntax)")
+# endif
#else
-# define TARGET_VERSION fprintf (stderr, " (68k, MIT syntax)")
# define MOTOROLA 0 /* Use the MIT assembly syntax. */
+# ifndef TARGET_VERSION
+# define TARGET_VERSION fprintf (stderr, " (68k, MIT syntax)")
+# endif
#endif
/* Handle --with-cpu, --with-float default options from configure script. */
@@ -45,11 +47,37 @@ Boston, MA 02110-1301, USA. */
#define TARGET_DEFAULT 0
#endif
-
#ifndef ASM_CPU_DEFAULT_SPEC
#define ASM_CPU_DEFAULT_SPEC ""
#endif
+
+/* Pass flags to gas indicating which type of processor we have. This
+ can be simplified when we can rely on the assembler supporting .cpu
+ and .arch directives. */
+
+#define ASM_CPU_SPEC "\
+%{m68851}%{mno-68851} %{m68881}%{mno-68881} %{msoft-float:-mno-float} \
+%{m68000}%{m68302}%{mc68000}%{m68010}%{m68020}%{mc68020}%{m68030}\
+%{m68040}%{m68020-40:-m68040}%{m68020-60:-m68040}\
+%{m68060}%{mcpu32}%{m68332}%{m5200}%{m5206e}%{m528x}%{m5307}%{m5407}%{mcfv4e}\
+%{mcpu=*:-mcpu=%*}%{march=*:-march=%*}\
+%{!mc68000:%{!m68000:%{!m68302:%{!m68010:%{!mc68020:%{!m68020:\
+%{!m68030:%{!m68040:%{!m68020-40:%{!m68020-60:%{!m68060:%{!mcpu32:\
+%{!m68332:%{!m5200:%{!m5206e:%{!m528x:%{!m5307:%{!m5407:%{!mcfv4e:\
+%{!mcpu=*:%{!march=*:%(asm_cpu_default)}}}}}}}}}}}}}}}}}}}}} \
+"
+
+/* SUBTARGET_ASM_SPEC is always passed to the assembler. It may be
+ overridden by subtargets. */
+#ifndef SUBTARGET_ASM_SPEC
+#define SUBTARGET_ASM_SPEC ""
+#endif
+
+/* We do not #undef this beforehand in order to detect it being
+ erronously #defined. */
+#define ASM_SPEC "%(asm_cpu_spec) %(subtarget_asm_spec)"
+
/* 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.
@@ -62,10 +90,8 @@ Boston, MA 02110-1301, USA. */
#define EXTRA_SPECS \
{ "asm_cpu_default", ASM_CPU_DEFAULT_SPEC }, \
- SUBTARGET_EXTRA_SPECS
-
-#define CPP_SUBTARGET_SPEC ""
-#define SUBTARGET_EXTRA_SPECS
+ { "asm_cpu_spec", ASM_CPU_SPEC }, \
+ { "subtarget_asm_spec", SUBTARGET_ASM_SPEC } \
/* Note that some other tm.h files include this one and then override
many of the definitions that relate to assembler syntax. FIXME:We
@@ -540,13 +566,11 @@ extern enum reg_class regno_reg_class[];
/* Moves between fp regs and other regs are two insns. */
#define REGISTER_MOVE_COST(MODE, CLASS1, CLASS2) \
- (((CLASS1) == FP_REGS && (CLASS2) != FP_REGS) \
- || ((CLASS2) == FP_REGS && (CLASS1) != FP_REGS) \
- ? 4 : 2)
+ ((((CLASS1) == FP_REGS) != ((CLASS2) == FP_REGS)) ? 4 : 2)
/* Stack layout; function entry, exit and calling. */
-#define STACK_GROWS_DOWNWARD
+#define STACK_GROWS_DOWNWARD 1
#define FRAME_GROWS_DOWNWARD 1
#define STARTING_FRAME_OFFSET 0
@@ -565,26 +589,34 @@ extern enum reg_class regno_reg_class[];
standard Unix calling sequences. If the option is not selected,
the caller must always pop the args. */
#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \
- ((TARGET_RTD && (!(FUNDECL) || TREE_CODE (FUNDECL) != IDENTIFIER_NODE) \
+ ((TARGET_RTD && (!(FUNDECL) || TREE_CODE (FUNDECL) != IDENTIFIER_NODE) \
&& (TYPE_ARG_TYPES (FUNTYPE) == 0 \
|| (TREE_VALUE (tree_last (TYPE_ARG_TYPES (FUNTYPE))) \
== void_type_node))) \
? (SIZE) : 0)
-/* On the m68k the return value is always in D0. */
+/* On the m68k the return value defaults to D0. */
+#ifndef FUNCTION_VALUE
#define FUNCTION_VALUE(VALTYPE, FUNC) \
gen_rtx_REG (TYPE_MODE (VALTYPE), 0)
+#endif
-/* On the m68k the return value is always in D0. */
+/* On the m68k the return value defaults to D0. */
+#ifndef LIBCALL_VALUE
#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, 0)
+#endif
-/* On the m68k, D0 is the only register used. */
+/* On the m68k, D0 is usually the only register used. */
+#ifndef FUNCTION_VALUE_REGNO_P
#define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)
+#endif
/* Define this to be true when FUNCTION_VALUE_REGNO_P is true for
more than one register.
XXX This macro is m68k specific and used only for m68kemb.h. */
+#ifndef NEEDS_UNTYPED_CALL
#define NEEDS_UNTYPED_CALL 0
+#endif
/* On the m68k, all arguments are usually pushed on the stack. */
#define FUNCTION_ARG_REGNO_P(N) 0
@@ -605,8 +637,10 @@ extern enum reg_class regno_reg_class[];
/* On the m68k all args are always pushed. */
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) 0
+#ifndef FUNCTION_PROFILER
#define FUNCTION_PROFILER(FILE, LABELNO) \
asm_fprintf (FILE, "\tlea %LLP%d,%Ra0\n\tjsr mcount\n", (LABELNO))
+#endif
#define EXIT_IGNORE_STACK 1
@@ -752,7 +786,9 @@ __transfer_from_trampoline () \
/* True if SYMBOL + OFFSET constants must refer to something within
SYMBOL's section. */
+#ifndef M68K_OFFSETS_MUST_BE_WITHIN_SECTIONS_P
#define M68K_OFFSETS_MUST_BE_WITHIN_SECTIONS_P 0
+#endif
#define MAX_REGS_PER_ADDRESS 2
@@ -912,11 +948,19 @@ do { if (cc_prev_status.flags & CC_IN_68881) \
#define TEXT_SECTION_ASM_OP "\t.text"
#define DATA_SECTION_ASM_OP "\t.data"
#define GLOBAL_ASM_OP "\t.globl\t"
+#ifndef REGISTER_PREFIX
#define REGISTER_PREFIX ""
+#endif
+#ifndef LOCAL_LABEL_PREFIX
#define LOCAL_LABEL_PREFIX ""
+#endif
+#ifndef USER_LABEL_PREFIX
#define USER_LABEL_PREFIX "_"
+#endif
#define IMMEDIATE_PREFIX "#"
+#ifndef TARGET_ASM_FILE_START_APP_OFF
#define TARGET_ASM_FILE_START_APP_OFF true
+#endif
#define REGISTER_NAMES \
{REGISTER_PREFIX"d0", REGISTER_PREFIX"d1", REGISTER_PREFIX"d2", \
@@ -1010,8 +1054,10 @@ do { if (cc_prev_status.flags & CC_IN_68881) \
#define ASM_OUTPUT_LABELREF(FILE,NAME) \
asm_fprintf (FILE, "%U%s", NAME)
+#ifndef ASM_GENERATE_INTERNAL_LABEL
#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
sprintf (LABEL, "*%s%s%ld", LOCAL_LABEL_PREFIX, PREFIX, (long)(NUM))
+#endif
#define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \
asm_fprintf (FILE, "\tmovel %s,%Rsp@-\n", reg_names[REGNO])
@@ -1028,12 +1074,16 @@ do { if (cc_prev_status.flags & CC_IN_68881) \
/* We don't have a way to align to more than a two-byte boundary, so do the
best we can and don't complain. */
+#ifndef ASM_OUTPUT_ALIGN
#define ASM_OUTPUT_ALIGN(FILE,LOG) \
if ((LOG) >= 1) \
fprintf (FILE, "\t.even\n");
+#endif
+#ifndef ASM_OUTPUT_SKIP
#define ASM_OUTPUT_SKIP(FILE,SIZE) \
fprintf (FILE, "\t.skip %u\n", (int)(SIZE))
+#endif
#define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
( fputs (".comm ", (FILE)), \
diff --git a/gcc/config/m68k/openbsd.h b/gcc/config/m68k/openbsd.h
index eb0c13d2979..641f574c532 100644
--- a/gcc/config/m68k/openbsd.h
+++ b/gcc/config/m68k/openbsd.h
@@ -34,9 +34,8 @@ Boston, MA 02110-1301, USA. */
#undef CPP_SPEC
#define CPP_SPEC "%{!msoft-float:-D__HAVE_68881__ -D__HAVE_FPU__} %{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}"
-/* m68k as needs to know about the processor subtype. */
-#undef ASM_SPEC
-#define ASM_SPEC "%{m68030} %{m68040} %{m68060} %{fpic|fpie:-k} %{fPIC|fPIE:-k -K}"
+#undef SUBTARGET_ASM_SPEC
+#define SUBTARGET_ASM_SPEC "%{fpic|fpie:-k} %{fPIC|fPIE:-k -K}"
#define AS_NEEDS_DASH_FOR_PIPED_INPUT
diff --git a/gcc/config/m68k/uclinux.h b/gcc/config/m68k/uclinux.h
index 0ce0b307e40..78ba3037d49 100644
--- a/gcc/config/m68k/uclinux.h
+++ b/gcc/config/m68k/uclinux.h
@@ -61,7 +61,6 @@ Boston, MA 02110-1301, USA. */
/* The uclinux binary format relies on relocations against a segment being
within that segment. Conservatively apply this rule to individual
sections. */
-#undef M68K_OFFSETS_MUST_BE_WITHIN_SECTIONS_P
#define M68K_OFFSETS_MUST_BE_WITHIN_SECTIONS_P 1
/* -msep-data is the default PIC mode on this target. */