<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:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (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]--><o:SmartTagType
namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Helvetica;
panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
{font-family:"MS Mincho";
panose-1:2 2 6 9 4 2 5 8 3 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:"\@MS Mincho";
panose-1:2 2 6 9 4 2 5 8 3 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:blue;
text-decoration:underline;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:Arial;
color:navy;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=blue style='word-wrap: break-word;-webkit-nbsp-mode: space;
-webkit-line-break: after-white-space'>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Evan,<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> Thanks, I understand better now. This is
what I eventually came up with.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>def : Pat<(i32 (fp_to_sint (f64
GPR:$src0))),<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> (i32 (FTOI (f32 (DTOF (f64
GPR:$src0)))))>;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Micah<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
llvmdev-bounces@cs.uiuc.edu [mailto:llvmdev-bounces@cs.uiuc.edu] <b><span
style='font-weight:bold'>On Behalf Of </span></b>Evan Cheng<br>
<b><span style='font-weight:bold'>Sent:</span></b> Tuesday, October 07, 2008
11:24 AM<br>
<b><span style='font-weight:bold'>To:</span></b> <st1:PersonName w:st="on">LLVM
Developers Mailing List</st1:PersonName><br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [LLVMdev] Multi
instruction pattern help</span></font><o:p></o:p></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>On Oct 7, 2008, at 9:30 AM, <st1:PersonName w:st="on">Villmow, Micah</st1:PersonName>
wrote:<o:p></o:p></span></font></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><br>
<br>
<o:p></o:p></span></font></p>
<span style='orphans: 2;text-align:auto;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: 0;word-spacing:0px'><u1:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PersonName">
<div link=blue vlink=purple style='word-wrap: break-word;-webkit-nbsp-mode: space;
-webkit-line-break: after-white-space'>
<div>
<div>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Chris,<u1:p></u1:p></span></font><font
color=black><span style='color:black'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;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.<u1:p></u1:p></span></font><font
color=black><span style='color:black'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><u1:p> </u1:p></span></font><font
color=black><span style='color:black'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>// unsigned int: f64->i32 ==>
f64->f32 + f32->i32<u1:p></u1:p></span></font><font color=black><span
style='color:black'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>def : Pat<(i32 (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></p>
</div>
<div>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>
(i32 (fp_to_uint (f32 (dp_to_fp (f64 GPR:$src0)))))>;<u1:p></u1:p></span></font><font
color=black><span style='color:black'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=1 color=black face="Courier New"><span
style='font-size:8.0pt;font-family:"Courier New";color:black'>1>Building
AMDil.td instruction selector implementation with tblgen<u1:p></u1:p></span></font><font
color=black><span style='color:black'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=1 color=black face="Courier New"><span
style='font-size:8.0pt;font-family:"Courier New";color:black'>1>(fp_to_uint:i32
(dp_to_fp:f32 GPR:f64:$src0))<u1:p></u1:p></span></font><font color=black><span
style='color:black'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;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><font
color=black><span style='color:black'><o:p></o:p></span></font></p>
</div>
</div>
</div>
</span></u1:smarttagtype>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>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.<o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Evan<o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><br>
<br>
<o:p></o:p></span></font></p>
<span style='orphans: 2;text-align:auto;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: 0;word-spacing:0px'><u1:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PersonName"><u1:p></u1:p><u1:p>
<div link=blue vlink=purple style='word-wrap: break-word;-webkit-nbsp-mode: space;
-webkit-line-break: after-white-space'>
<div>
<div>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </u1:p></span></font><font
color=black><span style='color:black'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Thanks,<u1:p></u1:p></span></font><font
color=black><span style='color:black'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><u1:p> </u1:p></span></font><font
color=black><span style='color:black'><o:p></o:p></span></font></p>
</div>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
color=black face="Times New Roman"><span style='font-size:12.0pt;color:black'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<div>
<p class=MsoNormal><b><font size=2 color=black face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma;color:black;font-weight:bold'>From:</span></font></b><span
class=apple-converted-space><font size=2 color=black face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma;color:black'> </span></font></span><font
size=2 color=black face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma;
color:black'><a href="mailto:llvmdev-bounces@cs.uiuc.edu">llvmdev-bounces@cs.uiuc.edu</a>
[<a href="mailto:llvmdev-bounces@cs.uiuc.edu">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> <st1:personname u2:st="on"></span><st1:PersonName
w:st="on">LLVM Developers Mailing List</st1:personname></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><font color=black><span style='color:black'><o:p></o:p></span></font></p>
<u1:p></u1:p></div>
</div>
<div>
<p class=MsoNormal><font size=3 color=black face="Times New Roman"><span
style='font-size:12.0pt;color:black'><u1:p> </u1:p><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 color=black face="Times New Roman"><span
style='font-size:12.0pt;color:black'><u1:p> </u1:p><o:p></o:p></span></font></p>
</div>
<div>
<div>
<div>
<p class=MsoNormal><font size=3 color=black face="Times New Roman"><span
style='font-size:12.0pt;color:black'>On Oct 6, 2008, at 5:42 PM,<span
class=apple-converted-space> <st1:personname u2:st="on"></span><st1:PersonName
w:st="on">Villmow, Micah</st1:personname></st1:PersonName><span
class=apple-converted-space> </span>wrote:<u1:p></u1:p><o:p></o:p></span></font></p>
</div>
</div>
<div>
<p class=MsoNormal><font size=3 color=black face="Times New Roman"><span
style='font-size:12.0pt;color:black'><br>
<br>
<br>
<o:p></o:p></span></font></p>
</div>
<u1:p></u1:p><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'><u3:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="City"><u3:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="Street"><u3:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="address"><u3:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="place">
<div link=blue vlink=purple>
<div>
<div>
<div>
<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:black'>I am trying to get a multi instruction
pattern to work and seem to be running into trouble.<u3:p></u3:p></span></font><font
color=black><span style='color:black'><u1:p></u1:p><o:p></o:p></span></font></p>
</div>
</div>
<div>
<div>
<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;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.<u3:p></u3:p></span></font><font color=black><span
style='color:black'><u1:p></u1:p><o:p></o:p></span></font></p>
</div>
</div>
<div>
<div>
<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:black'><u3:p> </u3:p></span></font><font
color=black><span style='color:black'><u1:p></u1:p><o:p></o:p></span></font></p>
</div>
</div>
<div>
<div>
<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:black'>What I thought would work from the
previous discussion is the following:<u3:p></u3:p></span></font><font
color=black><span style='color:black'><u1:p></u1:p><o:p></o:p></span></font></p>
</div>
</div>
<div>
<div>
<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:black'>def : Pat<(fp_to_uint (f64 GPR:$src0)),<u3:p></u3:p></span></font><font
color=black><span style='color:black'><u1:p></u1:p><o:p></o:p></span></font></p>
</div>
</div>
<div>
<div>
<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:black'>
(fp_to_uint (f32 (dp_to_fp (f64 GPR:$src0))))>;</span></font><font
color=black><span style='color:black'><u1:p></u1:p><o:p></o:p></span></font></p>
</div>
</div>
</div>
</div>
<blockquote style='margin-top:5.0pt;margin-bottom:5.0pt' type=cite><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'></u3:smarttagtype></u3:smarttagtype></u3:smarttagtype></u3:smarttagtype></span><u3:p><u3:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="City"><u3:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="Street"><u3:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="address"><u3:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="place">
<div link=blue vlink=purple>
<div>
<div>
<div>
<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:black'> </span></font><font color=black><span
style='color:black'><u1:p></u1:p><o:p></o:p></span></font></p>
</div>
</div>
<div>
<div>
<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;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'><u1:p></u1:p><o:p></o:p></span></font></p>
</div>
</div>
</div>
</div>
</blockquote>
<div>
<div>
<p class=MsoNormal><font size=3 color=black face="Times New Roman"><span
style='font-size:12.0pt;color:black'></u3:smarttagtype></u3:smarttagtype></u3:smarttagtype></u3:smarttagtype></u3:p></span><u1:p> </u1:p><o:p></o:p></span></font></p>
</div>
</div>
<div>
<div>
<p class=MsoNormal><font size=3 color=black face="Times New Roman"><span
style='font-size:12.0pt;color:black'><u1:p> </u1:p><o:p></o:p></span></font></p>
</div>
</div>
<div>
<p class=MsoNormal><font size=3 color=black face="Times New Roman"><span
style='font-size:12.0pt;color:black'><br>
<br>
<br>
<o:p></o:p></span></font></p>
</div>
<u1:p></u1:p><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'><u3:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="City"><u3:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="Street"><u3:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="address"><u3:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="place"><u3:p></u3:p><u3:p>
<div link=blue vlink=purple>
<div>
<div>
<div>
<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:black'> </span></font><font color=black><span
style='color:black'><u1:p></u1:p><o:p></o:p></span></font></p>
</div>
</div>
<div>
<div>
<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:black'>However, tablegen fails with the
following error:<u3:p></u3:p></span></font><font color=black><span
style='color:black'><u1:p></u1:p><o:p></o:p></span></font></p>
</div>
</div>
<div>
<div>
<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;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'><u1:p></u1:p><o:p></o:p></span></font></p>
</div>
</div>
</div>
</div>
<div>
<p class=MsoNormal><font size=3 color=black face="Times New Roman"><span
style='font-size:12.0pt;color:black'></u3:p></u3:smarttagtype></u3:smarttagtype></u3:smarttagtype></u3:smarttagtype></span><u1:p> </u1:p><o:p></o:p></span></font></p>
</div>
</div>
<div>
<div>
<p class=MsoNormal><font size=3 color=black face="Times New Roman"><span
style='font-size:12.0pt;color:black'>This is trying to tell you that it
inferred that </span></font><span class=apple-style-span><font size=2
color=black face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:black'>fp_to_uint</span></font></span><span class=apple-converted-space><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New";color:black'> </span></font></span><font color=black><span
style='color:black'>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></span></font></p>
<u1:p></u1:p></div>
</div>
</div>
<p class=MsoNormal><font size=1 color=black face=Helvetica><span
style='font-size:9.0pt;font-family:Helvetica;color:black'>_______________________________________________<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">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br>
<o:p></o:p></span></font></p>
</div>
</div>
</u1:smarttagtype>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'></span><o:p> </o:p></span></font></p>
</div>
</body>
</html>