On Thu, Apr 16, 2020 at 12:45:46PM -0400, Michael Meissner wrote:
> > > +      /* Mask the element to make sure the element number is between 0 
> > > and the
> > > +  maximum number of elements - 1 so that we don't generate an address
> > > +  outside the vector.  */
> > 
> > Hrm, so why do you need to do this here?  It is part of the semantics of
> > vec_extract, so shouldn't the RTL already have this masking somewhere
> > when we get here?
> 
> Yes, as we discussed when it went into the master branch, the PowerPC
> vec_extract built-in function explicitly requires the masking, rather than it
> being undefined.  Currently, the masking is not done when the built-in is
> created, but only when it is split into the smaller insns.

That is very fragile.  Can that not be fixed?

> What makes this more complicated that normal is that while we have VEC_SELECT
> for the case where the index is constant, VEC_SELECT does not work for a
> variable index.

But it could, RTL supports that just fine.


Segher

Reply via email to