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

Commit d5969ed

Browse files
authored
Update overview to include table64 (#52)
See #51
1 parent b54e1cc commit d5969ed

File tree

1 file changed

+71
-7
lines changed

1 file changed

+71
-7
lines changed

proposals/memory64/Overview.md

Lines changed: 71 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ This page describes a proposal to support linear memory of sizes larger than
66
2<sup>32</sup> bits. It provides no new instructions, but instead extends the
77
currently existing instructions to allow 64-bit indexes.
88

9+
In addition, in order to support source languages with 64-bit pointer width,
10+
this proposal also extends tables to allow 64-bit indexes. This addition was
11+
made during phase 3 of the proposal and we refer to this addition as "table64".
12+
913
### Implementation Status
1014

1115
- spec interpreter: Done
@@ -16,6 +20,16 @@ currently existing instructions to allow 64-bit indexes.
1620
- binaryen: [Done](https://github.com/WebAssembly/binaryen/pull/3202)
1721
- emscripten: [Done](https://github.com/emscripten-core/emscripten/pull/17803)
1822

23+
### Implementation Status (table64)
24+
25+
- spec interpreter: -
26+
- v8/chrome: -
27+
- Firefox: -
28+
- Safari: -
29+
- wabt: -
30+
- binaryen: -
31+
- emscripten: -
32+
1933
## Motivation
2034

2135
[WebAssembly linear memory objects][memory object] have sizes measured in
@@ -52,11 +66,10 @@ have to support 32-bit memory addresses in their ABI.
5266
- `limits(iv) ::= {min iv, max iv?}`
5367
The parameter is omitted where it is immaterial.
5468

55-
* The [table type][syntax tabletype] continues to use i32 indices
56-
- `tabletype ::= limits(i32) elemtype`
57-
58-
* The [memory type][syntax memtype] structure is extended to have an index type
69+
* The [memory type][syntax memtype] and [table type][syntax tabletype]
70+
structures are extended to include an index type
5971
- `memtype ::= idxtype limits(type(iv))`
72+
- `tabletype ::= idxtype limits(type(iv)) reftype`
6073
- where
6174
```
6275
type(\i32) = \I32
@@ -66,7 +79,6 @@ have to support 32-bit memory addresses in their ABI.
6679
* The [memarg][syntax memarg] immediate is changed to allow a 64-bit offset
6780
- `memarg ::= {offset u64, align u32}`
6881
69-
7082
### Validation
7183
7284
* Index types are classified by their value range:
@@ -79,14 +91,15 @@ have to support 32-bit memory addresses in their ABI.
7991
⊦ i64 : 2**48
8092
```
8193
82-
* [Memory page limits][valid limits] are classified by their index types
94+
* [Memory page limits][valid limits] and [Table entry limits][valid limits] are
95+
classified by their respective index types
8396
- ```
8497
⊦ it : k n <= k (m <= k)? (n < m)?
8598
-------------------------------------------
8699
⊦ { min n, max m? } : it
87100
```
88101
89-
* Memory types are validated accordingly:
102+
* Memory and Table types are validated accordingly:
90103
- ```
91104
⊦ limits : it
92105
--------------
@@ -151,6 +164,56 @@ have to support 32-bit memory addresses in their ABI.
151164
```
152165
- (and similar for memory instructions from other proposals)
153166
167+
* [Table instructions][valid tableinst] are changed to use the index type
168+
- call_indirect x y
169+
- ```
170+
C.tables[x] = it limits t C.types[y] = [t1*] → [t2*]
171+
-------------------------------------------------------
172+
C ⊦ call_indirect x y : [t1* it] → [t2*]
173+
```
174+
- table.get x
175+
- ```
176+
C.tables[x] = it limits t
177+
------------------------------
178+
C ⊦ table.get x : [it] → [t]
179+
```
180+
- table.set x
181+
- ```
182+
C.tables[x] = it limits t
183+
------------------------------
184+
C ⊦ table.set x : [it] → [t]
185+
```
186+
- table.size x
187+
- ```
188+
C.tables[x] = it limits t
189+
------------------------------
190+
C ⊦ table.size x : [] → [it]
191+
```
192+
- table.grow x
193+
- ```
194+
C.tables[x] = it limits t
195+
-------------------------------
196+
C ⊦ table.grow x : [it] → [it]
197+
```
198+
- table.fill x
199+
- ```
200+
C.tables[x] = it limits t
201+
----------------------------------
202+
C ⊦ tables.fill x : [it t it] → []
203+
```
204+
- table.copy x y
205+
- ```
206+
C.tables[x] = it limits t
207+
----------------------------------
208+
C ⊦ table.copy x : [it it it] → []
209+
```
210+
- table.init x y
211+
- ```
212+
C.tables[x] = it limits t C.elems[y] = ok
213+
-----------------------------------------------
214+
C ⊦ table.init x y : [it i32 i32] → []
215+
```
216+
154217
* The [SIMD proposal][simd] extends `t.load memarg` and `t.store memarg`
155218
above such that `t` may now also be `v128`, which accesses a 16-byte quantity
156219
in memory that is also 16-byte aligned.
@@ -329,6 +392,7 @@ have to support 32-bit memory addresses in their ABI.
329392
[syntax memarg]: https://webassembly.github.io/spec/core/syntax/instructions.html#syntax-memarg
330393
[valid limits]: https://webassembly.github.io/spec/core/valid/types.html#limits
331394
[valid meminst]: https://webassembly.github.io/spec/core/valid/instructions.html#memory-instructions
395+
[valid tableinst]: https://webassembly.github.io/spec/core/valid/instructions.html#table-instructions
332396
[valid data]: https://webassembly.github.io/spec/core/valid/modules.html#data-segments
333397
[exec mem]: https://webassembly.github.io/spec/core/exec/runtime.html#memory-instances
334398
[exec meminst]: https://webassembly.github.io/spec/core/exec/instructions.html#memory-instructions

0 commit comments

Comments
 (0)