xref: /freebsd/contrib/llvm-project/llvm/lib/Target/X86/X86ShuffleDecodeConstantPool.h (revision e8d8bef961a50d4dc22501cde4fb9fb0be1b2532)
10b57cec5SDimitry Andric //===-- X86ShuffleDecodeConstantPool.h - X86 shuffle decode -----*-C++-*---===//
20b57cec5SDimitry Andric //
30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric //
70b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric //
90b57cec5SDimitry Andric // Define several functions to decode x86 specific shuffle semantics using
100b57cec5SDimitry Andric // constants from the constant pool.
110b57cec5SDimitry Andric //
120b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
130b57cec5SDimitry Andric 
140b57cec5SDimitry Andric #ifndef LLVM_LIB_TARGET_X86_X86SHUFFLEDECODECONSTANTPOOL_H
150b57cec5SDimitry Andric #define LLVM_LIB_TARGET_X86_X86SHUFFLEDECODECONSTANTPOOL_H
160b57cec5SDimitry Andric 
170b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
180b57cec5SDimitry Andric //  Vector Mask Decoding
190b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
200b57cec5SDimitry Andric 
210b57cec5SDimitry Andric namespace llvm {
220b57cec5SDimitry Andric class Constant;
23*5ffd83dbSDimitry Andric template <typename T> class SmallVectorImpl;
240b57cec5SDimitry Andric 
250b57cec5SDimitry Andric /// Decode a PSHUFB mask from an IR-level vector constant.
260b57cec5SDimitry Andric void DecodePSHUFBMask(const Constant *C, unsigned Width,
270b57cec5SDimitry Andric                       SmallVectorImpl<int> &ShuffleMask);
280b57cec5SDimitry Andric 
290b57cec5SDimitry Andric /// Decode a VPERMILP variable mask from an IR-level vector constant.
300b57cec5SDimitry Andric void DecodeVPERMILPMask(const Constant *C, unsigned ElSize, unsigned Width,
310b57cec5SDimitry Andric                         SmallVectorImpl<int> &ShuffleMask);
320b57cec5SDimitry Andric 
330b57cec5SDimitry Andric /// Decode a VPERMILP2 variable mask from an IR-level vector constant.
34*5ffd83dbSDimitry Andric void DecodeVPERMIL2PMask(const Constant *C, unsigned M2Z, unsigned ElSize,
35*5ffd83dbSDimitry Andric                          unsigned Width, SmallVectorImpl<int> &ShuffleMask);
360b57cec5SDimitry Andric 
370b57cec5SDimitry Andric /// Decode a VPPERM variable mask from an IR-level vector constant.
380b57cec5SDimitry Andric void DecodeVPPERMMask(const Constant *C, unsigned Width,
390b57cec5SDimitry Andric                       SmallVectorImpl<int> &ShuffleMask);
400b57cec5SDimitry Andric 
410b57cec5SDimitry Andric } // llvm namespace
420b57cec5SDimitry Andric 
430b57cec5SDimitry Andric #endif
44