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

arm: Thumb2 register preferencing for VFP movsi variant

Improves register allocation for Thumb2 VFP movsi operations, reducing spills.

This commit refines register preferencing for the Thumb2 variant of the movsi instruction when using VFP registers. It addresses an issue where the compiler previously hid alternatives from the register allocator, potentially leading to unnecessary spills and reloads between core and VFP registers. The changes aim to align Thumb2 behavior more closely with ARM (A32) mode to improve register utilization.

In Details

The Thumb2 thumb2_movsi_vfp pattern in config/arm/vfp.md previously obscured many alternatives from the register preferencing mechanism. This could lead the register allocator (LRA) to spill and reload values unnecessarily when transferring data between core and VFP registers. This patch modifies the pattern to expose more of these alternatives, bringing its register handling closer to that of the ARM (A32) mode and mitigating potential LRA disparagement of these alternatives.

For Context
Thumb2
A mixed 16-bit and 32-bit instruction set architecture for ARM processors, designed to provide denser code than the original 32-bit ARM (A32) instructions while retaining performance.
VFP
Vector Floating-Point. An extension to the ARM architecture that provides hardware support for floating-point arithmetic, including single and double precision operations.
movsi
A mnemonic for a move instruction that operates on a scalar integer value. In this context, it refers to moving a single-precision floating-point value.
register preferencing
A compiler optimization technique where the register allocator is guided to prefer certain registers or register classes for specific variables or instructions, aiming to improve performance by reducing memory accesses.
LRA
Live Range Analysis. A phase in register allocation that determines the scope of variables (their live ranges) to efficiently assign them to hardware registers.
Filed Under: armthumb2vfpregister-allocationoptimization