From 3fd79fbaa33199ba2d80b784e4d2efb10119378f Mon Sep 17 00:00:00 2001 From: Ng Zhi An Date: Wed, 10 Nov 2021 10:29:40 -0800 Subject: [PATCH 1/3] Fix some stale references to value types Based on comments from https://github.com/WebAssembly/spec/pull/1391. --- document/core/appendix/index-types.rst | 2 +- document/core/binary/conventions.rst | 9 ++++----- document/core/exec/runtime.rst | 8 +++++--- document/core/intro/overview.rst | 6 +++--- document/core/text/conventions.rst | 7 +++---- document/core/util/katex | 2 +- document/core/util/macros.def | 4 ++-- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/document/core/appendix/index-types.rst b/document/core/appendix/index-types.rst index a9eb5529..715233ce 100644 --- a/document/core/appendix/index-types.rst +++ b/document/core/appendix/index-types.rst @@ -12,7 +12,7 @@ Category Constructor :ref:`Number type ` |I64| :math:`\hex{7E}` (-2 as |Bs7|) :ref:`Number type ` |F32| :math:`\hex{7D}` (-3 as |Bs7|) :ref:`Number type ` |F64| :math:`\hex{7C}` (-4 as |Bs7|) -:ref:`Number type ` |V128| :math:`\hex{7B}` (-5 as |Bs7|) +:ref:`Vector type ` |V128| :math:`\hex{7B}` (-5 as |Bs7|) (reserved) :math:`\hex{7A}` .. :math:`\hex{71}` :ref:`Reference type ` |FUNCREF| :math:`\hex{70}` (-16 as |Bs7|) :ref:`Reference type ` |EXTERNREF| :math:`\hex{6F}` (-17 as |Bs7|) diff --git a/document/core/binary/conventions.rst b/document/core/binary/conventions.rst index c38df8ba..83c80399 100644 --- a/document/core/binary/conventions.rst +++ b/document/core/binary/conventions.rst @@ -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 ` for :ref:`value types ` is given as follows: + For example, the :ref:`binary grammar ` for :ref:`number types ` 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 ` for :ref:`limits ` is defined as follows: diff --git a/document/core/exec/runtime.rst b/document/core/exec/runtime.rst index 55f1f765..482eea0a 100644 --- a/document/core/exec/runtime.rst +++ b/document/core/exec/runtime.rst @@ -10,6 +10,7 @@ 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: @@ -17,7 +18,7 @@ Runtime Structure Values ~~~~~~ -WebAssembly computations manipulate *values* of either the five basic :ref:`number types `, i.e., :ref:`integers ` and :ref:`floating-point data ` of 32 or 64 bit width each and :ref:`vector data ` of 128 bit width, or of :ref:`reference type `. +WebAssembly computations manipulate *values* of either the four basic :ref:`number types `, i.e., :ref:`integers ` and :ref:`floating-point data ` of 32 or 64 bit width each, of :ref:`vectors ` of 128 bit width, or of :ref:`reference type `. 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. @@ -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:: diff --git a/document/core/intro/overview.rst b/document/core/intro/overview.rst index 3352a6e5..dbe0b466 100644 --- a/document/core/intro/overview.rst +++ b/document/core/intro/overview.rst @@ -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. @@ -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 above, 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 diff --git a/document/core/text/conventions.rst b/document/core/text/conventions.rst index 4acc9210..ddcd8e78 100644 --- a/document/core/text/conventions.rst +++ b/document/core/text/conventions.rst @@ -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 ` is allowed in any place where the grammar contains spaces. The productions defining :ref:`lexical syntax ` and the syntax of :Ref:`values ` are considered lexical, all others are syntactic. .. note:: - For example, the :ref:`textual grammar ` for :ref:`value types ` is given as follows: + For example, the :ref:`textual grammar ` for :ref:`number types ` 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 ` for :ref:`limits ` is defined as follows: diff --git a/document/core/util/katex b/document/core/util/katex index e751278c..b9deec09 160000 --- a/document/core/util/katex +++ b/document/core/util/katex @@ -1 +1 @@ -Subproject commit e751278cff42fada16dba6df331fda52aaa90f73 +Subproject commit b9deec098f35919b9ad77baa6b11b7593473d488 diff --git a/document/core/util/macros.def b/document/core/util/macros.def index f6a26fba..d66a8d6f 100644 --- a/document/core/util/macros.def +++ b/document/core/util/macros.def @@ -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}} @@ -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}} From 5ef4f9e09cfd6a406416a9e139f7464c2a6d8185 Mon Sep 17 00:00:00 2001 From: Ng Zhi An Date: Thu, 11 Nov 2021 09:35:42 -0800 Subject: [PATCH 2/3] Remove "above" --- document/core/intro/overview.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/document/core/intro/overview.rst b/document/core/intro/overview.rst index dbe0b466..a10a3b54 100644 --- a/document/core/intro/overview.rst +++ b/document/core/intro/overview.rst @@ -23,7 +23,7 @@ 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 these basic number types above, there is a single 128 bit wide + 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 From fb1c0484cef19f7ea40684763665911c288caa42 Mon Sep 17 00:00:00 2001 From: Ng Zhi An Date: Thu, 11 Nov 2021 10:18:29 -0800 Subject: [PATCH 3/3] Revert bad change to katex --- document/core/util/katex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/document/core/util/katex b/document/core/util/katex index b9deec09..e751278c 160000 --- a/document/core/util/katex +++ b/document/core/util/katex @@ -1 +1 @@ -Subproject commit b9deec098f35919b9ad77baa6b11b7593473d488 +Subproject commit e751278cff42fada16dba6df331fda52aaa90f73