GCC Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
alpha Performance Win

Provide movmisalign patterns for scalar integer modes

Alpha backend now supports unaligned scalar memory moves, improving code generation.

This commit adds support for unaligned memory move operations for scalar integer modes on the Alpha architecture. Previously, only vector modes had movmisalign patterns, forcing small memcpy operations to be expanded inefficiently with stack slots or byte-by-byte copies. By extending movmisalign to scalar modes and deriving access size from the mode, small memory operations are now folded directly into unaligned loads/stores, eliminating unnecessary stack usage and improving performance.

In Details

The alpha_expand_movmisalign function was modified to iterate over scalar integer modes (HImode, SImode, DImode) and determine the access size from the mode itself, rather than assuming 8 bytes. The MISALIGN mode iterator in alpha.md was updated to include these scalar modes. This allows gimple_fold_builtin_memory_op to fold small memcpy operations into unaligned loads or stores, avoiding the creation of stack slots and inefficient by-pieces expansion, especially on BWX targets.

For Context
movmisalign
A machine instruction or pattern that allows memory access without strict alignment requirements.
scalar integer modes
Compiler internal representations for integer data types of various sizes (e.g., short, int, long) that are not part of a vector.
gimple_fold_builtin_memory_op
A GCC function that attempts to optimize memory operations, such as memcpy, by folding them into simpler load/store instructions when possible.
STRICT_ALIGNMENT
A compiler target option that enforces strict memory alignment rules.
BWX
Byte Word Extend, a set of Alpha instructions that enhance performance for operations involving byte and word access.
leaf function
A function that does not call any other functions.
Filed Under: alphaoptimizationunaligned accesscode generation