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