diff --git a/source/numerics.tex b/source/numerics.tex index 79f510686c..ae4242eae9 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -16157,11 +16157,11 @@ \pnum The term \defnadj{data-parallel}{type} refers to all enabled specializations of -the \tcode{basic_simd} and \tcode{basic_simd_mask} class templates. +the \tcode{basic_vec} and \tcode{basic_mask} class templates. A \defnadj{data-parallel}{object} is an object of data-parallel type. \pnum -Each specialization of \tcode{basic_simd} or \tcode{basic_simd_mask} is either +Each specialization of \tcode{basic_vec} or \tcode{basic_mask} is either enabled or disabled, as described in \ref{simd.overview} and \ref{simd.mask.overview}. @@ -16183,7 +16183,7 @@ objects. \pnum -Given a \tcode{basic_simd_mask} object \tcode{mask}, the +Given a \tcode{basic_mask} object \tcode{mask}, the \defnadj{selected}{indices} signify the integers $i$ in the range \range{0}{mask.size()} for which \tcode{mask[$i$]} is \tcode{true}. Given a data-parallel object \tcode{data}, the \defnadj{selected}{elements} @@ -16211,29 +16211,38 @@ bool_constant::value && bool_constant(T()) == T::value>::value; -template using @\exposidnc{deduced-simd-t} = \seebelownc@; // \expos +template using @\exposidnc{deduced-vec-t} = \seebelownc@; // \expos template using @\exposidnc{make-compatible-simd-t} = \seebelownc@; // \expos template - concept @\defexposconceptnc{simd-type}@ = // \expos - @\libconcept{same_as}@> && + concept @\defexposconceptnc{simd-vec-type}@ = // \expos + @\libconcept{same_as}@> && + is_default_constructible_v; + +template + concept @\defexposconceptnc{simd-mask-type}@ = // \expos + @\libconcept{same_as}@, typename V::abi_type>> && is_default_constructible_v; template concept @\defexposconceptnc{simd-floating-point}@ = // \expos - @\exposconcept{simd-type}@ && @\libconcept{floating_point}@; + @\exposconcept{simd-vec-type}@ && @\libconcept{floating_point}@; + +template + concept @\defexposconceptnc{simd-integral}@ = // \expos + @\exposconcept{simd-vec-type}@ && @\libconcept{integral}@; template using @\exposidnc{simd-complex-value-type}@ = typename V::value_type::value_type; // \expos template concept @\defexposconceptnc{simd-complex}@ = // \expos - @\exposconcept{simd-type}@ && @\libconcept{same_as}@>>; + @\exposconcept{simd-vec-type}@ && @\libconcept{same_as}@>>; template concept @\defexposconceptnc{math-floating-point}@ = // \expos - (@\exposconceptnc{simd-floating-point}<\exposidnc{deduced-simd-t}@> || ...); + (@\exposconceptnc{simd-floating-point}<\exposidnc{deduced-vec-t}@> || ...); template requires @\exposconceptnc{math-floating-point}@ @@ -16280,8 +16289,8 @@ \begin{itemdescr} \pnum -\tcode{\exposid{simd-size-v}} denotes the width of \tcode{basic_simd} if the specialization \tcode{basic_simd} is enabled, or \tcode{0} +\tcode{\exposid{simd-size-v}} denotes the width of \tcode{basic_vec} if the specialization \tcode{basic_vec} is enabled, or \tcode{0} otherwise. \end{itemdescr} @@ -16291,12 +16300,12 @@ \begin{itemdescr} \pnum -\tcode{\exposid{mask-element-size}>} has the value +\tcode{\exposid{mask-element-size}>} has the value \tcode{Bytes}. \end{itemdescr} \begin{itemdecl} -template using @\exposid{deduced-simd-t}@ = @\seebelow@; +template using @\exposid{deduced-vec-t}@ = @\seebelow@; \end{itemdecl} \begin{itemdescr} @@ -16304,11 +16313,11 @@ Let \tcode{x} denote an lvalue of type \tcode{const T}. \pnum -\tcode{\exposid{deduced-simd-t}} is an alias for +\tcode{\exposid{deduced-vec-t}} is an alias for \begin{itemize} \item \tcode{decltype(x + x)}, if the type of \tcode{x + x} is an enabled - specialization of \tcode{basic_simd}; otherwise + specialization of \tcode{basic_vec}; otherwise \item \tcode{void}. \end{itemize} @@ -16326,10 +16335,10 @@ \tcode{\exposid{make-compatible-simd-t}} is an alias for \begin{itemize} \item - \tcode{\exposid{deduced-simd-t}}, if that type is not \tcode{void}, + \tcode{\exposid{deduced-vec-t}}, if that type is not \tcode{void}, otherwise \item - \tcode{simd}. + \tcode{vec}. \end{itemize} \end{itemdescr} @@ -16350,20 +16359,20 @@ Let \tcode{\exposid{math-common-simd-t}} be an alias for \begin{itemize} \item - \tcode{\exposid{deduced-simd-t}}, if \tcode{sizeof...(Ts)} equals $1$; + \tcode{\exposid{deduced-vec-t}}, if \tcode{sizeof...(Ts)} equals $1$; otherwise \item - \tcode{common_type_t<\exposid{deduced-simd-t}, - \exposid{deduced-simd-t}>}, if \tcode{sizeof...(Ts)} equals $2$ and + \tcode{common_type_t<\exposid{deduced-vec-t}, + \exposid{deduced-vec-t}>}, if \tcode{sizeof...(Ts)} equals $2$ and \tcode{\exposconcept{math-floating-point} \&\& \exposconcept{math-floating-point}} is \tcode{true}; otherwise \item - \tcode{common_type_t<\exposid{deduced-simd-t}, T1>}, if + \tcode{common_type_t<\exposid{deduced-vec-t}, T1>}, if \tcode{sizeof...(Ts)} equals $2$ and \tcode{\exposconceptx{math-floating-\brk{}point}{math-floating-point}<\brk{}T0>} is \tcode{true}; otherwise \item - \tcode{common_type_t>}, if + \tcode{common_type_t>}, if \tcode{sizeof...(Ts)} equals $2$; otherwise \item \tcode{common_type_t<\exposid{math-common-simd-t}, TRest...>}, if @@ -16377,8 +16386,8 @@ \begin{itemdecl} template concept @\defexposconcept{reduction-binary-operation}@ = - requires (const BinaryOperation binary_op, const simd v) { - { binary_op(v, v) } -> @\libconcept{same_as}@>; + requires (const BinaryOperation binary_op, const vec v) { + { binary_op(v, v) } -> @\libconcept{same_as}@>; }; \end{itemdecl} @@ -16391,8 +16400,8 @@ operation is commutative. \item An object of type \tcode{BinaryOperation} can be invoked with two -arguments of type \tcode{basic_simd}, with unspecified ABI tag -\tcode{Abi}, returning a \tcode{basic_simd}. +arguments of type \tcode{basic_vec}, with unspecified ABI tag +\tcode{Abi}, returning a \tcode{basic_vec}. \end{itemize} \end{itemdescr} @@ -16432,7 +16441,7 @@ \item \tcode{N} is greater than zero, and \item \tcode{N} is not larger than an implementation-defined maximum. \end{itemize} -The \impldef{maximum width for \tcode{simd} and \tcode{simd_mask}} maximum for +The \impldef{maximum width for \tcode{vec} and \tcode{mask}} maximum for \tcode{N} is not smaller than 64 and can differ depending on \tcode{T}. \pnum @@ -16441,17 +16450,17 @@ \begin{itemize} \item \tcode{\exposid{simd-size-v}>} equals - \tcode{N}, \item \tcode{basic_simd>} is + \tcode{N}, \item \tcode{basic_vec>} is enabled\iref{simd.overview}, and \item - \tcode{basic_simd_mask, N>>} is enabled. \end{itemize} \pnum \tcode{\exposid{native-abi}} is an \impldef{default ABI tag for -\tcode{basic_simd} and \tcode{basic_simd_mask}} alias for an ABI tag. -\tcode{basic_simd>} is an enabled specialization. +\tcode{basic_vec} and \tcode{basic_mask}} alias for an ABI tag. +\tcode{basic_vec>} is an enabled specialization. \begin{note} The intent is to use the ABI tag producing the most efficient data-parallel execution for the element type \tcode{T} on the currently targeted system. @@ -16474,36 +16483,36 @@ \rSec2[simd.syn]{Header \tcode{} synopsis} \indexheader{simd}% \begin{codeblock} -namespace std::datapar { +namespace std::simd { // \ref{simd.traits}, \tcode{simd} type traits template struct alignment; template - constexpr size_t alignment_v = alignment::value; + constexpr size_t @\libmember{alignment_v}{simd}@ = alignment::value; template struct rebind { using type = @\seebelow@; }; - template using rebind_t = typename rebind::type; + template using @\libmember{rebind_t}{simd}@ = typename rebind::type; template<@\exposid{simd-size-type}@ N, class V> struct resize { using type = @\seebelow@; }; - template<@\exposid{simd-size-type}@ N, class V> using resize_t = typename resize::type; + template<@\exposid{simd-size-type}@ N, class V> using @\libmember{resize_t}{simd}@ = typename resize::type; // \ref{simd.flags}, Load and store flags template struct flags; - inline constexpr flags<> flag_default{}; - inline constexpr flags<@\exposid{convert-flag}@> flag_convert{}; - inline constexpr flags<@\exposid{aligned-flag}@> flag_aligned{}; + inline constexpr flags<> @\libmember{flag_default}{simd}@{}; + inline constexpr flags<@\exposid{convert-flag}@> @\libmember{flag_convert}{simd}@{}; + inline constexpr flags<@\exposid{aligned-flag}@> @\libmember{flag_aligned}{simd}@{}; template requires (has_single_bit(N)) - constexpr flags<@\exposid{overaligned-flag}@> flag_overaligned{}; + constexpr flags<@\exposid{overaligned-flag}@> @\libmember{flag_overaligned}{simd}@{}; - // \ref{simd.class}, Class template \tcode{basic_simd} - template> class basic_simd; + // \ref{simd.class}, Class template \tcode{basic_vec} + template> class basic_vec; template>> - using simd = basic_simd>; + using @\libmember{vec}{simd}@ = basic_vec>; - // \ref{simd.mask.class}, Class template \tcode{basic_simd_mask} - template>> class basic_simd_mask; + // \ref{simd.mask.class}, Class template \tcode{basic_mask} + template>> class basic_mask; template>> - using simd_mask = basic_simd_mask>; + using @\libmember{mask}{simd}@ = basic_mask>; - // \ref{simd.loadstore}, \tcode{basic_simd} load and store functions + // \ref{simd.loadstore}, \tcode{basic_vec} load and store functions template requires ranges::@\libconcept{sized_range}@ constexpr V unchecked_load(R&& r, flags f = {}); @@ -16543,88 +16552,176 @@ template requires ranges::@\libconcept{sized_range}@ && @\libconcept{indirectly_writable}@, T> - constexpr void unchecked_store(const basic_simd& v, R&& r, + constexpr void unchecked_store(const basic_vec& v, R&& r, flags f = {}); template requires ranges::@\libconcept{sized_range}@ && @\libconcept{indirectly_writable}@, T> - constexpr void unchecked_store(const basic_simd& v, R&& r, - const typename basic_simd::mask_type& mask, flags f = {}); + constexpr void unchecked_store(const basic_vec& v, R&& r, + const typename basic_vec::mask_type& mask, flags f = {}); template requires @\libconcept{indirectly_writable}@ - constexpr void unchecked_store(const basic_simd& v, I first, + constexpr void unchecked_store(const basic_vec& v, I first, iter_difference_t n, flags f = {}); template requires @\libconcept{indirectly_writable}@ - constexpr void unchecked_store(const basic_simd& v, I first, - iter_difference_t n, const typename basic_simd::mask_type& mask, + constexpr void unchecked_store(const basic_vec& v, I first, + iter_difference_t n, const typename basic_vec::mask_type& mask, flags f = {}); template S, class... Flags> requires @\libconcept{indirectly_writable}@ - constexpr void unchecked_store(const basic_simd& v, I first, S last, + constexpr void unchecked_store(const basic_vec& v, I first, S last, flags f = {}); template S, class... Flags> requires @\libconcept{indirectly_writable}@ - constexpr void unchecked_store(const basic_simd& v, I first, S last, - const typename basic_simd::mask_type& mask, flags f = {}); + constexpr void unchecked_store(const basic_vec& v, I first, S last, + const typename basic_vec::mask_type& mask, flags f = {}); template requires ranges::@\libconcept{sized_range}@ && @\libconcept{indirectly_writable}@, T> - constexpr void partial_store(const basic_simd& v, R&& r, + constexpr void partial_store(const basic_vec& v, R&& r, flags f = {}); template requires ranges::@\libconcept{sized_range}@ && @\libconcept{indirectly_writable}@, T> - constexpr void partial_store(const basic_simd& v, R&& r, - const typename basic_simd::mask_type& mask, flags f = {}); + constexpr void partial_store(const basic_vec& v, R&& r, + const typename basic_vec::mask_type& mask, flags f = {}); template requires @\libconcept{indirectly_writable}@ constexpr void partial_store( - const basic_simd& v, I first, iter_difference_t n, flags f = {}); + const basic_vec& v, I first, iter_difference_t n, flags f = {}); template requires @\libconcept{indirectly_writable}@ constexpr void partial_store( - const basic_simd& v, I first, iter_difference_t n, - const typename basic_simd::mask_type& mask, flags f = {}); + const basic_vec& v, I first, iter_difference_t n, + const typename basic_vec::mask_type& mask, flags f = {}); template S, class... Flags> requires @\libconcept{indirectly_writable}@ - constexpr void partial_store(const basic_simd& v, I first, S last, + constexpr void partial_store(const basic_vec& v, I first, S last, flags f = {}); template S, class... Flags> requires @\libconcept{indirectly_writable}@ - constexpr void partial_store(const basic_simd& v, I first, S last, - const typename basic_simd::mask_type& mask, flags f = {}); + constexpr void partial_store(const basic_vec& v, I first, S last, + const typename basic_vec::mask_type& mask, flags f = {}); + + // \ref{simd.permute.static}, Permute by static index generator + static constexpr @\exposid{simd-size-type}@ @\libmember{zero_element}{simd}@ = @\impdefx{value of \tcode{simd::zero_element}}@; + static constexpr @\exposid{simd-size-type}@ @\libmember{uninit_element}{simd}@ = @\impdefx{value of \tcode{simd::uninit_element}}@; + + template<@\exposid{simd-size-type}@ N = @\seebelow@, @\exposconcept{simd-vec-type}@ V, class IdxMap> + constexpr resize_t permute(const V& v, IdxMap&& idxmap); + template<@\exposid{simd-size-type}@ N = @\seebelow@, @\exposconcept{simd-mask-type}@ M, class IdxMap> + constexpr resize_t permute(const M& v, IdxMap&& idxmap); + + // \ref{simd.permute.dynamic}, Permute by dynamic index + template<@\exposconcept{simd-vec-type}@ V, @\exposconcept{simd-integral}@ I> + constexpr resize_t permute(const V& v, const I& indices); + template<@\exposconcept{simd-mask-type}@ M, @\exposconcept{simd-integral}@ I> + constexpr resize_t permute(const M& v, const I& indices); + + // \ref{simd.permute.mask}, Permute by active mask bits + template<@\exposconcept{simd-vec-type}@ V> + constexpr V compress(const V& v, const typename V::mask_type& selector); + template<@\exposconcept{simd-mask-type}@ M> + constexpr M compress(const M& v, const type_identity_t& selector); + template<@\exposconcept{simd-vec-type}@ V> + constexpr V compress(const V& v, const typename V::mask_type& selector, + const typename V::value_type& fill_value); + template<@\exposconcept{simd-mask-type}@ M> + constexpr M compress(const M& v, const type_identity_t& selector, + const typename V::value_type& fill_value); + + template<@\exposconcept{simd-vec-type}@ V> + constexpr V expand(const V& v, const typename V::mask_type& selector, + const V& original = {}); + template<@\exposconcept{simd-mask-type}@ M> + constexpr M expand(const M& v, const type_identity_t& selector, const M& original = {}); + + // \ref{simd.permute.memory}, Permute to and from memory + template + requires ranges::@\libconcept{sized_range}@ + constexpr V + unchecked_gather_from(R&& in, const I& indices, flags f = {}); + template + requires ranges::@\libconcept{sized_range}@ + constexpr V + unchecked_gather_from(R&& in, const typename I::mask_type& mask, + const I& indices, flags f = {}); - // \ref{simd.creation}, \tcode{basic_simd} and \tcode{basic_simd_mask} creation + template + requires ranges::@\libconcept{sized_range}@ + constexpr V + partial_gather_from(R&& in, const I& indices, flags f = {}); + template + requires ranges::@\libconcept{sized_range}@ + constexpr V + partial_gather_from(R&& in, const typename I::mask_type& mask, + const I& indices, flags f = {}); + + template<@\exposconcept{simd-vec-type}@ V, + ranges::@\libconcept{contiguous_range}@ R, + @\exposconcept{simd-integral}@ I, class... Flags> + requires ranges::@\libconcept{sized_range}@ + constexpr void + unchecked_scatter_to(const V& v, R&& out, const I& indices, flags f = {}); + template<@\exposconcept{simd-vec-type}@ V, + ranges::@\libconcept{contiguous_range}@ R, + @\exposconcept{simd-integral}@ I, class... Flags> + requires ranges::@\libconcept{sized_range}@ + constexpr void + unchecked_scatter_to(const V& v, R&& out, + const typename I::mask_type& mask, + const I& indices, flags f = {}); + + template<@\exposconcept{simd-vec-type}@ V, + ranges::@\libconcept{contiguous_range}@ R, + @\exposconcept{simd-integral}@ I, class... Flags> + requires ranges::@\libconcept{sized_range}@ + constexpr void + partial_scatter_to(const V& v, R&& out, const I& indices, flags f = {}); + template<@\exposconcept{simd-vec-type}@ V, + ranges::@\libconcept{contiguous_range}@ R, + @\exposconcept{simd-integral}@ I, class... Flags> + requires ranges::@\libconcept{sized_range}@ + constexpr void + partial_scatter_to(const V& v, R&& out, + const typename I::mask_type& mask, + const I& indices, flags f = {}); + + // \ref{simd.creation}, \tcode{basic_vec} and \tcode{basic_mask} creation template - constexpr auto chunk(const basic_simd& x) noexcept; + constexpr auto chunk(const basic_vec& x) noexcept; template - constexpr auto chunk(const basic_simd_mask<@\exposid{mask-element-size}@, Abi>& x) noexcept; + constexpr auto chunk(const basic_mask<@\exposid{mask-element-size}@, Abi>& x) noexcept; template - constexpr auto chunk(const basic_simd& x) noexcept; + constexpr auto chunk(const basic_vec& x) noexcept; template - constexpr auto chunk(const basic_simd_mask& x) noexcept; + constexpr auto chunk(const basic_mask& x) noexcept; template - constexpr basic_simd::size() + ...)>> - cat(const basic_simd&...) noexcept; + constexpr basic_vec::size() + ...)>> + cat(const basic_vec&...) noexcept; template - constexpr basic_simd_mask, - (basic_simd_mask::size() + ...)>> - cat(const basic_simd_mask&...) noexcept; + constexpr basic_mask, + (basic_mask::size() + ...)>> + cat(const basic_mask&...) noexcept; - // \ref{simd.mask.reductions}, \tcode{basic_simd_mask} reductions + // \ref{simd.mask.reductions}, \tcode{basic_mask} reductions template - constexpr bool all_of(const basic_simd_mask&) noexcept; + constexpr bool all_of(const basic_mask&) noexcept; template - constexpr bool any_of(const basic_simd_mask&) noexcept; + constexpr bool any_of(const basic_mask&) noexcept; template - constexpr bool none_of(const basic_simd_mask&) noexcept; + constexpr bool none_of(const basic_mask&) noexcept; template - constexpr @\exposid{simd-size-type}@ reduce_count(const basic_simd_mask&) noexcept; + constexpr @\exposid{simd-size-type}@ reduce_count(const basic_mask&) noexcept; template - constexpr @\exposid{simd-size-type}@ reduce_min_index(const basic_simd_mask&); + constexpr @\exposid{simd-size-type}@ reduce_min_index(const basic_mask&); template - constexpr @\exposid{simd-size-type}@ reduce_max_index(const basic_simd_mask&); + constexpr @\exposid{simd-size-type}@ reduce_max_index(const basic_mask&); constexpr bool all_of(@\libconcept{same_as}@ auto) noexcept; constexpr bool any_of(@\libconcept{same_as}@ auto) noexcept; @@ -16633,117 +16730,117 @@ constexpr @\exposid{simd-size-type}@ reduce_min_index(@\libconcept{same_as}@ auto); constexpr @\exposid{simd-size-type}@ reduce_max_index(@\libconcept{same_as}@ auto); - // \ref{simd.reductions}, \tcode{basic_simd} reductions + // \ref{simd.reductions}, \tcode{basic_vec} reductions template> - constexpr T reduce(const basic_simd&, BinaryOperation = {}); + constexpr T reduce(const basic_vec&, BinaryOperation = {}); template> constexpr T reduce( - const basic_simd& x, const typename basic_simd::mask_type& mask, + const basic_vec& x, const typename basic_vec::mask_type& mask, BinaryOperation binary_op = {}, type_identity_t identity_element = @\seebelow@); template - constexpr T reduce_min(const basic_simd&) noexcept; + constexpr T reduce_min(const basic_vec&) noexcept; template - constexpr T reduce_min(const basic_simd&, - const typename basic_simd::mask_type&) noexcept; + constexpr T reduce_min(const basic_vec&, + const typename basic_vec::mask_type&) noexcept; template - constexpr T reduce_max(const basic_simd&) noexcept; + constexpr T reduce_max(const basic_vec&) noexcept; template - constexpr T reduce_max(const basic_simd&, - const typename basic_simd::mask_type&) noexcept; + constexpr T reduce_max(const basic_vec&, + const typename basic_vec::mask_type&) noexcept; // \ref{simd.alg}, Algorithms template - constexpr basic_simd - min(const basic_simd& a, const basic_simd& b) noexcept; + constexpr basic_vec + min(const basic_vec& a, const basic_vec& b) noexcept; template - constexpr basic_simd - max(const basic_simd& a, const basic_simd& b) noexcept; + constexpr basic_vec + max(const basic_vec& a, const basic_vec& b) noexcept; template - constexpr pair, basic_simd> - minmax(const basic_simd& a, const basic_simd& b) noexcept; + constexpr pair, basic_vec> + minmax(const basic_vec& a, const basic_vec& b) noexcept; template - constexpr basic_simd - clamp(const basic_simd& v, const basic_simd& lo, - const basic_simd& hi); + constexpr basic_vec + clamp(const basic_vec& v, const basic_vec& lo, + const basic_vec& hi); template constexpr auto select(bool c, const T& a, const U& b) -> remove_cvref_t; template - constexpr auto select(const basic_simd_mask& c, const T& a, const U& b) + constexpr auto select(const basic_mask& c, const T& a, const U& b) noexcept -> decltype(@\exposid{simd-select-impl}@(c, a, b)); // \ref{simd.math}, Mathematical functions - template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ acos(const V& x); - template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ asin(const V& x); - template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ atan(const V& x); + template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ acos(const V& x); + template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ asin(const V& x); + template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ atan(const V& x); template constexpr @\exposid{math-common-simd-t}@ atan2(const V0& y, const V1& x); - template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ cos(const V& x); - template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ sin(const V& x); - template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ tan(const V& x); - template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ acosh(const V& x); - template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ asinh(const V& x); - template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ atanh(const V& x); - template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ cosh(const V& x); - template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ sinh(const V& x); - template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ tanh(const V& x); - template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ exp(const V& x); - template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ exp2(const V& x); - template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ expm1(const V& x); + template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ cos(const V& x); + template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ sin(const V& x); + template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ tan(const V& x); + template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ acosh(const V& x); + template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ asinh(const V& x); + template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ atanh(const V& x); + template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ cosh(const V& x); + template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ sinh(const V& x); + template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ tanh(const V& x); + template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ exp(const V& x); + template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ exp2(const V& x); + template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ expm1(const V& x); template<@\exposconcept{math-floating-point}@ V> - constexpr @\exposid{deduced-simd-t}@ - frexp(const V& value, rebind_t>* exp); + constexpr @\exposid{deduced-vec-t}@ + frexp(const V& value, rebind_t>* exp); template<@\exposconcept{math-floating-point}@ V> - constexpr rebind_t> ilogb(const V& x); - template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ ldexp(const V& x, const - rebind_t>& exp); - template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ log(const V& x); - template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ log10(const V& x); - template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ log1p(const V& x); - template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ log2(const V& x); - template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ logb(const V& x); + constexpr rebind_t> ilogb(const V& x); + template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ ldexp(const V& x, const + rebind_t>& exp); + template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ log(const V& x); + template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ log10(const V& x); + template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ log1p(const V& x); + template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ log2(const V& x); + template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ logb(const V& x); template - constexpr basic_simd modf(const type_identity_t>& value, - basic_simd* iptr); - template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ scalbn(const V& x, const - rebind_t>& n); + constexpr basic_vec modf(const type_identity_t>& value, + basic_vec* iptr); + template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ scalbn(const V& x, const + rebind_t>& n); template<@\exposconcept{math-floating-point}@ V> - constexpr @\exposid{deduced-simd-t}@ scalbln( - const V& x, const rebind_t>& n); - template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ cbrt(const V& x); + constexpr @\exposid{deduced-vec-t}@ scalbln( + const V& x, const rebind_t>& n); + template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ cbrt(const V& x); template<@\libconcept{signed_integral}@ T, class Abi> - constexpr basic_simd abs(const basic_simd& j); - template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ abs(const V& j); - template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ fabs(const V& x); + constexpr basic_vec abs(const basic_vec& j); + template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ abs(const V& j); + template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ fabs(const V& x); template constexpr @\exposid{math-common-simd-t}@ hypot(const V0& x, const V1& y); template constexpr @\exposid{math-common-simd-t}@ hypot(const V0& x, const V1& y, const V2& z); template constexpr @\exposid{math-common-simd-t}@ pow(const V0& x, const V1& y); - template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ sqrt(const V& x); - template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ erf(const V& x); - template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ erfc(const V& x); - template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ lgamma(const V& x); - template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ tgamma(const V& x); - template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ ceil(const V& x); - template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ floor(const V& x); - template<@\exposconcept{math-floating-point}@ V> @\exposid{deduced-simd-t}@ nearbyint(const V& x); - template<@\exposconcept{math-floating-point}@ V> @\exposid{deduced-simd-t}@ rint(const V& x); + template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ sqrt(const V& x); + template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ erf(const V& x); + template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ erfc(const V& x); + template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ lgamma(const V& x); + template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ tgamma(const V& x); + template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ ceil(const V& x); + template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ floor(const V& x); + template<@\exposconcept{math-floating-point}@ V> @\exposid{deduced-vec-t}@ nearbyint(const V& x); + template<@\exposconcept{math-floating-point}@ V> @\exposid{deduced-vec-t}@ rint(const V& x); template<@\exposconcept{math-floating-point}@ V> - rebind_t> lrint(const V& x); + rebind_t> lrint(const V& x); template<@\exposconcept{math-floating-point}@ V> - rebind_t llrint(const @\exposid{deduced-simd-t}@& x); + rebind_t llrint(const @\exposid{deduced-vec-t}@& x); template<@\exposconcept{math-floating-point}@ V> - constexpr @\exposid{deduced-simd-t}@ round(const V& x); + constexpr @\exposid{deduced-vec-t}@ round(const V& x); template<@\exposconcept{math-floating-point}@ V> - constexpr rebind_t> lround(const V& x); + constexpr rebind_t> lround(const V& x); template<@\exposconcept{math-floating-point}@ V> - constexpr rebind_t> llround(const V& x); + constexpr rebind_t> llround(const V& x); template<@\exposconcept{math-floating-point}@ V> - constexpr @\exposid{deduced-simd-t}@ trunc(const V& x); + constexpr @\exposid{deduced-vec-t}@ trunc(const V& x); template constexpr @\exposid{math-common-simd-t}@ fmod(const V0& x, const V1& y); template @@ -16767,17 +16864,17 @@ constexpr @\exposid{math-common-simd-t}@ lerp(const V0& a, const V1& b, const V2& t) noexcept; template<@\exposconcept{math-floating-point}@ V> - constexpr rebind_t> fpclassify(const V& x); + constexpr rebind_t> fpclassify(const V& x); template<@\exposconcept{math-floating-point}@ V> - constexpr typename @\exposid{deduced-simd-t}@::mask_type isfinite(const V& x); + constexpr typename @\exposid{deduced-vec-t}@::mask_type isfinite(const V& x); template<@\exposconcept{math-floating-point}@ V> - constexpr typename @\exposid{deduced-simd-t}@::mask_type isinf(const V& x); + constexpr typename @\exposid{deduced-vec-t}@::mask_type isinf(const V& x); template<@\exposconcept{math-floating-point}@ V> - constexpr typename @\exposid{deduced-simd-t}@::mask_type isnan(const V& x); + constexpr typename @\exposid{deduced-vec-t}@::mask_type isnan(const V& x); template<@\exposconcept{math-floating-point}@ V> - constexpr typename @\exposid{deduced-simd-t}@::mask_type isnormal(const V& x); + constexpr typename @\exposid{deduced-vec-t}@::mask_type isnormal(const V& x); template<@\exposconcept{math-floating-point}@ V> - constexpr typename @\exposid{deduced-simd-t}@::mask_type signbit(const V& x); + constexpr typename @\exposid{deduced-vec-t}@::mask_type signbit(const V& x); template constexpr typename @\exposid{math-common-simd-t}@::mask_type isgreater(const V0& x, const V1& y); @@ -16797,17 +16894,17 @@ constexpr typename @\exposid{math-common-simd-t}@::mask_type isunordered(const V0& x, const V1& y); template<@\exposconcept{math-floating-point}@ V> - @\exposid{deduced-simd-t}@ assoc_laguerre(const rebind_t>& n, const - rebind_t>& m, + @\exposid{deduced-vec-t}@ assoc_laguerre(const rebind_t>& n, const + rebind_t>& m, const V& x); template<@\exposconcept{math-floating-point}@ V> - @\exposid{deduced-simd-t}@ assoc_legendre(const rebind_t>& l, const - rebind_t>& m, + @\exposid{deduced-vec-t}@ assoc_legendre(const rebind_t>& l, const + rebind_t>& m, const V& x); template @\exposid{math-common-simd-t}@ beta(const V0& x, const V1& y); - template<@\exposconcept{math-floating-point}@ V> @\exposid{deduced-simd-t}@ comp_ellint_1(const V& k); - template<@\exposconcept{math-floating-point}@ V> @\exposid{deduced-simd-t}@ comp_ellint_2(const V& k); + template<@\exposconcept{math-floating-point}@ V> @\exposid{deduced-vec-t}@ comp_ellint_1(const V& k); + template<@\exposconcept{math-floating-point}@ V> @\exposid{deduced-vec-t}@ comp_ellint_2(const V& k); template @\exposid{math-common-simd-t}@ comp_ellint_3(const V0& k, const V1& nu); template @@ -16824,59 +16921,59 @@ @\exposid{math-common-simd-t}@ ellint_2(const V0& k, const V1& phi); template @\exposid{math-common-simd-t}@ ellint_3(const V0& k, const V1& nu, const V2& phi); - template<@\exposconcept{math-floating-point}@ V> @\exposid{deduced-simd-t}@ expint(const V& x); + template<@\exposconcept{math-floating-point}@ V> @\exposid{deduced-vec-t}@ expint(const V& x); template<@\exposconcept{math-floating-point}@ V> - @\exposid{deduced-simd-t}@ hermite(const rebind_t>& n, const V& x); + @\exposid{deduced-vec-t}@ hermite(const rebind_t>& n, const V& x); template<@\exposconcept{math-floating-point}@ V> - @\exposid{deduced-simd-t}@ laguerre(const rebind_t>& n, const V& x); + @\exposid{deduced-vec-t}@ laguerre(const rebind_t>& n, const V& x); template<@\exposconcept{math-floating-point}@ V> - @\exposid{deduced-simd-t}@ legendre(const rebind_t>& l, const V& x); + @\exposid{deduced-vec-t}@ legendre(const rebind_t>& l, const V& x); template<@\exposconcept{math-floating-point}@ V> - @\exposid{deduced-simd-t}@ riemann_zeta(const V& x); + @\exposid{deduced-vec-t}@ riemann_zeta(const V& x); template<@\exposconcept{math-floating-point}@ V> - @\exposid{deduced-simd-t}@ sph_bessel( - const rebind_t>& n, const V& x); + @\exposid{deduced-vec-t}@ sph_bessel( + const rebind_t>& n, const V& x); template<@\exposconcept{math-floating-point}@ V> - @\exposid{deduced-simd-t}@ sph_legendre(const rebind_t>& l, - const rebind_t>& m, const V& theta); + @\exposid{deduced-vec-t}@ sph_legendre(const rebind_t>& l, + const rebind_t>& m, const V& theta); template<@\exposconcept{math-floating-point}@ V> - @\exposid{deduced-simd-t}@ - sph_neumann(const rebind_t>& n, const V& x); + @\exposid{deduced-vec-t}@ + sph_neumann(const rebind_t>& n, const V& x); // \ref{simd.bit}, Bit manipulation - template<@\exposconcept{simd-type}@ V> constexpr V byteswap(const V& v) noexcept; - template<@\exposconcept{simd-type}@ V> constexpr V bit_ceil(const V& v) noexcept; - template<@\exposconcept{simd-type}@ V> constexpr V bit_floor(const V& v) noexcept; + template<@\exposconcept{simd-vec-type}@ V> constexpr V byteswap(const V& v) noexcept; + template<@\exposconcept{simd-vec-type}@ V> constexpr V bit_ceil(const V& v) noexcept; + template<@\exposconcept{simd-vec-type}@ V> constexpr V bit_floor(const V& v) noexcept; - template<@\exposconcept{simd-type}@ V> + template<@\exposconcept{simd-vec-type}@ V> constexpr typename V::mask_type has_single_bit(const V& v) noexcept; - template<@\exposconcept{simd-type}@ V0, @\exposconcept{simd-type}@ V1> + template<@\exposconcept{simd-vec-type}@ V0, @\exposconcept{simd-vec-type}@ V1> constexpr V0 rotl(const V0& v, const V1& s) noexcept; - template<@\exposconcept{simd-type}@ V> + template<@\exposconcept{simd-vec-type}@ V> constexpr V rotl(const V& v, int s) noexcept; - template<@\exposconcept{simd-type}@ V0, @\exposconcept{simd-type}@ V1> + template<@\exposconcept{simd-vec-type}@ V0, @\exposconcept{simd-vec-type}@ V1> constexpr V0 rotr(const V0& v, const V1& s) noexcept; - template<@\exposconcept{simd-type}@ V> + template<@\exposconcept{simd-vec-type}@ V> constexpr V rotr(const V& v, int s) noexcept; - template<@\exposconcept{simd-type}@ V> + template<@\exposconcept{simd-vec-type}@ V> constexpr rebind_t, V> bit_width(const V& v) noexcept; - template<@\exposconcept{simd-type}@ V> + template<@\exposconcept{simd-vec-type}@ V> constexpr rebind_t, V> countl_zero(const V& v) noexcept; - template<@\exposconcept{simd-type}@ V> + template<@\exposconcept{simd-vec-type}@ V> constexpr rebind_t, V> countl_one(const V& v) noexcept; - template<@\exposconcept{simd-type}@ V> + template<@\exposconcept{simd-vec-type}@ V> constexpr rebind_t, V> countr_zero(const V& v) noexcept; - template<@\exposconcept{simd-type}@ V> + template<@\exposconcept{simd-vec-type}@ V> constexpr rebind_t, V> countr_one(const V& v) noexcept; - template<@\exposconcept{simd-type}@ V> + template<@\exposconcept{simd-vec-type}@ V> constexpr rebind_t, V> popcount(const V& v) noexcept; - // \ref{simd.complex.math}, simd complex math + // \ref{simd.complex.math}, vec complex math template<@\exposconcept{simd-complex}@ V> constexpr rebind_t<@\exposid{simd-complex-value-type}@, V> real(const V&) noexcept; @@ -16920,131 +17017,132 @@ namespace std { // See \ref{simd.alg}, Algorithms - using datapar::min; - using datapar::max; - using datapar::minmax; - using datapar::clamp; + using simd::min; + using simd::max; + using simd::minmax; + using simd::clamp; // See \ref{simd.math}, Mathematical functions - using datapar::acos; - using datapar::asin; - using datapar::atan; - using datapar::atan2; - using datapar::cos; - using datapar::sin; - using datapar::tan; - using datapar::acosh; - using datapar::asinh; - using datapar::atanh; - using datapar::cosh; - using datapar::sinh; - using datapar::tanh; - using datapar::exp; - using datapar::exp2; - using datapar::expm1; - using datapar::frexp; - using datapar::ilogb; - using datapar::ldexp; - using datapar::log; - using datapar::log10; - using datapar::log1p; - using datapar::log2; - using datapar::logb; - using datapar::modf; - using datapar::scalbn; - using datapar::scalbln; - using datapar::cbrt; - using datapar::abs; - using datapar::abs; - using datapar::fabs; - using datapar::hypot; - using datapar::pow; - using datapar::sqrt; - using datapar::erf; - using datapar::erfc; - using datapar::lgamma; - using datapar::tgamma; - using datapar::ceil; - using datapar::floor; - using datapar::nearbyint; - using datapar::rint; - using datapar::lrint; - using datapar::llrint; - using datapar::round; - using datapar::lround; - using datapar::llround; - using datapar::trunc; - using datapar::fmod; - using datapar::remainder; - using datapar::remquo; - using datapar::copysign; - using datapar::nextafter; - using datapar::fdim; - using datapar::fmax; - using datapar::fmin; - using datapar::fma; - using datapar::lerp; - using datapar::fpclassify; - using datapar::isfinite; - using datapar::isinf; - using datapar::isnan; - using datapar::isnormal; - using datapar::signbit; - using datapar::isgreater; - using datapar::isgreaterequal; - using datapar::isless; - using datapar::islessequal; - using datapar::islessgreater; - using datapar::isunordered; - using datapar::assoc_laguerre; - using datapar::assoc_legendre; - using datapar::beta; - using datapar::comp_ellint_1; - using datapar::comp_ellint_2; - using datapar::comp_ellint_3; - using datapar::cyl_bessel_i; - using datapar::cyl_bessel_j; - using datapar::cyl_bessel_k; - using datapar::cyl_neumann; - using datapar::ellint_1; - using datapar::ellint_2; - using datapar::ellint_3; - using datapar::expint; - using datapar::hermite; - using datapar::laguerre; - using datapar::legendre; - using datapar::riemann_zeta; - using datapar::sph_bessel; - using datapar::sph_legendre; - using datapar::sph_neumann; + using simd::acos; + using simd::asin; + using simd::atan; + using simd::atan2; + using simd::cos; + using simd::sin; + using simd::tan; + using simd::acosh; + using simd::asinh; + using simd::atanh; + using simd::cosh; + using simd::sinh; + using simd::tanh; + using simd::exp; + using simd::exp2; + using simd::expm1; + using simd::frexp; + using simd::ilogb; + using simd::ldexp; + using simd::log; + using simd::log10; + using simd::log1p; + using simd::log2; + using simd::logb; + using simd::modf; + using simd::scalbn; + using simd::scalbln; + using simd::cbrt; + using simd::abs; + using simd::abs; + using simd::fabs; + using simd::hypot; + using simd::pow; + using simd::sqrt; + using simd::erf; + using simd::erfc; + using simd::lgamma; + using simd::tgamma; + using simd::ceil; + using simd::floor; + using simd::nearbyint; + using simd::rint; + using simd::lrint; + using simd::llrint; + using simd::round; + using simd::lround; + using simd::llround; + using simd::trunc; + using simd::fmod; + using simd::remainder; + using simd::remquo; + using simd::copysign; + using simd::nextafter; + using simd::fdim; + using simd::fmax; + using simd::fmin; + using simd::fma; + using simd::lerp; + using simd::fpclassify; + using simd::isfinite; + using simd::isinf; + using simd::isnan; + using simd::isnormal; + using simd::signbit; + using simd::isgreater; + using simd::isgreaterequal; + using simd::isless; + using simd::islessequal; + using simd::islessgreater; + using simd::isunordered; + using simd::assoc_laguerre; + using simd::assoc_legendre; + using simd::beta; + using simd::comp_ellint_1; + using simd::comp_ellint_2; + using simd::comp_ellint_3; + using simd::cyl_bessel_i; + using simd::cyl_bessel_j; + using simd::cyl_bessel_k; + using simd::cyl_neumann; + using simd::ellint_1; + using simd::ellint_2; + using simd::ellint_3; + using simd::expint; + using simd::hermite; + using simd::laguerre; + using simd::legendre; + using simd::riemann_zeta; + using simd::sph_bessel; + using simd::sph_legendre; + using simd::sph_neumann; // See \ref{simd.bit}, Bit manipulation - using datapar::byteswap; - using datapar::bit_ceil; - using datapar::bit_floor; - using datapar::has_single_bit; - using datapar::rotl; - using datapar::rotr; - using datapar::bit_width; - using datapar::countl_zero; - using datapar::countl_one; - using datapar::countr_zero; - using datapar::countr_one; - using datapar::popcount; - - // See \ref{simd.complex.math}, simd complex math - using datapar::real; - using datapar::imag; - using datapar::arg; - using datapar::norm; - using datapar::conj; - using datapar::proj; - using datapar::polar; + using simd::byteswap; + using simd::bit_ceil; + using simd::bit_floor; + using simd::has_single_bit; + using simd::rotl; + using simd::rotr; + using simd::bit_width; + using simd::countl_zero; + using simd::countl_one; + using simd::countr_zero; + using simd::countr_one; + using simd::popcount; + + // See \ref{simd.complex.math}, vec complex math + using simd::real; + using simd::imag; + using simd::arg; + using simd::norm; + using simd::conj; + using simd::proj; + using simd::polar; } \end{codeblock} -\rSec2[simd.traits]{\tcode{simd} type traits} +\rSec2[simd.traits]{\tcode{vec} type traits} +\indexlibrarymember{alignment}{simd} \begin{itemdecl} template struct alignment { @\seebelow@ }; \end{itemdecl} @@ -17054,10 +17152,10 @@ \tcode{alignment} has a member \tcode{value} if and only if \begin{itemize} \item - \tcode{T} is a specialization of \tcode{basic_simd_mask} and \tcode{U} is + \tcode{T} is a specialization of \tcode{basic_mask} and \tcode{U} is \tcode{bool}, or \item - \tcode{T} is a specialization of \tcode{basic_simd} and \tcode{U} is a + \tcode{T} is a specialization of \tcode{basic_vec} and \tcode{U} is a vectorizable type. \end{itemize} @@ -17077,6 +17175,7 @@ is undefined. \end{itemdescr} +\indexlibrarymember{rebind}{simd} \begin{itemdecl} template struct rebind { using type = @\seebelow@; }; \end{itemdecl} @@ -17092,20 +17191,21 @@ \end{itemize} \pnum -If \tcode V is a specialization of \tcode{basic_simd}, let \tcode{Abi1} denote -an ABI tag such that \tcode{basic_simd::\brk{}size()} equals +If \tcode V is a specialization of \tcode{basic_vec}, let \tcode{Abi1} denote +an ABI tag such that \tcode{basic_vec::\brk{}size()} equals \tcode{V::size()}. -If \tcode V is a specialization of \tcode{basic_simd_mask}, let \tcode{Abi1} -denote an ABI tag such that \tcode{basic_simd_mask::\brk{}size()} equals \tcode{V::size()}. \pnum -Where present, the member typedef \tcode{type} names \tcode{basic_simd} -if \tcode V is a specialization of \tcode{basic_simd} or -\tcode{basic_simd_mask} if \tcode V is a specialization of -\tcode{basic_simd_mask}. +Where present, the member typedef \tcode{type} names \tcode{basic_vec} +if \tcode V is a specialization of \tcode{basic_vec} or +\tcode{basic_mask} if \tcode V is a specialization of +\tcode{basic_mask}. \end{itemdescr} +\indexlibrarymember{resize}{simd} \begin{itemdecl} template<@\exposid{simd-size-type}@ N, class V> struct resize { using type = @\seebelow@; }; \end{itemdecl} @@ -17116,10 +17216,10 @@ \begin{itemize} \item \tcode{typename V::value_type} if \tcode{V} is a specialization of - \tcode{basic_simd}, + \tcode{basic_vec}, \item otherwise \tcode{\exposid{integer-from}<\exposid{mask-element-size}>} if - \tcode{V} is a specialization of \tcode{basic_simd_mask}. + \tcode{V} is a specialization of \tcode{basic_mask}. \end{itemize} \pnum @@ -17130,26 +17230,27 @@ \end{itemize} \pnum -If \tcode V is a specialization of \tcode{basic_simd}, let \tcode{Abi1} denote an -ABI tag such that \tcode{basic_simd::\brk{}size()} equals +If \tcode V is a specialization of \tcode{basic_vec}, let \tcode{Abi1} denote an +ABI tag such that \tcode{basic_vec::\brk{}size()} equals \tcode{V::size()}. -If \tcode V is a specialization of \tcode{basic_simd_mask}, let \tcode{Abi1} -denote an ABI tag such that \tcode{basic_simd_mask::\brk{}size()} equals \tcode{V::size()}. \pnum -Where present, the member typedef \tcode{type} names \tcode{basic_simd} -if \tcode V is a specialization of \tcode{basic_simd} or -\tcode{basic_simd_mask} if \tcode V is a specialization of -\tcode{basic_simd_mask}. +Where present, the member typedef \tcode{type} names \tcode{basic_vec} +if \tcode V is a specialization of \tcode{basic_vec} or +\tcode{basic_mask} if \tcode V is a specialization of +\tcode{basic_mask}. \end{itemdescr} \rSec2[simd.flags]{Load and store flags} \rSec3[simd.flags.overview]{Class template \tcode{flags} overview} +\indexlibrarymember{flags}{simd} \begin{codeblock} -namespace std::datapar { +namespace std::simd { template struct flags { // \ref{simd.flags.oper}, \tcode{flags} operators template @@ -17170,6 +17271,7 @@ \rSec3[simd.flags.oper]{\tcode{flags} operators} +\indexlibrarymember{operator|}{simd::flags} \begin{itemdecl} template friend consteval auto operator|(flags a, flags b); @@ -17188,84 +17290,355 @@ specialization \tcode{\exposid{overaligned-flag}}. \end{itemdescr} -\rSec2[simd.class]{Class template \tcode{basic_simd}} +\rSec2[simd.iterator]{Class \exposid{simd-iterator}} +\indexlibrarymember{iterator}{basic_vec} +\indexlibrarymember{iterator}{basic_mask} +\indexlibrarymember{const_iterator}{basic_vec} +\indexlibrarymember{const_iterator}{basic_mask} +\begin{codeblock} +namespace std::simd { + template + class @\exposidnc{simd-iterator}@ { // \expos + V* @\exposidnc{data_}@ = nullptr; // \expos + @\exposidnc{simd-size-type} \exposidnc{offset_}@ = 0; // \expos + + constexpr @\exposid{simd-iterator}@(V& d, @\exposid{simd-size-type}@ off) noexcept; // \expos + + public: + using value_type = typename V::value_type; + using iterator_category = input_iterator_tag; + using iterator_concept = random_access_iterator_tag; + using difference_type = @\exposid{simd-size-type}@; + + constexpr @\exposid{simd-iterator}@() = default; + + constexpr @\exposid{simd-iterator}@(const @\exposid{simd-iterator}@&) = default; + constexpr @\exposid{simd-iterator}@& operator=(const @\exposid{simd-iterator}@&) = default; + + constexpr @\exposid{simd-iterator}@(const @\exposid{simd-iterator}@>&) requires is_const_v; + + constexpr value_type operator*() const; + + constexpr @\exposid{simd-iterator}@& operator++(); + constexpr @\exposid{simd-iterator}@ operator++(int); + constexpr @\exposid{simd-iterator}@& operator--(); + constexpr @\exposid{simd-iterator}@ operator--(int); + + constexpr @\exposid{simd-iterator}@& operator+=(difference_type n); + constexpr @\exposid{simd-iterator}@& operator-=(difference_type n); + + constexpr value_type operator[](difference_type n) const; + + friend constexpr bool operator==(@\exposid{simd-iterator}@ a, @\exposid{simd-iterator}@ b) = default; + friend constexpr bool operator==(@\exposid{simd-iterator}@ a, default_sentinel_t) noexcept; + friend constexpr auto operator<=>(@\exposid{simd-iterator}@ a, @\exposid{simd-iterator}@ b); + + friend constexpr @\exposid{simd-iterator}@ operator+(@\exposid{simd-iterator}@ i, difference_type n); + friend constexpr @\exposid{simd-iterator}@ operator+(difference_type n, @\exposid{simd-iterator}@ i); + friend constexpr @\exposid{simd-iterator}@ operator-(@\exposid{simd-iterator}@ i, difference_type n); + + friend constexpr difference_type operator-(@\exposid{simd-iterator}@ a, @\exposid{simd-iterator}@ b); + friend constexpr difference_type operator-(@\exposid{simd-iterator}@ i, default_sentinel_t) noexcept; + friend constexpr difference_type operator-(default_sentinel_t, @\exposid{simd-iterator}@ i) noexcept; + }; +} +\end{codeblock} + +\begin{itemdecl} +constexpr @\exposid{simd-iterator}@(V& d, @\exposid{simd-size-type}@ off) noexcept; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\effects +Initializes \exposid{data_} with \tcode{addressof(d)} and \exposid{offset_} with \tcode{off}. +\end{itemdescr} + +\begin{itemdecl} +constexpr @\exposid{simd-iterator}@(const @\exposid{simd-iterator}@>& i) requires is_const_v; +\end{itemdecl} -\rSec3[simd.overview]{Class template \tcode{basic_simd} overview} +\begin{itemdescr} +\pnum +\effects +Initializes \exposid{data_} with \tcode{i.\exposid{data_}} and \exposid{offset_} with \tcode{i.\exposid{offset_}}. +\end{itemdescr} +\begin{itemdecl} +constexpr value_type operator*() const; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\effects +Equivalent to: \tcode{return (*\exposid{data_})[\exposid{offset_}];} +\end{itemdescr} + +\begin{itemdecl} +constexpr @\exposid{simd-iterator}@& operator++(); +\end{itemdecl} + +\begin{itemdescr} +\pnum +\effects +Equivalent to: \tcode{return *this += 1;} +\end{itemdescr} + +\begin{itemdecl} +constexpr @\exposid{simd-iterator}@ operator++(int); +\end{itemdecl} + +\begin{itemdescr} +\pnum +\effects +Equivalent to: \begin{codeblock} -namespace std::datapar { - template class basic_simd { +@\exposid{simd-iterator}@ tmp = *this; +*this += 1; +return tmp; +\end{codeblock} +\end{itemdescr} + +\begin{itemdecl} +constexpr @\exposid{simd-iterator}@& operator--(); +\end{itemdecl} + +\begin{itemdescr} +\pnum +\effects +Equivalent to: \tcode{return *this -= 1;} +\end{itemdescr} + +\begin{itemdecl} +constexpr @\exposid{simd-iterator}@ operator--(int); +\end{itemdecl} + +\begin{itemdescr} +\pnum +\effects +Equivalent to: +\begin{codeblock} +@\exposid{simd-iterator}@ tmp = *this; +*this -= 1; +return tmp; +\end{codeblock} +\end{itemdescr} + +\begin{itemdecl} +constexpr @\exposid{simd-iterator}@& operator+=(difference_type n); +\end{itemdecl} + +\begin{itemdescr} +\pnum +\expects +\tcode{\exposid{offset_} + n} is in the range \crange{0}{V::size()}. + +\pnum +\effects +Equivalent to: +\begin{codeblock} +@\exposid{offset_}@ += n; +return *this; +\end{codeblock} +\end{itemdescr} + +\begin{itemdecl} +constexpr @\exposid{simd-iterator}@& operator-=(difference_type n); +\end{itemdecl} + +\begin{itemdescr} +\pnum +\expects +\tcode{\exposid{offset_} - n} is in the range \crange{0}{V::size()}. + +\pnum +\effects +Equivalent to: +\begin{codeblock} +@\exposid{offset_}@ -= n; +return *this; +\end{codeblock} +\end{itemdescr} + +\begin{itemdecl} +constexpr value_type operator[](difference_type n) const; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\effects +Equivalent to: \tcode{return (*\exposid{data_})[\exposid{offset_} + n];} +\end{itemdescr} + +\begin{itemdecl} +friend constexpr bool operator==(@\exposid{simd-iterator}@ i, default_sentinel_t) noexcept; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\effects +Equivalent to: \tcode{return i.\exposid{offset_} == V::size();} +\end{itemdescr} + +\begin{itemdecl} +friend constexpr auto operator<=>(@\exposid{simd-iterator}@ a, @\exposid{simd-iterator}@ b); +\end{itemdecl} + +\begin{itemdescr} +\pnum +\expects +\tcode{a.\exposid{data_} == b.\exposid{data_}} is \tcode{true}. + +\pnum +\effects +Equivalent to: \tcode{return a.\exposid{offset_} <=> b.\exposid{offset_};} +\end{itemdescr} + +\begin{itemdecl} +friend constexpr @\exposid{simd-iterator}@ operator+(@\exposid{simd-iterator}@ i, difference_type n); +friend constexpr @\exposid{simd-iterator}@ operator+(difference_type n, @\exposid{simd-iterator}@ i); +\end{itemdecl} + +\begin{itemdescr} +\pnum +\effects +Equivalent to: \tcode{return i += n;} +\end{itemdescr} + +\begin{itemdecl} +friend constexpr @\exposid{simd-iterator}@ operator-(@\exposid{simd-iterator}@ i, difference_type n); +\end{itemdecl} + +\begin{itemdescr} +\pnum +\effects +Equivalent to: \tcode{return i -= n;} +\end{itemdescr} + +\begin{itemdecl} +friend constexpr difference_type operator-(@\exposid{simd-iterator}@ a, @\exposid{simd-iterator}@ b); +\end{itemdecl} + +\begin{itemdescr} +\pnum +\expects +\tcode{a.\exposid{data_} == b.\exposid{data_}} is \tcode{true}. + +\pnum +\effects +Equivalent to: \tcode{return a.\exposid{offset_} - b.\exposid{offset_};} +\end{itemdescr} + +\begin{itemdecl} +friend constexpr difference_type operator-(@\exposid{simd-iterator}@ i, default_sentinel_t) noexcept; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\effects +Equivalent to: \tcode{return i.\exposid{offset_} - V::size();} +\end{itemdescr} + + +\begin{itemdecl} +friend constexpr difference_type operator-(default_sentinel_t, @\exposid{simd-iterator}@ i) noexcept; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\effects +Equivalent to: \tcode{return V::size() - i.\exposid{offset_};} +\end{itemdescr} + +\rSec2[simd.class]{Class template \tcode{basic_vec}} + +\rSec3[simd.overview]{Class template \tcode{basic_vec} overview} + +\indexlibraryglobal{basic_vec}% +\begin{codeblock} +namespace std::simd { + template class basic_vec { public: - using value_type = T; - using mask_type = basic_simd_mask; - using abi_type = Abi; + using @\libmember{value_type}{basic_vec}@ = T; + using @\libmember{mask_type}{basic_vec}@ = basic_mask; + using @\libmember{abi_type}{basic_vec}@ = Abi; + using @\libmember{iterator}{basic_vec}@ = @\exposid{simd-iterator}@; + using @\libmember{const_iterator}{basic_vec}@ = @\exposid{simd-iterator}@; + + constexpr iterator @\libmember{begin}{basic_vec}@() noexcept { return {*this, 0}; } + constexpr const_iterator @\libmember{begin}{basic_vec}@() const noexcept { return {*this, 0}; } + constexpr const_iterator @\libmember{cbegin}{basic_vec}@() const noexcept { return {*this, 0}; } + constexpr default_sentinel_t @\libmember{end}{basic_vec}@() const noexcept { return {}; } + constexpr default_sentinel_t @\libmember{cend}{basic_vec}@() const noexcept { return {}; } - static constexpr integral_constant<@\exposid{simd-size-type}@, @\exposid{simd-size-v}@> size {}; + static constexpr integral_constant<@\exposid{simd-size-type}@, @\exposid{simd-size-v}@> @\libmember{size}{basic_vec}@ {}; - constexpr basic_simd() noexcept = default; + constexpr basic_vec() noexcept = default; - // \ref{simd.ctor}, \tcode{basic_simd} constructors - template constexpr explicit(@\seebelow@) basic_simd(U&& value) noexcept; + // \ref{simd.ctor}, \tcode{basic_vec} constructors + template constexpr explicit(@\seebelow@) basic_vec(U&& value) noexcept; template - constexpr explicit(@\seebelow@) basic_simd(const basic_simd&) noexcept; - template constexpr explicit basic_simd(G&& gen) noexcept; + constexpr explicit(@\seebelow@) basic_vec(const basic_vec&) noexcept; + template constexpr explicit basic_vec(G&& gen) noexcept; template - constexpr basic_simd(R&& range, flags = {}); + constexpr basic_vec(R&& range, flags = {}); template - constexpr basic_simd(R&& range, const mask_type& mask, flags = {}); + constexpr basic_vec(R&& range, const mask_type& mask, flags = {}); template<@\exposconcept{simd-floating-point}@ V> - constexpr explicit(@\seebelow@) basic_simd(const V& reals, const V& imags = {}) noexcept; + constexpr explicit(@\seebelow@) basic_vec(const V& reals, const V& imags = {}) noexcept; - // \ref{simd.subscr}, \tcode{basic_simd} subscript operators + // \ref{simd.subscr}, \tcode{basic_vec} subscript operators constexpr value_type operator[](@\exposid{simd-size-type}@) const; - - // \ref{simd.unary}, \tcode{basic_simd} unary operators - constexpr basic_simd& operator++() noexcept; - constexpr basic_simd operator++(int) noexcept; - constexpr basic_simd& operator--() noexcept; - constexpr basic_simd operator--(int) noexcept; + template<@\exposconcept{simd-integral}@ I> + constexpr resize_t operator[](const I& indices) const; + + // \ref{simd.unary}, \tcode{basic_vec} unary operators + constexpr basic_vec& operator++() noexcept; + constexpr basic_vec operator++(int) noexcept; + constexpr basic_vec& operator--() noexcept; + constexpr basic_vec operator--(int) noexcept; constexpr mask_type operator!() const noexcept; - constexpr basic_simd operator~() const noexcept; - constexpr basic_simd operator+() const noexcept; - constexpr basic_simd operator-() const noexcept; - - // \ref{simd.binary}, \tcode{basic_simd} binary operators - friend constexpr basic_simd operator+(const basic_simd&, const basic_simd&) noexcept; - friend constexpr basic_simd operator-(const basic_simd&, const basic_simd&) noexcept; - friend constexpr basic_simd operator*(const basic_simd&, const basic_simd&) noexcept; - friend constexpr basic_simd operator/(const basic_simd&, const basic_simd&) noexcept; - friend constexpr basic_simd operator%(const basic_simd&, const basic_simd&) noexcept; - friend constexpr basic_simd operator&(const basic_simd&, const basic_simd&) noexcept; - friend constexpr basic_simd operator|(const basic_simd&, const basic_simd&) noexcept; - friend constexpr basic_simd operator^(const basic_simd&, const basic_simd&) noexcept; - friend constexpr basic_simd operator<<(const basic_simd&, const basic_simd&) noexcept; - friend constexpr basic_simd operator>>(const basic_simd&, const basic_simd&) noexcept; - friend constexpr basic_simd operator<<(const basic_simd&, @\exposid{simd-size-type}@) noexcept; - friend constexpr basic_simd operator>>(const basic_simd&, @\exposid{simd-size-type}@) noexcept; - - // \ref{simd.cassign}, \tcode{basic_simd} compound assignment - friend constexpr basic_simd& operator+=(basic_simd&, const basic_simd&) noexcept; - friend constexpr basic_simd& operator-=(basic_simd&, const basic_simd&) noexcept; - friend constexpr basic_simd& operator*=(basic_simd&, const basic_simd&) noexcept; - friend constexpr basic_simd& operator/=(basic_simd&, const basic_simd&) noexcept; - friend constexpr basic_simd& operator%=(basic_simd&, const basic_simd&) noexcept; - friend constexpr basic_simd& operator&=(basic_simd&, const basic_simd&) noexcept; - friend constexpr basic_simd& operator|=(basic_simd&, const basic_simd&) noexcept; - friend constexpr basic_simd& operator^=(basic_simd&, const basic_simd&) noexcept; - friend constexpr basic_simd& operator<<=(basic_simd&, const basic_simd&) noexcept; - friend constexpr basic_simd& operator>>=(basic_simd&, const basic_simd&) noexcept; - friend constexpr basic_simd& operator<<=(basic_simd&, @\exposid{simd-size-type}@) noexcept; - friend constexpr basic_simd& operator>>=(basic_simd&, @\exposid{simd-size-type}@) noexcept; - - // \ref{simd.comparison}, \tcode{basic_simd} compare operators - friend constexpr mask_type operator==(const basic_simd&, const basic_simd&) noexcept; - friend constexpr mask_type operator!=(const basic_simd&, const basic_simd&) noexcept; - friend constexpr mask_type operator>=(const basic_simd&, const basic_simd&) noexcept; - friend constexpr mask_type operator<=(const basic_simd&, const basic_simd&) noexcept; - friend constexpr mask_type operator>(const basic_simd&, const basic_simd&) noexcept; - friend constexpr mask_type operator<(const basic_simd&, const basic_simd&) noexcept; - - // \ref{simd.complex.access}, \tcode{basic_simd} complex-value accessors + constexpr basic_vec operator~() const noexcept; + constexpr basic_vec operator+() const noexcept; + constexpr basic_vec operator-() const noexcept; + + // \ref{simd.binary}, \tcode{basic_vec} binary operators + friend constexpr basic_vec operator+(const basic_vec&, const basic_vec&) noexcept; + friend constexpr basic_vec operator-(const basic_vec&, const basic_vec&) noexcept; + friend constexpr basic_vec operator*(const basic_vec&, const basic_vec&) noexcept; + friend constexpr basic_vec operator/(const basic_vec&, const basic_vec&) noexcept; + friend constexpr basic_vec operator%(const basic_vec&, const basic_vec&) noexcept; + friend constexpr basic_vec operator&(const basic_vec&, const basic_vec&) noexcept; + friend constexpr basic_vec operator|(const basic_vec&, const basic_vec&) noexcept; + friend constexpr basic_vec operator^(const basic_vec&, const basic_vec&) noexcept; + friend constexpr basic_vec operator<<(const basic_vec&, const basic_vec&) noexcept; + friend constexpr basic_vec operator>>(const basic_vec&, const basic_vec&) noexcept; + friend constexpr basic_vec operator<<(const basic_vec&, @\exposid{simd-size-type}@) noexcept; + friend constexpr basic_vec operator>>(const basic_vec&, @\exposid{simd-size-type}@) noexcept; + + // \ref{simd.cassign}, \tcode{basic_vec} compound assignment + friend constexpr basic_vec& operator+=(basic_vec&, const basic_vec&) noexcept; + friend constexpr basic_vec& operator-=(basic_vec&, const basic_vec&) noexcept; + friend constexpr basic_vec& operator*=(basic_vec&, const basic_vec&) noexcept; + friend constexpr basic_vec& operator/=(basic_vec&, const basic_vec&) noexcept; + friend constexpr basic_vec& operator%=(basic_vec&, const basic_vec&) noexcept; + friend constexpr basic_vec& operator&=(basic_vec&, const basic_vec&) noexcept; + friend constexpr basic_vec& operator|=(basic_vec&, const basic_vec&) noexcept; + friend constexpr basic_vec& operator^=(basic_vec&, const basic_vec&) noexcept; + friend constexpr basic_vec& operator<<=(basic_vec&, const basic_vec&) noexcept; + friend constexpr basic_vec& operator>>=(basic_vec&, const basic_vec&) noexcept; + friend constexpr basic_vec& operator<<=(basic_vec&, @\exposid{simd-size-type}@) noexcept; + friend constexpr basic_vec& operator>>=(basic_vec&, @\exposid{simd-size-type}@) noexcept; + + // \ref{simd.comparison}, \tcode{basic_vec} compare operators + friend constexpr mask_type operator==(const basic_vec&, const basic_vec&) noexcept; + friend constexpr mask_type operator!=(const basic_vec&, const basic_vec&) noexcept; + friend constexpr mask_type operator>=(const basic_vec&, const basic_vec&) noexcept; + friend constexpr mask_type operator<=(const basic_vec&, const basic_vec&) noexcept; + friend constexpr mask_type operator>(const basic_vec&, const basic_vec&) noexcept; + friend constexpr mask_type operator<(const basic_vec&, const basic_vec&) noexcept; + + // \ref{simd.complex.access}, \tcode{basic_vec} complex-value accessors constexpr auto real() const noexcept; constexpr auto imag() const noexcept; template<@\exposconcept{simd-floating-point}@ V> @@ -17273,19 +17646,19 @@ template<@\exposconcept{simd-floating-point}@ V> constexpr void imag(const V& v) noexcept; - // \ref{simd.cond}, \tcode{basic_simd} exposition only conditional operators - friend constexpr basic_simd @\exposid{simd-select-impl}@( // \expos - const mask_type&, const basic_simd&, const basic_simd&) noexcept; + // \ref{simd.cond}, \tcode{basic_vec} exposition only conditional operators + friend constexpr basic_vec @\exposid{simd-select-impl}@( // \expos + const mask_type&, const basic_vec&, const basic_vec&) noexcept; }; template - basic_simd(R&& r, Ts...) -> @\seebelow@; + basic_vec(R&& r, Ts...) -> @\seebelow@; } \end{codeblock} \pnum -Every specialization of \tcode{basic_simd} is a complete type. -The specialization of \tcode{basic_simd} is +Every specialization of \tcode{basic_vec} is a complete type. +The specialization of \tcode{basic_vec} is \begin{itemize} \item enabled, if \tcode{T} is a vectorizable type, and there exists value @@ -17294,17 +17667,17 @@ \item otherwise, disabled, if \tcode{T} is not a vectorizable type, \item - otherwise, it is \impldef{set of enabled \tcode{basic_simd} + otherwise, it is \impldef{set of enabled \tcode{basic_vec} specializations} if such a specialization is enabled. \end{itemize} -If \tcode{basic_simd} is disabled, then the specialization has a +If \tcode{basic_vec} is disabled, then the specialization has a deleted default constructor, deleted destructor, deleted copy constructor, and deleted copy assignment. In addition only the \tcode{value_type}, \tcode{abi_type}, and \tcode{mask_type} members are present. -If \tcode{basic_simd} is enabled, then \tcode{basic_simd} is +If \tcode{basic_vec} is enabled, then \tcode{basic_vec} is trivially copyable, default-initialization of an object of such a type default-initializes all elements, and value-initialization value-initializes all elements\iref{dcl.init.general}. @@ -17312,17 +17685,18 @@ \pnum \recommended Implementations should support implicit conversions between specializations of -\tcode{basic_simd} and appropriate \impldef{conversions of \tcode{basic_simd} +\tcode{basic_vec} and appropriate \impldef{conversions of \tcode{basic_vec} from/to implementation-specific vector types} types. \begin{note} Appropriate types are non-standard vector types which are available in the implementation. \end{note} -\rSec3[simd.ctor]{\tcode{basic_simd} constructors} +\rSec3[simd.ctor]{\tcode{basic_vec} constructors} +\indexlibraryctor{basic_vec} \begin{itemdecl} -template constexpr explicit(@\seebelow@) basic_simd(U&& value) noexcept; +template constexpr explicit(@\seebelow@) basic_vec(U&& value) noexcept; \end{itemdecl} \begin{itemdescr} @@ -17356,9 +17730,10 @@ \end{itemize} \end{itemdescr} +\indexlibraryctor{basic_vec} \begin{itemdecl} template - constexpr explicit(@\seebelow@) basic_simd(const basic_simd& x) noexcept; + constexpr explicit(@\seebelow@) basic_vec(const basic_vec& x) noexcept; \end{itemdecl} \begin{itemdescr} @@ -17389,8 +17764,9 @@ \end{itemize} \end{itemdescr} +\indexlibraryctor{basic_vec} \begin{itemdecl} -template constexpr explicit basic_simd(G&& gen); +template constexpr explicit basic_vec(G&& gen); \end{itemdecl} \begin{itemdescr} @@ -17417,11 +17793,12 @@ \tcode{gen} is invoked exactly once for each $i$, in increasing order of $i$. \end{itemdescr} +\indexlibraryctor{basic_vec} \begin{itemdecl} template - constexpr basic_simd(R&& r, flags = {}); + constexpr basic_vec(R&& r, flags = {}); template - constexpr basic_simd(R&& r, const mask_type& mask, flags = {}); + constexpr basic_vec(R&& r, const mask_type& mask, flags = {}); \end{itemdecl} \begin{itemdescr} @@ -17455,7 +17832,7 @@ \item If the template parameter pack \tcode{Flags} contains \tcode{\exposid{aligned-flag}}, \tcode{ranges::data(r)} points to - storage aligned by \tcode{alignment_v>}. \item If the template parameter pack \tcode{Flags} contains @@ -17472,7 +17849,7 @@ \begin{itemdecl} template - basic_simd(R&& r, Ts...) -> @\seebelow@; + basic_vec(R&& r, Ts...) -> @\seebelow@; \end{itemdecl} \begin{itemdescr} @@ -17486,14 +17863,15 @@ \pnum \remarks -The deduced type is equivalent to \tcode{simd, +The deduced type is equivalent to \tcode{vec, ranges::size(r)>}. \end{itemdescr} +\indexlibraryctor{basic_vec} \begin{itemdecl} template<@\exposconcept{simd-floating-point}@ V> constexpr explicit(@\seebelow@) - basic_simd(const V& reals, const V& imags = {}) noexcept; + basic_vec(const V& reals, const V& imags = {}) noexcept; \end{itemdecl} \begin{itemdescr} @@ -17501,7 +17879,7 @@ \constraints \begin{itemize} \item - \tcode{\exposconcept{simd-complex}} is modeled, and + \tcode{\exposconcept{simd-complex}} is modeled, and \item \tcode{V::size() == size()} is \tcode{true}. \end{itemize} @@ -17518,8 +17896,9 @@ or equal to the floating-point conversion rank of \tcode{V::value_type}. \end{itemdescr} -\rSec3[simd.subscr]{\tcode{basic_simd} subscript operator} +\rSec3[simd.subscr]{\tcode{basic_vec} subscript operator} +\indexlibrarymember{operator[]}{basic_vec} \begin{itemdecl} constexpr value_type operator[](@\exposid{simd-size-type}@ i) const; \end{itemdecl} @@ -17538,13 +17917,26 @@ Nothing. \end{itemdescr} -\rSec3[simd.unary]{\tcode{basic_simd} unary operators} +\indexlibrarymember{operator[]}{basic_vec} +\begin{itemdecl} +template<@\exposconcept{simd-integral}@ I> + constexpr resize_t operator[](const I& indices) const; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\effects +Equivalent to: \tcode{return permute(*this, indices);} +\end{itemdescr} + +\rSec3[simd.unary]{\tcode{basic_vec} unary operators} \pnum Effects in \ref{simd.unary} are applied as unary element-wise operations. +\indexlibrarymember{operator++}{basic_vec} \begin{itemdecl} -constexpr basic_simd& operator++() noexcept; +constexpr basic_vec& operator++() noexcept; \end{itemdecl} \begin{itemdescr} @@ -17561,8 +17953,9 @@ \tcode{*this}. \end{itemdescr} +\indexlibrarymember{operator++}{basic_vec} \begin{itemdecl} -constexpr basic_simd operator++(int) noexcept; +constexpr basic_vec operator++(int) noexcept; \end{itemdecl} \begin{itemdescr} @@ -17579,8 +17972,9 @@ A copy of \tcode{*this} before incrementing. \end{itemdescr} +\indexlibrarymember{operator--}{basic_vec} \begin{itemdecl} -constexpr basic_simd& operator--() noexcept; +constexpr basic_vec& operator--() noexcept; \end{itemdecl} \begin{itemdescr} @@ -17597,8 +17991,9 @@ \tcode{*this}. \end{itemdescr} +\indexlibrarymember{operator--}{basic_vec} \begin{itemdecl} -constexpr basic_simd operator--(int) noexcept; +constexpr basic_vec operator--(int) noexcept; \end{itemdecl} \begin{itemdescr} @@ -17615,6 +18010,7 @@ A copy of \tcode{*this} before decrementing. \end{itemdescr} +\indexlibrarymember{operator!}{basic_vec} \begin{itemdecl} constexpr mask_type operator!() const noexcept; \end{itemdecl} @@ -17626,12 +18022,13 @@ \pnum \returns -A \tcode{basic_simd_mask} object with the $i^\text{th}$ element set to +A \tcode{basic_mask} object with the $i^\text{th}$ element set to \tcode{!operator[]($i$)} for all $i$ in the range of \range{0}{size()}. \end{itemdescr} +\indexlibrarymember{operator~}{basic_vec} \begin{itemdecl} -constexpr basic_simd operator~() const noexcept; +constexpr basic_vec operator~() const noexcept; \end{itemdecl} \begin{itemdescr} @@ -17641,12 +18038,13 @@ \pnum \returns -A \tcode{basic_simd} object with the $i^\text{th}$ element set to +A \tcode{basic_vec} object with the $i^\text{th}$ element set to \tcode{\~{}operator[]($i$)} for all $i$ in the range of \range{0}{size()}. \end{itemdescr} +\indexlibrarymember{operator+}{basic_vec} \begin{itemdecl} -constexpr basic_simd operator+() const noexcept; +constexpr basic_vec operator+() const noexcept; \end{itemdecl} \begin{itemdescr} @@ -17659,8 +18057,9 @@ \tcode{*this}. \end{itemdescr} +\indexlibrarymember{operator-}{basic_vec} \begin{itemdecl} -constexpr basic_simd operator-() const noexcept; +constexpr basic_vec operator-() const noexcept; \end{itemdecl} \begin{itemdescr} @@ -17670,25 +18069,35 @@ \pnum \returns -A \tcode{basic_simd} object where the $i^\text{th}$ element is initialized to +A \tcode{basic_vec} object where the $i^\text{th}$ element is initialized to \tcode{-operator[]($i$)} for all $i$ in the range of \range{0}{size()}. \end{itemdescr} -\rSec2[simd.nonmembers]{\tcode{basic_simd} non-member operations} +\rSec2[simd.nonmembers]{\tcode{basic_vec} non-member operations} -\rSec3[simd.binary]{\tcode{basic_simd} binary operators} +\rSec3[simd.binary]{\tcode{basic_vec} binary operators} +\indexlibrarymember{operator+}{basic_vec} +\indexlibrarymember{operator-}{basic_vec} +\indexlibrarymember{operator*}{basic_vec} +\indexlibrarymember{operator/}{basic_vec} +\indexlibrarymember{operator\%}{basic_vec} +\indexlibrarymember{operator\&}{basic_vec} +\indexlibrarymember{operator|}{basic_vec} +\indexlibrarymember{operator\caret}{basic_vec} +\indexlibrarymember{operator<<}{basic_vec} +\indexlibrarymember{operator>>}{basic_vec} \begin{itemdecl} -friend constexpr basic_simd operator+(const basic_simd& lhs, const basic_simd& rhs) noexcept; -friend constexpr basic_simd operator-(const basic_simd& lhs, const basic_simd& rhs) noexcept; -friend constexpr basic_simd operator*(const basic_simd& lhs, const basic_simd& rhs) noexcept; -friend constexpr basic_simd operator/(const basic_simd& lhs, const basic_simd& rhs) noexcept; -friend constexpr basic_simd operator%(const basic_simd& lhs, const basic_simd& rhs) noexcept; -friend constexpr basic_simd operator&(const basic_simd& lhs, const basic_simd& rhs) noexcept; -friend constexpr basic_simd operator|(const basic_simd& lhs, const basic_simd& rhs) noexcept; -friend constexpr basic_simd operator^(const basic_simd& lhs, const basic_simd& rhs) noexcept; -friend constexpr basic_simd operator<<(const basic_simd& lhs, const basic_simd& rhs) noexcept; -friend constexpr basic_simd operator>>(const basic_simd& lhs, const basic_simd& rhs) noexcept; +friend constexpr basic_vec operator+(const basic_vec& lhs, const basic_vec& rhs) noexcept; +friend constexpr basic_vec operator-(const basic_vec& lhs, const basic_vec& rhs) noexcept; +friend constexpr basic_vec operator*(const basic_vec& lhs, const basic_vec& rhs) noexcept; +friend constexpr basic_vec operator/(const basic_vec& lhs, const basic_vec& rhs) noexcept; +friend constexpr basic_vec operator%(const basic_vec& lhs, const basic_vec& rhs) noexcept; +friend constexpr basic_vec operator&(const basic_vec& lhs, const basic_vec& rhs) noexcept; +friend constexpr basic_vec operator|(const basic_vec& lhs, const basic_vec& rhs) noexcept; +friend constexpr basic_vec operator^(const basic_vec& lhs, const basic_vec& rhs) noexcept; +friend constexpr basic_vec operator<<(const basic_vec& lhs, const basic_vec& rhs) noexcept; +friend constexpr basic_vec operator>>(const basic_vec& lhs, const basic_vec& rhs) noexcept; \end{itemdecl} \begin{itemdescr} @@ -17702,14 +18111,16 @@ \pnum \returns -A \tcode{basic_simd} object initialized with the results of applying +A \tcode{basic_vec} object initialized with the results of applying \placeholder{op} to \tcode{lhs} and \tcode{rhs} as a binary element-wise operation. \end{itemdescr} +\indexlibrarymember{operator<<}{basic_vec} +\indexlibrarymember{operator>>}{basic_vec} \begin{itemdecl} -friend constexpr basic_simd operator<<(const basic_simd& v, @\exposid{simd-size-type}@ n) noexcept; -friend constexpr basic_simd operator>>(const basic_simd& v, @\exposid{simd-size-type}@ n) noexcept; +friend constexpr basic_vec operator<<(const basic_vec& v, @\exposid{simd-size-type}@ n) noexcept; +friend constexpr basic_vec operator>>(const basic_vec& v, @\exposid{simd-size-type}@ n) noexcept; \end{itemdecl} \begin{itemdescr} @@ -17723,24 +18134,34 @@ \pnum \returns -A \tcode{basic_simd} object where the $i^\text{th}$ element is initialized to +A \tcode{basic_vec} object where the $i^\text{th}$ element is initialized to the result of applying \placeholder{op} to \tcode{v[$i$]} and \tcode{n} for all $i$ in the range of \range{0}{size()}. \end{itemdescr} -\rSec3[simd.cassign]{\tcode{basic_simd} compound assignment} +\rSec3[simd.cassign]{\tcode{basic_vec} compound assignment} +\indexlibrarymember{operator+=}{basic_vec} +\indexlibrarymember{operator-=}{basic_vec} +\indexlibrarymember{operator*=}{basic_vec} +\indexlibrarymember{operator/=}{basic_vec} +\indexlibrarymember{operator\%=}{basic_vec} +\indexlibrarymember{operator\&=}{basic_vec} +\indexlibrarymember{operator|=}{basic_vec} +\indexlibrarymember{operator\caret=}{basic_vec} +\indexlibrarymember{operator<<=}{basic_vec} +\indexlibrarymember{operator>>=}{basic_vec} \begin{itemdecl} -friend constexpr basic_simd& operator+=(basic_simd& lhs, const basic_simd& rhs) noexcept; -friend constexpr basic_simd& operator-=(basic_simd& lhs, const basic_simd& rhs) noexcept; -friend constexpr basic_simd& operator*=(basic_simd& lhs, const basic_simd& rhs) noexcept; -friend constexpr basic_simd& operator/=(basic_simd& lhs, const basic_simd& rhs) noexcept; -friend constexpr basic_simd& operator%=(basic_simd& lhs, const basic_simd& rhs) noexcept; -friend constexpr basic_simd& operator&=(basic_simd& lhs, const basic_simd& rhs) noexcept; -friend constexpr basic_simd& operator|=(basic_simd& lhs, const basic_simd& rhs) noexcept; -friend constexpr basic_simd& operator^=(basic_simd& lhs, const basic_simd& rhs) noexcept; -friend constexpr basic_simd& operator<<=(basic_simd& lhs, const basic_simd& rhs) noexcept; -friend constexpr basic_simd& operator>>=(basic_simd& lhs, const basic_simd& rhs) noexcept; +friend constexpr basic_vec& operator+=(basic_vec& lhs, const basic_vec& rhs) noexcept; +friend constexpr basic_vec& operator-=(basic_vec& lhs, const basic_vec& rhs) noexcept; +friend constexpr basic_vec& operator*=(basic_vec& lhs, const basic_vec& rhs) noexcept; +friend constexpr basic_vec& operator/=(basic_vec& lhs, const basic_vec& rhs) noexcept; +friend constexpr basic_vec& operator%=(basic_vec& lhs, const basic_vec& rhs) noexcept; +friend constexpr basic_vec& operator&=(basic_vec& lhs, const basic_vec& rhs) noexcept; +friend constexpr basic_vec& operator|=(basic_vec& lhs, const basic_vec& rhs) noexcept; +friend constexpr basic_vec& operator^=(basic_vec& lhs, const basic_vec& rhs) noexcept; +friend constexpr basic_vec& operator<<=(basic_vec& lhs, const basic_vec& rhs) noexcept; +friend constexpr basic_vec& operator>>=(basic_vec& lhs, const basic_vec& rhs) noexcept; \end{itemdecl} \begin{itemdescr} @@ -17762,9 +18183,11 @@ \tcode{lhs}. \end{itemdescr} +\indexlibrarymember{operator<<=}{basic_vec} +\indexlibrarymember{operator>>=}{basic_vec} \begin{itemdecl} -friend constexpr basic_simd& operator<<=(basic_simd& lhs, @\exposid{simd-size-type}@ n) noexcept; -friend constexpr basic_simd& operator>>=(basic_simd& lhs, @\exposid{simd-size-type}@ n) noexcept; +friend constexpr basic_vec& operator<<=(basic_vec& lhs, @\exposid{simd-size-type}@ n) noexcept; +friend constexpr basic_vec& operator>>=(basic_vec& lhs, @\exposid{simd-size-type}@ n) noexcept; \end{itemdecl} \begin{itemdescr} @@ -17778,18 +18201,24 @@ \pnum \effects -Equivalent to: \tcode{return operator \placeholder{op} (lhs, basic_simd(n));} +Equivalent to: \tcode{return operator \placeholder{op} (lhs, basic_vec(n));} \end{itemdescr} -\rSec3[simd.comparison]{\tcode{basic_simd} compare operators} +\rSec3[simd.comparison]{\tcode{basic_vec} compare operators} +\indexlibrarymember{operator==}{basic_vec} +\indexlibrarymember{operator!=}{basic_vec} +\indexlibrarymember{operator>=}{basic_vec} +\indexlibrarymember{operator<=}{basic_vec} +\indexlibrarymember{operator>}{basic_vec} +\indexlibrarymember{operator<}{basic_vec} \begin{itemdecl} -friend constexpr mask_type operator==(const basic_simd& lhs, const basic_simd& rhs) noexcept; -friend constexpr mask_type operator!=(const basic_simd& lhs, const basic_simd& rhs) noexcept; -friend constexpr mask_type operator>=(const basic_simd& lhs, const basic_simd& rhs) noexcept; -friend constexpr mask_type operator<=(const basic_simd& lhs, const basic_simd& rhs) noexcept; -friend constexpr mask_type operator>(const basic_simd& lhs, const basic_simd& rhs) noexcept; -friend constexpr mask_type operator<(const basic_simd& lhs, const basic_simd& rhs) noexcept; +friend constexpr mask_type operator==(const basic_vec& lhs, const basic_vec& rhs) noexcept; +friend constexpr mask_type operator!=(const basic_vec& lhs, const basic_vec& rhs) noexcept; +friend constexpr mask_type operator>=(const basic_vec& lhs, const basic_vec& rhs) noexcept; +friend constexpr mask_type operator<=(const basic_vec& lhs, const basic_vec& rhs) noexcept; +friend constexpr mask_type operator>(const basic_vec& lhs, const basic_vec& rhs) noexcept; +friend constexpr mask_type operator<(const basic_vec& lhs, const basic_vec& rhs) noexcept; \end{itemdecl} \begin{itemdescr} @@ -17803,13 +18232,15 @@ \pnum \returns -A \tcode{basic_simd_mask} object initialized with the results of applying +A \tcode{basic_mask} object initialized with the results of applying \placeholder{op} to \tcode{lhs} and \tcode{rhs} as a binary element-wise operation. \end{itemdescr} -\rSec3[simd.complex.access]{\tcode{simd} complex accessors} +\rSec3[simd.complex.access]{\tcode{vec} complex accessors} +\indexlibrarymember{real}{basic_vec} +\indexlibrarymember{imag}{basic_vec} \begin{itemdecl} constexpr auto real() const noexcept; constexpr auto imag() const noexcept; @@ -17818,17 +18249,19 @@ \begin{itemdescr} \pnum \constraints -\tcode{\exposconcept{simd-complex}} is modeled. +\tcode{\exposconcept{simd-complex}} is modeled. \pnum \returns -An object of type \tcode{rebind_t} +An object of type \tcode{rebind_t} where the $i^\text{th}$ element is initialized to the result of \tcode{\placeholder{cmplx-func}(operator[]($i$))} for all $i$ in the range \range{0}{size()}, where \placeholder{cmplx-func} is the corresponding function from \libheader{complex}. \end{itemdescr} +\indexlibrarymember{real}{basic_vec} +\indexlibrarymember{imag}{basic_vec} \begin{itemdecl} template<@\exposconcept{simd-floating-point}@ V> constexpr void real(const V& v) noexcept; @@ -17841,7 +18274,7 @@ \constraints \begin{itemize} \item - \tcode{\exposconcept{simd-complex}} is modeled, + \tcode{\exposconcept{simd-complex}} is modeled, \item \tcode{\libconcept{same_as}} is modeled, and @@ -17851,32 +18284,33 @@ \pnum \effects -Replaces each element of the \tcode{basic_simd} object such that the +Replaces each element of the \tcode{basic_vec} object such that the $i^\text{th}$ element is replaced with \tcode{value_type(v[$i$], operator[]($i$).imag())} or \tcode{value_type(operator[]($i$).real(), v[$i$])} for \tcode{real} and \tcode{imag} respectively, for all $i$ in the range \range{0}{size()}. \end{itemdescr} -\rSec3[simd.cond]{\tcode{basic_simd} exposition only conditional operators} +\rSec3[simd.cond]{\tcode{basic_vec} exposition only conditional operators} \begin{itemdecl} -friend constexpr basic_simd -@\exposid{simd-select-impl}@(const mask_type& mask, const basic_simd& a, const basic_simd& b) noexcept; +friend constexpr basic_vec +@\exposid{simd-select-impl}@(const mask_type& mask, const basic_vec& a, const basic_vec& b) noexcept; \end{itemdecl} \begin{itemdescr} \pnum \returns -A \tcode{basic_simd} object where the $i^\text{th}$ element equals +A \tcode{basic_vec} object where the $i^\text{th}$ element equals \tcode{mask[$i$] ? a[$i$] : b[$i$]} for all $i$ in the range of \range{0}{size()}. \end{itemdescr} -\rSec3[simd.reductions]{\tcode{basic_simd} reductions} +\rSec3[simd.reductions]{\tcode{basic_vec} reductions} +\indexlibrarymember{reduce}{simd} \begin{itemdecl} template> - constexpr T reduce(const basic_simd& x, BinaryOperation binary_op = {}); + constexpr T reduce(const basic_vec& x, BinaryOperation binary_op = {}); \end{itemdecl} \begin{itemdescr} @@ -17891,18 +18325,19 @@ \pnum \returns -\tcode{\placeholdernc{GENERALIZED_SUM}(binary_op, simd(x[0]), $\ldots$, -simd(x[x.size() - 1])\brk{})[0]}\iref{numerics.defns}. +\tcode{\placeholdernc{GENERALIZED_SUM}(binary_op, vec(x[0]), $\ldots$, +vec(x[x.size() - 1]))[\brk{}0]}\iref{numerics.defns}. \pnum \throws Any exception thrown from \tcode{binary_op}. \end{itemdescr} +\indexlibrarymember{reduce}{simd} \begin{itemdecl} template> constexpr T reduce( - const basic_simd& x, const typename basic_simd::mask_type& mask, + const basic_vec& x, const typename basic_vec::mask_type& mask, BinaryOperation binary_op = {}, type_identity_t identity_element = @\seebelow@); \end{itemdecl} @@ -17927,16 +18362,16 @@ \tcode{binary_op} does not modify \tcode{x}. \item For all finite values \tcode{y} representable by \tcode{T}, the results of - \tcode{y == binary_op(simd(iden\-ti\-ty\-_\-element), simd(y))[0]} and \tcode{y == binary_op(simd(y), simd(iden\-ti\-ty\-_\-element), vec(y))[0]} and \tcode{y == binary_op(vec(y), vec(iden\-ti\-ty\-_\-element))[0]} are \tcode{true}. \end{itemize} \pnum \returns If \tcode{none_of(mask)} is \tcode{true}, returns \tcode{identity_element}. -Otherwise, returns \tcode{\placeholdernc{GENERALIZED_SUM}(binary_op, simd(x[$k_0$]), $\ldots$, simd(x[$k_n$]))[0]} where $k_0, \ldots, k_n$ are +Otherwise, returns \tcode{\placeholdernc{GENERALIZED_SUM}(binary_op, vec(x[$k_0$]), $\ldots$, vec(x[$k_n$]))[0]} where $k_0, \ldots, k_n$ are the selected indices of \tcode{mask}. \pnum @@ -17955,8 +18390,9 @@ \end{itemize} \end{itemdescr} +\indexlibrarymember{reduce_min}{simd} \begin{itemdecl} -template constexpr T reduce_min(const basic_simd& x) noexcept; +template constexpr T reduce_min(const basic_vec& x) noexcept; \end{itemdecl} \begin{itemdescr} @@ -17967,13 +18403,14 @@ \pnum \returns The value of an element \tcode{x[$j$]} for which \tcode{x[$i$] < x[$j$]} is -\tcode{false} for all $i$ in the range of \range{0}{basic_simd::size()}. +\tcode{false} for all $i$ in the range of \range{0}{basic_vec::size()}. \end{itemdescr} +\indexlibrarymember{reduce_min}{simd} \begin{itemdecl} template constexpr T reduce_min( - const basic_simd&, const typename basic_simd::mask_type&) noexcept; + const basic_vec&, const typename basic_vec::mask_type&) noexcept; \end{itemdecl} \begin{itemdescr} @@ -17990,8 +18427,9 @@ \tcode{mask}. \end{itemdescr} +\indexlibrarymember{reduce_max}{simd} \begin{itemdecl} -template constexpr T reduce_max(const basic_simd& x) noexcept; +template constexpr T reduce_max(const basic_vec& x) noexcept; \end{itemdecl} \begin{itemdescr} @@ -18002,13 +18440,14 @@ \pnum \returns The value of an element \tcode{x[$j$]} for which \tcode{x[$j$] < x[$i$]} is -\tcode{false} for all $i$ in the range of \range{0}{basic_simd::size()}. +\tcode{false} for all $i$ in the range of \range{0}{basic_vec::size()}. \end{itemdescr} +\indexlibrarymember{reduce_max}{simd} \begin{itemdecl} template constexpr T reduce_max( - const basic_simd&, const typename basic_simd::mask_type&) noexcept; + const basic_vec&, const typename basic_vec::mask_type&) noexcept; \end{itemdecl} \begin{itemdescr} @@ -18025,8 +18464,9 @@ \tcode{mask}. \end{itemdescr} -\rSec3[simd.loadstore]{\tcode{basic_simd} load and store functions} +\rSec3[simd.loadstore]{\tcode{basic_vec} load and store functions} +\indexlibrarymember{unchecked_load}{simd} \begin{itemdecl} template requires ranges::@\libconcept{sized_range}@ @@ -18084,9 +18524,10 @@ \pnum \remarks The default argument for template parameter \tcode{V} is -\tcode{basic_simd>}. +\tcode{basic_vec>}. \end{itemdescr} +\indexlibrarymember{partial_load}{simd} \begin{itemdecl} template requires ranges::@\libconcept{sized_range}@ @@ -18130,7 +18571,7 @@ \item \tcode{same_as, V>} is \tcode{true}, \item - \tcode{V} is an enabled specialization of \tcode{basic_simd}, and + \tcode{V} is an enabled specialization of \tcode{basic_vec}, and \item if the template parameter pack \tcode{Flags} does not contain \tcode{\exposid{convert-flag}}, then the conversion from @@ -18167,33 +18608,34 @@ \pnum \remarks The default argument for template parameter \tcode{V} is -\tcode{basic_simd>}. +\tcode{basic_vec>}. \end{itemdescr} +\indexlibrarymember{unchecked_store}{simd} \begin{itemdecl} template requires ranges::@\libconcept{sized_range}@ && @\libconcept{indirectly_writable}@, T> - constexpr void unchecked_store(const basic_simd& v, R&& r, flags f = {}); + constexpr void unchecked_store(const basic_vec& v, R&& r, flags f = {}); template requires ranges::@\libconcept{sized_range}@ && @\libconcept{indirectly_writable}@, T> - constexpr void unchecked_store(const basic_simd& v, R&& r, - const typename basic_simd::mask_type& mask, flags f = {}); + constexpr void unchecked_store(const basic_vec& v, R&& r, + const typename basic_vec::mask_type& mask, flags f = {}); template requires @\libconcept{indirectly_writable}@ - constexpr void unchecked_store(const basic_simd& v, I first, iter_difference_t n, + constexpr void unchecked_store(const basic_vec& v, I first, iter_difference_t n, flags f = {}); template requires @\libconcept{indirectly_writable}@ - constexpr void unchecked_store(const basic_simd& v, I first, iter_difference_t n, - const typename basic_simd::mask_type& mask, flags f = {}); + constexpr void unchecked_store(const basic_vec& v, I first, iter_difference_t n, + const typename basic_vec::mask_type& mask, flags f = {}); template S, class... Flags> requires @\libconcept{indirectly_writable}@ - constexpr void unchecked_store(const basic_simd& v, I first, S last, + constexpr void unchecked_store(const basic_vec& v, I first, S last, flags f = {}); template S, class... Flags> requires @\libconcept{indirectly_writable}@ - constexpr void unchecked_store(const basic_simd& v, I first, S last, - const typename basic_simd::mask_type& mask, flags f = {}); + constexpr void unchecked_store(const basic_vec& v, I first, S last, + const typename basic_vec::mask_type& mask, flags f = {}); \end{itemdecl} \begin{itemdescr} @@ -18201,7 +18643,7 @@ Let \begin{itemize} \item - \tcode{mask} be \tcode{basic_simd::mask_type(true)} for the + \tcode{mask} be \tcode{basic_vec::mask_type(true)} for the overloads with no \tcode{mask} parameter; \item \tcode{R} be \tcode{span>} for the overloads with no @@ -18235,30 +18677,31 @@ Equivalent to: \tcode{partial_store(v, r, mask, f)}. \end{itemdescr} +\indexlibrarymember{partial_store}{simd} \begin{itemdecl} template requires ranges::@\libconcept{sized_range}@ && @\libconcept{indirectly_writable}@, T> - constexpr void partial_store(const basic_simd& v, R&& r, flags f = {}); + constexpr void partial_store(const basic_vec& v, R&& r, flags f = {}); template requires ranges::@\libconcept{sized_range}@ && @\libconcept{indirectly_writable}@, T> - constexpr void partial_store(const basic_simd& v, R&& r, - const typename basic_simd::mask_type& mask, flags f = {}); + constexpr void partial_store(const basic_vec& v, R&& r, + const typename basic_vec::mask_type& mask, flags f = {}); template requires @\libconcept{indirectly_writable}@ - constexpr void partial_store(const basic_simd& v, I first, iter_difference_t n, + constexpr void partial_store(const basic_vec& v, I first, iter_difference_t n, flags f = {}); template requires @\libconcept{indirectly_writable}@ - constexpr void partial_store(const basic_simd& v, I first, iter_difference_t n, - const typename basic_simd::mask_type& mask, flags f = {}); + constexpr void partial_store(const basic_vec& v, I first, iter_difference_t n, + const typename basic_vec::mask_type& mask, flags f = {}); template S, class... Flags> requires @\libconcept{indirectly_writable}@ - constexpr void partial_store(const basic_simd& v, I first, S last, + constexpr void partial_store(const basic_vec& v, I first, S last, flags f = {}); template S, class... Flags> requires @\libconcept{indirectly_writable}@ - constexpr void partial_store(const basic_simd& v, I first, S last, - const typename basic_simd::mask_type& mask, flags f = {}); + constexpr void partial_store(const basic_vec& v, I first, S last, + const typename basic_vec::mask_type& mask, flags f = {}); \end{itemdecl} \begin{itemdescr} @@ -18266,7 +18709,7 @@ Let \begin{itemize} \item - \tcode{mask} be \tcode{basic_simd::mask_type(true)} for the + \tcode{mask} be \tcode{basic_vec::mask_type(true)} for the overloads with no \tcode{mask} parameter; \item \tcode{R} be \tcode{span>} for the overloads with no @@ -18300,7 +18743,7 @@ \item If the template parameter pack \tcode{Flags} contains \tcode{\exposid{aligned-flag}}, \tcode{ranges::data(r)} points to storage - aligned by \tcode{alignment_v, + aligned by \tcode{alignment_v, ranges::range_value_t>}. \item If the template parameter pack \tcode{Flags} contains @@ -18310,18 +18753,350 @@ \pnum \effects -For all $i$ in the range of \range{0}{basic_simd::size()}, if +For all $i$ in the range of \range{0}{basic_vec::size()}, if \tcode{mask[$i$] \&\& $i$ < ranges::\brk{}size(r)} is \tcode{true}, evaluates \tcode{ranges::data(r)[$i$] = v[$i$]}. \end{itemdescr} -\rSec3[simd.creation]{\tcode{basic_simd} and \tcode{basic_simd_mask} creation} +\rSec3[simd.permute.static]{\tcode{vec} static permute} + +\indexlibrarymember{permute}{simd} +\begin{itemdecl} +template<@\exposid{simd-size-type}@ N = @\seebelow@, @\exposconcept{simd-vec-type}@ V, class IdxMap> + constexpr resize_t permute(const V& v, IdxMap&& idxmap); +template<@\exposid{simd-size-type}@ N = @\seebelow@, @\exposconcept{simd-mask-type}@ M, class IdxMap> + constexpr resize_t permute(const M& v, IdxMap&& idxmap); +\end{itemdecl} + +\begin{itemdescr} +\pnum +Let: +\begin{itemize} +\item \tcode{\exposid{gen-fn}($i$)} be \tcode{idxmap($i$, V::size())} + if that expression is well-formed, and \tcode{idxmap($i$)} otherwise. +\item \tcode{perm-fn} be the following exposition-only function template: +\begin{codeblock} +template<@\exposid{simd-size-type}@ I> +typename V::value_type @\exposid{perm-fn}@() { + constexpr auto src_index = @\exposid{gen-fn}@(I); + if constexpr (src_index == zero_element) return typename V::value_type(); + else if constexpr (src_index == uninit_element) return @\exposid{unspecified-value}@; + else return v[src_index]; +} +\end{codeblock} +\end{itemize} + +\pnum +\constraints +\tcode{integral> || +integral>} is \tcode{true}. + +\pnum +\mandates +\tcode{\exposid{gen-fn}($i$)} is a constant expression whose value is +\tcode{zero_element}, \tcode{uninit_element}, or in the range +\range{0}{V::size()}, for all $i$ in the range \range{0}{N}. + +\pnum +\returns +A data-parallel object where the +$i^\text{th}$ element is initialized to the result of +\tcode{\exposid{perm-fn}<$i$>()} for all $i$ in the range \range{0}{N}. + +\pnum +\remarks +The default argument for template parameter \tcode{N} is \tcode{V::size()}. +\end{itemdescr} + +\rSec3[simd.permute.dynamic]{\tcode{vec} dynamic permute} + +\indexlibrarymember{permute}{simd} +\begin{itemdecl} +template<@\exposconcept{simd-vec-type}@ V, @\exposconcept{simd-integral}@ I> + constexpr resize_t permute(const V& v, const I& indices); +template<@\exposconcept{simd-mask-type}@ M, @\exposconcept{simd-integral}@ I> + constexpr resize_t permute(const M& v, const I& indices); +\end{itemdecl} + +\begin{itemdescr} +\pnum +\expects +All values in \tcode{indices} are in the range \range{0}{V::size()}. + +\pnum +\returns +A data-parallel object where the $i^\text{th}$ +element is initialized to the result of \tcode{v[indices[$i$]]} for all $i$ in +the range \range{0}{I::size()}. +\end{itemdescr} + +\rSec3[simd.permute.mask]{\tcode{vec} mask permute} + +\indexlibrarymember{compress}{simd} +\begin{itemdecl} +template<@\exposconcept{simd-vec-type}@ V> + constexpr V compress(const V& v, const typename V::mask_type& selector); +template<@\exposconcept{simd-mask-type}@ M> + constexpr M compress(const M& v, const type_identity_t& selector); +\end{itemdecl} + +\begin{itemdescr} +\pnum +Let: +\begin{itemize} +\item \tcode{\exposid{bit-index}($i$)} be a function which returns the index + of the $i$'th element of \tcode{selector} that is \tcode{true}. +\item \tcode{\exposid{select-value}($i$)} be a function which returns + \tcode{v[\exposid{bit-index}($i$)]} for $i$ in the range + \range{0}{reduce_count(selector)} and a valid but unspecified value + otherwise. [*Note*: Different calls to \tcode{select-value} can return + different unspecified values. - *end note*] +\end{itemize} + +\pnum +\returns +A data-parallel object where the $i^\text{th}$ +element is initialized to the result of \tcode{\exposid{select-value}($i$)} +for all $i$ in the range \range{0}{V::size()}. +\end{itemdescr} +\indexlibrarymember{compress}{simd} +\begin{itemdecl} +template<@\exposconcept{simd-vec-type}@ V> + constexpr V compress(const V& v, const typename V::mask_type& selector, + const typename V::value_type& fill_value); +template<@\exposconcept{simd-mask-type}@ M> + constexpr M compress(const M& v, const type_identity_t& selector, + const typename V::value_type& fill_value); +\end{itemdecl} + +\begin{itemdescr} +\pnum +Let: +\begin{itemize} +\item \tcode{\exposid{bit-index}($i$)} be a function which returns the index + of the $i$'th element of \tcode{selector} that is \tcode{true}. +\item \tcode{\exposid{select-value}($i$)} be a function which returns + \tcode{v[\exposid{bit-index}($i$)]} for $i$ in the range + \range{0}{reduce_count(selector)} and \tcode{fill_value} otherwise. +\end{itemize} + +\pnum +\returns +A data-parallel object where the $i^\text{th}$ +element is initialized to the result of \tcode{\exposid{select-value}($i$)} +for all $i$ in the range \range{0}{V::size()}. +\end{itemdescr} + +\indexlibrarymember{expand}{simd} +\begin{itemdecl} +template<@\exposconcept{simd-vec-type}@ V> + constexpr V expand(const V& v, const typename V::mask_type& selector, const V& original = {}); +template<@\exposconcept{simd-mask-type}@ M> + constexpr M expand(const M& v, const type_identity_t& selector, const M& original = {}); +\end{itemdecl} + +\begin{itemdescr} +\pnum +Let: +\begin{itemize} +\item \tcode{set-indices} be a list of the index positions of \tcode{true} + elements in \tcode{selector}. +\item \tcode{\exposid{bit-lookup}(b)} be a function which returns the index + where \tcode{b} appears in \tcode{\exposid{set-indices}}. +\item \tcode{\exposid{select-value}($i$)} be a function which returns + \tcode{v[\exposid{bit-lookup}($i$)]} if \tcode{selector[$i$]} is + \tcode{true}, otherwise returns \tcode{original[$i$]}. +\end{itemize} + +\pnum +\returns +A data-parallel object where the $i^\text{th}$ +element is initialized to the result of \tcode{\exposid{select-value}($i$)} +for all $i$ in the range \range{0}{V::size()}. +\end{itemdescr} + +\rSec3[simd.permute.memory]{\tcode{simd} memory permute} + +\indexlibrarymember{unchecked_gather_from}{simd} +\begin{itemdecl} +template + requires ranges::@\libconcept{sized_range}@ + constexpr V unchecked_gather_from(R&& in, const I& indices, flags f = {}); +template + requires ranges::@\libconcept{sized_range}@ + constexpr V unchecked_gather_from(R&& in, const typename I::mask_type& mask, + const I& indices, flags f = {}); +\end{itemdecl} + +\begin{itemdescr} +\pnum +Let \tcode{mask} be \tcode{typename I::mask_type(true)} for the overload with +no \tcode{mask} parameter. + +\pnum +\expects +All values in \tcode{select(mask, indices, typename I::value_type())} are in +the range \range{0}{ranges::size(in)}. + +\pnum +\effects +Equivalent to: \tcode{return partial_gather_from(in, mask, indices, f);} + +\pnum +\remarks +The default argument for template parameter \tcode{V} is +\tcode{vec, I::\brk{}size()>}. +\end{itemdescr} + +\indexlibrarymember{partial_gather_from}{simd} +\begin{itemdecl} +template + requires ranges::@\libconcept{sized_range}@ + constexpr V partial_gather_from(R&& in, const I& indices, flags f = {}); +template + requires ranges::@\libconcept{sized_range}@ + constexpr V partial_gather_from(R&& in, const typename I::mask_type& mask, + const I& indices, flags f = {}); +\end{itemdecl} + +\begin{itemdescr} +\pnum +Let +\begin{itemize} + \item + \tcode{mask} be \tcode{typename I::mask_type(true)} for the overload with no + \tcode{mask} parameter; + \item + \tcode{T} be \tcode{typename V::value_type}. +\end{itemize} + + +\pnum +\mandates +\begin{itemize} +\item \tcode{ranges::range_value_t} is a vectorizable type, +\item \tcode{same_as, V>} is \tcode{true}, +\item \tcode{V} is an enabled specialization of \tcode{basic_vec}, +\item \tcode{V::size() == I::size()} is \tcode{true}, and +\item if the template parameter pack \tcode{Flags} does not contain + \tcode{convert-flag}, then the conversion from + \tcode{ranges::range_value_t} to \tcode{T} is + value-preserving. +\end{itemize} + +\pnum +\expects +\begin{itemize} +\item If the template parameter pack \tcode{Flags} contains + \tcode{aligned-flag}, \tcode{ranges::data(in)} points to storage aligned by + \tcode{alignment_v>}. +\item If the template parameter pack \tcode{Flags} contains + \tcode{\exposid{overaligned-flag}}, \tcode{ranges::data(in)} points to + storage aligned by \tcode{N}. +\end{itemize} + +\pnum +\returns +A \tcode{basic_vec} object where the $i^\text{th}$ +element is initialized to the result of \tcode{mask[$i$] \&\& indices[$i$] < +ranges::size(in) ? static_cast(ranges::data(in)[indices[$i$]]) : +T()} for all $i$ in the range \range{0}{I::size()}. + +\pnum +\remarks +The default argument for template parameter \tcode{V} is +\tcode{vec, I::\brk{}size()>}. +\end{itemdescr} + +\indexlibrarymember{unchecked_scatter_to}{simd} +\begin{itemdecl} +template<@\exposconcept{simd-vec-type}@ V, ranges::@\libconcept{contiguous_range}@ R, @\exposconcept{simd-integral}@ I, class... Flags> + requires ranges::@\libconcept{sized_range}@ + constexpr void unchecked_scatter_to(const V& v, R&& out, const I& indices, + flags f = {}); +template<@\exposconcept{simd-vec-type}@ V, ranges::@\libconcept{contiguous_range}@ R, @\exposconcept{simd-integral}@ I, class... Flags> + requires ranges::@\libconcept{sized_range}@ + constexpr void unchecked_scatter_to(const V& v, R&& out, const typename I::mask_type& mask, + const I& indices, flags f = {}); +\end{itemdecl} + +\begin{itemdescr} +\pnum +Let \tcode{mask} be \tcode{typename I::mask_type(true)} for the overload with +no \tcode{mask} parameter. + +\pnum +\expects +All values in \tcode{select(mask, indices, typename I::value_type())} are in +the range \range{0}{ranges::size(out)}. + +\pnum +\effects +Equivalent to: \tcode{partial_scatter_to(v, out, mask, indices, f);} +\end{itemdescr} + +\indexlibrarymember{partial_scatter_to}{simd} +\begin{itemdecl} +template<@\exposconcept{simd-vec-type}@ V, ranges::@\libconcept{contiguous_range}@ R, @\exposconcept{simd-integral}@ I, class... Flags> + requires ranges::@\libconcept{sized_range}@ + constexpr void + partial_scatter_to(const V& v, R&& out, const I& indices, flags f = {}); +template<@\exposconcept{simd-vec-type}@ V, ranges::@\libconcept{contiguous_range}@ R, @\exposconcept{simd-integral}@ I, class... Flags> + requires ranges::@\libconcept{sized_range}@ + constexpr void + partial_scatter_to(const V& v, R&& out, + const typename I::mask_type& mask, + const I& indices, flags f = {}); +\end{itemdecl} + +\begin{itemdescr} +\pnum +Let \tcode{mask} be \tcode{typename I::mask_type(true)} for the overload with +no \tcode{mask} parameter. + +\pnum +\constraints +\tcode{V::size() == I::size()} is \tcode{true}. + +\pnum +\mandates +\begin{itemize} +\item \tcode{ranges::range_value_t} is a vectorizable type, and +\item if the template parameter pack \tcode{Flags} does not contain + \tcode{convert-flag}, then the conversion from \tcode{typename V::value_type} to + \tcode{ranges::range_value_t} is value-preserving. +\end{itemize} + +\pnum +\expects +\begin{itemize} +\item For all selected indices *$i$* the values \tcode{indices[$i$]} are + unique. +\item If the template parameter pack \tcode{Flags} contains + \tcode{aligned-flag}, \tcode{ranges::data(out)} points to storage aligned by + \tcode{alignment_v>}. +\item If the template parameter pack \tcode{Flags} contains + \tcode{\exposid{overaligned-flag}}, \tcode{ranges::data(out)} points to + storage aligned by \tcode{N}. +\end{itemize} + +\pnum +\effects +For all $i$ in the range \range{0}{I::size()}, if \tcode{mask[$i$] \&\& +(indices[$i$] < ranges::size(out))} is \tcode{true}, evaluates +\tcode{ranges::data(out)[indices[$i$]] = v[$i$]}. +\end{itemdescr} + +\rSec3[simd.creation]{\tcode{basic_vec} and \tcode{basic_mask} creation} + +\indexlibrarymember{chunk}{simd} \begin{itemdecl} template - constexpr auto chunk(const basic_simd& x) noexcept; + constexpr auto chunk(const basic_vec& x) noexcept; template - constexpr auto chunk(const basic_simd_mask<@\exposid{mask-element-size}@, Abi>& x) noexcept; + constexpr auto chunk(const basic_mask<@\exposid{mask-element-size}@, Abi>& x) noexcept; \end{itemdecl} \begin{itemdescr} @@ -18330,18 +19105,18 @@ \begin{itemize} \item For the first overload, - \tcode{T} is an enabled specialization of \tcode{basic_simd}. - If \tcode{basic_simd<\brk{}typename T::\brk{}value_type, Abi>::size() \% T::size()} + \tcode{T} is an enabled specialization of \tcode{basic_vec}. + If \tcode{basic_vec<\brk{}typename T::\brk{}value_type, Abi>::size() \% T::size()} is not \tcode{0}, then - \tcode{resize_t::size() + \tcode{resize_t::size() \% T::size(), T>} is valid and denotes a type. \item For the second overload, - \tcode{T} is an enabled specialization of \tcode{basic_simd\-_\-mask}. - If \tcode{basic_simd_mask<\exposid{mask-element-size}, Abi>::size() \% T::size()} + \tcode{T} is an enabled specialization of \tcode{basic_mask}. + If \tcode{basic_mask<\exposid{mask-el\-e\-ment-size}, Abi>::size() \% T::size()} is not \tcode{0}, then - \tcode{resize_t<\brk{}ba\-sic\-_\-simd_mask<\brk{}\exposid{mask-element-size}, + \tcode{resize_t<\brk{}basic_mask<\brk{}\exposid{mask-el\-e\-ment-size}, Abi>::size() \% T::size(), T>} is valid and denotes a type. \end{itemize} @@ -18353,53 +19128,56 @@ \begin{itemize} \item If \tcode{x.size() \% T::size() == 0} is \tcode{true}, an \tcode{array} with the $i^\text{th}$ \tcode{basic_simd} or \tcode{basic_simd_mask} + $N$>} with the $i^\text{th}$ \tcode{basic_vec} or \tcode{basic_mask} element of the $j^\text{th}$ \tcode{array} element initialized to the value of the element in \tcode{x} with index \tcode{$i$ + $j$ * T::size()}. \item Otherwise, a \tcode{tuple} of $N$ objects of type \tcode{T} and one object of type \tcode{resize_t}. - The $i^\text{th}$ \tcode{basic_simd} or \tcode{basic_simd_mask} element of + The $i^\text{th}$ \tcode{basic_vec} or \tcode{basic_mask} element of the $j^\text{th}$ \tcode{tuple} element of type \tcode{T} is initialized to the value of the element in \tcode{x} with index \tcode{$i$ + $j$ * T::size()}. - The $i^\text{th}$ \tcode{basic_simd} or \tcode{basic_simd_mask} element of + The $i^\text{th}$ \tcode{basic_vec} or \tcode{basic_mask} element of the $N^\text{th}$ \tcode{tuple} element is initialized to the value of the element in \tcode{x} with index \tcode{$i$ + $N$ * T::size()}. \end{itemize} \end{itemdescr} +\indexlibrarymember{chunk}{simd} \begin{itemdecl} template - constexpr auto chunk(const basic_simd& x) noexcept; + constexpr auto chunk(const basic_vec& x) noexcept; \end{itemdecl} \begin{itemdescr} \pnum \effects -Equivalent to: \tcode{return chunk>>(x);} +Equivalent to: \tcode{return chunk>>(x);} \end{itemdescr} +\indexlibrarymember{chunk}{simd} \begin{itemdecl} template - constexpr auto chunk(const basic_simd_mask& x) noexcept; + constexpr auto chunk(const basic_mask& x) noexcept; \end{itemdecl} \begin{itemdescr} \pnum \effects -Equivalent to: \tcode{return chunk>>(x);} +Equivalent to: \tcode{return chunk>>(x);} \end{itemdescr} +\indexlibrarymember{cat}{simd} \begin{itemdecl} template - constexpr simd::size() + ...)> - cat(const basic_simd&... xs) noexcept; + constexpr vec::size() + ...)> + cat(const basic_vec&... xs) noexcept; template - constexpr basic_simd_mask, - (basic_simd_mask::size() + ...)>> - cat(const basic_simd_mask&... xs) noexcept; + constexpr basic_mask, + (basic_mask::size() + ...)>> + cat(const basic_mask&... xs) noexcept; \end{itemdecl} \begin{itemdescr} @@ -18407,20 +19185,20 @@ \constraints \begin{itemize} \item - For the first overload \tcode{simd::size() + ...)>} + For the first overload \tcode{vec::size() + ...)>} is enabled. \item For the second overload - \tcode{basic_simd_mask, - (ba\-sic_simd_mask::size() + ...)>>} is enabled. + (basic_mask::size() + ...)>>} is enabled. \end{itemize} \pnum \returns A data-parallel object initialized with the concatenated values in the \tcode{xs} pack of data-parallel objects: The $i^\text{th}$ -\tcode{basic_simd}/\tcode{basic_simd_mask} element of the $j^\text{th}$ +\tcode{basic_vec}/\tcode{basic_mask} element of the $j^\text{th}$ parameter in the \tcode{xs} pack is copied to the return value's element with index $i$ + the sum of the width of the first $j$ parameters in the \tcode{xs} pack. @@ -18428,10 +19206,11 @@ \rSec3[simd.alg]{Algorithms} +\indexlibrarymember{min}{simd} \begin{itemdecl} template - constexpr basic_simd min(const basic_simd& a, - const basic_simd& b) noexcept; + constexpr basic_vec min(const basic_vec& a, + const basic_vec& b) noexcept; \end{itemdecl} \begin{itemdescr} @@ -18442,13 +19221,14 @@ \pnum \returns The result of the element-wise application of \tcode{min(a[$i$], b[$i$])} for -all $i$ in the range of \range{0}{basic_simd::size()}. +all $i$ in the range of \range{0}{basic_vec::size()}. \end{itemdescr} +\indexlibrarymember{max}{simd} \begin{itemdecl} template - constexpr basic_simd max(const basic_simd& a, - const basic_simd& b) noexcept; + constexpr basic_vec max(const basic_vec& a, + const basic_vec& b) noexcept; \end{itemdecl} \begin{itemdescr} @@ -18459,13 +19239,14 @@ \pnum \returns The result of the element-wise application of \tcode{max(a[$i$], b[$i$])} for -all $i$ in the range of \range{0}{basic_simd::size()}. +all $i$ in the range of \range{0}{basic_vec::size()}. \end{itemdescr} +\indexlibrarymember{minmax}{simd} \begin{itemdecl} template - constexpr pair, basic_simd> - minmax(const basic_simd& a, const basic_simd& b) noexcept; + constexpr pair, basic_vec> + minmax(const basic_vec& a, const basic_vec& b) noexcept; \end{itemdecl} \begin{itemdescr} @@ -18474,10 +19255,11 @@ Equivalent to: \tcode{return pair\{min(a, b), max(a, b)\};} \end{itemdescr} +\indexlibrarymember{clamp}{simd} \begin{itemdecl} template - constexpr basic_simd clamp( - const basic_simd& v, const basic_simd& lo, const basic_simd& hi); + constexpr basic_vec clamp( + const basic_vec& v, const basic_vec& lo, const basic_vec& hi); \end{itemdecl} \begin{itemdescr} @@ -18493,9 +19275,10 @@ \pnum \returns The result of element-wise application of \tcode{clamp(v[$i$], lo[$i$], -hi[$i$])} for all $i$ in the range of \range{0}{basic_simd::size()}. +hi[$i$])} for all $i$ in the range of \range{0}{basic_vec::size()}. \end{itemdescr} +\indexlibrarymember{select}{simd} \begin{itemdecl} template constexpr auto select(bool c, const T& a, const U& b) @@ -18508,9 +19291,10 @@ Equivalent to: \tcode{return c ? a : b;} \end{itemdescr} +\indexlibrarymember{select}{simd} \begin{itemdecl} template - constexpr auto select(const basic_simd_mask& c, const T& a, const U& b) + constexpr auto select(const basic_mask& c, const T& a, const U& b) noexcept -> decltype(@\exposid{simd-select-impl}@(c, a, b)); \end{itemdecl} @@ -18527,44 +19311,81 @@ \rSec3[simd.math]{Mathematical functions} +\indexlibrarymember{ilogb}{simd} +\indexlibrarymember{ldexp}{simd} +\indexlibrarymember{scalbn}{simd} +\indexlibrarymember{scalbln}{simd} +\indexlibrarymember{abs}{simd} +\indexlibrarymember{abs}{simd} +\indexlibrarymember{fabs}{simd} +\indexlibrarymember{ceil}{simd} +\indexlibrarymember{floor}{simd} +\indexlibrarymember{nearbyint}{simd} +\indexlibrarymember{rint}{simd} +\indexlibrarymember{lrint}{simd} +\indexlibrarymember{llrint}{simd} +\indexlibrarymember{round}{simd} +\indexlibrarymember{lround}{simd} +\indexlibrarymember{llround}{simd} +\indexlibrarymember{fmod}{simd} +\indexlibrarymember{trunc}{simd} +\indexlibrarymember{remainder}{simd} +\indexlibrarymember{copysign}{simd} +\indexlibrarymember{nextafter}{simd} +\indexlibrarymember{fdim}{simd} +\indexlibrarymember{fmax}{simd} +\indexlibrarymember{fmin}{simd} +\indexlibrarymember{fma}{simd} +\indexlibrarymember{fpclassify}{simd} +\indexlibrarymember{isfinite}{simd} +\indexlibrarymember{isinf}{simd} +\indexlibrarymember{isnan}{simd} +\indexlibrarymember{isnormal}{simd} +\indexlibrarymember{signbit}{simd} +\indexlibrarymember{isgreater}{simd} +\indexlibrarymember{isgreaterequal}{simd} +\indexlibrarymember{isless}{simd} +\indexlibrarymember{islessequal}{simd} +\indexlibrarymember{islessgreater}{simd} +\indexlibrarymember{isunordered}{simd} \begin{itemdecl} template<@\exposconcept{math-floating-point}@ V> - constexpr rebind_t> ilogb(const V& x); + constexpr rebind_t> ilogb(const V& x); template<@\exposconcept{math-floating-point}@ V> - constexpr @\exposid{deduced-simd-t}@ ldexp(const V& x, const rebind_t>& exp); + constexpr @\exposid{deduced-vec-t}@ ldexp(const V& x, const rebind_t>& exp); template<@\exposconcept{math-floating-point}@ V> - constexpr @\exposid{deduced-simd-t}@ scalbn(const V& x, const rebind_t>& n); + constexpr @\exposid{deduced-vec-t}@ scalbn(const V& x, const rebind_t>& n); template<@\exposconcept{math-floating-point}@ V> - constexpr @\exposid{deduced-simd-t}@ - scalbln(const V& x, const rebind_t>& n); + constexpr @\exposid{deduced-vec-t}@ + scalbln(const V& x, const rebind_t>& n); template<@\libconcept{signed_integral}@ T, class Abi> - constexpr basic_simd abs(const basic_simd& j); + constexpr basic_vec abs(const basic_vec& j); template<@\exposconcept{math-floating-point}@ V> - constexpr @\exposid{deduced-simd-t}@ abs(const V& j); + constexpr @\exposid{deduced-vec-t}@ abs(const V& j); template<@\exposconcept{math-floating-point}@ V> - constexpr @\exposid{deduced-simd-t}@ fabs(const V& x); + constexpr @\exposid{deduced-vec-t}@ fabs(const V& x); template<@\exposconcept{math-floating-point}@ V> - constexpr @\exposid{deduced-simd-t}@ ceil(const V& x); + constexpr @\exposid{deduced-vec-t}@ ceil(const V& x); template<@\exposconcept{math-floating-point}@ V> - constexpr @\exposid{deduced-simd-t}@ floor(const V& x); + constexpr @\exposid{deduced-vec-t}@ floor(const V& x); template<@\exposconcept{math-floating-point}@ V> - @\exposid{deduced-simd-t}@ nearbyint(const V& x); + @\exposid{deduced-vec-t}@ nearbyint(const V& x); template<@\exposconcept{math-floating-point}@ V> - @\exposid{deduced-simd-t}@ rint(const V& x); + @\exposid{deduced-vec-t}@ rint(const V& x); template<@\exposconcept{math-floating-point}@ V> - rebind_t> lrint(const V& x); + rebind_t> lrint(const V& x); template<@\exposconcept{math-floating-point}@ V> - rebind_t> llrint(const V& x); + rebind_t> llrint(const V& x); template<@\exposconcept{math-floating-point}@ V> - constexpr @\exposid{deduced-simd-t}@ round(const V& x); + constexpr @\exposid{deduced-vec-t}@ round(const V& x); template<@\exposconcept{math-floating-point}@ V> - constexpr rebind_t> lround(const V& x); + constexpr rebind_t> lround(const V& x); template<@\exposconcept{math-floating-point}@ V> - constexpr rebind_t> llround(const V& x); + constexpr rebind_t> llround(const V& x); template constexpr @\exposid{math-common-simd-t}@ fmod(const V0& x, const V1& y); template<@\exposconcept{math-floating-point}@ V> - constexpr @\exposid{deduced-simd-t}@ trunc(const V& x); + constexpr @\exposid{deduced-vec-t}@ trunc(const V& x); template constexpr @\exposid{math-common-simd-t}@ remainder(const V0& x, const V1& y); template @@ -18580,17 +19401,17 @@ template constexpr @\exposid{math-common-simd-t}@ fma(const V0& x, const V1& y, const V2& z); template<@\exposconcept{math-floating-point}@ V> - constexpr rebind_t> fpclassify(const V& x); + constexpr rebind_t> fpclassify(const V& x); template<@\exposconcept{math-floating-point}@ V> - constexpr typename @\exposid{deduced-simd-t}@::mask_type isfinite(const V& x); + constexpr typename @\exposid{deduced-vec-t}@::mask_type isfinite(const V& x); template<@\exposconcept{math-floating-point}@ V> - constexpr typename @\exposid{deduced-simd-t}@::mask_type isinf(const V& x); + constexpr typename @\exposid{deduced-vec-t}@::mask_type isinf(const V& x); template<@\exposconcept{math-floating-point}@ V> - constexpr typename @\exposid{deduced-simd-t}@::mask_type isnan(const V& x); + constexpr typename @\exposid{deduced-vec-t}@::mask_type isnan(const V& x); template<@\exposconcept{math-floating-point}@ V> - constexpr typename @\exposid{deduced-simd-t}@::mask_type isnormal(const V& x); + constexpr typename @\exposid{deduced-vec-t}@::mask_type isnormal(const V& x); template<@\exposconcept{math-floating-point}@ V> - constexpr typename @\exposid{deduced-simd-t}@::mask_type signbit(const V& x); + constexpr typename @\exposid{deduced-vec-t}@::mask_type signbit(const V& x); template constexpr typename @\exposid{math-common-simd-t}@::mask_type isgreater(const V0& x, const V1& y); template @@ -18610,10 +19431,10 @@ \pnum Let \tcode{Ret} denote the return type of the specialization of a function template with the name \placeholder{math-func}. -Let \placeholder{math-func-simd} denote: +Let \placeholder{math-func-vec} denote: \begin{codeblock} template -Ret @\placeholder{math-func-simd}@(Args... args) { +Ret @\placeholder{math-func-vec}@(Args... args) { return Ret([&](@\exposid{simd-size-type}@ i) { @\placeholder{math-func}@(@\exposid{make-compatible-simd-t}@(args)[i]...); }); @@ -18623,10 +19444,10 @@ \pnum \returns A value \tcode{ret} of type \tcode{Ret}, that is element-wise equal to the -result of calling \placeholder{math-func-simd} with the arguments of the above +result of calling \placeholder{math-func-vec} with the arguments of the above functions. If in an invocation of a scalar overload of \placeholder{math-func} for index -\tcode{i} in \placeholder{math-func-simd} a domain, pole, or range error would +\tcode{i} in \placeholder{math-func-vec} a domain, pole, or range error would occur, the value of \tcode{ret[i]} is unspecified. \pnum @@ -18634,55 +19455,107 @@ It is unspecified whether \tcode{errno}\iref{errno} is accessed. \end{itemdescr} -\begin{itemdecl} -template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ acos(const V& x); -template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ asin(const V& x); -template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ atan(const V& x); +\indexlibrarymember{acos}{simd} +\indexlibrarymember{asin}{simd} +\indexlibrarymember{atan}{simd} +\indexlibrarymember{atan2}{simd} +\indexlibrarymember{cos}{simd} +\indexlibrarymember{sin}{simd} +\indexlibrarymember{tan}{simd} +\indexlibrarymember{acosh}{simd} +\indexlibrarymember{asinh}{simd} +\indexlibrarymember{atanh}{simd} +\indexlibrarymember{cosh}{simd} +\indexlibrarymember{sinh}{simd} +\indexlibrarymember{tanh}{simd} +\indexlibrarymember{exp}{simd} +\indexlibrarymember{exp2}{simd} +\indexlibrarymember{expm1}{simd} +\indexlibrarymember{log}{simd} +\indexlibrarymember{log10}{simd} +\indexlibrarymember{log1p}{simd} +\indexlibrarymember{log2}{simd} +\indexlibrarymember{logb}{simd} +\indexlibrarymember{cbrt}{simd} +\indexlibrarymember{hypot}{simd} +\indexlibrarymember{hypot}{simd} +\indexlibrarymember{pow}{simd} +\indexlibrarymember{sqrt}{simd} +\indexlibrarymember{erf}{simd} +\indexlibrarymember{erfc}{simd} +\indexlibrarymember{lgamma}{simd} +\indexlibrarymember{tgamma}{simd} +\indexlibrarymember{lerp}{simd} +\indexlibrarymember{assoc_laguerre}{simd} +\indexlibrarymember{assoc_legendre}{simd} +\indexlibrarymember{beta}{simd} +\indexlibrarymember{comp_ellint_1}{simd} +\indexlibrarymember{comp_ellint_2}{simd} +\indexlibrarymember{comp_ellint_3}{simd} +\indexlibrarymember{cyl_bessel_i}{simd} +\indexlibrarymember{cyl_bessel_j}{simd} +\indexlibrarymember{cyl_bessel_k}{simd} +\indexlibrarymember{cyl_neumann}{simd} +\indexlibrarymember{ellint_1}{simd} +\indexlibrarymember{ellint_2}{simd} +\indexlibrarymember{ellint_3}{simd} +\indexlibrarymember{expint}{simd} +\indexlibrarymember{hermite}{simd} +\indexlibrarymember{laguerre}{simd} +\indexlibrarymember{legendre}{simd} +\indexlibrarymember{riemann_zeta}{simd} +\indexlibrarymember{sph_bessel}{simd} +\indexlibrarymember{sph_legendre}{simd} +\indexlibrarymember{sph_neumann}{simd} +\begin{itemdecl} +template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ acos(const V& x); +template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ asin(const V& x); +template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ atan(const V& x); template constexpr @\exposid{math-common-simd-t}@ atan2(const V0& y, const V1& x); -template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ cos(const V& x); -template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ sin(const V& x); -template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ tan(const V& x); -template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ acosh(const V& x); -template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ asinh(const V& x); -template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ atanh(const V& x); -template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ cosh(const V& x); -template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ sinh(const V& x); -template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ tanh(const V& x); -template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ exp(const V& x); -template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ exp2(const V& x); -template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ expm1(const V& x); -template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ log(const V& x); -template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ log10(const V& x); -template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ log1p(const V& x); -template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ log2(const V& x); -template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ logb(const V& x); -template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ cbrt(const V& x); +template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ cos(const V& x); +template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ sin(const V& x); +template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ tan(const V& x); +template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ acosh(const V& x); +template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ asinh(const V& x); +template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ atanh(const V& x); +template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ cosh(const V& x); +template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ sinh(const V& x); +template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ tanh(const V& x); +template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ exp(const V& x); +template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ exp2(const V& x); +template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ expm1(const V& x); +template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ log(const V& x); +template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ log10(const V& x); +template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ log1p(const V& x); +template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ log2(const V& x); +template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ logb(const V& x); +template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ cbrt(const V& x); template constexpr @\exposid{math-common-simd-t}@ hypot(const V0& x, const V1& y); template constexpr @\exposid{math-common-simd-t}@ hypot(const V0& x, const V1& y, const V2& z); template constexpr @\exposid{math-common-simd-t}@ pow(const V0& x, const V1& y); -template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ sqrt(const V& x); -template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ erf(const V& x); -template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ erfc(const V& x); -template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ lgamma(const V& x); -template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-simd-t}@ tgamma(const V& x); +template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ sqrt(const V& x); +template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ erf(const V& x); +template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ erfc(const V& x); +template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ lgamma(const V& x); +template<@\exposconcept{math-floating-point}@ V> constexpr @\exposid{deduced-vec-t}@ tgamma(const V& x); template constexpr @\exposid{math-common-simd-t}@ lerp(const V0& a, const V1& b, const V2& t) noexcept; template<@\exposconcept{math-floating-point}@ V> - @\exposid{deduced-simd-t}@ assoc_laguerre(const rebind_t>& n, const - rebind_t>& m, + @\exposid{deduced-vec-t}@ assoc_laguerre(const rebind_t>& n, const + rebind_t>& m, const V& x); template<@\exposconcept{math-floating-point}@ V> - @\exposid{deduced-simd-t}@ assoc_legendre(const rebind_t>& l, const - rebind_t>& m, + @\exposid{deduced-vec-t}@ assoc_legendre(const rebind_t>& l, const + rebind_t>& m, const V& x); template @\exposid{math-common-simd-t}@ beta(const V0& x, const V1& y); -template<@\exposconcept{math-floating-point}@ V> @\exposid{deduced-simd-t}@ comp_ellint_1(const V& k); -template<@\exposconcept{math-floating-point}@ V> @\exposid{deduced-simd-t}@ comp_ellint_2(const V& k); +template<@\exposconcept{math-floating-point}@ V> @\exposid{deduced-vec-t}@ comp_ellint_1(const V& k); +template<@\exposconcept{math-floating-point}@ V> @\exposid{deduced-vec-t}@ comp_ellint_2(const V& k); template @\exposid{math-common-simd-t}@ comp_ellint_3(const V0& k, const V1& nu); template @@ -18699,32 +19572,32 @@ @\exposid{math-common-simd-t}@ ellint_2(const V0& k, const V1& phi); template @\exposid{math-common-simd-t}@ ellint_3(const V0& k, const V1& nu, const V2& phi); -template<@\exposconcept{math-floating-point}@ V> @\exposid{deduced-simd-t}@ expint(const V& x); -template<@\exposconcept{math-floating-point}@ V> @\exposid{deduced-simd-t}@ hermite(const rebind_t>& n, const V& x); -template<@\exposconcept{math-floating-point}@ V> @\exposid{deduced-simd-t}@ laguerre(const rebind_t>& n, const V& x); -template<@\exposconcept{math-floating-point}@ V> @\exposid{deduced-simd-t}@ legendre(const rebind_t>& l, const V& x); -template<@\exposconcept{math-floating-point}@ V> @\exposid{deduced-simd-t}@ riemann_zeta(const V& x); -template<@\exposconcept{math-floating-point}@ V> @\exposid{deduced-simd-t}@ sph_bessel(const rebind_t>& n, const V& x); +template<@\exposconcept{math-floating-point}@ V> @\exposid{deduced-vec-t}@ expint(const V& x); +template<@\exposconcept{math-floating-point}@ V> @\exposid{deduced-vec-t}@ hermite(const rebind_t>& n, const V& x); +template<@\exposconcept{math-floating-point}@ V> @\exposid{deduced-vec-t}@ laguerre(const rebind_t>& n, const V& x); +template<@\exposconcept{math-floating-point}@ V> @\exposid{deduced-vec-t}@ legendre(const rebind_t>& l, const V& x); +template<@\exposconcept{math-floating-point}@ V> @\exposid{deduced-vec-t}@ riemann_zeta(const V& x); +template<@\exposconcept{math-floating-point}@ V> @\exposid{deduced-vec-t}@ sph_bessel(const rebind_t>& n, const V& x); template<@\exposconcept{math-floating-point}@ V> - @\exposid{deduced-simd-t}@ sph_legendre(const rebind_t>& l, - const rebind_t>& m, + @\exposid{deduced-vec-t}@ sph_legendre(const rebind_t>& l, + const rebind_t>& m, const V& theta); -template<@\exposconcept{math-floating-point}@ V> @\exposid{deduced-simd-t}@ sph_neumann(const rebind_t>& n, const V& x); +template<@\exposconcept{math-floating-point}@ V> @\exposid{deduced-vec-t}@ sph_neumann(const rebind_t>& n, const V& x); \end{itemdecl} \begin{itemdescr} \pnum Let \tcode{Ret} denote the return type of the specialization of a function template with the name \placeholder{math-func}. -Let \placeholder{math-func-simd} denote: +Let \placeholder{math-func-vec} denote: \begin{codeblock} template -Ret @\placeholder{math-func-simd}@(Args... args) { +Ret @\placeholder{math-func-vec}@(Args... args) { return Ret([&](@\exposid{simd-size-type}@ i) { @\placeholder{math-func}@(@\exposid{make-compatible-simd-t}@(args)[i]...); }); @@ -18734,10 +19607,10 @@ \pnum \returns A value \tcode{ret} of type \tcode{Ret}, that is element-wise approximately -equal to the result of calling \placeholder{math-func-simd} with the arguments +equal to the result of calling \placeholder{math-func-vec} with the arguments of the above functions. If in an invocation of a scalar overload of \placeholder{math-func} for index -\tcode{i} in \placeholder{math-func-simd} a domain, pole, or range error would +\tcode{i} in \placeholder{math-func-vec} a domain, pole, or range error would occur, the value of \tcode{ret[i]} is unspecified. \pnum @@ -18745,18 +19618,19 @@ It is unspecified whether \tcode{errno}\iref{errno} is accessed. \end{itemdescr} +\indexlibrarymember{frexp}{simd} \begin{itemdecl} template<@\exposconcept{math-floating-point}@ V> - constexpr @\exposid{deduced-simd-t}@ frexp(const V& value, rebind_t>* exp); + constexpr @\exposid{deduced-vec-t}@ frexp(const V& value, rebind_t>* exp); \end{itemdecl} \begin{itemdescr} \pnum -Let \tcode{Ret} be \tcode{\exposid{deduced-simd-t}}. -Let \placeholder{frexp-simd} denote: +Let \tcode{Ret} be \tcode{\exposid{deduced-vec-t}}. +Let \placeholder{frexp-vec} denote: \begin{codeblock} template -pair> @\placeholder{frexp-simd}@(const V& x) { +pair> @\placeholder{frexp-vec}@(const V& x) { int r1[Ret::size()]; Ret r0([&](@\exposid{simd-size-type}@ i) { frexp(@\exposid{make-compatible-simd-t}@(x)[i], &r1[i]); @@ -18766,7 +19640,7 @@ \end{codeblock} Let \tcode{ret} be a value of type \tcode{pair>} that is the same value as the result of calling -\placeholder{frexp-simd}\tcode{(x)}. +\placeholder{frexp-vec}\tcode{(x)}. \pnum \effects @@ -18777,6 +19651,7 @@ \tcode{ret.first}. \end{itemdescr} +\indexlibrarymember{remquo}{simd} \begin{itemdecl} template constexpr @\exposid{math-common-simd-t}@ remquo(const V0& x, const V1& y, @@ -18786,10 +19661,10 @@ \begin{itemdescr} \pnum Let \tcode{Ret} be \tcode{\exposid{math-common-simd-t}}. -Let \placeholder{remquo-simd} denote: +Let \placeholder{remquo-vec} denote: \begin{codeblock} template -pair> @\placeholder{remquo-simd}@(const V0& x, const V1& y) { +pair> @\placeholder{remquo-vec}@(const V0& x, const V1& y) { int r1[Ret::size()]; Ret r0([&](@\exposid{simd-size-type}@ i) { remquo(@\exposid{make-compatible-simd-t}@(x)[i], @@ -18800,9 +19675,9 @@ \end{codeblock} Let \tcode{ret} be a value of type \tcode{pair>} that is the same value as the result of calling -\placeholder{remquo-simd}\tcode{(x, y)}. +\placeholder{remquo-vec}\tcode{(x, y)}. If in an invocation of a scalar overload of \tcode{remquo} for index \tcode{i} -in \placeholder{remquo-simd} a domain, pole, or range error would occur, the +in \placeholder{remquo-vec} a domain, pole, or range error would occur, the value of \tcode{ret[i]} is unspecified. \pnum @@ -18818,18 +19693,19 @@ It is unspecified whether \tcode{errno}\iref{errno} is accessed. \end{itemdescr} +\indexlibrarymember{modf}{simd} \begin{itemdecl} template - constexpr basic_simd modf(const type_identity_t>& value, - basic_simd* iptr); + constexpr basic_vec modf(const type_identity_t>& value, + basic_vec* iptr); \end{itemdecl} \begin{itemdescr} \pnum -Let \tcode{V} be \tcode{basic_simd}. -Let \placeholder{modf-simd} denote: +Let \tcode{V} be \tcode{basic_vec}. +Let \placeholder{modf-vec} denote: \begin{codeblock} -pair @\placeholder{modf-simd}@(const V& x) { +pair @\placeholder{modf-vec}@(const V& x) { T r1[Ret::size()]; V r0([&](@\exposid{simd-size-type}@ i) { modf(V(x)[i], &r1[i]); @@ -18838,7 +19714,7 @@ } \end{codeblock} Let \tcode{ret} be a value of type \tcode{pair} that is the same value as -the result of calling \placeholder{modf-simd}\tcode{(value)}. +the result of calling \placeholder{modf-vec}\tcode{(value)}. \pnum \effects @@ -18849,10 +19725,11 @@ \tcode{ret.first}. \end{itemdescr} -\rSec3[simd.bit]{\tcode{basic_simd} bit library} +\rSec3[simd.bit]{\tcode{basic_vec} bit library} +\indexlibrarymember{byteswap}{simd} \begin{itemdecl} -template<@\exposconcept{simd-type}@ V> constexpr V byteswap(const V& v) noexcept; +template<@\exposconcept{simd-vec-type}@ V> constexpr V byteswap(const V& v) noexcept; \end{itemdecl} \begin{itemdescr} @@ -18862,13 +19739,14 @@ \pnum \returns -A \tcode{basic_simd} object where the $i^\text{th}$ element is initialized to +A \tcode{basic_vec} object where the $i^\text{th}$ element is initialized to the result of \tcode{std::byteswap(v[$i$])} for all $i$ in the range \range{0}{V::size()}. \end{itemdescr} +\indexlibrarymember{bit_ceil}{simd} \begin{itemdecl} -template<@\exposconcept{simd-type}@ V> constexpr V bit_ceil(const V& v) noexcept; +template<@\exposconcept{simd-vec-type}@ V> constexpr V bit_ceil(const V& v) noexcept; \end{itemdecl} \begin{itemdescr} @@ -18884,7 +19762,7 @@ \pnum \returns -A \tcode{basic_simd} object where the $i^\text{th}$ element is initialized to +A \tcode{basic_vec} object where the $i^\text{th}$ element is initialized to the result of \tcode{std::bit_ceil(v[$i$])} for all $i$ in the range \range{0}{V::size()}. @@ -18894,8 +19772,9 @@ element is not a core constant expression\iref{expr.const}. \end{itemdescr} +\indexlibrarymember{bit_floor}{simd} \begin{itemdecl} -template<@\exposconcept{simd-type}@ V> constexpr V bit_floor(const V& v) noexcept; +template<@\exposconcept{simd-vec-type}@ V> constexpr V bit_floor(const V& v) noexcept; \end{itemdecl} \begin{itemdescr} @@ -18905,13 +19784,14 @@ \pnum \returns -A \tcode{basic_simd} object where the $i^\text{th}$ element is initialized to +A \tcode{basic_vec} object where the $i^\text{th}$ element is initialized to the result of \tcode{std::bit_floor(v[$i$])} for all $i$ in the range \range{0}{V::size()}. \end{itemdescr} +\indexlibrarymember{has_single_bit}{simd} \begin{itemdecl} -template<@\exposconcept{simd-type}@ V> +template<@\exposconcept{simd-vec-type}@ V> constexpr typename V::mask_type has_single_bit(const V& v) noexcept; \end{itemdecl} @@ -18922,15 +19802,17 @@ \pnum \returns -A \tcode{basic_simd_mask} object where the $i^\text{th}$ element is initialized +A \tcode{basic_mask} object where the $i^\text{th}$ element is initialized to the result of \tcode{std::has_single_bit(v[$i$])} for all $i$ in the range \range{0}{V::size()}. \end{itemdescr} +\indexlibrarymember{rotl}{simd} +\indexlibrarymember{rotr}{simd} \begin{itemdecl} -template<@\exposconcept{simd-type}@ V0, @\exposconcept{simd-type}@ V1> +template<@\exposconcept{simd-vec-type}@ V0, @\exposconcept{simd-vec-type}@ V1> constexpr V0 rotl(const V0& v0, const V1& v1) noexcept; -template<@\exposconcept{simd-type}@ V0, @\exposconcept{simd-type}@ V1> +template<@\exposconcept{simd-vec-type}@ V0, @\exposconcept{simd-vec-type}@ V1> constexpr V0 rotr(const V0& v0, const V1& v1) noexcept; \end{itemdecl} @@ -18950,15 +19832,17 @@ \pnum \returns -A \tcode{basic_simd} object where the $i^\text{th}$ element is initialized to +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 \placeholder{bit-func} is the corresponding scalar function from \libheader{bit}. \end{itemdescr} +\indexlibrarymember{rotl}{simd} +\indexlibrarymember{rotr}{simd} \begin{itemdecl} -template<@\exposconcept{simd-type}@ V> constexpr V rotl(const V& v, int s) noexcept; -template<@\exposconcept{simd-type}@ V> constexpr V rotr(const V& v, int s) noexcept; +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; \end{itemdecl} \begin{itemdescr} @@ -18968,24 +19852,30 @@ \pnum \returns -A \tcode{basic_simd} object where the $i^\text{th}$ element is initialized to +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 \placeholder{bit-func} is the corresponding scalar function from \libheader{bit}. \end{itemdescr} +\indexlibrarymember{bit_width}{simd} +\indexlibrarymember{countl_zero}{simd} +\indexlibrarymember{countl_one}{simd} +\indexlibrarymember{countr_zero}{simd} +\indexlibrarymember{countr_one}{simd} +\indexlibrarymember{popcount}{simd} \begin{itemdecl} -template<@\exposconcept{simd-type}@ V> +template<@\exposconcept{simd-vec-type}@ V> constexpr rebind_t, V> bit_width(const V& v) noexcept; -template<@\exposconcept{simd-type}@ V> +template<@\exposconcept{simd-vec-type}@ V> constexpr rebind_t, V> countl_zero(const V& v) noexcept; -template<@\exposconcept{simd-type}@ V> +template<@\exposconcept{simd-vec-type}@ V> constexpr rebind_t, V> countl_one(const V& v) noexcept; -template<@\exposconcept{simd-type}@ V> +template<@\exposconcept{simd-vec-type}@ V> constexpr rebind_t, V> countr_zero(const V& v) noexcept; -template<@\exposconcept{simd-type}@ V> +template<@\exposconcept{simd-vec-type}@ V> constexpr rebind_t, V> countr_one(const V& v) noexcept; -template<@\exposconcept{simd-type}@ V> +template<@\exposconcept{simd-vec-type}@ V> constexpr rebind_t, V> popcount(const V& v) noexcept; \end{itemdecl} @@ -18996,14 +19886,37 @@ \pnum \returns -A \tcode{basic_simd} object where the $i^\text{th}$ element is initialized to +A \tcode{basic_vec} object where the $i^\text{th}$ element is initialized to the result of \tcode{\placeholder{bit-func}(v[$i$])} for all $i$ in the range \range{0}{V::size()}, where \placeholder{bit-func} is the corresponding scalar function from \libheader{bit}. \end{itemdescr} -\rSec3[simd.complex.math]{\tcode{simd} complex math} - +\rSec3[simd.complex.math]{\tcode{vec} complex math} + +\indexlibrarymember{real}{simd} +\indexlibrarymember{imag}{simd} +\indexlibrarymember{abs}{simd} +\indexlibrarymember{arg}{simd} +\indexlibrarymember{norm}{simd} +\indexlibrarymember{conj}{simd} +\indexlibrarymember{proj}{simd} +\indexlibrarymember{exp}{simd} +\indexlibrarymember{log}{simd} +\indexlibrarymember{log10}{simd} +\indexlibrarymember{sqrt}{simd} +\indexlibrarymember{sin}{simd} +\indexlibrarymember{asin}{simd} +\indexlibrarymember{cos}{simd} +\indexlibrarymember{acos}{simd} +\indexlibrarymember{tan}{simd} +\indexlibrarymember{atan}{simd} +\indexlibrarymember{sinh}{simd} +\indexlibrarymember{asinh}{simd} +\indexlibrarymember{cosh}{simd} +\indexlibrarymember{acosh}{simd} +\indexlibrarymember{tanh}{simd} +\indexlibrarymember{atanh}{simd} \begin{itemdecl} template<@\exposconcept{simd-complex}@ V> constexpr rebind_t<@\exposid{simd-complex-value-type}@, V> real(const V&) noexcept; @@ -19041,7 +19954,7 @@ \begin{itemdescr} \pnum \returns -A \tcode{basic_simd} object \tcode{ret} where the $i^\text{th}$ element is +A \tcode{basic_vec} object \tcode{ret} where the $i^\text{th}$ element is initialized to the result of \tcode{\placeholder{cmplx-func}(v[$i$])} for all $i$ in the range \range{0}{V::size()}, where \placeholder{cmplx-func} is the corresponding function from \libheader{complex}. If in an invocation of @@ -19053,6 +19966,8 @@ It is unspecified whether \tcode{errno}\iref{errno} is accessed. \end{itemdescr} +\indexlibrarymember{polar}{simd} +\indexlibrarymember{pow}{simd} \begin{itemdecl} template<@\exposconcept{simd-floating-point}@ V> rebind_t, V> polar(const V& x, const V& y = {}); @@ -19063,7 +19978,7 @@ \begin{itemdescr} \pnum \returns -A \tcode{basic_simd} object \tcode{ret} where the $i^\text{th}$ element is +A \tcode{basic_vec} object \tcode{ret} where the $i^\text{th}$ element is initialized to the result of \tcode{\placeholder{cmplx-func}(x[$i$], y[$i$])} for all $i$ in the range \range{0}{V::size()}, where \placeholder{cmplx-func} is the corresponding function from \libheader{complex}. If in an invocation of @@ -19075,90 +19990,106 @@ It is unspecified whether \tcode{errno}\iref{errno} is accessed. \end{itemdescr} -\rSec2[simd.mask.class]{Class template \tcode{basic_simd_mask}} +\rSec2[simd.mask.class]{Class template \tcode{basic_mask}} -\rSec3[simd.mask.overview]{Class template \tcode{basic_simd_mask} overview} +\rSec3[simd.mask.overview]{Class template \tcode{basic_mask} overview} \begin{codeblock} -namespace std::datapar { - template class basic_simd_mask { +namespace std::simd { + template class basic_mask { public: - using value_type = bool; - using abi_type = Abi; + using @\libmember{value_type}{basic_mask} = bool; + using @\libmember{abi_type}{basic_mask} = Abi; + using @\libmember{iterator}{basic_mask}@ = @\exposid{simd-iterator}@; + using @\libmember{const_iterator}{basic_mask}@ = @\exposid{simd-iterator}@; + + constexpr iterator @\libmember{begin}{basic_mask}@() noexcept { return {*this, 0}; } + constexpr const_iterator @\libmember{begin}{basic_mask}@() const noexcept { return {*this, 0}; } + constexpr const_iterator @\libmember{cbegin}{basic_mask}@() const noexcept { return {*this, 0}; } + constexpr default_sentinel_t @\libmember{end}{basic_mask}@() const noexcept { return {}; } + constexpr default_sentinel_t @\libmember{cend}{basic_mask}@() const noexcept { return {}; } static constexpr integral_constant<@\exposid{simd-size-type}@, @\exposid{simd-size-v}@<@\exposid{integer-from}@, Abi>> - size {}; + @\libmember{size}{basic_mask}@ {}; - constexpr basic_simd_mask() noexcept = default; + constexpr basic_mask() noexcept = default; - // \ref{simd.mask.ctor}, \tcode{basic_simd_mask} constructors - constexpr explicit basic_simd_mask(value_type) noexcept; + // \ref{simd.mask.ctor}, \tcode{basic_mask} constructors + constexpr explicit basic_mask(value_type) noexcept; template - constexpr explicit basic_simd_mask(const basic_simd_mask&) noexcept; - template constexpr explicit basic_simd_mask(G&& gen) noexcept; + constexpr explicit basic_mask(const basic_mask&) noexcept; + template constexpr explicit basic_mask(G&& gen) noexcept; + constexpr basic_mask(const bitset& b) noexcept; + constexpr explicit basic_mask(@\libconcept{unsigned_integral}@ auto val) noexcept; - // \ref{simd.mask.subscr}, \tcode{basic_simd_mask} subscript operators + // \ref{simd.mask.subscr}, \tcode{basic_mask} subscript operators constexpr value_type operator[](@\exposid{simd-size-type}@) const; + template<@\exposconcept{simd-integral}@ I> + constexpr resize_t operator[](const I& indices) const; - // \ref{simd.mask.unary}, \tcode{basic_simd_mask} unary operators - constexpr basic_simd_mask operator!() const noexcept; - constexpr basic_simd<@\exposid{integer-from}@, Abi> operator+() const noexcept; - constexpr basic_simd<@\exposid{integer-from}@, Abi> operator-() const noexcept; - constexpr basic_simd<@\exposid{integer-from}@, Abi> operator~() const noexcept; + // \ref{simd.mask.unary}, \tcode{basic_mask} unary operators + constexpr basic_mask operator!() const noexcept; + constexpr basic_vec<@\exposid{integer-from}@, Abi> operator+() const noexcept; + constexpr basic_vec<@\exposid{integer-from}@, Abi> operator-() const noexcept; + constexpr basic_vec<@\exposid{integer-from}@, Abi> operator~() const noexcept; - // \ref{simd.mask.conv}, \tcode{basic_simd_mask} conversion operators + // \ref{simd.mask.conv}, \tcode{basic_mask} conversion operators template - constexpr explicit(sizeof(U) != Bytes) operator basic_simd() const noexcept; - - // \ref{simd.mask.binary}, \tcode{basic_simd_mask} binary operators - friend constexpr basic_simd_mask - operator&&(const basic_simd_mask&, const basic_simd_mask&) noexcept; - friend constexpr basic_simd_mask - operator||(const basic_simd_mask&, const basic_simd_mask&) noexcept; - friend constexpr basic_simd_mask - operator&(const basic_simd_mask&, const basic_simd_mask&) noexcept; - friend constexpr basic_simd_mask - operator|(const basic_simd_mask&, const basic_simd_mask&) noexcept; - friend constexpr basic_simd_mask - operator^(const basic_simd_mask&, const basic_simd_mask&) noexcept; - - // \ref{simd.mask.cassign}, \tcode{basic_simd_mask} compound assignment - friend constexpr basic_simd_mask& - operator&=(basic_simd_mask&, const basic_simd_mask&) noexcept; - friend constexpr basic_simd_mask& - operator|=(basic_simd_mask&, const basic_simd_mask&) noexcept; - friend constexpr basic_simd_mask& - operator^=(basic_simd_mask&, const basic_simd_mask&) noexcept; - - // \ref{simd.mask.comparison}, \tcode{basic_simd_mask} comparisons - friend constexpr basic_simd_mask - operator==(const basic_simd_mask&, const basic_simd_mask&) noexcept; - friend constexpr basic_simd_mask - operator!=(const basic_simd_mask&, const basic_simd_mask&) noexcept; - friend constexpr basic_simd_mask - operator>=(const basic_simd_mask&, const basic_simd_mask&) noexcept; - friend constexpr basic_simd_mask - operator<=(const basic_simd_mask&, const basic_simd_mask&) noexcept; - friend constexpr basic_simd_mask - operator>(const basic_simd_mask&, const basic_simd_mask&) noexcept; - friend constexpr basic_simd_mask - operator<(const basic_simd_mask&, const basic_simd_mask&) noexcept; - - // \ref{simd.mask.cond}, \tcode{basic_simd_mask} exposition only conditional operators - friend constexpr basic_simd_mask @\exposid{simd-select-impl}@( // \expos - const basic_simd_mask&, const basic_simd_mask&, const basic_simd_mask&) noexcept; - friend constexpr basic_simd_mask @\exposid{simd-select-impl}@( // \expos - const basic_simd_mask&, @\libconcept{same_as}@ auto, @\libconcept{same_as}@ auto) noexcept; + constexpr explicit(sizeof(U) != Bytes) operator basic_vec() const noexcept; + + // \ref{simd.mask.namedconv}, \tcode{basic_mask} named type convertors + constexpr bitset to_bitset() const noexcept; + constexpr unsigned long long to_ullong() const; + + // \ref{simd.mask.binary}, \tcode{basic_mask} binary operators + friend constexpr basic_mask + operator&&(const basic_mask&, const basic_mask&) noexcept; + friend constexpr basic_mask + operator||(const basic_mask&, const basic_mask&) noexcept; + friend constexpr basic_mask + operator&(const basic_mask&, const basic_mask&) noexcept; + friend constexpr basic_mask + operator|(const basic_mask&, const basic_mask&) noexcept; + friend constexpr basic_mask + operator^(const basic_mask&, const basic_mask&) noexcept; + + // \ref{simd.mask.cassign}, \tcode{basic_mask} compound assignment + friend constexpr basic_mask& + operator&=(basic_mask&, const basic_mask&) noexcept; + friend constexpr basic_mask& + operator|=(basic_mask&, const basic_mask&) noexcept; + friend constexpr basic_mask& + operator^=(basic_mask&, const basic_mask&) noexcept; + + // \ref{simd.mask.comparison}, \tcode{basic_mask} comparisons + friend constexpr basic_mask + operator==(const basic_mask&, const basic_mask&) noexcept; + friend constexpr basic_mask + operator!=(const basic_mask&, const basic_mask&) noexcept; + friend constexpr basic_mask + operator>=(const basic_mask&, const basic_mask&) noexcept; + friend constexpr basic_mask + operator<=(const basic_mask&, const basic_mask&) noexcept; + friend constexpr basic_mask + operator>(const basic_mask&, const basic_mask&) noexcept; + friend constexpr basic_mask + operator<(const basic_mask&, const basic_mask&) noexcept; + + // \ref{simd.mask.cond}, \tcode{basic_mask} exposition only conditional operators + friend constexpr basic_mask @\exposid{simd-select-impl}@( // \expos + const basic_mask&, const basic_mask&, const basic_mask&) noexcept; + friend constexpr basic_mask @\exposid{simd-select-impl}@( // \expos + const basic_mask&, @\libconcept{same_as}@ auto, @\libconcept{same_as}@ auto) noexcept; template - friend constexpr simd<@\seebelow@, size()> - @\exposid{simd-select-impl}@(const basic_simd_mask&, const T0&, const T1&) noexcept; // \expos + friend constexpr vec<@\seebelow@, size()> + @\exposid{simd-select-impl}@(const basic_mask&, const T0&, const T1&) noexcept; // \expos }; } \end{codeblock} \pnum -Every specialization of \tcode{basic_simd_mask} is a complete type. -The specialization of \tcode{basic_simd_mask} is: +Every specialization of \tcode{basic_mask} is a complete type. +The specialization of \tcode{basic_mask} is: \begin{itemize} \item disabled, if there is no vectorizable type \tcode{T} such that \tcode{Bytes} @@ -19169,32 +20100,33 @@ to \tcode{sizeof(T)} and \tcode{Abi} is \tcode{\exposid{deduce-abi-t}}, \item - otherwise, it is \impldef{set of enabled \tcode{basic_simd_mask} + otherwise, it is \impldef{set of enabled \tcode{basic_mask} specializations} if such a specialization is enabled. \end{itemize} -If \tcode{basic_simd_mask} is disabled, the specialization has a +If \tcode{basic_mask} is disabled, the specialization has a deleted default constructor, deleted destructor, deleted copy constructor, and deleted copy assignment. In addition only the \tcode{value_type} and \tcode{abi_type} members are present. -If \tcode{basic_simd_mask} is enabled, -\tcode{basic_simd_mask} is trivially copyable. +If \tcode{basic_mask} is enabled, +\tcode{basic_mask} is trivially copyable. \pnum \recommended Implementations should support implicit conversions between -specializations of \tcode{basic_simd_mask} and appropriate \impldef{conversions -of \tcode{basic_simd_mask} from/to implementation-specific vector types} types. +specializations of \tcode{basic_mask} and appropriate \impldef{conversions +of \tcode{basic_mask} from/to implementation-specific vector types} types. \begin{note} Appropriate types are non-standard vector types which are available in the implementation. \end{note} -\rSec3[simd.mask.ctor]{\tcode{basic_simd_mask} constructors} +\rSec3[simd.mask.ctor]{\tcode{basic_mask} constructors} +\indexlibraryctor{basic_mask} \begin{itemdecl} -constexpr explicit basic_simd_mask(value_type x) noexcept; +constexpr explicit basic_mask(value_type x) noexcept; \end{itemdecl} \begin{itemdescr} @@ -19203,15 +20135,16 @@ Initializes each element with \tcode{x}. \end{itemdescr} +\indexlibraryctor{basic_mask} \begin{itemdecl} template - constexpr explicit basic_simd_mask(const basic_simd_mask& x) noexcept; + constexpr explicit basic_mask(const basic_mask& x) noexcept; \end{itemdecl} \begin{itemdescr} \pnum \constraints -\tcode{basic_simd_mask::size() == size()} is +\tcode{basic_mask::size() == size()} is \tcode{true}. \pnum @@ -19220,8 +20153,9 @@ range of \range{0}{size()}. \end{itemdescr} +\indexlibraryctor{basic_mask} \begin{itemdecl} -template constexpr explicit basic_simd_mask(G&& gen); +template constexpr explicit basic_mask(G&& gen); \end{itemdecl} \begin{itemdescr} @@ -19242,8 +20176,36 @@ \tcode{gen} is invoked exactly once for each $i$, in increasing order of $i$. \end{itemdescr} -\rSec3[simd.mask.subscr]{\tcode{basic_simd_mask} subscript operator} +\indexlibraryctor{basic_mask} +\begin{itemdecl} +constexpr basic_mask(const bitset& b) noexcept; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\effects +Initializes the $i^\text{th}$ element with \tcode{b[$i$]} for all $i$ in the +range \range{0}{size()}. +\end{itemdescr} +\indexlibraryctor{basic_mask} +\begin{itemdecl} +constexpr explicit basic_mask(@\libconcept{unsigned_integral}@ auto val) noexcept; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\effects +Initializes the first $M$ elements to the corresponding bit values in +\tcode{val}, where $M$ is the smaller of \tcode{size()} and the number of bits in +the value representation\iref{basic.types.general} of the type of \tcode{val}. If +$M$ is less than \tcode{size()}, the remaining elements are initialized to +zero. +\end{itemdescr} + +\rSec3[simd.mask.subscr]{\tcode{basic_mask} subscript operator} + +\indexlibrarymember{operator[]}{basic_mask} \begin{itemdecl} constexpr value_type operator[](@\exposid{simd-size-type}@ i) const; \end{itemdecl} @@ -19262,13 +20224,29 @@ Nothing. \end{itemdescr} -\rSec3[simd.mask.unary]{\tcode{basic_simd_mask} unary operators} +\indexlibrarymember{operator[]}{basic_mask} +\begin{itemdecl} +template<@\exposconcept{simd-integral}@ I> + constexpr resize_t operator[](const I& indices) const; +\end{itemdecl} +\begin{itemdescr} +\pnum +\effects +Equivalent to: \tcode{return permute(*this, indices);} +\end{itemdescr} + +\rSec3[simd.mask.unary]{\tcode{basic_mask} unary operators} + +\indexlibrarymember{operator!}{basic_mask} +\indexlibrarymember{operator+}{basic_mask} +\indexlibrarymember{operator-}{basic_mask} +\indexlibrarymember{operator~}{basic_mask} \begin{itemdecl} -constexpr basic_simd_mask operator!() const noexcept; -constexpr basic_simd<@\exposid{integer-from}@, Abi> operator+() const noexcept; -constexpr basic_simd<@\exposid{integer-from}@, Abi> operator-() const noexcept; -constexpr basic_simd<@\exposid{integer-from}@, Abi> operator~() const noexcept; +constexpr basic_mask operator!() const noexcept; +constexpr basic_vec<@\exposid{integer-from}@, Abi> operator+() const noexcept; +constexpr basic_vec<@\exposid{integer-from}@, Abi> operator-() const noexcept; +constexpr basic_vec<@\exposid{integer-from}@, Abi> operator~() const noexcept; \end{itemdecl} \begin{itemdescr} @@ -19282,11 +20260,12 @@ the range of \range{0}{size()}. \end{itemdescr} -\rSec3[simd.mask.conv]{\tcode{basic_simd_mask} conversion operators} +\rSec3[simd.mask.conv]{\tcode{basic_mask} conversion operators} +\indexlibrarymember{operator basic_vec}{basic_mask} \begin{itemdecl} template - constexpr explicit(sizeof(U) != Bytes) operator basic_simd() const noexcept; + constexpr explicit(sizeof(U) != Bytes) operator basic_vec() const noexcept; \end{itemdecl} \begin{itemdescr} @@ -19300,21 +20279,65 @@ \tcode{static_cast(operator[]($i$))}. \end{itemdescr} +\rSec3[simd.mask.namedconv]{\tcode{basic_mask} named conversion operators} + +\indexlibrarymember{to_bitset}{basic_mask} +\begin{itemdecl} +constexpr bitset to_bitset() const noexcept; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\returns +A \tcode{bitset} object where the $i^\text{th}$ element is initialized to +\tcode{operator[]($i$)} for all $i$ in the range \range{0}{size()}. +\end{itemdescr} + +\indexlibrarymember{to_ullong}{basic_mask} +\begin{itemdecl} +constexpr unsigned long long to_ullong() const; +\end{itemdecl} + +\begin{itemdescr} +\pnum +Let $N$ be the width of \tcode{unsigned long long}. + +\pnum +\expects +\begin{itemize} +\item \tcode{size() <= $N$} is \tcode{true}, or +\item for all $i$ in the range \range{$N$}{size()}, \tcode{operator[]($i$)} returns \tcode{false}. +\end{itemize} + +\pnum +\returns +The integral value corresponding to the bits in \tcode{*this}. + +\pnum +\throws +Nothing. +\end{itemdescr} + \rSec2[simd.mask.nonmembers]{Non-member operations} -\rSec3[simd.mask.binary]{\tcode{basic_simd_mask} binary operators} +\rSec3[simd.mask.binary]{\tcode{basic_mask} binary operators} +\indexlibrarymember{operator\&\&}{basic_mask} +\indexlibrarymember{operator||}{basic_mask} +\indexlibrarymember{operator\&}{basic_mask} +\indexlibrarymember{operator|}{basic_mask} +\indexlibrarymember{operator\caret}{basic_mask} \begin{itemdecl} -friend constexpr basic_simd_mask - operator&&(const basic_simd_mask& lhs, const basic_simd_mask& rhs) noexcept; -friend constexpr basic_simd_mask - operator||(const basic_simd_mask& lhs, const basic_simd_mask& rhs) noexcept; -friend constexpr basic_simd_mask - operator& (const basic_simd_mask& lhs, const basic_simd_mask& rhs) noexcept; -friend constexpr basic_simd_mask - operator| (const basic_simd_mask& lhs, const basic_simd_mask& rhs) noexcept; -friend constexpr basic_simd_mask - operator^ (const basic_simd_mask& lhs, const basic_simd_mask& rhs) noexcept; +friend constexpr basic_mask + operator&&(const basic_mask& lhs, const basic_mask& rhs) noexcept; +friend constexpr basic_mask + operator||(const basic_mask& lhs, const basic_mask& rhs) noexcept; +friend constexpr basic_mask + operator& (const basic_mask& lhs, const basic_mask& rhs) noexcept; +friend constexpr basic_mask + operator| (const basic_mask& lhs, const basic_mask& rhs) noexcept; +friend constexpr basic_mask + operator^ (const basic_mask& lhs, const basic_mask& rhs) noexcept; \end{itemdecl} \begin{itemdescr} @@ -19323,20 +20346,23 @@ \pnum \returns -A \tcode{basic_simd_mask} object initialized with the results of applying +A \tcode{basic_mask} object initialized with the results of applying \placeholder{op} to \tcode{lhs} and \tcode{rhs} as a binary element-wise operation. \end{itemdescr} -\rSec3[simd.mask.cassign]{\tcode{basic_simd_mask} compound assignment} +\rSec3[simd.mask.cassign]{\tcode{basic_mask} compound assignment} +\indexlibrarymember{operator\&=}{basic_mask} +\indexlibrarymember{operator|=}{basic_mask} +\indexlibrarymember{operator\caret=}{basic_mask} \begin{itemdecl} -friend constexpr basic_simd_mask& - operator&=(basic_simd_mask& lhs, const basic_simd_mask& rhs) noexcept; -friend constexpr basic_simd_mask& - operator|=(basic_simd_mask& lhs, const basic_simd_mask& rhs) noexcept; -friend constexpr basic_simd_mask& - operator^=(basic_simd_mask& lhs, const basic_simd_mask& rhs) noexcept; +friend constexpr basic_mask& + operator&=(basic_mask& lhs, const basic_mask& rhs) noexcept; +friend constexpr basic_mask& + operator|=(basic_mask& lhs, const basic_mask& rhs) noexcept; +friend constexpr basic_mask& + operator^=(basic_mask& lhs, const basic_mask& rhs) noexcept; \end{itemdecl} \begin{itemdescr} @@ -19353,21 +20379,27 @@ \tcode{lhs}. \end{itemdescr} -\rSec3[simd.mask.comparison]{\tcode{basic_simd_mask} comparisons} +\rSec3[simd.mask.comparison]{\tcode{basic_mask} comparisons} +\indexlibrarymember{operator==}{basic_mask} +\indexlibrarymember{operator!=}{basic_mask} +\indexlibrarymember{operator>=}{basic_mask} +\indexlibrarymember{operator<=}{basic_mask} +\indexlibrarymember{operator<}{basic_mask} +\indexlibrarymember{operator>}{basic_mask} \begin{itemdecl} -friend constexpr basic_simd_mask - operator==(const basic_simd_mask&, const basic_simd_mask&) noexcept; -friend constexpr basic_simd_mask - operator!=(const basic_simd_mask&, const basic_simd_mask&) noexcept; -friend constexpr basic_simd_mask - operator>=(const basic_simd_mask&, const basic_simd_mask&) noexcept; -friend constexpr basic_simd_mask - operator<=(const basic_simd_mask&, const basic_simd_mask&) noexcept; -friend constexpr basic_simd_mask - operator>(const basic_simd_mask&, const basic_simd_mask&) noexcept; -friend constexpr basic_simd_mask - operator<(const basic_simd_mask&, const basic_simd_mask&) noexcept; +friend constexpr basic_mask + operator==(const basic_mask&, const basic_mask&) noexcept; +friend constexpr basic_mask + operator!=(const basic_mask&, const basic_mask&) noexcept; +friend constexpr basic_mask + operator>=(const basic_mask&, const basic_mask&) noexcept; +friend constexpr basic_mask + operator<=(const basic_mask&, const basic_mask&) noexcept; +friend constexpr basic_mask + operator>(const basic_mask&, const basic_mask&) noexcept; +friend constexpr basic_mask + operator<(const basic_mask&, const basic_mask&) noexcept; \end{itemdecl} \begin{itemdescr} @@ -19376,42 +20408,42 @@ \pnum \returns -A \tcode{basic_simd_mask} object initialized with the results of applying +A \tcode{basic_mask} object initialized with the results of applying \placeholder{op} to \tcode{lhs} and \tcode{rhs} as a binary element-wise operation. \end{itemdescr} -\rSec3[simd.mask.cond]{\tcode{basic_simd_mask} exposition only conditional operators} +\rSec3[simd.mask.cond]{\tcode{basic_mask} exposition only conditional operators} \begin{itemdecl} -friend constexpr basic_simd_mask @\exposid{simd-select-impl}@( - const basic_simd_mask& mask, const basic_simd_mask& a, const basic_simd_mask& b) noexcept; +friend constexpr basic_mask @\exposid{simd-select-impl}@( + const basic_mask& mask, const basic_mask& a, const basic_mask& b) noexcept; \end{itemdecl} \begin{itemdescr} \pnum \returns -A \tcode{basic_simd_mask} object where the $i^\text{th}$ element equals +A \tcode{basic_mask} object where the $i^\text{th}$ element equals \tcode{mask[$i$] ? a[$i$] : b[$i$]} for all $i$ in the range of \range{0}{size()}. \end{itemdescr} \begin{itemdecl} -friend constexpr basic_simd_mask -@\exposid{simd-select-impl}@(const basic_simd_mask& mask, @\libconcept{same_as}@ auto a, @\libconcept{same_as}@ auto b) noexcept; +friend constexpr basic_mask +@\exposid{simd-select-impl}@(const basic_mask& mask, @\libconcept{same_as}@ auto a, @\libconcept{same_as}@ auto b) noexcept; \end{itemdecl} \begin{itemdescr} \pnum \returns -A \tcode{basic_simd_mask} object where the $i^\text{th}$ element equals +A \tcode{basic_mask} object where the $i^\text{th}$ element equals \tcode{mask[$i$] ? a : b} for all $i$ in the range of \range{0}{size()}. \end{itemdescr} \begin{itemdecl} template - friend constexpr simd<@\seebelow@, size()> - @\exposid{simd-select-impl}@(const basic_simd_mask& mask, const T0& a, const T1& b) noexcept; + friend constexpr vec<@\seebelow@, size()> + @\exposid{simd-select-impl}@(const basic_mask& mask, const T0& a, const T1& b) noexcept; \end{itemdecl} \begin{itemdescr} @@ -19428,15 +20460,16 @@ \pnum \returns -A \tcode{simd} object where the $i^\text{th}$ element equals +A \tcode{vec} object where the $i^\text{th}$ element equals \tcode{mask[$i$] ? a : b} for all $i$ in the range of \range{0}{size()}. \end{itemdescr} -\rSec3[simd.mask.reductions]{\tcode{basic_simd_mask} reductions} +\rSec3[simd.mask.reductions]{\tcode{basic_mask} reductions} +\indexlibrarymember{all_of}{simd} \begin{itemdecl} template - constexpr bool all_of(const basic_simd_mask& k) noexcept; + constexpr bool all_of(const basic_mask& k) noexcept; \end{itemdecl} \begin{itemdescr} @@ -19446,9 +20479,10 @@ \tcode{false}. \end{itemdescr} +\indexlibrarymember{any_of}{simd} \begin{itemdecl} template - constexpr bool any_of(const basic_simd_mask& k) noexcept; + constexpr bool any_of(const basic_mask& k) noexcept; \end{itemdecl} \begin{itemdescr} @@ -19458,9 +20492,10 @@ otherwise \tcode{false}. \end{itemdescr} +\indexlibrarymember{none_of}{simd} \begin{itemdecl} template - constexpr bool none_of(const basic_simd_mask& k) noexcept; + constexpr bool none_of(const basic_mask& k) noexcept; \end{itemdecl} \begin{itemdescr} @@ -19469,9 +20504,10 @@ \tcode{!any_of(k)}. \end{itemdescr} +\indexlibrarymember{reduce_count}{simd} \begin{itemdecl} template - constexpr @\exposid{simd-size-type}@ reduce_count(const basic_simd_mask& k) noexcept; + constexpr @\exposid{simd-size-type}@ reduce_count(const basic_mask& k) noexcept; \end{itemdecl} \begin{itemdescr} @@ -19480,9 +20516,10 @@ The number of boolean elements in \tcode{k} that are \tcode{true}. \end{itemdescr} +\indexlibrarymember{reduce_min_index}{simd} \begin{itemdecl} template - constexpr @\exposid{simd-size-type}@ reduce_min_index(const basic_simd_mask& k); + constexpr @\exposid{simd-size-type}@ reduce_min_index(const basic_mask& k); \end{itemdecl} \begin{itemdescr} @@ -19495,9 +20532,10 @@ The lowest element index $i$ where \tcode{k[$i$]} is \tcode{true}. \end{itemdescr} +\indexlibrarymember{reduce_max_index}{simd} \begin{itemdecl} template - constexpr @\exposid{simd-size-type}@ reduce_max_index(const basic_simd_mask& k); + constexpr @\exposid{simd-size-type}@ reduce_max_index(const basic_mask& k); \end{itemdecl} \begin{itemdescr} @@ -19510,6 +20548,9 @@ The greatest element index $i$ where \tcode{k[$i$]} is \tcode{true}. \end{itemdescr} +\indexlibrarymember{all_of}{simd} +\indexlibrarymember{any_of}{simd} +\indexlibrarymember{reduce_count}{simd} \begin{itemdecl} constexpr bool all_of(@\libconcept{same_as}@ auto x) noexcept; constexpr bool any_of(@\libconcept{same_as}@ auto x) noexcept; @@ -19522,6 +20563,7 @@ \tcode{x}. \end{itemdescr} +\indexlibrarymember{none_of}{simd} \begin{itemdecl} constexpr bool none_of(@\libconcept{same_as}@ auto x) noexcept; \end{itemdecl} @@ -19532,6 +20574,8 @@ \tcode{!x}. \end{itemdescr} +\indexlibrarymember{reduce_min_index}{simd} +\indexlibrarymember{reduce_max_index}{simd} \begin{itemdecl} constexpr @\exposid{simd-size-type}@ reduce_min_index(@\libconcept{same_as}@ auto x); constexpr @\exposid{simd-size-type}@ reduce_max_index(@\libconcept{same_as}@ auto x); diff --git a/source/support.tex b/source/support.tex index 95d674aafb..4cbf9deb72 100644 --- a/source/support.tex +++ b/source/support.tex @@ -805,8 +805,9 @@ #define @\defnlibxname{cpp_lib_shared_ptr_weak_type}@ 201606L // also in \libheader{memory} #define @\defnlibxname{cpp_lib_shared_timed_mutex}@ 201402L // also in \libheader{shared_mutex} #define @\defnlibxname{cpp_lib_shift}@ 202202L // also in \libheader{algorithm} -#define @\defnlibxname{cpp_lib_simd}@ 202502L // also in \libheader{simd} +#define @\defnlibxname{cpp_lib_simd}@ 202506L // also in \libheader{simd} #define @\defnlibxname{cpp_lib_simd_complex}@ 202502L // 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} #define @\defnlibxname{cpp_lib_source_location}@ 201907L // freestanding, also in \libheader{source_location}