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

s390: Add vector multiply-and-add over integers

Introduces hardware acceleration for vector multiply-and-add on s390 with integer types.

The GCC compiler now supports the VMAL instruction on s390 architecture, enabling vector multiply-and-add operations for integer vector modes and TI mode. This feature, available on processors with VXE3/z17 extensions, significantly accelerates computations involving parallel multiplication and addition. The implementation includes adding the instruction pattern, adjusting RTX costs for constants, and providing new test cases.

This brings performance improvements for scientific and data-processing workloads on s390 by leveraging new hardware capabilities.

In Details

GCC's s390 backend gains support for the VMAL (Vector Multiply-AND-ADD) instruction through a new insn pattern in config/s390/vector.md. This instruction operates on integer vector modes and TI mode (128-bit integer). To ensure correct instruction selection, s390_rtx_costs has been updated: constant vectors loaded via single instructions like vzero are costed at COSTS_N_INSNS(1), while others incur a penalty via constant pool loading (COSTS_N_INSNS(2)). Multiply-and-add costs match multiply-only costs. Helper functions legitimate_reload_vector_constant_p and `s390_legitimate_c…

For Context
s390
A mainframe computer architecture developed by IBM, often used in enterprise environments. GCC supports compiling code for this architecture.
vector multiply-and-add
A single instruction that performs a multiplication of two vectors and adds a third vector to the result, all in parallel. This is common in digital signal processing and scientific computing.
RTX
Register Transfer Language. An intermediate representation used in GCC that describes operations on registers and memory. Optimizations often operate on RTL.
TI mode
A GCC internal mode representing a 128-bit integer type, often used for emulating larger integer types or for specific hardware instructions.
Filed Under: s390vectorizationperformance