diff options
author | Richard Henderson <rth@redhat.com> | 2002-02-04 10:16:07 -0800 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2002-02-04 10:16:07 -0800 |
commit | 563c12b029649156a5de1c934a6dd67838ca4845 (patch) | |
tree | 10416672c97e3811caed6a63b80b29c22958ea6a /gcc/combine.c | |
parent | ca56cd301e2c135d4ca5571a7b091564a508adfa (diff) | |
download | gcc-563c12b029649156a5de1c934a6dd67838ca4845.zip gcc-563c12b029649156a5de1c934a6dd67838ca4845.tar.gz gcc-563c12b029649156a5de1c934a6dd67838ca4845.tar.bz2 |
combine.c (force_to_mode): Remove STACK_BIAS code.
* combine.c (force_to_mode): Remove STACK_BIAS code.
(nonzero_bits): Likewise. Replace sp/fp special case with
REGNO_POINTER_ALIGN.
* config/sparc/sparc.h (FRAME_POINTER_REGNUM): Change to SFP.
(HARD_FRAME_POINTER_REGNUM): New.
(FIRST_PSEUDO_REGISTER, REG_CLASS_CONTENTS): Update.
(FIXED_REGS, CALL_USED_REGS): Update.
(REG_ALLOC_ORDER, REGISTER_NAMES): Update.
(CONDITIONAL_REGISTER_USAGE): Update for HFP.
(HARD_REGNO_NREGS): Update for SFP.
(STACK_POINTER_OFFSET): Include bias here ...
(FIRST_PARM_OFFSET): ... not here.
(STACK_BIAS): Remove.
(INIT_EXPANDERS): New.
(STARTING_FRAME_OFFSET): Do not include bias.
(ELIMINABLE_REGS, CAN_ELIMINATE, INITIAL_ELIMINATION_OFFSET): New.
(REGNO_OK_FOR_INDEX_P, REGNO_OK_FOR_BASE_P): Update for SFP.
(REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P): Likewise.
* config/sparc/aout.h (DBX_REGISTER_NUMBER): Update for HFP.
* config/sparc/litecoff.h, config/sparc/sol2.h: Likewise.
* config/sparc/sparc.c (mem_min_alignment): Update for HFP.
(sparc_nonflat_function_prologue, epilogue_renumber): Likewise.
(MUST_SAVE_REGISTER): Likewise.
(sparc_flat_function_prologue): Likewise.
(sparc_flat_function_epilogue): Likewise.
(HARD_FRAME_POINTER_MASK): Rename from FRAME_POINTER_MASK.
(sparc_init_modes): SFP is GENERAL_REGS.
(sparc_builtin_saveregs): SFP does not have bias applied.
From-SVN: r49486
Diffstat (limited to 'gcc/combine.c')
-rw-r--r-- | gcc/combine.c | 92 |
1 files changed, 19 insertions, 73 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index 25b4d63..7662b9b 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -6753,33 +6753,12 @@ force_to_mode (x, mode, mask, reg, just_select) smask |= (HOST_WIDE_INT) -1 << width; if (GET_CODE (XEXP (x, 1)) == CONST_INT - && exact_log2 (- smask) >= 0) - { -#ifdef STACK_BIAS - if (STACK_BIAS - && (XEXP (x, 0) == stack_pointer_rtx - || XEXP (x, 0) == frame_pointer_rtx)) - { - int sp_alignment = STACK_BOUNDARY / BITS_PER_UNIT; - unsigned HOST_WIDE_INT sp_mask = GET_MODE_MASK (mode); - - sp_mask &= ~(sp_alignment - 1); - if ((sp_mask & ~smask) == 0 - && ((INTVAL (XEXP (x, 1)) - STACK_BIAS) & ~smask) != 0) - return force_to_mode (plus_constant (XEXP (x, 0), - ((INTVAL (XEXP (x, 1)) - - STACK_BIAS) & smask) - + STACK_BIAS), - mode, smask, reg, next_select); - } -#endif - if ((nonzero_bits (XEXP (x, 0), mode) & ~smask) == 0 - && (INTVAL (XEXP (x, 1)) & ~smask) != 0) - return force_to_mode (plus_constant (XEXP (x, 0), - (INTVAL (XEXP (x, 1)) - & smask)), - mode, smask, reg, next_select); - } + && exact_log2 (- smask) >= 0 + && (nonzero_bits (XEXP (x, 0), mode) & ~smask) == 0 + && (INTVAL (XEXP (x, 1)) & ~smask) != 0) + return force_to_mode (plus_constant (XEXP (x, 0), + (INTVAL (XEXP (x, 1)) & smask)), + mode, smask, reg, next_select); } /* ... fall through ... */ @@ -7916,40 +7895,23 @@ nonzero_bits (x, mode) nonzero &= GET_MODE_MASK (ptr_mode); #endif -#ifdef STACK_BOUNDARY - /* If this is the stack pointer, we may know something about its - alignment. If PUSH_ROUNDING is defined, it is possible for the - stack to be momentarily aligned only to that amount, so we pick - the least alignment. */ - - /* We can't check for arg_pointer_rtx here, because it is not - guaranteed to have as much alignment as the stack pointer. - In particular, in the Irix6 n64 ABI, the stack has 128 bit - alignment but the argument pointer has only 64 bit alignment. */ - - if ((x == frame_pointer_rtx - || x == stack_pointer_rtx - || x == hard_frame_pointer_rtx - || (REGNO (x) >= FIRST_VIRTUAL_REGISTER - && REGNO (x) <= LAST_VIRTUAL_REGISTER)) -#ifdef STACK_BIAS - && !STACK_BIAS -#endif - ) + /* Include declared information about alignment of pointers. */ + + if (REG_POINTER (x) && REGNO_POINTER_ALIGN (REGNO (x))) { - int sp_alignment = STACK_BOUNDARY / BITS_PER_UNIT; + unsigned HOST_WIDE_INT alignment + = REGNO_POINTER_ALIGN (REGNO (x)) / BITS_PER_UNIT; #ifdef PUSH_ROUNDING - if (REGNO (x) == STACK_POINTER_REGNUM && PUSH_ARGS) - sp_alignment = MIN (PUSH_ROUNDING (1), sp_alignment); + /* If PUSH_ROUNDING is defined, it is possible for the + stack to be momentarily aligned only to that amount, + so we pick the least alignment. */ + if (x == stack_pointer_rtx && PUSH_ARGS) + alignment = MIN (PUSH_ROUNDING (1), alignment); #endif - /* We must return here, otherwise we may get a worse result from - one of the choices below. There is nothing useful below as - far as the stack pointer is concerned. */ - return nonzero &= ~(sp_alignment - 1); + nonzero &= ~(alignment - 1); } -#endif /* If X is a register whose nonzero bits value is current, use it. Otherwise, if X is a register whose value we can find, use that @@ -7964,7 +7926,7 @@ nonzero_bits (x, mode) && ! REGNO_REG_SET_P (BASIC_BLOCK (0)->global_live_at_start, REGNO (x)))) && INSN_CUID (reg_last_set[REGNO (x)]) < subst_low_cuid) - return reg_last_set_nonzero_bits[REGNO (x)]; + return reg_last_set_nonzero_bits[REGNO (x)] & nonzero; tem = get_last_value (x); @@ -7990,7 +7952,7 @@ nonzero_bits (x, mode) | ((HOST_WIDE_INT) (-1) << GET_MODE_BITSIZE (GET_MODE (x)))); #endif - return nonzero_bits (tem, mode); + return nonzero_bits (tem, mode) & nonzero; } else if (nonzero_sign_valid && reg_nonzero_bits[REGNO (x)]) { @@ -8128,22 +8090,6 @@ nonzero_bits (x, mode) switch (code) { case PLUS: -#ifdef STACK_BIAS - if (STACK_BIAS - && (XEXP (x, 0) == stack_pointer_rtx - || XEXP (x, 0) == frame_pointer_rtx) - && GET_CODE (XEXP (x, 1)) == CONST_INT) - { - int sp_alignment = STACK_BOUNDARY / BITS_PER_UNIT; - - nz0 = (GET_MODE_MASK (mode) & ~(sp_alignment - 1)); - nz1 = INTVAL (XEXP (x, 1)) - STACK_BIAS; - width0 = floor_log2 (nz0) + 1; - width1 = floor_log2 (nz1) + 1; - low0 = floor_log2 (nz0 & -nz0); - low1 = floor_log2 (nz1 & -nz1); - } -#endif result_width = MAX (width0, width1) + 1; result_low = MIN (low0, low1); break; |