P3844R3 — Restore simd::vec broadcast from int (14 items) LWG
Matthias Kretz
The Parallelism 2 TS allowed simd broadcast construction from int and unsigned int, enabling expressions like vec() + 1, but this is ill-formed in the C++26 working draft, breaking existing code ported from the TS. This paper proposes adding a consteval broadcast constructor overload to basic_vec that accepts arithmetic types whose values are not value-preservingly convertible to the element type, using constexpr exceptions to make value-changing conversions ill-formed at compile time. It also re-specifies [simd.math] to use explicit overload sets that move conversions before math function calls, avoiding issues with immediate-escalation of consteval constructors.

References — Anthropic Citations API

[1]
"• Fix incorrect constraint in hypot expample. "
[2]
"11 7.4 The importantance of conversions . "
[3]
"P3844R3 4 Design space needs fewer template instantations. "
[4]
"If we accept that common_type changes (we don’t have to, as we can specialize common_type), this has consquences on [simd.math]. "
[5]
"a basic_vec broadcast constructor (with it's helper types/concepts to determine whether the specialization is allowed)."
[6]
"Multi-argument math functions use common_type in it's specification"
[7]
"f calls a consteval constructor that uses y as it's argument."
[8]
"However, this rule alone still breaks the case of vec() + 1, which the user cannot changed to use a short literal (because we don’t have one). "
[9]
"P3844R3 11 Wording for [simd.math] 10.5 modify [simd.ctor] In [simd.ctore], change: [simd.ctor] template U> constexpr explicit(see below)..."
[10]
"Let V be basic_vec. Let modf-vec denote: pair modf-vec(const V& x) { T r1[Ret::size()];"
[11]
"constexpr deduced-vec-t isgreater(const deduced-vec-t& x, const V& y);"
[12]
"constexpr deduced-vec-t isgreater(const deduced-vec-t& x, const V& y);"
[13]
"The symmetric overloads on page 20 include all six classification functions: `isgreater`, `isgreaterequal`, `isless`, `islessequal`, `islessgreater`, `isunordered`. But the new asymmetric..."
[14]
"Thus we would need to ship C++26 with a [simd.math] specification that is forward-compatible"
Summary: P3844R3 proposes restoring the ability to broadcast from int to simd::vec by introducing asymmetric binary operator overloads and adjusting conversion rules, modifying the simd specification wording in P1928. It also extends asymmetric overloads to math and classification functions in [simd.math].
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.