You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This patch mostly follows up on D121292 which introduced the vp.fcmp
intrinsic.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D122729
Copy file name to clipboardExpand all lines: llvm/docs/LangRef.rst
+62Lines changed: 62 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11126,6 +11126,8 @@ The '``icmp``' instruction takes three operands. The first operand is
11126
11126
the condition code indicating the kind of comparison to perform. It is
11127
11127
not a value, just a keyword. The possible condition codes are:
11128
11128
11129
+
.. _icmp_md_cc:
11130
+
11129
11131
#. ``eq``: equal
11130
11132
#. ``ne``: not equal
11131
11133
#. ``ugt``: unsigned greater than
@@ -11148,6 +11150,8 @@ The '``icmp``' compares ``op1`` and ``op2`` according to the condition
11148
11150
code given as ``cond``. The comparison performed always yields either an
11149
11151
:ref:`i1 <t_integer>` or vector of ``i1`` result, as follows:
11150
11152
11153
+
.. _icmp_md_cc_sem:
11154
+
11151
11155
#. ``eq``: yields ``true`` if the operands are equal, ``false``
11152
11156
otherwise. No sign interpretation is necessary or performed.
11153
11157
#. ``ne``: yields ``true`` if the operands are unequal, ``false``
@@ -20341,6 +20345,64 @@ Examples:
20341
20345
%also.r = select <4 x i1> %mask, <4 x i1> %t, <4 x i1> undef
20342
20346
20343
20347
20348
+
.. _int_vp_icmp:
20349
+
20350
+
'``llvm.vp.icmp.*``' Intrinsics
20351
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
20352
+
20353
+
Syntax:
20354
+
"""""""
20355
+
This is an overloaded intrinsic.
20356
+
20357
+
::
20358
+
20359
+
declare <32 x i1> @llvm.vp.icmp.v32i32(<32 x i32> <left_op>, <32 x i32> <right_op>, metadata <condition code>, <32 x i1> <mask>, i32 <vector_length>)
20360
+
declare <vscale x 2 x i1> @llvm.vp.icmp.nxv2i32(<vscale x 2 x i32> <left_op>, <vscale x 2 x i32> <right_op>, metadata <condition code>, <vscale x 2 x i1> <mask>, i32 <vector_length>)
20361
+
declare <128 x i1> @llvm.vp.icmp.v128i8(<128 x i8> <left_op>, <128 x i8> <right_op>, metadata <condition code>, <128 x i1> <mask>, i32 <vector_length>)
20362
+
20363
+
Overview:
20364
+
"""""""""
20365
+
20366
+
The '``llvm.vp.icmp``' intrinsic returns a vector of boolean values based on
20367
+
the comparison of its operands. The operation has a mask and an explicit vector
20368
+
length parameter.
20369
+
20370
+
20371
+
Arguments:
20372
+
""""""""""
20373
+
20374
+
The '``llvm.vp.icmp``' intrinsic takes the two values to compare as its first
20375
+
and second operands. These two values must be vectors of :ref:`integer
20376
+
<t_integer>` types.
20377
+
The return type is the result of the comparison. The return type must be a
20378
+
vector of :ref:`i1 <t_integer>` type. The fourth operand is the vector mask.
20379
+
The return type, the values to compare, and the vector mask have the same
20380
+
number of elements. The third operand is the condition code indicating the kind
20381
+
of comparison to perform. It must be a metadata string with :ref:`one of the
20382
+
supported integer condition code values <icmp_md_cc>`. The fifth operand is the
20383
+
explicit vector length of the operation.
20384
+
20385
+
Semantics:
20386
+
""""""""""
20387
+
20388
+
The '``llvm.vp.icmp``' compares its first two operands according to the
20389
+
condition code given as the third operand. The operands are compared element by
20390
+
element on each enabled lane, where the the semantics of the comparison are
20391
+
defined :ref:`according to the condition code <icmp_md_cc_sem>`. Masked-off
20392
+
lanes are undefined.
20393
+
20394
+
Examples:
20395
+
"""""""""
20396
+
20397
+
.. code-block:: llvm
20398
+
20399
+
%r = call <4 x i1> @llvm.vp.icmp.v4i32(<4 x i32> %a, <4 x i32> %b, metadata !"ne", <4 x i1> %mask, i32 %evl)
20400
+
;; For all lanes below %evl, %r is lane-wise equivalent to %also.r
20401
+
20402
+
%t = icmp ne <4 x i32> %a, %b
20403
+
%also.r = select <4 x i1> %mask, <4 x i1> %t, <4 x i1> undef
0 commit comments