<div dir="ltr">I'd like to second that it would be nice to have an option for fast-math optimizations that don't change NaN and inf.  When I was working on rendering systems, optimizations that subtly changed precision were fine but we relied on inf behavior.<div>
<br></div><div style>-Warren</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Apr 25, 2013 at 3:12 PM, Christoph Grenz <span dir="ltr"><<a href="mailto:christophg+llvm@grenz-bonn.de" target="_blank">christophg+llvm@grenz-bonn.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Am Dienstag, 23. April 2013, 22:50:51 schrieben Sie:<br>
> [...]<br>
<div class="im">> Giving more-than-expected precision can be just as bad for the user as less.<br>
>  It tends to come up in situations where the optimization would break some<br>
> symmetry, the same way that aggressively forming FMAs can break user code.<br>
</div>> [...]<br>
<div class="im">><br>
> It boils down to the fact that giving excess precision in<br>
> some-places-but-not-others can lead to bad behavior.<br>
<br>
</div>Ok, I didn't think about excess precision resulting in problems.<br>
Now it's clear to me that fast-math is neccessary for this optimization.<br>
<br>
BTW: Is there a way to only get fast-math optimizations that don't change<br>
behaviour on NaNs and Infs? I think it would be an interesting possibility to<br>
allow arithmetic tranformations but only those preserving NaN and infinity<br>
bahavior to catch errors/corner cases.<br>
<br>
At least the pow(sqrt(x),2)=>x optimization falls into this category as I<br>
wrote before.<br>
<br>
> --Owen<br>
<span class="HOEnZb"><font color="#888888"><br>
Christoph<br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<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" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</div></div></blockquote></div><br></div>