Document: P3932R0
Author: Matthias Kretz
Date: 2026-02-13
Audience: LWG
Target: C++26
Matthias Kretz is back with plumbing work on std::simd. Three LWG issues - 4470, 4414, and 4518 - all touch overlapping wording in [simd], so they get fixed together in one paper.
The main issue: integer-from<Bytes>, an exposition-only trait used throughout the simd spec, broke when complex became a vectorizable type. Now Bytes can be 16, and nobody wants to require a 128-bit signed integer type from conforming implementations. The paper reworks how masks and ABI tags are specified to avoid depending on integer-from where it doesn't work.
Along the way, simd::cat gets a fix so that round-tripping through chunk/cat preserves your ABI tag instead of silently converting, and deduce-abi-t gets clarified for out-of-range arguments.
wording fixes already rolling in for
std::simdand most of us haven't even touched the API yet. Kretz works fast.Section 2.2 is the interesting one. The paper shows this scenario:
So
chunkfollowed bycatdoesn't round-trip to the same type because the return type was usingdeduce-abi-tinstead ofresize_t. The fix picks the first argument's ABI tag. Simple and deterministic. You could argue for other heuristics - widest argument, most common tag - but for a defect fix this is the pragmatic choice.Also notable: the paper recommends no feature test macro bump despite behavioral changes.
Fair enough for exposition-only traits. But anyone whose
simd::catreturn type silently changed might want a way to detect the fix at compile time.Wait,
std::complex<double>is a vectorizable type in C++26? I've been writing SIMD intrinsics for over a decade and somehow missed that going into P1928.It was added pretty late in the P1928 lifecycle. From the paper:
Pretty much exactly what happens when you expand a type set right before shipping.
sizeof(complex<double>)is 16 and the oldinteger-from<16>expected a signed integer type that doesn't exist in the standard.genuinely curious where implementations stand. is any standard library shipping conforming
std::simdyet or is everyone still on experimental?libstdc++ has had
std::experimental::simdfor years - Kretz literally wrote it. libc++ has a partial implementation going. MSVC I'm less sure about. The gap between spec and shipping is still wide.three issues, one paper, zero controversy. this is what LWG work looks like when it works.