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
This commit is contained in:
parent
3bd36029de
commit
939dcd0d38
|
@ -1,3 +1,20 @@
|
||||||
|
2010-07-12 Richard Sandiford <rdsandiford@googlemail.com>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
2010-07-12 Richard Sandiford <rdsandiford@googlemail.com>
|
2010-07-12 Richard Sandiford <rdsandiford@googlemail.com>
|
||||||
|
|
||||||
* doc/tm.texi.in (SWITCHABLE_TARGET): Document.
|
* doc/tm.texi.in (SWITCHABLE_TARGET): Document.
|
||||||
|
|
|
@ -3477,7 +3477,7 @@ lower-subreg.o : lower-subreg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
|
||||||
$(EXPR_H) $(EXCEPT_H) $(REGS_H) $(TREE_PASS_H) $(DF_H)
|
$(EXPR_H) $(EXCEPT_H) $(REGS_H) $(TREE_PASS_H) $(DF_H)
|
||||||
target-globals.o : target-globals.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
|
target-globals.o : target-globals.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
|
||||||
$(TM_H) insn-config.h $(MACHMODE_H) $(GGC_H) $(TOPLEV_H) target-globals.h \
|
$(TM_H) insn-config.h $(MACHMODE_H) $(GGC_H) $(TOPLEV_H) target-globals.h \
|
||||||
$(FLAGS_H)
|
$(FLAGS_H) $(REGS_H)
|
||||||
|
|
||||||
$(out_object_file): $(out_file) $(CONFIG_H) coretypes.h $(TM_H) $(TREE_H) \
|
$(out_object_file): $(out_file) $(CONFIG_H) coretypes.h $(TM_H) $(TREE_H) \
|
||||||
$(RTL_H) $(REGS_H) hard-reg-set.h insn-config.h conditions.h \
|
$(RTL_H) $(REGS_H) hard-reg-set.h insn-config.h conditions.h \
|
||||||
|
|
|
@ -59,6 +59,11 @@ along with GCC; see the file COPYING3. If not see
|
||||||
int max_regno;
|
int max_regno;
|
||||||
|
|
||||||
|
|
||||||
|
struct target_regs default_target_regs;
|
||||||
|
#if SWITCHABLE_TARGET
|
||||||
|
struct target_regs *this_target_regs = &default_target_regs;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Register tables used by many passes. */
|
/* Register tables used by many passes. */
|
||||||
|
|
||||||
/* Indexed by hard register number, contains 1 for registers
|
/* Indexed by hard register number, contains 1 for registers
|
||||||
|
@ -175,12 +180,6 @@ const char * 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;
|
||||||
|
|
||||||
/* 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 reg_raw_mode[FIRST_PSEUDO_REGISTER];
|
|
||||||
|
|
||||||
/* 1 if there is a register of given mode. */
|
/* 1 if there is a register of given mode. */
|
||||||
bool have_regs_of_mode [MAX_MACHINE_MODE];
|
bool have_regs_of_mode [MAX_MACHINE_MODE];
|
||||||
|
|
||||||
|
@ -209,9 +208,6 @@ static GTY(()) rtx top_of_stack[MAX_MACHINE_MODE];
|
||||||
reginfo has been initialized. */
|
reginfo has been initialized. */
|
||||||
static int no_global_reg_vars = 0;
|
static int no_global_reg_vars = 0;
|
||||||
|
|
||||||
/* Specify number of hard registers given machine mode occupy. */
|
|
||||||
unsigned char hard_regno_nregs[FIRST_PSEUDO_REGISTER][MAX_MACHINE_MODE];
|
|
||||||
|
|
||||||
/* Given a register bitmap, turn on the bits in a HARD_REG_SET that
|
/* Given a register bitmap, turn on the bits in a HARD_REG_SET that
|
||||||
correspond to the hard registers, if any, set in that map. This
|
correspond to the hard registers, if any, set in that map. This
|
||||||
could be done far more efficiently by having all sorts of special-cases
|
could be done far more efficiently by having all sorts of special-cases
|
||||||
|
|
35
gcc/regs.h
35
gcc/regs.h
|
@ -218,13 +218,6 @@ extern short *reg_renumber;
|
||||||
|
|
||||||
extern bool have_regs_of_mode [MAX_MACHINE_MODE];
|
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
|
/* 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. */
|
||||||
|
|
||||||
|
@ -266,9 +259,6 @@ typedef unsigned short move_table[N_REG_CLASSES];
|
||||||
in another class. */
|
in another class. */
|
||||||
extern move_table *move_cost[MAX_MACHINE_MODE];
|
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
|
/* 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. */
|
subset of the second so in that case the cost is zero. */
|
||||||
extern move_table *may_move_in_cost[MAX_MACHINE_MODE];
|
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. */
|
superset of the second so in that case the cost is zero. */
|
||||||
extern move_table *may_move_out_cost[MAX_MACHINE_MODE];
|
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
|
/* Return an exclusive upper bound on the registers occupied by hard
|
||||||
register (reg:MODE REGNO). */
|
register (reg:MODE REGNO). */
|
||||||
|
|
||||||
|
|
|
@ -27,10 +27,12 @@ along with GCC; see the file COPYING3. If not see
|
||||||
#include "toplev.h"
|
#include "toplev.h"
|
||||||
#include "target-globals.h"
|
#include "target-globals.h"
|
||||||
#include "flags.h"
|
#include "flags.h"
|
||||||
|
#include "regs.h"
|
||||||
|
|
||||||
#if SWITCHABLE_TARGET
|
#if SWITCHABLE_TARGET
|
||||||
struct target_globals default_target_globals = {
|
struct target_globals default_target_globals = {
|
||||||
&default_target_flag_state
|
&default_target_flag_state,
|
||||||
|
&default_target_regs
|
||||||
};
|
};
|
||||||
|
|
||||||
struct target_globals *
|
struct target_globals *
|
||||||
|
@ -40,6 +42,7 @@ save_target_globals (void)
|
||||||
|
|
||||||
g = ggc_alloc_target_globals ();
|
g = ggc_alloc_target_globals ();
|
||||||
g->flag_state = XCNEW (struct target_flag_state);
|
g->flag_state = XCNEW (struct target_flag_state);
|
||||||
|
g->regs = XCNEW (struct target_regs);
|
||||||
restore_target_globals (g);
|
restore_target_globals (g);
|
||||||
target_reinit ();
|
target_reinit ();
|
||||||
return g;
|
return g;
|
||||||
|
|
|
@ -22,9 +22,11 @@ along with GCC; see the file COPYING3. If not see
|
||||||
|
|
||||||
#if SWITCHABLE_TARGET
|
#if SWITCHABLE_TARGET
|
||||||
extern struct target_flag_state *this_target_flag_state;
|
extern struct target_flag_state *this_target_flag_state;
|
||||||
|
extern struct target_regs *this_target_regs;
|
||||||
|
|
||||||
struct GTY(()) target_globals {
|
struct GTY(()) target_globals {
|
||||||
struct target_flag_state *GTY((skip)) flag_state;
|
struct target_flag_state *GTY((skip)) flag_state;
|
||||||
|
struct target_regs *GTY((skip)) regs;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct target_globals default_target_globals;
|
extern struct target_globals default_target_globals;
|
||||||
|
@ -35,6 +37,7 @@ static inline void
|
||||||
restore_target_globals (struct target_globals *g)
|
restore_target_globals (struct target_globals *g)
|
||||||
{
|
{
|
||||||
this_target_flag_state = g->flag_state;
|
this_target_flag_state = g->flag_state;
|
||||||
|
this_target_regs = g->regs;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue