(*return_addsi): Change condition to exclude both ints.
authorRichard Kenner <kenner@gcc.gnu.org>
Sun, 13 Apr 1997 13:47:25 +0000 (09:47 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Sun, 13 Apr 1997 13:47:25 +0000 (09:47 -0400)
(*return_adddi): Likewise.
(*return_subsi): New pattern.

From-SVN: r13868

gcc/config/sparc/sparc.md

index 196b2f1078fdd5f6b3e7c324230bee4c99ad7895..a337b1055445651ca6d9dcd0fcf8bce0df650995 100644 (file)
@@ -1,5 +1,5 @@
 ;;- Machine description for SPARC chip for GNU C compiler
-;;  Copyright (C) 1987, 88, 89, 92-95, 1996 Free Software Foundation, Inc.
+;;  Copyright (C) 1987, 88, 89, 92-96, 1997 Free Software Foundation, Inc.
 ;;  Contributed by Michael Tiemann (tiemann@cygnus.com)
 ;;  64 bit SPARC V9 support by Michael Tiemann, Jim Wilson, and Doug Evans,
 ;;  at Cygnus Support.
        (plus:SI (match_operand:SI 1 "arith_operand" "%r")
                 (match_operand:SI 2 "arith_operand" "rI")))
    (return)]
-  "! TARGET_EPILOGUE && ! TARGET_LIVE_G0"
+  "! TARGET_EPILOGUE && ! TARGET_LIVE_G0
+   && (register_operand (operands[1], SImode)
+       || register_operand (operands[2], SImode))"
   "*
 {
   if (! TARGET_ARCH64 && current_function_returns_struct)
 
 (define_insn "*return_adddi"
   [(set (match_operand:DI 0 "restore_operand" "")
-       (plus:DI (match_operand:DI 1 "arith_operand" "%r")
+       (plus:DI (match_operand:DI 1 "arith_double_operand" "%r")
                 (match_operand:DI 2 "arith_double_operand" "rHI")))
    (return)]
-  "TARGET_ARCH64 && ! TARGET_EPILOGUE"
+  "TARGET_ARCH64 && ! TARGET_EPILOGUE
+   && (register_operand (operands[1], DImode)
+       || register_operand (operands[2], DImode))"
   "ret\;restore %r1,%2,%Y0"
   [(set_attr "type" "multi")])
 
-;; Turned off because it should never match (subtracting a constant
-;; is turned into addition) and because it would do the wrong thing
-;; when operand 2 is -4096 (--4096 == 4096 is not a valid immediate).
-;;(define_insn "*minus_const"
-;;  [(set (match_operand:SI 0 "restore_operand" "")
-;;     (minus:SI (match_operand:SI 1 "register_operand" "r")
-;;               (match_operand:SI 2 "small_int" "I")))
-;;   (return)]
-;;  "! TARGET_EPILOGUE"
-;;  "ret\;restore %1,-(%2),%Y0"
-;;  [(set_attr "type" "multi")])
+(define_insn "*return_subsi"
+  [(set (match_operand:SI 0 "restore_operand" "")
+       (minus:SI (match_operand:SI 1 "register_operand" "r")
+                 (match_operand:SI 2 "small_int" "I")))
+   (return)]
+  "! TARGET_EPILOGUE && INTVAL (operands[2]) != -4096"
+  "ret\;restore %1,%n2,%Y0"
+  [(set_attr "type" "multi")])
 
 ;; The following pattern is only generated by delayed-branch scheduling,
 ;; when the insn winds up in the epilogue.