Skip to content

Commit 36dc54b

Browse files
committed
Change documentation
1 parent ea5b37e commit 36dc54b

File tree

2 files changed

+28
-23
lines changed

2 files changed

+28
-23
lines changed

llvm/docs/LangRef.rst

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3057,20 +3057,21 @@ A "convergencectrl" operand bundle is only valid on a ``convergent`` operation.
30573057
When present, the operand bundle must contain exactly one value of token type.
30583058
See the :doc:`ConvergentOperations` document for details.
30593059

3060-
.. _ob_fpe:
3060+
.. _ob_fp:
30613061

3062-
Floating-point Environment Operand Bundles
3063-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3062+
Floating-point Operand Bundles
3063+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
30643064

3065-
These operand bundles provide details on how the operation interacts with the
3066-
:ref:`floating-point environment <floatenv>`. There are two kinds of such
3067-
operand bundles, which characterize interaction with floating-point control
3068-
modes and status bits respectively.
3065+
These operand bundles are used for calls that involve floating-point
3066+
operations and interact with :ref:`floating-point environment <floatenv>` or
3067+
depend on floating-point options, such as rounding mode, denormal modes, etc.
3068+
There are two kinds of such operand bundles, which represent the value of
3069+
floating-point control modes and the treatment of status bits respectively.
30693070

3070-
An operand bundle tagged with "fpe.control" keeps information about control
3071-
modes used by the operation. Only rounding mode is supported now. It is
3072-
represented by a metadata string value and specifies the rounding mode, which
3073-
will be used for the operation evaluation. Possible values are:
3071+
An operand bundle tagged with "fpe.control" contains information about the
3072+
control modes used for the operation execution. Currently, only rounding mode is
3073+
supported. It is represented by a metadata string value, which specifies the
3074+
rounding mode to be used for the operation evaluation. Possible values are:
30743075

30753076
::
30763077

@@ -3081,12 +3082,14 @@ will be used for the operation evaluation. Possible values are:
30813082
"rmm" - to nearest, ties away from zero
30823083
"dyn" - rounding mode is taken from control register
30833084

3084-
If "fpe.control" is absent, default rounding rounding to nearest, ties to even
3085-
is assumed.
3085+
If "fpe.control" is absent, the default rounding rounding mode is taken from the
3086+
control register (dynamic rounding). In the particular case of
3087+
:ref:`default floating-point environment <floatenv>`, it must be rounding to
3088+
nearest, ties to even.
30863089

3087-
An operand bundle tagged with "fpe.except" may be associated with the operations
3088-
that may read or write floating-point exception flags. It has a single metadata
3089-
string value, which may have one of the values:
3090+
An operand bundle tagged with "fpe.except" may be associated with operations
3091+
that can read or write floating-point exception flags. It contains a single
3092+
metadata string value, which can have one of the following values:
30903093

30913094
::
30923095

@@ -3791,9 +3794,9 @@ round-to-nearest rounding mode, and subnormals are assumed to be preserved.
37913794
Running LLVM code in an environment where these assumptions are not met
37923795
typically leads to undefined behavior. The ``strictfp`` and ``denormal-fp-math``
37933796
attributes as well as :ref:`Constrained Floating-Point Intrinsics
3794-
<constrainedfp>` can be used to weaken LLVM's assumptions and ensure defined
3795-
behavior in non-default floating-point environments; see their respective
3796-
documentation for details.
3797+
<constrainedfp>` or :ref:`floating-point operand bundles<ob_fp>` can be used to
3798+
weaken LLVM's assumptions and ensure defined behavior in non-default
3799+
floating-point environments; see their respective documentation for details.
37973800

37983801
.. _floatnan:
37993802

@@ -3845,7 +3848,8 @@ Floating-point math operations are allowed to treat all NaNs as if they were
38453848
quiet NaNs. For example, "pow(1.0, SNaN)" may be simplified to 1.0.
38463849

38473850
Code that requires different behavior than this should use the
3848-
:ref:`Constrained Floating-Point Intrinsics <constrainedfp>`.
3851+
:ref:`Constrained Floating-Point Intrinsics <constrainedfp>` or
3852+
:ref:`floating-point operand bundles<ob_fp>`.
38493853
In particular, constrained intrinsics rule out the "Unchanged NaN propagation"
38503854
case; they are guaranteed to return a QNaN.
38513855

@@ -17292,7 +17296,7 @@ would, and handles error conditions in the same way. Since LLVM assumes the
1729217296
:ref:`default floating-point environment <floatenv>`, the rounding mode is
1729317297
assumed to be set to "nearest", so halfway cases are rounded to the even
1729417298
integer. Use :ref:`Constrained Floating-Point Intrinsics <constrainedfp>`
17295-
to avoid that assumption.
17299+
or :ref:`floating-point operand bundles<ob_fp>` to avoid that assumption.
1729617300

1729717301
.. _int_nearbyint:
1729817302

@@ -17333,8 +17337,8 @@ This function returns the same values as the libm ``nearbyint``
1733317337
functions would, and handles error conditions in the same way. Since LLVM
1733417338
assumes the :ref:`default floating-point environment <floatenv>`, the rounding
1733517339
mode is assumed to be set to "nearest", so halfway cases are rounded to the even
17336-
integer. Use :ref:`Constrained Floating-Point Intrinsics <constrainedfp>` to
17337-
avoid that assumption.
17340+
integer. Use :ref:`Constrained Floating-Point Intrinsics <constrainedfp>` or
17341+
:ref:`floating-point operand bundles<ob_fp>` to avoid that assumption.
1733817342

1733917343
.. _int_round:
1734017344

llvm/docs/ReleaseNotes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ Changes to the LLVM IR
6161
removed:
6262

6363
* `mul`
64+
* Floating-point operand bundles have been added.
6465

6566
Changes to LLVM infrastructure
6667
------------------------------

0 commit comments

Comments
 (0)