diff options
author | Simeon K <5235180+simeonkr@users.noreply.github.com> | 2024-01-23 00:46:39 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-22 16:46:39 -0800 |
commit | 58cfd56356ed96690150245ca5bcf646d12edc7a (patch) | |
tree | 8ab1a66a74ad2aee15798c64d7e44b6e9abbf279 /llvm/docs/LangRef.rst | |
parent | 029bfd6329aee0b60761998986dadba38e1de6f3 (diff) | |
download | llvm-58cfd56356ed96690150245ca5bcf646d12edc7a.zip llvm-58cfd56356ed96690150245ca5bcf646d12edc7a.tar.gz llvm-58cfd56356ed96690150245ca5bcf646d12edc7a.tar.bz2 |
[VP][RISCV] Introduce llvm.vp.minimum/maximum intrinsics (#74840)
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.
Diffstat (limited to 'llvm/docs/LangRef.rst')
-rw-r--r-- | llvm/docs/LangRef.rst | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst index bc9cfb5..d58375c 100644 --- a/llvm/docs/LangRef.rst +++ b/llvm/docs/LangRef.rst @@ -20394,6 +20394,106 @@ Examples: %also.r = select <4 x i1> %mask, <4 x float> %t, <4 x float> poison +.. _int_vp_minimum: + +'``llvm.vp.minimum.*``' Intrinsics +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Syntax: +""""""" +This is an overloaded intrinsic. + +:: + + 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>) + 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>) + 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>) + +Overview: +""""""""" + +Predicated floating-point minimum of two vectors of floating-point values, +propagating NaNs and treating -0.0 as less than +0.0. + +Arguments: +"""""""""" + +The first two operands and the result have the same vector of floating-point type. The +third operand is the vector mask and has the same number of elements as the +result vector type. The fourth operand is the explicit vector length of the +operation. + +Semantics: +"""""""""" + +The '``llvm.vp.minimum``' intrinsic performs floating-point minimum (:ref:`minimum <i_minimum>`) +of the first and second vector operand on each enabled lane, the result being +NaN if either operand is a NaN. -0.0 is considered to be less than +0.0 for this +intrinsic. The result on disabled lanes is a :ref:`poison value <poisonvalues>`. +The operation is performed in the default floating-point environment. + +Examples: +""""""""" + +.. code-block:: llvm + + %r = call <4 x float> @llvm.vp.minimum.v4f32(<4 x float> %a, <4 x float> %b, <4 x i1> %mask, i32 %evl) + ;; For all lanes below %evl, %r is lane-wise equivalent to %also.r + + %t = call <4 x float> @llvm.minimum.v4f32(<4 x float> %a, <4 x float> %b) + %also.r = select <4 x i1> %mask, <4 x float> %t, <4 x float> poison + + +.. _int_vp_maximum: + +'``llvm.vp.maximum.*``' Intrinsics +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Syntax: +""""""" +This is an overloaded intrinsic. + +:: + + 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>) + 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>) + 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>) + +Overview: +""""""""" + +Predicated floating-point maximum of two vectors of floating-point values, +propagating NaNs and treating -0.0 as less than +0.0. + +Arguments: +"""""""""" + +The first two operands and the result have the same vector of floating-point type. The +third operand is the vector mask and has the same number of elements as the +result vector type. The fourth operand is the explicit vector length of the +operation. + +Semantics: +"""""""""" + +The '``llvm.vp.maximum``' intrinsic performs floating-point maximum (:ref:`maximum <i_maximum>`) +of the first and second vector operand on each enabled lane, the result being +NaN if either operand is a NaN. -0.0 is considered to be less than +0.0 for this +intrinsic. The result on disabled lanes is a :ref:`poison value <poisonvalues>`. +The operation is performed in the default floating-point environment. + +Examples: +""""""""" + +.. code-block:: llvm + + %r = call <4 x float> @llvm.vp.maximum.v4f32(<4 x float> %a, <4 x float> %b, <4 x i1> %mask, i32 %evl) + ;; For all lanes below %evl, %r is lane-wise equivalent to %also.r + + %t = call <4 x float> @llvm.maximum.v4f32(<4 x float> %a, <4 x float> %b, <4 x i1> %mask, i32 %evl) + %also.r = select <4 x i1> %mask, <4 x float> %t, <4 x float> poison + + .. _int_vp_fadd: '``llvm.vp.fadd.*``' Intrinsics |