https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99785

--- Comment #19 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #18)
> Also, __builtin_shufflevector allows to say -1 as a don't care element, our
> current infrastructure doesn't allow that, but it would be nice even for
> internal uses.  On the other side, I think __builtin_shufflevector allows
> only constant indices, while __builtin_shuffle allows arbitrary runtime
> reshuffling.

Yes, I think they complement each other.  The question would be whether we'd
want to represent both with VEC_PERM_EXPR on GIMPLE.  And how to present the
more flexible cases to the RTL expander and targets.  const permutes seem
to be handled via the vec_perm_const target hook and not the vec_perm
optab, so a possibility would be to create a new hook with relaxed mode
requirements - either by passing in three modes or some dummy RTXen.

OTOH it should be possible to handle some cases purely in the expander
by using paradoxical subregs when sources are of smaller size.  With
larger size sources the -1 would come in handy allowing for larger
results and subregging them.

Reply via email to