diff options
author | J"orn Rennecke <joern.rennecke@superh.com> | 2002-07-23 20:06:46 +0000 |
---|---|---|
committer | Joern Rennecke <amylaar@gcc.gnu.org> | 2002-07-23 21:06:46 +0100 |
commit | 451f86fdbce4602102d1786f13fafa278bbaa6c9 (patch) | |
tree | a4657d0936e95c87f5855af3090630b9fee49cb9 /gcc/simplify-rtx.c | |
parent | 1d5fa6b42508d546fe875bb6809e645523f01e70 (diff) | |
download | gcc-451f86fdbce4602102d1786f13fafa278bbaa6c9.zip gcc-451f86fdbce4602102d1786f13fafa278bbaa6c9.tar.gz gcc-451f86fdbce4602102d1786f13fafa278bbaa6c9.tar.bz2 |
reload.c (find_reloads_toplev): Use simplify_gen_subreg.
gcc:
* reload.c (find_reloads_toplev): Use simplify_gen_subreg.
* simplify-rtx.c (simplify_subreg): When converting to a non-int
mode, try to convert to an integer mode of matching size first.
gcc/testsuite:
* gcc.c-torture/compile/simd-4.c: New test.
From-SVN: r55687
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r-- | gcc/simplify-rtx.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index d07de68..1791f2e 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -2347,8 +2347,7 @@ simplify_subreg (outermode, op, innermode, byte) return NULL_RTX; return simplify_subreg (outermode, op, new_mode, subbyte); } - else if (GET_MODE_CLASS (outermode) != MODE_VECTOR_INT - && GET_MODE_CLASS (outermode) != MODE_VECTOR_FLOAT) + else if (GET_MODE_CLASS (outermode) == MODE_INT) /* This shouldn't happen, but let's not do anything stupid. */ return NULL_RTX; } @@ -2387,7 +2386,8 @@ simplify_subreg (outermode, op, innermode, byte) Later it we should move all simplification code here and rewrite GEN_LOWPART_IF_POSSIBLE, GEN_HIGHPART, OPERAND_SUBWORD and friends using SIMPLIFY_SUBREG. */ - if (subreg_lowpart_offset (outermode, innermode) == byte) + if (subreg_lowpart_offset (outermode, innermode) == byte + && GET_CODE (op) != CONST_VECTOR) { rtx new = gen_lowpart_if_possible (outermode, op); if (new) @@ -2406,6 +2406,19 @@ simplify_subreg (outermode, op, innermode, byte) return new; } + if (GET_MODE_CLASS (outermode) != MODE_INT) + { + enum machine_mode new_mode = int_mode_for_mode (outermode); + + if (new_mode != innermode || byte != 0) + { + op = simplify_subreg (new_mode, op, innermode, byte); + if (! op) + return NULL_RTX; + return simplify_subreg (outermode, op, new_mode, 0); + } + } + offset = byte * BITS_PER_UNIT; switch (GET_CODE (op)) { |