1 //===-- X86ShuffleDecodeConstantPool.h - X86 shuffle decode -----*-C++-*---===//
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
7 //===----------------------------------------------------------------------===//
9 // Define several functions to decode x86 specific shuffle semantics using
10 // constants from the constant pool.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_LIB_TARGET_X86_X86SHUFFLEDECODECONSTANTPOOL_H
15 #define LLVM_LIB_TARGET_X86_X86SHUFFLEDECODECONSTANTPOOL_H
17 #include "llvm/ADT/SmallVector.h"
19 //===----------------------------------------------------------------------===//
20 // Vector Mask Decoding
21 //===----------------------------------------------------------------------===//
27 /// Decode a PSHUFB mask from an IR-level vector constant.
28 void DecodePSHUFBMask(const Constant
*C
, unsigned Width
,
29 SmallVectorImpl
<int> &ShuffleMask
);
31 /// Decode a VPERMILP variable mask from an IR-level vector constant.
32 void DecodeVPERMILPMask(const Constant
*C
, unsigned ElSize
, unsigned Width
,
33 SmallVectorImpl
<int> &ShuffleMask
);
35 /// Decode a VPERMILP2 variable mask from an IR-level vector constant.
36 void DecodeVPERMIL2PMask(const Constant
*C
, unsigned MatchImm
, unsigned ElSize
,
38 SmallVectorImpl
<int> &ShuffleMask
);
40 /// Decode a VPPERM variable mask from an IR-level vector constant.
41 void DecodeVPPERMMask(const Constant
*C
, unsigned Width
,
42 SmallVectorImpl
<int> &ShuffleMask
);
44 /// Decode a VPERM W/D/Q/PS/PD mask from an IR-level vector constant.
45 void DecodeVPERMVMask(const Constant
*C
, unsigned ElSize
, unsigned Width
,
46 SmallVectorImpl
<int> &ShuffleMask
);
48 /// Decode a VPERMT2 W/D/Q/PS/PD mask from an IR-level vector constant.
49 void DecodeVPERMV3Mask(const Constant
*C
, unsigned ElSize
, unsigned Width
,
50 SmallVectorImpl
<int> &ShuffleMask
);