You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: clang/docs/UsersManual.rst
+27
Original file line number
Diff line number
Diff line change
@@ -1566,6 +1566,22 @@ Note that floating-point operations performed as part of constant initialization
1566
1566
* ``maytrap`` The compiler avoids transformations that may raise exceptions that would not have been raised by the original code. Constant folding performed by the compiler is exempt from this option.
1567
1567
* ``strict`` The compiler ensures that all transformations strictly preserve the floating point exception semantics of the original code.
1568
1568
1569
+
.. option:: -ffp-eval-method=<value>
1570
+
1571
+
Specify the floating-point evaluation method for intermediate results within
1572
+
a single expression of the code.
1573
+
1574
+
Valid values are: ``source``, ``double``, and ``extended``.
1575
+
For 64-bit targets, the default value is ``source``. For 32-bit x86 targets
1576
+
however, in the case of NETBSD 6.99.26 and under, the default value is
1577
+
``double``; in the case of NETBSD greater than 6.99.26, with NoSSE, the
1578
+
default value is ``extended``, with SSE the default value is ``source``.
1579
+
Details:
1580
+
1581
+
* ``source`` The compiler uses the floating-point type declared in the source program as the evaluation method.
1582
+
* ``double`` The compiler uses ``double`` as the floating-point evaluation method for all float expressions of type that is narrower than ``double``.
1583
+
* ``extended`` The compiler uses ``long double`` as the floating-point evaluation method for all float expressions of type that is narrower than ``long double``.
1584
+
1569
1585
.. option:: -f[no-]protect-parens:
1570
1586
1571
1587
This option pertains to floating-point types, complex types with
@@ -1587,6 +1603,17 @@ Note that floating-point operations performed as part of constant initialization
1587
1603
has no effect because the optimizer is prohibited from making unsafe
1588
1604
transformations.
1589
1605
1606
+
.. _FLT_EVAL_METHOD:
1607
+
1608
+
A note about ``__FLT_EVAL_METHOD__``
1609
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1610
+
The macro ``__FLT_EVAL_METHOD__`` will expand to either the value set from the
1611
+
command line option ``ffp-eval-method`` or to the value from the target info
1612
+
setting. The ``__FLT_EVAL_METHOD__`` macro cannot expand to the correct
1613
+
evaluation method in the presence of a ``#pragma`` which alters the evaluation
1614
+
method. An error is issued if ``__FLT_EVAL_METHOD__`` is expanded inside a scope
0 commit comments