P3844R4 — Reword [simd.math] for consteval conversions (12 items) LWG
Matthias Kretz
When a conversion to basic_vec is marked consteval, the [simd.math] functions fail to work equivalently to functions because conversions occurring after the function call trigger immediate escalation, requiring all arguments to be constant expressions. This paper fixes the issue by respecifying the [simd.math] overloads so that type conversions happen before the math function is called, mirroring the behavior of scalar overloads, using explicit overload sets instead of variadic template parameters with math-common-simd-t.

References — Anthropic Citations API

[1] chars 1360–1401
"4 3.4 The importantance of conversions . "
[2] chars 2871–2917
"• Fix incorrect constraint in hypot expample. "
[3]
"f calls a consteval constructor that uses y as it's argument."
[4]
"constexpr deduced-vec-t hypot(const deduced-vec-t& x, const deduced-vec-t& y const V& z);"
[5]
"constexpr deduced-vec-t fma(const deduced-vec-t& x, const deduced-vec-t& y const V& z);"
[6]
"constexpr deduced-vec-t lerp(const deduced-vec-t& x, const deduced-vec-t& y const V& z);"
[7] chars 53738–54289
"template constexpr math-common-simd-tdeduced-vec-t remquo(const V0& x, const V1& y, rebind_tdeduced-vec-t>*..."
[8]
"remquo(const deduced-vec-t& x, const V& y, rebind_t> quo); Effects: Sets *quo to ret.second."
[9]
"Let V be basic_vec. Let modf-vec denote: pair modf-vec(const V& x) { T r1[Ret::size()];"
[10]
"Synopsis (5.3): "rebind_t llrint(const deduced-vec-t& x);" — Definition (5.4): "rebind_t> llrint(const V& x);""
[11]
"Primary overload: "atan2(const V0& y, const V1& x);" — Additional overloads: "atan2(const deduced-vec-t& x, const V& y);" and "atan2(const V& x, const deduced-vec-t& y);""
[12]
"Primary overload (after diff): "lerp(const V0& a, const V1& b, const V2& t) noexcept;" — Additional overload (example): "constexpr deduced-vec-t lerp(const deduced-vec-t& x, const V& y,..."
Summary: P3844R4 proposes rewording [simd.math] to replace the current GENERATIVE_MATH_FUNCTION macro-based specification with explicit overloads using a deduced-vec-t exposition-only alias template, enabling consteval-time implicit conversions for mixed-type simd math calls. Twelve defects were found, including missing pointer declarators on remquo parameters, an undefined identifier in modf wording, a signature inversion between synopsis and definition for llrint, and multiple missing commas in three-argument overload declarations.
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.