[llvm] fceb719 - clarify NaN propagation in fptrunc (#68554)

via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 26 11:09:42 PDT 2023


Author: Ralf Jung
Date: 2023-10-26T14:09:38-04:00
New Revision: fceb7193ea538827ce7cfdf43bb972d88df53878

URL: https://github.com/llvm/llvm-project/commit/fceb7193ea538827ce7cfdf43bb972d88df53878
DIFF: https://github.com/llvm/llvm-project/commit/fceb7193ea538827ce7cfdf43bb972d88df53878.diff

LOG: clarify NaN propagation in fptrunc (#68554)

Follow-up to #66579: while
implementing those semantics in Miri I realized there's a special case
to be considered in truncating float casts.

Added: 
    

Modified: 
    llvm/docs/LangRef.rst

Removed: 
    


################################################################################
diff  --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index cabb5cd1bed62f8..c97a7ae372bc6eb 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -11332,7 +11332,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:
 """"""""


        


More information about the llvm-commits mailing list