<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=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 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";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
p.Default, li.Default, div.Default
        {mso-style-name:Default;
        margin:0cm;
        margin-bottom:.0001pt;
        text-autospace:none;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;
        mso-fareast-language:EN-US;}
.MsoChpDefault
        {mso-style-type:export-only;
        mso-fareast-language:EN-US;}
@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-IE" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I have a task to complete and I’m getting stuck. I can’t find anything comparable in the documentation. The shortest explanation I can give is as follows: I need to use double-precision floating point values for floating-point multiplies.
 I’ll not go into why: That would take the discussion away from the essential problem. E.g.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">  Replace:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="Default" style="text-align:justify"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#0070C0">  fmuls %f20,%f21,%f8<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:"Times New Roman","serif""><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-align:justify"><span lang="EN-US" style="font-family:"Times New Roman","serif"">  with the sequence:
<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:justify"><span lang="EN-US" style="font-family:"Times New Roman","serif""><o:p> </o:p></span></p>
<p class="Default" style="text-align:justify"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#0070C0">  fstod %f20,%f0<o:p></o:p></span></p>
<p class="Default" style="text-align:justify"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#0070C0">  fstod %f21,%f2<o:p></o:p></span></p>
<p class="Default" style="text-align:justify"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#0070C0">  fmuld %f0,%f2,%f8
<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">This is for a Sparc derived back-end and I’m already at the MachineInstr phase. The essential code I have now is as follows, but it doesn’t work. I’ve had much larger pieces of code, but I believe my mistake lies somewhere in here. I’m
 not sure if I’m heading down the right path with this. Please, any help would be appreciated – or any reference to an example, even better.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">[code is iterating through the MachineBasicBlock – this code is pretty straightforward and you can probably guess what’s in it]<o:p></o:p></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"> (Opcode ==
<u>SP::FMULS</u>)</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;color:black">       
</span><span style="font-size:10.0pt;font-family:Monospace;color:#005032">MachineOperand</span><span style="font-size:10.0pt;font-family:Monospace;color:black">& MO = MI.getOperand(0);</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:#005032">DebugLoc</span><span style="font-size:10.0pt;font-family:Monospace;color:black"> DL = MBBI->getDebugLoc();</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">       
<u>BuildMI</u>(MBB, MBBI, DL, TII.<u>get</u>(<u>SP::FSTOD</u>), MO.getReg());<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Monospace;color:black">           [ Then we’d do the second fstod and the fmuld, but I’ve not included this because the basic problem of generating the MachineInstr has
 happened already for this first MachineInstr]</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">        MI.eraseFromParent();</span><span style="font-size:10.0pt;font-family:Monospace"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:Monospace;color:black">      }<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:Monospace;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:Monospace;color:black">Chris Dewhurst,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:Monospace;color:black">University of Limerick, Ireland</span><o:p></o:p></p>
</div>
</body>
</html>