GCC Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
s390x Performance Win

s390x: Optimize vec_perm intrinsic by folding into VEC_PERM_EXPR

Improves s390x vector permutation optimization by folding the vec_perm intrinsic.

The s390x backend now optimizes the vec_perm intrinsic by folding it into a VEC_PERM_EXPR. This allows the GCC optimizer to better process and optimize vector permutation operations, potentially leading to more efficient code generation for vector processing on s390x architectures.

In Details

The s390_gimple_fold_builtin function in config/s390/s390.cc has been implemented to recognize and fold the __builtin_s390_vec_perm intrinsic. By transforming this intrinsic call into a VEC_PERM_EXPR, it becomes amenable to the general GIMPLE optimization passes, enabling more effective optimizations for vector permutations on the s390x target, including the use of the vec_perm machine instruction.

For Context
s390x
A 64-bit extension of the IBM System/390 architecture, used in IBM's mainframe servers.
vec_perm intrinsic
A compiler intrinsic function that performs a permutation operation on vector data types, allowing elements to be rearranged according to a control mask.
VEC_PERM_EXPR
A GIMPLE (GCC's Intermediate Representation) expression representing a vector permutation operation, allowing for common optimizations.
GIMPLE
Gre<bos> Intermediate Representation, GCC's main internal representation for optimizations, designed to be simpler than the initial parse tree.
Filed Under: s390xoptimizationvectorgcc