GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
arc Performance Win

ARC: Improve conditional moves for better DImode shifts

ARC architecture improved conditional move instructions, benefiting DImode shifts and register allocation.

This patch enhances the ARC architecture’s instruction set by adding an alternative to the movsicc_insn. This allows operands of conditional moves to be swapped by reversing the condition, improving register allocation and notably optimizing the expansion of DImode shifts. The change is verified with new test cases.

In Details

The ARC backend's instruction selection for *movsicc_insn in config/arc/arc.md has been updated. An alternative pattern is introduced that leverages the %D operand constraint. This enables the reordering of register operands by inverting the condition, which is particularly beneficial for optimizing complex patterns like DImode shifts by potentially reducing register pressure and instruction count.

For Context
ARC
A family of 32-bit and 64-bit RISC processor architectures developed by ARC International (now Synopsys).
conditional move
An instruction that moves data from a source to a destination only if a specified condition is met.
DImode
In GCC's internal representation, 'DI' mode typically refers to double-word integers (64 bits on many architectures).
SImode
In GCC's internal representation, 'SI' mode typically refers to single-word integers (32 bits on many architectures).
register allocation
The process by which the compiler assigns program variables and temporary values to the limited set of hardware registers available on a CPU.
instruction selection
The compiler phase responsible for choosing specific machine instructions to implement higher-level operations.
Filed Under: arcoptimizationriscinstruction selection