diff options
author | Wouter van Oortmerssen <aardappel@gmail.com> | 2021-07-19 13:10:00 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-19 13:10:00 -0700 |
commit | 2d385ff8ebfcf65e3b532f4c42795758966abff4 (patch) | |
tree | ae42efc6ecbf715ae12f436397b489a555bb46af /src/passes/Memory64Lowering.cpp | |
parent | ec6ef26ec4f4fdfc974e7087896ac004ac7c130a (diff) | |
download | binaryen-2d385ff8ebfcf65e3b532f4c42795758966abff4.tar.gz binaryen-2d385ff8ebfcf65e3b532f4c42795758966abff4.tar.bz2 binaryen-2d385ff8ebfcf65e3b532f4c42795758966abff4.zip |
[Memory64] Fixed atomics / bulk memory support. (#3992)
Diffstat (limited to 'src/passes/Memory64Lowering.cpp')
-rw-r--r-- | src/passes/Memory64Lowering.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/passes/Memory64Lowering.cpp b/src/passes/Memory64Lowering.cpp index c376ed6c6..95dbf4f17 100644 --- a/src/passes/Memory64Lowering.cpp +++ b/src/passes/Memory64Lowering.cpp @@ -90,11 +90,21 @@ struct Memory64Lowering : public WalkerPass<PostWalker<Memory64Lowering>> { wrapAddress64(curr->size); } + void visitAtomicRMW(AtomicRMW* curr) { wrapAddress64(curr->ptr); } + + void visitAtomicCmpxchg(AtomicCmpxchg* curr) { wrapAddress64(curr->ptr); } + + void visitAtomicWait(AtomicWait* curr) { wrapAddress64(curr->ptr); } + + void visitAtomicNotify(AtomicNotify* curr) { wrapAddress64(curr->ptr); } + void visitMemory(Memory* memory) { for (auto& segment : memory->segments) { - auto* c = segment.offset->cast<Const>(); - c->value = Literal(static_cast<uint32_t>(c->value.geti64())); - c->type = Type::i32; + if (!segment.isPassive) { + auto* c = segment.offset->cast<Const>(); + c->value = Literal(static_cast<uint32_t>(c->value.geti64())); + c->type = Type::i32; + } } // This is visited last. memory->indexType = Type::i32; |