@@ -16058,12 +16058,17 @@
1605816058\end{note}
1605916059
1606016060\pnum
16061- The set of \defnadjx{vectorizable}{types}{type} comprises all standard integer
16062- types, character types, and the types \tcode{float} and
16063- \tcode{double}\iref{basic.fundamental}.
16064- In addition, \tcode{std::float16_t}, \tcode{std::float32_t}, and
16065- \tcode{std::float64_t} are vectorizable types if
16066- defined\iref{basic.extended.fp}.
16061+ The set of \defnadjx{vectorizable}{types}{type} comprises
16062+ \begin{itemize}
16063+ \item
16064+ all standard integer types, character types, and the types \tcode{float} and
16065+ \tcode{double}\iref{basic.fundamental};
16066+ \item
16067+ \tcode{std::float16_t}, \tcode{std::float32_t}, and \tcode{std::float64_t}
16068+ if defined\iref{basic.extended.fp}; and
16069+ \item
16070+ \tcode{complex<T>} where \tcode{T} is a vectorizable floating-point type.
16071+ \end{itemize}
1606716072
1606816073\pnum
1606916074The term \defnadj{data-parallel}{type} refers to all enabled specializations of
1613216137
1613316138template<class V>
1613416139 concept @\defexposconceptnc{simd-floating-point}@ = // \expos
16135- @\libconcept{same_as}@<V, basic_simd<typename V::value_type, typename V::abi_type>> &&
16136- is_default_constructible_v<V> && @\libconcept{floating_point}@<typename V::value_type>;
16140+ @\exposconcept{simd-type}@<V> && @\libconcept{floating_point}@<typename V::value_type>;
16141+
16142+ template<class V>
16143+ using @\exposidnc{simd-complex-value-type}@ = typename V::value_type::value_type; // \expos
16144+
16145+ template<class V>
16146+ concept @\defexposconceptnc{simd-complex}@ = // \expos
16147+ @\exposconcept{simd-type}@<V> && @\libconcept{same_as}@<typename V::value_type, complex<@\exposid{simd-complex-value-type}@<V>>>;
1613716148
1613816149template<class... Ts>
1613916150 concept @\defexposconceptnc{math-floating-point}@ = // \expos
1678516796 template<@\exposconcept{simd-type}@ V>
1678616797 constexpr rebind_simd_t<make_signed_t<typename V::value_type>, V>
1678716798 popcount(const V& v) noexcept;
16799+
16800+ // \ref{simd.complex.math}, simd complex math
16801+ template<@\exposconcept{simd-complex}@ V>
16802+ constexpr rebind_simd_t<@\exposid{simd-complex-value-type<V>}@, V> real(const V&) noexcept;
16803+
16804+ template<@\exposconcept{simd-complex}@ V>
16805+ constexpr rebind_simd_t<@\exposid{simd-complex-value-type<V>}@, V> imag(const V&) noexcept;
16806+
16807+ template<@\exposconcept{simd-complex}@ V>
16808+ constexpr rebind_simd_t<@\exposid{simd-complex-value-type<V>}@, V> abs(const V&);
16809+
16810+ template<@\exposconcept{simd-complex}@ V>
16811+ constexpr rebind_simd_t<@\exposid{simd-complex-value-type<V>}@, V> arg(const V&);
16812+
16813+ template<@\exposconcept{simd-complex}@ V>
16814+ constexpr rebind_simd_t<@\exposid{simd-complex-value-type<V>}@, V> norm(const V&);
16815+
16816+ template<@\exposconcept{simd-complex}@ V> constexpr V conj(const V&);
16817+ template<@\exposconcept{simd-complex}@ V> constexpr V proj(const V&);
16818+ template<@\exposconcept{simd-complex}@ V> constexpr V exp(const V& v);
16819+ template<@\exposconcept{simd-complex}@ V> constexpr V log(const V& v);
16820+ template<@\exposconcept{simd-complex}@ V> constexpr V log10(const V& v);
16821+
16822+ template<@\exposconcept{simd-complex}@ V> constexpr V sqrt(const V& v);
16823+ template<@\exposconcept{simd-complex}@ V> constexpr V sin(const V& v);
16824+ template<@\exposconcept{simd-complex}@ V> constexpr V asin(const V& v);
16825+ template<@\exposconcept{simd-complex}@ V> constexpr V cos(const V& v);
16826+ template<@\exposconcept{simd-complex}@ V> constexpr V acos(const V& v);
16827+ template<@\exposconcept{simd-complex}@ V> constexpr V tan(const V& v);
16828+ template<@\exposconcept{simd-complex}@ V> constexpr V atan(const V& v);
16829+ template<@\exposconcept{simd-complex}@ V> constexpr V sinh(const V& v);
16830+ template<@\exposconcept{simd-complex}@ V> constexpr V asinh(const V& v);
16831+ template<@\exposconcept{simd-complex}@ V> constexpr V cosh(const V& v);
16832+ template<@\exposconcept{simd-complex}@ V> constexpr V acosh(const V& v);
16833+ template<@\exposconcept{simd-complex}@ V> constexpr V tanh(const V& v);
16834+ template<@\exposconcept{simd-complex}@ V> constexpr V atanh(const V& v);
16835+
16836+ template<@\exposconcept{simd-floating-point}@ V>
16837+ rebind_simd_t<complex<typename V::value_type>, V> polar(const V& x, const V& y = {});
16838+
16839+ template<@\exposconcept{simd-complex}@ V> constexpr V pow(const V& x, const V& y);
1678816840}
1678916841\end{codeblock}
1679016842
1695817010 constexpr basic_simd(R&& range, simd_flags<Flags...> = {});
1695917011 template<class R, class... Flags>
1696017012 constexpr basic_simd(R&& range, const mask_type& mask, simd_flags<Flags...> = {});
17013+ template<@\exposconcept{simd-floating-point}@ V>
17014+ constexpr explicit(@\seebelow@) basic_simd(const V& reals, const V& imags = {}) noexcept;
1696117015
1696217016 // \ref{simd.subscr}, \tcode{basic_simd} subscript operators
1696317017 constexpr value_type operator[](@\exposid{simd-size-type}@) const;
1700817062 friend constexpr mask_type operator>(const basic_simd&, const basic_simd&) noexcept;
1700917063 friend constexpr mask_type operator<(const basic_simd&, const basic_simd&) noexcept;
1701017064
17065+ // \ref{simd.complex.access}, \tcode{basic_simd} complex-value accessors
17066+ constexpr auto real() const noexcept;
17067+ constexpr auto imag() const noexcept;
17068+ template<@\exposconcept{simd-floating-point}@ V>
17069+ constexpr void real(const V& v) noexcept;
17070+ template<@\exposconcept{simd-floating-point}@ V>
17071+ constexpr void imag(const V& v) noexcept;
17072+
1701117073 // \ref{simd.cond}, \tcode{basic_simd} exposition only conditional operators
1701217074 friend constexpr basic_simd @\exposid{simd-select-impl}@( // \expos
1701317075 const mask_type&, const basic_simd&, const basic_simd&) noexcept;
@@ -17033,14 +17095,16 @@
1703317095 specializations} if such a specialization is enabled.
1703417096\end{itemize}
1703517097
17036- If \tcode{basic_simd<T, Abi>} is disabled, the specialization has a
17098+ If \tcode{basic_simd<T, Abi>} is disabled, then the specialization has a
1703717099deleted default constructor, deleted destructor, deleted copy constructor, and
1703817100deleted copy assignment.
1703917101In addition only the \tcode{value_type}, \tcode{abi_type}, and
1704017102\tcode{mask_type} members are present.
1704117103
17042- If \tcode{basic_simd<T, Abi>} is enabled, \tcode{basic_simd<T, Abi>} is
17043- trivially copyable.
17104+ If \tcode{basic_simd<T, Abi>} is enabled, then \tcode{basic_simd<T, Abi>} is
17105+ trivially copyable, default-initialization of an object of such a type
17106+ default-initializes all elements, and value-initialization value-initializes
17107+ all elements\iref{dcl.init.general}.
1704417108
1704517109\pnum
1704617110\recommended
1722117285ranges::size(r)>}.
1722217286\end{itemdescr}
1722317287
17288+ \begin{itemdecl}
17289+ template<@\exposconcept{simd-floating-point}@ V>
17290+ constexpr explicit(@\seebelow@)
17291+ basic_simd(const V& reals, const V& imags = {}) noexcept;
17292+ \end{itemdecl}
17293+
17294+ \begin{itemdescr}
17295+ \pnum
17296+ \constraints
17297+ \begin{itemize}
17298+ \item
17299+ \tcode{\exposconcept{simd-complex}<basic_simd>} is modeled, and
17300+ \item
17301+ \tcode{V::size() == size()} is \tcode{true}.
17302+ \end{itemize}
17303+
17304+ \pnum
17305+ \effects
17306+ Initializes the $i^\text{th}$ element with \tcode{value_type(reals[$i$],
17307+ imags[$i$])} for all $i$ in the range \range{0}{size()}.
17308+
17309+ \pnum
17310+ \remarks
17311+ The expression inside \tcode{explicit} evaluates to \tcode{false} if and only
17312+ if the floating-point conversion rank of \tcode{T::value_type} is greater than
17313+ or equal to the floating-point conversion rank of \tcode{V::value_type}.
17314+ \end{itemdescr}
17315+
1722417316\rSec3[simd.subscr]{\tcode{basic_simd} subscript operator}
1722517317
1722617318\begin{itemdecl}
1751117603operation.
1751217604\end{itemdescr}
1751317605
17606+ \rSec3[simd.complex.access]{\tcode{simd} complex accessors}
17607+
17608+ \begin{itemdecl}
17609+ constexpr auto real() const noexcept;
17610+ constexpr auto imag() const noexcept;
17611+ \end{itemdecl}
17612+
17613+ \begin{itemdescr}
17614+ \pnum
17615+ \constraints
17616+ \tcode{\exposconcept{simd-complex}<basic_simd>} is modeled.
17617+
17618+ \pnum
17619+ \returns
17620+ An object of type \tcode{rebind_simd_t<typename T::value_type, basic_simd>}
17621+ where the $i^\text{th}$ element is initialized to the result of
17622+ \tcode{\placeholder{cmplx-func}(operator[]($i$))} for all $i$ in the range
17623+ \range{0}{size()}, where \placeholder{cmplx-func} is the corresponding function
17624+ from \libheader{complex}.
17625+ \end{itemdescr}
17626+
17627+ \begin{itemdecl}
17628+ template<@\exposconcept{simd-floating-point}@ V>
17629+ constexpr void real(const V& v) noexcept;
17630+ template<@\exposconcept{simd-floating-point}@ V>
17631+ constexpr void imag(const V& v) noexcept;
17632+ \end{itemdecl}
17633+
17634+ \begin{itemdescr}
17635+ \pnum
17636+ \constraints
17637+ \begin{itemize}
17638+ \item
17639+ \tcode{\exposconcept{simd-complex}<basic_simd>} is modeled,
17640+ \item
17641+ \tcode{\libconcept{same_as}<typename V::value_type, typename T::value_type>}
17642+ is modeled, and
17643+ \item
17644+ \tcode{V::size() == size()} is \tcode{true}.
17645+ \end{itemize}
17646+
17647+ \pnum
17648+ \effects
17649+ Replaces each element of the \tcode{basic_simd} object such that the
17650+ $i^\text{th}$ element is replaced with \tcode{value_type(v[$i$],
17651+ operator[]($i$).imag())} or \tcode{value_type(operator[]($i$).real(), v[$i$])}
17652+ for \tcode{real} and \tcode{imag} respectively, for all $i$ in the range \range{0}{size()}.
17653+ \end{itemdescr}
17654+
1751417655\rSec3[simd.cond]{\tcode{basic_simd} exposition only conditional operators}
1751517656
1751617657\begin{itemdecl}
1867218813function from \libheader{bit}.
1867318814\end{itemdescr}
1867418815
18816+ \rSec3[simd.complex.math]{\tcode{simd} complex math}
18817+
18818+ \begin{itemdecl}
18819+ template<@\exposconcept{simd-complex}@ V>
18820+ constexpr rebind_simd_t<@\exposid{simd-complex-value-type<V>}@, V> real(const V&) noexcept;
18821+ template<@\exposconcept{simd-complex}@ V>
18822+ constexpr rebind_simd_t<@\exposid{simd-complex-value-type<V>}@, V> imag(const V&) noexcept;
18823+
18824+ template<@\exposconcept{simd-complex}@ V>
18825+ constexpr rebind_simd_t<@\exposid{simd-complex-value-type<V>}@, V> abs(const V&);
18826+ template<@\exposconcept{simd-complex}@ V>
18827+ constexpr rebind_simd_t<@\exposid{simd-complex-value-type<V>}@, V> arg(const V&);
18828+ template<@\exposconcept{simd-complex}@ V>
18829+ constexpr rebind_simd_t<@\exposid{simd-complex-value-type<V>}@, V> norm(const V&);
18830+ template<@\exposconcept{simd-complex}@ V> constexpr V conj(const V&);
18831+ template<@\exposconcept{simd-complex}@ V> constexpr V proj(const V&);
18832+
18833+ template<@\exposconcept{simd-complex}@ V> constexpr V exp(const V& v);
18834+ template<@\exposconcept{simd-complex}@ V> constexpr V log(const V& v);
18835+ template<@\exposconcept{simd-complex}@ V> constexpr V log10(const V& v);
18836+
18837+ template<@\exposconcept{simd-complex}@ V> constexpr V sqrt(const V& v);
18838+ template<@\exposconcept{simd-complex}@ V> constexpr V sin(const V& v);
18839+ template<@\exposconcept{simd-complex}@ V> constexpr V asin(const V& v);
18840+ template<@\exposconcept{simd-complex}@ V> constexpr V cos(const V& v);
18841+ template<@\exposconcept{simd-complex}@ V> constexpr V acos(const V& v);
18842+ template<@\exposconcept{simd-complex}@ V> constexpr V tan(const V& v);
18843+ template<@\exposconcept{simd-complex}@ V> constexpr V atan(const V& v);
18844+ template<@\exposconcept{simd-complex}@ V> constexpr V sinh(const V& v);
18845+ template<@\exposconcept{simd-complex}@ V> constexpr V asinh(const V& v);
18846+ template<@\exposconcept{simd-complex}@ V> constexpr V cosh(const V& v);
18847+ template<@\exposconcept{simd-complex}@ V> constexpr V acosh(const V& v);
18848+ template<@\exposconcept{simd-complex}@ V> constexpr V tanh(const V& v);
18849+ template<@\exposconcept{simd-complex}@ V> constexpr V atanh(const V& v);
18850+ \end{itemdecl}
18851+
18852+ \begin{itemdescr}
18853+ \pnum
18854+ \returns
18855+ A \tcode{basic_simd} object \tcode{ret} where the $i^\text{th}$ element is
18856+ initialized to the result of \tcode{\placeholder{cmplx-func}(v[$i$])} for all
18857+ $i$ in the range \range{0}{V::size()}, where \placeholder{cmplx-func} is the
18858+ corresponding function from \libheader{complex}. If in an invocation of
18859+ \placeholder{cmplx-func} for index $i$ a domain, pole, or range error would
18860+ occur, the value of \tcode{ret[$i$]} is unspecified.
18861+
18862+ \pnum
18863+ \remarks
18864+ It is unspecified whether \tcode{errno}\iref{errno} is accessed.
18865+ \end{itemdescr}
18866+
18867+ \begin{itemdecl}
18868+ template<@\exposconcept{simd-floating-point}@ V>
18869+ rebind_simd_t<complex<typename V::value_type>, V> polar(const V& x, const V& y = {});
18870+
18871+ template<@\exposconcept{simd-complex}@ V> constexpr V pow(const V& x, const V& y);
18872+ \end{itemdecl}
18873+
18874+ \begin{itemdescr}
18875+ \pnum
18876+ \returns
18877+ A \tcode{basic_simd} object \tcode{ret} where the $i^\text{th}$ element is
18878+ initialized to the result of \tcode{\placeholder{cmplx-func}(x[$i$], y[$i$])}
18879+ for all $i$ in the range \range{0}{V::size()}, where \placeholder{cmplx-func}
18880+ is the corresponding function from \libheader{complex}. If in an invocation of
18881+ \placeholder{cmplx-func} for index $i$ a domain, pole, or range error would
18882+ occur, the value of \tcode{ret[$i$]} is unspecified.
18883+
18884+ \pnum
18885+ \remarks
18886+ It is unspecified whether \tcode{errno}\iref{errno} is accessed.
18887+ \end{itemdescr}
18888+
1867518889\rSec2[simd.mask.class]{Class template \tcode{basic_simd_mask}}
1867618890
1867718891\rSec3[simd.mask.overview]{Class template \tcode{basic_simd_mask} overview}
0 commit comments