[PATCH] D122873: tmp

yanming via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 31 23:56:45 PDT 2022


ym1813382441 created this revision.
Herald added a subscriber: jdoerfert.
Herald added a project: All.
ym1813382441 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D122873

Files:
  llvm/docs/LangRef.rst
  llvm/include/llvm/IR/Intrinsics.td
  llvm/test/Verifier/vp-intrinsics.ll


Index: llvm/test/Verifier/vp-intrinsics.ll
===================================================================
--- llvm/test/Verifier/vp-intrinsics.ll
+++ llvm/test/Verifier/vp-intrinsics.ll
@@ -47,13 +47,13 @@
   ret void
 }
 
-define void @test_vp_splice0(<8 x i32> %i0, <8 x i32> %i1, <8 x i1> %m, i32 %l0, i32 %l1) {
-  %r0 = call <8 x i32> @llvm.experimental.vp.splice.v8i32(<8 x i32> %i0, <8 x i32> %i1, i32 2, <8 x i1> %m, i32 %l0, i32 %l1)
+define void @test_vp_splice0(<8 x i32> %i0, <8 x i32> %i1, i32 %idx <8 x i1> %m, i32 %l0, i32 %l1) {
+  %r0 = call <8 x i32> @llvm.experimental.vp.splice.v8i32(<8 x i32> %i0, <8 x i32> %i1, i32 %idx, <8 x i1> %m, i32 %l0, i32 %l1)
   ret void
 }
 
-define void @test_vp_splice1(<vscale x 8 x i32> %i0, <vscale x 8 x i32> %i1, <vscale x 8 x i1> %m, i32 %l0, i32 %l1) {
-  %r0 = call <vscale x 8 x i32> @llvm.experimental.vp.splice.nxv8i32(<vscale x 8 x i32> %i0, <vscale x 8 x i32> %i1, i32 -1, <vscale x 8 x i1> %m, i32 %l0, i32 %l1)
+define void @test_vp_splice1(<vscale x 8 x i32> %i0, <vscale x 8 x i32> %i1, <vscale x 8 x i1> %m, i32 %idx, i32 %l0, i32 %l1) {
+  %r0 = call <vscale x 8 x i32> @llvm.experimental.vp.splice.nxv8i32(<vscale x 8 x i32> %i0, <vscale x 8 x i32> %i1, i32 %idx, <vscale x 8 x i1> %m, i32 %l0, i32 %l1)
   ret void
 }
 
Index: llvm/include/llvm/IR/Intrinsics.td
===================================================================
--- llvm/include/llvm/IR/Intrinsics.td
+++ llvm/include/llvm/IR/Intrinsics.td
@@ -1701,7 +1701,7 @@
              llvm_i32_ty,
              LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
              llvm_i32_ty, llvm_i32_ty],
-            [IntrNoMem, ImmArg<ArgIndex<2>>]>;
+            [IntrNoMem]>;
 
 //===-------------------------- Masked Intrinsics -------------------------===//
 //
Index: llvm/docs/LangRef.rst
===================================================================
--- llvm/docs/LangRef.rst
+++ llvm/docs/LangRef.rst
@@ -19782,8 +19782,8 @@
 
 ::
 
-      declare <2 x double> @llvm.experimental.vp.splice.v2f64(<2 x double> %vec1, <2 x double> %vec2, i32 %imm, <2 x i1> %mask, i32 %evl1, i32 %evl2)
-      declare <vscale x 4 x i32> @llvm.experimental.vp.splice.nxv4i32(<vscale x 4 x i32> %vec1, <vscale x 4 x i32> %vec2, i32 %imm, <vscale x 4 x i1> %mask, i32 %evl1, i32 %evl2)
+      declare <2 x double> @llvm.experimental.vp.splice.v2f64(<2 x double> %vec1, <2 x double> %vec2, i32 %idx, <2 x i1> %mask, i32 %evl1, i32 %evl2)
+      declare <vscale x 4 x i32> @llvm.experimental.vp.splice.nxv4i32(<vscale x 4 x i32> %vec1, <vscale x 4 x i32> %vec2, i32 %idx, <vscale x 4 x i1> %mask, i32 %evl1, i32 %evl2)
 
 Overview:
 """""""""
@@ -19795,12 +19795,12 @@
 """"""""""
 
 The result and the first two arguments ``vec1`` and ``vec2`` are vectors with
-the same type.  The third argument ``imm`` is an immediate signed integer that
+the same type.  The third argument ``idx`` is a signed integer that
 indicates the offset index.  The fourth argument ``mask`` is a vector mask and
 has the same number of elements as the result.  The last two arguments ``evl1``
 and ``evl2`` are unsigned integers indicating the explicit vector lengths of
-``vec1`` and ``vec2`` respectively.  ``imm``, ``evl1`` and ``evl2`` should
-respect the following constraints: ``-evl1 <= imm < evl1``, ``0 <= evl1 <= VL``
+``vec1`` and ``vec2`` respectively.  ``idx``, ``evl1`` and ``evl2`` should
+respect the following constraints: ``-evl1 <= idx < evl1``, ``0 <= evl1 <= VL``
 and ``0 <= evl2 <= VL``, where ``VL`` is the runtime vector factor. If these
 constraints are not satisfied the intrinsic has undefined behaviour.
 
@@ -19809,14 +19809,14 @@
 
 Effectively, this intrinsic concatenates ``vec1[0..evl1-1]`` and
 ``vec2[0..evl2-1]`` and creates the result vector by selecting the elements in a
-window of size ``evl2``, starting at index ``imm`` (for a positive immediate) of
+window of size ``evl2``, starting at index ``idx`` (for a positive integer) of
 the concatenated vector. Elements in the result vector beyond ``evl2`` are
-``undef``.  If ``imm`` is negative the starting index is ``evl1 + imm``.  The result
-vector of active vector length ``evl2`` contains ``evl1 - imm`` (``-imm`` for
-negative ``imm``) elements from indices ``[imm..evl1 - 1]``
-(``[evl1 + imm..evl1 -1]`` for negative ``imm``) of ``vec1`` followed by the
-first ``evl2 - (evl1 - imm)`` (``evl2 + imm`` for negative ``imm``) elements of
-``vec2``. If ``evl1 - imm`` (``-imm``) >= ``evl2``, only the first ``evl2``
+``undef``.  If ``idx`` is negative the starting index is ``evl1 + idx``.  The result
+vector of active vector length ``evl2`` contains ``evl1 - idx`` (``-idx`` for
+negative ``idx``) elements from indices ``[idx..evl1 - 1]``
+(``[evl1 + idx..evl1 -1]`` for negative ``idx``) of ``vec1`` followed by the
+first ``evl2 - (evl1 - idx)`` (``evl2 + idx`` for negative ``idx``) elements of
+``vec2``. If ``evl1 - idx`` (``-idx``) >= ``evl2``, only the first ``evl2``
 elements are considered and the remaining are ``undef``.  The lanes in the result
 vector disabled by ``mask`` are ``undef``.
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122873.419643.patch
Type: text/x-patch
Size: 5102 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220401/20cc704c/attachment.bin>


More information about the llvm-commits mailing list