This is the mail archive of the gcc@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: Gimple vs ternary operations?


On Tue, Jun 22, 2010 at 11:34:30AM +0200, Richard Guenther wrote:
> On Mon, Jun 21, 2010 at 5:25 PM, Bernd Schmidt <bernds@codesourcery.com> wrote:
> > In PR43902, Jim has posted a patch to add support for widening
> > multiply-accumulate to tree-ssa-math-opts. ?They are represented as a
> > GIMPLE_SINGLE_RHS with a WIDEN_MULT_PLUS_EXPR tree which holds the
> > actual operands of the multiply-accumulate. ?I've modified this a bit so
> > that we now support gimple statements with a GIMPLE_TERNARY_RHS class
> > (see the other patch I've added to the PR), but while testing I found
> > that we already create DOT_PROD_EXPRs, which are also three-operand
> > expressions, with the same GIMPLE_SINGLE_RHS representation used by
> > Jim's patch.
> >
> > What's actually intended here? ?Should we add real support for
> > three-operand gimple statements and change the code that generates
> > DOT_PROD_EXPR, or should we add WIDEN_MULT_{PLUS,MINUS}_EXPR in the same
> > way DOT_PROD_EXPR is handled at the moment?
> 
> We should add support for a GIMPLE_TERNARY_RHS class.

It hasn't been added before because ternary ops were considered rare
(primarily just COND_EXPR).  If they are no longer so rare that it is worth
adding handling of GIMPLE_TERNARY_RHS on all spots that need adjusting
because of it, let's change it.

	Jakub


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