OSDN Git Service

[X86][AVX] createVariablePermute - use 2xVPERMIL+PCMPGT+SELECT for v8i32/v8f32 and...
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Sun, 11 Mar 2018 11:52:26 +0000 (11:52 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Sun, 11 Mar 2018 11:52:26 +0000 (11:52 +0000)
commit78049a406dce6ba5b09de031d9126b30f3e1f760
tree5e2eef712bef8e049e70584e36b0f87ac09c860a
parent7e6bfebf859950694d98a721cb322afbf80a3273
[X86][AVX] createVariablePermute - use 2xVPERMIL+PCMPGT+SELECT for v8i32/v8f32 and v4i64/v4f64 variable permutes

As VPERMILPS/VPERMILPD only selects elements based on the bits[1:0]/bit[1] then we can permute both the (repeated) lo/hi 128-bit vectors in each case and then select between these results based on whether the index was for for lo/hi.

For v4i64/v4f64 this avoids some rather nasty v4i64 multiples on the AVX2 implementation, which seems to be worse than the extra port5 pressure from the additional shuffles/blends.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327239 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/var-permute-256.ll