GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
gcc/aarch64

aarch64: Route print operands through a shared lookup table

AArch64 print operand handling is refactored into a lookup table for better extensibility.

This commit restructures the AArch64 print operand dispatch mechanism by moving from a large switch statement to a shared lookup table. This change enables the use of named, internal-only print operands, as required by subsequent cleanups for SIMD and SME instructions. The table registers both existing public modifiers (like %w0) and new named modifiers, while also tracking their accessibility to user assembly, providing a more flexible and organized approach to operand formatting.

In Details

This commit refactors aarch64.cc to replace the large switch statement in aarch64_print_operand with a lookup table (aarch64_print_operands_table) populated from aarch64-print-operands.def. This table maps both symbolic and numeric operand specifiers to internal enum values and flags. It allows for better handling of named, potentially internal-only, print operands, as needed for SIMD and SME cleanups. Existing single-character modifiers like %w0 are preserved, while new syntax like %[NAME:ARG] is introduced. User assembly access control is also integrated into the table.

For Context
print operand
A mechanism within GCC's machine descriptions that defines how operands should be formatted when generating assembly code.
dispatch mechanism
The system or logic used by the compiler to select the correct code or function to handle a specific operation or operand.
lookup table
A data structure that stores key-value pairs, allowing for efficient retrieval of a value based on its associated key.
user assembly
Assembly code written directly by the programmer within C/C++ source code using inline assembly constructs.
machine description
Configuration files used by GCC to describe the instruction set, registers, and other architecture-specific details of a target processor.
Filed Under: aarch64codegenrefactorprint operand