<div dir="ltr"><div>On Wed, Feb 13, 2013 at 8:04 AM, Badouh, Asaf <span dir="ltr"><<a href="mailto:asaf.badouh@intel.com" target="_blank">asaf.badouh@intel.com</a>></span> wrote:<br></div><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class=""><span style="color:rgb(31,73,125)">Hi Joe & Michael,<u></u><u></u></span></p>
<p class=""><span style="color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class=""><span style="color:rgb(31,73,125)">In rev. 151382 you have changed the fptoui implementation of the x86 codegen for win32.<u></u><u></u></span></p>
<p class=""><span style="color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class=""><span style="color:rgb(31,73,125)">Before the change fptoui was lowered to
<u></u><u></u></span></p>
<p style="text-indent:0.5in"><span style="font-size:9.5pt;font-family:Consolas">flds 16(%esp)<u></u><u></u></span></p>
<p style="margin-left:0in;text-indent:0.5in">
<span style="font-size:9.5pt;font-family:Consolas"> fisttpll 8(%esp)<u></u><u></u></span></p>
<p style="text-indent:0.5in"><span style="font-size:9.5pt;font-family:Consolas">movl 8(%esp), %eax<u></u><u></u></span></p>
<p class=""><span style="color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class=""><span style="color:rgb(31,73,125)">After the change fptoui is lowered to
<u></u><u></u></span></p>
<p style="text-indent:0.5in"><span style="font-size:9.5pt;font-family:Consolas">flds 40(%esp)<u></u><u></u></span></p>
<p class="" style="margin-left:0.5in;text-indent:0.5in"><span style="font-size:9.5pt;font-family:Consolas">calll _ftol2<u></u><u></u></span></p>
<p class=""><span style="color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class=""><span style="color:rgb(31,73,125)">Please note that the assumption that _ftol2 doesn’t modify ECX isn’t true on sandybridge platform.<u></u><u></u></span></p>
<p class=""><span style="color:rgb(31,73,125)">Could you share with me the reasons behind this change? Did you get better performance after this change?
<u></u><u></u></span></p>
<p class=""><span style="color:rgb(31,73,125)"><u></u> </span></p></div></div></blockquote><div>"fisttp" is only available with SSE3 or later, and before that change, if SSE3 was unavailable, legalization would lower fptoui and fptosi to a libgcc/compiler-rt call that does not exist on Win32, so the change was necessary for compatibility with MSVC. If SSE3 is enabled, it should use 'fisttp', and if _ftol2 clobbers ECX, the pseudo-instruction for it can be fixed to reflect that. Those would both be good things to fix.</div>
<div><br></div><div>-Joe</div><div><br></div></div></div></div>