summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/Utils
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/X86/Utils')
-rw-r--r--llvm/lib/Target/X86/Utils/X86ShuffleDecode.cpp7
-rw-r--r--llvm/lib/Target/X86/Utils/X86ShuffleDecode.h3
2 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/Utils/X86ShuffleDecode.cpp b/llvm/lib/Target/X86/Utils/X86ShuffleDecode.cpp
index 863da74efbc..5da63bef4d7 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) {
diff --git a/llvm/lib/Target/X86/Utils/X86ShuffleDecode.h b/llvm/lib/Target/X86/Utils/X86ShuffleDecode.h
index 51ebe86259a..911e7047ee6 100644
--- a/llvm/lib/Target/X86/Utils/X86ShuffleDecode.h
+++ b/llvm/lib/Target/X86/Utils/X86ShuffleDecode.h
@@ -70,6 +70,9 @@ void DecodePSHUFBMask(const ConstantDataSequential *C,
void DecodePSHUFBMask(ArrayRef<uint64_t> RawMask,
SmallVectorImpl<int> &ShuffleMask);
+/// \brief Decode a BLEND immediate mask into a shuffle mask.
+void DecodeBLENDMask(MVT VT, unsigned Imm, SmallVectorImpl<int> &ShuffleMask);
+
void DecodeVPERM2X128Mask(MVT VT, unsigned Imm,
SmallVectorImpl<int> &ShuffleMask);
OpenPOWER on IntegriCloud