diff options
author | aoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-03-04 05:54:39 +0000 |
---|---|---|
committer | aoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-03-04 05:54:39 +0000 |
commit | fd3ac62f59231c17eff73bc5edece2759b02fd14 (patch) | |
tree | 9c4b3b8fc4da20af305ea602c1a3ce677c8ef72c /gcc/reload.c | |
parent | 8b91a343a0b351146c091b7225c234d8dd2794d0 (diff) | |
download | gcc-fd3ac62f59231c17eff73bc5edece2759b02fd14.tar.gz |
* reload.c (reload_adjust_reg_for_mode): New function.
(subst_reloads): Call it.
(operands_match_p): Adjust registers using HARD_REGNO_NREGS.
* reload.h (reload_adjust_reg_for_mode): Declare.
* reload1.c (emit_input_reload_insns, emit_output_reload_insns):
Call it.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@63766 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/reload.c')
-rw-r--r-- | gcc/reload.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/gcc/reload.c b/gcc/reload.c index a2642aa7349..de1b1a93e25 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -2137,10 +2137,10 @@ operands_match_p (x, 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 += (GET_MODE_SIZE (GET_MODE (x)) / UNITS_PER_WORD) - 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 += (GET_MODE_SIZE (GET_MODE (y)) / UNITS_PER_WORD) - 1; + j += HARD_REGNO_NREGS (j, GET_MODE (y)) - 1; return i == j; } @@ -5954,7 +5954,7 @@ subst_reloads (insn) do the wrong thing if RELOADREG is multi-word. RELOADREG will always be a REG here. */ if (GET_MODE (reloadreg) != r->mode && r->mode != VOIDmode) - reloadreg = gen_rtx_REG (r->mode, REGNO (reloadreg)); + reloadreg = reload_adjust_reg_for_mode (reloadreg, r->mode); /* If we are putting this into a SUBREG and RELOADREG is a SUBREG, we would be making nested SUBREGs, so we have to fix @@ -6934,6 +6934,26 @@ regno_clobbered_p (regno, insn, mode, sets) return 0; } +/* Find the low part, with mode MODE, of a hard regno RELOADREG. */ +rtx +reload_adjust_reg_for_mode (reloadreg, mode) + rtx reloadreg; + enum machine_mode mode; +{ + int regno; + + if (GET_MODE (reloadreg) == mode) + return reloadreg; + + regno = REGNO (reloadreg); + + if (WORDS_BIG_ENDIAN) + regno += HARD_REGNO_NREGS (regno, GET_MODE (reloadreg)) + - HARD_REGNO_NREGS (regno, mode); + + return gen_rtx_REG (mode, regno); +} + static const char *const reload_when_needed_name[] = { "RELOAD_FOR_INPUT", |