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

Melanie Blower via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 31 08:28:09 PDT 2019


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


================
Comment at: clang/include/clang/Basic/CodeGenOptions.def:238
 CODEGENOPT(UnsafeFPMath      , 1, 0) ///< Allow unsafe floating point optzns.
+CODEGENOPT(RoundingFPMath    , 1, 0) ///< Rounding floating point optzns.
 CODEGENOPT(UnwindTables      , 1, 0) ///< Emit unwind tables.
----------------
mibintc wrote:
> rjmccall wrote:
> > Why do we need both a code-gen option and a language option?
> The main reason i added it to LangOptions.h is because I saw the FPContract support in there and I thought I'd get on that bandwagon.  My ultimate goal, after committing the command line options, is to add support for controlling rounding mode and exception behavior with pragma's embedded in the functions, similar to https://reviews.llvm.org/D69272.  
> 
> There's a patch here that I like, to add rounding-mode and exception-behavior to FPOptions https://reviews.llvm.org/D65994, but it hasn't been committed yet.
> 
I dropped the code-gen option.


================
Comment at: clang/include/clang/Basic/LangOptions.h:366
+      FPEB = Value;
+    }
+
----------------
rjmccall wrote:
> Everything here is a "setting", and in the context of this type they're all FP.  Please name these methods something like `getRoundingMode()`.
> 
> Does this structure really need to exist as opposed to tracking the dimensions separately?  Don't we already track some of this somewhere?  We should subsume that state into these values rather than tracking them separately.
I fixed the spelling, I also dropped the structure and used the ENUM_OPT macro instead of writing out the setter and getter. Look OK now?


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