sparc.c (function_value): Perform the equivalent of PROMOTE_MODE for ARCH64.
authorJakub Jelinek <jj@sunsite.ms.mff.cuni.cz>
Thu, 24 Sep 1998 16:16:58 +0000 (18:16 +0200)
committerDavid S. Miller <davem@gcc.gnu.org>
Thu, 24 Sep 1998 16:16:58 +0000 (09:16 -0700)
Thu Sep 24 15:08:08 1998  Jakub Jelinek  <jj@sunsite.ms.mff.cuni.cz>
* config/sparc/sparc.c (function_value): Perform the equivalent of
PROMOTE_MODE for ARCH64.
(eligible_for_epilogue_delay): Allow DImode operations in delay
slot of a return for ARCH64.

From-SVN: r22573

gcc/ChangeLog
gcc/config/sparc/sparc.c

index afd9981e195cebb89eb58299a6189e4b92952989..900fedd64c4c6009c1205dfd5041fe6dedc516c5 100644 (file)
@@ -1,3 +1,10 @@
+Thu Sep 24 15:08:08 1998  Jakub Jelinek  <jj@sunsite.ms.mff.cuni.cz>
+
+       * config/sparc/sparc.c (function_value): Perform the equivalent of
+       PROMOTE_MODE for ARCH64.
+       (eligible_for_epilogue_delay): Allow DImode operations in delay
+       slot of a return for ARCH64.
+
 Thu Sep 24 22:17:54 1998  J"orn Rennecke <amylaar@cygnus.co.uk>
 
        * sh.md (sqrtsf2): Fix mode of sqrt.
index 180666bb8173857c95c6c0003b4cd71c283c2c59..16fd6b7ba9d013da5c095dfff05f237a318a2f91 100644 (file)
@@ -2259,9 +2259,14 @@ eligible_for_epilogue_delay (trial, slot)
 
   src = SET_SRC (pat);
 
-  /* This matches "*return_[qhs]i".  */
+  /* This matches "*return_[qhs]i" or even "*return_di" on TARGET_ARCH64.  */
   if (arith_operand (src, GET_MODE (src)))
-    return GET_MODE_SIZE (GET_MODE (src)) <= GET_MODE_SIZE (SImode);
+    {
+      if (TARGET_ARCH64)
+        return GET_MODE_SIZE (GET_MODE (src)) <= GET_MODE_SIZE (DImode);
+      else
+        return GET_MODE_SIZE (GET_MODE (src)) <= GET_MODE_SIZE (SImode);
+    }
     
   /* This matches "*return_di".  */
   else if (arith_double_operand (src, GET_MODE (src)))
@@ -4232,6 +4237,12 @@ function_value (type, mode, incoming_p)
          mode = mode_for_size (bytes * BITS_PER_UNIT, MODE_INT, 0);
        }
     }
+    
+  if (TARGET_ARCH64
+      && GET_MODE_CLASS (mode) == MODE_INT 
+      && GET_MODE_SIZE (mode) < UNITS_PER_WORD
+      && type && TREE_CODE (type) != UNION_TYPE)
+    mode = DImode;
 
   if (incoming_p)
     regno = BASE_RETURN_VALUE_REG (mode);