OSDN Git Service

* config/m68k/m68k-none.h: Introduce new ColdFire archs.
[pf3gnuchains/gcc-fork.git] / gcc / config / m68k / m68kelf.h
index 1f50d2b..bb9edcc 100644 (file)
@@ -1,7 +1,7 @@
 /* m68kelf support, derived from m68kv4.h */
 
 /* Target definitions for GNU compiler for mc680x0 running System V.4
-   Copyright (C) 1991, 1993, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1991, 1993, 2000, 2002 Free Software Foundation, Inc.
 
    Written by Ron Guilmette (rfg@netcom.com) and Fred Fish (fnf@cygnus.com).
 
@@ -49,12 +49,12 @@ Boston, MA 02111-1307, USA.  */
 #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 ""
@@ -73,12 +73,17 @@ Boston, MA 02111-1307, USA.  */
 /* config/m68k.md has an explicit reference to the program counter,
    prefix this by the register prefix.  */
 
-#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_COLDFIRE)                               \
+      {                                                        \
+       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)
 
 /* How to refer to registers in assembler output.
@@ -98,10 +103,12 @@ Boston, MA 02111-1307, USA.  */
 
 #undef ASM_OUTPUT_ALIGN
 #define ASM_OUTPUT_ALIGN(FILE,LOG)                             \
+do {                                                           \
   if ((LOG) > 0)                                               \
-    fprintf ((FILE), "\t%s \t%u\n", ALIGN_ASM_OP, 1 << (LOG)); \
+    fprintf ((FILE), "%s%u\n", ALIGN_ASM_OP, 1 << (LOG));      \
   else if ((LOG) > 31)                                         \
-    abort ();
+    abort ();                                                  \
+} while (0)
 
 /* Use proper assembler syntax for these macros.  */
 #undef ASM_OUTPUT_REG_PUSH
@@ -116,7 +123,7 @@ Boston, MA 02111-1307, USA.  */
     g++ assembler names.  When this is defined, g++ uses embedded '.'
     characters and some m68k assemblers have problems with this.  The
     chances are much greater that any particular assembler will permit
-    embedded '$' characters. */
+    embedded '$' characters.  */
 
 #undef NO_DOLLAR_IN_LABEL
 
@@ -137,20 +144,17 @@ Boston, MA 02111-1307, USA.  */
 #define BSS_ASM_OP     "\t.lcomm\t"
 
 /* Register in which address to store a structure value is passed to a
-   function.  The default in m68k.h is a1.  For m68k/SVR4 it is a0. */
+   function.  The default in m68k.h is a1.  For m68k/SVR4 it is a0.  */
 
 #undef STRUCT_VALUE_REGNUM
 #define STRUCT_VALUE_REGNUM 8
 
 #define ASM_COMMENT_START "|"
 
-#undef TYPE_OPERAND_FMT
-#define TYPE_OPERAND_FMT      "@%s"
-
 /* Define how the m68k registers should be numbered for Dwarf output.
    The numbering provided here should be compatible with the native
    SVR4 SDB debugger in the m68k/SVR4 reference port, where d0-d7
-   are 0-7, a0-a8 are 8-15, and fp0-fp7 are 16-23. */
+   are 0-7, a0-a8 are 8-15, and fp0-fp7 are 16-23.  */
 
 #undef DBX_REGISTER_NUMBER
 #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
@@ -159,16 +163,16 @@ Boston, MA 02111-1307, USA.  */
    It is then overridden by m68k/sgs.h to use ".space", and again by svr4.h
    to use ".zero".  The m68k/SVR4 assembler uses ".space", so repeat the
    definition from m68k/sgs.h here.  Note that ASM_NO_SKIP_IN_TEXT is
-   defined in m68k/sgs.h, so we don't have to repeat it here. */
+   defined in m68k/sgs.h, so we don't have to repeat it here.  */
 
 #undef ASM_OUTPUT_SKIP
 #define ASM_OUTPUT_SKIP(FILE,SIZE)  \
-  fprintf (FILE, "\t%s %u\n", SPACE_ASM_OP, (SIZE))
+  fprintf (FILE, "%s%u\n", SPACE_ASM_OP, (int)(SIZE))
 
 #if 0
 /* SVR4 m68k assembler is bitching on the `comm i,1,1' which askes for 
    1 byte alignment. Don't generate alignment for COMMON seems to be
-   safer until we the assembler is fixed. */
+   safer until we the assembler is fixed.  */
 #undef ASM_OUTPUT_ALIGNED_COMMON
 /* Same problem with this one.  */
 #undef ASM_OUTPUT_ALIGNED_LOCAL
@@ -176,12 +180,12 @@ Boston, MA 02111-1307, USA.  */
 
 /* The `string' directive on m68k svr4 does not handle string with
    escape char (ie., `\') right. Use normal way to output ASCII bytes
-   seems to be safer. */
+   seems to be safer.  */
 #undef ASM_OUTPUT_ASCII
 #define ASM_OUTPUT_ASCII(FILE,PTR,LEN)                         \
 do {                                                           \
-  register int sp = 0, lp = 0, ch;                             \
-  fprintf ((FILE), "\t%s ", BYTE_ASM_OP);                      \
+  register int sp = 0, ch;                                     \
+  fputs (integer_asm_op (1, TRUE), (FILE));                    \
   do {                                                         \
     ch = (PTR)[sp];                                            \
     if (ch > ' ' && ! (ch & 0x80) && ch != '\\')               \
@@ -196,7 +200,7 @@ do {                                                                \
       {                                                                \
        if ((sp % 10) == 0)                                     \
          {                                                     \
-           fprintf ((FILE), "\n\t%s ", BYTE_ASM_OP);           \
+           fprintf ((FILE), "\n%s", integer_asm_op (1, TRUE)); \
          }                                                     \
        else                                                    \
          {                                                     \
@@ -214,7 +218,7 @@ do {                                                                \
 #define ASM_OUTPUT_CASE_END(FILE,NUM,TABLE)                            \
 do {                                                                   \
   if (switch_table_difference_label_flag)                              \
-    asm_fprintf ((FILE), "\t%s %LLD%d,%LL%d\n", SET_ASM_OP, (NUM), (NUM));\
+    asm_fprintf ((FILE), "%s%LLD%d,%LL%d\n", SET_ASM_OP, (NUM), (NUM));        \
   switch_table_difference_label_flag = 0;                              \
 } while (0)
 
@@ -225,47 +229,23 @@ extern int switch_table_difference_label_flag;
 #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED)  \
 ( fputs (".comm ", (FILE)),                    \
   assemble_name ((FILE), (NAME)),              \
-  fprintf ((FILE), ",%u\n", (SIZE)))
+  fprintf ((FILE), ",%u\n", (int)(SIZE)))
 
 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED)  \
 ( fputs (".lcomm ", (FILE)),                   \
   assemble_name ((FILE), (NAME)),              \
-  fprintf ((FILE), ",%u\n", (SIZE)))
+  fprintf ((FILE), ",%u\n", (int)(SIZE)))
 
 /* Currently, JUMP_TABLES_IN_TEXT_SECTION must be defined in order to
-   keep switch tables in the text section. */
+   keep switch tables in the text section.  */
    
 #define JUMP_TABLES_IN_TEXT_SECTION 1
 
 /* Override the definition in svr4.h. In m68k svr4, using swbeg is the 
-   standard way to do switch table. */
+   standard way to do switch table.  */
 #undef ASM_OUTPUT_BEFORE_CASE_LABEL
 #define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE,PREFIX,NUM,TABLE)            \
-  fprintf ((FILE), "\t%s &%d\n", SWBEG_ASM_OP, XVECLEN (PATTERN (TABLE), 1));
-
-/* In m68k svr4, a symbol_ref rtx can be a valid PIC operand if it is an
-   operand of a function call. */
-#undef LEGITIMATE_PIC_OPERAND_P
-
-#define LEGITIMATE_PIC_OPERAND_P(X)    \
-  (! symbolic_operand (X, 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 OVERRIDE_OPTIONS
-#define OVERRIDE_OPTIONS               \
-{                                      \
-  if (flag_pic) flag_no_function_cse = 1; \
-  if (! TARGET_68020 && flag_pic == 2) \
-    error("-fPIC is not currently supported on the 68000 or 68010\n"); \
-  if (TARGET_PCREL && flag_pic == 0)   \
-    flag_pic = 1;                      \
-}
+  fprintf ((FILE), "%s&%d\n", SWBEG_ASM_OP, XVECLEN (PATTERN (TABLE), 1));
 /* end of stuff from m68kv4.h */
 
 #undef SGS_CMP_ORDER
@@ -294,7 +274,7 @@ extern int switch_table_difference_label_flag;
    specified as the number of bits.
 
    Try to use function `asm_output_aligned_bss' defined in file
-   `varasm.c' when defining this macro. */
+   `varasm.c' when defining this macro.  */
 #ifndef ASM_OUTPUT_ALIGNED_BSS
 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
   asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)