|
19112 | 19112 | template<size_t UBytes, class UAbi>
|
19113 | 19113 | constexpr explicit basic_simd_mask(const basic_simd_mask<UBytes, UAbi>&) noexcept;
|
19114 | 19114 | template<class G> constexpr explicit basic_simd_mask(G&& gen) noexcept;
|
| 19115 | + constexpr basic_simd_mask(const bitset<size()>& b) noexcept; |
| 19116 | + constexpr explicit basic_simd_mask(@\libconcept{unsigned_integral}@ auto val) noexcept; |
19115 | 19117 |
|
19116 | 19118 | // \ref{simd.mask.subscr}, \tcode{basic_simd_mask} subscript operators
|
19117 | 19119 | constexpr value_type operator[](@\exposid{simd-size-type}@) const;
|
|
19126 | 19128 | template<class U, class A>
|
19127 | 19129 | constexpr explicit(sizeof(U) != Bytes) operator basic_simd<U, A>() const noexcept;
|
19128 | 19130 |
|
| 19131 | + // \ref{simd.mask.namedconv}, \tcode{basic_simd_mask} named type convertors |
| 19132 | + constexpr bitset<size()> to_bitset() const noexcept; |
| 19133 | + constexpr unsigned long long to_ullong() const; |
| 19134 | + |
19129 | 19135 | // \ref{simd.mask.binary}, \tcode{basic_simd_mask} binary operators
|
19130 | 19136 | friend constexpr basic_simd_mask
|
19131 | 19137 | operator&&(const basic_simd_mask&, const basic_simd_mask&) noexcept;
|
|
19258 | 19264 | \tcode{gen} is invoked exactly once for each $i$, in increasing order of $i$.
|
19259 | 19265 | \end{itemdescr}
|
19260 | 19266 |
|
| 19267 | +\begin{itemdecl} |
| 19268 | +constexpr basic_simd_mask(const bitset<size()>& b) noexcept; |
| 19269 | +\end{itemdecl} |
| 19270 | + |
| 19271 | +\begin{itemdescr} |
| 19272 | +\pnum |
| 19273 | +\effects |
| 19274 | +Initializes the $i^\text{th}$ element with \tcode{b[$i$]} for all $i$ in the |
| 19275 | +range \range{0}{size()}. |
| 19276 | +\end{itemdescr} |
| 19277 | + |
| 19278 | +\begin{itemdecl} |
| 19279 | +constexpr explicit basic_simd_mask(@\libconcept{unsigned_integral}@ auto val) noexcept; |
| 19280 | +\end{itemdecl} |
| 19281 | + |
| 19282 | +\begin{itemdescr} |
| 19283 | +\pnum |
| 19284 | +\effects |
| 19285 | +Initializes the first $M$ elements to the corresponding bit values in |
| 19286 | +\tcode{val}, where $M$ is the smaller of \tcode{size()} and the number of bits in |
| 19287 | +the value representation\iref{basic.types.general} of the type of \tcode{val}. If |
| 19288 | +$M$ is less than \tcode{size()}, the remaining elements are initialized to |
| 19289 | +zero. |
| 19290 | +\end{itemdescr} |
| 19291 | + |
19261 | 19292 | \rSec3[simd.mask.subscr]{\tcode{basic_simd_mask} subscript operator}
|
19262 | 19293 |
|
19263 | 19294 | \begin{itemdecl}
|
|
19316 | 19347 | \tcode{static_cast<U>(operator[]($i$))}.
|
19317 | 19348 | \end{itemdescr}
|
19318 | 19349 |
|
| 19350 | +\rSec3[simd.mask.namedconv]{\tcode{basic_simd_mask} named conversion operators} |
| 19351 | + |
| 19352 | +\begin{itemdecl} |
| 19353 | +constexpr bitset<size()> to_bitset() const noexcept; |
| 19354 | +\end{itemdecl} |
| 19355 | + |
| 19356 | +\begin{itemdescr} |
| 19357 | +\pnum |
| 19358 | +\returns |
| 19359 | +A \tcode{bitset<size()>} object where the $i^\text{th}$ element is initialized to |
| 19360 | +\tcode{operator[]($i$)} for all $i$ in the range \range{0}{size()}. |
| 19361 | +\end{itemdescr} |
| 19362 | + |
| 19363 | +\begin{itemdecl} |
| 19364 | +constexpr unsigned long long to_ullong() const; |
| 19365 | +\end{itemdecl} |
| 19366 | + |
| 19367 | +\begin{itemdescr} |
| 19368 | +\pnum |
| 19369 | +Let $N$ be the width of \tcode{unsigned long long}. |
| 19370 | + |
| 19371 | +\pnum |
| 19372 | +\expects |
| 19373 | +\begin{itemize} |
| 19374 | +\item \tcode{size() <= $N$} is \tcode{true}, or |
| 19375 | +\item for all $i$ in the range \range{$N$}{size()}, \tcode{operator[]($i$)} returns \tcode{false}. |
| 19376 | +\end{itemize} |
| 19377 | + |
| 19378 | +\pnum |
| 19379 | +\returns |
| 19380 | +The integral value corresponding to the bits in \tcode{*this}. |
| 19381 | + |
| 19382 | +\pnum |
| 19383 | +\throws |
| 19384 | +Nothing. |
| 19385 | +\end{itemdescr} |
| 19386 | + |
19319 | 19387 | \rSec2[simd.mask.nonmembers]{Non-member operations}
|
19320 | 19388 |
|
19321 | 19389 | \rSec3[simd.mask.binary]{\tcode{basic_simd_mask} binary operators}
|
|
0 commit comments