aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1992-12-31 14:31:24 -0800
committerJim Wilson <wilson@gcc.gnu.org>1992-12-31 14:31:24 -0800
commitdca52d8026885a3bfa6e67859a36b453bb41ead7 (patch)
tree6fd25264c6d57f84455b69fc110aa73d7cf60c5f
parent3002e1601b13c6a4cd4382788d97ebbd789e4ce9 (diff)
downloadgcc-dca52d8026885a3bfa6e67859a36b453bb41ead7.zip
gcc-dca52d8026885a3bfa6e67859a36b453bb41ead7.tar.gz
gcc-dca52d8026885a3bfa6e67859a36b453bb41ead7.tar.bz2
(operands_match_p): For WORDS_BIG_ENDIAN machines,
make multiple register operands equivalent if the last register of the groups are the same. (subst_reloads): Use gen_lowpart_common to change mode of reloadreg. From-SVN: r3030
-rw-r--r--gcc/reload.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/reload.c b/gcc/reload.c
index 7757dd7..1b98a42 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -1592,6 +1592,16 @@ operands_match_p (x, y)
else
j = REGNO (y);
+ /* On a WORDS_BIG_ENDIAN machine, point to the last register of a
+ multiple hard register group, so that for example (reg:DI 0) and
+ (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;
+ 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;
+
return i == j;
}
/* If two operands must match, because they are really a single
@@ -4348,7 +4358,7 @@ subst_reloads ()
/* Encapsulate RELOADREG so its machine mode matches what
used to be there. */
if (GET_MODE (reloadreg) != r->mode && r->mode != VOIDmode)
- reloadreg = gen_rtx (REG, r->mode, REGNO (reloadreg));
+ reloadreg = gen_lowpart_common (r->mode, reloadreg);
/* If we are putting this into a SUBREG and RELOADREG is a
SUBREG, we would be making nested SUBREGs, so we have to fix