On Wed, Jun 03, 2020 at 07:23:47PM +0200, Richard Biener wrote:
> >>   mask = vec_cmp of the comparison
> >>   true_masked = true_op & mask;
> >>   false_masked = false_op & ~mask;
> >>   result = true_masked | false_masked;
> >> 
> >> but I believe this would be dead code never triggered.
> >
> >But that would be the generic code as well?  Is that not useful to have
> >in any case?
> 
> Sure. If you remove the vcond patterns from your port the vectorizer will do 
> this transparently for you. So if you do not actually have a more clever way 
> of representing this in the ISA there's no point of the vcond patterns. 
> (though I think the vec_cmp ones didn't originally exist) 

So why can the expander not just do that whenever the patterns FAIL as
well?

> The point is the vectorizer relies on a optab query for querying backend 
> support and power claims vcond support here. If you then FAIL you have lied. 
> (not in your interpretation of the pattern docs but in the implementations 
> since introduction of vcond named patterns) 

Almost all RTL patterns are allowed to FAIL, and that is a very good
thing.  If the vectoriser does not allow that, *it* is buggy.

> So if you're happy I'll document explicitly that vector named patterns may 
> not FAIL. 

That will not work in general at all, no.  Please document it for only
those RTL patterns you need it for (and it is documented per pattern
currently, anyway).


Segher

Reply via email to