1 //===-- X86ShuffleDecode.h - X86 shuffle decode logic -----------*-C++-*---===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // Define several functions to decode x86 specific shuffle semantics into a
11 // generic vector mask.
13 //===----------------------------------------------------------------------===//
15 #ifndef X86_SHUFFLE_DECODE_H
16 #define X86_SHUFFLE_DECODE_H
18 #include "llvm/ADT/SmallVector.h"
19 #include "llvm/CodeGen/ValueTypes.h"
21 //===----------------------------------------------------------------------===//
22 // Vector Mask Decoding
23 //===----------------------------------------------------------------------===//
30 void DecodeINSERTPSMask(unsigned Imm, SmallVectorImpl<unsigned> &ShuffleMask);
33 void DecodeMOVHLPSMask(unsigned NElts,
34 SmallVectorImpl<unsigned> &ShuffleMask);
37 void DecodeMOVLHPSMask(unsigned NElts,
38 SmallVectorImpl<unsigned> &ShuffleMask);
40 void DecodePSHUFMask(EVT VT, unsigned Imm,
41 SmallVectorImpl<unsigned> &ShuffleMask);
43 void DecodePSHUFHWMask(unsigned Imm,
44 SmallVectorImpl<unsigned> &ShuffleMask);
46 void DecodePSHUFLWMask(unsigned Imm,
47 SmallVectorImpl<unsigned> &ShuffleMask);
49 /// DecodeSHUFPMask - This decodes the shuffle masks for shufp*. VT indicates
50 /// the type of the vector allowing it to handle different datatypes and vector
52 void DecodeSHUFPMask(EVT VT, unsigned Imm,
53 SmallVectorImpl<unsigned> &ShuffleMask);
55 /// DecodeUNPCKHMask - This decodes the shuffle masks for unpckhps/unpckhpd
56 /// and punpckh*. VT indicates the type of the vector allowing it to handle
57 /// different datatypes and vector widths.
58 void DecodeUNPCKHMask(EVT VT, SmallVectorImpl<unsigned> &ShuffleMask);
60 /// DecodeUNPCKLMask - This decodes the shuffle masks for unpcklps/unpcklpd
61 /// and punpckl*. VT indicates the type of the vector allowing it to handle
62 /// different datatypes and vector widths.
63 void DecodeUNPCKLMask(EVT VT, SmallVectorImpl<unsigned> &ShuffleMask);
66 void DecodeVPERM2X128Mask(EVT VT, unsigned Imm,
67 SmallVectorImpl<unsigned> &ShuffleMask);