[PATCH] D17041: [X86] Don't assume that a shuffle operand is #0: it isn't for VPERMV.

Elena Demikhovsky via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 28 00:08:20 PST 2016


delena added a comment.

> Ping of sorts: Elena, all, how do you think we should fix this: swap the VPERMV operands, or change all of our code to stop assuming the mask is the last operand (this patch)? I don't do much AVX512, so I'm not comfortable making that decision.


In my opinion, the mask op should not be always the last. I don't think that you need to swap  VPERMV operands. As far as AVX-512 - the form is the same: 
vpermd %vec_op, %mask_op, %vec_res.

I'll say you more - in AVX-512 we have two forms of 3-src shuffles:
VPERMT2D zmm1 {k1}{z}, zmm2, zmm3/m512/m32bcst Permute double-words from two tables in zmm3/m512/m32bcst and zmm1 using indices in zmm2 and store the result in zmm1 using writemask k1

VPERMI2D zmm1 {k1}{z}, zmm2, zmm3/m512/m32bcst Permute double-words from two tables in zmm3/m512/m32bcst and zmm2 using indices in zmm1 and store the result in zmm1 using writemask k1.

So, it's ok that the mask is not last in SDNode.


http://reviews.llvm.org/D17041





More information about the llvm-commits mailing list