diff options
Diffstat (limited to 'gcc/config/mips/mips.c')
-rw-r--r-- | gcc/config/mips/mips.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 0ee6a31a..0d1265e 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -494,7 +494,7 @@ static int mips_base_align_jumps; /* align_jumps */ static int mips_base_align_functions; /* align_functions */ /* Index [M][R] is true if register R is allowed to hold a value of mode M. */ -bool mips_hard_regno_mode_ok[(int) MAX_MACHINE_MODE][FIRST_PSEUDO_REGISTER]; +static bool mips_hard_regno_mode_ok_p[MAX_MACHINE_MODE][FIRST_PSEUDO_REGISTER]; /* Index C is true if character C is a valid PRINT_OPERAND punctation character. */ @@ -12725,7 +12725,7 @@ mips_can_use_return_insn (void) The result of this function is cached in mips_hard_regno_mode_ok. */ static bool -mips_hard_regno_mode_ok_p (unsigned int regno, machine_mode mode) +mips_hard_regno_mode_ok_uncached (unsigned int regno, machine_mode mode) { unsigned int size; enum mode_class mclass; @@ -12830,6 +12830,14 @@ mips_hard_regno_mode_ok_p (unsigned int regno, machine_mode mode) return false; } +/* Implement TARGET_HARD_REGNO_MODE_OK. */ + +static bool +mips_hard_regno_mode_ok (unsigned int regno, machine_mode mode) +{ + return mips_hard_regno_mode_ok_p[mode][regno]; +} + /* Return nonzero if register OLD_REG can be renamed to register NEW_REG. */ bool @@ -12912,14 +12920,14 @@ mips_class_max_nregs (enum reg_class rclass, machine_mode mode) COPY_HARD_REG_SET (left, reg_class_contents[(int) rclass]); if (hard_reg_set_intersect_p (left, reg_class_contents[(int) ST_REGS])) { - if (HARD_REGNO_MODE_OK (ST_REG_FIRST, mode)) + if (mips_hard_regno_mode_ok (ST_REG_FIRST, mode)) size = MIN (size, 4); AND_COMPL_HARD_REG_SET (left, reg_class_contents[(int) ST_REGS]); } if (hard_reg_set_intersect_p (left, reg_class_contents[(int) FP_REGS])) { - if (HARD_REGNO_MODE_OK (FP_REG_FIRST, mode)) + if (mips_hard_regno_mode_ok (FP_REG_FIRST, mode)) { if (MSA_SUPPORTED_MODE_P (mode)) size = MIN (size, UNITS_PER_MSA_REG); @@ -20110,8 +20118,8 @@ mips_option_override (void) /* Set up mips_hard_regno_mode_ok. */ for (mode = 0; mode < MAX_MACHINE_MODE; mode++) for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) - mips_hard_regno_mode_ok[mode][regno] - = mips_hard_regno_mode_ok_p (regno, (machine_mode) mode); + mips_hard_regno_mode_ok_p[mode][regno] + = mips_hard_regno_mode_ok_uncached (regno, (machine_mode) mode); /* Function to allocate machine-dependent function status. */ init_machine_status = &mips_init_machine_status; @@ -22578,6 +22586,9 @@ mips_promote_function_mode (const_tree type ATTRIBUTE_UNUSED, #undef TARGET_HARD_REGNO_SCRATCH_OK #define TARGET_HARD_REGNO_SCRATCH_OK mips_hard_regno_scratch_ok +#undef TARGET_HARD_REGNO_MODE_OK +#define TARGET_HARD_REGNO_MODE_OK mips_hard_regno_mode_ok + #undef TARGET_HARD_REGNO_CALL_PART_CLOBBERED #define TARGET_HARD_REGNO_CALL_PART_CLOBBERED \ mips_hard_regno_call_part_clobbered |