summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/UsersManual.rst13
-rw-r--r--include/clang/Basic/LangOptions.def2
-rw-r--r--include/clang/Driver/Options.td4
3 files changed, 15 insertions, 4 deletions
diff --git a/docs/UsersManual.rst b/docs/UsersManual.rst
index 48a85a6ccb..b88a418d89 100644
--- a/docs/UsersManual.rst
+++ b/docs/UsersManual.rst
@@ -1055,6 +1055,19 @@ are listed below.
the behavior of sanitizers in the ``cfi`` group to allow checking
of cross-DSO virtual and indirect calls.
+.. option:: -ffast-math
+
+ Enable fast-math mode. This defines the ``__FAST_MATH__`` preprocessor
+ macro, and lets the compiler make aggressive, potentially-lossy assumptions
+ about floating-point math. These include:
+
+ * Floating-point math obeys regular algebraic rules for real numbers (e.g.
+ ``+`` and ``*`` are associative, ``x/y == x * (1/y)``, and
+ ``(a + b) * c == a * c + b * c``),
+ * operands to floating-point operations are not equal to ``NaN`` and
+ ``Inf``, and
+ * ``+0`` and ``-0`` are interchangeable.
+
.. option:: -fwhole-program-vtables
Enable whole-program vtable optimizations, such as single-implementation
diff --git a/include/clang/Basic/LangOptions.def b/include/clang/Basic/LangOptions.def
index 55b389a148..b19095c3f9 100644
--- a/include/clang/Basic/LangOptions.def
+++ b/include/clang/Basic/LangOptions.def
@@ -162,7 +162,7 @@ COMPATIBLE_VALUE_LANGOPT(PIELevel , 2, 0, "__PIE__ level")
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")
diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td
index dad070ede9..989a06fa13 100644
--- a/include/clang/Driver/Options.td
+++ b/include/clang/Driver/Options.td
@@ -592,9 +592,7 @@ def : Flag<["-"], "fextended-identifiers">, Group<clang_ignored_f_Group>;
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<"Allow aggressive, lossy floating-point optimizations">;
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">;