Skip to content

Commit fceb719

Browse files
authored
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.
1 parent 645b779 commit fceb719

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

llvm/docs/LangRef.rst

+4-1
Original file line numberDiff line numberDiff line change
@@ -11332,7 +11332,10 @@ environment <floatenv>`.
1133211332
NaN values follow the usual :ref:`NaN behaviors <floatnan>`, except that _if_ a
1133311333
NaN payload is propagated from the input ("Quieting NaN propagation" or
1133411334
"Unchanged NaN propagation" cases), then the low order bits of the NaN payload
11335-
which cannot fit in the resulting type are discarded.
11335+
which cannot fit in the resulting type are discarded. Note that if discarding
11336+
the low order bits leads to an all-0 payload, this cannot be represented as a
11337+
signaling NaN (it would represent an infinity instead), so in that case
11338+
"Unchanged NaN propagation" is not possible.
1133611339

1133711340
Example:
1133811341
""""""""

0 commit comments

Comments
 (0)