aarch64: Tweak priorities of parsing-related errors
authorRichard Sandiford <richard.sandiford@arm.com>
Thu, 30 Mar 2023 10:09:08 +0000 (11:09 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Thu, 30 Mar 2023 10:09:08 +0000 (11:09 +0100)
commit1be1148d797dbb24fc866a9f9a98c85085db10c4
tree701c25f49a030f068d853da5cc88bd6b214c5a76
parentb5b4f6654515c93e131578045260d2dc8c6caeee
aarch64: Tweak priorities of parsing-related errors

There are three main kinds of error reported during parsing,
in increasing order of priority:

- AARCH64_OPDE_RECOVERABLE (register seen instead of immediate)
- AARCH64_OPDE_SYNTAX_ERROR
- AARCH64_OPDE_FATAL_SYNTAX_ERROR

This priority makes sense when comparing errors reported against the
same operand.  But if we get to operand 3 (say) and see a register
instead of an immediate, that's likely to be a better match than
something that fails with a syntax error at operand 1.

The idea of this patch is to prioritise parsing-related errors
based on operand index first, then by error code.  Post-parsing
errors still win over parsing errors, and their relative priorities
don't change.
gas/config/tc-aarch64.c
gas/testsuite/gas/aarch64/sme-8-illegal.l