Skip to content

Commit d3a7abb

Browse files
authored
[NFC] Move llvm.fptrunc.round to Floating-Point Conversion Intrinsics class (llvm#155854)
Floating-Point Conversion Intrinsics - is a new category of intrinsics, that do not fall into other categories and can be used for conversions with explicit rounding modes and mini-floats conversions. Signed-off-by: Sidorov, Dmitry <[email protected]>
1 parent e2d1bbe commit d3a7abb

File tree

1 file changed

+47
-39
lines changed

1 file changed

+47
-39
lines changed

llvm/docs/LangRef.rst

Lines changed: 47 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -21122,6 +21122,53 @@ Example:
2112221122
%c = call i8 @llvm.fptosi.sat.i8.f32(float 999.0) ; yields i8: 127
2112321123
%d = call i8 @llvm.fptosi.sat.i8.f32(float 0xFFF8000000000000) ; yields i8: 0
2112421124

21125+
Floating-Point Conversion Intrinsics
21126+
------------------------------------
21127+
21128+
This class of intrinsics is designed for floating-point conversions that do
21129+
not fall into other categories. For example conversions with specified rounding
21130+
mode or mini-float conversions.
21131+
21132+
'``llvm.fptrunc.round``' Intrinsic
21133+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
21134+
21135+
Syntax:
21136+
"""""""
21137+
21138+
::
21139+
21140+
declare <ty2>
21141+
@llvm.fptrunc.round(<type> <value>, metadata <rounding mode>)
21142+
21143+
Overview:
21144+
"""""""""
21145+
21146+
The '``llvm.fptrunc.round``' intrinsic truncates
21147+
:ref:`floating-point <t_floating>` ``value`` to type ``ty2``
21148+
with a specified rounding mode.
21149+
21150+
Arguments:
21151+
""""""""""
21152+
21153+
The '``llvm.fptrunc.round``' intrinsic takes a :ref:`floating-point
21154+
<t_floating>` value to cast and a :ref:`floating-point <t_floating>` type
21155+
to cast it to. This argument must be larger in size than the result.
21156+
21157+
The second argument specifies the rounding mode as described in the constrained
21158+
intrinsics section.
21159+
For this intrinsic, the "round.dynamic" mode is not supported.
21160+
21161+
Semantics:
21162+
""""""""""
21163+
21164+
The '``llvm.fptrunc.round``' intrinsic casts a ``value`` from a larger
21165+
:ref:`floating-point <t_floating>` type to a smaller :ref:`floating-point
21166+
<t_floating>` type.
21167+
This intrinsic is assumed to execute in the default :ref:`floating-point
21168+
environment <floatenv>` *except* for the rounding mode.
21169+
This intrinsic is not supported on all targets. Some targets may not support
21170+
all rounding modes.
21171+
2112521172
Convergence Intrinsics
2112621173
----------------------
2112721174

@@ -31295,42 +31342,3 @@ Semantics:
3129531342
The '``llvm.preserve.struct.access.index``' intrinsic produces the same result
3129631343
as a getelementptr with base ``base`` and access operands ``{0, gep_index}``.
3129731344

31298-
'``llvm.fptrunc.round``' Intrinsic
31299-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
31300-
31301-
Syntax:
31302-
"""""""
31303-
31304-
::
31305-
31306-
declare <ty2>
31307-
@llvm.fptrunc.round(<type> <value>, metadata <rounding mode>)
31308-
31309-
Overview:
31310-
"""""""""
31311-
31312-
The '``llvm.fptrunc.round``' intrinsic truncates
31313-
:ref:`floating-point <t_floating>` ``value`` to type ``ty2``
31314-
with a specified rounding mode.
31315-
31316-
Arguments:
31317-
""""""""""
31318-
31319-
The '``llvm.fptrunc.round``' intrinsic takes a :ref:`floating-point
31320-
<t_floating>` value to cast and a :ref:`floating-point <t_floating>` type
31321-
to cast it to. This argument must be larger in size than the result.
31322-
31323-
The second argument specifies the rounding mode as described in the constrained
31324-
intrinsics section.
31325-
For this intrinsic, the "round.dynamic" mode is not supported.
31326-
31327-
Semantics:
31328-
""""""""""
31329-
31330-
The '``llvm.fptrunc.round``' intrinsic casts a ``value`` from a larger
31331-
:ref:`floating-point <t_floating>` type to a smaller :ref:`floating-point
31332-
<t_floating>` type.
31333-
This intrinsic is assumed to execute in the default :ref:`floating-point
31334-
environment <floatenv>` *except* for the rounding mode.
31335-
This intrinsic is not supported on all targets. Some targets may not support
31336-
all rounding modes.

0 commit comments

Comments
 (0)