diff options
author | Andy Wingo <wingo@igalia.com> | 2020-04-20 21:10:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-20 12:10:19 -0700 |
commit | d041025854ba2b00b3df9f308914c8aba05dcda9 (patch) | |
tree | 2066b1cef60effa9c2a0ef7cf13cf65a34f23b1b /src/binary-reader.cc | |
parent | 952c3b8006911a8659c1b922c3bb4adffc671d89 (diff) | |
download | wabt-d041025854ba2b00b3df9f308914c8aba05dcda9.tar.gz wabt-d041025854ba2b00b3df9f308914c8aba05dcda9.tar.bz2 wabt-d041025854ba2b00b3df9f308914c8aba05dcda9.zip |
Add support for atomic.fence from the threads proposal (#1231)
See https://github.com/WebAssembly/threads/pull/141 for the binary
encoding. This patch does add a field to AtomicFenceExpr for the
consistency model, though without a type for the time being.
Diffstat (limited to 'src/binary-reader.cc')
-rw-r--r-- | src/binary-reader.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/binary-reader.cc b/src/binary-reader.cc index 32116a5c..86bb07bc 100644 --- a/src/binary-reader.cc +++ b/src/binary-reader.cc @@ -1315,6 +1315,16 @@ Result BinaryReader::ReadFunctionBody(Offset end_offset) { break; } + case Opcode::AtomicFence: { + uint8_t consistency_model; + CHECK_RESULT(ReadU8(&consistency_model, "consistency model")); + ERROR_UNLESS(consistency_model == 0, + "atomic.fence consistency model must be 0"); + CALLBACK(OnAtomicFenceExpr, consistency_model); + CALLBACK(OnOpcodeUint32, consistency_model); + break; + } + case Opcode::I32AtomicLoad8U: case Opcode::I32AtomicLoad16U: case Opcode::I64AtomicLoad8U: |