GCC Newspaper
JUNE 15, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
gcc/s390

Add HF vector mode support to s390 secondary reload

This commit adds support for handling HF vector modes in the s390 backend's secondary reload mechanism.

This commit extends the s390 backend to properly handle HF (Half-Floating-point) vector modes during secondary reloads. Secondary reloads are needed for instructions that cannot accept relative operands. Without this change, the compiler could generate incorrect code when dealing with HF vectors, leading to runtime errors or unexpected behavior.

In Details

The s390_secondary_reload function in s390.cc handles reloading values into registers when instructions don't directly support memory operands. This commit adds cases for HF vector modes (V1HF, V2HF, V4HF, V8HF) to ensure correct register allocation and data movement. The ALL mode iterator in s390.md is also updated to include these modes, ensuring that the backend can properly process HF vector operations.

For Context

Compilers often need to move data between memory and registers before an instruction can operate on it. Sometimes, an instruction can't directly access data in memory and requires the data to be in a register. When the desired register is already in use, the compiler performs a "reload", moving the existing value to a different register or memory location. This commit ensures that this process works correctly for a specific data type (HF vector) on the s390 architecture, preventing potential errors.

Filed Under: s390vectorizationhalf-floatcode generation