Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 47 additions & 39 deletions llvm/docs/LangRef.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21080,6 +21080,53 @@ Example:
%c = call i8 @llvm.fptosi.sat.i8.f32(float 999.0) ; yields i8: 127
%d = call i8 @llvm.fptosi.sat.i8.f32(float 0xFFF8000000000000) ; yields i8: 0

Floating-Point Conversion Intrinsics
------------------------------------

This class of intrinsics is designed for floating-point conversions that do
not fall into other categories. For example conversions with specified rounding
mode or mini-float conversions.

'``llvm.fptrunc.round``' Intrinsic
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Syntax:
"""""""

::

declare <ty2>
@llvm.fptrunc.round(<type> <value>, metadata <rounding mode>)

Overview:
"""""""""

The '``llvm.fptrunc.round``' intrinsic truncates
:ref:`floating-point <t_floating>` ``value`` to type ``ty2``
with a specified rounding mode.

Arguments:
""""""""""

The '``llvm.fptrunc.round``' intrinsic takes a :ref:`floating-point
<t_floating>` value to cast and a :ref:`floating-point <t_floating>` type
to cast it to. This argument must be larger in size than the result.

The second argument specifies the rounding mode as described in the constrained
intrinsics section.
For this intrinsic, the "round.dynamic" mode is not supported.

Semantics:
""""""""""

The '``llvm.fptrunc.round``' intrinsic casts a ``value`` from a larger
:ref:`floating-point <t_floating>` type to a smaller :ref:`floating-point
<t_floating>` type.
This intrinsic is assumed to execute in the default :ref:`floating-point
environment <floatenv>` *except* for the rounding mode.
This intrinsic is not supported on all targets. Some targets may not support
all rounding modes.

Convergence Intrinsics
----------------------

Expand Down Expand Up @@ -31123,42 +31170,3 @@ Semantics:
The '``llvm.preserve.struct.access.index``' intrinsic produces the same result
as a getelementptr with base ``base`` and access operands ``{0, gep_index}``.

'``llvm.fptrunc.round``' Intrinsic
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Syntax:
"""""""

::

declare <ty2>
@llvm.fptrunc.round(<type> <value>, metadata <rounding mode>)

Overview:
"""""""""

The '``llvm.fptrunc.round``' intrinsic truncates
:ref:`floating-point <t_floating>` ``value`` to type ``ty2``
with a specified rounding mode.

Arguments:
""""""""""

The '``llvm.fptrunc.round``' intrinsic takes a :ref:`floating-point
<t_floating>` value to cast and a :ref:`floating-point <t_floating>` type
to cast it to. This argument must be larger in size than the result.

The second argument specifies the rounding mode as described in the constrained
intrinsics section.
For this intrinsic, the "round.dynamic" mode is not supported.

Semantics:
""""""""""

The '``llvm.fptrunc.round``' intrinsic casts a ``value`` from a larger
:ref:`floating-point <t_floating>` type to a smaller :ref:`floating-point
<t_floating>` type.
This intrinsic is assumed to execute in the default :ref:`floating-point
environment <floatenv>` *except* for the rounding mode.
This intrinsic is not supported on all targets. Some targets may not support
all rounding modes.
Loading