Skip to content

Commit

Permalink
Updating language for min precision type representations
Browse files Browse the repository at this point in the history
  • Loading branch information
llvm-beanz committed Apr 17, 2024
1 parent e9c1eed commit 2259544
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 25 deletions.
49 changes: 24 additions & 25 deletions specs/language/basic.tex
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,23 @@
declaration}, and complete later with a full definition. The type \texttt{T} is
the same type throughout the translation unit.

\p There are two special implementation-defined types: \textit{handle types},
and \textit{minimum precision types}. These types are collectively called
\textit{standard intangible types}. Intangible types are types that have no
defined object representation or value representation, as such the size is
unknown at compile time.
\p There are special implementation-defined types such as \textit{handle types},
which fall into a category of \textit{standard intangible types}. Intangible
types are types that have no defined object representation or value
representation, as such the size is unknown at compile time.
% Note: The above definition is likely incomplete, and it is unclear if minimum
% precision types should be intangible.

\p A class type \texttt{T} is an \textit{intangible class type} if it contains
an base classes or members of intangible class type, standard intangible type,
or arrays of such types. Standard intangible types and intangible class types
are collectively called \textit{intangible types}.
are collectively called \textit{intangible types}(\ref{Intangible}).

\p An object type is an \textit{incomplete type} if the
compiler lacks sufficient information to determine the size of an object of type
\texttt{T}, and a \textit{complete type} if the compiler has sufficient
information to determine the size of an object of type \texttt{T}. An object may
not be defined to have an \textit{incomplete} type.
\p An object type is an \textit{incomplete type} if the compiler lacks
sufficient information to determine the size of an object of type \texttt{T},
and a \textit{complete type} if the compiler has sufficient information to
determine the size of an object of type \texttt{T}. An object may not be defined
to have an \textit{incomplete} type.

\p Arithmetic types (\ref{Basic.types.arithmetic}), enumeration types, and
\textit{cv-qualified} versions of these types are collectively called
Expand All @@ -57,23 +56,22 @@
is also the type alias \texttt{int} which is an alias of \texttt{int32\_t}.
There are three \textit{minimum precision signed integer types}:
\texttt{min10int}, \texttt{min12int}, and \texttt{min16int}. Each of the minimum
precision signed integer types are intangible types named for the required
minimum type size in bits. The object and value representations are
implementation defined, but shall not exceed the size of \texttt{int}. The
standard signed integer types and minimum precision signed integer types are
collectively called \textit{signed integer types}.
precision signed integer types are named for the required minimum value
representation size in bits. The object representation of all minimum precision
types is \texttt{int}. The standard signed integer types and minimum precision
signed integer types are collectively called \textit{signed integer types}.

\p There are three \textit{standard unsigned integer types}: \texttt{uint16\_t},
\texttt{uint32\_t}, and \texttt{uint64\_t}. Each of the unsigned integer types
is explicitly named for the size in bits of the type's object representation.
There is also the type alias \texttt{uint} which is an alias of
\texttt{uint32\_t}. There are three \textit{minimum precision unsigned integer
types}: \texttt{min10uint}, \texttt{min12uint}, and \texttt{min16uint}. Each of
the minimum precision unsigned integer types are intangible types named for the
required minimum type size in bits. The object and value representations are
implementation defined, but shall not exceed the size of \texttt{uint}. The
standard unsigned integer types and minimum precision unsigned integer types are
collectively called \textit{unsigned integer types}.
the minimum precision unsigned integer types are named for the required minimum
value representation size in bits. The object representation of all minimum
precision types is \texttt{uint}. The standard unsigned integer types and
minimum precision unsigned integer types are collectively called
\textit{unsigned integer types}.

\p The signed integer types and unsigned integer types are collectively called
\textit{integer types}. Integer types inherit the object representation of
Expand All @@ -93,10 +91,11 @@
for 16-bit floating point values, it does not fully specify the behavior of such
types.}. There are three \textit{minimum precision floating point types}:
\texttt{min10float}, \texttt{min12float}, and \texttt{min16float}. Each of the
minimum precision floating point types are intangible types named for the
required minimum size in bits. The object and value representations are
implementation defined, but shall not exceed the size of \texttt{float}. The
standard floating point types and minimum precision floating point types are
minimum precision floating point types are named for the required minimum value
representation size in bits. The object representation of all minimum precision
types is \texttt{float}\footnote{This means when stored to memory minimum
precision types are stored as \textbf{binary32} as defined in \gls{IEEE754}.}.
The standard floating point types and minimum precision floating point types are
collectively called \textit{floating point types}.

\p Integer and floating point types are collectively called \textit{arithmetic
Expand Down
30 changes: 30 additions & 0 deletions specs/language/classes.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
\Ch{Classes}{Classes}

\begin{grammar}
\define{class-name}\br
identifier\br
simple-template-id\br

\define{class-head}\br
class-key class-name-specifier \opt{base-clause}\br
class-key \opt{base-clause}\br

\define{class-name-specifier}\br
\opt{nested-name-specifier} class-name\br

\define{base-clause}\br
\terminal{:} class-name-specifier\br

\define{class-key}\br
\terminal{class}\br
\terminal{struct}
\end{grammar}

\Sec{Properties of classes}{Classes.properties}

\p A \textit{simple-layout class} is a class that:
\begin{itemize}
\item has no non-static data members of type non-simple-layout class or array
of such types, and
\item has no non-simple-layout base classes.
\end{itemize}
1 change: 1 addition & 0 deletions specs/language/placeholders.tex
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
\Sub{Entry Attributes}{Decl.Attr.Entry}
\Ch{Classes}{Classes}
\Ch{Overloading}{Overload}
\Ch{Intangible Types}{Intangible}
\Ch{Runtime}{Runtime}

0 comments on commit 2259544

Please sign in to comment.