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
Copy file name to clipboardExpand all lines: llvm/docs/LangRef.rst
+61Lines changed: 61 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17856,6 +17856,67 @@ Example:
17856
17856
%also.r = select <4 x i1> %cond, <4 x i32> %on_true, <4 x i32> %on_false
17857
17857
17858
17858
17859
+
.. _int_vp_merge:
17860
+
17861
+
'``llvm.vp.merge.*``' Intrinsics
17862
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17863
+
17864
+
Syntax:
17865
+
"""""""
17866
+
This is an overloaded intrinsic.
17867
+
17868
+
::
17869
+
17870
+
declare <16 x i32> @llvm.vp.merge.v16i32 (<16 x i1> <condition>, <16 x i32> <on_true>, <16 x i32> <on_false>, i32 <pivot>)
17871
+
declare <vscale x 4 x i64> @llvm.vp.merge.nxv4i64 (<vscale x 4 x i1> <condition>, <vscale x 4 x i64> <on_true>, <vscale x 4 x i64> <on_false>, i32 <pivot>)
17872
+
17873
+
Overview:
17874
+
"""""""""
17875
+
17876
+
The '``llvm.vp.merge``' intrinsic is used to choose one value based on a
17877
+
condition vector and an index operand, without IR-level branching.
17878
+
17879
+
Arguments:
17880
+
""""""""""
17881
+
17882
+
The first operand is a vector of ``i1`` and indicates the condition. The
17883
+
second operand is the value that is merged where the condition vector is true.
17884
+
The third operand is the value that is selected where the condition vector is
17885
+
false or the lane position is greater equal than the pivot. The fourth operand
17886
+
is the pivot.
17887
+
17888
+
#. The optional ``fast-math flags`` marker indicates that the merge has one or
17889
+
more :ref:`fast-math flags <fastmath>`. These are optimization hints to
17890
+
enable otherwise unsafe floating-point optimizations. Fast-math flags are
17891
+
only valid for merges that return a floating-point scalar or vector type,
17892
+
or an array (nested to any depth) of floating-point scalar or vector types.
17893
+
17894
+
Semantics:
17895
+
""""""""""
17896
+
17897
+
The intrinsic selects lanes from the second and third operand depending on a
17898
+
condition vector and pivot value.
17899
+
17900
+
For all lanes where the condition vector is true and the lane position is less
17901
+
than ``%pivot`` the lane is taken from the second operand. Otherwise, the lane
17902
+
is taken from the third operand.
17903
+
17904
+
Example:
17905
+
""""""""
17906
+
17907
+
.. code-block:: llvm
17908
+
17909
+
%r = call <4 x i32> @llvm.vp.merge.v4i32(<4 x i1> %cond, <4 x i32> %on_true, <4 x i32> %on_false, i32 %pivot)
17910
+
17911
+
;;; Expansion.
17912
+
;; Lanes at and above %pivot are taken from %on_false
0 commit comments