diff --git a/source/numerics.tex b/source/numerics.tex index ae6be4760a..0358e3bd6e 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -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; @@ -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, V> bit_width(const V& v) noexcept; @@ -17420,6 +17426,16 @@ constexpr rebind_t, 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> real(const V&) noexcept; @@ -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; @@ -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); @@ -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} @@ -20661,19 +20701,32 @@ \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(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} @@ -20681,12 +20734,22 @@ \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} @@ -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} diff --git a/source/support.tex b/source/support.tex index 70028e6719..b3d8ed64d4 100644 --- a/source/support.tex +++ b/source/support.tex @@ -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}