[PATCH] D33690: [PowerPC] Match vec_revb builtins to P9 instructions.

Tony Jiang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 31 19:22:23 PDT 2017


jtony added a comment.

In https://reviews.llvm.org/D33690#768479, @nemanjai wrote:

> I am debating internally about suggesting a potential solution for this, but this implementation essentially misses an entire set of complementary shuffle masks. We have a number of instructions that do element-wise reordering and we now have these that do per-element byte reversal. Combining the capabilities covers a lot more shuffles - I am just not positive that these occur enough to warrant the effort.
>
> Here's what I mean:
>
> - We have an instruction that will do a "rotate-left-by-word" operation on a vector (and a way to emit that instructions)
> - We now have a "reverse-bytes-within-word-elements" operation
> - We don't have a "reverse-bytes-within-each-word-and-rotate-left-by-word", which we can simply do with a 2 instruction sequence now
>
>   And of course, the same goes for all other masks we lower to a single instruction. It might be useful for each of them to detect byte-reversal as well. It is non-trivial work, but doesn't sound fundamentally all that hard. Perhaps we should re-design our handling of shuffles at some point and have a robust way to determine what we can lower to a one or two instruction sequence on any Subtarget.


Had a talk with Nemanja, this work should be done as a separate issue.


https://reviews.llvm.org/D33690





More information about the llvm-commits mailing list