diff options
author | Craig Topper <craig.topper@gmail.com> | 2012-05-06 18:44:02 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2012-05-06 18:44:02 +0000 |
commit | 156f5bb56e2730013fcddf90e8cad0e5e3ee1928 (patch) | |
tree | 9a6cc5ede95f17066f144210a47f773eb2db4b02 /lib/Target/X86/Utils | |
parent | 8e27c9615938298bd03a7884964a0f5e0e80542d (diff) | |
download | external_llvm-156f5bb56e2730013fcddf90e8cad0e5e3ee1928.zip external_llvm-156f5bb56e2730013fcddf90e8cad0e5e3ee1928.tar.gz external_llvm-156f5bb56e2730013fcddf90e8cad0e5e3ee1928.tar.bz2 |
Add shuffle decode support for VPERMQ/VPERMPD.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156265 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/Utils')
-rw-r--r-- | lib/Target/X86/Utils/X86ShuffleDecode.cpp | 8 | ||||
-rw-r--r-- | lib/Target/X86/Utils/X86ShuffleDecode.h | 4 |
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/Target/X86/Utils/X86ShuffleDecode.cpp b/lib/Target/X86/Utils/X86ShuffleDecode.cpp index f0d9467..69d9439 100644 --- a/lib/Target/X86/Utils/X86ShuffleDecode.cpp +++ b/lib/Target/X86/Utils/X86ShuffleDecode.cpp @@ -192,4 +192,12 @@ void DecodeVPERM2X128Mask(EVT VT, unsigned Imm, ShuffleMask.push_back(i); } +/// DecodeVPERMMask - this decodes the shuffle masks for VPERMQ/VPERMPD. +/// No VT provided since it only works on 256-bit, 4 element vectors. +void DecodeVPERMMask(unsigned Imm, SmallVectorImpl<int> &ShuffleMask) { + for (unsigned i = 0; i != 4; ++i) { + ShuffleMask.push_back((Imm >> (2*i)) & 3); + } +} + } // llvm namespace diff --git a/lib/Target/X86/Utils/X86ShuffleDecode.h b/lib/Target/X86/Utils/X86ShuffleDecode.h index 14545e7..a039b70 100644 --- a/lib/Target/X86/Utils/X86ShuffleDecode.h +++ b/lib/Target/X86/Utils/X86ShuffleDecode.h @@ -60,6 +60,10 @@ void DecodeUNPCKLMask(EVT VT, SmallVectorImpl<int> &ShuffleMask); void DecodeVPERM2X128Mask(EVT VT, unsigned Imm, SmallVectorImpl<int> &ShuffleMask); +/// DecodeVPERMMask - this decodes the shuffle masks for VPERMQ/VPERMPD. +/// No VT provided since it only works on 256-bit, 4 element vectors. +void DecodeVPERMMask(unsigned Imm, SmallVectorImpl<int> &ShuffleMask); + } // llvm namespace #endif |