aarch64: Deprioritise AARCH64_OPDE_REG_LIST

SME2 has many instructions that take a list of SVE registers.
There are often multiple forms, with different forms taking
different numbers of registers.

This means that if, after a successful parse and qualifier match,
we find that the number of registers does not match the opcode entry,
the associated error should have a lower priority/severity than other
errors reported at the same stage.  For example, if there are 2-register
and 4-register forms of an instruction, and if the assembly code uses
the 2-register form with an out-of-range value, the out-of-range value
error against the 2-register instruction should have a higher priority
than the "wrong number of registers" error against the 4-register
instruction.

This is tested by the main SME2 patches, but seemed worth splitting out.
This commit is contained in:
Richard Sandiford
2023-03-30 11:09:07 +01:00
parent c1817dc2ee
commit 36043bcff4
2 changed files with 12 additions and 8 deletions

View File

@@ -1284,6 +1284,14 @@ struct aarch64_inst
No syntax error, but the operands are not a valid combination, e.g.
FMOV D0,S0
The following errors are only reported against an asm string that is
syntactically valid and that has valid operand qualifiers.
AARCH64_OPDE_REG_LIST
Error about the register list operand having an unexpected number of
registers. This error is low severity because there might be another
opcode entry that supports the given number of registers.
AARCH64_OPDE_UNTIED_IMMS
The asm failed to use the same immediate for a destination operand
and a tied source operand.
@@ -1299,10 +1307,6 @@ struct aarch64_inst
Error about some immediate value not properly aligned (i.e. not being a
multiple times of a certain value).
AARCH64_OPDE_REG_LIST
Error about the register list operand having unexpected number of
registers.
AARCH64_OPDE_OTHER_ERROR
Error of the highest severity and used for any severe issue that does not
fall into any of the above categories.
@@ -1330,11 +1334,11 @@ enum aarch64_operand_error_kind
AARCH64_OPDE_SYNTAX_ERROR,
AARCH64_OPDE_FATAL_SYNTAX_ERROR,
AARCH64_OPDE_INVALID_VARIANT,
AARCH64_OPDE_REG_LIST,
AARCH64_OPDE_UNTIED_IMMS,
AARCH64_OPDE_UNTIED_OPERAND,
AARCH64_OPDE_OUT_OF_RANGE,
AARCH64_OPDE_UNALIGNED,
AARCH64_OPDE_REG_LIST,
AARCH64_OPDE_OTHER_ERROR
};