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(unsigned NElts
, 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 void DecodePUNPCKLBWMask(unsigned NElts
,
50 SmallVectorImpl
<unsigned> &ShuffleMask
);
52 void DecodePUNPCKLWDMask(unsigned NElts
,
53 SmallVectorImpl
<unsigned> &ShuffleMask
);
55 void DecodePUNPCKLDQMask(unsigned NElts
,
56 SmallVectorImpl
<unsigned> &ShuffleMask
);
58 void DecodePUNPCKLQDQMask(unsigned NElts
,
59 SmallVectorImpl
<unsigned> &ShuffleMask
);
61 void DecodePUNPCKLMask(EVT VT
,
62 SmallVectorImpl
<unsigned> &ShuffleMask
);
64 void DecodePUNPCKHMask(unsigned NElts
,
65 SmallVectorImpl
<unsigned> &ShuffleMask
);
67 void DecodeSHUFPSMask(unsigned NElts
, unsigned Imm
,
68 SmallVectorImpl
<unsigned> &ShuffleMask
);
70 void DecodeUNPCKHPMask(unsigned NElts
,
71 SmallVectorImpl
<unsigned> &ShuffleMask
);
73 void DecodeUNPCKLPSMask(unsigned NElts
,
74 SmallVectorImpl
<unsigned> &ShuffleMask
);
76 void DecodeUNPCKLPDMask(unsigned NElts
,
77 SmallVectorImpl
<unsigned> &ShuffleMask
);
79 /// DecodeUNPCKLPMask - This decodes the shuffle masks for unpcklps/unpcklpd
80 /// etc. VT indicates the type of the vector allowing it to handle different
81 /// datatypes and vector widths.
82 void DecodeUNPCKLPMask(EVT VT
,
83 SmallVectorImpl
<unsigned> &ShuffleMask
);