<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@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;}
@font-face
        {font-family:Monospace;
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
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.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></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 lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal" style="margin-bottom:12.0pt">Hi,<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">For the development of a new micro-controller backend, I try to lowering the following store SDNode:   t5: ch = store<ST2[%ptr2](align=4)> t0, Constant:i16<3>, FrameIndex:i16<1>, undef:i16<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">I have defined the following instruction and associated DAG pattern.<o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Monospace">            def MOVSUTO_A_i32o : CLPFPU_A_i32o_Inst<0b1000001101,<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Monospace">                                                (ins IMM16Operand:$ImmA,FPUaOffsetOperand:$OffsetB),<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Monospace">                                                (outs ),<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Monospace">                                                [],<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Monospace">                                                "movsuto_a\t$ImmA,$OffsetB","I32O",<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Monospace">                                                [(store (i16 IMM16Operand:$ImmA), FPUaOffsetOperand:$OffsetB)],NoItinerary>;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">While building CLPGenDAGISel.inc, I got the following error:<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">-------------------------------------------------------------------------------------------------<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">Unknown leaf kind: IMM16Operand:i16:$ImmA<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">…<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">#7 0x00000000005210a1 (anonymous namespace)::MatcherGen::EmitLeafMatchCode(llvm::TreePatternNode const*) /home/dte/Projects/CLP/clp-llvm/trunk/llvm-project/llvm/utils/TableGen/DAGISelMatcherGen.cpp:286:0<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">-------------------------------------------------------------------------------------------------<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">While looking the DAGISelMatcherGen.cpp around line 286 (version 3.8.0), I’ve found such a kind of code
<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">-------------------------------------------------------------------------------------------------<o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Monospace;color:black"> 
</span><span style="font-size:10.0pt;font-family:Monospace;color:#3F7F5F">// Direct match against an integer constant.</span><span style="font-size:10.0pt;font-family:Monospace"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Monospace;color:black"> 
</span><b><span style="font-size:10.0pt;font-family:Monospace;color:#7F0055">if</span></b><span style="font-size:10.0pt;font-family:Monospace;color:black"> (</span><span style="font-size:10.0pt;font-family:Monospace;color:#005032">IntInit</span><span style="font-size:10.0pt;font-family:Monospace;color:black">
 *II = dyn_cast<</span><span style="font-size:10.0pt;font-family:Monospace;color:#005032">IntInit</span><span style="font-size:10.0pt;font-family:Monospace;color:black">>(N->getLeafValue())) {</span><span style="font-size:10.0pt;font-family:Monospace"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Monospace;color:black">   
</span><span style="font-size:10.0pt;font-family:Monospace;color:#3F7F5F">// If this is the root of the
<u>dag</u> we're matching, we emit a redundant opcode</span><span style="font-size:10.0pt;font-family:Monospace"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Monospace;color:black">   
</span><span style="font-size:10.0pt;font-family:Monospace;color:#3F7F5F">// check to ensure that this gets folded into the normal top-level</span><span style="font-size:10.0pt;font-family:Monospace"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Monospace;color:black">   
</span><span style="font-size:10.0pt;font-family:Monospace;color:#3F7F5F">// OpcodeSwitch.</span><span style="font-size:10.0pt;font-family:Monospace"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Monospace;color:black">   
</span><b><span style="font-size:10.0pt;font-family:Monospace;color:#7F0055">if</span></b><span style="font-size:10.0pt;font-family:Monospace;color:black"> (N ==
</span><span style="font-size:10.0pt;font-family:Monospace;color:#0000C0">Pattern</span><span style="font-size:10.0pt;font-family:Monospace;color:black">.<span style="background:silver;mso-highlight:silver">getSrcPattern</span>()) {</span><span style="font-size:10.0pt;font-family:Monospace"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Monospace;color:black">     
</span><b><span style="font-size:10.0pt;font-family:Monospace;color:#7F0055">const</span></b><span style="font-size:10.0pt;font-family:Monospace;color:black">
</span><span style="font-size:10.0pt;font-family:Monospace;color:#005032">SDNodeInfo</span><span style="font-size:10.0pt;font-family:Monospace;color:black"> &NI =
</span><span style="font-size:10.0pt;font-family:Monospace;color:#0000C0">CGP</span><span style="font-size:10.0pt;font-family:Monospace;color:black">.<u>getSDNodeInfo</u>(</span><span style="font-size:10.0pt;font-family:Monospace;color:#0000C0">CGP</span><span style="font-size:10.0pt;font-family:Monospace;color:black">.<u>getSDNodeNamed</u>(</span><span style="font-size:10.0pt;font-family:Monospace;color:#2A00FF">"<u>imm</u>"</span><span style="font-size:10.0pt;font-family:Monospace;color:black">));</span><span style="font-size:10.0pt;font-family:Monospace"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Monospace;color:black">      AddMatcher(</span><b><span style="font-size:10.0pt;font-family:Monospace;color:#7F0055">new</span></b><span style="font-size:10.0pt;font-family:Monospace;color:black">
</span><span style="font-size:10.0pt;font-family:Monospace;color:#005032">CheckOpcodeMatcher</span><span style="font-size:10.0pt;font-family:Monospace;color:black">(NI));</span><span style="font-size:10.0pt;font-family:Monospace"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Monospace;color:black">    }</span><span style="font-size:10.0pt;font-family:Monospace"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Monospace"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Monospace;color:black">   
</span><b><span style="font-size:10.0pt;font-family:Monospace;color:#7F0055">return</span></b><span style="font-size:10.0pt;font-family:Monospace;color:black"> AddMatcher(</span><b><span style="font-size:10.0pt;font-family:Monospace;color:#7F0055">new</span></b><span style="font-size:10.0pt;font-family:Monospace;color:black">
</span><span style="font-size:10.0pt;font-family:Monospace;color:#005032">CheckIntegerMatcher</span><span style="font-size:10.0pt;font-family:Monospace;color:black">(II->getValue()));</span><span style="font-size:10.0pt;font-family:Monospace"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Monospace;color:black">  }</span><span style="font-size:10.0pt;font-family:Monospace"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">-------------------------------------------------------------------------------------------------<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">This code seems to retrieve some Node definition based on a naming convention related to the “imm” string.<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">Are such naming conventions quite common for TableGen target descition input file?<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">Do I have to rename <span style="font-size:10.0pt;font-family:Monospace">
IMM16Operand into something like imm16Operand?<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:10.0pt;font-family:Monospace"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:10.0pt;font-family:Monospace">Thanks in advance.        Dominique Torette.</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
<span style="font-size:12.0pt;font-family:"Times New Roman","serif""><br>
<br>
<br>
</span><o:p></o:p></p>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="536" style="width:402.0pt">
<tbody>
<tr>
<td style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""><img width="536" height="49" id="_x0000_i1025" src="http://www.spacebel.be/wp-content/uploads/2011/06/image-sign-sbp.jpg" alt="http://www.spacebel.be/wp-content/uploads/2011/06/image-sign-sbp.jpg"></span><span lang="FR-BE" style="font-size:12.0pt;font-family:"Times New Roman","serif""><o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="border:solid silver 1.0pt;padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal" align="center" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-align:center">
<b><span lang="FR-BE" style="font-size:10.0pt">Dominique Torette</span></b><span lang="FR-BE" style="font-size:10.0pt">
<br>
System Architect<br>
Rue des Chasseurs Ardennais - Liège Science Park - B-4031 Angleur <br>
Tel: +32 (0) 4 361 81 11 - Fax: +32 (0) 4 361 81 20 <br>
</span><span style="font-size:10.0pt"><a href="http://www.spacebel.be/"><span lang="FR-BE" style="color:blue">www.spacebel.be</span></a></span><span lang="FR-BE" style="font-size:12.0pt;font-family:"Times New Roman","serif""><o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span lang="FR-BE"><o:p> </o:p></span></p>
</div>
<br clear="both">
 ------------------------------------------------------------------------------<BR>
<BR>
E-MAIL DISCLAIMER<BR>
<BR>
The present message may contain confidential and/or legally privileged information. If you are not the intended addressee and in case of a transmission error, please notify the sender immediately and destroy this E-mail. Disclosure, reproduction or distribution of this document and its possible attachments is strictly forbidden.<BR>
<BR>
SPACEBEL denies all liability for incomplete, improper, inaccurate, intercepted, (partly) destroyed, lost and/or belated transmission of the current information given that unencrypted electronic transmission cannot currently be guaranteed to be secure or error free.<BR>
Upon request or in conformity with formal, contractual agreements, an originally signed hard copy will be sent to you to confirm the information contained in this E-mail.<BR>
<BR>
SPACEBEL denies all liability where E-mail is used for private use.<BR>
<BR>
SPACEBEL cannot be held responsible for possible viruses that might corrupt this message and/or your computer system.<BR>
 -------------------------------------------------------------------------------<BR>
</body>
</html>