[llvm] [ARM][TableGen][MC] Change the ARM mnemonic operands to be optional for ASM parsing (PR #83436)
Alfie Richards via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 6 05:12:20 PST 2024
================
@@ -5972,17 +6154,30 @@ ParseStatus ARMAsmParser::parseFPImm(OperandVector &Operands) {
// integer constant. Make sure we don't try to parse an FPImm
// for these:
// vmov.i{8|16|32|64} <dreg|qreg>, #imm
- ARMOperand &TyOp = static_cast<ARMOperand &>(*Operands[2]);
- bool isVmovf = TyOp.isToken() &&
- (TyOp.getToken() == ".f32" || TyOp.getToken() == ".f64" ||
- TyOp.getToken() == ".f16");
+
+ bool isVmovf = false;
+ unsigned MnemonicOpsEndInd = getMnemonicOpsEndInd(Operands);
+ for (unsigned I = 1; I < MnemonicOpsEndInd; ++I) {
+ ARMOperand &TyOp = static_cast<ARMOperand &>(*Operands[I]);
+ if (TyOp.isToken() &&
+ (TyOp.getToken() == ".f32" || TyOp.getToken() == ".f64" ||
+ TyOp.getToken() == ".f16")) {
+ isVmovf = true;
+ break;
+ }
+ }
+
ARMOperand &Mnemonic = static_cast<ARMOperand &>(*Operands[0]);
bool isFconst = Mnemonic.isToken() && (Mnemonic.getToken() == "fconstd" ||
Mnemonic.getToken() == "fconsts");
if (!(isVmovf || isFconst))
return ParseStatus::NoMatch;
- Parser.Lex(); // Eat '#' or '$'.
+ if (Parser.getTok().getKind() == llvm::AsmToken::Hash ||
----------------
AlfieRichardsArm wrote:
Ahh yes, thank you
https://github.com/llvm/llvm-project/pull/83436
More information about the llvm-commits
mailing list