OSDN Git Service

(ASM_RETURN_CASE_JUMP): Use extl to explicitly sign extend index
[pf3gnuchains/gcc-fork.git] / gcc / config / m68k / linux.h
index 00f8f42..10ef0e8 100644 (file)
@@ -1,5 +1,5 @@
 /* Definitions for Motorola 68k running Linux with ELF format.
-   Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
 
 This file is part of GNU CC.
 
@@ -29,7 +29,7 @@ Boston, MA 02111-1307, USA.  */
 #define TARGET_VERSION fprintf (stderr, " (68k Linux/ELF)");
 
 /* 68020 with 68881 */
-#define TARGET_DEFAULT 7
+#define TARGET_DEFAULT (MASK_BITFIELD|MASK_68881|MASK_68020)
 
 /* for 68k machines this only needs to be TRUE for the 68000 */
 
@@ -104,7 +104,7 @@ Boston, MA 02111-1307, USA.  */
   "-D__ELF__ -Dunix -Dmc68000 -Dmc68020 -Dlinux -Asystem(unix) -Asystem(posix) -Acpu(m68k) -Amachine(m68k)"
 
 #undef CPP_SPEC
-#if TARGET_DEFAULT & 2
+#if TARGET_DEFAULT & MASK_68881
 #define CPP_SPEC \
   "%{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{!msoft-float:-D__HAVE_68881__} %{posix:-D_POSIX_SOURCE}"
 #else
@@ -156,9 +156,13 @@ Boston, MA 02111-1307, USA.  */
 
 /* Use the default action for outputting the case label.  */
 #undef ASM_OUTPUT_CASE_LABEL
-
-#define ASM_RETURN_CASE_JUMP \
-  return "jmp (2,%%pc,%0.w)"
+#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)";              \
+  } while (0)
 
 /* This is how to output an assembler line that says to advance the
    location counter to a multiple of 2**LOG bytes.  */
@@ -175,12 +179,12 @@ Boston, MA 02111-1307, USA.  */
 #define BSS_SECTION_ASM_OP ".section\t.bss"
 
 /* A C statement (sans semicolon) to output to the stdio stream
-   FILE the assembler definition of an uninitialized global label named
+   FILE the assembler definition of uninitialized global DECL named
    NAME whose size is SIZE bytes and alignment is ALIGN bytes.
    Try to use asm_output_aligned_bss to implement this macro.  */
 
-#define ASM_OUTPUT_ALIGNED_BSS(FILE, NAME, SIZE, ALIGN) \
-  asm_output_aligned_bss (FILE, NAME, SIZE, ALIGN)
+#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
+  asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
 
 /* Output assembler code to FILE to increment profiler label # LABELNO
    for profiling a function entry.  */
@@ -354,3 +358,30 @@ do {                                                                       \
      : "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, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (FUNCTION)));    \
+      fprintf (FILE, "@PLTPC\n");                                      \
+    }                                                                  \
+  else                                                                 \
+    {                                                                  \
+      fprintf (FILE, "\tjmp ");                                                \
+      assemble_name                                                    \
+       (FILE, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (FUNCTION)));    \
+      fprintf (FILE, "\n");                                            \
+    }                                                                  \
+} while (0)