binutils Newspaper
NOVEMBER 30, 2026
aarch64 — Proposed

aarch64: Cleanup add/sub immediate decode

Improves AArch64 ADD/SUB immediate decoding by using a specific bit, avoiding linear scans.

This patch enhances the AArch64 instruction decoder by incorporating bit 23 into the mask for ADD/SUB immediate instructions. This change allows the decoder to more accurately distinguish between similar opcodes, preventing a linear scan through multiple table entries and improving decoding performance.

In Details

This patch modifies opcodes/aarch64-dis-2.c to refine the decoding logic for AArch64 ADD and SUB instructions that use immediate operands. It introduces a check against bit 23 of the instruction word as part of the mask, enabling the decoder to differentiate these opcodes more effectively. This avoids a fallback linear scan through opcode table entries, speeding up disassembly.

For Context
Immediate Operand
An operand whose value is specified directly within the instruction itself, rather than being fetched from a register or memory location.
Opcode Mask
A bitmask used during instruction decoding to isolate specific bits of the instruction word that determine the instruction's operation or format.
AArch64
The 64-bit ARM architecture instruction set.
Disassembler
A program that translates machine code (binary instructions) back into human-readable assembly language.
Filed Under: aarch64binutilsdisassemblerperformance