Commit 5aa62249 by Richard Sandiford Committed by Richard Sandiford

mips.h (mips16_globals): Declare.

gcc/
	* config/mips/mips.h (mips16_globals): Declare.
	(SWITCHABLE_TARGET): Define.
	* config/mips/mips.c: Include target-globals.h.
	(mips16_globals): New variable.
	(mips_set_mips16_mode): Use save_target_globals and
	restore_target_globals instead of target_reinit.

From-SVN: r162111
parent 77f55879
2010-07-12 Richard Sandiford <rdsandiford@googlemail.com> 2010-07-12 Richard Sandiford <rdsandiford@googlemail.com>
* config/mips/mips.h (mips16_globals): Declare.
(SWITCHABLE_TARGET): Define.
* config/mips/mips.c: Include target-globals.h.
(mips16_globals): New variable.
(mips_set_mips16_mode): Use save_target_globals and
restore_target_globals instead of target_reinit.
2010-07-12 Richard Sandiford <rdsandiford@googlemail.com>
* reginfo.c (init_reg_sets): Don't zero globals here. Update comment * reginfo.c (init_reg_sets): Don't zero globals here. Update comment
to say that the function can be called more than once. to say that the function can be called more than once.
* target-globals.c (save_target_globals): Call init_reg_sets. * target-globals.c (save_target_globals): Call init_reg_sets.
......
...@@ -58,6 +58,7 @@ along with GCC; see the file COPYING3. If not see ...@@ -58,6 +58,7 @@ along with GCC; see the file COPYING3. If not see
#include "gimple.h" #include "gimple.h"
#include "bitmap.h" #include "bitmap.h"
#include "diagnostic.h" #include "diagnostic.h"
#include "target-globals.h"
/* True if X is an UNSPEC wrapper around a SYMBOL_REF or LABEL_REF. */ /* True if X is an UNSPEC wrapper around a SYMBOL_REF or LABEL_REF. */
#define UNSPEC_ADDRESS_P(X) \ #define UNSPEC_ADDRESS_P(X) \
...@@ -568,6 +569,9 @@ static const char *mips_lo_relocs[NUM_SYMBOL_TYPES]; ...@@ -568,6 +569,9 @@ static const char *mips_lo_relocs[NUM_SYMBOL_TYPES];
/* Likewise for HIGHs. */ /* Likewise for HIGHs. */
static const char *mips_hi_relocs[NUM_SYMBOL_TYPES]; static const char *mips_hi_relocs[NUM_SYMBOL_TYPES];
/* Target state for MIPS16. */
struct target_globals *mips16_globals;
/* Index R is the smallest register class that contains register R. */ /* Index R is the smallest register class that contains register R. */
const enum reg_class mips_regno_to_class[FIRST_PSEUDO_REGISTER] = { const enum reg_class mips_regno_to_class[FIRST_PSEUDO_REGISTER] = {
LEA_REGS, LEA_REGS, M16_REGS, V1_REG, LEA_REGS, LEA_REGS, M16_REGS, V1_REG,
...@@ -15200,9 +15204,15 @@ mips_set_mips16_mode (int mips16_p) ...@@ -15200,9 +15204,15 @@ mips_set_mips16_mode (int mips16_p)
/* (Re)initialize MIPS target internals for new ISA. */ /* (Re)initialize MIPS target internals for new ISA. */
mips_init_relocs (); mips_init_relocs ();
if (was_mips16_p >= 0 || was_mips16_pch_p >= 0) if (mips16_p)
/* Reinitialize target-dependent state. */ {
target_reinit (); if (!mips16_globals)
mips16_globals = save_target_globals ();
else
restore_target_globals (mips16_globals);
}
else
restore_target_globals (&default_target_globals);
was_mips16_p = mips16_p; was_mips16_p = mips16_p;
was_mips16_pch_p = mips16_p; was_mips16_pch_p = mips16_p;
......
...@@ -3025,6 +3025,7 @@ extern const struct mips_cpu_info *mips_tune_info; ...@@ -3025,6 +3025,7 @@ extern const struct mips_cpu_info *mips_tune_info;
extern const struct mips_rtx_cost_data *mips_cost; extern const struct mips_rtx_cost_data *mips_cost;
extern bool mips_base_mips16; extern bool mips_base_mips16;
extern enum mips_code_readable_setting mips_code_readable; extern enum mips_code_readable_setting mips_code_readable;
extern GTY(()) struct target_globals *mips16_globals;
#endif #endif
/* Enable querying of DFA units. */ /* Enable querying of DFA units. */
...@@ -3059,3 +3060,6 @@ extern enum mips_code_readable_setting mips_code_readable; ...@@ -3059,3 +3060,6 @@ extern enum mips_code_readable_setting mips_code_readable;
support this feature. */ support this feature. */
#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \ #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
(((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_absptr) (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_absptr)
/* For switching between MIPS16 and non-MIPS16 modes. */
#define SWITCHABLE_TARGET 1
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