<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";
color:black;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";
color:black;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:1180314718;
mso-list-type:hybrid;
mso-list-template-ids:-213871422 67698705 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
{mso-level-text:"%1\)";
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level2
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level3
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level4
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level5
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level6
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level7
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level8
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level9
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Does your target support v16i8 natively? If not, then the DAG framework will split it up into the largest type your target supports.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Why are you attempting to do this in tablegen? This is something that should be trivially done in C++ code.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">For example:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">SDValue dst = DAG.getNode()
</span><span style="font-size:11.0pt;font-family:Wingdings;color:#1F497D">ß</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> extract element 0<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">for (1 to vec size-1) {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> SDValue tmp = DAG.getNode()
</span><span style="font-size:11.0pt;font-family:Wingdings;color:#1F497D">ß</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> extract element N<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> dst = DAG.getNode(ISD::AND, DL, MVT::i8, dst, tmp);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">}<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">return dst<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Simple 5-6 line helper function does what looks to be a very complex and error prone tablegen pattern.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext"> llvmdev-bounces@cs.uiuc.edu [mailto:llvmdev-bounces@cs.uiuc.edu]
<b>On Behalf Of </b>Conor Mac Aoidh<br>
<b>Sent:</b> Friday, July 26, 2013 3:28 AM<br>
<b>To:</b> llvmdev@cs.uiuc.edu<br>
<b>Subject:</b> Re: [LLVMdev] Vector DAG Patterns<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">To elaborate, it is not only cumbersome writing these patterns for vectors of 16 characters (v16i8), it does not work.<br>
<br>
When I compile with this pattern for an andx operation on v16i8:<br>
<br>
<i>[(set RC:$dst,<br>
(and (i8 (vector_extract(vt VC:$src), 0 ) ),
<br>
(and (i8 (vector_extract(vt VC:$src), 1 ) ),<br>
(and (i8 (vector_extract(vt VC:$src), 2 ) ),<br>
(and (i8 (vector_extract(vt VC:$src), 3 ) ),<br>
(and (i8 (vector_extract(vt VC:$src), 4 ) ),<br>
(and (i8 (vector_extract(vt VC:$src), 5 ) ),<br>
(and (i8 (vector_extract(vt VC:$src), 6 ) ),<br>
(and (i8 (vector_extract(vt VC:$src), 7 ) ),<br>
(and (i8 (vector_extract(vt VC:$src), 8 ) ), <br>
(and (i8 (vector_extract(vt VC:$src), 9 ) ),<br>
(and (i8 (vector_extract(vt VC:$src), 10 ) ),<br>
(and (i8 (vector_extract(vt VC:$src), 11 ) ),<br>
(and (i8 (vector_extract(vt VC:$src), 12 ) ),<br>
(and (i8 (vector_extract(vt VC:$src), 13 ) ),<br>
(and (i8 (vector_extract(vt VC:$src), 14 ) ),<br>
(i8 (vector_extract(vt VC:$src), 15 ) )<br>
)<br>
)<br>
)<br>
)<br>
)<br>
)<br>
)<br>
)<br>
)<br>
)<br>
)<br>
)<br>
)<br>
)<br>
)<br>
)]</i><br>
<br>
llvm-tblgen enters an infinite loop which never stops (i left it for ~10 mins before killing)<br>
<br>
So either there is another way to express this pattern, or this is a problem with tablegen?<br>
<br>
Regards<br>
---<br>
Conor Mac Aoidh<br>
<br>
On 23/07/2013 12:03, Conor Mac Aoidh wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">Hi All, <br>
<br>
Been having a problem constructing a suitable pattern to represent some vector operations in the DAG. Stuff like andx/orx operations where elements of a vector are anded/ored together.
<br>
<br>
My approach thus far has been to extract the sub elements of the vector and and/or those elements. This is ok for 4 vectors of i32s, but becomes cumbersome for v16i8s. Example instruction:
<br>
<br>
andx $dst $v1 <br>
<br>
Pattern: <br>
<br>
[(set RC:$dst, <br>
(and (i32 (vector_extract(vt VC:$src), 0 ) ), <br>
(and (i32 (vector_extract(vt VC:$src), 1 ) ), <br>
(and (i32 (vector_extract(vt VC:$src), 2 ) ), <br>
(i32 (vector_extract(vt VC:$src), 3 ) ) <br>
) <br>
) <br>
) <br>
)] <br>
<br>
Is there a better way to do this? <br>
<br>
Regards <br>
--- <br>
Conor Mac Aoidh <o:p></o:p></p>
</blockquote>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>