Skip to content

Commit

Permalink
clarify NaN propagation in fptrunc (#68554)
Browse files Browse the repository at this point in the history
Follow-up to #66579: while
implementing those semantics in Miri I realized there's a special case
to be considered in truncating float casts.
  • Loading branch information
RalfJung committed Oct 26, 2023
1 parent 645b779 commit fceb719
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion llvm/docs/LangRef.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
""""""""
Expand Down

0 comments on commit fceb719

Please sign in to comment.