Functionality wise, this looks fine. Some style comments below.<br><br><br>This comment is stale<br><br>+ // Handle 128 and 256-bit vector lengths. AVX defines PSHUF/SHUFP to operate<br>+ // independently on 128-bit lanes.<br>
+ unsigned NumElts = VT.getVectorNumElements();<br><br><br>80 columns<br><br>+ SDValue res = DAG.getNode(VT.isInteger()? X86ISD::VPERMD : X86ISD::VPERMPS, dl, VT,<br>+ DAG.getNode(ISD::BUILD_VECTOR, dl, MVT::v8i32, &permclMask[0], 8), V1);<br>
+ return res;<br> <br>+ }<br>+ if (V2IsUndef && HasAVX2 && (VT == MVT::v4i64 || VT == MVT::v4f64)) {<br>+ return getTargetShuffleNode(VT.isInteger()? X86ISD::VPERMQ : X86ISD::VPERMPD, dl, VT, V1,<br>
+ getShuffleCLImmediate(SVOp), DAG);<br>+ }<br><br><br>Dangling space after the else. What is the 0x80 value? The instruction only uses the lower 3-bits of each value. Probably cleaner codewise to make the value part conditional and not repeat the the push_back and getConstant calls twice.<br>
<br>+ if (M[i] < 0)<br>+ permclMask.push_back(DAG.getConstant(0x80, MVT::i32));<br>+ else <br>+ permclMask.push_back(DAG.getConstant(M[i], MVT::i32));<br>+ }<br><br><br>What does the "CL" here stand for?<br>
<br>+/// getShuffleCLImmediate - Return the appropriate immediate to shuffle<br>+/// the specified VECTOR_SHUFFLE mask with VPERMQ and VPERMPD instructions.<br>+/// Handles 256-bit.<br>+static unsigned getShuffleCLImmediate(ShuffleVectorSDNode *N) {<br>
<br><br>Either align the SDTShuff2Opl part across all 5 rows or remove the extra spaces from VPERMD/VPERMPS/VPERMQ<br><br> def X86VPermilp : SDNode<"X86ISD::VPERMILP", SDTShuff2OpI>;<br>+def X86VPermd : SDNode<"X86ISD::VPERMD", SDTShuff2Op>;<br>
+def X86VPermps : SDNode<"X86ISD::VPERMPS", SDTShuff2Op>;<br>+def X86VPermq : SDNode<"X86ISD::VPERMQ", SDTShuff2OpI>;<br>+def X86VPermpd : SDNode<"X86ISD::VPERMPD", SDTShuff2OpI>;<br>
<br>~Craig<br><br><div class="gmail_quote">On Tue, Apr 10, 2012 at 4:22 AM, Demikhovsky, Elena <span dir="ltr"><<a href="mailto:elena.demikhovsky@intel.com">elena.demikhovsky@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I added VPERMQ/VPERMD/VPERMPD/VPERMPS patterns. Please review.<br>
<br>
<br>
- Elena<br>
<br>
<br>
---------------------------------------------------------------------<br>
Intel Israel (74) Limited<br>
<br>
This e-mail and any attachments may contain confidential material for<br>
the sole use of the intended recipient(s). Any review or distribution<br>
by others is strictly prohibited. If you are not the intended<br>
recipient, please contact the sender and delete all copies.<br>
<br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>~Craig<br>