Skip to content

Commit ab119ad

Browse files
authored
LangRef: Fix minimumnum/maximumnum nan handling phrasing (#139228)
Make this consistent with other operations with respect to signaling nan quieting. This was specifying that quieting is required, which is true for IEEE. Make this consistent with other IR operations, and signaling nan quieting is possible but optional in the case where there are two nan inputs. This permits directly selecting the intrinsic to the hardware instruction in the default floating-point environment for shaders.
1 parent 53f11dd commit ab119ad

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

llvm/docs/LangRef.rst

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17200,12 +17200,14 @@ type.
1720017200

1720117201
Semantics:
1720217202
""""""""""
17203-
If both operands are NaNs (including sNaN), returns qNaN. If one operand
17204-
is NaN (including sNaN) and another operand is a number, return the number.
17205-
Otherwise returns the lesser of the two arguments. -0.0 is considered to
17206-
be less than +0.0 for this intrinsic.
1720717203

17208-
Note that these are the semantics of minimumNumber specified in IEEE 754-2019.
17204+
If both operands are NaNs (including sNaN), returns a :ref:`NaN <floatnan>`. If
17205+
one operand is NaN (including sNaN) and another operand is a number,
17206+
return the number. Otherwise returns the lesser of the two
17207+
arguments. -0.0 is considered to be less than +0.0 for this intrinsic.
17208+
17209+
Note that these are the semantics of minimumNumber specified in
17210+
IEEE-754-2019 with the usual :ref:`signaling NaN <floatnan>` exception.
1720917211

1721017212
It has some differences with '``llvm.minnum.*``':
1721117213
1)'``llvm.minnum.*``' will return qNaN if either operand is sNaN.
@@ -17246,12 +17248,15 @@ type.
1724617248

1724717249
Semantics:
1724817250
""""""""""
17249-
If both operands are NaNs (including sNaN), returns qNaN. If one operand
17250-
is NaN (including sNaN) and another operand is a number, return the number.
17251-
Otherwise returns the greater of the two arguments. -0.0 is considered to
17252-
be less than +0.0 for this intrinsic.
1725317251

17254-
Note that these are the semantics of maximumNumber specified in IEEE 754-2019.
17252+
If both operands are NaNs (including sNaN), returns a
17253+
:ref:`NaN <floatnan>`. If one operand is NaN (including sNaN) and
17254+
another operand is a number, return the number. Otherwise returns the
17255+
greater of the two arguments. -0.0 is considered to be less than +0.0
17256+
for this intrinsic.
17257+
17258+
Note that these are the semantics of maximumNumber specified in
17259+
IEEE-754-2019 with the usual :ref:`signaling NaN <floatnan>` exception.
1725517260

1725617261
It has some differences with '``llvm.maxnum.*``':
1725717262
1)'``llvm.maxnum.*``' will return qNaN if either operand is sNaN.

0 commit comments

Comments
 (0)