Skip to content
This repository was archived by the owner on Dec 22, 2021. It is now read-only.

Fix some stale references to value types #527

Merged
merged 3 commits into from
Nov 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion document/core/appendix/index-types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Category Constructor
:ref:`Number type <syntax-numtype>` |I64| :math:`\hex{7E}` (-2 as |Bs7|)
:ref:`Number type <syntax-numtype>` |F32| :math:`\hex{7D}` (-3 as |Bs7|)
:ref:`Number type <syntax-numtype>` |F64| :math:`\hex{7C}` (-4 as |Bs7|)
:ref:`Number type <syntax-vectype>` |V128| :math:`\hex{7B}` (-5 as |Bs7|)
:ref:`Vector type <syntax-vectype>` |V128| :math:`\hex{7B}` (-5 as |Bs7|)
(reserved) :math:`\hex{7A}` .. :math:`\hex{71}`
:ref:`Reference type <syntax-reftype>` |FUNCREF| :math:`\hex{70}` (-16 as |Bs7|)
:ref:`Reference type <syntax-reftype>` |EXTERNREF| :math:`\hex{6F}` (-17 as |Bs7|)
Expand Down
9 changes: 4 additions & 5 deletions document/core/binary/conventions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,20 @@ In order to distinguish symbols of the binary syntax from symbols of the abstrac
(This is a shorthand for a side condition requiring multiple different variables to be equal.)

.. note::
For example, the :ref:`binary grammar <binary-valtype>` for :ref:`value types <syntax-valtype>` is given as follows:
For example, the :ref:`binary grammar <binary-numtype>` for :ref:`number types <syntax-numtype>` is given as follows:

.. math::
\begin{array}{llcll@{\qquad\qquad}l}
\production{value types} & \Bvaltype &::=&
\production{number types} & \Bnumtype &::=&
\hex{7F} &\Rightarrow& \I32 \\ &&|&
\hex{7E} &\Rightarrow& \I64 \\ &&|&
\hex{7D} &\Rightarrow& \F32 \\ &&|&
\hex{7C} &\Rightarrow& \F64 \\ &&|&
\hex{7B} &\Rightarrow& \V128 \\
\hex{7C} &\Rightarrow& \F64 \\
\end{array}

Consequently, the byte :math:`\hex{7F}` encodes the type |I32|,
:math:`\hex{7E}` encodes the type |I64|, and so forth.
No other byte value is allowed as the encoding of a value type.
No other byte value is allowed as the encoding of a number type.

The :ref:`binary grammar <binary-limits>` for :ref:`limits <syntax-limits>` is defined as follows:

Expand Down
8 changes: 5 additions & 3 deletions document/core/exec/runtime.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ Runtime Structure
.. index:: ! value, number, reference, constant, number type, vector type, reference type, ! host address, value type, integer, floating-point, vector number, ! default value
pair: abstract syntax; value
.. _syntax-num:
.. _syntax-vecc:
.. _syntax-ref:
.. _syntax-ref.extern:
.. _syntax-val:

Values
~~~~~~

WebAssembly computations manipulate *values* of either the five basic :ref:`number types <syntax-numtype>`, i.e., :ref:`integers <syntax-int>` and :ref:`floating-point data <syntax-float>` of 32 or 64 bit width each and :ref:`vector data <syntax-vec>` of 128 bit width, or of :ref:`reference type <syntax-reftype>`.
WebAssembly computations manipulate *values* of either the four basic :ref:`number types <syntax-numtype>`, i.e., :ref:`integers <syntax-int>` and :ref:`floating-point data <syntax-float>` of 32 or 64 bit width each, of :ref:`vectors <syntax-vecnum>` of 128 bit width, or of :ref:`reference type <syntax-reftype>`.

In most places of the semantics, values of different types can occur.
In order to avoid ambiguities, values are therefore represented with an abstract syntax that makes their type explicit.
Expand All @@ -33,14 +34,15 @@ or *external references* pointing to an uninterpreted form of :ref:`extern addre
\I32.\CONST~\i32 \\&&|&
\I64.\CONST~\i64 \\&&|&
\F32.\CONST~\f32 \\&&|&
\F64.\CONST~\f64 \\ &&|&
\F64.\CONST~\f64 \\
\production{(vector)} & \vecc &::=&
\V128.\CONST~\i128 \\
\production{(reference)} & \reff &::=&
\REFNULL~t \\&&|&
\REFFUNCADDR~\funcaddr \\&&|&
\REFEXTERNADDR~\externaddr \\
\production{(value)} & \val &::=&
\num ~|~ \reff \\
\num ~|~ \vecc ~|~ \reff \\
\end{array}

.. note::
Expand Down
6 changes: 3 additions & 3 deletions document/core/intro/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This language is structured around the following concepts.
.. _value:

**Values**
WebAssembly provides only four basic *value types*.
WebAssembly provides only four basic *number types*.
These are integers and |IEEE754|_ numbers,
each in 32 and 64 bit width.
32 bit integers also serve as Booleans and as memory addresses.
Expand All @@ -23,8 +23,8 @@ This language is structured around the following concepts.
Instead, integers are interpreted by respective operations
as either unsigned or signed in two’s complement representation.

In addition to the basic value types above, there is a single 128 bit wide
value type representing different types of packed data.
In addition to these basic number types, there is a single 128 bit wide
vector type representing different types of packed data.
The supported representations are 4 32-bit, or 2 64-bit
|IEEE754|_ numbers, or different widths of packed integer values
specifically 2 64-bit integers, 4 32-bit integers, 8
Expand Down
7 changes: 3 additions & 4 deletions document/core/text/conventions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,15 @@ In order to distinguish symbols of the textual syntax from symbols of the abstra
* A distinction is made between *lexical* and *syntactic* productions. For the latter, arbitrary :ref:`white space <text-space>` is allowed in any place where the grammar contains spaces. The productions defining :ref:`lexical syntax <text-lexical>` and the syntax of :Ref:`values <text-value>` are considered lexical, all others are syntactic.

.. note::
For example, the :ref:`textual grammar <text-valtype>` for :ref:`value types <syntax-valtype>` is given as follows:
For example, the :ref:`textual grammar <text-numtype>` for :ref:`number types <syntax-numtype>` is given as follows:

.. math::
\begin{array}{llcll@{\qquad\qquad}l}
\production{value types} & \Tvaltype &::=&
\production{number types} & \Tnumtype &::=&
\text{i32} &\Rightarrow& \I32 \\ &&|&
\text{i64} &\Rightarrow& \I64 \\ &&|&
\text{f32} &\Rightarrow& \F32 \\ &&|&
\text{f64} &\Rightarrow& \F64 \\ &&|&
\text{v128} &\Rightarrow& \V128 \\
\text{f64} &\Rightarrow& \F64 \\
\end{array}

The :ref:`textual grammar <text-limits>` for :ref:`limits <syntax-limits>` is defined as follows:
Expand Down
4 changes: 2 additions & 2 deletions document/core/util/macros.def
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,7 @@
.. Values & Results, non-terminals

.. |num| mathdef:: \xref{exec/runtime}{syntax-num}{\X{num}}
.. |vecc| mathdef:: \xref{exec/runtime}{syntax-vecnum}{\X{vec}}
.. |vecc| mathdef:: \xref{exec/runtime}{syntax-vec}{\X{vec}}
.. |reff| mathdef:: \xref{exec/runtime}{syntax-ref}{\X{ref}}
.. |val| mathdef:: \xref{exec/runtime}{syntax-val}{\X{val}}
.. |result| mathdef:: \xref{exec/runtime}{syntax-result}{\X{result}}
Expand Down Expand Up @@ -1186,7 +1186,7 @@
.. |fsign| mathdef:: \xref{exec/numerics}{aux-fsign}{\F{fsign}}
.. |fbias| mathdef:: \xref{exec/numerics}{aux-fbias}{\F{fbias}}
.. |bytes| mathdef:: \xref{exec/numerics}{aux-bytes}{\F{bytes}}
.. |littleendian| mathdef:: \xref{exec/numerics}{aux-littleendian}{\F{little~endian}}
.. |littleendian| mathdef:: \xref{exec/numerics}{aux-littleendian}{\F{littleendian}}
.. |signed| mathdef:: \xref{exec/numerics}{aux-signed}{\F{signed}}
.. |bool| mathdef:: \xref{exec/numerics}{aux-bool}{\F{bool}}

Expand Down