sh.h: Define HARD_REGNO_RENAME_OK

Fri Jun 14 12:04:02 2002  Dhananjay R. Deshpande <dhananjayd@kpit.com>

	* sh.h: Define HARD_REGNO_RENAME_OK
	* sh.c: sh_hard_regno_rename_ok: New. If current function has
	interrupt_handler attribute, only registers saved on stack are OK.
	* sh-protos.h: Declare sh_hard_regno_rename_ok.

From-SVN: r54612
This commit is contained in:
Dhananjay R. Deshpande 2002-06-14 11:06:38 +00:00 committed by Joern Rennecke
parent 8e831557e4
commit 03b8ec294f
4 changed files with 34 additions and 0 deletions

View File

@ -1,3 +1,10 @@
Fri Jun 14 12:04:02 2002 Dhananjay R. Deshpande <dhananjayd@kpit.com>
* sh.h: Define HARD_REGNO_RENAME_OK
* sh.c: sh_hard_regno_rename_ok: New. If current function has
interrupt_handler attribute, only registers saved on stack are OK.
* sh-protos.h: Declare sh_hard_regno_rename_ok.
2002-06-14 Kaz Kojima <kkojima@gcc.gnu.org>
* config/sh/sh.md (jump): Emit jump insn.

View File

@ -122,6 +122,7 @@ extern int sh_need_epilogue PARAMS ((void));
extern int initial_elimination_offset PARAMS ((int, int));
extern int fldi_ok PARAMS ((void));
extern int sh_pr_n_sets PARAMS ((void));
extern int sh_hard_regno_rename_ok PARAMS ((unsigned int, unsigned int));
#ifdef HARD_CONST
extern void fpscr_set_from_mem PARAMS ((int, HARD_REG_SET));

View File

@ -6701,6 +6701,26 @@ sh_can_redirect_branch (branch1, branch2)
return 0;
}
/* Return non-zero if register old_reg can be renamed to register new_reg. */
int
sh_hard_regno_rename_ok (old_reg, new_reg)
unsigned int old_reg ATTRIBUTE_UNUSED;
unsigned int new_reg;
{
/* Interrupt functions can only use registers that have already been
saved by the prologue, even if they would normally be
call-clobbered. */
if ((lookup_attribute ("interrupt_handler",
DECL_ATTRIBUTES (current_function_decl))
!= NULL_TREE)
&& !regs_ever_live[new_reg])
return 0;
return 1;
}
/* A C statement (sans semicolon) to update the integer variable COST
based on the relationship between INSN that is dependent on
DEP_INSN through the dependence LINK. The default is to make no

View File

@ -942,6 +942,12 @@ extern char sh_additional_register_names[ADDREGNAMES_SIZE] \
&& (GET_MODE_SIZE (MODE2) <= 4)) \
: ((MODE1) != SFmode && (MODE2) != SFmode))))
/* A C expression that is nonzero if hard register NEW_REG can be
considered for use as a rename register for OLD_REG register */
#define HARD_REGNO_RENAME_OK(OLD_REG, NEW_REG) \
sh_hard_regno_rename_ok (OLD_REG, NEW_REG)
/* Specify the registers used for certain standard purposes.
The values of these macros are register numbers. */