<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hello Shuxin,<div><br></div><div>Answer inline</div><div><br></div><div><div><div>On Nov 30, 2012, at 10:22 AM, Shuxin Yang <<a href="mailto:shuxin.llvm@gmail.com">shuxin.llvm@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
  
    <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">hi, Pedro:<br>
      <br>
        Just curious, *NOT* review. <br>
       o.   What's the advantage of this transformation if the costs
      (say, in term of latency) between <br>
      fadd/fsub and fmpy is negligible?<br>
      <br></div></div></blockquote><div><br></div><div>I agree that if cost of multiplication = cost of addition the transform is not useful but LLVM assumes that cost of multiplication > cost of addition (for example when it transforms 2*X into X+X) already and this is true in architectures I can think of so, since it is already an embedded assumption, this is no different than what other passes already do. Ideally one would have an abstract arch model to make this only trigger when the assumption holds but AFAIK there is no such thing today.</div><br><blockquote type="cite"><div bgcolor="#FFFFFF" text="#000000"><div class="moz-cite-prefix">
        o. As far as I can understand, this change only catch log2(0.5 x
      x) => log2x - 1. <br>
      Is it able to figure out a FP value is negative-power-of-2 (to
      make this transformation more general)?<br>
      <br></div></div></blockquote><div><br></div><div>A negative power of two would require a multiply and a subtract because the factor would not be -1 in general, (for 0.5 it is -1) so it does not really apply as at that point the instruction count would increase.</div><div><br></div><div>Hope to have cleared all issues</div><div><br></div><div>Thanks</div><div><br></div><div>Pedro</div><br><blockquote type="cite"><div bgcolor="#FFFFFF" text="#000000"><div class="moz-cite-prefix">
      Thanks<br>
      Shuxin<br>
      <br>
      On 11/30/12 9:39 AM, Pedro Artigas wrote:<br>
    </div>
    <blockquote cite="mid:5AAF9F81-6E05-41B5-B466-6BC6365FCBD3@apple.com" type="cite">
      <pre wrap="">Hello All,

This patch implements the above algebra transform under fast math flag.

Thanks

Pedro Artigas

</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
llvm-commits mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a>
</pre>
    </blockquote>
    <br>
  </div>

</blockquote></div><br></div></body></html>