[cfe-commits] [PATCH] Add -fexcess-precision option.

Lang Hames lhames at gmail.com
Thu Jun 21 11:28:56 PDT 2012


Hi Steve, Chandler, Hal,


> That said, I don't love overloading excess-precision for this, even if fma
> is formally a special case of excess precision, mostly because excess
> precision has even more bizarre corner cases -- it leads to such
> monstrosities as cos(x) != cos(x).
>

Sounds like -fexcess-precision is too blunt of an instrument for this.
Should setting -fexcess-precision=fast enable this optimization though?

> If we're not going to use excess-precision, I would suggest a name that is
> completely explicit; something along the lines of -fallow-fma-anywhere or
> -fallow-fma-across-expressions (those might be too wordy).
>
> "-fallow-fma-anywhere" sounds fine to me if this flag is going to be
targeted specifically at FMA formation. Does anybody have any objections to
this?

Should this flag, whatever it's eventually called, have a "never-form" mode
that over-rides FP_CONTRACT and prevents any FMA formation? That seems like
it could be useful, if only for debugging. FP_CONTRACT doesn't guarantee
any fusing, so a flag that disabled any fusing wouldn't violate FP_CONTRACT
semantics, it would just provide a baseline with no fusing carried out.
This is what I had in mind when I penned the comments that you referred to
Hal.

In that case an alternative flag could be:

"-fform-fma={anywhere,standard,never}"

Cheers,
Lang.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120621/8e321dc9/attachment.html>


More information about the cfe-commits mailing list