summaryrefslogtreecommitdiff
path: root/src/wasm-builder.h
diff options
context:
space:
mode:
authorThomas Lively <7121787+tlively@users.noreply.github.com>2019-02-05 12:35:09 -0800
committerGitHub <noreply@github.com>2019-02-05 12:35:09 -0800
commitf424f81886405fc26a415fc86900c0f8d0df14eb (patch)
tree5896c316f216fca9654f55e41809839d181ca53b /src/wasm-builder.h
parent484f62f985cb2180139d1cf991ac04ee41635417 (diff)
downloadbinaryen-f424f81886405fc26a415fc86900c0f8d0df14eb.tar.gz
binaryen-f424f81886405fc26a415fc86900c0f8d0df14eb.tar.bz2
binaryen-f424f81886405fc26a415fc86900c0f8d0df14eb.zip
Bulk memory operations (#1892)
Bulk memory operations The only parts missing are the interpreter implementation and spec tests.
Diffstat (limited to 'src/wasm-builder.h')
-rw-r--r--src/wasm-builder.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/wasm-builder.h b/src/wasm-builder.h
index f182b1df2..eee4e3b79 100644
--- a/src/wasm-builder.h
+++ b/src/wasm-builder.h
@@ -334,6 +334,37 @@ public:
ret->finalize();
return ret;
}
+ MemoryInit* makeMemoryInit(uint32_t segment, Expression* dest, Expression* offset, Expression* size) {
+ auto* ret = allocator.alloc<MemoryInit>();
+ ret->segment = segment;
+ ret->dest = dest;
+ ret->offset = offset;
+ ret->size = size;
+ ret->finalize();
+ return ret;
+ }
+ DataDrop* makeDataDrop(uint32_t segment) {
+ auto* ret = allocator.alloc<DataDrop>();
+ ret->segment = segment;
+ ret->finalize();
+ return ret;
+ }
+ MemoryCopy* makeMemoryCopy(Expression* dest, Expression* source, Expression* size) {
+ auto* ret = allocator.alloc<MemoryCopy>();
+ ret->dest = dest;
+ ret->source = source;
+ ret->size = size;
+ ret->finalize();
+ return ret;
+ }
+ MemoryFill* makeMemoryFill(Expression* dest, Expression* value, Expression* size) {
+ auto* ret = allocator.alloc<MemoryFill>();
+ ret->dest = dest;
+ ret->value = value;
+ ret->size = size;
+ ret->finalize();
+ return ret;
+ }
Const* makeConst(Literal value) {
assert(isConcreteType(value.type));
auto* ret = allocator.alloc<Const>();