Skip to content

Commit

Permalink
Make simd_flags template arguments exposition-only.
Browse files Browse the repository at this point in the history
ChangeLog:

	* P1928/changelog.tex:
	* P1928/main.tex:
	* P1928/wording.tex:
  • Loading branch information
mattkretz committed Jun 28, 2024
1 parent 64569ed commit 7b0012c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 21 deletions.
1 change: 1 addition & 0 deletions P1928/changelog.tex
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ \section{Changelog}
\item Fix constraints on shift operators with \simdsizetype{} on the right operand.
\item Remove wording removed by P3275 (non-const \code{operator[]}).
\item Make intrinsics conversion recommended practice.
\item Make \code{simd_flags} template arguments exposition-only.

%\todo Reorder \code{simd} and \code{simd_mask} specification in the wording (mask first).
\end{revision}
3 changes: 3 additions & 0 deletions P1928/main.tex
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
\newcommand\maskelementsize{\UNSP{mask-element-size}}
\newcommand\integerfrom{\UNSP{integer-from}}
\newcommand\constexprwrapperlike{\UNSP{constexpr-wrapper-like}}
\newcommand\convertflag{\UNSP{convert-flag}}
\newcommand\alignedflag{\UNSP{aligned-flag}}
\newcommand\overalignedflag{\UNSP{overaligned-flag}}

\renewcommand{\lst}[1]{Listing~\ref{#1}}
\renewcommand{\sect}[1]{Section~\ref{#1}}
Expand Down
36 changes: 15 additions & 21 deletions P1928/wording.tex
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,16 @@
template<@\simdsizetype@ N, class V> using resize_simd_t = typename resize_simd<N, V>::type;

// \ref{simd.flags}, Load and store flags
struct @\convertflag@ {}; // \expos
struct @\alignedflag@ {}; // \expos
template<size_t N> struct @\overalignedflag@ {}; // \expos

template <class... Flags> struct simd_flags;
inline constexpr simd_flags<> simd_flag_default{};
inline constexpr simd_flags<@\seebelow@> simd_flag_convert{};
inline constexpr simd_flags<@\seebelow@> simd_flag_aligned{};
inline constexpr simd_flags<@\convertflag@> simd_flag_convert{};
inline constexpr simd_flags<@\alignedflag@> simd_flag_aligned{};
template<size_t N> requires (has_single_bit(N))
inline constexpr simd_flags<@\seebelow@> simd_flag_overaligned{};
inline constexpr simd_flags<@\overalignedflag<N>@> simd_flag_overaligned{};

// \ref{simd.class}, Class template \tcode{basic_simd}
template<class T, class Abi = @\nativeabi@<T>> class basic_simd;
Expand Down Expand Up @@ -400,19 +404,6 @@

\rSec1[simd.flags]{Load and store flags}

\begin{itemdecl}
inline constexpr simd_flags<@\seebelow@> simd_flag_convert{};
inline constexpr simd_flags<@\seebelow@> simd_flag_aligned{};
template<size_t N> requires (has_single_bit(N))
inline constexpr simd_flags<@\seebelow@> simd_flag_overaligned{};
\end{itemdecl}

\begin{itemdescr}
\pnum
The template arguments to \tcode{simd_flags} are unspecified types used
by the implementation to identify the different load and store flags.
\end{itemdescr}

\rSec2[simd.flags.overview]{Class template \tcode{simd_flags} overview}

\begin{codeblock}
Expand All @@ -429,9 +420,10 @@
\end{note}

\pnum\constraints
Every type in \code{Flags} is a valid template argument to one of
\code{simd_flag_convert}, \tcode{simd_flag_aligned}, or
\tcode{simd_flag_overaligned}.
Every type in \tcode{Flags} is one of \tcode{\convertflag},
\tcode{\alignedflag}, or \tcode{\overalignedflag<N>}.

\FIXME{“\ldots for any \tcode{N}”?}

\rSec2[simd.flags.oper]{\tcode{simd_flags} operators}

Expand All @@ -442,8 +434,10 @@

\begin{itemdescr}
\pnum\returns
A specialization of \tcode{simd_flags} identifying all load and
store flags identified either by \tcode{a} or \tcode{b}.
A default-initialized object of the specialization
\tcode{simd_flags<Flags2...>} where every type in pack \tcode{Flags2} is
present either in pack \tcode{Flags} or \tcode{Other} and every type in packs
\tcode{Flags} and \tcode{Other} is present in \code{Flags2}.
\end{itemdescr}

\rSec1[simd.class]{Class template \tcode{basic_simd}}
Expand Down

0 comments on commit 7b0012c

Please sign in to comment.