[PATCH] D62731: [RFC] Add support for options -frounding-math, -fp-model=, and -fp-exception-behavior=, : Specify floating point behavior

Melanie Blower via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 9 13:29:32 PDT 2019


mibintc marked 2 inline comments as done.
mibintc added inline comments.


================
Comment at: clang/docs/UsersManual.rst:1314
+   ``-ffp-model=strict``, or merely establish the rounding mode setting
+   parameter to the llvm floating point constrained intrinsics.
+
----------------
rjmccall wrote:
> What you should document here are the semantics and how the option interacts with other options, not how code gets translated into LLVM.  I'm not sure what the FIXME question here is; are you asking whether providing `-frounding-math` should *imply* an FP model?
> 
> The notes about each of the options should probably be structured into a bullet list.
I'll remove the FIXME and assert that frounding-math uses dynamic-rounding and strict exception behavior. This will make frounding-math synonymous with fp-model=strict.  I'll reformat to put notes into bullet lists.


================
Comment at: clang/docs/UsersManual.rst:1336
+   enables ``-fp-contract=fast``, and conflicts with: ``-fp-contract=on``,
+   ``-fp-contract=off``.
+
----------------
rjmccall wrote:
> This is basically incomprehensible. :) I don't know if the problem is the behavior or just how it's being described, but I have no idea what "conflict" means — does it mean the option gets overridden, ignored, or causes an error?  I think what you're trying to say is:
> 
> - Basic FP behavior can be broken down along two dimensions: the FP strictness model and the FP exceptions model.
> - There are many existing options for controlling FP behavior.
> - Some of these existing options are equivalent to setting one (or both?) of these dimensions.  These options should generally be treated as synonyms for the purposes of deciding the ultimate setting; for example, `-ffp-model=fast -fno-fast-math` should basically leave the setting in its default state (right?).
> - Other existing options only make sense in combination with certain basic models.  For example, `-ffp-contract=fast` (note the spelling) is only allowed when using the fast FP model (right?).
> 
> As a specific note, you break out the options into a list below; the entry for `fast` is the place to add things like "Equivalent to `-ffast-math`, including defining `__FAST_MATH__`)".
Conflict was a poor choice of words. I meant to say that the umbrella options like fp-model=strict overlap with some of the other floating-point settings, in that case the rightmost option takes precedence and overrides the setting.  I want the new options to behave in the same way that other clang options: rightmost option has precedence.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D62731





More information about the cfe-commits mailing list