From a2c6f0b7da35eadcfafa42e5ad04647c2696fbb4 Mon Sep 17 00:00:00 2001 From: rsandifo Date: Tue, 22 May 2007 20:52:39 +0000 Subject: gcc/ * regs.h (end_hard_regno): New function. (END_HARD_REGNO, END_REGNO): New macros. (add_to_hard_reg_set): New function. (remove_from_hard_reg_set): Likewise. (in_hard_reg_set_p): Likewise. (overlaps_hard_reg_set_p): Likewise. * bt-load.c (find_btr_reference): Use overlaps_hard_reg_set_p. (note_btr_set): Use END_HARD_REGNO. * caller-save.c (setup_save_areas): Use end_hard_regno. (mark_set_regs): Use END_HARD_REGNO. (add_stored_regs): Use end_hard_regno. (mark_referenced_regs): Use add_to_hard_reg_set. * combine.c (update_table_tick): Use END_REGNO. (record_value_for_reg): Likewise. (record_dead_and_set_regs): Likewise. (get_last_value_validate): Likewise. (use_crosses_set_p): Likewise. (reg_dead_at_p_1): Likewise. (reg_dead_at_p): Likewise. (mark_used_regs_combine): Use add_to_hard_reg_set. (move_deaths): Use END_HARD_REGNO. (reg_bitfield_target_p): Use end_hard_regno. (distribute_notes): Use END_HARD_REGNO. * cse.c (mention_regs): Use END_REGNO. (insert): Use add_to_hard_reg_set. (invalidate): Use END_HARD_REGNO. (invalidate_for_call): Likewise. (exp_equiv_p): Use END_REGNO. (cse_insn): Likewise. * cselib.c (cselib_invalidate_regno): Use end_hard_regno. * df-problems.c (df_urec_mark_reg_change): Use END_HARD_REGNO. * df-scan.c (df_ref_record): Use END_HARD_REGNO. * function.c (keep_stack_depressed): Use end_hard_regno. * global.c (global_alloc): Use end_hard_regno. (global_conflicts): Use add_to_hard_reg_set instead of mark_reg_live_nc. (find_reg): Likewise. (mark_reg_store): Likewise. (mark_reg_conflicts): Likewise. (mark_reg_death): Use remove_from_hard_reg_set. (mark_reg_live_nc): Delete. (set_preference): Use end_hard_regno. * local-alloc.c (mark_life): Use add_to_hard_reg_set and remove_from_hard_reg_set. (post_mark_life): Use add_to_hard_reg_set. * mode-switching.c (reg_dies): Use remove_from_hard_reg_set. (reg_becomes_live): Use add_to_hard_reg_set. * recog.c (reg_fits_class_p): Use in_hard_reg_set_p. (peep2_find_free_register): Use add_to_hard_reg_set. * reg-stack.c (convert_regs_exit): Use END_HARD_REGNO. * regclass.c (record_reg_classes): Use in_hard_reg_set_p. * regrename.c (note_sets): Use add_to_hard_reg_set. (clear_dead_regs): Use remove_from_hard_reg_set. (regrename_optimize): Use add_to_hard_reg_set. (find_oldest_value_reg): Use in_hard_reg_set_p. * reload.c (push_reload): Use in_hard_reg_set_p and end_hard_regno. (hard_reg_set_here_p): Use end_hard_regno. (decompose): Likewise. (reg_overlap_mentioned_for_reload_p): Use END_HARD_REGNO. (find_equiv_reg): Use in_hard_reg_set_p and end_hard_regno. * reload1.c (compute_use_by_pseudos): Use add_to_hard_reg_set. (mark_home_live): Use end_hard_regno. (spill_hard_reg): Likewise. (clear_reload_reg_in_use): Likewise. * reorg.c (delete_prior_computation): Use END_REGNO. * resource.c (update_live_status): Use END_HARD_REGNO. (mark_referenced_resources): Use add_to_hard_reg_set. (mark_set_resources): Likewise. (mark_target_live_regs): Likewise. Use remove_from_hard_reg_set. * rtlanal.c (refers_to_regno_p): Use END_REGNO. (reg_overlap_mentioned_p): Likewise. (dead_or_set_p): Likewise. Use an exclusive upper loop bound. (covers_regno_no_parallel_p): Use END_REGNO. (find_regno_note): Likewise. (find_reg_fusage): Use END_HARD_REGNO. * stmt.c (decl_overlaps_hard_reg_set_p): Use overlaps_hard_reg_set_p. * var-tracking.c (emit_note_insn_var_location): Use end_hard_regno. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124961 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/reload.c | 49 +++++++++++++------------------------------------ 1 file changed, 13 insertions(+), 36 deletions(-) (limited to 'gcc/reload.c') diff --git a/gcc/reload.c b/gcc/reload.c index 243b65bd709..16a7e474e66 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -1259,17 +1259,8 @@ push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc, } for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) 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 j; - for (j = 1; j < nregs; j++) - if (! TEST_HARD_REG_BIT (reg_class_contents[(int) class], i + j)) - break; - if (j == nregs) - break; - } + && in_hard_reg_set_p (reg_class_contents[(int) class], mode, i)) + break; if (i == FIRST_PSEUDO_REGISTER) { error_for_asm (this_insn, "impossible register constraint " @@ -1533,18 +1524,15 @@ push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc, || ! bitmap_bit_p (ENTRY_BLOCK_PTR->il.rtl->global_live_at_end, ORIGINAL_REGNO (XEXP (note, 0)))) && ! refers_to_regno_for_reload_p (regno, - (regno - + hard_regno_nregs[regno] - [rel_mode]), + end_hard_regno (rel_mode, + regno), 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 is also OUT. */ && (out == 0 || in == out || ! hard_reg_set_here_p (regno, - (regno - + hard_regno_nregs[regno] - [rel_mode]), + end_hard_regno (rel_mode, regno), PATTERN (this_insn))) /* ??? Why is this code so different from the previous? Is there any simple coherent way to describe the two together? @@ -1573,8 +1561,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]), - in, (rtx *)0)) + (regno, end_hard_regno (inmode, regno), in, (rtx *) 0)) || can_reload_into (in, regno, inmode))) { rld[i].reg_rtx = gen_rtx_REG (rel_mode, regno); @@ -2089,7 +2076,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) + && end_hard_regno (GET_MODE (op0), r) > beg_regno) return 1; } } @@ -2409,7 +2396,7 @@ decompose (rtx x) } else /* A hard reg. */ - val.end = val.start + hard_regno_nregs[val.start][GET_MODE (x)]; + val.end = end_hard_regno (GET_MODE (x), val.start); break; case SUBREG: @@ -6500,7 +6487,7 @@ reg_overlap_mentioned_for_reload_p (rtx x, rtx in) return 0; } - endregno = regno + hard_regno_nregs[regno][GET_MODE (x)]; + endregno = END_HARD_REGNO (x); return refers_to_regno_for_reload_p (regno, endregno, in, (rtx*) 0); } @@ -6733,17 +6720,9 @@ find_equiv_reg (rtx goal, rtx insn, enum reg_class class, int other, } else if ((unsigned) valueno >= FIRST_PSEUDO_REGISTER) continue; - else - { - int 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; - if (i >= 0) - continue; - } + else if (!in_hard_reg_set_p (reg_class_contents[(int) class], + mode, valueno)) + continue; value = valtry; where = p; break; @@ -6777,9 +6756,7 @@ find_equiv_reg (rtx goal, rtx insn, enum reg_class class, int other, and is also a register that appears in the address of GOAL. */ if (goal_mem && value == SET_DEST (single_set (where)) - && refers_to_regno_for_reload_p (valueno, - (valueno - + hard_regno_nregs[valueno][mode]), + && refers_to_regno_for_reload_p (valueno, end_hard_regno (mode, valueno), goal, (rtx*) 0)) return 0; -- cgit v1.2.1