diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2018-10-23 11:33:38 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2018-10-23 11:33:38 +0000 |
commit | f85ee9f8b40a0c1ac59be572e80527eb14e7a049 (patch) | |
tree | 5601c81a75c7cee5a24660430ec83c400457ef33 /llvm/lib/Target/X86/Utils/X86ShuffleDecode.h | |
parent | c29dbbdb1001063d79770eba4076a238eff1f1cd (diff) | |
download | bcm5719-llvm-f85ee9f8b40a0c1ac59be572e80527eb14e7a049.tar.gz bcm5719-llvm-f85ee9f8b40a0c1ac59be572e80527eb14e7a049.zip |
[X86][SSE] Update raw mask shuffle decoders to handle UNDEF mask elts
Matches the approach taken in the constant pool shuffle decoders, and uses an UndefElts mask instead of uint64_t(-1) raw mask values, which doesn't work safely for i32/i64 shuffle mask sizes (as the -1 value is legal).
This allows us to remove the constant pool shuffle decoders from most of the getTargetShuffleMask variable shuffle cases (X86ISD::VPERMV3 will be handled in a future commit).
llvm-svn: 345018
Diffstat (limited to 'llvm/lib/Target/X86/Utils/X86ShuffleDecode.h')
-rw-r--r-- | llvm/lib/Target/X86/Utils/X86ShuffleDecode.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/llvm/lib/Target/X86/Utils/X86ShuffleDecode.h b/llvm/lib/Target/X86/Utils/X86ShuffleDecode.h index 6d13bd58a12..85cde14a324 100644 --- a/llvm/lib/Target/X86/Utils/X86ShuffleDecode.h +++ b/llvm/lib/Target/X86/Utils/X86ShuffleDecode.h @@ -15,6 +15,7 @@ #ifndef LLVM_LIB_TARGET_X86_UTILS_X86SHUFFLEDECODE_H #define LLVM_LIB_TARGET_X86_UTILS_X86SHUFFLEDECODE_H +#include "llvm/ADT/APInt.h" #include "llvm/ADT/SmallVector.h" //===----------------------------------------------------------------------===// @@ -108,7 +109,7 @@ void DecodeSubVectorBroadcast(unsigned DstNumElts, unsigned SrcNumElts, /// Decode a PSHUFB mask from a raw array of constants such as from /// BUILD_VECTOR. -void DecodePSHUFBMask(ArrayRef<uint64_t> RawMask, +void DecodePSHUFBMask(ArrayRef<uint64_t> RawMask, const APInt &UndefElts, SmallVectorImpl<int> &ShuffleMask); /// Decode a BLEND immediate mask into a shuffle mask. @@ -131,7 +132,7 @@ void DecodeVPERMMask(unsigned NumElts, unsigned Imm, /// BUILD_VECTOR. /// This can only basic masks (permutes + zeros), not any of the other /// operations that VPPERM can perform. -void DecodeVPPERMMask(ArrayRef<uint64_t> RawMask, +void DecodeVPPERMMask(ArrayRef<uint64_t> RawMask, const APInt &UndefElts, SmallVectorImpl<int> &ShuffleMask); /// Decode a zero extension instruction as a shuffle mask. @@ -156,20 +157,20 @@ void DecodeINSERTQIMask(unsigned NumElts, unsigned EltSize, int Len, int Idx, /// Decode a VPERMILPD/VPERMILPS variable mask from a raw array of constants. void DecodeVPERMILPMask(unsigned NumElts, unsigned ScalarBits, - ArrayRef<uint64_t> RawMask, + ArrayRef<uint64_t> RawMask, const APInt &UndefElts, SmallVectorImpl<int> &ShuffleMask); /// Decode a VPERMIL2PD/VPERMIL2PS variable mask from a raw array of constants. void DecodeVPERMIL2PMask(unsigned NumElts, unsigned ScalarBits, unsigned M2Z, - ArrayRef<uint64_t> RawMask, + ArrayRef<uint64_t> RawMask, const APInt &UndefElts, SmallVectorImpl<int> &ShuffleMask); /// Decode a VPERM W/D/Q/PS/PD mask from a raw array of constants. -void DecodeVPERMVMask(ArrayRef<uint64_t> RawMask, +void DecodeVPERMVMask(ArrayRef<uint64_t> RawMask, const APInt &UndefElts, SmallVectorImpl<int> &ShuffleMask); /// Decode a VPERMT2 W/D/Q/PS/PD mask from a raw array of constants. -void DecodeVPERMV3Mask(ArrayRef<uint64_t> RawMask, +void DecodeVPERMV3Mask(ArrayRef<uint64_t> RawMask, const APInt &UndefElts, SmallVectorImpl<int> &ShuffleMask); } // llvm namespace |