Skip to content

Commit d96a363

Browse files
committed
[LangRef] fix description and examples of fptrunc
As noted in PR36966: https://bugs.llvm.org/show_bug.cgi?id=36966 The old description doesn't match what we do in code, so this just fixes the documentation to avoid confusion. Differential Revision: https://reviews.llvm.org/D45190 llvm-svn: 329065
1 parent 08a1775 commit d96a363

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

‎llvm/docs/LangRef.rst‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8371,18 +8371,17 @@ Semantics:
83718371

83728372
The '``fptrunc``' instruction casts a ``value`` from a larger
83738373
:ref:`floating-point <t_floating>` type to a smaller :ref:`floating-point
8374-
<t_floating>` type. If the value cannot fit (i.e. overflows) within the
8375-
destination type, ``ty2``, then the results are undefined. If the cast produces
8376-
an inexact result, how rounding is performed (e.g. truncation, also known as
8377-
round to zero) is undefined.
8374+
<t_floating>` type.
8375+
This instruction is assumed to execute in the default :ref:`floating-point
8376+
environment <floatenv>`.
83788377

83798378
Example:
83808379
""""""""
83818380

83828381
.. code-block:: llvm
83838382

8384-
%X = fptrunc double 123.0 to float ; yields float:123.0
8385-
%Y = fptrunc double 1.0E+300 to float ; yields undefined
8383+
%X = fptrunc double 16777217.0 to float ; yields float:16777216.0
8384+
%Y = fptrunc double 1.0E+300 to half ; yields half:+infinity
83868385

83878386
'``fpext .. to``' Instruction
83888387
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)