1 //======- X86InstrFragmentsSIMD.td - x86 ISA -------------*- tablegen -*-=====//
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 // This file provides pattern fragments useful for SIMD instructions.
12 //===----------------------------------------------------------------------===//
14 //===----------------------------------------------------------------------===//
15 // MMX Pattern Fragments
16 //===----------------------------------------------------------------------===//
18 def load_mmx : PatFrag<(ops node:$ptr), (x86mmx (load node:$ptr))>;
19 def bc_mmx : PatFrag<(ops node:$in), (x86mmx (bitconvert node:$in))>;
21 //===----------------------------------------------------------------------===//
22 // SSE specific DAG Nodes.
23 //===----------------------------------------------------------------------===//
25 def SDTX86FPShiftOp : SDTypeProfile<1, 2, [ SDTCisSameAs<0, 1>,
26 SDTCisFP<0>, SDTCisInt<2> ]>;
27 def SDTX86VFCMP : SDTypeProfile<1, 3, [SDTCisInt<0>, SDTCisSameAs<1, 2>,
28 SDTCisFP<1>, SDTCisVT<3, i8>]>;
30 def X86fmin : SDNode<"X86ISD::FMIN", SDTFPBinOp>;
31 def X86fmax : SDNode<"X86ISD::FMAX", SDTFPBinOp>;
32 def X86fand : SDNode<"X86ISD::FAND", SDTFPBinOp,
33 [SDNPCommutative, SDNPAssociative]>;
34 def X86for : SDNode<"X86ISD::FOR", SDTFPBinOp,
35 [SDNPCommutative, SDNPAssociative]>;
36 def X86fxor : SDNode<"X86ISD::FXOR", SDTFPBinOp,
37 [SDNPCommutative, SDNPAssociative]>;
38 def X86frsqrt : SDNode<"X86ISD::FRSQRT", SDTFPUnaryOp>;
39 def X86frcp : SDNode<"X86ISD::FRCP", SDTFPUnaryOp>;
40 def X86fsrl : SDNode<"X86ISD::FSRL", SDTX86FPShiftOp>;
41 def X86comi : SDNode<"X86ISD::COMI", SDTX86CmpTest>;
42 def X86ucomi : SDNode<"X86ISD::UCOMI", SDTX86CmpTest>;
43 def X86pshufb : SDNode<"X86ISD::PSHUFB",
44 SDTypeProfile<1, 2, [SDTCisVT<0, v16i8>, SDTCisSameAs<0,1>,
46 def X86pandn : SDNode<"X86ISD::PANDN",
47 SDTypeProfile<1, 2, [SDTCisVT<0, v2i64>, SDTCisSameAs<0,1>,
49 def X86psignb : SDNode<"X86ISD::PSIGNB",
50 SDTypeProfile<1, 2, [SDTCisVT<0, v16i8>, SDTCisSameAs<0,1>,
52 def X86psignw : SDNode<"X86ISD::PSIGNW",
53 SDTypeProfile<1, 2, [SDTCisVT<0, v8i16>, SDTCisSameAs<0,1>,
55 def X86psignd : SDNode<"X86ISD::PSIGND",
56 SDTypeProfile<1, 2, [SDTCisVT<0, v4i32>, SDTCisSameAs<0,1>,
58 def X86pblendv : SDNode<"X86ISD::PBLENDVB",
59 SDTypeProfile<1, 3, [SDTCisVT<0, v16i8>, SDTCisSameAs<0,1>,
60 SDTCisSameAs<0,2>, SDTCisSameAs<0,3>]>>;
61 def X86pextrb : SDNode<"X86ISD::PEXTRB",
62 SDTypeProfile<1, 2, [SDTCisVT<0, i32>, SDTCisPtrTy<2>]>>;
63 def X86pextrw : SDNode<"X86ISD::PEXTRW",
64 SDTypeProfile<1, 2, [SDTCisVT<0, i32>, SDTCisPtrTy<2>]>>;
65 def X86pinsrb : SDNode<"X86ISD::PINSRB",
66 SDTypeProfile<1, 3, [SDTCisVT<0, v16i8>, SDTCisSameAs<0,1>,
67 SDTCisVT<2, i32>, SDTCisPtrTy<3>]>>;
68 def X86pinsrw : SDNode<"X86ISD::PINSRW",
69 SDTypeProfile<1, 3, [SDTCisVT<0, v8i16>, SDTCisSameAs<0,1>,
70 SDTCisVT<2, i32>, SDTCisPtrTy<3>]>>;
71 def X86insrtps : SDNode<"X86ISD::INSERTPS",
72 SDTypeProfile<1, 3, [SDTCisVT<0, v4f32>, SDTCisSameAs<0,1>,
73 SDTCisVT<2, v4f32>, SDTCisPtrTy<3>]>>;
74 def X86vzmovl : SDNode<"X86ISD::VZEXT_MOVL",
75 SDTypeProfile<1, 1, [SDTCisSameAs<0,1>]>>;
76 def X86vzload : SDNode<"X86ISD::VZEXT_LOAD", SDTLoad,
77 [SDNPHasChain, SDNPMayLoad, SDNPMemOperand]>;
78 def X86vshl : SDNode<"X86ISD::VSHL", SDTIntShiftOp>;
79 def X86vshr : SDNode<"X86ISD::VSRL", SDTIntShiftOp>;
80 def X86cmpps : SDNode<"X86ISD::CMPPS", SDTX86VFCMP>;
81 def X86cmppd : SDNode<"X86ISD::CMPPD", SDTX86VFCMP>;
82 def X86pcmpeqb : SDNode<"X86ISD::PCMPEQB", SDTIntBinOp, [SDNPCommutative]>;
83 def X86pcmpeqw : SDNode<"X86ISD::PCMPEQW", SDTIntBinOp, [SDNPCommutative]>;
84 def X86pcmpeqd : SDNode<"X86ISD::PCMPEQD", SDTIntBinOp, [SDNPCommutative]>;
85 def X86pcmpeqq : SDNode<"X86ISD::PCMPEQQ", SDTIntBinOp, [SDNPCommutative]>;
86 def X86pcmpgtb : SDNode<"X86ISD::PCMPGTB", SDTIntBinOp>;
87 def X86pcmpgtw : SDNode<"X86ISD::PCMPGTW", SDTIntBinOp>;
88 def X86pcmpgtd : SDNode<"X86ISD::PCMPGTD", SDTIntBinOp>;
89 def X86pcmpgtq : SDNode<"X86ISD::PCMPGTQ", SDTIntBinOp>;
91 def SDTX86CmpPTest : SDTypeProfile<1, 2, [SDTCisVT<0, i32>,
94 def X86ptest : SDNode<"X86ISD::PTEST", SDTX86CmpPTest>;
95 def X86testp : SDNode<"X86ISD::TESTP", SDTX86CmpPTest>;
97 // Specific shuffle nodes - At some point ISD::VECTOR_SHUFFLE will always get
98 // translated into one of the target nodes below during lowering.
99 // Note: this is a work in progress...
100 def SDTShuff1Op : SDTypeProfile<1, 1, [SDTCisVec<0>, SDTCisSameAs<0,1>]>;
101 def SDTShuff2Op : SDTypeProfile<1, 2, [SDTCisVec<0>, SDTCisSameAs<0,1>,
104 def SDTShuff2OpI : SDTypeProfile<1, 2, [SDTCisVec<0>,
105 SDTCisSameAs<0,1>, SDTCisInt<2>]>;
106 def SDTShuff3OpI : SDTypeProfile<1, 3, [SDTCisVec<0>, SDTCisSameAs<0,1>,
107 SDTCisSameAs<0,2>, SDTCisInt<3>]>;
109 def X86PAlign : SDNode<"X86ISD::PALIGN", SDTShuff3OpI>;
111 def X86PShufd : SDNode<"X86ISD::PSHUFD", SDTShuff2OpI>;
112 def X86PShufhw : SDNode<"X86ISD::PSHUFHW", SDTShuff2OpI>;
113 def X86PShuflw : SDNode<"X86ISD::PSHUFLW", SDTShuff2OpI>;
115 def X86Shufpd : SDNode<"X86ISD::SHUFPD", SDTShuff3OpI>;
116 def X86Shufps : SDNode<"X86ISD::SHUFPS", SDTShuff3OpI>;
118 def X86Movddup : SDNode<"X86ISD::MOVDDUP", SDTShuff1Op>;
119 def X86Movshdup : SDNode<"X86ISD::MOVSHDUP", SDTShuff1Op>;
120 def X86Movsldup : SDNode<"X86ISD::MOVSLDUP", SDTShuff1Op>;
122 def X86Movsd : SDNode<"X86ISD::MOVSD", SDTShuff2Op>;
123 def X86Movss : SDNode<"X86ISD::MOVSS", SDTShuff2Op>;
125 def X86Movlhps : SDNode<"X86ISD::MOVLHPS", SDTShuff2Op>;
126 def X86Movlhpd : SDNode<"X86ISD::MOVLHPD", SDTShuff2Op>;
127 def X86Movhlps : SDNode<"X86ISD::MOVHLPS", SDTShuff2Op>;
128 def X86Movhlpd : SDNode<"X86ISD::MOVHLPD", SDTShuff2Op>;
130 def X86Movlps : SDNode<"X86ISD::MOVLPS", SDTShuff2Op>;
131 def X86Movlpd : SDNode<"X86ISD::MOVLPD", SDTShuff2Op>;
133 def X86Unpcklps : SDNode<"X86ISD::UNPCKLPS", SDTShuff2Op>;
134 def X86Unpcklpd : SDNode<"X86ISD::UNPCKLPD", SDTShuff2Op>;
135 def X86Unpcklpsy : SDNode<"X86ISD::VUNPCKLPSY", SDTShuff2Op>;
136 def X86Unpcklpdy : SDNode<"X86ISD::VUNPCKLPDY", SDTShuff2Op>;
137 def X86Unpckhps : SDNode<"X86ISD::UNPCKHPS", SDTShuff2Op>;
138 def X86Unpckhpd : SDNode<"X86ISD::UNPCKHPD", SDTShuff2Op>;
140 def X86Punpcklbw : SDNode<"X86ISD::PUNPCKLBW", SDTShuff2Op>;
141 def X86Punpcklwd : SDNode<"X86ISD::PUNPCKLWD", SDTShuff2Op>;
142 def X86Punpckldq : SDNode<"X86ISD::PUNPCKLDQ", SDTShuff2Op>;
143 def X86Punpcklqdq : SDNode<"X86ISD::PUNPCKLQDQ", SDTShuff2Op>;
145 def X86Punpckhbw : SDNode<"X86ISD::PUNPCKHBW", SDTShuff2Op>;
146 def X86Punpckhwd : SDNode<"X86ISD::PUNPCKHWD", SDTShuff2Op>;
147 def X86Punpckhdq : SDNode<"X86ISD::PUNPCKHDQ", SDTShuff2Op>;
148 def X86Punpckhqdq : SDNode<"X86ISD::PUNPCKHQDQ", SDTShuff2Op>;
150 //===----------------------------------------------------------------------===//
151 // SSE Complex Patterns
152 //===----------------------------------------------------------------------===//
154 // These are 'extloads' from a scalar to the low element of a vector, zeroing
155 // the top elements. These are used for the SSE 'ss' and 'sd' instruction
157 def sse_load_f32 : ComplexPattern<v4f32, 5, "SelectScalarSSELoad", [],
158 [SDNPHasChain, SDNPMayLoad, SDNPMemOperand,
160 def sse_load_f64 : ComplexPattern<v2f64, 5, "SelectScalarSSELoad", [],
161 [SDNPHasChain, SDNPMayLoad, SDNPMemOperand,
164 def ssmem : Operand<v4f32> {
165 let PrintMethod = "printf32mem";
166 let MIOperandInfo = (ops ptr_rc, i8imm, ptr_rc_nosp, i32imm, i8imm);
167 let ParserMatchClass = X86MemAsmOperand;
169 def sdmem : Operand<v2f64> {
170 let PrintMethod = "printf64mem";
171 let MIOperandInfo = (ops ptr_rc, i8imm, ptr_rc_nosp, i32imm, i8imm);
172 let ParserMatchClass = X86MemAsmOperand;
175 //===----------------------------------------------------------------------===//
176 // SSE pattern fragments
177 //===----------------------------------------------------------------------===//
179 // 128-bit load pattern fragments
180 def loadv4f32 : PatFrag<(ops node:$ptr), (v4f32 (load node:$ptr))>;
181 def loadv2f64 : PatFrag<(ops node:$ptr), (v2f64 (load node:$ptr))>;
182 def loadv4i32 : PatFrag<(ops node:$ptr), (v4i32 (load node:$ptr))>;
183 def loadv2i64 : PatFrag<(ops node:$ptr), (v2i64 (load node:$ptr))>;
185 // 256-bit load pattern fragments
186 def loadv8f32 : PatFrag<(ops node:$ptr), (v8f32 (load node:$ptr))>;
187 def loadv4f64 : PatFrag<(ops node:$ptr), (v4f64 (load node:$ptr))>;
188 def loadv8i32 : PatFrag<(ops node:$ptr), (v8i32 (load node:$ptr))>;
189 def loadv4i64 : PatFrag<(ops node:$ptr), (v4i64 (load node:$ptr))>;
191 // Like 'store', but always requires vector alignment.
192 def alignedstore : PatFrag<(ops node:$val, node:$ptr),
193 (store node:$val, node:$ptr), [{
194 return cast<StoreSDNode>(N)->getAlignment() >= 16;
197 // Like 'load', but always requires vector alignment.
198 def alignedload : PatFrag<(ops node:$ptr), (load node:$ptr), [{
199 return cast<LoadSDNode>(N)->getAlignment() >= 16;
202 def alignedloadfsf32 : PatFrag<(ops node:$ptr),
203 (f32 (alignedload node:$ptr))>;
204 def alignedloadfsf64 : PatFrag<(ops node:$ptr),
205 (f64 (alignedload node:$ptr))>;
207 // 128-bit aligned load pattern fragments
208 def alignedloadv4f32 : PatFrag<(ops node:$ptr),
209 (v4f32 (alignedload node:$ptr))>;
210 def alignedloadv2f64 : PatFrag<(ops node:$ptr),
211 (v2f64 (alignedload node:$ptr))>;
212 def alignedloadv4i32 : PatFrag<(ops node:$ptr),
213 (v4i32 (alignedload node:$ptr))>;
214 def alignedloadv2i64 : PatFrag<(ops node:$ptr),
215 (v2i64 (alignedload node:$ptr))>;
217 // 256-bit aligned load pattern fragments
218 def alignedloadv8f32 : PatFrag<(ops node:$ptr),
219 (v8f32 (alignedload node:$ptr))>;
220 def alignedloadv4f64 : PatFrag<(ops node:$ptr),
221 (v4f64 (alignedload node:$ptr))>;
222 def alignedloadv8i32 : PatFrag<(ops node:$ptr),
223 (v8i32 (alignedload node:$ptr))>;
224 def alignedloadv4i64 : PatFrag<(ops node:$ptr),
225 (v4i64 (alignedload node:$ptr))>;
227 // Like 'load', but uses special alignment checks suitable for use in
228 // memory operands in most SSE instructions, which are required to
229 // be naturally aligned on some targets but not on others. If the subtarget
230 // allows unaligned accesses, match any load, though this may require
231 // setting a feature bit in the processor (on startup, for example).
232 // Opteron 10h and later implement such a feature.
233 def memop : PatFrag<(ops node:$ptr), (load node:$ptr), [{
234 return Subtarget->hasVectorUAMem()
235 || cast<LoadSDNode>(N)->getAlignment() >= 16;
238 def memopfsf32 : PatFrag<(ops node:$ptr), (f32 (memop node:$ptr))>;
239 def memopfsf64 : PatFrag<(ops node:$ptr), (f64 (memop node:$ptr))>;
241 // 128-bit memop pattern fragments
242 def memopv4f32 : PatFrag<(ops node:$ptr), (v4f32 (memop node:$ptr))>;
243 def memopv2f64 : PatFrag<(ops node:$ptr), (v2f64 (memop node:$ptr))>;
244 def memopv4i32 : PatFrag<(ops node:$ptr), (v4i32 (memop node:$ptr))>;
245 def memopv2i64 : PatFrag<(ops node:$ptr), (v2i64 (memop node:$ptr))>;
246 def memopv8i16 : PatFrag<(ops node:$ptr), (v8i16 (memop node:$ptr))>;
247 def memopv16i8 : PatFrag<(ops node:$ptr), (v16i8 (memop node:$ptr))>;
249 // 256-bit memop pattern fragments
250 def memopv32i8 : PatFrag<(ops node:$ptr), (v32i8 (memop node:$ptr))>;
251 def memopv8f32 : PatFrag<(ops node:$ptr), (v8f32 (memop node:$ptr))>;
252 def memopv4f64 : PatFrag<(ops node:$ptr), (v4f64 (memop node:$ptr))>;
253 def memopv4i64 : PatFrag<(ops node:$ptr), (v4i64 (memop node:$ptr))>;
254 def memopv8i32 : PatFrag<(ops node:$ptr), (v8i32 (memop node:$ptr))>;
256 // SSSE3 uses MMX registers for some instructions. They aren't aligned on a
258 // FIXME: 8 byte alignment for mmx reads is not required
259 def memop64 : PatFrag<(ops node:$ptr), (load node:$ptr), [{
260 return cast<LoadSDNode>(N)->getAlignment() >= 8;
263 def memopmmx : PatFrag<(ops node:$ptr), (x86mmx (memop64 node:$ptr))>;
266 // Like 'store', but requires the non-temporal bit to be set
267 def nontemporalstore : PatFrag<(ops node:$val, node:$ptr),
268 (st node:$val, node:$ptr), [{
269 if (StoreSDNode *ST = dyn_cast<StoreSDNode>(N))
270 return ST->isNonTemporal();
274 def alignednontemporalstore : PatFrag<(ops node:$val, node:$ptr),
275 (st node:$val, node:$ptr), [{
276 if (StoreSDNode *ST = dyn_cast<StoreSDNode>(N))
277 return ST->isNonTemporal() && !ST->isTruncatingStore() &&
278 ST->getAddressingMode() == ISD::UNINDEXED &&
279 ST->getAlignment() >= 16;
283 def unalignednontemporalstore : PatFrag<(ops node:$val, node:$ptr),
284 (st node:$val, node:$ptr), [{
285 if (StoreSDNode *ST = dyn_cast<StoreSDNode>(N))
286 return ST->isNonTemporal() &&
287 ST->getAlignment() < 16;
291 // 128-bit bitconvert pattern fragments
292 def bc_v4f32 : PatFrag<(ops node:$in), (v4f32 (bitconvert node:$in))>;
293 def bc_v2f64 : PatFrag<(ops node:$in), (v2f64 (bitconvert node:$in))>;
294 def bc_v16i8 : PatFrag<(ops node:$in), (v16i8 (bitconvert node:$in))>;
295 def bc_v8i16 : PatFrag<(ops node:$in), (v8i16 (bitconvert node:$in))>;
296 def bc_v4i32 : PatFrag<(ops node:$in), (v4i32 (bitconvert node:$in))>;
297 def bc_v2i64 : PatFrag<(ops node:$in), (v2i64 (bitconvert node:$in))>;
299 // 256-bit bitconvert pattern fragments
300 def bc_v8i32 : PatFrag<(ops node:$in), (v8i32 (bitconvert node:$in))>;
302 def vzmovl_v2i64 : PatFrag<(ops node:$src),
303 (bitconvert (v2i64 (X86vzmovl
304 (v2i64 (scalar_to_vector (loadi64 node:$src))))))>;
305 def vzmovl_v4i32 : PatFrag<(ops node:$src),
306 (bitconvert (v4i32 (X86vzmovl
307 (v4i32 (scalar_to_vector (loadi32 node:$src))))))>;
309 def vzload_v2i64 : PatFrag<(ops node:$src),
310 (bitconvert (v2i64 (X86vzload node:$src)))>;
313 def fp32imm0 : PatLeaf<(f32 fpimm), [{
314 return N->isExactlyValue(+0.0);
317 // BYTE_imm - Transform bit immediates into byte immediates.
318 def BYTE_imm : SDNodeXForm<imm, [{
319 // Transformation function: imm >> 3
320 return getI32Imm(N->getZExtValue() >> 3);
323 // SHUFFLE_get_shuf_imm xform function: convert vector_shuffle mask to PSHUF*,
325 def SHUFFLE_get_shuf_imm : SDNodeXForm<vector_shuffle, [{
326 return getI8Imm(X86::getShuffleSHUFImmediate(N));
329 // SHUFFLE_get_pshufhw_imm xform function: convert vector_shuffle mask to
331 def SHUFFLE_get_pshufhw_imm : SDNodeXForm<vector_shuffle, [{
332 return getI8Imm(X86::getShufflePSHUFHWImmediate(N));
335 // SHUFFLE_get_pshuflw_imm xform function: convert vector_shuffle mask to
337 def SHUFFLE_get_pshuflw_imm : SDNodeXForm<vector_shuffle, [{
338 return getI8Imm(X86::getShufflePSHUFLWImmediate(N));
341 // SHUFFLE_get_palign_imm xform function: convert vector_shuffle mask to
343 def SHUFFLE_get_palign_imm : SDNodeXForm<vector_shuffle, [{
344 return getI8Imm(X86::getShufflePALIGNRImmediate(N));
347 // EXTRACT_get_vextractf128_imm xform function: convert extract_subvector index
348 // to VEXTRACTF128 imm.
349 def EXTRACT_get_vextractf128_imm : SDNodeXForm<extract_subvector, [{
350 return getI8Imm(X86::getExtractVEXTRACTF128Immediate(N));
353 // INSERT_get_vinsertf128_imm xform function: convert insert_subvector index to
355 def INSERT_get_vinsertf128_imm : SDNodeXForm<insert_subvector, [{
356 return getI8Imm(X86::getInsertVINSERTF128Immediate(N));
359 def splat_lo : PatFrag<(ops node:$lhs, node:$rhs),
360 (vector_shuffle node:$lhs, node:$rhs), [{
361 ShuffleVectorSDNode *SVOp = cast<ShuffleVectorSDNode>(N);
362 return SVOp->isSplat() && SVOp->getSplatIndex() == 0;
365 def movddup : PatFrag<(ops node:$lhs, node:$rhs),
366 (vector_shuffle node:$lhs, node:$rhs), [{
367 return X86::isMOVDDUPMask(cast<ShuffleVectorSDNode>(N));
370 def movhlps : PatFrag<(ops node:$lhs, node:$rhs),
371 (vector_shuffle node:$lhs, node:$rhs), [{
372 return X86::isMOVHLPSMask(cast<ShuffleVectorSDNode>(N));
375 def movhlps_undef : PatFrag<(ops node:$lhs, node:$rhs),
376 (vector_shuffle node:$lhs, node:$rhs), [{
377 return X86::isMOVHLPS_v_undef_Mask(cast<ShuffleVectorSDNode>(N));
380 def movlhps : PatFrag<(ops node:$lhs, node:$rhs),
381 (vector_shuffle node:$lhs, node:$rhs), [{
382 return X86::isMOVLHPSMask(cast<ShuffleVectorSDNode>(N));
385 def movlp : PatFrag<(ops node:$lhs, node:$rhs),
386 (vector_shuffle node:$lhs, node:$rhs), [{
387 return X86::isMOVLPMask(cast<ShuffleVectorSDNode>(N));
390 def movl : PatFrag<(ops node:$lhs, node:$rhs),
391 (vector_shuffle node:$lhs, node:$rhs), [{
392 return X86::isMOVLMask(cast<ShuffleVectorSDNode>(N));
395 def movshdup : PatFrag<(ops node:$lhs, node:$rhs),
396 (vector_shuffle node:$lhs, node:$rhs), [{
397 return X86::isMOVSHDUPMask(cast<ShuffleVectorSDNode>(N));
400 def movsldup : PatFrag<(ops node:$lhs, node:$rhs),
401 (vector_shuffle node:$lhs, node:$rhs), [{
402 return X86::isMOVSLDUPMask(cast<ShuffleVectorSDNode>(N));
405 def unpckl : PatFrag<(ops node:$lhs, node:$rhs),
406 (vector_shuffle node:$lhs, node:$rhs), [{
407 return X86::isUNPCKLMask(cast<ShuffleVectorSDNode>(N));
410 def unpckh : PatFrag<(ops node:$lhs, node:$rhs),
411 (vector_shuffle node:$lhs, node:$rhs), [{
412 return X86::isUNPCKHMask(cast<ShuffleVectorSDNode>(N));
415 def unpckl_undef : PatFrag<(ops node:$lhs, node:$rhs),
416 (vector_shuffle node:$lhs, node:$rhs), [{
417 return X86::isUNPCKL_v_undef_Mask(cast<ShuffleVectorSDNode>(N));
420 def unpckh_undef : PatFrag<(ops node:$lhs, node:$rhs),
421 (vector_shuffle node:$lhs, node:$rhs), [{
422 return X86::isUNPCKH_v_undef_Mask(cast<ShuffleVectorSDNode>(N));
425 def pshufd : PatFrag<(ops node:$lhs, node:$rhs),
426 (vector_shuffle node:$lhs, node:$rhs), [{
427 return X86::isPSHUFDMask(cast<ShuffleVectorSDNode>(N));
428 }], SHUFFLE_get_shuf_imm>;
430 def shufp : PatFrag<(ops node:$lhs, node:$rhs),
431 (vector_shuffle node:$lhs, node:$rhs), [{
432 return X86::isSHUFPMask(cast<ShuffleVectorSDNode>(N));
433 }], SHUFFLE_get_shuf_imm>;
435 def pshufhw : PatFrag<(ops node:$lhs, node:$rhs),
436 (vector_shuffle node:$lhs, node:$rhs), [{
437 return X86::isPSHUFHWMask(cast<ShuffleVectorSDNode>(N));
438 }], SHUFFLE_get_pshufhw_imm>;
440 def pshuflw : PatFrag<(ops node:$lhs, node:$rhs),
441 (vector_shuffle node:$lhs, node:$rhs), [{
442 return X86::isPSHUFLWMask(cast<ShuffleVectorSDNode>(N));
443 }], SHUFFLE_get_pshuflw_imm>;
445 def palign : PatFrag<(ops node:$lhs, node:$rhs),
446 (vector_shuffle node:$lhs, node:$rhs), [{
447 return X86::isPALIGNRMask(cast<ShuffleVectorSDNode>(N));
448 }], SHUFFLE_get_palign_imm>;
450 def vextractf128_extract : PatFrag<(ops node:$bigvec, node:$index),
451 (extract_subvector node:$bigvec,
453 return X86::isVEXTRACTF128Index(N);
454 }], EXTRACT_get_vextractf128_imm>;
456 def vinsertf128_insert : PatFrag<(ops node:$bigvec, node:$smallvec,
458 (insert_subvector node:$bigvec, node:$smallvec,
460 return X86::isVINSERTF128Index(N);
461 }], INSERT_get_vinsertf128_imm>;