diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2014-08-15 11:01:37 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2014-08-15 11:01:37 +0000 |
commit | 0288620f67a74e67604776c5257c0481c07be7c5 (patch) | |
tree | 24734791401f78b493593785f46438fd17cf2306 /llvm/lib/Target/X86/Utils/X86ShuffleDecode.cpp | |
parent | ee843ef0fa305bc2451a7e8c9b962b64108fc348 (diff) | |
download | llvm-0288620f67a74e67604776c5257c0481c07be7c5.zip llvm-0288620f67a74e67604776c5257c0481c07be7c5.tar.gz llvm-0288620f67a74e67604776c5257c0481c07be7c5.tar.bz2 |
[x86] Teach the instruction printer to decode immediate operands to
BLENDPS, BLENDPD, and PBLENDW instructions into pretty shuffle comments.
These will be used in my next commit as part of test cases for AVX
shuffles which can directly use blend in more places.
llvm-svn: 215701
Diffstat (limited to 'llvm/lib/Target/X86/Utils/X86ShuffleDecode.cpp')
-rw-r--r-- | llvm/lib/Target/X86/Utils/X86ShuffleDecode.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/Utils/X86ShuffleDecode.cpp b/llvm/lib/Target/X86/Utils/X86ShuffleDecode.cpp index 863da74..5da63be 100644 --- a/llvm/lib/Target/X86/Utils/X86ShuffleDecode.cpp +++ b/llvm/lib/Target/X86/Utils/X86ShuffleDecode.cpp @@ -258,6 +258,13 @@ void DecodePSHUFBMask(ArrayRef<uint64_t> RawMask, } } +void DecodeBLENDMask(MVT VT, unsigned Imm, + SmallVectorImpl<int> &ShuffleMask) { + int NumElements = VT.getVectorNumElements(); + for (int i = 0; i < NumElements; ++i) + ShuffleMask.push_back(((Imm >> i) & 1) ? NumElements + i : 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) { |