(output_function_prologue): Use link.w on 68040; emit pea fp + movl
authorRichard Kenner <kenner@gcc.gnu.org>
Fri, 25 Mar 1994 19:30:41 +0000 (14:30 -0500)
committerRichard Kenner <kenner@gcc.gnu.org>
Fri, 25 Mar 1994 19:30:41 +0000 (14:30 -0500)
sp,fp instead of linkw 0 for 6804.0

From-SVN: r6898

gcc/config/m68k/m68k.c

index b536f6d8cdd048c2e8853d73f9dd76ace706185a..4cd6c912b1de455e4919eef0e8efe2d871a06b14 100644 (file)
@@ -1,5 +1,5 @@
 /* Subroutines for insn-output.c for Motorola 68000 family.
-   Copyright (C) 1987, 1993 Free Software Foundation, Inc.
+   Copyright (C) 1987, 1993, 1994 Free Software Foundation, Inc.
 
 This file is part of GNU CC.
 
@@ -93,8 +93,20 @@ output_function_prologue (stream, size)
 
   if (frame_pointer_needed)
     {
-      /* Adding negative number is faster on the 68040.  */
-      if (fsize < 0x8000 && !TARGET_68040)
+      if (fsize == 0 && TARGET_68040_ONLY)
+       {
+       /* on the 68040, pea + move is faster than link.w 0 */
+#ifdef MOTOROLA
+         asm_fprintf (stream, "\tpea (%s)\n\tmove.l %s,%s\n",
+              reg_names[FRAME_POINTER_REGNUM], reg_names[STACK_POINTER_REGNUM],
+              reg_names[FRAME_POINTER_REGNUM]);
+#else
+         asm_fprintf (stream, "\tpea %s\@\n\tmovel %s,%s\n",
+              reg_names[FRAME_POINTER_REGNUM], reg_names[STACK_POINTER_REGNUM],
+              reg_names[FRAME_POINTER_REGNUM]);
+#endif
+       }
+      else if (fsize < 0x8000)
        {
 #ifdef MOTOROLA
          asm_fprintf (stream, "\tlink.w %s,%0I%d\n",
@@ -116,6 +128,7 @@ output_function_prologue (stream, size)
        }
       else
        {
+      /* Adding negative number is faster on the 68040.  */
 #ifdef MOTOROLA
          asm_fprintf (stream, "\tlink.w %s,%0I0\n\tadd.l %0I%d,%Rsp\n",
                       reg_names[FRAME_POINTER_REGNUM], -fsize);