LLVM  8.0.1
X86ShuffleDecodeConstantPool.h
Go to the documentation of this file.
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 
28 /// Decode a PSHUFB mask from an IR-level vector constant.
29 void DecodePSHUFBMask(const Constant *C, unsigned Width,
30  SmallVectorImpl<int> &ShuffleMask);
31 
32 /// Decode a VPERMILP variable mask from an IR-level vector constant.
33 void DecodeVPERMILPMask(const Constant *C, unsigned ElSize, unsigned Width,
34  SmallVectorImpl<int> &ShuffleMask);
35 
36 /// Decode a VPERMILP2 variable mask from an IR-level vector constant.
37 void DecodeVPERMIL2PMask(const Constant *C, unsigned MatchImm, unsigned ElSize,
38  unsigned Width,
39  SmallVectorImpl<int> &ShuffleMask);
40 
41 /// Decode a VPPERM variable mask from an IR-level vector constant.
42 void DecodeVPPERMMask(const Constant *C, unsigned Width,
43  SmallVectorImpl<int> &ShuffleMask);
44 
45 /// Decode a VPERM W/D/Q/PS/PD mask from an IR-level vector constant.
46 void DecodeVPERMVMask(const Constant *C, unsigned ElSize, unsigned Width,
47  SmallVectorImpl<int> &ShuffleMask);
48 
49 /// Decode a VPERMT2 W/D/Q/PS/PD mask from an IR-level vector constant.
50 void DecodeVPERMV3Mask(const Constant *C, unsigned ElSize, unsigned Width,
51  SmallVectorImpl<int> &ShuffleMask);
52 
53 } // llvm namespace
54 
55 #endif
uint64_t CallInst * C
This class represents lattice values for constants.
Definition: AllocatorList.h:24
void DecodeVPPERMMask(ArrayRef< uint64_t > RawMask, const APInt &UndefElts, SmallVectorImpl< int > &ShuffleMask)
Decode a VPPERM mask from a raw array of constants such as from BUILD_VECTOR.
void DecodeVPERMV3Mask(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 DecodeVPERMILPMask(unsigned NumElts, unsigned ScalarBits, ArrayRef< uint64_t > RawMask, const APInt &UndefElts, SmallVectorImpl< int > &ShuffleMask)
Decode a VPERMILPD/VPERMILPS variable mask from a raw array of constants.
void DecodeVPERMIL2PMask(unsigned NumElts, unsigned ScalarBits, unsigned M2Z, ArrayRef< uint64_t > RawMask, const APInt &UndefElts, SmallVectorImpl< int > &ShuffleMask)
Decode a VPERMIL2PD/VPERMIL2PS variable mask from a raw array of constants.
void DecodeVPERMVMask(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 DecodePSHUFBMask(ArrayRef< uint64_t > RawMask, const APInt &UndefElts, SmallVectorImpl< int > &ShuffleMask)
Decode a PSHUFB mask from a raw array of constants such as from BUILD_VECTOR.