From 68386e1e3cbcd64346749e822babf7e576fa16aa Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Wed, 6 Oct 1993 13:29:13 -0600 Subject: [PATCH] pa.c (output_function_prologue): Pass on information about the number of callee saved general and floating point... * pa.c (output_function_prologue): Pass on information about the number of callee saved general and floating point registers which are saved by the current function's prologue. (hppa_expand_prologue): Keep track of the number of callee register saves done for general and floating point registers. From-SVN: r5641 --- gcc/config/pa/pa.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index 1f6611d..215cfc1 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -46,6 +46,10 @@ rtx hppa_save_pic_table_rtx; /* Set by the FUNCTION_PROFILER macro. */ int hp_profile_labelno; +/* Counts for the number of callee-saved general and floating point + registers which were saved by the current function's prologue. */ +static int gr_saved, fr_saved; + static rtx find_addr_reg (); /* Return non-zero only if OP is a register of mode MODE, @@ -2018,6 +2022,10 @@ output_function_prologue (file, size) if (frame_pointer_needed) fprintf (file, ",SAVE_SP"); + /* Pass on information about the number of callee register saves + performed in the prologue. */ + fprintf (file, ",ENTRY_GR=%d,ENTRY_FR=%d", gr_saved, fr_saved); + fprintf (file, "\n\t.ENTRY\n"); /* Horrid hack. emit_function_prologue will modify this RTL in @@ -2036,6 +2044,8 @@ hppa_expand_prologue() rtx tmpreg, size_rtx; + gr_saved = 0; + fr_saved = 0; save_fregs = 0; local_fsize = size + (size || frame_pointer_needed ? 8 : 0); actual_fsize = compute_frame_size (size, &save_fregs); @@ -2167,6 +2177,7 @@ hppa_expand_prologue() { store_reg (i, offset, FRAME_POINTER_REGNUM); offset += 4; + gr_saved++; } } /* No frame pointer needed. */ @@ -2188,6 +2199,7 @@ hppa_expand_prologue() else store_reg (i, offset, STACK_POINTER_REGNUM); offset += 4; + gr_saved++; } /* If we wanted to merge the SP adjustment with a GR save, but we never @@ -2216,12 +2228,13 @@ hppa_expand_prologue() if (! TARGET_SNAKE) { for (i = 43; i >= 40; i--) - { - if (regs_ever_live[i]) + if (regs_ever_live[i]) + { emit_move_insn (gen_rtx (MEM, DFmode, gen_rtx (POST_INC, DFmode, tmpreg)), gen_rtx (REG, DFmode, i)); - } + fr_saved++; + } } else { @@ -2231,6 +2244,7 @@ hppa_expand_prologue() emit_move_insn (gen_rtx (MEM, DFmode, gen_rtx (POST_INC, DFmode, tmpreg)), gen_rtx (REG, DFmode, i)); + fr_saved++; } } } -- 2.7.4