(restore_referenced_regs): New variable saveregs
which is number of regs to save at a time, instead of numregs,
which is total number of registers to save.
From-SVN: r4445
* caller-save.c (init_caller_save): If we were unable to
find a simple insn which meets all its constraints to save
and restore with a single insn in a mode, then set
regno_save_mode to VOIDmode to insure that this mode is never
used to caller-save the current register.
From-SVN: r2038
* caller-save.c (restore_referenced_regs): When restoring a
referenced hard register, use CEIL instead of truncating
divide to determine the maximum number of registers to
restore.
(insert_save_restore): Document maxrestore parameter.
(CEIL): Define.
From-SVN: r2003
Major rework to have caller-saves emit load/store double insns when
possible and to avoid useless resaving of registers restored for
source accesses only.
* caller-save.c (toplevel): All arrays are multi-dimensional to
hold information for multiple save/restore insns. New variable
hard_regs_need_restore.
(choose_hard_reg_mode): New argument `nregs' indicating how many
hard registers are desired. All callers changed.
(init_caller_save): Change initialization to handle multiple
register saves. A call-used register can not be live across
if we can not find a single register mode to save it in.
(multiple register saves are optional)
(init_save_areas): Change initialization of regno_save_mem to
handle multiple register saves.
(setup_save_areas): Allocate space for consecutive hard registers
in aligned consecutive memory locations. When allocating space
for consecutive hard registers, also initialize regno_save_mem
for each hard register stored as a single word.
(save_call_clobbered_regs): Initialize hard_regs_need_restore.
Set hard_regs_need_restore to hard_regs_saved after crossing
a call. Also recompute n_regs_saved. At the end of a basic block
we need only restore registers in hard_regs_need_restore.
(set_reg_live, clear_reg_live): Do the right thing for
hard_regs_need_restore and hard_regs_saved.
(restore_referenced_regs): Just return if X is a clobber.
Test hard_regs_need_restore to determine when to restore a hard
register from the save area.
(insert_save_restore): Now returns the number of extra registers
saved/restored. New argument `maxrestore' which constrains how
many hard registers should be restored. All callers changed.
Do stores of consecutive registers with double store insns if
possible. Else do them with single word insns. Likewise for
loads, except constrained by maxrestore. Set hard_regs_saved
and hard_regs_need_restore appropriately to minimize useless
saves into the save area. Test against hard_regs_need_restore
when trying to restore multiple regs and similarly test against
hard_regs_saved when storing multiple regs.
From-SVN: r1964