This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] lower-subreg: Decompose multiword shifts
- From: Ian Lance Taylor <iant at google dot com>
- To: Andreas Krebbel <Andreas dot Krebbel at de dot ibm dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: 06 Aug 2007 18:26:41 -0700
- Subject: Re: [PATCH] lower-subreg: Decompose multiword shifts
- References: <20070802153434.GA24953@blc4eb430604175.ibm.com>
Andreas Krebbel <Andreas.Krebbel@de.ibm.com> writes:
> 2007-08-02 Andreas Krebbel <krebbel1@de.ibm.com>
>
> * lower-subreg.c (resolve_subreg_use): Remove assertion.
> (find_decomposable_shift, resolve_multiword_shift): New functions.
> (decompose_multiword_subregs): Use the functions above to decompose
> multiword shifts.
>
>
> 2007-08-02 Andreas Krebbel <krebbel1@de.ibm.com>
>
> * gcc.dg/multiword-shifts.c: New testcase.
> + /* Decompose the word wide shift (in INSN) of a multiword pseudo into
> + if (resolve_reg_p (SET_DEST (set)))
> + {
> + gcc_assert (GET_CODE (SET_DEST (set)) == CONCATN);
> +
> + dest_reg = XVECEXP (SET_DEST (set), 0, 1 - src_reg_num);
> + dest_zero = XVECEXP (SET_DEST (set), 0, src_reg_num);
> + }
> + else
> + {
> + dest_reg = gen_rtx_SUBREG (word_mode, SET_DEST (set), offset1);
> + dest_zero = gen_rtx_SUBREG (word_mode, SET_DEST (set), offset2);
> + }
> +
> + if (resolve_reg_p (shift_operand))
> + {
> + gcc_assert (GET_CODE (shift_operand) == CONCATN);
> +
> + src_reg = XVECEXP (shift_operand, 0, src_reg_num);
> + }
> + else
> + src_reg = gen_rtx_SUBREG (word_mode, shift_operand, offset2);
I think this should just be
dest_reg = simplify_gen_subreg_concatn (word_mode, SET_DEST (set),
GET_MODE (SET_DEST (dest)),
offset1);
dest_zero = simplify_gen_subreg_concatn (word_mode, SET_DEST (set),
GET_MODE (SET_DEST (dest)),
offset2);
src_reg = simplify_gen_subreg_concatn (word_mode, shift_operand,
GET_MODE (shift_operand),
offset2);
The patch is OK with that change, assuming it still passes bootstrap
and testsuite.
Thanks.
Ian