aarch64: Simplify operand field specification
Replaces enum-based field kind tracking with direct struct usage for clearer AArch64 opcode definitions.
This commit removes the indirection of aarch64_field_kind by directly using aarch64_field structs for AArch64 instruction operands. It introduces macro defines to map old enum names to the new struct values, facilitating a smoother transition. This change simplifies code readability by eliminating the need to cross-reference separate tables to determine opcode bit usage, addressing a long-standing issue with architecture complexity.
In Details
This patch tackles the complexity in AArch64 instruction decoding by moving away from an enum-based aarch64_field_kind to direct usage of aarch64_field structs. It introduces compatibility macros to ease the transition. The core issue addressed is the increasing difficulty in mapping field names to their specific bit positions within opcodes, a problem exacerbated by architectural additions. By using structs directly, the code becomes more self-contained and easier to understand, reducing reliance on external lookup tables.
- aarch64_field_kind
- An enumeration that previously represented the type or kind of a field within an AArch64 instruction's operand. This commit replaces it with a more direct structure-based approach.
- aarch64_field struct
- A structure that defines the properties and bit positions of a field within an AArch64 instruction operand. This replaces the previous enum-based system for better clarity and directness.
- opcode
- The part of a machine language instruction that specifies the operation to be performed. Opcode parsing involves breaking down instructions into their constituent parts, including operands and fields.