summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-12 18:53:33 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-12 18:53:33 +0000
commitfee704fa1e3783afa2551a70145ed06cecd48926 (patch)
tree191314ba26394a131d04588253375bac451eef17 /gcc
parent6d0eb0c4660dc7c6454be5b04f24de84dab27342 (diff)
downloadgcc-fee704fa1e3783afa2551a70145ed06cecd48926.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162090 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/reginfo.c22
-rw-r--r--gcc/regs.h52
3 files changed, 45 insertions, 40 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ce599e4a581..36f4ea62ea2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,16 @@
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.
(default_target_hard_regs): Declare.
(this_target_hard_regs): Declare as a variable or define as a macro.
diff --git a/gcc/reginfo.c b/gcc/reginfo.c
index c0a300c69e9..f17084c46ef 100644
--- a/gcc/reginfo.c
+++ b/gcc/reginfo.c
@@ -118,26 +118,8 @@ static const char *const initial_reg_names[] = REGISTER_NAMES;
/* Array containing all of the register class names. */
const char * reg_class_names[] = REG_CLASS_NAMES;
-/* 1 if there is a register of given mode. */
-bool have_regs_of_mode [MAX_MACHINE_MODE];
-
-/* 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;
+#define last_mode_for_init_move_cost \
+ (this_target_regs->x_last_mode_for_init_move_cost)
/* Sample MEM values for use by memory_move_secondary_cost. */
static GTY(()) rtx top_of_stack[MAX_MACHINE_MODE];
diff --git a/gcc/regs.h b/gcc/regs.h
index 6ae427cd197..ac23ae62fc9 100644
--- a/gcc/regs.h
+++ b/gcc/regs.h
@@ -214,10 +214,6 @@ extern size_t reg_info_p_size;
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
something in a call-clobbered register. */
@@ -249,24 +245,8 @@ extern int caller_save_needed;
#define HARD_REGNO_CALL_PART_CLOBBERED(REGNO, MODE) 0
#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];
-/* 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. */
struct target_regs {
/* For each starting hard register, the number of consecutive hard
@@ -278,6 +258,28 @@ struct target_regs {
it will be a MODE_FLOAT or a MODE_CC mode, whichever is valid for the
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;
@@ -291,6 +293,16 @@ extern struct target_regs *this_target_regs;
(this_target_regs->x_hard_regno_nregs)
#define 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
register (reg:MODE REGNO). */