binutils Newspaper
NOVEMBER 30, 2026
aarch64 — Proposed

aarch64: Fix incorrect opcode masks

Corrects overly permissive masks for `ldp`/`stp` and `stllrh` opcodes.

This patch corrects the opcode masks for ldp/stp (offset) and stllrh in aarch64-dis-2.c. The previous masks were too lax, but fixing them does not alter decode behavior due to the priority of earlier opcode table entries. These corrections ensure that the masks accurately reflect the intended instruction encodings, preventing potential ambiguities.

In Details

The patch addresses inaccuracies in opcode masks within aarch64-dis-2.c. Specifically, the masks for ldp/stp (offset variants) and stllrh were too broad. While the fixes don't change the current disassembly output because of the opcode table's priority ordering (meaning more specific entries are matched first), they correct the underlying definitions of these instructions' bit patterns.

For Context
opcode mask
A bitmask used to selectively extract or check specific bits within an instruction's binary representation (opcode) to identify the instruction or its variant.
ldp/stp
Load-Pair and Store-Pair instructions in ARM architecture, used to load or store two registers with a single instruction.
stllrh
Store-Linked-Register-Half, likely an AArch64 instruction for atomic operations on half-words.
Filed Under: aarch64binutilsdisassembleropcode