Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Merge upstream #26

Merged
merged 56 commits into from
Nov 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
b9668b9
[test] Check that memory is exported/imported with correct min limit …
gumb0 Apr 12, 2021
8b73d00
[spec] Adjust oversight in reversal of br_table validation (#1305)
rossberg Apr 14, 2021
7b270ee
[interpreter] More robust make rule
rossberg Apr 14, 2021
f607ec9
[test] Fix alignment of i32.store instruction (#1312)
gumb0 Apr 14, 2021
e3c1081
[spec] Remove obsolete notes and fix inaccurate side conditions (#1311)
rossberg Apr 21, 2021
c4dd6e3
binary: table instructions can be 1 byte or prefix+u32 (#1320)
ngzhian May 5, 2021
c22bc32
[interpreter] Overdue version bump
rossberg May 6, 2021
e94c07a
[spec] Fix side condition about fresh ids (#1315)
rossberg May 10, 2021
873197e
[spec] Fix various typos in rules (#1321)
rossberg May 10, 2021
6663b9e
[spec] Remove obsolete note about multiple tables.
Ms2ger May 10, 2021
361039b
[test] Revert accidental commenting-out of a test
jblebrun May 10, 2021
a36e851
[js-api] Fix links to the core specification.
Ms2ger May 11, 2021
d97afb2
Fix the Editor metadata format
jyasskin May 11, 2021
6f5a5af
Fix the Editor metadata format
jyasskin May 12, 2021
c681917
Proper markup for ref.func instruction
harpocrates May 13, 2021
8c5432f
[spec] Fix grammar typo (#1328)
theduke May 17, 2021
484bb2b
Factor unreachability tests out of select and br_table (#1329)
titzer Jun 1, 2021
6622327
[spec] Fix type typo (#1333)
rossberg Jun 8, 2021
f9770eb
[js-api] Fix link to HTML.
Ms2ger Jun 23, 2021
5e694c9
[spec] Fix a bunch of minor editorial issues (#1338)
rossberg Jun 28, 2021
2e629bc
Create Github Actions workflow for CI (#1344)
takikawa Jul 16, 2021
725c245
[spec] Fix `table.grow` signature in appendix (#1349)
fitzgen Jul 26, 2021
46cf27c
[CI] Adjust JS/Web API build to use latest bikeshed
takikawa Jul 16, 2021
ab5ad7f
[spec] Fix type of `if` instruction in index (#1350)
Aug 3, 2021
acf5d26
[spec] Fix typos (#1351)
ivan-pan Aug 14, 2021
ed0f019
[js-api] Update CreateBuiltinFunction call for ES changes. (#1337)
Ms2ger Aug 19, 2021
22f7fa4
[interpreter] Minor grammar fix
rossberg Sep 8, 2021
d404d09
[interpreter] Unbreak
rossberg Sep 8, 2021
4353b29
[spec] Fix variable name typos (#1358)
rossberg Sep 8, 2021
994ee7c
Remove outdated table test
gahaas Sep 15, 2021
e6bee70
[test] Sync with wpt.
Ms2ger Sep 15, 2021
6a2b3b2
Add missing import to test
gahaas Sep 16, 2021
f528da2
Add missing import to test [2]
gahaas Sep 16, 2021
ac1bb59
Add action to mirror main to master (#1364)
ngzhian Sep 28, 2021
397399a
[test] Fix binary test (#1367)
rossberg Oct 1, 2021
530d309
Improve parse error message and add null-byte in comments test (#1372)
ngzhian Oct 13, 2021
5893af5
Add tests for using nan patterns outside of script (#1373)
ngzhian Oct 13, 2021
efb35b2
[spec] Fix algorithm (#1375)
rossberg Oct 13, 2021
9b4d86f
[spec] Replace some odd whitespace
rossberg Oct 13, 2021
7f2dc80
[spec] Fix outdated item from br_table validation prose (#1378)
rossberg Oct 14, 2021
6d15d3e
Use main in github workflow (#1380)
ngzhian Oct 14, 2021
5d850a2
Rename "master" to "main" in repository URLs that have switched to "m…
sunfishcode Oct 13, 2021
ee4a6c4
Add integer tests for using nan patterns outside of script (#1379)
ngzhian Oct 21, 2021
09a9540
Update sphinx to 3.5.4 (#1382)
ngzhian Oct 27, 2021
0fd42ae
Import main conf.py in bikeshed/conf.py (#1381)
ngzhian Oct 27, 2021
b506bda
Check that partially-oob stores do not store partial data (#1384)
ngzhian Oct 27, 2021
941c6f3
Upgrade katex to v0.13.19 (#1383)
ngzhian Oct 27, 2021
93054e7
Check all types of partially-oob stores (#1385)
ngzhian Oct 28, 2021
b6307dc
Upgrade to Sphinx 4.0.0 (#1387)
ngzhian Oct 29, 2021
932fbf8
[spec] Remove outdated footnote (#1389)
devsnek Nov 2, 2021
3ae76b1
Only include ref links to index in multi-page html (#1388)
ngzhian Nov 2, 2021
e87021b
Fix html_last_updated_fmt
ngzhian Nov 2, 2021
25ffaea
[spec] Add reference types to overview (#1394)
rossberg Nov 11, 2021
eae4abc
[interpreter] Remove use of physical equality on characters (#1396)
hanshoglund Nov 16, 2021
f5a260a
Merge SIMD proposal (#1391)
ngzhian Nov 18, 2021
6711650
Merge branch 'main' of https://github.com/WebAssembly/spec into main
rossberg Nov 19, 2021
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
85 changes: 85 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
ref-interpreter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup OCaml
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: 4.12.x
- run: opam install --yes ocamlbuild.0.14.0
- run: cd interpreter && opam exec make all

build-js-api-spec:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: pip install bikeshed && bikeshed update
- run: bikeshed spec "document/js-api/index.bs" "document/js-api/index.html"
- uses: actions/upload-artifact@v2
with:
name: js-api-rendered
path: document/js-api/index.html

build-web-api-spec:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: pip install bikeshed && bikeshed update
- run: bikeshed spec "document/web-api/index.bs" "document/web-api/index.html"
- uses: actions/upload-artifact@v2
with:
name: web-api-rendered
path: document/web-api/index.html

build-core-spec:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: "recursive"
- run: pip install bikeshed && bikeshed update
- run: pip install six
- run: sudo apt-get update -y && sudo apt-get install -y latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended
- run: pip install sphinx==4.0.0
- run: cd document/core && make all
- uses: actions/upload-artifact@v2
with:
name: core-api-rendered
path: document/core/_build/html

publish-spec:
runs-on: ubuntu-latest
needs: [build-core-spec, build-js-api-spec, build-web-api-spec]
steps:
- uses: actions/checkout@v2
- run: mkdir _output && cp document/index.html _output/index.html
- uses: actions/download-artifact@v2
with:
name: js-api-rendered
path: _output/js-api
- uses: actions/download-artifact@v2
with:
name: web-api-rendered
path: _output/web-api
- uses: actions/download-artifact@v2
with:
name: core-api-rendered
path: _output/core
- name: Publish HTML to GitHub Pages
if: github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v3
with:
publish_dir: ./_output
github_token: ${{ secrets.GITHUB_TOKEN }}
17 changes: 17 additions & 0 deletions .github/workflows/mirror.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
on:
push:
branches:
- 'main'

jobs:
mirror_job:
runs-on: ubuntu-latest
name: Mirror main branch to master branch
steps:
- name: Mirror action step
id: mirror
uses: google/mirror-branch-action@v1.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
source: 'main'
dest: 'master'
42 changes: 0 additions & 42 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
Interested in participating? Please follow
[the same contributing guidelines as the design repository][].

[the same contributing guidelines as the design repository]: https://github.com/WebAssembly/design/blob/master/Contributing.md
[the same contributing guidelines as the design repository]: https://github.com/WebAssembly/design/blob/main/Contributing.md

Also, please be sure to read [the README.md](README.md) for this repository.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build Status](https://travis-ci.org/WebAssembly/multi-memory.svg?branch=master)](https://travis-ci.org/WebAssembly/multi-memory)
![Build Status](https://github.com/WebAssembly/multi-memory/actions/workflows/main.yml/badge.svg)

# Multi Memory Proposal for WebAssembly

Expand Down
Binary file removed deploy_key.enc
Binary file not shown.
2 changes: 1 addition & 1 deletion document/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pipenv shell
Install Python dependencies:

```
pipenv install Sphinx==3.5.2
pipenv install Sphinx==4.0.0
```

### Checking out the repository
Expand Down
56 changes: 27 additions & 29 deletions document/core/appendix/algorithm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ Types are representable as an enumeration.

.. code-block:: pseudo

type val_type = I32 | I64 | F32 | F64 | Funcref | Externref
type val_type = I32 | I64 | F32 | F64 | V128 | Funcref | Externref

func is_num(t : val_type | Unknown) : bool =
return t = I32 || t = I64 || t = F32 || t = F64 || t = Unknown
return t = I32 || t = I64 || t = F32 || t = F64 || t = V128 || t = Unknown

func is_ref(t : val_type | Unknown) : bool =
return t = Funcref || t = Externref || t = Unknown
Expand Down Expand Up @@ -75,15 +75,13 @@ However, these variables are not manipulated directly by the main checking funct

func pop_val(expect : val_type | Unknown) : val_type | Unknown =
let actual = pop_val()
if (actual = Unknown) return expect
if (expect = Unknown) return actual
error_if(actual =/= expect)
error_if(actual =/= expect && actual =/= Unknown && expect =/= Unknown)
return actual

func push_vals(types : list(val_type)) = foreach (t in types) push_val(t)
func pop_vals(types : list(val_type)) : list(val_type) =
var popped := []
foreach (t in reverse(types)) popped.append(pop_val(t))
foreach (t in reverse(types)) popped.prepend(pop_val(t))
return popped

Pushing an operand value simply pushes the respective type to the value stack.
Expand All @@ -109,24 +107,24 @@ The control stack is likewise manipulated through auxiliary functions:
.. code-block:: pseudo

func push_ctrl(opcode : opcode, in : list(val_type), out : list(val_type)) =
 let frame = ctrl_frame(opcode, in, out, vals.size(), false)
  ctrls.push(frame)
let frame = ctrl_frame(opcode, in, out, vals.size(), false)
ctrls.push(frame)
push_vals(in)

func pop_ctrl() : ctrl_frame =
 error_if(ctrls.is_empty())
 let frame = ctrls[0]
  pop_vals(frame.end_types)
  error_if(vals.size() =/= frame.height)
error_if(ctrls.is_empty())
let frame = ctrls[0]
pop_vals(frame.end_types)
error_if(vals.size() =/= frame.height)
ctrls.pop()
  return frame
return frame

func label_types(frame : ctrl_frame) : list(val_types) =
return (if frame.opcode == loop then frame.start_types else frame.end_types)

func unreachable() =
  vals.resize(ctrls[0].height)
  ctrls[0].unreachable := true
vals.resize(ctrls[0].height)
ctrls[0].unreachable := true

Pushing a control frame takes the types of the label and result values.
It allocates a new frame record recording them along with the current height of the operand stack and marks the block as reachable.
Expand Down Expand Up @@ -184,8 +182,8 @@ Other instructions are checked in a similar manner.
pop_val(t)
push_val(t)

   case (unreachable)
      unreachable()
case (unreachable)
unreachable()

case (block t1*->t2*)
pop_vals([t1*])
Expand All @@ -210,26 +208,26 @@ Other instructions are checked in a similar manner.
push_ctrl(else, frame.start_types, frame.end_types)

case (br n)
     error_if(ctrls.size() < n)
      pop_vals(label_types(ctrls[n]))
      unreachable()
error_if(ctrls.size() < n)
pop_vals(label_types(ctrls[n]))
unreachable()

case (br_if n)
     error_if(ctrls.size() < n)
error_if(ctrls.size() < n)
pop_val(I32)
      pop_vals(label_types(ctrls[n]))
      push_vals(label_types(ctrls[n]))
pop_vals(label_types(ctrls[n]))
push_vals(label_types(ctrls[n]))

   case (br_table n* m)
case (br_table n* m)
pop_val(I32)
      error_if(ctrls.size() < m)
error_if(ctrls.size() < m)
let arity = label_types(ctrls[m]).size()
      foreach (n in n*)
        error_if(ctrls.size() < n)
        error_if(label_types(ctrls[n]).size() =/= arity)
foreach (n in n*)
error_if(ctrls.size() < n)
error_if(label_types(ctrls[n]).size() =/= arity)
push_vals(pop_vals(label_types(ctrls[n])))
pop_vals(label_types(ctrls[m]))
      unreachable()
unreachable()


.. note::
Expand Down
47 changes: 42 additions & 5 deletions document/core/appendix/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,54 @@ Added instructions that modify ranges of memory or table entries [#proposal-reft
* Active data and element segments boundaries are no longer checked at compile time but may trap instead


.. index:: instructions, SIMD, value type, vector type

Vector instructions
...................

Added vector type and instructions that manipulate multiple numeric values in parallel (also known as *SIMD*, single instruction multiple data) [#proposal-vectype]_

* New :ref:`value type <syntax-valtype>`: |V128|

* New :ref:`memory instructions <syntax-instr-memory>`: :math:`\K{v128.}\LOAD`, :math:`\K{v128.}\LOAD{}\!N\!\K{x}\!M\!\K{\_}\sx`, :math:`\K{v128.}\LOAD{}N\K{\_zero}`, :math:`\K{v128.}\LOAD{}N\K{\_splat}`, :math:`\K{v128.}\LOAD{}N\K{\_lane}`, :math:`\K{v128.}\STORE`, :math:`\K{v128.}\STORE{}N\K{\_lane}`

* New constant :ref:`vector instruction <syntax-instr-vec>`: :math:`\K{v128.}\VCONST`

* New unary :ref:`vector instructions <syntax-instr-vec>`: :math:`\K{v128.not}`, :math:`\K{i}\!N\!\K{x}\!M\!\K{.abs}`, :math:`\K{i}\!N\!\K{x}\!M\!\K{.neg}`, :math:`\K{i8x16.popcnt}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.abs}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.neg}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.sqrt}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.ceil}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.floor}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.trunc}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.nearest}`

* New binary :ref:`vector instructions <syntax-instr-vec>`: :math:`\K{v128.and}`, :math:`\K{v128.andnot}`, :math:`\K{v128.or}`, :math:`\K{v128.xor}`, :math:`\K{i}\!N\!\K{x}\!M\!\K{.add}`, :math:`\K{i}\!N\!\K{x}\!M\!\K{.sub}`, :math:`\K{i}\!N\!\K{x}\!M\!\K{.mul}`, :math:`\K{i}\!N\!\K{x}\!M\!\K{.add\_sat\_}\sx`, :math:`\K{i}\!N\!\K{x}\!M\!\K{.sub\_sat\_}\sx`, :math:`\K{i}\!N\!\K{x}\!M\!\K{.min\_}\sx`, :math:`\K{i}\!N\!\K{x}\!M\!\K{.max\_}\sx`, :math:`\K{i}\!N\!\K{x}\!M\!\K{.shl}`, :math:`\K{i}\!N\!\K{x}\!M\!\K{.shr\_}\sx`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.add}`, :math:`\K{i}\!N\!\K{x}\!M\!\K{.extmul\_}\half\K{\_i}\!N'\!\K{x}\!M'\!\K{\_}\sx`, :math:`\K{i16x8.q15mulr\_sat\_s}`, :math:`\K{i32x4.dot\_i16x8\_s}`, :math:`\K{i16x8.extadd\_pairwise\_i8x16\_}\sx`, :math:`\K{i32x4.extadd\_pairwise\_i16x8\_}\sx`, :math:`\K{i8x16.avgr\_u}`, :math:`\K{i16x8.avgr\_u}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.sub}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.mul}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.div}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.min}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.max}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.pmin}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.pmax}`

* New ternary :ref:`vector instruction <syntax-instr-vec>`: :math:`\K{v128.bitselect}`

* New test :ref:`vector instructions <syntax-instr-vec>`: :math:`\K{v128.any\_true}`, :math:`\K{i}\!N\!\K{x}\!M\!\K{.all\_true}`

* New relational :ref:`vector instructions <syntax-instr-vec>`: :math:`\K{i}\!N\!\K{x}\!M\!\K{.eq}`, :math:`\K{i}\!N\!\K{x}\!M\!\K{.ne}`, :math:`\K{i}\!N\!\K{x}\!M\!\K{.lt\_}\sx`, :math:`\K{i}\!N\!\K{x}\!M\!\K{.gt\_}\sx`, :math:`\K{i}\!N\!\K{x}\!M\!\K{.le\_}\sx`, :math:`\K{i}\!N\!\K{x}\!M\!\K{.ge\_}\sx`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.eq}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.ne}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.lt}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.gt}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.le}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.ge}`

* New conversion :ref:`vector instructions <syntax-instr-vec>`::math:`\K{i32x4.trunc\_sat\_f32x4\_}\sx`, :math:`\K{i32x4.trunc\_sat\_f64x2\_}\sx\K{\_zero}`, :math:`\K{f32x4.convert\_i32x4\_}\sx`, :math:`\K{f32x4.demote\_f64x2\_zero}`, :math:`\K{f64x2.convert\_low\_i32x4\_}\sx`, :math:`\K{f64x2.promote\_low\_f32x4}`

* New lane access :ref:`vector instructions <syntax-instr-vec>`: :math:`\K{i}\!N\!\K{x}\!M\!\K{.extract\_lane\_}\sx^?`, :math:`\K{i}\!N\!\K{x}\!M\!\K{.replace\_lane}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.extract\_lane}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.replace\_lane}`

* New lane splitting/combining :ref:`vector instructions <syntax-instr-vec>`: :math:`\K{i}\!N\!\K{x}\!M\!\K{.extend\_}\half\K{\_i}\!N'\!\K{x}\!M'\!\K{\_}\sx`, :math:`\K{i8x16.narrow\_i16x8\_}\sx`, :math:`\K{i16x8.narrow\_i32x4\_}\sx`

* New byte reordering :ref:`vector instructions <syntax-instr-vec>`: :math:`\K{i8x16.shuffle}`, :math:`\K{i8x16.swizzle}`

* New injection/projection :ref:`vector instructions <syntax-instr-vec>`: :math:`\K{i}\!N\!\K{x}\!M\!\K{.splat}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.splat}`, :math:`\K{i}\!N\!\K{x}\!M\!\K{.bitmask}`


.. [#proposal-signext]
https://github.com/WebAssembly/spec/tree/master/proposals/sign-extension-ops/
https://github.com/WebAssembly/spec/tree/main/proposals/sign-extension-ops/

.. [#proposal-cvtsat]
https://github.com/WebAssembly/spec/tree/master/proposals/nontrapping-float-to-int-conversion/
https://github.com/WebAssembly/spec/tree/main/proposals/nontrapping-float-to-int-conversion/

.. [#proposal-multivalue]
https://github.com/WebAssembly/spec/tree/master/proposals/multi-value/
https://github.com/WebAssembly/spec/tree/main/proposals/multi-value/

.. [#proposal-reftype]
https://github.com/WebAssembly/spec/tree/master/proposals/reference-types/
https://github.com/WebAssembly/spec/tree/main/proposals/reference-types/

.. [#proposal-bulk]
https://github.com/WebAssembly/spec/tree/master/proposals/bulk-memory-operations/
https://github.com/WebAssembly/spec/tree/main/proposals/bulk-memory-operations/

.. [#proposal-vectype]
https://github.com/WebAssembly/spec/tree/main/proposals/simd/
Loading