Skip to content

Commit a25d5dc

Browse files
committed
LangRef: Clarify nsz on min/max operations for +0.0 vs -0.0
On min/max operations, now +0.0 is treated greater than -0.0. To ignore this behaivor (fmin/fmax of libc doesn't require it), let's use `nsz` for this case.
1 parent 3eab094 commit a25d5dc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llvm/docs/LangRef.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3914,6 +3914,10 @@ following flags to enable otherwise unsafe floating-point transformations.
39143914
No Signed Zeros - Allow optimizations to treat the sign of a zero
39153915
argument or zero result as insignificant. This does not imply that -0.0
39163916
is poison and/or guaranteed to not exist in the operation.
3917+
Don't require +0.0>-0.0 for min/max operations - Allow optimizations of the
3918+
min/max operation not to treat +0.0>-0.0. Note the result should be either of
3919+
the operands. (max|min)(-0.0, -0.0) should never return +0.0, and vice versa.
3920+
Note: floating compare operations always imply -0.0 == +0.0.
39173921

39183922
Note: For :ref:`phi <i_phi>`, :ref:`select <i_select>`, and :ref:`call <i_call>`
39193923
instructions, the following return types are considered to be floating-point

0 commit comments

Comments
 (0)