Skip to content

[2026-11 LWG Motion 9] P3642R8 Carry-less product: std::clmul - #9422

Open
eisenwave wants to merge 2 commits into
cplusplus:mainfrom
eisenwave:motions-2026-11-lwg-9
Open

eisenwave wants to merge 2 commits into
cplusplus:mainfrom
eisenwave:motions-2026-11-lwg-9

Conversation

@eisenwave

Copy link
Copy Markdown
Member

Fixes #9415
Also fixes cplusplus/papers#2279

@eisenwave

Copy link
Copy Markdown
Member Author

@jwakely I took the liberty to add the missing using simd::clmul. I hope that is typo-level and we can do that without an LWG issue.

@eisenwave
eisenwave force-pushed the motions-2026-11-lwg-9 branch from 908fd21 to b0ec1c6 Compare November 22, 2026 15:26
@eisenwave
eisenwave force-pushed the motions-2026-11-lwg-9 branch from b0ec1c6 to 3f4da92 Compare November 22, 2026 15:30
Comment thread source/algorithms.tex
\item \exposid{high-bits} stores the subsequent $N$ bits of $c$.
\end{itemize}
\begin{formula}{numeric.clmul}
c_i = \bigoplus_{j = 0}^i x_i y_{i - j}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo here; should be x_j
(the paper's actual formula uses x_j, but its drafting note has this typo)

Comment thread source/support.tex
#define @\defnlibxname{cpp_lib_shift}@ 202202L // also in \libheader{algorithm}
#define @\defnlibxname{cpp_lib_simd}@ 202606L // also in \libheader{simd}
#define @\defnlibxname{cpp_lib_simd_bitops}@ 202607L // also in \libheader{simd}
#define @\defnlibxname{cpp_lib_simd_clmul}@ 202611L // also in \libheader{numeric}

@cubbimew cubbimew Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

paper says "define __cpp_lib_simd_clmul 20????L // also in <simd>", numeric is probably copy-paste typo?

Comment thread source/numerics.tex

\begin{itemdescr}
\pnum
The type \tcode{V::value_type} is an unsigned integer type\iref{basic.fundamental}.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing \constraints ? Paper says "1 Constraints: The type..."

Comment thread source/algorithms.tex
constexpr T low() const noexcept { return @\exposid{low-bits}@; }

friend constexpr bool operator==(const wide_result&, const wide_result&) = default;
friend constexpr strong_ordering operator<=>(const wide_result& x, const wide_result& y)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

header numeric now uses strong_ordering? Can #include <compare> be added editorially?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe there should be an LWG issue. It's already weird that <algorithm> provides lexicographical_compare_three_way but isn't specified to include <compare>.

Comment thread source/numerics.tex

\pnum
\returns
An object where the $i^{\textrm{th}}$ element is initialized to the result of

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

paper says "2 Returns: A basic_vec object where " and also links numeric.clmul after b[i]?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[2026-11 LWG Motion 9] P3642R8 Carry-less product: std::clmul P3642 R7 Carry-less product: std::clmul

3 participants