[PATCH] D136088: [AArch64]SME2 instructions that use ZTO operand

Paul Walker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 2 11:13:18 PDT 2022


paulwalker-arm added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp:4325-4326
+
+  if (!Name.equals_insensitive("zt0"))
+    return MatchOperand_NoMatch;
+
----------------
CarolineConcatto wrote:
> paulwalker-arm wrote:
> > Is this required? now that `matchRegisterNameAlias` is being used I expect its `(RegNum == 0)` check to be enough? 
> I still need the test here, because it could be also a scalar registers.
> Because it uses parseRegister, all registers will go through tryParseZTOperand, including the scalars, that use matchRegisterNameAlias. The only difference between the scalar and ZT is the name.
OK, I see what you mean.  In which case I believe this code it just masking a bug in `matchRegisterNameAlias` and shows you cannot rely on `MatchRegisterName` for zt0.  Instead we likely want something like
```
if (Name.equals_insensitive("zt0"))
    return Kind == RegKind::LookupTable ? AArch64::ZT0 : 0;
```
just after the `matchMatrixRegName` block.  I guess you could create `matchLookupTableRegName` but given there's only one it doesn't seem worth it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136088



More information about the llvm-commits mailing list