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

Commit 8c1ea3a

Browse files
committed
Update overview to include table64
See #51
1 parent b54e1cc commit 8c1ea3a

File tree

1 file changed

+72
-7
lines changed

1 file changed

+72
-7
lines changed

proposals/memory64/Overview.md

Lines changed: 72 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ 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 indirect function tables to allow 64-bit indexes.
11+
This addition was made during phase 3 of the proposal and we refer to this
12+
addition as table64.
13+
914
### Implementation Status
1015

1116
- spec interpreter: Done
@@ -16,6 +21,16 @@ currently existing instructions to allow 64-bit indexes.
1621
- binaryen: [Done](https://github.com/WebAssembly/binaryen/pull/3202)
1722
- emscripten: [Done](https://github.com/emscripten-core/emscripten/pull/17803)
1823

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

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

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
70+
* The [memory type][syntax memtype] and [table type][syntax tabletype]
71+
structures are extended to include an index type
5972
- `memtype ::= idxtype limits(type(iv))`
73+
- `tabletype ::= idxtype limits(type(iv)) reftype`
6074
- where
6175
```
6276
type(\i32) = \I32
@@ -66,7 +80,6 @@ have to support 32-bit memory addresses in their ABI.
6680
* The [memarg][syntax memarg] immediate is changed to allow a 64-bit offset
6781
- `memarg ::= {offset u64, align u32}`
6882
69-
7083
### Validation
7184
7285
* Index types are classified by their value range:
@@ -79,14 +92,15 @@ have to support 32-bit memory addresses in their ABI.
7992
⊦ i64 : 2**48
8093
```
8194
82-
* [Memory page limits][valid limits] are classified by their index types
95+
* [Memory page limits][valid limits] and [Table entry limits][valid limits] are
96+
classified by their respective index types
8397
- ```
8498
⊦ it : k n <= k (m <= k)? (n < m)?
8599
-------------------------------------------
86100
⊦ { min n, max m? } : it
87101
```
88102
89-
* Memory types are validated accordingly:
103+
* Memory and Table types are validated accordingly:
90104
- ```
91105
⊦ limits : it
92106
--------------
@@ -151,6 +165,56 @@ have to support 32-bit memory addresses in their ABI.
151165
```
152166
- (and similar for memory instructions from other proposals)
153167
168+
* [Table instructions][valid tableinst] are changed to use the index type
169+
- call_indirect x y
170+
- ```
171+
C.tables[x] = it limits t C.types[y] = [t1*] → [t2*]
172+
-------------------------------------------------------
173+
C ⊦ call_indirect x y : [t1* it] → [t2*]
174+
```
175+
- table.get x
176+
- ```
177+
C.tables[x] = it limits t
178+
------------------------------
179+
C ⊦ table.get x : [it] → [t]
180+
```
181+
- table.set x
182+
- ```
183+
C.tables[x] = it limits t
184+
------------------------------
185+
C ⊦ table.set x : [it] → [t]
186+
```
187+
- table.size x
188+
- ```
189+
C.tables[x] = it limits t
190+
------------------------------
191+
C ⊦ table.size x : [it] → [it]
192+
```
193+
- table.grow x
194+
- ```
195+
C.tables[x] = it limits t
196+
-------------------------------
197+
C ⊦ table.grow x : [it] → [it]
198+
```
199+
- table.fill x
200+
- ```
201+
C.tables[x] = it limits t
202+
----------------------------------
203+
C ⊦ tables.fill x : [it t it] → []
204+
```
205+
- table.copy x y
206+
- ```
207+
C.tables[x] = it limits t
208+
----------------------------------
209+
C ⊦ table.copy x : [it it it] → []
210+
```
211+
- table.init x y
212+
- ```
213+
C.tables[x] = it limits t C.elems[y] = ok
214+
-----------------------------------------------
215+
C ⊦ table.init x y : [it i32 i32] → []
216+
```
217+
154218
* The [SIMD proposal][simd] extends `t.load memarg` and `t.store memarg`
155219
above such that `t` may now also be `v128`, which accesses a 16-byte quantity
156220
in memory that is also 16-byte aligned.
@@ -329,6 +393,7 @@ have to support 32-bit memory addresses in their ABI.
329393
[syntax memarg]: https://webassembly.github.io/spec/core/syntax/instructions.html#syntax-memarg
330394
[valid limits]: https://webassembly.github.io/spec/core/valid/types.html#limits
331395
[valid meminst]: https://webassembly.github.io/spec/core/valid/instructions.html#memory-instructions
396+
[valid tableinst]: https://webassembly.github.io/spec/core/valid/instructions.html#table-instructions
332397
[valid data]: https://webassembly.github.io/spec/core/valid/modules.html#data-segments
333398
[exec mem]: https://webassembly.github.io/spec/core/exec/runtime.html#memory-instances
334399
[exec meminst]: https://webassembly.github.io/spec/core/exec/instructions.html#memory-instructions

0 commit comments

Comments
 (0)