[committed v2 0/4] aarch64: use enums in generated tables
Richard Earnshaw
rearnsha@arm.com
Mon Jul 21 17:19:52 GMT 2025
The auto-generated files for aarch64 use index values into tables, but
these are unstable if changes are made to the opcode or operand
tables. This can lead to very large diffs when adding a few new
instructions. It also makes the tables nearly impossible to reason
about if using a debugger or reading the source code in general.
This patch series changes the code to use enumerated constants for the
table indices, with the benefit that these are stable, so will change
rarely, if at all, and much more comprehensible if you're looking at
the source code.
The diffs for the generated code accompanying this patch are obviously
very large, but hopefully this will be the last time this needs to
happen.
By way of example, if I take Ezra's most recent change to add
FEAT_SVE_AES2 the diffs in the generated files were over 11,000 lines
long. If the change in this patch were in place, the diffs in the
generated files shrink to a mere 275 lines.
--------
Changes since v1. Mostly addressing feedback from Alice. Some
additional formatting cleanups. Drop the generated insruction name
comments: they convey less information than the enumerated labels
so are now redundant.
[The generated files are necessarily very large. I've not included
them here as they significantly exceed the list limit and they won't
help the CI anyway as the patch has already been committed.]
Richard Earnshaw (4):
aarch64: minor code cleanups to aarch64-gen.c
aarch64: Fix operand name MOPS_WB_Rd -> MOPS_WB_Rn
aarch64: use an enumeration for operand indices.
aarch64: Use an enum to refer to indices in the opcode table
--
2.43.0
More information about the Binutils
mailing list