GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
libstdc++

libstdc++: Implement C++23 carry-less multiplication (std::clmul)

Adds C++23 support for carry-less multiplication operations in the standard library.

This change introduces the non-SIMD implementation of std::clmul and related utilities to libstdc++. Aligned with the C++23 proposal P3642R7, this feature provides support for carry-less multiplication, a fundamental operation in cryptographic and polynomial arithmetic. The implementation includes a new std::wide_result class and std::widening_clmul and std::clmul function templates, with exported symbols for C++29.

In Details

This commit adds the C++23 std::clmul functionality to libstdc++, specifically the non-SIMD path. It implements the std::wide_result class and the std::widening_clmul and std::clmul function templates as described in the P3642R7 paper. The changes involve adding new definitions to bits/version.def, numeric, and exporting them for C++29 in std::*.cc.in. A test case is also added to testsuite/26_numerics/clmul/1.cc.

For Context
std::clmul
A C++ standard library function providing carry-less multiplication, used in algorithms involving polynomials and cryptography.
Carry-less multiplication
A multiplication operation where carries are not propagated from one bit position to the next, commonly used in finite field arithmetic.
libstdc++
The C++ standard library implementation used by GCC.
P3642R7
A C++ proposal document detailing the addition of carry-less multiplication to the C++ standard library.
SIMD
Single Instruction, Multiple Data. A class of parallel computer architectures that achieve speedup by processing multiple data streams simultaneously with a single instruction.
Filed Under: gcclibstdc++c++23cryptography