Skip to content

Commit a9e6111

Browse files
committed
Merge branch 'main' of github.com:WebAssembly/spec into wasmfx-merge
2 parents a9ec313 + 724b3e7 commit a9e6111

File tree

6 files changed

+44
-26
lines changed

6 files changed

+44
-26
lines changed

document/core/exec/instructions.rst

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1844,31 +1844,31 @@ Most other vector instructions are defined in terms of numeric operators that ar
18441844

18451845
1. Assert: due to :ref:`validation <valid-vec-replace_lane>`, :math:`x < \dim(\shape)`.
18461846

1847-
2. Let :math:`t_1` be the type :math:`\unpacked(\shape)`.
1847+
2. Let :math:`t_2` be the type :math:`\unpacked(\shape)`.
18481848

18491849
3. Assert: due to :ref:`validation <valid-vec-replace_lane>`, a value of :ref:`value type <syntax-valtype>` :math:`t_1` is on the top of the stack.
18501850

1851-
4. Pop the value :math:`t_1.\CONST~c_1` from the stack.
1851+
4. Pop the value :math:`t_2.\CONST~c_2` from the stack.
18521852

18531853
5. Assert: due to :ref:`validation <valid-vec-replace_lane>`, a value of :ref:`value type <syntax-valtype>` |V128| is on the top of the stack.
18541854

1855-
6. Pop the value :math:`\V128.\VCONST~c_2` from the stack.
1855+
6. Pop the value :math:`\V128.\VCONST~c_1` from the stack.
18561856

1857-
7. Let :math:`i^\ast` be the result of computing :math:`\lanes_{\shape}(c_2)`.
1857+
7. Let :math:`i^\ast` be the result of computing :math:`\lanes_{\shape}(c_1)`.
18581858

1859-
8. Let :math:`c` be the result of computing :math:`\lanes^{-1}_{\shape}(i^\ast \with [x] = c_1)`.
1859+
8. Let :math:`c` be the result of computing :math:`\lanes^{-1}_{\shape}(i^\ast \with [x] = c_2)`.
18601860

18611861
9. Push :math:`\V128.\VCONST~c` on the stack.
18621862

18631863
.. math::
18641864
\begin{array}{l}
18651865
\begin{array}{lcl@{\qquad}l}
1866-
(t_1\K{.}\CONST~c_1)~(\V128\K{.}\VCONST~c_2)~(\shape\K{.}\REPLACELANE~x) &\stepto& (\V128\K{.}\VCONST~c)
1866+
(\V128\K{.}\VCONST~c_1)~(t_2\K{.}\CONST~c_2)~(\shape\K{.}\REPLACELANE~x) &\stepto& (\V128\K{.}\VCONST~c)
18671867
\end{array}
18681868
\\ \qquad
18691869
\begin{array}[t]{@{}r@{~}l@{}}
1870-
(\iff & i^\ast = \lanes_{\shape}(c_2) \\
1871-
\wedge & c = \lanes^{-1}_{\shape}(i^\ast \with [x] = c_1))
1870+
(\iff & i^\ast = \lanes_{\shape}(c_1) \\
1871+
\wedge & c = \lanes^{-1}_{\shape}(i^\ast \with [x] = c_2))
18721872
\end{array}
18731873
\end{array}
18741874
@@ -2168,8 +2168,8 @@ where:
21682168
\end{array}
21692169
21702170
2171-
:math:`t_2\K{x}N\K{.}\vcvtop\K{\_}t_1\K{x}M\K{\_}\sx\K{\_zero}`
2172-
...............................................................
2171+
:math:`t_2\K{x}N\K{.}\vcvtop\K{\_}t_1\K{x}M\K{\_}\sx^?\K{\_zero}`
2172+
.................................................................
21732173

21742174
1. Assert: due to :ref:`syntax <syntax-instr-vec>`, :math:`N = 2 \cdot M`.
21752175

@@ -2179,7 +2179,7 @@ where:
21792179

21802180
4. Let :math:`i^\ast` be the result of computing :math:`\lanes_{t_1\K{x}M}(c_1)`.
21812181

2182-
5. Let :math:`j^\ast` be the result of computing :math:`\vcvtop^{\sx}_{|t_1|,|t_2|}(i^\ast)`.
2182+
5. Let :math:`j^\ast` be the result of computing :math:`\vcvtop^{\sx^?}_{|t_1|,|t_2|}(i^\ast)`.
21832183

21842184
6. Let :math:`k^\ast` be the concatenation of the two sequences :math:`j^\ast` and :math:`0^M`.
21852185

@@ -2190,11 +2190,11 @@ where:
21902190
.. math::
21912191
\begin{array}{l}
21922192
\begin{array}{lcl@{\qquad}l}
2193-
(\V128\K{.}\VCONST~c_1)~t_2\K{x}N\K{.}\vcvtop\K{\_}t_1\K{x}M\K{\_}\sx\K{\_zero} &\stepto& (\V128\K{.}\VCONST~c) \\
2193+
(\V128\K{.}\VCONST~c_1)~t_2\K{x}N\K{.}\vcvtop\K{\_}t_1\K{x}M\K{\_}\sx^?\K{\_zero} &\stepto& (\V128\K{.}\VCONST~c) \\
21942194
\end{array}
21952195
\\ \qquad
21962196
\begin{array}[t]{@{}r@{~}l@{}}
2197-
(\iff & c = \lanes^{-1}_{t_2\K{x}N}(\vcvtop^{\sx}_{|t_1|,|t_2|}(\lanes_{t_1\K{x}M}(c_1))~0^M))
2197+
(\iff & c = \lanes^{-1}_{t_2\K{x}N}(\vcvtop^{\sx^?}_{|t_1|,|t_2|}(\lanes_{t_1\K{x}M}(c_1))~0^M))
21982198
\end{array}
21992199
\end{array}
22002200
@@ -2273,7 +2273,7 @@ where:
22732273

22742274
10. Let :math:`k_2^\ast` be the result of computing :math:`\extend^{\sx}_{|t_1|,|t_2|}(j_2^\ast)`.
22752275

2276-
11. Let :math:`k^\ast` be the result of computing :math:`\imul_{t_2\K{x}N}(k_1^\ast, k_2^\ast)`.
2276+
11. Let :math:`k^\ast` be the result of computing :math:`\imul_{|t_2|}(k_1^\ast, k_2^\ast)`.
22772277

22782278
12. Let :math:`c` be the result of computing :math:`\lanes^{-1}_{t_2\K{x}N}(k^\ast)`.
22792279

@@ -2287,7 +2287,7 @@ where:
22872287
\begin{array}[t]{@{}r@{~}l@{}}
22882288
(\iff & i^\ast = \lanes_{t_1\K{x}M}(c_1)[\half(0, N) \slice N] \\
22892289
\wedge & j^\ast = \lanes_{t_1\K{x}M}(c_2)[\half(0, N) \slice N] \\
2290-
\wedge & c = \lanes^{-1}_{t_2\K{x}N}(\imul_{t_2\K{x}N}(\extend^{\sx}_{|t_1|,|t_2|}(i^\ast), \extend^{\sx}_{|t_1|,|t_2|}(j^\ast))))
2290+
\wedge & c = \lanes^{-1}_{t_2\K{x}N}(\imul_{|t_2|}(\extend^{\sx}_{|t_1|,|t_2|}(i^\ast), \extend^{\sx}_{|t_1|,|t_2|}(j^\ast))))
22912291
\end{array}
22922292
22932293
where:
@@ -2314,7 +2314,7 @@ where:
23142314

23152315
5. Let :math:`(j_1~j_2)^\ast` be the result of computing :math:`\extend^{\sx}_{|t_1|,|t_2|}(i^\ast)`.
23162316

2317-
6. Let :math:`k^\ast` be the result of computing :math:`\iadd_{N}(j_1, j_2)^\ast`.
2317+
6. Let :math:`k^\ast` be the result of computing :math:`\iadd_{|t_2|}(j_1, j_2)^\ast`.
23182318

23192319
7. Let :math:`c` be the result of computing :math:`\lanes^{-1}_{t_2\K{x}N}(k^\ast)`.
23202320

@@ -2328,7 +2328,7 @@ where:
23282328
\\ \qquad
23292329
\begin{array}[t]{@{}r@{~}l@{}}
23302330
(\iff & (i_1~i_2)^\ast = \extend^{\sx}_{|t_1|,|t_2|}(\lanes_{t_1\K{x}M}(c_1)) \\
2331-
\wedge & j^\ast = \iadd_{N}(i_1, i_2)^\ast \\
2331+
\wedge & j^\ast = \iadd_{|t_2|}(i_1, i_2)^\ast \\
23322332
\wedge & c = \lanes^{-1}_{t_2\K{x}N}(j^\ast))
23332333
\end{array}
23342334
\end{array}

interpreter/script/js.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ let spectest = {
3333
print_f64: console.log.bind(console),
3434
global_i32: 666,
3535
global_i64: 666n,
36-
global_f32: 666,
37-
global_f64: 666,
36+
global_f32: 666.6,
37+
global_f64: 666.6,
3838
table: new WebAssembly.Table({initial: 10, maximum: 20, element: 'anyfunc'}),
3939
memory: new WebAssembly.Memory({initial: 1, maximum: 2})
4040
};

test/core/binary.wast

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,8 +1085,19 @@
10851085
(assert_malformed
10861086
(module binary
10871087
"\00asm" "\01\00\00\00"
1088-
"\01\04\01" ;; type section
1088+
"\01\25\0c" ;; type section
10891089
"\60\00\00" ;; type 0
1090+
"\60\00\00" ;; type 1
1091+
"\60\00\00" ;; type 2
1092+
"\60\00\00" ;; type 3
1093+
"\60\00\00" ;; type 4
1094+
"\60\00\00" ;; type 5
1095+
"\60\00\00" ;; type 6
1096+
"\60\00\00" ;; type 7
1097+
"\60\00\00" ;; type 8
1098+
"\60\00\00" ;; type 9
1099+
"\60\00\00" ;; type 10
1100+
"\60\00\00" ;; type 11
10901101
"\03\02\01\00" ;; func section
10911102
"\0a\13\01" ;; code section
10921103
"\11\00" ;; func 0
@@ -1097,8 +1108,9 @@
10971108
"\0e\01" ;; br_table with inconsistent target count (1 declared, 2 given)
10981109
"\00" ;; break depth 0
10991110
"\01" ;; break depth 1
1100-
"\02" ;; break depth for default
1101-
"\0b\0b\0b" ;; end
1111+
"\02" ;; break depth for default, interpreted as a block
1112+
"\0b" ;; end, interpreted as type 11 for the block
1113+
"\0b\0b" ;; end
11021114
)
11031115
"unexpected end of section or function"
11041116
)

test/core/imports.wast

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,12 +238,18 @@
238238
(func (export "get-1") (result i32) (global.get 1))
239239
(func (export "get-x") (result i32) (global.get $x))
240240
(func (export "get-y") (result i32) (global.get $y))
241+
(func (export "get-4") (result i64) (global.get 4))
242+
(func (export "get-5") (result f32) (global.get 5))
243+
(func (export "get-6") (result f64) (global.get 6))
241244
)
242245

243246
(assert_return (invoke "get-0") (i32.const 666))
244247
(assert_return (invoke "get-1") (i32.const 666))
245248
(assert_return (invoke "get-x") (i32.const 666))
246249
(assert_return (invoke "get-y") (i32.const 666))
250+
(assert_return (invoke "get-4") (i64.const 666))
251+
(assert_return (invoke "get-5") (f32.const 666.6))
252+
(assert_return (invoke "get-6") (f64.const 666.6))
247253

248254
(module (import "test" "global-i32" (global i32)))
249255
(module (import "test" "global-f32" (global f32)))

test/harness/async_index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ function reinitializeRegistry() {
100100
print_f64: console.log.bind(console),
101101
global_i32: 666,
102102
global_i64: 666n,
103-
global_f32: 666,
104-
global_f64: 666,
103+
global_f32: 666.6,
104+
global_f64: 666.6,
105105
table: new WebAssembly.Table({
106106
initial: 10,
107107
maximum: 20,

test/harness/sync_index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ function reinitializeRegistry() {
110110
print_f64: console.log.bind(console),
111111
global_i32: 666,
112112
global_i64: 666n,
113-
global_f32: 666,
114-
global_f64: 666,
113+
global_f32: 666.6,
114+
global_f64: 666.6,
115115
table: new WebAssembly.Table({initial: 10, maximum: 20, element: 'anyfunc'}),
116116
memory: new WebAssembly.Memory({initial: 1, maximum: 2})
117117
};

0 commit comments

Comments
 (0)