summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2018-04-03 13:05:20 +0000
committerSanjay Patel <spatel@rotateright.com>2018-04-03 13:05:20 +0000
commitd96a363855f9ce7b9d2d8182206c74f3bb9d11ab (patch)
tree37c26609c2e07884647f68e79eb1c74fd86461a9
parent08a1775f28cd164b318f7d361926f277ba2de1d0 (diff)
downloadbcm5719-llvm-d96a363855f9ce7b9d2d8182206c74f3bb9d11ab.tar.gz
bcm5719-llvm-d96a363855f9ce7b9d2d8182206c74f3bb9d11ab.zip
[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
-rw-r--r--llvm/docs/LangRef.rst11
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index 035019499c1..62fdda91218 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -8371,18 +8371,17 @@ Semantics:
The '``fptrunc``' instruction casts a ``value`` from a larger
:ref:`floating-point <t_floating>` type to a smaller :ref:`floating-point
-<t_floating>` type. If the value cannot fit (i.e. overflows) within the
-destination type, ``ty2``, then the results are undefined. If the cast produces
-an inexact result, how rounding is performed (e.g. truncation, also known as
-round to zero) is undefined.
+<t_floating>` type.
+This instruction is assumed to execute in the default :ref:`floating-point
+environment <floatenv>`.
Example:
""""""""
.. code-block:: llvm
- %X = fptrunc double 123.0 to float ; yields float:123.0
- %Y = fptrunc double 1.0E+300 to float ; yields undefined
+ %X = fptrunc double 16777217.0 to float ; yields float:16777216.0
+ %Y = fptrunc double 1.0E+300 to half ; yields half:+infinity
'``fpext .. to``' Instruction
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OpenPOWER on IntegriCloud