[PATCH] D15477: [X86][AVX] Only shuffle the lower half of vectors if the upper half is undefined

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 17 03:49:32 PST 2015


RKSimon added inline comments.

================
Comment at: lib/Target/X86/X86ISelLowering.cpp:10367
@@ +10366,3 @@
+    int HalfIdx = (M / HalfNumElts);
+    M %= NumElts;
+
----------------
delena wrote:
> Let's assume that the original mask was:
> 0, 1, 3, 3, 8, 8, 10, 11
> You want to take V1-Lo and V2-Lo
> the new mask should be
> 0, 1, 3, 3, 4, 4, 6, 7
> But M %= NumElts will not convert 8 to 4 and 10 to 6.
I think this is for a v816 - then the modulo will create:

0, 1, 3, 3, 0, 0, 2, 3

The lines below then offset the second half vector by halfnumelts:

0, 1, 3, 3, 4, 4, 6, 7


Repository:
  rL LLVM

http://reviews.llvm.org/D15477





More information about the llvm-commits mailing list