| Craig Topper | 69653af | 2015-12-31 22:40:45 +0000 | [diff] [blame] | 1 | //===-- X86ShuffleDecodeConstantPool.h - X86 shuffle decode -----*-C++-*---===// |
| 2 | // |
| Chandler Carruth | 2946cd7 | 2019-01-19 08:50:56 +0000 | [diff] [blame] | 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| Craig Topper | 69653af | 2015-12-31 22:40:45 +0000 | [diff] [blame] | 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | // |
| 9 | // Define several functions to decode x86 specific shuffle semantics using |
| 10 | // constants from the constant pool. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef LLVM_LIB_TARGET_X86_X86SHUFFLEDECODECONSTANTPOOL_H |
| 15 | #define LLVM_LIB_TARGET_X86_X86SHUFFLEDECODECONSTANTPOOL_H |
| 16 | |
| 17 | #include "llvm/ADT/SmallVector.h" |
| 18 | |
| 19 | //===----------------------------------------------------------------------===// |
| 20 | // Vector Mask Decoding |
| 21 | //===----------------------------------------------------------------------===// |
| 22 | |
| 23 | namespace llvm { |
| 24 | class Constant; |
| 25 | class MVT; |
| 26 | |
| Simon Pilgrim | 4761703 | 2016-04-08 14:17:07 +0000 | [diff] [blame] | 27 | /// Decode a PSHUFB mask from an IR-level vector constant. |
| Craig Topper | c8e183f | 2018-10-22 22:14:05 +0000 | [diff] [blame] | 28 | void DecodePSHUFBMask(const Constant *C, unsigned Width, |
| 29 | SmallVectorImpl<int> &ShuffleMask); |
| Craig Topper | 69653af | 2015-12-31 22:40:45 +0000 | [diff] [blame] | 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 | c8e183f | 2018-10-22 22:14:05 +0000 | [diff] [blame] | 32 | void DecodeVPERMILPMask(const Constant *C, unsigned ElSize, unsigned Width, |
| Craig Topper | 69653af | 2015-12-31 22:40:45 +0000 | [diff] [blame] | 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, |
| Craig Topper | c8e183f | 2018-10-22 22:14:05 +0000 | [diff] [blame] | 37 | unsigned Width, |
| Simon Pilgrim | 2ead861 | 2016-06-04 21:44:28 +0000 | [diff] [blame] | 38 | SmallVectorImpl<int> &ShuffleMask); |
| 39 | |
| Simon Pilgrim | 1cc5712 | 2016-04-09 14:51:26 +0000 | [diff] [blame] | 40 | /// Decode a VPPERM variable mask from an IR-level vector constant. |
| Craig Topper | c8e183f | 2018-10-22 22:14:05 +0000 | [diff] [blame] | 41 | void DecodeVPPERMMask(const Constant *C, unsigned Width, |
| 42 | SmallVectorImpl<int> &ShuffleMask); |
| Simon Pilgrim | 1cc5712 | 2016-04-09 14:51:26 +0000 | [diff] [blame] | 43 | |
| Simon Pilgrim | 4761703 | 2016-04-08 14:17:07 +0000 | [diff] [blame] | 44 | /// Decode a VPERM W/D/Q/PS/PD mask from an IR-level vector constant. |
| Craig Topper | c8e183f | 2018-10-22 22:14:05 +0000 | [diff] [blame] | 45 | void DecodeVPERMVMask(const Constant *C, unsigned ElSize, unsigned Width, |
| Craig Topper | 69653af | 2015-12-31 22:40:45 +0000 | [diff] [blame] | 46 | SmallVectorImpl<int> &ShuffleMask); |
| 47 | |
| Simon Pilgrim | 4761703 | 2016-04-08 14:17:07 +0000 | [diff] [blame] | 48 | /// Decode a VPERMT2 W/D/Q/PS/PD mask from an IR-level vector constant. |
| Craig Topper | c8e183f | 2018-10-22 22:14:05 +0000 | [diff] [blame] | 49 | void DecodeVPERMV3Mask(const Constant *C, unsigned ElSize, unsigned Width, |
| Craig Topper | 69653af | 2015-12-31 22:40:45 +0000 | [diff] [blame] | 50 | SmallVectorImpl<int> &ShuffleMask); |
| 51 | |
| 52 | } // llvm namespace |
| 53 | |
| 54 | #endif |