Hi Hal,<div><br></div><div>Sorry - that was an oversight on my part. I've now added support for expressions of the form (a * b - c) and (c - a * b). Adding that feature also prompted me to refactor some of the codegen logic, and testing helped me find a couple of bugs where I'd failed to propagate the contractable bit during template instantiation.</div>
<div><br></div><div>Updated patch attached.</div><div><br></div><div>Cheers,</div><div>Lang.<br><br><div class="gmail_quote">On Wed, Sep 26, 2012 at 7:50 PM, Hal Finkel <span dir="ltr"><<a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Lang,<br>
<br>
Great, thanks!<br>
<br>
Can you please add support for making a*c - b into fma(a, c, -b), etc.<br>
This is very important for performance on PPC (because this gets<br>
pattern-matched into a single instruction).<br>
<br>
 -Hal<br>
<div class="HOEnZb"><div class="h5"><br>
On Wed, 26 Sep 2012 17:12:50 -0700<br>
Lang Hames <<a href="mailto:lhames@gmail.com">lhames@gmail.com</a>> wrote:<br>
<br>
> Hi All,<br>
><br>
> This patch adds support for the FP_CONTRACT pragma to clang. It adds<br>
> a bit to BinaryOperator and CXXOperatorCallExpr to track the<br>
> FP_CONTRACT pragma state as each AST node is constructed. Pragma<br>
> state is made to follow scope correctly by having an RAII object save<br>
> and restore the state when the parser encounters a new compound<br>
> statement body. The -ffp-contract option is tested during codegen,<br>
> and fmuladd intrinsics (representing fusing opportunities) are output<br>
> only if --ffp-contract=on.<br>
><br>
> This patch does NOT include warnings/errors for specifying<br>
> FP_CONTRACT in invalid contexts that could be confusing (e.g.<br>
> introducing FP_CONTRACT at class scope). I think it's reasonable to<br>
> start by supporting valid use cases, and add restrictions/diagnostics<br>
> in a follow-up patch.<br>
><br>
> Comments and feedback most welcome.<br>
><br>
> Cheers,<br>
> Lang.<br>
<br>
<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
Hal Finkel<br>
Postdoctoral Appointee<br>
Leadership Computing Facility<br>
Argonne National Laboratory<br>
</font></span></blockquote></div><br></div>