Couple of nit picks on the patch itself, no real issue with the plan:<div><br></div><div><div>Index: test/CodeGen/fp-contract.c</div><div>===================================================================</div><div>--- test/CodeGen/fp-contract.c<span class="" style="white-space:pre">   </span>(revision 0)</div>
<div>+++ test/CodeGen/fp-contract.c<span class="" style="white-space:pre">      </span>(revision 0)</div><div>@@ -0,0 +1,8 @@</div><div>+// RUN: %clang_cc1 -O3 -ffp-contract=fast -triple=powerpc-apple-darwin10 -S -o - %s | FileCheck %s</div>
<div>+</div><div>+float fma_test1(float a, float b, float c) {</div><div>+// CHECK: fmadds</div><div>+  float x = a * b;</div><div>+  float y = x + c;</div><div>+  return y;</div><div>+}</div></div><div><br></div><div>I'd prefer to never check actual codegen from within the Clang test suite. I wonder if there is a way to get the backend libraries to print out their flags / state? Then we could just check that, and leave the actual functional test to the LLC-based tests in LLVM. Anyways, not needed for your patch -- this is a long standing deficit.</div>
<div><br></div><div><div>Index: include/clang/Driver/Options.td</div><div>===================================================================</div><div>--- include/clang/Driver/Options.td<span class="" style="white-space:pre">      </span>(revision 159591)</div>
<div>+++ include/clang/Driver/Options.td<span class="" style="white-space:pre"> </span>(working copy)</div><div>@@ -410,6 +410,12 @@</div><div> def fno_honor_infinites : Flag<"-fno-honor-infinites">, Alias<fno_honor_infinities>;</div>
<div> def ftrapping_math : Flag<"-ftrapping-math">, Group<f_Group>;</div><div> def fno_trapping_math : Flag<"-fno-trapping-math">, Group<f_Group>;</div><div>+def ffp_contract : Joined<"-ffp-contract=">, Group<f_Group>,</div>
<div>+                   Flags<[CC1Option]>,</div><div>+                   HelpText<"Form fused FP ops (e.g. FMAs): "</div><div>+                            "fast (everywhere) | "</div><div>+                            "on (according to FP_CONTRACT pragma, default) | "</div>
<div>+                            "off (never fuse)">;</div></div><div><br></div><div>The prevailing style in the options TD files is to maximize the columns w/o much regard for indentation:</div><div><br></div>
<div>def ffp_contract: Joined<'-ffp-contract=">, Group<f_Group>,</div><div>  Flags<[CC1Option]>,  HelpText<"...................."</div><div>  ".....">;</div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Mon, Jul 2, 2012 at 2:43 PM, Lang Hames <span dir="ltr"><<a href="mailto:lhames@gmail.com" target="_blank">lhames@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi All,<div><br></div><div>The attached patch adds a -ffp-contract=<style> option which (mostly) follows the behavior of GCC's option. Styles are 'fast', for aggressive FMA formation, 'on' for FP_CONTRACT compliance, and 'off' for no FMA formation (in the future this might be relaxed to FMA formation in cases where the result is provably unaffected).</div>

<div><br></div><div>Feedback would be welcome. In particular, I have toggled the fp-contract style based on the ffast-math option in Clang::ConstructJob(...) in lib/Driver/Tools.cpp. Is that the right place to do that kind of option fiddling? (It seems to be where the other fast-math related floating point options get handled).</div>

<div><br></div><div>Cheers,</div><div>Lang.</div>
<br>_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
<br></blockquote></div><br></div>