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
Although there are predicated versions of minnum/maxnum, the ones for
minimum/maximum are currently missing. This patch introduces these
intrinsics and implements their lowering to RISC-V.
Copy file name to clipboardExpand all lines: llvm/docs/LangRef.rst
+100Lines changed: 100 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20394,6 +20394,106 @@ Examples:
20394
20394
%also.r = select <4 x i1> %mask, <4 x float> %t, <4 x float> poison
20395
20395
20396
20396
20397
+
.. _int_vp_minimum:
20398
+
20399
+
'``llvm.vp.minimum.*``' Intrinsics
20400
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
20401
+
20402
+
Syntax:
20403
+
"""""""
20404
+
This is an overloaded intrinsic.
20405
+
20406
+
::
20407
+
20408
+
declare <16 x float> @llvm.vp.minimum.v16f32 (<16 x float> <left_op>, <16 x float> <right_op>, <16 x i1> <mask>, i32 <vector_length>)
20409
+
declare <vscale x 4 x float> @llvm.vp.minimum.nxv4f32 (<vscale x 4 x float> <left_op>, <vscale x 4 x float> <right_op>, <vscale x 4 x i1> <mask>, i32 <vector_length>)
20410
+
declare <256 x double> @llvm.vp.minimum.v256f64 (<256 x double> <left_op>, <256 x double> <right_op>, <256 x i1> <mask>, i32 <vector_length>)
20411
+
20412
+
Overview:
20413
+
"""""""""
20414
+
20415
+
Predicated floating-point minimum of two vectors of floating-point values,
20416
+
propagating NaNs and treating -0.0 as less than +0.0.
20417
+
20418
+
Arguments:
20419
+
""""""""""
20420
+
20421
+
The first two operands and the result have the same vector of floating-point type. The
20422
+
third operand is the vector mask and has the same number of elements as the
20423
+
result vector type. The fourth operand is the explicit vector length of the
20424
+
operation.
20425
+
20426
+
Semantics:
20427
+
""""""""""
20428
+
20429
+
The '``llvm.vp.minimum``' intrinsic performs floating-point minimum (:ref:`minimum <i_minimum>`)
20430
+
of the first and second vector operand on each enabled lane, the result being
20431
+
NaN if either operand is a NaN. -0.0 is considered to be less than +0.0 for this
20432
+
intrinsic. The result on disabled lanes is a :ref:`poison value <poisonvalues>`.
20433
+
The operation is performed in the default floating-point environment.
20434
+
20435
+
Examples:
20436
+
"""""""""
20437
+
20438
+
.. code-block:: llvm
20439
+
20440
+
%r = call <4 x float> @llvm.vp.minimum.v4f32(<4 x float> %a, <4 x float> %b, <4 x i1> %mask, i32 %evl)
20441
+
;; For all lanes below %evl, %r is lane-wise equivalent to %also.r
20442
+
20443
+
%t = call <4 x float> @llvm.minimum.v4f32(<4 x float> %a, <4 x float> %b)
20444
+
%also.r = select <4 x i1> %mask, <4 x float> %t, <4 x float> poison
20445
+
20446
+
20447
+
.. _int_vp_maximum:
20448
+
20449
+
'``llvm.vp.maximum.*``' Intrinsics
20450
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
20451
+
20452
+
Syntax:
20453
+
"""""""
20454
+
This is an overloaded intrinsic.
20455
+
20456
+
::
20457
+
20458
+
declare <16 x float> @llvm.vp.maximum.v16f32 (<16 x float> <left_op>, <16 x float> <right_op>, <16 x i1> <mask>, i32 <vector_length>)
20459
+
declare <vscale x 4 x float> @llvm.vp.maximum.nxv4f32 (<vscale x 4 x float> <left_op>, <vscale x 4 x float> <right_op>, <vscale x 4 x i1> <mask>, i32 <vector_length>)
20460
+
declare <256 x double> @llvm.vp.maximum.v256f64 (<256 x double> <left_op>, <256 x double> <right_op>, <256 x i1> <mask>, i32 <vector_length>)
20461
+
20462
+
Overview:
20463
+
"""""""""
20464
+
20465
+
Predicated floating-point maximum of two vectors of floating-point values,
20466
+
propagating NaNs and treating -0.0 as less than +0.0.
20467
+
20468
+
Arguments:
20469
+
""""""""""
20470
+
20471
+
The first two operands and the result have the same vector of floating-point type. The
20472
+
third operand is the vector mask and has the same number of elements as the
20473
+
result vector type. The fourth operand is the explicit vector length of the
20474
+
operation.
20475
+
20476
+
Semantics:
20477
+
""""""""""
20478
+
20479
+
The '``llvm.vp.maximum``' intrinsic performs floating-point maximum (:ref:`maximum <i_maximum>`)
20480
+
of the first and second vector operand on each enabled lane, the result being
20481
+
NaN if either operand is a NaN. -0.0 is considered to be less than +0.0 for this
20482
+
intrinsic. The result on disabled lanes is a :ref:`poison value <poisonvalues>`.
20483
+
The operation is performed in the default floating-point environment.
20484
+
20485
+
Examples:
20486
+
"""""""""
20487
+
20488
+
.. code-block:: llvm
20489
+
20490
+
%r = call <4 x float> @llvm.vp.maximum.v4f32(<4 x float> %a, <4 x float> %b, <4 x i1> %mask, i32 %evl)
20491
+
;; For all lanes below %evl, %r is lane-wise equivalent to %also.r
20492
+
20493
+
%t = call <4 x float> @llvm.maximum.v4f32(<4 x float> %a, <4 x float> %b, <4 x i1> %mask, i32 %evl)
20494
+
%also.r = select <4 x i1> %mask, <4 x float> %t, <4 x float> poison
0 commit comments