P3642R4 — Carry-less product: std::clmul (8 items) LEWG
Jan Schultke
This paper proposes adding carry-less multiplication (XOR multiplication) functions to the C++ standard library in the header. It introduces std::clmul for non-widening carry-less multiplication and std::clmul_wide for a widening variant returning a wide_result struct containing low and high bits, along with std::simd overloads for SIMD vector types. The operation is motivated by applications in CRC computation, AES-GCM cryptography, JSON parsing, and space-filling curve generation, with widespread hardware support via PCLMULQDQ (x86), PMULL (ARM), and CLMUL (RISC-V) instructions.

References — Anthropic Citations API

[1]
"this proposal provides non-widening SIMD carry-less multiplication with the following signature: template constexpr V clmul(const V& v) noexcept; and the Returns clause: A basic_vec..."
[2]
"This is utilized in the reference implementation [BitPermutations] of std::bit_compressr, proposed in [P3104R3]."
[3]
"c_i = \bigoplus_{j = 0}^i x_i y_{i - j}"
[4]
"static constexpr V powers = array{ 0, 1, 2, 4, 8, /* ... */ };"
[5]
"Two consecutive identical rows: clmul u64 → u128 | pclmulqdq | pmull+pmull2 | clmul+clmulh"
[6]
""http://threadlocalmutex.com/?p=188"
Summary: P3642R4 proposes std::clmul, a carry-less multiplication function for unsigned integer types, along with a std::simd overload. Six defects were found spanning a signature mismatch in the SIMD overload, incorrect example values, a misspelled identifier, a TeX transcription error, a duplicate table row, and a broken reference URL.
Pipeline: Discovery (Anthropic Opus + Citations API) → Verification Gate (OpenRouter Opus) → Report Writer (OpenRouter Opus)
Provenance: All references are machine-verified character positions from the Anthropic Citations API — deterministic, exact substrings, not model-generated quotes.