|
16123 | 16123 |
|
16124 | 16124 | template<class V, class T> using @\exposidnc{make-compatible-simd-t} = \seebelownc@; // \expos
|
16125 | 16125 |
|
| 16126 | +template<class V> |
| 16127 | + concept @\defexposconceptnc{simd-type}@ = // \expos |
| 16128 | + @\libconcept{same_as}@<V, basic_simd<typename V::value_type, typename V::abi_type>> && |
| 16129 | + is_default_constructible_v<V>; |
| 16130 | + |
16126 | 16131 | template<class V>
|
16127 | 16132 | concept @\defexposconceptnc{simd-floating-point}@ = // \expos
|
16128 | 16133 | @\libconcept{same_as}@<V, basic_simd<typename V::value_type, typename V::abi_type>> &&
|
|
16736 | 16741 | template<@\exposconcept{math-floating-point}@ V>
|
16737 | 16742 | @\exposid{deduced-simd-t}@<V>
|
16738 | 16743 | sph_neumann(const rebind_simd_t<unsigned, @\exposid{deduced-simd-t}@<V>>& n, const V& x);
|
| 16744 | + |
| 16745 | + // \ref{simd.bit}, Bit manipulation |
| 16746 | + template<@\exposconcept{simd-type}@ V> constexpr V byteswap(const V& v) noexcept; |
| 16747 | + template<@\exposconcept{simd-type}@ V> constexpr V bit_ceil(const V& v) noexcept; |
| 16748 | + template<@\exposconcept{simd-type}@ V> constexpr V bit_floor(const V& v) noexcept; |
| 16749 | + |
| 16750 | + template<@\exposconcept{simd-type}@ V> |
| 16751 | + constexpr typename V::mask_type has_single_bit(const V& v) noexcept; |
| 16752 | + |
| 16753 | + template<@\exposconcept{simd-type}@ V0, @\exposconcept{simd-type}@ V1> |
| 16754 | + constexpr V0 rotl(const V0& v, const V1& s) noexcept; |
| 16755 | + template<@\exposconcept{simd-type}@ V> |
| 16756 | + constexpr V rotl(const V& v, int s) noexcept; |
| 16757 | + |
| 16758 | + template<@\exposconcept{simd-type}@ V0, @\exposconcept{simd-type}@ V1> |
| 16759 | + constexpr V0 rotr(const V0& v, const V1& s) noexcept; |
| 16760 | + template<@\exposconcept{simd-type}@ V> |
| 16761 | + constexpr V rotr(const V& v, int s) noexcept; |
| 16762 | + |
| 16763 | + template<@\exposconcept{simd-type}@ V> |
| 16764 | + constexpr rebind_simd_t<make_signed_t<typename V::value_type>, V> |
| 16765 | + bit_width(const V& v) noexcept; |
| 16766 | + template<@\exposconcept{simd-type}@ V> |
| 16767 | + constexpr rebind_simd_t<make_signed_t<typename V::value_type>, V> |
| 16768 | + countl_zero(const V& v) noexcept; |
| 16769 | + template<@\exposconcept{simd-type}@ V> |
| 16770 | + constexpr rebind_simd_t<make_signed_t<typename V::value_type>, V> |
| 16771 | + countl_one(const V& v) noexcept; |
| 16772 | + template<@\exposconcept{simd-type}@ V> |
| 16773 | + constexpr rebind_simd_t<make_signed_t<typename V::value_type>, V> |
| 16774 | + countr_zero(const V& v) noexcept; |
| 16775 | + template<@\exposconcept{simd-type}@ V> |
| 16776 | + constexpr rebind_simd_t<make_signed_t<typename V::value_type>, V> |
| 16777 | + countr_one(const V& v) noexcept; |
| 16778 | + template<@\exposconcept{simd-type}@ V> |
| 16779 | + constexpr rebind_simd_t<make_signed_t<typename V::value_type>, V> |
| 16780 | + popcount(const V& v) noexcept; |
16739 | 16781 | }
|
16740 | 16782 | \end{codeblock}
|
16741 | 16783 |
|
@@ -18436,6 +18478,166 @@
|
18436 | 18478 | \tcode{ret.first}.
|
18437 | 18479 | \end{itemdescr}
|
18438 | 18480 |
|
| 18481 | +\rSec3[simd.bit]{\tcode{basic_simd} bit library} |
| 18482 | + |
| 18483 | +\begin{itemdecl} |
| 18484 | +template<@\exposconcept{simd-type}@ V> constexpr V byteswap(const V& v) noexcept; |
| 18485 | +\end{itemdecl} |
| 18486 | + |
| 18487 | +\begin{itemdescr} |
| 18488 | +\pnum |
| 18489 | +\constraints |
| 18490 | +The type \tcode{V::value_type} models \tcode{integral}. |
| 18491 | + |
| 18492 | +\pnum |
| 18493 | +\returns |
| 18494 | +A \tcode{basic_simd} object where the $i^\text{th}$ element is initialized to |
| 18495 | +the result of \tcode{std::byteswap(v[$i$])} for all $i$ in the range |
| 18496 | +\range{0}{V::size()}. |
| 18497 | +\end{itemdescr} |
| 18498 | + |
| 18499 | +\begin{itemdecl} |
| 18500 | +template<@\exposconcept{simd-type}@ V> constexpr V bit_ceil(const V& v) noexcept; |
| 18501 | +\end{itemdecl} |
| 18502 | + |
| 18503 | +\begin{itemdescr} |
| 18504 | +\pnum |
| 18505 | +\constraints |
| 18506 | +The type \tcode{V::value_type} is an unsigned integer type |
| 18507 | +\iref{basic.fundamental}. |
| 18508 | + |
| 18509 | +\pnum |
| 18510 | +\expects |
| 18511 | +For every $i$ in the range \range{0}{V::size()}, the smallest power of 2 |
| 18512 | +greater than or equal to \tcode{v[$i$]} is representable as a value of type |
| 18513 | +\tcode{V::value_type}. |
| 18514 | + |
| 18515 | +\pnum |
| 18516 | +\returns |
| 18517 | +A \tcode{basic_simd} object where the $i^\text{th}$ element is initialized to |
| 18518 | +the result of \tcode{std::bit_ceil(v[$i$])} for all $i$ in the range |
| 18519 | +\range{0}{V::size()}. |
| 18520 | + |
| 18521 | +\pnum |
| 18522 | +\remarks |
| 18523 | +A function call expression that violates the precondition in the \expects |
| 18524 | +element is not a core constant expression \iref{expr.const}. |
| 18525 | +\end{itemdescr} |
| 18526 | + |
| 18527 | +\begin{itemdecl} |
| 18528 | +template<@\exposconcept{simd-type}@ V> constexpr V bit_floor(const V& v) noexcept; |
| 18529 | +\end{itemdecl} |
| 18530 | + |
| 18531 | +\begin{itemdescr} |
| 18532 | +\pnum |
| 18533 | +\constraints |
| 18534 | +The type \tcode{V::value_type} is an unsigned integer type \iref{basic.fundamental}. |
| 18535 | + |
| 18536 | +\pnum |
| 18537 | +\returns |
| 18538 | +A \tcode{basic_simd} object where the $i^\text{th}$ element is initialized to |
| 18539 | +the result of \tcode{std::bit_floor(v[$i$])} for all $i$ in the range |
| 18540 | +\range{0}{V::size()}. |
| 18541 | +\end{itemdescr} |
| 18542 | + |
| 18543 | +\begin{itemdecl} |
| 18544 | +template<@\exposconcept{simd-type}@ V> |
| 18545 | + constexpr typename V::mask_type has_single_bit(const V& v) noexcept; |
| 18546 | +\end{itemdecl} |
| 18547 | + |
| 18548 | +\begin{itemdescr} |
| 18549 | +\pnum |
| 18550 | +\constraints |
| 18551 | +The type \tcode{V::value_type} is an unsigned integer type \iref{basic.fundamental}. |
| 18552 | + |
| 18553 | +\pnum |
| 18554 | +\returns |
| 18555 | +A \tcode{basic_simd_mask} object where the $i^\text{th}$ element is initialized |
| 18556 | +to the result of \tcode{std::has_single_bit(v[$i$])} for all $i$ in the range |
| 18557 | +\range{0}{V::size()}. |
| 18558 | +\end{itemdescr} |
| 18559 | + |
| 18560 | +\begin{itemdecl} |
| 18561 | +template<@\exposconcept{simd-type}@ V0, @\exposconcept{simd-type}@ V1> |
| 18562 | + constexpr V0 rotl(const V0& v0, const V1& v1) noexcept; |
| 18563 | +template<@\exposconcept{simd-type}@ V0, @\exposconcept{simd-type}@ V1> |
| 18564 | + constexpr V0 rotr(const V0& v0, const V1& v1) noexcept; |
| 18565 | +\end{itemdecl} |
| 18566 | + |
| 18567 | +\begin{itemdescr} |
| 18568 | +\pnum |
| 18569 | +\constraints |
| 18570 | +\begin{itemize} |
| 18571 | + \item |
| 18572 | + The type \tcode{V0::value_type} is an unsigned integer type \iref{basic.fundamental}, |
| 18573 | + \item |
| 18574 | + the type \tcode{V1::value_type} models \tcode{integral}, |
| 18575 | + \item |
| 18576 | + \tcode{V0::size() == V1::size()} is \tcode{true}, and |
| 18577 | + \item |
| 18578 | + \tcode{sizeof(typename V0::value_type) == sizeof(typename V1::value_type)} is \tcode{true}. |
| 18579 | +\end{itemize} |
| 18580 | + |
| 18581 | +\pnum |
| 18582 | +\returns |
| 18583 | +A \tcode{basic_simd} object where the $i^\text{th}$ element is initialized to |
| 18584 | +the result of \tcode{\placeholder{bit-func}(v0[$i$], |
| 18585 | +static_cast<int>(v1[$i$]))} for all $i$ in the range \range{0}{V0::size()}, |
| 18586 | +where \placeholder{bit-func} is the corresponding scalar function from \tcode{<bit>}. |
| 18587 | +\end{itemdescr} |
| 18588 | + |
| 18589 | +\begin{itemdecl} |
| 18590 | +template<@\exposconcept{simd-type}@ V> constexpr V rotl(const V& v, int s) noexcept; |
| 18591 | +template<@\exposconcept{simd-type}@ V> constexpr V rotr(const V& v, int s) noexcept; |
| 18592 | +\end{itemdecl} |
| 18593 | + |
| 18594 | +\begin{itemdescr} |
| 18595 | +\pnum |
| 18596 | +\constraints |
| 18597 | +The type \tcode{V::value_type} is an unsigned integer type \iref{basic.fundamental} |
| 18598 | + |
| 18599 | +\pnum |
| 18600 | +\returns |
| 18601 | +A \tcode{basic_simd} object where the $i^\text{th}$ element is initialized to |
| 18602 | +the result of \tcode{\placeholder{bit-func}(v[$i$], s)} for all $i$ in the |
| 18603 | +range \range{0}{V::size()}, where \placeholder{bit-func} is the corresponding |
| 18604 | +scalar function from \tcode{<bit>}. |
| 18605 | +\end{itemdescr} |
| 18606 | + |
| 18607 | +\begin{itemdecl} |
| 18608 | +template<@\exposconcept{simd-type}@ V> |
| 18609 | + constexpr rebind_simd_t<make_signed_t<typename V::value_type>, V> |
| 18610 | + bit_width(const V& v) noexcept; |
| 18611 | +template<@\exposconcept{simd-type}@ V> |
| 18612 | + constexpr rebind_simd_t<make_signed_t<typename V::value_type>, V> |
| 18613 | + countl_zero(const V& v) noexcept; |
| 18614 | +template<@\exposconcept{simd-type}@ V> |
| 18615 | + constexpr rebind_simd_t<make_signed_t<typename V::value_type>, V> |
| 18616 | + countl_one(const V& v) noexcept; |
| 18617 | +template<@\exposconcept{simd-type}@ V> |
| 18618 | + constexpr rebind_simd_t<make_signed_t<typename V::value_type>, V> |
| 18619 | + countr_zero(const V& v) noexcept; |
| 18620 | +template<@\exposconcept{simd-type}@ V> |
| 18621 | + constexpr rebind_simd_t<make_signed_t<typename V::value_type>, V> |
| 18622 | + countr_one(const V& v) noexcept; |
| 18623 | +template<@\exposconcept{simd-type}@ V> |
| 18624 | + constexpr rebind_simd_t<make_signed_t<typename V::value_type>, V> |
| 18625 | + popcount(const V& v) noexcept; |
| 18626 | +\end{itemdecl} |
| 18627 | + |
| 18628 | +\begin{itemdescr} |
| 18629 | +\pnum |
| 18630 | +\constraints |
| 18631 | +The type \tcode{V::value_type} is an unsigned integer type \iref{basic.fundamental} |
| 18632 | + |
| 18633 | +\pnum |
| 18634 | +\returns |
| 18635 | +A \tcode{basic_simd} object where the $i^\text{th}$ element is initialized to |
| 18636 | +the result of \tcode{\placeholder{bit-func}(v[$i$])} for all $i$ in the range |
| 18637 | +\range{0}{V::size()}, where \placeholder{bit-func} is the corresponding scalar |
| 18638 | +function from \tcode{<bit>}. |
| 18639 | +\end{itemdescr} |
| 18640 | + |
18439 | 18641 | \rSec2[simd.mask.class]{Class template \tcode{basic_simd_mask}}
|
18440 | 18642 |
|
18441 | 18643 | \rSec3[simd.mask.overview]{Class template \tcode{basic_simd_mask} overview}
|
|
0 commit comments