From: Richard Kenner Date: Sun, 13 Apr 1997 13:47:25 +0000 (-0400) Subject: (*return_addsi): Change condition to exclude both ints. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=eead6b5bdaa008eed61307e1fe90b6d4c2e24dd1;p=gcc.git (*return_addsi): Change condition to exclude both ints. (*return_adddi): Likewise. (*return_subsi): New pattern. From-SVN: r13868 --- diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md index 196b2f1078f..a337b105544 100644 --- a/gcc/config/sparc/sparc.md +++ b/gcc/config/sparc/sparc.md @@ -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. @@ -5975,7 +5975,9 @@ (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) @@ -5995,24 +5997,23 @@ (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.