17 Commits

Author SHA1 Message Date
Simon Pilgrim
a6fc694e85 Use APInt::isAllOnesValue instead of popcnt. NFCI.
More obvious implementation and faster too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284937 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-23 15:09:44 +00:00
Craig Topper
63ae3007f1 [X86] Fix DecodeVPERMVMask to handle cases where the constant pool entry has a different type than the shuffle itself.
This is especially important for 32-bit targets with 64-bit shuffle elements.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284453 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-18 04:48:33 +00:00
Craig Topper
a97a64ce70 [AVX-512] Fix DecodeVPERMV3Mask to handle cases where the constant pool entry has a different type than the shuffle itself.
Summary: This is especially important for 32-bit targets with 64-bit shuffle elements.This is similar to how PSHUFB and VPERMIL handle the same problem.

Reviewers: RKSimon

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D25666

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284451 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-18 04:00:32 +00:00
Simon Pilgrim
ec8ee2ad55 [X86][SSE] Cleaned up shuffle decode assertion messages
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283050 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-01 20:12:56 +00:00
Douglas Katzman
9ef51728b6 [X86] Avoid "unused" warnings if no asserts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282732 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-29 17:26:12 +00:00
Simon Pilgrim
8f1cd7aac1 [X86][SSE] Added common helper for shuffle mask constant pool decodes.
The shuffle mask decodes have a large amount of repeated code extracting/splitting mask values from Constant data.

This patch pulls all of this duplicated code into a single helper function to identify undef elements and combine/split constant integer data into the requested shuffle mask elements.

Updated PSHUFB/VPERMIL/VPERMIL2/VPPERM decoders to use it (VPERMV/VPERMV3 could be converted as well in the future).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282720 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-29 15:25:48 +00:00
Simon Pilgrim
c0ce5801a7 [X86][AVX] Add support for target shuffle combining to VPERMILPS variable shuffle mask
Added AVX512F VPERMILPS shuffle decoding support

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275270 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-13 15:10:43 +00:00
Simon Pilgrim
319708c881 [X86][AVX512] Fixed decoding of permd/permpd variable mask shuffles + enabled them for target shuffle combining
Corrected element mask masking to extract the bottom index bits (now matches the perm2 implementation but for unary inputs).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274571 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-05 18:31:17 +00:00
Chandler Carruth
bb0eb61dd0 Try a bit harder to remove the signed and unsigned comparison warning.
Hopefully this time it actually works and stays away.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272463 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-11 09:13:00 +00:00
Chandler Carruth
3e01c6e81f Compare to an unsigned literal to avoid a -Wsign-compare warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272459 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-11 08:02:01 +00:00
Simon Pilgrim
b8b77a8df5 [X86][XOP] Tidied up DecodeVPERMIL2PMask to more closely match DecodeVPERMILPMask.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271830 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-05 14:33:43 +00:00
Simon Pilgrim
b6dac61a73 [X86][XOP] Added VPERMIL2PD/VPERMIL2PS shuffle mask comment decoding
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271809 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-04 21:44:28 +00:00
Simon Pilgrim
c710179bcb [X86][XOP] Support for VPPERM 2-input shuffle mask decoding
This patch adds support for decoding XOP VPPERM instruction when it represents a basic shuffle.

The mask decoding required the existing MCInstrLowering code to be updated to support binary shuffles - the implementation now matches what is done in X86InstrComments.cpp.

Differential Revision: http://reviews.llvm.org/D18441

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265874 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-09 14:51:26 +00:00
Simon Pilgrim
0c5336e71f [X86][AVX512] Fixed VPERMT2* shuffle mask decoding and enabled target shuffle combining.
Patch to add support for target shuffle combining of X86ISD::VPERMV3 nodes, including support for detecting unary shuffles.

This uncovered several issues with the X86ISD::VPERMV3 shuffle mask decoding of non-64 bit shuffle mask elements - the bit masking wasn't being correctly computed.

Removed non-constant pool mask decode path as we have no way of testing it right now.

Differential Revision: http://reviews.llvm.org/D17916

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262809 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-06 21:54:52 +00:00
Simon Pilgrim
dd18dd4735 Fix spelling. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262078 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-26 21:56:27 +00:00
Simon Pilgrim
764196a8c8 [X86][SSE] Improve PSHUFB shuffle mask decoding.
In cases where the PSHUFB shuffle mask is shared it might not be bitcasted to a vXi8 byte vector. This patch adds support for decoding these wider shuffle masks from the ConstantPool.

The test case in question makes use of this to recognise the shuffle mask is an unary UNPCKL pattern and simplifies accordingly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261201 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-18 10:17:40 +00:00
Craig Topper
8cb3fe2069 [X86] Move shuffle decoding for constant pool into the X86CodeGen library to remove a layering violation in the Util library.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256680 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-31 22:40:45 +00:00