Craig Topper | 69653af | 2015-12-31 22:40:45 +0000 | [diff] [blame] | 1 | //===-- X86ShuffleDecodeConstantPool.h - X86 shuffle decode -----*-C++-*---===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // Define several functions to decode x86 specific shuffle semantics using |
| 11 | // constants from the constant pool. |
| 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
| 15 | #ifndef LLVM_LIB_TARGET_X86_X86SHUFFLEDECODECONSTANTPOOL_H |
| 16 | #define LLVM_LIB_TARGET_X86_X86SHUFFLEDECODECONSTANTPOOL_H |
| 17 | |
| 18 | #include "llvm/ADT/SmallVector.h" |
| 19 | |
| 20 | //===----------------------------------------------------------------------===// |
| 21 | // Vector Mask Decoding |
| 22 | //===----------------------------------------------------------------------===// |
| 23 | |
| 24 | namespace llvm { |
| 25 | class Constant; |
| 26 | class MVT; |
| 27 | |
Simon Pilgrim | 4761703 | 2016-04-08 14:17:07 +0000 | [diff] [blame] | 28 | /// Decode a PSHUFB mask from an IR-level vector constant. |
Craig Topper | 69653af | 2015-12-31 22:40:45 +0000 | [diff] [blame] | 29 | void DecodePSHUFBMask(const Constant *C, SmallVectorImpl<int> &ShuffleMask); |
| 30 | |
Simon Pilgrim | 4761703 | 2016-04-08 14:17:07 +0000 | [diff] [blame] | 31 | /// Decode a VPERMILP variable mask from an IR-level vector constant. |
Craig Topper | 69653af | 2015-12-31 22:40:45 +0000 | [diff] [blame] | 32 | void DecodeVPERMILPMask(const Constant *C, unsigned ElSize, |
| 33 | SmallVectorImpl<int> &ShuffleMask); |
| 34 | |
Simon Pilgrim | 2ead861 | 2016-06-04 21:44:28 +0000 | [diff] [blame] | 35 | /// Decode a VPERMILP2 variable mask from an IR-level vector constant. |
| 36 | void DecodeVPERMIL2PMask(const Constant *C, unsigned MatchImm, unsigned ElSize, |
| 37 | SmallVectorImpl<int> &ShuffleMask); |
| 38 | |
Simon Pilgrim | 1cc5712 | 2016-04-09 14:51:26 +0000 | [diff] [blame] | 39 | /// Decode a VPPERM variable mask from an IR-level vector constant. |
| 40 | void DecodeVPPERMMask(const Constant *C, SmallVectorImpl<int> &ShuffleMask); |
| 41 | |
Simon Pilgrim | 4761703 | 2016-04-08 14:17:07 +0000 | [diff] [blame] | 42 | /// Decode a VPERM W/D/Q/PS/PD mask from an IR-level vector constant. |
Craig Topper | 69653af | 2015-12-31 22:40:45 +0000 | [diff] [blame] | 43 | void DecodeVPERMVMask(const Constant *C, MVT VT, |
| 44 | SmallVectorImpl<int> &ShuffleMask); |
| 45 | |
Simon Pilgrim | 4761703 | 2016-04-08 14:17:07 +0000 | [diff] [blame] | 46 | /// Decode a VPERMT2 W/D/Q/PS/PD mask from an IR-level vector constant. |
Craig Topper | 7268bf9 | 2016-10-18 04:00:32 +0000 | [diff] [blame^] | 47 | void DecodeVPERMV3Mask(const Constant *C, unsigned ElSize, |
Craig Topper | 69653af | 2015-12-31 22:40:45 +0000 | [diff] [blame] | 48 | SmallVectorImpl<int> &ShuffleMask); |
| 49 | |
| 50 | } // llvm namespace |
| 51 | |
| 52 | #endif |