blob: 5c999261afb113e2d8bdd68627a899e551f7c3e2 [file] [log] [blame]
NAKAMURA Takumifb3bd712015-05-25 01:43:23 +00001//===-- X86ShuffleDecode.cpp - X86 shuffle decode logic -------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// Define several functions to decode x86 specific shuffle semantics into a
11// generic vector mask.
12//
13//===----------------------------------------------------------------------===//
14
15#include "X86ShuffleDecode.h"
NAKAMURA Takumifb3bd712015-05-25 01:43:23 +000016#include "llvm/CodeGen/MachineValueType.h"
17
18//===----------------------------------------------------------------------===//
19// Vector Mask Decoding
20//===----------------------------------------------------------------------===//
21
22namespace llvm {
23
24void DecodeINSERTPSMask(unsigned Imm, SmallVectorImpl<int> &ShuffleMask) {
25 // Defaults the copying the dest value.
26 ShuffleMask.push_back(0);
27 ShuffleMask.push_back(1);
28 ShuffleMask.push_back(2);
29 ShuffleMask.push_back(3);
30
31 // Decode the immediate.
32 unsigned ZMask = Imm & 15;
33 unsigned CountD = (Imm >> 4) & 3;
34 unsigned CountS = (Imm >> 6) & 3;
35
36 // CountS selects which input element to use.
NAKAMURA Takumi5582a6a2015-05-25 01:43:34 +000037 unsigned InVal = 4 + CountS;
NAKAMURA Takumifb3bd712015-05-25 01:43:23 +000038 // CountD specifies which element of destination to update.
39 ShuffleMask[CountD] = InVal;
40 // ZMask zaps values, potentially overriding the CountD elt.
41 if (ZMask & 1) ShuffleMask[0] = SM_SentinelZero;
42 if (ZMask & 2) ShuffleMask[1] = SM_SentinelZero;
43 if (ZMask & 4) ShuffleMask[2] = SM_SentinelZero;
44 if (ZMask & 8) ShuffleMask[3] = SM_SentinelZero;
45}
46
Simon Pilgrima3d67442016-02-07 15:39:22 +000047void DecodeInsertElementMask(MVT VT, unsigned Idx, unsigned Len,
48 SmallVectorImpl<int> &ShuffleMask) {
49 unsigned NumElts = VT.getVectorNumElements();
50 assert((Idx + Len) <= NumElts && "Insertion out of range");
51
52 for (unsigned i = 0; i != NumElts; ++i)
53 ShuffleMask.push_back(i);
54 for (unsigned i = 0; i != Len; ++i)
55 ShuffleMask[Idx + i] = NumElts + i;
56}
57
NAKAMURA Takumifb3bd712015-05-25 01:43:23 +000058// <3,1> or <6,7,2,3>
59void DecodeMOVHLPSMask(unsigned NElts, SmallVectorImpl<int> &ShuffleMask) {
NAKAMURA Takumi5582a6a2015-05-25 01:43:34 +000060 for (unsigned i = NElts / 2; i != NElts; ++i)
61 ShuffleMask.push_back(NElts + i);
NAKAMURA Takumifb3bd712015-05-25 01:43:23 +000062
NAKAMURA Takumi5582a6a2015-05-25 01:43:34 +000063 for (unsigned i = NElts / 2; i != NElts; ++i)
NAKAMURA Takumifb3bd712015-05-25 01:43:23 +000064 ShuffleMask.push_back(i);
65}
66
67// <0,2> or <0,1,4,5>
68void DecodeMOVLHPSMask(unsigned NElts, SmallVectorImpl<int> &ShuffleMask) {
NAKAMURA Takumi5582a6a2015-05-25 01:43:34 +000069 for (unsigned i = 0; i != NElts / 2; ++i)
NAKAMURA Takumifb3bd712015-05-25 01:43:23 +000070 ShuffleMask.push_back(i);
71
NAKAMURA Takumi5582a6a2015-05-25 01:43:34 +000072 for (unsigned i = 0; i != NElts / 2; ++i)
73 ShuffleMask.push_back(NElts + i);
NAKAMURA Takumifb3bd712015-05-25 01:43:23 +000074}
75
76void DecodeMOVSLDUPMask(MVT VT, SmallVectorImpl<int> &ShuffleMask) {
77 unsigned NumElts = VT.getVectorNumElements();
78 for (int i = 0, e = NumElts / 2; i < e; ++i) {
79 ShuffleMask.push_back(2 * i);
80 ShuffleMask.push_back(2 * i);
81 }
82}
83
84void DecodeMOVSHDUPMask(MVT VT, SmallVectorImpl<int> &ShuffleMask) {
85 unsigned NumElts = VT.getVectorNumElements();
86 for (int i = 0, e = NumElts / 2; i < e; ++i) {
87 ShuffleMask.push_back(2 * i + 1);
88 ShuffleMask.push_back(2 * i + 1);
89 }
90}
91
92void DecodeMOVDDUPMask(MVT VT, SmallVectorImpl<int> &ShuffleMask) {
93 unsigned VectorSizeInBits = VT.getSizeInBits();
94 unsigned ScalarSizeInBits = VT.getScalarSizeInBits();
95 unsigned NumElts = VT.getVectorNumElements();
96 unsigned NumLanes = VectorSizeInBits / 128;
97 unsigned NumLaneElts = NumElts / NumLanes;
98 unsigned NumLaneSubElts = 64 / ScalarSizeInBits;
99
100 for (unsigned l = 0; l < NumElts; l += NumLaneElts)
101 for (unsigned i = 0; i < NumLaneElts; i += NumLaneSubElts)
102 for (unsigned s = 0; s != NumLaneSubElts; s++)
103 ShuffleMask.push_back(l + s);
104}
105
106void DecodePSLLDQMask(MVT VT, unsigned Imm, SmallVectorImpl<int> &ShuffleMask) {
107 unsigned VectorSizeInBits = VT.getSizeInBits();
108 unsigned NumElts = VectorSizeInBits / 8;
109 unsigned NumLanes = VectorSizeInBits / 128;
110 unsigned NumLaneElts = NumElts / NumLanes;
111
112 for (unsigned l = 0; l < NumElts; l += NumLaneElts)
113 for (unsigned i = 0; i < NumLaneElts; ++i) {
114 int M = SM_SentinelZero;
115 if (i >= Imm) M = i - Imm + l;
116 ShuffleMask.push_back(M);
117 }
118}
119
120void DecodePSRLDQMask(MVT VT, unsigned Imm, SmallVectorImpl<int> &ShuffleMask) {
121 unsigned VectorSizeInBits = VT.getSizeInBits();
122 unsigned NumElts = VectorSizeInBits / 8;
123 unsigned NumLanes = VectorSizeInBits / 128;
124 unsigned NumLaneElts = NumElts / NumLanes;
125
126 for (unsigned l = 0; l < NumElts; l += NumLaneElts)
127 for (unsigned i = 0; i < NumLaneElts; ++i) {
128 unsigned Base = i + Imm;
129 int M = Base + l;
130 if (Base >= NumLaneElts) M = SM_SentinelZero;
131 ShuffleMask.push_back(M);
132 }
133}
134
135void DecodePALIGNRMask(MVT VT, unsigned Imm,
136 SmallVectorImpl<int> &ShuffleMask) {
137 unsigned NumElts = VT.getVectorNumElements();
138 unsigned Offset = Imm * (VT.getVectorElementType().getSizeInBits() / 8);
139
140 unsigned NumLanes = VT.getSizeInBits() / 128;
141 unsigned NumLaneElts = NumElts / NumLanes;
142
143 for (unsigned l = 0; l != NumElts; l += NumLaneElts) {
144 for (unsigned i = 0; i != NumLaneElts; ++i) {
145 unsigned Base = i + Offset;
146 // if i+offset is out of this lane then we actually need the other source
147 if (Base >= NumLaneElts) Base += NumElts - NumLaneElts;
148 ShuffleMask.push_back(Base + l);
149 }
150 }
151}
152
Simon Pilgrimf8f86ab2015-09-13 11:28:45 +0000153/// DecodePSHUFMask - This decodes the shuffle masks for pshufw, pshufd, and vpermilp*.
NAKAMURA Takumifb3bd712015-05-25 01:43:23 +0000154/// VT indicates the type of the vector allowing it to handle different
155/// datatypes and vector widths.
156void DecodePSHUFMask(MVT VT, unsigned Imm, SmallVectorImpl<int> &ShuffleMask) {
157 unsigned NumElts = VT.getVectorNumElements();
158
159 unsigned NumLanes = VT.getSizeInBits() / 128;
Simon Pilgrimf8f86ab2015-09-13 11:28:45 +0000160 if (NumLanes == 0) NumLanes = 1; // Handle MMX
NAKAMURA Takumifb3bd712015-05-25 01:43:23 +0000161 unsigned NumLaneElts = NumElts / NumLanes;
162
163 unsigned NewImm = Imm;
164 for (unsigned l = 0; l != NumElts; l += NumLaneElts) {
165 for (unsigned i = 0; i != NumLaneElts; ++i) {
166 ShuffleMask.push_back(NewImm % NumLaneElts + l);
167 NewImm /= NumLaneElts;
168 }
169 if (NumLaneElts == 4) NewImm = Imm; // reload imm
170 }
171}
172
173void DecodePSHUFHWMask(MVT VT, unsigned Imm,
174 SmallVectorImpl<int> &ShuffleMask) {
175 unsigned NumElts = VT.getVectorNumElements();
176
177 for (unsigned l = 0; l != NumElts; l += 8) {
178 unsigned NewImm = Imm;
179 for (unsigned i = 0, e = 4; i != e; ++i) {
180 ShuffleMask.push_back(l + i);
181 }
182 for (unsigned i = 4, e = 8; i != e; ++i) {
183 ShuffleMask.push_back(l + 4 + (NewImm & 3));
184 NewImm >>= 2;
185 }
186 }
187}
188
189void DecodePSHUFLWMask(MVT VT, unsigned Imm,
190 SmallVectorImpl<int> &ShuffleMask) {
191 unsigned NumElts = VT.getVectorNumElements();
192
193 for (unsigned l = 0; l != NumElts; l += 8) {
194 unsigned NewImm = Imm;
195 for (unsigned i = 0, e = 4; i != e; ++i) {
196 ShuffleMask.push_back(l + (NewImm & 3));
197 NewImm >>= 2;
198 }
199 for (unsigned i = 4, e = 8; i != e; ++i) {
200 ShuffleMask.push_back(l + i);
201 }
202 }
203}
204
Simon Pilgrimf8f86ab2015-09-13 11:28:45 +0000205void DecodePSWAPMask(MVT VT, SmallVectorImpl<int> &ShuffleMask) {
206 unsigned NumElts = VT.getVectorNumElements();
207 unsigned NumHalfElts = NumElts / 2;
208
209 for (unsigned l = 0; l != NumHalfElts; ++l)
210 ShuffleMask.push_back(l + NumHalfElts);
211 for (unsigned h = 0; h != NumHalfElts; ++h)
212 ShuffleMask.push_back(h);
213}
214
NAKAMURA Takumifb3bd712015-05-25 01:43:23 +0000215/// DecodeSHUFPMask - This decodes the shuffle masks for shufp*. VT indicates
216/// the type of the vector allowing it to handle different datatypes and vector
217/// widths.
218void DecodeSHUFPMask(MVT VT, unsigned Imm, SmallVectorImpl<int> &ShuffleMask) {
219 unsigned NumElts = VT.getVectorNumElements();
220
221 unsigned NumLanes = VT.getSizeInBits() / 128;
222 unsigned NumLaneElts = NumElts / NumLanes;
223
224 unsigned NewImm = Imm;
225 for (unsigned l = 0; l != NumElts; l += NumLaneElts) {
226 // each half of a lane comes from different source
NAKAMURA Takumi5582a6a2015-05-25 01:43:34 +0000227 for (unsigned s = 0; s != NumElts * 2; s += NumElts) {
228 for (unsigned i = 0; i != NumLaneElts / 2; ++i) {
NAKAMURA Takumifb3bd712015-05-25 01:43:23 +0000229 ShuffleMask.push_back(NewImm % NumLaneElts + s + l);
230 NewImm /= NumLaneElts;
231 }
232 }
233 if (NumLaneElts == 4) NewImm = Imm; // reload imm
234 }
235}
236
237/// DecodeUNPCKHMask - This decodes the shuffle masks for unpckhps/unpckhpd
238/// and punpckh*. VT indicates the type of the vector allowing it to handle
239/// different datatypes and vector widths.
240void DecodeUNPCKHMask(MVT VT, SmallVectorImpl<int> &ShuffleMask) {
241 unsigned NumElts = VT.getVectorNumElements();
242
243 // Handle 128 and 256-bit vector lengths. AVX defines UNPCK* to operate
244 // independently on 128-bit lanes.
245 unsigned NumLanes = VT.getSizeInBits() / 128;
Simon Pilgrimf8f86ab2015-09-13 11:28:45 +0000246 if (NumLanes == 0) NumLanes = 1; // Handle MMX
NAKAMURA Takumifb3bd712015-05-25 01:43:23 +0000247 unsigned NumLaneElts = NumElts / NumLanes;
248
249 for (unsigned l = 0; l != NumElts; l += NumLaneElts) {
NAKAMURA Takumi5582a6a2015-05-25 01:43:34 +0000250 for (unsigned i = l + NumLaneElts / 2, e = l + NumLaneElts; i != e; ++i) {
251 ShuffleMask.push_back(i); // Reads from dest/src1
252 ShuffleMask.push_back(i + NumElts); // Reads from src/src2
NAKAMURA Takumifb3bd712015-05-25 01:43:23 +0000253 }
254 }
255}
256
257/// DecodeUNPCKLMask - This decodes the shuffle masks for unpcklps/unpcklpd
258/// and punpckl*. VT indicates the type of the vector allowing it to handle
259/// different datatypes and vector widths.
260void DecodeUNPCKLMask(MVT VT, SmallVectorImpl<int> &ShuffleMask) {
261 unsigned NumElts = VT.getVectorNumElements();
262
263 // Handle 128 and 256-bit vector lengths. AVX defines UNPCK* to operate
264 // independently on 128-bit lanes.
265 unsigned NumLanes = VT.getSizeInBits() / 128;
266 if (NumLanes == 0 ) NumLanes = 1; // Handle MMX
267 unsigned NumLaneElts = NumElts / NumLanes;
268
269 for (unsigned l = 0; l != NumElts; l += NumLaneElts) {
NAKAMURA Takumi5582a6a2015-05-25 01:43:34 +0000270 for (unsigned i = l, e = l + NumLaneElts / 2; i != e; ++i) {
271 ShuffleMask.push_back(i); // Reads from dest/src1
272 ShuffleMask.push_back(i + NumElts); // Reads from src/src2
NAKAMURA Takumifb3bd712015-05-25 01:43:23 +0000273 }
274 }
275}
276
Igor Bregerd7bae452015-10-15 13:29:07 +0000277/// \brief Decode a shuffle packed values at 128-bit granularity
278/// (SHUFF32x4/SHUFF64x2/SHUFI32x4/SHUFI64x2)
279/// immediate mask into a shuffle mask.
280void decodeVSHUF64x2FamilyMask(MVT VT, unsigned Imm,
281 SmallVectorImpl<int> &ShuffleMask) {
282 unsigned NumLanes = VT.getSizeInBits() / 128;
283 unsigned NumElementsInLane = 128 / VT.getScalarSizeInBits();
284 unsigned ControlBitsMask = NumLanes - 1;
285 unsigned NumControlBits = NumLanes / 2;
286
287 for (unsigned l = 0; l != NumLanes; ++l) {
288 unsigned LaneMask = (Imm >> (l * NumControlBits)) & ControlBitsMask;
289 // We actually need the other source.
290 if (l >= NumLanes / 2)
291 LaneMask += NumLanes;
292 for (unsigned i = 0; i != NumElementsInLane; ++i)
293 ShuffleMask.push_back(LaneMask * NumElementsInLane + i);
294 }
295}
296
NAKAMURA Takumifb3bd712015-05-25 01:43:23 +0000297void DecodeVPERM2X128Mask(MVT VT, unsigned Imm,
298 SmallVectorImpl<int> &ShuffleMask) {
NAKAMURA Takumi5582a6a2015-05-25 01:43:34 +0000299 unsigned HalfSize = VT.getVectorNumElements() / 2;
NAKAMURA Takumifb3bd712015-05-25 01:43:23 +0000300
301 for (unsigned l = 0; l != 2; ++l) {
Simon Pilgrim40343e62015-07-06 22:46:46 +0000302 unsigned HalfMask = Imm >> (l * 4);
303 unsigned HalfBegin = (HalfMask & 0x3) * HalfSize;
NAKAMURA Takumi5582a6a2015-05-25 01:43:34 +0000304 for (unsigned i = HalfBegin, e = HalfBegin + HalfSize; i != e; ++i)
Denis Protivenskyb6129022015-07-07 07:48:48 +0000305 ShuffleMask.push_back(HalfMask & 8 ? SM_SentinelZero : (int)i);
NAKAMURA Takumifb3bd712015-05-25 01:43:23 +0000306 }
307}
308
NAKAMURA Takumifb3bd712015-05-25 01:43:23 +0000309void DecodePSHUFBMask(ArrayRef<uint64_t> RawMask,
310 SmallVectorImpl<int> &ShuffleMask) {
311 for (int i = 0, e = RawMask.size(); i < e; ++i) {
312 uint64_t M = RawMask[i];
313 if (M == (uint64_t)SM_SentinelUndef) {
314 ShuffleMask.push_back(M);
315 continue;
316 }
Simon Pilgrimf33cb612016-03-03 21:55:01 +0000317 // For 256/512-bit vectors the base of the shuffle is the 128-bit
318 // subvector we're inside.
319 int Base = (i / 16) * 16;
NAKAMURA Takumifb3bd712015-05-25 01:43:23 +0000320 // If the high bit (7) of the byte is set, the element is zeroed.
321 if (M & (1 << 7))
322 ShuffleMask.push_back(SM_SentinelZero);
323 else {
324 // Only the least significant 4 bits of the byte are used.
325 int Index = Base + (M & 0xf);
326 ShuffleMask.push_back(Index);
327 }
328 }
329}
330
331void DecodeBLENDMask(MVT VT, unsigned Imm, SmallVectorImpl<int> &ShuffleMask) {
332 int ElementBits = VT.getScalarSizeInBits();
333 int NumElements = VT.getVectorNumElements();
334 for (int i = 0; i < NumElements; ++i) {
335 // If there are more than 8 elements in the vector, then any immediate blend
336 // mask applies to each 128-bit lane. There can never be more than
337 // 8 elements in a 128-bit lane with an immediate blend.
338 int Bit = NumElements > 8 ? i % (128 / ElementBits) : i;
339 assert(Bit < 8 &&
340 "Immediate blends only operate over 8 elements at a time!");
341 ShuffleMask.push_back(((Imm >> Bit) & 1) ? NumElements + i : i);
342 }
343}
344
345/// DecodeVPERMMask - this decodes the shuffle masks for VPERMQ/VPERMPD.
346/// No VT provided since it only works on 256-bit, 4 element vectors.
347void DecodeVPERMMask(unsigned Imm, SmallVectorImpl<int> &ShuffleMask) {
348 for (unsigned i = 0; i != 4; ++i) {
NAKAMURA Takumi5582a6a2015-05-25 01:43:34 +0000349 ShuffleMask.push_back((Imm >> (2 * i)) & 3);
NAKAMURA Takumifb3bd712015-05-25 01:43:23 +0000350 }
351}
352
Simon Pilgrime1b6db92016-02-06 16:33:42 +0000353void DecodeZeroExtendMask(MVT SrcScalarVT, MVT DstVT, SmallVectorImpl<int> &Mask) {
NAKAMURA Takumifb3bd712015-05-25 01:43:23 +0000354 unsigned NumDstElts = DstVT.getVectorNumElements();
Simon Pilgrime1b6db92016-02-06 16:33:42 +0000355 unsigned SrcScalarBits = SrcScalarVT.getSizeInBits();
NAKAMURA Takumifb3bd712015-05-25 01:43:23 +0000356 unsigned DstScalarBits = DstVT.getScalarSizeInBits();
357 unsigned Scale = DstScalarBits / SrcScalarBits;
358 assert(SrcScalarBits < DstScalarBits &&
359 "Expected zero extension mask to increase scalar size");
NAKAMURA Takumifb3bd712015-05-25 01:43:23 +0000360
361 for (unsigned i = 0; i != NumDstElts; i++) {
362 Mask.push_back(i);
363 for (unsigned j = 1; j != Scale; j++)
364 Mask.push_back(SM_SentinelZero);
365 }
366}
367
368void DecodeZeroMoveLowMask(MVT VT, SmallVectorImpl<int> &ShuffleMask) {
369 unsigned NumElts = VT.getVectorNumElements();
370 ShuffleMask.push_back(0);
371 for (unsigned i = 1; i < NumElts; i++)
372 ShuffleMask.push_back(SM_SentinelZero);
373}
374
375void DecodeScalarMoveMask(MVT VT, bool IsLoad, SmallVectorImpl<int> &Mask) {
376 // First element comes from the first element of second source.
377 // Remaining elements: Load zero extends / Move copies from first source.
378 unsigned NumElts = VT.getVectorNumElements();
379 Mask.push_back(NumElts);
380 for (unsigned i = 1; i < NumElts; i++)
381 Mask.push_back(IsLoad ? static_cast<int>(SM_SentinelZero) : i);
382}
Simon Pilgrimd85cae32015-07-06 20:46:41 +0000383
384void DecodeEXTRQIMask(int Len, int Idx,
385 SmallVectorImpl<int> &ShuffleMask) {
386 // Only the bottom 6 bits are valid for each immediate.
387 Len &= 0x3F;
388 Idx &= 0x3F;
389
390 // We can only decode this bit extraction instruction as a shuffle if both the
391 // length and index work with whole bytes.
392 if (0 != (Len % 8) || 0 != (Idx % 8))
393 return;
394
395 // A length of zero is equivalent to a bit length of 64.
396 if (Len == 0)
397 Len = 64;
398
399 // If the length + index exceeds the bottom 64 bits the result is undefined.
400 if ((Len + Idx) > 64) {
401 ShuffleMask.append(16, SM_SentinelUndef);
402 return;
403 }
404
405 // Convert index and index to work with bytes.
406 Len /= 8;
407 Idx /= 8;
408
409 // EXTRQ: Extract Len bytes starting from Idx. Zero pad the remaining bytes
410 // of the lower 64-bits. The upper 64-bits are undefined.
411 for (int i = 0; i != Len; ++i)
412 ShuffleMask.push_back(i + Idx);
413 for (int i = Len; i != 8; ++i)
414 ShuffleMask.push_back(SM_SentinelZero);
415 for (int i = 8; i != 16; ++i)
416 ShuffleMask.push_back(SM_SentinelUndef);
417}
418
419void DecodeINSERTQIMask(int Len, int Idx,
420 SmallVectorImpl<int> &ShuffleMask) {
421 // Only the bottom 6 bits are valid for each immediate.
422 Len &= 0x3F;
423 Idx &= 0x3F;
424
425 // We can only decode this bit insertion instruction as a shuffle if both the
426 // length and index work with whole bytes.
427 if (0 != (Len % 8) || 0 != (Idx % 8))
428 return;
429
430 // A length of zero is equivalent to a bit length of 64.
431 if (Len == 0)
432 Len = 64;
433
434 // If the length + index exceeds the bottom 64 bits the result is undefined.
435 if ((Len + Idx) > 64) {
436 ShuffleMask.append(16, SM_SentinelUndef);
437 return;
438 }
439
440 // Convert index and index to work with bytes.
441 Len /= 8;
442 Idx /= 8;
443
444 // INSERTQ: Extract lowest Len bytes from lower half of second source and
445 // insert over first source starting at Idx byte. The upper 64-bits are
446 // undefined.
447 for (int i = 0; i != Idx; ++i)
448 ShuffleMask.push_back(i);
449 for (int i = 0; i != Len; ++i)
450 ShuffleMask.push_back(i + 16);
451 for (int i = Idx + Len; i != 8; ++i)
452 ShuffleMask.push_back(i);
453 for (int i = 8; i != 16; ++i)
454 ShuffleMask.push_back(SM_SentinelUndef);
455}
456
Elena Demikhovskye88038f2015-09-08 06:38:21 +0000457void DecodeVPERMVMask(ArrayRef<uint64_t> RawMask,
458 SmallVectorImpl<int> &ShuffleMask) {
459 for (int i = 0, e = RawMask.size(); i < e; ++i) {
460 uint64_t M = RawMask[i];
461 ShuffleMask.push_back((int)M);
462 }
463}
464
465void DecodeVPERMV3Mask(ArrayRef<uint64_t> RawMask,
466 SmallVectorImpl<int> &ShuffleMask) {
467 for (int i = 0, e = RawMask.size(); i < e; ++i) {
468 uint64_t M = RawMask[i];
469 ShuffleMask.push_back((int)M);
470 }
471}
472
Alexander Kornienkof00654e2015-06-23 09:49:53 +0000473} // llvm namespace