Commit bcbaaba1 by Richard Sandiford Committed by Richard Sandiford

defaults.h (MAX_MOVE_MAX, [...]): Define if not defined.

gcc/
	* defaults.h (MAX_MOVE_MAX, MIN_UNITS_PER_WORD): Define if not defined.
	* libgcc2.c (MIN_UNITS_PER_WORD): Delete.
	* hard-reg-set.h (target_hard_regs): Add x_no_caller_save_reg_set.
	(no_caller_save_reg_set): Redefine as a macro.
	* reload.h (target_reload): Add x_caller_save_initialized_p and
	x_regno_save_mode.
	(caller_save_initialized_p): Redefine as a macro.
	* caller-save.c (caller_save_initialized_p, no_caller_save_reg_set)
	(MAX_MOVE_MAX, MIN_UNITS_PER_WORD): Delete.
	(regno_save_mode): Redefine as a macro.

From-SVN: r162095
parent 462f85ce
2010-07-12 Richard Sandiford <rdsandiford@googlemail.com> 2010-07-12 Richard Sandiford <rdsandiford@googlemail.com>
* defaults.h (MAX_MOVE_MAX, MIN_UNITS_PER_WORD): Define if not defined.
* libgcc2.c (MIN_UNITS_PER_WORD): Delete.
* hard-reg-set.h (target_hard_regs): Add x_no_caller_save_reg_set.
(no_caller_save_reg_set): Redefine as a macro.
* reload.h (target_reload): Add x_caller_save_initialized_p and
x_regno_save_mode.
(caller_save_initialized_p): Redefine as a macro.
* caller-save.c (caller_save_initialized_p, no_caller_save_reg_set)
(MAX_MOVE_MAX, MIN_UNITS_PER_WORD): Delete.
(regno_save_mode): Redefine as a macro.
2010-07-12 Richard Sandiford <rdsandiford@googlemail.com>
* Makefile.in (expmed.o, target-globals.o): Depend on expmed.h. * Makefile.in (expmed.o, target-globals.o): Depend on expmed.h.
* expmed.h: New file. * expmed.h: New file.
* expmed.c (default_target_costs): New variable. * expmed.c (default_target_costs): New variable.
......
...@@ -41,30 +41,10 @@ along with GCC; see the file COPYING3. If not see ...@@ -41,30 +41,10 @@ along with GCC; see the file COPYING3. If not see
#include "output.h" #include "output.h"
#include "ggc.h" #include "ggc.h"
/* True if caller-save has been initialized. */
bool caller_save_initialized_p;
/* Call used hard registers which can not be saved because there is no
insn for this. */
HARD_REG_SET no_caller_save_reg_set;
#ifndef MAX_MOVE_MAX
#define MAX_MOVE_MAX MOVE_MAX
#endif
#ifndef MIN_UNITS_PER_WORD
#define MIN_UNITS_PER_WORD UNITS_PER_WORD
#endif
#define MOVE_MAX_WORDS (MOVE_MAX / UNITS_PER_WORD) #define MOVE_MAX_WORDS (MOVE_MAX / UNITS_PER_WORD)
/* Modes for each hard register that we can save. The smallest mode is wide #define regno_save_mode \
enough to save the entire contents of the register. When saving the (this_target_reload->x_regno_save_mode)
register because it is live we first try to save in multi-register modes.
If that is not possible the save is done one register at a time. */
static enum machine_mode
regno_save_mode[FIRST_PSEUDO_REGISTER][MAX_MOVE_MAX / MIN_UNITS_PER_WORD + 1];
/* For each hard register, a place on the stack where it can be saved, /* For each hard register, a place on the stack where it can be saved,
if needed. */ if needed. */
......
...@@ -1025,6 +1025,14 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see ...@@ -1025,6 +1025,14 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define MOVE_MAX_PIECES MOVE_MAX #define MOVE_MAX_PIECES MOVE_MAX
#endif #endif
#ifndef MAX_MOVE_MAX
#define MAX_MOVE_MAX MOVE_MAX
#endif
#ifndef MIN_UNITS_PER_WORD
#define MIN_UNITS_PER_WORD UNITS_PER_WORD
#endif
#ifndef STACK_POINTER_OFFSET #ifndef STACK_POINTER_OFFSET
#define STACK_POINTER_OFFSET 0 #define STACK_POINTER_OFFSET 0
#endif #endif
......
...@@ -582,11 +582,6 @@ hard_reg_set_iter_next (hard_reg_set_iterator *iter, unsigned *regno) ...@@ -582,11 +582,6 @@ hard_reg_set_iter_next (hard_reg_set_iterator *iter, unsigned *regno)
extern char global_regs[FIRST_PSEUDO_REGISTER]; extern char global_regs[FIRST_PSEUDO_REGISTER];
/* Call used hard registers which can not be saved because there is no
insn for this. */
extern HARD_REG_SET no_caller_save_reg_set;
struct target_hard_regs { struct target_hard_regs {
/* Indexed by hard register number, contains 1 for registers /* Indexed by hard register number, contains 1 for registers
that are fixed use (stack pointer, pc, frame pointer, etc.;. that are fixed use (stack pointer, pc, frame pointer, etc.;.
...@@ -622,6 +617,10 @@ struct target_hard_regs { ...@@ -622,6 +617,10 @@ struct target_hard_regs {
with the local stack frame are safe, but scant others. */ with the local stack frame are safe, but scant others. */
HARD_REG_SET x_regs_invalidated_by_call; HARD_REG_SET x_regs_invalidated_by_call;
/* Call used hard registers which can not be saved because there is no
insn for this. */
HARD_REG_SET x_no_caller_save_reg_set;
/* Table of register numbers in the order in which to try to use them. */ /* Table of register numbers in the order in which to try to use them. */
int x_reg_alloc_order[FIRST_PSEUDO_REGISTER]; int x_reg_alloc_order[FIRST_PSEUDO_REGISTER];
...@@ -674,6 +673,8 @@ extern struct target_hard_regs *this_target_hard_regs; ...@@ -674,6 +673,8 @@ extern struct target_hard_regs *this_target_hard_regs;
(this_target_hard_regs->x_call_fixed_reg_set) (this_target_hard_regs->x_call_fixed_reg_set)
#define regs_invalidated_by_call \ #define regs_invalidated_by_call \
(this_target_hard_regs->x_regs_invalidated_by_call) (this_target_hard_regs->x_regs_invalidated_by_call)
#define no_caller_save_reg_set \
(this_target_hard_regs->x_no_caller_save_reg_set)
#define reg_alloc_order \ #define reg_alloc_order \
(this_target_hard_regs->x_reg_alloc_order) (this_target_hard_regs->x_reg_alloc_order)
#define inv_reg_alloc_order \ #define inv_reg_alloc_order \
......
...@@ -36,10 +36,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see ...@@ -36,10 +36,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define ATTRIBUTE_HIDDEN #define ATTRIBUTE_HIDDEN
#endif #endif
#ifndef MIN_UNITS_PER_WORD
#define MIN_UNITS_PER_WORD UNITS_PER_WORD
#endif
/* Work out the largest "word" size that we can deal with on this target. */ /* Work out the largest "word" size that we can deal with on this target. */
#if MIN_UNITS_PER_WORD > 4 #if MIN_UNITS_PER_WORD > 4
# define LIBGCC2_MAX_UNITS_PER_WORD 8 # define LIBGCC2_MAX_UNITS_PER_WORD 8
......
...@@ -171,6 +171,17 @@ struct target_reload { ...@@ -171,6 +171,17 @@ struct target_reload {
means that (MEM (MEM (REG n))) is also valid if (REG n) does not get means that (MEM (MEM (REG n))) is also valid if (REG n) does not get
a hard register. */ a hard register. */
bool x_spill_indirect_levels; bool x_spill_indirect_levels;
/* True if caller-save has been reinitialized. */
bool x_caller_save_initialized_p;
/* Modes for each hard register that we can save. The smallest mode is wide
enough to save the entire contents of the register. When saving the
register because it is live we first try to save in multi-register modes.
If that is not possible the save is done one register at a time. */
enum machine_mode (x_regno_save_mode
[FIRST_PSEUDO_REGISTER]
[MAX_MOVE_MAX / MIN_UNITS_PER_WORD + 1]);
}; };
extern struct target_reload default_target_reload; extern struct target_reload default_target_reload;
...@@ -184,6 +195,8 @@ extern struct target_reload *this_target_reload; ...@@ -184,6 +195,8 @@ extern struct target_reload *this_target_reload;
(this_target_reload->x_indirect_symref_ok) (this_target_reload->x_indirect_symref_ok)
#define double_reg_address_ok \ #define double_reg_address_ok \
(this_target_reload->x_double_reg_address_ok) (this_target_reload->x_double_reg_address_ok)
#define caller_save_initialized_p \
(this_target_reload->x_caller_save_initialized_p)
extern GTY (()) VEC(rtx,gc) *reg_equiv_memory_loc_vec; extern GTY (()) VEC(rtx,gc) *reg_equiv_memory_loc_vec;
extern rtx *reg_equiv_constant; extern rtx *reg_equiv_constant;
...@@ -377,9 +390,6 @@ extern void calculate_elim_costs_all_insns (void); ...@@ -377,9 +390,6 @@ extern void calculate_elim_costs_all_insns (void);
/* Deallocate the reload register used by reload number R. */ /* Deallocate the reload register used by reload number R. */
extern void deallocate_reload_reg (int r); extern void deallocate_reload_reg (int r);
/* True if caller-save has been reinitialized. */
extern bool caller_save_initialized_p;
/* Functions in caller-save.c: */ /* Functions in caller-save.c: */
/* Initialize for caller-save. */ /* Initialize for caller-save. */
......
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