/* Definitions for Motorola 68k running Linux-based GNU systems with
ELF format.
- Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU CC.
#define MOTOROLA /* Use Motorola syntax */
#define USE_GAS /* But GAS wants jbsr instead of jsr */
+/* TODO: convert includes to ${tm_file} list in config.gcc. */
#include <m68k/m68k.h>
-/* Make sure CC1 is undefined. */
+/* Make sure CC1 is undefined. */
#undef CC1_SPEC
+#include "dbxelf.h"
+#include "elfos.h"
+#include "svr4.h"
#include <linux.h> /* some common stuff */
#undef TARGET_VERSION
#define STRICT_ALIGNMENT 0
#undef SUBTARGET_SWITCHES
-#define SUBTARGET_SWITCHES {"ieee-fp", 0},
+#define SUBTARGET_SWITCHES {"ieee-fp", 0, \
+ N_("Use IEEE math for fp comparisons")},
/* Here are four prefixes that are used by asm_fprintf to
facilitate customization for alternate assembler syntaxes.
#define REGISTER_PREFIX "%"
/* The prefix for local (compiler generated) labels.
- These labels will not appear in the symbol table. */
+ 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. */
+/* The prefix to add to user-visible assembler symbols. */
#undef USER_LABEL_PREFIX
#define USER_LABEL_PREFIX ""
/* How to refer to registers in assembler output.
This sequence is indexed by compiler's hard-register-number.
- Motorola format uses different register names than defined in m68k.h. */
+ Motorola format uses different register names than defined in m68k.h. */
#undef REGISTER_NAMES
-#ifndef SUPPORT_SUN_FPA
-
#define REGISTER_NAMES \
{"%d0", "%d1", "%d2", "%d3", "%d4", "%d5", "%d6", "%d7", \
"%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%a6", "%sp", \
"%fp0", "%fp1", "%fp2", "%fp3", "%fp4", "%fp5", "%fp6", "%fp7" }
-#else /* SUPPORTED_SUN_FPA */
-
-#define REGISTER_NAMES \
-{"%d0", "%d1", "%d2", "%d3", "%d4", "%d5", "%d6", "%d7", \
- "%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%a6", "%sp", \
- "%fp0", "%fp1", "%fp2", "%fp3", "%fp4", "%fp5", "%fp6", "%fp7", \
- "%fpa0", "%fpa1", "%fpa2", "%fpa3", "%fpa4", "%fpa5", "%fpa6", "%fpa7", \
- "%fpa8", "%fpa9", "%fpa10","%fpa11","%fpa12","%fpa13","%fpa14","%fpa15", \
- "%fpa16","%fpa17","%fpa18","%fpa19","%fpa20","%fpa21","%fpa22","%fpa23", \
- "%fpa24","%fpa25","%fpa26","%fpa27","%fpa28","%fpa29","%fpa30","%fpa31" }
-
-#endif /* defined SUPPORT_SUN_FPA */
-
#undef SIZE_TYPE
#define SIZE_TYPE "unsigned int"
#define WCHAR_TYPE_SIZE BITS_PER_WORD
#define CPP_PREDEFINES \
- "-D__ELF__ -Dunix -Dmc68000 -Dmc68020 -Dlinux -Asystem(unix) -Asystem(posix) -Acpu(m68k) -Amachine(m68k)"
+ "-D__ELF__ -Dunix -Dmc68000 -Dmc68020 -D__gnu_linux__ -Dlinux -Asystem=unix -Asystem=posix -Acpu=m68k -Amachine=m68k"
#undef CPP_SPEC
#ifdef USE_GNULIBC_1
When the -shared link option is used a final link is not being
done. */
-/* If ELF is the default format, we should not use /lib/elf. */
+/* If ELF is the default format, we should not use /lib/elf. */
#undef LINK_SPEC
#ifdef USE_GNULIBC_1
/* Use the default action for outputting the case label. */
#undef ASM_OUTPUT_CASE_LABEL
-#define ASM_RETURN_CASE_JUMP \
- do { \
- if (TARGET_5200) \
- return "ext%.l %0\n\tjmp %%pc@(2,%0:l)"; \
- else \
- return "jmp %%pc@(2,%0:w)"; \
+#define ASM_RETURN_CASE_JUMP \
+ do { \
+ if (TARGET_5200) \
+ { \
+ if (ADDRESS_REG_P (operands[0])) \
+ return "jmp %%pc@(2,%0:l)"; \
+ else \
+ return "ext%.l %0\n\tjmp %%pc@(2,%0:l)"; \
+ } \
+ else \
+ return "jmp %%pc@(2,%0:w)"; \
} while (0)
/* This is how to output an assembler line that says to advance the
#define DBX_CONTIN_LENGTH 0
-/* Allow folding division by zero. */
-#define REAL_INFINITY
-
/* 1 if N is a possible register number for a function value. For
m68k/SVR4 allow d0, a0, or fp0 as return registers, for integral,
pointer, or floating types, respectively. Reject fp0 if not using
function. VALTYPE is the data type of the value (as a tree). If
the precise function being called is known, FUNC is its
FUNCTION_DECL; otherwise, FUNC is 0. For m68k/SVR4 generate the
- result in d0, a0, or fp0 as appropriate. */
+ result in d0, a0, or fp0 as appropriate. */
#undef FUNCTION_VALUE
#define FUNCTION_VALUE(VALTYPE, FUNC) \
: gen_rtx_REG ((MODE), 0))
/* In m68k svr4, a symbol_ref rtx can be a valid PIC operand if it is
- an operand of a function call. */
+ an operand of a function call. */
#undef LEGITIMATE_PIC_OPERAND_P
#define LEGITIMATE_PIC_OPERAND_P(X) \
((! symbolic_operand (X, VOIDmode) \
- && ! (GET_CODE (X) == CONST_DOUBLE && CONST_DOUBLE_MEM (X) \
- && GET_CODE (CONST_DOUBLE_MEM (X)) == MEM \
- && symbolic_operand (XEXP (CONST_DOUBLE_MEM (X), 0), VOIDmode))) \
- || (GET_CODE (X) == SYMBOL_REF && SYMBOL_REF_FLAG (X)) \
+ && ! (GET_CODE (X) == CONST_DOUBLE && mem_for_const_double (X) != 0 \
+ && GET_CODE (mem_for_const_double (X)) == MEM \
+ && symbolic_operand (XEXP (mem_for_const_double (X), 0), \
+ VOIDmode))) \
+ || (GET_CODE (X) == SYMBOL_REF && SYMBOL_REF_FLAG (X)) \
|| PCREL_GENERAL_OPERAND_OK)
-/* Turn off function cse if we are doing PIC. We always want function
- call to be done as `bsr foo@PLTPC', so it will force the assembler
- to create the PLT entry for `foo'. Doing function cse will cause
- the address of `foo' to be loaded into a register, which is exactly
- what we want to avoid when we are doing PIC on svr4 m68k. */
-#undef SUBTARGET_OVERRIDE_OPTIONS
-#define SUBTARGET_OVERRIDE_OPTIONS \
- if (flag_pic) flag_no_function_cse = 1;
-
/* For m68k SVR4, structures are returned using the reentrant
- technique. */
+ technique. */
#undef PCC_STATIC_STRUCT_RETURN
#define DEFAULT_PCC_STRUCT_RETURN 0
: "d" (_beg), "d" (_len) \
: "%d0", "%d2", "%d3"); \
}
-\f
-/* Output code to add DELTA to the first argument, and then jump to FUNCTION.
- Used for C++ multiple inheritance. */
-#define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \
-do { \
- if (DELTA > 0 && DELTA <= 8) \
- asm_fprintf (FILE, "\taddq.l %I%d,4(%Rsp)\n", DELTA); \
- else if (DELTA < 0 && DELTA >= -8) \
- asm_fprintf (FILE, "\tsubq.l %I%d,4(%Rsp)\n", -DELTA); \
- else \
- asm_fprintf (FILE, "\tadd.l %I%d,4(%Rsp)\n", DELTA); \
- \
- if (flag_pic) \
- { \
- fprintf (FILE, "\tbra.l "); \
- assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \
- fprintf (FILE, "@PLTPC\n"); \
- } \
- else \
- { \
- fprintf (FILE, "\tjmp "); \
- assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \
- fprintf (FILE, "\n"); \
- } \
-} while (0)