diff options
Diffstat (limited to 'gcc')
40 files changed, 372 insertions, 275 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6eaff19375d..04aef581e0a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,84 @@ +2004-02-02 Jan Hubicka <jh@suse.cz> + + * alias.c (record_set): Use hard_regno_nregs. + * bt-load.c (find_btr_reference, note_btr_set): Likewise. + * builtins.c (apply_args_size): Likewise. + * caller-save.c (setup_save_areas, save_call_clobbered_regs, + mark_set_regs, add_stored_regs, mark_referenced_regs, + insert_restore, insert_save, insert_one_insn): Likewise. + * cfgcleanup.c: Include regs.h + (mark_effect, mentions_nonequal_regs): Likewise. + * cfgrtl.c (mark_killed_regs): Likewise + * combine.c (update_table_tick, record_value_for_reg, + record_dead_and_set_regs, get_last_value_validate, use_crosses_set_p, + reg_dead_at_p_1, reg_dead_at_p, mark_used_regs_combine, move_deaths, + reg_bitfield_target_p, distribute_notes): Likewise. + * cse.c (mention_regs, insert, invalidate, invalidate_for_call, + exp_equiv_p, cse_insn): Likewise. + * cselib.c (cselib_lookup): Likewise. + (cselib_invalidate_regno, cselib_record_set): Likewise. + * df.c (df_ref_record): Likewise. + * dwarf2out.c (reg_loc_descriptor, multiple_reg_loc_descriptor): + Likewise. + * flow.c (mark_reg, insn_dead_p, mark_set_1, mark_used_reg, + count_or_remove_death_notes_bb): Likewise. + * function.c (aggregate_value_p, keep_stack_depressed): Likewise. + * gloval.c (global_alloc, find_reg, mark_reg_store, mark_reg_conflicts, + mark_reg_death, set_preference, reg_becomes_live, reg_dies): Likewise. + * integrate.c (mark_stores): Likewise. + * jump.c (delete_prior_computation): Likewise. + * lcm.c (reg_dies, reg_becomes_live): Likewise. + * local-alloc.c (combine_regs, find_free_reg, post_mark_life): Likewise. + * loop.c (LOOP_REGNO_NREGS): Likewise. + * postreload.c (reload_combine, reload_combine_note_store, + reload_combine_note_use, reload_cse_move2add, move2add_note_store): Likewise. + * ra-colorize.c (combine, color_usable_p, get_free_reg, + calculate_dont_begin, calculate_dont_begin, colorize_one_web, + try_recolor_web, insert_coalesced_conflicts, check_colors, + break_precolored_alias): Likewise. + * ra-debug.c: Include regs.h + (ra_print_rtx_object): Likewise. + * ra-rewrite (choose_spill_colors): Likewise. + (spill_same_color_p, update_spill_colors, spill_is_free): Likewise. + * ra.c (init_ra): Likewise. + * recog.c (reg_fits_class_p, peep2_reg_dead_p, + peep2_find_free_register): Likewise. + * reg-stack.c (subst_stack_regs_pat, convert_regs_exit): Likewise. + * regclass.c (hard_regno_nregs): New array. + (init_reg_modes_once): Initialize it. + (choose_hard_reg_mode): Use it. + (record_reg_classes): Likewise. + * regmove.c (mark_flags_life_zones): Likewise. + * regrename.c (note_sets, clear_dead_regs, regrename_optimize, + scan_rtx_reg, dump_def_use_chain, kill_value, set_value_regno, + copy_value, maybe_mode_change, find_oldest_value_reg, + copyprop_hardreg_forward_1): + * regs.h (hard_regno_nregs): Declare. + * realod.c (reload_inner_reg_of_subreg): Use it. + (push_reload, combine_reloads, find_dummy_reload, + hard_reg_set_here_p, operands_match_p, decompose, find_reloads, + refers_to_regno_for_reload_p, find_equiv_reg, regno_clobbered_p, + reload_adjust_reg_for_mode): Likewise. + * reload1.c (compute_use_by_pseudos, count_pseudo, + count_spilled_pseudo, find_reg, find_reload_regs, mark_home_live, + spill_hard_reg, forget_old_reloads_1, mark_reload_reg_in_use, + clear_reload_reg_in_use, reload_reg_free_for_value_p, free_for_value_p + allocate_reload_reg, choose_reload_regs, emit_reload_insns, + delete_output_reload): Likewise. + * resource.c (update_live_status, mark_referenced_resources, + mark_set_resources, mark_target_live_regs): Likewise. + * rtlanal.c: Include regs.h + (refers_to_regno_p, reg_overlap_mentioned_p, dead_or_set_p, + dead_or_set_regno_p, find_regno_note, find_reg_fusage, + subreg_regno_offset, subreg_offset_representable_p, + hoist_test_store): Likewise. + * sched-deps.c (sched_analyze_1, sched_analyze_2): Likewise. + * sched-rgn.c (check_live_1, update_live_1): Likewise. + * stmt.c: Include regs.h + (decl_conflicts_with_clobbers_p): Likewise. + * varasm.c (make_decl_rtl): Likewise. + * Makefile.in (cfgcleanup.o, rtlanal.o, ra-debug.o): Add regs.h dependnecy. + 2004-02-01 Kazu Hirata <kazu@cs.umass.edu> * config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 6a83a2f0563..746c74231a1 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -1545,7 +1545,7 @@ print-rtl.o : print-rtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(RTL_H) $(TREE_H) hard-reg-set.h $(BASIC_BLOCK_H) real.h $(TM_P_H) rtlanal.o : rtlanal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) toplev.h \ $(RTL_H) hard-reg-set.h $(TM_P_H) insn-config.h $(RECOG_H) real.h flags.h \ - $(BASIC_BLOCK_H) + $(BASIC_BLOCK_H) $(REGS_H) errors.o : errors.c $(CONFIG_H) $(SYSTEM_H) errors.h $(CC) -c $(ALL_CFLAGS) -DGENERATOR_FILE $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION) @@ -1702,7 +1702,7 @@ cfgbuild.o : cfgbuild.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) fla cfgcleanup.o : cfgcleanup.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(RTL_H) $(TIMEVAR_H) $(BASIC_BLOCK_H) hard-reg-set.h output.h flags.h \ $(RECOG_H) toplev.h $(GGC_H) insn-config.h cselib.h $(TARGET_H) $(TM_P_H) \ - $(PARAMS_H) + $(PARAMS_H) $(REGS_H) cfgloop.o : cfgloop.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) coretypes.h $(TM_H) \ $(BASIC_BLOCK_H) hard-reg-set.h cfgloop.h flags.h cfgloopanal.o : cfgloopanal.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \ @@ -1748,7 +1748,7 @@ ra-colorize.o : ra-colorize.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_ $(TM_P_H) function.h $(REGS_H) hard-reg-set.h $(BASIC_BLOCK_H) df.h output.h ra.h ra-debug.o : ra-debug.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ insn-config.h $(RECOG_H) function.h hard-reg-set.h $(BASIC_BLOCK_H) df.h output.h \ - ra.h $(TM_P_H) + ra.h $(TM_P_H) $(REGS_H) ra-rewrite.o : ra-rewrite.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ $(TM_P_H) function.h $(REGS_H) hard-reg-set.h $(BASIC_BLOCK_H) df.h $(EXPR_H) \ output.h except.h ra.h reload.h insn-config.h diff --git a/gcc/alias.c b/gcc/alias.c index 5fd88120ae4..00060fceea1 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -942,7 +942,7 @@ record_set (rtx dest, rtx set, void *data ATTRIBUTE_UNUSED) /* If this spans multiple hard registers, then we must indicate that every register has an unusable value. */ if (regno < FIRST_PSEUDO_REGISTER) - n = HARD_REGNO_NREGS (regno, GET_MODE (dest)); + n = hard_regno_nregs[regno][GET_MODE (dest)]; else n = 1; if (n != 1) diff --git a/gcc/bt-load.c b/gcc/bt-load.c index f49cec8d00b..010b78e8e0f 100644 --- a/gcc/bt-load.c +++ b/gcc/bt-load.c @@ -198,7 +198,7 @@ find_btr_reference (rtx *px, void *preg) if (GET_CODE (x) != REG) return 0; regno = REGNO (x); - for (i = HARD_REGNO_NREGS (regno, GET_MODE (x)) - 1; i >= 0; i--) + for (i = hard_regno_nregs[regno][GET_MODE (x)] - 1; i >= 0; i--) if (TEST_HARD_REG_BIT (all_btrs, regno+i)) { btr_reference_found = px; @@ -430,7 +430,7 @@ note_btr_set (rtx dest, rtx set ATTRIBUTE_UNUSED, void *data) if (GET_CODE (dest) != REG) return; regno = REGNO (dest); - end_regno = regno + HARD_REGNO_NREGS (regno, GET_MODE (dest)); + end_regno = regno + hard_regno_nregs[regno][GET_MODE (dest)]; for (; regno < end_regno; regno++) if (TEST_HARD_REG_BIT (all_btrs, regno)) { diff --git a/gcc/builtins.c b/gcc/builtins.c index d28a1bfc402..b9b057d944f 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -941,7 +941,7 @@ apply_args_size (void) mode != VOIDmode; mode = GET_MODE_WIDER_MODE (mode)) if (HARD_REGNO_MODE_OK (regno, mode) - && HARD_REGNO_NREGS (regno, mode) == 1) + && hard_regno_nregs[regno][mode] == 1) best_mode = mode; if (best_mode == VOIDmode) diff --git a/gcc/caller-save.c b/gcc/caller-save.c index 7133fe393ab..38bc43160ca 100644 --- a/gcc/caller-save.c +++ b/gcc/caller-save.c @@ -300,7 +300,7 @@ setup_save_areas (void) { unsigned int regno = reg_renumber[i]; unsigned int endregno - = regno + HARD_REGNO_NREGS (regno, GET_MODE (regno_reg_rtx[i])); + = regno + hard_regno_nregs[regno][GET_MODE (regno_reg_rtx[i])]; for (r = regno; r < endregno; r++) if (call_used_regs[r]) @@ -436,7 +436,7 @@ save_call_clobbered_regs (void) { enum machine_mode mode; - nregs = HARD_REGNO_NREGS (r, PSEUDO_REGNO_MODE (regno)); + nregs = hard_regno_nregs[r][PSEUDO_REGNO_MODE (regno)]; mode = HARD_REGNO_CALLER_SAVE_MODE (r, nregs, PSEUDO_REGNO_MODE (regno)); if (GET_MODE_BITSIZE (mode) @@ -515,7 +515,7 @@ mark_set_regs (rtx reg, rtx setter ATTRIBUTE_UNUSED, else return; - endregno = regno + HARD_REGNO_NREGS (regno, mode); + endregno = regno + hard_regno_nregs[regno][mode]; for (i = regno; i < endregno; i++) SET_HARD_REG_BIT (this_insn_sets, i); @@ -548,7 +548,7 @@ add_stored_regs (rtx reg, rtx setter, void *data) return; regno = REGNO (reg) + offset; - endregno = regno + HARD_REGNO_NREGS (regno, mode); + endregno = regno + hard_regno_nregs[regno][mode]; for (i = regno; i < endregno; i++) SET_REGNO_REG_SET ((regset) data, i); @@ -595,7 +595,7 @@ mark_referenced_regs (rtx x) if (hardregno >= 0) { - int nregs = HARD_REGNO_NREGS (hardregno, GET_MODE (x)); + int nregs = hard_regno_nregs[hardregno][GET_MODE (x)]; while (nregs-- > 0) SET_HARD_REG_BIT (referenced_regs, hardregno + nregs); } @@ -683,7 +683,7 @@ insert_restore (struct insn_chain *chain, int before_p, int regno, mem = regno_save_mem [regno][numregs]; if (save_mode [regno] != VOIDmode && save_mode [regno] != GET_MODE (mem) - && numregs == (unsigned int) HARD_REGNO_NREGS (regno, save_mode [regno])) + && numregs == (unsigned int) hard_regno_nregs[regno][save_mode [regno]]) mem = adjust_address (mem, save_mode[regno], 0); pat = gen_rtx_SET (VOIDmode, gen_rtx_REG (GET_MODE (mem), @@ -755,7 +755,7 @@ insert_save (struct insn_chain *chain, int before_p, int regno, mem = regno_save_mem [regno][numregs]; if (save_mode [regno] != VOIDmode && save_mode [regno] != GET_MODE (mem) - && numregs == (unsigned int) HARD_REGNO_NREGS (regno, save_mode [regno])) + && numregs == (unsigned int) hard_regno_nregs[regno][save_mode [regno]]) mem = adjust_address (mem, save_mode[regno], 0); pat = gen_rtx_SET (VOIDmode, mem, gen_rtx_REG (GET_MODE (mem), @@ -828,7 +828,7 @@ insert_one_insn (struct insn_chain *chain, int before_p, int code, rtx pat) regno = reg_renumber[regno]; if (regno < 0) continue; - for (i = HARD_REGNO_NREGS (regno, GET_MODE (reg)) - 1; + for (i = hard_regno_nregs[regno][GET_MODE (reg)] - 1; i >= 0; i--) SET_REGNO_REG_SET (&new->live_throughout, regno + i); } diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c index a886e832bb5..38a2915cc7d 100644 --- a/gcc/cfgcleanup.c +++ b/gcc/cfgcleanup.c @@ -48,6 +48,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "params.h" #include "tm_p.h" #include "target.h" +#include "regs.h" /* cleanup_cfg maintains following flags for each basic block. */ @@ -220,7 +221,7 @@ mark_effect (rtx exp, regset nonequal) CLEAR_REGNO_REG_SET (nonequal, regno); if (regno < FIRST_PSEUDO_REGISTER) { - int n = HARD_REGNO_NREGS (regno, GET_MODE (dest)); + int n = hard_regno_nregs[regno][GET_MODE (dest)]; while (--n > 0) CLEAR_REGNO_REG_SET (nonequal, regno + n); } @@ -239,7 +240,7 @@ mark_effect (rtx exp, regset nonequal) SET_REGNO_REG_SET (nonequal, regno); if (regno < FIRST_PSEUDO_REGISTER) { - int n = HARD_REGNO_NREGS (regno, GET_MODE (dest)); + int n = hard_regno_nregs[regno][GET_MODE (dest)]; while (--n > 0) SET_REGNO_REG_SET (nonequal, regno + n); } @@ -265,7 +266,7 @@ mentions_nonequal_regs (rtx *x, void *data) return 1; if (regno < FIRST_PSEUDO_REGISTER) { - int n = HARD_REGNO_NREGS (regno, GET_MODE (*x)); + int n = hard_regno_nregs[regno][GET_MODE (*x)]; while (--n > 0) if (REGNO_REG_SET_P (nonequal, regno + n)) return 1; diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c index 01a5f3dbe66..cce760ff7cb 100644 --- a/gcc/cfgrtl.c +++ b/gcc/cfgrtl.c @@ -1352,7 +1352,7 @@ mark_killed_regs (rtx reg, rtx set ATTRIBUTE_UNUSED, void *data) SET_REGNO_REG_SET (killed, regno); else { - for (i = 0; i < (int) HARD_REGNO_NREGS (regno, GET_MODE (reg)); i++) + for (i = 0; i < (int) hard_regno_nregs[regno][GET_MODE (reg)]; i++) SET_REGNO_REG_SET (killed, regno + i); } } diff --git a/gcc/combine.c b/gcc/combine.c index 0db618e1ff1..36a7194bc16 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -11368,7 +11368,7 @@ update_table_tick (rtx x) unsigned int regno = REGNO (x); unsigned int endregno = regno + (regno < FIRST_PSEUDO_REGISTER - ? HARD_REGNO_NREGS (regno, GET_MODE (x)) : 1); + ? hard_regno_nregs[regno][GET_MODE (x)] : 1); unsigned int r; for (r = regno; r < endregno; r++) @@ -11433,7 +11433,7 @@ record_value_for_reg (rtx reg, rtx insn, rtx value) unsigned int regno = REGNO (reg); unsigned int endregno = regno + (regno < FIRST_PSEUDO_REGISTER - ? HARD_REGNO_NREGS (regno, GET_MODE (reg)) : 1); + ? hard_regno_nregs[regno][GET_MODE (reg)] : 1); unsigned int i; /* If VALUE contains REG and we have a previous value for REG, substitute @@ -11590,7 +11590,7 @@ record_dead_and_set_regs (rtx insn) unsigned int regno = REGNO (XEXP (link, 0)); unsigned int endregno = regno + (regno < FIRST_PSEUDO_REGISTER - ? HARD_REGNO_NREGS (regno, GET_MODE (XEXP (link, 0))) + ? hard_regno_nregs[regno][GET_MODE (XEXP (link, 0))] : 1); for (i = regno; i < endregno; i++) @@ -11726,7 +11726,7 @@ get_last_value_validate (rtx *loc, rtx insn, int tick, int replace) unsigned int regno = REGNO (x); unsigned int endregno = regno + (regno < FIRST_PSEUDO_REGISTER - ? HARD_REGNO_NREGS (regno, GET_MODE (x)) : 1); + ? hard_regno_nregs[regno][GET_MODE (x)] : 1); unsigned int j; for (j = regno; j < endregno; j++) @@ -11888,7 +11888,7 @@ use_crosses_set_p (rtx x, int from_cuid) { unsigned int regno = REGNO (x); unsigned endreg = regno + (regno < FIRST_PSEUDO_REGISTER - ? HARD_REGNO_NREGS (regno, GET_MODE (x)) : 1); + ? hard_regno_nregs[regno][GET_MODE (x)] : 1); #ifdef PUSH_ROUNDING /* Don't allow uses of the stack pointer to be moved, @@ -11945,7 +11945,7 @@ reg_dead_at_p_1 (rtx dest, rtx x, void *data ATTRIBUTE_UNUSED) regno = REGNO (dest); endregno = regno + (regno < FIRST_PSEUDO_REGISTER - ? HARD_REGNO_NREGS (regno, GET_MODE (dest)) : 1); + ? hard_regno_nregs[regno][GET_MODE (dest)] : 1); if (reg_dead_endregno > regno && reg_dead_regno < endregno) reg_dead_flag = (GET_CODE (x) == CLOBBER) ? 1 : -1; @@ -11968,8 +11968,8 @@ reg_dead_at_p (rtx reg, rtx insn) /* Set variables for reg_dead_at_p_1. */ reg_dead_regno = REGNO (reg); reg_dead_endregno = reg_dead_regno + (reg_dead_regno < FIRST_PSEUDO_REGISTER - ? HARD_REGNO_NREGS (reg_dead_regno, - GET_MODE (reg)) + ? hard_regno_nregs[reg_dead_regno] + [GET_MODE (reg)] : 1); reg_dead_flag = 0; @@ -12070,7 +12070,7 @@ mark_used_regs_combine (rtx x) || regno == FRAME_POINTER_REGNUM) return; - endregno = regno + HARD_REGNO_NREGS (regno, GET_MODE (x)); + endregno = regno + hard_regno_nregs[regno][GET_MODE (x)]; for (r = regno; r < endregno; r++) SET_HARD_REG_BIT (newpat_used_regs, r); } @@ -12199,10 +12199,10 @@ move_deaths (rtx x, rtx maybe_kill_insn, int from_cuid, rtx to_insn, { unsigned int deadregno = REGNO (XEXP (note, 0)); unsigned int deadend - = (deadregno + HARD_REGNO_NREGS (deadregno, - GET_MODE (XEXP (note, 0)))); + = (deadregno + hard_regno_nregs[deadregno] + [GET_MODE (XEXP (note, 0))]); unsigned int ourend - = regno + HARD_REGNO_NREGS (regno, GET_MODE (x)); + = regno + hard_regno_nregs[regno][GET_MODE (x)]; unsigned int i; for (i = deadregno; i < deadend; i++) @@ -12223,15 +12223,15 @@ move_deaths (rtx x, rtx maybe_kill_insn, int from_cuid, rtx to_insn, && (GET_MODE_SIZE (GET_MODE (XEXP (note, 0))) < GET_MODE_SIZE (GET_MODE (x))))) && regno < FIRST_PSEUDO_REGISTER - && HARD_REGNO_NREGS (regno, GET_MODE (x)) > 1) + && hard_regno_nregs[regno][GET_MODE (x)] > 1) { unsigned int ourend - = regno + HARD_REGNO_NREGS (regno, GET_MODE (x)); + = regno + hard_regno_nregs[regno][GET_MODE (x)]; unsigned int i, offset; rtx oldnotes = 0; if (note) - offset = HARD_REGNO_NREGS (regno, GET_MODE (XEXP (note, 0))); + offset = hard_regno_nregs[regno][GET_MODE (XEXP (note, 0))]; else offset = 1; @@ -12344,8 +12344,8 @@ reg_bitfield_target_p (rtx x, rtx body) if (tregno >= FIRST_PSEUDO_REGISTER || regno >= FIRST_PSEUDO_REGISTER) return target == x; - endtregno = tregno + HARD_REGNO_NREGS (tregno, GET_MODE (target)); - endregno = regno + HARD_REGNO_NREGS (regno, GET_MODE (x)); + endtregno = tregno + hard_regno_nregs[tregno][GET_MODE (target)]; + endregno = regno + hard_regno_nregs[regno][GET_MODE (x)]; return endregno > tregno && regno < endtregno; } @@ -12821,11 +12821,11 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2) the previous insn that used this register. */ if (place && regno < FIRST_PSEUDO_REGISTER - && HARD_REGNO_NREGS (regno, GET_MODE (XEXP (note, 0))) > 1) + && hard_regno_nregs[regno][GET_MODE (XEXP (note, 0))] > 1) { unsigned int endregno - = regno + HARD_REGNO_NREGS (regno, - GET_MODE (XEXP (note, 0))); + = regno + hard_regno_nregs[regno] + [GET_MODE (XEXP (note, 0))]; int all_used = 1; unsigned int i; @@ -12841,7 +12841,7 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2) not already dead or set. */ for (i = regno; i < endregno; - i += HARD_REGNO_NREGS (i, reg_raw_mode[i])) + i += hard_regno_nregs[i][reg_raw_mode[i]]) { rtx piece = regno_reg_rtx[i]; basic_block bb = this_basic_block; diff --git a/gcc/cse.c b/gcc/cse.c index edc6ef3a8a0..3bdbf0321f1 100644 --- a/gcc/cse.c +++ b/gcc/cse.c @@ -1162,7 +1162,7 @@ mention_regs (rtx x) unsigned int regno = REGNO (x); unsigned int endregno = regno + (regno >= FIRST_PSEUDO_REGISTER ? 1 - : HARD_REGNO_NREGS (regno, GET_MODE (x))); + : hard_regno_nregs[regno][GET_MODE (x)]); unsigned int i; for (i = regno; i < endregno; i++) @@ -1529,7 +1529,7 @@ insert (rtx x, struct table_elt *classp, unsigned int hash, enum machine_mode mo if (GET_CODE (x) == REG && REGNO (x) < FIRST_PSEUDO_REGISTER) { unsigned int regno = REGNO (x); - unsigned int endregno = regno + HARD_REGNO_NREGS (regno, GET_MODE (x)); + unsigned int endregno = regno + hard_regno_nregs[regno][GET_MODE (x)]; unsigned int i; for (i = regno; i < endregno; i++) @@ -1842,7 +1842,7 @@ invalidate (rtx x, enum machine_mode full_mode) HOST_WIDE_INT in_table = TEST_HARD_REG_BIT (hard_regs_in_table, regno); unsigned int endregno - = regno + HARD_REGNO_NREGS (regno, GET_MODE (x)); + = regno + hard_regno_nregs[regno][GET_MODE (x)]; unsigned int tregno, tendregno, rn; struct table_elt *p, *next; @@ -1869,7 +1869,7 @@ invalidate (rtx x, enum machine_mode full_mode) tregno = REGNO (p->exp); tendregno - = tregno + HARD_REGNO_NREGS (tregno, GET_MODE (p->exp)); + = tregno + hard_regno_nregs[tregno][GET_MODE (p->exp)]; if (tendregno > regno && tregno < endregno) remove_from_table (p, hash); } @@ -2081,7 +2081,7 @@ invalidate_for_call (void) continue; regno = REGNO (p->exp); - endregno = regno + HARD_REGNO_NREGS (regno, GET_MODE (p->exp)); + endregno = regno + hard_regno_nregs[regno][GET_MODE (p->exp)]; for (i = regno; i < endregno; i++) if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i)) @@ -2540,7 +2540,7 @@ exp_equiv_p (rtx x, rtx y, int validate, int equal_values) unsigned int regno = REGNO (y); unsigned int endregno = regno + (regno >= FIRST_PSEUDO_REGISTER ? 1 - : HARD_REGNO_NREGS (regno, GET_MODE (y))); + : hard_regno_nregs[regno][GET_MODE (y)]); unsigned int i; /* If the quantities are not the same, the expressions are not @@ -5974,7 +5974,7 @@ cse_insn (rtx insn, rtx libcall_insn) unsigned int regno = REGNO (x); unsigned int endregno = regno + (regno >= FIRST_PSEUDO_REGISTER ? 1 - : HARD_REGNO_NREGS (regno, GET_MODE (x))); + : hard_regno_nregs[regno][GET_MODE (x)]); unsigned int i; for (i = regno; i < endregno; i++) diff --git a/gcc/cselib.c b/gcc/cselib.c index 5c98b067f4d..1e6aa49ecb8 100644 --- a/gcc/cselib.c +++ b/gcc/cselib.c @@ -900,7 +900,7 @@ cselib_lookup (rtx x, enum machine_mode mode, int create) if (i < FIRST_PSEUDO_REGISTER) { - unsigned int n = HARD_REGNO_NREGS (i, mode); + unsigned int n = hard_regno_nregs[i][mode]; if (n > max_value_regs) max_value_regs = n; @@ -980,7 +980,7 @@ cselib_invalidate_regno (unsigned int regno, enum machine_mode mode) else i = regno - max_value_regs; - endregno = regno + HARD_REGNO_NREGS (regno, mode); + endregno = regno + hard_regno_nregs[regno][mode]; } else { @@ -1001,7 +1001,7 @@ cselib_invalidate_regno (unsigned int regno, enum machine_mode mode) unsigned int this_last = i; if (i < FIRST_PSEUDO_REGISTER && v != NULL) - this_last += HARD_REGNO_NREGS (i, GET_MODE (v->u.val_rtx)) - 1; + this_last += hard_regno_nregs[i][GET_MODE (v->u.val_rtx)] - 1; if (this_last < regno || v == NULL) { @@ -1177,7 +1177,7 @@ cselib_record_set (rtx dest, cselib_val *src_elt, cselib_val *dest_addr_elt) { if (dreg < FIRST_PSEUDO_REGISTER) { - unsigned int n = HARD_REGNO_NREGS (dreg, GET_MODE (dest)); + unsigned int n = hard_regno_nregs[dreg][GET_MODE (dest)]; if (n > max_value_regs) max_value_regs = n; @@ -819,7 +819,7 @@ df_ref_record (struct df *df, rtx reg, rtx *loc, rtx insn, are really referenced. E.g., a (subreg:SI (reg:DI 0) 0) does _not_ reference the whole reg 0 in DI mode (which would also include reg 1, at least, if 0 and 1 are SImode registers). */ - endregno = HARD_REGNO_NREGS (regno, GET_MODE (reg)); + endregno = hard_regno_nregs[regno][GET_MODE (reg)]; if (GET_CODE (reg) == SUBREG) regno += subreg_regno_offset (regno, GET_MODE (SUBREG_REG (reg)), SUBREG_BYTE (reg), GET_MODE (reg)); diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 5dfc989ce68..3a405ab0018 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -8080,7 +8080,7 @@ reg_loc_descriptor (rtx rtl) reg = reg_number (rtl); regs = (*targetm.dwarf_register_span) (rtl); - if (HARD_REGNO_NREGS (reg, GET_MODE (rtl)) > 1 + if (hard_regno_nregs[reg][GET_MODE (rtl)] > 1 || regs) return multiple_reg_loc_descriptor (rtl, regs); else @@ -8110,7 +8110,7 @@ multiple_reg_loc_descriptor (rtx rtl, rtx regs) dw_loc_descr_ref loc_result = NULL; reg = reg_number (rtl); - nregs = HARD_REGNO_NREGS (reg, GET_MODE (rtl)); + nregs = hard_regno_nregs[reg][GET_MODE (rtl)]; /* Simple, contiguous registers. */ if (regs == NULL_RTX) diff --git a/gcc/flow.c b/gcc/flow.c index b314ea00b65..1ed469f8f48 100644 --- a/gcc/flow.c +++ b/gcc/flow.c @@ -928,7 +928,7 @@ mark_reg (rtx reg, void *xset) SET_REGNO_REG_SET (set, regno); if (regno < FIRST_PSEUDO_REGISTER) { - int n = HARD_REGNO_NREGS (regno, GET_MODE (reg)); + int n = hard_regno_nregs[regno][GET_MODE (reg)]; while (--n > 0) SET_REGNO_REG_SET (set, regno + n); } @@ -2163,7 +2163,7 @@ insn_dead_p (struct propagate_block_info *pbi, rtx x, int call_ok, words are not needed. */ if (regno < FIRST_PSEUDO_REGISTER) { - int n = HARD_REGNO_NREGS (regno, GET_MODE (r)); + int n = hard_regno_nregs[regno][GET_MODE (r)]; while (--n > 0) if (REGNO_REG_SET_P (pbi->reg_live, regno+n)) @@ -2560,7 +2560,7 @@ mark_set_1 (struct propagate_block_info *pbi, enum rtx_code code, rtx reg, rtx c case REG: regno_last = regno_first = REGNO (reg); if (regno_first < FIRST_PSEUDO_REGISTER) - regno_last += HARD_REGNO_NREGS (regno_first, GET_MODE (reg)) - 1; + regno_last += hard_regno_nregs[regno_first][GET_MODE (reg)] - 1; break; case SUBREG: @@ -2579,7 +2579,7 @@ mark_set_1 (struct propagate_block_info *pbi, enum rtx_code code, rtx reg, rtx c SUBREG_BYTE (reg), outer_mode); regno_last = (regno_first - + HARD_REGNO_NREGS (regno_first, outer_mode) - 1); + + hard_regno_nregs[regno_first][outer_mode] - 1); /* Since we've just adjusted the register number ranges, make sure REG matches. Otherwise some_was_live will be clear @@ -3491,7 +3491,7 @@ mark_used_reg (struct propagate_block_info *pbi, rtx reg, regno_last = regno_first = REGNO (reg); if (regno_first < FIRST_PSEUDO_REGISTER) - regno_last += HARD_REGNO_NREGS (regno_first, GET_MODE (reg)) - 1; + regno_last += hard_regno_nregs[regno_first][GET_MODE (reg)] - 1; /* Find out if any of this register is live after this instruction. */ some_was_live = some_was_dead = 0; @@ -4247,7 +4247,7 @@ count_or_remove_death_notes_bb (basic_block bb, int kill) if (REGNO (reg) >= FIRST_PSEUDO_REGISTER) n = 1; else - n = HARD_REGNO_NREGS (REGNO (reg), GET_MODE (reg)); + n = hard_regno_nregs[REGNO (reg)][GET_MODE (reg)]; count += n; } diff --git a/gcc/function.c b/gcc/function.c index 11edd8b9b27..675d919cb0c 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -4260,7 +4260,7 @@ aggregate_value_p (tree exp, tree fntype) return 0; regno = REGNO (reg); - nregs = HARD_REGNO_NREGS (regno, TYPE_MODE (type)); + nregs = hard_regno_nregs[regno][TYPE_MODE (type)]; for (i = 0; i < nregs; i++) if (! call_used_regs[regno + i]) return 1; @@ -7489,8 +7489,8 @@ keep_stack_depressed (rtx insns) && !REGNO_REG_SET_P (EXIT_BLOCK_PTR->global_live_at_start, regno) && !refers_to_regno_p (regno, - regno + HARD_REGNO_NREGS (regno, - Pmode), + regno + hard_regno_nregs[regno] + [Pmode], info.equiv_reg_src, NULL) && info.const_equiv[regno] == 0) break; diff --git a/gcc/global.c b/gcc/global.c index de765b36731..a676515e553 100644 --- a/gcc/global.c +++ b/gcc/global.c @@ -485,7 +485,7 @@ global_alloc (FILE *file) if (reg_renumber[i] >= 0) { int regno = reg_renumber[i]; - int endregno = regno + HARD_REGNO_NREGS (regno, PSEUDO_REGNO_MODE (i)); + int endregno = regno + hard_regno_nregs[regno][PSEUDO_REGNO_MODE (i)]; int j; for (j = regno; j < endregno; j++) @@ -1072,7 +1072,7 @@ find_reg (int num, HARD_REG_SET losers, int alt_regs_p, int accept_call_clobbere || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) { int j; - int lim = regno + HARD_REGNO_NREGS (regno, mode); + int lim = regno + hard_regno_nregs[regno][mode]; for (j = regno + 1; (j < lim && ! TEST_HARD_REG_BIT (used, j)); @@ -1119,7 +1119,7 @@ find_reg (int num, HARD_REG_SET losers, int alt_regs_p, int accept_call_clobbere REGNO_REG_CLASS (i)))) { int j; - int lim = i + HARD_REGNO_NREGS (i, mode); + int lim = i + hard_regno_nregs[i][mode]; for (j = i + 1; (j < lim && ! TEST_HARD_REG_BIT (used, j) @@ -1158,7 +1158,7 @@ find_reg (int num, HARD_REG_SET losers, int alt_regs_p, int accept_call_clobbere REGNO_REG_CLASS (i)))) { int j; - int lim = i + HARD_REGNO_NREGS (i, mode); + int lim = i + hard_regno_nregs[i][mode]; for (j = i + 1; (j < lim && ! TEST_HARD_REG_BIT (used, j) @@ -1235,7 +1235,7 @@ find_reg (int num, HARD_REG_SET losers, int alt_regs_p, int accept_call_clobbere register, but the check of allocno[num].size above was not enough. Sometimes we need more than one register for a single-word value. */ - && HARD_REGNO_NREGS (regno, mode) == 1 + && hard_regno_nregs[regno][mode] == 1 && (allocno[num].calls_crossed == 0 || accept_call_clobbered || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) @@ -1268,7 +1268,7 @@ find_reg (int num, HARD_REG_SET losers, int alt_regs_p, int accept_call_clobbere { int r = reg_renumber[k]; int endregno - = r + HARD_REGNO_NREGS (r, PSEUDO_REGNO_MODE (k)); + = r + hard_regno_nregs[r][PSEUDO_REGNO_MODE (k)]; if (regno >= r && regno < endregno) reg_renumber[k] = -1; @@ -1298,7 +1298,7 @@ find_reg (int num, HARD_REG_SET losers, int alt_regs_p, int accept_call_clobbere /* Make a set of the hard regs being allocated. */ CLEAR_HARD_REG_SET (this_reg); - lim = best_reg + HARD_REGNO_NREGS (best_reg, mode); + lim = best_reg + hard_regno_nregs[best_reg][mode]; for (j = best_reg; j < lim; j++) { SET_HARD_REG_BIT (this_reg, j); @@ -1490,7 +1490,7 @@ mark_reg_store (rtx reg, rtx setter, void *data ATTRIBUTE_UNUSED) /* Handle hardware regs (and pseudos allocated to hard regs). */ if (regno < FIRST_PSEUDO_REGISTER && ! fixed_regs[regno]) { - int last = regno + HARD_REGNO_NREGS (regno, GET_MODE (reg)); + int last = regno + hard_regno_nregs[regno][GET_MODE (reg)]; while (regno < last) { record_one_conflict (regno); @@ -1539,7 +1539,7 @@ mark_reg_conflicts (rtx reg) /* Handle hardware regs (and pseudos allocated to hard regs). */ if (regno < FIRST_PSEUDO_REGISTER && ! fixed_regs[regno]) { - int last = regno + HARD_REGNO_NREGS (regno, GET_MODE (reg)); + int last = regno + hard_regno_nregs[regno][GET_MODE (reg)]; while (regno < last) { record_one_conflict (regno); @@ -1573,7 +1573,7 @@ mark_reg_death (rtx reg) { /* Pseudo regs already assigned hardware regs are treated almost the same as explicit hardware regs. */ - int last = regno + HARD_REGNO_NREGS (regno, GET_MODE (reg)); + int last = regno + hard_regno_nregs[regno][GET_MODE (reg)]; while (regno < last) { CLEAR_HARD_REG_BIT (hard_regs_live, regno); @@ -1590,7 +1590,7 @@ mark_reg_death (rtx reg) static void mark_reg_live_nc (int regno, enum machine_mode mode) { - int last = regno + HARD_REGNO_NREGS (regno, mode); + int last = regno + hard_regno_nregs[regno][mode]; while (regno < last) { SET_HARD_REG_BIT (hard_regs_live, regno); @@ -1683,7 +1683,7 @@ set_preference (rtx dest, rtx src) SET_REGBIT (hard_reg_preferences, reg_allocno[src_regno], dest_regno); for (i = dest_regno; - i < dest_regno + HARD_REGNO_NREGS (dest_regno, GET_MODE (dest)); + i < dest_regno + hard_regno_nregs[dest_regno][GET_MODE (dest)]; i++) SET_REGBIT (hard_reg_full_preferences, reg_allocno[src_regno], i); } @@ -1702,7 +1702,7 @@ set_preference (rtx dest, rtx src) SET_REGBIT (hard_reg_preferences, reg_allocno[dest_regno], src_regno); for (i = src_regno; - i < src_regno + HARD_REGNO_NREGS (src_regno, GET_MODE (src)); + i < src_regno + hard_regno_nregs[src_regno][GET_MODE (src)]; i++) SET_REGBIT (hard_reg_full_preferences, reg_allocno[dest_regno], i); } @@ -1750,7 +1750,7 @@ reg_becomes_live (rtx reg, rtx setter ATTRIBUTE_UNUSED, void *regs_set) regno = REGNO (reg); if (regno < FIRST_PSEUDO_REGISTER) { - int nregs = HARD_REGNO_NREGS (regno, GET_MODE (reg)); + int nregs = hard_regno_nregs[regno][GET_MODE (reg)]; while (nregs-- > 0) { SET_REGNO_REG_SET (live_relevant_regs, regno); @@ -1772,7 +1772,7 @@ reg_dies (int regno, enum machine_mode mode, struct insn_chain *chain) { if (regno < FIRST_PSEUDO_REGISTER) { - int nregs = HARD_REGNO_NREGS (regno, mode); + int nregs = hard_regno_nregs[regno][mode]; while (nregs-- > 0) { CLEAR_REGNO_REG_SET (live_relevant_regs, regno); diff --git a/gcc/integrate.c b/gcc/integrate.c index 82e8114214b..3e05934fbcf 100644 --- a/gcc/integrate.c +++ b/gcc/integrate.c @@ -2830,7 +2830,7 @@ mark_stores (rtx dest, rtx x ATTRIBUTE_UNUSED, void *data ATTRIBUTE_UNUSED) { unsigned int uregno = regno; unsigned int last_reg = (uregno >= FIRST_PSEUDO_REGISTER ? uregno - : uregno + HARD_REGNO_NREGS (uregno, mode) - 1); + : uregno + hard_regno_nregs[uregno][mode] - 1); unsigned int i; /* Ignore virtual stack var or virtual arg register since those diff --git a/gcc/jump.c b/gcc/jump.c index 0783114b10e..a1d4e06edde 100644 --- a/gcc/jump.c +++ b/gcc/jump.c @@ -1551,13 +1551,13 @@ delete_prior_computation (rtx note, rtx insn) int dest_endregno = (dest_regno + (dest_regno < FIRST_PSEUDO_REGISTER - ? HARD_REGNO_NREGS (dest_regno, - GET_MODE (SET_DEST (pat))) : 1)); + ? hard_regno_nregs[dest_regno] + [GET_MODE (SET_DEST (pat))] : 1)); int regno = REGNO (reg); int endregno = (regno + (regno < FIRST_PSEUDO_REGISTER - ? HARD_REGNO_NREGS (regno, GET_MODE (reg)) : 1)); + ? hard_regno_nregs[regno][GET_MODE (reg)] : 1)); if (dest_regno >= regno && dest_endregno <= endregno) diff --git a/gcc/lcm.c b/gcc/lcm.c index c8669049a6a..c53b91151c6 100644 --- a/gcc/lcm.c +++ b/gcc/lcm.c @@ -932,7 +932,7 @@ reg_dies (rtx reg, HARD_REG_SET live) regno = REGNO (reg); if (regno < FIRST_PSEUDO_REGISTER) - for (nregs = HARD_REGNO_NREGS (regno, GET_MODE (reg)) - 1; nregs >= 0; + for (nregs = hard_regno_nregs[regno][GET_MODE (reg)] - 1; nregs >= 0; nregs--) CLEAR_HARD_REG_BIT (live, regno + nregs); } @@ -953,7 +953,7 @@ reg_becomes_live (rtx reg, rtx setter ATTRIBUTE_UNUSED, void *live) regno = REGNO (reg); if (regno < FIRST_PSEUDO_REGISTER) - for (nregs = HARD_REGNO_NREGS (regno, GET_MODE (reg)) - 1; nregs >= 0; + for (nregs = hard_regno_nregs[regno][GET_MODE (reg)] - 1; nregs >= 0; nregs--) SET_HARD_REG_BIT (* (HARD_REG_SET *) live, regno + nregs); } diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c index 61ff7fbc6b2..2d7e32a5d1f 100644 --- a/gcc/local-alloc.c +++ b/gcc/local-alloc.c @@ -1799,7 +1799,7 @@ combine_regs (rtx usedreg, rtx setreg, int may_save_copy, int insn_number, ureg = REGNO (usedreg); if (ureg < FIRST_PSEUDO_REGISTER) - usize = HARD_REGNO_NREGS (ureg, GET_MODE (usedreg)); + usize = hard_regno_nregs[ureg][GET_MODE (usedreg)]; else usize = ((GET_MODE_SIZE (GET_MODE (usedreg)) + (REGMODE_NATURAL_SIZE (GET_MODE (usedreg)) - 1)) @@ -1832,7 +1832,7 @@ combine_regs (rtx usedreg, rtx setreg, int may_save_copy, int insn_number, sreg = REGNO (setreg); if (sreg < FIRST_PSEUDO_REGISTER) - ssize = HARD_REGNO_NREGS (sreg, GET_MODE (setreg)); + ssize = hard_regno_nregs[sreg][GET_MODE (setreg)]; else ssize = ((GET_MODE_SIZE (GET_MODE (setreg)) + (REGMODE_NATURAL_SIZE (GET_MODE (setreg)) - 1)) @@ -2217,7 +2217,7 @@ find_free_reg (enum reg_class class, enum machine_mode mode, int qtyno, || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) { int j; - int size1 = HARD_REGNO_NREGS (regno, mode); + int size1 = hard_regno_nregs[regno][mode]; for (j = 1; j < size1 && ! TEST_HARD_REG_BIT (used, regno + j); j++); if (j == size1) { @@ -2275,7 +2275,7 @@ find_free_reg (enum reg_class class, enum machine_mode mode, int qtyno, static void mark_life (int regno, enum machine_mode mode, int life) { - int j = HARD_REGNO_NREGS (regno, mode); + int j = hard_regno_nregs[regno][mode]; if (life) while (--j >= 0) SET_HARD_REG_BIT (regs_live, regno + j); @@ -2292,7 +2292,7 @@ static void post_mark_life (int regno, enum machine_mode mode, int life, int birth, int death) { - int j = HARD_REGNO_NREGS (regno, mode); + int j = hard_regno_nregs[regno][mode]; HARD_REG_SET this_reg; CLEAR_HARD_REG_SET (this_reg); diff --git a/gcc/loop.c b/gcc/loop.c index 8e5cc4440d7..55c9834b288 100644 --- a/gcc/loop.c +++ b/gcc/loop.c @@ -163,7 +163,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #define LOOP_REGNO_NREGS(REGNO, SET_DEST) \ ((REGNO) < FIRST_PSEUDO_REGISTER \ - ? (int) HARD_REGNO_NREGS ((REGNO), GET_MODE (SET_DEST)) : 1) + ? (int) hard_regno_nregs[(REGNO)][GET_MODE (SET_DEST)] : 1) /* Vector mapping INSN_UIDs to luids. diff --git a/gcc/postreload.c b/gcc/postreload.c index 7b7e3d2cfdd..e0f72d99ebd 100644 --- a/gcc/postreload.c +++ b/gcc/postreload.c @@ -780,8 +780,8 @@ reload_combine (void) set = single_set (insn); if (set != NULL_RTX && GET_CODE (SET_DEST (set)) == REG - && (HARD_REGNO_NREGS (REGNO (SET_DEST (set)), - GET_MODE (SET_DEST (set))) + && (hard_regno_nregs[REGNO (SET_DEST (set))] + [GET_MODE (SET_DEST (set))] == 1) && GET_CODE (SET_SRC (set)) == PLUS && GET_CODE (XEXP (SET_SRC (set), 1)) == REG @@ -825,7 +825,7 @@ reload_combine (void) i) && reg_state[i].use_index == RELOAD_COMBINE_MAX_USES && reg_state[i].store_ruid <= reg_state[regno].use_ruid - && HARD_REGNO_NREGS (i, GET_MODE (reg)) == 1) + && hard_regno_nregs[i][GET_MODE (reg)] == 1) { rtx index_reg = gen_rtx_REG (GET_MODE (reg), i); @@ -918,7 +918,7 @@ reload_combine (void) unsigned int i; unsigned int start_reg = REGNO (usage_rtx); unsigned int num_regs = - HARD_REGNO_NREGS (start_reg, GET_MODE (usage_rtx)); + hard_regno_nregs[start_reg][GET_MODE (usage_rtx)]; unsigned int end_reg = start_reg + num_regs - 1; for (i = start_reg; i <= end_reg; i++) if (GET_CODE (XEXP (link, 0)) == CLOBBER) @@ -999,7 +999,7 @@ reload_combine_note_store (rtx dst, rtx set, void *data ATTRIBUTE_UNUSED) || GET_CODE (SET_DEST (set)) == SIGN_EXTRACT || GET_CODE (SET_DEST (set)) == STRICT_LOW_PART) { - for (i = HARD_REGNO_NREGS (regno, mode) - 1 + regno; i >= regno; i--) + for (i = hard_regno_nregs[regno][mode] - 1 + regno; i >= regno; i--) { reg_state[i].use_index = -1; reg_state[i].store_ruid = reload_combine_ruid; @@ -1007,7 +1007,7 @@ reload_combine_note_store (rtx dst, rtx set, void *data ATTRIBUTE_UNUSED) } else { - for (i = HARD_REGNO_NREGS (regno, mode) - 1 + regno; i >= regno; i--) + for (i = hard_regno_nregs[regno][mode] - 1 + regno; i >= regno; i--) { reg_state[i].store_ruid = reload_combine_ruid; reg_state[i].use_index = RELOAD_COMBINE_MAX_USES; @@ -1045,7 +1045,7 @@ reload_combine_note_use (rtx *xp, rtx insn) /* Mark the return register as used in an unknown fashion. */ rtx reg = XEXP (x, 0); int regno = REGNO (reg); - int nregs = HARD_REGNO_NREGS (regno, GET_MODE (reg)); + int nregs = hard_regno_nregs[regno][GET_MODE (reg)]; while (--nregs >= 0) reg_state[regno + nregs].use_index = -1; @@ -1081,7 +1081,7 @@ reload_combine_note_use (rtx *xp, rtx insn) if (regno >= FIRST_PSEUDO_REGISTER) abort (); - nregs = HARD_REGNO_NREGS (regno, GET_MODE (x)); + nregs = hard_regno_nregs[regno][GET_MODE (x)]; /* We can't substitute into multi-hard-reg uses. */ if (nregs > 1) @@ -1391,7 +1391,7 @@ reload_cse_move2add (rtx first) number of calls to gen_rtx_SET to avoid memory allocation if possible. */ && SCALAR_INT_MODE_P (GET_MODE (XEXP (cnd, 0))) - && HARD_REGNO_NREGS (REGNO (XEXP (cnd, 0)), GET_MODE (XEXP (cnd, 0))) == 1 + && hard_regno_nregs[REGNO (XEXP (cnd, 0))][GET_MODE (XEXP (cnd, 0))] == 1 && GET_CODE (XEXP (cnd, 1)) == CONST_INT) { rtx implicit_set = @@ -1450,7 +1450,7 @@ move2add_note_store (rtx dst, rtx set, void *data ATTRIBUTE_UNUSED) regno += REGNO (dst); if (SCALAR_INT_MODE_P (mode) - && HARD_REGNO_NREGS (regno, mode) == 1 && GET_CODE (set) == SET + && hard_regno_nregs[regno][mode] == 1 && GET_CODE (set) == SET && GET_CODE (SET_DEST (set)) != ZERO_EXTRACT && GET_CODE (SET_DEST (set)) != SIGN_EXTRACT && GET_CODE (SET_DEST (set)) != STRICT_LOW_PART) @@ -1551,7 +1551,7 @@ move2add_note_store (rtx dst, rtx set, void *data ATTRIBUTE_UNUSED) } else { - unsigned int endregno = regno + HARD_REGNO_NREGS (regno, mode); + unsigned int endregno = regno + hard_regno_nregs[regno][mode]; for (i = regno; i < endregno; i++) /* Reset the information about this register. */ diff --git a/gcc/ra-colorize.c b/gcc/ra-colorize.c index fd4660ab9e0..245292b11cc 100644 --- a/gcc/ra-colorize.c +++ b/gcc/ra-colorize.c @@ -562,7 +562,7 @@ ok (struct web *target, struct web *source) return 0; /* Sanity for funny modes. */ - size = HARD_REGNO_NREGS (color, GET_MODE (target->orig_x)); + size = hard_regno_nregs[color][GET_MODE (target->orig_x)]; if (!size) return 0; @@ -726,7 +726,7 @@ combine (struct web *u, struct web *v) struct web *web = u; int nregs = 1 + v->add_hardregs; if (u->type == PRECOLORED) - nregs = HARD_REGNO_NREGS (u->color, GET_MODE (v->orig_x)); + nregs = hard_regno_nregs[u->color][GET_MODE (v->orig_x)]; /* For precolored U's we need to make conflicts between V's neighbors and as many hardregs from U as V needed if it gets @@ -992,7 +992,7 @@ color_usable_p (int c, HARD_REG_SET dont_begin_colors, && HARD_REGNO_MODE_OK (c, mode)) { int i, size; - size = HARD_REGNO_NREGS (c, mode); + size = hard_regno_nregs[c][mode]; for (i = 1; i < size && TEST_HARD_REG_BIT (free_colors, c + i); i++); if (i == size) return 1; @@ -1029,7 +1029,7 @@ get_free_reg (HARD_REG_SET dont_begin_colors, HARD_REG_SET free_colors, && HARD_REGNO_MODE_OK (c, mode)) { int i, size; - size = HARD_REGNO_NREGS (c, mode); + size = hard_regno_nregs[c][mode]; for (i = 1; i < size && TEST_HARD_REG_BIT (free_colors, c + i); i++); if (i != size) { @@ -1172,11 +1172,11 @@ calculate_dont_begin (struct web *web, HARD_REG_SET *result) if (ptarget->type == COLORED || ptarget->type == PRECOLORED) { struct web *source = (sl) ? sl->s : web; - unsigned int tsize = HARD_REGNO_NREGS (ptarget->color, - GET_MODE (w->orig_x)); + unsigned int tsize = hard_regno_nregs[ptarget->color] + [GET_MODE (w->orig_x)]; /* ssize is only a first guess for the size. */ - unsigned int ssize = HARD_REGNO_NREGS (ptarget->color, GET_MODE - (source->orig_x)); + unsigned int ssize = hard_regno_nregs[ptarget->color][GET_MODE + (source->orig_x)]; unsigned int tofs = 0; unsigned int sofs = 0; /* C1 and C2 can become negative, so unsigned @@ -1202,11 +1202,11 @@ calculate_dont_begin (struct web *web, HARD_REG_SET *result) c1 to a place, where the last of sources hardregs does not overlap the first of targets colors. */ while (c1 + sofs - + HARD_REGNO_NREGS (c1, GET_MODE (source->orig_x)) - 1 + + hard_regno_nregs[c1][GET_MODE (source->orig_x)] - 1 < ptarget->color + tofs) c1++; while (c1 > 0 && c1 + sofs - + HARD_REGNO_NREGS (c1, GET_MODE (source->orig_x)) - 1 + + hard_regno_nregs[c1][GET_MODE (source->orig_x)] - 1 > ptarget->color + tofs) c1--; for (; c1 <= c2; c1++) @@ -1588,7 +1588,7 @@ colorize_one_web (struct web *web, int hard) web->color = c; if (flag_ra_biased) { - int nregs = HARD_REGNO_NREGS (c, GET_MODE (web->orig_x)); + int nregs = hard_regno_nregs[c][GET_MODE (web->orig_x)]; for (wl = web->conflict_list; wl; wl = wl->next) { struct web *ptarget = alias (wl->t); @@ -1669,7 +1669,7 @@ try_recolor_web (struct web *web) int i, nregs; if (!HARD_REGNO_MODE_OK (c, GET_MODE (web->orig_x))) continue; - nregs = HARD_REGNO_NREGS (c, GET_MODE (web->orig_x)); + nregs = hard_regno_nregs[c][GET_MODE (web->orig_x)]; for (i = 0; i < nregs; i++) if (!TEST_HARD_REG_BIT (web->usable_regs, c + i)) break; @@ -1719,14 +1719,14 @@ try_recolor_web (struct web *web) /* Note that min_color[] contains 1-based values (zero means undef). */ c1 = c1 == 0 ? web2->color : (c1 - 1); - c2 = web2->color + HARD_REGNO_NREGS (web2->color, GET_MODE - (web2->orig_x)) - 1; + c2 = web2->color + hard_regno_nregs[web2->color][GET_MODE + (web2->orig_x)] - 1; for (; c1 <= c2; c1++) if (TEST_HARD_REG_BIT (possible_begin, c1)) { int nregs; HARD_REG_SET colors; - nregs = HARD_REGNO_NREGS (c1, GET_MODE (web->orig_x)); + nregs = hard_regno_nregs[c1][GET_MODE (web->orig_x)]; COPY_HARD_REG_SET (colors, web2->usable_regs); for (; nregs--;) CLEAR_HARD_REG_BIT (colors, c1 + nregs); @@ -1752,7 +1752,7 @@ try_recolor_web (struct web *web) newcol = c; if (newcol >= 0 && cost_neighbors[newcol] < web->spill_cost) { - int nregs = HARD_REGNO_NREGS (newcol, GET_MODE (web->orig_x)); + int nregs = hard_regno_nregs[newcol][GET_MODE (web->orig_x)]; unsigned HOST_WIDE_INT cost = 0; int *old_colors; struct conflict_link *wl_next; @@ -1775,8 +1775,8 @@ try_recolor_web (struct web *web) wl_next = wl->next; if (web2->type == COLORED) { - int nregs2 = HARD_REGNO_NREGS (web2->color, GET_MODE - (web2->orig_x)); + int nregs2 = hard_regno_nregs[web2->color][GET_MODE + (web2->orig_x)]; if (web->color >= web2->color + nregs2 || web2->color >= web->color + nregs) continue; @@ -1866,7 +1866,7 @@ insert_coalesced_conflicts (void) int i; int nregs = 1 + web->add_hardregs; if (aweb->type == PRECOLORED) - nregs = HARD_REGNO_NREGS (aweb->color, GET_MODE (web->orig_x)); + nregs = hard_regno_nregs[aweb->color][GET_MODE (web->orig_x)]; for (i = 0; i < nregs; i++) { if (aweb->type == PRECOLORED) @@ -1971,7 +1971,7 @@ check_colors (void) if (aweb->type == SPILLED || web->regno >= max_normal_pseudo) continue; else if (aweb->type == COLORED) - nregs = HARD_REGNO_NREGS (aweb->color, GET_MODE (web->orig_x)); + nregs = hard_regno_nregs[aweb->color][GET_MODE (web->orig_x)]; else if (aweb->type == PRECOLORED) nregs = 1; else @@ -1995,7 +1995,7 @@ check_colors (void) struct web *web2 = alias (wl->t); int nregs2; if (web2->type == COLORED) - nregs2 = HARD_REGNO_NREGS (web2->color, GET_MODE (web2->orig_x)); + nregs2 = hard_regno_nregs[web2->color][GET_MODE (web2->orig_x)]; else if (web2->type == PRECOLORED) nregs2 = 1; else @@ -2014,8 +2014,8 @@ check_colors (void) continue; for (sl = wl->sub; sl; sl = sl->next) { - int ssize = HARD_REGNO_NREGS (scol, GET_MODE (sl->s->orig_x)); - int tsize = HARD_REGNO_NREGS (tcol, GET_MODE (sl->t->orig_x)); + int ssize = hard_regno_nregs[scol][GET_MODE (sl->s->orig_x)]; + int tsize = hard_regno_nregs[tcol][GET_MODE (sl->t->orig_x)]; int sofs = 0, tofs = 0; if (SUBWEB_P (sl->t) && GET_MODE_SIZE (GET_MODE (sl->t->orig_x)) >= UNITS_PER_WORD) @@ -2112,7 +2112,7 @@ break_precolored_alias (struct web *web) struct web *pre = web->alias; struct conflict_link *wl; unsigned int c = pre->color; - unsigned int nregs = HARD_REGNO_NREGS (c, GET_MODE (web->orig_x)); + unsigned int nregs = hard_regno_nregs[c][GET_MODE (web->orig_x)]; if (pre->type != PRECOLORED) abort (); unalias_web (web); diff --git a/gcc/ra-debug.c b/gcc/ra-debug.c index 26aac12df0e..780c765d4d1 100644 --- a/gcc/ra-debug.c +++ b/gcc/ra-debug.c @@ -32,6 +32,7 @@ #include "output.h" #include "ra.h" #include "tm_p.h" +#include "regs.h" /* This file contains various dumping and debug functions for the graph coloring register allocator. */ @@ -245,7 +246,7 @@ ra_print_rtx_object (FILE *file, rtx x) int regno = REGNO (x); if (regno < FIRST_PSEUDO_REGISTER) { - int i, nregs = HARD_REGNO_NREGS (regno, mode); + int i, nregs = hard_regno_nregs[regno][mode]; if (nregs > 1) fputs ("[", file); for (i = 0; i < nregs; i++) @@ -272,7 +273,7 @@ ra_print_rtx_object (FILE *file, rtx x) && REGNO (sub) < FIRST_PSEUDO_REGISTER) { int regno = REGNO (sub); - int i, nregs = HARD_REGNO_NREGS (regno, mode); + int i, nregs = hard_regno_nregs[regno][mode]; regno += subreg_regno_offset (regno, GET_MODE (sub), ofs, mode); if (nregs > 1) diff --git a/gcc/ra-rewrite.c b/gcc/ra-rewrite.c index 44fde7ddd2f..98c87719187 100644 --- a/gcc/ra-rewrite.c +++ b/gcc/ra-rewrite.c @@ -352,7 +352,7 @@ choose_spill_colors (void) && HARD_REGNO_MODE_OK (c, PSEUDO_REGNO_MODE (web->regno))) { int i, size; - size = HARD_REGNO_NREGS (c, PSEUDO_REGNO_MODE (web->regno)); + size = hard_regno_nregs[c][PSEUDO_REGNO_MODE (web->regno)]; for (i = 1; i < size && TEST_HARD_REG_BIT (avail, c + i); i++); if (i == size) @@ -742,9 +742,9 @@ spill_same_color_p (struct web *web1, struct web *web2) return 0; size1 = web1->type == PRECOLORED - ? 1 : HARD_REGNO_NREGS (c1, PSEUDO_REGNO_MODE (web1->regno)); + ? 1 : hard_regno_nregs[c1][PSEUDO_REGNO_MODE (web1->regno)]; size2 = web2->type == PRECOLORED - ? 1 : HARD_REGNO_NREGS (c2, PSEUDO_REGNO_MODE (web2->regno)); + ? 1 : hard_regno_nregs[c2][PSEUDO_REGNO_MODE (web2->regno)]; if (c1 >= c2 + size2 || c2 >= c1 + size1) return 0; return 1; @@ -779,7 +779,7 @@ update_spill_colors (HARD_REG_SET *in_use, struct web *web, int add) if ((c = alias (find_web_for_subweb (web))->color) < 0 || c == an_unusable_color) return; - size = HARD_REGNO_NREGS (c, GET_MODE (web->orig_x)); + size = hard_regno_nregs[c][GET_MODE (web->orig_x)]; if (SUBWEB_P (web)) { c += subreg_regno_offset (c, GET_MODE (SUBREG_REG (web->orig_x)), @@ -810,7 +810,7 @@ spill_is_free (HARD_REG_SET *in_use, struct web *web) if (c == an_unusable_color) return 1; size = web->type == PRECOLORED - ? 1 : HARD_REGNO_NREGS (c, PSEUDO_REGNO_MODE (web->regno)); + ? 1 : hard_regno_nregs[c][PSEUDO_REGNO_MODE (web->regno)]; for (; size--;) if (TEST_HARD_REG_BIT (*in_use, c + size)) return 0; @@ -472,26 +472,26 @@ init_ra (void) { if (! CAN_ELIMINATE (eliminables[j].from, eliminables[j].to) || (eliminables[j].to == STACK_POINTER_REGNUM && need_fp)) - for (i = HARD_REGNO_NREGS (eliminables[j].from, Pmode); i--;) + for (i = hard_regno_nregs[eliminables[j].from][Pmode]; i--;) SET_HARD_REG_BIT (never_use_colors, eliminables[j].from + i); } #if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM if (need_fp) - for (i = HARD_REGNO_NREGS (HARD_FRAME_POINTER_REGNUM, Pmode); i--;) + for (i = hard_regno_nregs[HARD_FRAME_POINTER_REGNUM][Pmode]; i--;) SET_HARD_REG_BIT (never_use_colors, HARD_FRAME_POINTER_REGNUM + i); #endif #else if (need_fp) - for (i = HARD_REGNO_NREGS (FRAME_POINTER_REGNUM, Pmode); i--;) + for (i = hard_regno_nregs[FRAME_POINTER_REGNUM][Pmode]; i--;) SET_HARD_REG_BIT (never_use_colors, FRAME_POINTER_REGNUM + i); #endif /* Stack and argument pointer are also rather useless to us. */ - for (i = HARD_REGNO_NREGS (STACK_POINTER_REGNUM, Pmode); i--;) + for (i = hard_regno_nregs[STACK_POINTER_REGNUM][Pmode]; i--;) SET_HARD_REG_BIT (never_use_colors, STACK_POINTER_REGNUM + i); - for (i = HARD_REGNO_NREGS (ARG_POINTER_REGNUM, Pmode); i--;) + for (i = hard_regno_nregs[ARG_POINTER_REGNUM][Pmode]; i--;) SET_HARD_REG_BIT (never_use_colors, ARG_POINTER_REGNUM + i); for (i = 0; i < 256; i++) @@ -528,7 +528,7 @@ init_ra (void) for (reg = 0; reg < FIRST_PSEUDO_REGISTER; reg++) if (HARD_REGNO_MODE_OK (reg, i) /* Ignore VOIDmode and similar things. */ - && (size = HARD_REGNO_NREGS (reg, i)) != 0 + && (size = hard_regno_nregs[reg][i]) != 0 && (reg + size) <= FIRST_PSEUDO_REGISTER) { while (size--) diff --git a/gcc/recog.c b/gcc/recog.c index 2224c5ac8f4..470e93b06a3 100644 --- a/gcc/recog.c +++ b/gcc/recog.c @@ -2666,7 +2666,7 @@ reg_fits_class_p (rtx operand, enum reg_class class, int offset, { int sr; regno += offset; - for (sr = HARD_REGNO_NREGS (regno, mode) - 1; + for (sr = hard_regno_nregs[regno][mode] - 1; sr > 0; sr--) if (! TEST_HARD_REG_BIT (reg_class_contents[(int) class], regno + sr)) @@ -2910,7 +2910,7 @@ peep2_reg_dead_p (int ofs, rtx reg) abort (); regno = REGNO (reg); - n = HARD_REGNO_NREGS (regno, GET_MODE (reg)); + n = hard_regno_nregs[regno][GET_MODE (reg)]; while (--n >= 0) if (REGNO_REG_SET_P (peep2_insn_data[ofs].live_before, regno + n)) return 0; @@ -2998,7 +2998,7 @@ peep2_find_free_register (int from, int to, const char *class_str, continue; success = 1; - for (j = HARD_REGNO_NREGS (regno, mode) - 1; j >= 0; j--) + for (j = hard_regno_nregs[regno][mode] - 1; j >= 0; j--) { if (TEST_HARD_REG_BIT (*reg_set, regno + j) || TEST_HARD_REG_BIT (live, regno + j)) @@ -3009,7 +3009,7 @@ peep2_find_free_register (int from, int to, const char *class_str, } if (success) { - for (j = HARD_REGNO_NREGS (regno, mode) - 1; j >= 0; j--) + for (j = hard_regno_nregs[regno][mode] - 1; j >= 0; j--) SET_HARD_REG_BIT (*reg_set, regno + j); /* Start the next search with the next register. */ diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c index 9a6c89bf310..433b7393ab6 100644 --- a/gcc/reg-stack.c +++ b/gcc/reg-stack.c @@ -1491,7 +1491,7 @@ subst_stack_regs_pat (rtx insn, stack regstack, rtx pat) case CALL: { int count; - for (count = HARD_REGNO_NREGS (REGNO (*dest), GET_MODE (*dest)); + for (count = hard_regno_nregs[REGNO (*dest)][GET_MODE (*dest)]; --count >= 0;) { regstack->reg[++regstack->top] = REGNO (*dest) + count; @@ -2484,7 +2484,7 @@ convert_regs_exit (void) { value_reg_low = REGNO (retvalue); value_reg_high = value_reg_low - + HARD_REGNO_NREGS (value_reg_low, GET_MODE (retvalue)) - 1; + + hard_regno_nregs[value_reg_low][GET_MODE (retvalue)] - 1; } output_stack = &BLOCK_INFO (EXIT_BLOCK_PTR)->stack_in; diff --git a/gcc/regclass.c b/gcc/regclass.c index 2e4dc61be32..2ca4cfd2bab 100644 --- a/gcc/regclass.c +++ b/gcc/regclass.c @@ -252,6 +252,8 @@ static struct reg_info_data *reg_info_head; 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]; /* Function called only once to initialize the above data on reg usage. Once this is done, various switches may override. */ @@ -539,7 +541,11 @@ init_reg_sets_1 (void) void init_reg_modes_once (void) { - int i; + int i, j; + + for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) + for (j = 0; j < MAX_MACHINE_MODE; j++) + hard_regno_nregs[i][j] = HARD_REGNO_NREGS(i, (enum machine_mode)j); for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) { @@ -658,7 +664,7 @@ choose_hard_reg_mode (unsigned int regno ATTRIBUTE_UNUSED, for (mode = GET_CLASS_NARROWEST_MODE (MODE_INT); mode != VOIDmode; mode = GET_MODE_WIDER_MODE (mode)) - if ((unsigned) HARD_REGNO_NREGS (regno, mode) == nregs + if ((unsigned) hard_regno_nregs[regno][mode] == nregs && HARD_REGNO_MODE_OK (regno, mode) && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) found_mode = mode; @@ -669,7 +675,7 @@ choose_hard_reg_mode (unsigned int regno ATTRIBUTE_UNUSED, for (mode = GET_CLASS_NARROWEST_MODE (MODE_FLOAT); mode != VOIDmode; mode = GET_MODE_WIDER_MODE (mode)) - if ((unsigned) HARD_REGNO_NREGS (regno, mode) == nregs + if ((unsigned) hard_regno_nregs[regno][mode] == nregs && HARD_REGNO_MODE_OK (regno, mode) && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) found_mode = mode; @@ -680,7 +686,7 @@ choose_hard_reg_mode (unsigned int regno ATTRIBUTE_UNUSED, for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_FLOAT); mode != VOIDmode; mode = GET_MODE_WIDER_MODE (mode)) - if ((unsigned) HARD_REGNO_NREGS (regno, mode) == nregs + if ((unsigned) hard_regno_nregs[regno][mode] == nregs && HARD_REGNO_MODE_OK (regno, mode) && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) found_mode = mode; @@ -691,7 +697,7 @@ choose_hard_reg_mode (unsigned int regno ATTRIBUTE_UNUSED, for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_INT); mode != VOIDmode; mode = GET_MODE_WIDER_MODE (mode)) - if ((unsigned) HARD_REGNO_NREGS (regno, mode) == nregs + if ((unsigned) hard_regno_nregs[regno][mode] == nregs && HARD_REGNO_MODE_OK (regno, mode) && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) found_mode = mode; @@ -703,7 +709,7 @@ choose_hard_reg_mode (unsigned int regno ATTRIBUTE_UNUSED, for (m = (unsigned int) CCmode; m < (unsigned int) NUM_MACHINE_MODES; ++m) { mode = (enum machine_mode) m; - if ((unsigned) HARD_REGNO_NREGS (regno, mode) == nregs + if ((unsigned) hard_regno_nregs[regno][mode] == nregs && HARD_REGNO_MODE_OK (regno, mode) && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) return mode; @@ -1836,14 +1842,14 @@ record_reg_classes (int n_alts, int n_ops, rtx *ops, op_costs[i].cost[class] = -1; else { - for (nr = 0; nr < (unsigned) HARD_REGNO_NREGS (regno, mode); nr++) + for (nr = 0; nr < (unsigned) hard_regno_nregs[regno][mode]; nr++) { if (! TEST_HARD_REG_BIT (reg_class_contents[class], regno + nr)) break; } - if (nr == (unsigned) HARD_REGNO_NREGS (regno,mode)) + if (nr == (unsigned) hard_regno_nregs[regno][mode]) op_costs[i].cost[class] = -1; } } diff --git a/gcc/regmove.c b/gcc/regmove.c index 8dcd05486f2..196b86d1e8b 100644 --- a/gcc/regmove.c +++ b/gcc/regmove.c @@ -246,7 +246,7 @@ mark_flags_life_zones (rtx flags) flags_nregs = 1; #else flags_regno = REGNO (flags); - flags_nregs = HARD_REGNO_NREGS (flags_regno, GET_MODE (flags)); + flags_nregs = hard_regno_nregs[flags_regno][GET_MODE (flags)]; #endif flags_set_1_rtx = flags; diff --git a/gcc/regrename.c b/gcc/regrename.c index e725ee932da..914bfbc9cb6 100644 --- a/gcc/regrename.c +++ b/gcc/regrename.c @@ -104,7 +104,7 @@ note_sets (rtx x, rtx set ATTRIBUTE_UNUSED, void *data) if (GET_CODE (x) != REG) return; regno = REGNO (x); - nregs = HARD_REGNO_NREGS (regno, GET_MODE (x)); + nregs = hard_regno_nregs[regno][GET_MODE (x)]; /* There must not be pseudos at this point. */ if (regno + nregs > FIRST_PSEUDO_REGISTER) @@ -126,7 +126,7 @@ clear_dead_regs (HARD_REG_SET *pset, enum machine_mode kind, rtx notes) { rtx reg = XEXP (note, 0); unsigned int regno = REGNO (reg); - int nregs = HARD_REGNO_NREGS (regno, GET_MODE (reg)); + int nregs = hard_regno_nregs[regno][GET_MODE (reg)]; /* There must not be pseudos at this point. */ if (regno + nregs > FIRST_PSEUDO_REGISTER) @@ -218,11 +218,11 @@ regrename_optimize (void) { int i; - for (i = HARD_REGNO_NREGS (FRAME_POINTER_REGNUM, Pmode); i--;) + for (i = hard_regno_nregs[FRAME_POINTER_REGNUM][Pmode]; i--;) SET_HARD_REG_BIT (unavailable, FRAME_POINTER_REGNUM + i); #if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM - for (i = HARD_REGNO_NREGS (HARD_FRAME_POINTER_REGNUM, Pmode); i--;) + for (i = hard_regno_nregs[HARD_FRAME_POINTER_REGNUM][Pmode]; i--;) SET_HARD_REG_BIT (unavailable, HARD_FRAME_POINTER_REGNUM + i); #endif } @@ -287,7 +287,7 @@ regrename_optimize (void) have a closer look at each register still in there. */ for (new_reg = 0; new_reg < FIRST_PSEUDO_REGISTER; new_reg++) { - int nregs = HARD_REGNO_NREGS (new_reg, GET_MODE (*this->loc)); + int nregs = hard_regno_nregs[new_reg][GET_MODE (*this->loc)]; for (i = nregs - 1; i >= 0; --i) if (TEST_HARD_REG_BIT (this_unavailable, new_reg + i) @@ -391,7 +391,7 @@ scan_rtx_reg (rtx insn, rtx *loc, enum reg_class class, rtx x = *loc; enum machine_mode mode = GET_MODE (x); int this_regno = REGNO (x); - int this_nregs = HARD_REGNO_NREGS (this_regno, mode); + int this_nregs = hard_regno_nregs[this_regno][mode]; if (action == mark_write) { @@ -431,7 +431,7 @@ scan_rtx_reg (rtx insn, rtx *loc, enum reg_class class, else { int regno = REGNO (*this->loc); - int nregs = HARD_REGNO_NREGS (regno, GET_MODE (*this->loc)); + int nregs = hard_regno_nregs[regno][GET_MODE (*this->loc)]; int exact_match = (regno == this_regno && nregs == this_nregs); if (regno + nregs <= this_regno @@ -973,7 +973,7 @@ dump_def_use_chain (struct du_chain *chains) { struct du_chain *this = chains; int r = REGNO (*this->loc); - int nregs = HARD_REGNO_NREGS (r, GET_MODE (*this->loc)); + int nregs = hard_regno_nregs[r][GET_MODE (*this->loc)]; fprintf (rtl_dump_file, "Register %s (%d):", reg_names[r], nregs); while (this) { @@ -1084,7 +1084,7 @@ kill_value (rtx x, struct value_data *vd) if (REG_P (x)) { unsigned int regno = REGNO (x); - unsigned int n = HARD_REGNO_NREGS (regno, GET_MODE (x)); + unsigned int n = hard_regno_nregs[regno][GET_MODE (x)]; unsigned int i, j; /* Kill the value we're told to kill. */ @@ -1100,7 +1100,7 @@ kill_value (rtx x, struct value_data *vd) { if (vd->e[j].mode == VOIDmode) continue; - n = HARD_REGNO_NREGS (j, vd->e[j].mode); + n = hard_regno_nregs[j][vd->e[j].mode]; if (j + n > regno) for (i = 0; i < n; ++i) kill_value_regno (j + i, vd); @@ -1118,7 +1118,7 @@ set_value_regno (unsigned int regno, enum machine_mode mode, vd->e[regno].mode = mode; - nregs = HARD_REGNO_NREGS (regno, mode); + nregs = hard_regno_nregs[regno][mode]; if (nregs > vd->max_value_regs) vd->max_value_regs = nregs; } @@ -1210,8 +1210,8 @@ copy_value (rtx dest, rtx src, struct value_data *vd) return; /* If SRC and DEST overlap, don't record anything. */ - dn = HARD_REGNO_NREGS (dr, GET_MODE (dest)); - sn = HARD_REGNO_NREGS (sr, GET_MODE (dest)); + dn = hard_regno_nregs[dr][GET_MODE (dest)]; + sn = hard_regno_nregs[sr][GET_MODE (dest)]; if ((dr > sr && dr < sr + sn) || (sr > dr && sr < dr + dn)) return; @@ -1237,7 +1237,7 @@ copy_value (rtx dest, rtx src, struct value_data *vd) We can't properly represent the latter case in our tables, so don't record anything then. */ - else if (sn < (unsigned int) HARD_REGNO_NREGS (sr, vd->e[sr].mode) + else if (sn < (unsigned int) hard_regno_nregs[sr][vd->e[sr].mode] && (GET_MODE_SIZE (vd->e[sr].mode) > UNITS_PER_WORD ? WORDS_BIG_ENDIAN : BYTES_BIG_ENDIAN)) return; @@ -1245,7 +1245,7 @@ copy_value (rtx dest, rtx src, struct value_data *vd) /* If SRC had been assigned a mode narrower than the copy, we can't link DEST into the chain, because not all of the pieces of the copy came from oldest_regno. */ - else if (sn > (unsigned int) HARD_REGNO_NREGS (sr, vd->e[sr].mode)) + else if (sn > (unsigned int) hard_regno_nregs[sr][vd->e[sr].mode]) return; /* Link DR at the end of the value chain used by SR. */ @@ -1291,8 +1291,8 @@ maybe_mode_change (enum machine_mode orig_mode, enum machine_mode copy_mode, return gen_rtx_raw_REG (new_mode, regno); else if (mode_change_ok (orig_mode, new_mode, regno)) { - int copy_nregs = HARD_REGNO_NREGS (copy_regno, copy_mode); - int use_nregs = HARD_REGNO_NREGS (copy_regno, new_mode); + int copy_nregs = hard_regno_nregs[copy_regno][copy_mode]; + int use_nregs = hard_regno_nregs[copy_regno][new_mode]; int copy_offset = GET_MODE_SIZE (copy_mode) / copy_nregs * (copy_nregs - use_nregs); int offset @@ -1330,8 +1330,8 @@ find_oldest_value_reg (enum reg_class class, rtx reg, struct value_data *vd) Replacing r9 with r11 is invalid. */ if (mode != vd->e[regno].mode) { - if (HARD_REGNO_NREGS (regno, mode) - > HARD_REGNO_NREGS (regno, vd->e[regno].mode)) + if (hard_regno_nregs[regno][mode] + > hard_regno_nregs[regno][vd->e[regno].mode]) return NULL_RTX; } @@ -1341,7 +1341,7 @@ find_oldest_value_reg (enum reg_class class, rtx reg, struct value_data *vd) rtx new; unsigned int last; - for (last = i; last < i + HARD_REGNO_NREGS (i, mode); last++) + for (last = i; last < i + hard_regno_nregs[i][mode]; last++) if (!TEST_HARD_REG_BIT (reg_class_contents[class], last)) return NULL_RTX; @@ -1600,8 +1600,8 @@ copyprop_hardreg_forward_1 (basic_block bb, struct value_data *vd) set it in, make sure that the replacement is valid. */ if (mode != vd->e[regno].mode) { - if (HARD_REGNO_NREGS (regno, mode) - > HARD_REGNO_NREGS (regno, vd->e[regno].mode)) + if (hard_regno_nregs[regno][mode] + > hard_regno_nregs[regno][vd->e[regno].mode]) goto no_move_special_case; } diff --git a/gcc/regs.h b/gcc/regs.h index 9c9edccb26b..27592be0c47 100644 --- a/gcc/regs.h +++ b/gcc/regs.h @@ -224,3 +224,6 @@ extern int caller_save_needed; /* Allocate reg_n_info tables */ extern void allocate_reg_info (size_t, int, int); + +/* Specify number of hard registers given machine mode occupy. */ +extern unsigned char hard_regno_nregs[FIRST_PSEUDO_REGISTER][MAX_MACHINE_MODE]; diff --git a/gcc/reload.c b/gcc/reload.c index e105ac9a715..92c3c47a2b8 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -818,7 +818,7 @@ reload_inner_reg_of_subreg (rtx x, enum machine_mode mode, int output) && output && GET_MODE_SIZE (GET_MODE (inner)) > UNITS_PER_WORD && ((GET_MODE_SIZE (GET_MODE (inner)) / UNITS_PER_WORD) - != (int) HARD_REGNO_NREGS (REGNO (inner), GET_MODE (inner)))); + != (int) hard_regno_nregs[REGNO (inner)][GET_MODE (inner)])); } /* Return nonzero if IN can be reloaded into REGNO with mode MODE without @@ -1038,8 +1038,8 @@ push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc, > UNITS_PER_WORD) && ((GET_MODE_SIZE (GET_MODE (SUBREG_REG (in))) / UNITS_PER_WORD) - != (int) HARD_REGNO_NREGS (REGNO (SUBREG_REG (in)), - GET_MODE (SUBREG_REG (in))))) + != (int) hard_regno_nregs[REGNO (SUBREG_REG (in))] + [GET_MODE (SUBREG_REG (in))])) || ! HARD_REGNO_MODE_OK (subreg_regno (in), inmode))) #ifdef SECONDARY_INPUT_RELOAD_CLASS || (SECONDARY_INPUT_RELOAD_CLASS (class, inmode, in) != NO_REGS @@ -1135,8 +1135,8 @@ push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc, > UNITS_PER_WORD) && ((GET_MODE_SIZE (GET_MODE (SUBREG_REG (out))) / UNITS_PER_WORD) - != (int) HARD_REGNO_NREGS (REGNO (SUBREG_REG (out)), - GET_MODE (SUBREG_REG (out))))) + != (int) hard_regno_nregs[REGNO (SUBREG_REG (out))] + [GET_MODE (SUBREG_REG (out))])) || ! HARD_REGNO_MODE_OK (subreg_regno (out), outmode))) #ifdef SECONDARY_OUTPUT_RELOAD_CLASS || (SECONDARY_OUTPUT_RELOAD_CLASS (class, outmode, out) != NO_REGS @@ -1262,7 +1262,7 @@ push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc, if (HARD_REGNO_MODE_OK (i, mode) && TEST_HARD_REG_BIT (reg_class_contents[(int) class], i)) { - int nregs = HARD_REGNO_NREGS (i, mode); + int nregs = hard_regno_nregs[i][mode]; int j; for (j = 1; j < nregs; j++) @@ -1520,8 +1520,8 @@ push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc, && reg_mentioned_p (XEXP (note, 0), in) && ! refers_to_regno_for_reload_p (regno, (regno - + HARD_REGNO_NREGS (regno, - rel_mode)), + + hard_regno_nregs[regno] + [rel_mode]), PATTERN (this_insn), inloc) /* If this is also an output reload, IN cannot be used as the reload register if it is set in this insn unless IN @@ -1529,8 +1529,8 @@ push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc, && (out == 0 || in == out || ! hard_reg_set_here_p (regno, (regno - + HARD_REGNO_NREGS (regno, - rel_mode)), + + hard_regno_nregs[regno] + [rel_mode]), PATTERN (this_insn))) /* ??? Why is this code so different from the previous? Is there any simple coherent way to describe the two together? @@ -1548,8 +1548,8 @@ push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc, && HARD_REGNO_MODE_OK (regno, outmode)) { unsigned int offs; - unsigned int nregs = MAX (HARD_REGNO_NREGS (regno, inmode), - HARD_REGNO_NREGS (regno, outmode)); + unsigned int nregs = MAX (hard_regno_nregs[regno][inmode], + hard_regno_nregs[regno][outmode]); for (offs = 0; offs < nregs; offs++) if (fixed_regs[regno + offs] @@ -1559,7 +1559,7 @@ push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc, if (offs == nregs && (! (refers_to_regno_for_reload_p - (regno, (regno + HARD_REGNO_NREGS (regno, inmode)), + (regno, (regno + hard_regno_nregs[regno][inmode]), in, (rtx *)0)) || can_reload_into (in, regno, inmode))) { @@ -1830,8 +1830,8 @@ combine_reloads (void) && HARD_REGNO_MODE_OK (REGNO (XEXP (note, 0)), rld[output_reload].outmode) && TEST_HARD_REG_BIT (reg_class_contents[(int) rld[output_reload].class], REGNO (XEXP (note, 0))) - && (HARD_REGNO_NREGS (REGNO (XEXP (note, 0)), rld[output_reload].outmode) - <= HARD_REGNO_NREGS (REGNO (XEXP (note, 0)), GET_MODE (XEXP (note, 0)))) + && (hard_regno_nregs[REGNO (XEXP (note, 0))][rld[output_reload].outmode] + <= hard_regno_nregs[REGNO (XEXP (note, 0))][GET_MODE (XEXP (note, 0))]) /* Ensure that a secondary or tertiary reload for this output won't want this register. */ && ((secondary_out = rld[output_reload].secondary_out_reload) == -1 @@ -1923,7 +1923,7 @@ find_dummy_reload (rtx real_in, rtx real_out, rtx *inloc, rtx *outloc, && REGNO (out) < FIRST_PSEUDO_REGISTER) { unsigned int regno = REGNO (out) + out_offset; - unsigned int nwords = HARD_REGNO_NREGS (regno, outmode); + unsigned int nwords = hard_regno_nregs[regno][outmode]; rtx saved_rtx; /* When we consider whether the insn uses OUT, @@ -1984,7 +1984,7 @@ find_dummy_reload (rtx real_in, rtx real_out, rtx *inloc, rtx *outloc, ? GET_MODE (out) : outmode))) { unsigned int regno = REGNO (in) + in_offset; - unsigned int nwords = HARD_REGNO_NREGS (regno, inmode); + unsigned int nwords = hard_regno_nregs[regno][inmode]; if (! refers_to_regno_for_reload_p (regno, regno + nwords, out, (rtx*) 0) && ! hard_reg_set_here_p (regno, regno + nwords, @@ -2056,7 +2056,7 @@ hard_reg_set_here_p (unsigned int beg_regno, unsigned int end_regno, rtx x) /* See if this reg overlaps range under consideration. */ if (r < end_regno - && r + HARD_REGNO_NREGS (r, GET_MODE (op0)) > beg_regno) + && r + hard_regno_nregs[r][GET_MODE (op0)] > beg_regno) return 1; } } @@ -2148,10 +2148,10 @@ operands_match_p (rtx x, rtx y) (reg:SI 1) will be considered the same register. */ if (WORDS_BIG_ENDIAN && GET_MODE_SIZE (GET_MODE (x)) > UNITS_PER_WORD && i < FIRST_PSEUDO_REGISTER) - i += HARD_REGNO_NREGS (i, GET_MODE (x)) - 1; + i += hard_regno_nregs[i][GET_MODE (x)] - 1; if (WORDS_BIG_ENDIAN && GET_MODE_SIZE (GET_MODE (y)) > UNITS_PER_WORD && j < FIRST_PSEUDO_REGISTER) - j += HARD_REGNO_NREGS (j, GET_MODE (y)) - 1; + j += hard_regno_nregs[j][GET_MODE (y)] - 1; return i == j; } @@ -2363,7 +2363,7 @@ decompose (rtx x) } else /* A hard reg. */ - val.end = val.start + HARD_REGNO_NREGS (val.start, GET_MODE (x)); + val.end = val.start + hard_regno_nregs[val.start][GET_MODE (x)]; } else if (GET_CODE (x) == SUBREG) { @@ -2376,7 +2376,7 @@ decompose (rtx x) return decompose (SUBREG_REG (x)); else /* A hard reg. */ - val.end = val.start + HARD_REGNO_NREGS (val.start, GET_MODE (x)); + val.end = val.start + hard_regno_nregs[val.start][GET_MODE (x)]; } else if (CONSTANT_P (x) /* This hasn't been assigned yet, so it can't conflict yet. */ @@ -4366,7 +4366,7 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known, && TEST_HARD_REG_BIT (reg_class_contents[rld[i].class], regno) && HARD_REGNO_MODE_OK (regno, rld[i].mode)) { - int nr = HARD_REGNO_NREGS (regno, rld[i].mode); + int nr = hard_regno_nregs[regno][rld[i].mode]; int ok = 1, nri; for (nri = 1; nri < nr; nri ++) @@ -6177,7 +6177,7 @@ refers_to_regno_for_reload_p (unsigned int regno, unsigned int endregno, return (endregno > r && regno < r + (r < FIRST_PSEUDO_REGISTER - ? HARD_REGNO_NREGS (r, GET_MODE (x)) + ? hard_regno_nregs[r][GET_MODE (x)] : 1)); case SUBREG: @@ -6189,7 +6189,7 @@ refers_to_regno_for_reload_p (unsigned int regno, unsigned int endregno, unsigned int inner_regno = subreg_regno (x); unsigned int inner_endregno = inner_regno + (inner_regno < FIRST_PSEUDO_REGISTER - ? HARD_REGNO_NREGS (regno, GET_MODE (x)) : 1); + ? hard_regno_nregs[regno][GET_MODE (x)] : 1); return endregno > inner_regno && regno < inner_endregno; } @@ -6328,7 +6328,7 @@ reg_overlap_mentioned_for_reload_p (rtx x, rtx in) abort (); endregno = regno + (regno < FIRST_PSEUDO_REGISTER - ? HARD_REGNO_NREGS (regno, GET_MODE (x)) : 1); + ? hard_regno_nregs[regno][GET_MODE (x)] : 1); return refers_to_regno_for_reload_p (regno, endregno, in, (rtx*) 0); } @@ -6539,7 +6539,7 @@ find_equiv_reg (rtx goal, rtx insn, enum reg_class class, int other, { int i; - for (i = HARD_REGNO_NREGS (valueno, mode) - 1; i >= 0; i--) + for (i = hard_regno_nregs[valueno][mode] - 1; i >= 0; i--) if (! TEST_HARD_REG_BIT (reg_class_contents[(int) class], valueno + i)) break; @@ -6581,19 +6581,22 @@ find_equiv_reg (rtx goal, rtx insn, enum reg_class class, int other, if (goal_mem && value == SET_DEST (single_set (where)) && refers_to_regno_for_reload_p (valueno, (valueno - + HARD_REGNO_NREGS (valueno, mode)), + + hard_regno_nregs[valueno][mode]), goal, (rtx*) 0)) return 0; /* Reject registers that overlap GOAL. */ if (!goal_mem && !goal_const - && regno + (int) HARD_REGNO_NREGS (regno, mode) > valueno - && regno < valueno + (int) HARD_REGNO_NREGS (valueno, mode)) + && regno + (int) hard_regno_nregs[regno][mode] > valueno + && regno < valueno + (int) hard_regno_nregs[valueno][mode]) return 0; - nregs = HARD_REGNO_NREGS (regno, mode); - valuenregs = HARD_REGNO_NREGS (valueno, mode); + if (regno >= 0 && regno < FIRST_PSEUDO_REGISTER) + nregs = hard_regno_nregs[regno][mode]; + else + nregs = 1; + valuenregs = hard_regno_nregs[valueno][mode]; /* Reject VALUE if it is one of the regs reserved for reloads. Reload1 knows how to reuse them anyway, and it would get @@ -6619,8 +6622,8 @@ find_equiv_reg (rtx goal, rtx insn, enum reg_class class, int other, if (rld[i].reg_rtx != 0 && rld[i].in) { int regno1 = REGNO (rld[i].reg_rtx); - int nregs1 = HARD_REGNO_NREGS (regno1, - GET_MODE (rld[i].reg_rtx)); + int nregs1 = hard_regno_nregs[regno1] + [GET_MODE (rld[i].reg_rtx)]; if (regno1 < valueno + valuenregs && regno1 + nregs1 > valueno) return 0; @@ -6694,7 +6697,7 @@ find_equiv_reg (rtx goal, rtx insn, enum reg_class class, int other, int xregno = REGNO (dest); int xnregs; if (REGNO (dest) < FIRST_PSEUDO_REGISTER) - xnregs = HARD_REGNO_NREGS (xregno, GET_MODE (dest)); + xnregs = hard_regno_nregs[xregno][GET_MODE (dest)]; else xnregs = 1; if (xregno < regno + nregs && xregno + xnregs > regno) @@ -6738,7 +6741,7 @@ find_equiv_reg (rtx goal, rtx insn, enum reg_class class, int other, int xregno = REGNO (dest); int xnregs; if (REGNO (dest) < FIRST_PSEUDO_REGISTER) - xnregs = HARD_REGNO_NREGS (xregno, GET_MODE (dest)); + xnregs = hard_regno_nregs[xregno][GET_MODE (dest)]; else xnregs = 1; if (xregno < regno + nregs @@ -6783,7 +6786,7 @@ find_equiv_reg (rtx goal, rtx insn, enum reg_class class, int other, { int xregno = REGNO (dest); int xnregs - = HARD_REGNO_NREGS (xregno, GET_MODE (dest)); + = hard_regno_nregs[xregno][GET_MODE (dest)]; if (xregno < regno + nregs && xregno + xnregs > regno) @@ -6898,7 +6901,7 @@ int regno_clobbered_p (unsigned int regno, rtx insn, enum machine_mode mode, int sets) { - unsigned int nregs = HARD_REGNO_NREGS (regno, mode); + unsigned int nregs = hard_regno_nregs[regno][mode]; unsigned int endregno = regno + nregs; if ((GET_CODE (PATTERN (insn)) == CLOBBER @@ -6944,8 +6947,8 @@ reload_adjust_reg_for_mode (rtx reloadreg, enum machine_mode mode) regno = REGNO (reloadreg); if (WORDS_BIG_ENDIAN) - regno += HARD_REGNO_NREGS (regno, GET_MODE (reloadreg)) - - HARD_REGNO_NREGS (regno, mode); + regno += (int) hard_regno_nregs[regno][GET_MODE (reloadreg)] + - (int) hard_regno_nregs[regno][mode]; return gen_rtx_REG (mode, regno); } diff --git a/gcc/reload1.c b/gcc/reload1.c index 1ea21ee3890..5cce770ca12 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -534,7 +534,7 @@ compute_use_by_pseudos (HARD_REG_SET *to, regset from) } else { - nregs = HARD_REGNO_NREGS (r, PSEUDO_REGNO_MODE (regno)); + nregs = hard_regno_nregs[r][PSEUDO_REGNO_MODE (regno)]; while (nregs-- > 0) SET_HARD_REG_BIT (*to, r + nregs); } @@ -1572,7 +1572,7 @@ count_pseudo (int reg) spill_add_cost[r] += freq; - nregs = HARD_REGNO_NREGS (r, PSEUDO_REGNO_MODE (reg)); + nregs = hard_regno_nregs[r][PSEUDO_REGNO_MODE (reg)]; while (nregs-- > 0) spill_cost[r + nregs] += freq; } @@ -1634,7 +1634,7 @@ static void count_spilled_pseudo (int spilled, int spilled_nregs, int reg) { int r = reg_renumber[reg]; - int nregs = HARD_REGNO_NREGS (r, PSEUDO_REGNO_MODE (reg)); + int nregs = hard_regno_nregs[r][PSEUDO_REGNO_MODE (reg)]; if (REGNO_REG_SET_P (&spilled_pseudos, reg) || spilled + spilled_nregs <= r || r + nregs <= spilled) @@ -1685,7 +1685,7 @@ find_reg (struct insn_chain *chain, int order) { int this_cost = spill_cost[regno]; int ok = 1; - unsigned int this_nregs = HARD_REGNO_NREGS (regno, rl->mode); + unsigned int this_nregs = hard_regno_nregs[regno][rl->mode]; for (j = 1; j < this_nregs; j++) { @@ -1724,7 +1724,7 @@ find_reg (struct insn_chain *chain, int order) if (rtl_dump_file) fprintf (rtl_dump_file, "Using reg %d for reload %d\n", best_reg, rnum); - rl->nregs = HARD_REGNO_NREGS (best_reg, rl->mode); + rl->nregs = hard_regno_nregs[best_reg][rl->mode]; rl->regno = best_reg; EXECUTE_IF_SET_IN_REG_SET @@ -1772,7 +1772,7 @@ find_reload_regs (struct insn_chain *chain) int regno = REGNO (chain->rld[i].reg_rtx); chain->rld[i].regno = regno; chain->rld[i].nregs - = HARD_REGNO_NREGS (regno, GET_MODE (chain->rld[i].reg_rtx)); + = hard_regno_nregs[regno][GET_MODE (chain->rld[i].reg_rtx)]; } else chain->rld[i].regno = -1; @@ -2062,7 +2062,7 @@ mark_home_live (int regno) i = reg_renumber[regno]; if (i < 0) return; - lim = i + HARD_REGNO_NREGS (i, PSEUDO_REGNO_MODE (regno)); + lim = i + hard_regno_nregs[i][PSEUDO_REGNO_MODE (regno)]; while (i < lim) regs_ever_live[i++] = 1; } @@ -3516,8 +3516,8 @@ spill_hard_reg (unsigned int regno, int cant_eliminate) if (reg_renumber[i] >= 0 && (unsigned int) reg_renumber[i] <= regno && ((unsigned int) reg_renumber[i] - + HARD_REGNO_NREGS ((unsigned int) reg_renumber[i], - PSEUDO_REGNO_MODE (i)) + + hard_regno_nregs[(unsigned int) reg_renumber[i]] + [PSEUDO_REGNO_MODE (i)] > regno)) SET_REGNO_REG_SET (&spilled_pseudos, i); } @@ -4059,7 +4059,7 @@ forget_old_reloads_1 (rtx x, rtx ignored ATTRIBUTE_UNUSED, { unsigned int i; - nr = HARD_REGNO_NREGS (regno, GET_MODE (x)); + nr = hard_regno_nregs[regno][GET_MODE (x)]; /* Storing into a spilled-reg invalidates its contents. This can happen if a block-local pseudo is allocated to that reg and it wasn't spilled because this block's total need is 0. @@ -4133,7 +4133,7 @@ static void mark_reload_reg_in_use (unsigned int regno, int opnum, enum reload_type type, enum machine_mode mode) { - unsigned int nregs = HARD_REGNO_NREGS (regno, mode); + unsigned int nregs = hard_regno_nregs[regno][mode]; unsigned int i; for (i = regno; i < nregs + regno; i++) @@ -4195,7 +4195,7 @@ static void clear_reload_reg_in_use (unsigned int regno, int opnum, enum reload_type type, enum machine_mode mode) { - unsigned int nregs = HARD_REGNO_NREGS (regno, mode); + unsigned int nregs = hard_regno_nregs[regno][mode]; unsigned int start_regno, end_regno, r; int i; /* A complication is that for some reload types, inheritance might @@ -4279,7 +4279,7 @@ clear_reload_reg_in_use (unsigned int regno, int opnum, unsigned int conflict_start = true_regnum (rld[i].reg_rtx); unsigned int conflict_end = (conflict_start - + HARD_REGNO_NREGS (conflict_start, rld[i].mode)); + + hard_regno_nregs[conflict_start][rld[i].mode]); /* If there is an overlap with the first to-be-freed register, adjust the interval start. */ @@ -4774,7 +4774,7 @@ reload_reg_free_for_value_p (int start_regno, int regno, int opnum, rtx reg = rld[i].reg_rtx; if (reg && GET_CODE (reg) == REG && ((unsigned) regno - true_regnum (reg) - <= HARD_REGNO_NREGS (REGNO (reg), GET_MODE (reg)) - (unsigned) 1) + <= hard_regno_nregs[REGNO (reg)][GET_MODE (reg)] - (unsigned) 1) && i != reloadnum) { rtx other_input = rld[i].in; @@ -4930,7 +4930,7 @@ free_for_value_p (int regno, enum machine_mode mode, int opnum, enum reload_type type, rtx value, rtx out, int reloadnum, int ignore_address_reloads) { - int nregs = HARD_REGNO_NREGS (regno, mode); + int nregs = hard_regno_nregs[regno][mode]; while (nregs-- > 0) if (! reload_reg_free_for_value_p (regno, regno + nregs, opnum, type, value, out, reloadnum, @@ -5103,7 +5103,7 @@ allocate_reload_reg (struct insn_chain *chain ATTRIBUTE_UNUSED, int r, && ! TEST_HARD_REG_BIT (reload_reg_used_for_inherit, regnum)))) { - int nr = HARD_REGNO_NREGS (regnum, rld[r].mode); + int nr = hard_regno_nregs[regnum][rld[r].mode]; /* Avoid the problem where spilling a GENERAL_OR_FP_REG (on 68000) got us two FP regs. If NR is 1, we would reject both of them. */ @@ -5436,7 +5436,7 @@ choose_reload_regs (struct insn_chain *chain) { /* If a group is needed, verify that all the subsequent registers still have their values intact. */ - int nr = HARD_REGNO_NREGS (i, rld[r].mode); + int nr = hard_regno_nregs[i][rld[r].mode]; int k; for (k = 1; k < nr; k++) @@ -5669,7 +5669,7 @@ choose_reload_regs (struct insn_chain *chain) && (regno != HARD_FRAME_POINTER_REGNUM || !frame_pointer_needed)) { - int nr = HARD_REGNO_NREGS (regno, rld[r].mode); + int nr = hard_regno_nregs[regno][rld[r].mode]; int k; rld[r].reg_rtx = equiv; reload_inherited[r] = 1; @@ -5884,14 +5884,14 @@ choose_reload_regs (struct insn_chain *chain) int nr = 1; if (nregno < FIRST_PSEUDO_REGISTER) - nr = HARD_REGNO_NREGS (nregno, rld[r].mode); + nr = hard_regno_nregs[nregno][rld[r].mode]; while (--nr >= 0) reg_has_output_reload[nregno + nr] = 1; if (i >= 0) { - nr = HARD_REGNO_NREGS (i, rld[r].mode); + nr = hard_regno_nregs[i][rld[r].mode]; while (--nr >= 0) SET_HARD_REG_BIT (reg_is_output_reload, i + nr); } @@ -7032,7 +7032,7 @@ emit_reload_insns (struct insn_chain *chain) if (i >= 0 && rld[r].reg_rtx != 0) { - int nr = HARD_REGNO_NREGS (i, GET_MODE (rld[r].reg_rtx)); + int nr = hard_regno_nregs[i][GET_MODE (rld[r].reg_rtx)]; int k; int part_reaches_end = 0; int all_reaches_end = 1; @@ -7076,8 +7076,8 @@ emit_reload_insns (struct insn_chain *chain) /* AUTO_INC */ : XEXP (rld[r].in_reg, 0)); int nregno = REGNO (out); int nnr = (nregno >= FIRST_PSEUDO_REGISTER ? 1 - : HARD_REGNO_NREGS (nregno, - GET_MODE (rld[r].reg_rtx))); + : hard_regno_nregs[nregno] + [GET_MODE (rld[r].reg_rtx)]); spill_reg_store[i] = new_spill_reg_store[i]; spill_reg_stored_to[i] = out; @@ -7137,8 +7137,8 @@ emit_reload_insns (struct insn_chain *chain) nregno = REGNO (in); nnr = (nregno >= FIRST_PSEUDO_REGISTER ? 1 - : HARD_REGNO_NREGS (nregno, - GET_MODE (rld[r].reg_rtx))); + : hard_regno_nregs[nregno] + [GET_MODE (rld[r].reg_rtx)]); reg_last_reload_reg[nregno] = rld[r].reg_rtx; @@ -7238,7 +7238,7 @@ emit_reload_insns (struct insn_chain *chain) && REGNO (src_reg) < FIRST_PSEUDO_REGISTER) { int src_regno = REGNO (src_reg); - int nr = HARD_REGNO_NREGS (src_regno, rld[r].mode); + int nr = hard_regno_nregs[src_regno][rld[r].mode]; /* The place where to find a death note varies with PRESERVE_DEATH_INFO_REGNO_P . The condition is not necessarily checked exactly in the code that moves @@ -7269,7 +7269,7 @@ emit_reload_insns (struct insn_chain *chain) } else { - int num_regs = HARD_REGNO_NREGS (nregno, GET_MODE (rld[r].out)); + int num_regs = hard_regno_nregs[nregno][GET_MODE (rld[r].out)]; while (num_regs-- > 0) reg_last_reload_reg[nregno + num_regs] = 0; @@ -7594,7 +7594,7 @@ delete_output_reload (rtx insn, int j, int last_reload_reg) } /* We will be deleting the insn. Remove the spill reg information. */ - for (k = HARD_REGNO_NREGS (last_reload_reg, GET_MODE (reg)); k-- > 0; ) + for (k = hard_regno_nregs[last_reload_reg][GET_MODE (reg)]; k-- > 0; ) { spill_reg_store[last_reload_reg + k] = 0; spill_reg_stored_to[last_reload_reg + k] = 0; diff --git a/gcc/resource.c b/gcc/resource.c index 240cf232334..0eb52b20cb4 100644 --- a/gcc/resource.c +++ b/gcc/resource.c @@ -104,7 +104,7 @@ update_live_status (rtx dest, rtx x, void *data ATTRIBUTE_UNUSED) else first_regno = REGNO (dest); - last_regno = first_regno + HARD_REGNO_NREGS (first_regno, GET_MODE (dest)); + last_regno = first_regno + hard_regno_nregs[first_regno][GET_MODE (dest)]; if (GET_CODE (x) == CLOBBER) for (i = first_regno; i < last_regno; i++) @@ -233,7 +233,7 @@ mark_referenced_resources (rtx x, struct resources *res, { unsigned int regno = subreg_regno (x); unsigned int last_regno - = regno + HARD_REGNO_NREGS (regno, GET_MODE (x)); + = regno + hard_regno_nregs[regno][GET_MODE (x)]; if (last_regno > FIRST_PSEUDO_REGISTER) abort (); @@ -246,7 +246,7 @@ mark_referenced_resources (rtx x, struct resources *res, { unsigned int regno = REGNO (x); unsigned int last_regno - = regno + HARD_REGNO_NREGS (regno, GET_MODE (x)); + = regno + hard_regno_nregs[regno][GET_MODE (x)]; if (last_regno > FIRST_PSEUDO_REGISTER) abort (); @@ -771,7 +771,7 @@ mark_set_resources (rtx x, struct resources *res, int in_dest, { unsigned int regno = subreg_regno (x); unsigned int last_regno - = regno + HARD_REGNO_NREGS (regno, GET_MODE (x)); + = regno + hard_regno_nregs[regno][GET_MODE (x)]; if (last_regno > FIRST_PSEUDO_REGISTER) abort (); @@ -786,7 +786,7 @@ mark_set_resources (rtx x, struct resources *res, int in_dest, { unsigned int regno = REGNO (x); unsigned int last_regno - = regno + HARD_REGNO_NREGS (regno, GET_MODE (x)); + = regno + hard_regno_nregs[regno][GET_MODE (x)]; if (last_regno > FIRST_PSEUDO_REGISTER) abort (); @@ -970,8 +970,8 @@ mark_target_live_regs (rtx insns, rtx target, struct resources *res) { regno = reg_renumber[i]; for (j = regno; - j < regno + HARD_REGNO_NREGS (regno, - PSEUDO_REGNO_MODE (i)); + j < regno + hard_regno_nregs[regno] + [PSEUDO_REGNO_MODE (i)]; j++) SET_HARD_REG_BIT (current_live_regs, j); } @@ -1044,8 +1044,8 @@ mark_target_live_regs (rtx insns, rtx target, struct resources *res) unsigned int first_regno = REGNO (XEXP (link, 0)); unsigned int last_regno = (first_regno - + HARD_REGNO_NREGS (first_regno, - GET_MODE (XEXP (link, 0)))); + + hard_regno_nregs[first_regno] + [GET_MODE (XEXP (link, 0))]); for (i = first_regno; i < last_regno; i++) SET_HARD_REG_BIT (pending_dead_regs, i); @@ -1063,8 +1063,8 @@ mark_target_live_regs (rtx insns, rtx target, struct resources *res) unsigned int first_regno = REGNO (XEXP (link, 0)); unsigned int last_regno = (first_regno - + HARD_REGNO_NREGS (first_regno, - GET_MODE (XEXP (link, 0)))); + + hard_regno_nregs[first_regno] + [GET_MODE (XEXP (link, 0))]); for (i = first_regno; i < last_regno; i++) CLEAR_HARD_REG_BIT (current_live_regs, i); diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index 4dda1786996..856af2f3a78 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -33,6 +33,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "flags.h" #include "basic-block.h" #include "real.h" +#include "regs.h" /* Forward declarations */ static int global_reg_mentioned_p_1 (rtx *, void *); @@ -1437,7 +1438,7 @@ refers_to_regno_p (unsigned int regno, unsigned int endregno, rtx x, return (endregno > x_regno && regno < x_regno + (x_regno < FIRST_PSEUDO_REGISTER - ? HARD_REGNO_NREGS (x_regno, GET_MODE (x)) + ? hard_regno_nregs[x_regno][GET_MODE (x)] : 1)); case SUBREG: @@ -1449,7 +1450,7 @@ refers_to_regno_p (unsigned int regno, unsigned int endregno, rtx x, unsigned int inner_regno = subreg_regno (x); unsigned int inner_endregno = inner_regno + (inner_regno < FIRST_PSEUDO_REGISTER - ? HARD_REGNO_NREGS (regno, GET_MODE (x)) : 1); + ? hard_regno_nregs[regno][GET_MODE (x)] : 1); return endregno > inner_regno && regno < inner_endregno; } @@ -1541,7 +1542,7 @@ reg_overlap_mentioned_p (rtx x, rtx in) regno = REGNO (x); do_reg: endregno = regno + (regno < FIRST_PSEUDO_REGISTER - ? HARD_REGNO_NREGS (regno, GET_MODE (x)) : 1); + ? hard_regno_nregs[regno][GET_MODE (x)] : 1); return refers_to_regno_p (regno, endregno, in, (rtx*) 0); case MEM: @@ -1794,7 +1795,7 @@ dead_or_set_p (rtx insn, rtx x) regno = REGNO (x); last_regno = (regno >= FIRST_PSEUDO_REGISTER ? regno - : regno + HARD_REGNO_NREGS (regno, GET_MODE (x)) - 1); + : regno + hard_regno_nregs[regno][GET_MODE (x)] - 1); for (i = regno; i <= last_regno; i++) if (! dead_or_set_regno_p (insn, i)) @@ -1844,7 +1845,7 @@ dead_or_set_regno_p (rtx insn, unsigned int test_regno) regno = REGNO (dest); endregno = (regno >= FIRST_PSEUDO_REGISTER ? regno + 1 - : regno + HARD_REGNO_NREGS (regno, GET_MODE (dest))); + : regno + hard_regno_nregs[regno][GET_MODE (dest)]); return (test_regno >= regno && test_regno < endregno); } @@ -1875,7 +1876,7 @@ dead_or_set_regno_p (rtx insn, unsigned int test_regno) regno = REGNO (dest); endregno = (regno >= FIRST_PSEUDO_REGISTER ? regno + 1 - : regno + HARD_REGNO_NREGS (regno, GET_MODE (dest))); + : regno + hard_regno_nregs[regno][GET_MODE (dest)]); if (test_regno >= regno && test_regno < endregno) return 1; @@ -1927,8 +1928,8 @@ find_regno_note (rtx insn, enum reg_note kind, unsigned int regno) && REGNO (XEXP (link, 0)) <= regno && ((REGNO (XEXP (link, 0)) + (REGNO (XEXP (link, 0)) >= FIRST_PSEUDO_REGISTER ? 1 - : HARD_REGNO_NREGS (REGNO (XEXP (link, 0)), - GET_MODE (XEXP (link, 0))))) + : hard_regno_nregs[REGNO (XEXP (link, 0))] + [GET_MODE (XEXP (link, 0))])) > regno)) return link; return 0; @@ -1990,7 +1991,7 @@ find_reg_fusage (rtx insn, enum rtx_code code, rtx datum) if (regno < FIRST_PSEUDO_REGISTER) { unsigned int end_regno - = regno + HARD_REGNO_NREGS (regno, GET_MODE (datum)); + = regno + hard_regno_nregs[regno][GET_MODE (datum)]; unsigned int i; for (i = regno; i < end_regno; i++) @@ -2025,7 +2026,7 @@ find_regno_fusage (rtx insn, enum rtx_code code, unsigned int regno) if (GET_CODE (op = XEXP (link, 0)) == code && GET_CODE (reg = XEXP (op, 0)) == REG && (regnote = REGNO (reg)) <= regno - && regnote + HARD_REGNO_NREGS (regnote, GET_MODE (reg)) > regno) + && regnote + hard_regno_nregs[regnote][GET_MODE (reg)] > regno) return 1; } @@ -3257,8 +3258,8 @@ subreg_regno_offset (unsigned int xregno, enum machine_mode xmode, if (xregno >= FIRST_PSEUDO_REGISTER) abort (); - nregs_xmode = HARD_REGNO_NREGS (xregno, xmode); - nregs_ymode = HARD_REGNO_NREGS (xregno, ymode); + nregs_xmode = hard_regno_nregs[xregno][xmode]; + nregs_ymode = hard_regno_nregs[xregno][ymode]; /* If this is a big endian paradoxical subreg, which uses more actual hard registers than the original register, we must return a negative @@ -3300,8 +3301,8 @@ subreg_offset_representable_p (unsigned int xregno, enum machine_mode xmode, if (xregno >= FIRST_PSEUDO_REGISTER) abort (); - nregs_xmode = HARD_REGNO_NREGS (xregno, xmode); - nregs_ymode = HARD_REGNO_NREGS (xregno, ymode); + nregs_xmode = hard_regno_nregs[xregno][xmode]; + nregs_ymode = hard_regno_nregs[xregno][ymode]; /* paradoxical subregs are always valid. */ if (offset == 0 @@ -3513,7 +3514,7 @@ hoist_test_store (rtx x, rtx val, regset live) if (REGNO (x) < FIRST_PSEUDO_REGISTER) { int regno = REGNO (x); - int n = HARD_REGNO_NREGS (regno, GET_MODE (x)); + int n = hard_regno_nregs[regno][GET_MODE (x)]; if (!live) return false; diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c index 9bc7a11182f..0a6738895f8 100644 --- a/gcc/sched-deps.c +++ b/gcc/sched-deps.c @@ -492,7 +492,7 @@ sched_analyze_1 (struct deps *deps, rtx x, rtx insn) If so, mark all of them just like the first. */ if (regno < FIRST_PSEUDO_REGISTER) { - int i = HARD_REGNO_NREGS (regno, GET_MODE (dest)); + int i = hard_regno_nregs[regno][GET_MODE (dest)]; if (code == SET) { while (--i >= 0) @@ -639,7 +639,7 @@ sched_analyze_2 (struct deps *deps, rtx x, rtx insn) int regno = REGNO (x); if (regno < FIRST_PSEUDO_REGISTER) { - int i = HARD_REGNO_NREGS (regno, GET_MODE (x)); + int i = hard_regno_nregs[regno][GET_MODE (x)]; while (--i >= 0) SET_REGNO_REG_SET (reg_pending_uses, regno + i); } diff --git a/gcc/sched-rgn.c b/gcc/sched-rgn.c index b8e474d0b44..95d5f8e03e4 100644 --- a/gcc/sched-rgn.c +++ b/gcc/sched-rgn.c @@ -1323,7 +1323,7 @@ check_live_1 (int src, rtx x) if (regno < FIRST_PSEUDO_REGISTER) { /* Check for hard registers. */ - int j = HARD_REGNO_NREGS (regno, GET_MODE (reg)); + int j = hard_regno_nregs[regno][GET_MODE (reg)]; while (--j >= 0) { for (i = 0; i < candidate_table[src].split_bbs.nr_members; i++) @@ -1397,7 +1397,7 @@ update_live_1 (int src, rtx x) { if (regno < FIRST_PSEUDO_REGISTER) { - int j = HARD_REGNO_NREGS (regno, GET_MODE (reg)); + int j = hard_regno_nregs[regno][GET_MODE (reg)]; while (--j >= 0) { for (i = 0; i < candidate_table[src].update_bbs.nr_members; i++) diff --git a/gcc/stmt.c b/gcc/stmt.c index 7dc1a05aa8f..74d76c72f55 100644 --- a/gcc/stmt.c +++ b/gcc/stmt.c @@ -58,6 +58,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "predict.h" #include "optabs.h" #include "target.h" +#include "regs.h" /* Functions and data structures for expanding case statements. */ @@ -1413,7 +1414,7 @@ decl_conflicts_with_clobbers_p (tree decl, const HARD_REG_SET clobbered_regs) for (regno = REGNO (reg); regno < (REGNO (reg) - + HARD_REGNO_NREGS (REGNO (reg), GET_MODE (reg))); + + hard_regno_nregs[REGNO (reg)][GET_MODE (reg)]); regno++) if (TEST_HARD_REG_BIT (clobbered_regs, regno)) { diff --git a/gcc/varasm.c b/gcc/varasm.c index 8bad0fffb00..27f2f34b32c 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -795,7 +795,7 @@ make_decl_rtl (tree decl, const char *asmspec) #ifdef ASM_DECLARE_REGISTER_GLOBAL ASM_DECLARE_REGISTER_GLOBAL (asm_out_file, decl, reg_number, name); #endif - nregs = HARD_REGNO_NREGS (reg_number, DECL_MODE (decl)); + nregs = hard_regno_nregs[reg_number][DECL_MODE (decl)]; while (nregs > 0) globalize_reg (reg_number + --nregs); } |