Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 109 additions & 0 deletions source/numerics.tex
Original file line number Diff line number Diff line change
Expand Up @@ -17385,6 +17385,7 @@

// \ref{simd.bit}, bit manipulation
template<@\exposconcept{simd-vec-type}@ V> constexpr V byteswap(const V& v) noexcept;
template<@\exposconcept{simd-integral}@ V> constexpr V bit_reverse(const V& v) noexcept;
template<@\exposconcept{simd-vec-type}@ V> constexpr V bit_ceil(const V& v);
template<@\exposconcept{simd-vec-type}@ V> constexpr V bit_floor(const V& v) noexcept;

Expand All @@ -17401,6 +17402,11 @@
template<@\exposconcept{simd-vec-type}@ V>
constexpr V rotr(const V& v, int s) noexcept;

template<@\exposconcept{simd-integral}@ V0, @\exposconcept{simd-integral}@ V1>
constexpr V0 bit_repeat(const V0& v, const V1& l);
template<@\exposconcept{simd-integral}@ V>
constexpr V bit_repeat(const V& v, int l);

template<@\exposconcept{simd-vec-type}@ V>
constexpr rebind_t<make_signed_t<typename V::value_type>, V>
bit_width(const V& v) noexcept;
Expand All @@ -17420,6 +17426,16 @@
constexpr rebind_t<make_signed_t<typename V::value_type>, V>
popcount(const V& v) noexcept;

template<@\exposconcept{simd-integral}@ V>
constexpr V bit_compress(const V& v, const V& m) noexcept;
template<@\exposconcept{simd-integral}@ V>
constexpr V bit_expand(const V& v, const V& m) noexcept;

template<@\exposconcept{simd-integral}@ V>
constexpr V bit_compress(const V& v, typename V::value_type m) noexcept;
template<@\exposconcept{simd-integral}@ V>
constexpr V bit_expand(const V& v, typename V::value_type m) noexcept;

// \ref{simd.complex.math}, complex math
template<@\exposconcept{simd-complex}@ V>
constexpr rebind_t<@\exposid{simd-complex-value-type<V>}@, V> real(const V&) noexcept;
Expand Down Expand Up @@ -17591,15 +17607,19 @@
using simd::byteswap;
using simd::bit_ceil;
using simd::bit_floor;
using simd::bit_reverse;
using simd::has_single_bit;
using simd::rotl;
using simd::rotr;
using simd::bit_repeat;
using simd::bit_width;
using simd::countl_zero;
using simd::countl_one;
using simd::countr_zero;
using simd::countr_one;
using simd::popcount;
using simd::bit_compress;
using simd::bit_expand;

// See \ref{simd.complex.math}, \tcode{vec} complex math
using simd::real;
Expand Down Expand Up @@ -20575,6 +20595,23 @@
\range{0}{V::size()}.
\end{itemdescr}

\indexlibrarymember{bit_reverse}{simd}
\begin{itemdecl}
template<@\exposconcept{simd-integral}@ V> constexpr V bit_reverse(const V& v) noexcept;
\end{itemdecl}

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

\pnum
\returns
A \tcode{basic_vec} object where the $i^\text{th}$ element is initialized to
the result of \tcode{std::bit_reverse(v[$i$])} for all $i$ in the range
\range{0}{V::size()}.
\end{itemdescr}

\indexlibrarymember{bit_ceil}{simd}
\begin{itemdecl}
template<@\exposconcept{simd-vec-type}@ V> constexpr V bit_ceil(const V& v);
Expand Down Expand Up @@ -20640,11 +20677,14 @@

\indexlibrarymember{rotl}{simd}
\indexlibrarymember{rotr}{simd}
\indexlibrarymember{bit_repeat}{simd}
\begin{itemdecl}
template<@\exposconcept{simd-vec-type}@ V0, @\exposconcept{simd-vec-type}@ V1>
constexpr V0 rotl(const V0& v0, const V1& v1) noexcept;
template<@\exposconcept{simd-vec-type}@ V0, @\exposconcept{simd-vec-type}@ V1>
constexpr V0 rotr(const V0& v0, const V1& v1) noexcept;
template<@\exposconcept{simd-integral}@ V0, @\exposconcept{simd-integral}@ V1>
constexpr V0 bit_repeat(const V0& v0, const V1& v1);
\end{itemdecl}

\begin{itemdescr}
Expand All @@ -20661,32 +20701,55 @@
\tcode{sizeof(typename V0::value_type) == sizeof(typename V1::value_type)} is \tcode{true}.
\end{itemize}

\pnum
\expects
For \tcode{bit_repeat},
\tcode{v1[$i$] > 0} is \tcode{true}
for all $i$ in the range \range{0}{V0::size()}.

\pnum
\returns
A \tcode{basic_vec} object where the $i^\text{th}$ element is initialized to
the result of \tcode{\placeholder{bit-func}(v0[$i$],
static_cast<int>(v1[$i$]))} for all $i$ in the range \range{0}{V0::size()},
where \tcode{\placeholder{bit-func}} is the corresponding scalar function from \libheader{bit}.

\pnum
\remarks
A function call expression that violates the precondition in the \expects
element is not a core constant expression\iref{expr.const.core}.
\end{itemdescr}

\indexlibrarymember{rotl}{simd}
\indexlibrarymember{rotr}{simd}
\indexlibrarymember{bit_repeat}{simd}
\begin{itemdecl}
template<@\exposconcept{simd-vec-type}@ V> constexpr V rotl(const V& v, int s) noexcept;
template<@\exposconcept{simd-vec-type}@ V> constexpr V rotr(const V& v, int s) noexcept;
template<@\exposconcept{simd-integral}@ V> constexpr V bit_repeat(const V& v, int l);
\end{itemdecl}

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

\pnum
\expects
For \tcode{bit_repeat},
\tcode{l > 0} is \tcode{true}.

\pnum
\returns
A \tcode{basic_vec} object where the $i^\text{th}$ element is initialized to
the result of \tcode{\placeholder{bit-func}(v[$i$], s)} for all $i$ in the
range \range{0}{V::size()}, where \tcode{\placeholder{bit-func}} is the corresponding
scalar function from \libheader{bit}.

\pnum
\remarks
A function call expression that violates the precondition in the \expects
element is not a core constant expression\iref{expr.const.core}.
\end{itemdescr}

\indexlibrarymember{bit_width}{simd}
Expand Down Expand Up @@ -20723,6 +20786,52 @@
function from \libheader{bit}.
\end{itemdescr}

\indexlibrarymember{bit_compress}{simd}
\indexlibrarymember{bit_expand}{simd}
\begin{itemdecl}
template<@\exposconcept{simd-integral}@ V>
constexpr V bit_compress(const V& v, const V& m) noexcept;
template<@\exposconcept{simd-integral}@ V>
constexpr V bit_expand(const V& v, const V& m) noexcept;
\end{itemdecl}

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

\pnum
\returns
A \tcode{basic_vec} object where the $i^\text{th}$ element is initialized to
the result of \tcode{\placeholder{bit-func}(v[$i$], m[$i$])}
for all $i$ in the range \range{0}{V::size()},
where \tcode{\placeholder{bit-func}} is the corresponding
scalar function from \libheader{bit}.
\end{itemdescr}

\indexlibrarymember{bit_compress}{simd}
\indexlibrarymember{bit_expand}{simd}
\begin{itemdecl}
template<@\exposconcept{simd-integral}@ V>
constexpr V bit_compress(const V& v, typename V::value_type m) noexcept;
template<@\exposconcept{simd-integral}@ V>
constexpr V bit_expand(const V& v, typename V::value_type m) noexcept;
\end{itemdecl}

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

\pnum
\returns
A \tcode{basic_vec} object where the $i^\text{th}$ element is initialized to
the result of \tcode{\placeholder{bit-func}(v[$i$], m)}
for all $i$ in the range \range{0}{V::size()},
where \tcode{\placeholder{bit-func}} is the corresponding
scalar function from \libheader{bit}.
\end{itemdescr}

\rSec3[simd.complex.math]{Complex math}

\indexlibrarymember{real}{simd}
Expand Down
1 change: 1 addition & 0 deletions source/support.tex
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,7 @@
#define @\defnlibxname{cpp_lib_shift}@ 202202L // also in \libheader{algorithm}
#define @\defnlibxname{cpp_lib_simd}@ 202603L // also in \libheader{simd}
#define @\defnlibxname{cpp_lib_simd_complex}@ 202502L // also in \libheader{simd}
#define @\defnlibxname{cpp_lib_simd_bitops}@ 202606L // also in \libheader{simd}
#define @\defnlibxname{cpp_lib_simd_permutations}@ 202506L // also in \libheader{simd}
#define @\defnlibxname{cpp_lib_smart_ptr_for_overwrite}@ 202002L // also in \libheader{memory}
#define @\defnlibxname{cpp_lib_smart_ptr_owner_equality}@ 202306L // also in \libheader{memory}
Expand Down
Loading