[PATCH] D20457: Update -ffast-math documentation to match reality.

Justin Lebar via cfe-commits cfe-commits at lists.llvm.org
Thu May 19 18:11:57 PDT 2016


jlebar created this revision.
jlebar added a reviewer: rsmith.
jlebar added a subscriber: cfe-commits.

http://reviews.llvm.org/D20457

Files:
  include/clang/Basic/LangOptions.def
  include/clang/Driver/Options.td

Index: include/clang/Driver/Options.td
===================================================================
--- include/clang/Driver/Options.td
+++ include/clang/Driver/Options.td
@@ -592,9 +592,13 @@
 def : Flag<["-"], "fno-extended-identifiers">, Group<f_Group>, Flags<[Unsupported]>;
 def fhosted : Flag<["-"], "fhosted">, Group<f_Group>;
 def ffast_math : Flag<["-"], "ffast-math">, Group<f_Group>, Flags<[CC1Option]>,
-  HelpText<"Enable the *frontend*'s 'fast-math' mode. This has no effect on "
-           "optimizations, but provides a preprocessor macro __FAST_MATH__ the "
-           "same as GCC's -ffast-math flag">;
+  HelpText<"Enable fast-math mode. This defines the __FAST_MATH__ preprocessor "
+           "macro, and lets the compiler make aggressive, potentially unsafe "
+           "assumptions about floating-point math.  These include: "
+           "Floating-point math obeys regular algebraic rules for real "
+           "numbers (e.g. + and * are associative, and x/y == x * (1/y)), "
+           "operands to fp operations are not equal to NaN and Inf, and +0 "
+           "and -0 are interchangeable.">;
 def fno_fast_math : Flag<["-"], "fno-fast-math">, Group<f_Group>;
 def fmath_errno : Flag<["-"], "fmath-errno">, Group<f_Group>, Flags<[CC1Option]>,
   HelpText<"Require math functions to indicate errors by setting errno">;
Index: include/clang/Basic/LangOptions.def
===================================================================
--- include/clang/Basic/LangOptions.def
+++ include/clang/Basic/LangOptions.def
@@ -162,7 +162,7 @@
 COMPATIBLE_LANGOPT(GNUInline         , 1, 0, "GNU inline semantics")
 COMPATIBLE_LANGOPT(NoInlineDefine    , 1, 0, "__NO_INLINE__ predefined macro")
 COMPATIBLE_LANGOPT(Deprecated        , 1, 0, "__DEPRECATED predefined macro")
-COMPATIBLE_LANGOPT(FastMath          , 1, 0, "__FAST_MATH__ predefined macro")
+COMPATIBLE_LANGOPT(FastMath          , 1, 0, "Fast fp math optimizations, and __FAST_MATH__ predefined macro")
 COMPATIBLE_LANGOPT(FiniteMathOnly    , 1, 0, "__FINITE_MATH_ONLY__ predefined macro")
 COMPATIBLE_LANGOPT(UnsafeFPMath      , 1, 0, "Unsafe Floating Point Math")
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20457.57882.patch
Type: text/x-patch
Size: 2157 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160520/254510ec/attachment.bin>


More information about the cfe-commits mailing list