From: Richard Kenner Date: Wed, 11 May 1994 20:50:50 +0000 (-0400) Subject: (clobbers_to): Deleted. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c5bd3be879186eb78b92f12050e928391d8e874d;p=gcc.git (clobbers_to): Deleted. (call_internal, call_value_internal): New patterns. (call, call_value): Just call new patterns and a29k_clobbers_to. From-SVN: r7277 --- diff --git a/gcc/config/a29k/a29k.md b/gcc/config/a29k/a29k.md index 11ea2102a8a..9c7ca79a2c3 100644 --- a/gcc/config/a29k/a29k.md +++ b/gcc/config/a29k/a29k.md @@ -111,39 +111,28 @@ ;; CALLI ;; -;; Start with a subroutine to write out CLOBBERs starting at lr2 up to, -;; but not including, the next parameter register. If operand[0] is null, -;; it means that all the argument registers have been used. -(define_expand "clobbers_to" - [(clobber (match_operand:SI 0 "" ""))] +;; Each call pattern is duplicated so that we can add CLOBBERs to the +;; resulting insn. +;; +;; We indicate that LR0 is clobbered in the CALL_INSN itself. Otherwise, +;; reorg will think it is just clobbered by the called function. + +(define_expand "call" + [(use (match_operand:SI 0 "" "")) + (use (match_operand 1 "" "")) + (use (match_operand 2 "" ""))] "" " -{ - int i; - int high_regno; - - if (operands[0] == 0) - high_regno = R_LR (18); - else if (GET_CODE (operands[0]) != REG || REGNO (operands[0]) < R_LR (0) - || REGNO (operands[0]) > R_LR (18)) - abort (); - else - high_regno = REGNO (operands[0]); - - for (i = R_LR (2); i < high_regno; i++) - emit_insn (gen_rtx (CLOBBER, VOIDmode, gen_rtx (REG, SImode, i))); +{ rtx insn = emit_call_insn (gen_call_internal (operands[0], operands[1])); + a29k_clobbers_to (insn, operands[2]); DONE; }") - -;; We indicate that LR0 is clobbered in the CALL_INSN itself. Otherwise, -;; reorg will think it is just clobbered by the called function. - -(define_expand "call" + +(define_expand "call_internal" [(parallel [(call (match_operand:SI 0 "" "") (match_operand 1 "" "")) - (clobber (scratch:SI))]) - (match_operand 2 "" "")] + (clobber (scratch:SI))])] "" " { @@ -156,16 +145,27 @@ && GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF) operands[0] = gen_rtx (MEM, SImode, force_reg (Pmode, XEXP (operands[0], 0))); - - operands[2] = gen_clobbers_to (operands[2]); }") (define_expand "call_value" + [(use (match_operand:SI 0 "gpc_reg_operand" "")) + (use (match_operand:SI 1 "" "")) + (use (match_operand 2 "" "")) + (use (match_operand 3 "" ""))] + "" + " +{ rtx insn = emit_call_insn (gen_call_value_internal (operands[0], operands[1], + operands[2])); + + a29k_clobbers_to (insn, operands[3]); + DONE; +}") + +(define_expand "call_value_internal" [(parallel [(set (match_operand:SI 0 "gpc_reg_operand" "") (call (match_operand:SI 1 "" "") (match_operand 2 "" ""))) - (clobber (scratch:SI))]) - (match_operand 3 "" "")] + (clobber (scratch:SI))])] "" " { @@ -179,7 +179,6 @@ operands[1] = gen_rtx (MEM, SImode, force_reg (Pmode, XEXP (operands[1], 0))); - operands[3] = gen_clobbers_to (operands[3]); }") (define_insn ""