Skip to content

LangRef: Clarify behaviors of nsz in fast math flag #137567

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions llvm/docs/LangRef.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3914,6 +3914,11 @@ following flags to enable otherwise unsafe floating-point transformations.
No Signed Zeros - Allow optimizations to treat the sign of a zero
argument or zero result as insignificant. This does not imply that -0.0
is poison and/or guaranteed to not exist in the operation.
For fcmp, this has no effect. For min/max intrinsics, this allows
returning either +0 or -0 if both +0 and -0 are passed.
For calls to anything other than a min/max intrinsic,
arithmetic instructions, select, and phi, if the result is zero,
the returned value can be a zero of either sign.

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