This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] lower-subreg: Decompose multiword shifts


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]