[llvm] [RISCV] Initial codegen support for the XRivosVizip extension (PR #131933)
Luke Lau via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 28 01:42:49 PDT 2025
================
@@ -4611,6 +4613,43 @@ static bool isElementRotate(std::array<std::pair<int, int>, 2> &SrcInfo,
SrcInfo[1].second - SrcInfo[0].second == (int)NumElts;
}
+static bool isAlternating(std::array<std::pair<int, int>, 2> &SrcInfo,
+ ArrayRef<int> Mask, bool &Polarity) {
+ int NumElts = Mask.size();
+ bool NonUndefFound = false;
+ for (unsigned i = 0; i != Mask.size(); ++i) {
+ int M = Mask[i];
+ if (M < 0)
+ continue;
+ int Src = M >= (int)NumElts;
+ int Diff = (int)i - (M % NumElts);
+ bool C = Src == SrcInfo[1].first && Diff == SrcInfo[1].second;
----------------
lukel97 wrote:
Just to check my understanding, can we assert that
```c++
assert((Src == SrcInfo[0].first && Diff = SrcInfo[0].second) || (Src == SrcInfo[1].first && Diff == SrcInfo[1].second));
```
https://github.com/llvm/llvm-project/pull/131933
More information about the llvm-commits
mailing list