GCC Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
i386

Use %w operand modifier for ROLW bswaphisi2_lowpart alternative.

Fixes incorrect operand size handling for ROLW instruction on i386.

This change corrects an issue on the i386 architecture where the bswaphisi2_lowpart alternative for the ROLW instruction was not using the correct operand size modifier. By introducing the %w operand modifier, the compiler now correctly emits a HImode register name, resolving a bug reported in PR126685.

In Details

The i386 backend's machine description (i386.md) for the bswaphisi2_lowpart RTX pattern now uses the %w operand modifier when specifying the ROIW alternative. This ensures that the 16-bit register is correctly referenced, fixing a bug where it was potentially emitting a 32-bit register name instead.

For Context
i386
The Intel 80386 microprocessor, a foundational 32-bit processor for which GCC provides specific code generation support.
ROIW
A specific instruction on the i386 architecture that performs a rotate left operation on a word (16-bit register).
operand modifier
A character appended to an operand in assembly or machine description syntax to specify its size or other properties. '%w' typically indicates a word (16-bit) operand.
HImode
GCC's internal representation for a short integer, typically 16 bits.
RTX
RePresentation EXternals, GCC's internal intermediate representation for abstract machine operations.
Filed Under: i386code generation