1*0b57cec5SDimitry Andric //===-- X86ShuffleDecodeConstantPool.h - X86 shuffle decode -----*-C++-*---===// 2*0b57cec5SDimitry Andric // 3*0b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4*0b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 5*0b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6*0b57cec5SDimitry Andric // 7*0b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 8*0b57cec5SDimitry Andric // 9*0b57cec5SDimitry Andric // Define several functions to decode x86 specific shuffle semantics using 10*0b57cec5SDimitry Andric // constants from the constant pool. 11*0b57cec5SDimitry Andric // 12*0b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 13*0b57cec5SDimitry Andric 14*0b57cec5SDimitry Andric #ifndef LLVM_LIB_TARGET_X86_X86SHUFFLEDECODECONSTANTPOOL_H 15*0b57cec5SDimitry Andric #define LLVM_LIB_TARGET_X86_X86SHUFFLEDECODECONSTANTPOOL_H 16*0b57cec5SDimitry Andric 17*0b57cec5SDimitry Andric #include "llvm/ADT/SmallVector.h" 18*0b57cec5SDimitry Andric 19*0b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 20*0b57cec5SDimitry Andric // Vector Mask Decoding 21*0b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 22*0b57cec5SDimitry Andric 23*0b57cec5SDimitry Andric namespace llvm { 24*0b57cec5SDimitry Andric class Constant; 25*0b57cec5SDimitry Andric class MVT; 26*0b57cec5SDimitry Andric 27*0b57cec5SDimitry Andric /// Decode a PSHUFB mask from an IR-level vector constant. 28*0b57cec5SDimitry Andric void DecodePSHUFBMask(const Constant *C, unsigned Width, 29*0b57cec5SDimitry Andric SmallVectorImpl<int> &ShuffleMask); 30*0b57cec5SDimitry Andric 31*0b57cec5SDimitry Andric /// Decode a VPERMILP variable mask from an IR-level vector constant. 32*0b57cec5SDimitry Andric void DecodeVPERMILPMask(const Constant *C, unsigned ElSize, unsigned Width, 33*0b57cec5SDimitry Andric SmallVectorImpl<int> &ShuffleMask); 34*0b57cec5SDimitry Andric 35*0b57cec5SDimitry Andric /// Decode a VPERMILP2 variable mask from an IR-level vector constant. 36*0b57cec5SDimitry Andric void DecodeVPERMIL2PMask(const Constant *C, unsigned MatchImm, unsigned ElSize, 37*0b57cec5SDimitry Andric unsigned Width, 38*0b57cec5SDimitry Andric SmallVectorImpl<int> &ShuffleMask); 39*0b57cec5SDimitry Andric 40*0b57cec5SDimitry Andric /// Decode a VPPERM variable mask from an IR-level vector constant. 41*0b57cec5SDimitry Andric void DecodeVPPERMMask(const Constant *C, unsigned Width, 42*0b57cec5SDimitry Andric SmallVectorImpl<int> &ShuffleMask); 43*0b57cec5SDimitry Andric 44*0b57cec5SDimitry Andric /// Decode a VPERM W/D/Q/PS/PD mask from an IR-level vector constant. 45*0b57cec5SDimitry Andric void DecodeVPERMVMask(const Constant *C, unsigned ElSize, unsigned Width, 46*0b57cec5SDimitry Andric SmallVectorImpl<int> &ShuffleMask); 47*0b57cec5SDimitry Andric 48*0b57cec5SDimitry Andric /// Decode a VPERMT2 W/D/Q/PS/PD mask from an IR-level vector constant. 49*0b57cec5SDimitry Andric void DecodeVPERMV3Mask(const Constant *C, unsigned ElSize, unsigned Width, 50*0b57cec5SDimitry Andric SmallVectorImpl<int> &ShuffleMask); 51*0b57cec5SDimitry Andric 52*0b57cec5SDimitry Andric } // llvm namespace 53*0b57cec5SDimitry Andric 54*0b57cec5SDimitry Andric #endif 55