[PATCH] D107994: Making the code compliant to the documentation about Floating Point support default values for C/C++. FPP-MODEL=PRECISE enables FFP-CONTRACT (FMA is enabled).

Warren Ristow via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 14 22:20:47 PST 2021


wristow added a comment.

The Release Note change here says:

  Floating Point Support in Clang
  -------------------------------
  - The -ffp-model=precise now implies -ffp-contract=on rather than
    -ffp-contract=fast, and the documentation of these features has been
    clarified. Previously, the documentation claimed that -ffp-model=precise was
    the default, but this was incorrect because the precise model implied
    -ffp-contract=fast, whereas the default behavior is -ffp-contract=on.
    -ffp-model=precise is now exactly the default mode of the compiler.

Unless I'm missing something, there is a related change here that I think should be more overtly noted (given the discussions in this review, I //think// this additional change is understood/expected, but I'm surprised it's not pointed out explicitly -- so maybe I'm misunderstanding).

Specifically, this commit explicitly sets `-ffp-contract=on` in the default mode (which is what the documentation said, and continues to say).  But previously, there wasn't //any// explicit setting of `-ffp-contract` by default (and I think that lack of an explicit setting, was equivalent to `-ffp-contract=off`).

So with this commit, we now enable FMA by default (even at `-O0`). Noting the semantic change that FMA is now being enabled by default seems sensible.

Succinctly, in terms of the Release Note, the documentation claims that `-ffp-contract=on` is the default, but in fact the behavior //was// as though `-ffp-contract=off` was the default.  The default now really is `-ffp-contract=on`.

__________________

Also, I see a relatively minor point about `-ffp-contract` in the Users Manual.  It says that setting `-ffast-math` implies `-ffp-contract=fast`, and it says that setting `-ffp-model=fast` "Behaves identically to specifying both `-ffast-math` and `ffp-contract=fast`".  But that's redundant, since `-ffast-math` already implies  `-ffp-contract=fast`.  That is, `-ffast-math` and `-ffp-model=fast` are equivalent.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107994/new/

https://reviews.llvm.org/D107994



More information about the cfe-commits mailing list