P3844R3 — Restore simd::vec broadcast from int
(14 items)
LWG
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.
-
§11.3 and §11.4 (synopsis pp. 19-22, specification pp. 29-31) — The asymmetric overloads of isgreater, islessequal, islessgreater, and isunordered return deduced-vec-t
instead of typename deduced-vec-t ::mask_type. Classification functions return masks; the symmetric overloads already return mask_type. [1] -
§11.4, p. 30 (paragraph 24, modf-vec specification) — Ret is used but never defined in this context. The frexp specification introduces it explicitly ("Let Ret be deduced-vec-t
"); this specification does not. Should be V::size() or an explicit Ret definition. [2] - §11.3 and §11.4 (synopsis and specification) — Asymmetric overloads are added for isgreater, islessequal, islessgreater, and isunordered but not for isgreaterequal or isless. All six classification functions receive the same change to their main overload, so the omission appears unintentional. [3]
- §10.5, p. 16 — Stable name [simd.ctore] does not exist; spurious trailing 'e'. Should be [simd.ctor], consistent with the section heading on the same page. [4]
- §4.1, p. 6 — "cannot changed" — modal verb requires bare infinitive. Should be "cannot change". [5]
- §3, p. 5 — "it's helper types/concepts" — contraction used where possessive "its" is required. [6]
- §6, p. 11 — "it's specification" — contraction used where possessive "its" is required. [7]
- §7, p. 12 — "it's argument" — contraction used where possessive "its" is required. [8]
- §7.3, p. 13 — Sentence ends without terminal punctuation. [9]
- §1.3, p. 3 — "expample" — misspelling of "example". [10]
- §7.4 heading, p. 11 (and TOC p. 1) — "importantance" — misspelling of "importance". [11]
- §4, p. 6 — "instantations" — misspelling of "instantiations". [12]
- §6, p. 11 — "consquences" — misspelling of "consequences". [13]
- §7.3, p. 13 — Sentence ends without terminal punctuation (period missing). [14]
References — Anthropic Citations API
[1]
"• Fix incorrect constraint in hypot expample. "
"• Fix incorrect constraint in hypot expample. "
[2]
"11 7.4 The importantance of conversions . "
"11 7.4 The importantance of conversions . "
[3]
"P3844R3 4 Design space needs fewer template instantations. "
"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]. "
"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)."
"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"
"Multi-argument math functions use common_type in it's specification"
[7]
"f calls a consteval constructor that uses y as it's argument."
"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). "
"However, this rule alone still breaks the case of vec
[9]
"P3844R3 11 Wording for [simd.math] 10.5 modify [simd.ctor] In [simd.ctore], change: [simd.ctor] template U>
constexpr explicit(see below)..."
"P3844R3 11 Wording for [simd.math] 10.5 modify [simd.ctor] In [simd.ctore], change: [simd.ctor] template
[10]
"Let V be basic_vec. Let modf-vec denote: pair modf-vec(const V& x) { T r1[Ret::size()];"
"Let V be basic_vec
[11]
"constexpr deduced-vec-t isgreater(const deduced-vec-t& x, const V& y);"
"constexpr deduced-vec-t
[12]
"constexpr deduced-vec-t isgreater(const deduced-vec-t& x, const V& y);"
"constexpr deduced-vec-t
[13]
"The symmetric overloads on page 20 include all six classification functions: `isgreater`, `isgreaterequal`, `isless`, `islessequal`, `islessgreater`, `isunordered`. But the new asymmetric..."
"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"
"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.
Provenance: All references are machine-verified character positions from the Anthropic Citations API — deterministic, exact substrings, not model-generated quotes.