[PATCH] D94708: [IR] Introduce llvm.experimental.vector.splice intrinsic

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 20 07:15:49 PST 2021


sdesmalen added inline comments.


================
Comment at: llvm/docs/LangRef.rst:16242
+
+The first two operands are vectors with the same type. The third argument
+``trailing.elts`` is an integer constant that specifies the number of trailing
----------------
I expect that we want to support two flavours of the splice intrinsic:

  // in flavour1 an immediate of '3' translates to the number of trailing elements,
  // e.g. start index of VL - 3 == 'B'.
  experimental.vector.splice.flavour1(<A,B,C,D>, <E,F,G,H>, 3) ==> <B, C, D, E>

  // in flavour2 an immediate of '1' translates to the start index 1 == 'B'.
  experimental.vector.splice.flavour2(<A,B,C,D>, <E,F,G,H>, 1) ==> <B, C, D, E>

This patch implements only flavour1, and because trailing.elts should be an immediate it is not possible to express flavour2. Do we want to add flavour2 as well at some point? And if so, what would it be named?

Alternatively, it seems possible to express both with the current splice intrinsic where the sign of the immediate distinguishes the two flavours, e.g. a start index of `-3` would 'wrap' by VL to index 1, and thus have the same meaning as `3` in flavour1, whereas a positive immediate of `1` would mean index 1, as in flavour 2).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D94708/new/

https://reviews.llvm.org/D94708



More information about the llvm-commits mailing list