diff options
author | Heejin Ahn <aheejin@gmail.com> | 2020-11-13 15:54:08 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-13 15:54:08 -0800 |
commit | 75e61204b67e921464af14fd13ff768d88755e8c (patch) | |
tree | 969ddb2e4e2870fef662375914f16fc50713cd4c /test | |
parent | cc2b3e4175a6edc53487eec06da13b39eb66716b (diff) | |
download | binaryen-75e61204b67e921464af14fd13ff768d88755e8c.tar.gz binaryen-75e61204b67e921464af14fd13ff768d88755e8c.tar.bz2 binaryen-75e61204b67e921464af14fd13ff768d88755e8c.zip |
Rename atomic.notify and *.atomic.wait (#3353)
- atomic.notify -> memory.atomic.notify
- i32.atomic.wait -> memory.atomic.wait32
- i64.atomic.wait -> memory.atomic.wait64
See WebAssembly/threads#149.
This renames instruction name printing but not the internal data
structure names, such as `AtomicNotify`, which are not always the same
as printed instruction names anyway. This also does not modify C API.
But this fixes interface functions in binaryen.js because it seems
binaryen.js's interface functions all follow the corresponding
instruction names.
Diffstat (limited to 'test')
27 files changed, 92 insertions, 92 deletions
diff --git a/test/atomics.wast b/test/atomics.wast index 9cce84ccd..792772a51 100644 --- a/test/atomics.wast +++ b/test/atomics.wast @@ -138,40 +138,40 @@ (local $0 i32) (local $1 i64) (drop - (i32.atomic.wait + (memory.atomic.wait32 (local.get $0) (local.get $0) (local.get $1) ) ) (drop - (i32.atomic.wait offset=4 align=4 + (memory.atomic.wait32 offset=4 align=4 (local.get $0) (local.get $0) (local.get $1) ) ) (drop - (atomic.notify + (memory.atomic.notify (local.get $0) (local.get $0) ) ) (drop - (atomic.notify offset=24 align=4 + (memory.atomic.notify offset=24 align=4 (local.get $0) (local.get $0) ) ) (drop - (i64.atomic.wait + (memory.atomic.wait64 (local.get $0) (local.get $1) (local.get $1) ) ) (drop - (i64.atomic.wait align=8 offset=16 + (memory.atomic.wait64 align=8 offset=16 (local.get $0) (local.get $1) (local.get $1) diff --git a/test/atomics.wast.from-wast b/test/atomics.wast.from-wast index 70eda655a..5140f3901 100644 --- a/test/atomics.wast.from-wast +++ b/test/atomics.wast.from-wast @@ -138,40 +138,40 @@ (local $0 i32) (local $1 i64) (drop - (i32.atomic.wait + (memory.atomic.wait32 (local.get $0) (local.get $0) (local.get $1) ) ) (drop - (i32.atomic.wait offset=4 + (memory.atomic.wait32 offset=4 (local.get $0) (local.get $0) (local.get $1) ) ) (drop - (atomic.notify + (memory.atomic.notify (local.get $0) (local.get $0) ) ) (drop - (atomic.notify offset=24 + (memory.atomic.notify offset=24 (local.get $0) (local.get $0) ) ) (drop - (i64.atomic.wait + (memory.atomic.wait64 (local.get $0) (local.get $1) (local.get $1) ) ) (drop - (i64.atomic.wait offset=16 + (memory.atomic.wait64 offset=16 (local.get $0) (local.get $1) (local.get $1) diff --git a/test/atomics.wast.fromBinary b/test/atomics.wast.fromBinary index 2710c58d5..c9ce94c70 100644 --- a/test/atomics.wast.fromBinary +++ b/test/atomics.wast.fromBinary @@ -138,40 +138,40 @@ (local $0 i32) (local $1 i64) (drop - (i32.atomic.wait + (memory.atomic.wait32 (local.get $0) (local.get $0) (local.get $1) ) ) (drop - (i32.atomic.wait offset=4 + (memory.atomic.wait32 offset=4 (local.get $0) (local.get $0) (local.get $1) ) ) (drop - (atomic.notify + (memory.atomic.notify (local.get $0) (local.get $0) ) ) (drop - (atomic.notify offset=24 + (memory.atomic.notify offset=24 (local.get $0) (local.get $0) ) ) (drop - (i64.atomic.wait + (memory.atomic.wait64 (local.get $0) (local.get $1) (local.get $1) ) ) (drop - (i64.atomic.wait offset=16 + (memory.atomic.wait64 offset=16 (local.get $0) (local.get $1) (local.get $1) diff --git a/test/atomics.wast.fromBinary.noDebugInfo b/test/atomics.wast.fromBinary.noDebugInfo index 049a86282..e562f6a42 100644 --- a/test/atomics.wast.fromBinary.noDebugInfo +++ b/test/atomics.wast.fromBinary.noDebugInfo @@ -138,40 +138,40 @@ (local $0 i32) (local $1 i64) (drop - (i32.atomic.wait + (memory.atomic.wait32 (local.get $0) (local.get $0) (local.get $1) ) ) (drop - (i32.atomic.wait offset=4 + (memory.atomic.wait32 offset=4 (local.get $0) (local.get $0) (local.get $1) ) ) (drop - (atomic.notify + (memory.atomic.notify (local.get $0) (local.get $0) ) ) (drop - (atomic.notify offset=24 + (memory.atomic.notify offset=24 (local.get $0) (local.get $0) ) ) (drop - (i64.atomic.wait + (memory.atomic.wait64 (local.get $0) (local.get $1) (local.get $1) ) ) (drop - (i64.atomic.wait offset=16 + (memory.atomic.wait64 offset=16 (local.get $0) (local.get $1) (local.get $1) diff --git a/test/atomics64.wast b/test/atomics64.wast index c3855a717..6ccab9cfa 100644 --- a/test/atomics64.wast +++ b/test/atomics64.wast @@ -142,40 +142,40 @@ (local $1 i64) (local $2 i32) (drop - (i32.atomic.wait + (memory.atomic.wait32 (local.get $0) (local.get $2) (local.get $1) ) ) (drop - (i32.atomic.wait offset=4 align=4 + (memory.atomic.wait32 offset=4 align=4 (local.get $0) (local.get $2) (local.get $1) ) ) (drop - (atomic.notify + (memory.atomic.notify (local.get $0) (local.get $2) ) ) (drop - (atomic.notify offset=24 align=4 + (memory.atomic.notify offset=24 align=4 (local.get $0) (local.get $2) ) ) (drop - (i64.atomic.wait + (memory.atomic.wait64 (local.get $0) (local.get $1) (local.get $1) ) ) (drop - (i64.atomic.wait align=8 offset=16 + (memory.atomic.wait64 align=8 offset=16 (local.get $0) (local.get $1) (local.get $1) diff --git a/test/atomics64.wast.from-wast b/test/atomics64.wast.from-wast index f9ae56d17..ee4eb1bdf 100644 --- a/test/atomics64.wast.from-wast +++ b/test/atomics64.wast.from-wast @@ -142,40 +142,40 @@ (local $1 i64) (local $2 i32) (drop - (i32.atomic.wait + (memory.atomic.wait32 (local.get $0) (local.get $2) (local.get $1) ) ) (drop - (i32.atomic.wait offset=4 + (memory.atomic.wait32 offset=4 (local.get $0) (local.get $2) (local.get $1) ) ) (drop - (atomic.notify + (memory.atomic.notify (local.get $0) (local.get $2) ) ) (drop - (atomic.notify offset=24 + (memory.atomic.notify offset=24 (local.get $0) (local.get $2) ) ) (drop - (i64.atomic.wait + (memory.atomic.wait64 (local.get $0) (local.get $1) (local.get $1) ) ) (drop - (i64.atomic.wait offset=16 + (memory.atomic.wait64 offset=16 (local.get $0) (local.get $1) (local.get $1) diff --git a/test/atomics64.wast.fromBinary b/test/atomics64.wast.fromBinary index 1dcf24a1e..fc405c15c 100644 --- a/test/atomics64.wast.fromBinary +++ b/test/atomics64.wast.fromBinary @@ -142,40 +142,40 @@ (local $1 i64) (local $2 i64) (drop - (i32.atomic.wait + (memory.atomic.wait32 (local.get $1) (local.get $0) (local.get $2) ) ) (drop - (i32.atomic.wait offset=4 + (memory.atomic.wait32 offset=4 (local.get $1) (local.get $0) (local.get $2) ) ) (drop - (atomic.notify + (memory.atomic.notify (local.get $1) (local.get $0) ) ) (drop - (atomic.notify offset=24 + (memory.atomic.notify offset=24 (local.get $1) (local.get $0) ) ) (drop - (i64.atomic.wait + (memory.atomic.wait64 (local.get $1) (local.get $2) (local.get $2) ) ) (drop - (i64.atomic.wait offset=16 + (memory.atomic.wait64 offset=16 (local.get $1) (local.get $2) (local.get $2) diff --git a/test/atomics64.wast.fromBinary.noDebugInfo b/test/atomics64.wast.fromBinary.noDebugInfo index cffb1491e..afa8a3b7c 100644 --- a/test/atomics64.wast.fromBinary.noDebugInfo +++ b/test/atomics64.wast.fromBinary.noDebugInfo @@ -142,40 +142,40 @@ (local $1 i64) (local $2 i64) (drop - (i32.atomic.wait + (memory.atomic.wait32 (local.get $1) (local.get $0) (local.get $2) ) ) (drop - (i32.atomic.wait offset=4 + (memory.atomic.wait32 offset=4 (local.get $1) (local.get $0) (local.get $2) ) ) (drop - (atomic.notify + (memory.atomic.notify (local.get $1) (local.get $0) ) ) (drop - (atomic.notify offset=24 + (memory.atomic.notify offset=24 (local.get $1) (local.get $0) ) ) (drop - (i64.atomic.wait + (memory.atomic.wait64 (local.get $1) (local.get $2) (local.get $2) ) ) (drop - (i64.atomic.wait offset=16 + (memory.atomic.wait64 offset=16 (local.get $1) (local.get $2) (local.get $2) diff --git a/test/binaryen.js/atomics.js b/test/binaryen.js/atomics.js index bd4b898bd..ce68656e0 100644 --- a/test/binaryen.js/atomics.js +++ b/test/binaryen.js/atomics.js @@ -59,21 +59,21 @@ module.addFunction("main", binaryen.none, binaryen.none, [], module.block("", [ ), // wait and notify module.drop( - module.i32.atomic.wait( + module.memory.atomic.wait32( module.i32.const(0), module.i32.const(0), module.i64.const(0) ) ), module.drop( - module.i64.atomic.wait( + module.memory.atomic.wait64( module.i32.const(0), module.i64.const(0), module.i64.const(0) ) ), module.drop( - module.atomic.notify( + module.memory.atomic.notify( module.i32.const(0), module.i32.const(0) ) diff --git a/test/binaryen.js/atomics.js.txt b/test/binaryen.js/atomics.js.txt index a58647617..091298d57 100644 --- a/test/binaryen.js/atomics.js.txt +++ b/test/binaryen.js/atomics.js.txt @@ -45,21 +45,21 @@ ) ) (drop - (i32.atomic.wait + (memory.atomic.wait32 (i32.const 0) (i32.const 0) (i64.const 0) ) ) (drop - (i64.atomic.wait + (memory.atomic.wait64 (i32.const 0) (i64.const 0) (i64.const 0) ) ) (drop - (atomic.notify + (memory.atomic.notify (i32.const 0) (i32.const 0) ) diff --git a/test/binaryen.js/expressions.js b/test/binaryen.js/expressions.js index 0d48e5551..a340adcbe 100644 --- a/test/binaryen.js/expressions.js +++ b/test/binaryen.js/expressions.js @@ -901,7 +901,7 @@ console.log("# AtomicWait"); var ptr = module.i32.const(2); var expected = module.i32.const(3); var timeout = module.i64.const(4); - const theAtomicWait = binaryen.AtomicWait(module.i32.atomic.wait(ptr, expected, timeout)); + const theAtomicWait = binaryen.AtomicWait(module.memory.atomic.wait32(ptr, expected, timeout)); assert(theAtomicWait instanceof binaryen.AtomicWait); assert(theAtomicWait instanceof binaryen.Expression); assert(theAtomicWait.ptr === ptr); @@ -926,7 +926,7 @@ console.log("# AtomicWait"); assert( theAtomicWait.toText() == - "(i64.atomic.wait\n (i32.const 5)\n (i32.const 6)\n (i64.const 7)\n)\n" + "(memory.atomic.wait64\n (i32.const 5)\n (i32.const 6)\n (i64.const 7)\n)\n" ); module.dispose(); @@ -938,7 +938,7 @@ console.log("# AtomicNotify"); var ptr = module.i32.const(1); var notifyCount = module.i32.const(2); - const theAtomicNotify = binaryen.AtomicNotify(module.atomic.notify(ptr, notifyCount)); + const theAtomicNotify = binaryen.AtomicNotify(module.memory.atomic.notify(ptr, notifyCount)); assert(theAtomicNotify instanceof binaryen.AtomicNotify); assert(theAtomicNotify instanceof binaryen.Expression); assert(theAtomicNotify.ptr === ptr); @@ -957,7 +957,7 @@ console.log("# AtomicNotify"); assert( theAtomicNotify.toText() == - "(atomic.notify\n (i32.const 3)\n (i32.const 4)\n)\n" + "(memory.atomic.notify\n (i32.const 3)\n (i32.const 4)\n)\n" ); module.dispose(); diff --git a/test/binaryen.js/expressions.js.txt b/test/binaryen.js/expressions.js.txt index e2b34e501..ba946b296 100644 --- a/test/binaryen.js/expressions.js.txt +++ b/test/binaryen.js/expressions.js.txt @@ -128,14 +128,14 @@ ) # AtomicWait -(i64.atomic.wait +(memory.atomic.wait64 (i32.const 5) (i32.const 6) (i64.const 7) ) # AtomicNotify -(atomic.notify +(memory.atomic.notify (i32.const 3) (i32.const 4) ) diff --git a/test/binaryen.js/kitchen-sink.js b/test/binaryen.js/kitchen-sink.js index 769b1a7e0..836b7ab17 100644 --- a/test/binaryen.js/kitchen-sink.js +++ b/test/binaryen.js/kitchen-sink.js @@ -570,14 +570,14 @@ function test_core() { ) ), module.drop( - module.i32.atomic.wait( + module.memory.atomic.wait32( module.i32.const(0), module.i32.const(0), module.i64.const(0) ) ), module.drop( - module.atomic.notify( + module.memory.atomic.notify( module.i32.const(0), module.i32.const(0) ) diff --git a/test/binaryen.js/kitchen-sink.js.txt b/test/binaryen.js/kitchen-sink.js.txt index 6c32962a7..4990c0abd 100644 --- a/test/binaryen.js/kitchen-sink.js.txt +++ b/test/binaryen.js/kitchen-sink.js.txt @@ -1896,14 +1896,14 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7} ) ) (drop - (i32.atomic.wait + (memory.atomic.wait32 (i32.const 0) (i32.const 0) (i64.const 0) ) ) (drop - (atomic.notify + (memory.atomic.notify (i32.const 0) (i32.const 0) ) @@ -3778,14 +3778,14 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7} ) ) (drop - (i32.atomic.wait + (memory.atomic.wait32 (i32.const 0) (i32.const 0) (i64.const 0) ) ) (drop - (atomic.notify + (memory.atomic.notify (i32.const 0) (i32.const 0) ) diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt index 723d81999..ab9548924 100644 --- a/test/example/c-api-kitchen-sink.txt +++ b/test/example/c-api-kitchen-sink.txt @@ -1803,14 +1803,14 @@ BinaryenFeatureAll: 4095 ) ) (drop - (i32.atomic.wait + (memory.atomic.wait32 (i32.const 0) (i32.const 0) (i64.const 111) ) ) (drop - (atomic.notify + (memory.atomic.notify (i32.const 0) (i32.const 0) ) diff --git a/test/example/c-api-kitchen-sink.txt.txt b/test/example/c-api-kitchen-sink.txt.txt index d3cc32e8d..d3c8e4819 100644 --- a/test/example/c-api-kitchen-sink.txt.txt +++ b/test/example/c-api-kitchen-sink.txt.txt @@ -1692,14 +1692,14 @@ ) ) (drop - (i32.atomic.wait + (memory.atomic.wait32 (i32.const 0) (i32.const 0) (i64.const 111) ) ) (drop - (atomic.notify + (memory.atomic.notify (i32.const 0) (i32.const 0) ) diff --git a/test/extra-unreachable.wast b/test/extra-unreachable.wast index 7c9ed8814..799665924 100644 --- a/test/extra-unreachable.wast +++ b/test/extra-unreachable.wast @@ -138,16 +138,16 @@ ;; atomic.wait (global.set $g - (i32.atomic.wait + (memory.atomic.wait32 (unreachable) (i32.const 0) (i64.const 0) ) ) - ;; atomic.notify + ;; memory.atomic.notify (global.set $g - (atomic.notify + (memory.atomic.notify (unreachable) (i32.const 0) ) diff --git a/test/extra-unreachable.wast.from-wast b/test/extra-unreachable.wast.from-wast index 1598abf48..e084548f8 100644 --- a/test/extra-unreachable.wast.from-wast +++ b/test/extra-unreachable.wast.from-wast @@ -110,14 +110,14 @@ ) ) (global.set $g - (i32.atomic.wait + (memory.atomic.wait32 (unreachable) (i32.const 0) (i64.const 0) ) ) (global.set $g - (atomic.notify + (memory.atomic.notify (unreachable) (i32.const 0) ) diff --git a/test/passes/fuzz-exec_all-features.txt b/test/passes/fuzz-exec_all-features.txt index a6b25e8ca..cbdcf4fdb 100644 --- a/test/passes/fuzz-exec_all-features.txt +++ b/test/passes/fuzz-exec_all-features.txt @@ -98,7 +98,7 @@ ) ) (func $3 (result i32) - (atomic.notify + (memory.atomic.notify (i32.const 1) (i32.const 1) ) @@ -119,7 +119,7 @@ ) (func $5 (drop - (atomic.notify offset=22 + (memory.atomic.notify offset=22 (i32.const -104) (i32.const -72) ) diff --git a/test/passes/fuzz-exec_all-features.wast b/test/passes/fuzz-exec_all-features.wast index fd3018502..4e5c926a5 100644 --- a/test/passes/fuzz-exec_all-features.wast +++ b/test/passes/fuzz-exec_all-features.wast @@ -51,7 +51,7 @@ ) ) (func "unaligned_notify" (result i32) - (atomic.notify + (memory.atomic.notify (i32.const 1) ;; unaligned (i32.const 1) ) @@ -70,7 +70,7 @@ ) (func "oob_notify" (drop - (atomic.notify offset=22 + (memory.atomic.notify offset=22 (i32.const -104) ;; illegal address (i32.const -72) ) diff --git a/test/passes/remove-unused-module-elements_all-features.txt b/test/passes/remove-unused-module-elements_all-features.txt index e79257211..81382e4f4 100644 --- a/test/passes/remove-unused-module-elements_all-features.txt +++ b/test/passes/remove-unused-module-elements_all-features.txt @@ -157,7 +157,7 @@ (local $0 i32) (local $1 i64) (drop - (i32.atomic.wait + (memory.atomic.wait32 (local.get $0) (local.get $0) (local.get $1) @@ -170,7 +170,7 @@ (memory $0 (shared 23 256)) (export "user" (func $user)) (func $user (result i32) - (atomic.notify + (memory.atomic.notify (i32.const 0) (i32.const 0) ) diff --git a/test/passes/remove-unused-module-elements_all-features.wast b/test/passes/remove-unused-module-elements_all-features.wast index 265ef0e5f..bf9d5c7ff 100644 --- a/test/passes/remove-unused-module-elements_all-features.wast +++ b/test/passes/remove-unused-module-elements_all-features.wast @@ -128,7 +128,7 @@ (local $0 i32) (local $1 i64) (drop - (i32.atomic.wait + (memory.atomic.wait32 (local.get $0) (local.get $0) (local.get $1) @@ -140,7 +140,7 @@ (memory $0 (shared 23 256)) (export "user" $user) (func $user (result i32) - (atomic.notify (i32.const 0) (i32.const 0)) + (memory.atomic.notify (i32.const 0) (i32.const 0)) ) ) (module ;; more use checks diff --git a/test/passes/remove-unused-nonfunction-module-elements_all-features.txt b/test/passes/remove-unused-nonfunction-module-elements_all-features.txt index 2091e9560..5a5406f78 100644 --- a/test/passes/remove-unused-nonfunction-module-elements_all-features.txt +++ b/test/passes/remove-unused-nonfunction-module-elements_all-features.txt @@ -172,7 +172,7 @@ (local $0 i32) (local $1 i64) (drop - (i32.atomic.wait + (memory.atomic.wait32 (local.get $0) (local.get $0) (local.get $1) @@ -185,7 +185,7 @@ (memory $0 (shared 23 256)) (export "user" (func $user)) (func $user (result i32) - (atomic.notify + (memory.atomic.notify (i32.const 0) (i32.const 0) ) diff --git a/test/passes/remove-unused-nonfunction-module-elements_all-features.wast b/test/passes/remove-unused-nonfunction-module-elements_all-features.wast index 36bc79e82..c1003ebb0 100644 --- a/test/passes/remove-unused-nonfunction-module-elements_all-features.wast +++ b/test/passes/remove-unused-nonfunction-module-elements_all-features.wast @@ -128,7 +128,7 @@ (local $0 i32) (local $1 i64) (drop - (i32.atomic.wait + (memory.atomic.wait32 (local.get $0) (local.get $0) (local.get $1) @@ -140,7 +140,7 @@ (memory $0 (shared 23 256)) (export "user" $user) (func $user (result i32) - (atomic.notify (i32.const 0) (i32.const 0)) + (memory.atomic.notify (i32.const 0) (i32.const 0)) ) ) (module ;; more use checks diff --git a/test/unreachable-instr-type.wast b/test/unreachable-instr-type.wast index 220347f0f..b7c2078ab 100644 --- a/test/unreachable-instr-type.wast +++ b/test/unreachable-instr-type.wast @@ -19,7 +19,7 @@ (i64.const 1) ) - (i64.atomic.wait + (memory.atomic.wait64 (unreachable) (i64.const 0) (i64.const 0) diff --git a/test/unreachable-instr-type.wast.from-wast b/test/unreachable-instr-type.wast.from-wast index 4c456e59e..311c98a66 100644 --- a/test/unreachable-instr-type.wast.from-wast +++ b/test/unreachable-instr-type.wast.from-wast @@ -18,7 +18,7 @@ (i64.const 0) (i64.const 1) ) - (i64.atomic.wait + (memory.atomic.wait64 (unreachable) (i64.const 0) (i64.const 0) diff --git a/test/wasm2js/atomics_32.wast b/test/wasm2js/atomics_32.wast index 2c7ba9a44..e1b49d852 100644 --- a/test/wasm2js/atomics_32.wast +++ b/test/wasm2js/atomics_32.wast @@ -12,11 +12,11 @@ (local.set $x (i32.atomic.load16_u (i32.const 1028))) (local.set $x (i32.atomic.load (i32.const 1028))) (i32.atomic.store (i32.const 100) (i32.const 200)) - (local.set $x (i32.atomic.wait (i32.const 4) (i32.const 8) (i64.const -1))) + (local.set $x (memory.atomic.wait32 (i32.const 4) (i32.const 8) (i64.const -1))) (memory.init 0 (i32.const 512) (i32.const 0) (i32.const 4)) (memory.init 1 (i32.const 1024) (i32.const 4) (i32.const 2)) - (local.set $x (atomic.notify (i32.const 4) (i32.const 2))) - (local.set $x (atomic.notify offset=20 (i32.const 4) (i32.const 2))) + (local.set $x (memory.atomic.notify (i32.const 4) (i32.const 2))) + (local.set $x (memory.atomic.notify offset=20 (i32.const 4) (i32.const 2))) (local.set $x (i32.atomic.rmw.add (i32.const 8) (i32.const 12))) (local.set $x (i32.atomic.rmw.sub (i32.const 8) (i32.const 12))) (local.set $x (i32.atomic.rmw.and (i32.const 8) (i32.const 12))) |