[llvm] [CodeGen] Add MO_LaneMask type and a new COPY_LANEMASK instruction (PR #151944)
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 17 02:29:35 PST 2025
================
@@ -2873,6 +2876,32 @@ bool MIParser::parseCustomRegisterMaskOperand(MachineOperand &Dest) {
return false;
}
+bool MIParser::parseLaneMaskOperand(MachineOperand &Dest) {
+ assert(Token.is(MIToken::kw_lanemask));
+
+ lex();
+ if (expectAndConsume(MIToken::lparen))
+ return true;
+
+ LaneBitmask LaneMask = LaneBitmask::getAll();
+ // Parse lanemask.
+ if (Token.isNot(MIToken::IntegerLiteral) && Token.isNot(MIToken::HexLiteral))
+ return error("expected a valid lane mask value");
+ static_assert(sizeof(LaneBitmask::Type) == sizeof(uint64_t),
+ "Use correct get-function for lane mask.");
+ LaneBitmask::Type V;
+ if (getUint64(V))
+ return true;
+ LaneMask = LaneBitmask(V);
----------------
jayfoad wrote:
No need for the earlier declaration, you can just initialize it here.
```suggestion
LaneBitmask LaneMask(V);
```
https://github.com/llvm/llvm-project/pull/151944
More information about the llvm-commits
mailing list