diff options
author | amylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-07-23 20:06:46 +0000 |
---|---|---|
committer | amylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-07-23 20:06:46 +0000 |
commit | c736a8377d4c4b4efe1eec1c2d79e18e51dd8ac5 (patch) | |
tree | a4657d0936e95c87f5855af3090630b9fee49cb9 /gcc/reload.c | |
parent | 8d8dff492b9e21560d2094645b676b952ee720ef (diff) | |
download | gcc-c736a8377d4c4b4efe1eec1c2d79e18e51dd8ac5.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@55687 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/reload.c')
-rw-r--r-- | gcc/reload.c | 43 |
1 files changed, 4 insertions, 39 deletions
diff --git a/gcc/reload.c b/gcc/reload.c index 72e1674008f..7f3568c7ce4 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -4404,51 +4404,16 @@ find_reloads_toplev (x, opnum, type, ind_levels, is_set_dest, insn, if (GET_MODE_BITSIZE (GET_MODE (x)) == BITS_PER_WORD && regno >= FIRST_PSEUDO_REGISTER && reg_renumber[regno] < 0 - && reg_equiv_constant[regno] != 0 - && (tem = operand_subword (reg_equiv_constant[regno], - SUBREG_BYTE (x) / UNITS_PER_WORD, 0, - GET_MODE (SUBREG_REG (x)))) != 0) + && reg_equiv_constant[regno] != 0) { - /* TEM is now a word sized constant for the bits from X that - we wanted. However, TEM may be the wrong representation. - - Use gen_lowpart_common to convert a CONST_INT into a - CONST_DOUBLE and vice versa as needed according to by the mode - of the SUBREG. */ - tem = gen_lowpart_common (GET_MODE (x), tem); + tem = + simplify_gen_subreg (GET_MODE (x), reg_equiv_constant[regno], + GET_MODE (SUBREG_REG (x)), SUBREG_BYTE (x)); if (!tem) abort (); return tem; } - /* If the SUBREG is wider than a word, the above test will fail. - For example, we might have a SImode SUBREG of a DImode SUBREG_REG - for a 16 bit target, or a DImode SUBREG of a TImode SUBREG_REG for - a 32 bit target. We still can - and have to - handle this - for non-paradoxical subregs of CONST_INTs. */ - if (regno >= FIRST_PSEUDO_REGISTER && reg_renumber[regno] < 0 - && reg_equiv_constant[regno] != 0 - && GET_CODE (reg_equiv_constant[regno]) == CONST_INT - && (GET_MODE_SIZE (GET_MODE (x)) - < GET_MODE_SIZE (GET_MODE (SUBREG_REG (x))))) - { - int shift = SUBREG_BYTE (x) * BITS_PER_UNIT; - if (WORDS_BIG_ENDIAN) - shift = (GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (x))) - - GET_MODE_BITSIZE (GET_MODE (x)) - - shift); - /* Here we use the knowledge that CONST_INTs have a - HOST_WIDE_INT field. */ - if (shift >= HOST_BITS_PER_WIDE_INT) - shift = HOST_BITS_PER_WIDE_INT - 1; - return GEN_INT (INTVAL (reg_equiv_constant[regno]) >> shift); - } - - if (regno >= FIRST_PSEUDO_REGISTER && reg_renumber[regno] < 0 - && reg_equiv_constant[regno] != 0 - && GET_MODE (reg_equiv_constant[regno]) == VOIDmode) - abort (); - /* If the subreg contains a reg that will be converted to a mem, convert the subreg to a narrower memref now. Otherwise, we would get (subreg (mem ...) ...), |