summaryrefslogtreecommitdiff
path: root/test/spec
diff options
context:
space:
mode:
authorThomas Lively <7121787+tlively@users.noreply.github.com>2019-01-07 13:24:58 -0800
committerGitHub <noreply@github.com>2019-01-07 13:24:58 -0800
commit7d94900ded8e2e5ce8ef8ee2687528531d8f2a97 (patch)
treed8bba13d306b0c5ecba384384e602e6cccc83015 /test/spec
parent6f91af190effd7b8a5969314dd4fb3d2ec540524 (diff)
downloadbinaryen-7d94900ded8e2e5ce8ef8ee2687528531d8f2a97.tar.gz
binaryen-7d94900ded8e2e5ce8ef8ee2687528531d8f2a97.tar.bz2
binaryen-7d94900ded8e2e5ce8ef8ee2687528531d8f2a97.zip
Massive renaming (#1855)
Automated renaming according to https://github.com/WebAssembly/spec/issues/884#issuecomment-426433329.
Diffstat (limited to 'test/spec')
-rw-r--r--test/spec/address.wast28
-rw-r--r--test/spec/block.wast28
-rw-r--r--test/spec/br.wast18
-rw-r--r--test/spec/br_if.wast34
-rw-r--r--test/spec/br_table.wast70
-rw-r--r--test/spec/call.wast42
-rw-r--r--test/spec/call_indirect.wast84
-rw-r--r--test/spec/conversions.wast66
-rw-r--r--test/spec/endianness.wast66
-rw-r--r--test/spec/exports.wast34
-rw-r--r--test/spec/f32.load32.fail.wast2
-rw-r--r--test/spec/f32.load64.fail.wast2
-rw-r--r--test/spec/f32.store32.fail.wast2
-rw-r--r--test/spec/f32.store64.fail.wast2
-rw-r--r--test/spec/f32.wast28
-rw-r--r--test/spec/f32_cmp.wast12
-rw-r--r--test/spec/f64.load32.fail.wast2
-rw-r--r--test/spec/f64.load64.fail.wast2
-rw-r--r--test/spec/f64.store32.fail.wast2
-rw-r--r--test/spec/f64.store64.fail.wast2
-rw-r--r--test/spec/f64.wast28
-rw-r--r--test/spec/f64_cmp.wast12
-rw-r--r--test/spec/fac.wast46
-rw-r--r--test/spec/float_exprs.wast578
-rw-r--r--test/spec/float_literals.wast120
-rw-r--r--test/spec/float_misc.wast58
-rw-r--r--test/spec/forward.wast8
-rw-r--r--test/spec/func-local-before-result.fail.wast2
-rw-r--r--test/spec/func-result-before-param.fail.wast2
-rw-r--r--test/spec/func.wast94
-rw-r--r--test/spec/func_ptrs.wast22
-rw-r--r--test/spec/get_local.wast84
-rw-r--r--test/spec/globals.wast32
-rw-r--r--test/spec/i32.load32_s.fail.wast2
-rw-r--r--test/spec/i32.load32_u.fail.wast2
-rw-r--r--test/spec/i32.load64_s.fail.wast2
-rw-r--r--test/spec/i32.load64_u.fail.wast2
-rw-r--r--test/spec/i32.store32.fail.wast2
-rw-r--r--test/spec/i32.store64.fail.wast2
-rw-r--r--test/spec/i32.wast58
-rw-r--r--test/spec/i64.load64_s.fail.wast2
-rw-r--r--test/spec/i64.load64_u.fail.wast2
-rw-r--r--test/spec/i64.store64.fail.wast2
-rw-r--r--test/spec/i64.wast58
-rw-r--r--test/spec/import-after-global.fail.wast2
-rw-r--r--test/spec/import-after-table.fail.wast2
-rw-r--r--test/spec/imports.wast62
-rw-r--r--test/spec/int_exprs.wast108
-rw-r--r--test/spec/labels.wast130
-rw-r--r--test/spec/left-to-right.wast2
-rw-r--r--test/spec/linking.wast30
-rw-r--r--test/spec/loop.wast76
-rw-r--r--test/spec/memory.wast50
-rw-r--r--test/spec/memory_redundancy.wast10
-rw-r--r--test/spec/memory_trap.wast6
-rw-r--r--test/spec/names.wast4
-rw-r--r--test/spec/nop.wast76
-rw-r--r--test/spec/resizing.wast6
-rw-r--r--test/spec/return.wast18
-rw-r--r--test/spec/select.wast12
-rw-r--r--test/spec/set_local.wast114
-rw-r--r--test/spec/simd.wast334
-rw-r--r--test/spec/stack.wast84
-rw-r--r--test/spec/store_retval.wast8
-rw-r--r--test/spec/switch.wast32
-rw-r--r--test/spec/tee_local.wast132
-rw-r--r--test/spec/traps.wast40
-rw-r--r--test/spec/typecheck.wast58
-rw-r--r--test/spec/unreachable.wast18
69 files changed, 1580 insertions, 1580 deletions
diff --git a/test/spec/address.wast b/test/spec/address.wast
index 4f8e34982..a3fb19b83 100644
--- a/test/spec/address.wast
+++ b/test/spec/address.wast
@@ -5,25 +5,25 @@
(data (i32.const 0) "abcdefghijklmnopqrstuvwxyz")
(func (export "good") (param $i i32)
- (call $print (i32.load8_u offset=0 (get_local $i))) ;; 97 'a'
- (call $print (i32.load8_u offset=1 (get_local $i))) ;; 98 'b'
- (call $print (i32.load8_u offset=2 (get_local $i))) ;; 99 'c'
- (call $print (i32.load8_u offset=25 (get_local $i))) ;; 122 'z'
+ (call $print (i32.load8_u offset=0 (local.get $i))) ;; 97 'a'
+ (call $print (i32.load8_u offset=1 (local.get $i))) ;; 98 'b'
+ (call $print (i32.load8_u offset=2 (local.get $i))) ;; 99 'c'
+ (call $print (i32.load8_u offset=25 (local.get $i))) ;; 122 'z'
- (call $print (i32.load16_u offset=0 (get_local $i))) ;; 25185 'ab'
- (call $print (i32.load16_u align=1 (get_local $i))) ;; 25185 'ab'
- (call $print (i32.load16_u offset=1 align=1 (get_local $i))) ;; 25442 'bc'
- (call $print (i32.load16_u offset=2 (get_local $i))) ;; 25699 'cd'
- (call $print (i32.load16_u offset=25 align=1 (get_local $i))) ;; 122 'z\0'
+ (call $print (i32.load16_u offset=0 (local.get $i))) ;; 25185 'ab'
+ (call $print (i32.load16_u align=1 (local.get $i))) ;; 25185 'ab'
+ (call $print (i32.load16_u offset=1 align=1 (local.get $i))) ;; 25442 'bc'
+ (call $print (i32.load16_u offset=2 (local.get $i))) ;; 25699 'cd'
+ (call $print (i32.load16_u offset=25 align=1 (local.get $i))) ;; 122 'z\0'
- (call $print (i32.load offset=0 (get_local $i))) ;; 1684234849 'abcd'
- (call $print (i32.load offset=1 align=1 (get_local $i))) ;; 1701077858 'bcde'
- (call $print (i32.load offset=2 align=2 (get_local $i))) ;; 1717920867 'cdef'
- (call $print (i32.load offset=25 align=1 (get_local $i))) ;; 122 'z\0\0\0'
+ (call $print (i32.load offset=0 (local.get $i))) ;; 1684234849 'abcd'
+ (call $print (i32.load offset=1 align=1 (local.get $i))) ;; 1701077858 'bcde'
+ (call $print (i32.load offset=2 align=2 (local.get $i))) ;; 1717920867 'cdef'
+ (call $print (i32.load offset=25 align=1 (local.get $i))) ;; 122 'z\0\0\0'
)
(func (export "bad") (param $i i32)
- (drop (i32.load offset=4294967295 (get_local $i)))
+ (drop (i32.load offset=4294967295 (local.get $i)))
)
)
diff --git a/test/spec/block.wast b/test/spec/block.wast
index 389a71a37..505560885 100644
--- a/test/spec/block.wast
+++ b/test/spec/block.wast
@@ -85,29 +85,29 @@
)
(func (export "break-inner") (result i32)
(local i32)
- (set_local 0 (i32.const 0))
- (set_local 0 (i32.add (get_local 0) (block i32 (block i32 (br 1 (i32.const 0x1))))))
- (set_local 0 (i32.add (get_local 0) (block i32 (block (br 0)) (i32.const 0x2))))
- (set_local 0
- (i32.add (get_local 0) (block i32 (i32.ctz (br 0 (i32.const 0x4)))))
+ (local.set 0 (i32.const 0))
+ (local.set 0 (i32.add (local.get 0) (block i32 (block i32 (br 1 (i32.const 0x1))))))
+ (local.set 0 (i32.add (local.get 0) (block i32 (block (br 0)) (i32.const 0x2))))
+ (local.set 0
+ (i32.add (local.get 0) (block i32 (i32.ctz (br 0 (i32.const 0x4)))))
)
- (set_local 0
- (i32.add (get_local 0) (block i32 (i32.ctz (block i32 (br 1 (i32.const 0x8))))))
+ (local.set 0
+ (i32.add (local.get 0) (block i32 (i32.ctz (block i32 (br 1 (i32.const 0x8))))))
)
- (get_local 0)
+ (local.get 0)
)
(func (export "effects") (result i32)
(local i32)
(block
- (set_local 0 (i32.const 1))
- (set_local 0 (i32.mul (get_local 0) (i32.const 3)))
- (set_local 0 (i32.sub (get_local 0) (i32.const 5)))
- (set_local 0 (i32.mul (get_local 0) (i32.const 7)))
+ (local.set 0 (i32.const 1))
+ (local.set 0 (i32.mul (local.get 0) (i32.const 3)))
+ (local.set 0 (i32.sub (local.get 0) (i32.const 5)))
+ (local.set 0 (i32.mul (local.get 0) (i32.const 7)))
(br 0)
- (set_local 0 (i32.mul (get_local 0) (i32.const 100)))
+ (local.set 0 (i32.mul (local.get 0) (i32.const 100)))
)
- (i32.eq (get_local 0) (i32.const -14))
+ (i32.eq (local.get 0) (i32.const -14))
)
)
diff --git a/test/spec/br.wast b/test/spec/br.wast
index 2e98282a8..99b6605c8 100644
--- a/test/spec/br.wast
+++ b/test/spec/br.wast
@@ -81,17 +81,17 @@
(block i32 (if i32 (br 0 (i32.const 2)) (i32.const 0) (i32.const 1)))
)
(func (export "as-if-then") (param i32 i32) (result i32)
- (block i32 (if i32 (get_local 0) (br 1 (i32.const 3)) (get_local 1)))
+ (block i32 (if i32 (local.get 0) (br 1 (i32.const 3)) (local.get 1)))
)
(func (export "as-if-else") (param i32 i32) (result i32)
- (block i32 (if i32 (get_local 0) (get_local 1) (br 1 (i32.const 4))))
+ (block i32 (if i32 (local.get 0) (local.get 1) (br 1 (i32.const 4))))
)
(func (export "as-select-first") (param i32 i32) (result i32)
- (block i32 (select (br 0 (i32.const 5)) (get_local 0) (get_local 1)))
+ (block i32 (select (br 0 (i32.const 5)) (local.get 0) (local.get 1)))
)
(func (export "as-select-second") (param i32 i32) (result i32)
- (block i32 (select (get_local 0) (br 0 (i32.const 6)) (get_local 1)))
+ (block i32 (select (local.get 0) (br 0 (i32.const 6)) (local.get 1)))
)
(func (export "as-select-cond") (result i32)
(block i32 (select (i32.const 0) (i32.const 1) (br 0 (i32.const 7))))
@@ -109,7 +109,7 @@
)
(type $sig (func (param i32 i32 i32) (result i32)))
- (table anyfunc (elem $f))
+ (table funcref (elem $f))
(func (export "as-call_indirect-func") (result i32)
(block i32
(call_indirect (type $sig)
@@ -143,8 +143,8 @@
)
)
- (func (export "as-set_local-value") (result i32) (local f32)
- (block i32 (set_local 0 (br 0 (i32.const 17))) (i32.const -1))
+ (func (export "as-local.set-value") (result i32) (local f32)
+ (block i32 (local.set 0 (br 0 (i32.const 17))) (i32.const -1))
)
(memory 1)
@@ -192,7 +192,7 @@
)
(func (export "as-convert-operand") (result i32)
- (block i32 (i32.wrap/i64 (br 0 (i32.const 41))))
+ (block i32 (i32.wrap_i64 (br 0 (i32.const 41))))
)
(func (export "as-grow_memory-size") (result i32)
@@ -333,7 +333,7 @@
(assert_return (invoke "as-call_indirect-mid") (i32.const 22))
(assert_return (invoke "as-call_indirect-last") (i32.const 23))
-(assert_return (invoke "as-set_local-value") (i32.const 17))
+(assert_return (invoke "as-local.set-value") (i32.const 17))
(assert_return (invoke "as-load-address") (f32.const 1.7))
(assert_return (invoke "as-loadN-address") (i64.const 30))
diff --git a/test/spec/br_if.wast b/test/spec/br_if.wast
index d115fcbc5..44aeffbe7 100644
--- a/test/spec/br_if.wast
+++ b/test/spec/br_if.wast
@@ -4,43 +4,43 @@
(func $dummy)
(func (export "as-block-first") (param i32) (result i32)
- (block (br_if 0 (get_local 0)) (return (i32.const 2))) (i32.const 3)
+ (block (br_if 0 (local.get 0)) (return (i32.const 2))) (i32.const 3)
)
(func (export "as-block-mid") (param i32) (result i32)
- (block (call $dummy) (br_if 0 (get_local 0)) (return (i32.const 2)))
+ (block (call $dummy) (br_if 0 (local.get 0)) (return (i32.const 2)))
(i32.const 3)
)
(func (export "as-block-last") (param i32)
- (block (call $dummy) (call $dummy) (br_if 0 (get_local 0)))
+ (block (call $dummy) (call $dummy) (br_if 0 (local.get 0)))
)
(func (export "as-block-first-value") (param i32) (result i32)
- (block i32 (drop (br_if 0 (i32.const 10) (get_local 0))) (return (i32.const 11)))
+ (block i32 (drop (br_if 0 (i32.const 10) (local.get 0))) (return (i32.const 11)))
)
(func (export "as-block-mid-value") (param i32) (result i32)
- (block i32 (call $dummy) (drop (br_if 0 (i32.const 20) (get_local 0))) (return (i32.const 21)))
+ (block i32 (call $dummy) (drop (br_if 0 (i32.const 20) (local.get 0))) (return (i32.const 21)))
)
(func (export "as-block-last-value") (param i32) (result i32)
(block i32
- (call $dummy) (call $dummy) (br_if 0 (i32.const 11) (get_local 0))
+ (call $dummy) (call $dummy) (br_if 0 (i32.const 11) (local.get 0))
)
)
(func (export "as-loop-first") (param i32) (result i32)
- (block (loop (br_if 1 (get_local 0)) (return (i32.const 2)))) (i32.const 3)
+ (block (loop (br_if 1 (local.get 0)) (return (i32.const 2)))) (i32.const 3)
)
(func (export "as-loop-mid") (param i32) (result i32)
- (block (loop (call $dummy) (br_if 1 (get_local 0)) (return (i32.const 2))))
+ (block (loop (call $dummy) (br_if 1 (local.get 0)) (return (i32.const 2))))
(i32.const 4)
)
(func (export "as-loop-last") (param i32)
- (loop (call $dummy) (br_if 1 (get_local 0)))
+ (loop (call $dummy) (br_if 1 (local.get 0)))
)
(func (export "as-if-then") (param i32 i32)
- (block (if (get_local 0) (br_if 1 (get_local 1)) (call $dummy)))
+ (block (if (local.get 0) (br_if 1 (local.get 1)) (call $dummy)))
)
(func (export "as-if-else") (param i32 i32)
- (block (if (get_local 0) (call $dummy) (br_if 1 (get_local 1))))
+ (block (if (local.get 0) (call $dummy) (br_if 1 (local.get 1))))
)
(func (export "nested-block-value") (param i32) (result i32)
@@ -51,7 +51,7 @@
(i32.add
(i32.const 4)
(block i32
- (drop (br_if 1 (i32.const 8) (get_local 0)))
+ (drop (br_if 1 (i32.const 8) (local.get 0)))
(i32.const 16)
)
)
@@ -65,7 +65,7 @@
(block i32
(drop (i32.const 2))
(br 0
- (block i32 (drop (br_if 1 (i32.const 8) (get_local 0))) (i32.const 4))
+ (block i32 (drop (br_if 1 (i32.const 8) (local.get 0))) (i32.const 4))
)
(i32.const 16)
)
@@ -78,7 +78,7 @@
(block i32
(drop (i32.const 2))
(drop (br_if 0
- (block i32 (drop (br_if 1 (i32.const 8) (get_local 0))) (i32.const 4))
+ (block i32 (drop (br_if 1 (i32.const 8) (local.get 0))) (i32.const 4))
(i32.const 1)
))
(i32.const 16)
@@ -93,7 +93,7 @@
(drop (i32.const 2))
(drop (br_if 0
(i32.const 4)
- (block i32 (drop (br_if 1 (i32.const 8) (get_local 0))) (i32.const 1))
+ (block i32 (drop (br_if 1 (i32.const 8) (local.get 0))) (i32.const 1))
))
(i32.const 16)
)
@@ -106,7 +106,7 @@
(block i32
(drop (i32.const 2))
(br_table 0
- (block i32 (drop (br_if 1 (i32.const 8) (get_local 0))) (i32.const 4))
+ (block i32 (drop (br_if 1 (i32.const 8) (local.get 0))) (i32.const 4))
(i32.const 1)
)
(i32.const 16)
@@ -121,7 +121,7 @@
(drop (i32.const 2))
(br_table 0
(i32.const 4)
- (block i32 (drop (br_if 1 (i32.const 8) (get_local 0))) (i32.const 1))
+ (block i32 (drop (br_if 1 (i32.const 8) (local.get 0))) (i32.const 1))
)
(i32.const 16)
)
diff --git a/test/spec/br_table.wast b/test/spec/br_table.wast
index 3a305f43d..2f3f2aa7c 100644
--- a/test/spec/br_table.wast
+++ b/test/spec/br_table.wast
@@ -31,17 +31,17 @@
)
(func (export "empty") (param i32) (result i32)
- (block (br_table 0 (get_local 0)) (return (i32.const 21)))
+ (block (br_table 0 (local.get 0)) (return (i32.const 21)))
(i32.const 22)
)
(func (export "empty-value") (param i32) (result i32)
- (block i32 (br_table 0 (i32.const 33) (get_local 0)) (i32.const 31))
+ (block i32 (br_table 0 (i32.const 33) (local.get 0)) (i32.const 31))
)
(func (export "singleton") (param i32) (result i32)
(block
(block
- (br_table 1 0 (get_local 0))
+ (br_table 1 0 (local.get 0))
(return (i32.const 21))
)
(return (i32.const 20))
@@ -53,7 +53,7 @@
(block i32
(drop
(block i32
- (br_table 0 1 (i32.const 33) (get_local 0))
+ (br_table 0 1 (i32.const 33) (local.get 0))
(return (i32.const 31))
)
)
@@ -67,7 +67,7 @@
(block
(block
(block
- (br_table 3 2 1 0 4 (get_local 0))
+ (br_table 3 2 1 0 4 (local.get 0))
(return (i32.const 99))
)
(return (i32.const 100))
@@ -83,23 +83,23 @@
(func (export "multiple-value") (param i32) (result i32)
(local i32)
- (set_local 1 (block i32
- (set_local 1 (block i32
- (set_local 1 (block i32
- (set_local 1 (block i32
- (set_local 1 (block i32
- (br_table 3 2 1 0 4 (i32.const 200) (get_local 0))
- (return (i32.add (get_local 1) (i32.const 99)))
+ (local.set 1 (block i32
+ (local.set 1 (block i32
+ (local.set 1 (block i32
+ (local.set 1 (block i32
+ (local.set 1 (block i32
+ (br_table 3 2 1 0 4 (i32.const 200) (local.get 0))
+ (return (i32.add (local.get 1) (i32.const 99)))
))
- (return (i32.add (get_local 1) (i32.const 10)))
+ (return (i32.add (local.get 1) (i32.const 10)))
))
- (return (i32.add (get_local 1) (i32.const 11)))
+ (return (i32.add (local.get 1) (i32.const 11)))
))
- (return (i32.add (get_local 1) (i32.const 12)))
+ (return (i32.add (local.get 1) (i32.const 12)))
))
- (return (i32.add (get_local 1) (i32.const 13)))
+ (return (i32.add (local.get 1) (i32.const 13)))
))
- (i32.add (get_local 1) (i32.const 14))
+ (i32.add (local.get 1) (i32.const 14))
)
(func (export "large") (param i32) (result i32)
@@ -830,7 +830,7 @@
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
- (get_local 0)
+ (local.get 0)
)
(return (i32.const -1))
)
@@ -918,17 +918,17 @@
(func (export "as-if-then") (param i32 i32) (result i32)
(block i32
(if i32
- (get_local 0)
+ (local.get 0)
(br_table 1 (i32.const 3) (i32.const 0))
- (get_local 1)
+ (local.get 1)
)
)
)
(func (export "as-if-else") (param i32 i32) (result i32)
(block i32
(if i32
- (get_local 0)
- (get_local 1)
+ (local.get 0)
+ (local.get 1)
(br_table 1 0 (i32.const 4) (i32.const 0))
)
)
@@ -937,14 +937,14 @@
(func (export "as-select-first") (param i32 i32) (result i32)
(block i32
(select
- (br_table 0 (i32.const 5) (i32.const 0)) (get_local 0) (get_local 1)
+ (br_table 0 (i32.const 5) (i32.const 0)) (local.get 0) (local.get 1)
)
)
)
(func (export "as-select-second") (param i32 i32) (result i32)
(block i32
(select
- (get_local 0) (br_table 0 (i32.const 6) (i32.const 1)) (get_local 1)
+ (local.get 0) (br_table 0 (i32.const 6) (i32.const 1)) (local.get 1)
)
)
)
@@ -980,7 +980,7 @@
)
(type $sig (func (param i32 i32 i32) (result i32)))
- (table anyfunc (elem $f))
+ (table funcref (elem $f))
(func (export "as-call_indirect-first") (result i32)
(block i32
(call_indirect (type $sig)
@@ -1014,10 +1014,10 @@
)
)
- (func (export "as-set_local-value") (result i32)
+ (func (export "as-local.set-value") (result i32)
(local f32)
(block i32
- (set_local 0 (br_table 0 (i32.const 17) (i32.const 1)))
+ (local.set 0 (br_table 0 (i32.const 17) (i32.const 1)))
(i32.const -1)
)
)
@@ -1087,7 +1087,7 @@
)
(func (export "as-convert-operand") (result i32)
- (block i32 (i32.wrap/i64 (br_table 0 (i32.const 41) (i32.const 0))))
+ (block i32 (i32.wrap_i64 (br_table 0 (i32.const 41) (i32.const 0))))
)
(func (export "as-grow_memory-size") (result i32)
@@ -1106,7 +1106,7 @@
(drop (i32.const 4))
(i32.add
(i32.const 8)
- (br_table 0 1 2 (i32.const 16) (get_local 0))
+ (br_table 0 1 2 (i32.const 16) (local.get 0))
)
)
)
@@ -1124,7 +1124,7 @@
(drop
(block i32
(drop (i32.const 4))
- (br 0 (br_table 2 1 0 (i32.const 8) (get_local 0)))
+ (br 0 (br_table 2 1 0 (i32.const 8) (local.get 0)))
)
)
(i32.const 16)
@@ -1142,7 +1142,7 @@
(drop
(block i32
(drop (i32.const 4))
- (br_if 0 (br_table 0 1 2 (i32.const 8) (get_local 0)) (i32.const 1))
+ (br_if 0 (br_table 0 1 2 (i32.const 8) (local.get 0)) (i32.const 1))
(i32.const 32)
)
)
@@ -1158,7 +1158,7 @@
(i32.const 1)
(block i32
(drop (i32.const 2))
- (drop (br_if 0 (i32.const 4) (br_table 0 1 0 (i32.const 8) (get_local 0))))
+ (drop (br_if 0 (i32.const 4) (br_table 0 1 0 (i32.const 8) (local.get 0))))
(i32.const 16)
)
)
@@ -1174,7 +1174,7 @@
(drop
(block i32
(drop (i32.const 4))
- (br_table 0 (br_table 0 1 2 (i32.const 8) (get_local 0)) (i32.const 1))
+ (br_table 0 (br_table 0 1 2 (i32.const 8) (local.get 0)) (i32.const 1))
(i32.const 32)
)
)
@@ -1190,7 +1190,7 @@
(i32.const 1)
(block i32
(drop (i32.const 2))
- (br_table 0 (i32.const 4) (br_table 0 1 0 (i32.const 8) (get_local 0)))
+ (br_table 0 (i32.const 4) (br_table 0 1 0 (i32.const 8) (local.get 0)))
(i32.const 16)
)
)
@@ -1309,7 +1309,7 @@
(assert_return (invoke "as-call_indirect-last") (i32.const 22))
(assert_return (invoke "as-call_indirect-func") (i32.const 23))
-(assert_return (invoke "as-set_local-value") (i32.const 17))
+(assert_return (invoke "as-local.set-value") (i32.const 17))
(assert_return (invoke "as-load-address") (f32.const 1.7))
(assert_return (invoke "as-loadN-address") (i64.const 30))
diff --git a/test/spec/call.wast b/test/spec/call.wast
index b47eba89e..83bc2abde 100644
--- a/test/spec/call.wast
+++ b/test/spec/call.wast
@@ -7,15 +7,15 @@
(func $const-f32 (result f32) (f32.const 0xf32))
(func $const-f64 (result f64) (f64.const 0xf64))
- (func $id-i32 (param i32) (result i32) (get_local 0))
- (func $id-i64 (param i64) (result i64) (get_local 0))
- (func $id-f32 (param f32) (result f32) (get_local 0))
- (func $id-f64 (param f64) (result f64) (get_local 0))
+ (func $id-i32 (param i32) (result i32) (local.get 0))
+ (func $id-i64 (param i64) (result i64) (local.get 0))
+ (func $id-f32 (param f32) (result f32) (local.get 0))
+ (func $id-f64 (param f64) (result f64) (local.get 0))
- (func $f32-i32 (param f32 i32) (result i32) (get_local 1))
- (func $i32-i64 (param i32 i64) (result i64) (get_local 1))
- (func $f64-f32 (param f64 f32) (result f32) (get_local 1))
- (func $i64-f64 (param i64 f64) (result f64) (get_local 1))
+ (func $f32-i32 (param f32 i32) (result i32) (local.get 1))
+ (func $i32-i64 (param i32 i64) (result i64) (local.get 1))
+ (func $f64-f32 (param f64 f32) (result f32) (local.get 1))
+ (func $i64-f64 (param i64 f64) (result f64) (local.get 1))
;; Typing
@@ -45,42 +45,42 @@
;; Recursion
(func $fac (export "fac") (param i64) (result i64)
- (if i64 (i64.eqz (get_local 0))
+ (if i64 (i64.eqz (local.get 0))
(i64.const 1)
- (i64.mul (get_local 0) (call $fac (i64.sub (get_local 0) (i64.const 1))))
+ (i64.mul (local.get 0) (call $fac (i64.sub (local.get 0) (i64.const 1))))
)
)
(func $fac-acc (export "fac-acc") (param i64 i64) (result i64)
- (if i64 (i64.eqz (get_local 0))
- (get_local 1)
+ (if i64 (i64.eqz (local.get 0))
+ (local.get 1)
(call $fac-acc
- (i64.sub (get_local 0) (i64.const 1))
- (i64.mul (get_local 0) (get_local 1))
+ (i64.sub (local.get 0) (i64.const 1))
+ (i64.mul (local.get 0) (local.get 1))
)
)
)
(func $fib (export "fib") (param i64) (result i64)
- (if i64 (i64.le_u (get_local 0) (i64.const 1))
+ (if i64 (i64.le_u (local.get 0) (i64.const 1))
(i64.const 1)
(i64.add
- (call $fib (i64.sub (get_local 0) (i64.const 2)))
- (call $fib (i64.sub (get_local 0) (i64.const 1)))
+ (call $fib (i64.sub (local.get 0) (i64.const 2)))
+ (call $fib (i64.sub (local.get 0) (i64.const 1)))
)
)
)
(func $even (export "even") (param i64) (result i32)
- (if i32 (i64.eqz (get_local 0))
+ (if i32 (i64.eqz (local.get 0))
(i32.const 44)
- (call $odd (i64.sub (get_local 0) (i64.const 1)))
+ (call $odd (i64.sub (local.get 0) (i64.const 1)))
)
)
(func $odd (export "odd") (param i64) (result i32)
- (if i32 (i64.eqz (get_local 0))
+ (if i32 (i64.eqz (local.get 0))
(i32.const 99)
- (call $even (i64.sub (get_local 0) (i64.const 1)))
+ (call $even (i64.sub (local.get 0) (i64.const 1)))
)
)
diff --git a/test/spec/call_indirect.wast b/test/spec/call_indirect.wast
index e4161affd..7394be5a3 100644
--- a/test/spec/call_indirect.wast
+++ b/test/spec/call_indirect.wast
@@ -25,22 +25,22 @@
(func $const-f32 (type $out-f32) (f32.const 0xf32))
(func $const-f64 (type $out-f64) (f64.const 0xf64))
- (func $id-i32 (type $over-i32) (get_local 0))
- (func $id-i64 (type $over-i64) (get_local 0))
- (func $id-f32 (type $over-f32) (get_local 0))
- (func $id-f64 (type $over-f64) (get_local 0))
-
- (func $i32-i64 (type $i32-i64) (get_local 1))
- (func $i64-f64 (type $i64-f64) (get_local 1))
- (func $f32-i32 (type $f32-i32) (get_local 1))
- (func $f64-f32 (type $f64-f32) (get_local 1))
-
- (func $over-i32-duplicate (type $over-i32-duplicate) (get_local 0))
- (func $over-i64-duplicate (type $over-i64-duplicate) (get_local 0))
- (func $over-f32-duplicate (type $over-f32-duplicate) (get_local 0))
- (func $over-f64-duplicate (type $over-f64-duplicate) (get_local 0))
-
- (table anyfunc
+ (func $id-i32 (type $over-i32) (local.get 0))
+ (func $id-i64 (type $over-i64) (local.get 0))
+ (func $id-f32 (type $over-f32) (local.get 0))
+ (func $id-f64 (type $over-f64) (local.get 0))
+
+ (func $i32-i64 (type $i32-i64) (local.get 1))
+ (func $i64-f64 (type $i64-f64) (local.get 1))
+ (func $f32-i32 (type $f32-i32) (local.get 1))
+ (func $f64-f32 (type $f64-f32) (local.get 1))
+
+ (func $over-i32-duplicate (type $over-i32-duplicate) (local.get 0))
+ (func $over-i64-duplicate (type $over-i64-duplicate) (local.get 0))
+ (func $over-f32-duplicate (type $over-f32-duplicate) (local.get 0))
+ (func $over-f64-duplicate (type $over-f64-duplicate) (local.get 0))
+
+ (table funcref
(elem
$const-i32 $const-i64 $const-f32 $const-f64
$id-i32 $id-i64 $id-f32 $id-f64
@@ -92,22 +92,22 @@
;; Dispatch
(func (export "dispatch") (param i32 i64) (result i64)
- (call_indirect (type $over-i64) (get_local 1) (get_local 0))
+ (call_indirect (type $over-i64) (local.get 1) (local.get 0))
)
(func (export "dispatch-structural") (param i32) (result i64)
- (call_indirect (type $over-i64-duplicate) (i64.const 9) (get_local 0))
+ (call_indirect (type $over-i64-duplicate) (i64.const 9) (local.get 0))
)
;; Recursion
(func $fac (export "fac") (type $over-i64)
- (if i64 (i64.eqz (get_local 0))
+ (if i64 (i64.eqz (local.get 0))
(i64.const 1)
(i64.mul
- (get_local 0)
+ (local.get 0)
(call_indirect (type $over-i64)
- (i64.sub (get_local 0) (i64.const 1))
+ (i64.sub (local.get 0) (i64.const 1))
(i32.const 12)
)
)
@@ -115,15 +115,15 @@
)
(func $fib (export "fib") (type $over-i64)
- (if i64 (i64.le_u (get_local 0) (i64.const 1))
+ (if i64 (i64.le_u (local.get 0) (i64.const 1))
(i64.const 1)
(i64.add
(call_indirect (type $over-i64)
- (i64.sub (get_local 0) (i64.const 2))
+ (i64.sub (local.get 0) (i64.const 2))
(i32.const 13)
)
(call_indirect (type $over-i64)
- (i64.sub (get_local 0) (i64.const 1))
+ (i64.sub (local.get 0) (i64.const 1))
(i32.const 13)
)
)
@@ -131,19 +131,19 @@
)
(func $even (export "even") (param i32) (result i32)
- (if i32 (i32.eqz (get_local 0))
+ (if i32 (i32.eqz (local.get 0))
(i32.const 44)
(call_indirect (type $over-i32)
- (i32.sub (get_local 0) (i32.const 1))
+ (i32.sub (local.get 0) (i32.const 1))
(i32.const 15)
)
)
)
(func $odd (export "odd") (param i32) (result i32)
- (if i32 (i32.eqz (get_local 0))
+ (if i32 (i32.eqz (local.get 0))
(i32.const 99)
(call_indirect (type $over-i32)
- (i32.sub (get_local 0) (i32.const 1))
+ (i32.sub (local.get 0) (i32.const 1))
(i32.const 14)
)
)
@@ -236,7 +236,7 @@
(assert_invalid
(module
(type (func))
- (table 0 anyfunc)
+ (table 0 funcref)
(func $type-void-vs-num (i32.eqz (call_indirect (type 0) (i32.const 0))))
)
"type mismatch"
@@ -244,7 +244,7 @@
(assert_invalid
(module
(type (func (result i64)))
- (table 0 anyfunc)
+ (table 0 funcref)
(func $type-num-vs-num (i32.eqz (call_indirect (type 0) (i32.const 0))))
)
"type mismatch"
@@ -253,7 +253,7 @@
(assert_invalid
(module
(type (func (param i32)))
- (table 0 anyfunc)
+ (table 0 funcref)
(func $arity-0-vs-1 (call_indirect (type 0) (i32.const 0)))
)
"type mismatch"
@@ -261,7 +261,7 @@
(assert_invalid
(module
(type (func (param f64 i32)))
- (table 0 anyfunc)
+ (table 0 funcref)
(func $arity-0-vs-2 (call_indirect (type 0) (i32.const 0)))
)
"type mismatch"
@@ -269,7 +269,7 @@
(assert_invalid
(module
(type (func))
- (table 0 anyfunc)
+ (table 0 funcref)
(func $arity-1-vs-0 (call_indirect (type 0) (i32.const 1) (i32.const 0)))
)
"type mismatch"
@@ -277,7 +277,7 @@
(assert_invalid
(module
(type (func))
- (table 0 anyfunc)
+ (table 0 funcref)
(func $arity-2-vs-0
(call_indirect (type 0) (f64.const 2) (i32.const 1) (i32.const 0))
)
@@ -288,7 +288,7 @@
(assert_invalid
(module
(type (func (param i32)))
- (table 0 anyfunc)
+ (table 0 funcref)
(func $type-func-void-vs-i32 (call_indirect (type 0) (i32.const 1) (nop)))
)
"type mismatch"
@@ -296,7 +296,7 @@
(assert_invalid
(module
(type (func (param i32)))
- (table 0 anyfunc)
+ (table 0 funcref)
(func $type-func-num-vs-i32 (call_indirect (type 0) (i32.const 0) (i64.const 1)))
)
"type mismatch"
@@ -305,7 +305,7 @@
(assert_invalid
(module
(type (func (param i32 i32)))
- (table 0 anyfunc)
+ (table 0 funcref)
(func $type-first-void-vs-num
(call_indirect (type 0) (nop) (i32.const 1) (i32.const 0))
)
@@ -315,7 +315,7 @@
(assert_invalid
(module
(type (func (param i32 i32)))
- (table 0 anyfunc)
+ (table 0 funcref)
(func $type-second-void-vs-num
(call_indirect (type 0) (i32.const 1) (nop) (i32.const 0))
)
@@ -325,7 +325,7 @@
(assert_invalid
(module
(type (func (param i32 f64)))
- (table 0 anyfunc)
+ (table 0 funcref)
(func $type-first-num-vs-num
(call_indirect (type 0) (f64.const 1) (i32.const 1) (i32.const 0))
)
@@ -335,7 +335,7 @@
(assert_invalid
(module
(type (func (param f64 i32)))
- (table 0 anyfunc)
+ (table 0 funcref)
(func $type-second-num-vs-num
(call_indirect (type 0) (i32.const 1) (f64.const 1) (i32.const 0))
)
@@ -348,14 +348,14 @@
(assert_invalid
(module
- (table 0 anyfunc)
+ (table 0 funcref)
(func $unbound-type (call_indirect (type 1) (i32.const 0)))
)
"unknown type"
)
(assert_invalid
(module
- (table 0 anyfunc)
+ (table 0 funcref)
(func $large-type (call_indirect (type 1012321300) (i32.const 0)))
)
"unknown type"
diff --git a/test/spec/conversions.wast b/test/spec/conversions.wast
index 21f058897..c4d0f00e5 100644
--- a/test/spec/conversions.wast
+++ b/test/spec/conversions.wast
@@ -1,37 +1,37 @@
(module
- (func (export "i64.extend_s_i32") (param $x i32) (result i64) (i64.extend_s/i32 (get_local $x)))
- (func (export "i64.extend_u_i32") (param $x i32) (result i64) (i64.extend_u/i32 (get_local $x)))
- (func (export "i32.wrap_i64") (param $x i64) (result i32) (i32.wrap/i64 (get_local $x)))
- (func (export "i32.trunc_s_f32") (param $x f32) (result i32) (i32.trunc_s/f32 (get_local $x)))
- (func (export "i32.trunc_u_f32") (param $x f32) (result i32) (i32.trunc_u/f32 (get_local $x)))
- (func (export "i32.trunc_s_f64") (param $x f64) (result i32) (i32.trunc_s/f64 (get_local $x)))
- (func (export "i32.trunc_u_f64") (param $x f64) (result i32) (i32.trunc_u/f64 (get_local $x)))
- (func (export "i64.trunc_s_f32") (param $x f32) (result i64) (i64.trunc_s/f32 (get_local $x)))
- (func (export "i64.trunc_u_f32") (param $x f32) (result i64) (i64.trunc_u/f32 (get_local $x)))
- (func (export "i64.trunc_s_f64") (param $x f64) (result i64) (i64.trunc_s/f64 (get_local $x)))
- (func (export "i64.trunc_u_f64") (param $x f64) (result i64) (i64.trunc_u/f64 (get_local $x)))
- (func (export "i32.trunc_s_sat_f32") (param $x f32) (result i32) (i32.trunc_s:sat/f32 (get_local $x)))
- (func (export "i32.trunc_u_sat_f32") (param $x f32) (result i32) (i32.trunc_u:sat/f32 (get_local $x)))
- (func (export "i32.trunc_s_sat_f64") (param $x f64) (result i32) (i32.trunc_s:sat/f64 (get_local $x)))
- (func (export "i32.trunc_u_sat_f64") (param $x f64) (result i32) (i32.trunc_u:sat/f64 (get_local $x)))
- (func (export "i64.trunc_s_sat_f32") (param $x f32) (result i64) (i64.trunc_s:sat/f32 (get_local $x)))
- (func (export "i64.trunc_u_sat_f32") (param $x f32) (result i64) (i64.trunc_u:sat/f32 (get_local $x)))
- (func (export "i64.trunc_s_sat_f64") (param $x f64) (result i64) (i64.trunc_s:sat/f64 (get_local $x)))
- (func (export "i64.trunc_u_sat_f64") (param $x f64) (result i64) (i64.trunc_u:sat/f64 (get_local $x)))
- (func (export "f32.convert_s_i32") (param $x i32) (result f32) (f32.convert_s/i32 (get_local $x)))
- (func (export "f32.convert_s_i64") (param $x i64) (result f32) (f32.convert_s/i64 (get_local $x)))
- (func (export "f64.convert_s_i32") (param $x i32) (result f64) (f64.convert_s/i32 (get_local $x)))
- (func (export "f64.convert_s_i64") (param $x i64) (result f64) (f64.convert_s/i64 (get_local $x)))
- (func (export "f32.convert_u_i32") (param $x i32) (result f32) (f32.convert_u/i32 (get_local $x)))
- (func (export "f32.convert_u_i64") (param $x i64) (result f32) (f32.convert_u/i64 (get_local $x)))
- (func (export "f64.convert_u_i32") (param $x i32) (result f64) (f64.convert_u/i32 (get_local $x)))
- (func (export "f64.convert_u_i64") (param $x i64) (result f64) (f64.convert_u/i64 (get_local $x)))
- (func (export "f64.promote_f32") (param $x f32) (result f64) (f64.promote/f32 (get_local $x)))
- (func (export "f32.demote_f64") (param $x f64) (result f32) (f32.demote/f64 (get_local $x)))
- (func (export "f32.reinterpret_i32") (param $x i32) (result f32) (f32.reinterpret/i32 (get_local $x)))
- (func (export "f64.reinterpret_i64") (param $x i64) (result f64) (f64.reinterpret/i64 (get_local $x)))
- (func (export "i32.reinterpret_f32") (param $x f32) (result i32) (i32.reinterpret/f32 (get_local $x)))
- (func (export "i64.reinterpret_f64") (param $x f64) (result i64) (i64.reinterpret/f64 (get_local $x)))
+ (func (export "i64.extend_s_i32") (param $x i32) (result i64) (i64.extend_i32_s (local.get $x)))
+ (func (export "i64.extend_u_i32") (param $x i32) (result i64) (i64.extend_i32_u (local.get $x)))
+ (func (export "i32.wrap_i64") (param $x i64) (result i32) (i32.wrap_i64 (local.get $x)))
+ (func (export "i32.trunc_s_f32") (param $x f32) (result i32) (i32.trunc_f32_s (local.get $x)))
+ (func (export "i32.trunc_u_f32") (param $x f32) (result i32) (i32.trunc_f32_u (local.get $x)))
+ (func (export "i32.trunc_s_f64") (param $x f64) (result i32) (i32.trunc_f64_s (local.get $x)))
+ (func (export "i32.trunc_u_f64") (param $x f64) (result i32) (i32.trunc_f64_u (local.get $x)))
+ (func (export "i64.trunc_s_f32") (param $x f32) (result i64) (i64.trunc_f32_s (local.get $x)))
+ (func (export "i64.trunc_u_f32") (param $x f32) (result i64) (i64.trunc_f32_u (local.get $x)))
+ (func (export "i64.trunc_s_f64") (param $x f64) (result i64) (i64.trunc_f64_s (local.get $x)))
+ (func (export "i64.trunc_u_f64") (param $x f64) (result i64) (i64.trunc_f64_u (local.get $x)))
+ (func (export "i32.trunc_s_sat_f32") (param $x f32) (result i32) (i32.trunc_sat_f32_s (local.get $x)))
+ (func (export "i32.trunc_u_sat_f32") (param $x f32) (result i32) (i32.trunc_sat_f32_u (local.get $x)))
+ (func (export "i32.trunc_s_sat_f64") (param $x f64) (result i32) (i32.trunc_sat_f64_s (local.get $x)))
+ (func (export "i32.trunc_u_sat_f64") (param $x f64) (result i32) (i32.trunc_sat_f64_u (local.get $x)))
+ (func (export "i64.trunc_s_sat_f32") (param $x f32) (result i64) (i64.trunc_sat_f32_s (local.get $x)))
+ (func (export "i64.trunc_u_sat_f32") (param $x f32) (result i64) (i64.trunc_sat_f32_u (local.get $x)))
+ (func (export "i64.trunc_s_sat_f64") (param $x f64) (result i64) (i64.trunc_sat_f64_s (local.get $x)))
+ (func (export "i64.trunc_u_sat_f64") (param $x f64) (result i64) (i64.trunc_sat_f64_u (local.get $x)))
+ (func (export "f32.convert_s_i32") (param $x i32) (result f32) (f32.convert_i32_s (local.get $x)))
+ (func (export "f32.convert_s_i64") (param $x i64) (result f32) (f32.convert_i64_s (local.get $x)))
+ (func (export "f64.convert_s_i32") (param $x i32) (result f64) (f64.convert_i32_s (local.get $x)))
+ (func (export "f64.convert_s_i64") (param $x i64) (result f64) (f64.convert_i64_s (local.get $x)))
+ (func (export "f32.convert_u_i32") (param $x i32) (result f32) (f32.convert_i32_u (local.get $x)))
+ (func (export "f32.convert_u_i64") (param $x i64) (result f32) (f32.convert_i64_u (local.get $x)))
+ (func (export "f64.convert_u_i32") (param $x i32) (result f64) (f64.convert_i32_u (local.get $x)))
+ (func (export "f64.convert_u_i64") (param $x i64) (result f64) (f64.convert_i64_u (local.get $x)))
+ (func (export "f64.promote_f32") (param $x f32) (result f64) (f64.promote_f32 (local.get $x)))
+ (func (export "f32.demote_f64") (param $x f64) (result f32) (f32.demote_f64 (local.get $x)))
+ (func (export "f32.reinterpret_i32") (param $x i32) (result f32) (f32.reinterpret_i32 (local.get $x)))
+ (func (export "f64.reinterpret_i64") (param $x i64) (result f64) (f64.reinterpret_i64 (local.get $x)))
+ (func (export "i32.reinterpret_f32") (param $x f32) (result i32) (i32.reinterpret_f32 (local.get $x)))
+ (func (export "i64.reinterpret_f64") (param $x f64) (result i64) (i64.reinterpret_f64 (local.get $x)))
)
(assert_return (invoke "i64.extend_s_i32" (i32.const 0)) (i64.const 0))
diff --git a/test/spec/endianness.wast b/test/spec/endianness.wast
index 8dc0c2e2e..4f28a168f 100644
--- a/test/spec/endianness.wast
+++ b/test/spec/endianness.wast
@@ -3,130 +3,130 @@
;; Stores an i16 value in little-endian-format
(func $i16_store_little (param $address i32) (param $value i32)
- (i32.store8 (get_local $address) (get_local $value))
- (i32.store8 (i32.add (get_local $address) (i32.const 1)) (i32.shr_u (get_local $value) (i32.const 8)))
+ (i32.store8 (local.get $address) (local.get $value))
+ (i32.store8 (i32.add (local.get $address) (i32.const 1)) (i32.shr_u (local.get $value) (i32.const 8)))
)
;; Stores an i32 value in little-endian format
(func $i32_store_little (param $address i32) (param $value i32)
- (call $i16_store_little (get_local $address) (get_local $value))
- (call $i16_store_little (i32.add (get_local $address) (i32.const 2)) (i32.shr_u (get_local $value) (i32.const 16)))
+ (call $i16_store_little (local.get $address) (local.get $value))
+ (call $i16_store_little (i32.add (local.get $address) (i32.const 2)) (i32.shr_u (local.get $value) (i32.const 16)))
)
;; Stores an i64 value in little-endian format
(func $i64_store_little (param $address i32) (param $value i64)
- (call $i32_store_little (get_local $address) (i32.wrap/i64 (get_local $value)))
- (call $i32_store_little (i32.add (get_local $address) (i32.const 4)) (i32.wrap/i64 (i64.shr_u (get_local $value) (i64.const 32))))
+ (call $i32_store_little (local.get $address) (i32.wrap_i64 (local.get $value)))
+ (call $i32_store_little (i32.add (local.get $address) (i32.const 4)) (i32.wrap_i64 (i64.shr_u (local.get $value) (i64.const 32))))
)
;; Loads an i16 value in little-endian format
(func $i16_load_little (param $address i32) (result i32)
(i32.or
- (i32.load8_u (get_local $address))
- (i32.shl (i32.load8_u (i32.add (get_local $address) (i32.const 1))) (i32.const 8))
+ (i32.load8_u (local.get $address))
+ (i32.shl (i32.load8_u (i32.add (local.get $address) (i32.const 1))) (i32.const 8))
)
)
;; Loads an i32 value in little-endian format
(func $i32_load_little (param $address i32) (result i32)
(i32.or
- (call $i16_load_little (get_local $address))
- (i32.shl (call $i16_load_little (i32.add (get_local $address) (i32.const 2))) (i32.const 16))
+ (call $i16_load_little (local.get $address))
+ (i32.shl (call $i16_load_little (i32.add (local.get $address) (i32.const 2))) (i32.const 16))
)
)
;; Loads an i64 value in little-endian format
(func $i64_load_little (param $address i32) (result i64)
(i64.or
- (i64.extend_u/i32 (call $i32_load_little (get_local $address)))
- (i64.shl (i64.extend_u/i32 (call $i32_load_little (i32.add (get_local $address) (i32.const 4)))) (i64.const 32))
+ (i64.extend_i32_u (call $i32_load_little (local.get $address)))
+ (i64.shl (i64.extend_i32_u (call $i32_load_little (i32.add (local.get $address) (i32.const 4)))) (i64.const 32))
)
)
(func (export "i32_load16_s") (param $value i32) (result i32)
- (call $i16_store_little (i32.const 0) (get_local $value))
+ (call $i16_store_little (i32.const 0) (local.get $value))
(i32.load16_s (i32.const 0))
)
(func (export "i32_load16_u") (param $value i32) (result i32)
- (call $i16_store_little (i32.const 0) (get_local $value))
+ (call $i16_store_little (i32.const 0) (local.get $value))
(i32.load16_u (i32.const 0))
)
(func (export "i32_load") (param $value i32) (result i32)
- (call $i32_store_little (i32.const 0) (get_local $value))
+ (call $i32_store_little (i32.const 0) (local.get $value))
(i32.load (i32.const 0))
)
(func (export "i64_load16_s") (param $value i64) (result i64)
- (call $i16_store_little (i32.const 0) (i32.wrap/i64 (get_local $value)))
+ (call $i16_store_little (i32.const 0) (i32.wrap_i64 (local.get $value)))
(i64.load16_s (i32.const 0))
)
(func (export "i64_load16_u") (param $value i64) (result i64)
- (call $i16_store_little (i32.const 0) (i32.wrap/i64 (get_local $value)))
+ (call $i16_store_little (i32.const 0) (i32.wrap_i64 (local.get $value)))
(i64.load16_u (i32.const 0))
)
(func (export "i64_load32_s") (param $value i64) (result i64)
- (call $i32_store_little (i32.const 0) (i32.wrap/i64 (get_local $value)))
+ (call $i32_store_little (i32.const 0) (i32.wrap_i64 (local.get $value)))
(i64.load32_s (i32.const 0))
)
(func (export "i64_load32_u") (param $value i64) (result i64)
- (call $i32_store_little (i32.const 0) (i32.wrap/i64 (get_local $value)))
+ (call $i32_store_little (i32.const 0) (i32.wrap_i64 (local.get $value)))
(i64.load32_u (i32.const 0))
)
(func (export "i64_load") (param $value i64) (result i64)
- (call $i64_store_little (i32.const 0) (get_local $value))
+ (call $i64_store_little (i32.const 0) (local.get $value))
(i64.load (i32.const 0))
)
(func (export "f32_load") (param $value f32) (result f32)
- (call $i32_store_little (i32.const 0) (i32.reinterpret/f32 (get_local $value)))
+ (call $i32_store_little (i32.const 0) (i32.reinterpret_f32 (local.get $value)))
(f32.load (i32.const 0))
)
(func (export "f64_load") (param $value f64) (result f64)
- (call $i64_store_little (i32.const 0) (i64.reinterpret/f64 (get_local $value)))
+ (call $i64_store_little (i32.const 0) (i64.reinterpret_f64 (local.get $value)))
(f64.load (i32.const 0))
)
(func (export "i32_store16") (param $value i32) (result i32)
- (i32.store16 (i32.const 0) (get_local $value))
+ (i32.store16 (i32.const 0) (local.get $value))
(call $i16_load_little (i32.const 0))
)
(func (export "i32_store") (param $value i32) (result i32)
- (i32.store (i32.const 0) (get_local $value))
+ (i32.store (i32.const 0) (local.get $value))
(call $i32_load_little (i32.const 0))
)
(func (export "i64_store16") (param $value i64) (result i64)
- (i64.store16 (i32.const 0) (get_local $value))
- (i64.extend_u/i32 (call $i16_load_little (i32.const 0)))
+ (i64.store16 (i32.const 0) (local.get $value))
+ (i64.extend_i32_u (call $i16_load_little (i32.const 0)))
)
(func (export "i64_store32") (param $value i64) (result i64)
- (i64.store32 (i32.const 0) (get_local $value))
- (i64.extend_u/i32 (call $i32_load_little (i32.const 0)))
+ (i64.store32 (i32.const 0) (local.get $value))
+ (i64.extend_i32_u (call $i32_load_little (i32.const 0)))
)
(func (export "i64_store") (param $value i64) (result i64)
- (i64.store (i32.const 0) (get_local $value))
+ (i64.store (i32.const 0) (local.get $value))
(call $i64_load_little (i32.const 0))
)
(func (export "f32_store") (param $value f32) (result f32)
- (f32.store (i32.const 0) (get_local $value))
- (f32.reinterpret/i32 (call $i32_load_little (i32.const 0)))
+ (f32.store (i32.const 0) (local.get $value))
+ (f32.reinterpret_i32 (call $i32_load_little (i32.const 0)))
)
(func (export "f64_store") (param $value f64) (result f64)
- (f64.store (i32.const 0) (get_local $value))
- (f64.reinterpret/i64 (call $i64_load_little (i32.const 0)))
+ (f64.store (i32.const 0) (local.get $value))
+ (f64.reinterpret_i64 (call $i64_load_little (i32.const 0)))
)
)
diff --git a/test/spec/exports.wast b/test/spec/exports.wast
index fdbb052b0..487103b89 100644
--- a/test/spec/exports.wast
+++ b/test/spec/exports.wast
@@ -10,7 +10,7 @@
(module $Func
(export "e" (func $f))
(func $f (param $n i32) (result i32)
- (return (i32.add (get_local $n) (i32.const 1)))
+ (return (i32.add (local.get $n) (i32.const 1)))
)
)
(assert_return (invoke "e" (i32.const 42)) (i32.const 43))
@@ -36,7 +36,7 @@
"duplicate export name"
)
(assert_invalid
- (module (func) (table 0 anyfunc) (export "a" (func 0)) (export "a" (table 0)))
+ (module (func) (table 0 funcref) (export "a" (func 0)) (export "a" (table 0)))
"duplicate export name"
)
(assert_invalid
@@ -81,7 +81,7 @@
"duplicate export name"
)
(assert_invalid
- (module (global i32 (i32.const 0)) (table 0 anyfunc) (export "a" (global 0)) (export "a" (table 0)))
+ (module (global i32 (i32.const 0)) (table 0 funcref) (export "a" (global 0)) (export "a" (table 0)))
"duplicate export name"
)
(assert_invalid
@@ -92,41 +92,41 @@
;; Tables
-(module (table 0 anyfunc) (export "a" (table 0)))
-(module (table 0 anyfunc) (export "a" (table 0)) (export "b" (table 0)))
+(module (table 0 funcref) (export "a" (table 0)))
+(module (table 0 funcref) (export "a" (table 0)) (export "b" (table 0)))
;; No multiple tables yet.
-;; (module (table 0 anyfunc) (table 0 anyfunc) (export "a" (table 0)) (export "b" (table 1)))
+;; (module (table 0 funcref) (table 0 funcref) (export "a" (table 0)) (export "b" (table 1)))
-(module (table (export "a") 0 anyfunc))
-(module (table (export "a") 0 1 anyfunc))
-(module (table $a (export "a") 0 anyfunc))
-(module (table $a (export "a") 0 1 anyfunc))
+(module (table (export "a") 0 funcref))
+(module (table (export "a") 0 1 funcref))
+(module (table $a (export "a") 0 funcref))
+(module (table $a (export "a") 0 1 funcref))
(; TODO: access table ;)
(assert_invalid
- (module (table 0 anyfunc) (export "a" (table 1)))
+ (module (table 0 funcref) (export "a" (table 1)))
"unknown table"
)
(assert_invalid
- (module (table 0 anyfunc) (export "a" (table 0)) (export "a" (table 0)))
+ (module (table 0 funcref) (export "a" (table 0)) (export "a" (table 0)))
"duplicate export name"
)
;; No multiple tables yet.
;; (assert_invalid
-;; (module (table 0 anyfunc) (table 0 anyfunc) (export "a" (table 0)) (export "a" (table 1)))
+;; (module (table 0 funcref) (table 0 funcref) (export "a" (table 0)) (export "a" (table 1)))
;; "duplicate export name"
;; )
(assert_invalid
- (module (table 0 anyfunc) (func) (export "a" (table 0)) (export "a" (func 0)))
+ (module (table 0 funcref) (func) (export "a" (table 0)) (export "a" (func 0)))
"duplicate export name"
)
(assert_invalid
- (module (table 0 anyfunc) (global i32 (i32.const 0)) (export "a" (table 0)) (export "a" (global 0)))
+ (module (table 0 funcref) (global i32 (i32.const 0)) (export "a" (table 0)) (export "a" (global 0)))
"duplicate export name"
)
(assert_invalid
- (module (table 0 anyfunc) (memory 0) (export "a" (table 0)) (export "a" (memory 0)))
+ (module (table 0 funcref) (memory 0) (export "a" (table 0)) (export "a" (memory 0)))
"duplicate export name"
)
@@ -167,6 +167,6 @@
"duplicate export name"
)
(assert_invalid
- (module (memory 0) (table 0 anyfunc) (export "a" (memory 0)) (export "a" (table 0)))
+ (module (memory 0) (table 0 funcref) (export "a" (memory 0)) (export "a" (table 0)))
"duplicate export name"
)
diff --git a/test/spec/f32.load32.fail.wast b/test/spec/f32.load32.fail.wast
index 313364538..6b8128285 100644
--- a/test/spec/f32.load32.fail.wast
+++ b/test/spec/f32.load32.fail.wast
@@ -1 +1 @@
-(module (memory 1) (func (param i32) (result f32) (f32.load32 (get_local 0))))
+(module (memory 1) (func (param i32) (result f32) (f32.load32 (local.get 0))))
diff --git a/test/spec/f32.load64.fail.wast b/test/spec/f32.load64.fail.wast
index da94668fc..9ade6a559 100644
--- a/test/spec/f32.load64.fail.wast
+++ b/test/spec/f32.load64.fail.wast
@@ -1 +1 @@
-(module (memory 1) (func (param i32) (result f32) (f32.load64 (get_local 0))))
+(module (memory 1) (func (param i32) (result f32) (f32.load64 (local.get 0))))
diff --git a/test/spec/f32.store32.fail.wast b/test/spec/f32.store32.fail.wast
index 3daf6eb35..70c7c94d6 100644
--- a/test/spec/f32.store32.fail.wast
+++ b/test/spec/f32.store32.fail.wast
@@ -1 +1 @@
-(module (memory 1) (func (param i32) (param f32) (f32.store32 (get_local 0) (get_local 1))))
+(module (memory 1) (func (param i32) (param f32) (f32.store32 (local.get 0) (local.get 1))))
diff --git a/test/spec/f32.store64.fail.wast b/test/spec/f32.store64.fail.wast
index b2c47bb9b..a72acf472 100644
--- a/test/spec/f32.store64.fail.wast
+++ b/test/spec/f32.store64.fail.wast
@@ -1 +1 @@
-(module (memory 1) (func (param i32) (param f64) (f32.store64 (get_local 0) (get_local 1))))
+(module (memory 1) (func (param i32) (param f64) (f32.store64 (local.get 0) (local.get 1))))
diff --git a/test/spec/f32.wast b/test/spec/f32.wast
index 9f58f9bd1..aba05d0ac 100644
--- a/test/spec/f32.wast
+++ b/test/spec/f32.wast
@@ -2,20 +2,20 @@
;; values (except comparison operators, which are tested in f32_cmp.wast).
(module
- (func (export "add") (param $x f32) (param $y f32) (result f32) (f32.add (get_local $x) (get_local $y)))
- (func (export "sub") (param $x f32) (param $y f32) (result f32) (f32.sub (get_local $x) (get_local $y)))
- (func (export "mul") (param $x f32) (param $y f32) (result f32) (f32.mul (get_local $x) (get_local $y)))
- (func (export "div") (param $x f32) (param $y f32) (result f32) (f32.div (get_local $x) (get_local $y)))
- (func (export "sqrt") (param $x f32) (result f32) (f32.sqrt (get_local $x)))
- (func (export "min") (param $x f32) (param $y f32) (result f32) (f32.min (get_local $x) (get_local $y)))
- (func (export "max") (param $x f32) (param $y f32) (result f32) (f32.max (get_local $x) (get_local $y)))
- (func (export "ceil") (param $x f32) (result f32) (f32.ceil (get_local $x)))
- (func (export "floor") (param $x f32) (result f32) (f32.floor (get_local $x)))
- (func (export "trunc") (param $x f32) (result f32) (f32.trunc (get_local $x)))
- (func (export "nearest") (param $x f32) (result f32) (f32.nearest (get_local $x)))
- (func (export "abs") (param $x f32) (result f32) (f32.abs (get_local $x)))
- (func (export "neg") (param $x f32) (result f32) (f32.neg (get_local $x)))
- (func (export "copysign") (param $x f32) (param $y f32) (result f32) (f32.copysign (get_local $x) (get_local $y)))
+ (func (export "add") (param $x f32) (param $y f32) (result f32) (f32.add (local.get $x) (local.get $y)))
+ (func (export "sub") (param $x f32) (param $y f32) (result f32) (f32.sub (local.get $x) (local.get $y)))
+ (func (export "mul") (param $x f32) (param $y f32) (result f32) (f32.mul (local.get $x) (local.get $y)))
+ (func (export "div") (param $x f32) (param $y f32) (result f32) (f32.div (local.get $x) (local.get $y)))
+ (func (export "sqrt") (param $x f32) (result f32) (f32.sqrt (local.get $x)))
+ (func (export "min") (param $x f32) (param $y f32) (result f32) (f32.min (local.get $x) (local.get $y)))
+ (func (export "max") (param $x f32) (param $y f32) (result f32) (f32.max (local.get $x) (local.get $y)))
+ (func (export "ceil") (param $x f32) (result f32) (f32.ceil (local.get $x)))
+ (func (export "floor") (param $x f32) (result f32) (f32.floor (local.get $x)))
+ (func (export "trunc") (param $x f32) (result f32) (f32.trunc (local.get $x)))
+ (func (export "nearest") (param $x f32) (result f32) (f32.nearest (local.get $x)))
+ (func (export "abs") (param $x f32) (result f32) (f32.abs (local.get $x)))
+ (func (export "neg") (param $x f32) (result f32) (f32.neg (local.get $x)))
+ (func (export "copysign") (param $x f32) (param $y f32) (result f32) (f32.copysign (local.get $x) (local.get $y)))
)
(assert_return (invoke "add" (f32.const -0x0p+0) (f32.const -0x0p+0)) (f32.const -0x0p+0))
diff --git a/test/spec/f32_cmp.wast b/test/spec/f32_cmp.wast
index 9458069c3..469bd1146 100644
--- a/test/spec/f32_cmp.wast
+++ b/test/spec/f32_cmp.wast
@@ -2,12 +2,12 @@
;; special values.
(module
- (func (export "eq") (param $x f32) (param $y f32) (result i32) (f32.eq (get_local $x) (get_local $y)))
- (func (export "ne") (param $x f32) (param $y f32) (result i32) (f32.ne (get_local $x) (get_local $y)))
- (func (export "lt") (param $x f32) (param $y f32) (result i32) (f32.lt (get_local $x) (get_local $y)))
- (func (export "le") (param $x f32) (param $y f32) (result i32) (f32.le (get_local $x) (get_local $y)))
- (func (export "gt") (param $x f32) (param $y f32) (result i32) (f32.gt (get_local $x) (get_local $y)))
- (func (export "ge") (param $x f32) (param $y f32) (result i32) (f32.ge (get_local $x) (get_local $y)))
+ (func (export "eq") (param $x f32) (param $y f32) (result i32) (f32.eq (local.get $x) (local.get $y)))
+ (func (export "ne") (param $x f32) (param $y f32) (result i32) (f32.ne (local.get $x) (local.get $y)))
+ (func (export "lt") (param $x f32) (param $y f32) (result i32) (f32.lt (local.get $x) (local.get $y)))
+ (func (export "le") (param $x f32) (param $y f32) (result i32) (f32.le (local.get $x) (local.get $y)))
+ (func (export "gt") (param $x f32) (param $y f32) (result i32) (f32.gt (local.get $x) (local.get $y)))
+ (func (export "ge") (param $x f32) (param $y f32) (result i32) (f32.ge (local.get $x) (local.get $y)))
)
(assert_return (invoke "eq" (f32.const -0x0p+0) (f32.const -0x0p+0)) (i32.const 1))
diff --git a/test/spec/f64.load32.fail.wast b/test/spec/f64.load32.fail.wast
index 38811ff35..6f324b648 100644
--- a/test/spec/f64.load32.fail.wast
+++ b/test/spec/f64.load32.fail.wast
@@ -1 +1 @@
-(module (memory 1) (func (param i32) (result f64) (f64.load32 (get_local 0))))
+(module (memory 1) (func (param i32) (result f64) (f64.load32 (local.get 0))))
diff --git a/test/spec/f64.load64.fail.wast b/test/spec/f64.load64.fail.wast
index f3c30ef34..314053866 100644
--- a/test/spec/f64.load64.fail.wast
+++ b/test/spec/f64.load64.fail.wast
@@ -1 +1 @@
-(module (memory 1) (func (param i32) (result f64) (f64.load64 (get_local 0))))
+(module (memory 1) (func (param i32) (result f64) (f64.load64 (local.get 0))))
diff --git a/test/spec/f64.store32.fail.wast b/test/spec/f64.store32.fail.wast
index 92858a35e..fb1de4b84 100644
--- a/test/spec/f64.store32.fail.wast
+++ b/test/spec/f64.store32.fail.wast
@@ -1 +1 @@
-(module (memory 1) (func (param i32) (param f32) (f64.store32 (get_local 0) (get_local 1))))
+(module (memory 1) (func (param i32) (param f32) (f64.store32 (local.get 0) (local.get 1))))
diff --git a/test/spec/f64.store64.fail.wast b/test/spec/f64.store64.fail.wast
index 2b49017fe..8b74a0b39 100644
--- a/test/spec/f64.store64.fail.wast
+++ b/test/spec/f64.store64.fail.wast
@@ -1 +1 @@
-(module (memory 1) (func (param i32) (param f64) (f64.store64 (get_local 0) (get_local 1))))
+(module (memory 1) (func (param i32) (param f64) (f64.store64 (local.get 0) (local.get 1))))
diff --git a/test/spec/f64.wast b/test/spec/f64.wast
index 26a058a25..6f6d91199 100644
--- a/test/spec/f64.wast
+++ b/test/spec/f64.wast
@@ -2,20 +2,20 @@
;; values (except comparison operators, which are tested in f64_cmp.wast).
(module
- (func (export "add") (param $x f64) (param $y f64) (result f64) (f64.add (get_local $x) (get_local $y)))
- (func (export "sub") (param $x f64) (param $y f64) (result f64) (f64.sub (get_local $x) (get_local $y)))
- (func (export "mul") (param $x f64) (param $y f64) (result f64) (f64.mul (get_local $x) (get_local $y)))
- (func (export "div") (param $x f64) (param $y f64) (result f64) (f64.div (get_local $x) (get_local $y)))
- (func (export "sqrt") (param $x f64) (result f64) (f64.sqrt (get_local $x)))
- (func (export "min") (param $x f64) (param $y f64) (result f64) (f64.min (get_local $x) (get_local $y)))
- (func (export "max") (param $x f64) (param $y f64) (result f64) (f64.max (get_local $x) (get_local $y)))
- (func (export "ceil") (param $x f64) (result f64) (f64.ceil (get_local $x)))
- (func (export "floor") (param $x f64) (result f64) (f64.floor (get_local $x)))
- (func (export "trunc") (param $x f64) (result f64) (f64.trunc (get_local $x)))
- (func (export "nearest") (param $x f64) (result f64) (f64.nearest (get_local $x)))
- (func (export "abs") (param $x f64) (result f64) (f64.abs (get_local $x)))
- (func (export "neg") (param $x f64) (result f64) (f64.neg (get_local $x)))
- (func (export "copysign") (param $x f64) (param $y f64) (result f64) (f64.copysign (get_local $x) (get_local $y)))
+ (func (export "add") (param $x f64) (param $y f64) (result f64) (f64.add (local.get $x) (local.get $y)))
+ (func (export "sub") (param $x f64) (param $y f64) (result f64) (f64.sub (local.get $x) (local.get $y)))
+ (func (export "mul") (param $x f64) (param $y f64) (result f64) (f64.mul (local.get $x) (local.get $y)))
+ (func (export "div") (param $x f64) (param $y f64) (result f64) (f64.div (local.get $x) (local.get $y)))
+ (func (export "sqrt") (param $x f64) (result f64) (f64.sqrt (local.get $x)))
+ (func (export "min") (param $x f64) (param $y f64) (result f64) (f64.min (local.get $x) (local.get $y)))
+ (func (export "max") (param $x f64) (param $y f64) (result f64) (f64.max (local.get $x) (local.get $y)))
+ (func (export "ceil") (param $x f64) (result f64) (f64.ceil (local.get $x)))
+ (func (export "floor") (param $x f64) (result f64) (f64.floor (local.get $x)))
+ (func (export "trunc") (param $x f64) (result f64) (f64.trunc (local.get $x)))
+ (func (export "nearest") (param $x f64) (result f64) (f64.nearest (local.get $x)))
+ (func (export "abs") (param $x f64) (result f64) (f64.abs (local.get $x)))
+ (func (export "neg") (param $x f64) (result f64) (f64.neg (local.get $x)))
+ (func (export "copysign") (param $x f64) (param $y f64) (result f64) (f64.copysign (local.get $x) (local.get $y)))
)
(assert_return (invoke "add" (f64.const -0x0p+0) (f64.const -0x0p+0)) (f64.const -0x0p+0))
diff --git a/test/spec/f64_cmp.wast b/test/spec/f64_cmp.wast
index f4958b8f9..aa9ac90cf 100644
--- a/test/spec/f64_cmp.wast
+++ b/test/spec/f64_cmp.wast
@@ -2,12 +2,12 @@
;; special values.
(module
- (func (export "eq") (param $x f64) (param $y f64) (result i32) (f64.eq (get_local $x) (get_local $y)))
- (func (export "ne") (param $x f64) (param $y f64) (result i32) (f64.ne (get_local $x) (get_local $y)))
- (func (export "lt") (param $x f64) (param $y f64) (result i32) (f64.lt (get_local $x) (get_local $y)))
- (func (export "le") (param $x f64) (param $y f64) (result i32) (f64.le (get_local $x) (get_local $y)))
- (func (export "gt") (param $x f64) (param $y f64) (result i32) (f64.gt (get_local $x) (get_local $y)))
- (func (export "ge") (param $x f64) (param $y f64) (result i32) (f64.ge (get_local $x) (get_local $y)))
+ (func (export "eq") (param $x f64) (param $y f64) (result i32) (f64.eq (local.get $x) (local.get $y)))
+ (func (export "ne") (param $x f64) (param $y f64) (result i32) (f64.ne (local.get $x) (local.get $y)))
+ (func (export "lt") (param $x f64) (param $y f64) (result i32) (f64.lt (local.get $x) (local.get $y)))
+ (func (export "le") (param $x f64) (param $y f64) (result i32) (f64.le (local.get $x) (local.get $y)))
+ (func (export "gt") (param $x f64) (param $y f64) (result i32) (f64.gt (local.get $x) (local.get $y)))
+ (func (export "ge") (param $x f64) (param $y f64) (result i32) (f64.ge (local.get $x) (local.get $y)))
)
(assert_return (invoke "eq" (f64.const -0x0p+0) (f64.const -0x0p+0)) (i32.const 1))
diff --git a/test/spec/fac.wast b/test/spec/fac.wast
index be587520c..a9e437be2 100644
--- a/test/spec/fac.wast
+++ b/test/spec/fac.wast
@@ -1,19 +1,19 @@
(module
;; Recursive factorial
(func (export "fac-rec") (param i64) (result i64)
- (if i64 (i64.eq (get_local 0) (i64.const 0))
+ (if i64 (i64.eq (local.get 0) (i64.const 0))
(i64.const 1)
- (i64.mul (get_local 0) (call 0 (i64.sub (get_local 0) (i64.const 1))))
+ (i64.mul (local.get 0) (call 0 (i64.sub (local.get 0) (i64.const 1))))
)
)
;; Recursive factorial named
(func $fac-rec-named (export "fac-rec-named") (param $n i64) (result i64)
- (if i64 (i64.eq (get_local $n) (i64.const 0))
+ (if i64 (i64.eq (local.get $n) (i64.const 0))
(i64.const 1)
(i64.mul
- (get_local $n)
- (call $fac-rec-named (i64.sub (get_local $n) (i64.const 1)))
+ (local.get $n)
+ (call $fac-rec-named (i64.sub (local.get $n) (i64.const 1)))
)
)
)
@@ -21,59 +21,59 @@
;; Iterative factorial
(func (export "fac-iter") (param i64) (result i64)
(local i64 i64)
- (set_local 1 (get_local 0))
- (set_local 2 (i64.const 1))
+ (local.set 1 (local.get 0))
+ (local.set 2 (i64.const 1))
(block
(loop
(if
- (i64.eq (get_local 1) (i64.const 0))
+ (i64.eq (local.get 1) (i64.const 0))
(br 2)
(block
- (set_local 2 (i64.mul (get_local 1) (get_local 2)))
- (set_local 1 (i64.sub (get_local 1) (i64.const 1)))
+ (local.set 2 (i64.mul (local.get 1) (local.get 2)))
+ (local.set 1 (i64.sub (local.get 1) (i64.const 1)))
)
)
(br 0)
)
)
- (get_local 2)
+ (local.get 2)
)
;; Iterative factorial named
(func (export "fac-iter-named") (param $n i64) (result i64)
(local $i i64)
(local $res i64)
- (set_local $i (get_local $n))
- (set_local $res (i64.const 1))
+ (local.set $i (local.get $n))
+ (local.set $res (i64.const 1))
(block $done
(loop $loop
(if
- (i64.eq (get_local $i) (i64.const 0))
+ (i64.eq (local.get $i) (i64.const 0))
(br $done)
(block
- (set_local $res (i64.mul (get_local $i) (get_local $res)))
- (set_local $i (i64.sub (get_local $i) (i64.const 1)))
+ (local.set $res (i64.mul (local.get $i) (local.get $res)))
+ (local.set $i (i64.sub (local.get $i) (i64.const 1)))
)
)
(br $loop)
)
)
- (get_local $res)
+ (local.get $res)
)
;; Optimized factorial.
(func (export "fac-opt") (param i64) (result i64)
(local i64)
- (set_local 1 (i64.const 1))
+ (local.set 1 (i64.const 1))
(block
- (br_if 0 (i64.lt_s (get_local 0) (i64.const 2)))
+ (br_if 0 (i64.lt_s (local.get 0) (i64.const 2)))
(loop
- (set_local 1 (i64.mul (get_local 1) (get_local 0)))
- (set_local 0 (i64.add (get_local 0) (i64.const -1)))
- (br_if 0 (i64.gt_s (get_local 0) (i64.const 1)))
+ (local.set 1 (i64.mul (local.get 1) (local.get 0)))
+ (local.set 0 (i64.add (local.get 0) (i64.const -1)))
+ (br_if 0 (i64.gt_s (local.get 0) (i64.const 1)))
)
)
- (get_local 1)
+ (local.get 1)
)
)
diff --git a/test/spec/float_exprs.wast b/test/spec/float_exprs.wast
index ad8f769f0..7900832b0 100644
--- a/test/spec/float_exprs.wast
+++ b/test/spec/float_exprs.wast
@@ -5,7 +5,7 @@
(module
(func (export "f64.no_contraction") (param $x f64) (param $y f64) (param $z f64) (result f64)
- (f64.add (f64.mul (get_local $x) (get_local $y)) (get_local $z)))
+ (f64.add (f64.mul (local.get $x) (local.get $y)) (local.get $z)))
)
(assert_return (invoke "f64.no_contraction" (f64.const -0x1.9e87ce14273afp-103) (f64.const 0x1.2515ad31db63ep+664) (f64.const 0x1.868c6685e6185p+533)) (f64.const -0x1.da94885b11493p+561))
@@ -18,9 +18,9 @@
(module
(func (export "f32.no_fma") (param $x f32) (param $y f32) (param $z f32) (result f32)
- (f32.add (f32.mul (get_local $x) (get_local $y)) (get_local $z)))
+ (f32.add (f32.mul (local.get $x) (local.get $y)) (local.get $z)))
(func (export "f64.no_fma") (param $x f64) (param $y f64) (param $z f64) (result f64)
- (f64.add (f64.mul (get_local $x) (get_local $y)) (get_local $z)))
+ (f64.add (f64.mul (local.get $x) (local.get $y)) (local.get $z)))
)
(assert_return (invoke "f32.no_fma" (f32.const 0x1.a78402p+124) (f32.const 0x1.cf8548p-23) (f32.const 0x1.992adap+107)) (f32.const 0x1.a5262cp+107))
@@ -39,9 +39,9 @@
(module
(func (export "f32.no_fold_add_zero") (param $x f32) (result f32)
- (f32.add (get_local $x) (f32.const 0.0)))
+ (f32.add (local.get $x) (f32.const 0.0)))
(func (export "f64.no_fold_add_zero") (param $x f64) (result f64)
- (f64.add (get_local $x) (f64.const 0.0)))
+ (f64.add (local.get $x) (f64.const 0.0)))
)
(assert_return (invoke "f32.no_fold_add_zero" (f32.const -0.0)) (f32.const 0.0))
@@ -53,9 +53,9 @@
(module
(func (export "f32.no_fold_zero_sub") (param $x f32) (result f32)
- (f32.sub (f32.const 0.0) (get_local $x)))
+ (f32.sub (f32.const 0.0) (local.get $x)))
(func (export "f64.no_fold_zero_sub") (param $x f64) (result f64)
- (f64.sub (f64.const 0.0) (get_local $x)))
+ (f64.sub (f64.const 0.0) (local.get $x)))
)
(assert_return (invoke "f32.no_fold_zero_sub" (f32.const 0.0)) (f32.const 0.0))
@@ -67,9 +67,9 @@
(module
(func (export "f32.no_fold_sub_zero") (param $x f32) (result f32)
- (f32.sub (get_local $x) (f32.const 0.0)))
+ (f32.sub (local.get $x) (f32.const 0.0)))
(func (export "f64.no_fold_sub_zero") (param $x f64) (result f64)
- (f64.sub (get_local $x) (f64.const 0.0)))
+ (f64.sub (local.get $x) (f64.const 0.0)))
)
(assert_return (invoke "f32.no_fold_sub_zero" (f32.const nan:0x200000)) (f32.const nan:0x600000))
@@ -79,9 +79,9 @@
(module
(func (export "f32.no_fold_mul_zero") (param $x f32) (result f32)
- (f32.mul (get_local $x) (f32.const 0.0)))
+ (f32.mul (local.get $x) (f32.const 0.0)))
(func (export "f64.no_fold_mul_zero") (param $x f64) (result f64)
- (f64.mul (get_local $x) (f64.const 0.0)))
+ (f64.mul (local.get $x) (f64.const 0.0)))
)
(assert_return (invoke "f32.no_fold_mul_zero" (f32.const -0.0)) (f32.const -0.0))
@@ -98,9 +98,9 @@
(module
(func (export "f32.no_fold_mul_one") (param $x f32) (result f32)
- (f32.mul (get_local $x) (f32.const 1.0)))
+ (f32.mul (local.get $x) (f32.const 1.0)))
(func (export "f64.no_fold_mul_one") (param $x f64) (result f64)
- (f64.mul (get_local $x) (f64.const 1.0)))
+ (f64.mul (local.get $x) (f64.const 1.0)))
)
(assert_return (invoke "f32.no_fold_mul_one" (f32.const nan:0x200000)) (f32.const nan:0x600000))
@@ -110,9 +110,9 @@
(module
(func (export "f32.no_fold_zero_div") (param $x f32) (result f32)
- (f32.div (f32.const 0.0) (get_local $x)))
+ (f32.div (f32.const 0.0) (local.get $x)))
(func (export "f64.no_fold_zero_div") (param $x f64) (result f64)
- (f64.div (f64.const 0.0) (get_local $x)))
+ (f64.div (f64.const 0.0) (local.get $x)))
)
(assert_return_nan (invoke "f32.no_fold_zero_div" (f32.const 0.0)))
@@ -128,9 +128,9 @@
(module
(func (export "f32.no_fold_div_one") (param $x f32) (result f32)
- (f32.div (get_local $x) (f32.const 1.0)))
+ (f32.div (local.get $x) (f32.const 1.0)))
(func (export "f64.no_fold_div_one") (param $x f64) (result f64)
- (f64.div (get_local $x) (f64.const 1.0)))
+ (f64.div (local.get $x) (f64.const 1.0)))
)
(assert_return (invoke "f32.no_fold_div_one" (f32.const nan:0x200000)) (f32.const nan:0x600000))
@@ -140,9 +140,9 @@
(module
(func (export "f32.no_fold_div_neg1") (param $x f32) (result f32)
- (f32.div (get_local $x) (f32.const -1.0)))
+ (f32.div (local.get $x) (f32.const -1.0)))
(func (export "f64.no_fold_div_neg1") (param $x f64) (result f64)
- (f64.div (get_local $x) (f64.const -1.0)))
+ (f64.div (local.get $x) (f64.const -1.0)))
)
(assert_return (invoke "f32.no_fold_div_neg1" (f32.const nan:0x200000)) (f32.const nan:0x600000))
@@ -152,9 +152,9 @@
(module
(func (export "f32.no_fold_neg0_sub") (param $x f32) (result f32)
- (f32.sub (f32.const -0.0) (get_local $x)))
+ (f32.sub (f32.const -0.0) (local.get $x)))
(func (export "f64.no_fold_neg0_sub") (param $x f64) (result f64)
- (f64.sub (f64.const -0.0) (get_local $x)))
+ (f64.sub (f64.const -0.0) (local.get $x)))
)
(assert_return (invoke "f32.no_fold_neg0_sub" (f32.const nan:0x200000)) (f32.const nan:0x600000))
@@ -164,9 +164,9 @@
(module
(func (export "f32.no_fold_neg1_mul") (param $x f32) (result f32)
- (f32.mul (f32.const -1.0) (get_local $x)))
+ (f32.mul (f32.const -1.0) (local.get $x)))
(func (export "f64.no_fold_neg1_mul") (param $x f64) (result f64)
- (f64.mul (f64.const -1.0) (get_local $x)))
+ (f64.mul (f64.const -1.0) (local.get $x)))
)
(assert_return (invoke "f32.no_fold_neg1_mul" (f32.const nan:0x200000)) (f32.const nan:0x600000))
@@ -176,9 +176,9 @@
(module
(func (export "f32.no_fold_eq_self") (param $x f32) (result i32)
- (f32.eq (get_local $x) (get_local $x)))
+ (f32.eq (local.get $x) (local.get $x)))
(func (export "f64.no_fold_eq_self") (param $x f64) (result i32)
- (f64.eq (get_local $x) (get_local $x)))
+ (f64.eq (local.get $x) (local.get $x)))
)
(assert_return (invoke "f32.no_fold_eq_self" (f32.const nan)) (i32.const 0))
@@ -188,9 +188,9 @@
(module
(func (export "f32.no_fold_ne_self") (param $x f32) (result i32)
- (f32.ne (get_local $x) (get_local $x)))
+ (f32.ne (local.get $x) (local.get $x)))
(func (export "f64.no_fold_ne_self") (param $x f64) (result i32)
- (f64.ne (get_local $x) (get_local $x)))
+ (f64.ne (local.get $x) (local.get $x)))
)
(assert_return (invoke "f32.no_fold_ne_self" (f32.const nan)) (i32.const 1))
@@ -200,9 +200,9 @@
(module
(func (export "f32.no_fold_sub_self") (param $x f32) (result f32)
- (f32.sub (get_local $x) (get_local $x)))
+ (f32.sub (local.get $x) (local.get $x)))
(func (export "f64.no_fold_sub_self") (param $x f64) (result f64)
- (f64.sub (get_local $x) (get_local $x)))
+ (f64.sub (local.get $x) (local.get $x)))
)
(assert_return_nan (invoke "f32.no_fold_sub_self" (f32.const infinity)))
@@ -214,9 +214,9 @@
(module
(func (export "f32.no_fold_div_3") (param $x f32) (result f32)
- (f32.div (get_local $x) (f32.const 3.0)))
+ (f32.div (local.get $x) (f32.const 3.0)))
(func (export "f64.no_fold_div_3") (param $x f64) (result f64)
- (f64.div (get_local $x) (f64.const 3.0)))
+ (f64.div (local.get $x) (f64.const 3.0)))
)
(assert_return (invoke "f32.no_fold_div_3" (f32.const -0x1.359c26p+50)) (f32.const -0x1.9cd032p+48))
@@ -234,9 +234,9 @@
(module
(func (export "f32.no_factor") (param $x f32) (param $y f32) (param $z f32) (result f32)
- (f32.add (f32.mul (get_local $x) (get_local $z)) (f32.mul (get_local $y) (get_local $z))))
+ (f32.add (f32.mul (local.get $x) (local.get $z)) (f32.mul (local.get $y) (local.get $z))))
(func (export "f64.no_factor") (param $x f64) (param $y f64) (param $z f64) (result f64)
- (f64.add (f64.mul (get_local $x) (get_local $z)) (f64.mul (get_local $y) (get_local $z))))
+ (f64.add (f64.mul (local.get $x) (local.get $z)) (f64.mul (local.get $y) (local.get $z))))
)
(assert_return (invoke "f32.no_factor" (f32.const -0x1.4e2352p+40) (f32.const -0x1.842e2cp+49) (f32.const 0x1.eea602p+59)) (f32.const -0x1.77a7dp+109))
@@ -254,9 +254,9 @@
(module
(func (export "f32.no_distribute") (param $x f32) (param $y f32) (param $z f32) (result f32)
- (f32.mul (f32.add (get_local $x) (get_local $y)) (get_local $z)))
+ (f32.mul (f32.add (local.get $x) (local.get $y)) (local.get $z)))
(func (export "f64.no_distribute") (param $x f64) (param $y f64) (param $z f64) (result f64)
- (f64.mul (f64.add (get_local $x) (get_local $y)) (get_local $z)))
+ (f64.mul (f64.add (local.get $x) (local.get $y)) (local.get $z)))
)
(assert_return (invoke "f32.no_distribute" (f32.const -0x1.4e2352p+40) (f32.const -0x1.842e2cp+49) (f32.const 0x1.eea602p+59)) (f32.const -0x1.77a7d2p+109))
@@ -274,9 +274,9 @@
(module
(func (export "f32.no_regroup_div_mul") (param $x f32) (param $y f32) (param $z f32) (result f32)
- (f32.mul (get_local $x) (f32.div (get_local $y) (get_local $z))))
+ (f32.mul (local.get $x) (f32.div (local.get $y) (local.get $z))))
(func (export "f64.no_regroup_div_mul") (param $x f64) (param $y f64) (param $z f64) (result f64)
- (f64.mul (get_local $x) (f64.div (get_local $y) (get_local $z))))
+ (f64.mul (local.get $x) (f64.div (local.get $y) (local.get $z))))
)
(assert_return (invoke "f32.no_regroup_div_mul" (f32.const -0x1.2d14a6p-115) (f32.const -0x1.575a6cp-64) (f32.const 0x1.5cee0ep-116)) (f32.const 0x1.2844cap-63))
@@ -294,9 +294,9 @@
(module
(func (export "f32.no_regroup_mul_div") (param $x f32) (param $y f32) (param $z f32) (result f32)
- (f32.div (f32.mul (get_local $x) (get_local $y)) (get_local $z)))
+ (f32.div (f32.mul (local.get $x) (local.get $y)) (local.get $z)))
(func (export "f64.no_regroup_mul_div") (param $x f64) (param $y f64) (param $z f64) (result f64)
- (f64.div (f64.mul (get_local $x) (get_local $y)) (get_local $z)))
+ (f64.div (f64.mul (local.get $x) (local.get $y)) (local.get $z)))
)
(assert_return (invoke "f32.no_regroup_mul_div" (f32.const -0x1.2d14a6p-115) (f32.const -0x1.575a6cp-64) (f32.const 0x1.5cee0ep-116)) (f32.const 0x0p+0))
@@ -314,9 +314,9 @@
(module
(func (export "f32.no_reassociate_add") (param $x f32) (param $y f32) (param $z f32) (param $w f32) (result f32)
- (f32.add (f32.add (f32.add (get_local $x) (get_local $y)) (get_local $z)) (get_local $w)))
+ (f32.add (f32.add (f32.add (local.get $x) (local.get $y)) (local.get $z)) (local.get $w)))
(func (export "f64.no_reassociate_add") (param $x f64) (param $y f64) (param $z f64) (param $w f64) (result f64)
- (f64.add (f64.add (f64.add (get_local $x) (get_local $y)) (get_local $z)) (get_local $w)))
+ (f64.add (f64.add (f64.add (local.get $x) (local.get $y)) (local.get $z)) (local.get $w)))
)
(assert_return (invoke "f32.no_reassociate_add" (f32.const -0x1.5f7ddcp+44) (f32.const 0x1.854e1p+34) (f32.const -0x1.b2068cp+47) (f32.const -0x1.209692p+41)) (f32.const -0x1.e26c76p+47))
@@ -334,9 +334,9 @@
(module
(func (export "f32.no_reassociate_mul") (param $x f32) (param $y f32) (param $z f32) (param $w f32) (result f32)
- (f32.mul (f32.mul (f32.mul (get_local $x) (get_local $y)) (get_local $z)) (get_local $w)))
+ (f32.mul (f32.mul (f32.mul (local.get $x) (local.get $y)) (local.get $z)) (local.get $w)))
(func (export "f64.no_reassociate_mul") (param $x f64) (param $y f64) (param $z f64) (param $w f64) (result f64)
- (f64.mul (f64.mul (f64.mul (get_local $x) (get_local $y)) (get_local $z)) (get_local $w)))
+ (f64.mul (f64.mul (f64.mul (local.get $x) (local.get $y)) (local.get $z)) (local.get $w)))
)
(assert_return (invoke "f32.no_reassociate_mul" (f32.const 0x1.950ba8p-116) (f32.const 0x1.efdacep-33) (f32.const -0x1.5f9bcp+102) (f32.const 0x1.f04508p-56)) (f32.const -0x1.ff356ep-101))
@@ -354,9 +354,9 @@
(module
(func (export "f32.no_fold_div_0") (param $x f32) (result f32)
- (f32.div (get_local $x) (f32.const 0.0)))
+ (f32.div (local.get $x) (f32.const 0.0)))
(func (export "f64.no_fold_div_0") (param $x f64) (result f64)
- (f64.div (get_local $x) (f64.const 0.0)))
+ (f64.div (local.get $x) (f64.const 0.0)))
)
(assert_return (invoke "f32.no_fold_div_0" (f32.const 1.0)) (f32.const infinity))
@@ -380,9 +380,9 @@
(module
(func (export "f32.no_fold_div_neg0") (param $x f32) (result f32)
- (f32.div (get_local $x) (f32.const -0.0)))
+ (f32.div (local.get $x) (f32.const -0.0)))
(func (export "f64.no_fold_div_neg0") (param $x f64) (result f64)
- (f64.div (get_local $x) (f64.const -0.0)))
+ (f64.div (local.get $x) (f64.const -0.0)))
)
(assert_return (invoke "f32.no_fold_div_neg0" (f32.const 1.0)) (f32.const -infinity))
@@ -406,11 +406,11 @@
(module
(func (export "f32.no_fold_to_hypot") (param $x f32) (param $y f32) (result f32)
- (f32.sqrt (f32.add (f32.mul (get_local $x) (get_local $x))
- (f32.mul (get_local $y) (get_local $y)))))
+ (f32.sqrt (f32.add (f32.mul (local.get $x) (local.get $x))
+ (f32.mul (local.get $y) (local.get $y)))))
(func (export "f64.no_fold_to_hypot") (param $x f64) (param $y f64) (result f64)
- (f64.sqrt (f64.add (f64.mul (get_local $x) (get_local $x))
- (f64.mul (get_local $y) (get_local $y)))))
+ (f64.sqrt (f64.add (f64.mul (local.get $x) (local.get $x))
+ (f64.mul (local.get $y) (local.get $y)))))
)
(assert_return (invoke "f32.no_fold_to_hypot" (f32.const 0x1.c2f338p-81) (f32.const 0x1.401b5ep-68)) (f32.const 0x1.401cccp-68))
@@ -428,7 +428,7 @@
(module
(func (export "f32.no_approximate_reciprocal") (param $x f32) (result f32)
- (f32.div (f32.const 1.0) (get_local $x)))
+ (f32.div (f32.const 1.0) (local.get $x)))
)
(assert_return (invoke "f32.no_approximate_reciprocal" (f32.const -0x1.2900b6p-10)) (f32.const -0x1.b950d4p+9))
@@ -441,9 +441,9 @@
(module
(func (export "f32.no_approximate_reciprocal_sqrt") (param $x f32) (result f32)
- (f32.div (f32.const 1.0) (f32.sqrt (get_local $x))))
+ (f32.div (f32.const 1.0) (f32.sqrt (local.get $x))))
(func (export "f64.no_fuse_reciprocal_sqrt") (param $x f64) (result f64)
- (f64.div (f64.const 1.0) (f64.sqrt (get_local $x))))
+ (f64.div (f64.const 1.0) (f64.sqrt (local.get $x))))
)
(assert_return (invoke "f32.no_approximate_reciprocal_sqrt" (f32.const 0x1.6af12ap-43)) (f32.const 0x1.300ed4p+21))
@@ -462,7 +462,7 @@
(module
(func (export "f32.no_approximate_sqrt_reciprocal") (param $x f32) (result f32)
- (f32.sqrt (f32.div (f32.const 1.0) (get_local $x))))
+ (f32.sqrt (f32.div (f32.const 1.0) (local.get $x))))
)
(assert_return (invoke "f32.no_approximate_sqrt_reciprocal" (f32.const 0x1.a4c986p+60)) (f32.const 0x1.8f5ac6p-31))
@@ -475,13 +475,13 @@
(module
(func (export "i32.no_fold_f32_s") (param i32) (result i32)
- (i32.trunc_s/f32 (f32.convert_s/i32 (get_local 0))))
+ (i32.trunc_f32_s (f32.convert_i32_s (local.get 0))))
(func (export "i32.no_fold_f32_u") (param i32) (result i32)
- (i32.trunc_u/f32 (f32.convert_u/i32 (get_local 0))))
+ (i32.trunc_f32_u (f32.convert_i32_u (local.get 0))))
(func (export "i64.no_fold_f64_s") (param i64) (result i64)
- (i64.trunc_s/f64 (f64.convert_s/i64 (get_local 0))))
+ (i64.trunc_f64_s (f64.convert_i64_s (local.get 0))))
(func (export "i64.no_fold_f64_u") (param i64) (result i64)
- (i64.trunc_u/f64 (f64.convert_u/i64 (get_local 0))))
+ (i64.trunc_f64_u (f64.convert_i64_u (local.get 0))))
)
(assert_return (invoke "i32.no_fold_f32_s" (i32.const 0x1000000)) (i32.const 0x1000000))
@@ -504,9 +504,9 @@
(module
(func (export "f32.no_fold_add_sub") (param $x f32) (param $y f32) (result f32)
- (f32.sub (f32.add (get_local $x) (get_local $y)) (get_local $y)))
+ (f32.sub (f32.add (local.get $x) (local.get $y)) (local.get $y)))
(func (export "f64.no_fold_add_sub") (param $x f64) (param $y f64) (result f64)
- (f64.sub (f64.add (get_local $x) (get_local $y)) (get_local $y)))
+ (f64.sub (f64.add (local.get $x) (local.get $y)) (local.get $y)))
)
(assert_return (invoke "f32.no_fold_add_sub" (f32.const 0x1.b553e4p-47) (f32.const -0x1.67db2cp-26)) (f32.const 0x1.cp-47))
@@ -525,9 +525,9 @@
(module
(func (export "f32.no_fold_sub_add") (param $x f32) (param $y f32) (result f32)
- (f32.add (f32.sub (get_local $x) (get_local $y)) (get_local $y)))
+ (f32.add (f32.sub (local.get $x) (local.get $y)) (local.get $y)))
(func (export "f64.no_fold_sub_add") (param $x f64) (param $y f64) (result f64)
- (f64.add (f64.sub (get_local $x) (get_local $y)) (get_local $y)))
+ (f64.add (f64.sub (local.get $x) (local.get $y)) (local.get $y)))
)
(assert_return (invoke "f32.no_fold_sub_add" (f32.const -0x1.523cb8p+9) (f32.const 0x1.93096cp+8)) (f32.const -0x1.523cbap+9))
@@ -546,9 +546,9 @@
(module
(func (export "f32.no_fold_mul_div") (param $x f32) (param $y f32) (result f32)
- (f32.div (f32.mul (get_local $x) (get_local $y)) (get_local $y)))
+ (f32.div (f32.mul (local.get $x) (local.get $y)) (local.get $y)))
(func (export "f64.no_fold_mul_div") (param $x f64) (param $y f64) (result f64)
- (f64.div (f64.mul (get_local $x) (get_local $y)) (get_local $y)))
+ (f64.div (f64.mul (local.get $x) (local.get $y)) (local.get $y)))
)
(assert_return (invoke "f32.no_fold_mul_div" (f32.const -0x1.cd859ap+54) (f32.const 0x1.6ca936p-47)) (f32.const -0x1.cd8598p+54))
@@ -567,9 +567,9 @@
(module
(func (export "f32.no_fold_div_mul") (param $x f32) (param $y f32) (result f32)
- (f32.mul (f32.div (get_local $x) (get_local $y)) (get_local $y)))
+ (f32.mul (f32.div (local.get $x) (local.get $y)) (local.get $y)))
(func (export "f64.no_fold_div_mul") (param $x f64) (param $y f64) (result f64)
- (f64.mul (f64.div (get_local $x) (get_local $y)) (get_local $y)))
+ (f64.mul (f64.div (local.get $x) (local.get $y)) (local.get $y)))
)
(assert_return (invoke "f32.no_fold_div_mul" (f32.const -0x1.dc6364p+38) (f32.const 0x1.d630ecp+29)) (f32.const -0x1.dc6362p+38))
@@ -588,7 +588,7 @@
(module
(func (export "no_fold_demote_promote") (param $x f64) (result f64)
- (f64.promote/f32 (f32.demote/f64 (get_local $x))))
+ (f64.promote_f32 (f32.demote_f64 (local.get $x))))
)
(assert_return (invoke "no_fold_demote_promote" (f64.const -0x1.dece272390f5dp-133)) (f64.const -0x1.decep-133))
@@ -602,7 +602,7 @@
(module
(func (export "no_fold_promote_demote") (param $x f32) (result f32)
- (f32.demote/f64 (f64.promote/f32 (get_local $x))))
+ (f32.demote_f64 (f64.promote_f32 (local.get $x))))
)
(assert_return (invoke "no_fold_promote_demote" (f32.const nan:0x200000)) (f32.const nan:0x600000))
@@ -623,9 +623,9 @@
(module
(func (export "no_demote_mixed_add") (param $x f64) (param $y f32) (result f32)
- (f32.demote/f64 (f64.add (get_local $x) (f64.promote/f32 (get_local $y)))))
+ (f32.demote_f64 (f64.add (local.get $x) (f64.promote_f32 (local.get $y)))))
(func (export "no_demote_mixed_add_commuted") (param $y f32) (param $x f64) (result f32)
- (f32.demote/f64 (f64.add (f64.promote/f32 (get_local $y)) (get_local $x))))
+ (f32.demote_f64 (f64.add (f64.promote_f32 (local.get $y)) (local.get $x))))
)
(assert_return (invoke "no_demote_mixed_add" (f64.const 0x1.f51a9d04854f9p-95) (f32.const 0x1.3f4e9cp-119)) (f32.const 0x1.f51a9ep-95))
@@ -644,7 +644,7 @@
(module
(func (export "no_demote_mixed_sub") (param $x f64) (param $y f32) (result f32)
- (f32.demote/f64 (f64.sub (get_local $x) (f64.promote/f32 (get_local $y)))))
+ (f32.demote_f64 (f64.sub (local.get $x) (f64.promote_f32 (local.get $y)))))
)
(assert_return (invoke "no_demote_mixed_sub" (f64.const 0x1.a0a183220e9b1p+82) (f32.const 0x1.c5acf8p+61)) (f32.const 0x1.a0a174p+82))
@@ -657,37 +657,37 @@
(module
(func (export "f32.i32.no_fold_trunc_s_convert_s") (param $x f32) (result f32)
- (f32.convert_s/i32 (i32.trunc_s/f32 (get_local $x))))
+ (f32.convert_i32_s (i32.trunc_f32_s (local.get $x))))
(func (export "f32.i32.no_fold_trunc_u_convert_s") (param $x f32) (result f32)
- (f32.convert_s/i32 (i32.trunc_u/f32 (get_local $x))))
+ (f32.convert_i32_s (i32.trunc_f32_u (local.get $x))))
(func (export "f32.i32.no_fold_trunc_s_convert_u") (param $x f32) (result f32)
- (f32.convert_u/i32 (i32.trunc_s/f32 (get_local $x))))
+ (f32.convert_i32_u (i32.trunc_f32_s (local.get $x))))
(func (export "f32.i32.no_fold_trunc_u_convert_u") (param $x f32) (result f32)
- (f32.convert_u/i32 (i32.trunc_u/f32 (get_local $x))))
+ (f32.convert_i32_u (i32.trunc_f32_u (local.get $x))))
(func (export "f64.i32.no_fold_trunc_s_convert_s") (param $x f64) (result f64)
- (f64.convert_s/i32 (i32.trunc_s/f64 (get_local $x))))
+ (f64.convert_i32_s (i32.trunc_f64_s (local.get $x))))
(func (export "f64.i32.no_fold_trunc_u_convert_s") (param $x f64) (result f64)
- (f64.convert_s/i32 (i32.trunc_u/f64 (get_local $x))))
+ (f64.convert_i32_s (i32.trunc_f64_u (local.get $x))))
(func (export "f64.i32.no_fold_trunc_s_convert_u") (param $x f64) (result f64)
- (f64.convert_u/i32 (i32.trunc_s/f64 (get_local $x))))
+ (f64.convert_i32_u (i32.trunc_f64_s (local.get $x))))
(func (export "f64.i32.no_fold_trunc_u_convert_u") (param $x f64) (result f64)
- (f64.convert_u/i32 (i32.trunc_u/f64 (get_local $x))))
+ (f64.convert_i32_u (i32.trunc_f64_u (local.get $x))))
(func (export "f32.i64.no_fold_trunc_s_convert_s") (param $x f32) (result f32)
- (f32.convert_s/i64 (i64.trunc_s/f32 (get_local $x))))
+ (f32.convert_i64_s (i64.trunc_f32_s (local.get $x))))
(func (export "f32.i64.no_fold_trunc_u_convert_s") (param $x f32) (result f32)
- (f32.convert_s/i64 (i64.trunc_u/f32 (get_local $x))))
+ (f32.convert_i64_s (i64.trunc_f32_u (local.get $x))))
(func (export "f32.i64.no_fold_trunc_s_convert_u") (param $x f32) (result f32)
- (f32.convert_u/i64 (i64.trunc_s/f32 (get_local $x))))
+ (f32.convert_i64_u (i64.trunc_f32_s (local.get $x))))
(func (export "f32.i64.no_fold_trunc_u_convert_u") (param $x f32) (result f32)
- (f32.convert_u/i64 (i64.trunc_u/f32 (get_local $x))))
+ (f32.convert_i64_u (i64.trunc_f32_u (local.get $x))))
(func (export "f64.i64.no_fold_trunc_s_convert_s") (param $x f64) (result f64)
- (f64.convert_s/i64 (i64.trunc_s/f64 (get_local $x))))
+ (f64.convert_i64_s (i64.trunc_f64_s (local.get $x))))
(func (export "f64.i64.no_fold_trunc_u_convert_s") (param $x f64) (result f64)
- (f64.convert_s/i64 (i64.trunc_u/f64 (get_local $x))))
+ (f64.convert_i64_s (i64.trunc_f64_u (local.get $x))))
(func (export "f64.i64.no_fold_trunc_s_convert_u") (param $x f64) (result f64)
- (f64.convert_u/i64 (i64.trunc_s/f64 (get_local $x))))
+ (f64.convert_i64_u (i64.trunc_f64_s (local.get $x))))
(func (export "f64.i64.no_fold_trunc_u_convert_u") (param $x f64) (result f64)
- (f64.convert_u/i64 (i64.trunc_u/f64 (get_local $x))))
+ (f64.convert_i64_u (i64.trunc_f64_u (local.get $x))))
)
(assert_return (invoke "f32.i32.no_fold_trunc_s_convert_s" (f32.const 1.5)) (f32.const 1.0))
@@ -732,23 +732,23 @@
(module
(memory 1 1)
- (func (export "init") (param $i i32) (param $x f32) (f32.store (get_local $i) (get_local $x)))
+ (func (export "init") (param $i i32) (param $x f32) (f32.store (local.get $i) (local.get $x)))
(func (export "run") (param $n i32) (param $z f32)
(local $i i32)
(block $exit
(loop $cont
(f32.store
- (get_local $i)
- (f32.div (f32.load (get_local $i)) (get_local $z))
+ (local.get $i)
+ (f32.div (f32.load (local.get $i)) (local.get $z))
)
- (set_local $i (i32.add (get_local $i) (i32.const 4)))
- (br_if $cont (i32.lt_u (get_local $i) (get_local $n)))
+ (local.set $i (i32.add (local.get $i) (i32.const 4)))
+ (br_if $cont (i32.lt_u (local.get $i) (local.get $n)))
)
)
)
- (func (export "check") (param $i i32) (result f32) (f32.load (get_local $i)))
+ (func (export "check") (param $i i32) (result f32) (f32.load (local.get $i)))
)
(invoke "init" (i32.const 0) (f32.const 15.1))
@@ -767,23 +767,23 @@
(module
(memory 1 1)
- (func (export "init") (param $i i32) (param $x f64) (f64.store (get_local $i) (get_local $x)))
+ (func (export "init") (param $i i32) (param $x f64) (f64.store (local.get $i) (local.get $x)))
(func (export "run") (param $n i32) (param $z f64)
(local $i i32)
(block $exit
(loop $cont
(f64.store
- (get_local $i)
- (f64.div (f64.load (get_local $i)) (get_local $z))
+ (local.get $i)
+ (f64.div (f64.load (local.get $i)) (local.get $z))
)
- (set_local $i (i32.add (get_local $i) (i32.const 8)))
- (br_if $cont (i32.lt_u (get_local $i) (get_local $n)))
+ (local.set $i (i32.add (local.get $i) (i32.const 8)))
+ (br_if $cont (i32.lt_u (local.get $i) (local.get $n)))
)
)
)
- (func (export "check") (param $i i32) (result f64) (f64.load (get_local $i)))
+ (func (export "check") (param $i i32) (result f64) (f64.load (local.get $i)))
)
(invoke "init" (i32.const 0) (f64.const 15.1))
@@ -803,15 +803,15 @@
;; Test that ult/ugt/etc. aren't folded to olt/ogt/etc.
(module
- (func (export "f32.ult") (param $x f32) (param $y f32) (result i32) (i32.eqz (f32.ge (get_local $x) (get_local $y))))
- (func (export "f32.ule") (param $x f32) (param $y f32) (result i32) (i32.eqz (f32.gt (get_local $x) (get_local $y))))
- (func (export "f32.ugt") (param $x f32) (param $y f32) (result i32) (i32.eqz (f32.le (get_local $x) (get_local $y))))
- (func (export "f32.uge") (param $x f32) (param $y f32) (result i32) (i32.eqz (f32.lt (get_local $x) (get_local $y))))
+ (func (export "f32.ult") (param $x f32) (param $y f32) (result i32) (i32.eqz (f32.ge (local.get $x) (local.get $y))))
+ (func (export "f32.ule") (param $x f32) (param $y f32) (result i32) (i32.eqz (f32.gt (local.get $x) (local.get $y))))
+ (func (export "f32.ugt") (param $x f32) (param $y f32) (result i32) (i32.eqz (f32.le (local.get $x) (local.get $y))))
+ (func (export "f32.uge") (param $x f32) (param $y f32) (result i32) (i32.eqz (f32.lt (local.get $x) (local.get $y))))
- (func (export "f64.ult") (param $x f64) (param $y f64) (result i32) (i32.eqz (f64.ge (get_local $x) (get_local $y))))
- (func (export "f64.ule") (param $x f64) (param $y f64) (result i32) (i32.eqz (f64.gt (get_local $x) (get_local $y))))
- (func (export "f64.ugt") (param $x f64) (param $y f64) (result i32) (i32.eqz (f64.le (get_local $x) (get_local $y))))
- (func (export "f64.uge") (param $x f64) (param $y f64) (result i32) (i32.eqz (f64.lt (get_local $x) (get_local $y))))
+ (func (export "f64.ult") (param $x f64) (param $y f64) (result i32) (i32.eqz (f64.ge (local.get $x) (local.get $y))))
+ (func (export "f64.ule") (param $x f64) (param $y f64) (result i32) (i32.eqz (f64.gt (local.get $x) (local.get $y))))
+ (func (export "f64.ugt") (param $x f64) (param $y f64) (result i32) (i32.eqz (f64.le (local.get $x) (local.get $y))))
+ (func (export "f64.uge") (param $x f64) (param $y f64) (result i32) (i32.eqz (f64.lt (local.get $x) (local.get $y))))
)
(assert_return (invoke "f32.ult" (f32.const 3.0) (f32.const 2.0)) (i32.const 0))
@@ -850,15 +850,15 @@
;; Test that x<y?x:y, etc. using select aren't folded to min, etc.
(module
- (func (export "f32.no_fold_lt_select") (param $x f32) (param $y f32) (result f32) (select (get_local $x) (get_local $y) (f32.lt (get_local $x) (get_local $y))))
- (func (export "f32.no_fold_le_select") (param $x f32) (param $y f32) (result f32) (select (get_local $x) (get_local $y) (f32.le (get_local $x) (get_local $y))))
- (func (export "f32.no_fold_gt_select") (param $x f32) (param $y f32) (result f32) (select (get_local $x) (get_local $y) (f32.gt (get_local $x) (get_local $y))))
- (func (export "f32.no_fold_ge_select") (param $x f32) (param $y f32) (result f32) (select (get_local $x) (get_local $y) (f32.ge (get_local $x) (get_local $y))))
+ (func (export "f32.no_fold_lt_select") (param $x f32) (param $y f32) (result f32) (select (local.get $x) (local.get $y) (f32.lt (local.get $x) (local.get $y))))
+ (func (export "f32.no_fold_le_select") (param $x f32) (param $y f32) (result f32) (select (local.get $x) (local.get $y) (f32.le (local.get $x) (local.get $y))))
+ (func (export "f32.no_fold_gt_select") (param $x f32) (param $y f32) (result f32) (select (local.get $x) (local.get $y) (f32.gt (local.get $x) (local.get $y))))
+ (func (export "f32.no_fold_ge_select") (param $x f32) (param $y f32) (result f32) (select (local.get $x) (local.get $y) (f32.ge (local.get $x) (local.get $y))))
- (func (export "f64.no_fold_lt_select") (param $x f64) (param $y f64) (result f64) (select (get_local $x) (get_local $y) (f64.lt (get_local $x) (get_local $y))))
- (func (export "f64.no_fold_le_select") (param $x f64) (param $y f64) (result f64) (select (get_local $x) (get_local $y) (f64.le (get_local $x) (get_local $y))))
- (func (export "f64.no_fold_gt_select") (param $x f64) (param $y f64) (result f64) (select (get_local $x) (get_local $y) (f64.gt (get_local $x) (get_local $y))))
- (func (export "f64.no_fold_ge_select") (param $x f64) (param $y f64) (result f64) (select (get_local $x) (get_local $y) (f64.ge (get_local $x) (get_local $y))))
+ (func (export "f64.no_fold_lt_select") (param $x f64) (param $y f64) (result f64) (select (local.get $x) (local.get $y) (f64.lt (local.get $x) (local.get $y))))
+ (func (export "f64.no_fold_le_select") (param $x f64) (param $y f64) (result f64) (select (local.get $x) (local.get $y) (f64.le (local.get $x) (local.get $y))))
+ (func (export "f64.no_fold_gt_select") (param $x f64) (param $y f64) (result f64) (select (local.get $x) (local.get $y) (f64.gt (local.get $x) (local.get $y))))
+ (func (export "f64.no_fold_ge_select") (param $x f64) (param $y f64) (result f64) (select (local.get $x) (local.get $y) (f64.ge (local.get $x) (local.get $y))))
)
(assert_return (invoke "f32.no_fold_lt_select" (f32.const 0.0) (f32.const nan)) (f32.const nan))
@@ -897,15 +897,15 @@
;; Test that x<y?x:y, etc. using if and else aren't folded to min, etc.
(module
- (func (export "f32.no_fold_lt_if") (param $x f32) (param $y f32) (result f32) (if f32 (f32.lt (get_local $x) (get_local $y)) (get_local $x) (get_local $y)))
- (func (export "f32.no_fold_le_if") (param $x f32) (param $y f32) (result f32) (if f32 (f32.le (get_local $x) (get_local $y)) (get_local $x) (get_local $y)))
- (func (export "f32.no_fold_gt_if") (param $x f32) (param $y f32) (result f32) (if f32 (f32.gt (get_local $x) (get_local $y)) (get_local $x) (get_local $y)))
- (func (export "f32.no_fold_ge_if") (param $x f32) (param $y f32) (result f32) (if f32 (f32.ge (get_local $x) (get_local $y)) (get_local $x) (get_local $y)))
+ (func (export "f32.no_fold_lt_if") (param $x f32) (param $y f32) (result f32) (if f32 (f32.lt (local.get $x) (local.get $y)) (local.get $x) (local.get $y)))
+ (func (export "f32.no_fold_le_if") (param $x f32) (param $y f32) (result f32) (if f32 (f32.le (local.get $x) (local.get $y)) (local.get $x) (local.get $y)))
+ (func (export "f32.no_fold_gt_if") (param $x f32) (param $y f32) (result f32) (if f32 (f32.gt (local.get $x) (local.get $y)) (local.get $x) (local.get $y)))
+ (func (export "f32.no_fold_ge_if") (param $x f32) (param $y f32) (result f32) (if f32 (f32.ge (local.get $x) (local.get $y)) (local.get $x) (local.get $y)))
- (func (export "f64.no_fold_lt_if") (param $x f64) (param $y f64) (result f64) (if f64 (f64.lt (get_local $x) (get_local $y)) (get_local $x) (get_local $y)))
- (func (export "f64.no_fold_le_if") (param $x f64) (param $y f64) (result f64) (if f64 (f64.le (get_local $x) (get_local $y)) (get_local $x) (get_local $y)))
- (func (export "f64.no_fold_gt_if") (param $x f64) (param $y f64) (result f64) (if f64 (f64.gt (get_local $x) (get_local $y)) (get_local $x) (get_local $y)))
- (func (export "f64.no_fold_ge_if") (param $x f64) (param $y f64) (result f64) (if f64 (f64.ge (get_local $x) (get_local $y)) (get_local $x) (get_local $y)))
+ (func (export "f64.no_fold_lt_if") (param $x f64) (param $y f64) (result f64) (if f64 (f64.lt (local.get $x) (local.get $y)) (local.get $x) (local.get $y)))
+ (func (export "f64.no_fold_le_if") (param $x f64) (param $y f64) (result f64) (if f64 (f64.le (local.get $x) (local.get $y)) (local.get $x) (local.get $y)))
+ (func (export "f64.no_fold_gt_if") (param $x f64) (param $y f64) (result f64) (if f64 (f64.gt (local.get $x) (local.get $y)) (local.get $x) (local.get $y)))
+ (func (export "f64.no_fold_ge_if") (param $x f64) (param $y f64) (result f64) (if f64 (f64.ge (local.get $x) (local.get $y)) (local.get $x) (local.get $y)))
)
(assert_return (invoke "f32.no_fold_lt_if" (f32.const 0.0) (f32.const nan)) (f32.const nan))
@@ -944,15 +944,15 @@
;; Test that x<0?-x:0, etc. using select aren't folded to abs
(module
- (func (export "f32.no_fold_lt_select_to_abs") (param $x f32) (result f32) (select (f32.neg (get_local $x)) (get_local $x) (f32.lt (get_local $x) (f32.const 0.0))))
- (func (export "f32.no_fold_le_select_to_abs") (param $x f32) (result f32) (select (f32.neg (get_local $x)) (get_local $x) (f32.le (get_local $x) (f32.const -0.0))))
- (func (export "f32.no_fold_gt_select_to_abs") (param $x f32) (result f32) (select (get_local $x) (f32.neg (get_local $x)) (f32.gt (get_local $x) (f32.const -0.0))))
- (func (export "f32.no_fold_ge_select_to_abs") (param $x f32) (result f32) (select (get_local $x) (f32.neg (get_local $x)) (f32.ge (get_local $x) (f32.const 0.0))))
+ (func (export "f32.no_fold_lt_select_to_abs") (param $x f32) (result f32) (select (f32.neg (local.get $x)) (local.get $x) (f32.lt (local.get $x) (f32.const 0.0))))
+ (func (export "f32.no_fold_le_select_to_abs") (param $x f32) (result f32) (select (f32.neg (local.get $x)) (local.get $x) (f32.le (local.get $x) (f32.const -0.0))))
+ (func (export "f32.no_fold_gt_select_to_abs") (param $x f32) (result f32) (select (local.get $x) (f32.neg (local.get $x)) (f32.gt (local.get $x) (f32.const -0.0))))
+ (func (export "f32.no_fold_ge_select_to_abs") (param $x f32) (result f32) (select (local.get $x) (f32.neg (local.get $x)) (f32.ge (local.get $x) (f32.const 0.0))))
- (func (export "f64.no_fold_lt_select_to_abs") (param $x f64) (result f64) (select (f64.neg (get_local $x)) (get_local $x) (f64.lt (get_local $x) (f64.const 0.0))))
- (func (export "f64.no_fold_le_select_to_abs") (param $x f64) (result f64) (select (f64.neg (get_local $x)) (get_local $x) (f64.le (get_local $x) (f64.const -0.0))))
- (func (export "f64.no_fold_gt_select_to_abs") (param $x f64) (result f64) (select (get_local $x) (f64.neg (get_local $x)) (f64.gt (get_local $x) (f64.const -0.0))))
- (func (export "f64.no_fold_ge_select_to_abs") (param $x f64) (result f64) (select (get_local $x) (f64.neg (get_local $x)) (f64.ge (get_local $x) (f64.const 0.0))))
+ (func (export "f64.no_fold_lt_select_to_abs") (param $x f64) (result f64) (select (f64.neg (local.get $x)) (local.get $x) (f64.lt (local.get $x) (f64.const 0.0))))
+ (func (export "f64.no_fold_le_select_to_abs") (param $x f64) (result f64) (select (f64.neg (local.get $x)) (local.get $x) (f64.le (local.get $x) (f64.const -0.0))))
+ (func (export "f64.no_fold_gt_select_to_abs") (param $x f64) (result f64) (select (local.get $x) (f64.neg (local.get $x)) (f64.gt (local.get $x) (f64.const -0.0))))
+ (func (export "f64.no_fold_ge_select_to_abs") (param $x f64) (result f64) (select (local.get $x) (f64.neg (local.get $x)) (f64.ge (local.get $x) (f64.const 0.0))))
)
(assert_return (invoke "f32.no_fold_lt_select_to_abs" (f32.const nan:0x200000)) (f32.const nan:0x200000))
@@ -991,15 +991,15 @@
;; Test that x<0?-x:0, etc. using if aren't folded to abs
(module
- (func (export "f32.no_fold_lt_if_to_abs") (param $x f32) (result f32) (if f32 (f32.lt (get_local $x) (f32.const 0.0)) (f32.neg (get_local $x)) (get_local $x)))
- (func (export "f32.no_fold_le_if_to_abs") (param $x f32) (result f32) (if f32 (f32.le (get_local $x) (f32.const -0.0)) (f32.neg (get_local $x)) (get_local $x)))
- (func (export "f32.no_fold_gt_if_to_abs") (param $x f32) (result f32) (if f32 (f32.gt (get_local $x) (f32.const -0.0)) (get_local $x) (f32.neg (get_local $x))))
- (func (export "f32.no_fold_ge_if_to_abs") (param $x f32) (result f32) (if f32 (f32.ge (get_local $x) (f32.const 0.0)) (get_local $x) (f32.neg (get_local $x))))
+ (func (export "f32.no_fold_lt_if_to_abs") (param $x f32) (result f32) (if f32 (f32.lt (local.get $x) (f32.const 0.0)) (f32.neg (local.get $x)) (local.get $x)))
+ (func (export "f32.no_fold_le_if_to_abs") (param $x f32) (result f32) (if f32 (f32.le (local.get $x) (f32.const -0.0)) (f32.neg (local.get $x)) (local.get $x)))
+ (func (export "f32.no_fold_gt_if_to_abs") (param $x f32) (result f32) (if f32 (f32.gt (local.get $x) (f32.const -0.0)) (local.get $x) (f32.neg (local.get $x))))
+ (func (export "f32.no_fold_ge_if_to_abs") (param $x f32) (result f32) (if f32 (f32.ge (local.get $x) (f32.const 0.0)) (local.get $x) (f32.neg (local.get $x))))
- (func (export "f64.no_fold_lt_if_to_abs") (param $x f64) (result f64) (if f64 (f64.lt (get_local $x) (f64.const 0.0)) (f64.neg (get_local $x)) (get_local $x)))
- (func (export "f64.no_fold_le_if_to_abs") (param $x f64) (result f64) (if f64 (f64.le (get_local $x) (f64.const -0.0)) (f64.neg (get_local $x)) (get_local $x)))
- (func (export "f64.no_fold_gt_if_to_abs") (param $x f64) (result f64) (if f64 (f64.gt (get_local $x) (f64.const -0.0)) (get_local $x) (f64.neg (get_local $x))))
- (func (export "f64.no_fold_ge_if_to_abs") (param $x f64) (result f64) (if f64 (f64.ge (get_local $x) (f64.const 0.0)) (get_local $x) (f64.neg (get_local $x))))
+ (func (export "f64.no_fold_lt_if_to_abs") (param $x f64) (result f64) (if f64 (f64.lt (local.get $x) (f64.const 0.0)) (f64.neg (local.get $x)) (local.get $x)))
+ (func (export "f64.no_fold_le_if_to_abs") (param $x f64) (result f64) (if f64 (f64.le (local.get $x) (f64.const -0.0)) (f64.neg (local.get $x)) (local.get $x)))
+ (func (export "f64.no_fold_gt_if_to_abs") (param $x f64) (result f64) (if f64 (f64.gt (local.get $x) (f64.const -0.0)) (local.get $x) (f64.neg (local.get $x))))
+ (func (export "f64.no_fold_ge_if_to_abs") (param $x f64) (result f64) (if f64 (f64.ge (local.get $x) (f64.const 0.0)) (local.get $x) (f64.neg (local.get $x))))
)
(assert_return (invoke "f32.no_fold_lt_if_to_abs" (f32.const nan:0x200000)) (f32.const nan:0x200000))
@@ -1064,13 +1064,13 @@
(local $q f32)
(local $z0 f32)
(local $z1 f32)
- (set_local $x (f32.const 156.25))
- (set_local $r (f32.const 208.333333334))
- (set_local $q (f32.const 1.77951304201))
- (set_local $z0 (f32.div (f32.mul (f32.neg (get_local $r)) (get_local $x)) (f32.sub (f32.mul (get_local $x) (get_local $q)) (get_local $r))))
- (set_local $z1 (f32.div (f32.mul (f32.neg (get_local $r)) (get_local $x)) (f32.sub (f32.mul (get_local $x) (get_local $q)) (get_local $r))))
- (block (br_if 0 (f32.eq (get_local $z0) (get_local $z1))) (unreachable))
- (get_local $z1)
+ (local.set $x (f32.const 156.25))
+ (local.set $r (f32.const 208.333333334))
+ (local.set $q (f32.const 1.77951304201))
+ (local.set $z0 (f32.div (f32.mul (f32.neg (local.get $r)) (local.get $x)) (f32.sub (f32.mul (local.get $x) (local.get $q)) (local.get $r))))
+ (local.set $z1 (f32.div (f32.mul (f32.neg (local.get $r)) (local.get $x)) (f32.sub (f32.mul (local.get $x) (local.get $q)) (local.get $r))))
+ (block (br_if 0 (f32.eq (local.get $z0) (local.get $z1))) (unreachable))
+ (local.get $z1)
)
)
@@ -1083,13 +1083,13 @@
(local $q f64)
(local $z0 f64)
(local $z1 f64)
- (set_local $x (f64.const 156.25))
- (set_local $r (f64.const 208.333333334))
- (set_local $q (f64.const 1.77951304201))
- (set_local $z0 (f64.div (f64.mul (f64.neg (get_local $r)) (get_local $x)) (f64.sub (f64.mul (get_local $x) (get_local $q)) (get_local $r))))
- (set_local $z1 (f64.div (f64.mul (f64.neg (get_local $r)) (get_local $x)) (f64.sub (f64.mul (get_local $x) (get_local $q)) (get_local $r))))
- (block (br_if 0 (f64.eq (get_local $z0) (get_local $z1))) (unreachable))
- (get_local $z1)
+ (local.set $x (f64.const 156.25))
+ (local.set $r (f64.const 208.333333334))
+ (local.set $q (f64.const 1.77951304201))
+ (local.set $z0 (f64.div (f64.mul (f64.neg (local.get $r)) (local.get $x)) (f64.sub (f64.mul (local.get $x) (local.get $q)) (local.get $r))))
+ (local.set $z1 (f64.div (f64.mul (f64.neg (local.get $r)) (local.get $x)) (f64.sub (f64.mul (local.get $x) (local.get $q)) (local.get $r))))
+ (block (br_if 0 (f64.eq (local.get $z0) (local.get $z1))) (unreachable))
+ (local.get $z1)
)
)
@@ -1100,7 +1100,7 @@
(module
(func (export "llvm_pr26746") (param $x f32) (result f32)
- (f32.sub (f32.const 0.0) (f32.sub (f32.const -0.0) (get_local $x)))
+ (f32.sub (f32.const 0.0) (f32.sub (f32.const -0.0) (local.get $x)))
)
)
@@ -1111,7 +1111,7 @@
(module
(func (export "llvm_pr27153") (param $x i32) (result f32)
- (f32.add (f32.convert_s/i32 (i32.and (get_local $x) (i32.const 268435455))) (f32.const -8388608.0))
+ (f32.add (f32.convert_i32_s (i32.and (local.get $x) (i32.const 268435455))) (f32.const -8388608.0))
)
)
@@ -1122,8 +1122,8 @@
(module
(func (export "llvm_pr27036") (param $x i32) (param $y i32) (result f32)
- (f32.add (f32.convert_s/i32 (i32.or (get_local $x) (i32.const -25034805)))
- (f32.convert_s/i32 (i32.and (get_local $y) (i32.const 14942208))))
+ (f32.add (f32.convert_i32_s (i32.or (local.get $x) (i32.const -25034805)))
+ (f32.convert_i32_s (i32.and (local.get $y) (i32.const 14942208))))
)
)
@@ -1139,15 +1139,15 @@
;; covered elsewhere.
(module
(func (export "thepast0") (param $a f64) (param $b f64) (param $c f64) (param $d f64) (result f64)
- (f64.div (f64.mul (get_local $a) (get_local $b)) (f64.mul (get_local $c) (get_local $d)))
+ (f64.div (f64.mul (local.get $a) (local.get $b)) (f64.mul (local.get $c) (local.get $d)))
)
(func (export "thepast1") (param $a f64) (param $b f64) (param $c f64) (result f64)
- (f64.sub (f64.mul (get_local $a) (get_local $b)) (get_local $c))
+ (f64.sub (f64.mul (local.get $a) (local.get $b)) (local.get $c))
)
(func (export "thepast2") (param $a f32) (param $b f32) (param $c f32) (result f32)
- (f32.mul (f32.mul (get_local $a) (get_local $b)) (get_local $c))
+ (f32.mul (f32.mul (local.get $a) (local.get $b)) (local.get $c))
)
)
@@ -1160,7 +1160,7 @@
(module
(func (export "inverse") (param $x f32) (result f32)
- (f32.div (f32.const 1.0) (get_local $x))
+ (f32.div (f32.const 1.0) (local.get $x))
)
)
@@ -1171,11 +1171,11 @@
(module
(func (export "f32_sqrt_minus_2") (param $x f32) (result f32)
- (f32.sub (f32.sqrt (get_local $x)) (f32.const 2.0))
+ (f32.sub (f32.sqrt (local.get $x)) (f32.const 2.0))
)
(func (export "f64_sqrt_minus_2") (param $x f64) (result f64)
- (f64.sub (f64.sqrt (get_local $x)) (f64.const 2.0))
+ (f64.sub (f64.sqrt (local.get $x)) (f64.const 2.0))
)
)
@@ -1186,10 +1186,10 @@
(module
(func (export "f32.no_fold_recip_recip") (param $x f32) (result f32)
- (f32.div (f32.const 1.0) (f32.div (f32.const 1.0) (get_local $x))))
+ (f32.div (f32.const 1.0) (f32.div (f32.const 1.0) (local.get $x))))
(func (export "f64.no_fold_recip_recip") (param $x f64) (result f64)
- (f64.div (f64.const 1.0) (f64.div (f64.const 1.0) (get_local $x))))
+ (f64.div (f64.const 1.0) (f64.div (f64.const 1.0) (local.get $x))))
)
(assert_return (invoke "f32.no_fold_recip_recip" (f32.const -0x1.e8bf18p+65)) (f32.const -0x1.e8bf16p+65))
@@ -1218,12 +1218,12 @@
(module
(func (export "f32.no_algebraic_factoring") (param $x f32) (param $y f32) (result f32)
- (f32.mul (f32.add (get_local $x) (get_local $y))
- (f32.sub (get_local $x) (get_local $y))))
+ (f32.mul (f32.add (local.get $x) (local.get $y))
+ (f32.sub (local.get $x) (local.get $y))))
(func (export "f64.no_algebraic_factoring") (param $x f64) (param $y f64) (result f64)
- (f64.mul (f64.add (get_local $x) (get_local $y))
- (f64.sub (get_local $x) (get_local $y))))
+ (f64.mul (f64.add (local.get $x) (local.get $y))
+ (f64.sub (local.get $x) (local.get $y))))
)
(assert_return (invoke "f32.no_algebraic_factoring" (f32.const -0x1.ef678ep-55) (f32.const 0x1.c160b8p-54)) (f32.const -0x1.129402p-107))
@@ -1242,12 +1242,12 @@
(module
(func (export "f32.no_algebraic_factoring") (param $x f32) (param $y f32) (result f32)
- (f32.sub (f32.mul (get_local $x) (get_local $x))
- (f32.mul (get_local $y) (get_local $y))))
+ (f32.sub (f32.mul (local.get $x) (local.get $x))
+ (f32.mul (local.get $y) (local.get $y))))
(func (export "f64.no_algebraic_factoring") (param $x f64) (param $y f64) (result f64)
- (f64.sub (f64.mul (get_local $x) (get_local $x))
- (f64.mul (get_local $y) (get_local $y))))
+ (f64.sub (f64.mul (local.get $x) (local.get $x))
+ (f64.mul (local.get $y) (local.get $y))))
)
(assert_return (invoke "f32.no_algebraic_factoring" (f32.const 0x1.8e2c14p-46) (f32.const 0x1.bad59ap-39)) (f32.const -0x1.7efe5p-77))
@@ -1318,41 +1318,41 @@
(local $t f32)
(block $exit
(loop $top
- (set_local $t
+ (local.set $t
(f32.sub
(f32.sub
- (tee_local $sum
+ (local.tee $sum
(f32.add
- (get_local $c)
- (tee_local $t
- (f32.sub (f32.load (get_local $p)) (get_local $t))
+ (local.get $c)
+ (local.tee $t
+ (f32.sub (f32.load (local.get $p)) (local.get $t))
)
)
)
- (get_local $c)
+ (local.get $c)
)
- (get_local $t)
+ (local.get $t)
)
)
- (set_local $p (i32.add (get_local $p) (i32.const 4)))
- (set_local $c (get_local $sum))
- (br_if $top (tee_local $n (i32.add (get_local $n) (i32.const -1))))
+ (local.set $p (i32.add (local.get $p) (i32.const 4)))
+ (local.set $c (local.get $sum))
+ (br_if $top (local.tee $n (i32.add (local.get $n) (i32.const -1))))
)
)
- (get_local $sum)
+ (local.get $sum)
)
(func (export "f32.plain_sum") (param $p i32) (param $n i32) (result f32)
(local $sum f32)
(block $exit
(loop $top
- (set_local $sum (f32.add (get_local $sum) (f32.load (get_local $p))))
- (set_local $p (i32.add (get_local $p) (i32.const 4)))
- (set_local $n (i32.add (get_local $n) (i32.const -1)))
- (br_if $top (get_local $n))
+ (local.set $sum (f32.add (local.get $sum) (f32.load (local.get $p))))
+ (local.set $p (i32.add (local.get $p) (i32.const 4)))
+ (local.set $n (i32.add (local.get $n) (i32.const -1)))
+ (br_if $top (local.get $n))
)
)
- (get_local $sum)
+ (local.get $sum)
)
)
@@ -1369,41 +1369,41 @@
(local $t f64)
(block $exit
(loop $top
- (set_local $t
+ (local.set $t
(f64.sub
(f64.sub
- (tee_local $sum
+ (local.tee $sum
(f64.add
- (get_local $c)
- (tee_local $t
- (f64.sub (f64.load (get_local $p)) (get_local $t))
+ (local.get $c)
+ (local.tee $t
+ (f64.sub (f64.load (local.get $p)) (local.get $t))
)
)
)
- (get_local $c)
+ (local.get $c)
)
- (get_local $t)
+ (local.get $t)
)
)
- (set_local $p (i32.add (get_local $p) (i32.const 8)))
- (set_local $c (get_local $sum))
- (br_if $top (tee_local $n (i32.add (get_local $n) (i32.const -1))))
+ (local.set $p (i32.add (local.get $p) (i32.const 8)))
+ (local.set $c (local.get $sum))
+ (br_if $top (local.tee $n (i32.add (local.get $n) (i32.const -1))))
)
)
- (get_local $sum)
+ (local.get $sum)
)
(func (export "f64.plain_sum") (param $p i32) (param $n i32) (result f64)
(local $sum f64)
(block $exit
(loop $top
- (set_local $sum (f64.add (get_local $sum) (f64.load (get_local $p))))
- (set_local $p (i32.add (get_local $p) (i32.const 8)))
- (set_local $n (i32.add (get_local $n) (i32.const -1)))
- (br_if $top (get_local $n))
+ (local.set $sum (f64.add (local.get $sum) (f64.load (local.get $p))))
+ (local.set $p (i32.add (local.get $p) (i32.const 8)))
+ (local.set $n (i32.add (local.get $n) (i32.const -1)))
+ (br_if $top (local.get $n))
)
)
- (get_local $sum)
+ (local.get $sum)
)
)
@@ -1414,10 +1414,10 @@
(module
(func (export "f32.no_fold_neg_sub") (param $x f32) (param $y f32) (result f32)
- (f32.neg (f32.sub (get_local $x) (get_local $y))))
+ (f32.neg (f32.sub (local.get $x) (local.get $y))))
(func (export "f64.no_fold_neg_sub") (param $x f64) (param $y f64) (result f64)
- (f64.neg (f64.sub (get_local $x) (get_local $y))))
+ (f64.neg (f64.sub (local.get $x) (local.get $y))))
)
(assert_return (invoke "f32.no_fold_neg_sub" (f32.const -0.0) (f32.const -0.0)) (f32.const -0.0))
@@ -1434,10 +1434,10 @@
(module
(func (export "f32.no_fold_add_neg") (param $x f32) (result f32)
- (f32.add (f32.neg (get_local $x)) (get_local $x)))
+ (f32.add (f32.neg (local.get $x)) (local.get $x)))
(func (export "f64.no_fold_add_neg") (param $x f64) (result f64)
- (f64.add (f64.neg (get_local $x)) (get_local $x)))
+ (f64.add (f64.neg (local.get $x)) (local.get $x)))
)
(assert_return (invoke "f32.no_fold_add_neg" (f32.const 0.0)) (f32.const 0.0))
@@ -1455,15 +1455,15 @@
(module
(func (export "f32.no_fold_6x_via_add") (param $x f32) (result f32)
(f32.add (f32.add (f32.add (f32.add (f32.add
- (get_local $x)
- (get_local $x)) (get_local $x)) (get_local $x))
- (get_local $x)) (get_local $x)))
+ (local.get $x)
+ (local.get $x)) (local.get $x)) (local.get $x))
+ (local.get $x)) (local.get $x)))
(func (export "f64.no_fold_6x_via_add") (param $x f64) (result f64)
(f64.add (f64.add (f64.add (f64.add (f64.add
- (get_local $x)
- (get_local $x)) (get_local $x)) (get_local $x))
- (get_local $x)) (get_local $x)))
+ (local.get $x)
+ (local.get $x)) (local.get $x)) (local.get $x))
+ (local.get $x)) (local.get $x)))
)
(assert_return (invoke "f32.no_fold_6x_via_add" (f32.const -0x1.598a0cp+99)) (f32.const -0x1.03278ap+102))
@@ -1483,10 +1483,10 @@
(module
(func (export "f32.no_fold_div_div") (param $x f32) (param $y f32) (param $z f32) (result f32)
- (f32.div (f32.div (get_local $x) (get_local $y)) (get_local $z)))
+ (f32.div (f32.div (local.get $x) (local.get $y)) (local.get $z)))
(func (export "f64.no_fold_div_div") (param $x f64) (param $y f64) (param $z f64) (result f64)
- (f64.div (f64.div (get_local $x) (get_local $y)) (get_local $z)))
+ (f64.div (f64.div (local.get $x) (local.get $y)) (local.get $z)))
)
(assert_return (invoke "f32.no_fold_div_div" (f32.const -0x1.f70228p+78) (f32.const -0x1.fbc612p-16) (f32.const -0x1.8c379p+10)) (f32.const -0x1.47b43cp+83))
@@ -1507,10 +1507,10 @@
(module
(func (export "f32.no_fold_mul_divs") (param $x f32) (param $y f32) (param $z f32) (param $w f32) (result f32)
- (f32.mul (f32.div (get_local $x) (get_local $y)) (f32.div (get_local $z) (get_local $w))))
+ (f32.mul (f32.div (local.get $x) (local.get $y)) (f32.div (local.get $z) (local.get $w))))
(func (export "f64.no_fold_mul_divs") (param $x f64) (param $y f64) (param $z f64) (param $w f64) (result f64)
- (f64.mul (f64.div (get_local $x) (get_local $y)) (f64.div (get_local $z) (get_local $w))))
+ (f64.mul (f64.div (local.get $x) (local.get $y)) (f64.div (local.get $z) (local.get $w))))
)
(assert_return (invoke "f32.no_fold_mul_divs" (f32.const -0x1.c483bep-109) (f32.const 0x1.ee1c3cp-92) (f32.const 0x1.800756p-88) (f32.const -0x1.95b972p+4)) (f32.const 0x1.bbd30cp-110))
@@ -1529,10 +1529,10 @@
(module
(func (export "f32.no_fold_add_divs") (param $x f32) (param $y f32) (param $z f32) (result f32)
- (f32.add (f32.div (get_local $x) (get_local $z)) (f32.div (get_local $y) (get_local $z))))
+ (f32.add (f32.div (local.get $x) (local.get $z)) (f32.div (local.get $y) (local.get $z))))
(func (export "f64.no_fold_add_divs") (param $x f64) (param $y f64) (param $z f64) (result f64)
- (f64.add (f64.div (get_local $x) (get_local $z)) (f64.div (get_local $y) (get_local $z))))
+ (f64.add (f64.div (local.get $x) (local.get $z)) (f64.div (local.get $y) (local.get $z))))
)
(assert_return (invoke "f32.no_fold_add_divs" (f32.const 0x1.795e7p+8) (f32.const -0x1.48a5eep-5) (f32.const -0x1.9a244cp+126)) (f32.const -0x1.d709b6p-119))
@@ -1551,10 +1551,10 @@
(module
(func (export "f32.no_fold_sqrt_square") (param $x f32) (result f32)
- (f32.sqrt (f32.mul (get_local $x) (get_local $x))))
+ (f32.sqrt (f32.mul (local.get $x) (local.get $x))))
(func (export "f64.no_fold_sqrt_square") (param $x f64) (result f64)
- (f64.sqrt (f64.mul (get_local $x) (get_local $x))))
+ (f64.sqrt (f64.mul (local.get $x) (local.get $x))))
)
(assert_return (invoke "f32.no_fold_sqrt_square" (f32.const -0x1.5cb316p-66)) (f32.const 0x1.5cb322p-66))
@@ -1573,10 +1573,10 @@
(module
(func (export "f32.no_fold_mul_sqrts") (param $x f32) (param $y f32) (result f32)
- (f32.mul (f32.sqrt (get_local $x)) (f32.sqrt (get_local $y))))
+ (f32.mul (f32.sqrt (local.get $x)) (f32.sqrt (local.get $y))))
(func (export "f64.no_fold_mul_sqrts") (param $x f64) (param $y f64) (result f64)
- (f64.mul (f64.sqrt (get_local $x)) (f64.sqrt (get_local $y))))
+ (f64.mul (f64.sqrt (local.get $x)) (f64.sqrt (local.get $y))))
)
(assert_return_nan (invoke "f32.no_fold_mul_sqrts" (f32.const 0x1.dddda8p-125) (f32.const -0x1.25d22ap-83)))
@@ -1595,10 +1595,10 @@
(module
(func (export "f32.no_fold_div_sqrts") (param $x f32) (param $y f32) (result f32)
- (f32.div (f32.sqrt (get_local $x)) (f32.sqrt (get_local $y))))
+ (f32.div (f32.sqrt (local.get $x)) (f32.sqrt (local.get $y))))
(func (export "f64.no_fold_div_sqrts") (param $x f64) (param $y f64) (result f64)
- (f64.div (f64.sqrt (get_local $x)) (f64.sqrt (get_local $y))))
+ (f64.div (f64.sqrt (local.get $x)) (f64.sqrt (local.get $y))))
)
(assert_return_nan (invoke "f32.no_fold_div_sqrts" (f32.const -0x1.bea9bap+25) (f32.const -0x1.db776ep-58)))
@@ -1617,10 +1617,10 @@
(module
(func (export "f32.no_fold_mul_sqrt_div") (param $x f32) (param $y f32) (result f32)
- (f32.div (f32.mul (get_local $x) (f32.sqrt (get_local $y))) (get_local $y)))
+ (f32.div (f32.mul (local.get $x) (f32.sqrt (local.get $y))) (local.get $y)))
(func (export "f64.no_fold_mul_sqrt_div") (param $x f64) (param $y f64) (result f64)
- (f64.div (f64.mul (get_local $x) (f64.sqrt (get_local $y))) (get_local $y)))
+ (f64.div (f64.mul (local.get $x) (f64.sqrt (local.get $y))) (local.get $y)))
)
(assert_return (invoke "f32.no_fold_mul_sqrt_div" (f32.const -0x1.f4a7cap+81) (f32.const 0x1.c09adep+92)) (f32.const -infinity))
@@ -1640,10 +1640,10 @@
(module
(func (export "f32.no_flush_intermediate_subnormal") (param $x f32) (param $y f32) (param $z f32) (result f32)
- (f32.mul (f32.mul (get_local $x) (get_local $y)) (get_local $z)))
+ (f32.mul (f32.mul (local.get $x) (local.get $y)) (local.get $z)))
(func (export "f64.no_flush_intermediate_subnormal") (param $x f64) (param $y f64) (param $z f64) (result f64)
- (f64.mul (f64.mul (get_local $x) (get_local $y)) (get_local $z)))
+ (f64.mul (f64.mul (local.get $x) (local.get $y)) (local.get $z)))
)
(assert_return (invoke "f32.no_flush_intermediate_subnormal" (f32.const 0x1p-126) (f32.const 0x1p-23) (f32.const 0x1p23)) (f32.const 0x1p-126))
@@ -1654,25 +1654,25 @@
(module
(func (export "f32.recoding_eq") (param $x f32) (param $y f32) (result i32)
- (f32.eq (f32.mul (get_local $x) (get_local $y)) (get_local $x)))
+ (f32.eq (f32.mul (local.get $x) (local.get $y)) (local.get $x)))
(func (export "f32.recoding_le") (param $x f32) (param $y f32) (result i32)
- (f32.le (f32.mul (get_local $x) (get_local $y)) (get_local $x)))
+ (f32.le (f32.mul (local.get $x) (local.get $y)) (local.get $x)))
(func (export "f32.recoding_lt") (param $x f32) (param $y f32) (result i32)
- (f32.lt (f32.mul (get_local $x) (get_local $y)) (get_local $x)))
+ (f32.lt (f32.mul (local.get $x) (local.get $y)) (local.get $x)))
(func (export "f64.recoding_eq") (param $x f64) (param $y f64) (result i32)
- (f64.eq (f64.mul (get_local $x) (get_local $y)) (get_local $x)))
+ (f64.eq (f64.mul (local.get $x) (local.get $y)) (local.get $x)))
(func (export "f64.recoding_le") (param $x f64) (param $y f64) (result i32)
- (f64.le (f64.mul (get_local $x) (get_local $y)) (get_local $x)))
+ (f64.le (f64.mul (local.get $x) (local.get $y)) (local.get $x)))
(func (export "f64.recoding_lt") (param $x f64) (param $y f64) (result i32)
- (f64.lt (f64.mul (get_local $x) (get_local $y)) (get_local $x)))
+ (f64.lt (f64.mul (local.get $x) (local.get $y)) (local.get $x)))
(func (export "recoding_demote") (param $x f64) (param $y f32) (result f32)
- (f32.mul (f32.demote/f64 (get_local $x)) (get_local $y)))
+ (f32.mul (f32.demote_f64 (local.get $x)) (local.get $y)))
)
(assert_return (invoke "f32.recoding_eq" (f32.const -infinity) (f32.const 3.0)) (i32.const 1))
@@ -1698,10 +1698,10 @@
(module
(func (export "f32.no_extended_precision_div") (param $x f32) (param $y f32) (param $z f32) (result i32)
- (f32.eq (f32.div (get_local $x) (get_local $y)) (get_local $z)))
+ (f32.eq (f32.div (local.get $x) (local.get $y)) (local.get $z)))
(func (export "f64.no_extended_precision_div") (param $x f64) (param $y f64) (param $z f64) (result i32)
- (f64.eq (f64.div (get_local $x) (get_local $y)) (get_local $z)))
+ (f64.eq (f64.div (local.get $x) (local.get $y)) (local.get $z)))
)
(assert_return (invoke "f32.no_extended_precision_div" (f32.const 3.0) (f32.const 7.0) (f32.const 0x1.b6db6ep-2)) (i32.const 1))
@@ -1714,10 +1714,10 @@
(module
(func (export "f32.no_distribute_exact") (param $x f32) (result f32)
- (f32.add (f32.mul (f32.const -8.0) (get_local $x)) (f32.mul (f32.const 8.0) (get_local $x))))
+ (f32.add (f32.mul (f32.const -8.0) (local.get $x)) (f32.mul (f32.const 8.0) (local.get $x))))
(func (export "f64.no_distribute_exact") (param $x f64) (result f64)
- (f64.add (f64.mul (f64.const -8.0) (get_local $x)) (f64.mul (f64.const 8.0) (get_local $x))))
+ (f64.add (f64.mul (f64.const -8.0) (local.get $x)) (f64.mul (f64.const 8.0) (local.get $x))))
)
(assert_return (invoke "f32.no_distribute_exact" (f32.const -0.0)) (f32.const 0.0))
@@ -1728,34 +1728,34 @@
;; https://xkcd.com/1047/
(module
(func (export "f32.sqrt") (param f32) (result f32)
- (f32.sqrt (get_local 0)))
+ (f32.sqrt (local.get 0)))
(func (export "f32.xkcd_sqrt_2") (param f32) (param f32) (param f32) (param f32) (result f32)
- (f32.add (f32.div (get_local 0) (get_local 1)) (f32.div (get_local 2) (f32.sub (get_local 3) (get_local 2)))))
+ (f32.add (f32.div (local.get 0) (local.get 1)) (f32.div (local.get 2) (f32.sub (local.get 3) (local.get 2)))))
(func (export "f32.xkcd_sqrt_3") (param f32) (param f32) (param f32) (result f32)
- (f32.div (f32.mul (get_local 0) (get_local 1)) (get_local 2)))
+ (f32.div (f32.mul (local.get 0) (local.get 1)) (local.get 2)))
(func (export "f32.xkcd_sqrt_5") (param f32) (param f32) (param f32) (result f32)
- (f32.add (f32.div (get_local 0) (get_local 1)) (f32.div (get_local 2) (get_local 0))))
+ (f32.add (f32.div (local.get 0) (local.get 1)) (f32.div (local.get 2) (local.get 0))))
(func (export "f32.xkcd_better_sqrt_5") (param f32) (param f32) (param f32) (param f32) (result f32)
- (f32.div (f32.add (get_local 0) (f32.mul (get_local 1) (get_local 2))) (f32.sub (get_local 3) (f32.mul (get_local 1) (get_local 2)))))
+ (f32.div (f32.add (local.get 0) (f32.mul (local.get 1) (local.get 2))) (f32.sub (local.get 3) (f32.mul (local.get 1) (local.get 2)))))
(func (export "f64.sqrt") (param f64) (result f64)
- (f64.sqrt (get_local 0)))
+ (f64.sqrt (local.get 0)))
(func (export "f64.xkcd_sqrt_2") (param f64) (param f64) (param f64) (param f64) (result f64)
- (f64.add (f64.div (get_local 0) (get_local 1)) (f64.div (get_local 2) (f64.sub (get_local 3) (get_local 2)))))
+ (f64.add (f64.div (local.get 0) (local.get 1)) (f64.div (local.get 2) (f64.sub (local.get 3) (local.get 2)))))
(func (export "f64.xkcd_sqrt_3") (param f64) (param f64) (param f64) (result f64)
- (f64.div (f64.mul (get_local 0) (get_local 1)) (get_local 2)))
+ (f64.div (f64.mul (local.get 0) (local.get 1)) (local.get 2)))
(func (export "f64.xkcd_sqrt_5") (param f64) (param f64) (param f64) (result f64)
- (f64.add (f64.div (get_local 0) (get_local 1)) (f64.div (get_local 2) (get_local 0))))
+ (f64.add (f64.div (local.get 0) (local.get 1)) (f64.div (local.get 2) (local.get 0))))
(func (export "f64.xkcd_better_sqrt_5") (param f64) (param f64) (param f64) (param f64) (result f64)
- (f64.div (f64.add (get_local 0) (f64.mul (get_local 1) (get_local 2))) (f64.sub (get_local 3) (f64.mul (get_local 1) (get_local 2)))))
+ (f64.div (f64.add (local.get 0) (f64.mul (local.get 1) (local.get 2))) (f64.sub (local.get 3) (f64.mul (local.get 1) (local.get 2)))))
)
(assert_return (invoke "f32.sqrt" (f32.const 2.0)) (f32.const 0x1.6a09e6p+0))
@@ -1785,10 +1785,10 @@
(f32.add
(f32.sub
(f32.add
- (tee_local $0 (f32.add (get_local $0) (get_local $0)))
+ (local.tee $0 (f32.add (local.get $0) (local.get $0)))
(f32.const 1)
)
- (get_local $0)
+ (local.get $0)
)
(f32.const -1)
)
@@ -1802,18 +1802,18 @@
(f32.sub
(f32.sub
(f32.add
- (get_local $0)
- (tee_local $1 (f32.add (get_local $1) (f32.const 1)))
+ (local.get $0)
+ (local.tee $1 (f32.add (local.get $1) (f32.const 1)))
)
- (get_local $0)
+ (local.get $0)
)
- (get_local $1)
+ (local.get $1)
)
(f32.const 0)
)
)
)
- (get_local $1)
+ (local.get $1)
)
(func (export "f64.compute_radix") (param $0 f64) (param $1 f64) (result f64)
@@ -1823,10 +1823,10 @@
(f64.add
(f64.sub
(f64.add
- (tee_local $0 (f64.add (get_local $0) (get_local $0)))
+ (local.tee $0 (f64.add (local.get $0) (local.get $0)))
(f64.const 1)
)
- (get_local $0)
+ (local.get $0)
)
(f64.const -1)
)
@@ -1840,18 +1840,18 @@
(f64.sub
(f64.sub
(f64.add
- (get_local $0)
- (tee_local $1 (f64.add (get_local $1) (f64.const 1)))
+ (local.get $0)
+ (local.tee $1 (f64.add (local.get $1) (f64.const 1)))
)
- (get_local $0)
+ (local.get $0)
)
- (get_local $1)
+ (local.get $1)
)
(f64.const 0)
)
)
)
- (get_local $1)
+ (local.get $1)
)
)
@@ -1863,10 +1863,10 @@
(module
(func (export "f32.no_fold_sub1_mul_add") (param $x f32) (param $y f32) (result f32)
- (f32.add (f32.mul (f32.sub (get_local $x) (f32.const 1.0)) (get_local $y)) (get_local $y)))
+ (f32.add (f32.mul (f32.sub (local.get $x) (f32.const 1.0)) (local.get $y)) (local.get $y)))
(func (export "f64.no_fold_sub1_mul_add") (param $x f64) (param $y f64) (result f64)
- (f64.add (f64.mul (f64.sub (get_local $x) (f64.const 1.0)) (get_local $y)) (get_local $y)))
+ (f64.add (f64.mul (f64.sub (local.get $x) (f64.const 1.0)) (local.get $y)) (local.get $y)))
)
(assert_return (invoke "f32.no_fold_sub1_mul_add" (f32.const 0x1p-32) (f32.const 1.0)) (f32.const 0x0p+0))
@@ -1877,16 +1877,16 @@
(module
(func (export "f32.no_fold_add_le_monotonicity") (param $x f32) (param $y f32) (param $z f32) (result i32)
- (f32.le (f32.add (get_local $x) (get_local $z)) (f32.add (get_local $y) (get_local $z))))
+ (f32.le (f32.add (local.get $x) (local.get $z)) (f32.add (local.get $y) (local.get $z))))
(func (export "f32.no_fold_add_ge_monotonicity") (param $x f32) (param $y f32) (param $z f32) (result i32)
- (f32.ge (f32.add (get_local $x) (get_local $z)) (f32.add (get_local $y) (get_local $z))))
+ (f32.ge (f32.add (local.get $x) (local.get $z)) (f32.add (local.get $y) (local.get $z))))
(func (export "f64.no_fold_add_le_monotonicity") (param $x f64) (param $y f64) (param $z f64) (result i32)
- (f64.le (f64.add (get_local $x) (get_local $z)) (f64.add (get_local $y) (get_local $z))))
+ (f64.le (f64.add (local.get $x) (local.get $z)) (f64.add (local.get $y) (local.get $z))))
(func (export "f64.no_fold_add_ge_monotonicity") (param $x f64) (param $y f64) (param $z f64) (result i32)
- (f64.ge (f64.add (get_local $x) (get_local $z)) (f64.add (get_local $y) (get_local $z))))
+ (f64.ge (f64.add (local.get $x) (local.get $z)) (f64.add (local.get $y) (local.get $z))))
)
(assert_return (invoke "f32.no_fold_add_le_monotonicity" (f32.const 0.0) (f32.const 0.0) (f32.const nan)) (i32.const 0))
@@ -1898,28 +1898,28 @@
(module
(func (export "f32.not_lt") (param $x f32) (param $y f32) (result i32)
- (i32.eqz (f32.lt (get_local $x) (get_local $y))))
+ (i32.eqz (f32.lt (local.get $x) (local.get $y))))
(func (export "f32.not_le") (param $x f32) (param $y f32) (result i32)
- (i32.eqz (f32.le (get_local $x) (get_local $y))))
+ (i32.eqz (f32.le (local.get $x) (local.get $y))))
(func (export "f32.not_gt") (param $x f32) (param $y f32) (result i32)
- (i32.eqz (f32.gt (get_local $x) (get_local $y))))
+ (i32.eqz (f32.gt (local.get $x) (local.get $y))))
(func (export "f32.not_ge") (param $x f32) (param $y f32) (result i32)
- (i32.eqz (f32.ge (get_local $x) (get_local $y))))
+ (i32.eqz (f32.ge (local.get $x) (local.get $y))))
(func (export "f64.not_lt") (param $x f64) (param $y f64) (result i32)
- (i32.eqz (f64.lt (get_local $x) (get_local $y))))
+ (i32.eqz (f64.lt (local.get $x) (local.get $y))))
(func (export "f64.not_le") (param $x f64) (param $y f64) (result i32)
- (i32.eqz (f64.le (get_local $x) (get_local $y))))
+ (i32.eqz (f64.le (local.get $x) (local.get $y))))
(func (export "f64.not_gt") (param $x f64) (param $y f64) (result i32)
- (i32.eqz (f64.gt (get_local $x) (get_local $y))))
+ (i32.eqz (f64.gt (local.get $x) (local.get $y))))
(func (export "f64.not_ge") (param $x f64) (param $y f64) (result i32)
- (i32.eqz (f64.ge (get_local $x) (get_local $y))))
+ (i32.eqz (f64.ge (local.get $x) (local.get $y))))
)
(assert_return (invoke "f32.not_lt" (f32.const nan) (f32.const 0.0)) (i32.const 1))
@@ -1951,22 +1951,22 @@
(module
(func (export "f32.no_trichotomy_lt") (param $x f32) (param $y f32) (result i32)
- (i32.or (f32.lt (get_local $x) (get_local $y)) (f32.ge (get_local $x) (get_local $y))))
+ (i32.or (f32.lt (local.get $x) (local.get $y)) (f32.ge (local.get $x) (local.get $y))))
(func (export "f32.no_trichotomy_le") (param $x f32) (param $y f32) (result i32)
- (i32.or (f32.le (get_local $x) (get_local $y)) (f32.gt (get_local $x) (get_local $y))))
+ (i32.or (f32.le (local.get $x) (local.get $y)) (f32.gt (local.get $x) (local.get $y))))
(func (export "f32.no_trichotomy_gt") (param $x f32) (param $y f32) (result i32)
- (i32.or (f32.gt (get_local $x) (get_local $y)) (f32.le (get_local $x) (get_local $y))))
+ (i32.or (f32.gt (local.get $x) (local.get $y)) (f32.le (local.get $x) (local.get $y))))
(func (export "f32.no_trichotomy_ge") (param $x f32) (param $y f32) (result i32)
- (i32.or (f32.ge (get_local $x) (get_local $y)) (f32.lt (get_local $x) (get_local $y))))
+ (i32.or (f32.ge (local.get $x) (local.get $y)) (f32.lt (local.get $x) (local.get $y))))
(func (export "f64.no_trichotomy_lt") (param $x f64) (param $y f64) (result i32)
- (i32.or (f64.lt (get_local $x) (get_local $y)) (f64.ge (get_local $x) (get_local $y))))
+ (i32.or (f64.lt (local.get $x) (local.get $y)) (f64.ge (local.get $x) (local.get $y))))
(func (export "f64.no_trichotomy_le") (param $x f64) (param $y f64) (result i32)
- (i32.or (f64.le (get_local $x) (get_local $y)) (f64.gt (get_local $x) (get_local $y))))
+ (i32.or (f64.le (local.get $x) (local.get $y)) (f64.gt (local.get $x) (local.get $y))))
(func (export "f64.no_trichotomy_gt") (param $x f64) (param $y f64) (result i32)
- (i32.or (f64.gt (get_local $x) (get_local $y)) (f64.le (get_local $x) (get_local $y))))
+ (i32.or (f64.gt (local.get $x) (local.get $y)) (f64.le (local.get $x) (local.get $y))))
(func (export "f64.no_trichotomy_ge") (param $x f64) (param $y f64) (result i32)
- (i32.or (f64.ge (get_local $x) (get_local $y)) (f64.lt (get_local $x) (get_local $y))))
+ (i32.or (f64.ge (local.get $x) (local.get $y)) (f64.lt (local.get $x) (local.get $y))))
)
(assert_return (invoke "f32.no_trichotomy_lt" (f32.const 0.0) (f32.const nan)) (i32.const 0))
diff --git a/test/spec/float_literals.wast b/test/spec/float_literals.wast
index c69d81fb7..6f890affd 100644
--- a/test/spec/float_literals.wast
+++ b/test/spec/float_literals.wast
@@ -2,76 +2,76 @@
(module
;; f32 special values
- (func (export "f32.nan") (result i32) (i32.reinterpret/f32 (f32.const nan)))
- (func (export "f32.positive_nan") (result i32) (i32.reinterpret/f32 (f32.const +nan)))
- (func (export "f32.negative_nan") (result i32) (i32.reinterpret/f32 (f32.const -nan)))
- (func (export "f32.plain_nan") (result i32) (i32.reinterpret/f32 (f32.const nan:0x400000)))
- (func (export "f32.informally_known_as_plain_snan") (result i32) (i32.reinterpret/f32 (f32.const nan:0x200000)))
- (func (export "f32.all_ones_nan") (result i32) (i32.reinterpret/f32 (f32.const -nan:0x7fffff)))
- (func (export "f32.misc_nan") (result i32) (i32.reinterpret/f32 (f32.const nan:0x012345)))
- (func (export "f32.misc_positive_nan") (result i32) (i32.reinterpret/f32 (f32.const +nan:0x304050)))
- (func (export "f32.misc_negative_nan") (result i32) (i32.reinterpret/f32 (f32.const -nan:0x2abcde)))
- (func (export "f32.infinity") (result i32) (i32.reinterpret/f32 (f32.const infinity)))
- (func (export "f32.positive_infinity") (result i32) (i32.reinterpret/f32 (f32.const +infinity)))
- (func (export "f32.negative_infinity") (result i32) (i32.reinterpret/f32 (f32.const -infinity)))
+ (func (export "f32.nan") (result i32) (i32.reinterpret_f32 (f32.const nan)))
+ (func (export "f32.positive_nan") (result i32) (i32.reinterpret_f32 (f32.const +nan)))
+ (func (export "f32.negative_nan") (result i32) (i32.reinterpret_f32 (f32.const -nan)))
+ (func (export "f32.plain_nan") (result i32) (i32.reinterpret_f32 (f32.const nan:0x400000)))
+ (func (export "f32.informally_known_as_plain_snan") (result i32) (i32.reinterpret_f32 (f32.const nan:0x200000)))
+ (func (export "f32.all_ones_nan") (result i32) (i32.reinterpret_f32 (f32.const -nan:0x7fffff)))
+ (func (export "f32.misc_nan") (result i32) (i32.reinterpret_f32 (f32.const nan:0x012345)))
+ (func (export "f32.misc_positive_nan") (result i32) (i32.reinterpret_f32 (f32.const +nan:0x304050)))
+ (func (export "f32.misc_negative_nan") (result i32) (i32.reinterpret_f32 (f32.const -nan:0x2abcde)))
+ (func (export "f32.infinity") (result i32) (i32.reinterpret_f32 (f32.const infinity)))
+ (func (export "f32.positive_infinity") (result i32) (i32.reinterpret_f32 (f32.const +infinity)))
+ (func (export "f32.negative_infinity") (result i32) (i32.reinterpret_f32 (f32.const -infinity)))
;; f32 numbers
- (func (export "f32.zero") (result i32) (i32.reinterpret/f32 (f32.const 0x0.0p0)))
- (func (export "f32.positive_zero") (result i32) (i32.reinterpret/f32 (f32.const +0x0.0p0)))
- (func (export "f32.negative_zero") (result i32) (i32.reinterpret/f32 (f32.const -0x0.0p0)))
- (func (export "f32.misc") (result i32) (i32.reinterpret/f32 (f32.const 0x1.921fb6p+2)))
- (func (export "f32.min_positive") (result i32) (i32.reinterpret/f32 (f32.const 0x1p-149)))
- (func (export "f32.min_normal") (result i32) (i32.reinterpret/f32 (f32.const 0x1p-126)))
- (func (export "f32.max_finite") (result i32) (i32.reinterpret/f32 (f32.const 0x1.fffffep+127)))
- (func (export "f32.max_subnormal") (result i32) (i32.reinterpret/f32 (f32.const 0x1.fffffcp-127)))
- (func (export "f32.trailing_dot") (result i32) (i32.reinterpret/f32 (f32.const 0x1.p10)))
+ (func (export "f32.zero") (result i32) (i32.reinterpret_f32 (f32.const 0x0.0p0)))
+ (func (export "f32.positive_zero") (result i32) (i32.reinterpret_f32 (f32.const +0x0.0p0)))
+ (func (export "f32.negative_zero") (result i32) (i32.reinterpret_f32 (f32.const -0x0.0p0)))
+ (func (export "f32.misc") (result i32) (i32.reinterpret_f32 (f32.const 0x1.921fb6p+2)))
+ (func (export "f32.min_positive") (result i32) (i32.reinterpret_f32 (f32.const 0x1p-149)))
+ (func (export "f32.min_normal") (result i32) (i32.reinterpret_f32 (f32.const 0x1p-126)))
+ (func (export "f32.max_finite") (result i32) (i32.reinterpret_f32 (f32.const 0x1.fffffep+127)))
+ (func (export "f32.max_subnormal") (result i32) (i32.reinterpret_f32 (f32.const 0x1.fffffcp-127)))
+ (func (export "f32.trailing_dot") (result i32) (i32.reinterpret_f32 (f32.const 0x1.p10)))
;; f32 in decimal format
- (func (export "f32_dec.zero") (result i32) (i32.reinterpret/f32 (f32.const 0.0e0)))
- (func (export "f32_dec.positive_zero") (result i32) (i32.reinterpret/f32 (f32.const +0.0e0)))
- (func (export "f32_dec.negative_zero") (result i32) (i32.reinterpret/f32 (f32.const -0.0e0)))
- (func (export "f32_dec.misc") (result i32) (i32.reinterpret/f32 (f32.const 6.28318548202514648)))
- (func (export "f32_dec.min_positive") (result i32) (i32.reinterpret/f32 (f32.const 1.4013e-45)))
- (func (export "f32_dec.min_normal") (result i32) (i32.reinterpret/f32 (f32.const 1.1754944e-38)))
- (func (export "f32_dec.max_subnormal") (result i32) (i32.reinterpret/f32 (f32.const 1.1754942e-38)))
- (func (export "f32_dec.max_finite") (result i32) (i32.reinterpret/f32 (f32.const 3.4028234e+38)))
- (func (export "f32_dec.trailing_dot") (result i32) (i32.reinterpret/f32 (f32.const 1.e10)))
+ (func (export "f32_dec.zero") (result i32) (i32.reinterpret_f32 (f32.const 0.0e0)))
+ (func (export "f32_dec.positive_zero") (result i32) (i32.reinterpret_f32 (f32.const +0.0e0)))
+ (func (export "f32_dec.negative_zero") (result i32) (i32.reinterpret_f32 (f32.const -0.0e0)))
+ (func (export "f32_dec.misc") (result i32) (i32.reinterpret_f32 (f32.const 6.28318548202514648)))
+ (func (export "f32_dec.min_positive") (result i32) (i32.reinterpret_f32 (f32.const 1.4013e-45)))
+ (func (export "f32_dec.min_normal") (result i32) (i32.reinterpret_f32 (f32.const 1.1754944e-38)))
+ (func (export "f32_dec.max_subnormal") (result i32) (i32.reinterpret_f32 (f32.const 1.1754942e-38)))
+ (func (export "f32_dec.max_finite") (result i32) (i32.reinterpret_f32 (f32.const 3.4028234e+38)))
+ (func (export "f32_dec.trailing_dot") (result i32) (i32.reinterpret_f32 (f32.const 1.e10)))
;; f64 special values
- (func (export "f64.nan") (result i64) (i64.reinterpret/f64 (f64.const nan)))
- (func (export "f64.positive_nan") (result i64) (i64.reinterpret/f64 (f64.const +nan)))
- (func (export "f64.negative_nan") (result i64) (i64.reinterpret/f64 (f64.const -nan)))
- (func (export "f64.plain_nan") (result i64) (i64.reinterpret/f64 (f64.const nan:0x8000000000000)))
- (func (export "f64.informally_known_as_plain_snan") (result i64) (i64.reinterpret/f64 (f64.const nan:0x4000000000000)))
- (func (export "f64.all_ones_nan") (result i64) (i64.reinterpret/f64 (f64.const -nan:0xfffffffffffff)))
- (func (export "f64.misc_nan") (result i64) (i64.reinterpret/f64 (f64.const nan:0x0123456789abc)))
- (func (export "f64.misc_positive_nan") (result i64) (i64.reinterpret/f64 (f64.const +nan:0x3040506070809)))
- (func (export "f64.misc_negative_nan") (result i64) (i64.reinterpret/f64 (f64.const -nan:0x2abcdef012345)))
- (func (export "f64.infinity") (result i64) (i64.reinterpret/f64 (f64.const infinity)))
- (func (export "f64.positive_infinity") (result i64) (i64.reinterpret/f64 (f64.const +infinity)))
- (func (export "f64.negative_infinity") (result i64) (i64.reinterpret/f64 (f64.const -infinity)))
+ (func (export "f64.nan") (result i64) (i64.reinterpret_f64 (f64.const nan)))
+ (func (export "f64.positive_nan") (result i64) (i64.reinterpret_f64 (f64.const +nan)))
+ (func (export "f64.negative_nan") (result i64) (i64.reinterpret_f64 (f64.const -nan)))
+ (func (export "f64.plain_nan") (result i64) (i64.reinterpret_f64 (f64.const nan:0x8000000000000)))
+ (func (export "f64.informally_known_as_plain_snan") (result i64) (i64.reinterpret_f64 (f64.const nan:0x4000000000000)))
+ (func (export "f64.all_ones_nan") (result i64) (i64.reinterpret_f64 (f64.const -nan:0xfffffffffffff)))
+ (func (export "f64.misc_nan") (result i64) (i64.reinterpret_f64 (f64.const nan:0x0123456789abc)))
+ (func (export "f64.misc_positive_nan") (result i64) (i64.reinterpret_f64 (f64.const +nan:0x3040506070809)))
+ (func (export "f64.misc_negative_nan") (result i64) (i64.reinterpret_f64 (f64.const -nan:0x2abcdef012345)))
+ (func (export "f64.infinity") (result i64) (i64.reinterpret_f64 (f64.const infinity)))
+ (func (export "f64.positive_infinity") (result i64) (i64.reinterpret_f64 (f64.const +infinity)))
+ (func (export "f64.negative_infinity") (result i64) (i64.reinterpret_f64 (f64.const -infinity)))
;; f64 numbers
- (func (export "f64.zero") (result i64) (i64.reinterpret/f64 (f64.const 0x0.0p0)))
- (func (export "f64.positive_zero") (result i64) (i64.reinterpret/f64 (f64.const +0x0.0p0)))
- (func (export "f64.negative_zero") (result i64) (i64.reinterpret/f64 (f64.const -0x0.0p0)))
- (func (export "f64.misc") (result i64) (i64.reinterpret/f64 (f64.const 0x1.921fb54442d18p+2)))
- (func (export "f64.min_positive") (result i64) (i64.reinterpret/f64 (f64.const 0x0.0000000000001p-1022)))
- (func (export "f64.min_normal") (result i64) (i64.reinterpret/f64 (f64.const 0x1p-1022)))
- (func (export "f64.max_subnormal") (result i64) (i64.reinterpret/f64 (f64.const 0x0.fffffffffffffp-1022)))
- (func (export "f64.max_finite") (result i64) (i64.reinterpret/f64 (f64.const 0x1.fffffffffffffp+1023)))
- (func (export "f64.trailing_dot") (result i64) (i64.reinterpret/f64 (f64.const 0x1.p100)))
+ (func (export "f64.zero") (result i64) (i64.reinterpret_f64 (f64.const 0x0.0p0)))
+ (func (export "f64.positive_zero") (result i64) (i64.reinterpret_f64 (f64.const +0x0.0p0)))
+ (func (export "f64.negative_zero") (result i64) (i64.reinterpret_f64 (f64.const -0x0.0p0)))
+ (func (export "f64.misc") (result i64) (i64.reinterpret_f64 (f64.const 0x1.921fb54442d18p+2)))
+ (func (export "f64.min_positive") (result i64) (i64.reinterpret_f64 (f64.const 0x0.0000000000001p-1022)))
+ (func (export "f64.min_normal") (result i64) (i64.reinterpret_f64 (f64.const 0x1p-1022)))
+ (func (export "f64.max_subnormal") (result i64) (i64.reinterpret_f64 (f64.const 0x0.fffffffffffffp-1022)))
+ (func (export "f64.max_finite") (result i64) (i64.reinterpret_f64 (f64.const 0x1.fffffffffffffp+1023)))
+ (func (export "f64.trailing_dot") (result i64) (i64.reinterpret_f64 (f64.const 0x1.p100)))
;; f64 numbers in decimal format
- (func (export "f64_dec.zero") (result i64) (i64.reinterpret/f64 (f64.const 0.0e0)))
- (func (export "f64_dec.positive_zero") (result i64) (i64.reinterpret/f64 (f64.const +0.0e0)))
- (func (export "f64_dec.negative_zero") (result i64) (i64.reinterpret/f64 (f64.const -0.0e0)))
- (func (export "f64_dec.misc") (result i64) (i64.reinterpret/f64 (f64.const 6.28318530717958623)))
- (func (export "f64_dec.min_positive") (result i64) (i64.reinterpret/f64 (f64.const 4.94066e-324)))
- (func (export "f64_dec.min_normal") (result i64) (i64.reinterpret/f64 (f64.const 2.2250738585072012e-308)))
- (func (export "f64_dec.max_subnormal") (result i64) (i64.reinterpret/f64 (f64.const 2.2250738585072011e-308)))
- (func (export "f64_dec.max_finite") (result i64) (i64.reinterpret/f64 (f64.const 1.7976931348623157e+308)))
- (func (export "f64_dec.trailing_dot") (result i64) (i64.reinterpret/f64 (f64.const 1.e100)))
+ (func (export "f64_dec.zero") (result i64) (i64.reinterpret_f64 (f64.const 0.0e0)))
+ (func (export "f64_dec.positive_zero") (result i64) (i64.reinterpret_f64 (f64.const +0.0e0)))
+ (func (export "f64_dec.negative_zero") (result i64) (i64.reinterpret_f64 (f64.const -0.0e0)))
+ (func (export "f64_dec.misc") (result i64) (i64.reinterpret_f64 (f64.const 6.28318530717958623)))
+ (func (export "f64_dec.min_positive") (result i64) (i64.reinterpret_f64 (f64.const 4.94066e-324)))
+ (func (export "f64_dec.min_normal") (result i64) (i64.reinterpret_f64 (f64.const 2.2250738585072012e-308)))
+ (func (export "f64_dec.max_subnormal") (result i64) (i64.reinterpret_f64 (f64.const 2.2250738585072011e-308)))
+ (func (export "f64_dec.max_finite") (result i64) (i64.reinterpret_f64 (f64.const 1.7976931348623157e+308)))
+ (func (export "f64_dec.trailing_dot") (result i64) (i64.reinterpret_f64 (f64.const 1.e100)))
)
(assert_return (invoke "f32.nan") (i32.const 0x7fc00000))
diff --git a/test/spec/float_misc.wast b/test/spec/float_misc.wast
index 41e29321d..ae223aba0 100644
--- a/test/spec/float_misc.wast
+++ b/test/spec/float_misc.wast
@@ -15,35 +15,35 @@
;; interesting cases.
(module
- (func (export "f32.add") (param $x f32) (param $y f32) (result f32) (f32.add (get_local $x) (get_local $y)))
- (func (export "f32.sub") (param $x f32) (param $y f32) (result f32) (f32.sub (get_local $x) (get_local $y)))
- (func (export "f32.mul") (param $x f32) (param $y f32) (result f32) (f32.mul (get_local $x) (get_local $y)))
- (func (export "f32.div") (param $x f32) (param $y f32) (result f32) (f32.div (get_local $x) (get_local $y)))
- (func (export "f32.sqrt") (param $x f32) (result f32) (f32.sqrt (get_local $x)))
- (func (export "f32.abs") (param $x f32) (result f32) (f32.abs (get_local $x)))
- (func (export "f32.neg") (param $x f32) (result f32) (f32.neg (get_local $x)))
- (func (export "f32.copysign") (param $x f32) (param $y f32) (result f32) (f32.copysign (get_local $x) (get_local $y)))
- (func (export "f32.ceil") (param $x f32) (result f32) (f32.ceil (get_local $x)))
- (func (export "f32.floor") (param $x f32) (result f32) (f32.floor (get_local $x)))
- (func (export "f32.trunc") (param $x f32) (result f32) (f32.trunc (get_local $x)))
- (func (export "f32.nearest") (param $x f32) (result f32) (f32.nearest (get_local $x)))
- (func (export "f32.min") (param $x f32) (param $y f32) (result f32) (f32.min (get_local $x) (get_local $y)))
- (func (export "f32.max") (param $x f32) (param $y f32) (result f32) (f32.max (get_local $x) (get_local $y)))
-
- (func (export "f64.add") (param $x f64) (param $y f64) (result f64) (f64.add (get_local $x) (get_local $y)))
- (func (export "f64.sub") (param $x f64) (param $y f64) (result f64) (f64.sub (get_local $x) (get_local $y)))
- (func (export "f64.mul") (param $x f64) (param $y f64) (result f64) (f64.mul (get_local $x) (get_local $y)))
- (func (export "f64.div") (param $x f64) (param $y f64) (result f64) (f64.div (get_local $x) (get_local $y)))
- (func (export "f64.sqrt") (param $x f64) (result f64) (f64.sqrt (get_local $x)))
- (func (export "f64.abs") (param $x f64) (result f64) (f64.abs (get_local $x)))
- (func (export "f64.neg") (param $x f64) (result f64) (f64.neg (get_local $x)))
- (func (export "f64.copysign") (param $x f64) (param $y f64) (result f64) (f64.copysign (get_local $x) (get_local $y)))
- (func (export "f64.ceil") (param $x f64) (result f64) (f64.ceil (get_local $x)))
- (func (export "f64.floor") (param $x f64) (result f64) (f64.floor (get_local $x)))
- (func (export "f64.trunc") (param $x f64) (result f64) (f64.trunc (get_local $x)))
- (func (export "f64.nearest") (param $x f64) (result f64) (f64.nearest (get_local $x)))
- (func (export "f64.min") (param $x f64) (param $y f64) (result f64) (f64.min (get_local $x) (get_local $y)))
- (func (export "f64.max") (param $x f64) (param $y f64) (result f64) (f64.max (get_local $x) (get_local $y)))
+ (func (export "f32.add") (param $x f32) (param $y f32) (result f32) (f32.add (local.get $x) (local.get $y)))
+ (func (export "f32.sub") (param $x f32) (param $y f32) (result f32) (f32.sub (local.get $x) (local.get $y)))
+ (func (export "f32.mul") (param $x f32) (param $y f32) (result f32) (f32.mul (local.get $x) (local.get $y)))
+ (func (export "f32.div") (param $x f32) (param $y f32) (result f32) (f32.div (local.get $x) (local.get $y)))
+ (func (export "f32.sqrt") (param $x f32) (result f32) (f32.sqrt (local.get $x)))
+ (func (export "f32.abs") (param $x f32) (result f32) (f32.abs (local.get $x)))
+ (func (export "f32.neg") (param $x f32) (result f32) (f32.neg (local.get $x)))
+ (func (export "f32.copysign") (param $x f32) (param $y f32) (result f32) (f32.copysign (local.get $x) (local.get $y)))
+ (func (export "f32.ceil") (param $x f32) (result f32) (f32.ceil (local.get $x)))
+ (func (export "f32.floor") (param $x f32) (result f32) (f32.floor (local.get $x)))
+ (func (export "f32.trunc") (param $x f32) (result f32) (f32.trunc (local.get $x)))
+ (func (export "f32.nearest") (param $x f32) (result f32) (f32.nearest (local.get $x)))
+ (func (export "f32.min") (param $x f32) (param $y f32) (result f32) (f32.min (local.get $x) (local.get $y)))
+ (func (export "f32.max") (param $x f32) (param $y f32) (result f32) (f32.max (local.get $x) (local.get $y)))
+
+ (func (export "f64.add") (param $x f64) (param $y f64) (result f64) (f64.add (local.get $x) (local.get $y)))
+ (func (export "f64.sub") (param $x f64) (param $y f64) (result f64) (f64.sub (local.get $x) (local.get $y)))
+ (func (export "f64.mul") (param $x f64) (param $y f64) (result f64) (f64.mul (local.get $x) (local.get $y)))
+ (func (export "f64.div") (param $x f64) (param $y f64) (result f64) (f64.div (local.get $x) (local.get $y)))
+ (func (export "f64.sqrt") (param $x f64) (result f64) (f64.sqrt (local.get $x)))
+ (func (export "f64.abs") (param $x f64) (result f64) (f64.abs (local.get $x)))
+ (func (export "f64.neg") (param $x f64) (result f64) (f64.neg (local.get $x)))
+ (func (export "f64.copysign") (param $x f64) (param $y f64) (result f64) (f64.copysign (local.get $x) (local.get $y)))
+ (func (export "f64.ceil") (param $x f64) (result f64) (f64.ceil (local.get $x)))
+ (func (export "f64.floor") (param $x f64) (result f64) (f64.floor (local.get $x)))
+ (func (export "f64.trunc") (param $x f64) (result f64) (f64.trunc (local.get $x)))
+ (func (export "f64.nearest") (param $x f64) (result f64) (f64.nearest (local.get $x)))
+ (func (export "f64.min") (param $x f64) (param $y f64) (result f64) (f64.min (local.get $x) (local.get $y)))
+ (func (export "f64.max") (param $x f64) (param $y f64) (result f64) (f64.max (local.get $x) (local.get $y)))
)
;; Miscellaneous values.
diff --git a/test/spec/forward.wast b/test/spec/forward.wast
index 43ab49348..6cf94dc9e 100644
--- a/test/spec/forward.wast
+++ b/test/spec/forward.wast
@@ -1,15 +1,15 @@
(module
(func $even (export "even") (param $n i32) (result i32)
- (if i32 (i32.eq (get_local $n) (i32.const 0))
+ (if i32 (i32.eq (local.get $n) (i32.const 0))
(i32.const 1)
- (call $odd (i32.sub (get_local $n) (i32.const 1)))
+ (call $odd (i32.sub (local.get $n) (i32.const 1)))
)
)
(func $odd (export "odd") (param $n i32) (result i32)
- (if i32 (i32.eq (get_local $n) (i32.const 0))
+ (if i32 (i32.eq (local.get $n) (i32.const 0))
(i32.const 0)
- (call $even (i32.sub (get_local $n) (i32.const 1)))
+ (call $even (i32.sub (local.get $n) (i32.const 1)))
)
)
)
diff --git a/test/spec/func-local-before-result.fail.wast b/test/spec/func-local-before-result.fail.wast
index 52026cf76..ec43d94a6 100644
--- a/test/spec/func-local-before-result.fail.wast
+++ b/test/spec/func-local-before-result.fail.wast
@@ -1 +1 @@
-(module (func (local i32) (result i32) (get_local 0)))
+(module (func (local i32) (result i32) (local.get 0)))
diff --git a/test/spec/func-result-before-param.fail.wast b/test/spec/func-result-before-param.fail.wast
index 93a930f42..7ecda8241 100644
--- a/test/spec/func-result-before-param.fail.wast
+++ b/test/spec/func-result-before-param.fail.wast
@@ -1 +1 @@
-(module (func (result i32) (param i32) (get_local 0)))
+(module (func (result i32) (param i32) (local.get 0)))
diff --git a/test/spec/func.wast b/test/spec/func.wast
index 1ad375b32..83fb1aff3 100644
--- a/test/spec/func.wast
+++ b/test/spec/func.wast
@@ -47,44 +47,44 @@
;; Typing of locals
- (func (export "local-first-i32") (result i32) (local i32 i32) (get_local 0))
- (func (export "local-first-i64") (result i64) (local i64 i64) (get_local 0))
- (func (export "local-first-f32") (result f32) (local f32 f32) (get_local 0))
- (func (export "local-first-f64") (result f64) (local f64 f64) (get_local 0))
- (func (export "local-second-i32") (result i32) (local i32 i32) (get_local 1))
- (func (export "local-second-i64") (result i64) (local i64 i64) (get_local 1))
- (func (export "local-second-f32") (result f32) (local f32 f32) (get_local 1))
- (func (export "local-second-f64") (result f64) (local f64 f64) (get_local 1))
+ (func (export "local-first-i32") (result i32) (local i32 i32) (local.get 0))
+ (func (export "local-first-i64") (result i64) (local i64 i64) (local.get 0))
+ (func (export "local-first-f32") (result f32) (local f32 f32) (local.get 0))
+ (func (export "local-first-f64") (result f64) (local f64 f64) (local.get 0))
+ (func (export "local-second-i32") (result i32) (local i32 i32) (local.get 1))
+ (func (export "local-second-i64") (result i64) (local i64 i64) (local.get 1))
+ (func (export "local-second-f32") (result f32) (local f32 f32) (local.get 1))
+ (func (export "local-second-f64") (result f64) (local f64 f64) (local.get 1))
(func (export "local-mixed") (result f64)
(local f32) (local $x i32) (local i64 i32) (local) (local f64 i32)
- (drop (f32.neg (get_local 0)))
- (drop (i32.eqz (get_local 1)))
- (drop (i64.eqz (get_local 2)))
- (drop (i32.eqz (get_local 3)))
- (drop (f64.neg (get_local 4)))
- (drop (i32.eqz (get_local 5)))
- (get_local 4)
+ (drop (f32.neg (local.get 0)))
+ (drop (i32.eqz (local.get 1)))
+ (drop (i64.eqz (local.get 2)))
+ (drop (i32.eqz (local.get 3)))
+ (drop (f64.neg (local.get 4)))
+ (drop (i32.eqz (local.get 5)))
+ (local.get 4)
)
;; Typing of parameters
- (func (export "param-first-i32") (param i32 i32) (result i32) (get_local 0))
- (func (export "param-first-i64") (param i64 i64) (result i64) (get_local 0))
- (func (export "param-first-f32") (param f32 f32) (result f32) (get_local 0))
- (func (export "param-first-f64") (param f64 f64) (result f64) (get_local 0))
- (func (export "param-second-i32") (param i32 i32) (result i32) (get_local 1))
- (func (export "param-second-i64") (param i64 i64) (result i64) (get_local 1))
- (func (export "param-second-f32") (param f32 f32) (result f32) (get_local 1))
- (func (export "param-second-f64") (param f64 f64) (result f64) (get_local 1))
+ (func (export "param-first-i32") (param i32 i32) (result i32) (local.get 0))
+ (func (export "param-first-i64") (param i64 i64) (result i64) (local.get 0))
+ (func (export "param-first-f32") (param f32 f32) (result f32) (local.get 0))
+ (func (export "param-first-f64") (param f64 f64) (result f64) (local.get 0))
+ (func (export "param-second-i32") (param i32 i32) (result i32) (local.get 1))
+ (func (export "param-second-i64") (param i64 i64) (result i64) (local.get 1))
+ (func (export "param-second-f32") (param f32 f32) (result f32) (local.get 1))
+ (func (export "param-second-f64") (param f64 f64) (result f64) (local.get 1))
(func (export "param-mixed") (param f32 i32) (param) (param $x i64) (param i32 f64 i32)
(result f64)
- (drop (f32.neg (get_local 0)))
- (drop (i32.eqz (get_local 1)))
- (drop (i64.eqz (get_local 2)))
- (drop (i32.eqz (get_local 3)))
- (drop (f64.neg (get_local 4)))
- (drop (i32.eqz (get_local 5)))
- (get_local 4)
+ (drop (f32.neg (local.get 0)))
+ (drop (i32.eqz (local.get 1)))
+ (drop (i64.eqz (local.get 2)))
+ (drop (i32.eqz (local.get 3)))
+ (drop (f64.neg (local.get 4)))
+ (drop (i32.eqz (local.get 5)))
+ (local.get 4)
)
;; Typing of result
@@ -119,34 +119,34 @@
)
(func (export "break-br_if-empty") (param i32)
- (br_if 0 (get_local 0))
+ (br_if 0 (local.get 0))
)
(func (export "break-br_if-num") (param i32) (result i32)
- (drop (br_if 0 (i32.const 50) (get_local 0))) (i32.const 51)
+ (drop (br_if 0 (i32.const 50) (local.get 0))) (i32.const 51)
)
(func (export "break-br_table-empty") (param i32)
- (br_table 0 0 0 (get_local 0))
+ (br_table 0 0 0 (local.get 0))
)
(func (export "break-br_table-num") (param i32) (result i32)
- (br_table 0 0 (i32.const 50) (get_local 0)) (i32.const 51)
+ (br_table 0 0 (i32.const 50) (local.get 0)) (i32.const 51)
)
(func (export "break-br_table-nested-empty") (param i32)
- (block (br_table 0 1 0 (get_local 0)))
+ (block (br_table 0 1 0 (local.get 0)))
)
(func (export "break-br_table-nested-num") (param i32) (result i32)
(i32.add
- (block i32 (br_table 0 1 0 (i32.const 50) (get_local 0)) (i32.const 51))
+ (block i32 (br_table 0 1 0 (i32.const 50) (local.get 0)) (i32.const 51))
(i32.const 2)
)
)
;; Default initialization of locals
- (func (export "init-local-i32") (result i32) (local i32) (get_local 0))
- (func (export "init-local-i64") (result i64) (local i64) (get_local 0))
- (func (export "init-local-f32") (result f32) (local f32) (get_local 0))
- (func (export "init-local-f64") (result f64) (local f64) (get_local 0))
+ (func (export "init-local-i32") (result i32) (local i32) (local.get 0))
+ (func (export "init-local-i64") (result i64) (local i64) (local.get 0))
+ (func (export "init-local-f32") (result f32) (local f32) (local.get 0))
+ (func (export "init-local-f64") (result f64) (local f64) (local.get 0))
;; Desugaring of implicit type signature
@@ -158,7 +158,7 @@
(type $empty-sig-duplicate (func))
(type $complex-sig-duplicate (func (param f64 i64 f64 i64 f64 i64 f32 i32)))
- (table anyfunc
+ (table funcref
(elem
$complex-sig-3 $empty-sig-2 $complex-sig-1 $complex-sig-3 $empty-sig-1
)
@@ -312,15 +312,15 @@
;; Invalid typing of locals
(assert_invalid
- (module (func $type-local-num-vs-num (result i64) (local i32) (get_local 0)))
+ (module (func $type-local-num-vs-num (result i64) (local i32) (local.get 0)))
"type mismatch"
)
(assert_invalid
- (module (func $type-local-num-vs-num (local f32) (i32.eqz (get_local 0))))
+ (module (func $type-local-num-vs-num (local f32) (i32.eqz (local.get 0))))
"type mismatch"
)
(assert_invalid
- (module (func $type-local-num-vs-num (local f64 i64) (f64.neg (get_local 1))))
+ (module (func $type-local-num-vs-num (local f64 i64) (f64.neg (local.get 1))))
"type mismatch"
)
@@ -328,15 +328,15 @@
;; Invalid typing of parameters
(assert_invalid
- (module (func $type-param-num-vs-num (param i32) (result i64) (get_local 0)))
+ (module (func $type-param-num-vs-num (param i32) (result i64) (local.get 0)))
"type mismatch"
)
(assert_invalid
- (module (func $type-param-num-vs-num (param f32) (i32.eqz (get_local 0))))
+ (module (func $type-param-num-vs-num (param f32) (i32.eqz (local.get 0))))
"type mismatch"
)
(assert_invalid
- (module (func $type-param-num-vs-num (param f64 i64) (f64.neg (get_local 1))))
+ (module (func $type-param-num-vs-num (param f64 i64) (f64.neg (local.get 1))))
"type mismatch"
)
diff --git a/test/spec/func_ptrs.wast b/test/spec/func_ptrs.wast
index 359dd63c4..1844462b8 100644
--- a/test/spec/func_ptrs.wast
+++ b/test/spec/func_ptrs.wast
@@ -13,15 +13,15 @@
(func (type $S))
(func (export "one") (type 4) (i32.const 13))
- (func (export "two") (type $T) (i32.add (get_local 0) (i32.const 1)))
+ (func (export "two") (type $T) (i32.add (local.get 0) (i32.const 1)))
;; Both signature and parameters are allowed (and required to match)
;; since this allows the naming of parameters.
(func (export "three") (type $T) (param $a i32) (result i32)
- (i32.sub (get_local 0) (i32.const 2))
+ (i32.sub (local.get 0) (i32.const 2))
)
- (func (export "four") (type $U) (call $print (get_local 0)))
+ (func (export "four") (type $U) (call $print (local.get 0)))
)
(assert_return (invoke "one") (i32.const 13))
(assert_return (invoke "two" (i32.const 13)) (i32.const 14))
@@ -32,15 +32,15 @@
(assert_invalid (module (elem (i32.const 0) 0) (func)) "unknown table")
(assert_invalid
- (module (table 1 anyfunc) (elem (i64.const 0)))
+ (module (table 1 funcref) (elem (i64.const 0)))
"type mismatch"
)
(assert_invalid
- (module (table 1 anyfunc) (elem (i32.ctz (i32.const 0))))
+ (module (table 1 funcref) (elem (i32.ctz (i32.const 0))))
"constant expression required"
)
(assert_invalid
- (module (table 1 anyfunc) (elem (nop)))
+ (module (table 1 funcref) (elem (nop)))
"constant expression required"
)
@@ -50,7 +50,7 @@
(module
(type $T (func (param) (result i32)))
(type $U (func (param) (result i32)))
- (table anyfunc (elem $t1 $t2 $t3 $u1 $u2 $t1 $t3))
+ (table funcref (elem $t1 $t2 $t3 $u1 $u2 $t1 $t3))
(func $t1 (type $T) (i32.const 1))
(func $t2 (type $T) (i32.const 2))
@@ -59,11 +59,11 @@
(func $u2 (type $U) (i32.const 5))
(func (export "callt") (param $i i32) (result i32)
- (call_indirect (type $T) (get_local $i))
+ (call_indirect (type $T) (local.get $i))
)
(func (export "callu") (param $i i32) (result i32)
- (call_indirect (type $U) (get_local $i))
+ (call_indirect (type $U) (local.get $i))
)
)
@@ -91,13 +91,13 @@
(module
(type $T (func (result i32)))
- (table anyfunc (elem 0 1))
+ (table funcref (elem 0 1))
(func $t1 (type $T) (i32.const 1))
(func $t2 (type $T) (i32.const 2))
(func (export "callt") (param $i i32) (result i32)
- (call_indirect (type $T) (get_local $i))
+ (call_indirect (type $T) (local.get $i))
)
)
diff --git a/test/spec/get_local.wast b/test/spec/get_local.wast
index e1f9625b9..34353fd20 100644
--- a/test/spec/get_local.wast
+++ b/test/spec/get_local.wast
@@ -1,55 +1,55 @@
-;; Test `get_local` operator
+;; Test `local.get` operator
(module
;; Typing
- (func (export "type-local-i32") (result i32) (local i32) (get_local 0))
- (func (export "type-local-i64") (result i64) (local i64) (get_local 0))
- (func (export "type-local-f32") (result f32) (local f32) (get_local 0))
- (func (export "type-local-f64") (result f64) (local f64) (get_local 0))
+ (func (export "type-local-i32") (result i32) (local i32) (local.get 0))
+ (func (export "type-local-i64") (result i64) (local i64) (local.get 0))
+ (func (export "type-local-f32") (result f32) (local f32) (local.get 0))
+ (func (export "type-local-f64") (result f64) (local f64) (local.get 0))
- (func (export "type-param-i32") (param i32) (result i32) (get_local 0))
- (func (export "type-param-i64") (param i64) (result i64) (get_local 0))
- (func (export "type-param-f32") (param f32) (result f32) (get_local 0))
- (func (export "type-param-f64") (param f64) (result f64) (get_local 0))
+ (func (export "type-param-i32") (param i32) (result i32) (local.get 0))
+ (func (export "type-param-i64") (param i64) (result i64) (local.get 0))
+ (func (export "type-param-f32") (param f32) (result f32) (local.get 0))
+ (func (export "type-param-f64") (param f64) (result f64) (local.get 0))
(func (export "type-mixed") (param i64 f32 f64 i32 i32)
(local f32 i64 i64 f64)
- (drop (i64.eqz (get_local 0)))
- (drop (f32.neg (get_local 1)))
- (drop (f64.neg (get_local 2)))
- (drop (i32.eqz (get_local 3)))
- (drop (i32.eqz (get_local 4)))
- (drop (f32.neg (get_local 5)))
- (drop (i64.eqz (get_local 6)))
- (drop (i64.eqz (get_local 7)))
- (drop (f64.neg (get_local 8)))
+ (drop (i64.eqz (local.get 0)))
+ (drop (f32.neg (local.get 1)))
+ (drop (f64.neg (local.get 2)))
+ (drop (i32.eqz (local.get 3)))
+ (drop (i32.eqz (local.get 4)))
+ (drop (f32.neg (local.get 5)))
+ (drop (i64.eqz (local.get 6)))
+ (drop (i64.eqz (local.get 7)))
+ (drop (f64.neg (local.get 8)))
)
;; Reading
(func (export "read") (param i64 f32 f64 i32 i32) (result f64)
(local f32 i64 i64 f64)
- (set_local 5 (f32.const 5.5))
- (set_local 6 (i64.const 6))
- (set_local 8 (f64.const 8))
+ (local.set 5 (f32.const 5.5))
+ (local.set 6 (i64.const 6))
+ (local.set 8 (f64.const 8))
(f64.add
- (f64.convert_u/i64 (get_local 0))
+ (f64.convert_i64_u (local.get 0))
(f64.add
- (f64.promote/f32 (get_local 1))
+ (f64.promote_f32 (local.get 1))
(f64.add
- (get_local 2)
+ (local.get 2)
(f64.add
- (f64.convert_u/i32 (get_local 3))
+ (f64.convert_i32_u (local.get 3))
(f64.add
- (f64.convert_s/i32 (get_local 4))
+ (f64.convert_i32_s (local.get 4))
(f64.add
- (f64.promote/f32 (get_local 5))
+ (f64.promote_f32 (local.get 5))
(f64.add
- (f64.convert_u/i64 (get_local 6))
+ (f64.convert_i64_u (local.get 6))
(f64.add
- (f64.convert_u/i64 (get_local 7))
- (get_local 8)
+ (f64.convert_i64_u (local.get 7))
+ (local.get 8)
)
)
)
@@ -88,15 +88,15 @@
;; Invalid typing of access to locals
(assert_invalid
- (module (func $type-local-num-vs-num (result i64) (local i32) (get_local 0)))
+ (module (func $type-local-num-vs-num (result i64) (local i32) (local.get 0)))
"type mismatch"
)
(assert_invalid
- (module (func $type-local-num-vs-num (local f32) (i32.eqz (get_local 0))))
+ (module (func $type-local-num-vs-num (local f32) (i32.eqz (local.get 0))))
"type mismatch"
)
(assert_invalid
- (module (func $type-local-num-vs-num (local f64 i64) (f64.neg (get_local 1))))
+ (module (func $type-local-num-vs-num (local f64 i64) (f64.neg (local.get 1))))
"type mismatch"
)
@@ -104,15 +104,15 @@
;; Invalid typing of access to parameters
(assert_invalid
- (module (func $type-param-num-vs-num (param i32) (result i64) (get_local 0)))
+ (module (func $type-param-num-vs-num (param i32) (result i64) (local.get 0)))
"type mismatch"
)
(assert_invalid
- (module (func $type-param-num-vs-num (param f32) (i32.eqz (get_local 0))))
+ (module (func $type-param-num-vs-num (param f32) (i32.eqz (local.get 0))))
"type mismatch"
)
(assert_invalid
- (module (func $type-param-num-vs-num (param f64 i64) (f64.neg (get_local 1))))
+ (module (func $type-param-num-vs-num (param f64 i64) (f64.neg (local.get 1))))
"type mismatch"
)
@@ -120,29 +120,29 @@
;; Invalid local index
(assert_invalid
- (module (func $unbound-local (local i32 i64) (get_local 3)))
+ (module (func $unbound-local (local i32 i64) (local.get 3)))
"unknown local"
)
(assert_invalid
- (module (func $large-local (local i32 i64) (get_local 14324343)))
+ (module (func $large-local (local i32 i64) (local.get 14324343)))
"unknown local"
)
(assert_invalid
- (module (func $unbound-param (param i32 i64) (get_local 2)))
+ (module (func $unbound-param (param i32 i64) (local.get 2)))
"unknown local"
)
(assert_invalid
- (module (func $large-param (local i32 i64) (get_local 714324343)))
+ (module (func $large-param (local i32 i64) (local.get 714324343)))
"unknown local"
)
(assert_invalid
- (module (func $unbound-mixed (param i32) (local i32 i64) (get_local 3)))
+ (module (func $unbound-mixed (param i32) (local i32 i64) (local.get 3)))
"unknown local"
)
(assert_invalid
- (module (func $large-mixed (param i64) (local i32 i64) (get_local 214324343)))
+ (module (func $large-mixed (param i64) (local i32 i64) (local.get 214324343)))
"unknown local"
)
diff --git a/test/spec/globals.wast b/test/spec/globals.wast
index 58cc51b6b..02ef4dc04 100644
--- a/test/spec/globals.wast
+++ b/test/spec/globals.wast
@@ -11,19 +11,19 @@
(global (;6;) (mut f64) (f64.const -14))
(global $y (mut i64) (i64.const -15))
- (func (export "get-a") (result i32) (get_global $a))
- (func (export "get-b") (result i64) (get_global $b))
- (func (export "get-x") (result i32) (get_global $x))
- (func (export "get-y") (result i64) (get_global $y))
- (func (export "set-x") (param i32) (set_global $x (get_local 0)))
- (func (export "set-y") (param i64) (set_global $y (get_local 0)))
-
- (func (export "get-1") (result f32) (get_global 1))
- (func (export "get-2") (result f64) (get_global 2))
- (func (export "get-5") (result f32) (get_global 5))
- (func (export "get-6") (result f64) (get_global 6))
- (func (export "set-5") (param f32) (set_global 5 (get_local 0)))
- (func (export "set-6") (param f64) (set_global 6 (get_local 0)))
+ (func (export "get-a") (result i32) (global.get $a))
+ (func (export "get-b") (result i64) (global.get $b))
+ (func (export "get-x") (result i32) (global.get $x))
+ (func (export "get-y") (result i64) (global.get $y))
+ (func (export "set-x") (param i32) (global.set $x (local.get 0)))
+ (func (export "set-y") (param i64) (global.set $y (local.get 0)))
+
+ (func (export "get-1") (result f32) (global.get 1))
+ (func (export "get-2") (result f64) (global.get 2))
+ (func (export "get-5") (result f32) (global.get 5))
+ (func (export "get-6") (result f64) (global.get 6))
+ (func (export "set-5") (param f32) (global.set 5 (local.get 0)))
+ (func (export "set-6") (param f64) (global.set 6 (local.get 0)))
)
(assert_return (invoke "get-a") (i32.const -2))
@@ -47,7 +47,7 @@
(assert_return (invoke "get-6") (f64.const 9))
(assert_invalid
- (module (global f32 (f32.const 0)) (func (set_global 0 (i32.const 1))))
+ (module (global f32 (f32.const 0)) (func (global.set 0 (i32.const 1))))
"global is immutable"
)
@@ -77,7 +77,7 @@
)
(assert_invalid
- (module (global f32 (get_local 0)))
+ (module (global f32 (local.get 0)))
"constant expression required"
)
@@ -87,6 +87,6 @@
)
(assert_invalid
- (module (global i32 (get_global 0)))
+ (module (global i32 (global.get 0)))
"unknown global"
)
diff --git a/test/spec/i32.load32_s.fail.wast b/test/spec/i32.load32_s.fail.wast
index abf38966a..559c2b823 100644
--- a/test/spec/i32.load32_s.fail.wast
+++ b/test/spec/i32.load32_s.fail.wast
@@ -1 +1 @@
-(module (memory 1) (func (param i32) (result i32) (i32.load32_s (get_local 0))))
+(module (memory 1) (func (param i32) (result i32) (i32.load32_s (local.get 0))))
diff --git a/test/spec/i32.load32_u.fail.wast b/test/spec/i32.load32_u.fail.wast
index 26df00312..6156b0623 100644
--- a/test/spec/i32.load32_u.fail.wast
+++ b/test/spec/i32.load32_u.fail.wast
@@ -1 +1 @@
-(module (memory 1) (func (param i32) (result i32) (i32.load32_u (get_local 0))))
+(module (memory 1) (func (param i32) (result i32) (i32.load32_u (local.get 0))))
diff --git a/test/spec/i32.load64_s.fail.wast b/test/spec/i32.load64_s.fail.wast
index 78fa01279..563c21326 100644
--- a/test/spec/i32.load64_s.fail.wast
+++ b/test/spec/i32.load64_s.fail.wast
@@ -1 +1 @@
-(module (memory 1) (func (param i32) (result i32) (i32.load64_s (get_local 0))))
+(module (memory 1) (func (param i32) (result i32) (i32.load64_s (local.get 0))))
diff --git a/test/spec/i32.load64_u.fail.wast b/test/spec/i32.load64_u.fail.wast
index 01e8273e6..c773cca10 100644
--- a/test/spec/i32.load64_u.fail.wast
+++ b/test/spec/i32.load64_u.fail.wast
@@ -1 +1 @@
-(module (memory 1) (func (param i32) (result i32) (i32.load64_u (get_local 0))))
+(module (memory 1) (func (param i32) (result i32) (i32.load64_u (local.get 0))))
diff --git a/test/spec/i32.store32.fail.wast b/test/spec/i32.store32.fail.wast
index 8a6c528d6..b9ffb41a7 100644
--- a/test/spec/i32.store32.fail.wast
+++ b/test/spec/i32.store32.fail.wast
@@ -1 +1 @@
-(module (memory 1) (func (param i32) (param i32) (i32.store32 (get_local 0) (get_local 1))))
+(module (memory 1) (func (param i32) (param i32) (i32.store32 (local.get 0) (local.get 1))))
diff --git a/test/spec/i32.store64.fail.wast b/test/spec/i32.store64.fail.wast
index cb176d23e..ca08c5479 100644
--- a/test/spec/i32.store64.fail.wast
+++ b/test/spec/i32.store64.fail.wast
@@ -1 +1 @@
-(module (memory 1) (func (param i32) (param i64) (i32.store64 (get_local 0) (get_local 1))))
+(module (memory 1) (func (param i32) (param i64) (i32.store64 (local.get 0) (local.get 1))))
diff --git a/test/spec/i32.wast b/test/spec/i32.wast
index ba28d7c09..b1d9977a4 100644
--- a/test/spec/i32.wast
+++ b/test/spec/i32.wast
@@ -1,35 +1,35 @@
;; i32 operations
(module
- (func (export "add") (param $x i32) (param $y i32) (result i32) (i32.add (get_local $x) (get_local $y)))
- (func (export "sub") (param $x i32) (param $y i32) (result i32) (i32.sub (get_local $x) (get_local $y)))
- (func (export "mul") (param $x i32) (param $y i32) (result i32) (i32.mul (get_local $x) (get_local $y)))
- (func (export "div_s") (param $x i32) (param $y i32) (result i32) (i32.div_s (get_local $x) (get_local $y)))
- (func (export "div_u") (param $x i32) (param $y i32) (result i32) (i32.div_u (get_local $x) (get_local $y)))
- (func (export "rem_s") (param $x i32) (param $y i32) (result i32) (i32.rem_s (get_local $x) (get_local $y)))
- (func (export "rem_u") (param $x i32) (param $y i32) (result i32) (i32.rem_u (get_local $x) (get_local $y)))
- (func (export "and") (param $x i32) (param $y i32) (result i32) (i32.and (get_local $x) (get_local $y)))
- (func (export "or") (param $x i32) (param $y i32) (result i32) (i32.or (get_local $x) (get_local $y)))
- (func (export "xor") (param $x i32) (param $y i32) (result i32) (i32.xor (get_local $x) (get_local $y)))
- (func (export "shl") (param $x i32) (param $y i32) (result i32) (i32.shl (get_local $x) (get_local $y)))
- (func (export "shr_s") (param $x i32) (param $y i32) (result i32) (i32.shr_s (get_local $x) (get_local $y)))
- (func (export "shr_u") (param $x i32) (param $y i32) (result i32) (i32.shr_u (get_local $x) (get_local $y)))
- (func (export "rotl") (param $x i32) (param $y i32) (result i32) (i32.rotl (get_local $x) (get_local $y)))
- (func (export "rotr") (param $x i32) (param $y i32) (result i32) (i32.rotr (get_local $x) (get_local $y)))
- (func (export "clz") (param $x i32) (result i32) (i32.clz (get_local $x)))
- (func (export "ctz") (param $x i32) (result i32) (i32.ctz (get_local $x)))
- (func (export "popcnt") (param $x i32) (result i32) (i32.popcnt (get_local $x)))
- (func (export "eqz") (param $x i32) (result i32) (i32.eqz (get_local $x)))
- (func (export "eq") (param $x i32) (param $y i32) (result i32) (i32.eq (get_local $x) (get_local $y)))
- (func (export "ne") (param $x i32) (param $y i32) (result i32) (i32.ne (get_local $x) (get_local $y)))
- (func (export "lt_s") (param $x i32) (param $y i32) (result i32) (i32.lt_s (get_local $x) (get_local $y)))
- (func (export "lt_u") (param $x i32) (param $y i32) (result i32) (i32.lt_u (get_local $x) (get_local $y)))
- (func (export "le_s") (param $x i32) (param $y i32) (result i32) (i32.le_s (get_local $x) (get_local $y)))
- (func (export "le_u") (param $x i32) (param $y i32) (result i32) (i32.le_u (get_local $x) (get_local $y)))
- (func (export "gt_s") (param $x i32) (param $y i32) (result i32) (i32.gt_s (get_local $x) (get_local $y)))
- (func (export "gt_u") (param $x i32) (param $y i32) (result i32) (i32.gt_u (get_local $x) (get_local $y)))
- (func (export "ge_s") (param $x i32) (param $y i32) (result i32) (i32.ge_s (get_local $x) (get_local $y)))
- (func (export "ge_u") (param $x i32) (param $y i32) (result i32) (i32.ge_u (get_local $x) (get_local $y)))
+ (func (export "add") (param $x i32) (param $y i32) (result i32) (i32.add (local.get $x) (local.get $y)))
+ (func (export "sub") (param $x i32) (param $y i32) (result i32) (i32.sub (local.get $x) (local.get $y)))
+ (func (export "mul") (param $x i32) (param $y i32) (result i32) (i32.mul (local.get $x) (local.get $y)))
+ (func (export "div_s") (param $x i32) (param $y i32) (result i32) (i32.div_s (local.get $x) (local.get $y)))
+ (func (export "div_u") (param $x i32) (param $y i32) (result i32) (i32.div_u (local.get $x) (local.get $y)))
+ (func (export "rem_s") (param $x i32) (param $y i32) (result i32) (i32.rem_s (local.get $x) (local.get $y)))
+ (func (export "rem_u") (param $x i32) (param $y i32) (result i32) (i32.rem_u (local.get $x) (local.get $y)))
+ (func (export "and") (param $x i32) (param $y i32) (result i32) (i32.and (local.get $x) (local.get $y)))
+ (func (export "or") (param $x i32) (param $y i32) (result i32) (i32.or (local.get $x) (local.get $y)))
+ (func (export "xor") (param $x i32) (param $y i32) (result i32) (i32.xor (local.get $x) (local.get $y)))
+ (func (export "shl") (param $x i32) (param $y i32) (result i32) (i32.shl (local.get $x) (local.get $y)))
+ (func (export "shr_s") (param $x i32) (param $y i32) (result i32) (i32.shr_s (local.get $x) (local.get $y)))
+ (func (export "shr_u") (param $x i32) (param $y i32) (result i32) (i32.shr_u (local.get $x) (local.get $y)))
+ (func (export "rotl") (param $x i32) (param $y i32) (result i32) (i32.rotl (local.get $x) (local.get $y)))
+ (func (export "rotr") (param $x i32) (param $y i32) (result i32) (i32.rotr (local.get $x) (local.get $y)))
+ (func (export "clz") (param $x i32) (result i32) (i32.clz (local.get $x)))
+ (func (export "ctz") (param $x i32) (result i32) (i32.ctz (local.get $x)))
+ (func (export "popcnt") (param $x i32) (result i32) (i32.popcnt (local.get $x)))
+ (func (export "eqz") (param $x i32) (result i32) (i32.eqz (local.get $x)))
+ (func (export "eq") (param $x i32) (param $y i32) (result i32) (i32.eq (local.get $x) (local.get $y)))
+ (func (export "ne") (param $x i32) (param $y i32) (result i32) (i32.ne (local.get $x) (local.get $y)))
+ (func (export "lt_s") (param $x i32) (param $y i32) (result i32) (i32.lt_s (local.get $x) (local.get $y)))
+ (func (export "lt_u") (param $x i32) (param $y i32) (result i32) (i32.lt_u (local.get $x) (local.get $y)))
+ (func (export "le_s") (param $x i32) (param $y i32) (result i32) (i32.le_s (local.get $x) (local.get $y)))
+ (func (export "le_u") (param $x i32) (param $y i32) (result i32) (i32.le_u (local.get $x) (local.get $y)))
+ (func (export "gt_s") (param $x i32) (param $y i32) (result i32) (i32.gt_s (local.get $x) (local.get $y)))
+ (func (export "gt_u") (param $x i32) (param $y i32) (result i32) (i32.gt_u (local.get $x) (local.get $y)))
+ (func (export "ge_s") (param $x i32) (param $y i32) (result i32) (i32.ge_s (local.get $x) (local.get $y)))
+ (func (export "ge_u") (param $x i32) (param $y i32) (result i32) (i32.ge_u (local.get $x) (local.get $y)))
)
(assert_return (invoke "add" (i32.const 1) (i32.const 1)) (i32.const 2))
diff --git a/test/spec/i64.load64_s.fail.wast b/test/spec/i64.load64_s.fail.wast
index 335bac35a..075bd4828 100644
--- a/test/spec/i64.load64_s.fail.wast
+++ b/test/spec/i64.load64_s.fail.wast
@@ -1 +1 @@
-(module (memory 1) (func (param i32) (result i64) (i64.load64_s (get_local 0))))
+(module (memory 1) (func (param i32) (result i64) (i64.load64_s (local.get 0))))
diff --git a/test/spec/i64.load64_u.fail.wast b/test/spec/i64.load64_u.fail.wast
index b9002e2bf..9c149f7ac 100644
--- a/test/spec/i64.load64_u.fail.wast
+++ b/test/spec/i64.load64_u.fail.wast
@@ -1 +1 @@
-(module (memory 1) (func (param i32) (result i64) (i64.load64_u (get_local 0))))
+(module (memory 1) (func (param i32) (result i64) (i64.load64_u (local.get 0))))
diff --git a/test/spec/i64.store64.fail.wast b/test/spec/i64.store64.fail.wast
index 918761f68..54cff6ece 100644
--- a/test/spec/i64.store64.fail.wast
+++ b/test/spec/i64.store64.fail.wast
@@ -1 +1 @@
-(module (memory 1) (func (param i32) (param i64) (i64.store64 (get_local 0) (get_local 1))))
+(module (memory 1) (func (param i32) (param i64) (i64.store64 (local.get 0) (local.get 1))))
diff --git a/test/spec/i64.wast b/test/spec/i64.wast
index 54b28c460..021c26cb8 100644
--- a/test/spec/i64.wast
+++ b/test/spec/i64.wast
@@ -1,35 +1,35 @@
;; i64 operations
(module
- (func (export "add") (param $x i64) (param $y i64) (result i64) (i64.add (get_local $x) (get_local $y)))
- (func (export "sub") (param $x i64) (param $y i64) (result i64) (i64.sub (get_local $x) (get_local $y)))
- (func (export "mul") (param $x i64) (param $y i64) (result i64) (i64.mul (get_local $x) (get_local $y)))
- (func (export "div_s") (param $x i64) (param $y i64) (result i64) (i64.div_s (get_local $x) (get_local $y)))
- (func (export "div_u") (param $x i64) (param $y i64) (result i64) (i64.div_u (get_local $x) (get_local $y)))
- (func (export "rem_s") (param $x i64) (param $y i64) (result i64) (i64.rem_s (get_local $x) (get_local $y)))
- (func (export "rem_u") (param $x i64) (param $y i64) (result i64) (i64.rem_u (get_local $x) (get_local $y)))
- (func (export "and") (param $x i64) (param $y i64) (result i64) (i64.and (get_local $x) (get_local $y)))
- (func (export "or") (param $x i64) (param $y i64) (result i64) (i64.or (get_local $x) (get_local $y)))
- (func (export "xor") (param $x i64) (param $y i64) (result i64) (i64.xor (get_local $x) (get_local $y)))
- (func (export "shl") (param $x i64) (param $y i64) (result i64) (i64.shl (get_local $x) (get_local $y)))
- (func (export "shr_s") (param $x i64) (param $y i64) (result i64) (i64.shr_s (get_local $x) (get_local $y)))
- (func (export "shr_u") (param $x i64) (param $y i64) (result i64) (i64.shr_u (get_local $x) (get_local $y)))
- (func (export "rotl") (param $x i64) (param $y i64) (result i64) (i64.rotl (get_local $x) (get_local $y)))
- (func (export "rotr") (param $x i64) (param $y i64) (result i64) (i64.rotr (get_local $x) (get_local $y)))
- (func (export "clz") (param $x i64) (result i64) (i64.clz (get_local $x)))
- (func (export "ctz") (param $x i64) (result i64) (i64.ctz (get_local $x)))
- (func (export "popcnt") (param $x i64) (result i64) (i64.popcnt (get_local $x)))
- (func (export "eqz") (param $x i64) (result i32) (i64.eqz (get_local $x)))
- (func (export "eq") (param $x i64) (param $y i64) (result i32) (i64.eq (get_local $x) (get_local $y)))
- (func (export "ne") (param $x i64) (param $y i64) (result i32) (i64.ne (get_local $x) (get_local $y)))
- (func (export "lt_s") (param $x i64) (param $y i64) (result i32) (i64.lt_s (get_local $x) (get_local $y)))
- (func (export "lt_u") (param $x i64) (param $y i64) (result i32) (i64.lt_u (get_local $x) (get_local $y)))
- (func (export "le_s") (param $x i64) (param $y i64) (result i32) (i64.le_s (get_local $x) (get_local $y)))
- (func (export "le_u") (param $x i64) (param $y i64) (result i32) (i64.le_u (get_local $x) (get_local $y)))
- (func (export "gt_s") (param $x i64) (param $y i64) (result i32) (i64.gt_s (get_local $x) (get_local $y)))
- (func (export "gt_u") (param $x i64) (param $y i64) (result i32) (i64.gt_u (get_local $x) (get_local $y)))
- (func (export "ge_s") (param $x i64) (param $y i64) (result i32) (i64.ge_s (get_local $x) (get_local $y)))
- (func (export "ge_u") (param $x i64) (param $y i64) (result i32) (i64.ge_u (get_local $x) (get_local $y)))
+ (func (export "add") (param $x i64) (param $y i64) (result i64) (i64.add (local.get $x) (local.get $y)))
+ (func (export "sub") (param $x i64) (param $y i64) (result i64) (i64.sub (local.get $x) (local.get $y)))
+ (func (export "mul") (param $x i64) (param $y i64) (result i64) (i64.mul (local.get $x) (local.get $y)))
+ (func (export "div_s") (param $x i64) (param $y i64) (result i64) (i64.div_s (local.get $x) (local.get $y)))
+ (func (export "div_u") (param $x i64) (param $y i64) (result i64) (i64.div_u (local.get $x) (local.get $y)))
+ (func (export "rem_s") (param $x i64) (param $y i64) (result i64) (i64.rem_s (local.get $x) (local.get $y)))
+ (func (export "rem_u") (param $x i64) (param $y i64) (result i64) (i64.rem_u (local.get $x) (local.get $y)))
+ (func (export "and") (param $x i64) (param $y i64) (result i64) (i64.and (local.get $x) (local.get $y)))
+ (func (export "or") (param $x i64) (param $y i64) (result i64) (i64.or (local.get $x) (local.get $y)))
+ (func (export "xor") (param $x i64) (param $y i64) (result i64) (i64.xor (local.get $x) (local.get $y)))
+ (func (export "shl") (param $x i64) (param $y i64) (result i64) (i64.shl (local.get $x) (local.get $y)))
+ (func (export "shr_s") (param $x i64) (param $y i64) (result i64) (i64.shr_s (local.get $x) (local.get $y)))
+ (func (export "shr_u") (param $x i64) (param $y i64) (result i64) (i64.shr_u (local.get $x) (local.get $y)))
+ (func (export "rotl") (param $x i64) (param $y i64) (result i64) (i64.rotl (local.get $x) (local.get $y)))
+ (func (export "rotr") (param $x i64) (param $y i64) (result i64) (i64.rotr (local.get $x) (local.get $y)))
+ (func (export "clz") (param $x i64) (result i64) (i64.clz (local.get $x)))
+ (func (export "ctz") (param $x i64) (result i64) (i64.ctz (local.get $x)))
+ (func (export "popcnt") (param $x i64) (result i64) (i64.popcnt (local.get $x)))
+ (func (export "eqz") (param $x i64) (result i32) (i64.eqz (local.get $x)))
+ (func (export "eq") (param $x i64) (param $y i64) (result i32) (i64.eq (local.get $x) (local.get $y)))
+ (func (export "ne") (param $x i64) (param $y i64) (result i32) (i64.ne (local.get $x) (local.get $y)))
+ (func (export "lt_s") (param $x i64) (param $y i64) (result i32) (i64.lt_s (local.get $x) (local.get $y)))
+ (func (export "lt_u") (param $x i64) (param $y i64) (result i32) (i64.lt_u (local.get $x) (local.get $y)))
+ (func (export "le_s") (param $x i64) (param $y i64) (result i32) (i64.le_s (local.get $x) (local.get $y)))
+ (func (export "le_u") (param $x i64) (param $y i64) (result i32) (i64.le_u (local.get $x) (local.get $y)))
+ (func (export "gt_s") (param $x i64) (param $y i64) (result i32) (i64.gt_s (local.get $x) (local.get $y)))
+ (func (export "gt_u") (param $x i64) (param $y i64) (result i32) (i64.gt_u (local.get $x) (local.get $y)))
+ (func (export "ge_s") (param $x i64) (param $y i64) (result i32) (i64.ge_s (local.get $x) (local.get $y)))
+ (func (export "ge_u") (param $x i64) (param $y i64) (result i32) (i64.ge_u (local.get $x) (local.get $y)))
)
(assert_return (invoke "add" (i64.const 1) (i64.const 1)) (i64.const 2))
diff --git a/test/spec/import-after-global.fail.wast b/test/spec/import-after-global.fail.wast
index 09cece1a0..46f471ba7 100644
--- a/test/spec/import-after-global.fail.wast
+++ b/test/spec/import-after-global.fail.wast
@@ -1 +1 @@
-(module (global i64) (import "" "" (table 0 anyfunc)))
+(module (global i64) (import "" "" (table 0 funcref)))
diff --git a/test/spec/import-after-table.fail.wast b/test/spec/import-after-table.fail.wast
index bcd747a99..fcc4f5f96 100644
--- a/test/spec/import-after-table.fail.wast
+++ b/test/spec/import-after-table.fail.wast
@@ -1 +1 @@
-(module (table 0 anyfunc) (import "" "" (func)))
+(module (table 0 funcref) (import "" "" (func)))
diff --git a/test/spec/imports.wast b/test/spec/imports.wast
index f7805ef2b..f0ae31340 100644
--- a/test/spec/imports.wast
+++ b/test/spec/imports.wast
@@ -13,23 +13,23 @@
(func $print_i64-2 (import "spectest" "print") (param i64))
(func (export "print32") (param $i i32)
- (call 0 (get_local $i))
+ (call 0 (local.get $i))
(call $print_i32_f32
- (i32.add (get_local $i) (i32.const 1))
+ (i32.add (local.get $i) (i32.const 1))
(f32.const 42)
)
- (call $print_i32 (get_local $i))
- (call $print_i32-2 (get_local $i))
+ (call $print_i32 (local.get $i))
+ (call $print_i32-2 (local.get $i))
)
(func (export "print64") (param $i i64)
- (call 1 (get_local $i))
+ (call 1 (local.get $i))
(call $print_i64_f64
- (i64.add (get_local $i) (i64.const 1))
+ (i64.add (local.get $i) (i64.const 1))
(f64.const 53)
)
- (call $print_i64 (get_local $i))
- (call $print_i64-2 (get_local $i))
+ (call $print_i64 (local.get $i))
+ (call $print_i64-2 (local.get $i))
)
)
@@ -46,7 +46,7 @@
)
(assert_unlinkable
- (module (import "spectest" "print" (func)) (table anyfunc (elem 0)))
+ (module (import "spectest" "print" (func)) (table funcref (elem 0)))
"invalid use of host function"
)
@@ -60,16 +60,16 @@
(import "spectest" "global" (global $x i32))
(global $y (import "spectest" "global") i32)
- (func (export "get-0") (result i32) (get_global 0))
- (func (export "get-1") (result i32) (get_global 1))
- (func (export "get-x") (result i32) (get_global $x))
- (func (export "get-y") (result i32) (get_global $y))
+ (func (export "get-0") (result i32) (global.get 0))
+ (func (export "get-1") (result i32) (global.get 1))
+ (func (export "get-x") (result i32) (global.get $x))
+ (func (export "get-y") (result i32) (global.get $y))
;; TODO: mutable globals
- ;; (func (export "set-0") (param i32) (set_global 0 (get_local 0)))
- ;; (func (export "set-1") (param i32) (set_global 1 (get_local 0)))
- ;; (func (export "set-x") (param i32) (set_global $x (get_local 0)))
- ;; (func (export "set-y") (param i32) (set_global $y (get_local 0)))
+ ;; (func (export "set-0") (param i32) (global.set 0 (local.get 0)))
+ ;; (func (export "set-1") (param i32) (global.set 1 (local.get 0)))
+ ;; (func (export "set-x") (param i32) (global.set $x (local.get 0)))
+ ;; (func (export "set-y") (param i32) (global.set $y (local.get 0)))
)
(assert_return (invoke "get-0") (i32.const 666))
@@ -95,10 +95,10 @@
(module
(type (func (result i32)))
- (import "spectest" "table" (table 10 20 anyfunc))
+ (import "spectest" "table" (table 10 20 funcref))
(elem 0 (i32.const 1) $f $g)
- (func (export "call") (param i32) (result i32) (call_indirect (type 0) (get_local 0)))
+ (func (export "call") (param i32) (result i32) (call_indirect (type 0) (local.get 0)))
(func $f (result i32) (i32.const 11))
(func $g (result i32) (i32.const 22))
)
@@ -112,10 +112,10 @@
(module
(type (func (result i32)))
- (table (import "spectest" "table") 10 20 anyfunc)
+ (table (import "spectest" "table") 10 20 funcref)
(elem 0 (i32.const 1) $f $g)
- (func (export "call") (param i32) (result i32) (call_indirect (type 0) (get_local 0)))
+ (func (export "call") (param i32) (result i32) (call_indirect (type 0) (local.get 0)))
(func $f (result i32) (i32.const 11))
(func $g (result i32) (i32.const 22))
)
@@ -128,32 +128,32 @@
(assert_invalid
- (module (import "" "" (table 10 anyfunc)) (import "" "" (table 10 anyfunc)))
+ (module (import "" "" (table 10 funcref)) (import "" "" (table 10 funcref)))
"multiple tables"
)
(assert_invalid
- (module (import "" "" (table 10 anyfunc)) (table 10 anyfunc))
+ (module (import "" "" (table 10 funcref)) (table 10 funcref))
"multiple tables"
)
(assert_invalid
- (module (table 10 anyfunc) (table 10 anyfunc))
+ (module (table 10 funcref) (table 10 funcref))
"multiple tables"
)
(assert_unlinkable
- (module (import "spectest" "unknown" (table 10 anyfunc)))
+ (module (import "spectest" "unknown" (table 10 funcref)))
"unknown import"
)
(assert_unlinkable
- (module (import "spectest" "print" (table 10 anyfunc)))
+ (module (import "spectest" "print" (table 10 funcref)))
"type mismatch"
)
(assert_unlinkable
- (module (import "spectest" "table" (table 12 anyfunc)))
+ (module (import "spectest" "table" (table 12 funcref)))
"actual size smaller than declared"
)
(assert_unlinkable
- (module (import "spectest" "table" (table 10 15 anyfunc)))
+ (module (import "spectest" "table" (table 10 15 funcref)))
"maximum size larger than declared"
)
@@ -164,7 +164,7 @@
(import "spectest" "memory" (memory 1 2))
(data 0 (i32.const 10) "\10")
- (func (export "load") (param i32) (result i32) (i32.load (get_local 0)))
+ (func (export "load") (param i32) (result i32) (i32.load (local.get 0)))
)
(assert_return (invoke "load" (i32.const 0)) (i32.const 0))
@@ -176,7 +176,7 @@
(memory (import "spectest" "memory") 1 2)
(data 0 (i32.const 10) "\10")
- (func (export "load") (param i32) (result i32) (i32.load (get_local 0)))
+ (func (export "load") (param i32) (result i32) (i32.load (local.get 0)))
)
(assert_return (invoke "load" (i32.const 0)) (i32.const 0))
(assert_return (invoke "load" (i32.const 10)) (i32.const 16))
@@ -215,7 +215,7 @@
(module
(import "spectest" "memory" (memory 0 3)) ;; actual has max size 2
- (func (export "grow") (param i32) (result i32) (grow_memory (get_local 0)))
+ (func (export "grow") (param i32) (result i32) (grow_memory (local.get 0)))
)
(assert_return (invoke "grow" (i32.const 0)) (i32.const 1))
(assert_return (invoke "grow" (i32.const 1)) (i32.const 1))
diff --git a/test/spec/int_exprs.wast b/test/spec/int_exprs.wast
index d8272fa7f..aef0985f6 100644
--- a/test/spec/int_exprs.wast
+++ b/test/spec/int_exprs.wast
@@ -5,14 +5,14 @@
(module
(func (export "i32.no_fold_cmp_s_offset") (param $x i32) (param $y i32) (result i32)
- (i32.lt_s (i32.add (get_local $x) (i32.const 1)) (i32.add (get_local $y) (i32.const 1))))
+ (i32.lt_s (i32.add (local.get $x) (i32.const 1)) (i32.add (local.get $y) (i32.const 1))))
(func (export "i32.no_fold_cmp_u_offset") (param $x i32) (param $y i32) (result i32)
- (i32.lt_u (i32.add (get_local $x) (i32.const 1)) (i32.add (get_local $y) (i32.const 1))))
+ (i32.lt_u (i32.add (local.get $x) (i32.const 1)) (i32.add (local.get $y) (i32.const 1))))
(func (export "i64.no_fold_cmp_s_offset") (param $x i64) (param $y i64) (result i32)
- (i64.lt_s (i64.add (get_local $x) (i64.const 1)) (i64.add (get_local $y) (i64.const 1))))
+ (i64.lt_s (i64.add (local.get $x) (i64.const 1)) (i64.add (local.get $y) (i64.const 1))))
(func (export "i64.no_fold_cmp_u_offset") (param $x i64) (param $y i64) (result i32)
- (i64.lt_u (i64.add (get_local $x) (i64.const 1)) (i64.add (get_local $y) (i64.const 1))))
+ (i64.lt_u (i64.add (local.get $x) (i64.const 1)) (i64.add (local.get $y) (i64.const 1))))
)
(assert_return (invoke "i32.no_fold_cmp_s_offset" (i32.const 0x7fffffff) (i32.const 0)) (i32.const 1))
@@ -24,7 +24,7 @@
(module
(func (export "i64.no_fold_wrap_extend_s") (param $x i64) (result i64)
- (i64.extend_s/i32 (i32.wrap/i64 (get_local $x))))
+ (i64.extend_i32_s (i32.wrap_i64 (local.get $x))))
)
(assert_return (invoke "i64.no_fold_wrap_extend_s" (i64.const 0x0010203040506070)) (i64.const 0x0000000040506070))
@@ -34,7 +34,7 @@
(module
(func (export "i64.no_fold_wrap_extend_u") (param $x i64) (result i64)
- (i64.extend_u/i32 (i32.wrap/i64 (get_local $x))))
+ (i64.extend_i32_u (i32.wrap_i64 (local.get $x))))
)
(assert_return (invoke "i64.no_fold_wrap_extend_u" (i64.const 0x0010203040506070)) (i64.const 0x0000000040506070))
@@ -43,14 +43,14 @@
(module
(func (export "i32.no_fold_shl_shr_s") (param $x i32) (result i32)
- (i32.shr_s (i32.shl (get_local $x) (i32.const 1)) (i32.const 1)))
+ (i32.shr_s (i32.shl (local.get $x) (i32.const 1)) (i32.const 1)))
(func (export "i32.no_fold_shl_shr_u") (param $x i32) (result i32)
- (i32.shr_u (i32.shl (get_local $x) (i32.const 1)) (i32.const 1)))
+ (i32.shr_u (i32.shl (local.get $x) (i32.const 1)) (i32.const 1)))
(func (export "i64.no_fold_shl_shr_s") (param $x i64) (result i64)
- (i64.shr_s (i64.shl (get_local $x) (i64.const 1)) (i64.const 1)))
+ (i64.shr_s (i64.shl (local.get $x) (i64.const 1)) (i64.const 1)))
(func (export "i64.no_fold_shl_shr_u") (param $x i64) (result i64)
- (i64.shr_u (i64.shl (get_local $x) (i64.const 1)) (i64.const 1)))
+ (i64.shr_u (i64.shl (local.get $x) (i64.const 1)) (i64.const 1)))
)
(assert_return (invoke "i32.no_fold_shl_shr_s" (i32.const 0x80000000)) (i32.const 0))
@@ -62,14 +62,14 @@
(module
(func (export "i32.no_fold_shr_s_shl") (param $x i32) (result i32)
- (i32.shl (i32.shr_s (get_local $x) (i32.const 1)) (i32.const 1)))
+ (i32.shl (i32.shr_s (local.get $x) (i32.const 1)) (i32.const 1)))
(func (export "i32.no_fold_shr_u_shl") (param $x i32) (result i32)
- (i32.shl (i32.shr_u (get_local $x) (i32.const 1)) (i32.const 1)))
+ (i32.shl (i32.shr_u (local.get $x) (i32.const 1)) (i32.const 1)))
(func (export "i64.no_fold_shr_s_shl") (param $x i64) (result i64)
- (i64.shl (i64.shr_s (get_local $x) (i64.const 1)) (i64.const 1)))
+ (i64.shl (i64.shr_s (local.get $x) (i64.const 1)) (i64.const 1)))
(func (export "i64.no_fold_shr_u_shl") (param $x i64) (result i64)
- (i64.shl (i64.shr_u (get_local $x) (i64.const 1)) (i64.const 1)))
+ (i64.shl (i64.shr_u (local.get $x) (i64.const 1)) (i64.const 1)))
)
(assert_return (invoke "i32.no_fold_shr_s_shl" (i32.const 1)) (i32.const 0))
@@ -81,14 +81,14 @@
(module
(func (export "i32.no_fold_div_s_mul") (param $x i32) (result i32)
- (i32.mul (i32.div_s (get_local $x) (i32.const 6)) (i32.const 6)))
+ (i32.mul (i32.div_s (local.get $x) (i32.const 6)) (i32.const 6)))
(func (export "i32.no_fold_div_u_mul") (param $x i32) (result i32)
- (i32.mul (i32.div_u (get_local $x) (i32.const 6)) (i32.const 6)))
+ (i32.mul (i32.div_u (local.get $x) (i32.const 6)) (i32.const 6)))
(func (export "i64.no_fold_div_s_mul") (param $x i64) (result i64)
- (i64.mul (i64.div_s (get_local $x) (i64.const 6)) (i64.const 6)))
+ (i64.mul (i64.div_s (local.get $x) (i64.const 6)) (i64.const 6)))
(func (export "i64.no_fold_div_u_mul") (param $x i64) (result i64)
- (i64.mul (i64.div_u (get_local $x) (i64.const 6)) (i64.const 6)))
+ (i64.mul (i64.div_u (local.get $x) (i64.const 6)) (i64.const 6)))
)
(assert_return (invoke "i32.no_fold_div_s_mul" (i32.const 1)) (i32.const 0))
@@ -100,14 +100,14 @@
(module
(func (export "i32.no_fold_mul_div_s") (param $x i32) (result i32)
- (i32.div_s (i32.mul (get_local $x) (i32.const 6)) (i32.const 6)))
+ (i32.div_s (i32.mul (local.get $x) (i32.const 6)) (i32.const 6)))
(func (export "i32.no_fold_mul_div_u") (param $x i32) (result i32)
- (i32.div_u (i32.mul (get_local $x) (i32.const 6)) (i32.const 6)))
+ (i32.div_u (i32.mul (local.get $x) (i32.const 6)) (i32.const 6)))
(func (export "i64.no_fold_mul_div_s") (param $x i64) (result i64)
- (i64.div_s (i64.mul (get_local $x) (i64.const 6)) (i64.const 6)))
+ (i64.div_s (i64.mul (local.get $x) (i64.const 6)) (i64.const 6)))
(func (export "i64.no_fold_mul_div_u") (param $x i64) (result i64)
- (i64.div_u (i64.mul (get_local $x) (i64.const 6)) (i64.const 6)))
+ (i64.div_u (i64.mul (local.get $x) (i64.const 6)) (i64.const 6)))
)
(assert_return (invoke "i32.no_fold_mul_div_s" (i32.const 0x80000000)) (i32.const 0))
@@ -119,10 +119,10 @@
(module
(func (export "i32.no_fold_div_s_2") (param $x i32) (result i32)
- (i32.div_s (get_local $x) (i32.const 2)))
+ (i32.div_s (local.get $x) (i32.const 2)))
(func (export "i64.no_fold_div_s_2") (param $x i64) (result i64)
- (i64.div_s (get_local $x) (i64.const 2)))
+ (i64.div_s (local.get $x) (i64.const 2)))
)
(assert_return (invoke "i32.no_fold_div_s_2" (i32.const -11)) (i32.const -5))
@@ -132,10 +132,10 @@
(module
(func (export "i32.no_fold_rem_s_2") (param $x i32) (result i32)
- (i32.rem_s (get_local $x) (i32.const 2)))
+ (i32.rem_s (local.get $x) (i32.const 2)))
(func (export "i64.no_fold_rem_s_2") (param $x i64) (result i64)
- (i64.rem_s (get_local $x) (i64.const 2)))
+ (i64.rem_s (local.get $x) (i64.const 2)))
)
(assert_return (invoke "i32.no_fold_rem_s_2" (i32.const -11)) (i32.const -1))
@@ -145,14 +145,14 @@
(module
(func (export "i32.div_s_3") (param $x i32) (result i32)
- (i32.div_s (get_local $x) (i32.const 0)))
+ (i32.div_s (local.get $x) (i32.const 0)))
(func (export "i32.div_u_3") (param $x i32) (result i32)
- (i32.div_u (get_local $x) (i32.const 0)))
+ (i32.div_u (local.get $x) (i32.const 0)))
(func (export "i64.div_s_3") (param $x i64) (result i64)
- (i64.div_s (get_local $x) (i64.const 0)))
+ (i64.div_s (local.get $x) (i64.const 0)))
(func (export "i64.div_u_3") (param $x i64) (result i64)
- (i64.div_u (get_local $x) (i64.const 0)))
+ (i64.div_u (local.get $x) (i64.const 0)))
)
(assert_trap (invoke "i32.div_s_3" (i32.const 71)) "integer divide by zero")
@@ -164,14 +164,14 @@
(module
(func (export "i32.div_s_3") (param $x i32) (result i32)
- (i32.div_s (get_local $x) (i32.const 3)))
+ (i32.div_s (local.get $x) (i32.const 3)))
(func (export "i32.div_u_3") (param $x i32) (result i32)
- (i32.div_u (get_local $x) (i32.const 3)))
+ (i32.div_u (local.get $x) (i32.const 3)))
(func (export "i64.div_s_3") (param $x i64) (result i64)
- (i64.div_s (get_local $x) (i64.const 3)))
+ (i64.div_s (local.get $x) (i64.const 3)))
(func (export "i64.div_u_3") (param $x i64) (result i64)
- (i64.div_u (get_local $x) (i64.const 3)))
+ (i64.div_u (local.get $x) (i64.const 3)))
)
(assert_return (invoke "i32.div_s_3" (i32.const 71)) (i32.const 23))
@@ -187,14 +187,14 @@
(module
(func (export "i32.div_s_5") (param $x i32) (result i32)
- (i32.div_s (get_local $x) (i32.const 5)))
+ (i32.div_s (local.get $x) (i32.const 5)))
(func (export "i32.div_u_5") (param $x i32) (result i32)
- (i32.div_u (get_local $x) (i32.const 5)))
+ (i32.div_u (local.get $x) (i32.const 5)))
(func (export "i64.div_s_5") (param $x i64) (result i64)
- (i64.div_s (get_local $x) (i64.const 5)))
+ (i64.div_s (local.get $x) (i64.const 5)))
(func (export "i64.div_u_5") (param $x i64) (result i64)
- (i64.div_u (get_local $x) (i64.const 5)))
+ (i64.div_u (local.get $x) (i64.const 5)))
)
(assert_return (invoke "i32.div_s_5" (i32.const 71)) (i32.const 14))
@@ -210,14 +210,14 @@
(module
(func (export "i32.div_s_7") (param $x i32) (result i32)
- (i32.div_s (get_local $x) (i32.const 7)))
+ (i32.div_s (local.get $x) (i32.const 7)))
(func (export "i32.div_u_7") (param $x i32) (result i32)
- (i32.div_u (get_local $x) (i32.const 7)))
+ (i32.div_u (local.get $x) (i32.const 7)))
(func (export "i64.div_s_7") (param $x i64) (result i64)
- (i64.div_s (get_local $x) (i64.const 7)))
+ (i64.div_s (local.get $x) (i64.const 7)))
(func (export "i64.div_u_7") (param $x i64) (result i64)
- (i64.div_u (get_local $x) (i64.const 7)))
+ (i64.div_u (local.get $x) (i64.const 7)))
)
(assert_return (invoke "i32.div_s_7" (i32.const 71)) (i32.const 10))
@@ -233,14 +233,14 @@
(module
(func (export "i32.rem_s_3") (param $x i32) (result i32)
- (i32.rem_s (get_local $x) (i32.const 3)))
+ (i32.rem_s (local.get $x) (i32.const 3)))
(func (export "i32.rem_u_3") (param $x i32) (result i32)
- (i32.rem_u (get_local $x) (i32.const 3)))
+ (i32.rem_u (local.get $x) (i32.const 3)))
(func (export "i64.rem_s_3") (param $x i64) (result i64)
- (i64.rem_s (get_local $x) (i64.const 3)))
+ (i64.rem_s (local.get $x) (i64.const 3)))
(func (export "i64.rem_u_3") (param $x i64) (result i64)
- (i64.rem_u (get_local $x) (i64.const 3)))
+ (i64.rem_u (local.get $x) (i64.const 3)))
)
(assert_return (invoke "i32.rem_s_3" (i32.const 71)) (i32.const 2))
@@ -256,14 +256,14 @@
(module
(func (export "i32.rem_s_5") (param $x i32) (result i32)
- (i32.rem_s (get_local $x) (i32.const 5)))
+ (i32.rem_s (local.get $x) (i32.const 5)))
(func (export "i32.rem_u_5") (param $x i32) (result i32)
- (i32.rem_u (get_local $x) (i32.const 5)))
+ (i32.rem_u (local.get $x) (i32.const 5)))
(func (export "i64.rem_s_5") (param $x i64) (result i64)
- (i64.rem_s (get_local $x) (i64.const 5)))
+ (i64.rem_s (local.get $x) (i64.const 5)))
(func (export "i64.rem_u_5") (param $x i64) (result i64)
- (i64.rem_u (get_local $x) (i64.const 5)))
+ (i64.rem_u (local.get $x) (i64.const 5)))
)
(assert_return (invoke "i32.rem_s_5" (i32.const 71)) (i32.const 1))
@@ -279,14 +279,14 @@
(module
(func (export "i32.rem_s_7") (param $x i32) (result i32)
- (i32.rem_s (get_local $x) (i32.const 7)))
+ (i32.rem_s (local.get $x) (i32.const 7)))
(func (export "i32.rem_u_7") (param $x i32) (result i32)
- (i32.rem_u (get_local $x) (i32.const 7)))
+ (i32.rem_u (local.get $x) (i32.const 7)))
(func (export "i64.rem_s_7") (param $x i64) (result i64)
- (i64.rem_s (get_local $x) (i64.const 7)))
+ (i64.rem_s (local.get $x) (i64.const 7)))
(func (export "i64.rem_u_7") (param $x i64) (result i64)
- (i64.rem_u (get_local $x) (i64.const 7)))
+ (i64.rem_u (local.get $x) (i64.const 7)))
)
(assert_return (invoke "i32.rem_s_7" (i32.const 71)) (i32.const 1))
diff --git a/test/spec/labels.wast b/test/spec/labels.wast
index 03e5bf722..ccb164733 100644
--- a/test/spec/labels.wast
+++ b/test/spec/labels.wast
@@ -8,12 +8,12 @@
(func (export "loop1") (result i32)
(local $i i32)
- (set_local $i (i32.const 0))
+ (local.set $i (i32.const 0))
(block $exit i32
(loop $cont i32
- (set_local $i (i32.add (get_local $i) (i32.const 1)))
- (if (i32.eq (get_local $i) (i32.const 5))
- (br $exit (get_local $i))
+ (local.set $i (i32.add (local.get $i) (i32.const 1)))
+ (if (i32.eq (local.get $i) (i32.const 5))
+ (br $exit (local.get $i))
)
(br $cont)
)
@@ -22,17 +22,17 @@
(func (export "loop2") (result i32)
(local $i i32)
- (set_local $i (i32.const 0))
+ (local.set $i (i32.const 0))
(block $exit i32
(loop $cont i32
- (set_local $i (i32.add (get_local $i) (i32.const 1)))
- (if (i32.eq (get_local $i) (i32.const 5))
+ (local.set $i (i32.add (local.get $i) (i32.const 1)))
+ (if (i32.eq (local.get $i) (i32.const 5))
(br $cont)
)
- (if (i32.eq (get_local $i) (i32.const 8))
- (br $exit (get_local $i))
+ (if (i32.eq (local.get $i) (i32.const 8))
+ (br $exit (local.get $i))
)
- (set_local $i (i32.add (get_local $i) (i32.const 1)))
+ (local.set $i (i32.add (local.get $i) (i32.const 1)))
(br $cont)
)
)
@@ -40,26 +40,26 @@
(func (export "loop3") (result i32)
(local $i i32)
- (set_local $i (i32.const 0))
+ (local.set $i (i32.const 0))
(block $exit i32
(loop $cont i32
- (set_local $i (i32.add (get_local $i) (i32.const 1)))
- (if (i32.eq (get_local $i) (i32.const 5))
- (br $exit (get_local $i))
+ (local.set $i (i32.add (local.get $i) (i32.const 1)))
+ (if (i32.eq (local.get $i) (i32.const 5))
+ (br $exit (local.get $i))
)
- (get_local $i)
+ (local.get $i)
)
)
)
(func (export "loop4") (param $max i32) (result i32)
(local $i i32)
- (set_local $i (i32.const 1))
+ (local.set $i (i32.const 1))
(block $exit i32
(loop $cont i32
- (set_local $i (i32.add (get_local $i) (get_local $i)))
- (if (i32.gt_u (get_local $i) (get_local $max))
- (br $exit (get_local $i))
+ (local.set $i (i32.add (local.get $i) (local.get $i)))
+ (if (i32.gt_u (local.get $i) (local.get $max))
+ (br $exit (local.get $i))
)
(br $cont)
)
@@ -75,76 +75,76 @@
(func (export "if") (result i32)
(local $i i32)
- (set_local $i (i32.const 0))
+ (local.set $i (i32.const 0))
(block
(if $l
(i32.const 1)
- (then (br $l) (set_local $i (i32.const 666)))
+ (then (br $l) (local.set $i (i32.const 666)))
)
- (set_local $i (i32.add (get_local $i) (i32.const 1)))
+ (local.set $i (i32.add (local.get $i) (i32.const 1)))
(if $l
(i32.const 1)
- (then (br $l) (set_local $i (i32.const 666)))
- (else (set_local $i (i32.const 888)))
+ (then (br $l) (local.set $i (i32.const 666)))
+ (else (local.set $i (i32.const 888)))
)
- (set_local $i (i32.add (get_local $i) (i32.const 1)))
+ (local.set $i (i32.add (local.get $i) (i32.const 1)))
(if $l
(i32.const 1)
- (then (br $l) (set_local $i (i32.const 666)))
- (else (set_local $i (i32.const 888)))
+ (then (br $l) (local.set $i (i32.const 666)))
+ (else (local.set $i (i32.const 888)))
)
- (set_local $i (i32.add (get_local $i) (i32.const 1)))
+ (local.set $i (i32.add (local.get $i) (i32.const 1)))
(if $l
(i32.const 0)
- (then (set_local $i (i32.const 888)))
- (else (br $l) (set_local $i (i32.const 666)))
+ (then (local.set $i (i32.const 888)))
+ (else (br $l) (local.set $i (i32.const 666)))
)
- (set_local $i (i32.add (get_local $i) (i32.const 1)))
+ (local.set $i (i32.add (local.get $i) (i32.const 1)))
(if $l
(i32.const 0)
- (then (set_local $i (i32.const 888)))
- (else (br $l) (set_local $i (i32.const 666)))
+ (then (local.set $i (i32.const 888)))
+ (else (br $l) (local.set $i (i32.const 666)))
)
- (set_local $i (i32.add (get_local $i) (i32.const 1)))
+ (local.set $i (i32.add (local.get $i) (i32.const 1)))
)
- (get_local $i)
+ (local.get $i)
)
(func (export "if2") (result i32)
(local $i i32)
- (set_local $i (i32.const 0))
+ (local.set $i (i32.const 0))
(block
(if
(i32.const 1)
- (then (br 0) (set_local $i (i32.const 666)))
+ (then (br 0) (local.set $i (i32.const 666)))
)
- (set_local $i (i32.add (get_local $i) (i32.const 1)))
+ (local.set $i (i32.add (local.get $i) (i32.const 1)))
(if
(i32.const 1)
- (then (br 0) (set_local $i (i32.const 666)))
- (else (set_local $i (i32.const 888)))
+ (then (br 0) (local.set $i (i32.const 666)))
+ (else (local.set $i (i32.const 888)))
)
- (set_local $i (i32.add (get_local $i) (i32.const 1)))
+ (local.set $i (i32.add (local.get $i) (i32.const 1)))
(if
(i32.const 1)
- (then (br 0) (set_local $i (i32.const 666)))
- (else (set_local $i (i32.const 888)))
+ (then (br 0) (local.set $i (i32.const 666)))
+ (else (local.set $i (i32.const 888)))
)
- (set_local $i (i32.add (get_local $i) (i32.const 1)))
+ (local.set $i (i32.add (local.get $i) (i32.const 1)))
(if
(i32.const 0)
- (then (set_local $i (i32.const 888)))
- (else (br 0) (set_local $i (i32.const 666)))
+ (then (local.set $i (i32.const 888)))
+ (else (br 0) (local.set $i (i32.const 666)))
)
- (set_local $i (i32.add (get_local $i) (i32.const 1)))
+ (local.set $i (i32.add (local.get $i) (i32.const 1)))
(if
(i32.const 0)
- (then (set_local $i (i32.const 888)))
- (else (br 0) (set_local $i (i32.const 666)))
+ (then (local.set $i (i32.const 888)))
+ (else (br 0) (local.set $i (i32.const 666)))
)
- (set_local $i (i32.add (get_local $i) (i32.const 1)))
+ (local.set $i (i32.add (local.get $i) (i32.const 1)))
)
- (get_local $i)
+ (local.get $i)
)
(func (export "switch") (param i32) (result i32)
@@ -156,7 +156,7 @@
(block $3
(block $2
(block $1
- (br_table $0 $1 $2 $3 $default (get_local 0))
+ (br_table $0 $1 $2 $3 $default (local.get 0))
) ;; 1
) ;; 2
(br $exit (i32.const 2))
@@ -174,7 +174,7 @@
(block $default
(block $1
(block $0
- (br_table $0 $1 (get_local 0))
+ (br_table $0 $1 (local.get 0))
(br $default)
) ;; 0
(return (i32.const 0))
@@ -185,30 +185,30 @@
(func (export "br_if0") (result i32)
(local $i i32)
- (set_local $i (i32.const 0))
+ (local.set $i (i32.const 0))
(block $outer i32
(block $inner
(br_if $inner (i32.const 0))
- (set_local $i (i32.or (get_local $i) (i32.const 0x1)))
+ (local.set $i (i32.or (local.get $i) (i32.const 0x1)))
(br_if $inner (i32.const 1))
- (set_local $i (i32.or (get_local $i) (i32.const 0x2)))
+ (local.set $i (i32.or (local.get $i) (i32.const 0x2)))
)
(drop (br_if $outer
(block i32
- (set_local $i (i32.or (get_local $i) (i32.const 0x4)))
- (get_local $i)
+ (local.set $i (i32.or (local.get $i) (i32.const 0x4)))
+ (local.get $i)
)
(i32.const 0)
))
- (set_local $i (i32.or (get_local $i) (i32.const 0x8)))
+ (local.set $i (i32.or (local.get $i) (i32.const 0x8)))
(drop (br_if $outer
(block i32
- (set_local $i (i32.or (get_local $i) (i32.const 0x10)))
- (get_local $i)
+ (local.set $i (i32.or (local.get $i) (i32.const 0x10)))
+ (local.get $i)
)
(i32.const 1)
))
- (set_local $i (i32.or (get_local $i) (i32.const 0x20))) (get_local $i)
+ (local.set $i (i32.or (local.get $i) (i32.const 0x20))) (local.get $i)
)
)
@@ -234,15 +234,15 @@
(i32.add
(block $l0 i32
(drop (br_if $l0
- (block i32 (set_local $i1 (i32.const 1)) (get_local $i1))
- (block i32 (set_local $i1 (i32.const 2)) (get_local $i1))
+ (block i32 (local.set $i1 (i32.const 1)) (local.get $i1))
+ (block i32 (local.set $i1 (i32.const 2)) (local.get $i1))
))
(i32.const 0)
)
(i32.const 0)
)
)
- (get_local $i1)
+ (local.get $i1)
)
(func (export "br") (result i32)
diff --git a/test/spec/left-to-right.wast b/test/spec/left-to-right.wast
index 3dc4784db..69e39abb3 100644
--- a/test/spec/left-to-right.wast
+++ b/test/spec/left-to-right.wast
@@ -5,7 +5,7 @@
(type $i64_T (func (param i64 i64) (result i32)))
(type $f32_T (func (param f32 f32) (result i32)))
(type $f64_T (func (param f64 f64) (result i32)))
- (table anyfunc
+ (table funcref
(elem $i32_t0 $i32_t1 $i64_t0 $i64_t1 $f32_t0 $f32_t1 $f64_t0 $f64_t1)
)
diff --git a/test/spec/linking.wast b/test/spec/linking.wast
index ec0ea23e7..fafaf2746 100644
--- a/test/spec/linking.wast
+++ b/test/spec/linking.wast
@@ -24,7 +24,7 @@
(module $Mg
(global $glob (export "glob") i32 (i32.const 42))
- (func (export "get") (result i32) (get_global $glob))
+ (func (export "get") (result i32) (global.get $glob))
)
(register "Mg" $Mg)
@@ -34,7 +34,7 @@
(export "Mg.glob" (global $x))
(export "Mg.get" (func $f))
(global $glob (export "glob") i32 (i32.const 43))
- (func (export "get") (result i32) (get_global $glob))
+ (func (export "get") (result i32) (global.get $glob))
)
(assert_return (get $Mg "glob") (i32.const 42))
@@ -51,13 +51,13 @@
(type (func (result i32)))
(type (func))
- (table (export "tab") 10 anyfunc)
+ (table (export "tab") 10 funcref)
(elem (i32.const 2) $g $g $g $g)
(func $g (result i32) (i32.const 4))
(func (export "h") (result i32) (i32.const -4))
(func (export "call") (param i32) (result i32)
- (call_indirect (type 0) (get_local 0))
+ (call_indirect (type 0) (local.get 0))
)
)
(register "Mt" $Mt)
@@ -69,15 +69,15 @@
(func $f (import "Mt" "call") (param i32) (result i32))
(func $h (import "Mt" "h") (result i32))
- (table anyfunc (elem $g $g $g $h $f))
+ (table funcref (elem $g $g $g $h $f))
(func $g (result i32) (i32.const 5))
(export "Mt.call" (func $f))
(func (export "call Mt.call") (param i32) (result i32)
- (call $f (get_local 0))
+ (call $f (local.get 0))
)
(func (export "call") (param i32) (result i32)
- (call_indirect (type 1) (get_local 0))
+ (call_indirect (type 1) (local.get 0))
)
)
@@ -108,12 +108,12 @@
(type (func (result i32)))
(func $h (import "Mt" "h") (result i32))
- (table (import "Mt" "tab") 5 anyfunc)
+ (table (import "Mt" "tab") 5 funcref)
(elem (i32.const 1) $i $h)
(func $i (result i32) (i32.const 6))
(func (export "call") (param i32) (result i32)
- (call_indirect (type 0) (get_local 0))
+ (call_indirect (type 0) (local.get 0))
)
)
@@ -145,7 +145,7 @@
(assert_unlinkable
(module $Qt
(func $host (import "spectest" "print"))
- (table (import "Mt" "tab") 10 anyfunc)
+ (table (import "Mt" "tab") 10 funcref)
(elem (i32.const 7) $own)
(elem (i32.const 9) $host)
(func $own (result i32) (i32.const 666))
@@ -162,7 +162,7 @@
(data (i32.const 10) "\00\01\02\03\04\05\06\07\08\09")
(func (export "load") (param $a i32) (result i32)
- (i32.load8_u (get_local 0))
+ (i32.load8_u (local.get 0))
)
)
(register "Mm" $Mm)
@@ -175,7 +175,7 @@
(export "Mm.load" (func $loadM))
(func (export "load") (param $a i32) (result i32)
- (i32.load8_u (get_local 0))
+ (i32.load8_u (local.get 0))
)
)
@@ -188,7 +188,7 @@
(data (i32.const 5) "\a0\a1\a2\a3\a4\a5\a6\a7")
(func (export "load") (param $a i32) (result i32)
- (i32.load8_u (get_local 0))
+ (i32.load8_u (local.get 0))
)
)
@@ -201,7 +201,7 @@
(memory (import "Mm" "mem") 1 8)
(func (export "grow") (param $a i32) (result i32)
- (grow_memory (get_local 0))
+ (grow_memory (local.get 0))
)
)
@@ -218,7 +218,7 @@
(module $Qm
(func $host (import "spectest" "print"))
(memory (import "Mm" "mem") 1)
- (table 10 anyfunc)
+ (table 10 funcref)
(data (i32.const 0) "abc")
(elem (i32.const 9) $host)
(func $own (result i32) (i32.const 666))
diff --git a/test/spec/loop.wast b/test/spec/loop.wast
index 0187115bf..9e51f618c 100644
--- a/test/spec/loop.wast
+++ b/test/spec/loop.wast
@@ -88,88 +88,88 @@
)
(func (export "break-inner") (result i32)
(local i32)
- (set_local 0 (i32.const 0))
- (set_local 0 (i32.add (get_local 0) (block i32 (loop i32 (block i32 (br 2 (i32.const 0x1)))))))
- (set_local 0 (i32.add (get_local 0) (block i32 (loop i32 (loop i32 (br 2 (i32.const 0x2)))))))
- (set_local 0 (i32.add (get_local 0) (block i32 (loop i32 (block i32 (loop i32 (br 1 (i32.const 0x4))))))))
- (set_local 0 (i32.add (get_local 0) (block i32 (loop i32 (i32.ctz (br 1 (i32.const 0x8)))))))
- (set_local 0 (i32.add (get_local 0) (block i32 (loop i32 (i32.ctz (loop i32 (br 2 (i32.const 0x10))))))))
- (get_local 0)
+ (local.set 0 (i32.const 0))
+ (local.set 0 (i32.add (local.get 0) (block i32 (loop i32 (block i32 (br 2 (i32.const 0x1)))))))
+ (local.set 0 (i32.add (local.get 0) (block i32 (loop i32 (loop i32 (br 2 (i32.const 0x2)))))))
+ (local.set 0 (i32.add (local.get 0) (block i32 (loop i32 (block i32 (loop i32 (br 1 (i32.const 0x4))))))))
+ (local.set 0 (i32.add (local.get 0) (block i32 (loop i32 (i32.ctz (br 1 (i32.const 0x8)))))))
+ (local.set 0 (i32.add (local.get 0) (block i32 (loop i32 (i32.ctz (loop i32 (br 2 (i32.const 0x10))))))))
+ (local.get 0)
)
(func (export "cont-inner") (result i32)
(local i32)
- (set_local 0 (i32.const 0))
- (set_local 0 (i32.add (get_local 0) (loop i32 (loop i32 (br 1)))))
- (set_local 0 (i32.add (get_local 0) (loop i32 (i32.ctz (br 0)))))
- (set_local 0 (i32.add (get_local 0) (loop i32 (i32.ctz (loop i32 (br 1))))))
- (get_local 0)
+ (local.set 0 (i32.const 0))
+ (local.set 0 (i32.add (local.get 0) (loop i32 (loop i32 (br 1)))))
+ (local.set 0 (i32.add (local.get 0) (loop i32 (i32.ctz (br 0)))))
+ (local.set 0 (i32.add (local.get 0) (loop i32 (i32.ctz (loop i32 (br 1))))))
+ (local.get 0)
)
(func $fx (export "effects") (result i32)
(local i32)
(block
(loop
- (set_local 0 (i32.const 1))
- (set_local 0 (i32.mul (get_local 0) (i32.const 3)))
- (set_local 0 (i32.sub (get_local 0) (i32.const 5)))
- (set_local 0 (i32.mul (get_local 0) (i32.const 7)))
+ (local.set 0 (i32.const 1))
+ (local.set 0 (i32.mul (local.get 0) (i32.const 3)))
+ (local.set 0 (i32.sub (local.get 0) (i32.const 5)))
+ (local.set 0 (i32.mul (local.get 0) (i32.const 7)))
(br 1)
- (set_local 0 (i32.mul (get_local 0) (i32.const 100)))
+ (local.set 0 (i32.mul (local.get 0) (i32.const 100)))
)
)
- (i32.eq (get_local 0) (i32.const -14))
+ (i32.eq (local.get 0) (i32.const -14))
)
(func (export "while") (param i64) (result i64)
(local i64)
- (set_local 1 (i64.const 1))
+ (local.set 1 (i64.const 1))
(block
(loop
- (br_if 1 (i64.eqz (get_local 0)))
- (set_local 1 (i64.mul (get_local 0) (get_local 1)))
- (set_local 0 (i64.sub (get_local 0) (i64.const 1)))
+ (br_if 1 (i64.eqz (local.get 0)))
+ (local.set 1 (i64.mul (local.get 0) (local.get 1)))
+ (local.set 0 (i64.sub (local.get 0) (i64.const 1)))
(br 0)
)
)
- (get_local 1)
+ (local.get 1)
)
(func (export "for") (param i64) (result i64)
(local i64 i64)
- (set_local 1 (i64.const 1))
- (set_local 2 (i64.const 2))
+ (local.set 1 (i64.const 1))
+ (local.set 2 (i64.const 2))
(block
(loop
- (br_if 1 (i64.gt_u (get_local 2) (get_local 0)))
- (set_local 1 (i64.mul (get_local 1) (get_local 2)))
- (set_local 2 (i64.add (get_local 2) (i64.const 1)))
+ (br_if 1 (i64.gt_u (local.get 2) (local.get 0)))
+ (local.set 1 (i64.mul (local.get 1) (local.get 2)))
+ (local.set 2 (i64.add (local.get 2) (i64.const 1)))
(br 0)
)
)
- (get_local 1)
+ (local.get 1)
)
(func (export "nesting") (param f32 f32) (result f32)
(local f32 f32)
(block
(loop
- (br_if 1 (f32.eq (get_local 0) (f32.const 0)))
- (set_local 2 (get_local 1))
+ (br_if 1 (f32.eq (local.get 0) (f32.const 0)))
+ (local.set 2 (local.get 1))
(block
(loop
- (br_if 1 (f32.eq (get_local 2) (f32.const 0)))
- (br_if 3 (f32.lt (get_local 2) (f32.const 0)))
- (set_local 3 (f32.add (get_local 3) (get_local 2)))
- (set_local 2 (f32.sub (get_local 2) (f32.const 2)))
+ (br_if 1 (f32.eq (local.get 2) (f32.const 0)))
+ (br_if 3 (f32.lt (local.get 2) (f32.const 0)))
+ (local.set 3 (f32.add (local.get 3) (local.get 2)))
+ (local.set 2 (f32.sub (local.get 2) (f32.const 2)))
(br 0)
)
)
- (set_local 3 (f32.div (get_local 3) (get_local 0)))
- (set_local 0 (f32.sub (get_local 0) (f32.const 1)))
+ (local.set 3 (f32.div (local.get 3) (local.get 0)))
+ (local.set 0 (f32.sub (local.get 0) (f32.const 1)))
(br 0)
)
)
- (get_local 3)
+ (local.get 3)
)
)
diff --git a/test/spec/memory.wast b/test/spec/memory.wast
index e54888f7c..bb0226ed2 100644
--- a/test/spec/memory.wast
+++ b/test/spec/memory.wast
@@ -184,21 +184,21 @@
;; Aligned read/write
(func (export "aligned") (result i32)
(local i32 i32 i32)
- (set_local 0 (i32.const 10))
+ (local.set 0 (i32.const 10))
(block
(loop
(if
- (i32.eq (get_local 0) (i32.const 0))
+ (i32.eq (local.get 0) (i32.const 0))
(br 2)
)
- (set_local 2 (i32.mul (get_local 0) (i32.const 4)))
- (i32.store (get_local 2) (get_local 0))
- (set_local 1 (i32.load (get_local 2)))
+ (local.set 2 (i32.mul (local.get 0) (i32.const 4)))
+ (i32.store (local.get 2) (local.get 0))
+ (local.set 1 (i32.load (local.get 2)))
(if
- (i32.ne (get_local 0) (get_local 1))
+ (i32.ne (local.get 0) (local.get 1))
(return (i32.const 0))
)
- (set_local 0 (i32.sub (get_local 0) (i32.const 1)))
+ (local.set 0 (i32.sub (local.get 0) (i32.const 1)))
(br 0)
)
)
@@ -208,21 +208,21 @@
;; Unaligned read/write
(func (export "unaligned") (result i32)
(local i32 f64 f64)
- (set_local 0 (i32.const 10))
+ (local.set 0 (i32.const 10))
(block
(loop
(if
- (i32.eq (get_local 0) (i32.const 0))
+ (i32.eq (local.get 0) (i32.const 0))
(br 2)
)
- (set_local 2 (f64.convert_s/i32 (get_local 0)))
- (f64.store align=1 (get_local 0) (get_local 2))
- (set_local 1 (f64.load align=1 (get_local 0)))
+ (local.set 2 (f64.convert_i32_s (local.get 0)))
+ (f64.store align=1 (local.get 0) (local.get 2))
+ (local.set 1 (f64.load align=1 (local.get 0)))
(if
- (f64.ne (get_local 2) (get_local 1))
+ (f64.ne (local.get 2) (local.get 1))
(return (i32.const 0))
)
- (set_local 0 (i32.sub (get_local 0) (i32.const 1)))
+ (local.set 0 (i32.sub (local.get 0) (i32.const 1)))
(br 0)
)
)
@@ -235,7 +235,7 @@
(if
(f64.eq
(f64.load (i32.const 8))
- (f64.reinterpret/i64 (i64.const -12345))
+ (f64.reinterpret_i64 (i64.const -12345))
)
(return (f64.const 0))
)
@@ -246,43 +246,43 @@
;; Sign and zero extending memory loads
(func (export "i32_load8_s") (param $i i32) (result i32)
- (i32.store8 (i32.const 8) (get_local $i))
+ (i32.store8 (i32.const 8) (local.get $i))
(i32.load8_s (i32.const 8))
)
(func (export "i32_load8_u") (param $i i32) (result i32)
- (i32.store8 (i32.const 8) (get_local $i))
+ (i32.store8 (i32.const 8) (local.get $i))
(i32.load8_u (i32.const 8))
)
(func (export "i32_load16_s") (param $i i32) (result i32)
- (i32.store16 (i32.const 8) (get_local $i))
+ (i32.store16 (i32.const 8) (local.get $i))
(i32.load16_s (i32.const 8))
)
(func (export "i32_load16_u") (param $i i32) (result i32)
- (i32.store16 (i32.const 8) (get_local $i))
+ (i32.store16 (i32.const 8) (local.get $i))
(i32.load16_u (i32.const 8))
)
(func (export "i64_load8_s") (param $i i64) (result i64)
- (i64.store8 (i32.const 8) (get_local $i))
+ (i64.store8 (i32.const 8) (local.get $i))
(i64.load8_s (i32.const 8))
)
(func (export "i64_load8_u") (param $i i64) (result i64)
- (i64.store8 (i32.const 8) (get_local $i))
+ (i64.store8 (i32.const 8) (local.get $i))
(i64.load8_u (i32.const 8))
)
(func (export "i64_load16_s") (param $i i64) (result i64)
- (i64.store16 (i32.const 8) (get_local $i))
+ (i64.store16 (i32.const 8) (local.get $i))
(i64.load16_s (i32.const 8))
)
(func (export "i64_load16_u") (param $i i64) (result i64)
- (i64.store16 (i32.const 8) (get_local $i))
+ (i64.store16 (i32.const 8) (local.get $i))
(i64.load16_u (i32.const 8))
)
(func (export "i64_load32_s") (param $i i64) (result i64)
- (i64.store32 (i32.const 8) (get_local $i))
+ (i64.store32 (i32.const 8) (local.get $i))
(i64.load32_s (i32.const 8))
)
(func (export "i64_load32_u") (param $i i64) (result i64)
- (i64.store32 (i32.const 8) (get_local $i))
+ (i64.store32 (i32.const 8) (local.get $i))
(i64.load32_u (i32.const 8))
)
)
diff --git a/test/spec/memory_redundancy.wast b/test/spec/memory_redundancy.wast
index 2911537e1..58a31caba 100644
--- a/test/spec/memory_redundancy.wast
+++ b/test/spec/memory_redundancy.wast
@@ -21,18 +21,18 @@
(func (export "test_redundant_load") (result i32)
(local $t i32)
(local $s i32)
- (set_local $t (i32.load (i32.const 8)))
+ (local.set $t (i32.load (i32.const 8)))
(i32.store (i32.const 5) (i32.const 0x80000000))
- (set_local $s (i32.load (i32.const 8)))
- (i32.add (get_local $t) (get_local $s))
+ (local.set $s (i32.load (i32.const 8)))
+ (i32.add (local.get $t) (local.get $s))
)
(func (export "test_dead_store") (result f32)
(local $t f32)
(i32.store (i32.const 8) (i32.const 0x23232323))
- (set_local $t (f32.load (i32.const 11)))
+ (local.set $t (f32.load (i32.const 11)))
(i32.store (i32.const 8) (i32.const 0))
- (get_local $t)
+ (local.get $t)
)
)
diff --git a/test/spec/memory_trap.wast b/test/spec/memory_trap.wast
index 4fc4dccf9..2a4649126 100644
--- a/test/spec/memory_trap.wast
+++ b/test/spec/memory_trap.wast
@@ -6,15 +6,15 @@
)
(func (export "store") (param $i i32) (param $v i32)
- (i32.store (i32.add (call $addr_limit) (get_local $i)) (get_local $v))
+ (i32.store (i32.add (call $addr_limit) (local.get $i)) (local.get $v))
)
(func (export "load") (param $i i32) (result i32)
- (i32.load (i32.add (call $addr_limit) (get_local $i)))
+ (i32.load (i32.add (call $addr_limit) (local.get $i)))
)
(func (export "grow_memory") (param i32) (result i32)
- (grow_memory (get_local 0))
+ (grow_memory (local.get 0))
)
)
diff --git a/test/spec/names.wast b/test/spec/names.wast
index 07b4deb58..a586bc8e8 100644
--- a/test/spec/names.wast
+++ b/test/spec/names.wast
@@ -67,8 +67,8 @@
(import "spectest" "print" (func (param i32)))
(func (import "spectest" "print") (param i32))
(func (param i32) (param i32)
- (call 0 (get_local 0))
- (call 1 (get_local 1))
+ (call 0 (local.get 0))
+ (call 1 (local.get 1))
)
(export "print32" (func 2))
)
diff --git a/test/spec/nop.wast b/test/spec/nop.wast
index ab83eede2..aebe43819 100644
--- a/test/spec/nop.wast
+++ b/test/spec/nop.wast
@@ -4,7 +4,7 @@
;; Auxiliary definitions
(func $dummy)
(func $3-ary (param i32 i32 i32) (result i32)
- get_local 0 get_local 1 get_local 2 i32.sub i32.add
+ local.get 0 local.get 1 local.get 2 i32.sub i32.add
)
(memory 1)
@@ -22,24 +22,24 @@
)
(func (export "as-drop-last") (param i32)
- (get_local 0) (nop) (drop)
+ (local.get 0) (nop) (drop)
)
(func (export "as-drop-everywhere") (param i32)
- (nop) (nop) (get_local 0) (nop) (nop) (drop)
+ (nop) (nop) (local.get 0) (nop) (nop) (drop)
)
(func (export "as-select-mid1") (param i32) (result i32)
- (get_local 0) (nop) (get_local 0) (get_local 0) (select)
+ (local.get 0) (nop) (local.get 0) (local.get 0) (select)
)
(func (export "as-select-mid2") (param i32) (result i32)
- (get_local 0) (get_local 0) (nop) (get_local 0) (select)
+ (local.get 0) (local.get 0) (nop) (local.get 0) (select)
)
(func (export "as-select-last") (param i32) (result i32)
- (get_local 0) (get_local 0) (get_local 0) (nop) (select)
+ (local.get 0) (local.get 0) (local.get 0) (nop) (select)
)
(func (export "as-select-everywhere") (param i32) (result i32)
- (nop) (get_local 0) (nop) (nop) (get_local 0)
- (nop) (nop) (get_local 0) (nop) (nop) (select)
+ (nop) (local.get 0) (nop) (nop) (local.get 0)
+ (nop) (nop) (local.get 0) (nop) (nop) (select)
)
(func (export "as-block-first") (result i32)
@@ -69,110 +69,110 @@
)
(func (export "as-if-condition") (param i32)
- (get_local 0) (nop) (if (then (call $dummy)))
+ (local.get 0) (nop) (if (then (call $dummy)))
)
(func (export "as-if-then") (param i32)
- (if (get_local 0) (nop) (call $dummy))
+ (if (local.get 0) (nop) (call $dummy))
)
(func (export "as-if-else") (param i32)
- (if (get_local 0) (call $dummy) (nop))
+ (if (local.get 0) (call $dummy) (nop))
)
(func (export "as-br-last") (param i32) (result i32)
- (block i32 (get_local 0) (nop) (br 0))
+ (block i32 (local.get 0) (nop) (br 0))
)
(func (export "as-br-everywhere") (param i32) (result i32)
- (block i32 (nop) (nop) (get_local 0) (nop) (nop) (br 0))
+ (block i32 (nop) (nop) (local.get 0) (nop) (nop) (br 0))
)
(func (export "as-br_if-mid") (param i32) (result i32)
- (block i32 (get_local 0) (nop) (get_local 0) (br_if 0))
+ (block i32 (local.get 0) (nop) (local.get 0) (br_if 0))
)
(func (export "as-br_if-last") (param i32) (result i32)
- (block i32 (get_local 0) (get_local 0) (nop) (br_if 0))
+ (block i32 (local.get 0) (local.get 0) (nop) (br_if 0))
)
(func (export "as-br_if-everywhere") (param i32) (result i32)
(block i32
- (nop) (nop) (get_local 0) (nop) (nop) (get_local 0) (nop) (nop)
+ (nop) (nop) (local.get 0) (nop) (nop) (local.get 0) (nop) (nop)
(br_if 0)
)
)
(func (export "as-br_table-mid") (param i32) (result i32)
- (block i32 (get_local 0) (nop) (get_local 0) (br_table 0 0))
+ (block i32 (local.get 0) (nop) (local.get 0) (br_table 0 0))
)
(func (export "as-br_table-last") (param i32) (result i32)
- (block i32 (get_local 0) (get_local 0) (nop) (br_table 0 0))
+ (block i32 (local.get 0) (local.get 0) (nop) (br_table 0 0))
)
(func (export "as-br_table-everywhere") (param i32) (result i32)
(block i32
- (nop) (nop) (get_local 0) (nop) (nop) (get_local 0) (nop) (nop)
+ (nop) (nop) (local.get 0) (nop) (nop) (local.get 0) (nop) (nop)
(br_table 0 0)
)
)
(func (export "as-return-last") (param i32) (result i32)
- (get_local 0) (nop) (return)
+ (local.get 0) (nop) (return)
)
(func (export "as-return-everywhere") (param i32) (result i32)
- (nop) (nop) (get_local 0) (nop) (nop) (return)
+ (nop) (nop) (local.get 0) (nop) (nop) (return)
)
(func (export "as-call-mid1") (param i32 i32 i32) (result i32)
- (get_local 0) (nop) (get_local 1) (get_local 2) (call $3-ary)
+ (local.get 0) (nop) (local.get 1) (local.get 2) (call $3-ary)
)
(func (export "as-call-mid2") (param i32 i32 i32) (result i32)
- (get_local 0) (get_local 1) (nop) (get_local 2) (call $3-ary)
+ (local.get 0) (local.get 1) (nop) (local.get 2) (call $3-ary)
)
(func (export "as-call-last") (param i32 i32 i32) (result i32)
- (get_local 0) (get_local 1) (get_local 2) (nop) (call $3-ary)
+ (local.get 0) (local.get 1) (local.get 2) (nop) (call $3-ary)
)
(func (export "as-call-everywhere") (param i32 i32 i32) (result i32)
- (nop) (nop) (get_local 0) (nop) (nop) (get_local 1)
- (nop) (nop) (get_local 2) (nop) (nop) (call $3-ary)
+ (nop) (nop) (local.get 0) (nop) (nop) (local.get 1)
+ (nop) (nop) (local.get 2) (nop) (nop) (call $3-ary)
)
;; TODO(stack): call_indirect, *_local, load*, store*
(func (export "as-unary-last") (param i32) (result i32)
- (get_local 0) (nop) (i32.ctz)
+ (local.get 0) (nop) (i32.ctz)
)
(func (export "as-unary-everywhere") (param i32) (result i32)
- (nop) (nop) (get_local 0) (nop) (nop) (i32.ctz)
+ (nop) (nop) (local.get 0) (nop) (nop) (i32.ctz)
)
(func (export "as-binary-mid") (param i32) (result i32)
- (get_local 0) (nop) (get_local 0) (i32.add)
+ (local.get 0) (nop) (local.get 0) (i32.add)
)
(func (export "as-binary-last") (param i32) (result i32)
- (get_local 0) (get_local 0) (nop) (i32.add)
+ (local.get 0) (local.get 0) (nop) (i32.add)
)
(func (export "as-binary-everywhere") (param i32) (result i32)
- (nop) (get_local 0) (nop) (nop) (get_local 0) (nop) (nop) (i32.add)
+ (nop) (local.get 0) (nop) (nop) (local.get 0) (nop) (nop) (i32.add)
)
(func (export "as-test-last") (param i32) (result i32)
- (get_local 0) (nop) (i32.eqz)
+ (local.get 0) (nop) (i32.eqz)
)
(func (export "as-test-everywhere") (param i32) (result i32)
- (nop) (nop) (get_local 0) (nop) (nop) i32.eqz
+ (nop) (nop) (local.get 0) (nop) (nop) i32.eqz
)
(func (export "as-compare-mid") (param i32) (result i32)
- (get_local 0) (nop) (get_local 0) (i32.ne)
+ (local.get 0) (nop) (local.get 0) (i32.ne)
)
(func (export "as-compare-last") (param i32) (result i32)
- (get_local 0) (get_local 0) (nop) (i32.lt_u)
+ (local.get 0) (local.get 0) (nop) (i32.lt_u)
)
(func (export "as-compare-everywhere") (param i32) (result i32)
- (nop) (get_local 0) (nop) (nop) (get_local 0) (nop) (nop) (i32.le_s)
+ (nop) (local.get 0) (nop) (nop) (local.get 0) (nop) (nop) (i32.le_s)
)
(func (export "as-grow_memory-last") (param i32) (result i32)
- (get_local 0) (nop) (grow_memory)
+ (local.get 0) (nop) (grow_memory)
)
(func (export "as-grow_memory-everywhere") (param i32) (result i32)
- (nop) (nop) (get_local 0) (nop) (nop) (grow_memory)
+ (nop) (nop) (local.get 0) (nop) (nop) (grow_memory)
)
)
diff --git a/test/spec/resizing.wast b/test/spec/resizing.wast
index c24b7ec1a..b340bb4ea 100644
--- a/test/spec/resizing.wast
+++ b/test/spec/resizing.wast
@@ -7,7 +7,7 @@
(func (export "load_at_page_size") (result i32) (i32.load (i32.const 0x10000)))
(func (export "store_at_page_size") (i32.store (i32.const 0x10000) (i32.const 3)))
- (func (export "grow") (param $sz i32) (result i32) (grow_memory (get_local $sz)))
+ (func (export "grow") (param $sz i32) (result i32) (grow_memory (local.get $sz)))
(func (export "size") (result i32) (current_memory))
)
@@ -35,7 +35,7 @@
(module
(memory 0)
- (func (export "grow") (param i32) (result i32) (grow_memory (get_local 0)))
+ (func (export "grow") (param i32) (result i32) (grow_memory (local.get 0)))
)
(assert_return (invoke "grow" (i32.const 0)) (i32.const 0))
@@ -46,7 +46,7 @@
(module
(memory 0 10)
- (func (export "grow") (param i32) (result i32) (grow_memory (get_local 0)))
+ (func (export "grow") (param i32) (result i32) (grow_memory (local.get 0)))
)
(assert_return (invoke "grow" (i32.const 0)) (i32.const 0))
diff --git a/test/spec/return.wast b/test/spec/return.wast
index e47468bee..f6fd6de33 100644
--- a/test/spec/return.wast
+++ b/test/spec/return.wast
@@ -84,17 +84,17 @@
(if i32 (return (i32.const 2)) (i32.const 0) (i32.const 1))
)
(func (export "as-if-then") (param i32 i32) (result i32)
- (if i32 (get_local 0) (return (i32.const 3)) (get_local 1))
+ (if i32 (local.get 0) (return (i32.const 3)) (local.get 1))
)
(func (export "as-if-else") (param i32 i32) (result i32)
- (if i32 (get_local 0) (get_local 1) (return (i32.const 4)))
+ (if i32 (local.get 0) (local.get 1) (return (i32.const 4)))
)
(func (export "as-select-first") (param i32 i32) (result i32)
- (select (return (i32.const 5)) (get_local 0) (get_local 1))
+ (select (return (i32.const 5)) (local.get 0) (local.get 1))
)
(func (export "as-select-second") (param i32 i32) (result i32)
- (select (get_local 0) (return (i32.const 6)) (get_local 1))
+ (select (local.get 0) (return (i32.const 6)) (local.get 1))
)
(func (export "as-select-cond") (result i32)
(select (i32.const 0) (i32.const 1) (return (i32.const 7)))
@@ -112,7 +112,7 @@
)
(type $sig (func (param i32 i32 i32) (result i32)))
- (table anyfunc (elem $f))
+ (table funcref (elem $f))
(func (export "as-call_indirect-func") (result i32)
(call_indirect (type $sig) (return (i32.const 20)) (i32.const 1) (i32.const 2) (i32.const 3))
)
@@ -126,8 +126,8 @@
(call_indirect (type $sig) (i32.const 0) (i32.const 1) (i32.const 2) (return (i32.const 23)))
)
- (func (export "as-set_local-value") (result i32) (local f32)
- (set_local 0 (return (i32.const 17))) (i32.const -1)
+ (func (export "as-local.set-value") (result i32) (local f32)
+ (local.set 0 (return (i32.const 17))) (i32.const -1)
)
(memory 1)
@@ -175,7 +175,7 @@
)
(func (export "as-convert-operand") (result i32)
- (i32.wrap/i64 (return (i32.const 41)))
+ (i32.wrap_i64 (return (i32.const 41)))
)
(func (export "as-grow_memory-size") (result i32)
@@ -238,7 +238,7 @@
(assert_return (invoke "as-call_indirect-mid") (i32.const 22))
(assert_return (invoke "as-call_indirect-last") (i32.const 23))
-(assert_return (invoke "as-set_local-value") (i32.const 17))
+(assert_return (invoke "as-local.set-value") (i32.const 17))
(assert_return (invoke "as-load-address") (f32.const 1.7))
(assert_return (invoke "as-loadN-address") (i64.const 30))
diff --git a/test/spec/select.wast b/test/spec/select.wast
index a2406017f..493f67f0a 100644
--- a/test/spec/select.wast
+++ b/test/spec/select.wast
@@ -1,21 +1,21 @@
(module
(func (export "select_i32") (param $lhs i32) (param $rhs i32) (param $cond i32) (result i32)
- (select (get_local $lhs) (get_local $rhs) (get_local $cond)))
+ (select (local.get $lhs) (local.get $rhs) (local.get $cond)))
(func (export "select_i64") (param $lhs i64) (param $rhs i64) (param $cond i32) (result i64)
- (select (get_local $lhs) (get_local $rhs) (get_local $cond)))
+ (select (local.get $lhs) (local.get $rhs) (local.get $cond)))
(func (export "select_f32") (param $lhs f32) (param $rhs f32) (param $cond i32) (result f32)
- (select (get_local $lhs) (get_local $rhs) (get_local $cond)))
+ (select (local.get $lhs) (local.get $rhs) (local.get $cond)))
(func (export "select_f64") (param $lhs f64) (param $rhs f64) (param $cond i32) (result f64)
- (select (get_local $lhs) (get_local $rhs) (get_local $cond)))
+ (select (local.get $lhs) (local.get $rhs) (local.get $cond)))
;; Check that both sides of the select are evaluated
(func (export "select_trap_l") (param $cond i32) (result i32)
- (select (unreachable) (i32.const 0) (get_local $cond)))
+ (select (unreachable) (i32.const 0) (local.get $cond)))
(func (export "select_trap_r") (param $cond i32) (result i32)
- (select (i32.const 0) (unreachable) (get_local $cond)))
+ (select (i32.const 0) (unreachable) (local.get $cond)))
)
(assert_return (invoke "select_i32" (i32.const 1) (i32.const 2) (i32.const 1)) (i32.const 1))
diff --git a/test/spec/set_local.wast b/test/spec/set_local.wast
index 5a006e114..ddcd1f17d 100644
--- a/test/spec/set_local.wast
+++ b/test/spec/set_local.wast
@@ -1,58 +1,58 @@
-;; Test `set_local` operator
+;; Test `local.set` operator
(module
;; Typing
- (func (export "type-local-i32") (local i32) (set_local 0 (i32.const 0)))
- (func (export "type-local-i64") (local i64) (set_local 0 (i64.const 0)))
- (func (export "type-local-f32") (local f32) (set_local 0 (f32.const 0)))
- (func (export "type-local-f64") (local f64) (set_local 0 (f64.const 0)))
+ (func (export "type-local-i32") (local i32) (local.set 0 (i32.const 0)))
+ (func (export "type-local-i64") (local i64) (local.set 0 (i64.const 0)))
+ (func (export "type-local-f32") (local f32) (local.set 0 (f32.const 0)))
+ (func (export "type-local-f64") (local f64) (local.set 0 (f64.const 0)))
- (func (export "type-param-i32") (param i32) (set_local 0 (i32.const 10)))
- (func (export "type-param-i64") (param i64) (set_local 0 (i64.const 11)))
- (func (export "type-param-f32") (param f32) (set_local 0 (f32.const 11.1)))
- (func (export "type-param-f64") (param f64) (set_local 0 (f64.const 12.2)))
+ (func (export "type-param-i32") (param i32) (local.set 0 (i32.const 10)))
+ (func (export "type-param-i64") (param i64) (local.set 0 (i64.const 11)))
+ (func (export "type-param-f32") (param f32) (local.set 0 (f32.const 11.1)))
+ (func (export "type-param-f64") (param f64) (local.set 0 (f64.const 12.2)))
(func (export "type-mixed") (param i64 f32 f64 i32 i32) (local f32 i64 i64 f64)
- (set_local 0 (i64.const 0))
- (set_local 1 (f32.const 0))
- (set_local 2 (f64.const 0))
- (set_local 3 (i32.const 0))
- (set_local 4 (i32.const 0))
- (set_local 5 (f32.const 0))
- (set_local 6 (i64.const 0))
- (set_local 7 (i64.const 0))
- (set_local 8 (f64.const 0))
+ (local.set 0 (i64.const 0))
+ (local.set 1 (f32.const 0))
+ (local.set 2 (f64.const 0))
+ (local.set 3 (i32.const 0))
+ (local.set 4 (i32.const 0))
+ (local.set 5 (f32.const 0))
+ (local.set 6 (i64.const 0))
+ (local.set 7 (i64.const 0))
+ (local.set 8 (f64.const 0))
)
;; Writing
(func (export "write") (param i64 f32 f64 i32 i32) (result i64)
(local f32 i64 i64 f64)
- (set_local 1 (f32.const -0.3))
- (set_local 3 (i32.const 40))
- (set_local 4 (i32.const -7))
- (set_local 5 (f32.const 5.5))
- (set_local 6 (i64.const 6))
- (set_local 8 (f64.const 8))
- (i64.trunc_s/f64
+ (local.set 1 (f32.const -0.3))
+ (local.set 3 (i32.const 40))
+ (local.set 4 (i32.const -7))
+ (local.set 5 (f32.const 5.5))
+ (local.set 6 (i64.const 6))
+ (local.set 8 (f64.const 8))
+ (i64.trunc_f64_s
(f64.add
- (f64.convert_u/i64 (get_local 0))
+ (f64.convert_i64_u (local.get 0))
(f64.add
- (f64.promote/f32 (get_local 1))
+ (f64.promote_f32 (local.get 1))
(f64.add
- (get_local 2)
+ (local.get 2)
(f64.add
- (f64.convert_u/i32 (get_local 3))
+ (f64.convert_i32_u (local.get 3))
(f64.add
- (f64.convert_s/i32 (get_local 4))
+ (f64.convert_i32_s (local.get 4))
(f64.add
- (f64.promote/f32 (get_local 5))
+ (f64.promote_f32 (local.get 5))
(f64.add
- (f64.convert_u/i64 (get_local 6))
+ (f64.convert_i64_u (local.get 6))
(f64.add
- (f64.convert_u/i64 (get_local 7))
- (get_local 8)
+ (f64.convert_i64_u (local.get 7))
+ (local.get 8)
)
)
)
@@ -93,37 +93,37 @@
(assert_invalid
(module (func $type-local-num-vs-num (result i64) (local i32)
- (set_local 0 (i32.const 0))
+ (local.set 0 (i32.const 0))
))
"type mismatch"
)
(assert_invalid
(module (func $type-local-num-vs-num (local f32)
- (i32.eqz (set_local 0 (f32.const 0)))
+ (i32.eqz (local.set 0 (f32.const 0)))
))
"type mismatch"
)
(assert_invalid
(module (func $type-local-num-vs-num (local f64 i64)
- (f64.neg (set_local 1 (i64.const 0)))
+ (f64.neg (local.set 1 (i64.const 0)))
))
"type mismatch"
)
(assert_invalid
- (module (func $type-local-arg-void-vs-num (local i32) (set_local 0 (nop))))
+ (module (func $type-local-arg-void-vs-num (local i32) (local.set 0 (nop))))
"type mismatch"
)
(assert_invalid
- (module (func $type-local-arg-num-vs-num (local i32) (set_local 0 (f32.const 0))))
+ (module (func $type-local-arg-num-vs-num (local i32) (local.set 0 (f32.const 0))))
"type mismatch"
)
(assert_invalid
- (module (func $type-local-arg-num-vs-num (local f32) (set_local 0 (f64.const 0))))
+ (module (func $type-local-arg-num-vs-num (local f32) (local.set 0 (f64.const 0))))
"type mismatch"
)
(assert_invalid
- (module (func $type-local-arg-num-vs-num (local f64 i64) (set_local 1 (f64.const 0))))
+ (module (func $type-local-arg-num-vs-num (local f64 i64) (local.set 1 (f64.const 0))))
"type mismatch"
)
@@ -131,32 +131,32 @@
;; Invalid typing of access to parameters
(assert_invalid
- (module (func $type-param-num-vs-num (param i32) (result i64) (get_local 0)))
+ (module (func $type-param-num-vs-num (param i32) (result i64) (local.get 0)))
"type mismatch"
)
(assert_invalid
- (module (func $type-param-num-vs-num (param f32) (i32.eqz (get_local 0))))
+ (module (func $type-param-num-vs-num (param f32) (i32.eqz (local.get 0))))
"type mismatch"
)
(assert_invalid
- (module (func $type-param-num-vs-num (param f64 i64) (f64.neg (get_local 1))))
+ (module (func $type-param-num-vs-num (param f64 i64) (f64.neg (local.get 1))))
"type mismatch"
)
(assert_invalid
- (module (func $type-param-arg-void-vs-num (param i32) (set_local 0 (nop))))
+ (module (func $type-param-arg-void-vs-num (param i32) (local.set 0 (nop))))
"type mismatch"
)
(assert_invalid
- (module (func $type-param-arg-num-vs-num (param i32) (set_local 0 (f32.const 0))))
+ (module (func $type-param-arg-num-vs-num (param i32) (local.set 0 (f32.const 0))))
"type mismatch"
)
(assert_invalid
- (module (func $type-param-arg-num-vs-num (param f32) (set_local 0 (f64.const 0))))
+ (module (func $type-param-arg-num-vs-num (param f32) (local.set 0 (f64.const 0))))
"type mismatch"
)
(assert_invalid
- (module (func $type-param-arg-num-vs-num (param f64 i64) (set_local 1 (f64.const 0))))
+ (module (func $type-param-arg-num-vs-num (param f64 i64) (local.set 1 (f64.const 0))))
"type mismatch"
)
@@ -164,42 +164,42 @@
;; Invalid local index
(assert_invalid
- (module (func $unbound-local (local i32 i64) (get_local 3)))
+ (module (func $unbound-local (local i32 i64) (local.get 3)))
"unknown local"
)
(assert_invalid
- (module (func $large-local (local i32 i64) (get_local 14324343)))
+ (module (func $large-local (local i32 i64) (local.get 14324343)))
"unknown local"
)
(assert_invalid
- (module (func $unbound-param (param i32 i64) (get_local 2)))
+ (module (func $unbound-param (param i32 i64) (local.get 2)))
"unknown local"
)
(assert_invalid
- (module (func $large-param (local i32 i64) (get_local 714324343)))
+ (module (func $large-param (local i32 i64) (local.get 714324343)))
"unknown local"
)
(assert_invalid
- (module (func $unbound-mixed (param i32) (local i32 i64) (get_local 3)))
+ (module (func $unbound-mixed (param i32) (local i32 i64) (local.get 3)))
"unknown local"
)
(assert_invalid
- (module (func $large-mixed (param i64) (local i32 i64) (get_local 214324343)))
+ (module (func $large-mixed (param i64) (local i32 i64) (local.get 214324343)))
"unknown local"
)
(assert_invalid
- (module (func $type-mixed-arg-num-vs-num (param f32) (local i32) (set_local 1 (f32.const 0))))
+ (module (func $type-mixed-arg-num-vs-num (param f32) (local i32) (local.set 1 (f32.const 0))))
"type mismatch"
)
(assert_invalid
- (module (func $type-mixed-arg-num-vs-num (param i64 i32) (local f32) (set_local 1 (f32.const 0))))
+ (module (func $type-mixed-arg-num-vs-num (param i64 i32) (local f32) (local.set 1 (f32.const 0))))
"type mismatch"
)
(assert_invalid
- (module (func $type-mixed-arg-num-vs-num (param i64) (local f64 i64) (set_local 1 (i64.const 0))))
+ (module (func $type-mixed-arg-num-vs-num (param i64) (local f64 i64) (local.set 1 (i64.const 0))))
"type mismatch"
)
diff --git a/test/spec/simd.wast b/test/spec/simd.wast
index b0c7c8e2f..8d2edc42e 100644
--- a/test/spec/simd.wast
+++ b/test/spec/simd.wast
@@ -1,170 +1,170 @@
(module
(memory 1)
(data (i32.const 128) "WASMSIMDGOESFAST")
- (func (export "v128.load") (param $0 i32) (result v128)(v128.load (get_local $0)))
+ (func (export "v128.load") (param $0 i32) (result v128)(v128.load (local.get $0)))
(func (export "v128.store") (param $0 i32) (param $1 v128) (result v128)
- (v128.store offset=0 align=16 (get_local $0) (get_local $1))
- (v128.load (get_local $0))
+ (v128.store offset=0 align=16 (local.get $0) (local.get $1))
+ (v128.load (local.get $0))
)
(func (export "v128.const") (result v128) (v128.const i32 1 2 3 4))
(func (export "v128.shuffle_interleave_bytes") (param $0 v128) (param $1 v128) (result v128)
- (v8x16.shuffle 0 17 2 19 4 21 6 23 8 25 10 27 12 29 14 31 (get_local $0) (get_local $1))
+ (v8x16.shuffle 0 17 2 19 4 21 6 23 8 25 10 27 12 29 14 31 (local.get $0) (local.get $1))
)
(func (export "v128.shuffle_reverse_i32s") (param $0 v128) (result v128)
- (v8x16.shuffle 12 13 14 15 8 9 10 11 4 5 6 7 0 1 2 3 (get_local $0) (get_local $0))
+ (v8x16.shuffle 12 13 14 15 8 9 10 11 4 5 6 7 0 1 2 3 (local.get $0) (local.get $0))
)
- (func (export "i8x16.splat") (param $0 i32) (result v128) (i8x16.splat (get_local $0)))
- (func (export "i8x16.extract_lane_s_first") (param $0 v128) (result i32) (i8x16.extract_lane_s 0 (get_local $0)))
- (func (export "i8x16.extract_lane_s_last") (param $0 v128) (result i32) (i8x16.extract_lane_s 15 (get_local $0)))
- (func (export "i8x16.extract_lane_u_first") (param $0 v128) (result i32) (i8x16.extract_lane_u 0 (get_local $0)))
- (func (export "i8x16.extract_lane_u_last") (param $0 v128) (result i32) (i8x16.extract_lane_u 15 (get_local $0)))
- (func (export "i8x16.replace_lane_first") (param $0 v128) (param $1 i32) (result v128) (i8x16.replace_lane 0 (get_local $0) (get_local $1)))
- (func (export "i8x16.replace_lane_last") (param $0 v128) (param $1 i32) (result v128) (i8x16.replace_lane 15 (get_local $0) (get_local $1)))
- (func (export "i16x8.splat") (param $0 i32) (result v128) (i16x8.splat (get_local $0)))
- (func (export "i16x8.extract_lane_s_first") (param $0 v128) (result i32) (i16x8.extract_lane_s 0 (get_local $0)))
- (func (export "i16x8.extract_lane_s_last") (param $0 v128) (result i32) (i16x8.extract_lane_s 7 (get_local $0)))
- (func (export "i16x8.extract_lane_u_first") (param $0 v128) (result i32) (i16x8.extract_lane_u 0 (get_local $0)))
- (func (export "i16x8.extract_lane_u_last") (param $0 v128) (result i32) (i16x8.extract_lane_u 7 (get_local $0)))
- (func (export "i16x8.replace_lane_first") (param $0 v128) (param $1 i32) (result v128) (i16x8.replace_lane 0 (get_local $0) (get_local $1)))
- (func (export "i16x8.replace_lane_last") (param $0 v128) (param $1 i32) (result v128) (i16x8.replace_lane 7 (get_local $0) (get_local $1)))
- (func (export "i32x4.splat") (param $0 i32) (result v128) (i32x4.splat (get_local $0)))
- (func (export "i32x4.extract_lane_first") (param $0 v128) (result i32) (i32x4.extract_lane 0 (get_local $0)))
- (func (export "i32x4.extract_lane_last") (param $0 v128) (result i32) (i32x4.extract_lane 3 (get_local $0)))
- (func (export "i32x4.replace_lane_first") (param $0 v128) (param $1 i32) (result v128) (i32x4.replace_lane 0 (get_local $0) (get_local $1)))
- (func (export "i32x4.replace_lane_last") (param $0 v128) (param $1 i32) (result v128) (i32x4.replace_lane 3 (get_local $0) (get_local $1)))
- (func (export "i64x2.splat") (param $0 i64) (result v128) (i64x2.splat (get_local $0)))
- (func (export "i64x2.extract_lane_first") (param $0 v128) (result i64) (i64x2.extract_lane 0 (get_local $0)))
- (func (export "i64x2.extract_lane_last") (param $0 v128) (result i64) (i64x2.extract_lane 1 (get_local $0)))
- (func (export "i64x2.replace_lane_first") (param $0 v128) (param $1 i64) (result v128) (i64x2.replace_lane 0 (get_local $0) (get_local $1)))
- (func (export "i64x2.replace_lane_last") (param $0 v128) (param $1 i64) (result v128) (i64x2.replace_lane 1 (get_local $0) (get_local $1)))
- (func (export "f32x4.splat") (param $0 f32) (result v128) (f32x4.splat (get_local $0)))
- (func (export "f32x4.extract_lane_first") (param $0 v128) (result f32) (f32x4.extract_lane 0 (get_local $0)))
- (func (export "f32x4.extract_lane_last") (param $0 v128) (result f32) (f32x4.extract_lane 3 (get_local $0)))
- (func (export "f32x4.replace_lane_first") (param $0 v128) (param $1 f32) (result v128) (f32x4.replace_lane 0 (get_local $0) (get_local $1)))
- (func (export "f32x4.replace_lane_last") (param $0 v128) (param $1 f32) (result v128) (f32x4.replace_lane 3 (get_local $0) (get_local $1)))
- (func (export "f64x2.splat") (param $0 f64) (result v128) (f64x2.splat (get_local $0)))
- (func (export "f64x2.extract_lane_first") (param $0 v128) (result f64) (f64x2.extract_lane 0 (get_local $0)))
- (func (export "f64x2.extract_lane_last") (param $0 v128) (result f64) (f64x2.extract_lane 1 (get_local $0)))
- (func (export "f64x2.replace_lane_first") (param $0 v128) (param $1 f64) (result v128) (f64x2.replace_lane 0 (get_local $0) (get_local $1)))
- (func (export "f64x2.replace_lane_last") (param $0 v128) (param $1 f64) (result v128) (f64x2.replace_lane 1 (get_local $0) (get_local $1)))
- (func (export "i8x16.eq") (param $0 v128) (param $1 v128) (result v128) (i8x16.eq (get_local $0) (get_local $1)))
- (func (export "i8x16.ne") (param $0 v128) (param $1 v128) (result v128) (i8x16.ne (get_local $0) (get_local $1)))
- (func (export "i8x16.lt_s") (param $0 v128) (param $1 v128) (result v128) (i8x16.lt_s (get_local $0) (get_local $1)))
- (func (export "i8x16.lt_u") (param $0 v128) (param $1 v128) (result v128) (i8x16.lt_u (get_local $0) (get_local $1)))
- (func (export "i8x16.gt_s") (param $0 v128) (param $1 v128) (result v128) (i8x16.gt_s (get_local $0) (get_local $1)))
- (func (export "i8x16.gt_u") (param $0 v128) (param $1 v128) (result v128) (i8x16.gt_u (get_local $0) (get_local $1)))
- (func (export "i8x16.le_s") (param $0 v128) (param $1 v128) (result v128) (i8x16.le_s (get_local $0) (get_local $1)))
- (func (export "i8x16.le_u") (param $0 v128) (param $1 v128) (result v128) (i8x16.le_u (get_local $0) (get_local $1)))
- (func (export "i8x16.ge_s") (param $0 v128) (param $1 v128) (result v128) (i8x16.ge_s (get_local $0) (get_local $1)))
- (func (export "i8x16.ge_u") (param $0 v128) (param $1 v128) (result v128) (i8x16.ge_u (get_local $0) (get_local $1)))
- (func (export "i16x8.eq") (param $0 v128) (param $1 v128) (result v128) (i16x8.eq (get_local $0) (get_local $1)))
- (func (export "i16x8.ne") (param $0 v128) (param $1 v128) (result v128) (i16x8.ne (get_local $0) (get_local $1)))
- (func (export "i16x8.lt_s") (param $0 v128) (param $1 v128) (result v128) (i16x8.lt_s (get_local $0) (get_local $1)))
- (func (export "i16x8.lt_u") (param $0 v128) (param $1 v128) (result v128) (i16x8.lt_u (get_local $0) (get_local $1)))
- (func (export "i16x8.gt_s") (param $0 v128) (param $1 v128) (result v128) (i16x8.gt_s (get_local $0) (get_local $1)))
- (func (export "i16x8.gt_u") (param $0 v128) (param $1 v128) (result v128) (i16x8.gt_u (get_local $0) (get_local $1)))
- (func (export "i16x8.le_s") (param $0 v128) (param $1 v128) (result v128) (i16x8.le_s (get_local $0) (get_local $1)))
- (func (export "i16x8.le_u") (param $0 v128) (param $1 v128) (result v128) (i16x8.le_u (get_local $0) (get_local $1)))
- (func (export "i16x8.ge_s") (param $0 v128) (param $1 v128) (result v128) (i16x8.ge_s (get_local $0) (get_local $1)))
- (func (export "i16x8.ge_u") (param $0 v128) (param $1 v128) (result v128) (i16x8.ge_u (get_local $0) (get_local $1)))
- (func (export "i32x4.eq") (param $0 v128) (param $1 v128) (result v128) (i32x4.eq (get_local $0) (get_local $1)))
- (func (export "i32x4.ne") (param $0 v128) (param $1 v128) (result v128) (i32x4.ne (get_local $0) (get_local $1)))
- (func (export "i32x4.lt_s") (param $0 v128) (param $1 v128) (result v128) (i32x4.lt_s (get_local $0) (get_local $1)))
- (func (export "i32x4.lt_u") (param $0 v128) (param $1 v128) (result v128) (i32x4.lt_u (get_local $0) (get_local $1)))
- (func (export "i32x4.gt_s") (param $0 v128) (param $1 v128) (result v128) (i32x4.gt_s (get_local $0) (get_local $1)))
- (func (export "i32x4.gt_u") (param $0 v128) (param $1 v128) (result v128) (i32x4.gt_u (get_local $0) (get_local $1)))
- (func (export "i32x4.le_s") (param $0 v128) (param $1 v128) (result v128) (i32x4.le_s (get_local $0) (get_local $1)))
- (func (export "i32x4.le_u") (param $0 v128) (param $1 v128) (result v128) (i32x4.le_u (get_local $0) (get_local $1)))
- (func (export "i32x4.ge_s") (param $0 v128) (param $1 v128) (result v128) (i32x4.ge_s (get_local $0) (get_local $1)))
- (func (export "i32x4.ge_u") (param $0 v128) (param $1 v128) (result v128) (i32x4.ge_u (get_local $0) (get_local $1)))
- (func (export "f32x4.eq") (param $0 v128) (param $1 v128) (result v128) (f32x4.eq (get_local $0) (get_local $1)))
- (func (export "f32x4.ne") (param $0 v128) (param $1 v128) (result v128) (f32x4.ne (get_local $0) (get_local $1)))
- (func (export "f32x4.lt") (param $0 v128) (param $1 v128) (result v128) (f32x4.lt (get_local $0) (get_local $1)))
- (func (export "f32x4.gt") (param $0 v128) (param $1 v128) (result v128) (f32x4.gt (get_local $0) (get_local $1)))
- (func (export "f32x4.le") (param $0 v128) (param $1 v128) (result v128) (f32x4.le (get_local $0) (get_local $1)))
- (func (export "f32x4.ge") (param $0 v128) (param $1 v128) (result v128) (f32x4.ge (get_local $0) (get_local $1)))
- (func (export "f64x2.eq") (param $0 v128) (param $1 v128) (result v128) (f64x2.eq (get_local $0) (get_local $1)))
- (func (export "f64x2.ne") (param $0 v128) (param $1 v128) (result v128) (f64x2.ne (get_local $0) (get_local $1)))
- (func (export "f64x2.lt") (param $0 v128) (param $1 v128) (result v128) (f64x2.lt (get_local $0) (get_local $1)))
- (func (export "f64x2.gt") (param $0 v128) (param $1 v128) (result v128) (f64x2.gt (get_local $0) (get_local $1)))
- (func (export "f64x2.le") (param $0 v128) (param $1 v128) (result v128) (f64x2.le (get_local $0) (get_local $1)))
- (func (export "f64x2.ge") (param $0 v128) (param $1 v128) (result v128) (f64x2.ge (get_local $0) (get_local $1)))
- (func (export "v128.not") (param $0 v128) (result v128) (v128.not (get_local $0)))
- (func (export "v128.and") (param $0 v128) (param $1 v128) (result v128) (v128.and (get_local $0) (get_local $1)))
- (func (export "v128.or") (param $0 v128) (param $1 v128) (result v128) (v128.or (get_local $0) (get_local $1)))
- (func (export "v128.xor") (param $0 v128) (param $1 v128) (result v128) (v128.xor (get_local $0) (get_local $1)))
+ (func (export "i8x16.splat") (param $0 i32) (result v128) (i8x16.splat (local.get $0)))
+ (func (export "i8x16.extract_lane_s_first") (param $0 v128) (result i32) (i8x16.extract_lane_s 0 (local.get $0)))
+ (func (export "i8x16.extract_lane_s_last") (param $0 v128) (result i32) (i8x16.extract_lane_s 15 (local.get $0)))
+ (func (export "i8x16.extract_lane_u_first") (param $0 v128) (result i32) (i8x16.extract_lane_u 0 (local.get $0)))
+ (func (export "i8x16.extract_lane_u_last") (param $0 v128) (result i32) (i8x16.extract_lane_u 15 (local.get $0)))
+ (func (export "i8x16.replace_lane_first") (param $0 v128) (param $1 i32) (result v128) (i8x16.replace_lane 0 (local.get $0) (local.get $1)))
+ (func (export "i8x16.replace_lane_last") (param $0 v128) (param $1 i32) (result v128) (i8x16.replace_lane 15 (local.get $0) (local.get $1)))
+ (func (export "i16x8.splat") (param $0 i32) (result v128) (i16x8.splat (local.get $0)))
+ (func (export "i16x8.extract_lane_s_first") (param $0 v128) (result i32) (i16x8.extract_lane_s 0 (local.get $0)))
+ (func (export "i16x8.extract_lane_s_last") (param $0 v128) (result i32) (i16x8.extract_lane_s 7 (local.get $0)))
+ (func (export "i16x8.extract_lane_u_first") (param $0 v128) (result i32) (i16x8.extract_lane_u 0 (local.get $0)))
+ (func (export "i16x8.extract_lane_u_last") (param $0 v128) (result i32) (i16x8.extract_lane_u 7 (local.get $0)))
+ (func (export "i16x8.replace_lane_first") (param $0 v128) (param $1 i32) (result v128) (i16x8.replace_lane 0 (local.get $0) (local.get $1)))
+ (func (export "i16x8.replace_lane_last") (param $0 v128) (param $1 i32) (result v128) (i16x8.replace_lane 7 (local.get $0) (local.get $1)))
+ (func (export "i32x4.splat") (param $0 i32) (result v128) (i32x4.splat (local.get $0)))
+ (func (export "i32x4.extract_lane_first") (param $0 v128) (result i32) (i32x4.extract_lane 0 (local.get $0)))
+ (func (export "i32x4.extract_lane_last") (param $0 v128) (result i32) (i32x4.extract_lane 3 (local.get $0)))
+ (func (export "i32x4.replace_lane_first") (param $0 v128) (param $1 i32) (result v128) (i32x4.replace_lane 0 (local.get $0) (local.get $1)))
+ (func (export "i32x4.replace_lane_last") (param $0 v128) (param $1 i32) (result v128) (i32x4.replace_lane 3 (local.get $0) (local.get $1)))
+ (func (export "i64x2.splat") (param $0 i64) (result v128) (i64x2.splat (local.get $0)))
+ (func (export "i64x2.extract_lane_first") (param $0 v128) (result i64) (i64x2.extract_lane 0 (local.get $0)))
+ (func (export "i64x2.extract_lane_last") (param $0 v128) (result i64) (i64x2.extract_lane 1 (local.get $0)))
+ (func (export "i64x2.replace_lane_first") (param $0 v128) (param $1 i64) (result v128) (i64x2.replace_lane 0 (local.get $0) (local.get $1)))
+ (func (export "i64x2.replace_lane_last") (param $0 v128) (param $1 i64) (result v128) (i64x2.replace_lane 1 (local.get $0) (local.get $1)))
+ (func (export "f32x4.splat") (param $0 f32) (result v128) (f32x4.splat (local.get $0)))
+ (func (export "f32x4.extract_lane_first") (param $0 v128) (result f32) (f32x4.extract_lane 0 (local.get $0)))
+ (func (export "f32x4.extract_lane_last") (param $0 v128) (result f32) (f32x4.extract_lane 3 (local.get $0)))
+ (func (export "f32x4.replace_lane_first") (param $0 v128) (param $1 f32) (result v128) (f32x4.replace_lane 0 (local.get $0) (local.get $1)))
+ (func (export "f32x4.replace_lane_last") (param $0 v128) (param $1 f32) (result v128) (f32x4.replace_lane 3 (local.get $0) (local.get $1)))
+ (func (export "f64x2.splat") (param $0 f64) (result v128) (f64x2.splat (local.get $0)))
+ (func (export "f64x2.extract_lane_first") (param $0 v128) (result f64) (f64x2.extract_lane 0 (local.get $0)))
+ (func (export "f64x2.extract_lane_last") (param $0 v128) (result f64) (f64x2.extract_lane 1 (local.get $0)))
+ (func (export "f64x2.replace_lane_first") (param $0 v128) (param $1 f64) (result v128) (f64x2.replace_lane 0 (local.get $0) (local.get $1)))
+ (func (export "f64x2.replace_lane_last") (param $0 v128) (param $1 f64) (result v128) (f64x2.replace_lane 1 (local.get $0) (local.get $1)))
+ (func (export "i8x16.eq") (param $0 v128) (param $1 v128) (result v128) (i8x16.eq (local.get $0) (local.get $1)))
+ (func (export "i8x16.ne") (param $0 v128) (param $1 v128) (result v128) (i8x16.ne (local.get $0) (local.get $1)))
+ (func (export "i8x16.lt_s") (param $0 v128) (param $1 v128) (result v128) (i8x16.lt_s (local.get $0) (local.get $1)))
+ (func (export "i8x16.lt_u") (param $0 v128) (param $1 v128) (result v128) (i8x16.lt_u (local.get $0) (local.get $1)))
+ (func (export "i8x16.gt_s") (param $0 v128) (param $1 v128) (result v128) (i8x16.gt_s (local.get $0) (local.get $1)))
+ (func (export "i8x16.gt_u") (param $0 v128) (param $1 v128) (result v128) (i8x16.gt_u (local.get $0) (local.get $1)))
+ (func (export "i8x16.le_s") (param $0 v128) (param $1 v128) (result v128) (i8x16.le_s (local.get $0) (local.get $1)))
+ (func (export "i8x16.le_u") (param $0 v128) (param $1 v128) (result v128) (i8x16.le_u (local.get $0) (local.get $1)))
+ (func (export "i8x16.ge_s") (param $0 v128) (param $1 v128) (result v128) (i8x16.ge_s (local.get $0) (local.get $1)))
+ (func (export "i8x16.ge_u") (param $0 v128) (param $1 v128) (result v128) (i8x16.ge_u (local.get $0) (local.get $1)))
+ (func (export "i16x8.eq") (param $0 v128) (param $1 v128) (result v128) (i16x8.eq (local.get $0) (local.get $1)))
+ (func (export "i16x8.ne") (param $0 v128) (param $1 v128) (result v128) (i16x8.ne (local.get $0) (local.get $1)))
+ (func (export "i16x8.lt_s") (param $0 v128) (param $1 v128) (result v128) (i16x8.lt_s (local.get $0) (local.get $1)))
+ (func (export "i16x8.lt_u") (param $0 v128) (param $1 v128) (result v128) (i16x8.lt_u (local.get $0) (local.get $1)))
+ (func (export "i16x8.gt_s") (param $0 v128) (param $1 v128) (result v128) (i16x8.gt_s (local.get $0) (local.get $1)))
+ (func (export "i16x8.gt_u") (param $0 v128) (param $1 v128) (result v128) (i16x8.gt_u (local.get $0) (local.get $1)))
+ (func (export "i16x8.le_s") (param $0 v128) (param $1 v128) (result v128) (i16x8.le_s (local.get $0) (local.get $1)))
+ (func (export "i16x8.le_u") (param $0 v128) (param $1 v128) (result v128) (i16x8.le_u (local.get $0) (local.get $1)))
+ (func (export "i16x8.ge_s") (param $0 v128) (param $1 v128) (result v128) (i16x8.ge_s (local.get $0) (local.get $1)))
+ (func (export "i16x8.ge_u") (param $0 v128) (param $1 v128) (result v128) (i16x8.ge_u (local.get $0) (local.get $1)))
+ (func (export "i32x4.eq") (param $0 v128) (param $1 v128) (result v128) (i32x4.eq (local.get $0) (local.get $1)))
+ (func (export "i32x4.ne") (param $0 v128) (param $1 v128) (result v128) (i32x4.ne (local.get $0) (local.get $1)))
+ (func (export "i32x4.lt_s") (param $0 v128) (param $1 v128) (result v128) (i32x4.lt_s (local.get $0) (local.get $1)))
+ (func (export "i32x4.lt_u") (param $0 v128) (param $1 v128) (result v128) (i32x4.lt_u (local.get $0) (local.get $1)))
+ (func (export "i32x4.gt_s") (param $0 v128) (param $1 v128) (result v128) (i32x4.gt_s (local.get $0) (local.get $1)))
+ (func (export "i32x4.gt_u") (param $0 v128) (param $1 v128) (result v128) (i32x4.gt_u (local.get $0) (local.get $1)))
+ (func (export "i32x4.le_s") (param $0 v128) (param $1 v128) (result v128) (i32x4.le_s (local.get $0) (local.get $1)))
+ (func (export "i32x4.le_u") (param $0 v128) (param $1 v128) (result v128) (i32x4.le_u (local.get $0) (local.get $1)))
+ (func (export "i32x4.ge_s") (param $0 v128) (param $1 v128) (result v128) (i32x4.ge_s (local.get $0) (local.get $1)))
+ (func (export "i32x4.ge_u") (param $0 v128) (param $1 v128) (result v128) (i32x4.ge_u (local.get $0) (local.get $1)))
+ (func (export "f32x4.eq") (param $0 v128) (param $1 v128) (result v128) (f32x4.eq (local.get $0) (local.get $1)))
+ (func (export "f32x4.ne") (param $0 v128) (param $1 v128) (result v128) (f32x4.ne (local.get $0) (local.get $1)))
+ (func (export "f32x4.lt") (param $0 v128) (param $1 v128) (result v128) (f32x4.lt (local.get $0) (local.get $1)))
+ (func (export "f32x4.gt") (param $0 v128) (param $1 v128) (result v128) (f32x4.gt (local.get $0) (local.get $1)))
+ (func (export "f32x4.le") (param $0 v128) (param $1 v128) (result v128) (f32x4.le (local.get $0) (local.get $1)))
+ (func (export "f32x4.ge") (param $0 v128) (param $1 v128) (result v128) (f32x4.ge (local.get $0) (local.get $1)))
+ (func (export "f64x2.eq") (param $0 v128) (param $1 v128) (result v128) (f64x2.eq (local.get $0) (local.get $1)))
+ (func (export "f64x2.ne") (param $0 v128) (param $1 v128) (result v128) (f64x2.ne (local.get $0) (local.get $1)))
+ (func (export "f64x2.lt") (param $0 v128) (param $1 v128) (result v128) (f64x2.lt (local.get $0) (local.get $1)))
+ (func (export "f64x2.gt") (param $0 v128) (param $1 v128) (result v128) (f64x2.gt (local.get $0) (local.get $1)))
+ (func (export "f64x2.le") (param $0 v128) (param $1 v128) (result v128) (f64x2.le (local.get $0) (local.get $1)))
+ (func (export "f64x2.ge") (param $0 v128) (param $1 v128) (result v128) (f64x2.ge (local.get $0) (local.get $1)))
+ (func (export "v128.not") (param $0 v128) (result v128) (v128.not (local.get $0)))
+ (func (export "v128.and") (param $0 v128) (param $1 v128) (result v128) (v128.and (local.get $0) (local.get $1)))
+ (func (export "v128.or") (param $0 v128) (param $1 v128) (result v128) (v128.or (local.get $0) (local.get $1)))
+ (func (export "v128.xor") (param $0 v128) (param $1 v128) (result v128) (v128.xor (local.get $0) (local.get $1)))
(func (export "v128.bitselect") (param $0 v128) (param $1 v128) (param $2 v128) (result v128)
- (v128.bitselect (get_local $0) (get_local $1) (get_local $2))
+ (v128.bitselect (local.get $0) (local.get $1) (local.get $2))
)
- (func (export "i8x16.neg") (param $0 v128) (result v128) (i8x16.neg (get_local $0)))
- (func (export "i8x16.any_true") (param $0 v128) (result i32) (i8x16.any_true (get_local $0)))
- (func (export "i8x16.all_true") (param $0 v128) (result i32) (i8x16.all_true (get_local $0)))
- (func (export "i8x16.shl") (param $0 v128) (param $1 i32) (result v128) (i8x16.shl (get_local $0) (get_local $1)))
- (func (export "i8x16.shr_s") (param $0 v128) (param $1 i32) (result v128) (i8x16.shr_s (get_local $0) (get_local $1)))
- (func (export "i8x16.shr_u") (param $0 v128) (param $1 i32) (result v128) (i8x16.shr_u (get_local $0) (get_local $1)))
- (func (export "i8x16.add") (param $0 v128) (param $1 v128) (result v128) (i8x16.add (get_local $0) (get_local $1)))
- (func (export "i8x16.add_saturate_s") (param $0 v128) (param $1 v128) (result v128) (i8x16.add_saturate_s (get_local $0) (get_local $1)))
- (func (export "i8x16.add_saturate_u") (param $0 v128) (param $1 v128) (result v128) (i8x16.add_saturate_u (get_local $0) (get_local $1)))
- (func (export "i8x16.sub") (param $0 v128) (param $1 v128) (result v128) (i8x16.sub (get_local $0) (get_local $1)))
- (func (export "i8x16.sub_saturate_s") (param $0 v128) (param $1 v128) (result v128) (i8x16.sub_saturate_s (get_local $0) (get_local $1)))
- (func (export "i8x16.sub_saturate_u") (param $0 v128) (param $1 v128) (result v128) (i8x16.sub_saturate_u (get_local $0) (get_local $1)))
- (func (export "i8x16.mul") (param $0 v128) (param $1 v128) (result v128) (i8x16.mul (get_local $0) (get_local $1)))
- (func (export "i16x8.neg") (param $0 v128) (result v128) (i16x8.neg (get_local $0)))
- (func (export "i16x8.any_true") (param $0 v128) (result i32) (i16x8.any_true (get_local $0)))
- (func (export "i16x8.all_true") (param $0 v128) (result i32) (i16x8.all_true (get_local $0)))
- (func (export "i16x8.shl") (param $0 v128) (param $1 i32) (result v128) (i16x8.shl (get_local $0) (get_local $1)))
- (func (export "i16x8.shr_s") (param $0 v128) (param $1 i32) (result v128) (i16x8.shr_s (get_local $0) (get_local $1)))
- (func (export "i16x8.shr_u") (param $0 v128) (param $1 i32) (result v128) (i16x8.shr_u (get_local $0) (get_local $1)))
- (func (export "i16x8.add") (param $0 v128) (param $1 v128) (result v128) (i16x8.add (get_local $0) (get_local $1)))
- (func (export "i16x8.add_saturate_s") (param $0 v128) (param $1 v128) (result v128) (i16x8.add_saturate_s (get_local $0) (get_local $1)))
- (func (export "i16x8.add_saturate_u") (param $0 v128) (param $1 v128) (result v128) (i16x8.add_saturate_u (get_local $0) (get_local $1)))
- (func (export "i16x8.sub") (param $0 v128) (param $1 v128) (result v128) (i16x8.sub (get_local $0) (get_local $1)))
- (func (export "i16x8.sub_saturate_s") (param $0 v128) (param $1 v128) (result v128) (i16x8.sub_saturate_s (get_local $0) (get_local $1)))
- (func (export "i16x8.sub_saturate_u") (param $0 v128) (param $1 v128) (result v128) (i16x8.sub_saturate_u (get_local $0) (get_local $1)))
- (func (export "i16x8.mul") (param $0 v128) (param $1 v128) (result v128) (i16x8.mul (get_local $0) (get_local $1)))
- (func (export "i32x4.neg") (param $0 v128) (result v128) (i32x4.neg (get_local $0)))
- (func (export "i32x4.any_true") (param $0 v128) (result i32) (i32x4.any_true (get_local $0)))
- (func (export "i32x4.all_true") (param $0 v128) (result i32) (i32x4.all_true (get_local $0)))
- (func (export "i32x4.shl") (param $0 v128) (param $1 i32) (result v128) (i32x4.shl (get_local $0) (get_local $1)))
- (func (export "i32x4.shr_s") (param $0 v128) (param $1 i32) (result v128) (i32x4.shr_s (get_local $0) (get_local $1)))
- (func (export "i32x4.shr_u") (param $0 v128) (param $1 i32) (result v128) (i32x4.shr_u (get_local $0) (get_local $1)))
- (func (export "i32x4.add") (param $0 v128) (param $1 v128) (result v128) (i32x4.add (get_local $0) (get_local $1)))
- (func (export "i32x4.sub") (param $0 v128) (param $1 v128) (result v128) (i32x4.sub (get_local $0) (get_local $1)))
- (func (export "i32x4.mul") (param $0 v128) (param $1 v128) (result v128) (i32x4.mul (get_local $0) (get_local $1)))
- (func (export "i64x2.neg") (param $0 v128) (result v128) (i64x2.neg (get_local $0)))
- (func (export "i64x2.any_true") (param $0 v128) (result i32) (i64x2.any_true (get_local $0)))
- (func (export "i64x2.all_true") (param $0 v128) (result i32) (i64x2.all_true (get_local $0)))
- (func (export "i64x2.shl") (param $0 v128) (param $1 i32) (result v128) (i64x2.shl (get_local $0) (get_local $1)))
- (func (export "i64x2.shr_s") (param $0 v128) (param $1 i32) (result v128) (i64x2.shr_s (get_local $0) (get_local $1)))
- (func (export "i64x2.shr_u") (param $0 v128) (param $1 i32) (result v128) (i64x2.shr_u (get_local $0) (get_local $1)))
- (func (export "i64x2.add") (param $0 v128) (param $1 v128) (result v128) (i64x2.add (get_local $0) (get_local $1)))
- (func (export "i64x2.sub") (param $0 v128) (param $1 v128) (result v128) (i64x2.sub (get_local $0) (get_local $1)))
- (func (export "f32x4.abs") (param $0 v128) (result v128) (f32x4.abs (get_local $0)))
- (func (export "f32x4.neg") (param $0 v128) (result v128) (f32x4.neg (get_local $0)))
- (func (export "f32x4.sqrt") (param $0 v128) (result v128) (f32x4.sqrt (get_local $0)))
- (func (export "f32x4.add") (param $0 v128) (param $1 v128) (result v128) (f32x4.add (get_local $0) (get_local $1)))
- (func (export "f32x4.sub") (param $0 v128) (param $1 v128) (result v128) (f32x4.sub (get_local $0) (get_local $1)))
- (func (export "f32x4.mul") (param $0 v128) (param $1 v128) (result v128) (f32x4.mul (get_local $0) (get_local $1)))
- (func (export "f32x4.div") (param $0 v128) (param $1 v128) (result v128) (f32x4.div (get_local $0) (get_local $1)))
- (func (export "f32x4.min") (param $0 v128) (param $1 v128) (result v128) (f32x4.min (get_local $0) (get_local $1)))
- (func (export "f32x4.max") (param $0 v128) (param $1 v128) (result v128) (f32x4.max (get_local $0) (get_local $1)))
- (func (export "f64x2.abs") (param $0 v128) (result v128) (f64x2.abs (get_local $0)))
- (func (export "f64x2.neg") (param $0 v128) (result v128) (f64x2.neg (get_local $0)))
- (func (export "f64x2.sqrt") (param $0 v128) (result v128) (f64x2.sqrt (get_local $0)))
- (func (export "f64x2.add") (param $0 v128) (param $1 v128) (result v128) (f64x2.add (get_local $0) (get_local $1)))
- (func (export "f64x2.sub") (param $0 v128) (param $1 v128) (result v128) (f64x2.sub (get_local $0) (get_local $1)))
- (func (export "f64x2.mul") (param $0 v128) (param $1 v128) (result v128) (f64x2.mul (get_local $0) (get_local $1)))
- (func (export "f64x2.div") (param $0 v128) (param $1 v128) (result v128) (f64x2.div (get_local $0) (get_local $1)))
- (func (export "f64x2.min") (param $0 v128) (param $1 v128) (result v128) (f64x2.min (get_local $0) (get_local $1)))
- (func (export "f64x2.max") (param $0 v128) (param $1 v128) (result v128) (f64x2.max (get_local $0) (get_local $1)))
- (func (export "i32x4.trunc_s/f32x4:sat") (param $0 v128) (result v128) (i32x4.trunc_s/f32x4:sat (get_local $0)))
- (func (export "i32x4.trunc_u/f32x4:sat") (param $0 v128) (result v128) (i32x4.trunc_u/f32x4:sat (get_local $0)))
- (func (export "i64x2.trunc_s/f64x2:sat") (param $0 v128) (result v128) (i64x2.trunc_s/f64x2:sat (get_local $0)))
- (func (export "i64x2.trunc_u/f64x2:sat") (param $0 v128) (result v128) (i64x2.trunc_u/f64x2:sat (get_local $0)))
- (func (export "f32x4.convert_s/i32x4") (param $0 v128) (result v128) (f32x4.convert_s/i32x4 (get_local $0)))
- (func (export "f32x4.convert_u/i32x4") (param $0 v128) (result v128) (f32x4.convert_u/i32x4 (get_local $0)))
- (func (export "f64x2.convert_s/i64x2") (param $0 v128) (result v128) (f64x2.convert_s/i64x2 (get_local $0)))
- (func (export "f64x2.convert_u/i64x2") (param $0 v128) (result v128) (f64x2.convert_u/i64x2 (get_local $0)))
+ (func (export "i8x16.neg") (param $0 v128) (result v128) (i8x16.neg (local.get $0)))
+ (func (export "i8x16.any_true") (param $0 v128) (result i32) (i8x16.any_true (local.get $0)))
+ (func (export "i8x16.all_true") (param $0 v128) (result i32) (i8x16.all_true (local.get $0)))
+ (func (export "i8x16.shl") (param $0 v128) (param $1 i32) (result v128) (i8x16.shl (local.get $0) (local.get $1)))
+ (func (export "i8x16.shr_s") (param $0 v128) (param $1 i32) (result v128) (i8x16.shr_s (local.get $0) (local.get $1)))
+ (func (export "i8x16.shr_u") (param $0 v128) (param $1 i32) (result v128) (i8x16.shr_u (local.get $0) (local.get $1)))
+ (func (export "i8x16.add") (param $0 v128) (param $1 v128) (result v128) (i8x16.add (local.get $0) (local.get $1)))
+ (func (export "i8x16.add_saturate_s") (param $0 v128) (param $1 v128) (result v128) (i8x16.add_saturate_s (local.get $0) (local.get $1)))
+ (func (export "i8x16.add_saturate_u") (param $0 v128) (param $1 v128) (result v128) (i8x16.add_saturate_u (local.get $0) (local.get $1)))
+ (func (export "i8x16.sub") (param $0 v128) (param $1 v128) (result v128) (i8x16.sub (local.get $0) (local.get $1)))
+ (func (export "i8x16.sub_saturate_s") (param $0 v128) (param $1 v128) (result v128) (i8x16.sub_saturate_s (local.get $0) (local.get $1)))
+ (func (export "i8x16.sub_saturate_u") (param $0 v128) (param $1 v128) (result v128) (i8x16.sub_saturate_u (local.get $0) (local.get $1)))
+ (func (export "i8x16.mul") (param $0 v128) (param $1 v128) (result v128) (i8x16.mul (local.get $0) (local.get $1)))
+ (func (export "i16x8.neg") (param $0 v128) (result v128) (i16x8.neg (local.get $0)))
+ (func (export "i16x8.any_true") (param $0 v128) (result i32) (i16x8.any_true (local.get $0)))
+ (func (export "i16x8.all_true") (param $0 v128) (result i32) (i16x8.all_true (local.get $0)))
+ (func (export "i16x8.shl") (param $0 v128) (param $1 i32) (result v128) (i16x8.shl (local.get $0) (local.get $1)))
+ (func (export "i16x8.shr_s") (param $0 v128) (param $1 i32) (result v128) (i16x8.shr_s (local.get $0) (local.get $1)))
+ (func (export "i16x8.shr_u") (param $0 v128) (param $1 i32) (result v128) (i16x8.shr_u (local.get $0) (local.get $1)))
+ (func (export "i16x8.add") (param $0 v128) (param $1 v128) (result v128) (i16x8.add (local.get $0) (local.get $1)))
+ (func (export "i16x8.add_saturate_s") (param $0 v128) (param $1 v128) (result v128) (i16x8.add_saturate_s (local.get $0) (local.get $1)))
+ (func (export "i16x8.add_saturate_u") (param $0 v128) (param $1 v128) (result v128) (i16x8.add_saturate_u (local.get $0) (local.get $1)))
+ (func (export "i16x8.sub") (param $0 v128) (param $1 v128) (result v128) (i16x8.sub (local.get $0) (local.get $1)))
+ (func (export "i16x8.sub_saturate_s") (param $0 v128) (param $1 v128) (result v128) (i16x8.sub_saturate_s (local.get $0) (local.get $1)))
+ (func (export "i16x8.sub_saturate_u") (param $0 v128) (param $1 v128) (result v128) (i16x8.sub_saturate_u (local.get $0) (local.get $1)))
+ (func (export "i16x8.mul") (param $0 v128) (param $1 v128) (result v128) (i16x8.mul (local.get $0) (local.get $1)))
+ (func (export "i32x4.neg") (param $0 v128) (result v128) (i32x4.neg (local.get $0)))
+ (func (export "i32x4.any_true") (param $0 v128) (result i32) (i32x4.any_true (local.get $0)))
+ (func (export "i32x4.all_true") (param $0 v128) (result i32) (i32x4.all_true (local.get $0)))
+ (func (export "i32x4.shl") (param $0 v128) (param $1 i32) (result v128) (i32x4.shl (local.get $0) (local.get $1)))
+ (func (export "i32x4.shr_s") (param $0 v128) (param $1 i32) (result v128) (i32x4.shr_s (local.get $0) (local.get $1)))
+ (func (export "i32x4.shr_u") (param $0 v128) (param $1 i32) (result v128) (i32x4.shr_u (local.get $0) (local.get $1)))
+ (func (export "i32x4.add") (param $0 v128) (param $1 v128) (result v128) (i32x4.add (local.get $0) (local.get $1)))
+ (func (export "i32x4.sub") (param $0 v128) (param $1 v128) (result v128) (i32x4.sub (local.get $0) (local.get $1)))
+ (func (export "i32x4.mul") (param $0 v128) (param $1 v128) (result v128) (i32x4.mul (local.get $0) (local.get $1)))
+ (func (export "i64x2.neg") (param $0 v128) (result v128) (i64x2.neg (local.get $0)))
+ (func (export "i64x2.any_true") (param $0 v128) (result i32) (i64x2.any_true (local.get $0)))
+ (func (export "i64x2.all_true") (param $0 v128) (result i32) (i64x2.all_true (local.get $0)))
+ (func (export "i64x2.shl") (param $0 v128) (param $1 i32) (result v128) (i64x2.shl (local.get $0) (local.get $1)))
+ (func (export "i64x2.shr_s") (param $0 v128) (param $1 i32) (result v128) (i64x2.shr_s (local.get $0) (local.get $1)))
+ (func (export "i64x2.shr_u") (param $0 v128) (param $1 i32) (result v128) (i64x2.shr_u (local.get $0) (local.get $1)))
+ (func (export "i64x2.add") (param $0 v128) (param $1 v128) (result v128) (i64x2.add (local.get $0) (local.get $1)))
+ (func (export "i64x2.sub") (param $0 v128) (param $1 v128) (result v128) (i64x2.sub (local.get $0) (local.get $1)))
+ (func (export "f32x4.abs") (param $0 v128) (result v128) (f32x4.abs (local.get $0)))
+ (func (export "f32x4.neg") (param $0 v128) (result v128) (f32x4.neg (local.get $0)))
+ (func (export "f32x4.sqrt") (param $0 v128) (result v128) (f32x4.sqrt (local.get $0)))
+ (func (export "f32x4.add") (param $0 v128) (param $1 v128) (result v128) (f32x4.add (local.get $0) (local.get $1)))
+ (func (export "f32x4.sub") (param $0 v128) (param $1 v128) (result v128) (f32x4.sub (local.get $0) (local.get $1)))
+ (func (export "f32x4.mul") (param $0 v128) (param $1 v128) (result v128) (f32x4.mul (local.get $0) (local.get $1)))
+ (func (export "f32x4.div") (param $0 v128) (param $1 v128) (result v128) (f32x4.div (local.get $0) (local.get $1)))
+ (func (export "f32x4.min") (param $0 v128) (param $1 v128) (result v128) (f32x4.min (local.get $0) (local.get $1)))
+ (func (export "f32x4.max") (param $0 v128) (param $1 v128) (result v128) (f32x4.max (local.get $0) (local.get $1)))
+ (func (export "f64x2.abs") (param $0 v128) (result v128) (f64x2.abs (local.get $0)))
+ (func (export "f64x2.neg") (param $0 v128) (result v128) (f64x2.neg (local.get $0)))
+ (func (export "f64x2.sqrt") (param $0 v128) (result v128) (f64x2.sqrt (local.get $0)))
+ (func (export "f64x2.add") (param $0 v128) (param $1 v128) (result v128) (f64x2.add (local.get $0) (local.get $1)))
+ (func (export "f64x2.sub") (param $0 v128) (param $1 v128) (result v128) (f64x2.sub (local.get $0) (local.get $1)))
+ (func (export "f64x2.mul") (param $0 v128) (param $1 v128) (result v128) (f64x2.mul (local.get $0) (local.get $1)))
+ (func (export "f64x2.div") (param $0 v128) (param $1 v128) (result v128) (f64x2.div (local.get $0) (local.get $1)))
+ (func (export "f64x2.min") (param $0 v128) (param $1 v128) (result v128) (f64x2.min (local.get $0) (local.get $1)))
+ (func (export "f64x2.max") (param $0 v128) (param $1 v128) (result v128) (f64x2.max (local.get $0) (local.get $1)))
+ (func (export "i32x4.trunc_sat_f32x4_s") (param $0 v128) (result v128) (i32x4.trunc_sat_f32x4_s (local.get $0)))
+ (func (export "i32x4.trunc_sat_f32x4_u") (param $0 v128) (result v128) (i32x4.trunc_sat_f32x4_u (local.get $0)))
+ (func (export "i64x2.trunc_sat_f64x2_s") (param $0 v128) (result v128) (i64x2.trunc_sat_f64x2_s (local.get $0)))
+ (func (export "i64x2.trunc_sat_f64x2_u") (param $0 v128) (result v128) (i64x2.trunc_sat_f64x2_u (local.get $0)))
+ (func (export "f32x4.convert_i32x4_s") (param $0 v128) (result v128) (f32x4.convert_i32x4_s (local.get $0)))
+ (func (export "f32x4.convert_i32x4_u") (param $0 v128) (result v128) (f32x4.convert_i32x4_u (local.get $0)))
+ (func (export "f64x2.convert_i64x2_s") (param $0 v128) (result v128) (f64x2.convert_i64x2_s (local.get $0)))
+ (func (export "f64x2.convert_i64x2_u") (param $0 v128) (result v128) (f64x2.convert_i64x2_u (local.get $0)))
)
;; Basic v128 manipulation
@@ -647,15 +647,15 @@
(assert_return (invoke "f64x2.max" (v128.const f64 nan 5) (v128.const f64 5 nan)) (v128.const f64 nan nan))
;; conversions
-(assert_return (invoke "i32x4.trunc_s/f32x4:sat" (v128.const f32 42 nan infinity -infinity)) (v128.const i32 42 0 2147483647 -2147483648))
-(assert_return (invoke "i32x4.trunc_u/f32x4:sat" (v128.const f32 42 nan infinity -infinity)) (v128.const i32 42 0 4294967295 0))
-(assert_return (invoke "i64x2.trunc_s/f64x2:sat" (v128.const f64 42 nan)) (v128.const i64 42 0))
-(assert_return (invoke "i64x2.trunc_s/f64x2:sat" (v128.const f64 infinity -infinity)) (v128.const i64 9223372036854775807 -9223372036854775808))
-(assert_return (invoke "i64x2.trunc_u/f64x2:sat" (v128.const f64 42 nan)) (v128.const i64 42 0))
-(assert_return (invoke "i64x2.trunc_u/f64x2:sat" (v128.const f64 infinity -infinity)) (v128.const i64 18446744073709551615 0))
-(assert_return (invoke "f32x4.convert_s/i32x4" (v128.const i32 0 -1 2147483647 -2147483648)) (v128.const f32 0 -1 2147483648 -2147483648))
-(assert_return (invoke "f32x4.convert_u/i32x4" (v128.const i32 0 -1 2147483647 -2147483648)) (v128.const f32 0 4294967296 2147483648 2147483648))
-(assert_return (invoke "f64x2.convert_s/i64x2" (v128.const i64 0 -1)) (v128.const f64 0 -1))
-(assert_return (invoke "f64x2.convert_s/i64x2" (v128.const i64 9223372036854775807 -9223372036854775808)) (v128.const f64 9223372036854775807 -9223372036854775808))
-(assert_return (invoke "f64x2.convert_u/i64x2" (v128.const i64 0 -1)) (v128.const f64 0 18446744073709551616))
-(assert_return (invoke "f64x2.convert_u/i64x2" (v128.const i64 9223372036854775807 -9223372036854775808)) (v128.const f64 9223372036854775807 9223372036854775808))
+(assert_return (invoke "i32x4.trunc_sat_f32x4_s" (v128.const f32 42 nan infinity -infinity)) (v128.const i32 42 0 2147483647 -2147483648))
+(assert_return (invoke "i32x4.trunc_sat_f32x4_u" (v128.const f32 42 nan infinity -infinity)) (v128.const i32 42 0 4294967295 0))
+(assert_return (invoke "i64x2.trunc_sat_f64x2_s" (v128.const f64 42 nan)) (v128.const i64 42 0))
+(assert_return (invoke "i64x2.trunc_sat_f64x2_s" (v128.const f64 infinity -infinity)) (v128.const i64 9223372036854775807 -9223372036854775808))
+(assert_return (invoke "i64x2.trunc_sat_f64x2_u" (v128.const f64 42 nan)) (v128.const i64 42 0))
+(assert_return (invoke "i64x2.trunc_sat_f64x2_u" (v128.const f64 infinity -infinity)) (v128.const i64 18446744073709551615 0))
+(assert_return (invoke "f32x4.convert_i32x4_s" (v128.const i32 0 -1 2147483647 -2147483648)) (v128.const f32 0 -1 2147483648 -2147483648))
+(assert_return (invoke "f32x4.convert_i32x4_u" (v128.const i32 0 -1 2147483647 -2147483648)) (v128.const f32 0 4294967296 2147483648 2147483648))
+(assert_return (invoke "f64x2.convert_i64x2_s" (v128.const i64 0 -1)) (v128.const f64 0 -1))
+(assert_return (invoke "f64x2.convert_i64x2_s" (v128.const i64 9223372036854775807 -9223372036854775808)) (v128.const f64 9223372036854775807 -9223372036854775808))
+(assert_return (invoke "f64x2.convert_i64x2_u" (v128.const i64 0 -1)) (v128.const f64 0 18446744073709551616))
+(assert_return (invoke "f64x2.convert_i64x2_u" (v128.const i64 9223372036854775807 -9223372036854775808)) (v128.const f64 9223372036854775807 9223372036854775808))
diff --git a/test/spec/stack.wast b/test/spec/stack.wast
index a0559f561..b3933b394 100644
--- a/test/spec/stack.wast
+++ b/test/spec/stack.wast
@@ -2,128 +2,128 @@
(func (export "fac-expr") (param $n i64) (result i64)
(local $i i64)
(local $res i64)
- (set_local $i (get_local $n))
- (set_local $res (i64.const 1))
+ (local.set $i (local.get $n))
+ (local.set $res (i64.const 1))
(block $done
(loop $loop
(if
- (i64.eq (get_local $i) (i64.const 0))
+ (i64.eq (local.get $i) (i64.const 0))
(br $done)
(block
- (set_local $res (i64.mul (get_local $i) (get_local $res)))
- (set_local $i (i64.sub (get_local $i) (i64.const 1)))
+ (local.set $res (i64.mul (local.get $i) (local.get $res)))
+ (local.set $i (i64.sub (local.get $i) (i64.const 1)))
)
)
(br $loop)
)
)
- (get_local $res)
+ (local.get $res)
)
(func (export "fac-stack") (param $n i64) (result i64)
(local $i i64)
(local $res i64)
- (get_local $n)
- (set_local $i)
+ (local.get $n)
+ (local.set $i)
(i64.const 1)
- (set_local $res)
+ (local.set $res)
(block $done
(loop $loop
- (get_local $i)
+ (local.get $i)
(i64.const 0)
(i64.eq)
(if
(then (br $done))
(else
- (get_local $i)
- (get_local $res)
+ (local.get $i)
+ (local.get $res)
(i64.mul)
- (set_local $res)
- (get_local $i)
+ (local.set $res)
+ (local.get $i)
(i64.const 1)
(i64.sub)
- (set_local $i)
+ (local.set $i)
)
)
(br $loop)
)
)
- (get_local $res)
+ (local.get $res)
)
(func (export "fac-stack-raw") (param $n i64) (result i64)
(local $i i64)
(local $res i64)
- get_local $n
- set_local $i
+ local.get $n
+ local.set $i
i64.const 1
- set_local $res
+ local.set $res
block $done
loop $loop
- get_local $i
+ local.get $i
i64.const 0
i64.eq
if
br $done
else
- get_local $i
- get_local $res
+ local.get $i
+ local.get $res
i64.mul
- set_local $res
- get_local $i
+ local.set $res
+ local.get $i
i64.const 1
i64.sub
- set_local $i
+ local.set $i
end
br $loop
end
end
- get_local $res
+ local.get $res
)
(func (export "fac-mixed") (param $n i64) (result i64)
(local $i i64)
(local $res i64)
- (set_local $i (get_local $n))
- (set_local $res (i64.const 1))
+ (local.set $i (local.get $n))
+ (local.set $res (i64.const 1))
(block $done
(loop $loop
- (i64.eq (get_local $i) (i64.const 0))
+ (i64.eq (local.get $i) (i64.const 0))
(if
(then (br $done))
(else
- (i64.mul (get_local $i) (get_local $res))
- (set_local $res)
- (i64.sub (get_local $i) (i64.const 1))
- (set_local $i)
+ (i64.mul (local.get $i) (local.get $res))
+ (local.set $res)
+ (i64.sub (local.get $i) (i64.const 1))
+ (local.set $i)
)
)
(br $loop)
)
)
- (get_local $res)
+ (local.get $res)
)
(func (export "fac-mixed-raw") (param $n i64) (result i64)
(local $i i64)
(local $res i64)
- (set_local $i (get_local $n))
- (set_local $res (i64.const 1))
+ (local.set $i (local.get $n))
+ (local.set $res (i64.const 1))
block $done
loop $loop
- (i64.eq (get_local $i) (i64.const 0))
+ (i64.eq (local.get $i) (i64.const 0))
if
br $done
else
- (i64.mul (get_local $i) (get_local $res))
- set_local $res
- (i64.sub (get_local $i) (i64.const 1))
- set_local $i
+ (i64.mul (local.get $i) (local.get $res))
+ local.set $res
+ (i64.sub (local.get $i) (i64.const 1))
+ local.set $i
end
br $loop
end
end
- get_local $res
+ local.get $res
)
)
diff --git a/test/spec/store_retval.wast b/test/spec/store_retval.wast
index a4d03582f..a2d9183a9 100644
--- a/test/spec/store_retval.wast
+++ b/test/spec/store_retval.wast
@@ -1,17 +1,17 @@
(assert_invalid
- (module (func (param i32) (result i32) (set_local 0 (i32.const 1))))
+ (module (func (param i32) (result i32) (local.set 0 (i32.const 1))))
"type mismatch"
)
(assert_invalid
- (module (func (param i64) (result i64) (set_local 0 (i64.const 1))))
+ (module (func (param i64) (result i64) (local.set 0 (i64.const 1))))
"type mismatch"
)
(assert_invalid
- (module (func (param f32) (result f32) (set_local 0 (f32.const 1))))
+ (module (func (param f32) (result f32) (local.set 0 (f32.const 1))))
"type mismatch"
)
(assert_invalid
- (module (func (param f64) (result f64) (set_local 0 (f64.const 1))))
+ (module (func (param f64) (result f64) (local.set 0 (f64.const 1))))
"type mismatch"
)
diff --git a/test/spec/switch.wast b/test/spec/switch.wast
index 2d4565a5d..2e8a503a4 100644
--- a/test/spec/switch.wast
+++ b/test/spec/switch.wast
@@ -2,7 +2,7 @@
;; Statement switch
(func (export "stmt") (param $i i32) (result i32)
(local $j i32)
- (set_local $j (i32.const 100))
+ (local.set $j (i32.const 100))
(block $switch
(block $7
(block $default
@@ -14,38 +14,38 @@
(block $1
(block $0
(br_table $0 $1 $2 $3 $4 $5 $6 $7 $default
- (get_local $i)
+ (local.get $i)
)
) ;; 0
- (return (get_local $i))
+ (return (local.get $i))
) ;; 1
(nop)
;; fallthrough
) ;; 2
;; fallthrough
) ;; 3
- (set_local $j (i32.sub (i32.const 0) (get_local $i)))
+ (local.set $j (i32.sub (i32.const 0) (local.get $i)))
(br $switch)
) ;; 4
(br $switch)
) ;; 5
- (set_local $j (i32.const 101))
+ (local.set $j (i32.const 101))
(br $switch)
) ;; 6
- (set_local $j (i32.const 101))
+ (local.set $j (i32.const 101))
;; fallthrough
) ;; default
- (set_local $j (i32.const 102))
+ (local.set $j (i32.const 102))
) ;; 7
;; fallthrough
)
- (return (get_local $j))
+ (return (local.get $j))
)
;; Expression switch
(func (export "expr") (param $i i64) (result i64)
(local $j i64)
- (set_local $j (i64.const 100))
+ (local.set $j (i64.const 100))
(return
(block $switch i64
(block $7
@@ -58,26 +58,26 @@
(block $1
(block $0
(br_table $0 $1 $2 $3 $4 $5 $6 $7 $default
- (i32.wrap/i64 (get_local $i))
+ (i32.wrap_i64 (local.get $i))
)
) ;; 0
- (return (get_local $i))
+ (return (local.get $i))
) ;; 1
(nop)
;; fallthrough
) ;; 2
;; fallthrough
) ;; 3
- (br $switch (i64.sub (i64.const 0) (get_local $i)))
+ (br $switch (i64.sub (i64.const 0) (local.get $i)))
) ;; 6
- (set_local $j (i64.const 101))
+ (local.set $j (i64.const 101))
;; fallthrough
) ;; 4
;; fallthrough
) ;; 5
;; fallthrough
) ;; default
- (br $switch (get_local $j))
+ (br $switch (local.get $j))
) ;; 7
(i64.const -5)
)
@@ -95,8 +95,8 @@
(i32.add (i32.const 1000)
(block $default i32
(br_table $0 $1 $2 $default
- (i32.mul (i32.const 2) (get_local $i))
- (i32.and (i32.const 3) (get_local $i))
+ (i32.mul (i32.const 2) (local.get $i))
+ (i32.and (i32.const 3) (local.get $i))
)
)
)
diff --git a/test/spec/tee_local.wast b/test/spec/tee_local.wast
index 452793e30..89a90e9c2 100644
--- a/test/spec/tee_local.wast
+++ b/test/spec/tee_local.wast
@@ -1,57 +1,57 @@
-;; Test `tee_local` operator
+;; Test `local.tee` operator
(module
;; Typing
- (func (export "type-local-i32") (result i32) (local i32) (tee_local 0 (i32.const 0)))
- (func (export "type-local-i64") (result i64) (local i64) (tee_local 0 (i64.const 0)))
- (func (export "type-local-f32") (result f32) (local f32) (tee_local 0 (f32.const 0)))
- (func (export "type-local-f64") (result f64) (local f64) (tee_local 0 (f64.const 0)))
+ (func (export "type-local-i32") (result i32) (local i32) (local.tee 0 (i32.const 0)))
+ (func (export "type-local-i64") (result i64) (local i64) (local.tee 0 (i64.const 0)))
+ (func (export "type-local-f32") (result f32) (local f32) (local.tee 0 (f32.const 0)))
+ (func (export "type-local-f64") (result f64) (local f64) (local.tee 0 (f64.const 0)))
- (func (export "type-param-i32") (param i32) (result i32) (tee_local 0 (i32.const 10)))
- (func (export "type-param-i64") (param i64) (result i64) (tee_local 0 (i64.const 11)))
- (func (export "type-param-f32") (param f32) (result f32) (tee_local 0 (f32.const 11.1)))
- (func (export "type-param-f64") (param f64) (result f64) (tee_local 0 (f64.const 12.2)))
+ (func (export "type-param-i32") (param i32) (result i32) (local.tee 0 (i32.const 10)))
+ (func (export "type-param-i64") (param i64) (result i64) (local.tee 0 (i64.const 11)))
+ (func (export "type-param-f32") (param f32) (result f32) (local.tee 0 (f32.const 11.1)))
+ (func (export "type-param-f64") (param f64) (result f64) (local.tee 0 (f64.const 12.2)))
(func (export "type-mixed") (param i64 f32 f64 i32 i32) (local f32 i64 i64 f64)
- (drop (i64.eqz (tee_local 0 (i64.const 0))))
- (drop (f32.neg (tee_local 1 (f32.const 0))))
- (drop (f64.neg (tee_local 2 (f64.const 0))))
- (drop (i32.eqz (tee_local 3 (i32.const 0))))
- (drop (i32.eqz (tee_local 4 (i32.const 0))))
- (drop (f32.neg (tee_local 5 (f32.const 0))))
- (drop (i64.eqz (tee_local 6 (i64.const 0))))
- (drop (i64.eqz (tee_local 7 (i64.const 0))))
- (drop (f64.neg (tee_local 8 (f64.const 0))))
+ (drop (i64.eqz (local.tee 0 (i64.const 0))))
+ (drop (f32.neg (local.tee 1 (f32.const 0))))
+ (drop (f64.neg (local.tee 2 (f64.const 0))))
+ (drop (i32.eqz (local.tee 3 (i32.const 0))))
+ (drop (i32.eqz (local.tee 4 (i32.const 0))))
+ (drop (f32.neg (local.tee 5 (f32.const 0))))
+ (drop (i64.eqz (local.tee 6 (i64.const 0))))
+ (drop (i64.eqz (local.tee 7 (i64.const 0))))
+ (drop (f64.neg (local.tee 8 (f64.const 0))))
)
;; Writing
(func (export "write") (param i64 f32 f64 i32 i32) (result i64) (local f32 i64 i64 f64)
- (drop (tee_local 1 (f32.const -0.3)))
- (drop (tee_local 3 (i32.const 40)))
- (drop (tee_local 4 (i32.const -7)))
- (drop (tee_local 5 (f32.const 5.5)))
- (drop (tee_local 6 (i64.const 6)))
- (drop (tee_local 8 (f64.const 8)))
- (i64.trunc_s/f64
+ (drop (local.tee 1 (f32.const -0.3)))
+ (drop (local.tee 3 (i32.const 40)))
+ (drop (local.tee 4 (i32.const -7)))
+ (drop (local.tee 5 (f32.const 5.5)))
+ (drop (local.tee 6 (i64.const 6)))
+ (drop (local.tee 8 (f64.const 8)))
+ (i64.trunc_f64_s
(f64.add
- (f64.convert_u/i64 (get_local 0))
+ (f64.convert_i64_u (local.get 0))
(f64.add
- (f64.promote/f32 (get_local 1))
+ (f64.promote_f32 (local.get 1))
(f64.add
- (get_local 2)
+ (local.get 2)
(f64.add
- (f64.convert_u/i32 (get_local 3))
+ (f64.convert_i32_u (local.get 3))
(f64.add
- (f64.convert_s/i32 (get_local 4))
+ (f64.convert_i32_s (local.get 4))
(f64.add
- (f64.promote/f32 (get_local 5))
+ (f64.promote_f32 (local.get 5))
(f64.add
- (f64.convert_u/i64 (get_local 6))
+ (f64.convert_i64_u (local.get 6))
(f64.add
- (f64.convert_u/i64 (get_local 7))
- (get_local 8)
+ (f64.convert_i64_u (local.get 7))
+ (local.get 8)
)
)
)
@@ -68,22 +68,22 @@
(func (export "result") (param i64 f32 f64 i32 i32) (result f64)
(local f32 i64 i64 f64)
(f64.add
- (f64.convert_u/i64 (tee_local 0 (i64.const 1)))
+ (f64.convert_i64_u (local.tee 0 (i64.const 1)))
(f64.add
- (f64.promote/f32 (tee_local 1 (f32.const 2)))
+ (f64.promote_f32 (local.tee 1 (f32.const 2)))
(f64.add
- (tee_local 2 (f64.const 3.3))
+ (local.tee 2 (f64.const 3.3))
(f64.add
- (f64.convert_u/i32 (tee_local 3 (i32.const 4)))
+ (f64.convert_i32_u (local.tee 3 (i32.const 4)))
(f64.add
- (f64.convert_s/i32 (tee_local 4 (i32.const 5)))
+ (f64.convert_i32_s (local.tee 4 (i32.const 5)))
(f64.add
- (f64.promote/f32 (tee_local 5 (f32.const 5.5)))
+ (f64.promote_f32 (local.tee 5 (f32.const 5.5)))
(f64.add
- (f64.convert_u/i64 (tee_local 6 (i64.const 6)))
+ (f64.convert_i64_u (local.tee 6 (i64.const 6)))
(f64.add
- (f64.convert_u/i64 (tee_local 7 (i64.const 0)))
- (tee_local 8 (f64.const 8))
+ (f64.convert_i64_u (local.tee 7 (i64.const 0)))
+ (local.tee 8 (f64.const 8))
)
)
)
@@ -129,32 +129,32 @@
;; Invalid typing of access to locals
(assert_invalid
- (module (func $type-local-num-vs-num (result i64) (local i32) (tee_local 0 (i32.const 0))))
+ (module (func $type-local-num-vs-num (result i64) (local i32) (local.tee 0 (i32.const 0))))
"type mismatch"
)
(assert_invalid
- (module (func $type-local-num-vs-num (local f32) (i32.eqz (tee_local 0 (f32.const 0)))))
+ (module (func $type-local-num-vs-num (local f32) (i32.eqz (local.tee 0 (f32.const 0)))))
"type mismatch"
)
(assert_invalid
- (module (func $type-local-num-vs-num (local f64 i64) (f64.neg (tee_local 1 (i64.const 0)))))
+ (module (func $type-local-num-vs-num (local f64 i64) (f64.neg (local.tee 1 (i64.const 0)))))
"type mismatch"
)
(assert_invalid
- (module (func $type-local-arg-void-vs-num (local i32) (tee_local 0 (nop))))
+ (module (func $type-local-arg-void-vs-num (local i32) (local.tee 0 (nop))))
"type mismatch"
)
(assert_invalid
- (module (func $type-local-arg-num-vs-num (local i32) (tee_local 0 (f32.const 0))))
+ (module (func $type-local-arg-num-vs-num (local i32) (local.tee 0 (f32.const 0))))
"type mismatch"
)
(assert_invalid
- (module (func $type-local-arg-num-vs-num (local f32) (tee_local 0 (f64.const 0))))
+ (module (func $type-local-arg-num-vs-num (local f32) (local.tee 0 (f64.const 0))))
"type mismatch"
)
(assert_invalid
- (module (func $type-local-arg-num-vs-num (local f64 i64) (tee_local 1 (f64.const 0))))
+ (module (func $type-local-arg-num-vs-num (local f64 i64) (local.tee 1 (f64.const 0))))
"type mismatch"
)
@@ -162,32 +162,32 @@
;; Invalid typing of access to parameters
(assert_invalid
- (module (func $type-param-num-vs-num (param i32) (result i64) (get_local 0)))
+ (module (func $type-param-num-vs-num (param i32) (result i64) (local.get 0)))
"type mismatch"
)
(assert_invalid
- (module (func $type-param-num-vs-num (param f32) (i32.eqz (get_local 0))))
+ (module (func $type-param-num-vs-num (param f32) (i32.eqz (local.get 0))))
"type mismatch"
)
(assert_invalid
- (module (func $type-param-num-vs-num (param f64 i64) (f64.neg (get_local 1))))
+ (module (func $type-param-num-vs-num (param f64 i64) (f64.neg (local.get 1))))
"type mismatch"
)
(assert_invalid
- (module (func $type-param-arg-void-vs-num (param i32) (tee_local 0 (nop))))
+ (module (func $type-param-arg-void-vs-num (param i32) (local.tee 0 (nop))))
"type mismatch"
)
(assert_invalid
- (module (func $type-param-arg-num-vs-num (param i32) (tee_local 0 (f32.const 0))))
+ (module (func $type-param-arg-num-vs-num (param i32) (local.tee 0 (f32.const 0))))
"type mismatch"
)
(assert_invalid
- (module (func $type-param-arg-num-vs-num (param f32) (tee_local 0 (f64.const 0))))
+ (module (func $type-param-arg-num-vs-num (param f32) (local.tee 0 (f64.const 0))))
"type mismatch"
)
(assert_invalid
- (module (func $type-param-arg-num-vs-num (param f64 i64) (tee_local 1 (f64.const 0))))
+ (module (func $type-param-arg-num-vs-num (param f64 i64) (local.tee 1 (f64.const 0))))
"type mismatch"
)
@@ -195,42 +195,42 @@
;; Invalid local index
(assert_invalid
- (module (func $unbound-local (local i32 i64) (get_local 3)))
+ (module (func $unbound-local (local i32 i64) (local.get 3)))
"unknown local"
)
(assert_invalid
- (module (func $large-local (local i32 i64) (get_local 14324343)))
+ (module (func $large-local (local i32 i64) (local.get 14324343)))
"unknown local"
)
(assert_invalid
- (module (func $unbound-param (param i32 i64) (get_local 2)))
+ (module (func $unbound-param (param i32 i64) (local.get 2)))
"unknown local"
)
(assert_invalid
- (module (func $large-param (local i32 i64) (get_local 714324343)))
+ (module (func $large-param (local i32 i64) (local.get 714324343)))
"unknown local"
)
(assert_invalid
- (module (func $unbound-mixed (param i32) (local i32 i64) (get_local 3)))
+ (module (func $unbound-mixed (param i32) (local i32 i64) (local.get 3)))
"unknown local"
)
(assert_invalid
- (module (func $large-mixed (param i64) (local i32 i64) (get_local 214324343)))
+ (module (func $large-mixed (param i64) (local i32 i64) (local.get 214324343)))
"unknown local"
)
(assert_invalid
- (module (func $type-mixed-arg-num-vs-num (param f32) (local i32) (tee_local 1 (f32.const 0))))
+ (module (func $type-mixed-arg-num-vs-num (param f32) (local i32) (local.tee 1 (f32.const 0))))
"type mismatch"
)
(assert_invalid
- (module (func $type-mixed-arg-num-vs-num (param i64 i32) (local f32) (tee_local 1 (f32.const 0))))
+ (module (func $type-mixed-arg-num-vs-num (param i64 i32) (local f32) (local.tee 1 (f32.const 0))))
"type mismatch"
)
(assert_invalid
- (module (func $type-mixed-arg-num-vs-num (param i64) (local f64 i64) (tee_local 1 (i64.const 0))))
+ (module (func $type-mixed-arg-num-vs-num (param i64) (local f64 i64) (local.tee 1 (i64.const 0))))
"type mismatch"
)
diff --git a/test/spec/traps.wast b/test/spec/traps.wast
index a9184b654..3959aa947 100644
--- a/test/spec/traps.wast
+++ b/test/spec/traps.wast
@@ -4,13 +4,13 @@
(module
(func (export "no_dce.i32.div_s") (param $x i32) (param $y i32) (result i32)
- (i32.div_s (get_local $x) (get_local $y)))
+ (i32.div_s (local.get $x) (local.get $y)))
(func (export "no_dce.i32.div_u") (param $x i32) (param $y i32) (result i32)
- (i32.div_u (get_local $x) (get_local $y)))
+ (i32.div_u (local.get $x) (local.get $y)))
(func (export "no_dce.i64.div_s") (param $x i64) (param $y i64) (result i64)
- (i64.div_s (get_local $x) (get_local $y)))
+ (i64.div_s (local.get $x) (local.get $y)))
(func (export "no_dce.i64.div_u") (param $x i64) (param $y i64) (result i64)
- (i64.div_u (get_local $x) (get_local $y)))
+ (i64.div_u (local.get $x) (local.get $y)))
)
(assert_trap (invoke "no_dce.i32.div_s" (i32.const 1) (i32.const 0)) "integer divide by zero")
@@ -20,13 +20,13 @@
(module
(func (export "no_dce.i32.rem_s") (param $x i32) (param $y i32) (result i32)
- (i32.rem_s (get_local $x) (get_local $y)))
+ (i32.rem_s (local.get $x) (local.get $y)))
(func (export "no_dce.i32.rem_u") (param $x i32) (param $y i32) (result i32)
- (i32.rem_u (get_local $x) (get_local $y)))
+ (i32.rem_u (local.get $x) (local.get $y)))
(func (export "no_dce.i64.rem_s") (param $x i64) (param $y i64) (result i64)
- (i64.rem_s (get_local $x) (get_local $y)))
+ (i64.rem_s (local.get $x) (local.get $y)))
(func (export "no_dce.i64.rem_u") (param $x i64) (param $y i64) (result i64)
- (i64.rem_u (get_local $x) (get_local $y)))
+ (i64.rem_u (local.get $x) (local.get $y)))
)
(assert_trap (invoke "no_dce.i32.rem_s" (i32.const 1) (i32.const 0)) "integer divide by zero")
@@ -35,14 +35,14 @@
(assert_trap (invoke "no_dce.i64.rem_u" (i64.const 1) (i64.const 0)) "integer divide by zero")
(module
- (func (export "no_dce.i32.trunc_s_f32") (param $x f32) (result i32) (i32.trunc_s/f32 (get_local $x)))
- (func (export "no_dce.i32.trunc_u_f32") (param $x f32) (result i32) (i32.trunc_u/f32 (get_local $x)))
- (func (export "no_dce.i32.trunc_s_f64") (param $x f64) (result i32) (i32.trunc_s/f64 (get_local $x)))
- (func (export "no_dce.i32.trunc_u_f64") (param $x f64) (result i32) (i32.trunc_u/f64 (get_local $x)))
- (func (export "no_dce.i64.trunc_s_f32") (param $x f32) (result i64) (i64.trunc_s/f32 (get_local $x)))
- (func (export "no_dce.i64.trunc_u_f32") (param $x f32) (result i64) (i64.trunc_u/f32 (get_local $x)))
- (func (export "no_dce.i64.trunc_s_f64") (param $x f64) (result i64) (i64.trunc_s/f64 (get_local $x)))
- (func (export "no_dce.i64.trunc_u_f64") (param $x f64) (result i64) (i64.trunc_u/f64 (get_local $x)))
+ (func (export "no_dce.i32.trunc_s_f32") (param $x f32) (result i32) (i32.trunc_f32_s (local.get $x)))
+ (func (export "no_dce.i32.trunc_u_f32") (param $x f32) (result i32) (i32.trunc_f32_u (local.get $x)))
+ (func (export "no_dce.i32.trunc_s_f64") (param $x f64) (result i32) (i32.trunc_f64_s (local.get $x)))
+ (func (export "no_dce.i32.trunc_u_f64") (param $x f64) (result i32) (i32.trunc_f64_u (local.get $x)))
+ (func (export "no_dce.i64.trunc_s_f32") (param $x f32) (result i64) (i64.trunc_f32_s (local.get $x)))
+ (func (export "no_dce.i64.trunc_u_f32") (param $x f32) (result i64) (i64.trunc_f32_u (local.get $x)))
+ (func (export "no_dce.i64.trunc_s_f64") (param $x f64) (result i64) (i64.trunc_f64_s (local.get $x)))
+ (func (export "no_dce.i64.trunc_u_f64") (param $x f64) (result i64) (i64.trunc_f64_u (local.get $x)))
)
(assert_trap (invoke "no_dce.i32.trunc_s_f32" (f32.const nan)) "invalid conversion to integer")
@@ -57,10 +57,10 @@
(module
(memory 1)
- (func (export "no_dce.i32.load") (param $i i32) (result i32) (i32.load (get_local $i)))
- (func (export "no_dce.i64.load") (param $i i32) (result i64) (i64.load (get_local $i)))
- (func (export "no_dce.f32.load") (param $i i32) (result f32) (f32.load (get_local $i)))
- (func (export "no_dce.f64.load") (param $i i32) (result f64) (f64.load (get_local $i)))
+ (func (export "no_dce.i32.load") (param $i i32) (result i32) (i32.load (local.get $i)))
+ (func (export "no_dce.i64.load") (param $i i32) (result i64) (i64.load (local.get $i)))
+ (func (export "no_dce.f32.load") (param $i i32) (result f32) (f32.load (local.get $i)))
+ (func (export "no_dce.f64.load") (param $i i32) (result f64) (f64.load (local.get $i)))
)
(assert_trap (invoke "no_dce.i32.load" (i32.const 65536)) "out of bounds memory access")
diff --git a/test/spec/typecheck.wast b/test/spec/typecheck.wast
index d33cc5be3..773d00ffd 100644
--- a/test/spec/typecheck.wast
+++ b/test/spec/typecheck.wast
@@ -240,7 +240,7 @@
(module
(type (func (param i32)))
(func (type 0))
- (table 0 anyfunc)
+ (table 0 funcref)
(func
(call_indirect (type 0) (i32.const 0) (f32.const 0))))
"type mismatch")
@@ -250,15 +250,15 @@
(module
(type (func))
(func (type 0))
- (table 0 anyfunc)
+ (table 0 funcref)
(func (call_indirect (type 0) (f32.const 0))))
"type mismatch")
;; return
(assert_invalid (module (func (result i32) (return (f32.const 0)))) "type mismatch")
-;; set_local
-(assert_invalid (module (func (local i32) (set_local 0 (f32.const 0)))) "type mismatch")
+;; local.set
+(assert_invalid (module (func (local i32) (local.set 0 (f32.const 0)))) "type mismatch")
;; load index
(assert_invalid (module (memory 1) (func (i32.load (f32.const 0)))) "type mismatch")
@@ -403,31 +403,31 @@
(assert_invalid (module (func (f64.ne (i64.const 0) (f32.const 0)))) "type mismatch")
;; convert
-(assert_invalid (module (func (i32.wrap/i64 (f32.const 0)))) "type mismatch")
-(assert_invalid (module (func (i32.trunc_s/f32 (i64.const 0)))) "type mismatch")
-(assert_invalid (module (func (i32.trunc_u/f32 (i64.const 0)))) "type mismatch")
-(assert_invalid (module (func (i32.trunc_s/f64 (i64.const 0)))) "type mismatch")
-(assert_invalid (module (func (i32.trunc_u/f64 (i64.const 0)))) "type mismatch")
-(assert_invalid (module (func (i32.reinterpret/f32 (i64.const 0)))) "type mismatch")
-(assert_invalid (module (func (i64.extend_s/i32 (f32.const 0)))) "type mismatch")
-(assert_invalid (module (func (i64.extend_u/i32 (f32.const 0)))) "type mismatch")
-(assert_invalid (module (func (i64.trunc_s/f32 (i32.const 0)))) "type mismatch")
-(assert_invalid (module (func (i64.trunc_u/f32 (i32.const 0)))) "type mismatch")
-(assert_invalid (module (func (i64.trunc_s/f64 (i32.const 0)))) "type mismatch")
-(assert_invalid (module (func (i64.trunc_u/f64 (i32.const 0)))) "type mismatch")
-(assert_invalid (module (func (i64.reinterpret/f64 (i32.const 0)))) "type mismatch")
-(assert_invalid (module (func (f32.convert_s/i32 (i64.const 0)))) "type mismatch")
-(assert_invalid (module (func (f32.convert_u/i32 (i64.const 0)))) "type mismatch")
-(assert_invalid (module (func (f32.convert_s/i64 (i32.const 0)))) "type mismatch")
-(assert_invalid (module (func (f32.convert_u/i64 (i32.const 0)))) "type mismatch")
-(assert_invalid (module (func (f32.demote/f64 (i32.const 0)))) "type mismatch")
-(assert_invalid (module (func (f32.reinterpret/i32 (i64.const 0)))) "type mismatch")
-(assert_invalid (module (func (f64.convert_s/i32 (i64.const 0)))) "type mismatch")
-(assert_invalid (module (func (f64.convert_u/i32 (i64.const 0)))) "type mismatch")
-(assert_invalid (module (func (f64.convert_s/i64 (i32.const 0)))) "type mismatch")
-(assert_invalid (module (func (f64.convert_u/i64 (i32.const 0)))) "type mismatch")
-(assert_invalid (module (func (f64.promote/f32 (i32.const 0)))) "type mismatch")
-(assert_invalid (module (func (f64.reinterpret/i64 (i32.const 0)))) "type mismatch")
+(assert_invalid (module (func (i32.wrap_i64 (f32.const 0)))) "type mismatch")
+(assert_invalid (module (func (i32.trunc_f32_s (i64.const 0)))) "type mismatch")
+(assert_invalid (module (func (i32.trunc_f32_u (i64.const 0)))) "type mismatch")
+(assert_invalid (module (func (i32.trunc_f64_s (i64.const 0)))) "type mismatch")
+(assert_invalid (module (func (i32.trunc_f64_u (i64.const 0)))) "type mismatch")
+(assert_invalid (module (func (i32.reinterpret_f32 (i64.const 0)))) "type mismatch")
+(assert_invalid (module (func (i64.extend_i32_s (f32.const 0)))) "type mismatch")
+(assert_invalid (module (func (i64.extend_i32_u (f32.const 0)))) "type mismatch")
+(assert_invalid (module (func (i64.trunc_f32_s (i32.const 0)))) "type mismatch")
+(assert_invalid (module (func (i64.trunc_f32_u (i32.const 0)))) "type mismatch")
+(assert_invalid (module (func (i64.trunc_f64_s (i32.const 0)))) "type mismatch")
+(assert_invalid (module (func (i64.trunc_f64_u (i32.const 0)))) "type mismatch")
+(assert_invalid (module (func (i64.reinterpret_f64 (i32.const 0)))) "type mismatch")
+(assert_invalid (module (func (f32.convert_i32_s (i64.const 0)))) "type mismatch")
+(assert_invalid (module (func (f32.convert_i32_u (i64.const 0)))) "type mismatch")
+(assert_invalid (module (func (f32.convert_i64_s (i32.const 0)))) "type mismatch")
+(assert_invalid (module (func (f32.convert_i64_u (i32.const 0)))) "type mismatch")
+(assert_invalid (module (func (f32.demote_f64 (i32.const 0)))) "type mismatch")
+(assert_invalid (module (func (f32.reinterpret_i32 (i64.const 0)))) "type mismatch")
+(assert_invalid (module (func (f64.convert_i32_s (i64.const 0)))) "type mismatch")
+(assert_invalid (module (func (f64.convert_i32_u (i64.const 0)))) "type mismatch")
+(assert_invalid (module (func (f64.convert_i64_s (i32.const 0)))) "type mismatch")
+(assert_invalid (module (func (f64.convert_i64_u (i32.const 0)))) "type mismatch")
+(assert_invalid (module (func (f64.promote_f32 (i32.const 0)))) "type mismatch")
+(assert_invalid (module (func (f64.reinterpret_i64 (i32.const 0)))) "type mismatch")
;; grow_memory
(assert_invalid (module (memory 1) (func (grow_memory (f32.const 0)))) "type mismatch")
diff --git a/test/spec/unreachable.wast b/test/spec/unreachable.wast
index 428146f32..ce1d81ba1 100644
--- a/test/spec/unreachable.wast
+++ b/test/spec/unreachable.wast
@@ -84,17 +84,17 @@
(if i32 (unreachable) (i32.const 0) (i32.const 1))
)
(func (export "as-if-then") (param i32 i32) (result i32)
- (if i32 (get_local 0) (unreachable) (get_local 1))
+ (if i32 (local.get 0) (unreachable) (local.get 1))
)
(func (export "as-if-else") (param i32 i32) (result i32)
- (if i32 (get_local 0) (get_local 1) (unreachable))
+ (if i32 (local.get 0) (local.get 1) (unreachable))
)
(func (export "as-select-first") (param i32 i32) (result i32)
- (select (unreachable) (get_local 0) (get_local 1))
+ (select (unreachable) (local.get 0) (local.get 1))
)
(func (export "as-select-second") (param i32 i32) (result i32)
- (select (get_local 0) (unreachable) (get_local 1))
+ (select (local.get 0) (unreachable) (local.get 1))
)
(func (export "as-select-cond") (result i32)
(select (i32.const 0) (i32.const 1) (unreachable))
@@ -111,7 +111,7 @@
)
(type $sig (func (param i32 i32 i32)))
- (table anyfunc (elem $dummy3))
+ (table funcref (elem $dummy3))
(func (export "as-call_indirect-func")
(call_indirect (type $sig) (unreachable) (i32.const 1) (i32.const 2) (i32.const 3))
)
@@ -125,8 +125,8 @@
(call_indirect (type $sig) (i32.const 0) (i32.const 1) (i32.const 2) (unreachable))
)
- (func (export "as-set_local-value") (local f32)
- (set_local 0 (unreachable))
+ (func (export "as-local.set-value") (local f32)
+ (local.set 0 (unreachable))
)
(memory 1)
@@ -174,7 +174,7 @@
)
(func (export "as-convert-operand") (result i32)
- (i32.wrap/i64 (unreachable))
+ (i32.wrap_i64 (unreachable))
)
(func (export "as-grow_memory-size") (result i32)
@@ -236,7 +236,7 @@
(assert_trap (invoke "as-call_indirect-mid") "unreachable")
(assert_trap (invoke "as-call_indirect-last") "unreachable")
-(assert_trap (invoke "as-set_local-value") "unreachable")
+(assert_trap (invoke "as-local.set-value") "unreachable")
(assert_trap (invoke "as-load-address") "unreachable")
(assert_trap (invoke "as-loadN-address") "unreachable")