Commit 55e78c8c by Richard Sandiford Committed by Richard Sandiford

regs.h (target_regs): Add x_hard_regs_of_mode...

gcc/
	* regs.h (target_regs): Add x_hard_regs_of_mode, x_contains_reg_of_mode,
	x_move_cost, x_may_move_in_cost, x_may_move_out_cost and
	x_last_mode_for_init_move_cost.
	(have_regs_of_mode, contains_reg_of_mode, move_cost)
	(may_move_in_cost, may_move_out_cost): Redefine as macros.
	* reginfo.c (have_regs_of_mode, contains_reg_of_mode, move_cost)
	(may_move_in_cost, may_move_out_cost): Delete.
	(last_mode_for_init_move_cost): Redefine as a macro.

From-SVN: r162090
parent 6642445b
2010-07-12 Richard Sandiford <rdsandiford@googlemail.com> 2010-07-12 Richard Sandiford <rdsandiford@googlemail.com>
* regs.h (target_regs): Add x_hard_regs_of_mode, x_contains_reg_of_mode,
x_move_cost, x_may_move_in_cost, x_may_move_out_cost and
x_last_mode_for_init_move_cost.
(have_regs_of_mode, contains_reg_of_mode, move_cost)
(may_move_in_cost, may_move_out_cost): Redefine as macros.
* reginfo.c (have_regs_of_mode, contains_reg_of_mode, move_cost)
(may_move_in_cost, may_move_out_cost): Delete.
(last_mode_for_init_move_cost): Redefine as a macro.
2010-07-12 Richard Sandiford <rdsandiford@googlemail.com>
* hard-reg-set.h (target_hard_regs): New structure. * hard-reg-set.h (target_hard_regs): New structure.
(default_target_hard_regs): Declare. (default_target_hard_regs): Declare.
(this_target_hard_regs): Declare as a variable or define as a macro. (this_target_hard_regs): Declare as a variable or define as a macro.
......
...@@ -118,26 +118,8 @@ static const char *const initial_reg_names[] = REGISTER_NAMES; ...@@ -118,26 +118,8 @@ static const char *const initial_reg_names[] = REGISTER_NAMES;
/* Array containing all of the register class names. */ /* Array containing all of the register class names. */
const char * reg_class_names[] = REG_CLASS_NAMES; const char * reg_class_names[] = REG_CLASS_NAMES;
/* 1 if there is a register of given mode. */ #define last_mode_for_init_move_cost \
bool have_regs_of_mode [MAX_MACHINE_MODE]; (this_target_regs->x_last_mode_for_init_move_cost)
/* 1 if class does contain register of given mode. */
char contains_reg_of_mode [N_REG_CLASSES] [MAX_MACHINE_MODE];
/* Maximum cost of moving from a register in one class to a register in
another class. Based on TARGET_REGISTER_MOVE_COST. */
move_table *move_cost[MAX_MACHINE_MODE];
/* Similar, but here we don't have to move if the first index is a subset
of the second so in that case the cost is zero. */
move_table *may_move_in_cost[MAX_MACHINE_MODE];
/* Similar, but here we don't have to move if the first index is a superset
of the second so in that case the cost is zero. */
move_table *may_move_out_cost[MAX_MACHINE_MODE];
/* Keep track of the last mode we initialized move costs for. */
static int last_mode_for_init_move_cost;
/* Sample MEM values for use by memory_move_secondary_cost. */ /* Sample MEM values for use by memory_move_secondary_cost. */
static GTY(()) rtx top_of_stack[MAX_MACHINE_MODE]; static GTY(()) rtx top_of_stack[MAX_MACHINE_MODE];
......
...@@ -214,10 +214,6 @@ extern size_t reg_info_p_size; ...@@ -214,10 +214,6 @@ extern size_t reg_info_p_size;
extern short *reg_renumber; extern short *reg_renumber;
/* Vector indexed by machine mode saying whether there are regs of that mode. */
extern bool have_regs_of_mode [MAX_MACHINE_MODE];
/* Flag set by local-alloc or global-alloc if they decide to allocate /* Flag set by local-alloc or global-alloc if they decide to allocate
something in a call-clobbered register. */ something in a call-clobbered register. */
...@@ -249,24 +245,8 @@ extern int caller_save_needed; ...@@ -249,24 +245,8 @@ extern int caller_save_needed;
#define HARD_REGNO_CALL_PART_CLOBBERED(REGNO, MODE) 0 #define HARD_REGNO_CALL_PART_CLOBBERED(REGNO, MODE) 0
#endif #endif
/* 1 if the corresponding class does contain register of given
mode. */
extern char contains_reg_of_mode [N_REG_CLASSES] [MAX_MACHINE_MODE];
typedef unsigned short move_table[N_REG_CLASSES]; typedef unsigned short move_table[N_REG_CLASSES];
/* Maximum cost of moving from a register in one class to a register
in another class. */
extern move_table *move_cost[MAX_MACHINE_MODE];
/* Similar, but here we don't have to move if the first index is a
subset of the second so in that case the cost is zero. */
extern move_table *may_move_in_cost[MAX_MACHINE_MODE];
/* Similar, but here we don't have to move if the first index is a
superset of the second so in that case the cost is zero. */
extern move_table *may_move_out_cost[MAX_MACHINE_MODE];
/* Target-dependent globals. */ /* Target-dependent globals. */
struct target_regs { struct target_regs {
/* For each starting hard register, the number of consecutive hard /* For each starting hard register, the number of consecutive hard
...@@ -278,6 +258,28 @@ struct target_regs { ...@@ -278,6 +258,28 @@ struct target_regs {
it will be a MODE_FLOAT or a MODE_CC mode, whichever is valid for the it will be a MODE_FLOAT or a MODE_CC mode, whichever is valid for the
register. */ register. */
enum machine_mode x_reg_raw_mode[FIRST_PSEUDO_REGISTER]; enum machine_mode x_reg_raw_mode[FIRST_PSEUDO_REGISTER];
/* Vector indexed by machine mode saying whether there are regs of
that mode. */
bool x_have_regs_of_mode[MAX_MACHINE_MODE];
/* 1 if the corresponding class contains a register of the given mode. */
char x_contains_reg_of_mode[N_REG_CLASSES][MAX_MACHINE_MODE];
/* Maximum cost of moving from a register in one class to a register
in another class. Based on TARGET_REGISTER_MOVE_COST. */
move_table *x_move_cost[MAX_MACHINE_MODE];
/* Similar, but here we don't have to move if the first index is a
subset of the second so in that case the cost is zero. */
move_table *x_may_move_in_cost[MAX_MACHINE_MODE];
/* Similar, but here we don't have to move if the first index is a
superset of the second so in that case the cost is zero. */
move_table *x_may_move_out_cost[MAX_MACHINE_MODE];
/* Keep track of the last mode we initialized move costs for. */
int x_last_mode_for_init_move_cost;
}; };
extern struct target_regs default_target_regs; extern struct target_regs default_target_regs;
...@@ -291,6 +293,16 @@ extern struct target_regs *this_target_regs; ...@@ -291,6 +293,16 @@ extern struct target_regs *this_target_regs;
(this_target_regs->x_hard_regno_nregs) (this_target_regs->x_hard_regno_nregs)
#define reg_raw_mode \ #define reg_raw_mode \
(this_target_regs->x_reg_raw_mode) (this_target_regs->x_reg_raw_mode)
#define have_regs_of_mode \
(this_target_regs->x_have_regs_of_mode)
#define contains_reg_of_mode \
(this_target_regs->x_contains_reg_of_mode)
#define move_cost \
(this_target_regs->x_move_cost)
#define may_move_in_cost \
(this_target_regs->x_may_move_in_cost)
#define may_move_out_cost \
(this_target_regs->x_may_move_out_cost)
/* Return an exclusive upper bound on the registers occupied by hard /* Return an exclusive upper bound on the registers occupied by hard
register (reg:MODE REGNO). */ register (reg:MODE REGNO). */
......
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