From fe7d2b22f955c070905d8180bf1f3ccc25f908be Mon Sep 17 00:00:00 2001 From: Heejin Ahn Date: Fri, 1 Nov 2019 21:38:58 -0700 Subject: [PATCH] Add support for reference types proposal This adds support for the reference type proposal. This adds support for all reference types (anyref, funcref(=anyfunc), and nullref) and four new instructions: `ref.null`, `ref.is_null`, `ref.func`, and new typed `select`. This also adds subtype relationship support between reference types. This does not include table instructions yet. This also does not include wasm2js support. This does not pass `fuzz_opt.py` yet because there are remaining bugs related to `nullref` handling, because `nullref` is not allowed to be written to text or binary format. We are discussing whether we should allow it to be written in WebAssembly/reference-types#60 now. This is not ready for review yet because it does not pass fuzzer now; I'm uploading this just to show how the current a bit ad-hoc `nullref` handling looks like. So don't spend too much time on reviewing each detail for now. I apprciate some high-level comments on how we should handle `nullref` or other stuff. --- scripts/gen-s-parser.py | 7 + src/asmjs/asm_v_wasm.cpp | 21 +- src/binaryen-c.cpp | 90 +- src/binaryen-c.h | 18 +- src/gen-s-parser.inc | 64 +- src/ir/ExpressionAnalyzer.cpp | 3 + src/ir/ExpressionManipulator.cpp | 15 +- src/ir/ReFinalize.cpp | 53 +- src/ir/abstract.h | 14 +- src/ir/effects.h | 3 + src/ir/flat.h | 2 +- src/ir/literal-utils.h | 4 + src/ir/manipulation.h | 14 +- src/ir/utils.h | 18 +- src/js/binaryen.js-post.js | 53 +- src/literal.h | 41 +- src/parsing.h | 6 +- src/passes/ConstHoisting.cpp | 9 +- src/passes/DeadCodeElimination.cpp | 6 + src/passes/Flatten.cpp | 3 +- src/passes/FuncCastEmulation.cpp | 18 +- src/passes/InstrumentLocals.cpp | 21 +- src/passes/Precompute.cpp | 15 +- src/passes/Print.cpp | 30 +- src/passes/RemoveUnusedBrs.cpp | 4 +- src/passes/RemoveUnusedModuleElements.cpp | 6 + src/passes/SimplifyGlobals.cpp | 4 +- src/shell-interface.h | 6 +- src/support/name.h | 2 +- src/support/small_vector.h | 10 +- src/tools/fuzzing.h | 232 ++- src/tools/spec-wrapper.h | 10 +- src/tools/wasm-reduce.cpp | 14 + src/tools/wasm-shell.cpp | 11 +- src/wasm-binary.h | 28 +- src/wasm-builder.h | 73 +- src/wasm-interpreter.h | 43 +- src/wasm-s-parser.h | 3 + src/wasm-stack.h | 30 + src/wasm-traversal.h | 49 + src/wasm-type.h | 11 +- src/wasm.h | 42 + src/wasm/literal.cpp | 84 +- src/wasm/wasm-binary.cpp | 84 +- src/wasm/wasm-s-parser.cpp | 43 +- src/wasm/wasm-stack.cpp | 53 +- src/wasm/wasm-type.cpp | 57 +- src/wasm/wasm-validator.cpp | 306 ++-- src/wasm/wasm.cpp | 31 +- src/wasm2js.h | 12 + test/anyref.wast | 18 - test/anyref.wast.from-wast | 19 - test/anyref.wast.fromBinary | 20 - test/anyref.wast.fromBinary.noDebugInfo | 20 - test/binaryen.js/exception-handling.js.txt | 7 + test/binaryen.js/kitchen-sink.js | 7 + test/binaryen.js/kitchen-sink.js.txt | 262 ++- test/binaryen.js/push-pop.js | 4 + test/binaryen.js/push-pop.js.txt | 18 + test/example/c-api-kitchen-sink.c | 11 +- test/example/c-api-kitchen-sink.txt | 1574 ++++++++++------- test/example/c-api-kitchen-sink.txt.txt | 26 + test/exception-handling.wast | 16 + test/exception-handling.wast.from-wast | 23 +- test/exception-handling.wast.fromBinary | 19 + ...ption-handling.wast.fromBinary.noDebugInfo | 19 + test/passes/asyncify.txt | 8 +- ...syncify-imports@env.import,env.import2.txt | 8 +- test/passes/flatten.txt | 6 +- test/passes/flatten_i64-to-i32-lowering.txt | 38 +- test/passes/flatten_local-cse.txt | 38 +- .../passes/instrument-locals_all-features.txt | 9 +- .../passes/translate-to-fuzz_all-features.txt | 775 +++++++- ...late-to-fuzz_no-fuzz-nans_all-features.txt | 751 +++++++- test/push_pop.wast | 16 + test/push_pop.wast.from-wast | 37 + test/push_pop.wast.fromBinary | 25 + test/push_pop.wast.fromBinary.noDebugInfo | 25 + test/reference-types.wast | 314 ++++ test/reference-types.wast.from-wast | 430 +++++ test/reference-types.wast.fromBinary | 416 +++++ ...eference-types.wast.fromBinary.noDebugInfo | 416 +++++ test/spec/events.wast | 5 - 83 files changed, 5840 insertions(+), 1316 deletions(-) delete mode 100644 test/anyref.wast delete mode 100644 test/anyref.wast.from-wast delete mode 100644 test/anyref.wast.fromBinary delete mode 100644 test/anyref.wast.fromBinary.noDebugInfo create mode 100644 test/reference-types.wast create mode 100644 test/reference-types.wast.from-wast create mode 100644 test/reference-types.wast.fromBinary create mode 100644 test/reference-types.wast.fromBinary.noDebugInfo diff --git a/scripts/gen-s-parser.py b/scripts/gen-s-parser.py index c7f0a51c848..f43cb378da6 100755 --- a/scripts/gen-s-parser.py +++ b/scripts/gen-s-parser.py @@ -51,6 +51,8 @@ ("v128.pop", "makePop(v128)"), ("anyref.pop", "makePop(anyref)"), ("exnref.pop", "makePop(exnref)"), + ("funcref.pop", "makePop(funcref)"), + ("nullref.pop", "makePop(nullref)"), ("i32.load", "makeLoad(s, i32, /*isAtomic=*/false)"), ("i64.load", "makeLoad(s, i64, /*isAtomic=*/false)"), ("f32.load", "makeLoad(s, f32, /*isAtomic=*/false)"), @@ -467,6 +469,11 @@ ("i32x4.widen_low_i16x8_u", "makeUnary(s, UnaryOp::WidenLowUVecI16x8ToVecI32x4)"), ("i32x4.widen_high_i16x8_u", "makeUnary(s, UnaryOp::WidenHighUVecI16x8ToVecI32x4)"), ("v8x16.swizzle", "makeBinary(s, BinaryOp::SwizzleVec8x16)"), + # reference types instructions + # TODO Add table instructions + ("ref.null", "makeRefNull(s)"), + ("ref.is_null", "makeRefIsNull(s)"), + ("ref.func", "makeRefFunc(s)"), # exception handling instructions ("try", "makeTry(s)"), ("throw", "makeThrow(s)"), diff --git a/src/asmjs/asm_v_wasm.cpp b/src/asmjs/asm_v_wasm.cpp index 143d6667ea5..e54092133cd 100644 --- a/src/asmjs/asm_v_wasm.cpp +++ b/src/asmjs/asm_v_wasm.cpp @@ -53,10 +53,11 @@ AsmType wasmToAsmType(Type type) { return ASM_INT64; case v128: assert(false && "v128 not implemented yet"); + case funcref: case anyref: - assert(false && "anyref is not supported by asm2wasm"); + case nullref: case exnref: - assert(false && "exnref is not supported by asm2wasm"); + assert(false && "reference types are not supported by asm2wasm"); case none: return ASM_NONE; case unreachable: @@ -77,10 +78,14 @@ char getSig(Type type) { return 'd'; case v128: return 'V'; + case funcref: + return 'F'; case anyref: - return 'a'; + return 'A'; + case nullref: + return 'N'; case exnref: - return 'e'; + return 'E'; case none: return 'v'; case unreachable: @@ -109,9 +114,13 @@ Type sigToType(char sig) { return f64; case 'V': return v128; - case 'a': + case 'F': + return funcref; + case 'A': return anyref; - case 'e': + case 'N': + return nullref; + case 'E': return exnref; case 'v': return none; diff --git a/src/binaryen-c.cpp b/src/binaryen-c.cpp index 23472634f26..69f604a8bcf 100644 --- a/src/binaryen-c.cpp +++ b/src/binaryen-c.cpp @@ -46,9 +46,6 @@ using namespace wasm; // Literal utilities -static_assert(sizeof(BinaryenLiteral) == sizeof(Literal), - "Binaryen C API literal must match wasm.h"); - BinaryenLiteral toBinaryenLiteral(Literal x) { BinaryenLiteral ret; ret.type = x.type; @@ -69,11 +66,7 @@ BinaryenLiteral toBinaryenLiteral(Literal x) { memcpy(&ret.v128, x.getv128Ptr(), 16); break; } - - case Type::anyref: // there's no anyref literals - case Type::exnref: // there's no exnref literals - case Type::none: - case Type::unreachable: + default: WASM_UNREACHABLE(); } return ret; @@ -91,10 +84,7 @@ Literal fromBinaryenLiteral(BinaryenLiteral x) { return Literal(x.i64).castToF64(); case Type::v128: return Literal(x.v128); - case Type::anyref: // there's no anyref literals - case Type::exnref: // there's no exnref literals - case Type::none: - case Type::unreachable: + default: WASM_UNREACHABLE(); } WASM_UNREACHABLE(); @@ -212,10 +202,7 @@ void printArg(std::ostream& setup, std::ostream& out, BinaryenLiteral arg) { out << "BinaryenLiteralVec128(" << array << ")"; break; } - case Type::anyref: // there's no anyref literals - case Type::exnref: // there's no exnref literals - case Type::none: - case Type::unreachable: + default: WASM_UNREACHABLE(); } } @@ -268,7 +255,9 @@ BinaryenType BinaryenTypeInt64(void) { return i64; } BinaryenType BinaryenTypeFloat32(void) { return f32; } BinaryenType BinaryenTypeFloat64(void) { return f64; } BinaryenType BinaryenTypeVec128(void) { return v128; } +BinaryenType BinaryenTypeFuncref(void) { return funcref; } BinaryenType BinaryenTypeAnyref(void) { return anyref; } +BinaryenType BinaryenTypeNullref(void) { return nullref; } BinaryenType BinaryenTypeExnref(void) { return exnref; } BinaryenType BinaryenTypeUnreachable(void) { return unreachable; } BinaryenType BinaryenTypeAuto(void) { return uint32_t(-1); } @@ -400,6 +389,15 @@ BinaryenExpressionId BinaryenMemoryCopyId(void) { BinaryenExpressionId BinaryenMemoryFillId(void) { return Expression::Id::MemoryFillId; } +BinaryenExpressionId BinaryenRefNullId(void) { + return Expression::Id::RefNullId; +} +BinaryenExpressionId BinaryenRefIsNullId(void) { + return Expression::Id::RefIsNullId; +} +BinaryenExpressionId BinaryenRefFuncId(void) { + return Expression::Id::RefFuncId; +} BinaryenExpressionId BinaryenTryId(void) { return Expression::Id::TryId; } BinaryenExpressionId BinaryenThrowId(void) { return Expression::Id::ThrowId; } BinaryenExpressionId BinaryenRethrowId(void) { @@ -1391,17 +1389,22 @@ BinaryenExpressionRef BinaryenBinary(BinaryenModuleRef module, BinaryenExpressionRef BinaryenSelect(BinaryenModuleRef module, BinaryenExpressionRef condition, BinaryenExpressionRef ifTrue, - BinaryenExpressionRef ifFalse) { + BinaryenExpressionRef ifFalse, + BinaryenType type) { auto* ret = ((Module*)module)->allocator.alloc()) { + sub->finalize(); + } + // restore the original type ir the new type is nullref, because + // block/loop/ir/try/select cannot have nullref type. + if (curr->type == nullref && isLeftSubTypeOfRight(curr->type, old)) { + curr->type = old; + } +} + namespace { // Handles a branch fixup for visitBlock: if the branch goes to the @@ -48,6 +68,14 @@ void ReFinalize::visitBlock(Block* curr) { // do this quickly, without any validation // last element determines type curr->type = curr->list.back()->type; + + // we may have just made the return type lower in the type lattice, for + // example, anyref to other reference types or funcref/exnref to nullref. we + // restore the original type in that case. + if (curr->type != old && isLeftSubTypeOfRight(curr->type, old)) { + curr->type = old; + } + // if concrete, it doesn't matter if we have an unreachable child, and we // don't need to look at breaks if (curr->type.isConcrete()) { @@ -90,9 +118,15 @@ void ReFinalize::visitBlock(Block* curr) { auto type = iter->second; assert(type != unreachable); // we would have removed such branches curr->type = type; + // restore the original type ir the new type is nullref, because + // block/loop/ir/try cannot have nullref type. + if (curr->type == nullref && isLeftSubTypeOfRight(curr->type, old)) { + curr->type = old; + } return; } } + if (curr->type == unreachable) { return; } @@ -106,8 +140,8 @@ void ReFinalize::visitBlock(Block* curr) { } } } -void ReFinalize::visitIf(If* curr) { curr->finalize(); } -void ReFinalize::visitLoop(Loop* curr) { curr->finalize(); } +void ReFinalize::visitIf(If* curr) { refinalizeAndAvoidNullref(curr); } +void ReFinalize::visitLoop(Loop* curr) { refinalizeAndAvoidNullref(curr); } void ReFinalize::visitBreak(Break* curr) { curr->finalize(); auto valueType = getValueType(curr->value); @@ -155,11 +189,14 @@ void ReFinalize::visitMemoryFill(MemoryFill* curr) { curr->finalize(); } void ReFinalize::visitConst(Const* curr) { curr->finalize(); } void ReFinalize::visitUnary(Unary* curr) { curr->finalize(); } void ReFinalize::visitBinary(Binary* curr) { curr->finalize(); } -void ReFinalize::visitSelect(Select* curr) { curr->finalize(); } +void ReFinalize::visitSelect(Select* curr) { refinalizeAndAvoidNullref(curr); } void ReFinalize::visitDrop(Drop* curr) { curr->finalize(); } void ReFinalize::visitReturn(Return* curr) { curr->finalize(); } void ReFinalize::visitHost(Host* curr) { curr->finalize(); } -void ReFinalize::visitTry(Try* curr) { curr->finalize(); } +void ReFinalize::visitRefNull(RefNull* curr) { curr->finalize(); } +void ReFinalize::visitRefIsNull(RefIsNull* curr) { curr->finalize(); } +void ReFinalize::visitRefFunc(RefFunc* curr) { curr->finalize(); } +void ReFinalize::visitTry(Try* curr) { refinalizeAndAvoidNullref(curr); } void ReFinalize::visitThrow(Throw* curr) { curr->finalize(); } void ReFinalize::visitRethrow(Rethrow* curr) { curr->finalize(); } void ReFinalize::visitBrOnExn(BrOnExn* curr) { @@ -189,8 +226,12 @@ void ReFinalize::visitEvent(Event* curr) { WASM_UNREACHABLE(); } void ReFinalize::visitModule(Module* curr) { WASM_UNREACHABLE(); } void ReFinalize::updateBreakValueType(Name name, Type type) { - if (type != unreachable || breakValues.count(name) == 0) { - breakValues[name] = type; + if (type != unreachable) { + if (breakValues.count(name) == 0) { + breakValues[name] = type; + } else { + breakValues[name] = getLeastCommonSuperType(breakValues[name], type); + } } } diff --git a/src/ir/abstract.h b/src/ir/abstract.h index 2653218b03f..b3745a6937e 100644 --- a/src/ir/abstract.h +++ b/src/ir/abstract.h @@ -81,8 +81,11 @@ inline UnaryOp getUnary(Type type, Op op) { assert(false && "v128 not implemented yet"); WASM_UNREACHABLE(); } - case anyref: // there's no unary instructions for anyref - case exnref: // there's no unary instructions for exnref + // there's no unary instructions for reference types + case funcref: + case anyref: + case nullref: + case exnref: case none: case unreachable: { return InvalidUnary; @@ -213,12 +216,7 @@ inline BinaryOp getBinary(Type type, Op op) { assert(false && "v128 not implemented yet"); WASM_UNREACHABLE(); } - case anyref: // there's no binary instructions for anyref - case exnref: // there's no binary instructions for exnref - case none: - case unreachable: { - return InvalidBinary; - } + default: { return InvalidBinary; } } WASM_UNREACHABLE(); } diff --git a/src/ir/effects.h b/src/ir/effects.h index e93c6301778..6eb2da91d61 100644 --- a/src/ir/effects.h +++ b/src/ir/effects.h @@ -387,6 +387,9 @@ struct EffectAnalyzer // Atomics are also sequentially consistent with memory.grow. isAtomic = true; } + void visitRefNull(RefNull* curr) {} + void visitRefIsNull(RefIsNull* curr) {} + void visitRefFunc(RefFunc* curr) {} void visitTry(Try* curr) {} // We safely model throws as branches void visitThrow(Throw* curr) { branches = true; } diff --git a/src/ir/flat.h b/src/ir/flat.h index dd72e339d06..3da4114c82d 100644 --- a/src/ir/flat.h +++ b/src/ir/flat.h @@ -79,7 +79,7 @@ inline void verifyFlatness(Function* func) { verify(!curr->type.isConcrete(), "tees are not allowed, only sets"); } else { for (auto* child : ChildIterator(curr)) { - verify(child->is() || child->is() || + verify(child->isConstExpression() || child->is() || child->is(), "instructions must only have const, local.get, or unreachable " "as children"); diff --git a/src/ir/literal-utils.h b/src/ir/literal-utils.h index 63a2b3b4415..4bc79eee954 100644 --- a/src/ir/literal-utils.h +++ b/src/ir/literal-utils.h @@ -39,6 +39,10 @@ inline Expression* makeZero(Type type, Module& wasm) { return builder.makeUnary(SplatVecI32x4, builder.makeConst(Literal(int32_t(0)))); } + if (type.isRef()) { + Builder builder(wasm); + return builder.makeRefNull(); + } return makeFromInt32(0, type, wasm); } diff --git a/src/ir/manipulation.h b/src/ir/manipulation.h index ec137d37270..dc8138d62a4 100644 --- a/src/ir/manipulation.h +++ b/src/ir/manipulation.h @@ -35,12 +35,22 @@ inline OutputType* convert(InputType* input) { // Convenience method for nop, which is a common conversion template inline Nop* nop(InputType* target) { - return convert(target); + auto* ret = convert(target); + ret->finalize(); + return ret; +} + +template inline RefNull* refNull(InputType* target) { + auto* ret = convert(target); + ret->finalize(); + return ret; } template inline Unreachable* unreachable(InputType* target) { - return convert(target); + auto* ret = convert(target); + ret->finalize(); + return ret; } // Convert a node that allocates diff --git a/src/ir/utils.h b/src/ir/utils.h index e8c5b78b31f..1273ec189ac 100644 --- a/src/ir/utils.h +++ b/src/ir/utils.h @@ -81,6 +81,8 @@ struct ExpressionAnalyzer { static HashType hash(Expression* curr); }; +void refinalizeAndAvoidNullref(Expression* curr); + // Re-Finalizes all node types. This can be run after code was modified in // various ways that require propagating types around, and it does such an // "incremental" update. This is done under the assumption that there is @@ -146,6 +148,9 @@ struct ReFinalize void visitDrop(Drop* curr); void visitReturn(Return* curr); void visitHost(Host* curr); + void visitRefNull(RefNull* curr); + void visitRefIsNull(RefIsNull* curr); + void visitRefFunc(RefFunc* curr); void visitTry(Try* curr); void visitThrow(Throw* curr); void visitRethrow(Rethrow* curr); @@ -176,9 +181,9 @@ struct ReFinalize // Re-finalize a single node. This is slow, if you want to refinalize // an entire ast, use ReFinalize struct ReFinalizeNode : public OverriddenVisitor { - void visitBlock(Block* curr) { curr->finalize(); } - void visitIf(If* curr) { curr->finalize(); } - void visitLoop(Loop* curr) { curr->finalize(); } + void visitBlock(Block* curr) { refinalizeAndAvoidNullref(curr); } + void visitIf(If* curr) { refinalizeAndAvoidNullref(curr); } + void visitLoop(Loop* curr) { refinalizeAndAvoidNullref(curr); } void visitBreak(Break* curr) { curr->finalize(); } void visitSwitch(Switch* curr) { curr->finalize(); } void visitCall(Call* curr) { curr->finalize(); } @@ -207,11 +212,14 @@ struct ReFinalizeNode : public OverriddenVisitor { void visitConst(Const* curr) { curr->finalize(); } void visitUnary(Unary* curr) { curr->finalize(); } void visitBinary(Binary* curr) { curr->finalize(); } - void visitSelect(Select* curr) { curr->finalize(); } + void visitSelect(Select* curr) { refinalizeAndAvoidNullref(curr); } void visitDrop(Drop* curr) { curr->finalize(); } void visitReturn(Return* curr) { curr->finalize(); } void visitHost(Host* curr) { curr->finalize(); } - void visitTry(Try* curr) { curr->finalize(); } + void visitRefNull(RefNull* curr) { curr->finalize(); } + void visitRefIsNull(RefIsNull* curr) { curr->finalize(); } + void visitRefFunc(RefFunc* curr) { curr->finalize(); } + void visitTry(Try* curr) { refinalizeAndAvoidNullref(curr); } void visitThrow(Throw* curr) { curr->finalize(); } void visitRethrow(Rethrow* curr) { curr->finalize(); } void visitBrOnExn(BrOnExn* curr) { curr->finalize(); } diff --git a/src/js/binaryen.js-post.js b/src/js/binaryen.js-post.js index d5943176e0a..a83ecbccea9 100644 --- a/src/js/binaryen.js-post.js +++ b/src/js/binaryen.js-post.js @@ -37,7 +37,9 @@ Module['i64'] = Module['_BinaryenTypeInt64'](); Module['f32'] = Module['_BinaryenTypeFloat32'](); Module['f64'] = Module['_BinaryenTypeFloat64'](); Module['v128'] = Module['_BinaryenTypeVec128'](); +Module['funcref'] = Module['_BinaryenTypeFuncref'](); Module['anyref'] = Module['_BinaryenTypeAnyref'](); +Module['nullref'] = Module['_BinaryenTypeNullref'](); Module['exnref'] = Module['_BinaryenTypeExnref'](); Module['unreachable'] = Module['_BinaryenTypeUnreachable'](); Module['auto'] = /* deprecated */ Module['undefined'] = Module['_BinaryenTypeAuto'](); @@ -101,6 +103,9 @@ Module['MemoryInitId'] = Module['_BinaryenMemoryInitId'](); Module['DataDropId'] = Module['_BinaryenDataDropId'](); Module['MemoryCopyId'] = Module['_BinaryenMemoryCopyId'](); Module['MemoryFillId'] = Module['_BinaryenMemoryFillId'](); +Module['RefNullId'] = Module['_BinaryenRefNullId'](); +Module['RefIsNullId'] = Module['_BinaryenRefIsNullId'](); +Module['RefFuncId'] = Module['_BinaryenRefFuncId'](); Module['TryId'] = Module['_BinaryenTryId'](); Module['ThrowId'] = Module['_BinaryenThrowId'](); Module['RethrowId'] = Module['_BinaryenRethrowId'](); @@ -1944,20 +1949,47 @@ function wrapModule(module, self) { }, }; + self['funcref'] = { + 'pop': function() { + return Module['_BinaryenPop'](module, Module['funcref']); + } + }; + self['anyref'] = { 'pop': function() { return Module['_BinaryenPop'](module, Module['anyref']); } }; + self['nullref'] = { + 'pop': function() { + return Module['_BinaryenPop'](module, Module['nullref']); + } + }; + self['exnref'] = { 'pop': function() { return Module['_BinaryenPop'](module, Module['exnref']); } }; - self['select'] = function(condition, ifTrue, ifFalse) { - return Module['_BinaryenSelect'](module, condition, ifTrue, ifFalse); + self['ref'] = { + 'null': function() { + return Module['_BinaryenRefNull'](module); + }, + 'is_null': function(anyref) { + return Module['_BinaryenRefIsNull'](module, anyref); + }, + 'func': function(func) { + return preserveStack(function() { + return Module['_BinaryenRefFunc'](module, strToStack(func)); + }); + } + }; + + self['select'] = function(condition, ifTrue, ifFalse, type) { + return Module['_BinaryenSelect']( + module, condition, ifTrue, ifFalse, typeof type !== 'undefined' ? type : Module['auto']); }; self['drop'] = function(value) { return Module['_BinaryenDrop'](module, value); @@ -2659,6 +2691,23 @@ Module['getExpressionInfo'] = function(expr) { 'value': Module['_BinaryenMemoryFillGetValue'](expr), 'size': Module['_BinaryenMemoryFillGetSize'](expr) }; + case Module['RefNullId']: + return { + 'id': id, + 'type': type + }; + case Module['RefIsNullId']: + return { + 'id': id, + 'type': type, + 'anyref': Module['_BinaryenRefIsNullGetAnyref'](expr) + }; + case Module['RefFuncId']: + return { + 'id': id, + 'type': type, + 'func': UTF8ToString(Module['_BinaryenRefFuncGetFunc'](expr)), + }; case Module['TryId']: return { 'id': id, diff --git a/src/literal.h b/src/literal.h index 1106d1c2777..8c51d4acea0 100644 --- a/src/literal.h +++ b/src/literal.h @@ -22,6 +22,7 @@ #include "compiler-support.h" #include "support/hash.h" +#include "support/name.h" #include "support/utilities.h" #include "wasm-type.h" @@ -39,6 +40,15 @@ class Literal { public: Type type; + // These flags are true if the value this Literal contains is a value that is + // nullref or funcref type. This may not be the same as 'type' field, which + // can be a supertype. + // We set isNullref to true so every reference type literal is initialized + // with nullref by default + bool isNullref = true; + bool isFuncref = false; + Name func = ""; // function name when the value is funcref type + public: Literal() : v128(), type(Type::none) {} explicit Literal(Type type) : v128(), type(type) {} @@ -57,11 +67,13 @@ class Literal { explicit Literal(const std::array&); explicit Literal(const std::array&); explicit Literal(const std::array&); + explicit Literal(Name func) + : type(Type::funcref), isNullref(false), isFuncref(true), func(func) {} bool isConcrete() { return type != none; } - bool isNull() { return type == none; } + bool isNone() { return type == none; } - inline static Literal makeFromInt32(int32_t x, Type type) { + static Literal makeFromInt32(int32_t x, Type type) { switch (type) { case Type::i32: return Literal(int32_t(x)); @@ -80,16 +92,26 @@ class Literal { Literal(int32_t(0)), Literal(int32_t(0)), Literal(int32_t(0))}}); - case Type::anyref: // there's no anyref literals - case Type::exnref: // there's no exnref literals - case none: - case unreachable: + default: WASM_UNREACHABLE(); } WASM_UNREACHABLE(); } - inline static Literal makeZero(Type type) { return makeFromInt32(0, type); } + static Literal makeZero(Type type) { + if (type.isRef()) { + return makeNullref(type); + } + return makeFromInt32(0, type); + } + + static Literal makeNullref(Type type) { + assert(type.isRef() && + "Cannot create nullref with a non-reference type"); + return Literal(type); + } + + static Literal makeFuncref(Name func) { return Literal(func); } Literal castToF32(); Literal castToF64(); @@ -461,10 +483,7 @@ template<> struct less { return a.reinterpreti64() < b.reinterpreti64(); case wasm::Type::v128: return memcmp(a.getv128Ptr(), b.getv128Ptr(), 16) < 0; - case wasm::Type::anyref: // anyref is an opaque value - case wasm::Type::exnref: // exnref is an opaque value - case wasm::Type::none: - case wasm::Type::unreachable: + default: return false; } WASM_UNREACHABLE(); diff --git a/src/parsing.h b/src/parsing.h index 2591c4357df..ff1a2cdb766 100644 --- a/src/parsing.h +++ b/src/parsing.h @@ -263,8 +263,10 @@ parseConst(cashew::IString s, Type type, MixedArena& allocator) { break; } case v128: - case anyref: // there's no anyref.const - case exnref: // there's no exnref.const + case funcref: + case anyref: + case nullref: + case exnref: WASM_UNREACHABLE(); case none: case unreachable: { diff --git a/src/passes/ConstHoisting.cpp b/src/passes/ConstHoisting.cpp index 08fede1df39..99610230b8d 100644 --- a/src/passes/ConstHoisting.cpp +++ b/src/passes/ConstHoisting.cpp @@ -91,9 +91,12 @@ struct ConstHoisting : public WalkerPass> { size = getTypeSize(value.type); break; } - case v128: // v128 not implemented yet - case anyref: // anyref cannot have literals - case exnref: { // exnref cannot have literals + case v128: // v128 not implemented yet + // reference types cannot have literals + case funcref: + case anyref: + case nullref: + case exnref: { return false; } case none: diff --git a/src/passes/DeadCodeElimination.cpp b/src/passes/DeadCodeElimination.cpp index 058d9e4e442..7bb65a55713 100644 --- a/src/passes/DeadCodeElimination.cpp +++ b/src/passes/DeadCodeElimination.cpp @@ -347,6 +347,12 @@ struct DeadCodeElimination DELEGATE(Push); case Expression::Id::PopId: DELEGATE(Pop); + case Expression::Id::RefNullId: + DELEGATE(RefNull); + case Expression::Id::RefIsNullId: + DELEGATE(RefIsNull); + case Expression::Id::RefFuncId: + DELEGATE(RefFunc); case Expression::Id::TryId: DELEGATE(Try); case Expression::Id::ThrowId: diff --git a/src/passes/Flatten.cpp b/src/passes/Flatten.cpp index ee7a93b7216..8128c90ceb7 100644 --- a/src/passes/Flatten.cpp +++ b/src/passes/Flatten.cpp @@ -182,6 +182,7 @@ struct Flatten auto type = br->value->type; if (type.isConcrete()) { // we are sending a value. use a local instead + // TODO(aheejin) Add nullref handling Index temp = getTempForBreakTarget(br->name, type); ourPreludes.push_back(builder.makeLocalSet(temp, br->value)); if (br->condition) { @@ -231,7 +232,7 @@ struct Flatten // we have changed children ReFinalizeNode().visit(curr); // move everything to the prelude, if we need to: anything but constants - if (!curr->is()) { + if (!curr->isConstExpression()) { if (curr->type == unreachable) { ourPreludes.push_back(curr); replaceCurrent(builder.makeUnreachable()); diff --git a/src/passes/FuncCastEmulation.cpp b/src/passes/FuncCastEmulation.cpp index f938da3b7a2..465dc77df38 100644 --- a/src/passes/FuncCastEmulation.cpp +++ b/src/passes/FuncCastEmulation.cpp @@ -66,12 +66,11 @@ static Expression* toABI(Expression* value, Module* module) { assert(false && "v128 not implemented yet"); WASM_UNREACHABLE(); } - case anyref: { - assert(false && "anyref cannot be converted to i64"); - WASM_UNREACHABLE(); - } + case funcref: + case anyref: + case nullref: case exnref: { - assert(false && "exnref cannot be converted to i64"); + assert(false && "reference types cannot be converted to i64"); WASM_UNREACHABLE(); } case none: { @@ -112,12 +111,11 @@ static Expression* fromABI(Expression* value, Type type, Module* module) { assert(false && "v128 not implemented yet"); WASM_UNREACHABLE(); } - case anyref: { - assert(false && "anyref cannot be converted from i64"); - WASM_UNREACHABLE(); - } + case funcref: + case anyref: + case nullref: case exnref: { - assert(false && "exnref cannot be converted from i64"); + assert(false && "reference types cannot be converted from i64"); WASM_UNREACHABLE(); } case none: { diff --git a/src/passes/InstrumentLocals.cpp b/src/passes/InstrumentLocals.cpp index 6e12b0f3a9f..fbd20cfe438 100644 --- a/src/passes/InstrumentLocals.cpp +++ b/src/passes/InstrumentLocals.cpp @@ -57,6 +57,7 @@ Name get_i32("get_i32"); Name get_i64("get_i64"); Name get_f32("get_f32"); Name get_f64("get_f64"); +Name get_funcref("get_funcref"); Name get_anyref("get_anyref"); Name get_exnref("get_exnref"); @@ -64,6 +65,7 @@ Name set_i32("set_i32"); Name set_i64("set_i64"); Name set_f32("set_f32"); Name set_f64("set_f64"); +Name set_funcref("set_funcref"); Name set_anyref("set_anyref"); Name set_exnref("set_exnref"); @@ -85,14 +87,17 @@ struct InstrumentLocals : public WalkerPass> { break; case v128: assert(false && "v128 not implemented yet"); + case funcref: + import = get_funcref; + break; case anyref: import = get_anyref; break; case exnref: import = get_exnref; break; + case nullref: // nullref is not representable in binary format case none: - WASM_UNREACHABLE(); case unreachable: WASM_UNREACHABLE(); } @@ -128,6 +133,9 @@ struct InstrumentLocals : public WalkerPass> { break; case v128: assert(false && "v128 not implemented yet"); + case funcref: + import = set_funcref; + break; case anyref: import = set_anyref; break; @@ -136,6 +144,7 @@ struct InstrumentLocals : public WalkerPass> { break; case unreachable: return; // nothing to do here + case nullref: // nullref is not representable in binary format case none: WASM_UNREACHABLE(); } @@ -158,12 +167,14 @@ struct InstrumentLocals : public WalkerPass> { addImport(curr, set_f64, "diid"); if (curr->features.hasReferenceTypes()) { - addImport(curr, get_anyref, "aiia"); - addImport(curr, set_anyref, "aiia"); + addImport(curr, get_funcref, "FiiF"); + addImport(curr, set_funcref, "FiiF"); + addImport(curr, get_anyref, "AiiA"); + addImport(curr, set_anyref, "AiiA"); } if (curr->features.hasExceptionHandling()) { - addImport(curr, get_exnref, "eiie"); - addImport(curr, set_exnref, "eiie"); + addImport(curr, get_exnref, "EiiE"); + addImport(curr, set_exnref, "EiiE"); } } diff --git a/src/passes/Precompute.cpp b/src/passes/Precompute.cpp index 57a3ab27fd2..730ef294b4a 100644 --- a/src/passes/Precompute.cpp +++ b/src/passes/Precompute.cpp @@ -131,6 +131,7 @@ class PrecomputingExpressionRunner Flow visitMemoryCopy(MemoryCopy* curr) { return Flow(NOTPRECOMPUTABLE_FLOW); } Flow visitMemoryFill(MemoryFill* curr) { return Flow(NOTPRECOMPUTABLE_FLOW); } Flow visitHost(Host* curr) { return Flow(NOTPRECOMPUTABLE_FLOW); } + // TODO implement exception handling Flow visitTry(Try* curr) { return Flow(NOTPRECOMPUTABLE_FLOW); } Flow visitThrow(Throw* curr) { return Flow(NOTPRECOMPUTABLE_FLOW); } Flow visitRethrow(Rethrow* curr) { return Flow(NOTPRECOMPUTABLE_FLOW); } @@ -208,14 +209,15 @@ struct Precompute return; } } - ret->value = Builder(*getModule()).makeConst(flow.value); + ret->value = Builder(*getModule()).makeConstExpression(flow.value); } else { ret->value = nullptr; } } else { Builder builder(*getModule()); replaceCurrent(builder.makeReturn( - flow.value.type != none ? builder.makeConst(flow.value) : nullptr)); + flow.value.type != none ? builder.makeConstExpression(flow.value) + : nullptr)); } return; } @@ -234,7 +236,7 @@ struct Precompute return; } } - br->value = Builder(*getModule()).makeConst(flow.value); + br->value = Builder(*getModule()).makeConstExpression(flow.value); } else { br->value = nullptr; } @@ -243,13 +245,14 @@ struct Precompute Builder builder(*getModule()); replaceCurrent(builder.makeBreak( flow.breakTo, - flow.value.type != none ? builder.makeConst(flow.value) : nullptr)); + flow.value.type != none ? builder.makeConstExpression(flow.value) + : nullptr)); } return; } // this was precomputed if (flow.value.type.isConcrete()) { - replaceCurrent(Builder(*getModule()).makeConst(flow.value)); + replaceCurrent(Builder(*getModule()).makeConstExpression(flow.value)); worked = true; } else { ExpressionManipulator::nop(curr); @@ -350,7 +353,7 @@ struct Precompute } else { curr = setValues[set]; } - if (curr.isNull()) { + if (curr.isNone()) { // not a constant, give up value = Literal(); break; diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index e35d9b57e8a..7257af26175 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -1291,7 +1291,12 @@ struct PrintExpressionContents } restoreNormalColor(o); } - void visitSelect(Select* curr) { prepareColor(o) << "select"; } + void visitSelect(Select* curr) { + prepareColor(o) << "select"; + if (curr->type.isRef()) { + o << " (result " << curr->type << ')'; + } + } void visitDrop(Drop* curr) { printMedium(o, "drop"); } void visitReturn(Return* curr) { printMedium(o, "return"); } void visitHost(Host* curr) { @@ -1304,6 +1309,12 @@ struct PrintExpressionContents break; } } + void visitRefNull(RefNull* curr) { printMedium(o, "ref.null"); } + void visitRefIsNull(RefIsNull* curr) { printMedium(o, "ref.is_null"); } + void visitRefFunc(RefFunc* curr) { + printMedium(o, "ref.func "); + printName(curr->func, o); + } void visitTry(Try* curr) { printMedium(o, "try"); if (curr->type.isConcrete()) { @@ -1794,6 +1805,23 @@ struct PrintSExpression : public OverriddenVisitor { } } } + void visitRefNull(RefNull* curr) { + o << '('; + PrintExpressionContents(currFunction, o).visit(curr); + o << ')'; + } + void visitRefIsNull(RefIsNull* curr) { + o << '('; + PrintExpressionContents(currFunction, o).visit(curr); + incIndent(); + printFullLine(curr->anyref); + decIndent(); + } + void visitRefFunc(RefFunc* curr) { + o << '('; + PrintExpressionContents(currFunction, o).visit(curr); + o << ')'; + } // try-catch-end is written in the folded wast format as // (try // ... diff --git a/src/passes/RemoveUnusedBrs.cpp b/src/passes/RemoveUnusedBrs.cpp index d8668196d24..a02303c3151 100644 --- a/src/passes/RemoveUnusedBrs.cpp +++ b/src/passes/RemoveUnusedBrs.cpp @@ -623,8 +623,10 @@ struct RemoveUnusedBrs : public WalkerPass> { // return => nop ExpressionManipulator::nop(flow); anotherCycle = true; - } else { + } else if (flow->value->type != nullref) { // return with value => value + // if the value type is nullref, this can make the enclosing block's + // type nullref, so skip in that case *flows[i] = flow->value; anotherCycle = true; } diff --git a/src/passes/RemoveUnusedModuleElements.cpp b/src/passes/RemoveUnusedModuleElements.cpp index 20ce284f7cc..f38951efdee 100644 --- a/src/passes/RemoveUnusedModuleElements.cpp +++ b/src/passes/RemoveUnusedModuleElements.cpp @@ -116,6 +116,12 @@ struct ReachabilityAnalyzer : public PostWalker { usesMemory = true; } } + void visitRefFunc(RefFunc* curr) { + if (reachable.count( + ModuleElement(ModuleElementKind::Function, curr->func)) == 0) { + queue.emplace_back(ModuleElementKind::Function, curr->func); + } + } void visitThrow(Throw* curr) { if (reachable.count(ModuleElement(ModuleElementKind::Event, curr->event)) == 0) { diff --git a/src/passes/SimplifyGlobals.cpp b/src/passes/SimplifyGlobals.cpp index 88f27f8bef8..305aebfbcd2 100644 --- a/src/passes/SimplifyGlobals.cpp +++ b/src/passes/SimplifyGlobals.cpp @@ -125,7 +125,7 @@ struct ConstantGlobalApplier auto iter = currConstantGlobals.find(get->name); if (iter != currConstantGlobals.end()) { Builder builder(*getModule()); - replaceCurrent(builder.makeConst(iter->second)); + replaceCurrent(builder.makeConstExpression(iter->second)); replaced = true; } return; @@ -255,7 +255,7 @@ struct SimplifyGlobals : public Pass { auto iter = constantGlobals.find(get->name); if (iter != constantGlobals.end()) { Builder builder(*module); - global->init = builder.makeConst(iter->second); + global->init = builder.makeConstExpression(iter->second); } } } diff --git a/src/shell-interface.h b/src/shell-interface.h index e73ce4c48a2..5c49ff860b3 100644 --- a/src/shell-interface.h +++ b/src/shell-interface.h @@ -114,10 +114,12 @@ struct ShellExternalInterface : ModuleInstance::ExternalInterface { break; case v128: assert(false && "v128 not implemented yet"); + case funcref: case anyref: - assert(false && "anyref not implemented yet"); case exnref: - assert(false && "exnref not implemented yet"); + globals[import->name] = Literal::makeNullref(import->type); + break; + case nullref: // there cannot be nullref globals case none: case unreachable: WASM_UNREACHABLE(); diff --git a/src/support/name.h b/src/support/name.h index b6242aabcb3..9e8a484cae8 100644 --- a/src/support/name.h +++ b/src/support/name.h @@ -17,7 +17,7 @@ #ifndef wasm_support_name_h #define wasm_support_name_h -#include +#include #include "emscripten-optimizer/istring.h" diff --git a/src/support/small_vector.h b/src/support/small_vector.h index 7f00bd4a6f2..d4ad961a71f 100644 --- a/src/support/small_vector.h +++ b/src/support/small_vector.h @@ -38,17 +38,15 @@ template class SmallVector { std::vector flexible; public: + using value_type = T; + SmallVector() {} T& operator[](size_t i) { - if (i < N) { - return fixed[i]; - } else { - return flexible[i - N]; - } + return const_cast(static_cast&>(*this)[i]); } - T operator[](size_t i) const { + const T& operator[](size_t i) const { if (i < N) { return fixed[i]; } else { diff --git a/src/tools/fuzzing.h b/src/tools/fuzzing.h index 571dad79ee5..71552228363 100644 --- a/src/tools/fuzzing.h +++ b/src/tools/fuzzing.h @@ -25,8 +25,7 @@ high chance for set at start of loop high chance of a tee in that case => loop var */ -// TODO Complete exnref type support. Its support is partialy implemented -// and the type is currently not generated in fuzzed programs yet. +// TODO Generate exception handling instructions #include "ir/memory-utils.h" #include @@ -311,6 +310,24 @@ class TranslateToFuzzReader { double getDouble() { return Literal(get64()).reinterpretf64(); } + SmallVector getSubTypes(Type type) { + SmallVector ret; + ret.push_back(type); // includes itself + switch (type) { + case anyref: + ret.push_back(funcref); + ret.push_back(exnref); + // falls through + case funcref: + case exnref: + ret.push_back(nullref); + break; + default: + break; + } + return ret; + } + void setupMemory() { // Add memory itself MemoryUtils::ensureExists(wasm.memory); @@ -406,10 +423,12 @@ class TranslateToFuzzReader { Index num = upTo(3); for (size_t i = 0; i < num; i++) { // Events should have void return type and at least one param type + Type type = getConcreteType(); std::vector params; + params.push_back(type); Index numValues = upToSquared(MAX_PARAMS - 1); for (Index i = 0; i < numValues + 1; i++) { - params.push_back(pick(i32, i64, f32, f64)); + params.push_back(getConcreteType()); } auto* event = builder.makeEvent(std::string("event$") + std::to_string(i), WASM_EVENT_ATTRIBUTE_EXCEPTION, @@ -506,7 +525,7 @@ class TranslateToFuzzReader { // function generation state - Function* func; + Function* func = nullptr; std::vector breakableStack; // things we can break to Index labelIndex; @@ -589,10 +608,12 @@ class TranslateToFuzzReader { // loop limit FindAll loops(func->body); for (auto* loop : loops.list) { - loop->body = builder.makeSequence(makeHangLimitCheck(), loop->body); + loop->body = + builder.makeSequence(makeHangLimitCheck(), loop->body, loop->type); } // recursion limit - func->body = builder.makeSequence(makeHangLimitCheck(), func->body); + func->body = + builder.makeSequence(makeHangLimitCheck(), func->body, func->result); } void recombine(Function* func) { @@ -845,8 +866,10 @@ class TranslateToFuzzReader { case f32: case f64: case v128: + case funcref: case anyref: case exnref: + case nullref: ret = _makeConcrete(type); break; case none: @@ -856,7 +879,8 @@ class TranslateToFuzzReader { ret = _makeunreachable(); break; } - assert(ret->type == type); // we should create the right type of thing + // we should create the right type of thing + assert(isLeftSubTypeOfRight(ret->type, type)); nesting--; return ret; } @@ -905,6 +929,9 @@ class TranslateToFuzzReader { if (type == i32 || type == i64) { options.add(FeatureSet::Atomics, &Self::makeAtomic); } + if (type == i32) { + options.add(FeatureSet::ReferenceTypes, &Self::makeRefIsNull); + } return (this->*pick(options))(type); } @@ -1010,6 +1037,10 @@ class TranslateToFuzzReader { // specific expression creators Expression* makeBlock(Type type) { + // blocks cannot have nullref type + if (type == nullref) { + return makeTrivial(type); + } auto* ret = builder.makeBlock(); ret->type = type; // so we have it during child creation ret->name = makeLabel(); @@ -1053,6 +1084,10 @@ class TranslateToFuzzReader { } Expression* makeLoop(Type type) { + // loops cannot have nullref type + if (type == nullref) { + return makeTrivial(type); + } auto* ret = wasm.allocator.alloc(); ret->type = type; // so we have it during child creation ret->name = makeLabel(); @@ -1068,11 +1103,11 @@ class TranslateToFuzzReader { // possible branch back list.push_back(builder.makeBreak(ret->name, nullptr, makeCondition())); list.push_back(make(type)); // final element, so we have the right type - ret->body = builder.makeBlock(list); + ret->body = builder.makeBlock(list, type); } breakableStack.pop_back(); hangStack.pop_back(); - ret->finalize(); + ret->finalize(type); return ret; } @@ -1097,15 +1132,19 @@ class TranslateToFuzzReader { } } - Expression* buildIf(const struct ThreeArgs& args) { - return builder.makeIf(args.a, args.b, args.c); + Expression* buildIf(const struct ThreeArgs& args, Type type) { + return builder.makeIf(args.a, args.b, args.c, type); } Expression* makeIf(Type type) { + // ifs cannot have nullref type + if (type == nullref) { + return makeTrivial(type); + } auto* condition = makeCondition(); hangStack.push_back(nullptr); auto* ret = - buildIf({condition, makeMaybeBlock(type), makeMaybeBlock(type)}); + buildIf({condition, makeMaybeBlock(type), makeMaybeBlock(type)}, type); hangStack.pop_back(); return ret; } @@ -1366,18 +1405,15 @@ class TranslateToFuzzReader { return builder.makeLoad( 16, false, offset, pick(1, 2, 4, 8, 16), ptr, type); } - case anyref: // anyref cannot be loaded from memory - case exnref: // exnref cannot be loaded from memory - case none: - case unreachable: + default: WASM_UNREACHABLE(); } WASM_UNREACHABLE(); } Expression* makeLoad(Type type) { - // exnref type cannot be stored in memory - if (!allowMemory || type == exnref) { + // reference types cannot be stored in memory + if (!allowMemory || type.isRef()) { return makeTrivial(type); } auto* ret = makeNonAtomicLoad(type); @@ -1399,7 +1435,7 @@ class TranslateToFuzzReader { Expression* makeNonAtomicStore(Type type) { if (type == unreachable) { // make a normal store, then make it unreachable - auto* ret = makeNonAtomicStore(getConcreteType()); + auto* ret = makeNonAtomicStore(getStorableType()); auto* store = ret->dynCast(); if (!store) { return ret; @@ -1422,7 +1458,7 @@ class TranslateToFuzzReader { // the type is none or unreachable. we also need to pick the value // type. if (type == none) { - type = getConcreteType(); + type = getStorableType(); } auto offset = logify(get()); auto ptr = makePointer(); @@ -1468,17 +1504,13 @@ class TranslateToFuzzReader { return builder.makeStore( 16, offset, pick(1, 2, 4, 8, 16), ptr, value, type); } - case anyref: // anyref cannot be stored in memory - case exnref: // exnref cannot be stored in memory - case none: - case unreachable: + default: WASM_UNREACHABLE(); } WASM_UNREACHABLE(); } Expression* makeStore(Type type) { - // exnref type cannot be stored in memory if (!allowMemory || type.isRef()) { return makeTrivial(type); } @@ -1563,11 +1595,7 @@ class TranslateToFuzzReader { return Literal(getFloat()); case f64: return Literal(getDouble()); - case v128: - case anyref: // anyref cannot have literals - case exnref: // exnref cannot have literals - case none: - case unreachable: + default: WASM_UNREACHABLE(); } break; @@ -1606,11 +1634,7 @@ class TranslateToFuzzReader { return Literal(float(small)); case f64: return Literal(double(small)); - case v128: - case anyref: // anyref cannot have literals - case exnref: // exnref cannot have literals - case none: - case unreachable: + default: WASM_UNREACHABLE(); } break; @@ -1672,11 +1696,7 @@ class TranslateToFuzzReader { std::numeric_limits::max(), std::numeric_limits::max())); break; - case v128: - case anyref: // anyref cannot have literals - case exnref: // exnref cannot have literals - case none: - case unreachable: + default: WASM_UNREACHABLE(); } // tweak around special values @@ -1704,11 +1724,7 @@ class TranslateToFuzzReader { case f64: value = Literal(double(int64_t(1) << upTo(64))); break; - case v128: - case anyref: // anyref cannot have literals - case exnref: // exnref cannot have literals - case none: - case unreachable: + default: WASM_UNREACHABLE(); } // maybe negative @@ -1730,21 +1746,23 @@ class TranslateToFuzzReader { } Expression* makeConst(Type type) { - switch (type) { - case anyref: - // There's no anyref.const. - // TODO We should return a nullref once we implement instructions for - // reference types proposal. - assert(false && "anyref const is not implemented yet"); - case exnref: - // There's no exnref.const. - // TODO We should return a nullref once we implement instructions for - // reference types proposal. - assert(false && "exnref const is not implemented yet"); - default: - break; + if (type.isRef()) { + assert(wasm.features.hasReferenceTypes()); + // Check if we can use ref.func. + // 'func' is the pointer to the last created function and can be null when + // we set up globals (before we create any functions), in which case we + // can't use ref.func. + if (type == funcref && func && oneIn(2)) { + // First set to target to the last created function, and try to select + // among other existing function if possible + Function* target = func; + if (!wasm.functions.empty() && !oneIn(wasm.functions.size())) { + target = pick(wasm.functions).get(); + } + return builder.makeRefFunc(target->name); + } + return builder.makeRefNull(); } - auto* ret = wasm.allocator.alloc(); ret->value = makeLiteral(type); ret->type = type; @@ -1763,9 +1781,9 @@ class TranslateToFuzzReader { // give up return makeTrivial(type); } - // There's no binary ops for exnref - if (type == exnref) { - makeTrivial(type); + // There's no unary ops for reference types + if (type.isRef()) { + return makeTrivial(type); } switch (type) { @@ -1813,10 +1831,12 @@ class TranslateToFuzzReader { AllTrueVecI64x2), make(v128)}); } - case anyref: // there's no unary ops for anyref - case exnref: // there's no unary ops for exnref - case none: - case unreachable: + case funcref: + case anyref: + case exnref: + // No unary ops taking a reference type + return makeTrivial(type); + default: WASM_UNREACHABLE(); } WASM_UNREACHABLE(); @@ -1953,10 +1973,7 @@ class TranslateToFuzzReader { } WASM_UNREACHABLE(); } - case anyref: // there's no unary ops for anyref - case exnref: // there's no unary ops for exnref - case none: - case unreachable: + default: WASM_UNREACHABLE(); } WASM_UNREACHABLE(); @@ -1975,9 +1992,9 @@ class TranslateToFuzzReader { // give up return makeTrivial(type); } - // There's no binary ops for exnref + // There's no binary ops for reference types if (type.isRef()) { - makeTrivial(type); + return makeTrivial(type); } switch (type) { @@ -2186,21 +2203,25 @@ class TranslateToFuzzReader { make(v128), make(v128)}); } - case anyref: // there's no binary ops for anyref - case exnref: // there's no binary ops for exnref - case none: - case unreachable: + default: WASM_UNREACHABLE(); } WASM_UNREACHABLE(); } - Expression* buildSelect(const ThreeArgs& args) { - return builder.makeSelect(args.a, args.b, args.c); + Expression* buildSelect(const ThreeArgs& args, Type type) { + return builder.makeSelect(args.a, args.b, args.c, type); } Expression* makeSelect(Type type) { - return makeDeNanOp(buildSelect({make(i32), make(type), make(type)})); + // we cannot determine the type of select when both arms are null + if (type == nullref) { + return makeTrivial(type); + } + // try to have a subtype for one arm + Type subType = pick(getSubTypes(type)); + return makeDeNanOp( + buildSelect({make(i32), make(type), make(subType)}, type)); } Expression* makeSwitch(Type type) { @@ -2344,6 +2365,9 @@ class TranslateToFuzzReader { Expression* makeSIMD(Type type) { assert(wasm.features.hasSIMD()); + if (type.isRef()) { + return makeTrivial(type); + } if (type != v128) { return makeSIMDExtract(type); } @@ -2385,11 +2409,7 @@ class TranslateToFuzzReader { case f64: op = ExtractLaneVecF64x2; break; - case v128: - case anyref: - case exnref: - case none: - case unreachable: + default: WASM_UNREACHABLE(); } Expression* vec = make(v128); @@ -2555,6 +2575,18 @@ class TranslateToFuzzReader { WASM_UNREACHABLE(); } + Expression* makeRefIsNull(Type type) { + assert(type == i32); + assert(wasm.features.hasReferenceTypes()); + Type refType; + if (wasm.features.hasExceptionHandling()) { + refType = pick(funcref, anyref, exnref); + } else { + refType = pick(funcref, anyref); + } + return builder.makeRefIsNull(make(refType)); + } + Expression* makeMemoryInit() { if (!allowMemory) { return makeTrivial(none); @@ -2611,20 +2643,36 @@ class TranslateToFuzzReader { // special getters - Type getReachableType() { - return pick(FeatureOptions() - .add(FeatureSet::MVP, i32, i64, f32, f64, none) - .add(FeatureSet::SIMD, v128)); + std::vector getReachableTypes() { + return items(FeatureOptions() + .add(FeatureSet::MVP, i32, i64, f32, f64, none) + .add(FeatureSet::SIMD, v128) + .add(FeatureSet::ReferenceTypes, funcref, anyref) + .add((FeatureSet::Feature)(FeatureSet::ReferenceTypes | + FeatureSet::ExceptionHandling), + exnref)); } + Type getReachableType() { return pick(getReachableTypes()); } std::vector getConcreteTypes() { return items(FeatureOptions() .add(FeatureSet::MVP, i32, i64, f32, f64) - .add(FeatureSet::SIMD, v128)); + .add(FeatureSet::SIMD, v128) + .add(FeatureSet::ReferenceTypes, funcref, anyref) + .add((FeatureSet::Feature)(FeatureSet::ReferenceTypes | + FeatureSet::ExceptionHandling), + exnref)); } - Type getConcreteType() { return pick(getConcreteTypes()); } + // Get types that can be stored in memory + std::vector getStorableTypes() { + return items(FeatureOptions() + .add(FeatureSet::MVP, i32, i64, f32, f64) + .add(FeatureSet::SIMD, v128)); + } + Type getStorableType() { return pick(getStorableTypes()); } + // statistical distributions // 0 to the limit, logarithmic scale @@ -2665,8 +2713,8 @@ class TranslateToFuzzReader { // low values Index upToSquared(Index x) { return upTo(upTo(x)); } - // pick from a vector - template const T& pick(const std::vector& vec) { + // pick from a vector-like container + template const typename T::value_type& pick(const T& vec) { assert(!vec.empty()); auto index = upTo(vec.size()); return vec[index]; diff --git a/src/tools/spec-wrapper.h b/src/tools/spec-wrapper.h index 8dcb5fde4c4..d834c4b51be 100644 --- a/src/tools/spec-wrapper.h +++ b/src/tools/spec-wrapper.h @@ -48,10 +48,12 @@ static std::string generateSpecWrapper(Module& wasm) { case v128: ret += "(v128.const i32x4 0 0 0 0)"; break; - case anyref: // there's no anyref.const - case exnref: // there's no exnref.const - case none: - case unreachable: + case funcref: + case anyref: + case exnref: + ret += "(ref.null)"; + break; + default: WASM_UNREACHABLE(); } ret += " "; diff --git a/src/tools/wasm-reduce.cpp b/src/tools/wasm-reduce.cpp index f1fbebc244e..cb6562ee142 100644 --- a/src/tools/wasm-reduce.cpp +++ b/src/tools/wasm-reduce.cpp @@ -592,7 +592,9 @@ struct Reducer fixed = builder->makeUnary(TruncSFloat64ToInt32, child); break; case v128: + case funcref: case anyref: + case nullref: case exnref: continue; // not implemented yet case none: @@ -615,7 +617,9 @@ struct Reducer fixed = builder->makeUnary(TruncSFloat64ToInt64, child); break; case v128: + case funcref: case anyref: + case nullref: case exnref: continue; // not implemented yet case none: @@ -638,7 +642,9 @@ struct Reducer fixed = builder->makeUnary(DemoteFloat64, child); break; case v128: + case funcref: case anyref: + case nullref: case exnref: continue; // not implemented yet case none: @@ -661,7 +667,9 @@ struct Reducer case f64: WASM_UNREACHABLE(); case v128: + case funcref: case anyref: + case nullref: case exnref: continue; // not implemented yet case none: @@ -671,7 +679,9 @@ struct Reducer break; } case v128: + case funcref: case anyref: + case nullref: case exnref: continue; // not implemented yet case none: @@ -1002,6 +1012,10 @@ struct Reducer return false; } // try to replace with a trivial value + if (curr->type.isRef()) { + RefNull* n = builder->makeRefNull(); + return tryToReplaceCurrent(n); + } Const* c = builder->makeConst(Literal(int32_t(0))); if (tryToReplaceCurrent(c)) { return true; diff --git a/src/tools/wasm-shell.cpp b/src/tools/wasm-shell.cpp index b83989a2dfb..892e50bf770 100644 --- a/src/tools/wasm-shell.cpp +++ b/src/tools/wasm-shell.cpp @@ -74,7 +74,16 @@ struct Operation { name = element[i++]->str(); for (size_t j = i; j < element.size(); j++) { Expression* argument = builder.parseExpression(*element[j]); - arguments.push_back(argument->dynCast()->value); + if (auto* c = argument->dynCast()) { + arguments.push_back(c->value); + } else if (argument->is()) { + arguments.push_back(Literal(nullref)); + } else if (auto* refFunc = argument->dynCast()) { + arguments.push_back(Literal(refFunc->func)); + } else { + assert(false && + "Functions should be invoked with constant expressions"); + } } } diff --git a/src/wasm-binary.h b/src/wasm-binary.h index 78fd72e3856..c9bc4691024 100644 --- a/src/wasm-binary.h +++ b/src/wasm-binary.h @@ -379,10 +379,12 @@ enum EncodedType { f32 = -0x3, // 0x7d f64 = -0x4, // 0x7c v128 = -0x5, // 0x7b - // elem_type - AnyFunc = -0x10, // 0x70 + // function reference type + funcref = -0x10, // 0x70 // opaque reference type anyref = -0x11, // 0x6f + // null reference type + nullref = -0x12, // 0x6e // exception reference type exnref = -0x18, // 0x68 // func_type form @@ -438,6 +440,7 @@ enum ASTNodes { Drop = 0x1a, Select = 0x1b, + SelectWithType = 0x1c, // added in reference types proposal LocalGet = 0x20, LocalSet = 0x21, @@ -901,6 +904,12 @@ enum ASTNodes { MemoryCopy = 0x0a, MemoryFill = 0x0b, + // reference types opcodes + + RefNull = 0xd0, + RefIsNull = 0xd1, + RefFunc = 0xd2, + // exception handling opcodes Try = 0x06, @@ -951,6 +960,12 @@ inline S32LEB binaryType(Type type) { case anyref: ret = BinaryConsts::EncodedType::anyref; break; + case funcref: + ret = BinaryConsts::EncodedType::funcref; + break; + case nullref: + ret = BinaryConsts::EncodedType::nullref; + break; case exnref: ret = BinaryConsts::EncodedType::exnref; break; @@ -1159,8 +1174,8 @@ class WasmBinaryBuilder { // we store function imports here before wasm.addFunctionImport after we know // their names std::vector functionImports; - // at index i we have all calls to the function i - std::map> functionCalls; + // at index i we have all refs to the function i + std::map> functionRefs; Function* currFunction = nullptr; // before we see a function (like global init expressions), there is no end of // function to check @@ -1295,12 +1310,15 @@ class WasmBinaryBuilder { bool maybeVisitDataDrop(Expression*& out, uint32_t code); bool maybeVisitMemoryCopy(Expression*& out, uint32_t code); bool maybeVisitMemoryFill(Expression*& out, uint32_t code); - void visitSelect(Select* curr); + void visitSelect(Select* curr, uint8_t code); void visitReturn(Return* curr); bool maybeVisitHost(Expression*& out, uint8_t code); void visitNop(Nop* curr); void visitUnreachable(Unreachable* curr); void visitDrop(Drop* curr); + void visitRefNull(RefNull* curr); + void visitRefIsNull(RefIsNull* curr); + void visitRefFunc(RefFunc* curr); void visitTry(Try* curr); void visitThrow(Throw* curr); void visitRethrow(Rethrow* curr); diff --git a/src/wasm-builder.h b/src/wasm-builder.h index 533f83d94d0..1a59ea6c976 100644 --- a/src/wasm-builder.h +++ b/src/wasm-builder.h @@ -111,6 +111,12 @@ class Builder { ret->finalize(); return ret; } + Block* makeBlock(const std::vector& items, Type type) { + auto* ret = allocator.alloc(); + ret->list.set(items); + ret->finalize(type); + return ret; + } Block* makeBlock(const ExpressionList& items) { auto* ret = allocator.alloc(); ret->list.set(items); @@ -165,6 +171,13 @@ class Builder { ret->finalize(); return ret; } + Loop* makeLoop(Name name, Expression* body, Type type) { + auto* ret = allocator.alloc(); + ret->name = name; + ret->body = body; + ret->finalize(type); + return ret; + } Break* makeBreak(Name name, Expression* value = nullptr, Expression* condition = nullptr) { @@ -467,6 +480,7 @@ class Builder { return ret; } Const* makeConst(Literal value) { + assert(value.type.isNumber()); auto* ret = allocator.alloc(); ret->value = value; ret->type = value.type; @@ -496,6 +510,17 @@ class Builder { ret->finalize(); return ret; } + Select* makeSelect(Expression* condition, + Expression* ifTrue, + Expression* ifFalse, + Type type) { + auto* ret = allocator.alloc())->cast())->cast(); - ret->ifTrue = parseExpression(s[1]); - ret->ifFalse = parseExpression(s[2]); - ret->condition = parseExpression(s[3]); - ret->finalize(); + Index i = 1; + Type type = parseOptionalResultType(s, i); + ret->ifTrue = parseExpression(s[i++]); + ret->ifFalse = parseExpression(s[i++]); + ret->condition = parseExpression(s[i]); + if (type.isConcrete()) { + ret->finalize(type); + } else { + ret->finalize(); + } return ret; } @@ -1765,6 +1777,27 @@ Expression* SExpressionWasmBuilder::makeReturn(Element& s) { return ret; } +Expression* SExpressionWasmBuilder::makeRefNull(Element& s) { + auto ret = allocator.alloc(); + ret->finalize(); + return ret; +} + +Expression* SExpressionWasmBuilder::makeRefIsNull(Element& s) { + auto ret = allocator.alloc(); + ret->anyref = parseExpression(s[1]); + ret->finalize(); + return ret; +} + +Expression* SExpressionWasmBuilder::makeRefFunc(Element& s) { + auto func = getFunctionName(*s[1]); + auto ret = allocator.alloc(); + ret->func = func; + ret->finalize(); + return ret; +} + // try-catch-end is written in the folded wast format as // (try // ... diff --git a/src/wasm/wasm-stack.cpp b/src/wasm/wasm-stack.cpp index f1aaff93e1e..76f5f87a910 100644 --- a/src/wasm/wasm-stack.cpp +++ b/src/wasm/wasm-stack.cpp @@ -149,9 +149,7 @@ void BinaryInstWriter::visitLoad(Load* curr) { // the pointer is unreachable, so we are never reached; just don't emit // a load return; - case anyref: // anyref cannot be loaded from memory - case exnref: // exnref cannot be loaded from memory - case none: + default: WASM_UNREACHABLE(); } } else { @@ -249,10 +247,7 @@ void BinaryInstWriter::visitStore(Store* curr) { o << int8_t(BinaryConsts::SIMDPrefix) << U32LEB(BinaryConsts::V128Store); break; - case anyref: // anyref cannot be stored from memory - case exnref: // exnref cannot be stored in memory - case none: - case unreachable: + default: WASM_UNREACHABLE(); } } else { @@ -644,10 +639,7 @@ void BinaryInstWriter::visitConst(Const* curr) { } break; } - case anyref: // there's no anyref.const - case exnref: // there's no exnref.const - case none: - case unreachable: + default: WASM_UNREACHABLE(); } } @@ -1537,7 +1529,13 @@ void BinaryInstWriter::visitBinary(Binary* curr) { } void BinaryInstWriter::visitSelect(Select* curr) { - o << int8_t(BinaryConsts::Select); + if (curr->type.isRef()) { + o << int8_t(BinaryConsts::SelectWithType); + // select needs the number of return types, which is always 1 for now + o << U32LEB(1) << binaryType(curr->type != unreachable ? curr->type : none); + } else { + o << int8_t(BinaryConsts::Select); + } } void BinaryInstWriter::visitReturn(Return* curr) { @@ -1558,6 +1556,19 @@ void BinaryInstWriter::visitHost(Host* curr) { o << U32LEB(0); // Reserved flags field } +void BinaryInstWriter::visitRefNull(RefNull* curr) { + o << int8_t(BinaryConsts::RefNull); +} + +void BinaryInstWriter::visitRefIsNull(RefIsNull* curr) { + o << int8_t(BinaryConsts::RefIsNull); +} + +void BinaryInstWriter::visitRefFunc(RefFunc* curr) { + o << int8_t(BinaryConsts::RefFunc) + << U32LEB(parent.getFunctionIndex(curr->func)); +} + void BinaryInstWriter::visitTry(Try* curr) { breakStack.emplace_back(IMPOSSIBLE_CONTINUE); o << int8_t(BinaryConsts::Try); @@ -1655,6 +1666,11 @@ void BinaryInstWriter::mapLocalsAndEmitHeader() { continue; } index += numLocalsByType[v128]; + if (type == funcref) { + mappedLocals[i] = index + currLocalsByType[funcref] - 1; + continue; + } + index += numLocalsByType[funcref]; if (type == anyref) { mappedLocals[i] = index + currLocalsByType[anyref] - 1; continue; @@ -1667,11 +1683,11 @@ void BinaryInstWriter::mapLocalsAndEmitHeader() { WASM_UNREACHABLE(); } // Emit them. - o << U32LEB((numLocalsByType[i32] ? 1 : 0) + (numLocalsByType[i64] ? 1 : 0) + - (numLocalsByType[f32] ? 1 : 0) + (numLocalsByType[f64] ? 1 : 0) + - (numLocalsByType[v128] ? 1 : 0) + - (numLocalsByType[anyref] ? 1 : 0) + - (numLocalsByType[exnref] ? 1 : 0)); + o << U32LEB( + (numLocalsByType[i32] ? 1 : 0) + (numLocalsByType[i64] ? 1 : 0) + + (numLocalsByType[f32] ? 1 : 0) + (numLocalsByType[f64] ? 1 : 0) + + (numLocalsByType[v128] ? 1 : 0) + (numLocalsByType[funcref] ? 1 : 0) + + (numLocalsByType[anyref] ? 1 : 0) + (numLocalsByType[exnref] ? 1 : 0)); if (numLocalsByType[i32]) { o << U32LEB(numLocalsByType[i32]) << binaryType(i32); } @@ -1687,6 +1703,9 @@ void BinaryInstWriter::mapLocalsAndEmitHeader() { if (numLocalsByType[v128]) { o << U32LEB(numLocalsByType[v128]) << binaryType(v128); } + if (numLocalsByType[funcref]) { + o << U32LEB(numLocalsByType[funcref]) << binaryType(funcref); + } if (numLocalsByType[anyref]) { o << U32LEB(numLocalsByType[anyref]) << binaryType(anyref); } diff --git a/src/wasm/wasm-type.cpp b/src/wasm/wasm-type.cpp index 50ddc82f850..f777b190d3e 100644 --- a/src/wasm/wasm-type.cpp +++ b/src/wasm/wasm-type.cpp @@ -62,7 +62,9 @@ std::vector>> typeLists = [] { add({Type::f32}); add({Type::f64}); add({Type::v128}); + add({Type::funcref}); add({Type::anyref}); + add({Type::nullref}); add({Type::exnref}); return lists; }(); @@ -75,7 +77,9 @@ std::unordered_map, uint32_t> indices = { {{Type::f32}, Type::f32}, {{Type::f64}, Type::f64}, {{Type::v128}, Type::v128}, + {{Type::funcref}, Type::funcref}, {{Type::anyref}, Type::anyref}, + {{Type::nullref}, Type::nullref}, {{Type::exnref}, Type::exnref}, }; @@ -193,9 +197,15 @@ std::ostream& operator<<(std::ostream& os, Type type) { case Type::v128: os << "v128"; break; + case Type::funcref: + os << "funcref"; + break; case Type::anyref: os << "anyref"; break; + case Type::nullref: + os << "nullref"; + break; case Type::exnref: os << "exnref"; break; @@ -244,10 +254,7 @@ unsigned getTypeSize(Type type) { return 8; case Type::v128: return 16; - case Type::anyref: // anyref type is opaque - case Type::exnref: // exnref type is opaque - case Type::none: - case Type::unreachable: + default: WASM_UNREACHABLE(); } WASM_UNREACHABLE(); @@ -257,10 +264,12 @@ FeatureSet getFeatures(Type type) { switch (type) { case v128: return FeatureSet::SIMD; + case funcref: case anyref: + case nullref: return FeatureSet::ReferenceTypes; case exnref: - return FeatureSet::ExceptionHandling; + return FeatureSet::ReferenceTypes | FeatureSet::ExceptionHandling; default: return FeatureSet(); } @@ -282,6 +291,16 @@ Type getType(unsigned size, bool float_) { WASM_UNREACHABLE(); } +bool isLeftSubTypeOfRight(Type left, Type right) { + if (left == right) { + return true; + } + if (left.isRef() && right.isRef() && (right == anyref || left == nullref)) { + return true; + } + return false; +} + Type reinterpretType(Type type) { switch (type) { case Type::i32: @@ -292,14 +311,32 @@ Type reinterpretType(Type type) { return i32; case Type::f64: return i64; - case Type::v128: - case Type::anyref: - case Type::exnref: - case Type::none: - case Type::unreachable: + default: WASM_UNREACHABLE(); } WASM_UNREACHABLE(); } +Type getLeastCommonSuperType(Type a, Type b) { + if (a == b) { + return a; + } + if (!a.isRef() || !b.isRef()) { + return none; // a poison value that must not be consumed + } + if (a == anyref || b == anyref) { + return anyref; + } + if ((a == funcref && b == exnref) || (a == exnref && b == funcref)) { + return anyref; + } + if (a != nullref) { + return a; + } + if (b != nullref) { + return b; + } + return nullref; +} + } // namespace wasm diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp index d3f03b76c48..9f42c2518df 100644 --- a/src/wasm/wasm-validator.cpp +++ b/src/wasm/wasm-validator.cpp @@ -181,6 +181,30 @@ struct ValidationInfo { fail(text, curr, func); } } + + // TODO remove + bool shouldLeftBeSubTypeOfRight(Type left, + Type right, + Expression* curr, + const char* text, + Function* func = nullptr) { + if (isLeftSubTypeOfRight(left, right)) { + return true; + } + fail(text, curr, func); + return false; + } + + bool shouldLeftBeSubTypeOfRightOrUnreachable(Type left, + Type right, + Expression* curr, + const char* text, + Function* func = nullptr) { + if (left == unreachable) { + return true; + } + return shouldLeftBeSubTypeOfRight(left, right, curr, text, func); + } }; struct FunctionValidator : public WalkerPass> { @@ -210,7 +234,7 @@ struct FunctionValidator : public WalkerPass> { std::unordered_map breakInfos; - Type returnType = unreachable; // type used in returns + std::set returnTypes; // types used in returns // Binaryen IR requires that label names must be unique - IR generators must // ensure that @@ -287,6 +311,8 @@ struct FunctionValidator : public WalkerPass> { void visitDrop(Drop* curr); void visitReturn(Return* curr); void visitHost(Host* curr); + void visitRefIsNull(RefIsNull* curr); + void visitRefFunc(RefFunc* curr); void visitTry(Try* curr); void visitThrow(Throw* curr); void visitRethrow(Rethrow* curr); @@ -327,6 +353,22 @@ struct FunctionValidator : public WalkerPass> { return info.shouldBeIntOrUnreachable(ty, curr, text, getFunction()); } + bool shouldLeftBeSubTypeOfRight(Type left, + Type right, + Expression* curr, + const char* text) { + return info.shouldLeftBeSubTypeOfRight( + left, right, curr, text, getFunction()); + } + + bool shouldLeftBeSubTypeOfRightOrUnreachable(Type left, + Type right, + Expression* curr, + const char* text) { + return info.shouldLeftBeSubTypeOfRightOrUnreachable( + left, right, curr, text, getFunction()); + } + void validateAlignment( size_t align, Type type, Index bytes, bool isAtomic, Expression* curr); void validateMemBytes(uint8_t bytes, Type type, Expression* curr); @@ -364,29 +406,23 @@ void FunctionValidator::visitBlock(Block* curr) { // none or unreachable means a poison value that we should ignore - if // consumed, it will error if (info.type.isConcrete() && curr->type.isConcrete()) { - shouldBeEqual( - curr->type, + shouldLeftBeSubTypeOfRight( info.type, + curr->type, curr, "block+breaks must have right type if breaks return a value"); } if (curr->type.isConcrete() && info.arity && info.type != unreachable) { - shouldBeEqual(curr->type, - info.type, - curr, - "block+breaks must have right type if breaks have arity"); + shouldLeftBeSubTypeOfRight( + info.type, + curr->type, + curr, + "block+breaks must have right type if breaks have arity"); } shouldBeTrue( info.arity != BreakInfo::PoisonArity, curr, "break arities must match"); if (curr->list.size() > 0) { auto last = curr->list.back()->type; - if (last.isConcrete() && info.type != unreachable) { - shouldBeEqual(last, - info.type, - curr, - "block+breaks must have right type if block ends with " - "a reachable value"); - } if (last == none) { shouldBeTrue(info.arity == Index(0), curr, @@ -420,9 +456,9 @@ void FunctionValidator::visitBlock(Block* curr) { "not flow out a value"); } else { if (backType.isConcrete()) { - shouldBeEqual( - curr->type, + shouldLeftBeSubTypeOfRight( backType, + curr->type, curr, "block with value and last element with value must match types"); } else { @@ -438,6 +474,8 @@ void FunctionValidator::visitBlock(Block* curr) { shouldBeTrue( curr->list.size() > 0, curr, "block with a value must not be empty"); } + shouldBeTrue( + curr->type != nullref, curr, "block return type should not be nullref"); } void FunctionValidator::visitLoop(Loop* curr) { @@ -457,6 +495,26 @@ void FunctionValidator::visitLoop(Loop* curr) { curr, "bad body for a loop that has no value"); } + + // When there are multiple instructions within a loop, they are wrapped in a + // Block internally, so visitBlock can take care of verification. Here we + // check cases when there is only one instruction in a Loop. + if (!curr->body->is()) { + if (!curr->type.isConcrete()) { + shouldBeFalse(curr->body->type.isConcrete(), + curr, + "if loop is not returning a value, final element should " + "not flow out a value"); + } else { + shouldLeftBeSubTypeOfRightOrUnreachable( + curr->body->type, + curr->type, + curr, + "loop with value and last element with value must match types"); + } + } + shouldBeTrue( + curr->type != nullref, curr, "loop return type should not be nullref"); } void FunctionValidator::visitIf(If* curr) { @@ -476,12 +534,12 @@ void FunctionValidator::visitIf(If* curr) { } } else { if (curr->type != unreachable) { - shouldBeEqualOrFirstIsUnreachable( + shouldLeftBeSubTypeOfRightOrUnreachable( curr->ifTrue->type, curr->type, curr, "returning if-else's true must have right type"); - shouldBeEqualOrFirstIsUnreachable( + shouldLeftBeSubTypeOfRightOrUnreachable( curr->ifFalse->type, curr->type, curr, @@ -499,27 +557,20 @@ void FunctionValidator::visitIf(If* curr) { } } if (curr->ifTrue->type.isConcrete()) { - shouldBeEqual(curr->type, - curr->ifTrue->type, - curr, - "if type must match concrete ifTrue"); - shouldBeEqualOrFirstIsUnreachable(curr->ifFalse->type, - curr->ifTrue->type, - curr, - "other arm must match concrete ifTrue"); + shouldLeftBeSubTypeOfRight(curr->ifTrue->type, + curr->type, + curr, + "if type must match concrete ifTrue"); } if (curr->ifFalse->type.isConcrete()) { - shouldBeEqual(curr->type, - curr->ifFalse->type, - curr, - "if type must match concrete ifFalse"); - shouldBeEqualOrFirstIsUnreachable( - curr->ifTrue->type, - curr->ifFalse->type, - curr, - "other arm must match concrete ifFalse"); + shouldLeftBeSubTypeOfRight(curr->ifFalse->type, + curr->type, + curr, + "if type must match concrete ifFalse"); } } + shouldBeTrue( + curr->type != nullref, curr, "if return type should not be nullref"); } void FunctionValidator::noteBreak(Name name, @@ -548,9 +599,7 @@ void FunctionValidator::noteBreak(Name name, Type valueType, Expression* curr) { if (info.type == unreachable) { info.type = valueType; } else if (valueType != unreachable) { - if (valueType != info.type) { - info.type = none; // a poison value that must not be consumed - } + info.type = getLeastCommonSuperType(info.type, valueType); } if (arity != info.arity) { info.arity = BreakInfo::PoisonArity; @@ -599,10 +648,11 @@ void FunctionValidator::visitCall(Call* curr) { return; } for (size_t i = 0; i < curr->operands.size(); i++) { - if (!shouldBeEqualOrFirstIsUnreachable(curr->operands[i]->type, - target->params[i], - curr, - "call param types must match") && + if (!shouldLeftBeSubTypeOfRightOrUnreachable( + curr->operands[i]->type, + target->params[i], + curr, + "call param types must match") && !info.quiet) { getStream() << "(on argument " << i << ")\n"; } @@ -655,10 +705,11 @@ void FunctionValidator::visitCallIndirect(CallIndirect* curr) { return; } for (size_t i = 0; i < curr->operands.size(); i++) { - if (!shouldBeEqualOrFirstIsUnreachable(curr->operands[i]->type, - type->params[i], - curr, - "call param types must match") && + if (!shouldLeftBeSubTypeOfRightOrUnreachable( + curr->operands[i]->type, + type->params[i], + curr, + "call param types must match") && !info.quiet) { getStream() << "(on argument " << i << ")\n"; } @@ -719,13 +770,13 @@ void FunctionValidator::visitLocalSet(LocalSet* curr) { "local.set index must be small enough"); if (curr->value->type != unreachable) { if (curr->type != none) { // tee is ok anyhow - shouldBeEqualOrFirstIsUnreachable( + shouldLeftBeSubTypeOfRightOrUnreachable( curr->value->type, curr->type, curr, "local.set type must be correct"); } - shouldBeEqual(getFunction()->getLocalType(curr->index), - curr->value->type, - curr, - "local.set type must match function"); + shouldLeftBeSubTypeOfRight(curr->value->type, + getFunction()->getLocalType(curr->index), + curr, + "local.set type must match function"); } } @@ -748,10 +799,11 @@ void FunctionValidator::visitGlobalSet(GlobalSet* curr) { "global.set name must be valid (and not an import; imports " "can't be modified)")) { shouldBeTrue(global->mutable_, curr, "global.set global must be mutable"); - shouldBeEqualOrFirstIsUnreachable(curr->value->type, - global->type, - curr, - "global.set value must have right type"); + shouldLeftBeSubTypeOfRightOrUnreachable( + curr->value->type, + global->type, + curr, + "global.set value must have right type"); } } @@ -1180,12 +1232,10 @@ void FunctionValidator::validateMemBytes(uint8_t bytes, shouldBeEqual( bytes, uint8_t(16), curr, "expected v128 operation to touch 16 bytes"); break; - case anyref: // anyref cannot be stored in memory - case exnref: // exnref cannot be stored in memory - case none: - WASM_UNREACHABLE(); case unreachable: break; + default: + WASM_UNREACHABLE(); } } @@ -1612,16 +1662,21 @@ void FunctionValidator::visitSelect(Select* curr) { shouldBeUnequal(curr->ifTrue->type, none, curr, "select left must be valid"); shouldBeUnequal( curr->ifFalse->type, none, curr, "select right must be valid"); + shouldBeUnequal(curr->type, none, curr, "select type must be valid"); shouldBeTrue(curr->condition->type == unreachable || curr->condition->type == i32, curr, "select condition must be valid"); - if (curr->ifTrue->type != unreachable && curr->ifFalse->type != unreachable) { - shouldBeEqual(curr->ifTrue->type, - curr->ifFalse->type, - curr, - "select sides must be equal"); + if (curr->type != unreachable) { + shouldBeTrue(isLeftSubTypeOfRight(curr->ifTrue->type, curr->type), + curr, + "select's left expression must be subtype of select's type"); + shouldBeTrue(isLeftSubTypeOfRight(curr->ifFalse->type, curr->type), + curr, + "select's right expression must be subtype of select's type"); } + shouldBeTrue( + curr->type != nullref, curr, "select return type should not be nullref"); } void FunctionValidator::visitDrop(Drop* curr) { @@ -1632,16 +1687,7 @@ void FunctionValidator::visitDrop(Drop* curr) { } void FunctionValidator::visitReturn(Return* curr) { - if (curr->value) { - if (returnType == unreachable) { - returnType = curr->value->type; - } else if (curr->value->type != unreachable) { - shouldBeEqual( - curr->value->type, returnType, curr, "function results must match"); - } - } else { - returnType = none; - } + returnTypes.insert(curr->value ? curr->value->type : none); } void FunctionValidator::visitHost(Host* curr) { @@ -1664,33 +1710,42 @@ void FunctionValidator::visitHost(Host* curr) { } } +void FunctionValidator::visitRefIsNull(RefIsNull* curr) { + shouldBeTrue(curr->anyref->type == unreachable || + curr->anyref->type.isRef(), + curr->anyref, + "ref.is_null's argument should be a reference type"); +} + +void FunctionValidator::visitRefFunc(RefFunc* curr) { + auto* func = getModule()->getFunctionOrNull(curr->func); + shouldBeTrue(!!func, curr, "function argument of ref.func must exist"); +} + void FunctionValidator::visitTry(Try* curr) { if (curr->type != unreachable) { - shouldBeEqualOrFirstIsUnreachable( + shouldLeftBeSubTypeOfRightOrUnreachable( curr->body->type, curr->type, curr->body, "try's type does not match try body's type"); - shouldBeEqualOrFirstIsUnreachable( + shouldLeftBeSubTypeOfRightOrUnreachable( curr->catchBody->type, curr->type, curr->catchBody, "try's type does not match catch's body type"); + } else { + shouldBeEqual(curr->body->type, + unreachable, + curr, + "unreachable try-catch must have unreachable try body"); + shouldBeEqual(curr->catchBody->type, + unreachable, + curr, + "unreachable try-catch must have unreachable catch body"); } - if (curr->body->type.isConcrete()) { - shouldBeEqualOrFirstIsUnreachable( - curr->catchBody->type, - curr->body->type, - curr->catchBody, - "try's body type must match catch's body type"); - } - if (curr->catchBody->type.isConcrete()) { - shouldBeEqualOrFirstIsUnreachable( - curr->body->type, - curr->catchBody->type, - curr->body, - "try's body type must match catch's body type"); - } + shouldBeTrue( + curr->type != nullref, curr, "try return type should not be nullref"); } void FunctionValidator::visitThrow(Throw* curr) { @@ -1723,10 +1778,11 @@ void FunctionValidator::visitThrow(Throw* curr) { void FunctionValidator::visitRethrow(Rethrow* curr) { shouldBeEqual( curr->type, unreachable, curr, "rethrow's type must be unreachable"); - shouldBeEqual(curr->exnref->type, - exnref, - curr->exnref, - "rethrow's argument must be exnref type"); + shouldLeftBeSubTypeOfRight( + curr->exnref->type, + exnref, + curr->exnref, + "rethrow's argument must be exnref type or its subtype"); } void FunctionValidator::visitBrOnExn(BrOnExn* curr) { @@ -1736,10 +1792,11 @@ void FunctionValidator::visitBrOnExn(BrOnExn* curr) { curr, "br_on_exn's event params and event's params are different"); noteBreak(curr->name, curr->sent, curr); - shouldBeTrue(curr->exnref->type == unreachable || - curr->exnref->type == exnref, - curr, - "br_on_exn's argument must be unreachable or exnref type"); + shouldLeftBeSubTypeOfRightOrUnreachable( + curr->exnref->type, + exnref, + curr, + "br_on_exn's argument must be unreachable or exnref type or its subtype"); if (curr->exnref->type == unreachable) { shouldBeTrue(curr->type == unreachable, curr, @@ -1768,21 +1825,25 @@ void FunctionValidator::visitFunction(Function* curr) { "all used types should be allowed"); // if function has no result, it is ignored // if body is unreachable, it might be e.g. a return - if (curr->body->type != unreachable) { - shouldBeEqual(curr->result, - curr->body->type, - curr->body, - "function body type must match, if function returns"); - } - if (returnType != unreachable) { - shouldBeEqual(curr->result, - returnType, - curr->body, - "function result must match, if function has returns"); + shouldLeftBeSubTypeOfRightOrUnreachable( + curr->body->type, + curr->result, + curr->body, + "function body type must match, if function returns"); + for (Type returnType : returnTypes) { + shouldLeftBeSubTypeOfRightOrUnreachable( + returnType, + curr->result, + curr->body, + "function result must match, if function has returns"); } + shouldBeTrue(curr->result != nullref, + curr, + "function return type should not be nullref"); + shouldBeTrue( breakInfos.empty(), curr->body, "all named break targets must exist"); - returnType = unreachable; + returnTypes.clear(); labelNames.clear(); // if function has a named type, it must match up with the function's params // and result @@ -1863,9 +1924,7 @@ void FunctionValidator::validateAlignment( case v128: case unreachable: break; - case anyref: // anyref cannot be stored in memory - case exnref: // exnref cannot be stored in memory - case none: + default: WASM_UNREACHABLE(); } } @@ -1887,7 +1946,7 @@ static void validateBinaryenIR(Module& wasm, ValidationInfo& info) { auto oldType = curr->type; ReFinalizeNode().visit(curr); auto newType = curr->type; - if (newType != oldType) { + if (newType != oldType && !isLeftSubTypeOfRight(newType, oldType)) { // We accept concrete => undefined, // e.g. // @@ -2013,13 +2072,14 @@ static void validateGlobals(Module& module, ValidationInfo& info) { info.shouldBeTrue( curr->init != nullptr, curr->name, "global init must be non-null"); assert(curr->init); - info.shouldBeTrue(curr->init->is() || curr->init->is(), - curr->name, - "global init must be valid"); - if (!info.shouldBeEqual(curr->type, - curr->init->type, - curr->init, - "global init must have correct type") && + info.shouldBeTrue( + curr->init->isConstExpression(), curr->name, "global init must be valid"); + + if (!info.shouldLeftBeSubTypeOfRight( + curr->init->type, + curr->type, + curr->init, + "global init must have correct type") && !info.quiet) { info.getStream(nullptr) << "(on global " << curr->name << ")\n"; } @@ -2120,9 +2180,9 @@ static void validateEvents(Module& module, ValidationInfo& info) { curr->name, "Event type's result type should be none"); for (auto type : curr->sig.params.expand()) { - info.shouldBeTrue(type.isInteger() || type.isFloat(), + info.shouldBeTrue(type.isConcrete(), curr->name, - "Values in an event should have integer or float type"); + "Values in an event should have concrete types"); } } } diff --git a/src/wasm/wasm.cpp b/src/wasm/wasm.cpp index b71f7d854e8..b802cd98cd4 100644 --- a/src/wasm/wasm.cpp +++ b/src/wasm/wasm.cpp @@ -173,13 +173,19 @@ const char* getExpressionName(Expression* curr) { return "push"; case Expression::Id::PopId: return "pop"; - case Expression::TryId: + case Expression::Id::RefNullId: + return "ref.null"; + case Expression::Id::RefIsNullId: + return "ref.is_null"; + case Expression::Id::RefFuncId: + return "ref.func"; + case Expression::Id::TryId: return "try"; - case Expression::ThrowId: + case Expression::Id::ThrowId: return "throw"; - case Expression::RethrowId: + case Expression::Id::RethrowId: return "rethrow"; - case Expression::BrOnExnId: + case Expression::Id::BrOnExnId: return "br_on_exn"; case Expression::Id::NumExpressionIds: WASM_UNREACHABLE(); @@ -260,8 +266,7 @@ static Type mergeTypes(std::vector& types) { if (type == unreachable) { type = other; } else if (type != other) { - // poison value, we saw multiple types; this should not be consumed - type = none; + type = getLeastCommonSuperType(type, other); } } } @@ -372,7 +377,7 @@ void If::finalize() { } else if (ifFalse->type.isConcrete() && ifTrue->type == unreachable) { type = ifFalse->type; } else { - type = none; + type = getLeastCommonSuperType(ifTrue->type, ifFalse->type); } } else { type = none; // if without else @@ -856,13 +861,15 @@ void Binary::finalize() { } } +void Select::finalize(Type type_) { type = type_; } + void Select::finalize() { assert(ifTrue && ifFalse); if (ifTrue->type == unreachable || ifFalse->type == unreachable || condition->type == unreachable) { type = unreachable; } else { - type = ifTrue->type; + type = getLeastCommonSuperType(ifTrue->type, ifFalse->type); } } @@ -892,6 +899,12 @@ void Host::finalize() { } } +void RefNull::finalize() { type = nullref; } + +void RefIsNull::finalize() { type = i32; } + +void RefFunc::finalize() { type = funcref; } + void Try::finalize() { if (body->type == catchBody->type) { type = body->type; @@ -900,7 +913,7 @@ void Try::finalize() { } else if (catchBody->type.isConcrete() && body->type == unreachable) { type = catchBody->type; } else { - type = none; + type = getLeastCommonSuperType(body->type, catchBody->type); } } diff --git a/src/wasm2js.h b/src/wasm2js.h index 344416b5403..65dd3fb8172 100644 --- a/src/wasm2js.h +++ b/src/wasm2js.h @@ -1861,6 +1861,18 @@ Ref Wasm2JSBuilder::processFunctionBody(Module* m, unimplemented(curr); WASM_UNREACHABLE(); } + Ref visitRefNull(RefNull* curr) { + unimplemented(curr); + WASM_UNREACHABLE(); + } + Ref visitRefIsNull(RefIsNull* curr) { + unimplemented(curr); + WASM_UNREACHABLE(); + } + Ref visitRefFunc(RefFunc* curr) { + unimplemented(curr); + WASM_UNREACHABLE(); + } Ref visitTry(Try* curr) { unimplemented(curr); WASM_UNREACHABLE(); diff --git a/test/anyref.wast b/test/anyref.wast deleted file mode 100644 index d617d3f424f..00000000000 --- a/test/anyref.wast +++ /dev/null @@ -1,18 +0,0 @@ -(module - (memory 1 1) - (import "env" "test1" (func $test1 (param anyref) (result anyref))) - (import "env" "test2" (global $test2 anyref)) - (export "test1" (func $test1 (param anyref) (result anyref))) - (export "test2" (global $test2)) - (func $anyref_test (param $0 anyref) (result anyref) - (local $1 anyref) - (local.set $1 - (call $test1 - (local.get $0) - ) - ) - (return - (local.get $1) - ) - ) -) diff --git a/test/anyref.wast.from-wast b/test/anyref.wast.from-wast deleted file mode 100644 index 117695077f0..00000000000 --- a/test/anyref.wast.from-wast +++ /dev/null @@ -1,19 +0,0 @@ -(module - (type $FUNCSIG$aa (func (param anyref) (result anyref))) - (import "env" "test2" (global $test2 anyref)) - (import "env" "test1" (func $test1 (param anyref) (result anyref))) - (memory $0 1 1) - (export "test1" (func $test1)) - (export "test2" (global $test2)) - (func $anyref_test (; 1 ;) (type $FUNCSIG$aa) (param $0 anyref) (result anyref) - (local $1 anyref) - (local.set $1 - (call $test1 - (local.get $0) - ) - ) - (return - (local.get $1) - ) - ) -) diff --git a/test/anyref.wast.fromBinary b/test/anyref.wast.fromBinary deleted file mode 100644 index 3d9b223b6b4..00000000000 --- a/test/anyref.wast.fromBinary +++ /dev/null @@ -1,20 +0,0 @@ -(module - (type $0 (func (param anyref) (result anyref))) - (import "env" "test2" (global $gimport$1 anyref)) - (import "env" "test1" (func $test1 (param anyref) (result anyref))) - (memory $0 1 1) - (export "test1" (func $test1)) - (export "test2" (global $gimport$1)) - (func $anyref_test (; 1 ;) (type $0) (param $0 anyref) (result anyref) - (local $1 anyref) - (local.set $1 - (call $test1 - (local.get $0) - ) - ) - (return - (local.get $1) - ) - ) -) - diff --git a/test/anyref.wast.fromBinary.noDebugInfo b/test/anyref.wast.fromBinary.noDebugInfo deleted file mode 100644 index d397cd3f9b0..00000000000 --- a/test/anyref.wast.fromBinary.noDebugInfo +++ /dev/null @@ -1,20 +0,0 @@ -(module - (type $0 (func (param anyref) (result anyref))) - (import "env" "test2" (global $gimport$1 anyref)) - (import "env" "test1" (func $fimport$0 (param anyref) (result anyref))) - (memory $0 1 1) - (export "test1" (func $fimport$0)) - (export "test2" (global $gimport$1)) - (func $0 (; 1 ;) (type $0) (param $0 anyref) (result anyref) - (local $1 anyref) - (local.set $1 - (call $fimport$0 - (local.get $0) - ) - ) - (return - (local.get $1) - ) - ) -) - diff --git a/test/binaryen.js/exception-handling.js.txt b/test/binaryen.js/exception-handling.js.txt index 04887dc31b7..a09d957aff9 100644 --- a/test/binaryen.js/exception-handling.js.txt +++ b/test/binaryen.js/exception-handling.js.txt @@ -25,7 +25,14 @@ ) ) +<<<<<<< HEAD getExpressionInfo(throw) = {"id":41,"type":1,"event":"e"} getExpressionInfo(br_on_exn) = {"id":43,"type":8,"name":"l","event":"e"} getExpressionInfo(rethrow) = {"id":42,"type":1} getExpressionInfo(try) = {"id":40,"type":0} +======= +getExpressionInfo(throw) = {"id":44,"type":10,"event":"e"} +getExpressionInfo(br_on_exn) = {"id":46,"type":9,"name":"l","event":"e"} +getExpressionInfo(rethrow) = {"id":45,"type":10} +getExpressionInfo(try) = {"id":43,"type":0} +>>>>>>> Add support for reference types proposal diff --git a/test/binaryen.js/kitchen-sink.js b/test/binaryen.js/kitchen-sink.js index 8c2ebc7832d..d67924dba62 100644 --- a/test/binaryen.js/kitchen-sink.js +++ b/test/binaryen.js/kitchen-sink.js @@ -482,6 +482,11 @@ function test_core() { module.returnCall("kitchen()sinker", [ makeInt32(13), makeInt64(37, 0), makeFloat32(1.3), makeFloat64(3.7) ], Binaryen.i32), module.returnCallIndirect(makeInt32(2449), [ makeInt32(13), makeInt64(37, 0), makeFloat32(1.3), makeFloat64(3.7) ], "iiIfF"), + // Reference types + module.ref.is_null(module.ref.null()), + module.ref.is_null(module.ref.func("kitchen()sinker")), + module.select(temp10, module.ref.null(), module.ref.func("kitchen()sinker"), Binaryen.funcref), + // Exception handling module.try( module.throw("a-event", [module.i32.const(0)]), @@ -528,6 +533,8 @@ function test_core() { module.push(module.f64.pop()), module.push(module.v128.pop()), module.push(module.anyref.pop()), + module.push(module.funcref.pop()), + module.push(module.nullref.pop()), module.push(module.exnref.pop()), // TODO: Host module.nop(), diff --git a/test/binaryen.js/kitchen-sink.js.txt b/test/binaryen.js/kitchen-sink.js.txt index 601f08b4cdf..4365fc536b6 100644 --- a/test/binaryen.js/kitchen-sink.js.txt +++ b/test/binaryen.js/kitchen-sink.js.txt @@ -1,3 +1,4 @@ +<<<<<<< HEAD // BinaryenTypeNone: 0 // [] // BinaryenTypeUnreachable: 1 @@ -20,6 +21,18 @@ // 9 [ 2, 2 ] // 9 [ 2, 2 ] // 10 [ 4, 4 ] +======= +BinaryenTypeNone: 0 +BinaryenTypeInt32: 1 +BinaryenTypeInt64: 2 +BinaryenTypeFloat32: 3 +BinaryenTypeFloat64: 4 +BinaryenTypeVec128: 5 +BinaryenTypeAnyref: 6 +BinaryenTypeExnref: 9 +BinaryenTypeUnreachable: 10 +BinaryenTypeAuto: -1 +>>>>>>> Add support for reference types proposal Binaryen.Features.MVP: 0 Binaryen.Features.Atomics: 1 Binaryen.Features.BulkMemory: 16 @@ -68,10 +81,10 @@ MemoryInitId: 34 DataDropId: 35 MemoryCopyId: 36 MemoryFillId: 37 -TryId: 40 -ThrowId: 41 -RethrowId: 42 -BrOnExnId: 43 +TryId: 43 +ThrowId: 44 +RethrowId: 45 +BrOnExnId: 46 PushId: 38 PopId: 39 getExpressionInfo={"id":15,"type":4,"op":6} @@ -1693,6 +1706,23 @@ getExpressionInfo(f64.const)={"id":14,"type":5,"value":9.5} (f64.const 3.7) (i32.const 2449) ) + (drop + (ref.is_null + (ref.null) + ) + ) + (drop + (ref.is_null + (ref.func "$kitchen()sinker") + ) + ) + (drop + (select (result funcref) + (ref.null) + (ref.func "$kitchen()sinker") + (i32.const 1) + ) + ) (try (throw $a-event (i32.const 0) @@ -1750,6 +1780,12 @@ getExpressionInfo(f64.const)={"id":14,"type":5,"value":9.5} (push (anyref.pop) ) + (push + (funcref.pop) + ) + (push + (nullref.pop) + ) (push (exnref.pop) ) @@ -3376,6 +3412,23 @@ getExpressionInfo(f64.const)={"id":14,"type":5,"value":9.5} (f64.const 3.7) (i32.const 2449) ) + (drop + (ref.is_null + (ref.null) + ) + ) + (drop + (ref.is_null + (ref.func "$kitchen()sinker") + ) + ) + (drop + (select (result funcref) + (ref.null) + (ref.func "$kitchen()sinker") + (i32.const 1) + ) + ) (try (throw $a-event (i32.const 0) @@ -3433,6 +3486,12 @@ getExpressionInfo(f64.const)={"id":14,"type":5,"value":9.5} (push (anyref.pop) ) + (push + (funcref.pop) + ) + (push + (nullref.pop) + ) (push (exnref.pop) ) @@ -3956,7 +4015,11 @@ module loaded from binary form: ) ) +<<<<<<< HEAD [wasm-validator error in function $func] i32 != i64: local.set type must match function, on +======= +[wasm-validator error in function $func] local.set type must match function, on +>>>>>>> Add support for reference types proposal [none] (local.set $0 [i64] (i64.const 1234) ) @@ -5554,10 +5617,17 @@ int main() { expressions[745] = BinaryenConst(the_module, BinaryenLiteralInt32(2)); expressions[746] = BinaryenLoad(the_module, 4, 1, 0, 0, 4, expressions[745]); expressions[747] = BinaryenConst(the_module, BinaryenLiteralInt32(9)); +<<<<<<< HEAD expressions[748] = BinaryenLoad(the_module, 8, 1, 2, 8, 5, expressions[747]); expressions[749] = BinaryenStore(the_module, 4, 0, 0, expressions[19], expressions[20], 2); expressions[750] = BinaryenStore(the_module, 8, 2, 4, expressions[21], expressions[22], 3); expressions[751] = BinaryenSelect(the_module, expressions[16], expressions[17], expressions[18]); +======= + expressions[748] = BinaryenLoad(the_module, 8, 1, 2, 8, 4, expressions[747]); + expressions[749] = BinaryenStore(the_module, 4, 0, 0, expressions[19], expressions[20], 1); + expressions[750] = BinaryenStore(the_module, 8, 2, 4, expressions[21], expressions[22], 2); + expressions[751] = BinaryenSelect(the_module, expressions[16], expressions[17], expressions[18], BinaryenTypeAuto()); +>>>>>>> Add support for reference types proposal expressions[752] = BinaryenConst(the_module, BinaryenLiteralInt32(1337)); expressions[753] = BinaryenReturn(the_module, expressions[752]); expressions[754] = BinaryenConst(the_module, BinaryenLiteralInt32(13)); @@ -5577,6 +5647,7 @@ int main() { BinaryenExpressionRef operands[] = { expressions[760], expressions[761], expressions[762], expressions[763] }; expressions[764] = BinaryenReturnCallIndirect(the_module, expressions[759], operands, 4, "iiIfF"); } +<<<<<<< HEAD expressions[765] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); { BinaryenExpressionRef operands[] = { expressions[765] }; @@ -5627,6 +5698,69 @@ int main() { expressions[803] = BinaryenPush(the_module, expressions[802]); expressions[804] = BinaryenNop(the_module); expressions[805] = BinaryenUnreachable(the_module); +======= + expressions[765] = BinaryenRefNull(the_module); + expressions[766] = BinaryenRefIsNull(the_module, expressions[765]); + expressions[767] = BinaryenRefFunc(the_module, "kitchen()sinker"); + expressions[768] = BinaryenRefIsNull(the_module, expressions[767]); + expressions[769] = BinaryenRefNull(the_module); + expressions[770] = BinaryenRefFunc(the_module, "kitchen()sinker"); + expressions[771] = BinaryenSelect(the_module, expressions[16], expressions[769], expressions[770], 7); + expressions[772] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); + { + BinaryenExpressionRef operands[] = { expressions[772] }; + expressions[773] = BinaryenThrow(the_module, "a-event", operands, 1); + } + expressions[774] = BinaryenPop(the_module, 9); + expressions[775] = BinaryenLocalSet(the_module, 5, expressions[774]); + expressions[776] = BinaryenLocalGet(the_module, 5, 9); + expressions[777] = BinaryenBrOnExn(the_module, "try-block", "a-event", expressions[776]); + expressions[778] = BinaryenRethrow(the_module, expressions[777]); + { + BinaryenExpressionRef children[] = { expressions[778] }; + expressions[779] = BinaryenBlock(the_module, "try-block", children, 1, 1); + } + expressions[780] = BinaryenDrop(the_module, expressions[779]); + { + BinaryenExpressionRef children[] = { expressions[775], expressions[780] }; + expressions[781] = BinaryenBlock(the_module, NULL, children, 2, 0); + } + expressions[782] = BinaryenTry(the_module, expressions[773], expressions[781]); + expressions[783] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); + expressions[784] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); + expressions[785] = BinaryenAtomicLoad(the_module, 4, 0, 1, expressions[784]); + expressions[786] = BinaryenAtomicStore(the_module, 4, 0, expressions[783], expressions[785], 1); + expressions[787] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); + expressions[788] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); + expressions[789] = BinaryenConst(the_module, BinaryenLiteralInt64(0)); + expressions[790] = BinaryenAtomicWait(the_module, expressions[787], expressions[788], expressions[789], 1); + expressions[791] = BinaryenDrop(the_module, expressions[790]); + expressions[792] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); + expressions[793] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); + expressions[794] = BinaryenAtomicNotify(the_module, expressions[792], expressions[793]); + expressions[795] = BinaryenDrop(the_module, expressions[794]); + expressions[796] = BinaryenAtomicFence(the_module); + expressions[797] = BinaryenPop(the_module, 1); + expressions[798] = BinaryenPush(the_module, expressions[797]); + expressions[799] = BinaryenPop(the_module, 2); + expressions[800] = BinaryenPush(the_module, expressions[799]); + expressions[801] = BinaryenPop(the_module, 3); + expressions[802] = BinaryenPush(the_module, expressions[801]); + expressions[803] = BinaryenPop(the_module, 4); + expressions[804] = BinaryenPush(the_module, expressions[803]); + expressions[805] = BinaryenPop(the_module, 5); + expressions[806] = BinaryenPush(the_module, expressions[805]); + expressions[807] = BinaryenPop(the_module, 6); + expressions[808] = BinaryenPush(the_module, expressions[807]); + expressions[809] = BinaryenPop(the_module, 7); + expressions[810] = BinaryenPush(the_module, expressions[809]); + expressions[811] = BinaryenPop(the_module, 8); + expressions[812] = BinaryenPush(the_module, expressions[811]); + expressions[813] = BinaryenPop(the_module, 9); + expressions[814] = BinaryenPush(the_module, expressions[813]); + expressions[815] = BinaryenNop(the_module); + expressions[816] = BinaryenUnreachable(the_module); +>>>>>>> Add support for reference types proposal BinaryenExpressionGetId(expressions[30]); BinaryenExpressionGetType(expressions[30]); BinaryenUnaryGetOp(expressions[30]); @@ -5637,6 +5771,7 @@ getExpressionInfo={"id":15,"type":4,"op":6} (f32.const -33.61199951171875) ) +<<<<<<< HEAD expressions[806] = BinaryenConst(the_module, BinaryenLiteralInt32(5)); BinaryenExpressionGetId(expressions[806]); BinaryenExpressionGetType(expressions[806]); @@ -5658,6 +5793,29 @@ getExpressionInfo(f32.const)={"id":14,"type":4,"value":8.5} BinaryenExpressionGetType(expressions[809]); BinaryenConstGetValueF64(expressions[809]); getExpressionInfo(f64.const)={"id":14,"type":5,"value":9.5} +======= + expressions[817] = BinaryenConst(the_module, BinaryenLiteralInt32(5)); + BinaryenExpressionGetId(expressions[817]); + BinaryenExpressionGetType(expressions[817]); + BinaryenConstGetValueI32(expressions[817]); +getExpressionInfo(i32.const)={"id":14,"type":1,"value":5} + expressions[818] = BinaryenConst(the_module, BinaryenLiteralInt64(30064771078)); + BinaryenExpressionGetId(expressions[818]); + BinaryenExpressionGetType(expressions[818]); + BinaryenConstGetValueI64Low(expressions[818]); + BinaryenConstGetValueI64High(expressions[818]); +getExpressionInfo(i64.const)={"id":14,"type":2,"value":{"low":6,"high":7}} + expressions[819] = BinaryenConst(the_module, BinaryenLiteralFloat32(8.5)); + BinaryenExpressionGetId(expressions[819]); + BinaryenExpressionGetType(expressions[819]); + BinaryenConstGetValueF32(expressions[819]); +getExpressionInfo(f32.const)={"id":14,"type":3,"value":8.5} + expressions[820] = BinaryenConst(the_module, BinaryenLiteralFloat64(9.5)); + BinaryenExpressionGetId(expressions[820]); + BinaryenExpressionGetType(expressions[820]); + BinaryenConstGetValueF64(expressions[820]); +getExpressionInfo(f64.const)={"id":14,"type":4,"value":9.5} +>>>>>>> Add support for reference types proposal { BinaryenExpressionRef children[] = { expressions[24], expressions[26], expressions[28], expressions[30], expressions[32], expressions[34], expressions[36], expressions[38], expressions[40], expressions[42], expressions[44], @@ -5706,27 +5864,36 @@ getExpressionInfo(f64.const)={"id":14,"type":5,"value":9.5} expressions[707], expressions[709], expressions[711], expressions[712], expressions[713], expressions[715], expressions[721], expressions[726], expressions[733], expressions[735], expressions[737], expressions[740], expressions[742], expressions[744], expressions[746], expressions[748], expressions[749], expressions[750], - expressions[751], expressions[753], expressions[758], expressions[764], expressions[775], expressions[779], - expressions[784], expressions[788], expressions[789], expressions[791], expressions[793], expressions[795], - expressions[797], expressions[799], expressions[801], expressions[803], expressions[804], expressions[805] }; - expressions[810] = BinaryenBlock(the_module, "the-value", children, 299, 0); + expressions[751], expressions[753], expressions[758], expressions[764], expressions[766], expressions[768], + expressions[771], expressions[782], expressions[786], expressions[791], expressions[795], expressions[796], + expressions[798], expressions[800], expressions[802], expressions[804], expressions[806], expressions[808], + expressions[810], expressions[812], expressions[814], expressions[815], expressions[816] }; + expressions[821] = BinaryenBlock(the_module, "the-value", children, 304, 0); } - expressions[811] = BinaryenDrop(the_module, expressions[810]); + expressions[822] = BinaryenDrop(the_module, expressions[821]); { - BinaryenExpressionRef children[] = { expressions[811] }; - expressions[812] = BinaryenBlock(the_module, "the-nothing", children, 1, 0); + BinaryenExpressionRef children[] = { expressions[822] }; + expressions[823] = BinaryenBlock(the_module, "the-nothing", children, 1, 0); } - expressions[813] = BinaryenConst(the_module, BinaryenLiteralInt32(42)); + expressions[824] = BinaryenConst(the_module, BinaryenLiteralInt32(42)); { - BinaryenExpressionRef children[] = { expressions[812], expressions[813] }; - expressions[814] = BinaryenBlock(the_module, "the-body", children, 2, 0); + BinaryenExpressionRef children[] = { expressions[823], expressions[824] }; + expressions[825] = BinaryenBlock(the_module, "the-body", children, 2, 0); } { +<<<<<<< HEAD BinaryenType varTypes[] = { 2, 8 }; functions[0] = BinaryenAddFunction(the_module, "kitchen()sinker", functionTypes[0], varTypes, 2, expressions[814]); } expressions[815] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); globals[0] = BinaryenAddGlobal(the_module, "a-global", 2, 0, expressions[815]); +======= + BinaryenType varTypes[] = { 1, 9 }; + functions[0] = BinaryenAddFunction(the_module, "kitchen()sinker", functionTypes[1], varTypes, 2, expressions[825]); + } + expressions[826] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); + globals[0] = BinaryenAddGlobal(the_module, "a-global", 1, 0, expressions[826]); +>>>>>>> Add support for reference types proposal { BinaryenType paramTypes[] = { 2, 5 }; functionTypes[1] = BinaryenAddFunctionType(the_module, "fiF", 4, paramTypes, 2); @@ -5752,18 +5919,18 @@ getExpressionInfo(f64.const)={"id":14,"type":5,"value":9.5} BinaryenFunctionGetVar(functions[0], 0); BinaryenFunctionGetVar(functions[0], 1); BinaryenFunctionGetBody(functions[0]); - expressions[816] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); + expressions[827] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); { const char* funcNames[] = { "kitchen()sinker" }; - BinaryenSetFunctionTable(the_module, 1, 4294967295, funcNames, 1, expressions[816]); + BinaryenSetFunctionTable(the_module, 1, 4294967295, funcNames, 1, expressions[827]); } - expressions[817] = BinaryenConst(the_module, BinaryenLiteralInt32(10)); + expressions[828] = BinaryenConst(the_module, BinaryenLiteralInt32(10)); { const char segment0[] = { 104, 101, 108, 108, 111, 44, 32, 119, 111, 114, 108, 100 }; const char segment1[] = { 73, 32, 97, 109, 32, 112, 97, 115, 115, 105, 118, 101 }; const char* segments[] = { segment0, segment1 }; int8_t segmentPassive[] = { 0, 1 }; - BinaryenExpressionRef segmentOffsets[] = { expressions[817], expressions[0] }; + BinaryenExpressionRef segmentOffsets[] = { expressions[828], expressions[0] }; BinaryenIndex segmentSizes[] = { 12, 12 }; BinaryenSetMemory(the_module, 1, 256, "mem", segments, segmentPassive, segmentOffsets, segmentSizes, 2, 1); } @@ -5771,10 +5938,14 @@ getExpressionInfo(f64.const)={"id":14,"type":5,"value":9.5} BinaryenType paramTypes[] = { 0 }; functionTypes[2] = BinaryenAddFunctionType(the_module, "v", 0, paramTypes, 0); } - expressions[818] = BinaryenNop(the_module); + expressions[829] = BinaryenNop(the_module); { BinaryenType varTypes[] = { 0 }; +<<<<<<< HEAD functions[1] = BinaryenAddFunction(the_module, "starter", functionTypes[2], varTypes, 0, expressions[818]); +======= + functions[1] = BinaryenAddFunction(the_module, "starter", functionTypes[3], varTypes, 0, expressions[829]); +>>>>>>> Add support for reference types proposal } BinaryenSetStart(the_module, functions[1]); { @@ -7395,6 +7566,23 @@ getExpressionInfo(f64.const)={"id":14,"type":5,"value":9.5} (f64.const 3.7) (i32.const 2449) ) + (drop + (ref.is_null + (ref.null) + ) + ) + (drop + (ref.is_null + (ref.func "$kitchen()sinker") + ) + ) + (drop + (select (result funcref) + (ref.null) + (ref.func "$kitchen()sinker") + (i32.const 1) + ) + ) (try (throw $a-event (i32.const 0) @@ -7452,6 +7640,12 @@ getExpressionInfo(f64.const)={"id":14,"type":5,"value":9.5} (push (anyref.pop) ) + (push + (funcref.pop) + ) + (push + (nullref.pop) + ) (push (exnref.pop) ) @@ -9080,6 +9274,23 @@ getExpressionInfo(f64.const)={"id":14,"type":5,"value":9.5} (f64.const 3.7) (i32.const 2449) ) + (drop + (ref.is_null + (ref.null) + ) + ) + (drop + (ref.is_null + (ref.func "$kitchen()sinker") + ) + ) + (drop + (select (result funcref) + (ref.null) + (ref.func "$kitchen()sinker") + (i32.const 1) + ) + ) (try (throw $a-event (i32.const 0) @@ -9137,6 +9348,12 @@ getExpressionInfo(f64.const)={"id":14,"type":5,"value":9.5} (push (anyref.pop) ) + (push + (funcref.pop) + ) + (push + (nullref.pop) + ) (push (exnref.pop) ) @@ -10166,7 +10383,7 @@ module loaded from text form: ) ) -sizeof Literal: 24 +sizeof Literal: 32 (module (type $v (func)) (memory $0 1 256) @@ -10188,5 +10405,10 @@ sizeof Literal: 24 ) ) +<<<<<<< HEAD getExpressionInfo(memory.grow)={"id":20,"type":2,"op":1,"nameOperand":"","operands":[1]} getExpressionInfo(memory.grow)={"id":5,"type":1,"names":[""],"defaultName":"label","condition":0,"value":0} +======= +getExpressionInfo(memory.grow)={"id":20,"type":1,"op":1,"nameOperand":"","operands":[1]} +getExpressionInfo(memory.grow)={"id":5,"type":10,"names":[""],"defaultName":"label","condition":0,"value":0} +>>>>>>> Add support for reference types proposal diff --git a/test/binaryen.js/push-pop.js b/test/binaryen.js/push-pop.js index 1bc24963eda..6570e8ea25c 100644 --- a/test/binaryen.js/push-pop.js +++ b/test/binaryen.js/push-pop.js @@ -28,6 +28,8 @@ var func = module.addFunction("func", v, [], module.push(module.f64.pop()), module.push(module.v128.pop()), module.push(module.anyref.pop()), + module.push(module.funcref.pop()), + module.push(module.nullref.pop()), module.push(module.exnref.pop()) ] ) @@ -42,5 +44,7 @@ console.log("getExpressionInfo(f32.pop) = " + stringify(module.f32.pop())); console.log("getExpressionInfo(f64.pop) = " + stringify(module.f64.pop())); console.log("getExpressionInfo(v128.pop) = " + stringify(module.v128.pop())); console.log("getExpressionInfo(anyref.pop) = " + stringify(module.anyref.pop())); +console.log("getExpressionInfo(funcref.pop) = " + stringify(module.funcref.pop())); +console.log("getExpressionInfo(nullref.pop) = " + stringify(module.nullref.pop())); console.log("getExpressionInfo(exnref.pop) = " + stringify(module.exnref.pop())); console.log("getExpressionInfo(push) = " + stringify(module.push(module.i32.const(0)))); diff --git a/test/binaryen.js/push-pop.js.txt b/test/binaryen.js/push-pop.js.txt index 3d115cd90d0..f138427656f 100644 --- a/test/binaryen.js/push-pop.js.txt +++ b/test/binaryen.js/push-pop.js.txt @@ -19,12 +19,19 @@ (push (anyref.pop) ) + (push + (funcref.pop) + ) + (push + (nullref.pop) + ) (push (exnref.pop) ) ) ) +<<<<<<< HEAD getExpressionInfo(i32.pop) = {"id":39,"type":2} getExpressionInfo(i64.pop) = {"id":39,"type":3} getExpressionInfo(f32.pop) = {"id":39,"type":4} @@ -32,4 +39,15 @@ getExpressionInfo(f64.pop) = {"id":39,"type":5} getExpressionInfo(v128.pop) = {"id":39,"type":6} getExpressionInfo(anyref.pop) = {"id":39,"type":7} getExpressionInfo(exnref.pop) = {"id":39,"type":8} +======= +getExpressionInfo(i32.pop) = {"id":39,"type":1} +getExpressionInfo(i64.pop) = {"id":39,"type":2} +getExpressionInfo(f32.pop) = {"id":39,"type":3} +getExpressionInfo(f64.pop) = {"id":39,"type":4} +getExpressionInfo(v128.pop) = {"id":39,"type":5} +getExpressionInfo(anyref.pop) = {"id":39,"type":6} +getExpressionInfo(funcref.pop) = {"id":39,"type":7} +getExpressionInfo(nullref.pop) = {"id":39,"type":8} +getExpressionInfo(exnref.pop) = {"id":39,"type":9} +>>>>>>> Add support for reference types proposal getExpressionInfo(push) = {"id":38} diff --git a/test/example/c-api-kitchen-sink.c b/test/example/c-api-kitchen-sink.c index f438015b8a7..0a67aa50d58 100644 --- a/test/example/c-api-kitchen-sink.c +++ b/test/example/c-api-kitchen-sink.c @@ -270,6 +270,8 @@ void test_core() { temp10 = makeInt32(module, 1), temp11 = makeInt32(module, 3), temp12 = makeInt32(module, 5), temp13 = makeInt32(module, 10), temp14 = makeInt32(module, 11), temp15 = makeInt32(module, 110), temp16 = makeInt64(module, 111); + BinaryenExpressionRef nullref = BinaryenRefNull(module); + BinaryenExpressionRef funcref = BinaryenRefFunc(module, "kitchen()sinker"); // Events BinaryenAddEvent( @@ -651,13 +653,17 @@ void test_core() { module, 8, 0, 2, 8, BinaryenTypeFloat64(), makeInt32(module, 9)), BinaryenStore(module, 4, 0, 0, temp13, temp14, BinaryenTypeInt32()), BinaryenStore(module, 8, 2, 4, temp15, temp16, BinaryenTypeInt64()), - BinaryenSelect(module, temp10, temp11, temp12), + BinaryenSelect(module, temp10, temp11, temp12, BinaryenTypeAuto()), BinaryenReturn(module, makeInt32(module, 1337)), // Tail call BinaryenReturnCall( module, "kitchen()sinker", callOperands4, 4, BinaryenTypeInt32()), BinaryenReturnCallIndirect( module, makeInt32(module, 2449), callOperands4b, 4, "iiIfF"), + // Reference types + BinaryenRefIsNull(module, nullref), + BinaryenRefIsNull(module, funcref), + BinaryenSelect(module, temp10, nullref, funcref, BinaryenTypeFuncref()), // Exception handling BinaryenTry(module, tryBody, catchBody), // Atomics @@ -680,6 +686,9 @@ void test_core() { BinaryenPush(module, BinaryenPop(module, BinaryenTypeFloat64())), BinaryenPush(module, BinaryenPop(module, BinaryenTypeAnyref())), BinaryenPush(module, BinaryenPop(module, BinaryenTypeExnref())), + BinaryenPush(module, BinaryenPop(module, BinaryenTypeFuncref())), + BinaryenPush(module, BinaryenPop(module, BinaryenTypeNullref())), + BinaryenPush(module, BinaryenPop(module, BinaryenTypeExnref())), // TODO: Host BinaryenNop(module), diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt index 44f40ac4c00..260ab0d1a8d 100644 --- a/test/example/c-api-kitchen-sink.txt +++ b/test/example/c-api-kitchen-sink.txt @@ -1,3 +1,4 @@ +<<<<<<< HEAD // BinaryenTypeNone: 0 // BinaryenTypeUnreachable: 1 // BinaryenTypeInt32: 2 @@ -8,6 +9,18 @@ // BinaryenTypeAnyref: 7 // BinaryenTypeExnref: 8 // BinaryenTypeAuto: -1 +======= +BinaryenTypeNone: 0 +BinaryenTypeInt32: 1 +BinaryenTypeInt64: 2 +BinaryenTypeFloat32: 3 +BinaryenTypeFloat64: 4 +BinaryenTypeVec128: 5 +BinaryenTypeAnyref: 6 +BinaryenTypeExnref: 9 +BinaryenTypeUnreachable: 10 +BinaryenTypeAuto: -1 +>>>>>>> Add support for reference types proposal BinaryenFeatureMVP: 0 BinaryenFeatureAtomics: 1 BinaryenFeatureBulkMemory: 16 @@ -1628,6 +1641,23 @@ BinaryenFeatureAll: 511 (f64.const 3.7) (i32.const 2449) ) + (drop + (ref.is_null + (ref.null) + ) + ) + (drop + (ref.is_null + (ref.func "$kitchen()sinker") + ) + ) + (drop + (select (result funcref) + (ref.null) + (ref.func "$kitchen()sinker") + (i32.const 1) + ) + ) (try (throw $a-event (i32.const 0) @@ -1685,6 +1715,15 @@ BinaryenFeatureAll: 511 (push (exnref.pop) ) + (push + (funcref.pop) + ) + (push + (nullref.pop) + ) + (push + (exnref.pop) + ) (nop) (unreachable) ) @@ -2284,6 +2323,7 @@ int main() { expressions[31] = BinaryenConst(the_module, BinaryenLiteralInt32(11)); expressions[32] = BinaryenConst(the_module, BinaryenLiteralInt32(110)); expressions[33] = BinaryenConst(the_module, BinaryenLiteralInt64(111)); +<<<<<<< HEAD BinaryenAddEvent(the_module, "a-event", 0, 2, 0); expressions[34] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); { @@ -2320,1513 +2360,1566 @@ int main() { expressions[57] = BinaryenUnary(the_module, 13, expressions[56]); expressions[58] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); expressions[59] = BinaryenUnary(the_module, 14, expressions[58]); +======= + expressions[34] = BinaryenRefNull(the_module); + expressions[35] = BinaryenRefFunc(the_module, "kitchen()sinker"); + { + BinaryenType paramTypes[] = { 1 }; + functionTypes[1] = BinaryenAddFunctionType(the_module, "vi", 0, paramTypes, 1); + } + BinaryenAddEvent(the_module, "a-event", 0, functionTypes[1]); + expressions[36] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); + { + BinaryenExpressionRef operands[] = { expressions[36] }; + expressions[37] = BinaryenThrow(the_module, "a-event", operands, 1); + } + expressions[38] = BinaryenPop(the_module, 9); + expressions[39] = BinaryenLocalSet(the_module, 5, expressions[38]); + expressions[40] = BinaryenLocalGet(the_module, 5, 9); + expressions[41] = BinaryenBrOnExn(the_module, "try-block", "a-event", expressions[40]); + expressions[42] = BinaryenRethrow(the_module, expressions[41]); + { + BinaryenExpressionRef children[] = { expressions[42] }; + expressions[43] = BinaryenBlock(the_module, "try-block", children, 1, 1); + } + expressions[44] = BinaryenDrop(the_module, expressions[43]); + { + BinaryenExpressionRef children[] = { expressions[39], expressions[44] }; + expressions[45] = BinaryenBlock(the_module, NULL, children, 2, 0); + } + expressions[46] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[47] = BinaryenUnary(the_module, 0, expressions[46]); + expressions[48] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); + expressions[49] = BinaryenUnary(the_module, 3, expressions[48]); + expressions[50] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[51] = BinaryenUnary(the_module, 4, expressions[50]); + expressions[52] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); + expressions[53] = BinaryenUnary(the_module, 6, expressions[52]); + expressions[54] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); + expressions[55] = BinaryenUnary(the_module, 9, expressions[54]); + expressions[56] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); + expressions[57] = BinaryenUnary(the_module, 10, expressions[56]); + expressions[58] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); + expressions[59] = BinaryenUnary(the_module, 13, expressions[58]); +>>>>>>> Add support for reference types proposal expressions[60] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); - expressions[61] = BinaryenUnary(the_module, 16, expressions[60]); - expressions[62] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); - expressions[63] = BinaryenUnary(the_module, 19, expressions[62]); - expressions[64] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[65] = BinaryenUnary(the_module, 20, expressions[64]); + expressions[61] = BinaryenUnary(the_module, 14, expressions[60]); + expressions[62] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); + expressions[63] = BinaryenUnary(the_module, 16, expressions[62]); + expressions[64] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); + expressions[65] = BinaryenUnary(the_module, 19, expressions[64]); expressions[66] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[67] = BinaryenUnary(the_module, 22, expressions[66]); + expressions[67] = BinaryenUnary(the_module, 20, expressions[66]); expressions[68] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[69] = BinaryenUnary(the_module, 23, expressions[68]); - expressions[70] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); - expressions[71] = BinaryenUnary(the_module, 24, expressions[70]); - expressions[72] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); - expressions[73] = BinaryenUnary(the_module, 25, expressions[72]); + expressions[69] = BinaryenUnary(the_module, 22, expressions[68]); + expressions[70] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[71] = BinaryenUnary(the_module, 23, expressions[70]); + expressions[72] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); + expressions[73] = BinaryenUnary(the_module, 24, expressions[72]); expressions[74] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); - expressions[75] = BinaryenUnary(the_module, 26, expressions[74]); + expressions[75] = BinaryenUnary(the_module, 25, expressions[74]); expressions[76] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); - expressions[77] = BinaryenUnary(the_module, 27, expressions[76]); + expressions[77] = BinaryenUnary(the_module, 26, expressions[76]); expressions[78] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); - expressions[79] = BinaryenUnary(the_module, 28, expressions[78]); - expressions[80] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); - expressions[81] = BinaryenUnary(the_module, 29, expressions[80]); + expressions[79] = BinaryenUnary(the_module, 27, expressions[78]); + expressions[80] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); + expressions[81] = BinaryenUnary(the_module, 28, expressions[80]); expressions[82] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); - expressions[83] = BinaryenUnary(the_module, 30, expressions[82]); + expressions[83] = BinaryenUnary(the_module, 29, expressions[82]); expressions[84] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); - expressions[85] = BinaryenUnary(the_module, 31, expressions[84]); + expressions[85] = BinaryenUnary(the_module, 30, expressions[84]); expressions[86] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); - expressions[87] = BinaryenUnary(the_module, 32, expressions[86]); - expressions[88] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); - expressions[89] = BinaryenUnary(the_module, 52, expressions[88]); + expressions[87] = BinaryenUnary(the_module, 31, expressions[86]); + expressions[88] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); + expressions[89] = BinaryenUnary(the_module, 32, expressions[88]); expressions[90] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); - expressions[91] = BinaryenUnary(the_module, 56, expressions[90]); + expressions[91] = BinaryenUnary(the_module, 52, expressions[90]); expressions[92] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); - expressions[93] = BinaryenUnary(the_module, 53, expressions[92]); + expressions[93] = BinaryenUnary(the_module, 56, expressions[92]); expressions[94] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); - expressions[95] = BinaryenUnary(the_module, 57, expressions[94]); - expressions[96] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); - expressions[97] = BinaryenUnary(the_module, 54, expressions[96]); + expressions[95] = BinaryenUnary(the_module, 53, expressions[94]); + expressions[96] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); + expressions[97] = BinaryenUnary(the_module, 57, expressions[96]); expressions[98] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); - expressions[99] = BinaryenUnary(the_module, 58, expressions[98]); + expressions[99] = BinaryenUnary(the_module, 54, expressions[98]); expressions[100] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); - expressions[101] = BinaryenUnary(the_module, 55, expressions[100]); + expressions[101] = BinaryenUnary(the_module, 58, expressions[100]); expressions[102] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); - expressions[103] = BinaryenUnary(the_module, 59, expressions[102]); - expressions[104] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); - expressions[105] = BinaryenUnary(the_module, 33, expressions[104]); - expressions[106] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); - expressions[107] = BinaryenUnary(the_module, 34, expressions[106]); - expressions[108] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[109] = BinaryenUnary(the_module, 35, expressions[108]); + expressions[103] = BinaryenUnary(the_module, 55, expressions[102]); + expressions[104] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); + expressions[105] = BinaryenUnary(the_module, 59, expressions[104]); + expressions[106] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); + expressions[107] = BinaryenUnary(the_module, 33, expressions[106]); + expressions[108] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); + expressions[109] = BinaryenUnary(the_module, 34, expressions[108]); expressions[110] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[111] = BinaryenUnary(the_module, 36, expressions[110]); + expressions[111] = BinaryenUnary(the_module, 35, expressions[110]); expressions[112] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[113] = BinaryenUnary(the_module, 37, expressions[112]); + expressions[113] = BinaryenUnary(the_module, 36, expressions[112]); expressions[114] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[115] = BinaryenUnary(the_module, 38, expressions[114]); - expressions[116] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); - expressions[117] = BinaryenUnary(the_module, 39, expressions[116]); + expressions[115] = BinaryenUnary(the_module, 37, expressions[114]); + expressions[116] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[117] = BinaryenUnary(the_module, 38, expressions[116]); expressions[118] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); - expressions[119] = BinaryenUnary(the_module, 40, expressions[118]); + expressions[119] = BinaryenUnary(the_module, 39, expressions[118]); expressions[120] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); - expressions[121] = BinaryenUnary(the_module, 41, expressions[120]); + expressions[121] = BinaryenUnary(the_module, 40, expressions[120]); expressions[122] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); - expressions[123] = BinaryenUnary(the_module, 42, expressions[122]); - expressions[124] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); - expressions[125] = BinaryenUnary(the_module, 43, expressions[124]); - expressions[126] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); - expressions[127] = BinaryenUnary(the_module, 44, expressions[126]); - expressions[128] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[129] = BinaryenUnary(the_module, 45, expressions[128]); - expressions[130] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); - expressions[131] = BinaryenUnary(the_module, 46, expressions[130]); - expressions[132] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[133] = BinaryenUnary(the_module, 60, expressions[132]); + expressions[123] = BinaryenUnary(the_module, 41, expressions[122]); + expressions[124] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); + expressions[125] = BinaryenUnary(the_module, 42, expressions[124]); + expressions[126] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); + expressions[127] = BinaryenUnary(the_module, 43, expressions[126]); + expressions[128] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); + expressions[129] = BinaryenUnary(the_module, 44, expressions[128]); + expressions[130] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[131] = BinaryenUnary(the_module, 45, expressions[130]); + expressions[132] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); + expressions[133] = BinaryenUnary(the_module, 46, expressions[132]); expressions[134] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[135] = BinaryenUnary(the_module, 61, expressions[134]); + expressions[135] = BinaryenUnary(the_module, 60, expressions[134]); expressions[136] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[137] = BinaryenUnary(the_module, 62, expressions[136]); - expressions[138] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); - expressions[139] = BinaryenUnary(the_module, 63, expressions[138]); - expressions[140] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); - expressions[141] = BinaryenUnary(the_module, 64, expressions[140]); - expressions[142] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); - expressions[143] = BinaryenUnary(the_module, 65, expressions[142]); + expressions[137] = BinaryenUnary(the_module, 61, expressions[136]); + expressions[138] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[139] = BinaryenUnary(the_module, 62, expressions[138]); + expressions[140] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); + expressions[141] = BinaryenUnary(the_module, 63, expressions[140]); + expressions[142] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); + expressions[143] = BinaryenUnary(the_module, 64, expressions[142]); + expressions[144] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); + expressions[145] = BinaryenUnary(the_module, 65, expressions[144]); { uint8_t t1[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[144] = BinaryenConst(the_module, BinaryenLiteralVec128(t1)); + expressions[146] = BinaryenConst(the_module, BinaryenLiteralVec128(t1)); } - expressions[145] = BinaryenUnary(the_module, 66, expressions[144]); + expressions[147] = BinaryenUnary(the_module, 66, expressions[146]); { uint8_t t2[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[146] = BinaryenConst(the_module, BinaryenLiteralVec128(t2)); + expressions[148] = BinaryenConst(the_module, BinaryenLiteralVec128(t2)); } - expressions[147] = BinaryenUnary(the_module, 67, expressions[146]); + expressions[149] = BinaryenUnary(the_module, 67, expressions[148]); { uint8_t t3[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[148] = BinaryenConst(the_module, BinaryenLiteralVec128(t3)); + expressions[150] = BinaryenConst(the_module, BinaryenLiteralVec128(t3)); } - expressions[149] = BinaryenUnary(the_module, 68, expressions[148]); + expressions[151] = BinaryenUnary(the_module, 68, expressions[150]); { uint8_t t4[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[150] = BinaryenConst(the_module, BinaryenLiteralVec128(t4)); + expressions[152] = BinaryenConst(the_module, BinaryenLiteralVec128(t4)); } - expressions[151] = BinaryenUnary(the_module, 69, expressions[150]); + expressions[153] = BinaryenUnary(the_module, 69, expressions[152]); { uint8_t t5[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[152] = BinaryenConst(the_module, BinaryenLiteralVec128(t5)); + expressions[154] = BinaryenConst(the_module, BinaryenLiteralVec128(t5)); } - expressions[153] = BinaryenUnary(the_module, 70, expressions[152]); + expressions[155] = BinaryenUnary(the_module, 70, expressions[154]); { uint8_t t6[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[154] = BinaryenConst(the_module, BinaryenLiteralVec128(t6)); + expressions[156] = BinaryenConst(the_module, BinaryenLiteralVec128(t6)); } - expressions[155] = BinaryenUnary(the_module, 71, expressions[154]); + expressions[157] = BinaryenUnary(the_module, 71, expressions[156]); { uint8_t t7[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[156] = BinaryenConst(the_module, BinaryenLiteralVec128(t7)); + expressions[158] = BinaryenConst(the_module, BinaryenLiteralVec128(t7)); } - expressions[157] = BinaryenUnary(the_module, 72, expressions[156]); + expressions[159] = BinaryenUnary(the_module, 72, expressions[158]); { uint8_t t8[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[158] = BinaryenConst(the_module, BinaryenLiteralVec128(t8)); + expressions[160] = BinaryenConst(the_module, BinaryenLiteralVec128(t8)); } - expressions[159] = BinaryenUnary(the_module, 73, expressions[158]); + expressions[161] = BinaryenUnary(the_module, 73, expressions[160]); { uint8_t t9[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[160] = BinaryenConst(the_module, BinaryenLiteralVec128(t9)); + expressions[162] = BinaryenConst(the_module, BinaryenLiteralVec128(t9)); } - expressions[161] = BinaryenUnary(the_module, 74, expressions[160]); + expressions[163] = BinaryenUnary(the_module, 74, expressions[162]); { uint8_t t10[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[162] = BinaryenConst(the_module, BinaryenLiteralVec128(t10)); + expressions[164] = BinaryenConst(the_module, BinaryenLiteralVec128(t10)); } - expressions[163] = BinaryenUnary(the_module, 75, expressions[162]); + expressions[165] = BinaryenUnary(the_module, 75, expressions[164]); { uint8_t t11[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[164] = BinaryenConst(the_module, BinaryenLiteralVec128(t11)); + expressions[166] = BinaryenConst(the_module, BinaryenLiteralVec128(t11)); } - expressions[165] = BinaryenUnary(the_module, 76, expressions[164]); + expressions[167] = BinaryenUnary(the_module, 76, expressions[166]); { uint8_t t12[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[166] = BinaryenConst(the_module, BinaryenLiteralVec128(t12)); + expressions[168] = BinaryenConst(the_module, BinaryenLiteralVec128(t12)); } - expressions[167] = BinaryenUnary(the_module, 77, expressions[166]); + expressions[169] = BinaryenUnary(the_module, 77, expressions[168]); { uint8_t t13[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[168] = BinaryenConst(the_module, BinaryenLiteralVec128(t13)); + expressions[170] = BinaryenConst(the_module, BinaryenLiteralVec128(t13)); } - expressions[169] = BinaryenUnary(the_module, 78, expressions[168]); + expressions[171] = BinaryenUnary(the_module, 78, expressions[170]); { uint8_t t14[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[170] = BinaryenConst(the_module, BinaryenLiteralVec128(t14)); + expressions[172] = BinaryenConst(the_module, BinaryenLiteralVec128(t14)); } - expressions[171] = BinaryenUnary(the_module, 79, expressions[170]); + expressions[173] = BinaryenUnary(the_module, 79, expressions[172]); { uint8_t t15[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[172] = BinaryenConst(the_module, BinaryenLiteralVec128(t15)); + expressions[174] = BinaryenConst(the_module, BinaryenLiteralVec128(t15)); } - expressions[173] = BinaryenUnary(the_module, 80, expressions[172]); + expressions[175] = BinaryenUnary(the_module, 80, expressions[174]); { uint8_t t16[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[174] = BinaryenConst(the_module, BinaryenLiteralVec128(t16)); + expressions[176] = BinaryenConst(the_module, BinaryenLiteralVec128(t16)); } - expressions[175] = BinaryenUnary(the_module, 81, expressions[174]); + expressions[177] = BinaryenUnary(the_module, 81, expressions[176]); { uint8_t t17[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[176] = BinaryenConst(the_module, BinaryenLiteralVec128(t17)); + expressions[178] = BinaryenConst(the_module, BinaryenLiteralVec128(t17)); } - expressions[177] = BinaryenUnary(the_module, 82, expressions[176]); + expressions[179] = BinaryenUnary(the_module, 82, expressions[178]); { uint8_t t18[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[178] = BinaryenConst(the_module, BinaryenLiteralVec128(t18)); + expressions[180] = BinaryenConst(the_module, BinaryenLiteralVec128(t18)); } - expressions[179] = BinaryenUnary(the_module, 83, expressions[178]); + expressions[181] = BinaryenUnary(the_module, 83, expressions[180]); { uint8_t t19[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[180] = BinaryenConst(the_module, BinaryenLiteralVec128(t19)); + expressions[182] = BinaryenConst(the_module, BinaryenLiteralVec128(t19)); } - expressions[181] = BinaryenUnary(the_module, 84, expressions[180]); + expressions[183] = BinaryenUnary(the_module, 84, expressions[182]); { uint8_t t20[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[182] = BinaryenConst(the_module, BinaryenLiteralVec128(t20)); + expressions[184] = BinaryenConst(the_module, BinaryenLiteralVec128(t20)); } - expressions[183] = BinaryenUnary(the_module, 85, expressions[182]); + expressions[185] = BinaryenUnary(the_module, 85, expressions[184]); { uint8_t t21[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[184] = BinaryenConst(the_module, BinaryenLiteralVec128(t21)); + expressions[186] = BinaryenConst(the_module, BinaryenLiteralVec128(t21)); } - expressions[185] = BinaryenUnary(the_module, 86, expressions[184]); + expressions[187] = BinaryenUnary(the_module, 86, expressions[186]); { uint8_t t22[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[186] = BinaryenConst(the_module, BinaryenLiteralVec128(t22)); + expressions[188] = BinaryenConst(the_module, BinaryenLiteralVec128(t22)); } - expressions[187] = BinaryenUnary(the_module, 87, expressions[186]); + expressions[189] = BinaryenUnary(the_module, 87, expressions[188]); { uint8_t t23[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[188] = BinaryenConst(the_module, BinaryenLiteralVec128(t23)); + expressions[190] = BinaryenConst(the_module, BinaryenLiteralVec128(t23)); } - expressions[189] = BinaryenUnary(the_module, 88, expressions[188]); + expressions[191] = BinaryenUnary(the_module, 88, expressions[190]); { uint8_t t24[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[190] = BinaryenConst(the_module, BinaryenLiteralVec128(t24)); + expressions[192] = BinaryenConst(the_module, BinaryenLiteralVec128(t24)); } - expressions[191] = BinaryenUnary(the_module, 89, expressions[190]); + expressions[193] = BinaryenUnary(the_module, 89, expressions[192]); { uint8_t t25[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[192] = BinaryenConst(the_module, BinaryenLiteralVec128(t25)); + expressions[194] = BinaryenConst(the_module, BinaryenLiteralVec128(t25)); } - expressions[193] = BinaryenUnary(the_module, 90, expressions[192]); + expressions[195] = BinaryenUnary(the_module, 90, expressions[194]); { uint8_t t26[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[194] = BinaryenConst(the_module, BinaryenLiteralVec128(t26)); + expressions[196] = BinaryenConst(the_module, BinaryenLiteralVec128(t26)); } - expressions[195] = BinaryenUnary(the_module, 91, expressions[194]); + expressions[197] = BinaryenUnary(the_module, 91, expressions[196]); { uint8_t t27[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[196] = BinaryenConst(the_module, BinaryenLiteralVec128(t27)); + expressions[198] = BinaryenConst(the_module, BinaryenLiteralVec128(t27)); } - expressions[197] = BinaryenUnary(the_module, 92, expressions[196]); + expressions[199] = BinaryenUnary(the_module, 92, expressions[198]); { uint8_t t28[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[198] = BinaryenConst(the_module, BinaryenLiteralVec128(t28)); + expressions[200] = BinaryenConst(the_module, BinaryenLiteralVec128(t28)); } - expressions[199] = BinaryenUnary(the_module, 93, expressions[198]); + expressions[201] = BinaryenUnary(the_module, 93, expressions[200]); { uint8_t t29[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[200] = BinaryenConst(the_module, BinaryenLiteralVec128(t29)); + expressions[202] = BinaryenConst(the_module, BinaryenLiteralVec128(t29)); } - expressions[201] = BinaryenUnary(the_module, 94, expressions[200]); + expressions[203] = BinaryenUnary(the_module, 94, expressions[202]); { uint8_t t30[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[202] = BinaryenConst(the_module, BinaryenLiteralVec128(t30)); + expressions[204] = BinaryenConst(the_module, BinaryenLiteralVec128(t30)); } - expressions[203] = BinaryenUnary(the_module, 95, expressions[202]); + expressions[205] = BinaryenUnary(the_module, 95, expressions[204]); { uint8_t t31[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[204] = BinaryenConst(the_module, BinaryenLiteralVec128(t31)); + expressions[206] = BinaryenConst(the_module, BinaryenLiteralVec128(t31)); } - expressions[205] = BinaryenUnary(the_module, 96, expressions[204]); + expressions[207] = BinaryenUnary(the_module, 96, expressions[206]); { uint8_t t32[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[206] = BinaryenConst(the_module, BinaryenLiteralVec128(t32)); + expressions[208] = BinaryenConst(the_module, BinaryenLiteralVec128(t32)); } - expressions[207] = BinaryenUnary(the_module, 97, expressions[206]); + expressions[209] = BinaryenUnary(the_module, 97, expressions[208]); { uint8_t t33[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[208] = BinaryenConst(the_module, BinaryenLiteralVec128(t33)); + expressions[210] = BinaryenConst(the_module, BinaryenLiteralVec128(t33)); } - expressions[209] = BinaryenUnary(the_module, 98, expressions[208]); + expressions[211] = BinaryenUnary(the_module, 98, expressions[210]); { uint8_t t34[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[210] = BinaryenConst(the_module, BinaryenLiteralVec128(t34)); + expressions[212] = BinaryenConst(the_module, BinaryenLiteralVec128(t34)); } - expressions[211] = BinaryenUnary(the_module, 99, expressions[210]); + expressions[213] = BinaryenUnary(the_module, 99, expressions[212]); { uint8_t t35[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[212] = BinaryenConst(the_module, BinaryenLiteralVec128(t35)); - } - expressions[213] = BinaryenUnary(the_module, 100, expressions[212]); - expressions[214] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); - expressions[215] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[216] = BinaryenBinary(the_module, 0, expressions[215], expressions[214]); - expressions[217] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9007.33)); - expressions[218] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); - expressions[219] = BinaryenBinary(the_module, 64, expressions[218], expressions[217]); - expressions[220] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); - expressions[221] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[222] = BinaryenBinary(the_module, 3, expressions[221], expressions[220]); - expressions[223] = BinaryenConst(the_module, BinaryenLiteralInt64(-23)); - expressions[224] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); - expressions[225] = BinaryenBinary(the_module, 29, expressions[224], expressions[223]); - expressions[226] = BinaryenConst(the_module, BinaryenLiteralInt64(-23)); - expressions[227] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); - expressions[228] = BinaryenBinary(the_module, 30, expressions[227], expressions[226]); - expressions[229] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); - expressions[230] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[231] = BinaryenBinary(the_module, 6, expressions[230], expressions[229]); - expressions[232] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); - expressions[233] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[234] = BinaryenBinary(the_module, 7, expressions[233], expressions[232]); - expressions[235] = BinaryenConst(the_module, BinaryenLiteralInt64(-23)); - expressions[236] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); - expressions[237] = BinaryenBinary(the_module, 33, expressions[236], expressions[235]); - expressions[238] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); - expressions[239] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[240] = BinaryenBinary(the_module, 9, expressions[239], expressions[238]); - expressions[241] = BinaryenConst(the_module, BinaryenLiteralInt64(-23)); - expressions[242] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); - expressions[243] = BinaryenBinary(the_module, 35, expressions[242], expressions[241]); - expressions[244] = BinaryenConst(the_module, BinaryenLiteralInt64(-23)); - expressions[245] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); - expressions[246] = BinaryenBinary(the_module, 36, expressions[245], expressions[244]); - expressions[247] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); - expressions[248] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[249] = BinaryenBinary(the_module, 12, expressions[248], expressions[247]); - expressions[250] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); - expressions[251] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[252] = BinaryenBinary(the_module, 13, expressions[251], expressions[250]); - expressions[253] = BinaryenConst(the_module, BinaryenLiteralInt64(-23)); - expressions[254] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); - expressions[255] = BinaryenBinary(the_module, 39, expressions[254], expressions[253]); - expressions[256] = BinaryenConst(the_module, BinaryenLiteralFloat32(-62.5)); - expressions[257] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); - expressions[258] = BinaryenBinary(the_module, 53, expressions[257], expressions[256]); - expressions[259] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9007.33)); - expressions[260] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); - expressions[261] = BinaryenBinary(the_module, 67, expressions[260], expressions[259]); - expressions[262] = BinaryenConst(the_module, BinaryenLiteralFloat32(-62.5)); - expressions[263] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); - expressions[264] = BinaryenBinary(the_module, 55, expressions[263], expressions[262]); - expressions[265] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9007.33)); - expressions[266] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); - expressions[267] = BinaryenBinary(the_module, 69, expressions[266], expressions[265]); - expressions[268] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); - expressions[269] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[270] = BinaryenBinary(the_module, 15, expressions[269], expressions[268]); - expressions[271] = BinaryenConst(the_module, BinaryenLiteralFloat32(-62.5)); - expressions[272] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); - expressions[273] = BinaryenBinary(the_module, 58, expressions[272], expressions[271]); - expressions[274] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); - expressions[275] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[276] = BinaryenBinary(the_module, 17, expressions[275], expressions[274]); - expressions[277] = BinaryenConst(the_module, BinaryenLiteralInt64(-23)); - expressions[278] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); - expressions[279] = BinaryenBinary(the_module, 43, expressions[278], expressions[277]); - expressions[280] = BinaryenConst(the_module, BinaryenLiteralInt64(-23)); - expressions[281] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); - expressions[282] = BinaryenBinary(the_module, 44, expressions[281], expressions[280]); - expressions[283] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); - expressions[284] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[285] = BinaryenBinary(the_module, 20, expressions[284], expressions[283]); - expressions[286] = BinaryenConst(the_module, BinaryenLiteralInt64(-23)); - expressions[287] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); - expressions[288] = BinaryenBinary(the_module, 46, expressions[287], expressions[286]); - expressions[289] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); - expressions[290] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[291] = BinaryenBinary(the_module, 22, expressions[290], expressions[289]); - expressions[292] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); - expressions[293] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[294] = BinaryenBinary(the_module, 23, expressions[293], expressions[292]); - expressions[295] = BinaryenConst(the_module, BinaryenLiteralInt64(-23)); - expressions[296] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); - expressions[297] = BinaryenBinary(the_module, 49, expressions[296], expressions[295]); - expressions[298] = BinaryenConst(the_module, BinaryenLiteralFloat32(-62.5)); - expressions[299] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); - expressions[300] = BinaryenBinary(the_module, 59, expressions[299], expressions[298]); - expressions[301] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9007.33)); - expressions[302] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); - expressions[303] = BinaryenBinary(the_module, 73, expressions[302], expressions[301]); - expressions[304] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9007.33)); - expressions[305] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); - expressions[306] = BinaryenBinary(the_module, 74, expressions[305], expressions[304]); - expressions[307] = BinaryenConst(the_module, BinaryenLiteralFloat32(-62.5)); - expressions[308] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); - expressions[309] = BinaryenBinary(the_module, 62, expressions[308], expressions[307]); + expressions[214] = BinaryenConst(the_module, BinaryenLiteralVec128(t35)); + } + expressions[215] = BinaryenUnary(the_module, 100, expressions[214]); + expressions[216] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); + expressions[217] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[218] = BinaryenBinary(the_module, 0, expressions[217], expressions[216]); + expressions[219] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9007.33)); + expressions[220] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); + expressions[221] = BinaryenBinary(the_module, 64, expressions[220], expressions[219]); + expressions[222] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); + expressions[223] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[224] = BinaryenBinary(the_module, 3, expressions[223], expressions[222]); + expressions[225] = BinaryenConst(the_module, BinaryenLiteralInt64(-23)); + expressions[226] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); + expressions[227] = BinaryenBinary(the_module, 29, expressions[226], expressions[225]); + expressions[228] = BinaryenConst(the_module, BinaryenLiteralInt64(-23)); + expressions[229] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); + expressions[230] = BinaryenBinary(the_module, 30, expressions[229], expressions[228]); + expressions[231] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); + expressions[232] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[233] = BinaryenBinary(the_module, 6, expressions[232], expressions[231]); + expressions[234] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); + expressions[235] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[236] = BinaryenBinary(the_module, 7, expressions[235], expressions[234]); + expressions[237] = BinaryenConst(the_module, BinaryenLiteralInt64(-23)); + expressions[238] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); + expressions[239] = BinaryenBinary(the_module, 33, expressions[238], expressions[237]); + expressions[240] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); + expressions[241] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[242] = BinaryenBinary(the_module, 9, expressions[241], expressions[240]); + expressions[243] = BinaryenConst(the_module, BinaryenLiteralInt64(-23)); + expressions[244] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); + expressions[245] = BinaryenBinary(the_module, 35, expressions[244], expressions[243]); + expressions[246] = BinaryenConst(the_module, BinaryenLiteralInt64(-23)); + expressions[247] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); + expressions[248] = BinaryenBinary(the_module, 36, expressions[247], expressions[246]); + expressions[249] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); + expressions[250] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[251] = BinaryenBinary(the_module, 12, expressions[250], expressions[249]); + expressions[252] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); + expressions[253] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[254] = BinaryenBinary(the_module, 13, expressions[253], expressions[252]); + expressions[255] = BinaryenConst(the_module, BinaryenLiteralInt64(-23)); + expressions[256] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); + expressions[257] = BinaryenBinary(the_module, 39, expressions[256], expressions[255]); + expressions[258] = BinaryenConst(the_module, BinaryenLiteralFloat32(-62.5)); + expressions[259] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); + expressions[260] = BinaryenBinary(the_module, 53, expressions[259], expressions[258]); + expressions[261] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9007.33)); + expressions[262] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); + expressions[263] = BinaryenBinary(the_module, 67, expressions[262], expressions[261]); + expressions[264] = BinaryenConst(the_module, BinaryenLiteralFloat32(-62.5)); + expressions[265] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); + expressions[266] = BinaryenBinary(the_module, 55, expressions[265], expressions[264]); + expressions[267] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9007.33)); + expressions[268] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); + expressions[269] = BinaryenBinary(the_module, 69, expressions[268], expressions[267]); + expressions[270] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); + expressions[271] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[272] = BinaryenBinary(the_module, 15, expressions[271], expressions[270]); + expressions[273] = BinaryenConst(the_module, BinaryenLiteralFloat32(-62.5)); + expressions[274] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); + expressions[275] = BinaryenBinary(the_module, 58, expressions[274], expressions[273]); + expressions[276] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); + expressions[277] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[278] = BinaryenBinary(the_module, 17, expressions[277], expressions[276]); + expressions[279] = BinaryenConst(the_module, BinaryenLiteralInt64(-23)); + expressions[280] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); + expressions[281] = BinaryenBinary(the_module, 43, expressions[280], expressions[279]); + expressions[282] = BinaryenConst(the_module, BinaryenLiteralInt64(-23)); + expressions[283] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); + expressions[284] = BinaryenBinary(the_module, 44, expressions[283], expressions[282]); + expressions[285] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); + expressions[286] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[287] = BinaryenBinary(the_module, 20, expressions[286], expressions[285]); + expressions[288] = BinaryenConst(the_module, BinaryenLiteralInt64(-23)); + expressions[289] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); + expressions[290] = BinaryenBinary(the_module, 46, expressions[289], expressions[288]); + expressions[291] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); + expressions[292] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[293] = BinaryenBinary(the_module, 22, expressions[292], expressions[291]); + expressions[294] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); + expressions[295] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[296] = BinaryenBinary(the_module, 23, expressions[295], expressions[294]); + expressions[297] = BinaryenConst(the_module, BinaryenLiteralInt64(-23)); + expressions[298] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); + expressions[299] = BinaryenBinary(the_module, 49, expressions[298], expressions[297]); + expressions[300] = BinaryenConst(the_module, BinaryenLiteralFloat32(-62.5)); + expressions[301] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); + expressions[302] = BinaryenBinary(the_module, 59, expressions[301], expressions[300]); + expressions[303] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9007.33)); + expressions[304] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); + expressions[305] = BinaryenBinary(the_module, 73, expressions[304], expressions[303]); + expressions[306] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9007.33)); + expressions[307] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); + expressions[308] = BinaryenBinary(the_module, 74, expressions[307], expressions[306]); + expressions[309] = BinaryenConst(the_module, BinaryenLiteralFloat32(-62.5)); + expressions[310] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); + expressions[311] = BinaryenBinary(the_module, 62, expressions[310], expressions[309]); { uint8_t t36[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[310] = BinaryenConst(the_module, BinaryenLiteralVec128(t36)); + expressions[312] = BinaryenConst(the_module, BinaryenLiteralVec128(t36)); } { uint8_t t37[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[311] = BinaryenConst(the_module, BinaryenLiteralVec128(t37)); + expressions[313] = BinaryenConst(the_module, BinaryenLiteralVec128(t37)); } - expressions[312] = BinaryenBinary(the_module, 76, expressions[311], expressions[310]); + expressions[314] = BinaryenBinary(the_module, 76, expressions[313], expressions[312]); { uint8_t t38[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[313] = BinaryenConst(the_module, BinaryenLiteralVec128(t38)); + expressions[315] = BinaryenConst(the_module, BinaryenLiteralVec128(t38)); } { uint8_t t39[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[314] = BinaryenConst(the_module, BinaryenLiteralVec128(t39)); + expressions[316] = BinaryenConst(the_module, BinaryenLiteralVec128(t39)); } - expressions[315] = BinaryenBinary(the_module, 77, expressions[314], expressions[313]); + expressions[317] = BinaryenBinary(the_module, 77, expressions[316], expressions[315]); { uint8_t t40[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[316] = BinaryenConst(the_module, BinaryenLiteralVec128(t40)); + expressions[318] = BinaryenConst(the_module, BinaryenLiteralVec128(t40)); } { uint8_t t41[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[317] = BinaryenConst(the_module, BinaryenLiteralVec128(t41)); + expressions[319] = BinaryenConst(the_module, BinaryenLiteralVec128(t41)); } - expressions[318] = BinaryenBinary(the_module, 78, expressions[317], expressions[316]); + expressions[320] = BinaryenBinary(the_module, 78, expressions[319], expressions[318]); { uint8_t t42[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[319] = BinaryenConst(the_module, BinaryenLiteralVec128(t42)); + expressions[321] = BinaryenConst(the_module, BinaryenLiteralVec128(t42)); } { uint8_t t43[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[320] = BinaryenConst(the_module, BinaryenLiteralVec128(t43)); + expressions[322] = BinaryenConst(the_module, BinaryenLiteralVec128(t43)); } - expressions[321] = BinaryenBinary(the_module, 79, expressions[320], expressions[319]); + expressions[323] = BinaryenBinary(the_module, 79, expressions[322], expressions[321]); { uint8_t t44[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[322] = BinaryenConst(the_module, BinaryenLiteralVec128(t44)); + expressions[324] = BinaryenConst(the_module, BinaryenLiteralVec128(t44)); } { uint8_t t45[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[323] = BinaryenConst(the_module, BinaryenLiteralVec128(t45)); + expressions[325] = BinaryenConst(the_module, BinaryenLiteralVec128(t45)); } - expressions[324] = BinaryenBinary(the_module, 80, expressions[323], expressions[322]); + expressions[326] = BinaryenBinary(the_module, 80, expressions[325], expressions[324]); { uint8_t t46[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[325] = BinaryenConst(the_module, BinaryenLiteralVec128(t46)); + expressions[327] = BinaryenConst(the_module, BinaryenLiteralVec128(t46)); } { uint8_t t47[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[326] = BinaryenConst(the_module, BinaryenLiteralVec128(t47)); + expressions[328] = BinaryenConst(the_module, BinaryenLiteralVec128(t47)); } - expressions[327] = BinaryenBinary(the_module, 81, expressions[326], expressions[325]); + expressions[329] = BinaryenBinary(the_module, 81, expressions[328], expressions[327]); { uint8_t t48[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[328] = BinaryenConst(the_module, BinaryenLiteralVec128(t48)); + expressions[330] = BinaryenConst(the_module, BinaryenLiteralVec128(t48)); } { uint8_t t49[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[329] = BinaryenConst(the_module, BinaryenLiteralVec128(t49)); + expressions[331] = BinaryenConst(the_module, BinaryenLiteralVec128(t49)); } - expressions[330] = BinaryenBinary(the_module, 82, expressions[329], expressions[328]); + expressions[332] = BinaryenBinary(the_module, 82, expressions[331], expressions[330]); { uint8_t t50[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[331] = BinaryenConst(the_module, BinaryenLiteralVec128(t50)); + expressions[333] = BinaryenConst(the_module, BinaryenLiteralVec128(t50)); } { uint8_t t51[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[332] = BinaryenConst(the_module, BinaryenLiteralVec128(t51)); + expressions[334] = BinaryenConst(the_module, BinaryenLiteralVec128(t51)); } - expressions[333] = BinaryenBinary(the_module, 83, expressions[332], expressions[331]); + expressions[335] = BinaryenBinary(the_module, 83, expressions[334], expressions[333]); { uint8_t t52[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[334] = BinaryenConst(the_module, BinaryenLiteralVec128(t52)); + expressions[336] = BinaryenConst(the_module, BinaryenLiteralVec128(t52)); } { uint8_t t53[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[335] = BinaryenConst(the_module, BinaryenLiteralVec128(t53)); + expressions[337] = BinaryenConst(the_module, BinaryenLiteralVec128(t53)); } - expressions[336] = BinaryenBinary(the_module, 84, expressions[335], expressions[334]); + expressions[338] = BinaryenBinary(the_module, 84, expressions[337], expressions[336]); { uint8_t t54[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[337] = BinaryenConst(the_module, BinaryenLiteralVec128(t54)); + expressions[339] = BinaryenConst(the_module, BinaryenLiteralVec128(t54)); } { uint8_t t55[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[338] = BinaryenConst(the_module, BinaryenLiteralVec128(t55)); + expressions[340] = BinaryenConst(the_module, BinaryenLiteralVec128(t55)); } - expressions[339] = BinaryenBinary(the_module, 85, expressions[338], expressions[337]); + expressions[341] = BinaryenBinary(the_module, 85, expressions[340], expressions[339]); { uint8_t t56[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[340] = BinaryenConst(the_module, BinaryenLiteralVec128(t56)); + expressions[342] = BinaryenConst(the_module, BinaryenLiteralVec128(t56)); } { uint8_t t57[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[341] = BinaryenConst(the_module, BinaryenLiteralVec128(t57)); + expressions[343] = BinaryenConst(the_module, BinaryenLiteralVec128(t57)); } - expressions[342] = BinaryenBinary(the_module, 86, expressions[341], expressions[340]); + expressions[344] = BinaryenBinary(the_module, 86, expressions[343], expressions[342]); { uint8_t t58[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[343] = BinaryenConst(the_module, BinaryenLiteralVec128(t58)); + expressions[345] = BinaryenConst(the_module, BinaryenLiteralVec128(t58)); } { uint8_t t59[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[344] = BinaryenConst(the_module, BinaryenLiteralVec128(t59)); + expressions[346] = BinaryenConst(the_module, BinaryenLiteralVec128(t59)); } - expressions[345] = BinaryenBinary(the_module, 87, expressions[344], expressions[343]); + expressions[347] = BinaryenBinary(the_module, 87, expressions[346], expressions[345]); { uint8_t t60[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[346] = BinaryenConst(the_module, BinaryenLiteralVec128(t60)); + expressions[348] = BinaryenConst(the_module, BinaryenLiteralVec128(t60)); } { uint8_t t61[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[347] = BinaryenConst(the_module, BinaryenLiteralVec128(t61)); + expressions[349] = BinaryenConst(the_module, BinaryenLiteralVec128(t61)); } - expressions[348] = BinaryenBinary(the_module, 88, expressions[347], expressions[346]); + expressions[350] = BinaryenBinary(the_module, 88, expressions[349], expressions[348]); { uint8_t t62[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[349] = BinaryenConst(the_module, BinaryenLiteralVec128(t62)); + expressions[351] = BinaryenConst(the_module, BinaryenLiteralVec128(t62)); } { uint8_t t63[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[350] = BinaryenConst(the_module, BinaryenLiteralVec128(t63)); + expressions[352] = BinaryenConst(the_module, BinaryenLiteralVec128(t63)); } - expressions[351] = BinaryenBinary(the_module, 89, expressions[350], expressions[349]); + expressions[353] = BinaryenBinary(the_module, 89, expressions[352], expressions[351]); { uint8_t t64[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[352] = BinaryenConst(the_module, BinaryenLiteralVec128(t64)); + expressions[354] = BinaryenConst(the_module, BinaryenLiteralVec128(t64)); } { uint8_t t65[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[353] = BinaryenConst(the_module, BinaryenLiteralVec128(t65)); + expressions[355] = BinaryenConst(the_module, BinaryenLiteralVec128(t65)); } - expressions[354] = BinaryenBinary(the_module, 90, expressions[353], expressions[352]); + expressions[356] = BinaryenBinary(the_module, 90, expressions[355], expressions[354]); { uint8_t t66[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[355] = BinaryenConst(the_module, BinaryenLiteralVec128(t66)); + expressions[357] = BinaryenConst(the_module, BinaryenLiteralVec128(t66)); } { uint8_t t67[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[356] = BinaryenConst(the_module, BinaryenLiteralVec128(t67)); + expressions[358] = BinaryenConst(the_module, BinaryenLiteralVec128(t67)); } - expressions[357] = BinaryenBinary(the_module, 91, expressions[356], expressions[355]); + expressions[359] = BinaryenBinary(the_module, 91, expressions[358], expressions[357]); { uint8_t t68[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[358] = BinaryenConst(the_module, BinaryenLiteralVec128(t68)); + expressions[360] = BinaryenConst(the_module, BinaryenLiteralVec128(t68)); } { uint8_t t69[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[359] = BinaryenConst(the_module, BinaryenLiteralVec128(t69)); + expressions[361] = BinaryenConst(the_module, BinaryenLiteralVec128(t69)); } - expressions[360] = BinaryenBinary(the_module, 92, expressions[359], expressions[358]); + expressions[362] = BinaryenBinary(the_module, 92, expressions[361], expressions[360]); { uint8_t t70[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[361] = BinaryenConst(the_module, BinaryenLiteralVec128(t70)); + expressions[363] = BinaryenConst(the_module, BinaryenLiteralVec128(t70)); } { uint8_t t71[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[362] = BinaryenConst(the_module, BinaryenLiteralVec128(t71)); + expressions[364] = BinaryenConst(the_module, BinaryenLiteralVec128(t71)); } - expressions[363] = BinaryenBinary(the_module, 93, expressions[362], expressions[361]); + expressions[365] = BinaryenBinary(the_module, 93, expressions[364], expressions[363]); { uint8_t t72[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[364] = BinaryenConst(the_module, BinaryenLiteralVec128(t72)); + expressions[366] = BinaryenConst(the_module, BinaryenLiteralVec128(t72)); } { uint8_t t73[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[365] = BinaryenConst(the_module, BinaryenLiteralVec128(t73)); + expressions[367] = BinaryenConst(the_module, BinaryenLiteralVec128(t73)); } - expressions[366] = BinaryenBinary(the_module, 94, expressions[365], expressions[364]); + expressions[368] = BinaryenBinary(the_module, 94, expressions[367], expressions[366]); { uint8_t t74[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[367] = BinaryenConst(the_module, BinaryenLiteralVec128(t74)); + expressions[369] = BinaryenConst(the_module, BinaryenLiteralVec128(t74)); } { uint8_t t75[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[368] = BinaryenConst(the_module, BinaryenLiteralVec128(t75)); + expressions[370] = BinaryenConst(the_module, BinaryenLiteralVec128(t75)); } - expressions[369] = BinaryenBinary(the_module, 95, expressions[368], expressions[367]); + expressions[371] = BinaryenBinary(the_module, 95, expressions[370], expressions[369]); { uint8_t t76[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[370] = BinaryenConst(the_module, BinaryenLiteralVec128(t76)); + expressions[372] = BinaryenConst(the_module, BinaryenLiteralVec128(t76)); } { uint8_t t77[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[371] = BinaryenConst(the_module, BinaryenLiteralVec128(t77)); + expressions[373] = BinaryenConst(the_module, BinaryenLiteralVec128(t77)); } - expressions[372] = BinaryenBinary(the_module, 96, expressions[371], expressions[370]); + expressions[374] = BinaryenBinary(the_module, 96, expressions[373], expressions[372]); { uint8_t t78[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[373] = BinaryenConst(the_module, BinaryenLiteralVec128(t78)); + expressions[375] = BinaryenConst(the_module, BinaryenLiteralVec128(t78)); } { uint8_t t79[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[374] = BinaryenConst(the_module, BinaryenLiteralVec128(t79)); + expressions[376] = BinaryenConst(the_module, BinaryenLiteralVec128(t79)); } - expressions[375] = BinaryenBinary(the_module, 97, expressions[374], expressions[373]); + expressions[377] = BinaryenBinary(the_module, 97, expressions[376], expressions[375]); { uint8_t t80[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[376] = BinaryenConst(the_module, BinaryenLiteralVec128(t80)); + expressions[378] = BinaryenConst(the_module, BinaryenLiteralVec128(t80)); } { uint8_t t81[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[377] = BinaryenConst(the_module, BinaryenLiteralVec128(t81)); + expressions[379] = BinaryenConst(the_module, BinaryenLiteralVec128(t81)); } - expressions[378] = BinaryenBinary(the_module, 98, expressions[377], expressions[376]); + expressions[380] = BinaryenBinary(the_module, 98, expressions[379], expressions[378]); { uint8_t t82[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[379] = BinaryenConst(the_module, BinaryenLiteralVec128(t82)); + expressions[381] = BinaryenConst(the_module, BinaryenLiteralVec128(t82)); } { uint8_t t83[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[380] = BinaryenConst(the_module, BinaryenLiteralVec128(t83)); + expressions[382] = BinaryenConst(the_module, BinaryenLiteralVec128(t83)); } - expressions[381] = BinaryenBinary(the_module, 99, expressions[380], expressions[379]); + expressions[383] = BinaryenBinary(the_module, 99, expressions[382], expressions[381]); { uint8_t t84[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[382] = BinaryenConst(the_module, BinaryenLiteralVec128(t84)); + expressions[384] = BinaryenConst(the_module, BinaryenLiteralVec128(t84)); } { uint8_t t85[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[383] = BinaryenConst(the_module, BinaryenLiteralVec128(t85)); + expressions[385] = BinaryenConst(the_module, BinaryenLiteralVec128(t85)); } - expressions[384] = BinaryenBinary(the_module, 100, expressions[383], expressions[382]); + expressions[386] = BinaryenBinary(the_module, 100, expressions[385], expressions[384]); { uint8_t t86[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[385] = BinaryenConst(the_module, BinaryenLiteralVec128(t86)); + expressions[387] = BinaryenConst(the_module, BinaryenLiteralVec128(t86)); } { uint8_t t87[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[386] = BinaryenConst(the_module, BinaryenLiteralVec128(t87)); + expressions[388] = BinaryenConst(the_module, BinaryenLiteralVec128(t87)); } - expressions[387] = BinaryenBinary(the_module, 101, expressions[386], expressions[385]); + expressions[389] = BinaryenBinary(the_module, 101, expressions[388], expressions[387]); { uint8_t t88[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[388] = BinaryenConst(the_module, BinaryenLiteralVec128(t88)); + expressions[390] = BinaryenConst(the_module, BinaryenLiteralVec128(t88)); } { uint8_t t89[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[389] = BinaryenConst(the_module, BinaryenLiteralVec128(t89)); + expressions[391] = BinaryenConst(the_module, BinaryenLiteralVec128(t89)); } - expressions[390] = BinaryenBinary(the_module, 102, expressions[389], expressions[388]); + expressions[392] = BinaryenBinary(the_module, 102, expressions[391], expressions[390]); { uint8_t t90[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[391] = BinaryenConst(the_module, BinaryenLiteralVec128(t90)); + expressions[393] = BinaryenConst(the_module, BinaryenLiteralVec128(t90)); } { uint8_t t91[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[392] = BinaryenConst(the_module, BinaryenLiteralVec128(t91)); + expressions[394] = BinaryenConst(the_module, BinaryenLiteralVec128(t91)); } - expressions[393] = BinaryenBinary(the_module, 103, expressions[392], expressions[391]); + expressions[395] = BinaryenBinary(the_module, 103, expressions[394], expressions[393]); { uint8_t t92[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[394] = BinaryenConst(the_module, BinaryenLiteralVec128(t92)); + expressions[396] = BinaryenConst(the_module, BinaryenLiteralVec128(t92)); } { uint8_t t93[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[395] = BinaryenConst(the_module, BinaryenLiteralVec128(t93)); + expressions[397] = BinaryenConst(the_module, BinaryenLiteralVec128(t93)); } - expressions[396] = BinaryenBinary(the_module, 104, expressions[395], expressions[394]); + expressions[398] = BinaryenBinary(the_module, 104, expressions[397], expressions[396]); { uint8_t t94[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[397] = BinaryenConst(the_module, BinaryenLiteralVec128(t94)); + expressions[399] = BinaryenConst(the_module, BinaryenLiteralVec128(t94)); } { uint8_t t95[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[398] = BinaryenConst(the_module, BinaryenLiteralVec128(t95)); + expressions[400] = BinaryenConst(the_module, BinaryenLiteralVec128(t95)); } - expressions[399] = BinaryenBinary(the_module, 105, expressions[398], expressions[397]); + expressions[401] = BinaryenBinary(the_module, 105, expressions[400], expressions[399]); { uint8_t t96[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[400] = BinaryenConst(the_module, BinaryenLiteralVec128(t96)); + expressions[402] = BinaryenConst(the_module, BinaryenLiteralVec128(t96)); } { uint8_t t97[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[401] = BinaryenConst(the_module, BinaryenLiteralVec128(t97)); + expressions[403] = BinaryenConst(the_module, BinaryenLiteralVec128(t97)); } - expressions[402] = BinaryenBinary(the_module, 106, expressions[401], expressions[400]); + expressions[404] = BinaryenBinary(the_module, 106, expressions[403], expressions[402]); { uint8_t t98[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[403] = BinaryenConst(the_module, BinaryenLiteralVec128(t98)); + expressions[405] = BinaryenConst(the_module, BinaryenLiteralVec128(t98)); } { uint8_t t99[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[404] = BinaryenConst(the_module, BinaryenLiteralVec128(t99)); + expressions[406] = BinaryenConst(the_module, BinaryenLiteralVec128(t99)); } - expressions[405] = BinaryenBinary(the_module, 107, expressions[404], expressions[403]); + expressions[407] = BinaryenBinary(the_module, 107, expressions[406], expressions[405]); { uint8_t t100[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[406] = BinaryenConst(the_module, BinaryenLiteralVec128(t100)); + expressions[408] = BinaryenConst(the_module, BinaryenLiteralVec128(t100)); } { uint8_t t101[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[407] = BinaryenConst(the_module, BinaryenLiteralVec128(t101)); + expressions[409] = BinaryenConst(the_module, BinaryenLiteralVec128(t101)); } - expressions[408] = BinaryenBinary(the_module, 108, expressions[407], expressions[406]); + expressions[410] = BinaryenBinary(the_module, 108, expressions[409], expressions[408]); { uint8_t t102[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[409] = BinaryenConst(the_module, BinaryenLiteralVec128(t102)); + expressions[411] = BinaryenConst(the_module, BinaryenLiteralVec128(t102)); } { uint8_t t103[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[410] = BinaryenConst(the_module, BinaryenLiteralVec128(t103)); + expressions[412] = BinaryenConst(the_module, BinaryenLiteralVec128(t103)); } - expressions[411] = BinaryenBinary(the_module, 109, expressions[410], expressions[409]); + expressions[413] = BinaryenBinary(the_module, 109, expressions[412], expressions[411]); { uint8_t t104[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[412] = BinaryenConst(the_module, BinaryenLiteralVec128(t104)); + expressions[414] = BinaryenConst(the_module, BinaryenLiteralVec128(t104)); } { uint8_t t105[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[413] = BinaryenConst(the_module, BinaryenLiteralVec128(t105)); + expressions[415] = BinaryenConst(the_module, BinaryenLiteralVec128(t105)); } - expressions[414] = BinaryenBinary(the_module, 110, expressions[413], expressions[412]); + expressions[416] = BinaryenBinary(the_module, 110, expressions[415], expressions[414]); { uint8_t t106[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[415] = BinaryenConst(the_module, BinaryenLiteralVec128(t106)); + expressions[417] = BinaryenConst(the_module, BinaryenLiteralVec128(t106)); } { uint8_t t107[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[416] = BinaryenConst(the_module, BinaryenLiteralVec128(t107)); + expressions[418] = BinaryenConst(the_module, BinaryenLiteralVec128(t107)); } - expressions[417] = BinaryenBinary(the_module, 111, expressions[416], expressions[415]); + expressions[419] = BinaryenBinary(the_module, 111, expressions[418], expressions[417]); { uint8_t t108[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[418] = BinaryenConst(the_module, BinaryenLiteralVec128(t108)); + expressions[420] = BinaryenConst(the_module, BinaryenLiteralVec128(t108)); } { uint8_t t109[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[419] = BinaryenConst(the_module, BinaryenLiteralVec128(t109)); + expressions[421] = BinaryenConst(the_module, BinaryenLiteralVec128(t109)); } - expressions[420] = BinaryenBinary(the_module, 112, expressions[419], expressions[418]); + expressions[422] = BinaryenBinary(the_module, 112, expressions[421], expressions[420]); { uint8_t t110[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[421] = BinaryenConst(the_module, BinaryenLiteralVec128(t110)); + expressions[423] = BinaryenConst(the_module, BinaryenLiteralVec128(t110)); } { uint8_t t111[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[422] = BinaryenConst(the_module, BinaryenLiteralVec128(t111)); + expressions[424] = BinaryenConst(the_module, BinaryenLiteralVec128(t111)); } - expressions[423] = BinaryenBinary(the_module, 113, expressions[422], expressions[421]); + expressions[425] = BinaryenBinary(the_module, 113, expressions[424], expressions[423]); { uint8_t t112[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[424] = BinaryenConst(the_module, BinaryenLiteralVec128(t112)); + expressions[426] = BinaryenConst(the_module, BinaryenLiteralVec128(t112)); } { uint8_t t113[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[425] = BinaryenConst(the_module, BinaryenLiteralVec128(t113)); + expressions[427] = BinaryenConst(the_module, BinaryenLiteralVec128(t113)); } - expressions[426] = BinaryenBinary(the_module, 114, expressions[425], expressions[424]); + expressions[428] = BinaryenBinary(the_module, 114, expressions[427], expressions[426]); { uint8_t t114[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[427] = BinaryenConst(the_module, BinaryenLiteralVec128(t114)); + expressions[429] = BinaryenConst(the_module, BinaryenLiteralVec128(t114)); } { uint8_t t115[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[428] = BinaryenConst(the_module, BinaryenLiteralVec128(t115)); + expressions[430] = BinaryenConst(the_module, BinaryenLiteralVec128(t115)); } - expressions[429] = BinaryenBinary(the_module, 115, expressions[428], expressions[427]); + expressions[431] = BinaryenBinary(the_module, 115, expressions[430], expressions[429]); { uint8_t t116[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[430] = BinaryenConst(the_module, BinaryenLiteralVec128(t116)); + expressions[432] = BinaryenConst(the_module, BinaryenLiteralVec128(t116)); } { uint8_t t117[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[431] = BinaryenConst(the_module, BinaryenLiteralVec128(t117)); + expressions[433] = BinaryenConst(the_module, BinaryenLiteralVec128(t117)); } - expressions[432] = BinaryenBinary(the_module, 116, expressions[431], expressions[430]); + expressions[434] = BinaryenBinary(the_module, 116, expressions[433], expressions[432]); { uint8_t t118[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[433] = BinaryenConst(the_module, BinaryenLiteralVec128(t118)); + expressions[435] = BinaryenConst(the_module, BinaryenLiteralVec128(t118)); } { uint8_t t119[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[434] = BinaryenConst(the_module, BinaryenLiteralVec128(t119)); + expressions[436] = BinaryenConst(the_module, BinaryenLiteralVec128(t119)); } - expressions[435] = BinaryenBinary(the_module, 117, expressions[434], expressions[433]); + expressions[437] = BinaryenBinary(the_module, 117, expressions[436], expressions[435]); { uint8_t t120[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[436] = BinaryenConst(the_module, BinaryenLiteralVec128(t120)); + expressions[438] = BinaryenConst(the_module, BinaryenLiteralVec128(t120)); } { uint8_t t121[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[437] = BinaryenConst(the_module, BinaryenLiteralVec128(t121)); + expressions[439] = BinaryenConst(the_module, BinaryenLiteralVec128(t121)); } - expressions[438] = BinaryenBinary(the_module, 118, expressions[437], expressions[436]); + expressions[440] = BinaryenBinary(the_module, 118, expressions[439], expressions[438]); { uint8_t t122[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[439] = BinaryenConst(the_module, BinaryenLiteralVec128(t122)); + expressions[441] = BinaryenConst(the_module, BinaryenLiteralVec128(t122)); } { uint8_t t123[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[440] = BinaryenConst(the_module, BinaryenLiteralVec128(t123)); + expressions[442] = BinaryenConst(the_module, BinaryenLiteralVec128(t123)); } - expressions[441] = BinaryenBinary(the_module, 119, expressions[440], expressions[439]); + expressions[443] = BinaryenBinary(the_module, 119, expressions[442], expressions[441]); { uint8_t t124[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[442] = BinaryenConst(the_module, BinaryenLiteralVec128(t124)); + expressions[444] = BinaryenConst(the_module, BinaryenLiteralVec128(t124)); } { uint8_t t125[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[443] = BinaryenConst(the_module, BinaryenLiteralVec128(t125)); + expressions[445] = BinaryenConst(the_module, BinaryenLiteralVec128(t125)); } - expressions[444] = BinaryenBinary(the_module, 120, expressions[443], expressions[442]); + expressions[446] = BinaryenBinary(the_module, 120, expressions[445], expressions[444]); { uint8_t t126[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[445] = BinaryenConst(the_module, BinaryenLiteralVec128(t126)); + expressions[447] = BinaryenConst(the_module, BinaryenLiteralVec128(t126)); } { uint8_t t127[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[446] = BinaryenConst(the_module, BinaryenLiteralVec128(t127)); + expressions[448] = BinaryenConst(the_module, BinaryenLiteralVec128(t127)); } - expressions[447] = BinaryenBinary(the_module, 121, expressions[446], expressions[445]); + expressions[449] = BinaryenBinary(the_module, 121, expressions[448], expressions[447]); { uint8_t t128[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[448] = BinaryenConst(the_module, BinaryenLiteralVec128(t128)); + expressions[450] = BinaryenConst(the_module, BinaryenLiteralVec128(t128)); } { uint8_t t129[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[449] = BinaryenConst(the_module, BinaryenLiteralVec128(t129)); + expressions[451] = BinaryenConst(the_module, BinaryenLiteralVec128(t129)); } - expressions[450] = BinaryenBinary(the_module, 122, expressions[449], expressions[448]); + expressions[452] = BinaryenBinary(the_module, 122, expressions[451], expressions[450]); { uint8_t t130[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[451] = BinaryenConst(the_module, BinaryenLiteralVec128(t130)); + expressions[453] = BinaryenConst(the_module, BinaryenLiteralVec128(t130)); } { uint8_t t131[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[452] = BinaryenConst(the_module, BinaryenLiteralVec128(t131)); + expressions[454] = BinaryenConst(the_module, BinaryenLiteralVec128(t131)); } - expressions[453] = BinaryenBinary(the_module, 123, expressions[452], expressions[451]); + expressions[455] = BinaryenBinary(the_module, 123, expressions[454], expressions[453]); { uint8_t t132[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[454] = BinaryenConst(the_module, BinaryenLiteralVec128(t132)); + expressions[456] = BinaryenConst(the_module, BinaryenLiteralVec128(t132)); } { uint8_t t133[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[455] = BinaryenConst(the_module, BinaryenLiteralVec128(t133)); + expressions[457] = BinaryenConst(the_module, BinaryenLiteralVec128(t133)); } - expressions[456] = BinaryenBinary(the_module, 124, expressions[455], expressions[454]); + expressions[458] = BinaryenBinary(the_module, 124, expressions[457], expressions[456]); { uint8_t t134[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[457] = BinaryenConst(the_module, BinaryenLiteralVec128(t134)); + expressions[459] = BinaryenConst(the_module, BinaryenLiteralVec128(t134)); } { uint8_t t135[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[458] = BinaryenConst(the_module, BinaryenLiteralVec128(t135)); + expressions[460] = BinaryenConst(the_module, BinaryenLiteralVec128(t135)); } - expressions[459] = BinaryenBinary(the_module, 125, expressions[458], expressions[457]); + expressions[461] = BinaryenBinary(the_module, 125, expressions[460], expressions[459]); { uint8_t t136[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[460] = BinaryenConst(the_module, BinaryenLiteralVec128(t136)); + expressions[462] = BinaryenConst(the_module, BinaryenLiteralVec128(t136)); } { uint8_t t137[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[461] = BinaryenConst(the_module, BinaryenLiteralVec128(t137)); + expressions[463] = BinaryenConst(the_module, BinaryenLiteralVec128(t137)); } - expressions[462] = BinaryenBinary(the_module, 126, expressions[461], expressions[460]); + expressions[464] = BinaryenBinary(the_module, 126, expressions[463], expressions[462]); { uint8_t t138[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[463] = BinaryenConst(the_module, BinaryenLiteralVec128(t138)); + expressions[465] = BinaryenConst(the_module, BinaryenLiteralVec128(t138)); } { uint8_t t139[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[464] = BinaryenConst(the_module, BinaryenLiteralVec128(t139)); + expressions[466] = BinaryenConst(the_module, BinaryenLiteralVec128(t139)); } - expressions[465] = BinaryenBinary(the_module, 127, expressions[464], expressions[463]); + expressions[467] = BinaryenBinary(the_module, 127, expressions[466], expressions[465]); { uint8_t t140[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[466] = BinaryenConst(the_module, BinaryenLiteralVec128(t140)); + expressions[468] = BinaryenConst(the_module, BinaryenLiteralVec128(t140)); } { uint8_t t141[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[467] = BinaryenConst(the_module, BinaryenLiteralVec128(t141)); + expressions[469] = BinaryenConst(the_module, BinaryenLiteralVec128(t141)); } - expressions[468] = BinaryenBinary(the_module, 128, expressions[467], expressions[466]); + expressions[470] = BinaryenBinary(the_module, 128, expressions[469], expressions[468]); { uint8_t t142[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[469] = BinaryenConst(the_module, BinaryenLiteralVec128(t142)); + expressions[471] = BinaryenConst(the_module, BinaryenLiteralVec128(t142)); } { uint8_t t143[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[470] = BinaryenConst(the_module, BinaryenLiteralVec128(t143)); + expressions[472] = BinaryenConst(the_module, BinaryenLiteralVec128(t143)); } - expressions[471] = BinaryenBinary(the_module, 133, expressions[470], expressions[469]); + expressions[473] = BinaryenBinary(the_module, 133, expressions[472], expressions[471]); { uint8_t t144[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[472] = BinaryenConst(the_module, BinaryenLiteralVec128(t144)); + expressions[474] = BinaryenConst(the_module, BinaryenLiteralVec128(t144)); } { uint8_t t145[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[473] = BinaryenConst(the_module, BinaryenLiteralVec128(t145)); + expressions[475] = BinaryenConst(the_module, BinaryenLiteralVec128(t145)); } - expressions[474] = BinaryenBinary(the_module, 134, expressions[473], expressions[472]); + expressions[476] = BinaryenBinary(the_module, 134, expressions[475], expressions[474]); { uint8_t t146[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[475] = BinaryenConst(the_module, BinaryenLiteralVec128(t146)); + expressions[477] = BinaryenConst(the_module, BinaryenLiteralVec128(t146)); } { uint8_t t147[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[476] = BinaryenConst(the_module, BinaryenLiteralVec128(t147)); + expressions[478] = BinaryenConst(the_module, BinaryenLiteralVec128(t147)); } - expressions[477] = BinaryenBinary(the_module, 135, expressions[476], expressions[475]); + expressions[479] = BinaryenBinary(the_module, 135, expressions[478], expressions[477]); { uint8_t t148[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[478] = BinaryenConst(the_module, BinaryenLiteralVec128(t148)); + expressions[480] = BinaryenConst(the_module, BinaryenLiteralVec128(t148)); } { uint8_t t149[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[479] = BinaryenConst(the_module, BinaryenLiteralVec128(t149)); + expressions[481] = BinaryenConst(the_module, BinaryenLiteralVec128(t149)); } - expressions[480] = BinaryenBinary(the_module, 136, expressions[479], expressions[478]); + expressions[482] = BinaryenBinary(the_module, 136, expressions[481], expressions[480]); { uint8_t t150[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[481] = BinaryenConst(the_module, BinaryenLiteralVec128(t150)); + expressions[483] = BinaryenConst(the_module, BinaryenLiteralVec128(t150)); } { uint8_t t151[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[482] = BinaryenConst(the_module, BinaryenLiteralVec128(t151)); + expressions[484] = BinaryenConst(the_module, BinaryenLiteralVec128(t151)); } - expressions[483] = BinaryenBinary(the_module, 137, expressions[482], expressions[481]); + expressions[485] = BinaryenBinary(the_module, 137, expressions[484], expressions[483]); { uint8_t t152[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[484] = BinaryenConst(the_module, BinaryenLiteralVec128(t152)); + expressions[486] = BinaryenConst(the_module, BinaryenLiteralVec128(t152)); } { uint8_t t153[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[485] = BinaryenConst(the_module, BinaryenLiteralVec128(t153)); + expressions[487] = BinaryenConst(the_module, BinaryenLiteralVec128(t153)); } - expressions[486] = BinaryenBinary(the_module, 138, expressions[485], expressions[484]); + expressions[488] = BinaryenBinary(the_module, 138, expressions[487], expressions[486]); { uint8_t t154[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[487] = BinaryenConst(the_module, BinaryenLiteralVec128(t154)); + expressions[489] = BinaryenConst(the_module, BinaryenLiteralVec128(t154)); } { uint8_t t155[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[488] = BinaryenConst(the_module, BinaryenLiteralVec128(t155)); + expressions[490] = BinaryenConst(the_module, BinaryenLiteralVec128(t155)); } - expressions[489] = BinaryenBinary(the_module, 139, expressions[488], expressions[487]); + expressions[491] = BinaryenBinary(the_module, 139, expressions[490], expressions[489]); { uint8_t t156[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[490] = BinaryenConst(the_module, BinaryenLiteralVec128(t156)); + expressions[492] = BinaryenConst(the_module, BinaryenLiteralVec128(t156)); } { uint8_t t157[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[491] = BinaryenConst(the_module, BinaryenLiteralVec128(t157)); + expressions[493] = BinaryenConst(the_module, BinaryenLiteralVec128(t157)); } - expressions[492] = BinaryenBinary(the_module, 140, expressions[491], expressions[490]); + expressions[494] = BinaryenBinary(the_module, 140, expressions[493], expressions[492]); { uint8_t t158[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[493] = BinaryenConst(the_module, BinaryenLiteralVec128(t158)); + expressions[495] = BinaryenConst(the_module, BinaryenLiteralVec128(t158)); } { uint8_t t159[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[494] = BinaryenConst(the_module, BinaryenLiteralVec128(t159)); + expressions[496] = BinaryenConst(the_module, BinaryenLiteralVec128(t159)); } - expressions[495] = BinaryenBinary(the_module, 141, expressions[494], expressions[493]); + expressions[497] = BinaryenBinary(the_module, 141, expressions[496], expressions[495]); { uint8_t t160[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[496] = BinaryenConst(the_module, BinaryenLiteralVec128(t160)); + expressions[498] = BinaryenConst(the_module, BinaryenLiteralVec128(t160)); } { uint8_t t161[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[497] = BinaryenConst(the_module, BinaryenLiteralVec128(t161)); + expressions[499] = BinaryenConst(the_module, BinaryenLiteralVec128(t161)); } - expressions[498] = BinaryenBinary(the_module, 142, expressions[497], expressions[496]); + expressions[500] = BinaryenBinary(the_module, 142, expressions[499], expressions[498]); { uint8_t t162[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[499] = BinaryenConst(the_module, BinaryenLiteralVec128(t162)); + expressions[501] = BinaryenConst(the_module, BinaryenLiteralVec128(t162)); } { uint8_t t163[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[500] = BinaryenConst(the_module, BinaryenLiteralVec128(t163)); + expressions[502] = BinaryenConst(the_module, BinaryenLiteralVec128(t163)); } - expressions[501] = BinaryenBinary(the_module, 143, expressions[500], expressions[499]); + expressions[503] = BinaryenBinary(the_module, 143, expressions[502], expressions[501]); { uint8_t t164[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[502] = BinaryenConst(the_module, BinaryenLiteralVec128(t164)); + expressions[504] = BinaryenConst(the_module, BinaryenLiteralVec128(t164)); } { uint8_t t165[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[503] = BinaryenConst(the_module, BinaryenLiteralVec128(t165)); + expressions[505] = BinaryenConst(the_module, BinaryenLiteralVec128(t165)); } - expressions[504] = BinaryenBinary(the_module, 144, expressions[503], expressions[502]); + expressions[506] = BinaryenBinary(the_module, 144, expressions[505], expressions[504]); { uint8_t t166[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[505] = BinaryenConst(the_module, BinaryenLiteralVec128(t166)); + expressions[507] = BinaryenConst(the_module, BinaryenLiteralVec128(t166)); } { uint8_t t167[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[506] = BinaryenConst(the_module, BinaryenLiteralVec128(t167)); + expressions[508] = BinaryenConst(the_module, BinaryenLiteralVec128(t167)); } - expressions[507] = BinaryenBinary(the_module, 145, expressions[506], expressions[505]); + expressions[509] = BinaryenBinary(the_module, 145, expressions[508], expressions[507]); { uint8_t t168[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[508] = BinaryenConst(the_module, BinaryenLiteralVec128(t168)); + expressions[510] = BinaryenConst(the_module, BinaryenLiteralVec128(t168)); } { uint8_t t169[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[509] = BinaryenConst(the_module, BinaryenLiteralVec128(t169)); + expressions[511] = BinaryenConst(the_module, BinaryenLiteralVec128(t169)); } - expressions[510] = BinaryenBinary(the_module, 146, expressions[509], expressions[508]); + expressions[512] = BinaryenBinary(the_module, 146, expressions[511], expressions[510]); { uint8_t t170[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[511] = BinaryenConst(the_module, BinaryenLiteralVec128(t170)); + expressions[513] = BinaryenConst(the_module, BinaryenLiteralVec128(t170)); } { uint8_t t171[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[512] = BinaryenConst(the_module, BinaryenLiteralVec128(t171)); + expressions[514] = BinaryenConst(the_module, BinaryenLiteralVec128(t171)); } - expressions[513] = BinaryenBinary(the_module, 129, expressions[512], expressions[511]); + expressions[515] = BinaryenBinary(the_module, 129, expressions[514], expressions[513]); { uint8_t t172[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[514] = BinaryenConst(the_module, BinaryenLiteralVec128(t172)); + expressions[516] = BinaryenConst(the_module, BinaryenLiteralVec128(t172)); } { uint8_t t173[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[515] = BinaryenConst(the_module, BinaryenLiteralVec128(t173)); + expressions[517] = BinaryenConst(the_module, BinaryenLiteralVec128(t173)); } - expressions[516] = BinaryenBinary(the_module, 130, expressions[515], expressions[514]); + expressions[518] = BinaryenBinary(the_module, 130, expressions[517], expressions[516]); { uint8_t t174[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[517] = BinaryenConst(the_module, BinaryenLiteralVec128(t174)); + expressions[519] = BinaryenConst(the_module, BinaryenLiteralVec128(t174)); } { uint8_t t175[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[518] = BinaryenConst(the_module, BinaryenLiteralVec128(t175)); + expressions[520] = BinaryenConst(the_module, BinaryenLiteralVec128(t175)); } - expressions[519] = BinaryenBinary(the_module, 131, expressions[518], expressions[517]); + expressions[521] = BinaryenBinary(the_module, 131, expressions[520], expressions[519]); { uint8_t t176[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[520] = BinaryenConst(the_module, BinaryenLiteralVec128(t176)); + expressions[522] = BinaryenConst(the_module, BinaryenLiteralVec128(t176)); } { uint8_t t177[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[521] = BinaryenConst(the_module, BinaryenLiteralVec128(t177)); + expressions[523] = BinaryenConst(the_module, BinaryenLiteralVec128(t177)); } - expressions[522] = BinaryenBinary(the_module, 132, expressions[521], expressions[520]); + expressions[524] = BinaryenBinary(the_module, 132, expressions[523], expressions[522]); { uint8_t t178[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[523] = BinaryenConst(the_module, BinaryenLiteralVec128(t178)); + expressions[525] = BinaryenConst(the_module, BinaryenLiteralVec128(t178)); } { uint8_t t179[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[524] = BinaryenConst(the_module, BinaryenLiteralVec128(t179)); + expressions[526] = BinaryenConst(the_module, BinaryenLiteralVec128(t179)); } - expressions[525] = BinaryenBinary(the_module, 152, expressions[524], expressions[523]); + expressions[527] = BinaryenBinary(the_module, 152, expressions[526], expressions[525]); { uint8_t t180[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[526] = BinaryenConst(the_module, BinaryenLiteralVec128(t180)); + expressions[528] = BinaryenConst(the_module, BinaryenLiteralVec128(t180)); } { uint8_t t181[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[527] = BinaryenConst(the_module, BinaryenLiteralVec128(t181)); + expressions[529] = BinaryenConst(the_module, BinaryenLiteralVec128(t181)); } - expressions[528] = BinaryenBinary(the_module, 153, expressions[527], expressions[526]); + expressions[530] = BinaryenBinary(the_module, 153, expressions[529], expressions[528]); { uint8_t t182[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[529] = BinaryenConst(the_module, BinaryenLiteralVec128(t182)); + expressions[531] = BinaryenConst(the_module, BinaryenLiteralVec128(t182)); } { uint8_t t183[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[530] = BinaryenConst(the_module, BinaryenLiteralVec128(t183)); + expressions[532] = BinaryenConst(the_module, BinaryenLiteralVec128(t183)); } - expressions[531] = BinaryenBinary(the_module, 154, expressions[530], expressions[529]); + expressions[533] = BinaryenBinary(the_module, 154, expressions[532], expressions[531]); { uint8_t t184[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[532] = BinaryenConst(the_module, BinaryenLiteralVec128(t184)); + expressions[534] = BinaryenConst(the_module, BinaryenLiteralVec128(t184)); } { uint8_t t185[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[533] = BinaryenConst(the_module, BinaryenLiteralVec128(t185)); + expressions[535] = BinaryenConst(the_module, BinaryenLiteralVec128(t185)); } - expressions[534] = BinaryenBinary(the_module, 155, expressions[533], expressions[532]); + expressions[536] = BinaryenBinary(the_module, 155, expressions[535], expressions[534]); { uint8_t t186[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[535] = BinaryenConst(the_module, BinaryenLiteralVec128(t186)); + expressions[537] = BinaryenConst(the_module, BinaryenLiteralVec128(t186)); } { uint8_t t187[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[536] = BinaryenConst(the_module, BinaryenLiteralVec128(t187)); + expressions[538] = BinaryenConst(the_module, BinaryenLiteralVec128(t187)); } - expressions[537] = BinaryenBinary(the_module, 156, expressions[536], expressions[535]); + expressions[539] = BinaryenBinary(the_module, 156, expressions[538], expressions[537]); { uint8_t t188[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[538] = BinaryenConst(the_module, BinaryenLiteralVec128(t188)); + expressions[540] = BinaryenConst(the_module, BinaryenLiteralVec128(t188)); } { uint8_t t189[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[539] = BinaryenConst(the_module, BinaryenLiteralVec128(t189)); + expressions[541] = BinaryenConst(the_module, BinaryenLiteralVec128(t189)); } - expressions[540] = BinaryenBinary(the_module, 147, expressions[539], expressions[538]); + expressions[542] = BinaryenBinary(the_module, 147, expressions[541], expressions[540]); { uint8_t t190[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[541] = BinaryenConst(the_module, BinaryenLiteralVec128(t190)); + expressions[543] = BinaryenConst(the_module, BinaryenLiteralVec128(t190)); } { uint8_t t191[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[542] = BinaryenConst(the_module, BinaryenLiteralVec128(t191)); + expressions[544] = BinaryenConst(the_module, BinaryenLiteralVec128(t191)); } - expressions[543] = BinaryenBinary(the_module, 148, expressions[542], expressions[541]); + expressions[545] = BinaryenBinary(the_module, 148, expressions[544], expressions[543]); { uint8_t t192[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[544] = BinaryenConst(the_module, BinaryenLiteralVec128(t192)); + expressions[546] = BinaryenConst(the_module, BinaryenLiteralVec128(t192)); } { uint8_t t193[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[545] = BinaryenConst(the_module, BinaryenLiteralVec128(t193)); + expressions[547] = BinaryenConst(the_module, BinaryenLiteralVec128(t193)); } - expressions[546] = BinaryenBinary(the_module, 149, expressions[545], expressions[544]); + expressions[548] = BinaryenBinary(the_module, 149, expressions[547], expressions[546]); { uint8_t t194[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[547] = BinaryenConst(the_module, BinaryenLiteralVec128(t194)); + expressions[549] = BinaryenConst(the_module, BinaryenLiteralVec128(t194)); } { uint8_t t195[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[548] = BinaryenConst(the_module, BinaryenLiteralVec128(t195)); + expressions[550] = BinaryenConst(the_module, BinaryenLiteralVec128(t195)); } - expressions[549] = BinaryenBinary(the_module, 150, expressions[548], expressions[547]); + expressions[551] = BinaryenBinary(the_module, 150, expressions[550], expressions[549]); { uint8_t t196[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[550] = BinaryenConst(the_module, BinaryenLiteralVec128(t196)); + expressions[552] = BinaryenConst(the_module, BinaryenLiteralVec128(t196)); } { uint8_t t197[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[551] = BinaryenConst(the_module, BinaryenLiteralVec128(t197)); + expressions[553] = BinaryenConst(the_module, BinaryenLiteralVec128(t197)); } - expressions[552] = BinaryenBinary(the_module, 151, expressions[551], expressions[550]); + expressions[554] = BinaryenBinary(the_module, 151, expressions[553], expressions[552]); { uint8_t t198[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[553] = BinaryenConst(the_module, BinaryenLiteralVec128(t198)); + expressions[555] = BinaryenConst(the_module, BinaryenLiteralVec128(t198)); } { uint8_t t199[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[554] = BinaryenConst(the_module, BinaryenLiteralVec128(t199)); + expressions[556] = BinaryenConst(the_module, BinaryenLiteralVec128(t199)); } - expressions[555] = BinaryenBinary(the_module, 157, expressions[554], expressions[553]); + expressions[557] = BinaryenBinary(the_module, 157, expressions[556], expressions[555]); { uint8_t t200[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[556] = BinaryenConst(the_module, BinaryenLiteralVec128(t200)); + expressions[558] = BinaryenConst(the_module, BinaryenLiteralVec128(t200)); } { uint8_t t201[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[557] = BinaryenConst(the_module, BinaryenLiteralVec128(t201)); + expressions[559] = BinaryenConst(the_module, BinaryenLiteralVec128(t201)); } - expressions[558] = BinaryenBinary(the_module, 158, expressions[557], expressions[556]); + expressions[560] = BinaryenBinary(the_module, 158, expressions[559], expressions[558]); { uint8_t t202[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[559] = BinaryenConst(the_module, BinaryenLiteralVec128(t202)); + expressions[561] = BinaryenConst(the_module, BinaryenLiteralVec128(t202)); } { uint8_t t203[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[560] = BinaryenConst(the_module, BinaryenLiteralVec128(t203)); + expressions[562] = BinaryenConst(the_module, BinaryenLiteralVec128(t203)); } - expressions[561] = BinaryenBinary(the_module, 159, expressions[560], expressions[559]); + expressions[563] = BinaryenBinary(the_module, 159, expressions[562], expressions[561]); { uint8_t t204[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[562] = BinaryenConst(the_module, BinaryenLiteralVec128(t204)); + expressions[564] = BinaryenConst(the_module, BinaryenLiteralVec128(t204)); } { uint8_t t205[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[563] = BinaryenConst(the_module, BinaryenLiteralVec128(t205)); + expressions[565] = BinaryenConst(the_module, BinaryenLiteralVec128(t205)); } - expressions[564] = BinaryenBinary(the_module, 160, expressions[563], expressions[562]); + expressions[566] = BinaryenBinary(the_module, 160, expressions[565], expressions[564]); { uint8_t t206[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[565] = BinaryenConst(the_module, BinaryenLiteralVec128(t206)); + expressions[567] = BinaryenConst(the_module, BinaryenLiteralVec128(t206)); } { uint8_t t207[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[566] = BinaryenConst(the_module, BinaryenLiteralVec128(t207)); + expressions[568] = BinaryenConst(the_module, BinaryenLiteralVec128(t207)); } - expressions[567] = BinaryenBinary(the_module, 161, expressions[566], expressions[565]); + expressions[569] = BinaryenBinary(the_module, 161, expressions[568], expressions[567]); { uint8_t t208[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[568] = BinaryenConst(the_module, BinaryenLiteralVec128(t208)); + expressions[570] = BinaryenConst(the_module, BinaryenLiteralVec128(t208)); } { uint8_t t209[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[569] = BinaryenConst(the_module, BinaryenLiteralVec128(t209)); + expressions[571] = BinaryenConst(the_module, BinaryenLiteralVec128(t209)); } - expressions[570] = BinaryenBinary(the_module, 162, expressions[569], expressions[568]); + expressions[572] = BinaryenBinary(the_module, 162, expressions[571], expressions[570]); { uint8_t t210[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[571] = BinaryenConst(the_module, BinaryenLiteralVec128(t210)); + expressions[573] = BinaryenConst(the_module, BinaryenLiteralVec128(t210)); } { uint8_t t211[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[572] = BinaryenConst(the_module, BinaryenLiteralVec128(t211)); + expressions[574] = BinaryenConst(the_module, BinaryenLiteralVec128(t211)); } - expressions[573] = BinaryenBinary(the_module, 163, expressions[572], expressions[571]); + expressions[575] = BinaryenBinary(the_module, 163, expressions[574], expressions[573]); { uint8_t t212[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[574] = BinaryenConst(the_module, BinaryenLiteralVec128(t212)); + expressions[576] = BinaryenConst(the_module, BinaryenLiteralVec128(t212)); } { uint8_t t213[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[575] = BinaryenConst(the_module, BinaryenLiteralVec128(t213)); + expressions[577] = BinaryenConst(the_module, BinaryenLiteralVec128(t213)); } - expressions[576] = BinaryenBinary(the_module, 164, expressions[575], expressions[574]); + expressions[578] = BinaryenBinary(the_module, 164, expressions[577], expressions[576]); { uint8_t t214[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[577] = BinaryenConst(the_module, BinaryenLiteralVec128(t214)); + expressions[579] = BinaryenConst(the_module, BinaryenLiteralVec128(t214)); } { uint8_t t215[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[578] = BinaryenConst(the_module, BinaryenLiteralVec128(t215)); + expressions[580] = BinaryenConst(the_module, BinaryenLiteralVec128(t215)); } - expressions[579] = BinaryenBinary(the_module, 165, expressions[578], expressions[577]); + expressions[581] = BinaryenBinary(the_module, 165, expressions[580], expressions[579]); { uint8_t t216[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[580] = BinaryenConst(the_module, BinaryenLiteralVec128(t216)); + expressions[582] = BinaryenConst(the_module, BinaryenLiteralVec128(t216)); } { uint8_t t217[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[581] = BinaryenConst(the_module, BinaryenLiteralVec128(t217)); + expressions[583] = BinaryenConst(the_module, BinaryenLiteralVec128(t217)); } - expressions[582] = BinaryenBinary(the_module, 166, expressions[581], expressions[580]); + expressions[584] = BinaryenBinary(the_module, 166, expressions[583], expressions[582]); { uint8_t t218[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[583] = BinaryenConst(the_module, BinaryenLiteralVec128(t218)); + expressions[585] = BinaryenConst(the_module, BinaryenLiteralVec128(t218)); } { uint8_t t219[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[584] = BinaryenConst(the_module, BinaryenLiteralVec128(t219)); + expressions[586] = BinaryenConst(the_module, BinaryenLiteralVec128(t219)); } - expressions[585] = BinaryenBinary(the_module, 167, expressions[584], expressions[583]); + expressions[587] = BinaryenBinary(the_module, 167, expressions[586], expressions[585]); { uint8_t t220[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[586] = BinaryenConst(the_module, BinaryenLiteralVec128(t220)); + expressions[588] = BinaryenConst(the_module, BinaryenLiteralVec128(t220)); } { uint8_t t221[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[587] = BinaryenConst(the_module, BinaryenLiteralVec128(t221)); + expressions[589] = BinaryenConst(the_module, BinaryenLiteralVec128(t221)); } - expressions[588] = BinaryenBinary(the_module, 168, expressions[587], expressions[586]); + expressions[590] = BinaryenBinary(the_module, 168, expressions[589], expressions[588]); { uint8_t t222[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[589] = BinaryenConst(the_module, BinaryenLiteralVec128(t222)); + expressions[591] = BinaryenConst(the_module, BinaryenLiteralVec128(t222)); } { uint8_t t223[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[590] = BinaryenConst(the_module, BinaryenLiteralVec128(t223)); + expressions[592] = BinaryenConst(the_module, BinaryenLiteralVec128(t223)); } - expressions[591] = BinaryenBinary(the_module, 169, expressions[590], expressions[589]); + expressions[593] = BinaryenBinary(the_module, 169, expressions[592], expressions[591]); { uint8_t t224[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[592] = BinaryenConst(the_module, BinaryenLiteralVec128(t224)); + expressions[594] = BinaryenConst(the_module, BinaryenLiteralVec128(t224)); } { uint8_t t225[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[593] = BinaryenConst(the_module, BinaryenLiteralVec128(t225)); + expressions[595] = BinaryenConst(the_module, BinaryenLiteralVec128(t225)); } - expressions[594] = BinaryenBinary(the_module, 170, expressions[593], expressions[592]); + expressions[596] = BinaryenBinary(the_module, 170, expressions[595], expressions[594]); { uint8_t t226[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[595] = BinaryenConst(the_module, BinaryenLiteralVec128(t226)); + expressions[597] = BinaryenConst(the_module, BinaryenLiteralVec128(t226)); } - expressions[596] = BinaryenSIMDExtract(the_module, 0, expressions[595], 0); + expressions[598] = BinaryenSIMDExtract(the_module, 0, expressions[597], 0); { uint8_t t227[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[597] = BinaryenConst(the_module, BinaryenLiteralVec128(t227)); + expressions[599] = BinaryenConst(the_module, BinaryenLiteralVec128(t227)); } - expressions[598] = BinaryenSIMDExtract(the_module, 1, expressions[597], 0); + expressions[600] = BinaryenSIMDExtract(the_module, 1, expressions[599], 0); { uint8_t t228[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[599] = BinaryenConst(the_module, BinaryenLiteralVec128(t228)); + expressions[601] = BinaryenConst(the_module, BinaryenLiteralVec128(t228)); } - expressions[600] = BinaryenSIMDExtract(the_module, 2, expressions[599], 0); + expressions[602] = BinaryenSIMDExtract(the_module, 2, expressions[601], 0); { uint8_t t229[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[601] = BinaryenConst(the_module, BinaryenLiteralVec128(t229)); + expressions[603] = BinaryenConst(the_module, BinaryenLiteralVec128(t229)); } - expressions[602] = BinaryenSIMDExtract(the_module, 3, expressions[601], 0); + expressions[604] = BinaryenSIMDExtract(the_module, 3, expressions[603], 0); { uint8_t t230[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[603] = BinaryenConst(the_module, BinaryenLiteralVec128(t230)); + expressions[605] = BinaryenConst(the_module, BinaryenLiteralVec128(t230)); } - expressions[604] = BinaryenSIMDExtract(the_module, 4, expressions[603], 0); + expressions[606] = BinaryenSIMDExtract(the_module, 4, expressions[605], 0); { uint8_t t231[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[605] = BinaryenConst(the_module, BinaryenLiteralVec128(t231)); + expressions[607] = BinaryenConst(the_module, BinaryenLiteralVec128(t231)); } - expressions[606] = BinaryenSIMDExtract(the_module, 5, expressions[605], 0); + expressions[608] = BinaryenSIMDExtract(the_module, 5, expressions[607], 0); { uint8_t t232[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[607] = BinaryenConst(the_module, BinaryenLiteralVec128(t232)); + expressions[609] = BinaryenConst(the_module, BinaryenLiteralVec128(t232)); } - expressions[608] = BinaryenSIMDExtract(the_module, 6, expressions[607], 0); + expressions[610] = BinaryenSIMDExtract(the_module, 6, expressions[609], 0); { uint8_t t233[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[609] = BinaryenConst(the_module, BinaryenLiteralVec128(t233)); + expressions[611] = BinaryenConst(the_module, BinaryenLiteralVec128(t233)); } - expressions[610] = BinaryenSIMDExtract(the_module, 7, expressions[609], 0); - expressions[611] = BinaryenConst(the_module, BinaryenLiteralInt32(42)); + expressions[612] = BinaryenSIMDExtract(the_module, 7, expressions[611], 0); + expressions[613] = BinaryenConst(the_module, BinaryenLiteralInt32(42)); { uint8_t t234[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[612] = BinaryenConst(the_module, BinaryenLiteralVec128(t234)); + expressions[614] = BinaryenConst(the_module, BinaryenLiteralVec128(t234)); } - expressions[613] = BinaryenSIMDReplace(the_module, 0, expressions[612], 0, expressions[611]); - expressions[614] = BinaryenConst(the_module, BinaryenLiteralInt32(42)); + expressions[615] = BinaryenSIMDReplace(the_module, 0, expressions[614], 0, expressions[613]); + expressions[616] = BinaryenConst(the_module, BinaryenLiteralInt32(42)); { uint8_t t235[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[615] = BinaryenConst(the_module, BinaryenLiteralVec128(t235)); + expressions[617] = BinaryenConst(the_module, BinaryenLiteralVec128(t235)); } - expressions[616] = BinaryenSIMDReplace(the_module, 1, expressions[615], 0, expressions[614]); - expressions[617] = BinaryenConst(the_module, BinaryenLiteralInt32(42)); + expressions[618] = BinaryenSIMDReplace(the_module, 1, expressions[617], 0, expressions[616]); + expressions[619] = BinaryenConst(the_module, BinaryenLiteralInt32(42)); { uint8_t t236[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[618] = BinaryenConst(the_module, BinaryenLiteralVec128(t236)); + expressions[620] = BinaryenConst(the_module, BinaryenLiteralVec128(t236)); } - expressions[619] = BinaryenSIMDReplace(the_module, 2, expressions[618], 0, expressions[617]); - expressions[620] = BinaryenConst(the_module, BinaryenLiteralInt64(42)); + expressions[621] = BinaryenSIMDReplace(the_module, 2, expressions[620], 0, expressions[619]); + expressions[622] = BinaryenConst(the_module, BinaryenLiteralInt64(42)); { uint8_t t237[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[621] = BinaryenConst(the_module, BinaryenLiteralVec128(t237)); + expressions[623] = BinaryenConst(the_module, BinaryenLiteralVec128(t237)); } - expressions[622] = BinaryenSIMDReplace(the_module, 3, expressions[621], 0, expressions[620]); - expressions[623] = BinaryenConst(the_module, BinaryenLiteralFloat32(42)); + expressions[624] = BinaryenSIMDReplace(the_module, 3, expressions[623], 0, expressions[622]); + expressions[625] = BinaryenConst(the_module, BinaryenLiteralFloat32(42)); { uint8_t t238[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[624] = BinaryenConst(the_module, BinaryenLiteralVec128(t238)); + expressions[626] = BinaryenConst(the_module, BinaryenLiteralVec128(t238)); } - expressions[625] = BinaryenSIMDReplace(the_module, 4, expressions[624], 0, expressions[623]); - expressions[626] = BinaryenConst(the_module, BinaryenLiteralFloat64(42)); + expressions[627] = BinaryenSIMDReplace(the_module, 4, expressions[626], 0, expressions[625]); + expressions[628] = BinaryenConst(the_module, BinaryenLiteralFloat64(42)); { uint8_t t239[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[627] = BinaryenConst(the_module, BinaryenLiteralVec128(t239)); + expressions[629] = BinaryenConst(the_module, BinaryenLiteralVec128(t239)); } - expressions[628] = BinaryenSIMDReplace(the_module, 5, expressions[627], 0, expressions[626]); + expressions[630] = BinaryenSIMDReplace(the_module, 5, expressions[629], 0, expressions[628]); { uint8_t t240[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[629] = BinaryenConst(the_module, BinaryenLiteralVec128(t240)); + expressions[631] = BinaryenConst(the_module, BinaryenLiteralVec128(t240)); } - expressions[630] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); - expressions[631] = BinaryenSIMDShift(the_module, 0, expressions[629], expressions[630]); + expressions[632] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); + expressions[633] = BinaryenSIMDShift(the_module, 0, expressions[631], expressions[632]); { uint8_t t241[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[632] = BinaryenConst(the_module, BinaryenLiteralVec128(t241)); + expressions[634] = BinaryenConst(the_module, BinaryenLiteralVec128(t241)); } - expressions[633] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); - expressions[634] = BinaryenSIMDShift(the_module, 1, expressions[632], expressions[633]); + expressions[635] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); + expressions[636] = BinaryenSIMDShift(the_module, 1, expressions[634], expressions[635]); { uint8_t t242[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[635] = BinaryenConst(the_module, BinaryenLiteralVec128(t242)); + expressions[637] = BinaryenConst(the_module, BinaryenLiteralVec128(t242)); } - expressions[636] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); - expressions[637] = BinaryenSIMDShift(the_module, 2, expressions[635], expressions[636]); + expressions[638] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); + expressions[639] = BinaryenSIMDShift(the_module, 2, expressions[637], expressions[638]); { uint8_t t243[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[638] = BinaryenConst(the_module, BinaryenLiteralVec128(t243)); + expressions[640] = BinaryenConst(the_module, BinaryenLiteralVec128(t243)); } - expressions[639] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); - expressions[640] = BinaryenSIMDShift(the_module, 3, expressions[638], expressions[639]); + expressions[641] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); + expressions[642] = BinaryenSIMDShift(the_module, 3, expressions[640], expressions[641]); { uint8_t t244[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[641] = BinaryenConst(the_module, BinaryenLiteralVec128(t244)); + expressions[643] = BinaryenConst(the_module, BinaryenLiteralVec128(t244)); } - expressions[642] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); - expressions[643] = BinaryenSIMDShift(the_module, 4, expressions[641], expressions[642]); + expressions[644] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); + expressions[645] = BinaryenSIMDShift(the_module, 4, expressions[643], expressions[644]); { uint8_t t245[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[644] = BinaryenConst(the_module, BinaryenLiteralVec128(t245)); + expressions[646] = BinaryenConst(the_module, BinaryenLiteralVec128(t245)); } - expressions[645] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); - expressions[646] = BinaryenSIMDShift(the_module, 5, expressions[644], expressions[645]); + expressions[647] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); + expressions[648] = BinaryenSIMDShift(the_module, 5, expressions[646], expressions[647]); { uint8_t t246[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[647] = BinaryenConst(the_module, BinaryenLiteralVec128(t246)); + expressions[649] = BinaryenConst(the_module, BinaryenLiteralVec128(t246)); } - expressions[648] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); - expressions[649] = BinaryenSIMDShift(the_module, 6, expressions[647], expressions[648]); + expressions[650] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); + expressions[651] = BinaryenSIMDShift(the_module, 6, expressions[649], expressions[650]); { uint8_t t247[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[650] = BinaryenConst(the_module, BinaryenLiteralVec128(t247)); + expressions[652] = BinaryenConst(the_module, BinaryenLiteralVec128(t247)); } - expressions[651] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); - expressions[652] = BinaryenSIMDShift(the_module, 7, expressions[650], expressions[651]); + expressions[653] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); + expressions[654] = BinaryenSIMDShift(the_module, 7, expressions[652], expressions[653]); { uint8_t t248[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[653] = BinaryenConst(the_module, BinaryenLiteralVec128(t248)); + expressions[655] = BinaryenConst(the_module, BinaryenLiteralVec128(t248)); } - expressions[654] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); - expressions[655] = BinaryenSIMDShift(the_module, 8, expressions[653], expressions[654]); + expressions[656] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); + expressions[657] = BinaryenSIMDShift(the_module, 8, expressions[655], expressions[656]); { uint8_t t249[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[656] = BinaryenConst(the_module, BinaryenLiteralVec128(t249)); + expressions[658] = BinaryenConst(the_module, BinaryenLiteralVec128(t249)); } - expressions[657] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); - expressions[658] = BinaryenSIMDShift(the_module, 9, expressions[656], expressions[657]); + expressions[659] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); + expressions[660] = BinaryenSIMDShift(the_module, 9, expressions[658], expressions[659]); { uint8_t t250[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[659] = BinaryenConst(the_module, BinaryenLiteralVec128(t250)); + expressions[661] = BinaryenConst(the_module, BinaryenLiteralVec128(t250)); } - expressions[660] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); - expressions[661] = BinaryenSIMDShift(the_module, 10, expressions[659], expressions[660]); + expressions[662] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); + expressions[663] = BinaryenSIMDShift(the_module, 10, expressions[661], expressions[662]); { uint8_t t251[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[662] = BinaryenConst(the_module, BinaryenLiteralVec128(t251)); + expressions[664] = BinaryenConst(the_module, BinaryenLiteralVec128(t251)); } - expressions[663] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); - expressions[664] = BinaryenSIMDShift(the_module, 11, expressions[662], expressions[663]); - expressions[665] = BinaryenConst(the_module, BinaryenLiteralInt32(128)); - expressions[666] = BinaryenSIMDLoad(the_module, 0, 0, 1, expressions[665]); + expressions[665] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); + expressions[666] = BinaryenSIMDShift(the_module, 11, expressions[664], expressions[665]); expressions[667] = BinaryenConst(the_module, BinaryenLiteralInt32(128)); - expressions[668] = BinaryenSIMDLoad(the_module, 1, 16, 1, expressions[667]); + expressions[668] = BinaryenSIMDLoad(the_module, 0, 0, 1, expressions[667]); expressions[669] = BinaryenConst(the_module, BinaryenLiteralInt32(128)); - expressions[670] = BinaryenSIMDLoad(the_module, 2, 16, 4, expressions[669]); + expressions[670] = BinaryenSIMDLoad(the_module, 1, 16, 1, expressions[669]); expressions[671] = BinaryenConst(the_module, BinaryenLiteralInt32(128)); - expressions[672] = BinaryenSIMDLoad(the_module, 3, 0, 4, expressions[671]); + expressions[672] = BinaryenSIMDLoad(the_module, 2, 16, 4, expressions[671]); expressions[673] = BinaryenConst(the_module, BinaryenLiteralInt32(128)); - expressions[674] = BinaryenSIMDLoad(the_module, 4, 0, 8, expressions[673]); + expressions[674] = BinaryenSIMDLoad(the_module, 3, 0, 4, expressions[673]); expressions[675] = BinaryenConst(the_module, BinaryenLiteralInt32(128)); - expressions[676] = BinaryenSIMDLoad(the_module, 5, 0, 8, expressions[675]); + expressions[676] = BinaryenSIMDLoad(the_module, 4, 0, 8, expressions[675]); expressions[677] = BinaryenConst(the_module, BinaryenLiteralInt32(128)); - expressions[678] = BinaryenSIMDLoad(the_module, 6, 0, 8, expressions[677]); + expressions[678] = BinaryenSIMDLoad(the_module, 5, 0, 8, expressions[677]); expressions[679] = BinaryenConst(the_module, BinaryenLiteralInt32(128)); - expressions[680] = BinaryenSIMDLoad(the_module, 7, 0, 8, expressions[679]); + expressions[680] = BinaryenSIMDLoad(the_module, 6, 0, 8, expressions[679]); expressions[681] = BinaryenConst(the_module, BinaryenLiteralInt32(128)); - expressions[682] = BinaryenSIMDLoad(the_module, 8, 0, 8, expressions[681]); + expressions[682] = BinaryenSIMDLoad(the_module, 7, 0, 8, expressions[681]); expressions[683] = BinaryenConst(the_module, BinaryenLiteralInt32(128)); - expressions[684] = BinaryenSIMDLoad(the_module, 9, 0, 8, expressions[683]); + expressions[684] = BinaryenSIMDLoad(the_module, 8, 0, 8, expressions[683]); + expressions[685] = BinaryenConst(the_module, BinaryenLiteralInt32(128)); + expressions[686] = BinaryenSIMDLoad(the_module, 9, 0, 8, expressions[685]); { uint8_t t252[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[685] = BinaryenConst(the_module, BinaryenLiteralVec128(t252)); + expressions[687] = BinaryenConst(the_module, BinaryenLiteralVec128(t252)); } { uint8_t t253[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[686] = BinaryenConst(the_module, BinaryenLiteralVec128(t253)); + expressions[688] = BinaryenConst(the_module, BinaryenLiteralVec128(t253)); } { uint8_t mask[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - expressions[687] = BinaryenSIMDShuffle(the_module, expressions[685], expressions[686], mask); + expressions[689] = BinaryenSIMDShuffle(the_module, expressions[687], expressions[688], mask); } { uint8_t t254[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[688] = BinaryenConst(the_module, BinaryenLiteralVec128(t254)); + expressions[690] = BinaryenConst(the_module, BinaryenLiteralVec128(t254)); } { uint8_t t255[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[689] = BinaryenConst(the_module, BinaryenLiteralVec128(t255)); + expressions[691] = BinaryenConst(the_module, BinaryenLiteralVec128(t255)); } { uint8_t t256[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[690] = BinaryenConst(the_module, BinaryenLiteralVec128(t256)); + expressions[692] = BinaryenConst(the_module, BinaryenLiteralVec128(t256)); } - expressions[691] = BinaryenSIMDTernary(the_module, 0, expressions[688], expressions[689], expressions[690]); + expressions[693] = BinaryenSIMDTernary(the_module, 0, expressions[690], expressions[691], expressions[692]); { uint8_t t257[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[692] = BinaryenConst(the_module, BinaryenLiteralVec128(t257)); + expressions[694] = BinaryenConst(the_module, BinaryenLiteralVec128(t257)); } { uint8_t t258[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[693] = BinaryenConst(the_module, BinaryenLiteralVec128(t258)); + expressions[695] = BinaryenConst(the_module, BinaryenLiteralVec128(t258)); } { uint8_t t259[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[694] = BinaryenConst(the_module, BinaryenLiteralVec128(t259)); + expressions[696] = BinaryenConst(the_module, BinaryenLiteralVec128(t259)); } - expressions[695] = BinaryenSIMDTernary(the_module, 1, expressions[692], expressions[693], expressions[694]); + expressions[697] = BinaryenSIMDTernary(the_module, 1, expressions[694], expressions[695], expressions[696]); { uint8_t t260[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[696] = BinaryenConst(the_module, BinaryenLiteralVec128(t260)); + expressions[698] = BinaryenConst(the_module, BinaryenLiteralVec128(t260)); } { uint8_t t261[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[697] = BinaryenConst(the_module, BinaryenLiteralVec128(t261)); + expressions[699] = BinaryenConst(the_module, BinaryenLiteralVec128(t261)); } { uint8_t t262[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[698] = BinaryenConst(the_module, BinaryenLiteralVec128(t262)); + expressions[700] = BinaryenConst(the_module, BinaryenLiteralVec128(t262)); } - expressions[699] = BinaryenSIMDTernary(the_module, 2, expressions[696], expressions[697], expressions[698]); + expressions[701] = BinaryenSIMDTernary(the_module, 2, expressions[698], expressions[699], expressions[700]); { uint8_t t263[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[700] = BinaryenConst(the_module, BinaryenLiteralVec128(t263)); + expressions[702] = BinaryenConst(the_module, BinaryenLiteralVec128(t263)); } { uint8_t t264[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[701] = BinaryenConst(the_module, BinaryenLiteralVec128(t264)); + expressions[703] = BinaryenConst(the_module, BinaryenLiteralVec128(t264)); } { uint8_t t265[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[702] = BinaryenConst(the_module, BinaryenLiteralVec128(t265)); + expressions[704] = BinaryenConst(the_module, BinaryenLiteralVec128(t265)); } - expressions[703] = BinaryenSIMDTernary(the_module, 3, expressions[700], expressions[701], expressions[702]); + expressions[705] = BinaryenSIMDTernary(the_module, 3, expressions[702], expressions[703], expressions[704]); { uint8_t t266[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[704] = BinaryenConst(the_module, BinaryenLiteralVec128(t266)); + expressions[706] = BinaryenConst(the_module, BinaryenLiteralVec128(t266)); } { uint8_t t267[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[705] = BinaryenConst(the_module, BinaryenLiteralVec128(t267)); + expressions[707] = BinaryenConst(the_module, BinaryenLiteralVec128(t267)); } { uint8_t t268[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - expressions[706] = BinaryenConst(the_module, BinaryenLiteralVec128(t268)); - } - expressions[707] = BinaryenSIMDTernary(the_module, 4, expressions[704], expressions[705], expressions[706]); - expressions[708] = BinaryenConst(the_module, BinaryenLiteralInt32(1024)); - expressions[709] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); - expressions[710] = BinaryenConst(the_module, BinaryenLiteralInt32(12)); - expressions[711] = BinaryenMemoryInit(the_module, 0, expressions[708], expressions[709], expressions[710]); - expressions[712] = BinaryenDataDrop(the_module, 0); - expressions[713] = BinaryenConst(the_module, BinaryenLiteralInt32(2048)); - expressions[714] = BinaryenConst(the_module, BinaryenLiteralInt32(1024)); - expressions[715] = BinaryenConst(the_module, BinaryenLiteralInt32(12)); - expressions[716] = BinaryenMemoryCopy(the_module, expressions[713], expressions[714], expressions[715]); - expressions[717] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); - expressions[718] = BinaryenConst(the_module, BinaryenLiteralInt32(42)); - expressions[719] = BinaryenConst(the_module, BinaryenLiteralInt32(1024)); - expressions[720] = BinaryenMemoryFill(the_module, expressions[717], expressions[718], expressions[719]); + expressions[708] = BinaryenConst(the_module, BinaryenLiteralVec128(t268)); + } + expressions[709] = BinaryenSIMDTernary(the_module, 4, expressions[706], expressions[707], expressions[708]); + expressions[710] = BinaryenConst(the_module, BinaryenLiteralInt32(1024)); + expressions[711] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); + expressions[712] = BinaryenConst(the_module, BinaryenLiteralInt32(12)); + expressions[713] = BinaryenMemoryInit(the_module, 0, expressions[710], expressions[711], expressions[712]); + expressions[714] = BinaryenDataDrop(the_module, 0); + expressions[715] = BinaryenConst(the_module, BinaryenLiteralInt32(2048)); + expressions[716] = BinaryenConst(the_module, BinaryenLiteralInt32(1024)); + expressions[717] = BinaryenConst(the_module, BinaryenLiteralInt32(12)); + expressions[718] = BinaryenMemoryCopy(the_module, expressions[715], expressions[716], expressions[717]); + expressions[719] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); + expressions[720] = BinaryenConst(the_module, BinaryenLiteralInt32(42)); + expressions[721] = BinaryenConst(the_module, BinaryenLiteralInt32(1024)); + expressions[722] = BinaryenMemoryFill(the_module, expressions[719], expressions[720], expressions[721]); { BinaryenExpressionRef children[] = { 0 }; - expressions[721] = BinaryenBlock(the_module, NULL, children, 0, BinaryenTypeAuto()); + expressions[723] = BinaryenBlock(the_module, NULL, children, 0, BinaryenTypeAuto()); } - expressions[722] = BinaryenIf(the_module, expressions[18], expressions[19], expressions[20]); - expressions[723] = BinaryenIf(the_module, expressions[21], expressions[22], expressions[0]); - expressions[724] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); - expressions[725] = BinaryenLoop(the_module, "in", expressions[724]); + expressions[724] = BinaryenIf(the_module, expressions[18], expressions[19], expressions[20]); + expressions[725] = BinaryenIf(the_module, expressions[21], expressions[22], expressions[0]); expressions[726] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); - expressions[727] = BinaryenLoop(the_module, NULL, expressions[726]); - expressions[728] = BinaryenBreak(the_module, "the-value", expressions[23], expressions[24]); - expressions[729] = BinaryenConst(the_module, BinaryenLiteralInt32(2)); - expressions[730] = BinaryenBreak(the_module, "the-nothing", expressions[729], expressions[0]); - expressions[731] = BinaryenConst(the_module, BinaryenLiteralInt32(3)); - expressions[732] = BinaryenBreak(the_module, "the-value", expressions[0], expressions[731]); - expressions[733] = BinaryenBreak(the_module, "the-nothing", expressions[0], expressions[0]); + expressions[727] = BinaryenLoop(the_module, "in", expressions[726]); + expressions[728] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); + expressions[729] = BinaryenLoop(the_module, NULL, expressions[728]); + expressions[730] = BinaryenBreak(the_module, "the-value", expressions[23], expressions[24]); + expressions[731] = BinaryenConst(the_module, BinaryenLiteralInt32(2)); + expressions[732] = BinaryenBreak(the_module, "the-nothing", expressions[731], expressions[0]); + expressions[733] = BinaryenConst(the_module, BinaryenLiteralInt32(3)); + expressions[734] = BinaryenBreak(the_module, "the-value", expressions[0], expressions[733]); + expressions[735] = BinaryenBreak(the_module, "the-nothing", expressions[0], expressions[0]); { const char* names[] = { "the-value" }; - expressions[734] = BinaryenSwitch(the_module, names, 1, "the-value", expressions[25], expressions[26]); + expressions[736] = BinaryenSwitch(the_module, names, 1, "the-value", expressions[25], expressions[26]); } - expressions[735] = BinaryenConst(the_module, BinaryenLiteralInt32(2)); + expressions[737] = BinaryenConst(the_module, BinaryenLiteralInt32(2)); { const char* names[] = { "the-nothing" }; - expressions[736] = BinaryenSwitch(the_module, names, 1, "the-nothing", expressions[735], expressions[0]); + expressions[738] = BinaryenSwitch(the_module, names, 1, "the-nothing", expressions[737], expressions[0]); } { BinaryenExpressionRef operands[] = { expressions[10], expressions[11], expressions[12], expressions[13] }; +<<<<<<< HEAD expressions[737] = BinaryenCall(the_module, "kitchen()sinker", operands, 4, 2); +======= + expressions[739] = BinaryenCall(the_module, "kitchen()sinker", operands, 4, 1); +>>>>>>> Add support for reference types proposal } - expressions[738] = BinaryenUnary(the_module, 20, expressions[737]); + expressions[740] = BinaryenUnary(the_module, 20, expressions[739]); { BinaryenExpressionRef operands[] = { expressions[8], expressions[9] }; +<<<<<<< HEAD expressions[739] = BinaryenCall(the_module, "an-imported", operands, 2, 4); +======= + expressions[741] = BinaryenCall(the_module, "an-imported", operands, 2, 3); +>>>>>>> Add support for reference types proposal } - expressions[740] = BinaryenUnary(the_module, 25, expressions[739]); - expressions[741] = BinaryenUnary(the_module, 20, expressions[740]); - expressions[742] = BinaryenConst(the_module, BinaryenLiteralInt32(2449)); + expressions[742] = BinaryenUnary(the_module, 25, expressions[741]); + expressions[743] = BinaryenUnary(the_module, 20, expressions[742]); + expressions[744] = BinaryenConst(the_module, BinaryenLiteralInt32(2449)); { BinaryenExpressionRef operands[] = { expressions[14], expressions[15], expressions[16], expressions[17] }; +<<<<<<< HEAD expressions[743] = BinaryenCallIndirect(the_module, expressions[742], operands, 4, "iiIfF"); } expressions[744] = BinaryenUnary(the_module, 20, expressions[743]); @@ -3853,10 +3946,39 @@ int main() { { BinaryenExpressionRef operands[] = { expressions[10], expressions[11], expressions[12], expressions[13] }; expressions[765] = BinaryenReturnCall(the_module, "kitchen()sinker", operands, 4, 2); +======= + expressions[745] = BinaryenCallIndirect(the_module, expressions[744], operands, 4, "iiIfF"); + } + expressions[746] = BinaryenUnary(the_module, 20, expressions[745]); + expressions[747] = BinaryenLocalGet(the_module, 0, 1); + expressions[748] = BinaryenDrop(the_module, expressions[747]); + expressions[749] = BinaryenConst(the_module, BinaryenLiteralInt32(101)); + expressions[750] = BinaryenLocalSet(the_module, 0, expressions[749]); + expressions[751] = BinaryenConst(the_module, BinaryenLiteralInt32(102)); + expressions[752] = BinaryenLocalTee(the_module, 0, expressions[751]); + expressions[753] = BinaryenDrop(the_module, expressions[752]); + expressions[754] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); + expressions[755] = BinaryenLoad(the_module, 4, 0, 0, 0, 1, expressions[754]); + expressions[756] = BinaryenConst(the_module, BinaryenLiteralInt32(8)); + expressions[757] = BinaryenLoad(the_module, 2, 1, 2, 1, 2, expressions[756]); + expressions[758] = BinaryenConst(the_module, BinaryenLiteralInt32(2)); + expressions[759] = BinaryenLoad(the_module, 4, 0, 0, 0, 3, expressions[758]); + expressions[760] = BinaryenConst(the_module, BinaryenLiteralInt32(9)); + expressions[761] = BinaryenLoad(the_module, 8, 0, 2, 8, 4, expressions[760]); + expressions[762] = BinaryenStore(the_module, 4, 0, 0, expressions[30], expressions[31], 1); + expressions[763] = BinaryenStore(the_module, 8, 2, 4, expressions[32], expressions[33], 2); + expressions[764] = BinaryenSelect(the_module, expressions[27], expressions[28], expressions[29], BinaryenTypeAuto()); + expressions[765] = BinaryenConst(the_module, BinaryenLiteralInt32(1337)); + expressions[766] = BinaryenReturn(the_module, expressions[765]); + { + BinaryenExpressionRef operands[] = { expressions[10], expressions[11], expressions[12], expressions[13] }; + expressions[767] = BinaryenReturnCall(the_module, "kitchen()sinker", operands, 4, 1); +>>>>>>> Add support for reference types proposal } - expressions[766] = BinaryenConst(the_module, BinaryenLiteralInt32(2449)); + expressions[768] = BinaryenConst(the_module, BinaryenLiteralInt32(2449)); { BinaryenExpressionRef operands[] = { expressions[14], expressions[15], expressions[16], expressions[17] }; +<<<<<<< HEAD expressions[767] = BinaryenReturnCallIndirect(the_module, expressions[766], operands, 4, "iiIfF"); } expressions[768] = BinaryenTry(the_module, expressions[35], expressions[43]); @@ -3882,10 +4004,47 @@ int main() { expressions[788] = BinaryenNop(the_module); expressions[789] = BinaryenUnreachable(the_module); BinaryenExpressionPrint(expressions[51]); +======= + expressions[769] = BinaryenReturnCallIndirect(the_module, expressions[768], operands, 4, "iiIfF"); + } + expressions[770] = BinaryenRefIsNull(the_module, expressions[34]); + expressions[771] = BinaryenRefIsNull(the_module, expressions[35]); + expressions[772] = BinaryenSelect(the_module, expressions[27], expressions[34], expressions[35], 7); + expressions[773] = BinaryenTry(the_module, expressions[37], expressions[45]); + expressions[774] = BinaryenAtomicLoad(the_module, 4, 0, 1, expressions[23]); + expressions[775] = BinaryenAtomicStore(the_module, 4, 0, expressions[23], expressions[774], 1); + expressions[776] = BinaryenAtomicWait(the_module, expressions[23], expressions[23], expressions[33], 1); + expressions[777] = BinaryenDrop(the_module, expressions[776]); + expressions[778] = BinaryenAtomicNotify(the_module, expressions[23], expressions[23]); + expressions[779] = BinaryenDrop(the_module, expressions[778]); + expressions[780] = BinaryenAtomicFence(the_module); + expressions[781] = BinaryenPop(the_module, 1); + expressions[782] = BinaryenPush(the_module, expressions[781]); + expressions[783] = BinaryenPop(the_module, 2); + expressions[784] = BinaryenPush(the_module, expressions[783]); + expressions[785] = BinaryenPop(the_module, 3); + expressions[786] = BinaryenPush(the_module, expressions[785]); + expressions[787] = BinaryenPop(the_module, 4); + expressions[788] = BinaryenPush(the_module, expressions[787]); + expressions[789] = BinaryenPop(the_module, 6); + expressions[790] = BinaryenPush(the_module, expressions[789]); + expressions[791] = BinaryenPop(the_module, 9); + expressions[792] = BinaryenPush(the_module, expressions[791]); + expressions[793] = BinaryenPop(the_module, 7); + expressions[794] = BinaryenPush(the_module, expressions[793]); + expressions[795] = BinaryenPop(the_module, 8); + expressions[796] = BinaryenPush(the_module, expressions[795]); + expressions[797] = BinaryenPop(the_module, 9); + expressions[798] = BinaryenPush(the_module, expressions[797]); + expressions[799] = BinaryenNop(the_module); + expressions[800] = BinaryenUnreachable(the_module); + BinaryenExpressionPrint(expressions[53]); +>>>>>>> Add support for reference types proposal (f32.neg (f32.const -33.61199951171875) ) { +<<<<<<< HEAD BinaryenExpressionRef children[] = { expressions[45], expressions[47], expressions[49], expressions[51], expressions[53], expressions[55], expressions[57], expressions[59], expressions[61], expressions[63], expressions[65], expressions[67], expressions[69], expressions[71], expressions[73], expressions[75], expressions[77], @@ -3956,6 +4115,79 @@ int main() { globals[0] = BinaryenAddGlobal(the_module, "a-global", 2, 0, expressions[795]); expressions[796] = BinaryenConst(the_module, BinaryenLiteralFloat32(7.5)); globals[1] = BinaryenAddGlobal(the_module, "a-mutable-global", 4, 1, expressions[796]); +======= + BinaryenExpressionRef children[] = { expressions[47], expressions[49], expressions[51], expressions[53], expressions[55], + expressions[57], expressions[59], expressions[61], expressions[63], expressions[65], expressions[67], + expressions[69], expressions[71], expressions[73], expressions[75], expressions[77], expressions[79], + expressions[81], expressions[83], expressions[85], expressions[87], expressions[89], expressions[91], + expressions[93], expressions[95], expressions[97], expressions[99], expressions[101], expressions[103], + expressions[105], expressions[107], expressions[109], expressions[111], expressions[113], expressions[115], + expressions[117], expressions[119], expressions[121], expressions[123], expressions[125], expressions[127], + expressions[129], expressions[131], expressions[133], expressions[135], expressions[137], expressions[139], + expressions[141], expressions[143], expressions[145], expressions[147], expressions[149], expressions[151], + expressions[153], expressions[155], expressions[157], expressions[159], expressions[161], expressions[163], + expressions[165], expressions[167], expressions[169], expressions[171], expressions[173], expressions[175], + expressions[177], expressions[179], expressions[181], expressions[183], expressions[185], expressions[187], + expressions[189], expressions[191], expressions[193], expressions[195], expressions[197], expressions[199], + expressions[201], expressions[203], expressions[205], expressions[207], expressions[209], expressions[211], + expressions[213], expressions[215], expressions[218], expressions[221], expressions[224], expressions[227], + expressions[230], expressions[233], expressions[236], expressions[239], expressions[242], expressions[245], + expressions[248], expressions[251], expressions[254], expressions[257], expressions[260], expressions[263], + expressions[266], expressions[269], expressions[272], expressions[275], expressions[278], expressions[281], + expressions[284], expressions[287], expressions[290], expressions[293], expressions[296], expressions[299], + expressions[302], expressions[305], expressions[308], expressions[311], expressions[314], expressions[317], + expressions[320], expressions[323], expressions[326], expressions[329], expressions[332], expressions[335], + expressions[338], expressions[341], expressions[344], expressions[347], expressions[350], expressions[353], + expressions[356], expressions[359], expressions[362], expressions[365], expressions[368], expressions[371], + expressions[374], expressions[377], expressions[380], expressions[383], expressions[386], expressions[389], + expressions[392], expressions[395], expressions[398], expressions[401], expressions[404], expressions[407], + expressions[410], expressions[413], expressions[416], expressions[419], expressions[422], expressions[425], + expressions[428], expressions[431], expressions[434], expressions[437], expressions[440], expressions[443], + expressions[446], expressions[449], expressions[452], expressions[455], expressions[458], expressions[461], + expressions[464], expressions[467], expressions[470], expressions[473], expressions[476], expressions[479], + expressions[482], expressions[485], expressions[488], expressions[491], expressions[494], expressions[497], + expressions[500], expressions[503], expressions[506], expressions[509], expressions[512], expressions[515], + expressions[518], expressions[521], expressions[524], expressions[527], expressions[530], expressions[533], + expressions[536], expressions[539], expressions[542], expressions[545], expressions[548], expressions[551], + expressions[554], expressions[557], expressions[560], expressions[563], expressions[566], expressions[569], + expressions[572], expressions[575], expressions[578], expressions[581], expressions[584], expressions[587], + expressions[590], expressions[593], expressions[596], expressions[598], expressions[600], expressions[602], + expressions[604], expressions[606], expressions[608], expressions[610], expressions[612], expressions[615], + expressions[618], expressions[621], expressions[624], expressions[627], expressions[630], expressions[633], + expressions[636], expressions[639], expressions[642], expressions[645], expressions[648], expressions[651], + expressions[654], expressions[657], expressions[660], expressions[663], expressions[666], expressions[668], + expressions[670], expressions[672], expressions[674], expressions[676], expressions[678], expressions[680], + expressions[682], expressions[684], expressions[686], expressions[689], expressions[693], expressions[697], + expressions[701], expressions[705], expressions[709], expressions[713], expressions[714], expressions[718], + expressions[722], expressions[723], expressions[724], expressions[725], expressions[727], expressions[729], + expressions[730], expressions[732], expressions[734], expressions[735], expressions[736], expressions[738], + expressions[740], expressions[743], expressions[746], expressions[748], expressions[750], expressions[753], + expressions[755], expressions[757], expressions[759], expressions[761], expressions[762], expressions[763], + expressions[764], expressions[766], expressions[767], expressions[769], expressions[770], expressions[771], + expressions[772], expressions[773], expressions[775], expressions[777], expressions[779], expressions[780], + expressions[782], expressions[784], expressions[786], expressions[788], expressions[790], expressions[792], + expressions[794], expressions[796], expressions[798], expressions[799], expressions[800] }; + expressions[801] = BinaryenBlock(the_module, "the-value", children, 304, BinaryenTypeAuto()); + } + expressions[802] = BinaryenDrop(the_module, expressions[801]); + { + BinaryenExpressionRef children[] = { expressions[802] }; + expressions[803] = BinaryenBlock(the_module, "the-nothing", children, 1, BinaryenTypeAuto()); + } + expressions[804] = BinaryenConst(the_module, BinaryenLiteralInt32(42)); + { + BinaryenExpressionRef children[] = { expressions[803], expressions[804] }; + expressions[805] = BinaryenBlock(the_module, "the-body", children, 2, BinaryenTypeAuto()); + } + { + BinaryenType varTypes[] = { 1, 9 }; + functions[0] = BinaryenAddFunction(the_module, "kitchen()sinker", functionTypes[0], varTypes, 2, expressions[805]); + } + expressions[806] = BinaryenConst(the_module, BinaryenLiteralInt32(7)); + globals[0] = BinaryenAddGlobal(the_module, "a-global", 1, 0, expressions[806]); + expressions[807] = BinaryenConst(the_module, BinaryenLiteralFloat32(7.5)); + globals[1] = BinaryenAddGlobal(the_module, "a-mutable-global", 3, 1, expressions[807]); +>>>>>>> Add support for reference types proposal { BinaryenType paramTypes[] = { 2, 5 }; functionTypes[1] = BinaryenAddFunctionType(the_module, "fiF", 4, paramTypes, 2); @@ -3963,18 +4195,18 @@ int main() { BinaryenAddFunctionImport(the_module, "an-imported", "module", "base", functionTypes[1]); exports[0] = BinaryenAddFunctionExport(the_module, "kitchen()sinker", "kitchen_sinker"); BinaryenFunctionGetName(functions[0]); - expressions[797] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); + expressions[808] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); { const char* funcNames[] = { "kitchen()sinker" }; - BinaryenSetFunctionTable(the_module, 1, 1, funcNames, 1, expressions[797]); + BinaryenSetFunctionTable(the_module, 1, 1, funcNames, 1, expressions[808]); } - expressions[798] = BinaryenConst(the_module, BinaryenLiteralInt32(10)); + expressions[809] = BinaryenConst(the_module, BinaryenLiteralInt32(10)); { const char segment0[] = { 104, 101, 108, 108, 111, 44, 32, 119, 111, 114, 108, 100 }; const char segment1[] = { 73, 32, 97, 109, 32, 112, 97, 115, 115, 105, 118, 101 }; const char* segments[] = { segment0, segment1 }; int8_t segmentPassive[] = { 0, 1 }; - BinaryenExpressionRef segmentOffsets[] = { expressions[798], expressions[0] }; + BinaryenExpressionRef segmentOffsets[] = { expressions[809], expressions[0] }; BinaryenIndex segmentSizes[] = { 12, 12 }; BinaryenSetMemory(the_module, 1, 256, "mem", segments, segmentPassive, segmentOffsets, segmentSizes, 2, 1); } @@ -3982,10 +4214,14 @@ int main() { BinaryenType paramTypes[] = { 0 }; functionTypes[2] = BinaryenAddFunctionType(the_module, "v", 0, paramTypes, 0); } - expressions[799] = BinaryenNop(the_module); + expressions[810] = BinaryenNop(the_module); { BinaryenType varTypes[] = { 0 }; +<<<<<<< HEAD functions[1] = BinaryenAddFunction(the_module, "starter", functionTypes[2], varTypes, 0, expressions[799]); +======= + functions[1] = BinaryenAddFunction(the_module, "starter", functionTypes[3], varTypes, 0, expressions[810]); +>>>>>>> Add support for reference types proposal } BinaryenSetStart(the_module, functions[1]); { @@ -5603,6 +5839,23 @@ int main() { (f64.const 3.7) (i32.const 2449) ) + (drop + (ref.is_null + (ref.null) + ) + ) + (drop + (ref.is_null + (ref.func "$kitchen()sinker") + ) + ) + (drop + (select (result funcref) + (ref.null) + (ref.func "$kitchen()sinker") + (i32.const 1) + ) + ) (try (throw $a-event (i32.const 0) @@ -5660,6 +5913,15 @@ int main() { (push (exnref.pop) ) + (push + (funcref.pop) + ) + (push + (nullref.pop) + ) + (push + (exnref.pop) + ) (nop) (unreachable) ) diff --git a/test/example/c-api-kitchen-sink.txt.txt b/test/example/c-api-kitchen-sink.txt.txt index 92f620e7328..5edfc534d5f 100644 --- a/test/example/c-api-kitchen-sink.txt.txt +++ b/test/example/c-api-kitchen-sink.txt.txt @@ -1607,6 +1607,23 @@ (f64.const 3.7) (i32.const 2449) ) + (drop + (ref.is_null + (ref.null) + ) + ) + (drop + (ref.is_null + (ref.func "$kitchen()sinker") + ) + ) + (drop + (select (result funcref) + (ref.null) + (ref.func "$kitchen()sinker") + (i32.const 1) + ) + ) (try (throw $a-event (i32.const 0) @@ -1664,6 +1681,15 @@ (push (exnref.pop) ) + (push + (funcref.pop) + ) + (push + (nullref.pop) + ) + (push + (exnref.pop) + ) (nop) (unreachable) ) diff --git a/test/exception-handling.wast b/test/exception-handling.wast index 275350c615e..0929daeecd3 100644 --- a/test/exception-handling.wast +++ b/test/exception-handling.wast @@ -53,4 +53,20 @@ ) ) ) + + ;; Test subtype relationship for br_on_exn and rethrow + (func $subtype_test + (try + (catch + (drop (exnref.pop)) + (drop + (block $l0 (result i32) + (rethrow + (br_on_exn $l0 $e0 (ref.null)) + ) + ) + ) + ) + ) + ) ) diff --git a/test/exception-handling.wast.from-wast b/test/exception-handling.wast.from-wast index e3209518ef0..96a956ffa6a 100644 --- a/test/exception-handling.wast.from-wast +++ b/test/exception-handling.wast.from-wast @@ -1,9 +1,9 @@ (module - (type $FUNCSIG$ee (func (param exnref) (result exnref))) + (type $FUNCSIG$EE (func (param exnref) (result exnref))) (type $FUNCSIG$v (func)) (type $FUNCSIG$vi (func (param i32))) (event $e0 (attr 0) (param i32)) - (func $exnref_test (; 0 ;) (type $FUNCSIG$ee) (param $0 exnref) (result exnref) + (func $exnref_test (; 0 ;) (type $FUNCSIG$EE) (param $0 exnref) (result exnref) (local.get $0) ) (func $foo (; 1 ;) (type $FUNCSIG$v) @@ -63,4 +63,23 @@ ) ) ) + (func $subtype_test (; 4 ;) (type $FUNCSIG$v) + (try + (nop) + (catch + (drop + (exnref.pop) + ) + (drop + (block $l0 (result i32) + (rethrow + (br_on_exn $l0 $e0 + (ref.null) + ) + ) + ) + ) + ) + ) + ) ) diff --git a/test/exception-handling.wast.fromBinary b/test/exception-handling.wast.fromBinary index 043eadf87a4..677de0547fe 100644 --- a/test/exception-handling.wast.fromBinary +++ b/test/exception-handling.wast.fromBinary @@ -66,5 +66,24 @@ ) ) ) + (func $subtype_test (; 4 ;) (type $1) + (try + (nop) + (catch + (drop + (exnref.pop) + ) + (drop + (block $label$3 (result i32) + (rethrow + (br_on_exn $label$3 $event$0 + (ref.null) + ) + ) + ) + ) + ) + ) + ) ) diff --git a/test/exception-handling.wast.fromBinary.noDebugInfo b/test/exception-handling.wast.fromBinary.noDebugInfo index 4242c139506..a70405fc045 100644 --- a/test/exception-handling.wast.fromBinary.noDebugInfo +++ b/test/exception-handling.wast.fromBinary.noDebugInfo @@ -66,5 +66,24 @@ ) ) ) + (func $4 (; 4 ;) (type $1) + (try + (nop) + (catch + (drop + (exnref.pop) + ) + (drop + (block $label$3 (result i32) + (rethrow + (br_on_exn $label$3 $event$0 + (ref.null) + ) + ) + ) + ) + ) + ) + ) ) diff --git a/test/passes/asyncify.txt b/test/passes/asyncify.txt index 317e6f442dc..4e889297752 100644 --- a/test/passes/asyncify.txt +++ b/test/passes/asyncify.txt @@ -11,18 +11,14 @@ (export "asyncify_stop_rewind" (func $asyncify_stop_rewind)) (func $do_sleep (; 0 ;) (type $FUNCSIG$v) (local $0 i32) - (local $1 i32) (block (local.set $0 - (global.get $sleeping) - ) - (local.set $1 (i32.eqz - (local.get $0) + (global.get $sleeping) ) ) (if - (local.get $1) + (local.get $0) (block (block $block (global.set $sleeping diff --git a/test/passes/asyncify_pass-arg=asyncify-imports@env.import,env.import2.txt b/test/passes/asyncify_pass-arg=asyncify-imports@env.import,env.import2.txt index 96a6c765194..03759d87fcc 100644 --- a/test/passes/asyncify_pass-arg=asyncify-imports@env.import,env.import2.txt +++ b/test/passes/asyncify_pass-arg=asyncify-imports@env.import,env.import2.txt @@ -11,18 +11,14 @@ (export "asyncify_stop_rewind" (func $asyncify_stop_rewind)) (func $do_sleep (; 0 ;) (type $FUNCSIG$v) (local $0 i32) - (local $1 i32) (block (local.set $0 - (global.get $sleeping) - ) - (local.set $1 (i32.eqz - (local.get $0) + (global.get $sleeping) ) ) (if - (local.get $1) + (local.get $0) (block (block $block (global.set $sleeping diff --git a/test/passes/flatten.txt b/test/passes/flatten.txt index 5fc0a103206..7325a569369 100644 --- a/test/passes/flatten.txt +++ b/test/passes/flatten.txt @@ -1435,15 +1435,11 @@ ) ) (func $global (; 25 ;) (type $1) - (local $0 i32) (block (unreachable) (unreachable) - (local.set $0 - (global.get $x) - ) (drop - (local.get $0) + (global.get $x) ) (nop) (global.set $x diff --git a/test/passes/flatten_i64-to-i32-lowering.txt b/test/passes/flatten_i64-to-i32-lowering.txt index 809982880f2..7aea2c357f3 100644 --- a/test/passes/flatten_i64-to-i32-lowering.txt +++ b/test/passes/flatten_i64-to-i32-lowering.txt @@ -431,29 +431,14 @@ (nop) ) (func $1 (; 1 ;) (type $FUNCSIG$v) - (local $0 i32) - (local $0$hi i32) (local $i64toi32_i32$0 i32) (block - (block - (local.set $0 - (block (result i32) - (local.set $i64toi32_i32$0 - (global.get $f$hi) - ) - (global.get $f) - ) - ) - (local.set $0$hi - (local.get $i64toi32_i32$0) - ) - ) (call $call (block (result i32) (local.set $i64toi32_i32$0 - (local.get $0$hi) + (global.get $f$hi) ) - (local.get $0) + (global.get $f) ) (local.get $i64toi32_i32$0) ) @@ -527,29 +512,14 @@ (nop) ) (func $1 (; 1 ;) (type $FUNCSIG$v) - (local $0 i32) - (local $0$hi i32) (local $i64toi32_i32$0 i32) (block - (block - (local.set $0 - (block (result i32) - (local.set $i64toi32_i32$0 - (global.get $f$hi) - ) - (global.get $f) - ) - ) - (local.set $0$hi - (local.get $i64toi32_i32$0) - ) - ) (call $call (block (result i32) (local.set $i64toi32_i32$0 - (local.get $0$hi) + (global.get $f$hi) ) - (local.get $0) + (global.get $f) ) (local.get $i64toi32_i32$0) ) diff --git a/test/passes/flatten_local-cse.txt b/test/passes/flatten_local-cse.txt index aae715bb0e2..53be58d4559 100644 --- a/test/passes/flatten_local-cse.txt +++ b/test/passes/flatten_local-cse.txt @@ -700,30 +700,24 @@ (func $2 (; 2 ;) (type $1) (param $var$0 i32) (param $var$1 f64) (result i32) (local $2 i32) (local $3 i32) - (local $4 i32) (block - (block - (local.set $2 - (global.get $global$0) - ) - (if - (local.get $2) - (block - (unreachable) - (unreachable) - ) + (if + (global.get $global$0) + (block + (unreachable) + (unreachable) ) ) (nop) - (local.set $3 + (local.set $2 (i32.const 0) ) ) - (local.set $4 - (local.get $3) + (local.set $3 + (local.get $2) ) (return - (local.get $3) + (local.get $2) ) ) ) @@ -812,27 +806,15 @@ (func $global (; 1 ;) (type $FUNCSIG$v) (local $x i32) (local $y i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) (block - (local.set $2 - (global.get $glob) - ) (local.set $x - (local.get $2) + (global.get $glob) ) (nop) - (local.set $3 - (local.get $x) - ) (local.set $y (local.get $x) ) (nop) - (local.set $4 - (local.get $x) - ) (local.set $y (local.get $x) ) diff --git a/test/passes/instrument-locals_all-features.txt b/test/passes/instrument-locals_all-features.txt index 3d6aa4d05c2..da435283bb3 100644 --- a/test/passes/instrument-locals_all-features.txt +++ b/test/passes/instrument-locals_all-features.txt @@ -4,8 +4,9 @@ (type $FUNCSIG$jiij (func (param i32 i32 i64) (result i64))) (type $FUNCSIG$fiif (func (param i32 i32 f32) (result f32))) (type $FUNCSIG$diid (func (param i32 i32 f64) (result f64))) - (type $FUNCSIG$aiia (func (param i32 i32 anyref) (result anyref))) - (type $FUNCSIG$eiie (func (param i32 i32 exnref) (result exnref))) + (type $FUNCSIG$AiiA (func (param i32 i32 anyref) (result anyref))) + (type $FUNCSIG$FiiF (func (param i32 i32 funcref) (result funcref))) + (type $FUNCSIG$EiiE (func (param i32 i32 exnref) (result exnref))) (import "env" "get_i32" (func $get_i32 (param i32 i32 i32) (result i32))) (import "env" "get_i64" (func $get_i64 (param i32 i32 i64) (result i64))) (import "env" "get_f32" (func $get_f32 (param i32 i32 f32) (result f32))) @@ -16,9 +17,11 @@ (import "env" "set_f64" (func $set_f64 (param i32 i32 f64) (result f64))) (import "env" "get_anyref" (func $get_anyref (param i32 i32 anyref) (result anyref))) (import "env" "set_anyref" (func $set_anyref (param i32 i32 anyref) (result anyref))) + (import "env" "get_funcref" (func $get_funcref (param i32 i32 funcref) (result funcref))) + (import "env" "set_funcref" (func $set_funcref (param i32 i32 funcref) (result funcref))) (import "env" "get_exnref" (func $get_exnref (param i32 i32 exnref) (result exnref))) (import "env" "set_exnref" (func $set_exnref (param i32 i32 exnref) (result exnref))) - (func $A (; 12 ;) (type $FUNCSIG$v) + (func $A (; 14 ;) (type $FUNCSIG$v) (local $x i32) (local $y i64) (local $z f32) diff --git a/test/passes/translate-to-fuzz_all-features.txt b/test/passes/translate-to-fuzz_all-features.txt index ce0d33e14d1..7756716033c 100644 --- a/test/passes/translate-to-fuzz_all-features.txt +++ b/test/passes/translate-to-fuzz_all-features.txt @@ -5,26 +5,50 @@ (type $FUNCSIG$vf (func (param f32))) (type $FUNCSIG$vd (func (param f64))) (type $FUNCSIG$vV (func (param v128))) +<<<<<<< HEAD (type $FUNCSIG$d (func (result f64))) (type $FUNCSIG$v (func)) (type $FUNCSIG$ji (func (param i32) (result i64))) (type $FUNCSIG$ff (func (param f32) (result f32))) (type $FUNCSIG$fi (func (param i32) (result f32))) +======= + (type $FUNCSIG$vA (func (param anyref))) + (type $FUNCSIG$vF (func (param funcref))) + (type $FUNCSIG$vE (func (param exnref))) + (type $FUNCSIG$Ad (func (param f64) (result anyref))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$iiFdf (func (param i32 funcref f64 f32) (result i32))) + (type $FUNCSIG$djdVf (func (param i64 f64 v128 f32) (result f64))) + (type $FUNCSIG$VEdfAVAE (func (param exnref f64 f32 anyref v128 anyref exnref) (result v128))) +>>>>>>> Add support for reference types proposal (import "fuzzing-support" "log-i32" (func $log-i32 (param i32))) (import "fuzzing-support" "log-i64" (func $log-i64 (param i64))) (import "fuzzing-support" "log-f32" (func $log-f32 (param f32))) (import "fuzzing-support" "log-f64" (func $log-f64 (param f64))) (import "fuzzing-support" "log-v128" (func $log-v128 (param v128))) - (memory $0 (shared 1 1)) + (import "fuzzing-support" "log-anyref" (func $log-anyref (param anyref))) + (import "fuzzing-support" "log-funcref" (func $log-funcref (param funcref))) + (import "fuzzing-support" "log-exnref" (func $log-exnref (param exnref))) + (memory $0 1 1) (data (i32.const 0) "N\0fN\f5\f9\b1\ff\fa\eb\e5\fe\a7\ec\fb\fc\f4\a6\e4\ea\f0\ae\e3") +<<<<<<< HEAD (table $0 4 4 funcref) (elem (i32.const 0) $func_11 $func_13 $func_15 $func_15) +======= + (table $0 2 2 funcref) + (elem (i32.const 0) $func_14 $func_15) +>>>>>>> Add support for reference types proposal (global $global$0 (mut i32) (i32.const 975663930)) (global $global$1 (mut i32) (i32.const 2066300474)) (global $global$2 (mut i64) (i64.const 20510)) (global $global$3 (mut f32) (f32.const -2147483648)) (global $global$4 (mut v128) (v128.const i32x4 0x7f002833 0x580000fe 0x59750500 0x01ff002f)) + (global $global$5 (mut anyref) (ref.null)) + (global $global$6 (mut funcref) (ref.null)) + (global $global$7 (mut exnref) (ref.null)) + (global $global$8 (mut exnref) (ref.null)) (global $hangLimit (mut i32) (i32.const 10)) +<<<<<<< HEAD (event $event$0 (attr 0) (param f64 f32)) (export "hashMemory" (func $hashMemory)) (export "memory" (memory $0)) @@ -36,8 +60,23 @@ (export "func_15" (func $func_15)) (export "func_16_invoker" (func $func_16_invoker)) (export "func_18_invoker" (func $func_18_invoker)) +======= + (export "hashMemory" (func $hashMemory)) + (export "memory" (memory $0)) + (export "func_9" (func $func_9)) + (export "func_10_invoker" (func $func_10_invoker)) + (export "func_12_invoker" (func $func_12_invoker)) + (export "func_15" (func $func_15)) + (export "func_15_invoker" (func $func_15_invoker)) + (export "func_17" (func $func_17)) + (export "func_17_invoker" (func $func_17_invoker)) + (export "func_19_invoker" (func $func_19_invoker)) + (export "func_21" (func $func_21)) + (export "func_21_invoker" (func $func_21_invoker)) + (export "func_23_invoker" (func $func_23_invoker)) +>>>>>>> Add support for reference types proposal (export "hangLimitInitializer" (func $hangLimitInitializer)) - (func $hashMemory (; 5 ;) (type $FUNCSIG$i) (result i32) + (func $hashMemory (; 8 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) (local.set $0 (i32.const 5381) @@ -268,13 +307,19 @@ ) (local.get $0) ) +<<<<<<< HEAD (func $func_6 (; 6 ;) (param $0 i64) (param $1 v128) (param $2 i64) (result f64) +======= + (func $func_9 (; 9 ;) (type $FUNCSIG$Ad) (param $0 f64) (result anyref) + (local $1 anyref) +>>>>>>> Add support for reference types proposal (block (if (i32.eqz (global.get $hangLimit) ) (return +<<<<<<< HEAD (f64.const -1) ) ) @@ -299,6 +344,9 @@ ) (return (local.get $2) +======= + (ref.null) +>>>>>>> Add support for reference types proposal ) ) (global.set $hangLimit @@ -308,6 +356,7 @@ ) ) ) +<<<<<<< HEAD (block $label$0 (call $log-i32 (call $hashMemory) @@ -330,13 +379,153 @@ (local $10 i64) (local $11 i64) (local $12 f64) +======= + (block $label$0 (result anyref) + (local.set $1 + (block $label$1 (result anyref) + (if + (i32.eqz + (i32.const 723742247) + ) + (block $label$2 + (local.set $0 + (if (result f64) + (if (result i32) + (i32.eqz + (i32.const 1) + ) + (i32.const 1581531209) + (i32.const -127) + ) + (block $label$6 (result f64) + (local.set $1 + (local.tee $1 + (local.get $1) + ) + ) + (local.tee $0 + (loop $label$7 (result f64) + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (ref.null) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (block $label$8 (result f64) + (if + (i32.const 0) + (block $label$9 + (local.set $1 + (local.tee $1 + (ref.null) + ) + ) + (local.set $1 + (local.tee $1 + (local.get $1) + ) + ) + ) + (nop) + ) + (loop $label$11 (result f64) + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (local.get $1) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (block $label$12 (result f64) + (local.set $1 + (local.tee $1 + (local.get $1) + ) + ) + (f64.const -nan:0xfffffffffffe0) + ) + ) + ) + ) + ) + ) + (block $label$13 + (br $label$2) + ) + ) + ) + (nop) + ) + (block $label$14 + (local.set $0 + (local.tee $0 + (local.tee $0 + (local.tee $0 + (local.tee $0 + (local.tee $0 + (local.tee $0 + (local.tee $0 + (local.tee $0 + (local.tee $0 + (local.tee $0 + (local.tee $0 + (f64.const 0) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (block $label$26 + (nop) + (nop) + ) + ) + ) + (local.get $1) + ) + ) + (local.get $1) + ) + ) + (func $func_10 (; 10 ;) (param $0 funcref) (param $1 funcref) (param $2 anyref) (param $3 anyref) (param $4 funcref) (param $5 anyref) (result i64) +>>>>>>> Add support for reference types proposal (block (if (i32.eqz (global.get $hangLimit) ) (return +<<<<<<< HEAD (local.get $5) +======= + (i64.const 4398046511104) +>>>>>>> Add support for reference types proposal ) ) (global.set $hangLimit @@ -346,6 +535,7 @@ ) ) ) +<<<<<<< HEAD (block $label$0 (call $log-f32 (local.get $5) @@ -364,13 +554,37 @@ (local $5 f32) (local $6 i32) (local $7 i64) +======= + (i64.const 4294967296) + ) + (func $func_10_invoker (; 11 ;) (type $FUNCSIG$v) + (drop + (call $func_10 + (ref.func $log-f32) + (ref.null) + (ref.null) + (ref.null) + (ref.func $log-i64) + (ref.null) + ) + ) + ) + (func $func_12 (; 12 ;) (result v128) + (local $0 funcref) + (local $1 anyref) + (local $2 exnref) +>>>>>>> Add support for reference types proposal (block (if (i32.eqz (global.get $hangLimit) ) (return +<<<<<<< HEAD (local.get $1) +======= + (v128.const i32x4 0x0a0d1c1f 0x071d1c48 0x0000034d 0x00000000) +>>>>>>> Add support for reference types proposal ) ) (global.set $hangLimit @@ -381,6 +595,7 @@ ) ) (block $label$0 +<<<<<<< HEAD (call $log-v128 (v128.const i32x4 0x77367f7e 0x00000045 0x40000000 0x0000007f) ) @@ -408,13 +623,318 @@ (local $7 f32) (local $8 i32) (local $9 f64) +======= + (block $label$1 + (loop $label$2 + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (v128.const i32x4 0x00005b34 0x342a2f2f 0x00000f5b 0x0e171513) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (block + (block $label$3 + (nop) + ) + (br_if $label$2 + (i32.eqz + (i32.const -536870912) + ) + ) + (br_if $label$2 + (i32.eqz + (i32.const -32768) + ) + ) + ) + ) + (block $label$4 + (nop) + (if + (i32.const 138613770) + (local.set $1 + (local.tee $1 + (local.tee $1 + (local.tee $1 + (ref.null) + ) + ) + ) + ) + (block $label$5 + (if + (loop $label$6 (result i32) + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (v128.const i32x4 0xff000000 0x00001000 0x00000001 0x00004611) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (loop $label$7 (result i32) + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (v128.const i32x4 0x43434343 0x43434343 0xfff80000 0xffffffff) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (block $label$8 (result i32) + (nop) + (br_if $label$8 + (loop $label$9 (result i32) + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (v128.const i32x4 0x050300ff 0x00000000 0x00010000 0xffff007f) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (block (result i32) + (local.set $1 + (local.get $1) + ) + (br_if $label$9 + (i32.const -80) + ) + (i32.const 337253912) + ) + ) + (i32.eqz + (i32.const 96) + ) + ) + ) + ) + ) + (nop) + (block $label$10 + (local.set $1 + (ref.null) + ) + (if + (i32.eqz + (i32.const 0) + ) + (block $label$11 + (nop) + (local.set $2 + (local.get $2) + ) + ) + (loop $label$12 + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (v128.const i32x4 0x4e000000 0x41dddd9f 0x00000000 0x40a00000) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (block $label$13 + (local.set $2 + (local.get $2) + ) + (if + (i32.const 51777295) + (block $label$14 + (br_if $label$5 + (i32.eqz + (global.get $global$0) + ) + ) + (loop $label$15 + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (v128.const i32x4 0x1dcf0000 0x56001375 0x000afe08 0x55490b31) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (block $label$16 + (br_if $label$1 + (i32.const -2147483647) + ) + (local.set $0 + (ref.null) + ) + ) + ) + ) + (block $label$17 + (local.set $2 + (local.tee $2 + (ref.null) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (memory.init 0 + (i32.and + (i32.const 2147483647) + (i32.const 15) + ) + (i32.const 15) + (i32.const 6) + ) + ) + ) + ) + ) + (nop) + (i64.store32 offset=4 align=1 + (i32.and + (i32.const 70) + (i32.const 15) + ) + (block $label$18 + (loop $label$19 + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (v128.const i32x4 0x0000110e 0x00000000 0x00001e13 0x00000000) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (block $label$20 + (local.set $1 + (local.tee $1 + (local.tee $1 + (local.tee $1 + (local.tee $1 + (local.tee $1 + (local.get $1) + ) + ) + ) + ) + ) + ) + (nop) + ) + ) + (block $label$21 + (block $label$22 + (block $label$23 + (block $label$24 + (local.set $2 + (ref.null) + ) + (local.set $1 + (local.tee $1 + (ref.null) + ) + ) + ) + (return + (v128.const i32x4 0xefe65f1c 0x49000201 0x4f225f1e 0x0018e9f0) + ) + ) + ) + ) + ) + ) + ) + ) + (func $func_12_invoker (; 13 ;) (type $FUNCSIG$v) + (drop + (call $func_12) + ) + (call $log-i32 + (call $hashMemory) + ) + (drop + (call $func_12) + ) + ) + (func $func_14 (; 14 ;) (result f64) + (local $0 anyref) + (local $1 anyref) + (local $2 i64) + (local $3 v128) + (local $4 anyref) + (local $5 f64) + (local $6 f32) +>>>>>>> Add support for reference types proposal (block (if (i32.eqz (global.get $hangLimit) ) (return +<<<<<<< HEAD (f32.const 10961.05859375) +======= + (f64.const -1) +>>>>>>> Add support for reference types proposal ) ) (global.set $hangLimit @@ -424,6 +944,7 @@ ) ) ) +<<<<<<< HEAD (local.get $7) ) (func $func_11_invoker (; 12 ;) (type $FUNCSIG$v) @@ -471,13 +992,27 @@ (local $13 v128) (local $14 i32) (local $15 v128) +======= + (block $label$0 + (return + (local.get $5) + ) + ) + ) + (func $func_15 (; 15 ;) (type $FUNCSIG$iiFdf) (param $0 i32) (param $1 funcref) (param $2 f64) (param $3 f32) (result i32) + (local $4 funcref) +>>>>>>> Add support for reference types proposal (block (if (i32.eqz (global.get $hangLimit) ) (return +<<<<<<< HEAD (local.get $12) +======= + (local.get $0) +>>>>>>> Add support for reference types proposal ) ) (global.set $hangLimit @@ -487,6 +1022,7 @@ ) ) ) +<<<<<<< HEAD (i64.const 2) ) (func $func_14 (; 14 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) @@ -498,13 +1034,36 @@ (local $6 f32) (local $7 f32) (local $8 f64) +======= + (local.tee $0 + (local.get $0) + ) + ) + (func $func_15_invoker (; 16 ;) (type $FUNCSIG$v) + (drop + (call $func_15 + (i32.const 65535) + (ref.func $log-f32) + (f64.const -0) + (f32.const 24) + ) + ) + ) + (func $func_17 (; 17 ;) (type $FUNCSIG$djdVf) (param $0 i64) (param $1 f64) (param $2 v128) (param $3 f32) (result f64) + (local $4 funcref) + (local $5 anyref) +>>>>>>> Add support for reference types proposal (block (if (i32.eqz (global.get $hangLimit) ) (return +<<<<<<< HEAD (f32.const -4294967296) +======= + (f64.const 41) +>>>>>>> Add support for reference types proposal ) ) (global.set $hangLimit @@ -514,6 +1073,7 @@ ) ) ) +<<<<<<< HEAD (block $label$0 (block $label$1 (local.set $6 @@ -584,11 +1144,25 @@ ) ) ) +======= + (block $label$0 (result f64) + (call $log-i32 + (call $hashMemory) + ) + (local.tee $1 + (local.tee $1 + (local.tee $1 + (local.tee $1 + (local.tee $1 + (local.tee $1 + (local.get $1) +>>>>>>> Add support for reference types proposal ) ) ) ) ) +<<<<<<< HEAD (br_if $label$1 (i32.eqz (local.get $5) @@ -630,13 +1204,37 @@ (local $0 i32) (local $1 i64) (local $2 v128) +======= + ) + ) + ) + (func $func_17_invoker (; 18 ;) (type $FUNCSIG$v) + (drop + (call $func_17 + (i64.const 2165693858784287514) + (f64.const 17179869184) + (v128.const i32x4 0xdf800000 0xfffffff9 0xffffff80 0x5f800000) + (f32.const -nan:0x7fffca) + ) + ) + (call $log-i32 + (call $hashMemory) + ) + ) + (func $func_19 (; 19 ;) (param $0 i32) (result exnref) + (local $1 anyref) +>>>>>>> Add support for reference types proposal (block (if (i32.eqz (global.get $hangLimit) ) (return +<<<<<<< HEAD (i32.const 84558856) +======= + (ref.null) +>>>>>>> Add support for reference types proposal ) ) (global.set $hangLimit @@ -646,6 +1244,7 @@ ) ) ) +<<<<<<< HEAD (block $label$0 (result i32) (nop) (br_if $label$0 @@ -659,11 +1258,31 @@ (func $func_16_invoker (; 17 ;) (type $FUNCSIG$v) (drop (call $func_16) +======= + (ref.null) + ) + (func $func_19_invoker (; 20 ;) (type $FUNCSIG$v) + (drop + (call $func_19 + (i32.const -8192) + ) + ) + (drop + (call $func_19 + (i32.const 641212458) + ) + ) + (drop + (call $func_19 + (i32.const 128) + ) +>>>>>>> Add support for reference types proposal ) (call $log-i32 (call $hashMemory) ) (drop +<<<<<<< HEAD (call $func_16) ) ) @@ -680,13 +1299,25 @@ (local $9 f64) (local $10 v128) (local $11 i32) +======= + (call $func_19 + (i32.const -38) + ) + ) + ) + (func $func_21 (; 21 ;) (type $FUNCSIG$VEdfAVAE) (param $0 exnref) (param $1 f64) (param $2 f32) (param $3 anyref) (param $4 v128) (param $5 anyref) (param $6 exnref) (result v128) +>>>>>>> Add support for reference types proposal (block (if (i32.eqz (global.get $hangLimit) ) (return +<<<<<<< HEAD (local.get $10) +======= + (local.get $4) +>>>>>>> Add support for reference types proposal ) ) (global.set $hangLimit @@ -696,6 +1327,7 @@ ) ) ) +<<<<<<< HEAD (local.tee $1 (local.tee $1 (loop $label$0 (result v128) @@ -718,11 +1350,48 @@ (block $label$1 (result v128) (nop) (local.get $0) +======= + (local.tee $4 + (loop $label$0 + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (v128.const i32x4 0x41700000 0x4d633171 0xc7800000 0x4e4e4e4e) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (block $label$1 + (local.set $3 + (local.tee $3 + (local.tee $5 + (local.tee $3 + (local.tee $3 + (local.tee $5 + (ref.null) + ) + ) + ) + ) + ) + ) + (return + (local.get $4) +>>>>>>> Add support for reference types proposal ) ) ) ) ) +<<<<<<< HEAD (func $func_18_invoker (; 19 ;) (type $FUNCSIG$v) (drop (call $func_18) @@ -735,21 +1404,43 @@ ) (drop (call $func_18) +======= + (func $func_21_invoker (; 22 ;) (type $FUNCSIG$v) + (drop + (call $func_21 + (ref.null) + (f64.const -4294967296) + (f32.const 72057594037927936) + (ref.null) + (v128.const i32x4 0x651900ff 0x7ffe2a5a 0x38010008 0x00554c1f) + (ref.null) + (ref.null) + ) +>>>>>>> Add support for reference types proposal ) (call $log-i32 (call $hashMemory) ) ) +<<<<<<< HEAD (func $func_20 (; 20 ;) (param $0 i64) (param $1 f32) (param $2 i32) (param $3 i32) (result v128) (local $4 i64) (local $5 f64) +======= + (func $func_23 (; 23 ;) (param $0 anyref) (result funcref) + (local $1 v128) +>>>>>>> Add support for reference types proposal (block (if (i32.eqz (global.get $hangLimit) ) (return +<<<<<<< HEAD (v128.const i32x4 0x4e000000 0x4f000000 0x45821000 0x7f7fffff) +======= + (ref.func $log-f64) +>>>>>>> Add support for reference types proposal ) ) (global.set $hangLimit @@ -759,6 +1450,7 @@ ) ) ) +<<<<<<< HEAD (block $label$0 (result v128) (local.set $1 (local.get $1) @@ -767,6 +1459,85 @@ ) ) (func $hangLimitInitializer (; 21 ;) +======= + (ref.func $func_17_invoker) + ) + (func $func_23_invoker (; 24 ;) (type $FUNCSIG$v) + (drop + (call $func_23 + (ref.null) + ) + ) + (call $log-i32 + (call $hashMemory) + ) + ) + (func $func_25 (; 25 ;) (param $0 exnref) (result v128) + (local $1 i64) + (local $2 exnref) + (local $3 v128) + (local $4 exnref) + (local $5 f32) + (local $6 funcref) + (local $7 f32) + (local $8 exnref) + (local $9 f64) + (local $10 f32) + (local $11 i64) + (local $12 f32) + (local $13 f32) + (local $14 v128) + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (v128.const i32x4 0x05050505 0x46190000 0xc6800000 0x4a031a19) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (if (result v128) + (i32.eqz + (loop $label$0 (result i32) + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (v128.const i32x4 0x0000ff44 0xbf00bd00 0x1d00b544 0x0b7ffe00) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (i32.const -134217728) + ) + ) + (block $label$6 + (nop) + (return + (v128.const i32x4 0x4eaca8bf 0xda000000 0x48800000 0xffffffe9) + ) + ) + (block $label$7 (result v128) + (local.get $3) + ) + ) + ) + (func $hangLimitInitializer (; 26 ;) +>>>>>>> Add support for reference types proposal (global.set $hangLimit (i32.const 10) ) diff --git a/test/passes/translate-to-fuzz_no-fuzz-nans_all-features.txt b/test/passes/translate-to-fuzz_no-fuzz-nans_all-features.txt index 67946289668..fc3470f3ae8 100644 --- a/test/passes/translate-to-fuzz_no-fuzz-nans_all-features.txt +++ b/test/passes/translate-to-fuzz_no-fuzz-nans_all-features.txt @@ -5,27 +5,51 @@ (type $FUNCSIG$vf (func (param f32))) (type $FUNCSIG$vd (func (param f64))) (type $FUNCSIG$vV (func (param v128))) +<<<<<<< HEAD (type $FUNCSIG$d (func (result f64))) (type $FUNCSIG$v (func)) (type $FUNCSIG$ji (func (param i32) (result i64))) (type $FUNCSIG$ff (func (param f32) (result f32))) (type $FUNCSIG$fi (func (param i32) (result f32))) (type $FUNCSIG$Vjfii (func (param i64 f32 i32 i32) (result v128))) +======= + (type $FUNCSIG$vA (func (param anyref))) + (type $FUNCSIG$vF (func (param funcref))) + (type $FUNCSIG$vE (func (param exnref))) + (type $FUNCSIG$Ad (func (param f64) (result anyref))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$iiFdf (func (param i32 funcref f64 f32) (result i32))) + (type $FUNCSIG$djdVf (func (param i64 f64 v128 f32) (result f64))) + (type $FUNCSIG$VEdfAVAE (func (param exnref f64 f32 anyref v128 anyref exnref) (result v128))) +>>>>>>> Add support for reference types proposal (import "fuzzing-support" "log-i32" (func $log-i32 (param i32))) (import "fuzzing-support" "log-i64" (func $log-i64 (param i64))) (import "fuzzing-support" "log-f32" (func $log-f32 (param f32))) (import "fuzzing-support" "log-f64" (func $log-f64 (param f64))) (import "fuzzing-support" "log-v128" (func $log-v128 (param v128))) - (memory $0 (shared 1 1)) + (import "fuzzing-support" "log-anyref" (func $log-anyref (param anyref))) + (import "fuzzing-support" "log-funcref" (func $log-funcref (param funcref))) + (import "fuzzing-support" "log-exnref" (func $log-exnref (param exnref))) + (memory $0 1 1) (data (i32.const 0) "N\0fN\f5\f9\b1\ff\fa\eb\e5\fe\a7\ec\fb\fc\f4\a6\e4\ea\f0\ae\e3") +<<<<<<< HEAD (table $0 4 4 funcref) (elem (i32.const 0) $func_11 $func_13 $func_15 $func_15) +======= + (table $0 3 funcref) + (elem (i32.const 0) $func_14 $func_15 $func_25) +>>>>>>> Add support for reference types proposal (global $global$0 (mut i32) (i32.const 975663930)) (global $global$1 (mut i32) (i32.const 2066300474)) (global $global$2 (mut i64) (i64.const 20510)) (global $global$3 (mut f32) (f32.const -2147483648)) (global $global$4 (mut v128) (v128.const i32x4 0x7f002833 0x580000fe 0x59750500 0x01ff002f)) + (global $global$5 (mut anyref) (ref.null)) + (global $global$6 (mut funcref) (ref.null)) + (global $global$7 (mut exnref) (ref.null)) + (global $global$8 (mut exnref) (ref.null)) (global $hangLimit (mut i32) (i32.const 10)) +<<<<<<< HEAD (event $event$0 (attr 0) (param f64 f32)) (export "hashMemory" (func $hashMemory)) (export "memory" (memory $0)) @@ -38,8 +62,23 @@ (export "func_16_invoker" (func $func_16_invoker)) (export "func_18_invoker" (func $func_18_invoker)) (export "func_20" (func $func_20)) +======= + (export "hashMemory" (func $hashMemory)) + (export "memory" (memory $0)) + (export "func_9" (func $func_9)) + (export "func_10_invoker" (func $func_10_invoker)) + (export "func_12_invoker" (func $func_12_invoker)) + (export "func_15" (func $func_15)) + (export "func_15_invoker" (func $func_15_invoker)) + (export "func_17" (func $func_17)) + (export "func_17_invoker" (func $func_17_invoker)) + (export "func_19_invoker" (func $func_19_invoker)) + (export "func_21" (func $func_21)) + (export "func_21_invoker" (func $func_21_invoker)) + (export "func_23_invoker" (func $func_23_invoker)) +>>>>>>> Add support for reference types proposal (export "hangLimitInitializer" (func $hangLimitInitializer)) - (func $hashMemory (; 5 ;) (type $FUNCSIG$i) (result i32) + (func $hashMemory (; 8 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) (local.set $0 (i32.const 5381) @@ -270,13 +309,19 @@ ) (local.get $0) ) +<<<<<<< HEAD (func $func_6 (; 6 ;) (param $0 i64) (param $1 v128) (param $2 i64) (result f64) +======= + (func $func_9 (; 9 ;) (type $FUNCSIG$Ad) (param $0 f64) (result anyref) + (local $1 anyref) +>>>>>>> Add support for reference types proposal (block (if (i32.eqz (global.get $hangLimit) ) (return +<<<<<<< HEAD (f64.const -1) ) ) @@ -301,6 +346,9 @@ ) (return (local.get $2) +======= + (ref.null) +>>>>>>> Add support for reference types proposal ) ) (global.set $hangLimit @@ -310,6 +358,7 @@ ) ) ) +<<<<<<< HEAD (block $label$0 (call $log-i32 (call $hashMemory) @@ -332,13 +381,153 @@ (local $10 i64) (local $11 i64) (local $12 f64) +======= + (block $label$0 (result anyref) + (local.set $1 + (block $label$1 (result anyref) + (if + (i32.eqz + (i32.const 723742247) + ) + (block $label$2 + (local.set $0 + (if (result f64) + (if (result i32) + (i32.eqz + (i32.const 1) + ) + (i32.const 1581531209) + (i32.const -127) + ) + (block $label$6 (result f64) + (local.set $1 + (local.tee $1 + (local.get $1) + ) + ) + (local.tee $0 + (loop $label$7 (result f64) + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (ref.null) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (block $label$8 (result f64) + (if + (i32.const 0) + (block $label$9 + (local.set $1 + (local.tee $1 + (ref.null) + ) + ) + (local.set $1 + (local.tee $1 + (local.get $1) + ) + ) + ) + (nop) + ) + (loop $label$11 (result f64) + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (local.get $1) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (block $label$12 (result f64) + (local.set $1 + (local.tee $1 + (local.get $1) + ) + ) + (f64.const 0) + ) + ) + ) + ) + ) + ) + (block $label$13 + (br $label$2) + ) + ) + ) + (nop) + ) + (block $label$14 + (local.set $0 + (local.tee $0 + (local.tee $0 + (local.tee $0 + (local.tee $0 + (local.tee $0 + (local.tee $0 + (local.tee $0 + (local.tee $0 + (local.tee $0 + (local.tee $0 + (local.tee $0 + (f64.const 0) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (block $label$26 + (nop) + (nop) + ) + ) + ) + (local.get $1) + ) + ) + (local.get $1) + ) + ) + (func $func_10 (; 10 ;) (param $0 funcref) (param $1 funcref) (param $2 anyref) (param $3 anyref) (param $4 funcref) (param $5 anyref) (result i64) +>>>>>>> Add support for reference types proposal (block (if (i32.eqz (global.get $hangLimit) ) (return +<<<<<<< HEAD (local.get $5) +======= + (i64.const 4398046511104) +>>>>>>> Add support for reference types proposal ) ) (global.set $hangLimit @@ -348,6 +537,7 @@ ) ) ) +<<<<<<< HEAD (block $label$0 (call $log-f32 (local.get $5) @@ -366,13 +556,37 @@ (local $5 f32) (local $6 i32) (local $7 i64) +======= + (i64.const 4294967296) + ) + (func $func_10_invoker (; 11 ;) (type $FUNCSIG$v) + (drop + (call $func_10 + (ref.func $log-f32) + (ref.null) + (ref.null) + (ref.null) + (ref.func $log-i64) + (ref.null) + ) + ) + ) + (func $func_12 (; 12 ;) (result v128) + (local $0 funcref) + (local $1 anyref) + (local $2 exnref) +>>>>>>> Add support for reference types proposal (block (if (i32.eqz (global.get $hangLimit) ) (return +<<<<<<< HEAD (local.get $1) +======= + (v128.const i32x4 0x0a0d1c1f 0x071d1c48 0x0000034d 0x00000000) +>>>>>>> Add support for reference types proposal ) ) (global.set $hangLimit @@ -383,6 +597,7 @@ ) ) (block $label$0 +<<<<<<< HEAD (call $log-v128 (v128.const i32x4 0x77367f7e 0x00000045 0x40000000 0x0000007f) ) @@ -410,13 +625,318 @@ (local $7 f32) (local $8 i32) (local $9 f64) +======= + (block $label$1 + (loop $label$2 + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (v128.const i32x4 0x00005b34 0x342a2f2f 0x00000f5b 0x0e171513) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (block + (block $label$3 + (nop) + ) + (br_if $label$2 + (i32.eqz + (i32.const -536870912) + ) + ) + (br_if $label$2 + (i32.eqz + (i32.const -32768) + ) + ) + ) + ) + (block $label$4 + (nop) + (if + (i32.const 138613770) + (local.set $1 + (local.tee $1 + (local.tee $1 + (local.tee $1 + (ref.null) + ) + ) + ) + ) + (block $label$5 + (if + (loop $label$6 (result i32) + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (v128.const i32x4 0xff000000 0x00001000 0x00000001 0x00004611) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (loop $label$7 (result i32) + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (v128.const i32x4 0x43434343 0x43434343 0xfff80000 0xffffffff) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (block $label$8 (result i32) + (nop) + (br_if $label$8 + (loop $label$9 (result i32) + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (v128.const i32x4 0x050300ff 0x00000000 0x00010000 0xffff007f) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (block (result i32) + (local.set $1 + (local.get $1) + ) + (br_if $label$9 + (i32.const -80) + ) + (i32.const 337253912) + ) + ) + (i32.eqz + (i32.const 96) + ) + ) + ) + ) + ) + (nop) + (block $label$10 + (local.set $1 + (ref.null) + ) + (if + (i32.eqz + (i32.const 0) + ) + (block $label$11 + (nop) + (local.set $2 + (local.get $2) + ) + ) + (loop $label$12 + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (v128.const i32x4 0x4e000000 0x41dddd9f 0x00000000 0x40a00000) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (block $label$13 + (local.set $2 + (local.get $2) + ) + (if + (i32.const 51777295) + (block $label$14 + (br_if $label$5 + (i32.eqz + (global.get $global$0) + ) + ) + (loop $label$15 + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (v128.const i32x4 0x1dcf0000 0x56001375 0x000afe08 0x55490b31) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (block $label$16 + (br_if $label$1 + (i32.const -2147483647) + ) + (local.set $0 + (ref.null) + ) + ) + ) + ) + (block $label$17 + (local.set $2 + (local.tee $2 + (ref.null) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (memory.init 0 + (i32.and + (i32.const 2147483647) + (i32.const 15) + ) + (i32.const 15) + (i32.const 6) + ) + ) + ) + ) + ) + (nop) + (i64.store32 offset=4 align=1 + (i32.and + (i32.const 70) + (i32.const 15) + ) + (block $label$18 + (loop $label$19 + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (v128.const i32x4 0x0000110e 0x00000000 0x00001e13 0x00000000) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (block $label$20 + (local.set $1 + (local.tee $1 + (local.tee $1 + (local.tee $1 + (local.tee $1 + (local.tee $1 + (local.get $1) + ) + ) + ) + ) + ) + ) + (nop) + ) + ) + (block $label$21 + (block $label$22 + (block $label$23 + (block $label$24 + (local.set $2 + (ref.null) + ) + (local.set $1 + (local.tee $1 + (ref.null) + ) + ) + ) + (return + (v128.const i32x4 0xefe65f1c 0x49000201 0x4f225f1e 0x0018e9f0) + ) + ) + ) + ) + ) + ) + ) + ) + (func $func_12_invoker (; 13 ;) (type $FUNCSIG$v) + (drop + (call $func_12) + ) + (call $log-i32 + (call $hashMemory) + ) + (drop + (call $func_12) + ) + ) + (func $func_14 (; 14 ;) (result f64) + (local $0 anyref) + (local $1 anyref) + (local $2 i64) + (local $3 v128) + (local $4 anyref) + (local $5 f64) + (local $6 f32) +>>>>>>> Add support for reference types proposal (block (if (i32.eqz (global.get $hangLimit) ) (return +<<<<<<< HEAD (f32.const 10961.05859375) +======= + (f64.const -1) +>>>>>>> Add support for reference types proposal ) ) (global.set $hangLimit @@ -426,6 +946,7 @@ ) ) ) +<<<<<<< HEAD (local.get $7) ) (func $func_11_invoker (; 12 ;) (type $FUNCSIG$v) @@ -473,13 +994,27 @@ (local $13 v128) (local $14 i32) (local $15 v128) +======= + (block $label$0 + (return + (local.get $5) + ) + ) + ) + (func $func_15 (; 15 ;) (type $FUNCSIG$iiFdf) (param $0 i32) (param $1 funcref) (param $2 f64) (param $3 f32) (result i32) + (local $4 funcref) +>>>>>>> Add support for reference types proposal (block (if (i32.eqz (global.get $hangLimit) ) (return +<<<<<<< HEAD (local.get $12) +======= + (local.get $0) +>>>>>>> Add support for reference types proposal ) ) (global.set $hangLimit @@ -489,6 +1024,7 @@ ) ) ) +<<<<<<< HEAD (i64.const 2) ) (func $func_14 (; 14 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) @@ -500,13 +1036,36 @@ (local $6 f32) (local $7 f32) (local $8 f64) +======= + (local.tee $0 + (local.get $0) + ) + ) + (func $func_15_invoker (; 16 ;) (type $FUNCSIG$v) + (drop + (call $func_15 + (i32.const 65535) + (ref.func $log-f32) + (f64.const -0) + (f32.const 24) + ) + ) + ) + (func $func_17 (; 17 ;) (type $FUNCSIG$djdVf) (param $0 i64) (param $1 f64) (param $2 v128) (param $3 f32) (result f64) + (local $4 funcref) + (local $5 anyref) +>>>>>>> Add support for reference types proposal (block (if (i32.eqz (global.get $hangLimit) ) (return +<<<<<<< HEAD (f32.const -4294967296) +======= + (f64.const 41) +>>>>>>> Add support for reference types proposal ) ) (global.set $hangLimit @@ -516,6 +1075,7 @@ ) ) ) +<<<<<<< HEAD (block $label$0 (block $label$1 (local.set $6 @@ -586,11 +1146,25 @@ ) ) ) +======= + (block $label$0 (result f64) + (call $log-i32 + (call $hashMemory) + ) + (local.tee $1 + (local.tee $1 + (local.tee $1 + (local.tee $1 + (local.tee $1 + (local.tee $1 + (local.get $1) +>>>>>>> Add support for reference types proposal ) ) ) ) ) +<<<<<<< HEAD (br_if $label$1 (i32.eqz (local.get $5) @@ -606,13 +1180,37 @@ (local $1 f32) (local $2 f64) (local $3 v128) +======= + ) + ) + ) + (func $func_17_invoker (; 18 ;) (type $FUNCSIG$v) + (drop + (call $func_17 + (i64.const 2165693858784287514) + (f64.const 17179869184) + (v128.const i32x4 0xdf800000 0x00000000 0x00000000 0x5f800000) + (f32.const 0) + ) + ) + (call $log-i32 + (call $hashMemory) + ) + ) + (func $func_19 (; 19 ;) (param $0 i32) (result exnref) + (local $1 anyref) +>>>>>>> Add support for reference types proposal (block (if (i32.eqz (global.get $hangLimit) ) (return +<<<<<<< HEAD (f32.const -65536) +======= + (ref.null) +>>>>>>> Add support for reference types proposal ) ) (global.set $hangLimit @@ -622,6 +1220,7 @@ ) ) ) +<<<<<<< HEAD (f64x2.splat (return (f32.const 1) @@ -632,13 +1231,47 @@ (local $0 i32) (local $1 i64) (local $2 v128) +======= + (ref.null) + ) + (func $func_19_invoker (; 20 ;) (type $FUNCSIG$v) + (drop + (call $func_19 + (i32.const -8192) + ) + ) + (drop + (call $func_19 + (i32.const 641212458) + ) + ) + (drop + (call $func_19 + (i32.const 128) + ) + ) + (call $log-i32 + (call $hashMemory) + ) + (drop + (call $func_19 + (i32.const -38) + ) + ) + ) + (func $func_21 (; 21 ;) (type $FUNCSIG$VEdfAVAE) (param $0 exnref) (param $1 f64) (param $2 f32) (param $3 anyref) (param $4 v128) (param $5 anyref) (param $6 exnref) (result v128) +>>>>>>> Add support for reference types proposal (block (if (i32.eqz (global.get $hangLimit) ) (return +<<<<<<< HEAD (i32.const 84558856) +======= + (local.get $4) +>>>>>>> Add support for reference types proposal ) ) (global.set $hangLimit @@ -648,23 +1281,76 @@ ) ) ) +<<<<<<< HEAD (block $label$0 (result i32) (nop) (br_if $label$0 (i32.const 16777216) (i32.eqz (i32.const 524288) +======= + (local.tee $4 + (loop $label$0 + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (v128.const i32x4 0x41700000 0x4d633171 0xc7800000 0x4e4e4e4e) + ) + ) + (global.set $hangLimit + (i32.sub + (global.get $hangLimit) + (i32.const 1) + ) + ) + ) + (block $label$1 + (local.set $3 + (local.tee $3 + (local.tee $5 + (local.tee $3 + (local.tee $3 + (local.tee $5 + (ref.null) + ) + ) + ) + ) + ) + ) + (return + (local.get $4) + ) +>>>>>>> Add support for reference types proposal ) ) ) ) +<<<<<<< HEAD (func $func_16_invoker (; 17 ;) (type $FUNCSIG$v) (drop (call $func_16) +======= + (func $func_21_invoker (; 22 ;) (type $FUNCSIG$v) + (drop + (call $func_21 + (ref.null) + (f64.const -4294967296) + (f32.const 72057594037927936) + (ref.null) + (v128.const i32x4 0x651900ff 0x7ffe2a5a 0x38010008 0x00554c1f) + (ref.null) + (ref.null) + ) +>>>>>>> Add support for reference types proposal ) (call $log-i32 (call $hashMemory) ) +<<<<<<< HEAD (drop (call $func_16) ) @@ -682,13 +1368,22 @@ (local $9 f64) (local $10 v128) (local $11 i32) +======= + ) + (func $func_23 (; 23 ;) (param $0 anyref) (result funcref) + (local $1 v128) +>>>>>>> Add support for reference types proposal (block (if (i32.eqz (global.get $hangLimit) ) (return +<<<<<<< HEAD (local.get $10) +======= + (ref.func $log-f64) +>>>>>>> Add support for reference types proposal ) ) (global.set $hangLimit @@ -698,6 +1393,7 @@ ) ) ) +<<<<<<< HEAD (local.tee $1 (local.tee $1 (loop $label$0 (result v128) @@ -753,6 +1449,43 @@ (return (v128.const i32x4 0x00000000 0x40c11580 0x00000000 0xb8100000) ) +======= + (ref.func $func_17_invoker) + ) + (func $func_23_invoker (; 24 ;) (type $FUNCSIG$v) + (drop + (call $func_23 + (ref.null) + ) + ) + (call $log-i32 + (call $hashMemory) + ) + ) + (func $func_25 (; 25 ;) (param $0 exnref) (result v128) + (local $1 i64) + (local $2 exnref) + (local $3 v128) + (local $4 exnref) + (local $5 f32) + (local $6 funcref) + (local $7 f32) + (local $8 exnref) + (local $9 f64) + (local $10 f32) + (local $11 i64) + (local $12 f32) + (local $13 f32) + (local $14 v128) + (block + (if + (i32.eqz + (global.get $hangLimit) + ) + (return + (v128.const i32x4 0x033e0b0b 0x5d5d0001 0x02000b0b 0xff80272f) + ) +>>>>>>> Add support for reference types proposal ) (global.set $hangLimit (i32.sub @@ -761,14 +1494,24 @@ ) ) ) +<<<<<<< HEAD (v128.const i32x4 0x00000000 0x80000000 0x00000078 0x00000000) ) (func $hangLimitInitializer (; 21 ;) +======= + (v128.const i32x4 0x00000000 0x405e8000 0xffc00000 0x41dfffff) + ) + (func $hangLimitInitializer (; 26 ;) +>>>>>>> Add support for reference types proposal (global.set $hangLimit (i32.const 10) ) ) +<<<<<<< HEAD (func $deNan32 (; 22 ;) (param $0 f32) (result f32) +======= + (func $deNan32 (; 27 ;) (param $0 f32) (result f32) +>>>>>>> Add support for reference types proposal (if (result f32) (f32.eq (local.get $0) @@ -778,7 +1521,11 @@ (f32.const 0) ) ) +<<<<<<< HEAD (func $deNan64 (; 23 ;) (param $0 f64) (result f64) +======= + (func $deNan64 (; 28 ;) (param $0 f64) (result f64) +>>>>>>> Add support for reference types proposal (if (result f64) (f64.eq (local.get $0) diff --git a/test/push_pop.wast b/test/push_pop.wast index f40e30abe93..d73e0dc684b 100644 --- a/test/push_pop.wast +++ b/test/push_pop.wast @@ -19,5 +19,21 @@ (push (f64.const 1)) (f64.pop) ) + (func "ppanyref" (result anyref) (local $any anyref) + (push (local.get $any)) + (anyref.pop) + ) + (func "ppfuncref" (result funcref) (local $fn funcref) + (push (local.get $fn)) + (funcref.pop) + ) + (func "ppnullref" + (push (ref.null)) + (drop (nullref.pop)) + ) + (func "ppexnref" (result exnref) (local $exn exnref) + (push (local.get $exn)) + (exnref.pop) + ) ) diff --git a/test/push_pop.wast.from-wast b/test/push_pop.wast.from-wast index 63f21ee9c8c..5d83e7c9248 100644 --- a/test/push_pop.wast.from-wast +++ b/test/push_pop.wast.from-wast @@ -3,10 +3,18 @@ (type $FUNCSIG$j (func (result i64))) (type $FUNCSIG$f (func (result f32))) (type $FUNCSIG$d (func (result f64))) + (type $FUNCSIG$A (func (result anyref))) + (type $FUNCSIG$F (func (result funcref))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$E (func (result exnref))) (export "ppi32" (func $0)) (export "ppi64" (func $1)) (export "ppf32" (func $2)) (export "ppf64" (func $3)) + (export "ppanyref" (func $4)) + (export "ppfuncref" (func $5)) + (export "ppnullref" (func $6)) + (export "ppexnref" (func $7)) (func $0 (; 0 ;) (type $FUNCSIG$i) (result i32) (push (i32.const 1) @@ -31,4 +39,33 @@ ) (f64.pop) ) + (func $4 (; 4 ;) (type $FUNCSIG$A) (result anyref) + (local $any anyref) + (push + (local.get $any) + ) + (anyref.pop) + ) + (func $5 (; 5 ;) (type $FUNCSIG$F) (result funcref) + (local $fn funcref) + (push + (local.get $fn) + ) + (funcref.pop) + ) + (func $6 (; 6 ;) (type $FUNCSIG$v) + (push + (ref.null) + ) + (drop + (nullref.pop) + ) + ) + (func $7 (; 7 ;) (type $FUNCSIG$E) (result exnref) + (local $exn exnref) + (push + (local.get $exn) + ) + (exnref.pop) + ) ) diff --git a/test/push_pop.wast.fromBinary b/test/push_pop.wast.fromBinary index ac6901ff3b3..9a4418bbbb3 100644 --- a/test/push_pop.wast.fromBinary +++ b/test/push_pop.wast.fromBinary @@ -3,10 +3,18 @@ (type $1 (func (result i64))) (type $2 (func (result f32))) (type $3 (func (result f64))) + (type $4 (func (result anyref))) + (type $5 (func (result funcref))) + (type $6 (func)) + (type $7 (func (result exnref))) (export "ppi32" (func $0)) (export "ppi64" (func $1)) (export "ppf32" (func $2)) (export "ppf64" (func $3)) + (export "ppanyref" (func $4)) + (export "ppfuncref" (func $5)) + (export "ppnullref" (func $6)) + (export "ppexnref" (func $7)) (func $0 (; 0 ;) (type $0) (result i32) (i32.const 1) ) @@ -19,5 +27,22 @@ (func $3 (; 3 ;) (type $3) (result f64) (f64.const 1) ) + (func $4 (; 4 ;) (type $4) (result anyref) + (local $0 anyref) + (local.get $0) + ) + (func $5 (; 5 ;) (type $5) (result funcref) + (local $0 funcref) + (local.get $0) + ) + (func $6 (; 6 ;) (type $6) + (drop + (ref.null) + ) + ) + (func $7 (; 7 ;) (type $7) (result exnref) + (local $0 exnref) + (local.get $0) + ) ) diff --git a/test/push_pop.wast.fromBinary.noDebugInfo b/test/push_pop.wast.fromBinary.noDebugInfo index ac6901ff3b3..9a4418bbbb3 100644 --- a/test/push_pop.wast.fromBinary.noDebugInfo +++ b/test/push_pop.wast.fromBinary.noDebugInfo @@ -3,10 +3,18 @@ (type $1 (func (result i64))) (type $2 (func (result f32))) (type $3 (func (result f64))) + (type $4 (func (result anyref))) + (type $5 (func (result funcref))) + (type $6 (func)) + (type $7 (func (result exnref))) (export "ppi32" (func $0)) (export "ppi64" (func $1)) (export "ppf32" (func $2)) (export "ppf64" (func $3)) + (export "ppanyref" (func $4)) + (export "ppfuncref" (func $5)) + (export "ppnullref" (func $6)) + (export "ppexnref" (func $7)) (func $0 (; 0 ;) (type $0) (result i32) (i32.const 1) ) @@ -19,5 +27,22 @@ (func $3 (; 3 ;) (type $3) (result f64) (f64.const 1) ) + (func $4 (; 4 ;) (type $4) (result anyref) + (local $0 anyref) + (local.get $0) + ) + (func $5 (; 5 ;) (type $5) (result funcref) + (local $0 funcref) + (local.get $0) + ) + (func $6 (; 6 ;) (type $6) + (drop + (ref.null) + ) + ) + (func $7 (; 7 ;) (type $7) (result exnref) + (local $0 exnref) + (local.get $0) + ) ) diff --git a/test/reference-types.wast b/test/reference-types.wast new file mode 100644 index 00000000000..66fab6d979c --- /dev/null +++ b/test/reference-types.wast @@ -0,0 +1,314 @@ +;; reftype :: anyref | funcref | exnref | nullref + +;; nullref is merely an internal type and is neither expressible in the binary +;; format nor the text format. + +;; t <: anyref for all reftypes t +;; nullref <: anyref, nullref <: funcref and nullref <: exnref + +(module + (type $sig_anyref (func (param anyref))) + (type $sig_funcref (func (param funcref))) + (type $sig_exnref (func (param exnref))) + + (func $take_anyref (param anyref)) + (func $take_funcref (param funcref)) + (func $take_exnref (param exnref)) + (func $foo) + + (table funcref (elem $take_anyref $take_funcref $take_exnref)) + + (import "env" "import_func" (func $import_func (param anyref) (result funcref))) + (import "env" "import_global" (global $import_global anyref)) + (export "export_func" (func $import_func (param anyref) (result funcref))) + (export "export_global" (global $import_global)) + + ;; Test subtype relationship in global initializer expressions + (global $global_anyref (mut anyref) (ref.null)) + (global $global_funcref (mut funcref) (ref.null)) + (global $global_exnref (mut exnref) (ref.null)) + (global $global_anyref2 (mut anyref) (ref.func $foo)) + (global $global_funcref2 (mut funcref) (ref.func $foo)) + + (func $test (local $local_anyref anyref) (local $local_funcref funcref) + (local $local_exnref exnref) + ;; Test subtype relationship for local.set & Test types for local.get + (local.set $local_anyref (local.get $local_anyref)) + (local.set $local_anyref (local.get $local_funcref)) + (local.set $local_anyref (local.get $local_exnref)) + (local.set $local_anyref (ref.null)) + (local.set $local_anyref (ref.func $foo)) + (local.set $local_funcref (local.get $local_funcref)) + (local.set $local_funcref (ref.null)) + (local.set $local_funcref (ref.func $foo)) + (local.set $local_exnref (local.get $local_exnref)) + (local.set $local_exnref (ref.null)) + + ;; Test subtype relationship for global.set & Test types for global.get + (global.set $global_anyref (global.get $global_anyref)) + (global.set $global_anyref (global.get $global_funcref)) + (global.set $global_anyref (global.get $global_exnref)) + (global.set $global_anyref (ref.null)) + (global.set $global_anyref (ref.func $foo)) + (global.set $global_funcref (global.get $global_funcref)) + (global.set $global_funcref (ref.null)) + (global.set $global_funcref (ref.func $foo)) + (global.set $global_exnref (global.get $global_exnref)) + (global.set $global_exnref (ref.null)) + + ;; Test subtype relationship for function call / call_indirect params + (call $take_anyref (local.get $local_anyref)) + (call $take_anyref (local.get $local_funcref)) + (call $take_anyref (local.get $local_exnref)) + (call $take_anyref (ref.null)) + (call_indirect (type $sig_anyref) (local.get $local_anyref) (i32.const 0)) + (call_indirect (type $sig_anyref) (local.get $local_funcref) (i32.const 0)) + (call_indirect (type $sig_anyref) (local.get $local_exnref) (i32.const 0)) + (call_indirect (type $sig_anyref) (ref.null) (i32.const 0)) + (call_indirect (type $sig_funcref) (local.get $local_funcref) (i32.const 1)) + (call_indirect (type $sig_funcref) (ref.null) (i32.const 1)) + (call_indirect (type $sig_exnref) (local.get $local_exnref) (i32.const 2)) + (call_indirect (type $sig_exnref) (ref.null) (i32.const 2)) + + ;; Test subtype relationship for block return type + (drop + (block (result anyref) + (br_if 0 (local.get $local_anyref) (i32.const 1)) + ) + ) + (drop + (block (result anyref) + (br_if 0 (local.get $local_funcref) (i32.const 1)) + ) + ) + (drop + (block (result anyref) + (br_if 0 (local.get $local_exnref) (i32.const 1)) + ) + ) + (drop + (block (result anyref) + (br_if 0 (ref.null) (i32.const 1)) + ) + ) + (drop + (block (result funcref) + (br_if 0 (ref.null) (i32.const 1)) + ) + ) + (drop + (block (result exnref) + (br_if 0 (ref.null) (i32.const 1)) + ) + ) + + ;; Test subtype relationship for loop return type + (drop + (loop (result anyref) + (local.get $local_anyref) + ) + ) + (drop + (loop (result anyref) + (local.get $local_funcref) + ) + ) + (drop + (loop (result anyref) + (local.get $local_exnref) + ) + ) + (drop + (loop (result anyref) + (ref.null) + ) + ) + (drop + (loop (result funcref) + (local.get $local_funcref) + ) + ) + (drop + (loop (result funcref) + (ref.null) + ) + ) + (drop + (loop (result exnref) + (local.get $local_exnref) + ) + ) + (drop + (loop (result exnref) + (ref.null) + ) + ) + + ;; Test subtype relationship for if return type + (drop + (if (result anyref) + (i32.const 1) + (local.get $local_anyref) + (local.get $local_exnref) + ) + ) + (drop + (if (result anyref) + (i32.const 1) + (ref.func $foo) + (ref.null) + ) + ) + (drop + (if (result funcref) + (i32.const 1) + (ref.func $foo) + (ref.null) + ) + ) + (drop + (if (result exnref) + (i32.const 1) + (local.get $local_exnref) + (ref.null) + ) + ) + + ;; Test subtype relationship for try return type + (drop + (try (result anyref) + (local.get $local_anyref) + (catch + (exnref.pop) + ) + ) + ) + (drop + (try (result anyref) + (ref.func $foo) + (catch + (drop (exnref.pop)) + (ref.null) + ) + ) + ) + (drop + (try (result funcref) + (ref.func $foo) + (catch + (drop (exnref.pop)) + (ref.null) + ) + ) + ) + (drop + (try (result exnref) + (ref.null) + (catch + (exnref.pop) + ) + ) + ) + + ;; Test subtype relationship for typed select + (drop + (select (result anyref) + (local.get $local_anyref) + (ref.func $foo) + (i32.const 1) + ) + ) + (drop + (select (result anyref) + (local.get $local_exnref) + (local.get $local_anyref) + (i32.const 1) + ) + ) + (drop + (select (result anyref) + (local.get $local_anyref) + (ref.null) + (i32.const 1) + ) + ) + (drop + (select (result anyref) + (ref.null) + (ref.func $foo) + (i32.const 1) + ) + ) + (drop + (select (result funcref) + (ref.func $foo) + (ref.null) + (i32.const 1) + ) + ) + (drop + (select (result exnref) + (ref.null) + (local.get $local_exnref) + (i32.const 1) + ) + ) + (drop + (select (result i32) + (i32.const 0) + (i32.const 2) + (i32.const 1) + ) + ) + + ;; ref.is_null takes any reference types + (drop (ref.is_null (local.get $local_anyref))) + (drop (ref.is_null (local.get $local_funcref))) + (drop (ref.is_null (local.get $local_exnref))) + (drop (ref.is_null (ref.null))) + (drop (ref.is_null (ref.func $foo))) + ) + + ;; Test subtype relationship in function return type + (func $return_anyref (result anyref) (local $local_anyref anyref) + (local.get $local_anyref) + ) + (func $return_anyref2 (result anyref) + (ref.func $foo) + ) + (func $return_anyref3 (result anyref) (local $local_exnref exnref) + (local.get $local_exnref) + ) + (func $return_anyref4 (result anyref) + (ref.null) + ) + (func $return_funcref (result funcref) + (ref.func $foo) + ) + (func $return_funcref2 (result funcref) + (ref.null) + ) + (func $return_exnref (result exnref) (local $local_exnref exnref) + (local.get $local_exnref) + ) + (func $return_exnref2 (result exnref) + (ref.null) + ) + + ;; Test subtype relationship in returns + (func $return_anyref_returns (result anyref) (local $local_anyref anyref) + (local $local_exnref exnref) + (return (local.get $local_anyref)) + (return (local.get $local_exnref)) + (return (ref.func $foo)) + (return (ref.null)) + ) + (func $return_funcref_returns (result funcref) + (return (ref.func $foo)) + (return (ref.null)) + ) + (func $return_exnref_returns (result exnref) (local $local_exnref exnref) + (return (local.get $local_exnref)) + (return (ref.null)) + ) +) diff --git a/test/reference-types.wast.from-wast b/test/reference-types.wast.from-wast new file mode 100644 index 00000000000..afafc4a4dba --- /dev/null +++ b/test/reference-types.wast.from-wast @@ -0,0 +1,430 @@ +(module + (type $sig_anyref (func (param anyref))) + (type $sig_funcref (func (param funcref))) + (type $sig_exnref (func (param exnref))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$FA (func (param anyref) (result funcref))) + (type $FUNCSIG$A (func (result anyref))) + (type $FUNCSIG$F (func (result funcref))) + (type $FUNCSIG$E (func (result exnref))) + (import "env" "import_global" (global $import_global anyref)) + (import "env" "import_func" (func $import_func (param anyref) (result funcref))) + (table $0 3 3 funcref) + (elem (i32.const 0) $take_anyref $take_funcref $take_exnref) + (global $global_anyref (mut anyref) (ref.null)) + (global $global_funcref (mut funcref) (ref.null)) + (global $global_exnref (mut exnref) (ref.null)) + (global $global_anyref2 (mut anyref) (ref.func $foo)) + (global $global_funcref2 (mut funcref) (ref.func $foo)) + (export "export_func" (func $import_func)) + (export "export_global" (global $import_global)) + (func $take_anyref (; 1 ;) (type $sig_anyref) (param $0 anyref) + (nop) + ) + (func $take_funcref (; 2 ;) (type $sig_funcref) (param $0 funcref) + (nop) + ) + (func $take_exnref (; 3 ;) (type $sig_exnref) (param $0 exnref) + (nop) + ) + (func $foo (; 4 ;) (type $FUNCSIG$v) + (nop) + ) + (func $test (; 5 ;) (type $FUNCSIG$v) + (local $local_anyref anyref) + (local $local_funcref funcref) + (local $local_exnref exnref) + (local.set $local_anyref + (local.get $local_anyref) + ) + (local.set $local_anyref + (local.get $local_funcref) + ) + (local.set $local_anyref + (local.get $local_exnref) + ) + (local.set $local_anyref + (ref.null) + ) + (local.set $local_anyref + (ref.func $foo) + ) + (local.set $local_funcref + (local.get $local_funcref) + ) + (local.set $local_funcref + (ref.null) + ) + (local.set $local_funcref + (ref.func $foo) + ) + (local.set $local_exnref + (local.get $local_exnref) + ) + (local.set $local_exnref + (ref.null) + ) + (global.set $global_anyref + (global.get $global_anyref) + ) + (global.set $global_anyref + (global.get $global_funcref) + ) + (global.set $global_anyref + (global.get $global_exnref) + ) + (global.set $global_anyref + (ref.null) + ) + (global.set $global_anyref + (ref.func $foo) + ) + (global.set $global_funcref + (global.get $global_funcref) + ) + (global.set $global_funcref + (ref.null) + ) + (global.set $global_funcref + (ref.func $foo) + ) + (global.set $global_exnref + (global.get $global_exnref) + ) + (global.set $global_exnref + (ref.null) + ) + (call $take_anyref + (local.get $local_anyref) + ) + (call $take_anyref + (local.get $local_funcref) + ) + (call $take_anyref + (local.get $local_exnref) + ) + (call $take_anyref + (ref.null) + ) + (call_indirect (type $sig_anyref) + (local.get $local_anyref) + (i32.const 0) + ) + (call_indirect (type $sig_anyref) + (local.get $local_funcref) + (i32.const 0) + ) + (call_indirect (type $sig_anyref) + (local.get $local_exnref) + (i32.const 0) + ) + (call_indirect (type $sig_anyref) + (ref.null) + (i32.const 0) + ) + (call_indirect (type $sig_funcref) + (local.get $local_funcref) + (i32.const 1) + ) + (call_indirect (type $sig_funcref) + (ref.null) + (i32.const 1) + ) + (call_indirect (type $sig_exnref) + (local.get $local_exnref) + (i32.const 2) + ) + (call_indirect (type $sig_exnref) + (ref.null) + (i32.const 2) + ) + (drop + (block $block (result anyref) + (br_if $block + (local.get $local_anyref) + (i32.const 1) + ) + ) + ) + (drop + (block $block0 (result anyref) + (br_if $block0 + (local.get $local_funcref) + (i32.const 1) + ) + ) + ) + (drop + (block $block1 (result anyref) + (br_if $block1 + (local.get $local_exnref) + (i32.const 1) + ) + ) + ) + (drop + (block $block2 (result anyref) + (br_if $block2 + (ref.null) + (i32.const 1) + ) + ) + ) + (drop + (block $block3 (result funcref) + (br_if $block3 + (ref.null) + (i32.const 1) + ) + ) + ) + (drop + (block $block4 (result exnref) + (br_if $block4 + (ref.null) + (i32.const 1) + ) + ) + ) + (drop + (loop $loop-in (result anyref) + (local.get $local_anyref) + ) + ) + (drop + (loop $loop-in5 (result anyref) + (local.get $local_funcref) + ) + ) + (drop + (loop $loop-in6 (result anyref) + (local.get $local_exnref) + ) + ) + (drop + (loop $loop-in7 (result anyref) + (ref.null) + ) + ) + (drop + (loop $loop-in8 (result funcref) + (local.get $local_funcref) + ) + ) + (drop + (loop $loop-in9 (result funcref) + (ref.null) + ) + ) + (drop + (loop $loop-in10 (result exnref) + (local.get $local_exnref) + ) + ) + (drop + (loop $loop-in11 (result exnref) + (ref.null) + ) + ) + (drop + (if (result anyref) + (i32.const 1) + (local.get $local_anyref) + (local.get $local_exnref) + ) + ) + (drop + (if (result anyref) + (i32.const 1) + (ref.func $foo) + (ref.null) + ) + ) + (drop + (if (result funcref) + (i32.const 1) + (ref.func $foo) + (ref.null) + ) + ) + (drop + (if (result exnref) + (i32.const 1) + (local.get $local_exnref) + (ref.null) + ) + ) + (drop + (try (result anyref) + (local.get $local_anyref) + (catch + (exnref.pop) + ) + ) + ) + (drop + (try (result anyref) + (ref.func $foo) + (catch + (drop + (exnref.pop) + ) + (ref.null) + ) + ) + ) + (drop + (try (result funcref) + (ref.func $foo) + (catch + (drop + (exnref.pop) + ) + (ref.null) + ) + ) + ) + (drop + (try (result exnref) + (ref.null) + (catch + (exnref.pop) + ) + ) + ) + (drop + (select (result anyref) + (local.get $local_anyref) + (ref.func $foo) + (i32.const 1) + ) + ) + (drop + (select (result anyref) + (local.get $local_exnref) + (local.get $local_anyref) + (i32.const 1) + ) + ) + (drop + (select (result anyref) + (local.get $local_anyref) + (ref.null) + (i32.const 1) + ) + ) + (drop + (select (result anyref) + (ref.null) + (ref.func $foo) + (i32.const 1) + ) + ) + (drop + (select (result funcref) + (ref.func $foo) + (ref.null) + (i32.const 1) + ) + ) + (drop + (select (result exnref) + (ref.null) + (local.get $local_exnref) + (i32.const 1) + ) + ) + (drop + (select + (i32.const 0) + (i32.const 2) + (i32.const 1) + ) + ) + (drop + (ref.is_null + (local.get $local_anyref) + ) + ) + (drop + (ref.is_null + (local.get $local_funcref) + ) + ) + (drop + (ref.is_null + (local.get $local_exnref) + ) + ) + (drop + (ref.is_null + (ref.null) + ) + ) + (drop + (ref.is_null + (ref.func $foo) + ) + ) + ) + (func $return_anyref (; 6 ;) (type $FUNCSIG$A) (result anyref) + (local $local_anyref anyref) + (local.get $local_anyref) + ) + (func $return_anyref2 (; 7 ;) (type $FUNCSIG$A) (result anyref) + (ref.func $foo) + ) + (func $return_anyref3 (; 8 ;) (type $FUNCSIG$A) (result anyref) + (local $local_exnref exnref) + (local.get $local_exnref) + ) + (func $return_anyref4 (; 9 ;) (type $FUNCSIG$A) (result anyref) + (ref.null) + ) + (func $return_funcref (; 10 ;) (type $FUNCSIG$F) (result funcref) + (ref.func $foo) + ) + (func $return_funcref2 (; 11 ;) (type $FUNCSIG$F) (result funcref) + (ref.null) + ) + (func $return_exnref (; 12 ;) (type $FUNCSIG$E) (result exnref) + (local $local_exnref exnref) + (local.get $local_exnref) + ) + (func $return_exnref2 (; 13 ;) (type $FUNCSIG$E) (result exnref) + (ref.null) + ) + (func $return_anyref_returns (; 14 ;) (type $FUNCSIG$A) (result anyref) + (local $local_anyref anyref) + (local $local_exnref exnref) + (return + (local.get $local_anyref) + ) + (return + (local.get $local_exnref) + ) + (return + (ref.func $foo) + ) + (return + (ref.null) + ) + ) + (func $return_funcref_returns (; 15 ;) (type $FUNCSIG$F) (result funcref) + (return + (ref.func $foo) + ) + (return + (ref.null) + ) + ) + (func $return_exnref_returns (; 16 ;) (type $FUNCSIG$E) (result exnref) + (local $local_exnref exnref) + (return + (local.get $local_exnref) + ) + (return + (ref.null) + ) + ) +) diff --git a/test/reference-types.wast.fromBinary b/test/reference-types.wast.fromBinary new file mode 100644 index 00000000000..1c9cbe27f84 --- /dev/null +++ b/test/reference-types.wast.fromBinary @@ -0,0 +1,416 @@ +(module + (type $0 (func (param anyref))) + (type $1 (func (param funcref))) + (type $2 (func (param exnref))) + (type $3 (func)) + (type $4 (func (param anyref) (result funcref))) + (type $5 (func (result anyref))) + (type $6 (func (result funcref))) + (type $7 (func (result exnref))) + (import "env" "import_global" (global $gimport$1 anyref)) + (import "env" "import_func" (func $import_func (param anyref) (result funcref))) + (table $0 3 3 funcref) + (elem (i32.const 0) $take_anyref $take_funcref $take_exnref) + (global $global$0 (mut anyref) (ref.null)) + (global $global$1 (mut funcref) (ref.null)) + (global $global$2 (mut exnref) (ref.null)) + (global $global$3 (mut anyref) (ref.func $foo)) + (global $global$4 (mut funcref) (ref.func $foo)) + (export "export_func" (func $import_func)) + (export "export_global" (global $gimport$1)) + (func $take_anyref (; 1 ;) (type $0) (param $0 anyref) + (nop) + ) + (func $take_funcref (; 2 ;) (type $1) (param $0 funcref) + (nop) + ) + (func $take_exnref (; 3 ;) (type $2) (param $0 exnref) + (nop) + ) + (func $foo (; 4 ;) (type $3) + (nop) + ) + (func $test (; 5 ;) (type $3) + (local $0 anyref) + (local $1 funcref) + (local $2 exnref) + (local.set $0 + (local.get $0) + ) + (local.set $0 + (local.get $1) + ) + (local.set $0 + (local.get $2) + ) + (local.set $0 + (ref.null) + ) + (local.set $0 + (ref.func $foo) + ) + (local.set $1 + (local.get $1) + ) + (local.set $1 + (ref.null) + ) + (local.set $1 + (ref.func $foo) + ) + (local.set $2 + (local.get $2) + ) + (local.set $2 + (ref.null) + ) + (global.set $global$0 + (global.get $global$0) + ) + (global.set $global$0 + (global.get $global$1) + ) + (global.set $global$0 + (global.get $global$2) + ) + (global.set $global$0 + (ref.null) + ) + (global.set $global$0 + (ref.func $foo) + ) + (global.set $global$1 + (global.get $global$1) + ) + (global.set $global$1 + (ref.null) + ) + (global.set $global$1 + (ref.func $foo) + ) + (global.set $global$2 + (global.get $global$2) + ) + (global.set $global$2 + (ref.null) + ) + (call $take_anyref + (local.get $0) + ) + (call $take_anyref + (local.get $1) + ) + (call $take_anyref + (local.get $2) + ) + (call $take_anyref + (ref.null) + ) + (call_indirect (type $0) + (local.get $0) + (i32.const 0) + ) + (call_indirect (type $0) + (local.get $1) + (i32.const 0) + ) + (call_indirect (type $0) + (local.get $2) + (i32.const 0) + ) + (call_indirect (type $0) + (ref.null) + (i32.const 0) + ) + (call_indirect (type $1) + (local.get $1) + (i32.const 1) + ) + (call_indirect (type $1) + (ref.null) + (i32.const 1) + ) + (call_indirect (type $2) + (local.get $2) + (i32.const 2) + ) + (call_indirect (type $2) + (ref.null) + (i32.const 2) + ) + (drop + (block $label$1 (result anyref) + (br_if $label$1 + (local.get $0) + (i32.const 1) + ) + ) + ) + (drop + (block $label$2 (result anyref) + (br_if $label$2 + (local.get $1) + (i32.const 1) + ) + ) + ) + (drop + (block $label$3 (result anyref) + (br_if $label$3 + (local.get $2) + (i32.const 1) + ) + ) + ) + (drop + (block $label$4 (result anyref) + (br_if $label$4 + (ref.null) + (i32.const 1) + ) + ) + ) + (drop + (block $label$5 (result funcref) + (br_if $label$5 + (ref.null) + (i32.const 1) + ) + ) + ) + (drop + (block $label$6 (result exnref) + (br_if $label$6 + (ref.null) + (i32.const 1) + ) + ) + ) + (drop + (loop $label$7 (result anyref) + (local.get $0) + ) + ) + (drop + (loop $label$8 (result anyref) + (local.get $1) + ) + ) + (drop + (loop $label$9 (result anyref) + (local.get $2) + ) + ) + (drop + (loop $label$10 (result anyref) + (ref.null) + ) + ) + (drop + (loop $label$11 (result funcref) + (local.get $1) + ) + ) + (drop + (loop $label$12 (result funcref) + (ref.null) + ) + ) + (drop + (loop $label$13 (result exnref) + (local.get $2) + ) + ) + (drop + (loop $label$14 (result exnref) + (ref.null) + ) + ) + (drop + (if (result anyref) + (i32.const 1) + (local.get $0) + (local.get $2) + ) + ) + (drop + (if (result anyref) + (i32.const 1) + (ref.func $foo) + (ref.null) + ) + ) + (drop + (if (result funcref) + (i32.const 1) + (ref.func $foo) + (ref.null) + ) + ) + (drop + (if (result exnref) + (i32.const 1) + (local.get $2) + (ref.null) + ) + ) + (drop + (try (result anyref) + (local.get $0) + (catch + (exnref.pop) + ) + ) + ) + (drop + (try (result anyref) + (ref.func $foo) + (catch + (drop + (exnref.pop) + ) + (ref.null) + ) + ) + ) + (drop + (try (result funcref) + (ref.func $foo) + (catch + (drop + (exnref.pop) + ) + (ref.null) + ) + ) + ) + (drop + (try (result exnref) + (ref.null) + (catch + (exnref.pop) + ) + ) + ) + (drop + (select (result anyref) + (local.get $0) + (ref.func $foo) + (i32.const 1) + ) + ) + (drop + (select (result anyref) + (local.get $2) + (local.get $0) + (i32.const 1) + ) + ) + (drop + (select (result anyref) + (local.get $0) + (ref.null) + (i32.const 1) + ) + ) + (drop + (select (result anyref) + (ref.null) + (ref.func $foo) + (i32.const 1) + ) + ) + (drop + (select (result funcref) + (ref.func $foo) + (ref.null) + (i32.const 1) + ) + ) + (drop + (select (result exnref) + (ref.null) + (local.get $2) + (i32.const 1) + ) + ) + (drop + (select + (i32.const 0) + (i32.const 2) + (i32.const 1) + ) + ) + (drop + (ref.is_null + (local.get $0) + ) + ) + (drop + (ref.is_null + (local.get $1) + ) + ) + (drop + (ref.is_null + (local.get $2) + ) + ) + (drop + (ref.is_null + (ref.null) + ) + ) + (drop + (ref.is_null + (ref.func $foo) + ) + ) + ) + (func $return_anyref (; 6 ;) (type $5) (result anyref) + (local $0 anyref) + (local.get $0) + ) + (func $return_anyref2 (; 7 ;) (type $5) (result anyref) + (ref.func $foo) + ) + (func $return_anyref3 (; 8 ;) (type $5) (result anyref) + (local $0 exnref) + (local.get $0) + ) + (func $return_anyref4 (; 9 ;) (type $5) (result anyref) + (ref.null) + ) + (func $return_funcref (; 10 ;) (type $6) (result funcref) + (ref.func $foo) + ) + (func $return_funcref2 (; 11 ;) (type $6) (result funcref) + (ref.null) + ) + (func $return_exnref (; 12 ;) (type $7) (result exnref) + (local $0 exnref) + (local.get $0) + ) + (func $return_exnref2 (; 13 ;) (type $7) (result exnref) + (ref.null) + ) + (func $return_anyref_returns (; 14 ;) (type $5) (result anyref) + (local $0 anyref) + (local $1 exnref) + (return + (local.get $0) + ) + ) + (func $return_funcref_returns (; 15 ;) (type $6) (result funcref) + (return + (ref.func $foo) + ) + ) + (func $return_exnref_returns (; 16 ;) (type $7) (result exnref) + (local $0 exnref) + (return + (local.get $0) + ) + ) +) + diff --git a/test/reference-types.wast.fromBinary.noDebugInfo b/test/reference-types.wast.fromBinary.noDebugInfo new file mode 100644 index 00000000000..a1dcf50b136 --- /dev/null +++ b/test/reference-types.wast.fromBinary.noDebugInfo @@ -0,0 +1,416 @@ +(module + (type $0 (func (param anyref))) + (type $1 (func (param funcref))) + (type $2 (func (param exnref))) + (type $3 (func)) + (type $4 (func (param anyref) (result funcref))) + (type $5 (func (result anyref))) + (type $6 (func (result funcref))) + (type $7 (func (result exnref))) + (import "env" "import_global" (global $gimport$1 anyref)) + (import "env" "import_func" (func $fimport$0 (param anyref) (result funcref))) + (table $0 3 3 funcref) + (elem (i32.const 0) $0 $1 $2) + (global $global$0 (mut anyref) (ref.null)) + (global $global$1 (mut funcref) (ref.null)) + (global $global$2 (mut exnref) (ref.null)) + (global $global$3 (mut anyref) (ref.func $3)) + (global $global$4 (mut funcref) (ref.func $3)) + (export "export_func" (func $fimport$0)) + (export "export_global" (global $gimport$1)) + (func $0 (; 1 ;) (type $0) (param $0 anyref) + (nop) + ) + (func $1 (; 2 ;) (type $1) (param $0 funcref) + (nop) + ) + (func $2 (; 3 ;) (type $2) (param $0 exnref) + (nop) + ) + (func $3 (; 4 ;) (type $3) + (nop) + ) + (func $4 (; 5 ;) (type $3) + (local $0 anyref) + (local $1 funcref) + (local $2 exnref) + (local.set $0 + (local.get $0) + ) + (local.set $0 + (local.get $1) + ) + (local.set $0 + (local.get $2) + ) + (local.set $0 + (ref.null) + ) + (local.set $0 + (ref.func $3) + ) + (local.set $1 + (local.get $1) + ) + (local.set $1 + (ref.null) + ) + (local.set $1 + (ref.func $3) + ) + (local.set $2 + (local.get $2) + ) + (local.set $2 + (ref.null) + ) + (global.set $global$0 + (global.get $global$0) + ) + (global.set $global$0 + (global.get $global$1) + ) + (global.set $global$0 + (global.get $global$2) + ) + (global.set $global$0 + (ref.null) + ) + (global.set $global$0 + (ref.func $3) + ) + (global.set $global$1 + (global.get $global$1) + ) + (global.set $global$1 + (ref.null) + ) + (global.set $global$1 + (ref.func $3) + ) + (global.set $global$2 + (global.get $global$2) + ) + (global.set $global$2 + (ref.null) + ) + (call $0 + (local.get $0) + ) + (call $0 + (local.get $1) + ) + (call $0 + (local.get $2) + ) + (call $0 + (ref.null) + ) + (call_indirect (type $0) + (local.get $0) + (i32.const 0) + ) + (call_indirect (type $0) + (local.get $1) + (i32.const 0) + ) + (call_indirect (type $0) + (local.get $2) + (i32.const 0) + ) + (call_indirect (type $0) + (ref.null) + (i32.const 0) + ) + (call_indirect (type $1) + (local.get $1) + (i32.const 1) + ) + (call_indirect (type $1) + (ref.null) + (i32.const 1) + ) + (call_indirect (type $2) + (local.get $2) + (i32.const 2) + ) + (call_indirect (type $2) + (ref.null) + (i32.const 2) + ) + (drop + (block $label$1 (result anyref) + (br_if $label$1 + (local.get $0) + (i32.const 1) + ) + ) + ) + (drop + (block $label$2 (result anyref) + (br_if $label$2 + (local.get $1) + (i32.const 1) + ) + ) + ) + (drop + (block $label$3 (result anyref) + (br_if $label$3 + (local.get $2) + (i32.const 1) + ) + ) + ) + (drop + (block $label$4 (result anyref) + (br_if $label$4 + (ref.null) + (i32.const 1) + ) + ) + ) + (drop + (block $label$5 (result funcref) + (br_if $label$5 + (ref.null) + (i32.const 1) + ) + ) + ) + (drop + (block $label$6 (result exnref) + (br_if $label$6 + (ref.null) + (i32.const 1) + ) + ) + ) + (drop + (loop $label$7 (result anyref) + (local.get $0) + ) + ) + (drop + (loop $label$8 (result anyref) + (local.get $1) + ) + ) + (drop + (loop $label$9 (result anyref) + (local.get $2) + ) + ) + (drop + (loop $label$10 (result anyref) + (ref.null) + ) + ) + (drop + (loop $label$11 (result funcref) + (local.get $1) + ) + ) + (drop + (loop $label$12 (result funcref) + (ref.null) + ) + ) + (drop + (loop $label$13 (result exnref) + (local.get $2) + ) + ) + (drop + (loop $label$14 (result exnref) + (ref.null) + ) + ) + (drop + (if (result anyref) + (i32.const 1) + (local.get $0) + (local.get $2) + ) + ) + (drop + (if (result anyref) + (i32.const 1) + (ref.func $3) + (ref.null) + ) + ) + (drop + (if (result funcref) + (i32.const 1) + (ref.func $3) + (ref.null) + ) + ) + (drop + (if (result exnref) + (i32.const 1) + (local.get $2) + (ref.null) + ) + ) + (drop + (try (result anyref) + (local.get $0) + (catch + (exnref.pop) + ) + ) + ) + (drop + (try (result anyref) + (ref.func $3) + (catch + (drop + (exnref.pop) + ) + (ref.null) + ) + ) + ) + (drop + (try (result funcref) + (ref.func $3) + (catch + (drop + (exnref.pop) + ) + (ref.null) + ) + ) + ) + (drop + (try (result exnref) + (ref.null) + (catch + (exnref.pop) + ) + ) + ) + (drop + (select (result anyref) + (local.get $0) + (ref.func $3) + (i32.const 1) + ) + ) + (drop + (select (result anyref) + (local.get $2) + (local.get $0) + (i32.const 1) + ) + ) + (drop + (select (result anyref) + (local.get $0) + (ref.null) + (i32.const 1) + ) + ) + (drop + (select (result anyref) + (ref.null) + (ref.func $3) + (i32.const 1) + ) + ) + (drop + (select (result funcref) + (ref.func $3) + (ref.null) + (i32.const 1) + ) + ) + (drop + (select (result exnref) + (ref.null) + (local.get $2) + (i32.const 1) + ) + ) + (drop + (select + (i32.const 0) + (i32.const 2) + (i32.const 1) + ) + ) + (drop + (ref.is_null + (local.get $0) + ) + ) + (drop + (ref.is_null + (local.get $1) + ) + ) + (drop + (ref.is_null + (local.get $2) + ) + ) + (drop + (ref.is_null + (ref.null) + ) + ) + (drop + (ref.is_null + (ref.func $3) + ) + ) + ) + (func $5 (; 6 ;) (type $5) (result anyref) + (local $0 anyref) + (local.get $0) + ) + (func $6 (; 7 ;) (type $5) (result anyref) + (ref.func $3) + ) + (func $7 (; 8 ;) (type $5) (result anyref) + (local $0 exnref) + (local.get $0) + ) + (func $8 (; 9 ;) (type $5) (result anyref) + (ref.null) + ) + (func $9 (; 10 ;) (type $6) (result funcref) + (ref.func $3) + ) + (func $10 (; 11 ;) (type $6) (result funcref) + (ref.null) + ) + (func $11 (; 12 ;) (type $7) (result exnref) + (local $0 exnref) + (local.get $0) + ) + (func $12 (; 13 ;) (type $7) (result exnref) + (ref.null) + ) + (func $13 (; 14 ;) (type $5) (result anyref) + (local $0 anyref) + (local $1 exnref) + (return + (local.get $0) + ) + ) + (func $14 (; 15 ;) (type $6) (result funcref) + (return + (ref.func $3) + ) + ) + (func $15 (; 16 ;) (type $7) (result exnref) + (local $0 exnref) + (return + (local.get $0) + ) + ) +) + diff --git a/test/spec/events.wast b/test/spec/events.wast index d3371a78250..c864a0c8702 100644 --- a/test/spec/events.wast +++ b/test/spec/events.wast @@ -24,11 +24,6 @@ "Currently only attribute 0 is supported" ) -(assert_invalid - (module (event $e (attr 0) (param exnref))) - "Values in an event should have integer or float type" -) - (assert_invalid (module (type $t (param i32))