[llvm] Vector masked extract last active element intrinsic (PR #113587)
Paul Walker via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 7 05:42:41 PST 2024
================
@@ -19956,6 +19956,36 @@ the follow sequence of operations:
The ``mask`` operand will apply to at least the gather and scatter operations.
+'``llvm.experimental.vector.masked.extract.last.active``' Intrinsic
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+This is an overloaded intrinsic.
+
+This intrinsic will extract the value from a single lane of a vector, based
+on a supplied mask vector.
+
+::
+
+ declare i32 @llvm.experimental.vector.masked.extract.last.active.v4i32(<4 x i32> %data, <4 x i1> %mask, i32 %passthru)
+ declare i16 @llvm.experimental.vector.masked.extract.last.active.nxv8i16(<vscale x 8 x i16> %data, <vscale x 8 x i1> %mask, i16 %passthru)
+
+Arguments:
+""""""""""
+
+The first argument is the data vector to extract a lane from. The second is a
+mask vector controlling the extraction. The third argument is a passthru
+value.
+
+The two input vectors must have the same number of elements, and the type of
+the passthru value must match that of the elements of the data vector.
+
+Semantics:
+""""""""""
+
+The '``llvm.experimental.vector.masked.extract.last.active``' intrinsic will
+find the index of the most significant active lane in the mask vector, and
----------------
paulwalker-arm wrote:
Not sure "most significant" makes sense when talking about vectors because their lanes are already numbered in a target independent way. What do you think about "...will extract an element from the data vector at the index matching the highest lane of the mask vector that is active"?
https://github.com/llvm/llvm-project/pull/113587
More information about the llvm-commits
mailing list