GCC Newspaper
JULY 29, 2026
Date
/
Architectures
Components
Topics
News & Policy
s390x Performance Win

s390x: Implement vec_cbranch_{all,any}

Early-exit vectorization enabled for s390x by implementing vec_cbranch instructions.

The s390x GCC backend now implements vec_cbranch_all and vec_cbranch_any instructions, enabling early-exit vectorization. This allows the compiler to terminate vector operations as soon as a condition is met, potentially improving performance. The test suite has been adjusted to account for s390x’s limitations with variable-length vectors and basic vector load schemes.

In Details

This commit introduces support for vec_cbranch_all(<mode>) and vec_cbranch_any(<mode>) vector instructions on the s390x backend. These instructions facilitate early-exit vectorization by allowing a vector operation to conditionally branch out based on the results of a vector comparison, rather than processing the entire vector. The test suite is updated to reflect s390x's specific vector capabilities, such as the lack of variable-length vectors and support for only basic vector load schemes.

For Context
s390x
The GCC target backend for IBM's System/390 architecture, specifically the 64-bit version (z/Architecture).
vectorization
The compiler optimization that transforms a loop or sequence of operations to use SIMD (Single Instruction, Multiple Data) instructions, processing multiple data elements simultaneously for performance gains.
early-exit vectorization
A form of vectorization where the vector processing loop can terminate prematurely once a specific condition is met for any element, rather than processing all elements unconditionally.
variable length vectors
A feature in some vector instruction set architectures that allows vector registers to hold varying numbers of elements depending on the data type and the register size. s390x does not support this.
Filed Under: s390xvectorizationoptimization