[llvm] clarify NaN propagation in fptrunc (PR #68554)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 8 23:01:59 PDT 2023
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-ir
<details>
<summary>Changes</summary>
Follow-up to https://github.com/llvm/llvm-project/pull/66579: while implementing those semantics in Miri I realized there's a special case to be considered in truncating float casts.
Cc @<!-- -->nunoplopes @<!-- -->nikic @<!-- -->jyknight @<!-- -->jcranmer-intel
---
Full diff: https://github.com/llvm/llvm-project/pull/68554.diff
1 Files Affected:
- (modified) llvm/docs/LangRef.rst (+4-1)
``````````diff
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index 1883e9f6290b151..e27d4e0ed695319 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -11311,7 +11311,10 @@ environment <floatenv>`.
NaN values follow the usual :ref:`NaN behaviors <floatnan>`, except that _if_ a
NaN payload is propagated from the input ("Quieting NaN propagation" or
"Unchanged NaN propagation" cases), then the low order bits of the NaN payload
-which cannot fit in the resulting type are discarded.
+which cannot fit in the resulting type are discarded. Note that if discarding
+the low order bits leads to an all-0 payload, this cannot be represented as a
+signaling NaN (it would represent an infinity instead), so in that case
+"Unchanged NaN propagation" is not possible.
Example:
""""""""
``````````
</details>
https://github.com/llvm/llvm-project/pull/68554
More information about the llvm-commits
mailing list