-
Notifications
You must be signed in to change notification settings - Fork 15.5k
Revert "LangRef: Clarify llvm.minnum and llvm.maxnum about sNaN and signed zero (#112852)" #168838
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -17257,8 +17257,9 @@ LLVM Implementation: | |||||
| """""""""""""""""""" | ||||||
|
|
||||||
| LLVM implements all ISO C flavors as listed in this table, except in the | ||||||
| default floating-point environment exceptions are ignored. The constrained | ||||||
| versions of the intrinsics respect the exception behavior. | ||||||
| default floating-point environment exceptions are ignored and return value | ||||||
| is non-deterministic if one or both inputs are sNaN. The constrained | ||||||
| versions of the intrinsics respect the exception behavior and sNaN. | ||||||
|
|
||||||
| .. list-table:: | ||||||
| :header-rows: 1 | ||||||
|
|
@@ -17290,7 +17291,7 @@ versions of the intrinsics respect the exception behavior. | |||||
| - qNaN, invalid exception | ||||||
|
|
||||||
| * - ``+0.0 vs -0.0`` | ||||||
| - +0.0(max)/-0.0(min) | ||||||
| - either one | ||||||
| - +0.0(max)/-0.0(min) | ||||||
| - +0.0(max)/-0.0(min) | ||||||
|
|
||||||
|
|
@@ -17334,30 +17335,22 @@ type. | |||||
|
|
||||||
| Semantics: | ||||||
| """""""""" | ||||||
| Follows the semantics of minNum in IEEE-754-2008, except that -0.0 < +0.0 for the purposes | ||||||
| of this intrinsic. As for signaling NaNs, per the minNum semantics, if either operand is sNaN, | ||||||
| the result is qNaN. This matches the recommended behavior for the libm | ||||||
| function ``fmin``, although not all implementations have implemented these recommended behaviors. | ||||||
|
|
||||||
| If either operand is a qNaN, returns the other non-NaN operand. Returns NaN only if both operands are | ||||||
| NaN or if either operand is sNaN. Note that arithmetic on an sNaN doesn't consistently produce a qNaN, | ||||||
| so arithmetic feeding into a minnum can produce inconsistent results. For example, | ||||||
| ``minnum(fadd(sNaN, -0.0), 1.0)`` can produce qNaN or 1.0 depending on whether ``fadd`` is folded. | ||||||
|
|
||||||
| IEEE-754-2008 defines minNum, and it was removed in IEEE-754-2019. As the replacement, IEEE-754-2019 | ||||||
| defines :ref:`minimumNumber <i_minimumnum>`. | ||||||
| Follows the IEEE-754-2008 semantics for minNum, except for handling of | ||||||
| signaling NaNs. This match's the behavior of libm's fmin. | ||||||
|
|
||||||
| If the intrinsic is marked with the nsz attribute, then the effect is as in the definition in C | ||||||
| and IEEE-754-2008: the result of ``minnum(-0.0, +0.0)`` may be either -0.0 or +0.0. | ||||||
| If either operand is a NaN, returns the other non-NaN operand. Returns | ||||||
| NaN only if both operands are NaN. If the operands compare equal, | ||||||
| returns either one of the operands. For example, this means that | ||||||
| fmin(+0.0, -0.0) non-deterministically returns either operand (-0.0 | ||||||
|
||||||
| fmin(+0.0, -0.0) returns non-deterministic value (either -0.0 or 0.0). | |
| fmin(+0.0, -0.0) non-deterministically returns either operand (-0.0 or 0.0). |
just a grammar fix
Contributor
Author
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.