summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-stack.cpp
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2019-08-27 16:40:59 -0700
committerGitHub <noreply@github.com>2019-08-27 16:40:59 -0700
commitcb0b31a2d185f18662814c9f3c9158b2eea74760 (patch)
tree4fe23ff2abb08af7a804f6e6755b07454f79f45d /src/wasm/wasm-stack.cpp
parentf070e8c10a15a02735fbd9b88c4c569a8c786933 (diff)
downloadbinaryen-cb0b31a2d185f18662814c9f3c9158b2eea74760.tar.gz
binaryen-cb0b31a2d185f18662814c9f3c9158b2eea74760.tar.bz2
binaryen-cb0b31a2d185f18662814c9f3c9158b2eea74760.zip
Add atomic.fence instruction (#2307)
This adds `atomic.fence` instruction: https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md#fence-operator This also fix bugs in `atomic.wait` and `atomic.notify` instructions in binaryen.js and adds tests for them.
Diffstat (limited to 'src/wasm/wasm-stack.cpp')
-rw-r--r--src/wasm/wasm-stack.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/wasm/wasm-stack.cpp b/src/wasm/wasm-stack.cpp
index cb60c50f9..faa06330b 100644
--- a/src/wasm/wasm-stack.cpp
+++ b/src/wasm/wasm-stack.cpp
@@ -422,6 +422,11 @@ void BinaryInstWriter::visitAtomicNotify(AtomicNotify* curr) {
emitMemoryAccess(4, 4, 0);
}
+void BinaryInstWriter::visitAtomicFence(AtomicFence* curr) {
+ o << int8_t(BinaryConsts::AtomicPrefix) << int8_t(BinaryConsts::AtomicFence)
+ << int8_t(curr->order);
+}
+
void BinaryInstWriter::visitSIMDExtract(SIMDExtract* curr) {
o << int8_t(BinaryConsts::SIMDPrefix);
switch (curr->op) {