[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 12:53:52 PDT 2017


jtony marked 3 inline comments as done.
jtony added inline comments.


================
Comment at: lib/Target/PowerPC/PPCISelLowering.cpp:1768
+
+  for (int i = 0; i < 16; i += Width) {
+    if (N->getMaskElt(i) != i + Width - 1)
----------------
nemanjai wrote:
> Doesn't it just suffice at this point to ensure that each element of the shuffle mask has a value less than 16?
Just check the value less 16 is not sufficient here. We need to make sure the starting element index of each N Byte element is i + Width - 1. For example, for XXBRW , I expect a mask like this:   shuffleVector(a, undef, 3,2,1,0,7,6,5,4, 11,10,9,8,15,14,13,12)
We  check getElt(0)=3, getElt(4)=7, getElt(8)=11, getElt(12)=15
i.e. N->getMaskElt(i) != i + Width - 1, here Width == 4


https://reviews.llvm.org/D33690





More information about the llvm-commits mailing list