<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Oct 7, 2008, at 9:30 AM, Villmow, Micah wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div lang="EN-US" link="blue" vlink="purple" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><o:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PersonName"><div class="Section1"><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" color="navy" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy; ">Chris,<o:p></o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" color="navy" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy; "> Thanks for the help, this will help me with writing more patterns, but I am still hitting another roadblock. I attempted what you suggested and it fixed that issue, but then it started giving a warning that there is an unknown node in the resulting pattern.<o:p></o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" color="navy" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy; "><o:p> </o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" color="navy" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy; ">// unsigned int: f64->i32 ==> f64->f32 + f32->i32<o:p></o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" color="navy" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy; ">def : Pat<(i32 (fp_to_uint (f64 GPR:$src0))),<o:p></o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" color="navy" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy; "> (i32 (fp_to_uint (f32 (dp_to_fp (f64 GPR:$src0)))))>;<o:p></o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="1" face="Courier New"><span style="font-size: 8pt; font-family: 'Courier New'; ">1>Building AMDil.td instruction selector implementation with tblgen<o:p></o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="1" face="Courier New"><span style="font-size: 8pt; font-family: 'Courier New'; ">1>(fp_to_uint:i32 (dp_to_fp:f32 GPR:f64:$src0))<o:p></o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="1" face="Courier New"><span style="font-size: 8pt; font-family: 'Courier New'; ">1>f:\hq\main\sw\appeng\tools\hpc\llvm\win32\AMDIL\..\bin\Win32\Debug\TableGen.exe: Unknown node in result pattern!</span></font><font size="2" color="navy" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy; "><o:p></o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" color="navy" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy; ">both fp_to_uint and dp_to_fp are used in other patterns, so I am sure that the patterns separate from each other work and the above pattern passes the instruction information stage, so not sure why the instruction selector cannot parse it. Any help would be useful.</span></font></div></div></o:smarttagtype></div></span></blockquote><div><br></div>What are you trying to do here? Your pattern is transforming target independent nodes into other target independent nodes (fp_to_uint, etc)? That's not going to work. Patterns are meant to transform to target instruction nodes.</div><div><br></div><div>Evan</div><div><br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div lang="EN-US" link="blue" vlink="purple" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><o:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PersonName"><div class="Section1"><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" color="navy" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy; "><o:p></o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" color="navy" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy; "><o:p> </o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" color="navy" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy; ">Thanks,<o:p></o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" color="navy" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy; "><o:p> </o:p></span></font></div><div><div class="MsoNormal" align="center" style="text-align: center; margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="3" face="Times New Roman"><span style="font-size: 12pt; "><hr size="2" width="100%" align="center" tabindex="-1"></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><b><font size="2" face="Tahoma"><span style="font-size: 10pt; font-family: Tahoma; font-weight: bold; ">From:</span></font></b><font size="2" face="Tahoma"><span style="font-size: 10pt; font-family: Tahoma; "><span class="Apple-converted-space"> </span><a href="mailto:llvmdev-bounces@cs.uiuc.edu">llvmdev-bounces@cs.uiuc.edu</a> [<a href="mailto:llvmdev-bounces@cs.uiuc.edu" style="color: blue; text-decoration: underline; ">mailto:llvmdev-bounces@cs.uiuc.edu</a>]<span class="Apple-converted-space"> </span><b><span style="font-weight: bold; ">On Behalf Of<span class="Apple-converted-space"> </span></span></b>Chris Lattner<br><b><span style="font-weight: bold; ">Sent:</span></b><span class="Apple-converted-space"> </span>Monday, October 06, 2008 9:15 PM<br><b><span style="font-weight: bold; ">To:</span></b><span class="Apple-converted-space"> </span><st1:personname w:st="on">LLVM Developers Mailing List</st1:personname><br><b><span style="font-weight: bold; ">Subject:</span></b><span class="Apple-converted-space"> </span>Re: [LLVMdev] Multi instruction pattern help</span></font><o:p></o:p></div></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="3" face="Times New Roman"><span style="font-size: 12pt; "><o:p> </o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="3" face="Times New Roman"><span style="font-size: 12pt; "><o:p> </o:p></span></font></div><div><div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="3" face="Times New Roman"><span style="font-size: 12pt; ">On Oct 6, 2008, at 5:42 PM,<span class="Apple-converted-space"> </span><st1:personname w:st="on">Villmow, Micah</st1:personname><span class="Apple-converted-space"> </span>wrote:<o:p></o:p></span></font></div></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="3" face="Times New Roman"><span style="font-size: 12pt; "><br><br><o:p></o:p></span></font></div><span style="orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-spacing: 0px; "><u1:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="City"><u1:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="Street"><u1:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="address"><u1:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="place"><div link="blue" vlink="purple"><div><div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" color="black" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: black; ">I am trying to get a multi instruction pattern to work and seem to be running into trouble.<u1:p></u1:p></span></font><font color="black"><span style="color: black; "><o:p></o:p></span></font></div></div><div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" color="black" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: black; ">The problem itself is fairly simple. I need to go from 64bit floats to 32bit integers. As the backend doesn’t support this natively but has a way of converting it, I’d prefer to get this working via tablegen.<u1:p></u1:p></span></font><font color="black"><span style="color: black; "><o:p></o:p></span></font></div></div><div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" color="black" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: black; "><u1:p> </u1:p></span></font><font color="black"><span style="color: black; "><o:p></o:p></span></font></div></div><div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" color="black" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: black; ">What I thought would work from the previous discussion is the following:<u1:p></u1:p></span></font><font color="black"><span style="color: black; "><o:p></o:p></span></font></div></div><div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" color="black" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: black; ">def : Pat<(fp_to_uint (f64 GPR:$src0)),<u1:p></u1:p></span></font><font color="black"><span style="color: black; "><o:p></o:p></span></font></div></div><div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" color="black" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: black; "> (fp_to_uint (f32 (dp_to_fp (f64 GPR:$src0))))>;</span></font><font color="black"><span style="color: black; "><o:p></o:p></span></font></div></div></div></div></u1:smarttagtype></u1:smarttagtype></u1:smarttagtype></u1:smarttagtype></span><blockquote type="cite" style="margin-top: 5pt; margin-bottom: 5pt; "><span style="orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-spacing: 0px; "><u1:p><u1:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="City"><u1:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="Street"><u1:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="address"><u1:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="place"><div link="blue" vlink="purple"><div><div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" color="black" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: black; "> </span></font><font color="black"><span style="color: black; "><o:p></o:p></span></font></div></div><div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" color="black" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: black; ">Which when it runs across a 64bit float, it does a double to single conversion, and then calls the 32bit float to int routine.</span></font><font color="black"><span style="color: black; "><o:p></o:p></span></font></div></div></div></div></u1:smarttagtype></u1:smarttagtype></u1:smarttagtype></u1:smarttagtype></u1:p></span></blockquote><div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="3" face="Times New Roman"><span style="font-size: 12pt; "><o:p> </o:p></span></font></div></div><div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="3" face="Times New Roman"><span style="font-size: 12pt; "><o:p> </o:p></span></font></div></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="3" face="Times New Roman"><span style="font-size: 12pt; "><br><br><o:p></o:p></span></font></div><span style="orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-spacing: 0px; "><u1:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="City"><u1:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="Street"><u1:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="address"><u1:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="place"><u1:p></u1:p><u1:p><div link="blue" vlink="purple"><div><div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" color="black" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: black; "> </span></font><font color="black"><span style="color: black; "><o:p></o:p></span></font></div></div><div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" color="black" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: black; ">However, tablegen fails with the following error:<u1:p></u1:p></span></font><font color="black"><span style="color: black; "><o:p></o:p></span></font></div></div><div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" color="black" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; color: black; ">1>anonymous.2: (fp_to_uint:isInt GPR:f64:$src0)</span></font><font color="black"><span style="color: black; "><o:p></o:p></span></font></div></div></div></div></u1:p></u1:smarttagtype></u1:smarttagtype></u1:smarttagtype></u1:smarttagtype></span><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="3" face="Times New Roman"><span style="font-size: 12pt; "><o:p> </o:p></span></font></div></div><div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="3" face="Times New Roman"><span style="font-size: 12pt; ">This is trying to tell you that it inferred that </span></font><span class="apple-style-span"><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: 'Courier New'; ">fp_to_uint<span class="Apple-converted-space"> </span></span></font></span>returns an integer type, but it doesn't know which one. Try disambiguating either the input or output with an explicit type, ilke (i32 (fp_to_uint (...<o:p></o:p></div></div></div>_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" style="color: blue; text-decoration: underline; ">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" style="color: blue; text-decoration: underline; ">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></o:smarttagtype></div></span></blockquote></div><br></body></html>