Commit c6aa9ce1 by Doug Evans

(leaf_reg_backmap): Delete.

(sparc_flat_compute_frame_size): Renamed from
sparc_frw_compute_frame_size.  All callers changed.
(sparc_flat_save_restore): Likewise.
(sparc_flat_output_function_prologue): Likewise.
Delete decl of call_used_regs.
Delete reference to frame_base_name, use frame pointer explicitly.
Print prologue end marker.
(sparc_flat_output_function_epilogue): Likewise (renaming).
Delete decls of asm_out_data_file, asm_out_file, call_used_regs.
Print epilogue start marker.
(sparc_flat_epilogue_delay_slots): Likewise (renaming).
(sparc_flat_eligible_for_epilogue_delay): Likewise.

From-SVN: r7258
parent 5e6aa513
...@@ -62,18 +62,6 @@ char leaf_reg_remap[] = ...@@ -62,18 +62,6 @@ char leaf_reg_remap[] =
48, 49, 50, 51, 52, 53, 54, 55, 48, 49, 50, 51, 52, 53, 54, 55,
56, 57, 58, 59, 60, 61, 62, 63}; 56, 57, 58, 59, 60, 61, 62, 63};
#if 0 /* not used anymore */
char leaf_reg_backmap[] =
{ 0, 1, 2, 3, 4, 5, 6, 7,
24, 25, 26, 27, 28, 29, 14, 31,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
32, 33, 34, 35, 36, 37, 38, 39,
40, 41, 42, 43, 44, 45, 46, 47,
48, 49, 50, 51, 52, 53, 54, 55,
56, 57, 58, 59, 60, 61, 62, 63};
#endif
#endif #endif
/* Global variables set by FUNCTION_PROLOGUE. */ /* Global variables set by FUNCTION_PROLOGUE. */
...@@ -2107,7 +2095,9 @@ output_function_prologue (file, size, leaf_function) ...@@ -2107,7 +2095,9 @@ output_function_prologue (file, size, leaf_function)
space for our callee (and our own register save area). */ space for our callee (and our own register save area). */
actual_fsize = compute_frame_size (size, leaf_function); actual_fsize = compute_frame_size (size, leaf_function);
/* This is only for the human reader. */
fprintf (file, "\t!#PROLOGUE# 0\n"); fprintf (file, "\t!#PROLOGUE# 0\n");
if (actual_fsize == 0) if (actual_fsize == 0)
/* do nothing. */ ; /* do nothing. */ ;
else if (actual_fsize <= 4096) else if (actual_fsize <= 4096)
...@@ -3055,7 +3045,7 @@ sparc_type_code (type) ...@@ -3055,7 +3045,7 @@ sparc_type_code (type)
SP->| | SP->| |
+-----------------------+ */ +-----------------------+ */
/* Structure to be filled in by sparc_frw_compute_frame_size with register /* Structure to be filled in by sparc_flat_compute_frame_size with register
save masks, and offsets for the current function. */ save masks, and offsets for the current function. */
struct sparc_frame_info struct sparc_frame_info
...@@ -3073,7 +3063,7 @@ struct sparc_frame_info ...@@ -3073,7 +3063,7 @@ struct sparc_frame_info
int initialized; /* Nonzero if frame size already calculated. */ int initialized; /* Nonzero if frame size already calculated. */
}; };
/* Current frame information calculated by sparc_frw_compute_frame_size. */ /* Current frame information calculated by sparc_flat_compute_frame_size. */
struct sparc_frame_info current_frame_info; struct sparc_frame_info current_frame_info;
/* Zero structure to initialize current_frame_info. */ /* Zero structure to initialize current_frame_info. */
...@@ -3090,7 +3080,7 @@ struct sparc_frame_info zero_frame_info; ...@@ -3090,7 +3080,7 @@ struct sparc_frame_info zero_frame_info;
stack pointer. */ stack pointer. */
unsigned long unsigned long
sparc_frw_compute_frame_size (size) sparc_flat_compute_frame_size (size)
int size; /* # of var. bytes allocated. */ int size; /* # of var. bytes allocated. */
{ {
int regno; int regno;
...@@ -3191,7 +3181,7 @@ sparc_frw_compute_frame_size (size) ...@@ -3191,7 +3181,7 @@ sparc_frw_compute_frame_size (size)
/* Common code to save/restore registers. */ /* Common code to save/restore registers. */
void void
sparc_frw_save_restore (file, word_op, doubleword_op) sparc_flat_save_restore (file, word_op, doubleword_op)
FILE *file; /* Stream to write to. */ FILE *file; /* Stream to write to. */
char *word_op; /* Operation to do for one word. */ char *word_op; /* Operation to do for one word. */
char *doubleword_op; /* Operation to do for doubleword. */ char *doubleword_op; /* Operation to do for doubleword. */
...@@ -3291,24 +3281,19 @@ sparc_frw_save_restore (file, word_op, doubleword_op) ...@@ -3291,24 +3281,19 @@ sparc_frw_save_restore (file, word_op, doubleword_op)
/* Set up the stack and frame (if desired) for the function. */ /* Set up the stack and frame (if desired) for the function. */
void void
sparc_frw_output_function_prologue (file, size, ignored) sparc_flat_output_function_prologue (file, size)
FILE *file; FILE *file;
int size; int size;
{ {
extern char call_used_regs[];
int tsize; int tsize;
char *sp_str = reg_names[STACK_POINTER_REGNUM]; char *sp_str = reg_names[STACK_POINTER_REGNUM];
/* ??? This should be %sp+actual_fsize for a leaf function. I think it /* This is only for the human reader. */
works only because it is never used. */
frame_base_name
= (!frame_pointer_needed) ? "%sp+80" : reg_names[FRAME_POINTER_REGNUM];
fprintf (file, "\t!#PROLOGUE# 0\n"); fprintf (file, "\t!#PROLOGUE# 0\n");
size = SPARC_STACK_ALIGN (size); size = SPARC_STACK_ALIGN (size);
tsize = (! current_frame_info.initialized tsize = (! current_frame_info.initialized
? sparc_frw_compute_frame_size (size) ? sparc_flat_compute_frame_size (size)
: current_frame_info.total_size); : current_frame_info.total_size);
if (tsize > 0) if (tsize > 0)
...@@ -3332,36 +3317,40 @@ sparc_frw_output_function_prologue (file, size, ignored) ...@@ -3332,36 +3317,40 @@ sparc_frw_output_function_prologue (file, size, ignored)
current_frame_info.extra_size); current_frame_info.extra_size);
} }
sparc_frw_save_restore (file, "st", "std"); sparc_flat_save_restore (file, "st", "std");
if (frame_pointer_needed) if (frame_pointer_needed)
{ {
char *fp_str = reg_names[FRAME_POINTER_REGNUM];
if (tsize <= 4095) if (tsize <= 4095)
fprintf (file, "\tadd %s,%d,%s\t!# set up frame pointer\n", sp_str, fprintf (file, "\tadd %s,%d,%s\t!# set up frame pointer\n", sp_str,
tsize, frame_base_name); tsize, fp_str);
else else
fprintf (file, "\tadd %s,%s,%s\t!# set up frame pointer\n", sp_str, fprintf (file, "\tadd %s,%s,%s\t!# set up frame pointer\n", sp_str,
"%g1", frame_base_name); "%g1", fp_str);
} }
fprintf (file, "\t!#PROLOGUE# 1\n");
} }
/* Do any necessary cleanup after a function to restore stack, frame, /* Do any necessary cleanup after a function to restore stack, frame,
and regs. */ and regs. */
void void
sparc_frw_output_function_epilogue (file, size, ignored1, ignored2) sparc_flat_output_function_epilogue (file, size)
FILE *file; FILE *file;
int size; int size;
{ {
extern FILE *asm_out_data_file, *asm_out_file;
extern char call_used_regs[];
extern int frame_pointer_needed;
int tsize; int tsize;
char *sp_str = reg_names[STACK_POINTER_REGNUM]; char *sp_str = reg_names[STACK_POINTER_REGNUM];
char *t1_str = "%g1"; char *t1_str = "%g1";
rtx epilogue_delay = current_function_epilogue_delay_list; rtx epilogue_delay = current_function_epilogue_delay_list;
int noepilogue = FALSE; int noepilogue = FALSE;
/* This is only for the human reader. */
fprintf (file, "\t!#EPILOGUE#\n");
/* The epilogue does not depend on any registers, but the stack /* The epilogue does not depend on any registers, but the stack
registers, so we assume that if we have 1 pending nop, it can be registers, so we assume that if we have 1 pending nop, it can be
ignored, and 2 it must be filled (2 nops occur for integer ignored, and 2 it must be filled (2 nops occur for integer
...@@ -3369,7 +3358,7 @@ sparc_frw_output_function_epilogue (file, size, ignored1, ignored2) ...@@ -3369,7 +3358,7 @@ sparc_frw_output_function_epilogue (file, size, ignored1, ignored2)
size = SPARC_STACK_ALIGN (size); size = SPARC_STACK_ALIGN (size);
tsize = (!current_frame_info.initialized tsize = (!current_frame_info.initialized
? sparc_frw_compute_frame_size (size) ? sparc_flat_compute_frame_size (size)
: current_frame_info.total_size); : current_frame_info.total_size);
if (tsize == 0 && epilogue_delay == 0) if (tsize == 0 && epilogue_delay == 0)
...@@ -3404,7 +3393,7 @@ sparc_frw_output_function_epilogue (file, size, ignored1, ignored2) ...@@ -3404,7 +3393,7 @@ sparc_frw_output_function_epilogue (file, size, ignored1, ignored2)
fp_str, tsize, sp_str); fp_str, tsize, sp_str);
} }
sparc_frw_save_restore (file, "ld", "ldd"); sparc_flat_save_restore (file, "ld", "ldd");
if (current_function_returns_struct) if (current_function_returns_struct)
fprintf (file, "\tjmp %%o7+12\n"); fprintf (file, "\tjmp %%o7+12\n");
...@@ -3443,10 +3432,10 @@ sparc_frw_output_function_epilogue (file, size, ignored1, ignored2) ...@@ -3443,10 +3432,10 @@ sparc_frw_output_function_epilogue (file, size, ignored1, ignored2)
or the only register saved is the return register. */ or the only register saved is the return register. */
int int
sparc_frw_epilogue_delay_slots () sparc_flat_epilogue_delay_slots ()
{ {
if (!current_frame_info.initialized) if (!current_frame_info.initialized)
(void) sparc_frw_compute_frame_size (get_frame_size ()); (void) sparc_flat_compute_frame_size (get_frame_size ());
if (current_frame_info.total_size == 0) if (current_frame_info.total_size == 0)
return 1; return 1;
...@@ -3459,7 +3448,7 @@ sparc_frw_epilogue_delay_slots () ...@@ -3459,7 +3448,7 @@ sparc_frw_epilogue_delay_slots ()
pointer is OK. */ pointer is OK. */
int int
sparc_frw_eligible_for_epilogue_delay (trial, slot) sparc_flat_eligible_for_epilogue_delay (trial, slot)
rtx trial; rtx trial;
int slot; int slot;
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment