summaryrefslogtreecommitdiff
path: root/gcc/regs.h
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2010-07-12 18:53:08 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2010-07-12 18:53:08 +0000
commit939dcd0d38af0571a15f1bcff788d593ed33d5eb (patch)
treed708b56be81952da9c5f1952199355f972230b0e /gcc/regs.h
parent3bd36029de1b586b49b3b021385b275ba5427611 (diff)
Makefile.in (target-globals.o): Depend on $(REGS_H).
gcc/ * Makefile.in (target-globals.o): Depend on $(REGS_H). * regs.h (target_reg_modes): New structure. (default_target_reg_modes): Declare. (this_target_reg_modes): Declare as a variable or define as a macro. (hard_regno_nregs, reg_raw_mode): Redefine as macros. * reginfo.c (default_target_reg_modes): New variable. (this_target_reg_modes): New conditional variable. (hard_regno_nregs, reg_raw_mode): Delete. * target-globals.h (this_target_regs): Declare. (target_globals): Add a regs field. (restore_target_globals): Copy the regs field to this_target_regs. * target-globals.c: Include regs.h. (default_target_globals): Initialize the regs field. (save_target_globals): Likewise. From-SVN: r162087
Diffstat (limited to 'gcc/regs.h')
-rw-r--r--gcc/regs.h35
1 files changed, 25 insertions, 10 deletions
diff --git a/gcc/regs.h b/gcc/regs.h
index c9dddb5abd1..6ae427cd197 100644
--- a/gcc/regs.h
+++ b/gcc/regs.h
@@ -218,13 +218,6 @@ extern short *reg_renumber;
extern bool have_regs_of_mode [MAX_MACHINE_MODE];
-/* For each hard register, the widest mode object that it can contain.
- This will be a MODE_INT mode if the register can hold integers. Otherwise
- it will be a MODE_FLOAT or a MODE_CC mode, whichever is valid for the
- register. */
-
-extern enum machine_mode reg_raw_mode[FIRST_PSEUDO_REGISTER];
-
/* Flag set by local-alloc or global-alloc if they decide to allocate
something in a call-clobbered register. */
@@ -266,9 +259,6 @@ typedef unsigned short move_table[N_REG_CLASSES];
in another class. */
extern move_table *move_cost[MAX_MACHINE_MODE];
-/* Specify number of hard registers given machine mode occupy. */
-extern unsigned char hard_regno_nregs[FIRST_PSEUDO_REGISTER][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];
@@ -277,6 +267,31 @@ extern move_table *may_move_in_cost[MAX_MACHINE_MODE];
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
+ registers that a given machine mode occupies. */
+ unsigned char x_hard_regno_nregs[FIRST_PSEUDO_REGISTER][MAX_MACHINE_MODE];
+
+ /* For each hard register, the widest mode object that it can contain.
+ This will be a MODE_INT mode if the register can hold integers. Otherwise
+ 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];
+};
+
+extern struct target_regs default_target_regs;
+#if SWITCHABLE_TARGET
+extern struct target_regs *this_target_regs;
+#else
+#define this_target_regs (&default_target_regs)
+#endif
+
+#define hard_regno_nregs \
+ (this_target_regs->x_hard_regno_nregs)
+#define reg_raw_mode \
+ (this_target_regs->x_reg_raw_mode)
+
/* Return an exclusive upper bound on the registers occupied by hard
register (reg:MODE REGNO). */