This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Improve pattern recognizer for division by constant (PR tree-optimization/51581)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 19 Jun 2012 07:46:50 +0200
- Subject: Re: [PATCH] Improve pattern recognizer for division by constant (PR tree-optimization/51581)
- References: <20120614205851.GF24904@tucnak.redhat.com> <4FDFBD55.4030909@redhat.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Mon, Jun 18, 2012 at 04:44:21PM -0700, Richard Henderson wrote:
> On 2012-06-14 13:58, Jakub Jelinek wrote:
> > + if (!supportable_widening_operation (WIDEN_MULT_EXPR, last_stmt,
> > + vecwtype, vectype,
> > + &dummy, &dummy, &dummy_code,
> > + &dummy_code, &dummy_int, &dummy_vec))
> > + return NULL;
>
>
> It would be nice to be able to handle high-part multiplies as well, e.g.
> VEC_WIDEN_MULT_HI_EXPR. Which is what Altivec provides, and not VEC_WIDEN_MULT.
Sure, but we don't have a tree code for that right now, do we?
VEC_WIDEN_MULT_HI_EXPR is just one half of the widened multiply results,
not all the high halves of the widened multiply.
For 16-bit multiplication we could also use {,V}PMULH{,U}W
(for 32-bit multiplication we use two {,V}PMUL{,U}DQ plus shifts afterwards).
Jakub