From b0213198c922e82a632e1e78aa08dada252732ab Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Mon, 5 Apr 1993 18:51:12 -0600 Subject: [PATCH] pa.md (prologue, epilogue): New define_expands. * pa.md (prologue, epilogue): New define_expands. (return_internal, call_profiler): New define_insns. From-SVN: r4023 --- gcc/config/pa/pa.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md index 9dcd818ec06..f5df9dfc290 100644 --- a/gcc/config/pa/pa.md +++ b/gcc/config/pa/pa.md @@ -2580,6 +2580,47 @@ "bv%* 0(%%r2)" [(set_attr "type" "branch")]) +;; Use a different pattern for functions which have non-trivial +;; epilogues so as not to confuse jump and reorg. +(define_insn "return_internal" + [(use (reg:SI 2)) + (return)] + "" + "bv%* 0(%%r2)" + [(set_attr "type" "branch")]) + +(define_expand "prologue" + [(const_int 0)] + "" + "hppa_expand_prologue ();DONE;") + +(define_expand "epilogue" + [(return)] + "" + " +{ + /* Try to use the trivial return first. Else use the full + epilogue. */ + if (hppa_can_use_return_insn_p ()) + emit_jump_insn (gen_return ()); + else + { + hppa_expand_epilogue (); + emit_jump_insn (gen_return_internal ()); + } + DONE; +}") + +;; Special because we use the value placed in %r2 by the bl instruction +;; from within its delay slot to set the value for the 2nd parameter to +;; the call. +(define_insn "call_profiler" + [(unspec_volatile [(const_int 0)] 0) + (use (match_operand:SI 0 "const_int_operand" ""))] + "" + "bl _mcount,%%r2\;ldo %0(%%r2),%%r25" + [(set_attr "length" "2")]) + (define_insn "jump" [(set (pc) (label_ref (match_operand 0 "" "")))] "" -- 2.30.2