aarch64: Add support for vgx2 and vgx4
authorRichard Sandiford <richard.sandiford@arm.com>
Thu, 30 Mar 2023 10:09:11 +0000 (11:09 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Thu, 30 Mar 2023 10:09:11 +0000 (11:09 +0100)
commite2dc4040f30caba49d2bb7bd1d5119dd8a72cdba
tree0cfebab3ae6d8f57a7e9f44c876059922ec076d7
parent90cd80f8c24f9919a10117aa93fc570ac8b7767a
aarch64: Add support for vgx2 and vgx4

Many SME2 instructions operate on groups of 2 or 4 ZA vectors.
This is indicated by adding a "vgx2" or "vgx4" group size to the
ZA index.  The group size is optional in assembly but preferred
for disassembly.

There is not a binary distinction between mnemonics that have
group sizes and mnemonics that don't, nor between mnemonics that
take vgx2 and mnemonics that take vgx4.  We therefore get better
error messages if we allow any ZA index to have a group size
during parsing, and wait until constraint checking to reject
invalid sizes.

A quirk of the way errors are reported means that if an instruction
is wrong both in its qualifiers and its use of a group size, we'll
print suggested alternative instructions that also have an incorrect
group size.  But that's a general property that also applies to
things like out-of-range immediates.  It's also not obviously the
wrong thing to do.  We need to be relatively confident that we're
looking at the right opcode before reporting detailed operand-specific
errors, so doing qualifier checking first seems resonable.
15 files changed:
gas/config/tc-aarch64.c
gas/testsuite/gas/aarch64/sme-2-illegal.l
gas/testsuite/gas/aarch64/sme-2-illegal.s
gas/testsuite/gas/aarch64/sme-3-illegal.l
gas/testsuite/gas/aarch64/sme-3-illegal.s
gas/testsuite/gas/aarch64/sme-5-illegal.l
gas/testsuite/gas/aarch64/sme-5-illegal.s
gas/testsuite/gas/aarch64/sme-6-illegal.l
gas/testsuite/gas/aarch64/sme-6-illegal.s
gas/testsuite/gas/aarch64/sme-7-illegal.l
gas/testsuite/gas/aarch64/sme-7-illegal.s
gas/testsuite/gas/aarch64/sme-9-illegal.l
gas/testsuite/gas/aarch64/sme-9-illegal.s
include/opcode/aarch64.h
opcodes/aarch64-opc.c