[PATCH 0/6] aarch64: use an enumeration for operand indicees.
Richard Earnshaw
rearnsha@arm.com
Fri Jul 18 10:03:55 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.
I'll push this next week unless I hear back something that changes my
mind.
[The generated files this time are necessarily very large. I hope they
don't get blocked by mailing list limits]
Richard Earnshaw (6):
aarch64: Fix operand name MOPS_WB_Rd -> MOPS_WB_Rn
Regenerated
aarch64: use an enumeration for operand indices.
Regenerated
aarch64: Use an enum to refer to indices in the opcode table
aarch64: regenerate files following previous change.
opcodes/Makefile.am | 10 +-
opcodes/Makefile.in | 10 +-
opcodes/aarch64-asm-2.c | 2001 ++++----
opcodes/aarch64-dis-2.c | 10328 ++++++++++++++++++++++----------------
opcodes/aarch64-gen.c | 213 +-
opcodes/aarch64-opc-2.c | 178 +-
opcodes/aarch64-tbl-2.h | 3847 ++++++++++++++
opcodes/aarch64-tbl.h | 2 +-
8 files changed, 10983 insertions(+), 5606 deletions(-)
create mode 100644 opcodes/aarch64-tbl-2.h
--
2.43.0
More information about the Binutils
mailing list