Commit 1e326708 by Michael Hayes Committed by Jeff Law

regs.h (HARD_REGNO_CALL_PART_CLOBBERED): New macro.

        * regs.h (HARD_REGNO_CALL_PART_CLOBBERED):  New macro.
        * local-alloc.c (find_free_reg): Use it.
        * global.c (find_reg): Likewise.
        * tm.texi: Document HARD_REGNO_CALL_PART_CLOBBERED.

From-SVN: r22688
parent b8c08e04
......@@ -24,6 +24,11 @@ Wed Sep 30 18:29:26 1998 Jeffrey A Law (law@cygnus.com)
Wed Sep 30 18:19:27 1998 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* regs.h (HARD_REGNO_CALL_PART_CLOBBERED): New macro.
* local-alloc.c (find_free_reg): Use it.
* global.c (find_reg): Likewise.
* tm.texi: Document HARD_REGNO_CALL_PART_CLOBBERED.
* regs.h (HARD_REGNO_CALLER_SAVE_MODE): New macro.
* caller-save.c (init_caller_save): Use it.
* tm.texi: Document HARD_REGNO_CALLER_SAVE_MODE.
......
......@@ -976,7 +976,10 @@ find_reg (allocno, losers, alt_regs_p, accept_call_clobbered, retrying)
int regno = i;
#endif
if (! TEST_HARD_REG_BIT (used, regno)
&& HARD_REGNO_MODE_OK (regno, mode))
&& HARD_REGNO_MODE_OK (regno, mode)
&& (allocno_calls_crossed[allocno] == 0
|| accept_call_clobbered
|| ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
{
register int j;
register int lim = regno + HARD_REGNO_NREGS (regno, mode);
......
......@@ -2043,7 +2043,10 @@ find_free_reg (class, mode, qty, accept_call_clobbered, just_try_suggested,
int regno = i;
#endif
if (! TEST_HARD_REG_BIT (first_used, regno)
&& HARD_REGNO_MODE_OK (regno, mode))
&& HARD_REGNO_MODE_OK (regno, mode)
&& (qty_n_calls_crossed[qty] == 0
|| accept_call_clobbered
|| ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
{
register int j;
register int size1 = HARD_REGNO_NREGS (regno, mode);
......
......@@ -217,6 +217,12 @@ extern int caller_save_needed;
choose_hard_reg_mode (REGNO, NREGS)
#endif
/* Registers that get partially clobbered by a call in a given mode.
These must not be call used registers. */
#ifndef HARD_REGNO_CALL_PART_CLOBBERED
#define HARD_REGNO_CALL_PART_CLOBBERED(REGNO, MODE) 0
#endif
/* Allocated in local_alloc. */
/* A list of SCRATCH rtl allocated by local-alloc. */
......
......@@ -1333,6 +1333,17 @@ If a register has 0 in @code{CALL_USED_REGISTERS}, the compiler
automatically saves it on function entry and restores it on function
exit, if the register is used within the function.
@findex HARD_REGNO_CALL_PART_CLOBBERED
@item HARD_REGNO_CALL_PART_CLOBBERED (@var{regno}, @var{mode})
@cindex call-used register
@cindex call-clobbered register
@cindex call-saved register
A C expression that is non-zero if it is not permissible to store a
value of mode @var{mode} in hard register number @var{regno} across a
call without some part of it being clobbered. For most machines this
macro need not be defined. It is only required for machines that do not
preserve the entire contents of a register across a call.
@findex CONDITIONAL_REGISTER_USAGE
@findex fixed_regs
@findex call_used_regs
......
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