summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md5
-rwxr-xr-xcheck.py17
-rw-r--r--scripts/fuzz_opt.py6
-rwxr-xr-xscripts/gen-s-parser.py7
-rw-r--r--src/asmjs/asm_v_wasm.cpp13
-rw-r--r--src/binaryen-c.cpp101
-rw-r--r--src/binaryen-c.h19
-rw-r--r--src/gen-s-parser.inc64
-rw-r--r--src/ir/ExpressionAnalyzer.cpp3
-rw-r--r--src/ir/ExpressionManipulator.cpp15
-rw-r--r--src/ir/ReFinalize.cpp27
-rw-r--r--src/ir/abstract.h12
-rw-r--r--src/ir/block-utils.h3
-rw-r--r--src/ir/effects.h3
-rw-r--r--src/ir/flat.h12
-rw-r--r--src/ir/global-utils.h6
-rw-r--r--src/ir/literal-utils.h4
-rw-r--r--src/ir/manipulation.h16
-rw-r--r--src/ir/properties.h4
-rw-r--r--src/ir/utils.h6
-rw-r--r--src/js/binaryen.js-post.js53
-rw-r--r--src/literal.h36
-rw-r--r--src/parsing.h6
-rw-r--r--src/passes/ConstHoisting.cpp9
-rw-r--r--src/passes/DeadCodeElimination.cpp6
-rw-r--r--src/passes/Flatten.cpp37
-rw-r--r--src/passes/FuncCastEmulation.cpp16
-rw-r--r--src/passes/Inlining.cpp17
-rw-r--r--src/passes/InstrumentLocals.cpp32
-rw-r--r--src/passes/LegalizeJSInterface.cpp33
-rw-r--r--src/passes/LocalCSE.cpp7
-rw-r--r--src/passes/MergeLocals.cpp15
-rw-r--r--src/passes/OptimizeInstructions.cpp6
-rw-r--r--src/passes/Precompute.cpp19
-rw-r--r--src/passes/Print.cpp40
-rw-r--r--src/passes/RemoveUnusedModuleElements.cpp6
-rw-r--r--src/passes/SimplifyGlobals.cpp19
-rw-r--r--src/passes/SimplifyLocals.cpp6
-rw-r--r--src/passes/opt-utils.h13
-rw-r--r--src/shell-interface.h8
-rw-r--r--src/support/name.h2
-rw-r--r--src/support/small_vector.h10
-rw-r--r--src/tools/execution-results.h24
-rw-r--r--src/tools/fuzzing.h253
-rw-r--r--src/tools/spec-wrapper.h8
-rw-r--r--src/tools/wasm-reduce.cpp14
-rw-r--r--src/tools/wasm-shell.cpp4
-rw-r--r--src/wasm-binary.h28
-rw-r--r--src/wasm-builder.h73
-rw-r--r--src/wasm-interpreter.h47
-rw-r--r--src/wasm-s-parser.h3
-rw-r--r--src/wasm-stack.h30
-rw-r--r--src/wasm-traversal.h57
-rw-r--r--src/wasm-type.h24
-rw-r--r--src/wasm.h32
-rw-r--r--src/wasm/literal.cpp45
-rw-r--r--src/wasm/wasm-binary.cpp83
-rw-r--r--src/wasm/wasm-s-parser.cpp43
-rw-r--r--src/wasm/wasm-stack.cpp76
-rw-r--r--src/wasm/wasm-type.cpp53
-rw-r--r--src/wasm/wasm-validator.cpp306
-rw-r--r--src/wasm/wasm.cpp90
-rw-r--r--src/wasm2js.h12
-rw-r--r--test/anyref.wast18
-rw-r--r--test/binaryen.js/exception-handling.js3
-rw-r--r--test/binaryen.js/exception-handling.js.txt8
-rw-r--r--test/binaryen.js/kitchen-sink.js7
-rw-r--r--test/binaryen.js/kitchen-sink.js.txt332
-rw-r--r--test/binaryen.js/push-pop.js4
-rw-r--r--test/binaryen.js/push-pop.js.txt12
-rw-r--r--test/example/c-api-kitchen-sink.c27
-rw-r--r--test/example/c-api-kitchen-sink.txt1744
-rw-r--r--test/example/c-api-kitchen-sink.txt.txt32
-rw-r--r--test/exception-handling.wast16
-rw-r--r--test/exception-handling.wast.from-wast19
-rw-r--r--test/exception-handling.wast.fromBinary19
-rw-r--r--test/exception-handling.wast.fromBinary.noDebugInfo19
-rw-r--r--test/passes/duplicate-function-elimination_all-features.txt10
-rw-r--r--test/passes/duplicate-function-elimination_all-features.wast12
-rw-r--r--test/passes/flatten_all-features.txt (renamed from test/passes/flatten.txt)48
-rw-r--r--test/passes/flatten_all-features.wast (renamed from test/passes/flatten.wast)20
-rw-r--r--test/passes/flatten_local-cse_all-features.txt (renamed from test/passes/flatten_local-cse.txt)29
-rw-r--r--test/passes/flatten_local-cse_all-features.wast (renamed from test/passes/flatten_local-cse.wast)12
-rw-r--r--test/passes/inlining_all-features.txt16
-rw-r--r--test/passes/inlining_all-features.wast10
-rw-r--r--test/passes/instrument-locals_all-features.txt174
-rw-r--r--test/passes/instrument-locals_all-features.wast38
-rw-r--r--test/passes/legalize-js-interface_all-features.txt (renamed from test/passes/legalize-js-interface.txt)39
-rw-r--r--test/passes/legalize-js-interface_all-features.wast (renamed from test/passes/legalize-js-interface.wast)13
-rw-r--r--test/passes/merge-locals_all-features.txt (renamed from test/passes/merge-locals.txt)12
-rw-r--r--test/passes/merge-locals_all-features.wast (renamed from test/passes/merge-locals.wast)12
-rw-r--r--test/passes/optimize-instructions_all-features.txt (renamed from test/passes/optimize-instructions_enable-threads.txt)6
-rw-r--r--test/passes/optimize-instructions_all-features.wast (renamed from test/passes/optimize-instructions_enable-threads.wast)10
-rw-r--r--test/passes/precompute_all-features.txt4
-rw-r--r--test/passes/precompute_all-features.wast4
-rw-r--r--test/passes/remove-unused-module-elements_all-features.txt12
-rw-r--r--test/passes/remove-unused-module-elements_all-features.wast9
-rw-r--r--test/passes/simplify-globals-optimizing_enable-mutable-globals.wast1
-rw-r--r--test/passes/simplify-globals_all-features.txt (renamed from test/passes/simplify-globals_enable-mutable-globals.txt)19
-rw-r--r--test/passes/simplify-globals_all-features.wast (renamed from test/passes/simplify-globals_enable-mutable-globals.wast)14
-rw-r--r--test/passes/simplify-locals_all-features.txt13
-rw-r--r--test/passes/simplify-locals_all-features.wast16
-rw-r--r--test/passes/translate-to-fuzz_all-features.txt1534
-rw-r--r--test/passes/translate-to-fuzz_no-fuzz-nans_all-features.txt830
-rw-r--r--test/push_pop.wast16
-rw-r--r--test/push_pop.wast.from-wast37
-rw-r--r--test/push_pop.wast.fromBinary25
-rw-r--r--test/push_pop.wast.fromBinary.noDebugInfo25
-rw-r--r--test/reference-types.wast361
-rw-r--r--test/reference-types.wast.from-wast509
-rw-r--r--test/reference-types.wast.fromBinary492
-rw-r--r--test/reference-types.wast.fromBinary.noDebugInfo492
-rw-r--r--test/spec/events.wast5
-rw-r--r--test/spec/old_select.wast87
-rw-r--r--test/spec/ref_func.wast44
-rw-r--r--test/spec/ref_is_null.wast15
-rw-r--r--test/spec/ref_null.wast13
-rw-r--r--test/unit/test_features.py25
118 files changed, 7083 insertions, 2284 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2e05fea09..90591bbb0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,6 +15,11 @@ full changeset diff at the end of each section.
Current Trunk
-------------
+- Reference type support is added. Supported instructions are `ref.null`,
+ `ref.is_null`, `ref.func`, and typed `select`. Table instructions are not
+ supported yet. For typed `select`, C/JS API can take an additional 'type'
+ parameter.
+
v90
---
diff --git a/check.py b/check.py
index 377d41918..f4d6bed7e 100755
--- a/check.py
+++ b/check.py
@@ -153,8 +153,10 @@ def run_wasm_opt_tests():
shared.fail_if_not_identical_to_file(actual, f)
- shared.binary_format_check(t, wasm_as_args=['-g']) # test with debuginfo
- shared.binary_format_check(t, wasm_as_args=[], binary_suffix='.fromBinary.noDebugInfo') # test without debuginfo
+ # FIXME Remove this condition after nullref is implemented in V8
+ if 'reference-types.wast' not in t:
+ shared.binary_format_check(t, wasm_as_args=['-g']) # test with debuginfo
+ shared.binary_format_check(t, wasm_as_args=[], binary_suffix='.fromBinary.noDebugInfo') # test without debuginfo
shared.minify_check(t)
@@ -271,9 +273,9 @@ def run_wasm_reduce_tests():
before = os.stat('a.wasm').st_size
support.run_command(shared.WASM_REDUCE + ['a.wasm', '--command=%s b.wasm --fuzz-exec -all' % shared.WASM_OPT[0], '-t', 'b.wasm', '-w', 'c.wasm'])
after = os.stat('c.wasm').st_size
- # 0.65 is a custom threshold to check if we have shrunk the output
- # sufficiently
- assert after < 0.7 * before, [before, after]
+ # This number is a custom threshold to check if we have shrunk the
+ # output sufficiently
+ assert after < 0.75 * before, [before, after]
def run_spec_tests():
@@ -323,7 +325,10 @@ def run_spec_tests():
# some wast files cannot be split:
# * comments.wast: contains characters that are not valid utf-8,
# so our string splitting code fails there
- if os.path.basename(wast) not in ['comments.wast']:
+
+ # FIXME Remove reference type tests from this list after nullref is
+ # implemented in V8
+ if os.path.basename(wast) not in ['comments.wast', 'ref_null.wast', 'ref_is_null.wast', 'ref_func.wast', 'old_select.wast']:
split_num = 0
actual = ''
for module, asserts in support.split_wast(wast):
diff --git a/scripts/fuzz_opt.py b/scripts/fuzz_opt.py
index a0b763aab..b77d8e9b4 100644
--- a/scripts/fuzz_opt.py
+++ b/scripts/fuzz_opt.py
@@ -228,7 +228,7 @@ class CompareVMs(TestCaseHandler):
break
def can_run_on_feature_opts(self, feature_opts):
- return all([x in feature_opts for x in ['--disable-simd']])
+ return all([x in feature_opts for x in ['--disable-simd', '--disable-reference-types', '--disable-exception-handling']])
# Fuzz the interpreter with --fuzz-exec. This tests everything in a single command (no
@@ -294,7 +294,7 @@ class Wasm2JS(TestCaseHandler):
return out
def can_run_on_feature_opts(self, feature_opts):
- return all([x in feature_opts for x in ['--disable-exception-handling', '--disable-simd', '--disable-threads', '--disable-bulk-memory', '--disable-nontrapping-float-to-int', '--disable-tail-call', '--disable-sign-ext']])
+ return all([x in feature_opts for x in ['--disable-exception-handling', '--disable-simd', '--disable-threads', '--disable-bulk-memory', '--disable-nontrapping-float-to-int', '--disable-tail-call', '--disable-sign-ext', '--disable-reference-types']])
class Asyncify(TestCaseHandler):
@@ -339,7 +339,7 @@ class Asyncify(TestCaseHandler):
compare(before, after_asyncify, 'Asyncify (before/after_asyncify)')
def can_run_on_feature_opts(self, feature_opts):
- return all([x in feature_opts for x in ['--disable-exception-handling', '--disable-simd', '--disable-tail-call']])
+ return all([x in feature_opts for x in ['--disable-exception-handling', '--disable-simd', '--disable-tail-call', '--disable-reference-types']])
# The global list of all test case handlers
diff --git a/scripts/gen-s-parser.py b/scripts/gen-s-parser.py
index 79b1a60f8..4a900ac0e 100755
--- a/scripts/gen-s-parser.py
+++ b/scripts/gen-s-parser.py
@@ -49,7 +49,9 @@ instructions = [
("f32.pop", "makePop(f32)"),
("f64.pop", "makePop(f64)"),
("v128.pop", "makePop(v128)"),
+ ("funcref.pop", "makePop(funcref)"),
("anyref.pop", "makePop(anyref)"),
+ ("nullref.pop", "makePop(nullref)"),
("exnref.pop", "makePop(exnref)"),
("i32.load", "makeLoad(s, i32, /*isAtomic=*/false)"),
("i64.load", "makeLoad(s, i64, /*isAtomic=*/false)"),
@@ -469,6 +471,11 @@ instructions = [
("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 3720ca079..5959db43e 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:
diff --git a/src/binaryen-c.cpp b/src/binaryen-c.cpp
index 82cbc4c1f..826193e06 100644
--- a/src/binaryen-c.cpp
+++ b/src/binaryen-c.cpp
@@ -64,13 +64,16 @@ BinaryenLiteral toBinaryenLiteral(Literal x) {
case Type::f64:
ret.i64 = x.reinterpreti64();
break;
- case Type::v128: {
+ case Type::v128:
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::funcref:
+ ret.func = x.getFunc().c_str();
+ break;
+ case Type::nullref:
+ break;
+ case Type::anyref:
+ case Type::exnref:
case Type::none:
case Type::unreachable:
WASM_UNREACHABLE("unexpected type");
@@ -90,8 +93,12 @@ 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::funcref:
+ return Literal::makeFuncref(x.func);
+ case Type::nullref:
+ return Literal::makeNullref();
+ case Type::anyref:
+ case Type::exnref:
case Type::none:
case Type::unreachable:
WASM_UNREACHABLE("unexpected type");
@@ -209,8 +216,14 @@ 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::funcref:
+ out << "BinaryenLiteralFuncref(" << arg.func << ")";
+ break;
+ case Type::nullref:
+ out << "BinaryenLiteralNullref()";
+ break;
+ case Type::anyref:
+ case Type::exnref:
case Type::none:
case Type::unreachable:
WASM_UNREACHABLE("unexpected type");
@@ -265,7 +278,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); }
@@ -397,6 +412,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) {
@@ -1330,17 +1354,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<Select>();
if (tracing) {
- traceExpression(ret, "BinaryenSelect", condition, ifTrue, ifFalse);
+ traceExpression(ret, "BinaryenSelect", condition, ifTrue, ifFalse, type);
}
ret->condition = (Expression*)condition;
ret->ifTrue = (Expression*)ifTrue;
ret->ifFalse = (Expression*)ifFalse;
- ret->finalize();
+ if (type != BinaryenTypeAuto()) {
+ ret->finalize(Type(type));
+ } else {
+ ret->finalize();
+ }
return static_cast<Expression*>(ret);
}
BinaryenExpressionRef BinaryenDrop(BinaryenModuleRef module,
@@ -1695,6 +1724,32 @@ BinaryenExpressionRef BinaryenPop(BinaryenModuleRef module, BinaryenType type) {
return static_cast<Expression*>(ret);
}
+BinaryenExpressionRef BinaryenRefNull(BinaryenModuleRef module) {
+ auto* ret = Builder(*(Module*)module).makeRefNull();
+ if (tracing) {
+ traceExpression(ret, "BinaryenRefNull");
+ }
+ return static_cast<Expression*>(ret);
+}
+
+BinaryenExpressionRef BinaryenRefIsNull(BinaryenModuleRef module,
+ BinaryenExpressionRef value) {
+ auto* ret = Builder(*(Module*)module).makeRefIsNull((Expression*)value);
+ if (tracing) {
+ traceExpression(ret, "BinaryenRefIsNull", value);
+ }
+ return static_cast<Expression*>(ret);
+}
+
+BinaryenExpressionRef BinaryenRefFunc(BinaryenModuleRef module,
+ const char* func) {
+ auto* ret = Builder(*(Module*)module).makeRefFunc(func);
+ if (tracing) {
+ traceExpression(ret, "BinaryenRefFunc", StringLit(func));
+ }
+ return static_cast<Expression*>(ret);
+}
+
BinaryenExpressionRef BinaryenTry(BinaryenModuleRef module,
BinaryenExpressionRef body,
BinaryenExpressionRef catchBody) {
@@ -2964,6 +3019,28 @@ BinaryenExpressionRef BinaryenPushGetValue(BinaryenExpressionRef expr) {
assert(expression->is<Push>());
return static_cast<Push*>(expression)->value;
}
+// RefIsNull
+BinaryenExpressionRef BinaryenRefIsNullGetValue(BinaryenExpressionRef expr) {
+ if (tracing) {
+ std::cout << " BinaryenRefIsNullGetValue(expressions[" << expressions[expr]
+ << "]);\n";
+ }
+
+ auto* expression = (Expression*)expr;
+ assert(expression->is<RefIsNull>());
+ return static_cast<RefIsNull*>(expression)->value;
+}
+// RefFunc
+const char* BinaryenRefFuncGetFunc(BinaryenExpressionRef expr) {
+ if (tracing) {
+ std::cout << " BinaryenRefFuncGetFunc(expressions[" << expressions[expr]
+ << "]);\n";
+ }
+
+ auto* expression = (Expression*)expr;
+ assert(expression->is<RefFunc>());
+ return static_cast<RefFunc*>(expression)->func.c_str();
+}
// Try
BinaryenExpressionRef BinaryenTryGetBody(BinaryenExpressionRef expr) {
if (tracing) {
diff --git a/src/binaryen-c.h b/src/binaryen-c.h
index f169ff367..36d82ecb0 100644
--- a/src/binaryen-c.h
+++ b/src/binaryen-c.h
@@ -98,7 +98,9 @@ BINARYEN_API BinaryenType BinaryenTypeInt64(void);
BINARYEN_API BinaryenType BinaryenTypeFloat32(void);
BINARYEN_API BinaryenType BinaryenTypeFloat64(void);
BINARYEN_API BinaryenType BinaryenTypeVec128(void);
+BINARYEN_API BinaryenType BinaryenTypeFuncref(void);
BINARYEN_API BinaryenType BinaryenTypeAnyref(void);
+BINARYEN_API BinaryenType BinaryenTypeNullref(void);
BINARYEN_API BinaryenType BinaryenTypeExnref(void);
BINARYEN_API BinaryenType BinaryenTypeUnreachable(void);
// Not a real type. Used as the last parameter to BinaryenBlock to let
@@ -158,6 +160,9 @@ BINARYEN_API BinaryenExpressionId BinaryenMemoryInitId(void);
BINARYEN_API BinaryenExpressionId BinaryenDataDropId(void);
BINARYEN_API BinaryenExpressionId BinaryenMemoryCopyId(void);
BINARYEN_API BinaryenExpressionId BinaryenMemoryFillId(void);
+BINARYEN_API BinaryenExpressionId BinaryenRefNullId(void);
+BINARYEN_API BinaryenExpressionId BinaryenRefIsNullId(void);
+BINARYEN_API BinaryenExpressionId BinaryenRefFuncId(void);
BINARYEN_API BinaryenExpressionId BinaryenTryId(void);
BINARYEN_API BinaryenExpressionId BinaryenThrowId(void);
BINARYEN_API BinaryenExpressionId BinaryenRethrowId(void);
@@ -222,6 +227,7 @@ struct BinaryenLiteral {
float f32;
double f64;
uint8_t v128[16];
+ const char* func;
};
};
@@ -692,7 +698,8 @@ BINARYEN_API BinaryenExpressionRef
BinaryenSelect(BinaryenModuleRef module,
BinaryenExpressionRef condition,
BinaryenExpressionRef ifTrue,
- BinaryenExpressionRef ifFalse);
+ BinaryenExpressionRef ifFalse,
+ BinaryenType type);
BINARYEN_API BinaryenExpressionRef BinaryenDrop(BinaryenModuleRef module,
BinaryenExpressionRef value);
// Return: value can be NULL
@@ -797,6 +804,11 @@ BinaryenMemoryFill(BinaryenModuleRef module,
BinaryenExpressionRef dest,
BinaryenExpressionRef value,
BinaryenExpressionRef size);
+BINARYEN_API BinaryenExpressionRef BinaryenRefNull(BinaryenModuleRef module);
+BINARYEN_API BinaryenExpressionRef
+BinaryenRefIsNull(BinaryenModuleRef module, BinaryenExpressionRef value);
+BINARYEN_API BinaryenExpressionRef BinaryenRefFunc(BinaryenModuleRef module,
+ const char* func);
BINARYEN_API BinaryenExpressionRef BinaryenTry(BinaryenModuleRef module,
BinaryenExpressionRef body,
BinaryenExpressionRef catchBody);
@@ -1036,6 +1048,11 @@ BINARYEN_API BinaryenExpressionRef
BinaryenMemoryFillGetSize(BinaryenExpressionRef expr);
BINARYEN_API BinaryenExpressionRef
+BinaryenRefIsNullGetValue(BinaryenExpressionRef expr);
+
+BINARYEN_API const char* BinaryenRefFuncGetFunc(BinaryenExpressionRef expr);
+
+BINARYEN_API BinaryenExpressionRef
BinaryenTryGetBody(BinaryenExpressionRef expr);
BINARYEN_API BinaryenExpressionRef
BinaryenTryGetCatchBody(BinaryenExpressionRef expr);
diff --git a/src/gen-s-parser.inc b/src/gen-s-parser.inc
index d60ee1794..eb5626b3f 100644
--- a/src/gen-s-parser.inc
+++ b/src/gen-s-parser.inc
@@ -653,6 +653,9 @@ switch (op[0]) {
default: goto parse_error;
}
}
+ case 'u':
+ if (strcmp(op, "funcref.pop") == 0) { return makePop(funcref); }
+ goto parse_error;
default: goto parse_error;
}
}
@@ -2480,30 +2483,57 @@ switch (op[0]) {
default: goto parse_error;
}
}
- case 'n':
- if (strcmp(op, "nop") == 0) { return makeNop(); }
- goto parse_error;
+ case 'n': {
+ switch (op[1]) {
+ case 'o':
+ if (strcmp(op, "nop") == 0) { return makeNop(); }
+ goto parse_error;
+ case 'u':
+ if (strcmp(op, "nullref.pop") == 0) { return makePop(nullref); }
+ goto parse_error;
+ default: goto parse_error;
+ }
+ }
case 'p':
if (strcmp(op, "push") == 0) { return makePush(s); }
goto parse_error;
case 'r': {
- switch (op[3]) {
- case 'h':
- if (strcmp(op, "rethrow") == 0) { return makeRethrow(s); }
- goto parse_error;
- case 'u': {
- switch (op[6]) {
- case '\0':
- if (strcmp(op, "return") == 0) { return makeReturn(s); }
+ switch (op[2]) {
+ case 'f': {
+ switch (op[4]) {
+ case 'f':
+ if (strcmp(op, "ref.func") == 0) { return makeRefFunc(s); }
goto parse_error;
- case '_': {
- switch (op[11]) {
+ case 'i':
+ if (strcmp(op, "ref.is_null") == 0) { return makeRefIsNull(s); }
+ goto parse_error;
+ case 'n':
+ if (strcmp(op, "ref.null") == 0) { return makeRefNull(s); }
+ goto parse_error;
+ default: goto parse_error;
+ }
+ }
+ case 't': {
+ switch (op[3]) {
+ case 'h':
+ if (strcmp(op, "rethrow") == 0) { return makeRethrow(s); }
+ goto parse_error;
+ case 'u': {
+ switch (op[6]) {
case '\0':
- if (strcmp(op, "return_call") == 0) { return makeCall(s, /*isReturn=*/true); }
- goto parse_error;
- case '_':
- if (strcmp(op, "return_call_indirect") == 0) { return makeCallIndirect(s, /*isReturn=*/true); }
+ if (strcmp(op, "return") == 0) { return makeReturn(s); }
goto parse_error;
+ case '_': {
+ switch (op[11]) {
+ case '\0':
+ if (strcmp(op, "return_call") == 0) { return makeCall(s, /*isReturn=*/true); }
+ goto parse_error;
+ case '_':
+ if (strcmp(op, "return_call_indirect") == 0) { return makeCallIndirect(s, /*isReturn=*/true); }
+ goto parse_error;
+ default: goto parse_error;
+ }
+ }
default: goto parse_error;
}
}
diff --git a/src/ir/ExpressionAnalyzer.cpp b/src/ir/ExpressionAnalyzer.cpp
index 7355d1856..4b9869ddd 100644
--- a/src/ir/ExpressionAnalyzer.cpp
+++ b/src/ir/ExpressionAnalyzer.cpp
@@ -218,6 +218,9 @@ template<typename T> void visitImmediates(Expression* curr, T& visitor) {
visitor.visitInt(curr->op);
visitor.visitNonScopeName(curr->nameOperand);
}
+ void visitRefNull(RefNull* curr) {}
+ void visitRefIsNull(RefIsNull* curr) {}
+ void visitRefFunc(RefFunc* curr) { visitor.visitNonScopeName(curr->func); }
void visitTry(Try* curr) {}
void visitThrow(Throw* curr) { visitor.visitNonScopeName(curr->event); }
void visitRethrow(Rethrow* curr) {}
diff --git a/src/ir/ExpressionManipulator.cpp b/src/ir/ExpressionManipulator.cpp
index fbee9f9c1..acea09bad 100644
--- a/src/ir/ExpressionManipulator.cpp
+++ b/src/ir/ExpressionManipulator.cpp
@@ -58,7 +58,7 @@ flexibleCopy(Expression* original, Module& wasm, CustomCopier custom) {
curr->type);
}
Expression* visitLoop(Loop* curr) {
- return builder.makeLoop(curr->name, copy(curr->body));
+ return builder.makeLoop(curr->name, copy(curr->body), curr->type);
}
Expression* visitBreak(Break* curr) {
return builder.makeBreak(
@@ -208,8 +208,10 @@ flexibleCopy(Expression* original, Module& wasm, CustomCopier custom) {
return builder.makeBinary(curr->op, copy(curr->left), copy(curr->right));
}
Expression* visitSelect(Select* curr) {
- return builder.makeSelect(
- copy(curr->condition), copy(curr->ifTrue), copy(curr->ifFalse));
+ return builder.makeSelect(copy(curr->condition),
+ copy(curr->ifTrue),
+ copy(curr->ifFalse),
+ curr->type);
}
Expression* visitDrop(Drop* curr) {
return builder.makeDrop(copy(curr->value));
@@ -226,6 +228,13 @@ flexibleCopy(Expression* original, Module& wasm, CustomCopier custom) {
builder.makeHost(curr->op, curr->nameOperand, std::move(operands));
return ret;
}
+ Expression* visitRefNull(RefNull* curr) { return builder.makeRefNull(); }
+ Expression* visitRefIsNull(RefIsNull* curr) {
+ return builder.makeRefIsNull(copy(curr->value));
+ }
+ Expression* visitRefFunc(RefFunc* curr) {
+ return builder.makeRefFunc(curr->func);
+ }
Expression* visitTry(Try* curr) {
return builder.makeTry(
copy(curr->body), copy(curr->catchBody), curr->type);
diff --git a/src/ir/ReFinalize.cpp b/src/ir/ReFinalize.cpp
index be0a8604b..9243869a1 100644
--- a/src/ir/ReFinalize.cpp
+++ b/src/ir/ReFinalize.cpp
@@ -44,23 +44,13 @@ void ReFinalize::visitBlock(Block* curr) {
curr->type = none;
return;
}
- // do this quickly, without any validation
- // last element determines type
+ // Get the least upper bound type of the last element and all branch return
+ // values
curr->type = curr->list.back()->type;
- // 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()) {
- return;
- }
- // otherwise, we have no final fallthrough element to determine the type,
- // could be determined by breaks
if (curr->name.is()) {
auto iter = breakValues.find(curr->name);
if (iter != breakValues.end()) {
- // there is a break to here
- auto type = iter->second;
- assert(type != unreachable); // we would have removed such branches
- curr->type = type;
+ curr->type = Type::getLeastUpperBound(curr->type, iter->second);
return;
}
}
@@ -130,6 +120,9 @@ void ReFinalize::visitSelect(Select* curr) { curr->finalize(); }
void ReFinalize::visitDrop(Drop* curr) { curr->finalize(); }
void ReFinalize::visitReturn(Return* curr) { curr->finalize(); }
void ReFinalize::visitHost(Host* 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) { curr->finalize(); }
void ReFinalize::visitThrow(Throw* curr) { curr->finalize(); }
void ReFinalize::visitRethrow(Rethrow* curr) { curr->finalize(); }
@@ -159,8 +152,12 @@ void ReFinalize::visitEvent(Event* curr) { WASM_UNREACHABLE("unimp"); }
void ReFinalize::visitModule(Module* curr) { WASM_UNREACHABLE("unimp"); }
void ReFinalize::updateBreakValueType(Name name, Type type) {
- if (type != unreachable || breakValues.count(name) == 0) {
- breakValues[name] = type;
+ if (type != Type::unreachable) {
+ if (breakValues.count(name) == 0) {
+ breakValues[name] = type;
+ } else {
+ breakValues[name] = Type::getLeastUpperBound(breakValues[name], type);
+ }
}
}
diff --git a/src/ir/abstract.h b/src/ir/abstract.h
index 384f8b555..76215d07f 100644
--- a/src/ir/abstract.h
+++ b/src/ir/abstract.h
@@ -80,8 +80,10 @@ inline UnaryOp getUnary(Type type, Op op) {
case v128: {
WASM_UNREACHABLE("v128 not implemented yet");
}
- case anyref: // there's no unary instructions for anyref
- case exnref: // there's no unary instructions for exnref
+ case funcref:
+ case anyref:
+ case nullref:
+ case exnref:
case none:
case unreachable: {
return InvalidUnary;
@@ -211,8 +213,10 @@ inline BinaryOp getBinary(Type type, Op op) {
case v128: {
WASM_UNREACHABLE("v128 not implemented yet");
}
- case anyref: // there's no binary instructions for anyref
- case exnref: // there's no binary instructions for exnref
+ case funcref:
+ case anyref:
+ case nullref:
+ case exnref:
case none:
case unreachable: {
return InvalidBinary;
diff --git a/src/ir/block-utils.h b/src/ir/block-utils.h
index ca8b7179b..153dd45b3 100644
--- a/src/ir/block-utils.h
+++ b/src/ir/block-utils.h
@@ -43,7 +43,8 @@ simplifyToContents(Block* block, T* parent, bool allowTypeChange = false) {
// no side effects, and singleton is not returning a value, so we can
// throw away the block and its contents, basically
return Builder(*parent->getModule()).replaceWithIdenticalType(block);
- } else if (block->type == singleton->type || allowTypeChange) {
+ } else if (Type::isSubType(singleton->type, block->type) ||
+ allowTypeChange) {
return singleton;
} else {
// (side effects +) type change, must be block with declared value but
diff --git a/src/ir/effects.h b/src/ir/effects.h
index e93c63017..6eb2da91d 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 dd72e339d..01a94a759 100644
--- a/src/ir/flat.h
+++ b/src/ir/flat.h
@@ -56,6 +56,7 @@
#define wasm_ir_flat_h
#include "ir/iteration.h"
+#include "ir/properties.h"
#include "pass.h"
#include "wasm-traversal.h"
@@ -64,7 +65,8 @@ namespace wasm {
namespace Flat {
inline bool isControlFlowStructure(Expression* curr) {
- return curr->is<Block>() || curr->is<If>() || curr->is<Loop>();
+ return curr->is<Block>() || curr->is<If>() || curr->is<Loop>() ||
+ curr->is<Try>();
}
inline void verifyFlatness(Function* func) {
@@ -79,10 +81,10 @@ inline void verifyFlatness(Function* func) {
verify(!curr->type.isConcrete(), "tees are not allowed, only sets");
} else {
for (auto* child : ChildIterator(curr)) {
- verify(child->is<Const>() || child->is<LocalGet>() ||
- child->is<Unreachable>(),
- "instructions must only have const, local.get, or unreachable "
- "as children");
+ verify(Properties::isConstantExpression(child) ||
+ child->is<LocalGet>() || child->is<Unreachable>(),
+ "instructions must only have constant expressions, local.get, "
+ "or unreachable as children");
}
}
}
diff --git a/src/ir/global-utils.h b/src/ir/global-utils.h
index 93e5c8a67..e096aec8c 100644
--- a/src/ir/global-utils.h
+++ b/src/ir/global-utils.h
@@ -52,6 +52,12 @@ getGlobalInitializedToImport(Module& wasm, Name module, Name base) {
});
return ret;
}
+
+inline bool canInitializeGlobal(const Expression* curr) {
+ return curr->is<Const>() || curr->is<RefNull>() || curr->is<RefFunc>() ||
+ curr->is<GlobalGet>();
+}
+
} // namespace GlobalUtils
} // namespace wasm
diff --git a/src/ir/literal-utils.h b/src/ir/literal-utils.h
index 63a2b3b44..4bc79eee9 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 ec137d372..49ed7e11e 100644
--- a/src/ir/manipulation.h
+++ b/src/ir/manipulation.h
@@ -33,14 +33,24 @@ inline OutputType* convert(InputType* input) {
return output;
}
-// Convenience method for nop, which is a common conversion
+// Convenience methods for certain instructions, which are common conversions
template<typename InputType> inline Nop* nop(InputType* target) {
- return convert<InputType, Nop>(target);
+ auto* ret = convert<InputType, Nop>(target);
+ ret->finalize();
+ return ret;
+}
+
+template<typename InputType> inline RefNull* refNull(InputType* target) {
+ auto* ret = convert<InputType, RefNull>(target);
+ ret->finalize();
+ return ret;
}
template<typename InputType>
inline Unreachable* unreachable(InputType* target) {
- return convert<InputType, Unreachable>(target);
+ auto* ret = convert<InputType, Unreachable>(target);
+ ret->finalize();
+ return ret;
}
// Convert a node that allocates
diff --git a/src/ir/properties.h b/src/ir/properties.h
index bb88af6c5..f4c9686b6 100644
--- a/src/ir/properties.h
+++ b/src/ir/properties.h
@@ -187,6 +187,10 @@ inline Expression* getFallthrough(Expression* curr) {
return curr;
}
+inline bool isConstantExpression(const Expression* curr) {
+ return curr->is<Const>() || curr->is<RefNull>() || curr->is<RefFunc>();
+}
+
} // namespace Properties
} // namespace wasm
diff --git a/src/ir/utils.h b/src/ir/utils.h
index cad7bc885..9bd3c9e0b 100644
--- a/src/ir/utils.h
+++ b/src/ir/utils.h
@@ -146,6 +146,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);
@@ -210,6 +213,9 @@ struct ReFinalizeNode : public OverriddenVisitor<ReFinalizeNode> {
void visitDrop(Drop* curr) { curr->finalize(); }
void visitReturn(Return* curr) { curr->finalize(); }
void visitHost(Host* 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) { curr->finalize(); }
void visitThrow(Throw* curr) { curr->finalize(); }
void visitRethrow(Rethrow* curr) { curr->finalize(); }
diff --git a/src/js/binaryen.js-post.js b/src/js/binaryen.js-post.js
index 8cddc61c7..2993573d1 100644
--- a/src/js/binaryen.js-post.js
+++ b/src/js/binaryen.js-post.js
@@ -38,7 +38,9 @@ function initializeConstants() {
['f32', 'Float32'],
['f64', 'Float64'],
['v128', 'Vec128'],
+ ['funcref', 'Funcref'],
['anyref', 'Anyref'],
+ ['nullref', 'Nullref'],
['exnref', 'Exnref'],
['unreachable', 'Unreachable'],
['auto', 'Auto']
@@ -86,6 +88,9 @@ function initializeConstants() {
'DataDrop',
'MemoryCopy',
'MemoryFill',
+ 'RefNull',
+ 'RefIsNull',
+ 'RefFunc',
'Try',
'Throw',
'Rethrow',
@@ -1952,20 +1957,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(value) {
+ return Module['_BinaryenRefIsNull'](module, value);
+ },
+ '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);
@@ -2651,6 +2683,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,
+ 'value': Module['_BinaryenRefIsNullGetValue'](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 1d19e6661..ef3e13d44 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"
@@ -34,6 +35,7 @@ class Literal {
int32_t i32;
int64_t i64;
uint8_t v128[16];
+ Name func; // function name for funcref
};
public:
@@ -57,11 +59,12 @@ public:
explicit Literal(const std::array<Literal, 8>&);
explicit Literal(const std::array<Literal, 4>&);
explicit Literal(const std::array<Literal, 2>&);
+ explicit Literal(Name func) : func(func), type(Type::funcref) {}
- bool isConcrete() { return type != none; }
- bool isNull() { return type == none; }
+ bool isConcrete() { return type != Type::none; }
+ bool isNone() { return type == 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 +83,26 @@ public:
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:
+ case Type::funcref:
+ case Type::anyref:
+ case Type::nullref:
+ case Type::exnref:
+ case Type::none:
+ case Type::unreachable:
WASM_UNREACHABLE("unexpected type");
}
WASM_UNREACHABLE("unexpected type");
}
- inline static Literal makeZero(Type type) { return makeFromInt32(0, type); }
+ static Literal makeZero(Type type) {
+ if (type.isRef()) {
+ return makeNullref();
+ }
+ return makeFromInt32(0, type);
+ }
+
+ static Literal makeNullref() { return Literal(Type(Type::nullref)); }
+ static Literal makeFuncref(Name func) { return Literal(func.c_str()); }
Literal castToF32();
Literal castToF64();
@@ -113,6 +126,7 @@ public:
return bit_cast<double>(i64);
}
std::array<uint8_t, 16> getv128() const;
+ Name getFunc() const { return func; }
// careful!
int32_t* geti32Ptr() {
@@ -464,8 +478,10 @@ template<> struct less<wasm::Literal> {
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::funcref:
+ case wasm::Type::anyref:
+ case wasm::Type::nullref:
+ case wasm::Type::exnref:
case wasm::Type::none:
case wasm::Type::unreachable:
return false;
diff --git a/src/parsing.h b/src/parsing.h
index 7017fdb0f..d64236df3 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("unexpected const type");
case none:
case unreachable: {
diff --git a/src/passes/ConstHoisting.cpp b/src/passes/ConstHoisting.cpp
index dbb3853d8..4e8cd9910 100644
--- a/src/passes/ConstHoisting.cpp
+++ b/src/passes/ConstHoisting.cpp
@@ -91,9 +91,12 @@ private:
size = value.type.getByteSize();
break;
}
- case v128: // v128 not implemented yet
- case anyref: // anyref cannot have literals
- case exnref: { // exnref cannot have literals
+ // not implemented yet
+ case v128:
+ 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 be6f92ffa..7d5385a83 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 f5115567b..fda8e3f80 100644
--- a/src/passes/Flatten.cpp
+++ b/src/passes/Flatten.cpp
@@ -21,6 +21,7 @@
#include <ir/branch-utils.h>
#include <ir/effects.h>
#include <ir/flat.h>
+#include <ir/properties.h>
#include <ir/utils.h>
#include <pass.h>
#include <wasm-builder.h>
@@ -61,7 +62,9 @@ struct Flatten
std::vector<Expression*> ourPreludes;
Builder builder(*getModule());
- if (curr->is<Const>() || curr->is<Nop>() || curr->is<Unreachable>()) {
+ // Nothing to do for constants, nop, and unreachable
+ if (Properties::isConstantExpression(curr) || curr->is<Nop>() ||
+ curr->is<Unreachable>()) {
return;
}
@@ -194,8 +197,37 @@ struct Flatten
auto type = br->value->type;
if (type.isConcrete()) {
// we are sending a value. use a local instead
- Index temp = getTempForBreakTarget(br->name, type);
+ Type blockType = findBreakTarget(br->name)->type;
+ Index temp = getTempForBreakTarget(br->name, blockType);
ourPreludes.push_back(builder.makeLocalSet(temp, br->value));
+
+ // br_if leaves a value on the stack if not taken, which later can
+ // be the last element of the enclosing innermost block and flow
+ // out. The local we created using 'getTempForBreakTarget' returns
+ // the return type of the block this branch is targetting, which may
+ // not be the same with the innermost block's return type. For
+ // example,
+ // (block $any (result anyref)
+ // (block (result nullref)
+ // (local.tee $0
+ // (br_if $any
+ // (ref.null)
+ // (i32.const 0)
+ // )
+ // )
+ // )
+ // )
+ // In this case we need two locals to store (ref.null); one with
+ // anyref type that's for the target block ($label0) and one more
+ // with nullref type in case for flowing out. Here we create the
+ // second 'flowing out' local in case two block's types are
+ // different.
+ if (type != blockType) {
+ temp = builder.addVar(getFunction(), type);
+ ourPreludes.push_back(builder.makeLocalSet(
+ temp, ExpressionManipulator::copy(br->value, *getModule())));
+ }
+
if (br->condition) {
// the value must also flow out
ourPreludes.push_back(br);
@@ -239,6 +271,7 @@ struct Flatten
}
}
}
+ // TODO Handle br_on_exn
// continue for general handling of everything, control flow or otherwise
curr = getCurrent(); // we may have replaced it
diff --git a/src/passes/FuncCastEmulation.cpp b/src/passes/FuncCastEmulation.cpp
index 729a4a6c3..9d5109a83 100644
--- a/src/passes/FuncCastEmulation.cpp
+++ b/src/passes/FuncCastEmulation.cpp
@@ -65,11 +65,11 @@ static Expression* toABI(Expression* value, Module* module) {
case v128: {
WASM_UNREACHABLE("v128 not implemented yet");
}
- case anyref: {
- WASM_UNREACHABLE("anyref cannot be converted to i64");
- }
+ case funcref:
+ case anyref:
+ case nullref:
case exnref: {
- WASM_UNREACHABLE("exnref cannot be converted to i64");
+ WASM_UNREACHABLE("reference types cannot be converted to i64");
}
case none: {
// the value is none, but we need a value here
@@ -108,11 +108,11 @@ static Expression* fromABI(Expression* value, Type type, Module* module) {
case v128: {
WASM_UNREACHABLE("v128 not implemented yet");
}
- case anyref: {
- WASM_UNREACHABLE("anyref cannot be converted from i64");
- }
+ case funcref:
+ case anyref:
+ case nullref:
case exnref: {
- WASM_UNREACHABLE("exnref cannot be converted from i64");
+ WASM_UNREACHABLE("reference types cannot be converted from i64");
}
case none: {
value = builder.makeDrop(value);
diff --git a/src/passes/Inlining.cpp b/src/passes/Inlining.cpp
index db1db5971..c43d41e7f 100644
--- a/src/passes/Inlining.cpp
+++ b/src/passes/Inlining.cpp
@@ -46,13 +46,13 @@ namespace wasm {
// Useful into on a function, helping us decide if we can inline it
struct FunctionInfo {
- std::atomic<Index> calls;
+ std::atomic<Index> refs;
Index size;
std::atomic<bool> lightweight;
bool usedGlobally; // in a table or export
FunctionInfo() {
- calls = 0;
+ refs = 0;
size = 0;
lightweight = true;
usedGlobally = false;
@@ -75,7 +75,7 @@ struct FunctionInfo {
// FIXME: move this check to be first in this function, since we should
// return true if oneCallerInlineMaxSize is bigger than
// flexibleInlineMaxSize (which it typically should be).
- if (calls == 1 && !usedGlobally &&
+ if (refs == 1 && !usedGlobally &&
size <= options.inlining.oneCallerInlineMaxSize) {
return true;
}
@@ -108,11 +108,16 @@ struct FunctionInfoScanner
void visitCall(Call* curr) {
// can't add a new element in parallel
assert(infos->count(curr->target) > 0);
- (*infos)[curr->target].calls++;
+ (*infos)[curr->target].refs++;
// having a call is not lightweight
(*infos)[getFunction()->name].lightweight = false;
}
+ void visitRefFunc(RefFunc* curr) {
+ assert(infos->count(curr->func) > 0);
+ (*infos)[curr->func].refs++;
+ }
+
void visitFunction(Function* curr) {
(*infos)[curr->name].size = Measurer::measure(curr->body);
}
@@ -374,7 +379,7 @@ struct Inlining : public Pass {
doInlining(module, func.get(), action);
inlinedUses[inlinedName]++;
inlinedInto.insert(func.get());
- assert(inlinedUses[inlinedName] <= infos[inlinedName].calls);
+ assert(inlinedUses[inlinedName] <= infos[inlinedName].refs);
}
}
// anything we inlined into may now have non-unique label names, fix it up
@@ -388,7 +393,7 @@ struct Inlining : public Pass {
module->removeFunctions([&](Function* func) {
auto name = func->name;
auto& info = infos[name];
- return inlinedUses.count(name) && inlinedUses[name] == info.calls &&
+ return inlinedUses.count(name) && inlinedUses[name] == info.refs &&
!info.usedGlobally;
});
// return whether we did any work
diff --git a/src/passes/InstrumentLocals.cpp b/src/passes/InstrumentLocals.cpp
index 407903219..ae35ec2d1 100644
--- a/src/passes/InstrumentLocals.cpp
+++ b/src/passes/InstrumentLocals.cpp
@@ -56,14 +56,18 @@ 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_nullref("get_nullref");
Name get_exnref("get_exnref");
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_nullref("set_nullref");
Name set_exnref("set_exnref");
struct InstrumentLocals : public WalkerPass<PostWalker<InstrumentLocals>> {
@@ -84,9 +88,15 @@ struct InstrumentLocals : public WalkerPass<PostWalker<InstrumentLocals>> {
break;
case v128:
assert(false && "v128 not implemented yet");
+ case funcref:
+ import = get_funcref;
+ break;
case anyref:
import = get_anyref;
break;
+ case nullref:
+ import = get_nullref;
+ break;
case exnref:
import = get_exnref;
break;
@@ -126,9 +136,15 @@ struct InstrumentLocals : public WalkerPass<PostWalker<InstrumentLocals>> {
break;
case v128:
assert(false && "v128 not implemented yet");
+ case funcref:
+ import = set_funcref;
+ break;
case anyref:
import = set_anyref;
break;
+ case nullref:
+ import = set_nullref;
+ break;
case exnref:
import = set_exnref;
break;
@@ -156,10 +172,26 @@ struct InstrumentLocals : public WalkerPass<PostWalker<InstrumentLocals>> {
addImport(curr, set_f64, {Type::i32, Type::i32, Type::f64}, Type::f64);
if (curr->features.hasReferenceTypes()) {
+ addImport(curr,
+ get_funcref,
+ {Type::i32, Type::i32, Type::funcref},
+ Type::funcref);
+ addImport(curr,
+ set_funcref,
+ {Type::i32, Type::i32, Type::funcref},
+ Type::funcref);
addImport(
curr, get_anyref, {Type::i32, Type::i32, Type::anyref}, Type::anyref);
addImport(
curr, set_anyref, {Type::i32, Type::i32, Type::anyref}, Type::anyref);
+ addImport(curr,
+ get_nullref,
+ {Type::i32, Type::i32, Type::nullref},
+ Type::nullref);
+ addImport(curr,
+ set_nullref,
+ {Type::i32, Type::i32, Type::nullref},
+ Type::nullref);
}
if (curr->features.hasExceptionHandling()) {
addImport(
diff --git a/src/passes/LegalizeJSInterface.cpp b/src/passes/LegalizeJSInterface.cpp
index 8c7bc4414..df6651b0d 100644
--- a/src/passes/LegalizeJSInterface.cpp
+++ b/src/passes/LegalizeJSInterface.cpp
@@ -107,14 +107,43 @@ struct LegalizeJSInterface : public Pass {
}
}
}
+
if (!illegalImportsToLegal.empty()) {
+ // Gather functions used in 'ref.func'. They should not be removed.
+ std::unordered_map<Name, std::atomic<bool>> usedInRefFunc;
+
+ struct RefFuncScanner : public WalkerPass<PostWalker<RefFuncScanner>> {
+ Module& wasm;
+ std::unordered_map<Name, std::atomic<bool>>& usedInRefFunc;
+
+ bool isFunctionParallel() override { return true; }
+
+ Pass* create() override {
+ return new RefFuncScanner(wasm, usedInRefFunc);
+ }
+
+ RefFuncScanner(
+ Module& wasm,
+ std::unordered_map<Name, std::atomic<bool>>& usedInRefFunc)
+ : wasm(wasm), usedInRefFunc(usedInRefFunc) {
+ // Fill in unordered_map, as we operate on it in parallel
+ for (auto& func : wasm.functions) {
+ usedInRefFunc[func->name];
+ }
+ }
+
+ void visitRefFunc(RefFunc* curr) { usedInRefFunc[curr->func] = true; }
+ };
+
+ RefFuncScanner(*module, usedInRefFunc).run(runner, module);
for (auto& pair : illegalImportsToLegal) {
- module->removeFunction(pair.first);
+ if (!usedInRefFunc[pair.first]) {
+ module->removeFunction(pair.first);
+ }
}
// fix up imports: call_import of an illegal must be turned to a call of a
// legal
-
struct FixImports : public WalkerPass<PostWalker<FixImports>> {
bool isFunctionParallel() override { return true; }
diff --git a/src/passes/LocalCSE.cpp b/src/passes/LocalCSE.cpp
index 0816bf6ea..b49c92310 100644
--- a/src/passes/LocalCSE.cpp
+++ b/src/passes/LocalCSE.cpp
@@ -172,9 +172,12 @@ struct LocalCSE : public WalkerPass<LinearExecutionWalker<LocalCSE>> {
void handle(Expression* curr) {
if (auto* set = curr->dynCast<LocalSet>()) {
// Calculate equivalences
+ auto* func = getFunction();
equivalences.reset(set->index);
if (auto* get = set->value->dynCast<LocalGet>()) {
- equivalences.add(set->index, get->index);
+ if (func->getLocalType(set->index) == func->getLocalType(get->index)) {
+ equivalences.add(set->index, get->index);
+ }
}
// consider the value
auto* value = set->value;
@@ -184,7 +187,7 @@ struct LocalCSE : public WalkerPass<LinearExecutionWalker<LocalCSE>> {
if (iter != usables.end()) {
// already exists in the table, this is good to reuse
auto& info = iter->second;
- Type localType = getFunction()->getLocalType(info.index);
+ Type localType = func->getLocalType(info.index);
set->value =
Builder(*getModule()).makeLocalGet(info.index, localType);
anotherPass = true;
diff --git a/src/passes/MergeLocals.cpp b/src/passes/MergeLocals.cpp
index 0116753f1..2223594b6 100644
--- a/src/passes/MergeLocals.cpp
+++ b/src/passes/MergeLocals.cpp
@@ -100,7 +100,8 @@ struct MergeLocals
return;
}
// compute all dependencies
- LocalGraph preGraph(getFunction());
+ auto* func = getFunction();
+ LocalGraph preGraph(func);
preGraph.computeInfluences();
// optimize each copy
std::unordered_map<LocalSet*, LocalSet*> optimizedToCopy,
@@ -119,6 +120,11 @@ struct MergeLocals
if (preGraph.getSetses[influencedGet].size() == 1) {
// this is ok
assert(*preGraph.getSetses[influencedGet].begin() == trivial);
+ // If local types are different (when one is a subtype of the
+ // other), don't optimize
+ if (func->getLocalType(copy->index) != influencedGet->type) {
+ canOptimizeToCopy = false;
+ }
} else {
canOptimizeToCopy = false;
break;
@@ -152,6 +158,11 @@ struct MergeLocals
if (preGraph.getSetses[influencedGet].size() == 1) {
// this is ok
assert(*preGraph.getSetses[influencedGet].begin() == copy);
+ // If local types are different (when one is a subtype of the
+ // other), don't optimize
+ if (func->getLocalType(trivial->index) != influencedGet->type) {
+ canOptimizeToTrivial = false;
+ }
} else {
canOptimizeToTrivial = false;
break;
@@ -176,7 +187,7 @@ struct MergeLocals
// if one does not work, we need to undo all its siblings (don't extend
// the live range unless we are definitely removing a conflict, same
// logic as before).
- LocalGraph postGraph(getFunction());
+ LocalGraph postGraph(func);
postGraph.computeInfluences();
for (auto& pair : optimizedToCopy) {
auto* copy = pair.first;
diff --git a/src/passes/OptimizeInstructions.cpp b/src/passes/OptimizeInstructions.cpp
index 6de1d3d00..edd6ba2b6 100644
--- a/src/passes/OptimizeInstructions.cpp
+++ b/src/passes/OptimizeInstructions.cpp
@@ -751,12 +751,12 @@ struct OptimizeInstructions
// condition, do that
auto needCondition =
EffectAnalyzer(getPassOptions(), iff->condition).hasSideEffects();
- auto typeIsIdentical = iff->ifTrue->type == iff->type;
- if (typeIsIdentical && !needCondition) {
+ auto isSubType = Type::isSubType(iff->ifTrue->type, iff->type);
+ if (isSubType && !needCondition) {
return iff->ifTrue;
} else {
Builder builder(*getModule());
- if (typeIsIdentical) {
+ if (isSubType) {
return builder.makeSequence(builder.makeDrop(iff->condition),
iff->ifTrue);
} else {
diff --git a/src/passes/Precompute.cpp b/src/passes/Precompute.cpp
index 57a3ab27f..85eb026f9 100644
--- a/src/passes/Precompute.cpp
+++ b/src/passes/Precompute.cpp
@@ -177,7 +177,7 @@ struct Precompute
void visitExpression(Expression* curr) {
// TODO: if local.get, only replace with a constant if we don't care about
// size...?
- if (curr->is<Const>() || curr->is<Nop>()) {
+ if (Properties::isConstantExpression(curr) || curr->is<Nop>()) {
return;
}
// Until engines implement v128.const and we have SIMD-aware optimizations
@@ -208,14 +208,16 @@ 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));
+ replaceCurrent(
+ builder.makeReturn(flow.value.type != 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 @@ private:
} 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 5efd1fd28..51e78c8a7 100644
--- a/src/passes/Print.cpp
+++ b/src/passes/Print.cpp
@@ -1333,7 +1333,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) {
@@ -1346,6 +1351,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()) {
@@ -1852,6 +1863,23 @@ struct PrintSExpression : public OverriddenVisitor<PrintSExpression> {
}
}
}
+ void visitRefNull(RefNull* curr) {
+ o << '(';
+ PrintExpressionContents(currFunction, o).visit(curr);
+ o << ')';
+ }
+ void visitRefIsNull(RefIsNull* curr) {
+ o << '(';
+ PrintExpressionContents(currFunction, o).visit(curr);
+ incIndent();
+ printFullLine(curr->value);
+ decIndent();
+ }
+ void visitRefFunc(RefFunc* curr) {
+ o << '(';
+ PrintExpressionContents(currFunction, o).visit(curr);
+ o << ')';
+ }
// try-catch-end is written in the folded wat format as
// (try
// ...
@@ -2434,13 +2462,15 @@ WasmPrinter::printStackInst(StackInst* inst, std::ostream& o, Function* func) {
}
case StackInst::BlockBegin:
case StackInst::IfBegin:
- case StackInst::LoopBegin: {
+ case StackInst::LoopBegin:
+ case StackInst::TryBegin: {
o << getExpressionName(inst->origin);
break;
}
case StackInst::BlockEnd:
case StackInst::IfEnd:
- case StackInst::LoopEnd: {
+ case StackInst::LoopEnd:
+ case StackInst::TryEnd: {
o << "end (" << inst->type << ')';
break;
}
@@ -2448,6 +2478,10 @@ WasmPrinter::printStackInst(StackInst* inst, std::ostream& o, Function* func) {
o << "else";
break;
}
+ case StackInst::Catch: {
+ o << "catch";
+ break;
+ }
default:
WASM_UNREACHABLE("unexpeted op");
}
diff --git a/src/passes/RemoveUnusedModuleElements.cpp b/src/passes/RemoveUnusedModuleElements.cpp
index f5000e3a4..21cbc5e5b 100644
--- a/src/passes/RemoveUnusedModuleElements.cpp
+++ b/src/passes/RemoveUnusedModuleElements.cpp
@@ -116,6 +116,12 @@ struct ReachabilityAnalyzer : public PostWalker<ReachabilityAnalyzer> {
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 88f27f8be..b18f726ed 100644
--- a/src/passes/SimplifyGlobals.cpp
+++ b/src/passes/SimplifyGlobals.cpp
@@ -37,6 +37,7 @@
#include <atomic>
#include "ir/effects.h"
+#include "ir/properties.h"
#include "ir/utils.h"
#include "pass.h"
#include "wasm-builder.h"
@@ -106,8 +107,9 @@ struct ConstantGlobalApplier
void visitExpression(Expression* curr) {
if (auto* set = curr->dynCast<GlobalSet>()) {
- if (auto* c = set->value->dynCast<Const>()) {
- currConstantGlobals[set->name] = c->value;
+ if (Properties::isConstantExpression(set->value)) {
+ currConstantGlobals[set->name] =
+ getLiteralFromConstExpression(set->value);
} else {
currConstantGlobals.erase(set->name);
}
@@ -116,7 +118,7 @@ struct ConstantGlobalApplier
// Check if the global is known to be constant all the time.
if (constantGlobals->count(get->name)) {
auto* global = getModule()->getGlobal(get->name);
- assert(global->init->is<Const>());
+ assert(Properties::isConstantExpression(global->init));
replaceCurrent(ExpressionManipulator::copy(global->init, *getModule()));
replaced = true;
return;
@@ -125,7 +127,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;
@@ -249,13 +251,14 @@ struct SimplifyGlobals : public Pass {
std::map<Name, Literal> constantGlobals;
for (auto& global : module->globals) {
if (!global->imported()) {
- if (auto* c = global->init->dynCast<Const>()) {
- constantGlobals[global->name] = c->value;
+ if (Properties::isConstantExpression(global->init)) {
+ constantGlobals[global->name] =
+ getLiteralFromConstExpression(global->init);
} else if (auto* get = global->init->dynCast<GlobalGet>()) {
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);
}
}
}
@@ -268,7 +271,7 @@ struct SimplifyGlobals : public Pass {
NameSet constantGlobals;
for (auto& global : module->globals) {
if (!global->mutable_ && !global->imported() &&
- global->init->is<Const>()) {
+ Properties::isConstantExpression(global->init)) {
constantGlobals.insert(global->name);
}
}
diff --git a/src/passes/SimplifyLocals.cpp b/src/passes/SimplifyLocals.cpp
index a3fa4a34d..a952f8a38 100644
--- a/src/passes/SimplifyLocals.cpp
+++ b/src/passes/SimplifyLocals.cpp
@@ -546,7 +546,6 @@ struct SimplifyLocals
auto* blockLocalSetPointer = sinkables.at(sharedIndex).item;
auto* value = (*blockLocalSetPointer)->template cast<LocalSet>()->value;
block->list[block->list.size() - 1] = value;
- block->type = value->type;
ExpressionManipulator::nop(*blockLocalSetPointer);
for (size_t j = 0; j < breaks.size(); j++) {
// move break local.set's value to the break
@@ -577,6 +576,7 @@ struct SimplifyLocals
this->replaceCurrent(newLocalSet);
sinkables.clear();
anotherCycle = true;
+ block->finalize();
}
// optimize local.sets from both sides of an if into a return value
@@ -915,6 +915,7 @@ struct SimplifyLocals
void visitLocalSet(LocalSet* curr) {
// Remove trivial copies, even through a tee
auto* value = curr->value;
+ Function* func = this->getFunction();
while (auto* subSet = value->dynCast<LocalSet>()) {
value = subSet->value;
}
@@ -929,7 +930,8 @@ struct SimplifyLocals
}
anotherCycle = true;
}
- } else {
+ } else if (func->getLocalType(curr->index) ==
+ func->getLocalType(get->index)) {
// There is a new equivalence now.
equivalences.reset(curr->index);
equivalences.add(curr->index, get->index);
diff --git a/src/passes/opt-utils.h b/src/passes/opt-utils.h
index 93fac137f..7912a7d92 100644
--- a/src/passes/opt-utils.h
+++ b/src/passes/opt-utils.h
@@ -54,19 +54,22 @@ inline void optimizeAfterInlining(std::unordered_set<Function*>& funcs,
module->updateMaps();
}
-struct CallTargetReplacer : public WalkerPass<PostWalker<CallTargetReplacer>> {
+struct FunctionRefReplacer
+ : public WalkerPass<PostWalker<FunctionRefReplacer>> {
bool isFunctionParallel() override { return true; }
using MaybeReplace = std::function<void(Name&)>;
- CallTargetReplacer(MaybeReplace maybeReplace) : maybeReplace(maybeReplace) {}
+ FunctionRefReplacer(MaybeReplace maybeReplace) : maybeReplace(maybeReplace) {}
- CallTargetReplacer* create() override {
- return new CallTargetReplacer(maybeReplace);
+ FunctionRefReplacer* create() override {
+ return new FunctionRefReplacer(maybeReplace);
}
void visitCall(Call* curr) { maybeReplace(curr->target); }
+ void visitRefFunc(RefFunc* curr) { maybeReplace(curr->func); }
+
private:
MaybeReplace maybeReplace;
};
@@ -81,7 +84,7 @@ inline void replaceFunctions(PassRunner* runner,
}
};
// replace direct calls
- CallTargetReplacer(maybeReplace).run(runner, &module);
+ FunctionRefReplacer(maybeReplace).run(runner, &module);
// replace in table
for (auto& segment : module.table.segments) {
for (auto& name : segment.data) {
diff --git a/src/shell-interface.h b/src/shell-interface.h
index 52533f37c..75f8e81b8 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 nullref:
case exnref:
- assert(false && "exnref not implemented yet");
+ globals[import->name] = Literal::makeNullref();
+ break;
case none:
case unreachable:
WASM_UNREACHABLE("unexpected type");
@@ -163,7 +165,7 @@ struct ShellExternalInterface : ModuleInstance::ExternalInterface {
trap("callIndirect: bad # of arguments");
}
for (size_t i = 0; i < params.size(); i++) {
- if (params[i] != arguments[i].type) {
+ if (!Type::isSubType(arguments[i].type, params[i])) {
trap("callIndirect: bad argument type");
}
}
diff --git a/src/support/name.h b/src/support/name.h
index 2bc50abf0..615740e09 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 <cstring>
+#include <string>
#include "emscripten-optimizer/istring.h"
diff --git a/src/support/small_vector.h b/src/support/small_vector.h
index 7f00bd4a6..d4ad961a7 100644
--- a/src/support/small_vector.h
+++ b/src/support/small_vector.h
@@ -38,17 +38,15 @@ template<typename T, size_t N> class SmallVector {
std::vector<T> 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<T&>(static_cast<const SmallVector<T, N>&>(*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/execution-results.h b/src/tools/execution-results.h
index c0c7428cc..7787dba25 100644
--- a/src/tools/execution-results.h
+++ b/src/tools/execution-results.h
@@ -69,11 +69,17 @@ struct ExecutionResults {
auto* func = wasm.getFunction(exp->value);
if (func->sig.results != Type::none) {
// this has a result
- results[exp->name] = run(func, wasm, instance);
- // ignore the result if we hit an unreachable and returned no value
- if (results[exp->name].type.isConcrete()) {
- std::cout << "[fuzz-exec] note result: " << exp->name << " => "
- << results[exp->name] << '\n';
+ Literal ret = run(func, wasm, instance);
+ // We cannot compare funcrefs by name because function names can
+ // change (after duplicate function elimination or roundtripping)
+ // while the function contents are still the same
+ if (ret.type != Type::funcref) {
+ results[exp->name] = ret;
+ // ignore the result if we hit an unreachable and returned no value
+ if (results[exp->name].type.isConcrete()) {
+ std::cout << "[fuzz-exec] note result: " << exp->name << " => "
+ << results[exp->name] << '\n';
+ }
}
} else {
// no result, run it anyhow (it might modify memory etc.)
@@ -100,17 +106,17 @@ struct ExecutionResults {
auto name = iter.first;
if (results.find(name) == results.end()) {
std::cout << "[fuzz-exec] missing " << name << '\n';
- abort();
+ return false;
}
std::cout << "[fuzz-exec] comparing " << name << '\n';
if (results[name] != other.results[name]) {
std::cout << "not identical!\n";
- abort();
+ return false;
}
}
if (loggings != other.loggings) {
std::cout << "logging not identical!\n";
- abort();
+ return false;
}
return true;
}
@@ -138,7 +144,7 @@ struct ExecutionResults {
// call the method
for (Type param : func->sig.params.expand()) {
// zeros in arguments TODO: more?
- arguments.push_back(Literal(param));
+ arguments.push_back(Literal::makeZero(param));
}
return instance.callFunction(func->name, arguments);
} catch (const TrapException&) {
diff --git a/src/tools/fuzzing.h b/src/tools/fuzzing.h
index ce302fac6..ff0888f1d 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 <ir/find_all.h>
@@ -310,6 +309,24 @@ private:
double getDouble() { return Literal(get64()).reinterpretf64(); }
+ SmallVector<Type, 2> getSubTypes(Type type) {
+ SmallVector<Type, 2> ret;
+ ret.push_back(type); // includes itself
+ switch (type) {
+ case Type::anyref:
+ ret.push_back(Type::funcref);
+ ret.push_back(Type::exnref);
+ // falls through
+ case Type::funcref:
+ case Type::exnref:
+ ret.push_back(Type::nullref);
+ break;
+ default:
+ break;
+ }
+ return ret;
+ }
+
void setupMemory() {
// Add memory itself
MemoryUtils::ensureExists(wasm.memory);
@@ -404,10 +421,12 @@ private:
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<Type> 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,
@@ -447,7 +466,7 @@ private:
}
void addImportLoggingSupport() {
- for (auto type : getConcreteTypes()) {
+ for (auto type : getLoggableTypes()) {
auto* func = new Function;
Name name = std::string("log-") + type.toString();
func->name = name;
@@ -501,7 +520,7 @@ private:
// function generation state
- Function* func;
+ Function* func = nullptr;
std::vector<Expression*> breakableStack; // things we can break to
Index labelIndex;
@@ -585,10 +604,12 @@ private:
// loop limit
FindAll<Loop> 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->sig.results);
}
void recombine(Function* func) {
@@ -841,7 +862,9 @@ private:
case f32:
case f64:
case v128:
+ case funcref:
case anyref:
+ case nullref:
case exnref:
ret = _makeConcrete(type);
break;
@@ -852,7 +875,8 @@ private:
ret = _makeunreachable();
break;
}
- assert(ret->type == type); // we should create the right type of thing
+ // we should create the right type of thing
+ assert(Type::isSubType(ret->type, type));
nesting--;
return ret;
}
@@ -898,9 +922,12 @@ private:
&Self::makeSelect,
&Self::makeGlobalGet)
.add(FeatureSet::SIMD, &Self::makeSIMD);
- if (type == i32 || type == i64) {
+ if (type == Type::i32 || type == Type::i64) {
options.add(FeatureSet::Atomics, &Self::makeAtomic);
}
+ if (type == Type::i32) {
+ options.add(FeatureSet::ReferenceTypes, &Self::makeRefIsNull);
+ }
return (this->*pick(options))(type);
}
@@ -1064,11 +1091,11 @@ private:
// 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;
}
@@ -1093,15 +1120,15 @@ private:
}
}
- 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) {
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;
}
@@ -1360,8 +1387,10 @@ private:
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 funcref:
+ case anyref:
+ case nullref:
+ case exnref:
case none:
case unreachable:
WASM_UNREACHABLE("invalid type");
@@ -1370,8 +1399,8 @@ private:
}
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);
@@ -1393,7 +1422,7 @@ private:
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<Store>();
if (!store) {
return ret;
@@ -1416,7 +1445,7 @@ private:
// 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();
@@ -1462,8 +1491,10 @@ private:
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 funcref:
+ case anyref:
+ case nullref:
+ case exnref:
case none:
case unreachable:
WASM_UNREACHABLE("invalid type");
@@ -1472,7 +1503,6 @@ private:
}
Expression* makeStore(Type type) {
- // exnref type cannot be stored in memory
if (!allowMemory || type.isRef()) {
return makeTrivial(type);
}
@@ -1558,8 +1588,10 @@ private:
case f64:
return Literal(getDouble());
case v128:
- case anyref: // anyref cannot have literals
- case exnref: // exnref cannot have literals
+ case funcref:
+ case anyref:
+ case nullref:
+ case exnref:
case none:
case unreachable:
WASM_UNREACHABLE("invalid type");
@@ -1601,8 +1633,10 @@ private:
case f64:
return Literal(double(small));
case v128:
- case anyref: // anyref cannot have literals
- case exnref: // exnref cannot have literals
+ case funcref:
+ case anyref:
+ case nullref:
+ case exnref:
case none:
case unreachable:
WASM_UNREACHABLE("unexpected type");
@@ -1667,8 +1701,10 @@ private:
std::numeric_limits<uint64_t>::max()));
break;
case v128:
- case anyref: // anyref cannot have literals
- case exnref: // exnref cannot have literals
+ case funcref:
+ case anyref:
+ case nullref:
+ case exnref:
case none:
case unreachable:
WASM_UNREACHABLE("unexpected type");
@@ -1699,8 +1735,10 @@ private:
value = Literal(double(int64_t(1) << upTo(64)));
break;
case v128:
- case anyref: // anyref cannot have literals
- case exnref: // exnref cannot have literals
+ case funcref:
+ case anyref:
+ case nullref:
+ case exnref:
case none:
case unreachable:
WASM_UNREACHABLE("unexpected type");
@@ -1724,21 +1762,23 @@ private:
}
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 == 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<Const>();
ret->value = makeLiteral(type);
ret->type = type;
@@ -1757,9 +1797,9 @@ private:
// 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) {
@@ -1807,8 +1847,11 @@ private:
AllTrueVecI64x2),
make(v128)});
}
- case anyref: // there's no unary ops for anyref
- case exnref: // there's no unary ops for exnref
+ case funcref:
+ case anyref:
+ case nullref:
+ case exnref:
+ return makeTrivial(type);
case none:
case unreachable:
WASM_UNREACHABLE("unexpected type");
@@ -1947,8 +1990,10 @@ private:
}
WASM_UNREACHABLE("invalid value");
}
- case anyref: // there's no unary ops for anyref
- case exnref: // there's no unary ops for exnref
+ case funcref:
+ case anyref:
+ case nullref:
+ case exnref:
case none:
case unreachable:
WASM_UNREACHABLE("unexpected type");
@@ -1969,9 +2014,9 @@ private:
// 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) {
@@ -2180,8 +2225,10 @@ private:
make(v128),
make(v128)});
}
- case anyref: // there's no binary ops for anyref
- case exnref: // there's no binary ops for exnref
+ case funcref:
+ case anyref:
+ case nullref:
+ case exnref:
case none:
case unreachable:
WASM_UNREACHABLE("unexpected type");
@@ -2189,12 +2236,15 @@ private:
WASM_UNREACHABLE("invalid type");
}
- 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)}));
+ Type subType1 = pick(getSubTypes(type));
+ Type subType2 = pick(getSubTypes(type));
+ return makeDeNanOp(
+ buildSelect({make(i32), make(subType1), make(subType2)}, type));
}
Expression* makeSwitch(Type type) {
@@ -2338,6 +2388,9 @@ private:
Expression* makeSIMD(Type type) {
assert(wasm.features.hasSIMD());
+ if (type.isRef()) {
+ return makeTrivial(type);
+ }
if (type != v128) {
return makeSIMDExtract(type);
}
@@ -2380,7 +2433,9 @@ private:
op = ExtractLaneVecF64x2;
break;
case v128:
+ case funcref:
case anyref:
+ case nullref:
case exnref:
case none:
case unreachable:
@@ -2549,6 +2604,18 @@ private:
WASM_UNREACHABLE("invalid value");
}
+ Expression* makeRefIsNull(Type type) {
+ assert(type == Type::i32);
+ assert(wasm.features.hasReferenceTypes());
+ Type refType;
+ if (wasm.features.hasExceptionHandling()) {
+ refType = pick(Type::funcref, Type::anyref, Type::nullref, Type::exnref);
+ } else {
+ refType = pick(Type::funcref, Type::anyref, Type::nullref);
+ }
+ return builder.makeRefIsNull(make(refType));
+ }
+
Expression* makeMemoryInit() {
if (!allowMemory) {
return makeTrivial(none);
@@ -2593,7 +2660,7 @@ private:
// special makers
Expression* makeLogging() {
- auto type = getConcreteType();
+ auto type = getLoggableType();
return builder.makeCall(
std::string("log-") + type.toString(), {make(type)}, none);
}
@@ -2605,20 +2672,64 @@ private:
// special getters
- Type getReachableType() {
- return pick(FeatureOptions<Type>()
- .add(FeatureSet::MVP, i32, i64, f32, f64, none)
- .add(FeatureSet::SIMD, v128));
- }
+ std::vector<Type> getReachableTypes() {
+ return items(FeatureOptions<Type>()
+ .add(FeatureSet::MVP,
+ Type::i32,
+ Type::i64,
+ Type::f32,
+ Type::f64,
+ Type::none)
+ .add(FeatureSet::SIMD, Type::v128)
+ .add(FeatureSet::ReferenceTypes,
+ Type::funcref,
+ Type::anyref,
+ Type::nullref)
+ .add((FeatureSet::Feature)(FeatureSet::ReferenceTypes |
+ FeatureSet::ExceptionHandling),
+ Type::exnref));
+ }
+ Type getReachableType() { return pick(getReachableTypes()); }
std::vector<Type> getConcreteTypes() {
- return items(FeatureOptions<Type>()
- .add(FeatureSet::MVP, i32, i64, f32, f64)
- .add(FeatureSet::SIMD, v128));
+ return items(
+ FeatureOptions<Type>()
+ .add(FeatureSet::MVP, Type::i32, Type::i64, Type::f32, Type::f64)
+ .add(FeatureSet::SIMD, Type::v128)
+ .add(FeatureSet::ReferenceTypes,
+ Type::funcref,
+ Type::anyref,
+ Type::nullref)
+ .add((FeatureSet::Feature)(FeatureSet::ReferenceTypes |
+ FeatureSet::ExceptionHandling),
+ Type::exnref));
}
-
Type getConcreteType() { return pick(getConcreteTypes()); }
+ // Get types that can be stored in memory
+ std::vector<Type> getStorableTypes() {
+ return items(
+ FeatureOptions<Type>()
+ .add(FeatureSet::MVP, Type::i32, Type::i64, Type::f32, Type::f64)
+ .add(FeatureSet::SIMD, Type::v128));
+ }
+ Type getStorableType() { return pick(getStorableTypes()); }
+
+ // - funcref cannot be logged because referenced functions can be inlined or
+ // removed during optimization
+ // - there's no point in logging anyref because it is opaque
+ std::vector<Type> getLoggableTypes() {
+ return items(
+ FeatureOptions<Type>()
+ .add(FeatureSet::MVP, Type::i32, Type::i64, Type::f32, Type::f64)
+ .add(FeatureSet::SIMD, Type::v128)
+ .add(FeatureSet::ReferenceTypes, Type::nullref)
+ .add((FeatureSet::Feature)(FeatureSet::ReferenceTypes |
+ FeatureSet::ExceptionHandling),
+ Type::exnref));
+ }
+ Type getLoggableType() { return pick(getLoggableTypes()); }
+
// statistical distributions
// 0 to the limit, logarithmic scale
@@ -2659,8 +2770,8 @@ private:
// low values
Index upToSquared(Index x) { return upTo(upTo(x)); }
- // pick from a vector
- template<typename T> const T& pick(const std::vector<T>& vec) {
+ // pick from a vector-like container
+ template<typename T> 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 beada1b4b..f59291e55 100644
--- a/src/tools/spec-wrapper.h
+++ b/src/tools/spec-wrapper.h
@@ -48,8 +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 funcref:
+ case anyref:
+ case nullref:
+ case exnref:
+ ret += "(ref.null)";
+ break;
case none:
case unreachable:
WASM_UNREACHABLE("unexpected type");
diff --git a/src/tools/wasm-reduce.cpp b/src/tools/wasm-reduce.cpp
index 274b6de29..6adb1e174 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("unexpected type");
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:
@@ -999,6 +1009,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 d5ee60d8a..6c9d3f36a 100644
--- a/src/tools/wasm-shell.cpp
+++ b/src/tools/wasm-shell.cpp
@@ -74,7 +74,7 @@ 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<Const>()->value);
+ arguments.push_back(getLiteralFromConstExpression(argument));
}
}
@@ -214,7 +214,7 @@ static void run_asserts(Name moduleName,
assert(!trapped);
if (curr.size() >= 3) {
Literal expected =
- builder->parseExpression(*curr[2])->dynCast<Const>()->value;
+ getLiteralFromConstExpression(builder->parseExpression(*curr[2]));
std::cerr << "seen " << result << ", expected " << expected << '\n';
if (expected != result) {
std::cout << "unexpected, should be identical\n";
diff --git a/src/wasm-binary.h b/src/wasm-binary.h
index 4206defdf..f019d0792 100644
--- a/src/wasm-binary.h
+++ b/src/wasm-binary.h
@@ -343,10 +343,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
@@ -402,6 +404,7 @@ enum ASTNodes {
Drop = 0x1a,
Select = 0x1b,
+ SelectWithType = 0x1c, // added in reference types proposal
LocalGet = 0x20,
LocalSet = 0x21,
@@ -867,6 +870,12 @@ enum ASTNodes {
MemoryCopy = 0x0a,
MemoryFill = 0x0b,
+ // reference types opcodes
+
+ RefNull = 0xd0,
+ RefIsNull = 0xd1,
+ RefFunc = 0xd2,
+
// exception handling opcodes
Try = 0x06,
@@ -914,9 +923,15 @@ inline S32LEB binaryType(Type type) {
case v128:
ret = BinaryConsts::EncodedType::v128;
break;
+ case funcref:
+ ret = BinaryConsts::EncodedType::funcref;
+ break;
case anyref:
ret = BinaryConsts::EncodedType::anyref;
break;
+ case nullref:
+ ret = BinaryConsts::EncodedType::nullref;
+ break;
case exnref:
ret = BinaryConsts::EncodedType::exnref;
break;
@@ -1143,8 +1158,8 @@ public:
// we store function imports here before wasm.addFunctionImport after we know
// their names
std::vector<Function*> functionImports;
- // at index i we have all calls to the function i
- std::map<Index, std::vector<Call*>> functionCalls;
+ // at index i we have all refs to the function i
+ std::map<Index, std::vector<Expression*>> functionRefs;
Function* currFunction = nullptr;
// before we see a function (like global init expressions), there is no end of
// function to check
@@ -1279,12 +1294,15 @@ public:
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 918e6a4ab..38009cb8a 100644
--- a/src/wasm-builder.h
+++ b/src/wasm-builder.h
@@ -110,6 +110,12 @@ public:
ret->finalize();
return ret;
}
+ Block* makeBlock(const std::vector<Expression*>& items, Type type) {
+ auto* ret = allocator.alloc<Block>();
+ ret->list.set(items);
+ ret->finalize(type);
+ return ret;
+ }
Block* makeBlock(const ExpressionList& items) {
auto* ret = allocator.alloc<Block>();
ret->list.set(items);
@@ -164,6 +170,13 @@ public:
ret->finalize();
return ret;
}
+ Loop* makeLoop(Name name, Expression* body, Type type) {
+ auto* ret = allocator.alloc<Loop>();
+ ret->name = name;
+ ret->body = body;
+ ret->finalize(type);
+ return ret;
+ }
Break* makeBreak(Name name,
Expression* value = nullptr,
Expression* condition = nullptr) {
@@ -459,6 +472,7 @@ public:
return ret;
}
Const* makeConst(Literal value) {
+ assert(value.type.isNumber());
auto* ret = allocator.alloc<Const>();
ret->value = value;
ret->type = value.type;
@@ -488,6 +502,17 @@ public:
ret->finalize();
return ret;
}
+ Select* makeSelect(Expression* condition,
+ Expression* ifTrue,
+ Expression* ifFalse,
+ Type type) {
+ auto* ret = allocator.alloc<Select>();
+ ret->condition = condition;
+ ret->ifTrue = ifTrue;
+ ret->ifFalse = ifFalse;
+ ret->finalize(type);
+ return ret;
+ }
Return* makeReturn(Expression* value = nullptr) {
auto* ret = allocator.alloc<Return>();
ret->value = value;
@@ -502,6 +527,23 @@ public:
ret->finalize();
return ret;
}
+ RefNull* makeRefNull() {
+ auto* ret = allocator.alloc<RefNull>();
+ ret->finalize();
+ return ret;
+ }
+ RefIsNull* makeRefIsNull(Expression* value) {
+ auto* ret = allocator.alloc<RefIsNull>();
+ ret->value = value;
+ ret->finalize();
+ return ret;
+ }
+ RefFunc* makeRefFunc(Name func) {
+ auto* ret = allocator.alloc<RefFunc>();
+ ret->func = func;
+ ret->finalize();
+ return ret;
+ }
Try* makeTry(Expression* body, Expression* catchBody) {
auto* ret = allocator.alloc<Try>();
ret->body = body;
@@ -569,6 +611,21 @@ public:
return ret;
}
+ Expression* makeConstExpression(Literal value) {
+ switch (value.type) {
+ case Type::nullref:
+ return makeRefNull();
+ case Type::funcref:
+ if (value.getFunc()[0] != 0) {
+ return makeRefFunc(value.getFunc());
+ }
+ return makeRefNull();
+ default:
+ assert(value.type.isNumber());
+ return makeConst(value);
+ }
+ }
+
// Additional utility functions for building on top of nodes
// Convenient to have these on Builder, as it has allocation built in
@@ -663,6 +720,13 @@ public:
return block;
}
+ Block* makeSequence(Expression* left, Expression* right, Type type) {
+ auto* block = makeBlock(left);
+ block->list.push_back(right);
+ block->finalize(type);
+ return block;
+ }
+
// Grab a slice out of a block, replacing it with nops, and returning
// either another block with the contents (if more than 1) or a single
// expression
@@ -728,16 +792,15 @@ public:
value = Literal(bytes.data());
break;
}
+ case funcref:
case anyref:
- // TODO Implement and return nullref
- assert(false && "anyref not implemented yet");
+ case nullref:
case exnref:
- // TODO Implement and return nullref
- assert(false && "exnref not implemented yet");
+ return ExpressionManipulator::refNull(curr);
case none:
return ExpressionManipulator::nop(curr);
case unreachable:
- return ExpressionManipulator::convert<T, Unreachable>(curr);
+ return ExpressionManipulator::unreachable(curr);
}
return makeConst(value);
}
diff --git a/src/wasm-interpreter.h b/src/wasm-interpreter.h
index 571f0d1a5..f37a6edd6 100644
--- a/src/wasm-interpreter.h
+++ b/src/wasm-interpreter.h
@@ -143,13 +143,13 @@ public:
if (!ret.breaking() &&
(curr->type.isConcrete() || ret.value.type.isConcrete())) {
#if 1 // def WASM_INTERPRETER_DEBUG
- if (ret.value.type != curr->type) {
+ if (!Type::isSubType(ret.value.type, curr->type)) {
std::cerr << "expected " << curr->type << ", seeing " << ret.value.type
<< " from\n"
<< curr << '\n';
}
#endif
- assert(ret.value.type == curr->type);
+ assert(Type::isSubType(ret.value.type, curr->type));
}
depth--;
return ret;
@@ -1095,7 +1095,7 @@ public:
return Literal(uint64_t(val));
}
}
- Flow visitAtomicFence(AtomicFence*) {
+ Flow visitAtomicFence(AtomicFence* curr) {
// Wasm currently supports only sequentially consistent atomics, in which
// case atomic_fence can be lowered to nothing.
NOTE_ENTER("AtomicFence");
@@ -1123,6 +1123,26 @@ public:
Flow visitSIMDLoadExtend(SIMDLoad*) { WASM_UNREACHABLE("unimp"); }
Flow visitPush(Push*) { WASM_UNREACHABLE("unimp"); }
Flow visitPop(Pop*) { WASM_UNREACHABLE("unimp"); }
+ Flow visitRefNull(RefNull* curr) {
+ NOTE_ENTER("RefNull");
+ return Literal::makeNullref();
+ }
+ Flow visitRefIsNull(RefIsNull* curr) {
+ NOTE_ENTER("RefIsNull");
+ Flow flow = visit(curr->value);
+ if (flow.breaking()) {
+ return flow;
+ }
+ Literal value = flow.value;
+ NOTE_EVAL1(value);
+ return Literal(value.type == nullref);
+ }
+ Flow visitRefFunc(RefFunc* curr) {
+ NOTE_ENTER("RefFunc");
+ NOTE_NAME(curr->func);
+ return Literal::makeFuncref(curr->func);
+ }
+ // TODO Implement EH instructions
Flow visitTry(Try*) { WASM_UNREACHABLE("unimp"); }
Flow visitThrow(Throw*) { WASM_UNREACHABLE("unimp"); }
Flow visitRethrow(Rethrow*) { WASM_UNREACHABLE("unimp"); }
@@ -1217,8 +1237,10 @@ public:
return Literal(load64u(addr)).castToF64();
case v128:
return Literal(load128(addr).data());
- case anyref: // anyref cannot be loaded from memory
- case exnref: // exnref cannot be loaded from memory
+ case funcref:
+ case anyref:
+ case nullref:
+ case exnref:
case none:
case unreachable:
WASM_UNREACHABLE("unexpected type");
@@ -1272,8 +1294,10 @@ public:
case v128:
store128(addr, value.getv128());
break;
- case anyref: // anyref cannot be stored from memory
- case exnref: // exnref cannot be stored in memory
+ case funcref:
+ case anyref:
+ case nullref:
+ case exnref:
case none:
case unreachable:
WASM_UNREACHABLE("unexpected type");
@@ -1464,7 +1488,7 @@ private:
for (size_t i = 0; i < function->getNumLocals(); i++) {
if (i < arguments.size()) {
assert(i < params.size());
- if (params[i] != arguments[i].type) {
+ if (!Type::isSubType(arguments[i].type, params[i])) {
std::cerr << "Function `" << function->name << "` expects type "
<< params[i] << " for parameter " << i << ", got "
<< arguments[i].type << "." << std::endl;
@@ -1473,7 +1497,7 @@ private:
locals[i] = arguments[i];
} else {
assert(function->isVar(i));
- locals[i].type = function->getLocalType(i);
+ locals[i] = Literal::makeZero(function->getLocalType(i));
}
}
}
@@ -1580,7 +1604,8 @@ private:
}
NOTE_EVAL1(index);
NOTE_EVAL1(flow.value);
- assert(curr->isTee() ? flow.value.type == curr->type : true);
+ assert(curr->isTee() ? Type::isSubType(flow.value.type, curr->type)
+ : true);
scope.locals[index] = flow.value;
return curr->isTee() ? flow : Flow();
}
@@ -2067,7 +2092,7 @@ public:
// cannot still be breaking, it means we missed our stop
assert(!flow.breaking() || flow.breakTo == RETURN_FLOW);
Literal ret = flow.value;
- if (function->sig.results != ret.type) {
+ if (!Type::isSubType(ret.type, function->sig.results)) {
std::cerr << "calling " << function->name << " resulted in " << ret
<< " but the function type is " << function->sig.results
<< '\n';
diff --git a/src/wasm-s-parser.h b/src/wasm-s-parser.h
index d7324d756..8cdcb88f4 100644
--- a/src/wasm-s-parser.h
+++ b/src/wasm-s-parser.h
@@ -225,6 +225,9 @@ private:
Expression* makeBreak(Element& s);
Expression* makeBreakTable(Element& s);
Expression* makeReturn(Element& s);
+ Expression* makeRefNull(Element& s);
+ Expression* makeRefIsNull(Element& s);
+ Expression* makeRefFunc(Element& s);
Expression* makeTry(Element& s);
Expression* makeCatch(Element& s, Type type);
Expression* makeThrow(Element& s);
diff --git a/src/wasm-stack.h b/src/wasm-stack.h
index fbd28b0d5..91c0c5383 100644
--- a/src/wasm-stack.h
+++ b/src/wasm-stack.h
@@ -128,6 +128,9 @@ public:
void visitSelect(Select* 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);
@@ -207,6 +210,9 @@ public:
void visitSelect(Select* 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);
@@ -698,6 +704,30 @@ void BinaryenIRWriter<SubType>::visitHost(Host* curr) {
emit(curr);
}
+template<typename SubType>
+void BinaryenIRWriter<SubType>::visitRefNull(RefNull* curr) {
+ emit(curr);
+}
+
+template<typename SubType>
+void BinaryenIRWriter<SubType>::visitRefIsNull(RefIsNull* curr) {
+ visit(curr->value);
+ if (curr->type == Type::unreachable) {
+ emitUnreachable();
+ return;
+ }
+ emit(curr);
+}
+
+template<typename SubType>
+void BinaryenIRWriter<SubType>::visitRefFunc(RefFunc* curr) {
+ if (curr->type == Type::unreachable) {
+ emitUnreachable();
+ return;
+ }
+ emit(curr);
+}
+
template<typename SubType> void BinaryenIRWriter<SubType>::visitTry(Try* curr) {
emit(curr);
visitPossibleBlockContents(curr->body);
diff --git a/src/wasm-traversal.h b/src/wasm-traversal.h
index 9c6e78360..c9290cbab 100644
--- a/src/wasm-traversal.h
+++ b/src/wasm-traversal.h
@@ -72,6 +72,9 @@ template<typename SubType, typename ReturnType = void> struct Visitor {
ReturnType visitDrop(Drop* curr) { return ReturnType(); }
ReturnType visitReturn(Return* curr) { return ReturnType(); }
ReturnType visitHost(Host* curr) { return ReturnType(); }
+ ReturnType visitRefNull(RefNull* curr) { return ReturnType(); }
+ ReturnType visitRefIsNull(RefIsNull* curr) { return ReturnType(); }
+ ReturnType visitRefFunc(RefFunc* curr) { return ReturnType(); }
ReturnType visitTry(Try* curr) { return ReturnType(); }
ReturnType visitThrow(Throw* curr) { return ReturnType(); }
ReturnType visitRethrow(Rethrow* curr) { return ReturnType(); }
@@ -167,6 +170,12 @@ template<typename SubType, typename ReturnType = void> struct Visitor {
DELEGATE(Return);
case Expression::Id::HostId:
DELEGATE(Host);
+ 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:
@@ -241,6 +250,9 @@ struct OverriddenVisitor {
UNIMPLEMENTED(Drop);
UNIMPLEMENTED(Return);
UNIMPLEMENTED(Host);
+ UNIMPLEMENTED(RefNull);
+ UNIMPLEMENTED(RefIsNull);
+ UNIMPLEMENTED(RefFunc);
UNIMPLEMENTED(Try);
UNIMPLEMENTED(Throw);
UNIMPLEMENTED(Rethrow);
@@ -337,6 +349,12 @@ struct OverriddenVisitor {
DELEGATE(Return);
case Expression::Id::HostId:
DELEGATE(Host);
+ 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:
@@ -476,6 +494,15 @@ struct UnifiedExpressionVisitor : public Visitor<SubType, ReturnType> {
ReturnType visitHost(Host* curr) {
return static_cast<SubType*>(this)->visitExpression(curr);
}
+ ReturnType visitRefNull(RefNull* curr) {
+ return static_cast<SubType*>(this)->visitExpression(curr);
+ }
+ ReturnType visitRefIsNull(RefIsNull* curr) {
+ return static_cast<SubType*>(this)->visitExpression(curr);
+ }
+ ReturnType visitRefFunc(RefFunc* curr) {
+ return static_cast<SubType*>(this)->visitExpression(curr);
+ }
ReturnType visitTry(Try* curr) {
return static_cast<SubType*>(this)->visitExpression(curr);
}
@@ -778,6 +805,15 @@ struct Walker : public VisitorType {
static void doVisitHost(SubType* self, Expression** currp) {
self->visitHost((*currp)->cast<Host>());
}
+ static void doVisitRefNull(SubType* self, Expression** currp) {
+ self->visitRefNull((*currp)->cast<RefNull>());
+ }
+ static void doVisitRefIsNull(SubType* self, Expression** currp) {
+ self->visitRefIsNull((*currp)->cast<RefIsNull>());
+ }
+ static void doVisitRefFunc(SubType* self, Expression** currp) {
+ self->visitRefFunc((*currp)->cast<RefFunc>());
+ }
static void doVisitTry(SubType* self, Expression** currp) {
self->visitTry((*currp)->cast<Try>());
}
@@ -1036,6 +1072,19 @@ struct PostWalker : public Walker<SubType, VisitorType> {
}
break;
}
+ case Expression::Id::RefNullId: {
+ self->pushTask(SubType::doVisitRefNull, currp);
+ break;
+ }
+ case Expression::Id::RefIsNullId: {
+ self->pushTask(SubType::doVisitRefIsNull, currp);
+ self->pushTask(SubType::scan, &curr->cast<RefIsNull>()->value);
+ break;
+ }
+ case Expression::Id::RefFuncId: {
+ self->pushTask(SubType::doVisitRefFunc, currp);
+ break;
+ }
case Expression::Id::TryId: {
self->pushTask(SubType::doVisitTry, currp);
self->pushTask(SubType::scan, &curr->cast<Try>()->catchBody);
@@ -1099,7 +1148,7 @@ struct ControlFlowWalker : public PostWalker<SubType, VisitorType> {
Expression* findBreakTarget(Name name) {
assert(!controlFlowStack.empty());
Index i = controlFlowStack.size() - 1;
- while (1) {
+ while (true) {
auto* curr = controlFlowStack[i];
if (Block* block = curr->template dynCast<Block>()) {
if (name == block->name) {
@@ -1111,7 +1160,7 @@ struct ControlFlowWalker : public PostWalker<SubType, VisitorType> {
}
} else {
// an if, ignorable
- assert(curr->template is<If>());
+ assert(curr->template is<If>() || curr->template is<Try>());
}
if (i == 0) {
return nullptr;
@@ -1169,7 +1218,7 @@ struct ExpressionStackWalker : public PostWalker<SubType, VisitorType> {
Expression* findBreakTarget(Name name) {
assert(!expressionStack.empty());
Index i = expressionStack.size() - 1;
- while (1) {
+ while (true) {
auto* curr = expressionStack[i];
if (Block* block = curr->template dynCast<Block>()) {
if (name == block->name) {
@@ -1179,8 +1228,6 @@ struct ExpressionStackWalker : public PostWalker<SubType, VisitorType> {
if (name == loop->name) {
return curr;
}
- } else {
- WASM_UNREACHABLE("unexpected expression type");
}
if (i == 0) {
return nullptr;
diff --git a/src/wasm-type.h b/src/wasm-type.h
index 53ef39ef8..668ac3e4d 100644
--- a/src/wasm-type.h
+++ b/src/wasm-type.h
@@ -36,7 +36,9 @@ public:
f32,
f64,
v128,
+ funcref,
anyref,
+ nullref,
exnref,
_last_value_type,
};
@@ -64,7 +66,8 @@ public:
bool isInteger() const { return id == i32 || id == i64; }
bool isFloat() const { return id == f32 || id == f64; }
bool isVector() const { return id == v128; };
- bool isRef() const { return id == anyref || id == exnref; }
+ bool isNumber() const { return id >= i32 && id <= v128; }
+ bool isRef() const { return id >= funcref && id <= exnref; }
// (In)equality must be defined for both Type and ValueType because it is
// otherwise ambiguous whether to convert both this and other to int or
@@ -94,6 +97,23 @@ public:
// type.
static Type get(unsigned byteSize, bool float_);
+ // Returns true if left is a subtype of right. Subtype includes itself.
+ static bool isSubType(Type left, Type right);
+
+ // Computes the least upper bound from the type lattice.
+ // If one of the type is unreachable, the other type becomes the result. If
+ // the common supertype does not exist, returns none, a poison value.
+ static Type getLeastUpperBound(Type a, Type b);
+
+ // Computes the least upper bound for all types in the given list.
+ template<typename T> static Type mergeTypes(const T& types) {
+ Type type = Type::unreachable;
+ for (auto other : types) {
+ type = Type::getLeastUpperBound(type, other);
+ }
+ return type;
+ }
+
std::string toString() const;
};
@@ -134,7 +154,9 @@ constexpr Type i64 = Type::i64;
constexpr Type f32 = Type::f32;
constexpr Type f64 = Type::f64;
constexpr Type v128 = Type::v128;
+constexpr Type funcref = Type::funcref;
constexpr Type anyref = Type::anyref;
+constexpr Type nullref = Type::nullref;
constexpr Type exnref = Type::exnref;
constexpr Type unreachable = Type::unreachable;
diff --git a/src/wasm.h b/src/wasm.h
index 48adf103b..c4dbd2f3f 100644
--- a/src/wasm.h
+++ b/src/wasm.h
@@ -531,6 +531,9 @@ public:
MemoryFillId,
PushId,
PopId,
+ RefNullId,
+ RefIsNullId,
+ RefFuncId,
TryId,
ThrowId,
RethrowId,
@@ -569,6 +572,8 @@ public:
const char* getExpressionName(Expression* curr);
+Literal getLiteralFromConstExpression(Expression* curr);
+
typedef ArenaVector<Expression*> ExpressionList;
template<Expression::Id SID> class SpecificExpression : public Expression {
@@ -1008,6 +1013,7 @@ public:
Expression* condition;
void finalize();
+ void finalize(Type type_);
};
class Drop : public SpecificExpression<Expression::DropId> {
@@ -1070,6 +1076,32 @@ public:
Pop(MixedArena& allocator) {}
};
+class RefNull : public SpecificExpression<Expression::RefNullId> {
+public:
+ RefNull() = default;
+ RefNull(MixedArena& allocator) {}
+
+ void finalize();
+};
+
+class RefIsNull : public SpecificExpression<Expression::RefIsNullId> {
+public:
+ RefIsNull(MixedArena& allocator) {}
+
+ Expression* value;
+
+ void finalize();
+};
+
+class RefFunc : public SpecificExpression<Expression::RefFuncId> {
+public:
+ RefFunc(MixedArena& allocator) {}
+
+ Name func;
+
+ void finalize();
+};
+
class Try : public SpecificExpression<Expression::TryId> {
public:
Try(MixedArena& allocator) {}
diff --git a/src/wasm/literal.cpp b/src/wasm/literal.cpp
index 82a150257..4f66b36e3 100644
--- a/src/wasm/literal.cpp
+++ b/src/wasm/literal.cpp
@@ -137,8 +137,11 @@ void Literal::getBits(uint8_t (&buf)[16]) const {
case Type::v128:
memcpy(buf, &v128, sizeof(v128));
break;
- case Type::anyref: // anyref type is opaque
- case Type::exnref: // exnref type is opaque
+ case Type::funcref:
+ case Type::nullref:
+ break;
+ case Type::anyref:
+ case Type::exnref:
case Type::none:
case Type::unreachable:
WASM_UNREACHABLE("invalid type");
@@ -146,10 +149,20 @@ void Literal::getBits(uint8_t (&buf)[16]) const {
}
bool Literal::operator==(const Literal& other) const {
+ if (type.isRef() && other.type.isRef()) {
+ if (type == Type::nullref && other.type == Type::nullref) {
+ return true;
+ }
+ if (type == Type::funcref && other.type == Type::funcref &&
+ func == other.func) {
+ return true;
+ }
+ return false;
+ }
if (type != other.type) {
return false;
}
- if (type == none) {
+ if (type == Type::none) {
return true;
}
uint8_t bits[16], other_bits[16];
@@ -273,8 +286,14 @@ std::ostream& operator<<(std::ostream& o, Literal literal) {
o << "i32x4 ";
literal.printVec128(o, literal.getv128());
break;
- case Type::anyref: // anyref type is opaque
- case Type::exnref: // exnref type is opaque
+ case Type::funcref:
+ o << "funcref(" << literal.getFunc() << ")";
+ break;
+ case Type::nullref:
+ o << "nullref";
+ break;
+ case Type::anyref:
+ case Type::exnref:
case Type::unreachable:
WASM_UNREACHABLE("invalid type");
}
@@ -477,7 +496,9 @@ Literal Literal::eqz() const {
case Type::f64:
return eq(Literal(double(0)));
case Type::v128:
+ case Type::funcref:
case Type::anyref:
+ case Type::nullref:
case Type::exnref:
case Type::none:
case Type::unreachable:
@@ -497,7 +518,9 @@ Literal Literal::neg() const {
case Type::f64:
return Literal(int64_t(i64 ^ 0x8000000000000000ULL)).castToF64();
case Type::v128:
+ case Type::funcref:
case Type::anyref:
+ case Type::nullref:
case Type::exnref:
case Type::none:
case Type::unreachable:
@@ -517,7 +540,9 @@ Literal Literal::abs() const {
case Type::f64:
return Literal(int64_t(i64 & 0x7fffffffffffffffULL)).castToF64();
case Type::v128:
+ case Type::funcref:
case Type::anyref:
+ case Type::nullref:
case Type::exnref:
case Type::none:
case Type::unreachable:
@@ -620,7 +645,9 @@ Literal Literal::add(const Literal& other) const {
case Type::f64:
return Literal(getf64() + other.getf64());
case Type::v128:
+ case Type::funcref:
case Type::anyref:
+ case Type::nullref:
case Type::exnref:
case Type::none:
case Type::unreachable:
@@ -640,7 +667,9 @@ Literal Literal::sub(const Literal& other) const {
case Type::f64:
return Literal(getf64() - other.getf64());
case Type::v128:
+ case Type::funcref:
case Type::anyref:
+ case Type::nullref:
case Type::exnref:
case Type::none:
case Type::unreachable:
@@ -731,7 +760,9 @@ Literal Literal::mul(const Literal& other) const {
case Type::f64:
return Literal(getf64() * other.getf64());
case Type::v128:
+ case Type::funcref:
case Type::anyref:
+ case Type::nullref:
case Type::exnref:
case Type::none:
case Type::unreachable:
@@ -967,7 +998,9 @@ Literal Literal::eq(const Literal& other) const {
case Type::f64:
return Literal(getf64() == other.getf64());
case Type::v128:
+ case Type::funcref:
case Type::anyref:
+ case Type::nullref:
case Type::exnref:
case Type::none:
case Type::unreachable:
@@ -987,7 +1020,9 @@ Literal Literal::ne(const Literal& other) const {
case Type::f64:
return Literal(getf64() != other.getf64());
case Type::v128:
+ case Type::funcref:
case Type::anyref:
+ case Type::nullref:
case Type::exnref:
case Type::none:
case Type::unreachable:
diff --git a/src/wasm/wasm-binary.cpp b/src/wasm/wasm-binary.cpp
index 82eb51d7e..ba5a8d3dd 100644
--- a/src/wasm/wasm-binary.cpp
+++ b/src/wasm/wasm-binary.cpp
@@ -262,7 +262,7 @@ void WasmBinaryWriter::writeImports() {
BYN_TRACE("write one table\n");
writeImportHeader(&wasm->table);
o << U32LEB(int32_t(ExternalKind::Table));
- o << S32LEB(BinaryConsts::EncodedType::AnyFunc);
+ o << S32LEB(BinaryConsts::EncodedType::funcref);
writeResizableLimits(wasm->table.initial,
wasm->table.max,
wasm->table.hasMax(),
@@ -463,7 +463,7 @@ void WasmBinaryWriter::writeFunctionTableDeclaration() {
BYN_TRACE("== writeFunctionTableDeclaration\n");
auto start = startSection(BinaryConsts::Section::Table);
o << U32LEB(1); // Declare 1 table.
- o << S32LEB(BinaryConsts::EncodedType::AnyFunc);
+ o << S32LEB(BinaryConsts::EncodedType::funcref);
writeResizableLimits(wasm->table.initial,
wasm->table.max,
wasm->table.hasMax(),
@@ -1059,8 +1059,12 @@ Type WasmBinaryBuilder::getType() {
return f64;
case BinaryConsts::EncodedType::v128:
return v128;
+ case BinaryConsts::EncodedType::funcref:
+ return funcref;
case BinaryConsts::EncodedType::anyref:
return anyref;
+ case BinaryConsts::EncodedType::nullref:
+ return nullref;
case BinaryConsts::EncodedType::exnref:
return exnref;
default:
@@ -1258,8 +1262,8 @@ void WasmBinaryBuilder::readImports() {
wasm.table.name = Name(std::string("timport$") + std::to_string(i));
auto elementType = getS32LEB();
WASM_UNUSED(elementType);
- if (elementType != BinaryConsts::EncodedType::AnyFunc) {
- throwError("Imported table type is not AnyFunc");
+ if (elementType != BinaryConsts::EncodedType::funcref) {
+ throwError("Imported table type is not funcref");
}
wasm.table.exists = true;
bool is_shared;
@@ -1802,11 +1806,17 @@ void WasmBinaryBuilder::processFunctions() {
wasm.addExport(curr);
}
- for (auto& iter : functionCalls) {
+ for (auto& iter : functionRefs) {
size_t index = iter.first;
- auto& calls = iter.second;
- for (auto* call : calls) {
- call->target = getFunctionName(index);
+ auto& refs = iter.second;
+ for (auto* ref : refs) {
+ if (auto* call = ref->dynCast<Call>()) {
+ call->target = getFunctionName(index);
+ } else if (auto* refFunc = ref->dynCast<RefFunc>()) {
+ refFunc->func = getFunctionName(index);
+ } else {
+ WASM_UNREACHABLE("Invalid type in function references");
+ }
}
}
@@ -1869,8 +1879,8 @@ void WasmBinaryBuilder::readFunctionTableDeclaration() {
}
wasm.table.exists = true;
auto elemType = getS32LEB();
- if (elemType != BinaryConsts::EncodedType::AnyFunc) {
- throwError("ElementType must be AnyFunc in MVP");
+ if (elemType != BinaryConsts::EncodedType::funcref) {
+ throwError("ElementType must be funcref in MVP");
}
bool is_shared;
getResizableLimits(
@@ -2117,7 +2127,8 @@ BinaryConsts::ASTNodes WasmBinaryBuilder::readExpression(Expression*& curr) {
visitGlobalSet((curr = allocator.alloc<GlobalSet>())->cast<GlobalSet>());
break;
case BinaryConsts::Select:
- visitSelect((curr = allocator.alloc<Select>())->cast<Select>());
+ case BinaryConsts::SelectWithType:
+ visitSelect((curr = allocator.alloc<Select>())->cast<Select>(), code);
break;
case BinaryConsts::Return:
visitReturn((curr = allocator.alloc<Return>())->cast<Return>());
@@ -2137,6 +2148,15 @@ BinaryConsts::ASTNodes WasmBinaryBuilder::readExpression(Expression*& curr) {
case BinaryConsts::Catch:
curr = nullptr;
break;
+ case BinaryConsts::RefNull:
+ visitRefNull((curr = allocator.alloc<RefNull>())->cast<RefNull>());
+ break;
+ case BinaryConsts::RefIsNull:
+ visitRefIsNull((curr = allocator.alloc<RefIsNull>())->cast<RefIsNull>());
+ break;
+ case BinaryConsts::RefFunc:
+ visitRefFunc((curr = allocator.alloc<RefFunc>())->cast<RefFunc>());
+ break;
case BinaryConsts::Try:
visitTry((curr = allocator.alloc<Try>())->cast<Try>());
break;
@@ -2510,7 +2530,7 @@ void WasmBinaryBuilder::visitCall(Call* curr) {
curr->operands[num - i - 1] = popNonVoidExpression();
}
curr->type = sig.results;
- functionCalls[index].push_back(curr); // we don't know function names yet
+ functionRefs[index].push_back(curr); // we don't know function names yet
curr->finalize();
}
@@ -4326,12 +4346,24 @@ bool WasmBinaryBuilder::maybeVisitSIMDLoad(Expression*& out, uint32_t code) {
return true;
}
-void WasmBinaryBuilder::visitSelect(Select* curr) {
- BYN_TRACE("zz node: Select\n");
+void WasmBinaryBuilder::visitSelect(Select* curr, uint8_t code) {
+ BYN_TRACE("zz node: Select, code " << int32_t(code) << std::endl);
+ if (code == BinaryConsts::SelectWithType) {
+ size_t numTypes = getU32LEB();
+ std::vector<Type> types;
+ for (size_t i = 0; i < numTypes; i++) {
+ types.push_back(getType());
+ }
+ curr->type = Type(types);
+ }
curr->condition = popNonVoidExpression();
curr->ifFalse = popNonVoidExpression();
curr->ifTrue = popNonVoidExpression();
- curr->finalize();
+ if (code == BinaryConsts::SelectWithType) {
+ curr->finalize(curr->type);
+ } else {
+ curr->finalize();
+ }
}
void WasmBinaryBuilder::visitReturn(Return* curr) {
@@ -4383,6 +4415,27 @@ void WasmBinaryBuilder::visitDrop(Drop* curr) {
curr->finalize();
}
+void WasmBinaryBuilder::visitRefNull(RefNull* curr) {
+ BYN_TRACE("zz node: RefNull\n");
+ curr->finalize();
+}
+
+void WasmBinaryBuilder::visitRefIsNull(RefIsNull* curr) {
+ BYN_TRACE("zz node: RefIsNull\n");
+ curr->value = popNonVoidExpression();
+ curr->finalize();
+}
+
+void WasmBinaryBuilder::visitRefFunc(RefFunc* curr) {
+ BYN_TRACE("zz node: RefFunc\n");
+ Index index = getU32LEB();
+ if (index >= functionImports.size() + functionSignatures.size()) {
+ throwError("ref.func: invalid call index");
+ }
+ functionRefs[index].push_back(curr); // we don't know function names yet
+ curr->finalize();
+}
+
void WasmBinaryBuilder::visitTry(Try* curr) {
BYN_TRACE("zz node: Try\n");
// For simplicity of implementation, like if scopes, we create a hidden block
diff --git a/src/wasm/wasm-s-parser.cpp b/src/wasm/wasm-s-parser.cpp
index 20aff2091..3b12c4346 100644
--- a/src/wasm/wasm-s-parser.cpp
+++ b/src/wasm/wasm-s-parser.cpp
@@ -850,16 +850,22 @@ Type SExpressionWasmBuilder::stringToType(const char* str,
return v128;
}
}
+ if (strncmp(str, "funcref", 7) == 0 && (prefix || str[7] == 0)) {
+ return funcref;
+ }
if (strncmp(str, "anyref", 6) == 0 && (prefix || str[6] == 0)) {
return anyref;
}
+ if (strncmp(str, "nullref", 7) == 0 && (prefix || str[7] == 0)) {
+ return nullref;
+ }
if (strncmp(str, "exnref", 6) == 0 && (prefix || str[6] == 0)) {
return exnref;
}
if (allowError) {
return none;
}
- throw ParseException("invalid wasm type");
+ throw ParseException(std::string("invalid wasm type: ") + str);
}
Type SExpressionWasmBuilder::stringToLaneType(const char* str) {
@@ -936,10 +942,16 @@ Expression* SExpressionWasmBuilder::makeUnary(Element& s, UnaryOp op) {
Expression* SExpressionWasmBuilder::makeSelect(Element& s) {
auto ret = allocator.alloc<Select>();
- 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;
}
@@ -1718,6 +1730,27 @@ Expression* SExpressionWasmBuilder::makeReturn(Element& s) {
return ret;
}
+Expression* SExpressionWasmBuilder::makeRefNull(Element& s) {
+ auto ret = allocator.alloc<RefNull>();
+ ret->finalize();
+ return ret;
+}
+
+Expression* SExpressionWasmBuilder::makeRefIsNull(Element& s) {
+ auto ret = allocator.alloc<RefIsNull>();
+ ret->value = parseExpression(s[1]);
+ ret->finalize();
+ return ret;
+}
+
+Expression* SExpressionWasmBuilder::makeRefFunc(Element& s) {
+ auto func = getFunctionName(*s[1]);
+ auto ret = allocator.alloc<RefFunc>();
+ 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 593214838..22d6a0036 100644
--- a/src/wasm/wasm-stack.cpp
+++ b/src/wasm/wasm-stack.cpp
@@ -147,8 +147,10 @@ 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 funcref:
+ case anyref:
+ case nullref:
+ case exnref:
case none:
WASM_UNREACHABLE("unexpected type");
}
@@ -247,8 +249,10 @@ 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 funcref:
+ case anyref:
+ case nullref:
+ case exnref:
case none:
case unreachable:
WASM_UNREACHABLE("unexpected type");
@@ -642,8 +646,10 @@ void BinaryInstWriter::visitConst(Const* curr) {
}
break;
}
- case anyref: // there's no anyref.const
- case exnref: // there's no exnref.const
+ case funcref:
+ case anyref:
+ case nullref:
+ case exnref:
case none:
case unreachable:
WASM_UNREACHABLE("unexpected type");
@@ -1541,7 +1547,15 @@ void BinaryInstWriter::visitBinary(Binary* curr) {
}
void BinaryInstWriter::visitSelect(Select* curr) {
- o << int8_t(BinaryConsts::Select);
+ if (curr->type.isRef()) {
+ o << int8_t(BinaryConsts::SelectWithType) << U32LEB(curr->type.size());
+ for (size_t i = 0; i < curr->type.size(); i++) {
+ o << binaryType(curr->type != Type::unreachable ? curr->type
+ : Type::none);
+ }
+ } else {
+ o << int8_t(BinaryConsts::Select);
+ }
}
void BinaryInstWriter::visitReturn(Return* curr) {
@@ -1562,6 +1576,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);
@@ -1659,11 +1686,21 @@ 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;
}
index += numLocalsByType[anyref];
+ if (type == nullref) {
+ mappedLocals[i] = index + currLocalsByType[nullref] - 1;
+ continue;
+ }
+ index += numLocalsByType[nullref];
if (type == exnref) {
mappedLocals[i] = index + currLocalsByType[exnref] - 1;
continue;
@@ -1671,11 +1708,12 @@ void BinaryInstWriter::mapLocalsAndEmitHeader() {
WASM_UNREACHABLE("unexpected type");
}
// 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[nullref] ? 1 : 0) +
+ (numLocalsByType[exnref] ? 1 : 0));
if (numLocalsByType[i32]) {
o << U32LEB(numLocalsByType[i32]) << binaryType(i32);
}
@@ -1691,9 +1729,15 @@ 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);
}
+ if (numLocalsByType[nullref]) {
+ o << U32LEB(numLocalsByType[nullref]) << binaryType(nullref);
+ }
if (numLocalsByType[exnref]) {
o << U32LEB(numLocalsByType[exnref]) << binaryType(exnref);
}
@@ -1760,7 +1804,7 @@ StackInst* StackIRGenerator::makeStackInst(StackInst::Op op,
// type.
stackType = none;
} else if (op != StackInst::BlockEnd && op != StackInst::IfEnd &&
- op != StackInst::LoopEnd) {
+ op != StackInst::LoopEnd && op != StackInst::TryEnd) {
// If a concrete type is returned, we mark the end of the construct has
// having that type (as it is pushed to the value stack at that point),
// other parts are marked as none).
@@ -1781,13 +1825,15 @@ void StackIRToBinaryWriter::write() {
case StackInst::Basic:
case StackInst::BlockBegin:
case StackInst::IfBegin:
- case StackInst::LoopBegin: {
+ case StackInst::LoopBegin:
+ case StackInst::TryBegin: {
writer.visit(inst->origin);
break;
}
case StackInst::BlockEnd:
case StackInst::IfEnd:
- case StackInst::LoopEnd: {
+ case StackInst::LoopEnd:
+ case StackInst::TryEnd: {
writer.emitScopeEnd();
break;
}
diff --git a/src/wasm/wasm-type.cpp b/src/wasm/wasm-type.cpp
index 939ee8c93..62c30d1e0 100644
--- a/src/wasm/wasm-type.cpp
+++ b/src/wasm/wasm-type.cpp
@@ -62,7 +62,9 @@ std::vector<std::unique_ptr<std::vector<Type>>> 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<std::vector<Type>, 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},
};
@@ -154,8 +158,10 @@ unsigned Type::getByteSize() const {
return 8;
case Type::v128:
return 16;
- case Type::anyref: // anyref type is opaque
- case Type::exnref: // exnref type is opaque
+ case Type::funcref:
+ case Type::anyref:
+ case Type::nullref:
+ case Type::exnref:
case Type::none:
case Type::unreachable:
WASM_UNREACHABLE("invalid type");
@@ -164,7 +170,7 @@ unsigned Type::getByteSize() const {
}
Type Type::reinterpret() const {
- assert(isSingle() && "reinterpret only works with single types");
+ assert(isSingle() && "reinterpretType only works with single types");
Type singleType = *expand().begin();
switch (singleType) {
case Type::i32:
@@ -176,7 +182,9 @@ Type Type::reinterpret() const {
case Type::f64:
return i64;
case Type::v128:
+ case Type::funcref:
case Type::anyref:
+ case Type::nullref:
case Type::exnref:
case Type::none:
case Type::unreachable:
@@ -221,6 +229,39 @@ Type Type::get(unsigned byteSize, bool float_) {
WASM_UNREACHABLE("invalid size");
}
+bool Type::Type::isSubType(Type left, Type right) {
+ if (left == right) {
+ return true;
+ }
+ if (left.isRef() && right.isRef() &&
+ (right == Type::anyref || left == Type::nullref)) {
+ return true;
+ }
+ return false;
+}
+
+Type Type::Type::getLeastUpperBound(Type a, Type b) {
+ if (a == b) {
+ return a;
+ }
+ if (a == Type::unreachable) {
+ return b;
+ }
+ if (b == Type::unreachable) {
+ return a;
+ }
+ if (!a.isRef() || !b.isRef()) {
+ return none; // a poison value that must not be consumed
+ }
+ if (a == Type::nullref) {
+ return b;
+ }
+ if (b == Type::nullref) {
+ return a;
+ }
+ return Type::anyref;
+}
+
namespace {
std::ostream&
@@ -280,9 +321,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;
diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp
index 55e115d95..7bf51c5f7 100644
--- a/src/wasm/wasm-validator.cpp
+++ b/src/wasm/wasm-validator.cpp
@@ -21,6 +21,7 @@
#include "ir/branch-utils.h"
#include "ir/features.h"
+#include "ir/global-utils.h"
#include "ir/module-utils.h"
#include "ir/utils.h"
#include "support/colors.h"
@@ -181,6 +182,31 @@ struct ValidationInfo {
fail(text, curr, func);
}
}
+
+ // Type 'left' should be a subtype of 'right'.
+ bool shouldBeSubType(Type left,
+ Type right,
+ Expression* curr,
+ const char* text,
+ Function* func = nullptr) {
+ if (Type::isSubType(left, right)) {
+ return true;
+ }
+ fail(text, curr, func);
+ return false;
+ }
+
+ // Type 'left' should be a subtype of 'right', or unreachable.
+ bool shouldBeSubTypeOrUnreachable(Type left,
+ Type right,
+ Expression* curr,
+ const char* text,
+ Function* func = nullptr) {
+ if (left == Type::unreachable) {
+ return true;
+ }
+ return shouldBeSubType(left, right, curr, text, func);
+ }
};
struct FunctionValidator : public WalkerPass<PostWalker<FunctionValidator>> {
@@ -210,7 +236,7 @@ struct FunctionValidator : public WalkerPass<PostWalker<FunctionValidator>> {
std::unordered_map<Name, BreakInfo> breakInfos;
- Type returnType = unreachable; // type used in returns
+ std::set<Type> returnTypes; // types used in returns
// Binaryen IR requires that label names must be unique - IR generators must
// ensure that
@@ -287,6 +313,8 @@ public:
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 +355,19 @@ private:
return info.shouldBeIntOrUnreachable(ty, curr, text, getFunction());
}
+ bool
+ shouldBeSubType(Type left, Type right, Expression* curr, const char* text) {
+ return info.shouldBeSubType(left, right, curr, text, getFunction());
+ }
+
+ bool shouldBeSubTypeOrUnreachable(Type left,
+ Type right,
+ Expression* curr,
+ const char* text) {
+ return info.shouldBeSubTypeOrUnreachable(
+ 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 +405,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,
+ shouldBeSubType(
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");
+ shouldBeSubType(
+ 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 +455,9 @@ void FunctionValidator::visitBlock(Block* curr) {
"not flow out a value");
} else {
if (backType.isConcrete()) {
- shouldBeEqual(
- curr->type,
+ shouldBeSubType(
backType,
+ curr->type,
curr,
"block with value and last element with value must match types");
} else {
@@ -457,6 +492,23 @@ 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<Block>()) {
+ 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 {
+ shouldBeSubTypeOrUnreachable(curr->body->type,
+ curr->type,
+ curr,
+ "loop with value and body must match types");
+ }
+ }
}
void FunctionValidator::visitIf(If* curr) {
@@ -476,12 +528,12 @@ void FunctionValidator::visitIf(If* curr) {
}
} else {
if (curr->type != unreachable) {
- shouldBeEqualOrFirstIsUnreachable(
+ shouldBeSubTypeOrUnreachable(
curr->ifTrue->type,
curr->type,
curr,
"returning if-else's true must have right type");
- shouldBeEqualOrFirstIsUnreachable(
+ shouldBeSubTypeOrUnreachable(
curr->ifFalse->type,
curr->type,
curr,
@@ -499,25 +551,16 @@ 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");
+ shouldBeSubType(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");
+ shouldBeSubType(curr->ifFalse->type,
+ curr->type,
+ curr,
+ "if type must match concrete ifFalse");
}
}
}
@@ -545,13 +588,7 @@ void FunctionValidator::noteBreak(Name name, Type valueType, Expression* curr) {
if (!info.hasBeenSet()) {
info = BreakInfo(valueType, arity);
} else {
- 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 = Type::getLeastUpperBound(info.type, valueType);
if (arity != info.arity) {
info.arity = BreakInfo::PoisonArity;
}
@@ -600,10 +637,10 @@ void FunctionValidator::visitCall(Call* curr) {
return;
}
for (size_t i = 0; i < curr->operands.size(); i++) {
- if (!shouldBeEqualOrFirstIsUnreachable(curr->operands[i]->type,
- params[i],
- curr,
- "call param types must match") &&
+ if (!shouldBeSubTypeOrUnreachable(curr->operands[i]->type,
+ params[i],
+ curr,
+ "call param types must match") &&
!info.quiet) {
getStream() << "(on argument " << i << ")\n";
}
@@ -653,10 +690,10 @@ void FunctionValidator::visitCallIndirect(CallIndirect* curr) {
return;
}
for (size_t i = 0; i < curr->operands.size(); i++) {
- if (!shouldBeEqualOrFirstIsUnreachable(curr->operands[i]->type,
- params[i],
- curr,
- "call param types must match") &&
+ if (!shouldBeSubTypeOrUnreachable(curr->operands[i]->type,
+ params[i],
+ curr,
+ "call param types must match") &&
!info.quiet) {
getStream() << "(on argument " << i << ")\n";
}
@@ -723,10 +760,10 @@ void FunctionValidator::visitLocalSet(LocalSet* curr) {
curr,
"local.set type must be correct");
}
- shouldBeEqual(curr->value->type,
- getFunction()->getLocalType(curr->index),
- curr,
- "local.set's value type must be correct");
+ shouldBeSubType(curr->value->type,
+ getFunction()->getLocalType(curr->index),
+ curr,
+ "local.set's value type must be correct");
}
}
}
@@ -750,10 +787,10 @@ 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");
+ shouldBeSubTypeOrUnreachable(curr->value->type,
+ global->type,
+ curr,
+ "global.set value must have right type");
}
}
@@ -1182,12 +1219,14 @@ 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("unexpected type");
case unreachable:
break;
+ case funcref:
+ case anyref:
+ case nullref:
+ case exnref:
+ case none:
+ WASM_UNREACHABLE("unexpected type");
}
}
@@ -1616,15 +1655,18 @@ 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(Type::isSubType(curr->ifTrue->type, curr->type),
+ curr,
+ "select's left expression must be subtype of select's type");
+ shouldBeTrue(Type::isSubType(curr->ifFalse->type, curr->type),
+ curr,
+ "select's right expression must be subtype of select's type");
}
}
@@ -1636,16 +1678,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 : Type::none);
}
void FunctionValidator::visitHost(Host* curr) {
@@ -1668,32 +1701,37 @@ void FunctionValidator::visitHost(Host* curr) {
}
}
+void FunctionValidator::visitRefIsNull(RefIsNull* curr) {
+ shouldBeTrue(curr->value->type == Type::unreachable ||
+ curr->value->type.isRef(),
+ curr->value,
+ "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(
- curr->body->type,
- curr->type,
- curr->body,
- "try's type does not match try body's type");
- shouldBeEqualOrFirstIsUnreachable(
- curr->catchBody->type,
- curr->type,
- curr->catchBody,
- "try's type does not match catch's body type");
- }
- 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");
+ shouldBeSubTypeOrUnreachable(curr->body->type,
+ curr->type,
+ curr->body,
+ "try's type does not match try body's type");
+ shouldBeSubTypeOrUnreachable(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");
}
}
@@ -1727,10 +1765,10 @@ 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");
+ shouldBeSubType(curr->exnref->type,
+ Type::exnref,
+ curr->exnref,
+ "rethrow's argument must be exnref type or its subtype");
}
void FunctionValidator::visitBrOnExn(BrOnExn* curr) {
@@ -1740,10 +1778,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");
+ shouldBeSubTypeOrUnreachable(
+ curr->exnref->type,
+ 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,
@@ -1779,21 +1818,22 @@ 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->sig.results,
- curr->body->type,
- curr->body,
- "function body type must match, if function returns");
- }
- if (returnType != unreachable) {
- shouldBeEqual(curr->sig.results,
- returnType,
- curr->body,
- "function result must match, if function has returns");
+ shouldBeSubTypeOrUnreachable(
+ curr->body->type,
+ curr->sig.results,
+ curr->body,
+ "function body type must match, if function returns");
+ for (Type returnType : returnTypes) {
+ shouldBeSubTypeOrUnreachable(
+ returnType,
+ curr->sig.results,
+ curr->body,
+ "function result must match, if function has returns");
}
+
shouldBeTrue(
breakInfos.empty(), curr->body, "all named break targets must exist");
- returnType = unreachable;
+ returnTypes.clear();
labelNames.clear();
// validate optional local names
std::set<Name> seen;
@@ -1858,8 +1898,10 @@ 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 funcref:
+ case anyref:
+ case nullref:
+ case exnref:
case none:
WASM_UNREACHABLE("invalid type");
}
@@ -1890,7 +1932,8 @@ static void validateBinaryenIR(Module& wasm, ValidationInfo& info) {
//
// The block has an added type, not derived from the ast itself, so it
// is ok for it to be either i32 or unreachable.
- if (!(oldType.isConcrete() && newType == unreachable)) {
+ if (!Type::isSubType(newType, oldType) &&
+ !(oldType.isConcrete() && newType == Type::unreachable)) {
std::ostringstream ss;
ss << "stale type found in " << scope << " on " << curr
<< "\n(marked as " << oldType << ", should be " << newType
@@ -2011,13 +2054,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<Const>() || curr->init->is<GlobalGet>(),
+ info.shouldBeTrue(GlobalUtils::canInitializeGlobal(curr->init),
curr->name,
"global init must be valid");
- if (!info.shouldBeEqual(curr->type,
- curr->init->type,
- curr->init,
- "global init must have correct type") &&
+
+ if (!info.shouldBeSubType(curr->init->type,
+ curr->type,
+ curr->init,
+ "global init must have correct type") &&
!info.quiet) {
info.getStream(nullptr) << "(on global " << curr->name << ")\n";
}
@@ -2118,9 +2162,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 ff1295bad..11d203835 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("invalid expr id");
@@ -187,6 +193,18 @@ const char* getExpressionName(Expression* curr) {
WASM_UNREACHABLE("invalid expr id");
}
+Literal getLiteralFromConstExpression(Expression* curr) {
+ if (auto* c = curr->dynCast<Const>()) {
+ return c->value;
+ } else if (curr->is<RefNull>()) {
+ return Literal::makeNullref();
+ } else if (auto* r = curr->dynCast<RefFunc>()) {
+ return Literal::makeFuncref(r->func);
+ } else {
+ WASM_UNREACHABLE("Not a constant expression");
+ }
+}
+
// core AST type checking
struct TypeSeeker : public PostWalker<TypeSeeker> {
@@ -248,27 +266,6 @@ struct TypeSeeker : public PostWalker<TypeSeeker> {
}
};
-static Type mergeTypes(std::vector<Type>& types) {
- Type type = unreachable;
- for (auto other : types) {
- // once none, stop. it then indicates a poison value, that must not be
- // consumed and ignore unreachable
- if (type != none) {
- if (other == none) {
- type = none;
- } else if (other != unreachable) {
- if (type == unreachable) {
- type = other;
- } else if (type != other) {
- // poison value, we saw multiple types; this should not be consumed
- type = none;
- }
- }
- }
- }
- return type;
-}
-
// a block is unreachable if one of its elements is unreachable,
// and there are no branches to it
static void handleUnreachable(Block* block,
@@ -336,7 +333,7 @@ void Block::finalize() {
}
TypeSeeker seeker(this, this->name);
- type = mergeTypes(seeker.types);
+ type = Type::mergeTypes(seeker.types);
handleUnreachable(this);
}
@@ -364,19 +361,8 @@ void If::finalize(Type type_) {
}
void If::finalize() {
- if (ifFalse) {
- if (ifTrue->type == ifFalse->type) {
- type = ifTrue->type;
- } else if (ifTrue->type.isConcrete() && ifFalse->type == unreachable) {
- type = ifTrue->type;
- } else if (ifFalse->type.isConcrete() && ifTrue->type == unreachable) {
- type = ifFalse->type;
- } else {
- type = none;
- }
- } else {
- type = none; // if without else
- }
+ type = ifFalse ? Type::getLeastUpperBound(ifTrue->type, ifFalse->type)
+ : Type::none;
// if the arms return a value, leave it even if the condition
// is unreachable, we still mark ourselves as having that type, e.g.
// (if (result i32)
@@ -828,13 +814,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 = Type::getLeastUpperBound(ifTrue->type, ifFalse->type);
}
}
@@ -864,16 +852,20 @@ void Host::finalize() {
}
}
-void Try::finalize() {
- if (body->type == catchBody->type) {
- type = body->type;
- } else if (body->type.isConcrete() && catchBody->type == unreachable) {
- type = body->type;
- } else if (catchBody->type.isConcrete() && body->type == unreachable) {
- type = catchBody->type;
- } else {
- type = none;
+void RefNull::finalize() { type = Type::nullref; }
+
+void RefIsNull::finalize() {
+ if (value->type == Type::unreachable) {
+ type = Type::unreachable;
+ return;
}
+ type = Type::i32;
+}
+
+void RefFunc::finalize() { type = Type::funcref; }
+
+void Try::finalize() {
+ type = Type::getLeastUpperBound(body->type, catchBody->type);
}
void Try::finalize(Type type_) {
diff --git a/src/wasm2js.h b/src/wasm2js.h
index 2cacbe8e5..1adde23b8 100644
--- a/src/wasm2js.h
+++ b/src/wasm2js.h
@@ -1848,6 +1848,18 @@ Ref Wasm2JSBuilder::processFunctionBody(Module* m,
unimplemented(curr);
WASM_UNREACHABLE("unimp");
}
+ Ref visitRefNull(RefNull* curr) {
+ unimplemented(curr);
+ WASM_UNREACHABLE("unimp");
+ }
+ Ref visitRefIsNull(RefIsNull* curr) {
+ unimplemented(curr);
+ WASM_UNREACHABLE("unimp");
+ }
+ Ref visitRefFunc(RefFunc* curr) {
+ unimplemented(curr);
+ WASM_UNREACHABLE("unimp");
+ }
Ref visitTry(Try* curr) {
unimplemented(curr);
WASM_UNREACHABLE("unimp");
diff --git a/test/anyref.wast b/test/anyref.wast
deleted file mode 100644
index d617d3f42..000000000
--- 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/binaryen.js/exception-handling.js b/test/binaryen.js/exception-handling.js
index 6a1b32ed7..5ee53667c 100644
--- a/test/binaryen.js/exception-handling.js
+++ b/test/binaryen.js/exception-handling.js
@@ -18,7 +18,8 @@ function stringify(expr) {
function test() {
var module = new Binaryen.Module();
- module.setFeatures(Binaryen.Features.ExceptionHandling);
+ module.setFeatures(Binaryen.Features.ReferenceTypes |
+ Binaryen.Features.ExceptionHandling);
var event_ = module.addEvent("e", 0, Binaryen.i32, Binaryen.none);
diff --git a/test/binaryen.js/exception-handling.js.txt b/test/binaryen.js/exception-handling.js.txt
index 55f6422af..11486ab11 100644
--- a/test/binaryen.js/exception-handling.js.txt
+++ b/test/binaryen.js/exception-handling.js.txt
@@ -26,7 +26,7 @@
)
)
-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":1,"event":"e"}
+getExpressionInfo(br_on_exn) = {"id":46,"type":10,"name":"l","event":"e"}
+getExpressionInfo(rethrow) = {"id":45,"type":1}
+getExpressionInfo(try) = {"id":43,"type":0}
diff --git a/test/binaryen.js/kitchen-sink.js b/test/binaryen.js/kitchen-sink.js
index a44cd9116..ac101c93d 100644
--- a/test/binaryen.js/kitchen-sink.js
+++ b/test/binaryen.js/kitchen-sink.js
@@ -484,6 +484,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) ], iIfF, Binaryen.i32),
+ // 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)]),
@@ -530,6 +535,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 b08dbfdfb..7e0615ffd 100644
--- a/test/binaryen.js/kitchen-sink.js.txt
+++ b/test/binaryen.js/kitchen-sink.js.txt
@@ -22,7 +22,7 @@ int main() {
expressions[6] = BinaryenConst(the_module, BinaryenLiteralFloat64(NAN));
{
BinaryenType t0[] = {2, 3, 4, 5};
- BinaryenTypeCreate(t0, 4); // 9
+ BinaryenTypeCreate(t0, 4); // 11
}
expressions[7] = BinaryenConst(the_module, BinaryenLiteralInt32(1));
expressions[8] = BinaryenConst(the_module, BinaryenLiteralInt32(2));
@@ -1591,7 +1591,7 @@ int main() {
expressions[737] = BinaryenConst(the_module, BinaryenLiteralFloat64(3.7));
{
BinaryenExpressionRef operands[] = { expressions[734], expressions[735], expressions[736], expressions[737] };
- expressions[738] = BinaryenCallIndirect(the_module, expressions[733], operands, 4, 9, 2);
+ expressions[738] = BinaryenCallIndirect(the_module, expressions[733], operands, 4, 11, 2);
}
expressions[739] = BinaryenUnary(the_module, 20, expressions[738]);
expressions[740] = BinaryenLocalGet(the_module, 0, 2);
@@ -1611,7 +1611,7 @@ int main() {
expressions[754] = BinaryenLoad(the_module, 8, 1, 2, 8, 5, expressions[753]);
expressions[755] = BinaryenStore(the_module, 4, 0, 0, expressions[19], expressions[20], 2);
expressions[756] = BinaryenStore(the_module, 8, 2, 4, expressions[21], expressions[22], 3);
- expressions[757] = BinaryenSelect(the_module, expressions[16], expressions[17], expressions[18]);
+ expressions[757] = BinaryenSelect(the_module, expressions[16], expressions[17], expressions[18], BinaryenTypeAuto());
expressions[758] = BinaryenConst(the_module, BinaryenLiteralInt32(1337));
expressions[759] = BinaryenReturn(the_module, expressions[758]);
expressions[760] = BinaryenConst(the_module, BinaryenLiteralInt32(13));
@@ -1629,58 +1629,69 @@ int main() {
expressions[769] = BinaryenConst(the_module, BinaryenLiteralFloat64(3.7));
{
BinaryenExpressionRef operands[] = { expressions[766], expressions[767], expressions[768], expressions[769] };
- expressions[770] = BinaryenReturnCallIndirect(the_module, expressions[765], operands, 4, 9, 2);
- }
- expressions[771] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
- {
- BinaryenExpressionRef operands[] = { expressions[771] };
- expressions[772] = BinaryenThrow(the_module, "a-event", operands, 1);
- }
- expressions[773] = BinaryenPop(the_module, 8);
- expressions[774] = BinaryenLocalSet(the_module, 5, expressions[773]);
- expressions[775] = BinaryenLocalGet(the_module, 5, 8);
- expressions[776] = BinaryenBrOnExn(the_module, "try-block", "a-event", expressions[775]);
- expressions[777] = BinaryenRethrow(the_module, expressions[776]);
- {
- BinaryenExpressionRef children[] = { expressions[777] };
- expressions[778] = BinaryenBlock(the_module, "try-block", children, 1, 2);
- }
- expressions[779] = BinaryenDrop(the_module, expressions[778]);
- {
- BinaryenExpressionRef children[] = { expressions[774], expressions[779] };
- expressions[780] = BinaryenBlock(the_module, NULL, children, 2, 0);
- }
- expressions[781] = BinaryenTry(the_module, expressions[772], expressions[780]);
- expressions[782] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
- expressions[783] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
- expressions[784] = BinaryenAtomicLoad(the_module, 4, 0, 2, expressions[783]);
- expressions[785] = BinaryenAtomicStore(the_module, 4, 0, expressions[782], expressions[784], 2);
- expressions[786] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
- expressions[787] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
- expressions[788] = BinaryenConst(the_module, BinaryenLiteralInt64(0));
- expressions[789] = BinaryenAtomicWait(the_module, expressions[786], expressions[787], expressions[788], 2);
- expressions[790] = BinaryenDrop(the_module, expressions[789]);
- expressions[791] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
- expressions[792] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
- expressions[793] = BinaryenAtomicNotify(the_module, expressions[791], expressions[792]);
- expressions[794] = BinaryenDrop(the_module, expressions[793]);
- expressions[795] = BinaryenAtomicFence(the_module);
- expressions[796] = BinaryenPop(the_module, 2);
- expressions[797] = BinaryenPush(the_module, expressions[796]);
- expressions[798] = BinaryenPop(the_module, 3);
- expressions[799] = BinaryenPush(the_module, expressions[798]);
- expressions[800] = BinaryenPop(the_module, 4);
- expressions[801] = BinaryenPush(the_module, expressions[800]);
- expressions[802] = BinaryenPop(the_module, 5);
- expressions[803] = BinaryenPush(the_module, expressions[802]);
- expressions[804] = BinaryenPop(the_module, 6);
- expressions[805] = BinaryenPush(the_module, expressions[804]);
- expressions[806] = BinaryenPop(the_module, 7);
- expressions[807] = BinaryenPush(the_module, expressions[806]);
- expressions[808] = BinaryenPop(the_module, 8);
- expressions[809] = BinaryenPush(the_module, expressions[808]);
- expressions[810] = BinaryenNop(the_module);
- expressions[811] = BinaryenUnreachable(the_module);
+ expressions[770] = BinaryenReturnCallIndirect(the_module, expressions[765], operands, 4, 11, 2);
+ }
+ expressions[771] = BinaryenRefNull(the_module);
+ expressions[772] = BinaryenRefIsNull(the_module, expressions[771]);
+ expressions[773] = BinaryenRefFunc(the_module, "kitchen()sinker");
+ expressions[774] = BinaryenRefIsNull(the_module, expressions[773]);
+ expressions[775] = BinaryenRefNull(the_module);
+ expressions[776] = BinaryenRefFunc(the_module, "kitchen()sinker");
+ expressions[777] = BinaryenSelect(the_module, expressions[16], expressions[775], expressions[776], 7);
+ expressions[778] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
+ {
+ BinaryenExpressionRef operands[] = { expressions[778] };
+ expressions[779] = BinaryenThrow(the_module, "a-event", operands, 1);
+ }
+ expressions[780] = BinaryenPop(the_module, 10);
+ expressions[781] = BinaryenLocalSet(the_module, 5, expressions[780]);
+ expressions[782] = BinaryenLocalGet(the_module, 5, 10);
+ expressions[783] = BinaryenBrOnExn(the_module, "try-block", "a-event", expressions[782]);
+ expressions[784] = BinaryenRethrow(the_module, expressions[783]);
+ {
+ BinaryenExpressionRef children[] = { expressions[784] };
+ expressions[785] = BinaryenBlock(the_module, "try-block", children, 1, 2);
+ }
+ expressions[786] = BinaryenDrop(the_module, expressions[785]);
+ {
+ BinaryenExpressionRef children[] = { expressions[781], expressions[786] };
+ expressions[787] = BinaryenBlock(the_module, NULL, children, 2, 0);
+ }
+ expressions[788] = BinaryenTry(the_module, expressions[779], expressions[787]);
+ expressions[789] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
+ expressions[790] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
+ expressions[791] = BinaryenAtomicLoad(the_module, 4, 0, 2, expressions[790]);
+ expressions[792] = BinaryenAtomicStore(the_module, 4, 0, expressions[789], expressions[791], 2);
+ expressions[793] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
+ expressions[794] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
+ expressions[795] = BinaryenConst(the_module, BinaryenLiteralInt64(0));
+ expressions[796] = BinaryenAtomicWait(the_module, expressions[793], expressions[794], expressions[795], 2);
+ expressions[797] = BinaryenDrop(the_module, expressions[796]);
+ expressions[798] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
+ expressions[799] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
+ expressions[800] = BinaryenAtomicNotify(the_module, expressions[798], expressions[799]);
+ expressions[801] = BinaryenDrop(the_module, expressions[800]);
+ expressions[802] = BinaryenAtomicFence(the_module);
+ expressions[803] = BinaryenPop(the_module, 2);
+ expressions[804] = BinaryenPush(the_module, expressions[803]);
+ expressions[805] = BinaryenPop(the_module, 3);
+ expressions[806] = BinaryenPush(the_module, expressions[805]);
+ expressions[807] = BinaryenPop(the_module, 4);
+ expressions[808] = BinaryenPush(the_module, expressions[807]);
+ expressions[809] = BinaryenPop(the_module, 5);
+ expressions[810] = BinaryenPush(the_module, expressions[809]);
+ expressions[811] = BinaryenPop(the_module, 6);
+ expressions[812] = BinaryenPush(the_module, expressions[811]);
+ expressions[813] = BinaryenPop(the_module, 8);
+ expressions[814] = BinaryenPush(the_module, expressions[813]);
+ expressions[815] = BinaryenPop(the_module, 7);
+ expressions[816] = BinaryenPush(the_module, expressions[815]);
+ expressions[817] = BinaryenPop(the_module, 9);
+ expressions[818] = BinaryenPush(the_module, expressions[817]);
+ expressions[819] = BinaryenPop(the_module, 10);
+ expressions[820] = BinaryenPush(the_module, expressions[819]);
+ expressions[821] = BinaryenNop(the_module);
+ expressions[822] = BinaryenUnreachable(the_module);
BinaryenExpressionGetId(expressions[30]);
BinaryenExpressionGetType(expressions[30]);
BinaryenUnaryGetOp(expressions[30]);
@@ -1691,26 +1702,26 @@ getExpressionInfo={"id":15,"type":4,"op":6}
(f32.const -33.61199951171875)
)
- expressions[812] = BinaryenConst(the_module, BinaryenLiteralInt32(5));
- BinaryenExpressionGetId(expressions[812]);
- BinaryenExpressionGetType(expressions[812]);
- BinaryenConstGetValueI32(expressions[812]);
+ expressions[823] = BinaryenConst(the_module, BinaryenLiteralInt32(5));
+ BinaryenExpressionGetId(expressions[823]);
+ BinaryenExpressionGetType(expressions[823]);
+ BinaryenConstGetValueI32(expressions[823]);
getExpressionInfo(i32.const)={"id":14,"type":2,"value":5}
- expressions[813] = BinaryenConst(the_module, BinaryenLiteralInt64(30064771078));
- BinaryenExpressionGetId(expressions[813]);
- BinaryenExpressionGetType(expressions[813]);
- BinaryenConstGetValueI64Low(expressions[813]);
- BinaryenConstGetValueI64High(expressions[813]);
+ expressions[824] = BinaryenConst(the_module, BinaryenLiteralInt64(30064771078));
+ BinaryenExpressionGetId(expressions[824]);
+ BinaryenExpressionGetType(expressions[824]);
+ BinaryenConstGetValueI64Low(expressions[824]);
+ BinaryenConstGetValueI64High(expressions[824]);
getExpressionInfo(i64.const)={"id":14,"type":3,"value":{"low":6,"high":7}}
- expressions[814] = BinaryenConst(the_module, BinaryenLiteralFloat32(8.5));
- BinaryenExpressionGetId(expressions[814]);
- BinaryenExpressionGetType(expressions[814]);
- BinaryenConstGetValueF32(expressions[814]);
+ expressions[825] = BinaryenConst(the_module, BinaryenLiteralFloat32(8.5));
+ BinaryenExpressionGetId(expressions[825]);
+ BinaryenExpressionGetType(expressions[825]);
+ BinaryenConstGetValueF32(expressions[825]);
getExpressionInfo(f32.const)={"id":14,"type":4,"value":8.5}
- expressions[815] = BinaryenConst(the_module, BinaryenLiteralFloat64(9.5));
- BinaryenExpressionGetId(expressions[815]);
- BinaryenExpressionGetType(expressions[815]);
- BinaryenConstGetValueF64(expressions[815]);
+ expressions[826] = BinaryenConst(the_module, BinaryenLiteralFloat64(9.5));
+ BinaryenExpressionGetId(expressions[826]);
+ BinaryenExpressionGetType(expressions[826]);
+ BinaryenConstGetValueF64(expressions[826]);
getExpressionInfo(f64.const)={"id":14,"type":5,"value":9.5}
{
BinaryenExpressionRef children[] = { expressions[24], expressions[26], expressions[28], expressions[30], expressions[32],
@@ -1761,32 +1772,33 @@ getExpressionInfo(f64.const)={"id":14,"type":5,"value":9.5}
expressions[719], expressions[721], expressions[727], expressions[732], expressions[739], expressions[741],
expressions[743], expressions[746], expressions[748], expressions[750], expressions[752], expressions[754],
expressions[755], expressions[756], expressions[757], expressions[759], expressions[764], expressions[770],
- expressions[781], expressions[785], expressions[790], expressions[794], expressions[795], expressions[797],
- expressions[799], expressions[801], expressions[803], expressions[805], expressions[807], expressions[809],
- expressions[810], expressions[811] };
- expressions[816] = BinaryenBlock(the_module, "the-value", children, 301, 0);
+ expressions[772], expressions[774], expressions[777], expressions[788], expressions[792], expressions[797],
+ expressions[801], expressions[802], expressions[804], expressions[806], expressions[808], expressions[810],
+ expressions[812], expressions[814], expressions[816], expressions[818], expressions[820], expressions[821],
+ expressions[822] };
+ expressions[827] = BinaryenBlock(the_module, "the-value", children, 306, 0);
}
- expressions[817] = BinaryenDrop(the_module, expressions[816]);
+ expressions[828] = BinaryenDrop(the_module, expressions[827]);
{
- BinaryenExpressionRef children[] = { expressions[817] };
- expressions[818] = BinaryenBlock(the_module, "the-nothing", children, 1, 0);
+ BinaryenExpressionRef children[] = { expressions[828] };
+ expressions[829] = BinaryenBlock(the_module, "the-nothing", children, 1, 0);
}
- expressions[819] = BinaryenConst(the_module, BinaryenLiteralInt32(42));
+ expressions[830] = BinaryenConst(the_module, BinaryenLiteralInt32(42));
{
- BinaryenExpressionRef children[] = { expressions[818], expressions[819] };
- expressions[820] = BinaryenBlock(the_module, "the-body", children, 2, 0);
+ BinaryenExpressionRef children[] = { expressions[829], expressions[830] };
+ expressions[831] = BinaryenBlock(the_module, "the-body", children, 2, 0);
}
{
- BinaryenType varTypes[] = { 2, 8 };
- functions[0] = BinaryenAddFunction(the_module, "kitchen()sinker", 9, 2, varTypes, 2, expressions[820]);
+ BinaryenType varTypes[] = { 2, 10 };
+ functions[0] = BinaryenAddFunction(the_module, "kitchen()sinker", 11, 2, varTypes, 2, expressions[831]);
}
- expressions[821] = BinaryenConst(the_module, BinaryenLiteralInt32(1));
- globals[0] = BinaryenAddGlobal(the_module, "a-global", 2, 0, expressions[821]);
+ expressions[832] = BinaryenConst(the_module, BinaryenLiteralInt32(1));
+ globals[0] = BinaryenAddGlobal(the_module, "a-global", 2, 0, expressions[832]);
{
BinaryenType t273[] = {2, 5};
- BinaryenTypeCreate(t273, 2); // 10
+ BinaryenTypeCreate(t273, 2); // 12
}
- BinaryenAddFunctionImport(the_module, "an-imported", "module", "base", 10, 4);
+ BinaryenAddFunctionImport(the_module, "an-imported", "module", "base", 12, 4);
BinaryenAddGlobalImport(the_module, "a-global-imp", "module", "base", 2, 0);
BinaryenAddGlobalImport(the_module, "a-mut-global-imp", "module", "base", 2, 1);
BinaryenAddEventImport(the_module, "a-event-imp", "module", "base", 0, 2, 0);
@@ -1802,25 +1814,25 @@ getExpressionInfo(f64.const)={"id":14,"type":5,"value":9.5}
BinaryenFunctionGetVar(functions[0], 0);
BinaryenFunctionGetVar(functions[0], 1);
BinaryenFunctionGetBody(functions[0]);
- expressions[822] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
+ expressions[833] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
{
const char* funcNames[] = { "kitchen()sinker" };
- BinaryenSetFunctionTable(the_module, 1, 4294967295, funcNames, 1, expressions[822]);
+ BinaryenSetFunctionTable(the_module, 1, 4294967295, funcNames, 1, expressions[833]);
}
- expressions[823] = BinaryenConst(the_module, BinaryenLiteralInt32(10));
+ expressions[834] = 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[823], expressions[0] };
+ BinaryenExpressionRef segmentOffsets[] = { expressions[834], expressions[0] };
BinaryenIndex segmentSizes[] = { 12, 12 };
BinaryenSetMemory(the_module, 1, 256, "mem", segments, segmentPassive, segmentOffsets, segmentSizes, 2, 1);
}
- expressions[824] = BinaryenNop(the_module);
+ expressions[835] = BinaryenNop(the_module);
{
BinaryenType varTypes[] = { 0 };
- functions[1] = BinaryenAddFunction(the_module, "starter", 0, 0, varTypes, 0, expressions[824]);
+ functions[1] = BinaryenAddFunction(the_module, "starter", 0, 0, varTypes, 0, expressions[835]);
}
BinaryenSetStart(the_module, functions[1]);
BinaryenModuleAutoDrop(the_module);
@@ -3449,6 +3461,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)
@@ -3507,6 +3536,12 @@ getExpressionInfo(f64.const)={"id":14,"type":5,"value":9.5}
(anyref.pop)
)
(push
+ (funcref.pop)
+ )
+ (push
+ (nullref.pop)
+ )
+ (push
(exnref.pop)
)
(nop)
@@ -5146,6 +5181,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)
@@ -5204,6 +5256,12 @@ getExpressionInfo(f64.const)={"id":14,"type":5,"value":9.5}
(anyref.pop)
)
(push
+ (funcref.pop)
+ )
+ (push
+ (nullref.pop)
+ )
+ (push
(exnref.pop)
)
(nop)
@@ -6169,26 +6227,26 @@ optimized:
// [ 5 ]
// BinaryenTypeVec128: 6
// [ 6 ]
- // BinaryenTypeAnyref: 7
- // [ 7 ]
- // BinaryenTypeExnref: 8
+ // BinaryenTypeAnyref: 8
// [ 8 ]
+ // BinaryenTypeExnref: 10
+ // [ 10 ]
// BinaryenTypeAuto: -1
{
BinaryenType t274[] = {2, 2};
- BinaryenTypeCreate(t274, 2); // 11
+ BinaryenTypeCreate(t274, 2); // 13
}
- // 11 [ 2, 2 ]
+ // 13 [ 2, 2 ]
{
BinaryenType t275[] = {2, 2};
- BinaryenTypeCreate(t275, 2); // 11
+ BinaryenTypeCreate(t275, 2); // 13
}
- // 11 [ 2, 2 ]
+ // 13 [ 2, 2 ]
{
BinaryenType t276[] = {4, 4};
- BinaryenTypeCreate(t276, 2); // 12
+ BinaryenTypeCreate(t276, 2); // 14
}
- // 12 [ 4, 4 ]
+ // 14 [ 4, 4 ]
return 0;
}
// ending a Binaryen API trace
@@ -6206,14 +6264,14 @@ optimized:
// [ 5 ]
// BinaryenTypeVec128: 6
// [ 6 ]
- // BinaryenTypeAnyref: 7
- // [ 7 ]
- // BinaryenTypeExnref: 8
+ // BinaryenTypeAnyref: 8
// [ 8 ]
+ // BinaryenTypeExnref: 10
+ // [ 10 ]
// BinaryenTypeAuto: -1
- // 11 [ 2, 2 ]
- // 11 [ 2, 2 ]
- // 12 [ 4, 4 ]
+ // 13 [ 2, 2 ]
+ // 13 [ 2, 2 ]
+ // 14 [ 4, 4 ]
Binaryen.Features.MVP: 0
Binaryen.Features.Atomics: 1
Binaryen.Features.BulkMemory: 16
@@ -6262,10 +6320,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}
@@ -7899,6 +7957,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)
@@ -7957,6 +8032,12 @@ getExpressionInfo(f64.const)={"id":14,"type":5,"value":9.5}
(anyref.pop)
)
(push
+ (funcref.pop)
+ )
+ (push
+ (nullref.pop)
+ )
+ (push
(exnref.pop)
)
(nop)
@@ -9594,6 +9675,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)
@@ -9652,6 +9750,12 @@ getExpressionInfo(f64.const)={"id":14,"type":5,"value":9.5}
(anyref.pop)
)
(push
+ (funcref.pop)
+ )
+ (push
+ (nullref.pop)
+ )
+ (push
(exnref.pop)
)
(nop)
@@ -10174,7 +10278,7 @@ module loaded from binary form:
)
)
-[wasm-validator error in function func] i64 != i32: local.set's value type must be correct, on
+[wasm-validator error in function func] local.set's value type must be correct, on
[none] (local.set $0
[i64] (i64.const 1234)
)
diff --git a/test/binaryen.js/push-pop.js b/test/binaryen.js/push-pop.js
index 01d6e76a9..2b50b2dca 100644
--- a/test/binaryen.js/push-pop.js
+++ b/test/binaryen.js/push-pop.js
@@ -26,7 +26,9 @@ function test() {
module.push(module.f32.pop()),
module.push(module.f64.pop()),
module.push(module.v128.pop()),
+ module.push(module.funcref.pop()),
module.push(module.anyref.pop()),
+ module.push(module.nullref.pop()),
module.push(module.exnref.pop())
]
)
@@ -40,7 +42,9 @@ function test() {
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(funcref.pop) = " + stringify(module.funcref.pop()));
console.log("getExpressionInfo(anyref.pop) = " + stringify(module.anyref.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 bf4c5fd8c..00fbd58b9 100644
--- a/test/binaryen.js/push-pop.js.txt
+++ b/test/binaryen.js/push-pop.js.txt
@@ -17,9 +17,15 @@
(v128.pop)
)
(push
+ (funcref.pop)
+ )
+ (push
(anyref.pop)
)
(push
+ (nullref.pop)
+ )
+ (push
(exnref.pop)
)
)
@@ -30,6 +36,8 @@ getExpressionInfo(i64.pop) = {"id":39,"type":3}
getExpressionInfo(f32.pop) = {"id":39,"type":4}
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(funcref.pop) = {"id":39,"type":7}
+getExpressionInfo(anyref.pop) = {"id":39,"type":8}
+getExpressionInfo(nullref.pop) = {"id":39,"type":9}
+getExpressionInfo(exnref.pop) = {"id":39,"type":10}
getExpressionInfo(push) = {"id":38}
diff --git a/test/example/c-api-kitchen-sink.c b/test/example/c-api-kitchen-sink.c
index 348cb5e85..6d56ccf44 100644
--- a/test/example/c-api-kitchen-sink.c
+++ b/test/example/c-api-kitchen-sink.c
@@ -193,12 +193,24 @@ void test_types() {
BinaryenTypeExpand(v128, &valueType);
assert(valueType == v128);
+ BinaryenType funcref = BinaryenTypeFuncref();
+ printf(" // BinaryenTypeFuncref: %d\n", funcref);
+ assert(BinaryenTypeArity(funcref) == 1);
+ BinaryenTypeExpand(funcref, &valueType);
+ assert(valueType == funcref);
+
BinaryenType anyref = BinaryenTypeAnyref();
printf(" // BinaryenTypeAnyref: %d\n", anyref);
assert(BinaryenTypeArity(anyref) == 1);
BinaryenTypeExpand(anyref, &valueType);
assert(valueType == anyref);
+ BinaryenType nullref = BinaryenTypeNullref();
+ printf(" // BinaryenTypeNullref: %d\n", nullref);
+ assert(BinaryenTypeArity(nullref) == 1);
+ BinaryenTypeExpand(nullref, &valueType);
+ assert(valueType == nullref);
+
BinaryenType exnref = BinaryenTypeExnref();
printf(" // BinaryenTypeExnref: %d\n", exnref);
assert(BinaryenTypeArity(exnref) == 1);
@@ -273,6 +285,9 @@ 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 nullrefExpr = BinaryenRefNull(module);
+ BinaryenExpressionRef funcrefExpr =
+ BinaryenRefFunc(module, "kitchen()sinker");
// Events
BinaryenAddEvent(
@@ -661,7 +676,7 @@ 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(
@@ -672,6 +687,11 @@ void test_core() {
4,
iIfF,
BinaryenTypeInt32()),
+ // Reference types
+ BinaryenRefIsNull(module, nullrefExpr),
+ BinaryenRefIsNull(module, funcrefExpr),
+ BinaryenSelect(
+ module, temp10, nullrefExpr, funcrefExpr, BinaryenTypeFuncref()),
// Exception handling
BinaryenTry(module, tryBody, catchBody),
// Atomics
@@ -692,7 +712,12 @@ void test_core() {
BinaryenPush(module, BinaryenPop(module, BinaryenTypeInt64())),
BinaryenPush(module, BinaryenPop(module, BinaryenTypeFloat32())),
BinaryenPush(module, BinaryenPop(module, BinaryenTypeFloat64())),
+ BinaryenPush(module, BinaryenPop(module, BinaryenTypeFuncref())),
BinaryenPush(module, BinaryenPop(module, BinaryenTypeAnyref())),
+ BinaryenPush(module, BinaryenPop(module, BinaryenTypeNullref())),
+ BinaryenPush(module, BinaryenPop(module, BinaryenTypeExnref())),
+ BinaryenPush(module, BinaryenPop(module, BinaryenTypeFuncref())),
+ BinaryenPush(module, BinaryenPop(module, BinaryenTypeNullref())),
BinaryenPush(module, BinaryenPop(module, BinaryenTypeExnref())),
// TODO: Host
diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt
index 7cf5010f7..b64aeefc7 100644
--- a/test/example/c-api-kitchen-sink.txt
+++ b/test/example/c-api-kitchen-sink.txt
@@ -35,7 +35,7 @@ int main() {
expressions[17] = BinaryenConst(the_module, BinaryenLiteralFloat64(3.7));
{
BinaryenType t1[] = {2, 3, 4, 5};
- BinaryenTypeCreate(t1, 4); // 9
+ BinaryenTypeCreate(t1, 4); // 11
}
expressions[18] = BinaryenConst(the_module, BinaryenLiteralInt32(1));
expressions[19] = BinaryenConst(the_module, BinaryenLiteralInt32(2));
@@ -53,1723 +53,1739 @@ int main() {
expressions[31] = BinaryenConst(the_module, BinaryenLiteralInt32(11));
expressions[32] = BinaryenConst(the_module, BinaryenLiteralInt32(110));
expressions[33] = BinaryenConst(the_module, BinaryenLiteralInt64(111));
+ expressions[34] = BinaryenRefNull(the_module);
+ expressions[35] = BinaryenRefFunc(the_module, "kitchen()sinker");
BinaryenAddEvent(the_module, "a-event", 0, 2, 0);
- expressions[34] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
- {
- BinaryenExpressionRef operands[] = { expressions[34] };
- expressions[35] = BinaryenThrow(the_module, "a-event", operands, 1);
- }
- expressions[36] = BinaryenPop(the_module, 8);
- expressions[37] = BinaryenLocalSet(the_module, 5, expressions[36]);
- expressions[38] = BinaryenLocalGet(the_module, 5, 8);
- expressions[39] = BinaryenBrOnExn(the_module, "try-block", "a-event", expressions[38]);
- expressions[40] = BinaryenRethrow(the_module, expressions[39]);
- {
- BinaryenExpressionRef children[] = { expressions[40] };
- expressions[41] = BinaryenBlock(the_module, "try-block", children, 1, 2);
- }
- expressions[42] = BinaryenDrop(the_module, expressions[41]);
- {
- BinaryenExpressionRef children[] = { expressions[37], expressions[42] };
- expressions[43] = BinaryenBlock(the_module, NULL, children, 2, 0);
- }
- expressions[44] = BinaryenConst(the_module, BinaryenLiteralInt32(-10));
- expressions[45] = BinaryenUnary(the_module, 0, expressions[44]);
- expressions[46] = BinaryenConst(the_module, BinaryenLiteralInt64(-22));
- expressions[47] = BinaryenUnary(the_module, 3, expressions[46]);
- expressions[48] = BinaryenConst(the_module, BinaryenLiteralInt32(-10));
- expressions[49] = BinaryenUnary(the_module, 4, expressions[48]);
- expressions[50] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612));
- expressions[51] = BinaryenUnary(the_module, 6, expressions[50]);
- expressions[52] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84));
- expressions[53] = BinaryenUnary(the_module, 9, expressions[52]);
- expressions[54] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612));
- expressions[55] = BinaryenUnary(the_module, 10, expressions[54]);
- expressions[56] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84));
- 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[36] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
+ {
+ BinaryenExpressionRef operands[] = { expressions[36] };
+ expressions[37] = BinaryenThrow(the_module, "a-event", operands, 1);
+ }
+ expressions[38] = BinaryenPop(the_module, 10);
+ expressions[39] = BinaryenLocalSet(the_module, 5, expressions[38]);
+ expressions[40] = BinaryenLocalGet(the_module, 5, 10);
+ 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, 2);
+ }
+ 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]);
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 t2[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[144] = BinaryenConst(the_module, BinaryenLiteralVec128(t2));
+ expressions[146] = BinaryenConst(the_module, BinaryenLiteralVec128(t2));
}
- expressions[145] = BinaryenUnary(the_module, 66, expressions[144]);
+ expressions[147] = BinaryenUnary(the_module, 66, expressions[146]);
{
uint8_t t3[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[146] = BinaryenConst(the_module, BinaryenLiteralVec128(t3));
+ expressions[148] = BinaryenConst(the_module, BinaryenLiteralVec128(t3));
}
- expressions[147] = BinaryenUnary(the_module, 67, expressions[146]);
+ expressions[149] = BinaryenUnary(the_module, 67, expressions[148]);
{
uint8_t t4[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[148] = BinaryenConst(the_module, BinaryenLiteralVec128(t4));
+ expressions[150] = BinaryenConst(the_module, BinaryenLiteralVec128(t4));
}
- expressions[149] = BinaryenUnary(the_module, 68, expressions[148]);
+ expressions[151] = BinaryenUnary(the_module, 68, expressions[150]);
{
uint8_t t5[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[150] = BinaryenConst(the_module, BinaryenLiteralVec128(t5));
+ expressions[152] = BinaryenConst(the_module, BinaryenLiteralVec128(t5));
}
- expressions[151] = BinaryenUnary(the_module, 69, expressions[150]);
+ expressions[153] = BinaryenUnary(the_module, 69, expressions[152]);
{
uint8_t t6[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[152] = BinaryenConst(the_module, BinaryenLiteralVec128(t6));
+ expressions[154] = BinaryenConst(the_module, BinaryenLiteralVec128(t6));
}
- expressions[153] = BinaryenUnary(the_module, 70, expressions[152]);
+ expressions[155] = BinaryenUnary(the_module, 70, expressions[154]);
{
uint8_t t7[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[154] = BinaryenConst(the_module, BinaryenLiteralVec128(t7));
+ expressions[156] = BinaryenConst(the_module, BinaryenLiteralVec128(t7));
}
- expressions[155] = BinaryenUnary(the_module, 71, expressions[154]);
+ expressions[157] = BinaryenUnary(the_module, 71, expressions[156]);
{
uint8_t t8[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[156] = BinaryenConst(the_module, BinaryenLiteralVec128(t8));
+ expressions[158] = BinaryenConst(the_module, BinaryenLiteralVec128(t8));
}
- expressions[157] = BinaryenUnary(the_module, 72, expressions[156]);
+ expressions[159] = BinaryenUnary(the_module, 72, expressions[158]);
{
uint8_t t9[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[158] = BinaryenConst(the_module, BinaryenLiteralVec128(t9));
+ expressions[160] = BinaryenConst(the_module, BinaryenLiteralVec128(t9));
}
- expressions[159] = BinaryenUnary(the_module, 73, expressions[158]);
+ expressions[161] = BinaryenUnary(the_module, 73, expressions[160]);
{
uint8_t t10[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[160] = BinaryenConst(the_module, BinaryenLiteralVec128(t10));
+ expressions[162] = BinaryenConst(the_module, BinaryenLiteralVec128(t10));
}
- expressions[161] = BinaryenUnary(the_module, 74, expressions[160]);
+ expressions[163] = BinaryenUnary(the_module, 74, expressions[162]);
{
uint8_t t11[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[162] = BinaryenConst(the_module, BinaryenLiteralVec128(t11));
+ expressions[164] = BinaryenConst(the_module, BinaryenLiteralVec128(t11));
}
- expressions[163] = BinaryenUnary(the_module, 75, expressions[162]);
+ expressions[165] = BinaryenUnary(the_module, 75, expressions[164]);
{
uint8_t t12[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[164] = BinaryenConst(the_module, BinaryenLiteralVec128(t12));
+ expressions[166] = BinaryenConst(the_module, BinaryenLiteralVec128(t12));
}
- expressions[165] = BinaryenUnary(the_module, 76, expressions[164]);
+ expressions[167] = BinaryenUnary(the_module, 76, expressions[166]);
{
uint8_t t13[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[166] = BinaryenConst(the_module, BinaryenLiteralVec128(t13));
+ expressions[168] = BinaryenConst(the_module, BinaryenLiteralVec128(t13));
}
- expressions[167] = BinaryenUnary(the_module, 77, expressions[166]);
+ expressions[169] = BinaryenUnary(the_module, 77, expressions[168]);
{
uint8_t t14[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[168] = BinaryenConst(the_module, BinaryenLiteralVec128(t14));
+ expressions[170] = BinaryenConst(the_module, BinaryenLiteralVec128(t14));
}
- expressions[169] = BinaryenUnary(the_module, 78, expressions[168]);
+ expressions[171] = BinaryenUnary(the_module, 78, expressions[170]);
{
uint8_t t15[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[170] = BinaryenConst(the_module, BinaryenLiteralVec128(t15));
+ expressions[172] = BinaryenConst(the_module, BinaryenLiteralVec128(t15));
}
- expressions[171] = BinaryenUnary(the_module, 79, expressions[170]);
+ expressions[173] = BinaryenUnary(the_module, 79, expressions[172]);
{
uint8_t t16[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[172] = BinaryenConst(the_module, BinaryenLiteralVec128(t16));
+ expressions[174] = BinaryenConst(the_module, BinaryenLiteralVec128(t16));
}
- expressions[173] = BinaryenUnary(the_module, 80, expressions[172]);
+ expressions[175] = BinaryenUnary(the_module, 80, expressions[174]);
{
uint8_t t17[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[174] = BinaryenConst(the_module, BinaryenLiteralVec128(t17));
+ expressions[176] = BinaryenConst(the_module, BinaryenLiteralVec128(t17));
}
- expressions[175] = BinaryenUnary(the_module, 81, expressions[174]);
+ expressions[177] = BinaryenUnary(the_module, 81, expressions[176]);
{
uint8_t t18[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[176] = BinaryenConst(the_module, BinaryenLiteralVec128(t18));
+ expressions[178] = BinaryenConst(the_module, BinaryenLiteralVec128(t18));
}
- expressions[177] = BinaryenUnary(the_module, 82, expressions[176]);
+ expressions[179] = BinaryenUnary(the_module, 82, expressions[178]);
{
uint8_t t19[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[178] = BinaryenConst(the_module, BinaryenLiteralVec128(t19));
+ expressions[180] = BinaryenConst(the_module, BinaryenLiteralVec128(t19));
}
- expressions[179] = BinaryenUnary(the_module, 83, expressions[178]);
+ expressions[181] = BinaryenUnary(the_module, 83, expressions[180]);
{
uint8_t t20[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[180] = BinaryenConst(the_module, BinaryenLiteralVec128(t20));
+ expressions[182] = BinaryenConst(the_module, BinaryenLiteralVec128(t20));
}
- expressions[181] = BinaryenUnary(the_module, 84, expressions[180]);
+ expressions[183] = BinaryenUnary(the_module, 84, expressions[182]);
{
uint8_t t21[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[182] = BinaryenConst(the_module, BinaryenLiteralVec128(t21));
+ expressions[184] = BinaryenConst(the_module, BinaryenLiteralVec128(t21));
}
- expressions[183] = BinaryenUnary(the_module, 85, expressions[182]);
+ expressions[185] = BinaryenUnary(the_module, 85, expressions[184]);
{
uint8_t t22[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[184] = BinaryenConst(the_module, BinaryenLiteralVec128(t22));
+ expressions[186] = BinaryenConst(the_module, BinaryenLiteralVec128(t22));
}
- expressions[185] = BinaryenUnary(the_module, 86, expressions[184]);
+ expressions[187] = BinaryenUnary(the_module, 86, expressions[186]);
{
uint8_t t23[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[186] = BinaryenConst(the_module, BinaryenLiteralVec128(t23));
+ expressions[188] = BinaryenConst(the_module, BinaryenLiteralVec128(t23));
}
- expressions[187] = BinaryenUnary(the_module, 87, expressions[186]);
+ expressions[189] = BinaryenUnary(the_module, 87, expressions[188]);
{
uint8_t t24[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[188] = BinaryenConst(the_module, BinaryenLiteralVec128(t24));
+ expressions[190] = BinaryenConst(the_module, BinaryenLiteralVec128(t24));
}
- expressions[189] = BinaryenUnary(the_module, 88, expressions[188]);
+ expressions[191] = BinaryenUnary(the_module, 88, expressions[190]);
{
uint8_t t25[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[190] = BinaryenConst(the_module, BinaryenLiteralVec128(t25));
+ expressions[192] = BinaryenConst(the_module, BinaryenLiteralVec128(t25));
}
- expressions[191] = BinaryenUnary(the_module, 89, expressions[190]);
+ expressions[193] = BinaryenUnary(the_module, 89, expressions[192]);
{
uint8_t t26[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[192] = BinaryenConst(the_module, BinaryenLiteralVec128(t26));
+ expressions[194] = BinaryenConst(the_module, BinaryenLiteralVec128(t26));
}
- expressions[193] = BinaryenUnary(the_module, 90, expressions[192]);
+ expressions[195] = BinaryenUnary(the_module, 90, expressions[194]);
{
uint8_t t27[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[194] = BinaryenConst(the_module, BinaryenLiteralVec128(t27));
+ expressions[196] = BinaryenConst(the_module, BinaryenLiteralVec128(t27));
}
- expressions[195] = BinaryenUnary(the_module, 91, expressions[194]);
+ expressions[197] = BinaryenUnary(the_module, 91, expressions[196]);
{
uint8_t t28[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[196] = BinaryenConst(the_module, BinaryenLiteralVec128(t28));
+ expressions[198] = BinaryenConst(the_module, BinaryenLiteralVec128(t28));
}
- expressions[197] = BinaryenUnary(the_module, 92, expressions[196]);
+ expressions[199] = BinaryenUnary(the_module, 92, expressions[198]);
{
uint8_t t29[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[198] = BinaryenConst(the_module, BinaryenLiteralVec128(t29));
+ expressions[200] = BinaryenConst(the_module, BinaryenLiteralVec128(t29));
}
- expressions[199] = BinaryenUnary(the_module, 93, expressions[198]);
+ expressions[201] = BinaryenUnary(the_module, 93, expressions[200]);
{
uint8_t t30[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[200] = BinaryenConst(the_module, BinaryenLiteralVec128(t30));
+ expressions[202] = BinaryenConst(the_module, BinaryenLiteralVec128(t30));
}
- expressions[201] = BinaryenUnary(the_module, 94, expressions[200]);
+ expressions[203] = BinaryenUnary(the_module, 94, expressions[202]);
{
uint8_t t31[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[202] = BinaryenConst(the_module, BinaryenLiteralVec128(t31));
+ expressions[204] = BinaryenConst(the_module, BinaryenLiteralVec128(t31));
}
- expressions[203] = BinaryenUnary(the_module, 95, expressions[202]);
+ expressions[205] = BinaryenUnary(the_module, 95, expressions[204]);
{
uint8_t t32[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[204] = BinaryenConst(the_module, BinaryenLiteralVec128(t32));
+ expressions[206] = BinaryenConst(the_module, BinaryenLiteralVec128(t32));
}
- expressions[205] = BinaryenUnary(the_module, 96, expressions[204]);
+ expressions[207] = BinaryenUnary(the_module, 96, expressions[206]);
{
uint8_t t33[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[206] = BinaryenConst(the_module, BinaryenLiteralVec128(t33));
+ expressions[208] = BinaryenConst(the_module, BinaryenLiteralVec128(t33));
}
- expressions[207] = BinaryenUnary(the_module, 97, expressions[206]);
+ expressions[209] = BinaryenUnary(the_module, 97, expressions[208]);
{
uint8_t t34[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[208] = BinaryenConst(the_module, BinaryenLiteralVec128(t34));
+ expressions[210] = BinaryenConst(the_module, BinaryenLiteralVec128(t34));
}
- expressions[209] = BinaryenUnary(the_module, 98, expressions[208]);
+ expressions[211] = BinaryenUnary(the_module, 98, expressions[210]);
{
uint8_t t35[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[210] = BinaryenConst(the_module, BinaryenLiteralVec128(t35));
+ expressions[212] = BinaryenConst(the_module, BinaryenLiteralVec128(t35));
}
- expressions[211] = BinaryenUnary(the_module, 99, expressions[210]);
+ expressions[213] = BinaryenUnary(the_module, 99, expressions[212]);
{
uint8_t t36[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[212] = BinaryenConst(the_module, BinaryenLiteralVec128(t36));
- }
- 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(t36));
+ }
+ 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 t37[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[310] = BinaryenConst(the_module, BinaryenLiteralVec128(t37));
+ expressions[312] = BinaryenConst(the_module, BinaryenLiteralVec128(t37));
}
{
uint8_t t38[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[311] = BinaryenConst(the_module, BinaryenLiteralVec128(t38));
+ expressions[313] = BinaryenConst(the_module, BinaryenLiteralVec128(t38));
}
- expressions[312] = BinaryenBinary(the_module, 76, expressions[311], expressions[310]);
+ expressions[314] = BinaryenBinary(the_module, 76, expressions[313], expressions[312]);
{
uint8_t t39[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[313] = BinaryenConst(the_module, BinaryenLiteralVec128(t39));
+ expressions[315] = BinaryenConst(the_module, BinaryenLiteralVec128(t39));
}
{
uint8_t t40[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[314] = BinaryenConst(the_module, BinaryenLiteralVec128(t40));
+ expressions[316] = BinaryenConst(the_module, BinaryenLiteralVec128(t40));
}
- expressions[315] = BinaryenBinary(the_module, 77, expressions[314], expressions[313]);
+ expressions[317] = BinaryenBinary(the_module, 77, expressions[316], expressions[315]);
{
uint8_t t41[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[316] = BinaryenConst(the_module, BinaryenLiteralVec128(t41));
+ expressions[318] = BinaryenConst(the_module, BinaryenLiteralVec128(t41));
}
{
uint8_t t42[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[317] = BinaryenConst(the_module, BinaryenLiteralVec128(t42));
+ expressions[319] = BinaryenConst(the_module, BinaryenLiteralVec128(t42));
}
- expressions[318] = BinaryenBinary(the_module, 78, expressions[317], expressions[316]);
+ expressions[320] = BinaryenBinary(the_module, 78, expressions[319], expressions[318]);
{
uint8_t t43[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[319] = BinaryenConst(the_module, BinaryenLiteralVec128(t43));
+ expressions[321] = BinaryenConst(the_module, BinaryenLiteralVec128(t43));
}
{
uint8_t t44[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[320] = BinaryenConst(the_module, BinaryenLiteralVec128(t44));
+ expressions[322] = BinaryenConst(the_module, BinaryenLiteralVec128(t44));
}
- expressions[321] = BinaryenBinary(the_module, 79, expressions[320], expressions[319]);
+ expressions[323] = BinaryenBinary(the_module, 79, expressions[322], expressions[321]);
{
uint8_t t45[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[322] = BinaryenConst(the_module, BinaryenLiteralVec128(t45));
+ expressions[324] = BinaryenConst(the_module, BinaryenLiteralVec128(t45));
}
{
uint8_t t46[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[323] = BinaryenConst(the_module, BinaryenLiteralVec128(t46));
+ expressions[325] = BinaryenConst(the_module, BinaryenLiteralVec128(t46));
}
- expressions[324] = BinaryenBinary(the_module, 80, expressions[323], expressions[322]);
+ expressions[326] = BinaryenBinary(the_module, 80, expressions[325], expressions[324]);
{
uint8_t t47[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[325] = BinaryenConst(the_module, BinaryenLiteralVec128(t47));
+ expressions[327] = BinaryenConst(the_module, BinaryenLiteralVec128(t47));
}
{
uint8_t t48[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[326] = BinaryenConst(the_module, BinaryenLiteralVec128(t48));
+ expressions[328] = BinaryenConst(the_module, BinaryenLiteralVec128(t48));
}
- expressions[327] = BinaryenBinary(the_module, 81, expressions[326], expressions[325]);
+ expressions[329] = BinaryenBinary(the_module, 81, expressions[328], expressions[327]);
{
uint8_t t49[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[328] = BinaryenConst(the_module, BinaryenLiteralVec128(t49));
+ expressions[330] = BinaryenConst(the_module, BinaryenLiteralVec128(t49));
}
{
uint8_t t50[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[329] = BinaryenConst(the_module, BinaryenLiteralVec128(t50));
+ expressions[331] = BinaryenConst(the_module, BinaryenLiteralVec128(t50));
}
- expressions[330] = BinaryenBinary(the_module, 82, expressions[329], expressions[328]);
+ expressions[332] = BinaryenBinary(the_module, 82, expressions[331], expressions[330]);
{
uint8_t t51[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[331] = BinaryenConst(the_module, BinaryenLiteralVec128(t51));
+ expressions[333] = BinaryenConst(the_module, BinaryenLiteralVec128(t51));
}
{
uint8_t t52[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[332] = BinaryenConst(the_module, BinaryenLiteralVec128(t52));
+ expressions[334] = BinaryenConst(the_module, BinaryenLiteralVec128(t52));
}
- expressions[333] = BinaryenBinary(the_module, 83, expressions[332], expressions[331]);
+ expressions[335] = BinaryenBinary(the_module, 83, expressions[334], expressions[333]);
{
uint8_t t53[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[334] = BinaryenConst(the_module, BinaryenLiteralVec128(t53));
+ expressions[336] = BinaryenConst(the_module, BinaryenLiteralVec128(t53));
}
{
uint8_t t54[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[335] = BinaryenConst(the_module, BinaryenLiteralVec128(t54));
+ expressions[337] = BinaryenConst(the_module, BinaryenLiteralVec128(t54));
}
- expressions[336] = BinaryenBinary(the_module, 84, expressions[335], expressions[334]);
+ expressions[338] = BinaryenBinary(the_module, 84, expressions[337], expressions[336]);
{
uint8_t t55[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[337] = BinaryenConst(the_module, BinaryenLiteralVec128(t55));
+ expressions[339] = BinaryenConst(the_module, BinaryenLiteralVec128(t55));
}
{
uint8_t t56[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[338] = BinaryenConst(the_module, BinaryenLiteralVec128(t56));
+ expressions[340] = BinaryenConst(the_module, BinaryenLiteralVec128(t56));
}
- expressions[339] = BinaryenBinary(the_module, 85, expressions[338], expressions[337]);
+ expressions[341] = BinaryenBinary(the_module, 85, expressions[340], expressions[339]);
{
uint8_t t57[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[340] = BinaryenConst(the_module, BinaryenLiteralVec128(t57));
+ expressions[342] = BinaryenConst(the_module, BinaryenLiteralVec128(t57));
}
{
uint8_t t58[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[341] = BinaryenConst(the_module, BinaryenLiteralVec128(t58));
+ expressions[343] = BinaryenConst(the_module, BinaryenLiteralVec128(t58));
}
- expressions[342] = BinaryenBinary(the_module, 86, expressions[341], expressions[340]);
+ expressions[344] = BinaryenBinary(the_module, 86, expressions[343], expressions[342]);
{
uint8_t t59[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[343] = BinaryenConst(the_module, BinaryenLiteralVec128(t59));
+ expressions[345] = BinaryenConst(the_module, BinaryenLiteralVec128(t59));
}
{
uint8_t t60[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[344] = BinaryenConst(the_module, BinaryenLiteralVec128(t60));
+ expressions[346] = BinaryenConst(the_module, BinaryenLiteralVec128(t60));
}
- expressions[345] = BinaryenBinary(the_module, 87, expressions[344], expressions[343]);
+ expressions[347] = BinaryenBinary(the_module, 87, expressions[346], expressions[345]);
{
uint8_t t61[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[346] = BinaryenConst(the_module, BinaryenLiteralVec128(t61));
+ expressions[348] = BinaryenConst(the_module, BinaryenLiteralVec128(t61));
}
{
uint8_t t62[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[347] = BinaryenConst(the_module, BinaryenLiteralVec128(t62));
+ expressions[349] = BinaryenConst(the_module, BinaryenLiteralVec128(t62));
}
- expressions[348] = BinaryenBinary(the_module, 88, expressions[347], expressions[346]);
+ expressions[350] = BinaryenBinary(the_module, 88, expressions[349], expressions[348]);
{
uint8_t t63[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[349] = BinaryenConst(the_module, BinaryenLiteralVec128(t63));
+ expressions[351] = BinaryenConst(the_module, BinaryenLiteralVec128(t63));
}
{
uint8_t t64[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[350] = BinaryenConst(the_module, BinaryenLiteralVec128(t64));
+ expressions[352] = BinaryenConst(the_module, BinaryenLiteralVec128(t64));
}
- expressions[351] = BinaryenBinary(the_module, 89, expressions[350], expressions[349]);
+ expressions[353] = BinaryenBinary(the_module, 89, expressions[352], expressions[351]);
{
uint8_t t65[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[352] = BinaryenConst(the_module, BinaryenLiteralVec128(t65));
+ expressions[354] = BinaryenConst(the_module, BinaryenLiteralVec128(t65));
}
{
uint8_t t66[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[353] = BinaryenConst(the_module, BinaryenLiteralVec128(t66));
+ expressions[355] = BinaryenConst(the_module, BinaryenLiteralVec128(t66));
}
- expressions[354] = BinaryenBinary(the_module, 90, expressions[353], expressions[352]);
+ expressions[356] = BinaryenBinary(the_module, 90, expressions[355], expressions[354]);
{
uint8_t t67[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[355] = BinaryenConst(the_module, BinaryenLiteralVec128(t67));
+ expressions[357] = BinaryenConst(the_module, BinaryenLiteralVec128(t67));
}
{
uint8_t t68[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[356] = BinaryenConst(the_module, BinaryenLiteralVec128(t68));
+ expressions[358] = BinaryenConst(the_module, BinaryenLiteralVec128(t68));
}
- expressions[357] = BinaryenBinary(the_module, 91, expressions[356], expressions[355]);
+ expressions[359] = BinaryenBinary(the_module, 91, expressions[358], expressions[357]);
{
uint8_t t69[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[358] = BinaryenConst(the_module, BinaryenLiteralVec128(t69));
+ expressions[360] = BinaryenConst(the_module, BinaryenLiteralVec128(t69));
}
{
uint8_t t70[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[359] = BinaryenConst(the_module, BinaryenLiteralVec128(t70));
+ expressions[361] = BinaryenConst(the_module, BinaryenLiteralVec128(t70));
}
- expressions[360] = BinaryenBinary(the_module, 92, expressions[359], expressions[358]);
+ expressions[362] = BinaryenBinary(the_module, 92, expressions[361], expressions[360]);
{
uint8_t t71[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[361] = BinaryenConst(the_module, BinaryenLiteralVec128(t71));
+ expressions[363] = BinaryenConst(the_module, BinaryenLiteralVec128(t71));
}
{
uint8_t t72[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[362] = BinaryenConst(the_module, BinaryenLiteralVec128(t72));
+ expressions[364] = BinaryenConst(the_module, BinaryenLiteralVec128(t72));
}
- expressions[363] = BinaryenBinary(the_module, 93, expressions[362], expressions[361]);
+ expressions[365] = BinaryenBinary(the_module, 93, expressions[364], expressions[363]);
{
uint8_t t73[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[364] = BinaryenConst(the_module, BinaryenLiteralVec128(t73));
+ expressions[366] = BinaryenConst(the_module, BinaryenLiteralVec128(t73));
}
{
uint8_t t74[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[365] = BinaryenConst(the_module, BinaryenLiteralVec128(t74));
+ expressions[367] = BinaryenConst(the_module, BinaryenLiteralVec128(t74));
}
- expressions[366] = BinaryenBinary(the_module, 94, expressions[365], expressions[364]);
+ expressions[368] = BinaryenBinary(the_module, 94, expressions[367], expressions[366]);
{
uint8_t t75[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[367] = BinaryenConst(the_module, BinaryenLiteralVec128(t75));
+ expressions[369] = BinaryenConst(the_module, BinaryenLiteralVec128(t75));
}
{
uint8_t t76[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[368] = BinaryenConst(the_module, BinaryenLiteralVec128(t76));
+ expressions[370] = BinaryenConst(the_module, BinaryenLiteralVec128(t76));
}
- expressions[369] = BinaryenBinary(the_module, 95, expressions[368], expressions[367]);
+ expressions[371] = BinaryenBinary(the_module, 95, expressions[370], expressions[369]);
{
uint8_t t77[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[370] = BinaryenConst(the_module, BinaryenLiteralVec128(t77));
+ expressions[372] = BinaryenConst(the_module, BinaryenLiteralVec128(t77));
}
{
uint8_t t78[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[371] = BinaryenConst(the_module, BinaryenLiteralVec128(t78));
+ expressions[373] = BinaryenConst(the_module, BinaryenLiteralVec128(t78));
}
- expressions[372] = BinaryenBinary(the_module, 96, expressions[371], expressions[370]);
+ expressions[374] = BinaryenBinary(the_module, 96, expressions[373], expressions[372]);
{
uint8_t t79[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[373] = BinaryenConst(the_module, BinaryenLiteralVec128(t79));
+ expressions[375] = BinaryenConst(the_module, BinaryenLiteralVec128(t79));
}
{
uint8_t t80[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[374] = BinaryenConst(the_module, BinaryenLiteralVec128(t80));
+ expressions[376] = BinaryenConst(the_module, BinaryenLiteralVec128(t80));
}
- expressions[375] = BinaryenBinary(the_module, 97, expressions[374], expressions[373]);
+ expressions[377] = BinaryenBinary(the_module, 97, expressions[376], expressions[375]);
{
uint8_t t81[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[376] = BinaryenConst(the_module, BinaryenLiteralVec128(t81));
+ expressions[378] = BinaryenConst(the_module, BinaryenLiteralVec128(t81));
}
{
uint8_t t82[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[377] = BinaryenConst(the_module, BinaryenLiteralVec128(t82));
+ expressions[379] = BinaryenConst(the_module, BinaryenLiteralVec128(t82));
}
- expressions[378] = BinaryenBinary(the_module, 98, expressions[377], expressions[376]);
+ expressions[380] = BinaryenBinary(the_module, 98, expressions[379], expressions[378]);
{
uint8_t t83[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[379] = BinaryenConst(the_module, BinaryenLiteralVec128(t83));
+ expressions[381] = BinaryenConst(the_module, BinaryenLiteralVec128(t83));
}
{
uint8_t t84[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[380] = BinaryenConst(the_module, BinaryenLiteralVec128(t84));
+ expressions[382] = BinaryenConst(the_module, BinaryenLiteralVec128(t84));
}
- expressions[381] = BinaryenBinary(the_module, 99, expressions[380], expressions[379]);
+ expressions[383] = BinaryenBinary(the_module, 99, expressions[382], expressions[381]);
{
uint8_t t85[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[382] = BinaryenConst(the_module, BinaryenLiteralVec128(t85));
+ expressions[384] = BinaryenConst(the_module, BinaryenLiteralVec128(t85));
}
{
uint8_t t86[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[383] = BinaryenConst(the_module, BinaryenLiteralVec128(t86));
+ expressions[385] = BinaryenConst(the_module, BinaryenLiteralVec128(t86));
}
- expressions[384] = BinaryenBinary(the_module, 100, expressions[383], expressions[382]);
+ expressions[386] = BinaryenBinary(the_module, 100, expressions[385], expressions[384]);
{
uint8_t t87[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[385] = BinaryenConst(the_module, BinaryenLiteralVec128(t87));
+ expressions[387] = BinaryenConst(the_module, BinaryenLiteralVec128(t87));
}
{
uint8_t t88[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[386] = BinaryenConst(the_module, BinaryenLiteralVec128(t88));
+ expressions[388] = BinaryenConst(the_module, BinaryenLiteralVec128(t88));
}
- expressions[387] = BinaryenBinary(the_module, 101, expressions[386], expressions[385]);
+ expressions[389] = BinaryenBinary(the_module, 101, expressions[388], expressions[387]);
{
uint8_t t89[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[388] = BinaryenConst(the_module, BinaryenLiteralVec128(t89));
+ expressions[390] = BinaryenConst(the_module, BinaryenLiteralVec128(t89));
}
{
uint8_t t90[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[389] = BinaryenConst(the_module, BinaryenLiteralVec128(t90));
+ expressions[391] = BinaryenConst(the_module, BinaryenLiteralVec128(t90));
}
- expressions[390] = BinaryenBinary(the_module, 102, expressions[389], expressions[388]);
+ expressions[392] = BinaryenBinary(the_module, 102, expressions[391], expressions[390]);
{
uint8_t t91[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[391] = BinaryenConst(the_module, BinaryenLiteralVec128(t91));
+ expressions[393] = BinaryenConst(the_module, BinaryenLiteralVec128(t91));
}
{
uint8_t t92[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[392] = BinaryenConst(the_module, BinaryenLiteralVec128(t92));
+ expressions[394] = BinaryenConst(the_module, BinaryenLiteralVec128(t92));
}
- expressions[393] = BinaryenBinary(the_module, 103, expressions[392], expressions[391]);
+ expressions[395] = BinaryenBinary(the_module, 103, expressions[394], expressions[393]);
{
uint8_t t93[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[394] = BinaryenConst(the_module, BinaryenLiteralVec128(t93));
+ expressions[396] = BinaryenConst(the_module, BinaryenLiteralVec128(t93));
}
{
uint8_t t94[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[395] = BinaryenConst(the_module, BinaryenLiteralVec128(t94));
+ expressions[397] = BinaryenConst(the_module, BinaryenLiteralVec128(t94));
}
- expressions[396] = BinaryenBinary(the_module, 104, expressions[395], expressions[394]);
+ expressions[398] = BinaryenBinary(the_module, 104, expressions[397], expressions[396]);
{
uint8_t t95[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[397] = BinaryenConst(the_module, BinaryenLiteralVec128(t95));
+ expressions[399] = BinaryenConst(the_module, BinaryenLiteralVec128(t95));
}
{
uint8_t t96[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[398] = BinaryenConst(the_module, BinaryenLiteralVec128(t96));
+ expressions[400] = BinaryenConst(the_module, BinaryenLiteralVec128(t96));
}
- expressions[399] = BinaryenBinary(the_module, 105, expressions[398], expressions[397]);
+ expressions[401] = BinaryenBinary(the_module, 105, expressions[400], expressions[399]);
{
uint8_t t97[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[400] = BinaryenConst(the_module, BinaryenLiteralVec128(t97));
+ expressions[402] = BinaryenConst(the_module, BinaryenLiteralVec128(t97));
}
{
uint8_t t98[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[401] = BinaryenConst(the_module, BinaryenLiteralVec128(t98));
+ expressions[403] = BinaryenConst(the_module, BinaryenLiteralVec128(t98));
}
- expressions[402] = BinaryenBinary(the_module, 106, expressions[401], expressions[400]);
+ expressions[404] = BinaryenBinary(the_module, 106, expressions[403], expressions[402]);
{
uint8_t t99[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[403] = BinaryenConst(the_module, BinaryenLiteralVec128(t99));
+ expressions[405] = BinaryenConst(the_module, BinaryenLiteralVec128(t99));
}
{
uint8_t t100[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[404] = BinaryenConst(the_module, BinaryenLiteralVec128(t100));
+ expressions[406] = BinaryenConst(the_module, BinaryenLiteralVec128(t100));
}
- expressions[405] = BinaryenBinary(the_module, 107, expressions[404], expressions[403]);
+ expressions[407] = BinaryenBinary(the_module, 107, expressions[406], expressions[405]);
{
uint8_t t101[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[406] = BinaryenConst(the_module, BinaryenLiteralVec128(t101));
+ expressions[408] = BinaryenConst(the_module, BinaryenLiteralVec128(t101));
}
{
uint8_t t102[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[407] = BinaryenConst(the_module, BinaryenLiteralVec128(t102));
+ expressions[409] = BinaryenConst(the_module, BinaryenLiteralVec128(t102));
}
- expressions[408] = BinaryenBinary(the_module, 108, expressions[407], expressions[406]);
+ expressions[410] = BinaryenBinary(the_module, 108, expressions[409], expressions[408]);
{
uint8_t t103[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[409] = BinaryenConst(the_module, BinaryenLiteralVec128(t103));
+ expressions[411] = BinaryenConst(the_module, BinaryenLiteralVec128(t103));
}
{
uint8_t t104[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[410] = BinaryenConst(the_module, BinaryenLiteralVec128(t104));
+ expressions[412] = BinaryenConst(the_module, BinaryenLiteralVec128(t104));
}
- expressions[411] = BinaryenBinary(the_module, 109, expressions[410], expressions[409]);
+ expressions[413] = BinaryenBinary(the_module, 109, expressions[412], expressions[411]);
{
uint8_t t105[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[412] = BinaryenConst(the_module, BinaryenLiteralVec128(t105));
+ expressions[414] = BinaryenConst(the_module, BinaryenLiteralVec128(t105));
}
{
uint8_t t106[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[413] = BinaryenConst(the_module, BinaryenLiteralVec128(t106));
+ expressions[415] = BinaryenConst(the_module, BinaryenLiteralVec128(t106));
}
- expressions[414] = BinaryenBinary(the_module, 110, expressions[413], expressions[412]);
+ expressions[416] = BinaryenBinary(the_module, 110, expressions[415], expressions[414]);
{
uint8_t t107[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[415] = BinaryenConst(the_module, BinaryenLiteralVec128(t107));
+ expressions[417] = BinaryenConst(the_module, BinaryenLiteralVec128(t107));
}
{
uint8_t t108[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[416] = BinaryenConst(the_module, BinaryenLiteralVec128(t108));
+ expressions[418] = BinaryenConst(the_module, BinaryenLiteralVec128(t108));
}
- expressions[417] = BinaryenBinary(the_module, 111, expressions[416], expressions[415]);
+ expressions[419] = BinaryenBinary(the_module, 111, expressions[418], expressions[417]);
{
uint8_t t109[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[418] = BinaryenConst(the_module, BinaryenLiteralVec128(t109));
+ expressions[420] = BinaryenConst(the_module, BinaryenLiteralVec128(t109));
}
{
uint8_t t110[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[419] = BinaryenConst(the_module, BinaryenLiteralVec128(t110));
+ expressions[421] = BinaryenConst(the_module, BinaryenLiteralVec128(t110));
}
- expressions[420] = BinaryenBinary(the_module, 112, expressions[419], expressions[418]);
+ expressions[422] = BinaryenBinary(the_module, 112, expressions[421], expressions[420]);
{
uint8_t t111[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[421] = BinaryenConst(the_module, BinaryenLiteralVec128(t111));
+ expressions[423] = BinaryenConst(the_module, BinaryenLiteralVec128(t111));
}
{
uint8_t t112[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[422] = BinaryenConst(the_module, BinaryenLiteralVec128(t112));
+ expressions[424] = BinaryenConst(the_module, BinaryenLiteralVec128(t112));
}
- expressions[423] = BinaryenBinary(the_module, 113, expressions[422], expressions[421]);
+ expressions[425] = BinaryenBinary(the_module, 113, expressions[424], expressions[423]);
{
uint8_t t113[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[424] = BinaryenConst(the_module, BinaryenLiteralVec128(t113));
+ expressions[426] = BinaryenConst(the_module, BinaryenLiteralVec128(t113));
}
{
uint8_t t114[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[425] = BinaryenConst(the_module, BinaryenLiteralVec128(t114));
+ expressions[427] = BinaryenConst(the_module, BinaryenLiteralVec128(t114));
}
- expressions[426] = BinaryenBinary(the_module, 114, expressions[425], expressions[424]);
+ expressions[428] = BinaryenBinary(the_module, 114, expressions[427], expressions[426]);
{
uint8_t t115[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[427] = BinaryenConst(the_module, BinaryenLiteralVec128(t115));
+ expressions[429] = BinaryenConst(the_module, BinaryenLiteralVec128(t115));
}
{
uint8_t t116[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[428] = BinaryenConst(the_module, BinaryenLiteralVec128(t116));
+ expressions[430] = BinaryenConst(the_module, BinaryenLiteralVec128(t116));
}
- expressions[429] = BinaryenBinary(the_module, 115, expressions[428], expressions[427]);
+ expressions[431] = BinaryenBinary(the_module, 115, expressions[430], expressions[429]);
{
uint8_t t117[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[430] = BinaryenConst(the_module, BinaryenLiteralVec128(t117));
+ expressions[432] = BinaryenConst(the_module, BinaryenLiteralVec128(t117));
}
{
uint8_t t118[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[431] = BinaryenConst(the_module, BinaryenLiteralVec128(t118));
+ expressions[433] = BinaryenConst(the_module, BinaryenLiteralVec128(t118));
}
- expressions[432] = BinaryenBinary(the_module, 116, expressions[431], expressions[430]);
+ expressions[434] = BinaryenBinary(the_module, 116, expressions[433], expressions[432]);
{
uint8_t t119[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[433] = BinaryenConst(the_module, BinaryenLiteralVec128(t119));
+ expressions[435] = BinaryenConst(the_module, BinaryenLiteralVec128(t119));
}
{
uint8_t t120[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[434] = BinaryenConst(the_module, BinaryenLiteralVec128(t120));
+ expressions[436] = BinaryenConst(the_module, BinaryenLiteralVec128(t120));
}
- expressions[435] = BinaryenBinary(the_module, 117, expressions[434], expressions[433]);
+ expressions[437] = BinaryenBinary(the_module, 117, expressions[436], expressions[435]);
{
uint8_t t121[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[436] = BinaryenConst(the_module, BinaryenLiteralVec128(t121));
+ expressions[438] = BinaryenConst(the_module, BinaryenLiteralVec128(t121));
}
{
uint8_t t122[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[437] = BinaryenConst(the_module, BinaryenLiteralVec128(t122));
+ expressions[439] = BinaryenConst(the_module, BinaryenLiteralVec128(t122));
}
- expressions[438] = BinaryenBinary(the_module, 118, expressions[437], expressions[436]);
+ expressions[440] = BinaryenBinary(the_module, 118, expressions[439], expressions[438]);
{
uint8_t t123[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[439] = BinaryenConst(the_module, BinaryenLiteralVec128(t123));
+ expressions[441] = BinaryenConst(the_module, BinaryenLiteralVec128(t123));
}
{
uint8_t t124[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[440] = BinaryenConst(the_module, BinaryenLiteralVec128(t124));
+ expressions[442] = BinaryenConst(the_module, BinaryenLiteralVec128(t124));
}
- expressions[441] = BinaryenBinary(the_module, 119, expressions[440], expressions[439]);
+ expressions[443] = BinaryenBinary(the_module, 119, expressions[442], expressions[441]);
{
uint8_t t125[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[442] = BinaryenConst(the_module, BinaryenLiteralVec128(t125));
+ expressions[444] = BinaryenConst(the_module, BinaryenLiteralVec128(t125));
}
{
uint8_t t126[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[443] = BinaryenConst(the_module, BinaryenLiteralVec128(t126));
+ expressions[445] = BinaryenConst(the_module, BinaryenLiteralVec128(t126));
}
- expressions[444] = BinaryenBinary(the_module, 120, expressions[443], expressions[442]);
+ expressions[446] = BinaryenBinary(the_module, 120, expressions[445], expressions[444]);
{
uint8_t t127[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[445] = BinaryenConst(the_module, BinaryenLiteralVec128(t127));
+ expressions[447] = BinaryenConst(the_module, BinaryenLiteralVec128(t127));
}
{
uint8_t t128[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[446] = BinaryenConst(the_module, BinaryenLiteralVec128(t128));
+ expressions[448] = BinaryenConst(the_module, BinaryenLiteralVec128(t128));
}
- expressions[447] = BinaryenBinary(the_module, 121, expressions[446], expressions[445]);
+ expressions[449] = BinaryenBinary(the_module, 121, expressions[448], expressions[447]);
{
uint8_t t129[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[448] = BinaryenConst(the_module, BinaryenLiteralVec128(t129));
+ expressions[450] = BinaryenConst(the_module, BinaryenLiteralVec128(t129));
}
{
uint8_t t130[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[449] = BinaryenConst(the_module, BinaryenLiteralVec128(t130));
+ expressions[451] = BinaryenConst(the_module, BinaryenLiteralVec128(t130));
}
- expressions[450] = BinaryenBinary(the_module, 122, expressions[449], expressions[448]);
+ expressions[452] = BinaryenBinary(the_module, 122, expressions[451], expressions[450]);
{
uint8_t t131[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[451] = BinaryenConst(the_module, BinaryenLiteralVec128(t131));
+ expressions[453] = BinaryenConst(the_module, BinaryenLiteralVec128(t131));
}
{
uint8_t t132[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[452] = BinaryenConst(the_module, BinaryenLiteralVec128(t132));
+ expressions[454] = BinaryenConst(the_module, BinaryenLiteralVec128(t132));
}
- expressions[453] = BinaryenBinary(the_module, 123, expressions[452], expressions[451]);
+ expressions[455] = BinaryenBinary(the_module, 123, expressions[454], expressions[453]);
{
uint8_t t133[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[454] = BinaryenConst(the_module, BinaryenLiteralVec128(t133));
+ expressions[456] = BinaryenConst(the_module, BinaryenLiteralVec128(t133));
}
{
uint8_t t134[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[455] = BinaryenConst(the_module, BinaryenLiteralVec128(t134));
+ expressions[457] = BinaryenConst(the_module, BinaryenLiteralVec128(t134));
}
- expressions[456] = BinaryenBinary(the_module, 124, expressions[455], expressions[454]);
+ expressions[458] = BinaryenBinary(the_module, 124, expressions[457], expressions[456]);
{
uint8_t t135[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[457] = BinaryenConst(the_module, BinaryenLiteralVec128(t135));
+ expressions[459] = BinaryenConst(the_module, BinaryenLiteralVec128(t135));
}
{
uint8_t t136[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[458] = BinaryenConst(the_module, BinaryenLiteralVec128(t136));
+ expressions[460] = BinaryenConst(the_module, BinaryenLiteralVec128(t136));
}
- expressions[459] = BinaryenBinary(the_module, 125, expressions[458], expressions[457]);
+ expressions[461] = BinaryenBinary(the_module, 125, expressions[460], expressions[459]);
{
uint8_t t137[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[460] = BinaryenConst(the_module, BinaryenLiteralVec128(t137));
+ expressions[462] = BinaryenConst(the_module, BinaryenLiteralVec128(t137));
}
{
uint8_t t138[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[461] = BinaryenConst(the_module, BinaryenLiteralVec128(t138));
+ expressions[463] = BinaryenConst(the_module, BinaryenLiteralVec128(t138));
}
- expressions[462] = BinaryenBinary(the_module, 126, expressions[461], expressions[460]);
+ expressions[464] = BinaryenBinary(the_module, 126, expressions[463], expressions[462]);
{
uint8_t t139[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[463] = BinaryenConst(the_module, BinaryenLiteralVec128(t139));
+ expressions[465] = BinaryenConst(the_module, BinaryenLiteralVec128(t139));
}
{
uint8_t t140[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[464] = BinaryenConst(the_module, BinaryenLiteralVec128(t140));
+ expressions[466] = BinaryenConst(the_module, BinaryenLiteralVec128(t140));
}
- expressions[465] = BinaryenBinary(the_module, 127, expressions[464], expressions[463]);
+ expressions[467] = BinaryenBinary(the_module, 127, expressions[466], expressions[465]);
{
uint8_t t141[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[466] = BinaryenConst(the_module, BinaryenLiteralVec128(t141));
+ expressions[468] = BinaryenConst(the_module, BinaryenLiteralVec128(t141));
}
{
uint8_t t142[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[467] = BinaryenConst(the_module, BinaryenLiteralVec128(t142));
+ expressions[469] = BinaryenConst(the_module, BinaryenLiteralVec128(t142));
}
- expressions[468] = BinaryenBinary(the_module, 128, expressions[467], expressions[466]);
+ expressions[470] = BinaryenBinary(the_module, 128, expressions[469], expressions[468]);
{
uint8_t t143[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[469] = BinaryenConst(the_module, BinaryenLiteralVec128(t143));
+ expressions[471] = BinaryenConst(the_module, BinaryenLiteralVec128(t143));
}
{
uint8_t t144[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[470] = BinaryenConst(the_module, BinaryenLiteralVec128(t144));
+ expressions[472] = BinaryenConst(the_module, BinaryenLiteralVec128(t144));
}
- expressions[471] = BinaryenBinary(the_module, 129, expressions[470], expressions[469]);
+ expressions[473] = BinaryenBinary(the_module, 129, expressions[472], expressions[471]);
{
uint8_t t145[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[472] = BinaryenConst(the_module, BinaryenLiteralVec128(t145));
+ expressions[474] = BinaryenConst(the_module, BinaryenLiteralVec128(t145));
}
{
uint8_t t146[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[473] = BinaryenConst(the_module, BinaryenLiteralVec128(t146));
+ expressions[475] = BinaryenConst(the_module, BinaryenLiteralVec128(t146));
}
- expressions[474] = BinaryenBinary(the_module, 130, expressions[473], expressions[472]);
+ expressions[476] = BinaryenBinary(the_module, 130, expressions[475], expressions[474]);
{
uint8_t t147[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[475] = BinaryenConst(the_module, BinaryenLiteralVec128(t147));
+ expressions[477] = BinaryenConst(the_module, BinaryenLiteralVec128(t147));
}
{
uint8_t t148[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[476] = BinaryenConst(the_module, BinaryenLiteralVec128(t148));
+ expressions[478] = BinaryenConst(the_module, BinaryenLiteralVec128(t148));
}
- expressions[477] = BinaryenBinary(the_module, 131, expressions[476], expressions[475]);
+ expressions[479] = BinaryenBinary(the_module, 131, expressions[478], expressions[477]);
{
uint8_t t149[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[478] = BinaryenConst(the_module, BinaryenLiteralVec128(t149));
+ expressions[480] = BinaryenConst(the_module, BinaryenLiteralVec128(t149));
}
{
uint8_t t150[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[479] = BinaryenConst(the_module, BinaryenLiteralVec128(t150));
+ expressions[481] = BinaryenConst(the_module, BinaryenLiteralVec128(t150));
}
- expressions[480] = BinaryenBinary(the_module, 132, expressions[479], expressions[478]);
+ expressions[482] = BinaryenBinary(the_module, 132, expressions[481], expressions[480]);
{
uint8_t t151[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[481] = BinaryenConst(the_module, BinaryenLiteralVec128(t151));
+ expressions[483] = BinaryenConst(the_module, BinaryenLiteralVec128(t151));
}
{
uint8_t t152[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[482] = BinaryenConst(the_module, BinaryenLiteralVec128(t152));
+ expressions[484] = BinaryenConst(the_module, BinaryenLiteralVec128(t152));
}
- expressions[483] = BinaryenBinary(the_module, 133, expressions[482], expressions[481]);
+ expressions[485] = BinaryenBinary(the_module, 133, expressions[484], expressions[483]);
{
uint8_t t153[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[484] = BinaryenConst(the_module, BinaryenLiteralVec128(t153));
+ expressions[486] = BinaryenConst(the_module, BinaryenLiteralVec128(t153));
}
{
uint8_t t154[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[485] = BinaryenConst(the_module, BinaryenLiteralVec128(t154));
+ expressions[487] = BinaryenConst(the_module, BinaryenLiteralVec128(t154));
}
- expressions[486] = BinaryenBinary(the_module, 134, expressions[485], expressions[484]);
+ expressions[488] = BinaryenBinary(the_module, 134, expressions[487], expressions[486]);
{
uint8_t t155[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[487] = BinaryenConst(the_module, BinaryenLiteralVec128(t155));
+ expressions[489] = BinaryenConst(the_module, BinaryenLiteralVec128(t155));
}
{
uint8_t t156[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[488] = BinaryenConst(the_module, BinaryenLiteralVec128(t156));
+ expressions[490] = BinaryenConst(the_module, BinaryenLiteralVec128(t156));
}
- expressions[489] = BinaryenBinary(the_module, 135, expressions[488], expressions[487]);
+ expressions[491] = BinaryenBinary(the_module, 135, expressions[490], expressions[489]);
{
uint8_t t157[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[490] = BinaryenConst(the_module, BinaryenLiteralVec128(t157));
+ expressions[492] = BinaryenConst(the_module, BinaryenLiteralVec128(t157));
}
{
uint8_t t158[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[491] = BinaryenConst(the_module, BinaryenLiteralVec128(t158));
+ expressions[493] = BinaryenConst(the_module, BinaryenLiteralVec128(t158));
}
- expressions[492] = BinaryenBinary(the_module, 136, expressions[491], expressions[490]);
+ expressions[494] = BinaryenBinary(the_module, 136, expressions[493], expressions[492]);
{
uint8_t t159[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[493] = BinaryenConst(the_module, BinaryenLiteralVec128(t159));
+ expressions[495] = BinaryenConst(the_module, BinaryenLiteralVec128(t159));
}
{
uint8_t t160[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[494] = BinaryenConst(the_module, BinaryenLiteralVec128(t160));
+ expressions[496] = BinaryenConst(the_module, BinaryenLiteralVec128(t160));
}
- expressions[495] = BinaryenBinary(the_module, 137, expressions[494], expressions[493]);
+ expressions[497] = BinaryenBinary(the_module, 137, expressions[496], expressions[495]);
{
uint8_t t161[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[496] = BinaryenConst(the_module, BinaryenLiteralVec128(t161));
+ expressions[498] = BinaryenConst(the_module, BinaryenLiteralVec128(t161));
}
{
uint8_t t162[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[497] = BinaryenConst(the_module, BinaryenLiteralVec128(t162));
+ expressions[499] = BinaryenConst(the_module, BinaryenLiteralVec128(t162));
}
- expressions[498] = BinaryenBinary(the_module, 138, expressions[497], expressions[496]);
+ expressions[500] = BinaryenBinary(the_module, 138, expressions[499], expressions[498]);
{
uint8_t t163[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[499] = BinaryenConst(the_module, BinaryenLiteralVec128(t163));
+ expressions[501] = BinaryenConst(the_module, BinaryenLiteralVec128(t163));
}
{
uint8_t t164[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[500] = BinaryenConst(the_module, BinaryenLiteralVec128(t164));
+ expressions[502] = BinaryenConst(the_module, BinaryenLiteralVec128(t164));
}
- expressions[501] = BinaryenBinary(the_module, 139, expressions[500], expressions[499]);
+ expressions[503] = BinaryenBinary(the_module, 139, expressions[502], expressions[501]);
{
uint8_t t165[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[502] = BinaryenConst(the_module, BinaryenLiteralVec128(t165));
+ expressions[504] = BinaryenConst(the_module, BinaryenLiteralVec128(t165));
}
{
uint8_t t166[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[503] = BinaryenConst(the_module, BinaryenLiteralVec128(t166));
+ expressions[505] = BinaryenConst(the_module, BinaryenLiteralVec128(t166));
}
- expressions[504] = BinaryenBinary(the_module, 140, expressions[503], expressions[502]);
+ expressions[506] = BinaryenBinary(the_module, 140, expressions[505], expressions[504]);
{
uint8_t t167[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[505] = BinaryenConst(the_module, BinaryenLiteralVec128(t167));
+ expressions[507] = BinaryenConst(the_module, BinaryenLiteralVec128(t167));
}
{
uint8_t t168[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[506] = BinaryenConst(the_module, BinaryenLiteralVec128(t168));
+ expressions[508] = BinaryenConst(the_module, BinaryenLiteralVec128(t168));
}
- expressions[507] = BinaryenBinary(the_module, 141, expressions[506], expressions[505]);
+ expressions[509] = BinaryenBinary(the_module, 141, expressions[508], expressions[507]);
{
uint8_t t169[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[508] = BinaryenConst(the_module, BinaryenLiteralVec128(t169));
+ expressions[510] = BinaryenConst(the_module, BinaryenLiteralVec128(t169));
}
{
uint8_t t170[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[509] = BinaryenConst(the_module, BinaryenLiteralVec128(t170));
+ expressions[511] = BinaryenConst(the_module, BinaryenLiteralVec128(t170));
}
- expressions[510] = BinaryenBinary(the_module, 142, expressions[509], expressions[508]);
+ expressions[512] = BinaryenBinary(the_module, 142, expressions[511], expressions[510]);
{
uint8_t t171[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[511] = BinaryenConst(the_module, BinaryenLiteralVec128(t171));
+ expressions[513] = BinaryenConst(the_module, BinaryenLiteralVec128(t171));
}
{
uint8_t t172[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[512] = BinaryenConst(the_module, BinaryenLiteralVec128(t172));
+ expressions[514] = BinaryenConst(the_module, BinaryenLiteralVec128(t172));
}
- expressions[513] = BinaryenBinary(the_module, 143, expressions[512], expressions[511]);
+ expressions[515] = BinaryenBinary(the_module, 143, expressions[514], expressions[513]);
{
uint8_t t173[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[514] = BinaryenConst(the_module, BinaryenLiteralVec128(t173));
+ expressions[516] = BinaryenConst(the_module, BinaryenLiteralVec128(t173));
}
{
uint8_t t174[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[515] = BinaryenConst(the_module, BinaryenLiteralVec128(t174));
+ expressions[517] = BinaryenConst(the_module, BinaryenLiteralVec128(t174));
}
- expressions[516] = BinaryenBinary(the_module, 144, expressions[515], expressions[514]);
+ expressions[518] = BinaryenBinary(the_module, 144, expressions[517], expressions[516]);
{
uint8_t t175[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[517] = BinaryenConst(the_module, BinaryenLiteralVec128(t175));
+ expressions[519] = BinaryenConst(the_module, BinaryenLiteralVec128(t175));
}
{
uint8_t t176[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[518] = BinaryenConst(the_module, BinaryenLiteralVec128(t176));
+ expressions[520] = BinaryenConst(the_module, BinaryenLiteralVec128(t176));
}
- expressions[519] = BinaryenBinary(the_module, 145, expressions[518], expressions[517]);
+ expressions[521] = BinaryenBinary(the_module, 145, expressions[520], expressions[519]);
{
uint8_t t177[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[520] = BinaryenConst(the_module, BinaryenLiteralVec128(t177));
+ expressions[522] = BinaryenConst(the_module, BinaryenLiteralVec128(t177));
}
{
uint8_t t178[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[521] = BinaryenConst(the_module, BinaryenLiteralVec128(t178));
+ expressions[523] = BinaryenConst(the_module, BinaryenLiteralVec128(t178));
}
- expressions[522] = BinaryenBinary(the_module, 146, expressions[521], expressions[520]);
+ expressions[524] = BinaryenBinary(the_module, 146, expressions[523], expressions[522]);
{
uint8_t t179[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[523] = BinaryenConst(the_module, BinaryenLiteralVec128(t179));
+ expressions[525] = BinaryenConst(the_module, BinaryenLiteralVec128(t179));
}
{
uint8_t t180[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[524] = BinaryenConst(the_module, BinaryenLiteralVec128(t180));
+ expressions[526] = BinaryenConst(the_module, BinaryenLiteralVec128(t180));
}
- expressions[525] = BinaryenBinary(the_module, 147, expressions[524], expressions[523]);
+ expressions[527] = BinaryenBinary(the_module, 147, expressions[526], expressions[525]);
{
uint8_t t181[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[526] = BinaryenConst(the_module, BinaryenLiteralVec128(t181));
+ expressions[528] = BinaryenConst(the_module, BinaryenLiteralVec128(t181));
}
{
uint8_t t182[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[527] = BinaryenConst(the_module, BinaryenLiteralVec128(t182));
+ expressions[529] = BinaryenConst(the_module, BinaryenLiteralVec128(t182));
}
- expressions[528] = BinaryenBinary(the_module, 148, expressions[527], expressions[526]);
+ expressions[530] = BinaryenBinary(the_module, 148, expressions[529], expressions[528]);
{
uint8_t t183[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[529] = BinaryenConst(the_module, BinaryenLiteralVec128(t183));
+ expressions[531] = BinaryenConst(the_module, BinaryenLiteralVec128(t183));
}
{
uint8_t t184[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[530] = BinaryenConst(the_module, BinaryenLiteralVec128(t184));
+ expressions[532] = BinaryenConst(the_module, BinaryenLiteralVec128(t184));
}
- expressions[531] = BinaryenBinary(the_module, 154, expressions[530], expressions[529]);
+ expressions[533] = BinaryenBinary(the_module, 154, expressions[532], expressions[531]);
{
uint8_t t185[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[532] = BinaryenConst(the_module, BinaryenLiteralVec128(t185));
+ expressions[534] = BinaryenConst(the_module, BinaryenLiteralVec128(t185));
}
{
uint8_t t186[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[533] = BinaryenConst(the_module, BinaryenLiteralVec128(t186));
+ expressions[535] = BinaryenConst(the_module, BinaryenLiteralVec128(t186));
}
- expressions[534] = BinaryenBinary(the_module, 155, expressions[533], expressions[532]);
+ expressions[536] = BinaryenBinary(the_module, 155, expressions[535], expressions[534]);
{
uint8_t t187[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[535] = BinaryenConst(the_module, BinaryenLiteralVec128(t187));
+ expressions[537] = BinaryenConst(the_module, BinaryenLiteralVec128(t187));
}
{
uint8_t t188[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[536] = BinaryenConst(the_module, BinaryenLiteralVec128(t188));
+ expressions[538] = BinaryenConst(the_module, BinaryenLiteralVec128(t188));
}
- expressions[537] = BinaryenBinary(the_module, 156, expressions[536], expressions[535]);
+ expressions[539] = BinaryenBinary(the_module, 156, expressions[538], expressions[537]);
{
uint8_t t189[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[538] = BinaryenConst(the_module, BinaryenLiteralVec128(t189));
+ expressions[540] = BinaryenConst(the_module, BinaryenLiteralVec128(t189));
}
{
uint8_t t190[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[539] = BinaryenConst(the_module, BinaryenLiteralVec128(t190));
+ expressions[541] = BinaryenConst(the_module, BinaryenLiteralVec128(t190));
}
- expressions[540] = BinaryenBinary(the_module, 157, expressions[539], expressions[538]);
+ expressions[542] = BinaryenBinary(the_module, 157, expressions[541], expressions[540]);
{
uint8_t t191[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[541] = BinaryenConst(the_module, BinaryenLiteralVec128(t191));
+ expressions[543] = BinaryenConst(the_module, BinaryenLiteralVec128(t191));
}
{
uint8_t t192[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[542] = BinaryenConst(the_module, BinaryenLiteralVec128(t192));
+ expressions[544] = BinaryenConst(the_module, BinaryenLiteralVec128(t192));
}
- expressions[543] = BinaryenBinary(the_module, 158, expressions[542], expressions[541]);
+ expressions[545] = BinaryenBinary(the_module, 158, expressions[544], expressions[543]);
{
uint8_t t193[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[544] = BinaryenConst(the_module, BinaryenLiteralVec128(t193));
+ expressions[546] = BinaryenConst(the_module, BinaryenLiteralVec128(t193));
}
{
uint8_t t194[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[545] = BinaryenConst(the_module, BinaryenLiteralVec128(t194));
+ expressions[547] = BinaryenConst(the_module, BinaryenLiteralVec128(t194));
}
- expressions[546] = BinaryenBinary(the_module, 149, expressions[545], expressions[544]);
+ expressions[548] = BinaryenBinary(the_module, 149, expressions[547], expressions[546]);
{
uint8_t t195[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[547] = BinaryenConst(the_module, BinaryenLiteralVec128(t195));
+ expressions[549] = BinaryenConst(the_module, BinaryenLiteralVec128(t195));
}
{
uint8_t t196[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[548] = BinaryenConst(the_module, BinaryenLiteralVec128(t196));
+ expressions[550] = BinaryenConst(the_module, BinaryenLiteralVec128(t196));
}
- expressions[549] = BinaryenBinary(the_module, 150, expressions[548], expressions[547]);
+ expressions[551] = BinaryenBinary(the_module, 150, expressions[550], expressions[549]);
{
uint8_t t197[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[550] = BinaryenConst(the_module, BinaryenLiteralVec128(t197));
+ expressions[552] = BinaryenConst(the_module, BinaryenLiteralVec128(t197));
}
{
uint8_t t198[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[551] = BinaryenConst(the_module, BinaryenLiteralVec128(t198));
+ expressions[553] = BinaryenConst(the_module, BinaryenLiteralVec128(t198));
}
- expressions[552] = BinaryenBinary(the_module, 151, expressions[551], expressions[550]);
+ expressions[554] = BinaryenBinary(the_module, 151, expressions[553], expressions[552]);
{
uint8_t t199[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[553] = BinaryenConst(the_module, BinaryenLiteralVec128(t199));
+ expressions[555] = BinaryenConst(the_module, BinaryenLiteralVec128(t199));
}
{
uint8_t t200[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[554] = BinaryenConst(the_module, BinaryenLiteralVec128(t200));
+ expressions[556] = BinaryenConst(the_module, BinaryenLiteralVec128(t200));
}
- expressions[555] = BinaryenBinary(the_module, 152, expressions[554], expressions[553]);
+ expressions[557] = BinaryenBinary(the_module, 152, expressions[556], expressions[555]);
{
uint8_t t201[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[556] = BinaryenConst(the_module, BinaryenLiteralVec128(t201));
+ expressions[558] = BinaryenConst(the_module, BinaryenLiteralVec128(t201));
}
{
uint8_t t202[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[557] = BinaryenConst(the_module, BinaryenLiteralVec128(t202));
+ expressions[559] = BinaryenConst(the_module, BinaryenLiteralVec128(t202));
}
- expressions[558] = BinaryenBinary(the_module, 153, expressions[557], expressions[556]);
+ expressions[560] = BinaryenBinary(the_module, 153, expressions[559], expressions[558]);
{
uint8_t t203[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[559] = BinaryenConst(the_module, BinaryenLiteralVec128(t203));
+ expressions[561] = BinaryenConst(the_module, BinaryenLiteralVec128(t203));
}
{
uint8_t t204[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[560] = BinaryenConst(the_module, BinaryenLiteralVec128(t204));
+ expressions[562] = BinaryenConst(the_module, BinaryenLiteralVec128(t204));
}
- expressions[561] = BinaryenBinary(the_module, 159, expressions[560], expressions[559]);
+ expressions[563] = BinaryenBinary(the_module, 159, expressions[562], expressions[561]);
{
uint8_t t205[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[562] = BinaryenConst(the_module, BinaryenLiteralVec128(t205));
+ expressions[564] = BinaryenConst(the_module, BinaryenLiteralVec128(t205));
}
{
uint8_t t206[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[563] = BinaryenConst(the_module, BinaryenLiteralVec128(t206));
+ expressions[565] = BinaryenConst(the_module, BinaryenLiteralVec128(t206));
}
- expressions[564] = BinaryenBinary(the_module, 160, expressions[563], expressions[562]);
+ expressions[566] = BinaryenBinary(the_module, 160, expressions[565], expressions[564]);
{
uint8_t t207[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[565] = BinaryenConst(the_module, BinaryenLiteralVec128(t207));
+ expressions[567] = BinaryenConst(the_module, BinaryenLiteralVec128(t207));
}
{
uint8_t t208[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[566] = BinaryenConst(the_module, BinaryenLiteralVec128(t208));
+ expressions[568] = BinaryenConst(the_module, BinaryenLiteralVec128(t208));
}
- expressions[567] = BinaryenBinary(the_module, 161, expressions[566], expressions[565]);
+ expressions[569] = BinaryenBinary(the_module, 161, expressions[568], expressions[567]);
{
uint8_t t209[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[568] = BinaryenConst(the_module, BinaryenLiteralVec128(t209));
+ expressions[570] = BinaryenConst(the_module, BinaryenLiteralVec128(t209));
}
{
uint8_t t210[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[569] = BinaryenConst(the_module, BinaryenLiteralVec128(t210));
+ expressions[571] = BinaryenConst(the_module, BinaryenLiteralVec128(t210));
}
- expressions[570] = BinaryenBinary(the_module, 162, expressions[569], expressions[568]);
+ expressions[572] = BinaryenBinary(the_module, 162, expressions[571], expressions[570]);
{
uint8_t t211[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[571] = BinaryenConst(the_module, BinaryenLiteralVec128(t211));
+ expressions[573] = BinaryenConst(the_module, BinaryenLiteralVec128(t211));
}
{
uint8_t t212[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[572] = BinaryenConst(the_module, BinaryenLiteralVec128(t212));
+ expressions[574] = BinaryenConst(the_module, BinaryenLiteralVec128(t212));
}
- expressions[573] = BinaryenBinary(the_module, 163, expressions[572], expressions[571]);
+ expressions[575] = BinaryenBinary(the_module, 163, expressions[574], expressions[573]);
{
uint8_t t213[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[574] = BinaryenConst(the_module, BinaryenLiteralVec128(t213));
+ expressions[576] = BinaryenConst(the_module, BinaryenLiteralVec128(t213));
}
{
uint8_t t214[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[575] = BinaryenConst(the_module, BinaryenLiteralVec128(t214));
+ expressions[577] = BinaryenConst(the_module, BinaryenLiteralVec128(t214));
}
- expressions[576] = BinaryenBinary(the_module, 164, expressions[575], expressions[574]);
+ expressions[578] = BinaryenBinary(the_module, 164, expressions[577], expressions[576]);
{
uint8_t t215[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[577] = BinaryenConst(the_module, BinaryenLiteralVec128(t215));
+ expressions[579] = BinaryenConst(the_module, BinaryenLiteralVec128(t215));
}
{
uint8_t t216[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[578] = BinaryenConst(the_module, BinaryenLiteralVec128(t216));
+ expressions[580] = BinaryenConst(the_module, BinaryenLiteralVec128(t216));
}
- expressions[579] = BinaryenBinary(the_module, 165, expressions[578], expressions[577]);
+ expressions[581] = BinaryenBinary(the_module, 165, expressions[580], expressions[579]);
{
uint8_t t217[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[580] = BinaryenConst(the_module, BinaryenLiteralVec128(t217));
+ expressions[582] = BinaryenConst(the_module, BinaryenLiteralVec128(t217));
}
{
uint8_t t218[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[581] = BinaryenConst(the_module, BinaryenLiteralVec128(t218));
+ expressions[583] = BinaryenConst(the_module, BinaryenLiteralVec128(t218));
}
- expressions[582] = BinaryenBinary(the_module, 166, expressions[581], expressions[580]);
+ expressions[584] = BinaryenBinary(the_module, 166, expressions[583], expressions[582]);
{
uint8_t t219[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[583] = BinaryenConst(the_module, BinaryenLiteralVec128(t219));
+ expressions[585] = BinaryenConst(the_module, BinaryenLiteralVec128(t219));
}
{
uint8_t t220[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[584] = BinaryenConst(the_module, BinaryenLiteralVec128(t220));
+ expressions[586] = BinaryenConst(the_module, BinaryenLiteralVec128(t220));
}
- expressions[585] = BinaryenBinary(the_module, 167, expressions[584], expressions[583]);
+ expressions[587] = BinaryenBinary(the_module, 167, expressions[586], expressions[585]);
{
uint8_t t221[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[586] = BinaryenConst(the_module, BinaryenLiteralVec128(t221));
+ expressions[588] = BinaryenConst(the_module, BinaryenLiteralVec128(t221));
}
{
uint8_t t222[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[587] = BinaryenConst(the_module, BinaryenLiteralVec128(t222));
+ expressions[589] = BinaryenConst(the_module, BinaryenLiteralVec128(t222));
}
- expressions[588] = BinaryenBinary(the_module, 168, expressions[587], expressions[586]);
+ expressions[590] = BinaryenBinary(the_module, 168, expressions[589], expressions[588]);
{
uint8_t t223[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[589] = BinaryenConst(the_module, BinaryenLiteralVec128(t223));
+ expressions[591] = BinaryenConst(the_module, BinaryenLiteralVec128(t223));
}
{
uint8_t t224[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[590] = BinaryenConst(the_module, BinaryenLiteralVec128(t224));
+ expressions[592] = BinaryenConst(the_module, BinaryenLiteralVec128(t224));
}
- expressions[591] = BinaryenBinary(the_module, 169, expressions[590], expressions[589]);
+ expressions[593] = BinaryenBinary(the_module, 169, expressions[592], expressions[591]);
{
uint8_t t225[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[592] = BinaryenConst(the_module, BinaryenLiteralVec128(t225));
+ expressions[594] = BinaryenConst(the_module, BinaryenLiteralVec128(t225));
}
{
uint8_t t226[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[593] = BinaryenConst(the_module, BinaryenLiteralVec128(t226));
+ expressions[595] = BinaryenConst(the_module, BinaryenLiteralVec128(t226));
}
- expressions[594] = BinaryenBinary(the_module, 170, expressions[593], expressions[592]);
+ expressions[596] = BinaryenBinary(the_module, 170, expressions[595], expressions[594]);
{
uint8_t t227[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[595] = BinaryenConst(the_module, BinaryenLiteralVec128(t227));
+ expressions[597] = BinaryenConst(the_module, BinaryenLiteralVec128(t227));
}
{
uint8_t t228[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[596] = BinaryenConst(the_module, BinaryenLiteralVec128(t228));
+ expressions[598] = BinaryenConst(the_module, BinaryenLiteralVec128(t228));
}
- expressions[597] = BinaryenBinary(the_module, 171, expressions[596], expressions[595]);
+ expressions[599] = BinaryenBinary(the_module, 171, expressions[598], expressions[597]);
{
uint8_t t229[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[598] = BinaryenConst(the_module, BinaryenLiteralVec128(t229));
+ expressions[600] = BinaryenConst(the_module, BinaryenLiteralVec128(t229));
}
{
uint8_t t230[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[599] = BinaryenConst(the_module, BinaryenLiteralVec128(t230));
+ expressions[601] = BinaryenConst(the_module, BinaryenLiteralVec128(t230));
}
- expressions[600] = BinaryenBinary(the_module, 172, expressions[599], expressions[598]);
+ expressions[602] = BinaryenBinary(the_module, 172, expressions[601], expressions[600]);
{
uint8_t t231[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[601] = BinaryenConst(the_module, BinaryenLiteralVec128(t231));
+ expressions[603] = BinaryenConst(the_module, BinaryenLiteralVec128(t231));
}
- expressions[602] = BinaryenSIMDExtract(the_module, 0, expressions[601], 0);
+ expressions[604] = BinaryenSIMDExtract(the_module, 0, expressions[603], 0);
{
uint8_t t232[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[603] = BinaryenConst(the_module, BinaryenLiteralVec128(t232));
+ expressions[605] = BinaryenConst(the_module, BinaryenLiteralVec128(t232));
}
- expressions[604] = BinaryenSIMDExtract(the_module, 1, expressions[603], 0);
+ expressions[606] = BinaryenSIMDExtract(the_module, 1, expressions[605], 0);
{
uint8_t t233[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[605] = BinaryenConst(the_module, BinaryenLiteralVec128(t233));
+ expressions[607] = BinaryenConst(the_module, BinaryenLiteralVec128(t233));
}
- expressions[606] = BinaryenSIMDExtract(the_module, 2, expressions[605], 0);
+ expressions[608] = BinaryenSIMDExtract(the_module, 2, expressions[607], 0);
{
uint8_t t234[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[607] = BinaryenConst(the_module, BinaryenLiteralVec128(t234));
+ expressions[609] = BinaryenConst(the_module, BinaryenLiteralVec128(t234));
}
- expressions[608] = BinaryenSIMDExtract(the_module, 3, expressions[607], 0);
+ expressions[610] = BinaryenSIMDExtract(the_module, 3, expressions[609], 0);
{
uint8_t t235[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[609] = BinaryenConst(the_module, BinaryenLiteralVec128(t235));
+ expressions[611] = BinaryenConst(the_module, BinaryenLiteralVec128(t235));
}
- expressions[610] = BinaryenSIMDExtract(the_module, 4, expressions[609], 0);
+ expressions[612] = BinaryenSIMDExtract(the_module, 4, expressions[611], 0);
{
uint8_t t236[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[611] = BinaryenConst(the_module, BinaryenLiteralVec128(t236));
+ expressions[613] = BinaryenConst(the_module, BinaryenLiteralVec128(t236));
}
- expressions[612] = BinaryenSIMDExtract(the_module, 5, expressions[611], 0);
+ expressions[614] = BinaryenSIMDExtract(the_module, 5, expressions[613], 0);
{
uint8_t t237[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[613] = BinaryenConst(the_module, BinaryenLiteralVec128(t237));
+ expressions[615] = BinaryenConst(the_module, BinaryenLiteralVec128(t237));
}
- expressions[614] = BinaryenSIMDExtract(the_module, 6, expressions[613], 0);
+ expressions[616] = BinaryenSIMDExtract(the_module, 6, expressions[615], 0);
{
uint8_t t238[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[615] = BinaryenConst(the_module, BinaryenLiteralVec128(t238));
+ expressions[617] = BinaryenConst(the_module, BinaryenLiteralVec128(t238));
}
- expressions[616] = BinaryenSIMDExtract(the_module, 7, expressions[615], 0);
- expressions[617] = BinaryenConst(the_module, BinaryenLiteralInt32(42));
+ expressions[618] = BinaryenSIMDExtract(the_module, 7, expressions[617], 0);
+ expressions[619] = BinaryenConst(the_module, BinaryenLiteralInt32(42));
{
uint8_t t239[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[618] = BinaryenConst(the_module, BinaryenLiteralVec128(t239));
+ expressions[620] = BinaryenConst(the_module, BinaryenLiteralVec128(t239));
}
- expressions[619] = BinaryenSIMDReplace(the_module, 0, expressions[618], 0, expressions[617]);
- expressions[620] = BinaryenConst(the_module, BinaryenLiteralInt32(42));
+ expressions[621] = BinaryenSIMDReplace(the_module, 0, expressions[620], 0, expressions[619]);
+ expressions[622] = BinaryenConst(the_module, BinaryenLiteralInt32(42));
{
uint8_t t240[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[621] = BinaryenConst(the_module, BinaryenLiteralVec128(t240));
+ expressions[623] = BinaryenConst(the_module, BinaryenLiteralVec128(t240));
}
- expressions[622] = BinaryenSIMDReplace(the_module, 1, expressions[621], 0, expressions[620]);
- expressions[623] = BinaryenConst(the_module, BinaryenLiteralInt32(42));
+ expressions[624] = BinaryenSIMDReplace(the_module, 1, expressions[623], 0, expressions[622]);
+ expressions[625] = BinaryenConst(the_module, BinaryenLiteralInt32(42));
{
uint8_t t241[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[624] = BinaryenConst(the_module, BinaryenLiteralVec128(t241));
+ expressions[626] = BinaryenConst(the_module, BinaryenLiteralVec128(t241));
}
- expressions[625] = BinaryenSIMDReplace(the_module, 2, expressions[624], 0, expressions[623]);
- expressions[626] = BinaryenConst(the_module, BinaryenLiteralInt64(42));
+ expressions[627] = BinaryenSIMDReplace(the_module, 2, expressions[626], 0, expressions[625]);
+ expressions[628] = BinaryenConst(the_module, BinaryenLiteralInt64(42));
{
uint8_t t242[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[627] = BinaryenConst(the_module, BinaryenLiteralVec128(t242));
+ expressions[629] = BinaryenConst(the_module, BinaryenLiteralVec128(t242));
}
- expressions[628] = BinaryenSIMDReplace(the_module, 3, expressions[627], 0, expressions[626]);
- expressions[629] = BinaryenConst(the_module, BinaryenLiteralFloat32(42));
+ expressions[630] = BinaryenSIMDReplace(the_module, 3, expressions[629], 0, expressions[628]);
+ expressions[631] = BinaryenConst(the_module, BinaryenLiteralFloat32(42));
{
uint8_t t243[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[630] = BinaryenConst(the_module, BinaryenLiteralVec128(t243));
+ expressions[632] = BinaryenConst(the_module, BinaryenLiteralVec128(t243));
}
- expressions[631] = BinaryenSIMDReplace(the_module, 4, expressions[630], 0, expressions[629]);
- expressions[632] = BinaryenConst(the_module, BinaryenLiteralFloat64(42));
+ expressions[633] = BinaryenSIMDReplace(the_module, 4, expressions[632], 0, expressions[631]);
+ expressions[634] = BinaryenConst(the_module, BinaryenLiteralFloat64(42));
{
uint8_t t244[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[633] = BinaryenConst(the_module, BinaryenLiteralVec128(t244));
+ expressions[635] = BinaryenConst(the_module, BinaryenLiteralVec128(t244));
}
- expressions[634] = BinaryenSIMDReplace(the_module, 5, expressions[633], 0, expressions[632]);
+ expressions[636] = BinaryenSIMDReplace(the_module, 5, expressions[635], 0, expressions[634]);
{
uint8_t t245[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[635] = BinaryenConst(the_module, BinaryenLiteralVec128(t245));
+ expressions[637] = BinaryenConst(the_module, BinaryenLiteralVec128(t245));
}
- expressions[636] = BinaryenConst(the_module, BinaryenLiteralInt32(1));
- expressions[637] = BinaryenSIMDShift(the_module, 0, expressions[635], expressions[636]);
+ expressions[638] = BinaryenConst(the_module, BinaryenLiteralInt32(1));
+ expressions[639] = BinaryenSIMDShift(the_module, 0, expressions[637], expressions[638]);
{
uint8_t t246[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[638] = BinaryenConst(the_module, BinaryenLiteralVec128(t246));
+ expressions[640] = BinaryenConst(the_module, BinaryenLiteralVec128(t246));
}
- expressions[639] = BinaryenConst(the_module, BinaryenLiteralInt32(1));
- expressions[640] = BinaryenSIMDShift(the_module, 1, expressions[638], expressions[639]);
+ expressions[641] = BinaryenConst(the_module, BinaryenLiteralInt32(1));
+ expressions[642] = BinaryenSIMDShift(the_module, 1, expressions[640], expressions[641]);
{
uint8_t t247[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[641] = BinaryenConst(the_module, BinaryenLiteralVec128(t247));
+ expressions[643] = BinaryenConst(the_module, BinaryenLiteralVec128(t247));
}
- expressions[642] = BinaryenConst(the_module, BinaryenLiteralInt32(1));
- expressions[643] = BinaryenSIMDShift(the_module, 2, expressions[641], expressions[642]);
+ expressions[644] = BinaryenConst(the_module, BinaryenLiteralInt32(1));
+ expressions[645] = BinaryenSIMDShift(the_module, 2, expressions[643], expressions[644]);
{
uint8_t t248[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[644] = BinaryenConst(the_module, BinaryenLiteralVec128(t248));
+ expressions[646] = BinaryenConst(the_module, BinaryenLiteralVec128(t248));
}
- expressions[645] = BinaryenConst(the_module, BinaryenLiteralInt32(1));
- expressions[646] = BinaryenSIMDShift(the_module, 3, expressions[644], expressions[645]);
+ expressions[647] = BinaryenConst(the_module, BinaryenLiteralInt32(1));
+ expressions[648] = BinaryenSIMDShift(the_module, 3, expressions[646], expressions[647]);
{
uint8_t t249[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[647] = BinaryenConst(the_module, BinaryenLiteralVec128(t249));
+ expressions[649] = BinaryenConst(the_module, BinaryenLiteralVec128(t249));
}
- expressions[648] = BinaryenConst(the_module, BinaryenLiteralInt32(1));
- expressions[649] = BinaryenSIMDShift(the_module, 4, expressions[647], expressions[648]);
+ expressions[650] = BinaryenConst(the_module, BinaryenLiteralInt32(1));
+ expressions[651] = BinaryenSIMDShift(the_module, 4, expressions[649], expressions[650]);
{
uint8_t t250[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[650] = BinaryenConst(the_module, BinaryenLiteralVec128(t250));
+ expressions[652] = BinaryenConst(the_module, BinaryenLiteralVec128(t250));
}
- expressions[651] = BinaryenConst(the_module, BinaryenLiteralInt32(1));
- expressions[652] = BinaryenSIMDShift(the_module, 5, expressions[650], expressions[651]);
+ expressions[653] = BinaryenConst(the_module, BinaryenLiteralInt32(1));
+ expressions[654] = BinaryenSIMDShift(the_module, 5, expressions[652], expressions[653]);
{
uint8_t t251[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[653] = BinaryenConst(the_module, BinaryenLiteralVec128(t251));
+ expressions[655] = BinaryenConst(the_module, BinaryenLiteralVec128(t251));
}
- expressions[654] = BinaryenConst(the_module, BinaryenLiteralInt32(1));
- expressions[655] = BinaryenSIMDShift(the_module, 6, expressions[653], expressions[654]);
+ expressions[656] = BinaryenConst(the_module, BinaryenLiteralInt32(1));
+ expressions[657] = BinaryenSIMDShift(the_module, 6, expressions[655], expressions[656]);
{
uint8_t t252[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[656] = BinaryenConst(the_module, BinaryenLiteralVec128(t252));
+ expressions[658] = BinaryenConst(the_module, BinaryenLiteralVec128(t252));
}
- expressions[657] = BinaryenConst(the_module, BinaryenLiteralInt32(1));
- expressions[658] = BinaryenSIMDShift(the_module, 7, expressions[656], expressions[657]);
+ expressions[659] = BinaryenConst(the_module, BinaryenLiteralInt32(1));
+ expressions[660] = BinaryenSIMDShift(the_module, 7, expressions[658], expressions[659]);
{
uint8_t t253[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[659] = BinaryenConst(the_module, BinaryenLiteralVec128(t253));
+ expressions[661] = BinaryenConst(the_module, BinaryenLiteralVec128(t253));
}
- expressions[660] = BinaryenConst(the_module, BinaryenLiteralInt32(1));
- expressions[661] = BinaryenSIMDShift(the_module, 8, expressions[659], expressions[660]);
+ expressions[662] = BinaryenConst(the_module, BinaryenLiteralInt32(1));
+ expressions[663] = BinaryenSIMDShift(the_module, 8, expressions[661], expressions[662]);
{
uint8_t t254[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[662] = BinaryenConst(the_module, BinaryenLiteralVec128(t254));
+ expressions[664] = BinaryenConst(the_module, BinaryenLiteralVec128(t254));
}
- expressions[663] = BinaryenConst(the_module, BinaryenLiteralInt32(1));
- expressions[664] = BinaryenSIMDShift(the_module, 9, expressions[662], expressions[663]);
+ expressions[665] = BinaryenConst(the_module, BinaryenLiteralInt32(1));
+ expressions[666] = BinaryenSIMDShift(the_module, 9, expressions[664], expressions[665]);
{
uint8_t t255[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[665] = BinaryenConst(the_module, BinaryenLiteralVec128(t255));
+ expressions[667] = BinaryenConst(the_module, BinaryenLiteralVec128(t255));
}
- expressions[666] = BinaryenConst(the_module, BinaryenLiteralInt32(1));
- expressions[667] = BinaryenSIMDShift(the_module, 10, expressions[665], expressions[666]);
+ expressions[668] = BinaryenConst(the_module, BinaryenLiteralInt32(1));
+ expressions[669] = BinaryenSIMDShift(the_module, 10, expressions[667], expressions[668]);
{
uint8_t t256[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[668] = BinaryenConst(the_module, BinaryenLiteralVec128(t256));
+ expressions[670] = BinaryenConst(the_module, BinaryenLiteralVec128(t256));
}
- expressions[669] = BinaryenConst(the_module, BinaryenLiteralInt32(1));
- expressions[670] = BinaryenSIMDShift(the_module, 11, expressions[668], expressions[669]);
- expressions[671] = BinaryenConst(the_module, BinaryenLiteralInt32(128));
- expressions[672] = BinaryenSIMDLoad(the_module, 0, 0, 1, expressions[671]);
+ expressions[671] = BinaryenConst(the_module, BinaryenLiteralInt32(1));
+ expressions[672] = BinaryenSIMDShift(the_module, 11, expressions[670], expressions[671]);
expressions[673] = BinaryenConst(the_module, BinaryenLiteralInt32(128));
- expressions[674] = BinaryenSIMDLoad(the_module, 1, 16, 1, expressions[673]);
+ expressions[674] = BinaryenSIMDLoad(the_module, 0, 0, 1, expressions[673]);
expressions[675] = BinaryenConst(the_module, BinaryenLiteralInt32(128));
- expressions[676] = BinaryenSIMDLoad(the_module, 2, 16, 4, expressions[675]);
+ expressions[676] = BinaryenSIMDLoad(the_module, 1, 16, 1, expressions[675]);
expressions[677] = BinaryenConst(the_module, BinaryenLiteralInt32(128));
- expressions[678] = BinaryenSIMDLoad(the_module, 3, 0, 4, expressions[677]);
+ expressions[678] = BinaryenSIMDLoad(the_module, 2, 16, 4, expressions[677]);
expressions[679] = BinaryenConst(the_module, BinaryenLiteralInt32(128));
- expressions[680] = BinaryenSIMDLoad(the_module, 4, 0, 8, expressions[679]);
+ expressions[680] = BinaryenSIMDLoad(the_module, 3, 0, 4, expressions[679]);
expressions[681] = BinaryenConst(the_module, BinaryenLiteralInt32(128));
- expressions[682] = BinaryenSIMDLoad(the_module, 5, 0, 8, expressions[681]);
+ expressions[682] = BinaryenSIMDLoad(the_module, 4, 0, 8, expressions[681]);
expressions[683] = BinaryenConst(the_module, BinaryenLiteralInt32(128));
- expressions[684] = BinaryenSIMDLoad(the_module, 6, 0, 8, expressions[683]);
+ expressions[684] = BinaryenSIMDLoad(the_module, 5, 0, 8, expressions[683]);
expressions[685] = BinaryenConst(the_module, BinaryenLiteralInt32(128));
- expressions[686] = BinaryenSIMDLoad(the_module, 7, 0, 8, expressions[685]);
+ expressions[686] = BinaryenSIMDLoad(the_module, 6, 0, 8, expressions[685]);
expressions[687] = BinaryenConst(the_module, BinaryenLiteralInt32(128));
- expressions[688] = BinaryenSIMDLoad(the_module, 8, 0, 8, expressions[687]);
+ expressions[688] = BinaryenSIMDLoad(the_module, 7, 0, 8, expressions[687]);
expressions[689] = BinaryenConst(the_module, BinaryenLiteralInt32(128));
- expressions[690] = BinaryenSIMDLoad(the_module, 9, 0, 8, expressions[689]);
+ expressions[690] = BinaryenSIMDLoad(the_module, 8, 0, 8, expressions[689]);
+ expressions[691] = BinaryenConst(the_module, BinaryenLiteralInt32(128));
+ expressions[692] = BinaryenSIMDLoad(the_module, 9, 0, 8, expressions[691]);
{
uint8_t t257[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[691] = BinaryenConst(the_module, BinaryenLiteralVec128(t257));
+ expressions[693] = 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[692] = BinaryenConst(the_module, BinaryenLiteralVec128(t258));
+ expressions[694] = BinaryenConst(the_module, BinaryenLiteralVec128(t258));
}
{
uint8_t mask[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- expressions[693] = BinaryenSIMDShuffle(the_module, expressions[691], expressions[692], mask);
+ expressions[695] = BinaryenSIMDShuffle(the_module, expressions[693], expressions[694], mask);
}
{
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));
}
{
uint8_t t260[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[695] = BinaryenConst(the_module, BinaryenLiteralVec128(t260));
+ expressions[697] = 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[696] = BinaryenConst(the_module, BinaryenLiteralVec128(t261));
+ expressions[698] = BinaryenConst(the_module, BinaryenLiteralVec128(t261));
}
- expressions[697] = BinaryenSIMDTernary(the_module, 0, expressions[694], expressions[695], expressions[696]);
+ expressions[699] = BinaryenSIMDTernary(the_module, 0, expressions[696], expressions[697], expressions[698]);
{
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));
}
{
uint8_t t263[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[699] = BinaryenConst(the_module, BinaryenLiteralVec128(t263));
+ expressions[701] = 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[700] = BinaryenConst(the_module, BinaryenLiteralVec128(t264));
+ expressions[702] = BinaryenConst(the_module, BinaryenLiteralVec128(t264));
}
- expressions[701] = BinaryenSIMDTernary(the_module, 1, expressions[698], expressions[699], expressions[700]);
+ expressions[703] = BinaryenSIMDTernary(the_module, 1, expressions[700], expressions[701], expressions[702]);
{
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));
}
{
uint8_t t266[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[703] = BinaryenConst(the_module, BinaryenLiteralVec128(t266));
+ expressions[705] = 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[704] = BinaryenConst(the_module, BinaryenLiteralVec128(t267));
+ expressions[706] = BinaryenConst(the_module, BinaryenLiteralVec128(t267));
}
- expressions[705] = BinaryenSIMDTernary(the_module, 2, expressions[702], expressions[703], expressions[704]);
+ expressions[707] = BinaryenSIMDTernary(the_module, 2, expressions[704], expressions[705], expressions[706]);
{
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[708] = BinaryenConst(the_module, BinaryenLiteralVec128(t268));
}
{
uint8_t t269[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[707] = BinaryenConst(the_module, BinaryenLiteralVec128(t269));
+ expressions[709] = BinaryenConst(the_module, BinaryenLiteralVec128(t269));
}
{
uint8_t t270[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[708] = BinaryenConst(the_module, BinaryenLiteralVec128(t270));
+ expressions[710] = BinaryenConst(the_module, BinaryenLiteralVec128(t270));
}
- expressions[709] = BinaryenSIMDTernary(the_module, 3, expressions[706], expressions[707], expressions[708]);
+ expressions[711] = BinaryenSIMDTernary(the_module, 3, expressions[708], expressions[709], expressions[710]);
{
uint8_t t271[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[710] = BinaryenConst(the_module, BinaryenLiteralVec128(t271));
+ expressions[712] = BinaryenConst(the_module, BinaryenLiteralVec128(t271));
}
{
uint8_t t272[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[711] = BinaryenConst(the_module, BinaryenLiteralVec128(t272));
+ expressions[713] = BinaryenConst(the_module, BinaryenLiteralVec128(t272));
}
{
uint8_t t273[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[712] = BinaryenConst(the_module, BinaryenLiteralVec128(t273));
- }
- expressions[713] = BinaryenSIMDTernary(the_module, 4, expressions[710], expressions[711], expressions[712]);
- expressions[714] = BinaryenConst(the_module, BinaryenLiteralInt32(1024));
- expressions[715] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
- expressions[716] = BinaryenConst(the_module, BinaryenLiteralInt32(12));
- expressions[717] = BinaryenMemoryInit(the_module, 0, expressions[714], expressions[715], expressions[716]);
- expressions[718] = BinaryenDataDrop(the_module, 0);
- expressions[719] = BinaryenConst(the_module, BinaryenLiteralInt32(2048));
- expressions[720] = BinaryenConst(the_module, BinaryenLiteralInt32(1024));
- expressions[721] = BinaryenConst(the_module, BinaryenLiteralInt32(12));
- expressions[722] = BinaryenMemoryCopy(the_module, expressions[719], expressions[720], expressions[721]);
- expressions[723] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
- expressions[724] = BinaryenConst(the_module, BinaryenLiteralInt32(42));
- expressions[725] = BinaryenConst(the_module, BinaryenLiteralInt32(1024));
- expressions[726] = BinaryenMemoryFill(the_module, expressions[723], expressions[724], expressions[725]);
+ expressions[714] = BinaryenConst(the_module, BinaryenLiteralVec128(t273));
+ }
+ expressions[715] = BinaryenSIMDTernary(the_module, 4, expressions[712], expressions[713], expressions[714]);
+ expressions[716] = BinaryenConst(the_module, BinaryenLiteralInt32(1024));
+ expressions[717] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
+ expressions[718] = BinaryenConst(the_module, BinaryenLiteralInt32(12));
+ expressions[719] = BinaryenMemoryInit(the_module, 0, expressions[716], expressions[717], expressions[718]);
+ expressions[720] = BinaryenDataDrop(the_module, 0);
+ expressions[721] = BinaryenConst(the_module, BinaryenLiteralInt32(2048));
+ expressions[722] = BinaryenConst(the_module, BinaryenLiteralInt32(1024));
+ expressions[723] = BinaryenConst(the_module, BinaryenLiteralInt32(12));
+ expressions[724] = BinaryenMemoryCopy(the_module, expressions[721], expressions[722], expressions[723]);
+ expressions[725] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
+ expressions[726] = BinaryenConst(the_module, BinaryenLiteralInt32(42));
+ expressions[727] = BinaryenConst(the_module, BinaryenLiteralInt32(1024));
+ expressions[728] = BinaryenMemoryFill(the_module, expressions[725], expressions[726], expressions[727]);
{
BinaryenExpressionRef children[] = { 0 };
- expressions[727] = BinaryenBlock(the_module, NULL, children, 0, BinaryenTypeAuto());
+ expressions[729] = BinaryenBlock(the_module, NULL, children, 0, BinaryenTypeAuto());
}
- expressions[728] = BinaryenIf(the_module, expressions[18], expressions[19], expressions[20]);
- expressions[729] = BinaryenIf(the_module, expressions[21], expressions[22], expressions[0]);
- expressions[730] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
- expressions[731] = BinaryenLoop(the_module, "in", expressions[730]);
+ expressions[730] = BinaryenIf(the_module, expressions[18], expressions[19], expressions[20]);
+ expressions[731] = BinaryenIf(the_module, expressions[21], expressions[22], expressions[0]);
expressions[732] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
- expressions[733] = BinaryenLoop(the_module, NULL, expressions[732]);
- expressions[734] = BinaryenBreak(the_module, "the-value", expressions[23], expressions[24]);
- expressions[735] = BinaryenConst(the_module, BinaryenLiteralInt32(2));
- expressions[736] = BinaryenBreak(the_module, "the-nothing", expressions[735], expressions[0]);
- expressions[737] = BinaryenConst(the_module, BinaryenLiteralInt32(3));
- expressions[738] = BinaryenBreak(the_module, "the-value", expressions[0], expressions[737]);
- expressions[739] = BinaryenBreak(the_module, "the-nothing", expressions[0], expressions[0]);
+ expressions[733] = BinaryenLoop(the_module, "in", expressions[732]);
+ expressions[734] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
+ expressions[735] = BinaryenLoop(the_module, NULL, expressions[734]);
+ expressions[736] = BinaryenBreak(the_module, "the-value", expressions[23], expressions[24]);
+ expressions[737] = BinaryenConst(the_module, BinaryenLiteralInt32(2));
+ expressions[738] = BinaryenBreak(the_module, "the-nothing", expressions[737], expressions[0]);
+ expressions[739] = BinaryenConst(the_module, BinaryenLiteralInt32(3));
+ expressions[740] = BinaryenBreak(the_module, "the-value", expressions[0], expressions[739]);
+ expressions[741] = BinaryenBreak(the_module, "the-nothing", expressions[0], expressions[0]);
{
const char* names[] = { "the-value" };
- expressions[740] = BinaryenSwitch(the_module, names, 1, "the-value", expressions[25], expressions[26]);
+ expressions[742] = BinaryenSwitch(the_module, names, 1, "the-value", expressions[25], expressions[26]);
}
- expressions[741] = BinaryenConst(the_module, BinaryenLiteralInt32(2));
+ expressions[743] = BinaryenConst(the_module, BinaryenLiteralInt32(2));
{
const char* names[] = { "the-nothing" };
- expressions[742] = BinaryenSwitch(the_module, names, 1, "the-nothing", expressions[741], expressions[0]);
+ expressions[744] = BinaryenSwitch(the_module, names, 1, "the-nothing", expressions[743], expressions[0]);
}
{
BinaryenExpressionRef operands[] = { expressions[10], expressions[11], expressions[12], expressions[13] };
- expressions[743] = BinaryenCall(the_module, "kitchen()sinker", operands, 4, 2);
+ expressions[745] = BinaryenCall(the_module, "kitchen()sinker", operands, 4, 2);
}
- expressions[744] = BinaryenUnary(the_module, 20, expressions[743]);
+ expressions[746] = BinaryenUnary(the_module, 20, expressions[745]);
{
BinaryenExpressionRef operands[] = { expressions[8], expressions[9] };
- expressions[745] = BinaryenCall(the_module, "an-imported", operands, 2, 4);
+ expressions[747] = BinaryenCall(the_module, "an-imported", operands, 2, 4);
}
- expressions[746] = BinaryenUnary(the_module, 25, expressions[745]);
- expressions[747] = BinaryenUnary(the_module, 20, expressions[746]);
- expressions[748] = BinaryenConst(the_module, BinaryenLiteralInt32(2449));
+ expressions[748] = BinaryenUnary(the_module, 25, expressions[747]);
+ expressions[749] = BinaryenUnary(the_module, 20, expressions[748]);
+ expressions[750] = BinaryenConst(the_module, BinaryenLiteralInt32(2449));
{
BinaryenExpressionRef operands[] = { expressions[14], expressions[15], expressions[16], expressions[17] };
- expressions[749] = BinaryenCallIndirect(the_module, expressions[748], operands, 4, 9, 2);
- }
- expressions[750] = BinaryenUnary(the_module, 20, expressions[749]);
- expressions[751] = BinaryenLocalGet(the_module, 0, 2);
- expressions[752] = BinaryenDrop(the_module, expressions[751]);
- expressions[753] = BinaryenConst(the_module, BinaryenLiteralInt32(101));
- expressions[754] = BinaryenLocalSet(the_module, 0, expressions[753]);
- expressions[755] = BinaryenConst(the_module, BinaryenLiteralInt32(102));
- expressions[756] = BinaryenLocalTee(the_module, 0, expressions[755], 2);
- expressions[757] = BinaryenDrop(the_module, expressions[756]);
- expressions[758] = BinaryenConst(the_module, BinaryenLiteralInt32(1));
- expressions[759] = BinaryenLoad(the_module, 4, 0, 0, 0, 2, expressions[758]);
- expressions[760] = BinaryenConst(the_module, BinaryenLiteralInt32(8));
- expressions[761] = BinaryenLoad(the_module, 2, 1, 2, 1, 3, expressions[760]);
- expressions[762] = BinaryenConst(the_module, BinaryenLiteralInt32(2));
- expressions[763] = BinaryenLoad(the_module, 4, 0, 0, 0, 4, expressions[762]);
- expressions[764] = BinaryenConst(the_module, BinaryenLiteralInt32(9));
- expressions[765] = BinaryenLoad(the_module, 8, 0, 2, 8, 5, expressions[764]);
- expressions[766] = BinaryenStore(the_module, 4, 0, 0, expressions[30], expressions[31], 2);
- expressions[767] = BinaryenStore(the_module, 8, 2, 4, expressions[32], expressions[33], 3);
- expressions[768] = BinaryenSelect(the_module, expressions[27], expressions[28], expressions[29]);
- expressions[769] = BinaryenConst(the_module, BinaryenLiteralInt32(1337));
- expressions[770] = BinaryenReturn(the_module, expressions[769]);
+ expressions[751] = BinaryenCallIndirect(the_module, expressions[750], operands, 4, 11, 2);
+ }
+ expressions[752] = BinaryenUnary(the_module, 20, expressions[751]);
+ expressions[753] = BinaryenLocalGet(the_module, 0, 2);
+ expressions[754] = BinaryenDrop(the_module, expressions[753]);
+ expressions[755] = BinaryenConst(the_module, BinaryenLiteralInt32(101));
+ expressions[756] = BinaryenLocalSet(the_module, 0, expressions[755]);
+ expressions[757] = BinaryenConst(the_module, BinaryenLiteralInt32(102));
+ expressions[758] = BinaryenLocalTee(the_module, 0, expressions[757], 2);
+ expressions[759] = BinaryenDrop(the_module, expressions[758]);
+ expressions[760] = BinaryenConst(the_module, BinaryenLiteralInt32(1));
+ expressions[761] = BinaryenLoad(the_module, 4, 0, 0, 0, 2, expressions[760]);
+ expressions[762] = BinaryenConst(the_module, BinaryenLiteralInt32(8));
+ expressions[763] = BinaryenLoad(the_module, 2, 1, 2, 1, 3, expressions[762]);
+ expressions[764] = BinaryenConst(the_module, BinaryenLiteralInt32(2));
+ expressions[765] = BinaryenLoad(the_module, 4, 0, 0, 0, 4, expressions[764]);
+ expressions[766] = BinaryenConst(the_module, BinaryenLiteralInt32(9));
+ expressions[767] = BinaryenLoad(the_module, 8, 0, 2, 8, 5, expressions[766]);
+ expressions[768] = BinaryenStore(the_module, 4, 0, 0, expressions[30], expressions[31], 2);
+ expressions[769] = BinaryenStore(the_module, 8, 2, 4, expressions[32], expressions[33], 3);
+ expressions[770] = BinaryenSelect(the_module, expressions[27], expressions[28], expressions[29], BinaryenTypeAuto());
+ expressions[771] = BinaryenConst(the_module, BinaryenLiteralInt32(1337));
+ expressions[772] = BinaryenReturn(the_module, expressions[771]);
{
BinaryenExpressionRef operands[] = { expressions[10], expressions[11], expressions[12], expressions[13] };
- expressions[771] = BinaryenReturnCall(the_module, "kitchen()sinker", operands, 4, 2);
+ expressions[773] = BinaryenReturnCall(the_module, "kitchen()sinker", operands, 4, 2);
}
- expressions[772] = BinaryenConst(the_module, BinaryenLiteralInt32(2449));
+ expressions[774] = BinaryenConst(the_module, BinaryenLiteralInt32(2449));
{
BinaryenExpressionRef operands[] = { expressions[14], expressions[15], expressions[16], expressions[17] };
- expressions[773] = BinaryenReturnCallIndirect(the_module, expressions[772], operands, 4, 9, 2);
- }
- expressions[774] = BinaryenTry(the_module, expressions[35], expressions[43]);
- expressions[775] = BinaryenAtomicLoad(the_module, 4, 0, 2, expressions[23]);
- expressions[776] = BinaryenAtomicStore(the_module, 4, 0, expressions[23], expressions[775], 2);
- expressions[777] = BinaryenAtomicWait(the_module, expressions[23], expressions[23], expressions[33], 2);
- expressions[778] = BinaryenDrop(the_module, expressions[777]);
- expressions[779] = BinaryenAtomicNotify(the_module, expressions[23], expressions[23]);
- expressions[780] = BinaryenDrop(the_module, expressions[779]);
- expressions[781] = BinaryenAtomicFence(the_module);
- expressions[782] = BinaryenPop(the_module, 2);
- expressions[783] = BinaryenPush(the_module, expressions[782]);
- expressions[784] = BinaryenPop(the_module, 3);
- expressions[785] = BinaryenPush(the_module, expressions[784]);
- expressions[786] = BinaryenPop(the_module, 4);
- expressions[787] = BinaryenPush(the_module, expressions[786]);
- expressions[788] = BinaryenPop(the_module, 5);
- expressions[789] = BinaryenPush(the_module, expressions[788]);
- expressions[790] = BinaryenPop(the_module, 7);
- expressions[791] = BinaryenPush(the_module, expressions[790]);
- expressions[792] = BinaryenPop(the_module, 8);
- expressions[793] = BinaryenPush(the_module, expressions[792]);
- expressions[794] = BinaryenNop(the_module);
- expressions[795] = BinaryenUnreachable(the_module);
- BinaryenExpressionPrint(expressions[51]);
+ expressions[775] = BinaryenReturnCallIndirect(the_module, expressions[774], operands, 4, 11, 2);
+ }
+ expressions[776] = BinaryenRefIsNull(the_module, expressions[34]);
+ expressions[777] = BinaryenRefIsNull(the_module, expressions[35]);
+ expressions[778] = BinaryenSelect(the_module, expressions[27], expressions[34], expressions[35], 7);
+ expressions[779] = BinaryenTry(the_module, expressions[37], expressions[45]);
+ expressions[780] = BinaryenAtomicLoad(the_module, 4, 0, 2, expressions[23]);
+ expressions[781] = BinaryenAtomicStore(the_module, 4, 0, expressions[23], expressions[780], 2);
+ expressions[782] = BinaryenAtomicWait(the_module, expressions[23], expressions[23], expressions[33], 2);
+ expressions[783] = BinaryenDrop(the_module, expressions[782]);
+ expressions[784] = BinaryenAtomicNotify(the_module, expressions[23], expressions[23]);
+ expressions[785] = BinaryenDrop(the_module, expressions[784]);
+ expressions[786] = BinaryenAtomicFence(the_module);
+ expressions[787] = BinaryenPop(the_module, 2);
+ expressions[788] = BinaryenPush(the_module, expressions[787]);
+ expressions[789] = BinaryenPop(the_module, 3);
+ expressions[790] = BinaryenPush(the_module, expressions[789]);
+ expressions[791] = BinaryenPop(the_module, 4);
+ expressions[792] = BinaryenPush(the_module, expressions[791]);
+ expressions[793] = BinaryenPop(the_module, 5);
+ expressions[794] = BinaryenPush(the_module, expressions[793]);
+ expressions[795] = BinaryenPop(the_module, 7);
+ expressions[796] = BinaryenPush(the_module, expressions[795]);
+ expressions[797] = BinaryenPop(the_module, 8);
+ expressions[798] = BinaryenPush(the_module, expressions[797]);
+ expressions[799] = BinaryenPop(the_module, 9);
+ expressions[800] = BinaryenPush(the_module, expressions[799]);
+ expressions[801] = BinaryenPop(the_module, 10);
+ expressions[802] = BinaryenPush(the_module, expressions[801]);
+ expressions[803] = BinaryenPop(the_module, 7);
+ expressions[804] = BinaryenPush(the_module, expressions[803]);
+ expressions[805] = BinaryenPop(the_module, 9);
+ expressions[806] = BinaryenPush(the_module, expressions[805]);
+ expressions[807] = BinaryenPop(the_module, 10);
+ expressions[808] = BinaryenPush(the_module, expressions[807]);
+ expressions[809] = BinaryenNop(the_module);
+ expressions[810] = BinaryenUnreachable(the_module);
+ BinaryenExpressionPrint(expressions[53]);
(f32.neg
(f32.const -33.61199951171875)
)
{
- 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],
- 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[216], expressions[219], expressions[222], expressions[225],
- expressions[228], expressions[231], expressions[234], expressions[237], expressions[240], expressions[243],
- expressions[246], expressions[249], expressions[252], expressions[255], expressions[258], expressions[261],
- expressions[264], expressions[267], expressions[270], expressions[273], expressions[276], expressions[279],
- expressions[282], expressions[285], expressions[288], expressions[291], expressions[294], expressions[297],
- expressions[300], expressions[303], expressions[306], expressions[309], expressions[312], expressions[315],
- expressions[318], expressions[321], expressions[324], expressions[327], expressions[330], expressions[333],
- expressions[336], expressions[339], expressions[342], expressions[345], expressions[348], expressions[351],
- expressions[354], expressions[357], expressions[360], expressions[363], expressions[366], expressions[369],
- expressions[372], expressions[375], expressions[378], expressions[381], expressions[384], expressions[387],
- expressions[390], expressions[393], expressions[396], expressions[399], expressions[402], expressions[405],
- expressions[408], expressions[411], expressions[414], expressions[417], expressions[420], expressions[423],
- expressions[426], expressions[429], expressions[432], expressions[435], expressions[438], expressions[441],
- expressions[444], expressions[447], expressions[450], expressions[453], expressions[456], expressions[459],
- expressions[462], expressions[465], expressions[468], expressions[471], expressions[474], expressions[477],
- expressions[480], expressions[483], expressions[486], expressions[489], expressions[492], expressions[495],
- expressions[498], expressions[501], expressions[504], expressions[507], expressions[510], expressions[513],
- expressions[516], expressions[519], expressions[522], expressions[525], expressions[528], expressions[531],
- expressions[534], expressions[537], expressions[540], expressions[543], expressions[546], expressions[549],
- expressions[552], expressions[555], expressions[558], expressions[561], expressions[564], expressions[567],
- expressions[570], expressions[573], expressions[576], expressions[579], expressions[582], expressions[585],
- expressions[588], expressions[591], expressions[594], expressions[597], expressions[600], expressions[602],
- expressions[604], expressions[606], expressions[608], expressions[610], expressions[612], expressions[614],
- expressions[616], expressions[619], expressions[622], expressions[625], expressions[628], expressions[631],
- expressions[634], expressions[637], expressions[640], expressions[643], expressions[646], expressions[649],
- expressions[652], expressions[655], expressions[658], expressions[661], expressions[664], expressions[667],
- expressions[670], expressions[672], expressions[674], expressions[676], expressions[678], expressions[680],
- expressions[682], expressions[684], expressions[686], expressions[688], expressions[690], expressions[693],
- expressions[697], expressions[701], expressions[705], expressions[709], expressions[713], expressions[717],
- expressions[718], expressions[722], expressions[726], expressions[727], expressions[728], expressions[729],
- expressions[731], expressions[733], expressions[734], expressions[736], expressions[738], expressions[739],
- expressions[740], expressions[742], expressions[744], expressions[747], expressions[750], expressions[752],
- expressions[754], expressions[757], expressions[759], expressions[761], expressions[763], expressions[765],
- expressions[766], expressions[767], expressions[768], expressions[770], expressions[771], expressions[773],
- expressions[774], expressions[776], expressions[778], expressions[780], expressions[781], expressions[783],
- expressions[785], expressions[787], expressions[789], expressions[791], expressions[793], expressions[794],
- expressions[795] };
- expressions[796] = BinaryenBlock(the_module, "the-value", children, 300, BinaryenTypeAuto());
- }
- expressions[797] = BinaryenDrop(the_module, expressions[796]);
- {
- BinaryenExpressionRef children[] = { expressions[797] };
- expressions[798] = BinaryenBlock(the_module, "the-nothing", children, 1, BinaryenTypeAuto());
- }
- expressions[799] = BinaryenConst(the_module, BinaryenLiteralInt32(42));
- {
- BinaryenExpressionRef children[] = { expressions[798], expressions[799] };
- expressions[800] = BinaryenBlock(the_module, "the-body", children, 2, BinaryenTypeAuto());
- }
- {
- BinaryenType varTypes[] = { 2, 8 };
- functions[0] = BinaryenAddFunction(the_module, "kitchen()sinker", 9, 2, varTypes, 2, expressions[800]);
- }
- expressions[801] = BinaryenConst(the_module, BinaryenLiteralInt32(7));
- globals[0] = BinaryenAddGlobal(the_module, "a-global", 2, 0, expressions[801]);
- expressions[802] = BinaryenConst(the_module, BinaryenLiteralFloat32(7.5));
- globals[1] = BinaryenAddGlobal(the_module, "a-mutable-global", 4, 1, expressions[802]);
+ 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[599], expressions[602], expressions[604],
+ expressions[606], expressions[608], expressions[610], expressions[612], expressions[614], expressions[616],
+ 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[669],
+ expressions[672], expressions[674], expressions[676], expressions[678], expressions[680], expressions[682],
+ expressions[684], expressions[686], expressions[688], expressions[690], expressions[692], expressions[695],
+ expressions[699], expressions[703], expressions[707], expressions[711], expressions[715], expressions[719],
+ expressions[720], expressions[724], expressions[728], expressions[729], expressions[730], expressions[731],
+ expressions[733], expressions[735], expressions[736], expressions[738], expressions[740], expressions[741],
+ expressions[742], expressions[744], expressions[746], expressions[749], expressions[752], expressions[754],
+ expressions[756], expressions[759], expressions[761], expressions[763], expressions[765], expressions[767],
+ expressions[768], expressions[769], expressions[770], expressions[772], expressions[773], expressions[775],
+ expressions[776], expressions[777], expressions[778], expressions[779], expressions[781], expressions[783],
+ expressions[785], expressions[786], expressions[788], expressions[790], expressions[792], expressions[794],
+ expressions[796], expressions[798], expressions[800], expressions[802], expressions[804], expressions[806],
+ expressions[808], expressions[809], expressions[810] };
+ expressions[811] = BinaryenBlock(the_module, "the-value", children, 308, BinaryenTypeAuto());
+ }
+ expressions[812] = BinaryenDrop(the_module, expressions[811]);
+ {
+ BinaryenExpressionRef children[] = { expressions[812] };
+ expressions[813] = BinaryenBlock(the_module, "the-nothing", children, 1, BinaryenTypeAuto());
+ }
+ expressions[814] = BinaryenConst(the_module, BinaryenLiteralInt32(42));
+ {
+ BinaryenExpressionRef children[] = { expressions[813], expressions[814] };
+ expressions[815] = BinaryenBlock(the_module, "the-body", children, 2, BinaryenTypeAuto());
+ }
+ {
+ BinaryenType varTypes[] = { 2, 10 };
+ functions[0] = BinaryenAddFunction(the_module, "kitchen()sinker", 11, 2, varTypes, 2, expressions[815]);
+ }
+ expressions[816] = BinaryenConst(the_module, BinaryenLiteralInt32(7));
+ globals[0] = BinaryenAddGlobal(the_module, "a-global", 2, 0, expressions[816]);
+ expressions[817] = BinaryenConst(the_module, BinaryenLiteralFloat32(7.5));
+ globals[1] = BinaryenAddGlobal(the_module, "a-mutable-global", 4, 1, expressions[817]);
{
BinaryenType t274[] = {2, 5};
- BinaryenTypeCreate(t274, 2); // 10
+ BinaryenTypeCreate(t274, 2); // 12
}
- BinaryenAddFunctionImport(the_module, "an-imported", "module", "base", 10, 4);
+ BinaryenAddFunctionImport(the_module, "an-imported", "module", "base", 12, 4);
exports[0] = BinaryenAddFunctionExport(the_module, "kitchen()sinker", "kitchen_sinker");
BinaryenFunctionGetName(functions[0]);
- expressions[803] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
+ expressions[818] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
{
const char* funcNames[] = { "kitchen()sinker" };
- BinaryenSetFunctionTable(the_module, 1, 1, funcNames, 1, expressions[803]);
+ BinaryenSetFunctionTable(the_module, 1, 1, funcNames, 1, expressions[818]);
}
- expressions[804] = BinaryenConst(the_module, BinaryenLiteralInt32(10));
+ expressions[819] = 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[804], expressions[0] };
+ BinaryenExpressionRef segmentOffsets[] = { expressions[819], expressions[0] };
BinaryenIndex segmentSizes[] = { 12, 12 };
BinaryenSetMemory(the_module, 1, 256, "mem", segments, segmentPassive, segmentOffsets, segmentSizes, 2, 1);
}
- expressions[805] = BinaryenNop(the_module);
+ expressions[820] = BinaryenNop(the_module);
{
BinaryenType varTypes[] = { 0 };
- functions[1] = BinaryenAddFunction(the_module, "starter", 0, 0, varTypes, 0, expressions[805]);
+ functions[1] = BinaryenAddFunction(the_module, "starter", 0, 0, varTypes, 0, expressions[820]);
}
BinaryenSetStart(the_module, functions[1]);
BinaryenModuleAutoDrop(the_module);
@@ -3395,6 +3411,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)
@@ -3447,9 +3480,24 @@ int main() {
(f64.pop)
)
(push
+ (funcref.pop)
+ )
+ (push
(anyref.pop)
)
(push
+ (nullref.pop)
+ )
+ (push
+ (exnref.pop)
+ )
+ (push
+ (funcref.pop)
+ )
+ (push
+ (nullref.pop)
+ )
+ (push
(exnref.pop)
)
(nop)
@@ -4400,20 +4448,22 @@ optimized:
// BinaryenTypeFloat32: 4
// BinaryenTypeFloat64: 5
// BinaryenTypeVec128: 6
- // BinaryenTypeAnyref: 7
- // BinaryenTypeExnref: 8
+ // BinaryenTypeFuncref: 7
+ // BinaryenTypeAnyref: 8
+ // BinaryenTypeNullref: 9
+ // BinaryenTypeExnref: 10
// BinaryenTypeAuto: -1
{
BinaryenType t275[] = {2, 2};
- BinaryenTypeCreate(t275, 2); // 11
+ BinaryenTypeCreate(t275, 2); // 13
}
{
BinaryenType t276[] = {2, 2};
- BinaryenTypeCreate(t276, 2); // 11
+ BinaryenTypeCreate(t276, 2); // 13
}
{
BinaryenType t277[] = {4, 4};
- BinaryenTypeCreate(t277, 2); // 12
+ BinaryenTypeCreate(t277, 2); // 14
}
return 0;
}
@@ -4425,8 +4475,10 @@ optimized:
// BinaryenTypeFloat32: 4
// BinaryenTypeFloat64: 5
// BinaryenTypeVec128: 6
- // BinaryenTypeAnyref: 7
- // BinaryenTypeExnref: 8
+ // BinaryenTypeFuncref: 7
+ // BinaryenTypeAnyref: 8
+ // BinaryenTypeNullref: 9
+ // BinaryenTypeExnref: 10
// BinaryenTypeAuto: -1
BinaryenFeatureMVP: 0
BinaryenFeatureAtomics: 1
@@ -6060,6 +6112,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)
@@ -6112,9 +6181,24 @@ BinaryenFeatureAll: 511
(f64.pop)
)
(push
+ (funcref.pop)
+ )
+ (push
(anyref.pop)
)
(push
+ (nullref.pop)
+ )
+ (push
+ (exnref.pop)
+ )
+ (push
+ (funcref.pop)
+ )
+ (push
+ (nullref.pop)
+ )
+ (push
(exnref.pop)
)
(nop)
diff --git a/test/example/c-api-kitchen-sink.txt.txt b/test/example/c-api-kitchen-sink.txt.txt
index b69d3c7fa..a03eafe38 100644
--- a/test/example/c-api-kitchen-sink.txt.txt
+++ b/test/example/c-api-kitchen-sink.txt.txt
@@ -1619,6 +1619,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)
@@ -1671,9 +1688,24 @@
(f64.pop)
)
(push
+ (funcref.pop)
+ )
+ (push
(anyref.pop)
)
(push
+ (nullref.pop)
+ )
+ (push
+ (exnref.pop)
+ )
+ (push
+ (funcref.pop)
+ )
+ (push
+ (nullref.pop)
+ )
+ (push
(exnref.pop)
)
(nop)
diff --git a/test/exception-handling.wast b/test/exception-handling.wast
index 275350c61..0929daeec 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 85a21e9bf..93945c39c 100644
--- a/test/exception-handling.wast.from-wast
+++ b/test/exception-handling.wast.from-wast
@@ -63,4 +63,23 @@
)
)
)
+ (func $subtype_test (; 4 ;)
+ (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 f83ad5d48..369b17dd9 100644
--- a/test/exception-handling.wast.fromBinary
+++ b/test/exception-handling.wast.fromBinary
@@ -66,5 +66,24 @@
)
)
)
+ (func $subtype_test (; 4 ;)
+ (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 0e9ceecae..87ab1c772 100644
--- a/test/exception-handling.wast.fromBinary.noDebugInfo
+++ b/test/exception-handling.wast.fromBinary.noDebugInfo
@@ -66,5 +66,24 @@
)
)
)
+ (func $4 (; 4 ;)
+ (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/duplicate-function-elimination_all-features.txt b/test/passes/duplicate-function-elimination_all-features.txt
new file mode 100644
index 000000000..edb6e7e1f
--- /dev/null
+++ b/test/passes/duplicate-function-elimination_all-features.txt
@@ -0,0 +1,10 @@
+(module
+ (type $none_=>_i32 (func (result i32)))
+ (type $none_=>_funcref (func (result funcref)))
+ (func $0 (; 0 ;) (result i32)
+ (i32.const 0)
+ )
+ (func $test (; 1 ;) (result funcref)
+ (ref.func $0)
+ )
+)
diff --git a/test/passes/duplicate-function-elimination_all-features.wast b/test/passes/duplicate-function-elimination_all-features.wast
new file mode 100644
index 000000000..587271728
--- /dev/null
+++ b/test/passes/duplicate-function-elimination_all-features.wast
@@ -0,0 +1,12 @@
+;; --dupliate-function-elimination should not remove functions used in ref.func.
+(module
+ (func $0 (result i32)
+ (i32.const 0)
+ )
+ (func $1 (result i32)
+ (i32.const 0)
+ )
+ (func $test (result funcref)
+ (ref.func $1)
+ )
+)
diff --git a/test/passes/flatten.txt b/test/passes/flatten_all-features.txt
index 7d7eb80dd..38dc9bdfe 100644
--- a/test/passes/flatten.txt
+++ b/test/passes/flatten_all-features.txt
@@ -5,6 +5,7 @@
(type $i32_=>_i32 (func (param i32) (result i32)))
(type $none_=>_f32 (func (result f32)))
(type $i64_i64_=>_i64 (func (param i64 i64) (result i64)))
+ (type $none_=>_anyref (func (result anyref)))
(memory $0 10)
(table $0 1 1 funcref)
(elem (i32.const 0) $call-me)
@@ -2312,4 +2313,51 @@
)
(unreachable)
)
+ (func $subtype (; 43 ;) (result anyref)
+ (local $0 nullref)
+ (local $1 anyref)
+ (local $2 nullref)
+ (local $3 nullref)
+ (local $4 nullref)
+ (local $5 nullref)
+ (local $6 nullref)
+ (local $7 anyref)
+ (block $label0
+ (block $block
+ (local.set $1
+ (ref.null)
+ )
+ (local.set $2
+ (ref.null)
+ )
+ (br_if $label0
+ (i32.const 0)
+ )
+ (local.set $3
+ (local.get $2)
+ )
+ (local.set $0
+ (local.get $3)
+ )
+ (local.set $4
+ (local.get $0)
+ )
+ (local.set $5
+ (local.get $4)
+ )
+ )
+ (local.set $6
+ (local.get $5)
+ )
+ (local.set $1
+ (local.get $6)
+ )
+ )
+ (local.set $7
+ (local.get $1)
+ )
+ (return
+ (local.get $7)
+ )
+ )
)
diff --git a/test/passes/flatten.wast b/test/passes/flatten_all-features.wast
index dbfc8165c..fe8629e73 100644
--- a/test/passes/flatten.wast
+++ b/test/passes/flatten_all-features.wast
@@ -1019,4 +1019,24 @@
(func $return (param $x i32) (result i32)
(return (i32.sub (i32.const 1) (i32.const 2)))
)
+
+ ;; subtypes
+
+ ;; br_if leaves a value on the stack if not taken, which later can be the last
+ ;; element of the enclosing innermost block and flow out. So in case br_if
+ ;; targets an outer branch whose return type is a supertype of the br_if's
+ ;; value type, we need the value to be set into two locals: one with the outer
+ ;; block's type, and one with its value type.
+ (func $subtype (result anyref) (local $0 nullref)
+ (block $label0 (result anyref)
+ (block (result nullref)
+ (local.tee $0
+ (br_if $label0
+ (ref.null)
+ (i32.const 0)
+ )
+ )
+ )
+ )
+ )
)
diff --git a/test/passes/flatten_local-cse.txt b/test/passes/flatten_local-cse_all-features.txt
index f576ccefe..0697e27a5 100644
--- a/test/passes/flatten_local-cse.txt
+++ b/test/passes/flatten_local-cse_all-features.txt
@@ -761,3 +761,32 @@
)
)
)
+(module
+ (type $none_=>_funcref (func (result funcref)))
+ (func $subtype-test (; 0 ;) (result funcref)
+ (local $0 nullref)
+ (local $1 nullref)
+ (local $2 funcref)
+ (local $3 funcref)
+ (block
+ (nop)
+ (loop $label$1
+ (local.set $0
+ (ref.null)
+ )
+ )
+ (local.set $1
+ (local.get $0)
+ )
+ (local.set $2
+ (local.get $0)
+ )
+ )
+ (local.set $3
+ (local.get $2)
+ )
+ (return
+ (local.get $2)
+ )
+ )
+)
diff --git a/test/passes/flatten_local-cse.wast b/test/passes/flatten_local-cse_all-features.wast
index b967e9177..6ca154278 100644
--- a/test/passes/flatten_local-cse.wast
+++ b/test/passes/flatten_local-cse_all-features.wast
@@ -287,3 +287,15 @@
(local.set $y (global.get $glob))
)
)
+
+;; After --flatten, there will be a series of chain copies between multiple
+;; locals, but some of the locals will be nullref type and others funcref type.
+;; We cannot make locals of different types a common subexpression.
+(module
+ (func $subtype-test (result funcref)
+ (nop)
+ (loop $label$1 (result nullref)
+ (ref.null)
+ )
+ )
+)
diff --git a/test/passes/inlining_all-features.txt b/test/passes/inlining_all-features.txt
new file mode 100644
index 000000000..ec99a3603
--- /dev/null
+++ b/test/passes/inlining_all-features.txt
@@ -0,0 +1,16 @@
+(module
+ (type $none_=>_none (func))
+ (type $none_=>_funcref (func (result funcref)))
+ (export "test" (func $test))
+ (func $foo (; 0 ;)
+ (nop)
+ )
+ (func $test (; 1 ;) (result funcref)
+ (block
+ (block $__inlined_func$foo
+ (nop)
+ )
+ )
+ (ref.func $foo)
+ )
+)
diff --git a/test/passes/inlining_all-features.wast b/test/passes/inlining_all-features.wast
new file mode 100644
index 000000000..352978eda
--- /dev/null
+++ b/test/passes/inlining_all-features.wast
@@ -0,0 +1,10 @@
+(module
+ (export "test" (func $test))
+ ;; $foo should not be removed after being inlined, because there is 'ref.func'
+ ;; instruction that refers to it
+ (func $foo)
+ (func $test (result funcref)
+ (call $foo)
+ (ref.func $foo)
+ )
+)
diff --git a/test/passes/instrument-locals_all-features.txt b/test/passes/instrument-locals_all-features.txt
index 92924611c..efda489bd 100644
--- a/test/passes/instrument-locals_all-features.txt
+++ b/test/passes/instrument-locals_all-features.txt
@@ -3,7 +3,9 @@
(type $i32_i32_i64_=>_i64 (func (param i32 i32 i64) (result i64)))
(type $i32_i32_f32_=>_f32 (func (param i32 i32 f32) (result f32)))
(type $i32_i32_f64_=>_f64 (func (param i32 i32 f64) (result f64)))
+ (type $i32_i32_funcref_=>_funcref (func (param i32 i32 funcref) (result funcref)))
(type $i32_i32_anyref_=>_anyref (func (param i32 i32 anyref) (result anyref)))
+ (type $i32_i32_nullref_=>_nullref (func (param i32 i32 nullref) (result nullref)))
(type $i32_i32_exnref_=>_exnref (func (param i32 i32 exnref) (result exnref)))
(type $none_=>_none (func))
(import "env" "get_i32" (func $get_i32 (param i32 i32 i32) (result i32)))
@@ -14,17 +16,23 @@
(import "env" "set_i64" (func $set_i64 (param i32 i32 i64) (result i64)))
(import "env" "set_f32" (func $set_f32 (param i32 i32 f32) (result f32)))
(import "env" "set_f64" (func $set_f64 (param i32 i32 f64) (result f64)))
+ (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_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_nullref" (func $get_nullref (param i32 i32 nullref) (result nullref)))
+ (import "env" "set_nullref" (func $set_nullref (param i32 i32 nullref) (result nullref)))
(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 ;)
+ (func $test (; 16 ;)
(local $x i32)
(local $y i64)
(local $z f32)
(local $w f64)
- (local $a anyref)
- (local $e exnref)
+ (local $F funcref)
+ (local $A anyref)
+ (local $N nullref)
+ (local $E exnref)
(drop
(call $get_i32
(i32.const 0)
@@ -50,22 +58,36 @@
)
)
(drop
- (call $get_anyref
+ (call $get_funcref
(i32.const 3)
(i32.const 4)
- (local.get $a)
+ (local.get $F)
)
)
(drop
- (call $get_exnref
+ (call $get_anyref
(i32.const 4)
(i32.const 5)
- (local.get $e)
+ (local.get $A)
)
)
(drop
- (call $get_i32
+ (call $get_nullref
(i32.const 5)
+ (i32.const 6)
+ (local.get $N)
+ )
+ )
+ (drop
+ (call $get_exnref
+ (i32.const 6)
+ (i32.const 7)
+ (local.get $E)
+ )
+ )
+ (drop
+ (call $get_i32
+ (i32.const 7)
(i32.const 0)
(local.get $x)
)
@@ -75,35 +97,49 @@
)
(drop
(call $get_f32
- (i32.const 6)
+ (i32.const 8)
(i32.const 2)
(local.get $z)
)
)
(drop
(call $get_f64
- (i32.const 7)
+ (i32.const 9)
(i32.const 3)
(local.get $w)
)
)
(drop
- (call $get_anyref
- (i32.const 8)
+ (call $get_funcref
+ (i32.const 10)
(i32.const 4)
- (local.get $a)
+ (local.get $F)
)
)
(drop
- (call $get_exnref
- (i32.const 9)
+ (call $get_anyref
+ (i32.const 11)
(i32.const 5)
- (local.get $e)
+ (local.get $A)
+ )
+ )
+ (drop
+ (call $get_nullref
+ (i32.const 12)
+ (i32.const 6)
+ (local.get $N)
+ )
+ )
+ (drop
+ (call $get_exnref
+ (i32.const 13)
+ (i32.const 7)
+ (local.get $E)
)
)
(local.set $x
(call $set_i32
- (i32.const 10)
+ (i32.const 14)
(i32.const 0)
(i32.const 1)
)
@@ -113,43 +149,57 @@
)
(local.set $z
(call $set_f32
- (i32.const 11)
+ (i32.const 15)
(i32.const 2)
(f32.const 3.2100000381469727)
)
)
(local.set $w
(call $set_f64
- (i32.const 12)
+ (i32.const 16)
(i32.const 3)
(f64.const 4.321)
)
)
- (local.set $a
- (call $set_anyref
- (i32.const 14)
+ (local.set $F
+ (call $set_funcref
+ (i32.const 17)
(i32.const 4)
+ (ref.func $test)
+ )
+ )
+ (local.set $A
+ (call $set_anyref
+ (i32.const 19)
+ (i32.const 5)
(call $get_anyref
- (i32.const 13)
- (i32.const 4)
- (local.get $a)
+ (i32.const 18)
+ (i32.const 5)
+ (local.get $A)
)
)
)
- (local.set $e
+ (local.set $N
+ (call $set_nullref
+ (i32.const 20)
+ (i32.const 6)
+ (ref.null)
+ )
+ )
+ (local.set $E
(call $set_exnref
- (i32.const 16)
- (i32.const 5)
+ (i32.const 22)
+ (i32.const 7)
(call $get_exnref
- (i32.const 15)
- (i32.const 5)
- (local.get $e)
+ (i32.const 21)
+ (i32.const 7)
+ (local.get $E)
)
)
)
(local.set $x
(call $set_i32
- (i32.const 17)
+ (i32.const 23)
(i32.const 0)
(i32.const 11)
)
@@ -159,44 +209,72 @@
)
(local.set $z
(call $set_f32
- (i32.const 18)
+ (i32.const 24)
(i32.const 2)
(f32.const 33.209999084472656)
)
)
(local.set $w
(call $set_f64
- (i32.const 19)
+ (i32.const 25)
(i32.const 3)
(f64.const 44.321)
)
)
- (local.set $a
- (call $set_anyref
- (i32.const 21)
+ (local.set $F
+ (call $set_funcref
+ (i32.const 27)
(i32.const 4)
- (call $get_anyref
- (i32.const 20)
+ (call $get_funcref
+ (i32.const 26)
(i32.const 4)
- (local.get $a)
+ (local.get $F)
)
)
)
- (local.set $e
- (call $set_exnref
- (i32.const 23)
+ (local.set $A
+ (call $set_anyref
+ (i32.const 29)
(i32.const 5)
- (call $get_exnref
- (i32.const 22)
+ (call $get_anyref
+ (i32.const 28)
(i32.const 5)
- (local.get $e)
+ (local.get $A)
+ )
+ )
+ )
+ (local.set $N
+ (call $set_nullref
+ (i32.const 31)
+ (i32.const 6)
+ (call $get_nullref
+ (i32.const 30)
+ (i32.const 6)
+ (local.get $N)
+ )
+ )
+ )
+ (local.set $E
+ (call $set_exnref
+ (i32.const 33)
+ (i32.const 7)
+ (call $get_exnref
+ (i32.const 32)
+ (i32.const 7)
+ (local.get $E)
)
)
)
- (local.set $a
+ (local.set $F
+ (funcref.pop)
+ )
+ (local.set $A
(anyref.pop)
)
- (local.set $e
+ (local.set $N
+ (nullref.pop)
+ )
+ (local.set $E
(exnref.pop)
)
)
diff --git a/test/passes/instrument-locals_all-features.wast b/test/passes/instrument-locals_all-features.wast
index 906366557..ccf64d5a2 100644
--- a/test/passes/instrument-locals_all-features.wast
+++ b/test/passes/instrument-locals_all-features.wast
@@ -1,43 +1,55 @@
(module
- (func $A
+ (func $test
(local $x i32)
(local $y i64)
(local $z f32)
(local $w f64)
- (local $a anyref)
- (local $e exnref)
+ (local $F funcref)
+ (local $A anyref)
+ (local $N nullref)
+ (local $E exnref)
(drop (local.get $x))
(drop (local.get $y))
(drop (local.get $z))
(drop (local.get $w))
- (drop (local.get $a))
- (drop (local.get $e))
+ (drop (local.get $F))
+ (drop (local.get $A))
+ (drop (local.get $N))
+ (drop (local.get $E))
(drop (local.get $x))
(drop (local.get $y))
(drop (local.get $z))
(drop (local.get $w))
- (drop (local.get $a))
- (drop (local.get $e))
+ (drop (local.get $F))
+ (drop (local.get $A))
+ (drop (local.get $N))
+ (drop (local.get $E))
(local.set $x (i32.const 1))
(local.set $y (i64.const 2))
(local.set $z (f32.const 3.21))
(local.set $w (f64.const 4.321))
- (local.set $a (local.get $a))
- (local.set $e (local.get $e))
+ (local.set $F (ref.func $test))
+ (local.set $A (local.get $A))
+ (local.set $N (ref.null))
+ (local.set $E (local.get $E))
(local.set $x (i32.const 11))
(local.set $y (i64.const 22))
(local.set $z (f32.const 33.21))
(local.set $w (f64.const 44.321))
- (local.set $a (local.get $a))
- (local.set $e (local.get $e))
+ (local.set $F (local.get $F))
+ (local.set $A (local.get $A))
+ (local.set $N (local.get $N))
+ (local.set $E (local.get $E))
;; Pop instructions should not be instrumented
- (local.set $a (anyref.pop))
- (local.set $e (exnref.pop))
+ (local.set $F (funcref.pop))
+ (local.set $A (anyref.pop))
+ (local.set $N (nullref.pop))
+ (local.set $E (exnref.pop))
)
)
diff --git a/test/passes/legalize-js-interface.txt b/test/passes/legalize-js-interface_all-features.txt
index 4e27eff5c..866356947 100644
--- a/test/passes/legalize-js-interface.txt
+++ b/test/passes/legalize-js-interface_all-features.txt
@@ -1,18 +1,22 @@
(module
(type $none_=>_i32 (func (result i32)))
- (type $i32_i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32 i32)))
(type $none_=>_i64 (func (result i64)))
+ (type $i32_i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32 i32)))
+ (type $none_=>_none (func))
(type $i32_=>_none (func (param i32)))
(type $i32_i64_i64_=>_none (func (param i32 i64 i64)))
+ (import "env" "ref-func-arg" (func $ref-func-arg (result i64)))
(import "env" "setTempRet0" (func $setTempRet0 (param i32)))
(import "env" "getTempRet0" (func $getTempRet0 (result i32)))
(import "env" "imported" (func $legalimport$imported (result i32)))
(import "env" "other" (func $legalimport$other (param i32 i32 i32 i32 i32)))
+ (import "env" "ref-func-arg" (func $legalimport$ref-func-arg (result i32)))
(export "func" (func $legalstub$func))
+ (export "ref-func-test" (func $ref-func-test))
(export "imported" (func $legalstub$imported))
(export "imported_again" (func $legalstub$imported))
(export "other" (func $legalstub$other))
- (func $func (; 4 ;) (result i64)
+ (func $func (; 6 ;) (result i64)
(drop
(call $legalfunc$imported)
)
@@ -23,7 +27,15 @@
)
(unreachable)
)
- (func $legalstub$func (; 5 ;) (result i32)
+ (func $ref-func-test (; 7 ;)
+ (drop
+ (call $legalfunc$ref-func-arg)
+ )
+ (drop
+ (ref.func $ref-func-arg)
+ )
+ )
+ (func $legalstub$func (; 8 ;) (result i32)
(local $0 i64)
(local.set $0
(call $func)
@@ -40,7 +52,7 @@
(local.get $0)
)
)
- (func $legalstub$imported (; 6 ;) (result i32)
+ (func $legalstub$imported (; 9 ;) (result i32)
(local $0 i64)
(local.set $0
(call $legalfunc$imported)
@@ -57,7 +69,7 @@
(local.get $0)
)
)
- (func $legalstub$other (; 7 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32)
+ (func $legalstub$other (; 10 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32)
(call $legalfunc$other
(local.get $0)
(i64.or
@@ -84,7 +96,7 @@
)
)
)
- (func $legalfunc$imported (; 8 ;) (result i64)
+ (func $legalfunc$imported (; 11 ;) (result i64)
(i64.or
(i64.extend_i32_u
(call $legalimport$imported)
@@ -97,7 +109,7 @@
)
)
)
- (func $legalfunc$other (; 9 ;) (param $0 i32) (param $1 i64) (param $2 i64)
+ (func $legalfunc$other (; 12 ;) (param $0 i32) (param $1 i64) (param $2 i64)
(call $legalimport$other
(local.get $0)
(i32.wrap_i64
@@ -120,6 +132,19 @@
)
)
)
+ (func $legalfunc$ref-func-arg (; 13 ;) (result i64)
+ (i64.or
+ (i64.extend_i32_u
+ (call $legalimport$ref-func-arg)
+ )
+ (i64.shl
+ (i64.extend_i32_u
+ (call $getTempRet0)
+ )
+ (i64.const 32)
+ )
+ )
+ )
)
(module
)
diff --git a/test/passes/legalize-js-interface.wast b/test/passes/legalize-js-interface_all-features.wast
index da8a0b2ff..4697a8f18 100644
--- a/test/passes/legalize-js-interface.wast
+++ b/test/passes/legalize-js-interface_all-features.wast
@@ -1,7 +1,9 @@
(module
(import "env" "imported" (func $imported (result i64)))
(import "env" "other" (func $other (param i32) (param i64) (param i64)))
+ (import "env" "ref-func-arg" (func $ref-func-arg (result i64)))
(export "func" (func $func))
+ (export "ref-func-test" (func $ref-func-test))
(export "imported" (func $imported))
(export "imported_again" (func $imported))
(export "other" (func $other))
@@ -14,5 +16,16 @@
)
(unreachable)
)
+
+ ;; If an import is used in ref.func, even if it is legalized to another
+ ;; import, the original import should not be removed.
+ (func $ref-func-test
+ (drop
+ (call $ref-func-arg)
+ )
+ (drop
+ (ref.func $ref-func-arg)
+ )
+ )
)
(module)
diff --git a/test/passes/merge-locals.txt b/test/passes/merge-locals_all-features.txt
index f955cec33..1210fab59 100644
--- a/test/passes/merge-locals.txt
+++ b/test/passes/merge-locals_all-features.txt
@@ -1,6 +1,7 @@
(module
(type $i32_i32_=>_none (func (param i32 i32)))
(type $i32_i32_=>_i32 (func (param i32 i32) (result i32)))
+ (type $none_=>_none (func))
(type $i32_i32_i32_=>_none (func (param i32 i32 i32)))
(type $i32_f32_f32_=>_i64 (func (param i32 f32 f32) (result i64)))
(global $global$0 (mut i32) (i32.const 10))
@@ -456,4 +457,15 @@
)
)
)
+ (func $subtype-test (; 20 ;)
+ (local $0 anyref)
+ (local $1 nullref)
+ (local $2 nullref)
+ (local.set $0
+ (local.get $1)
+ )
+ (local.set $2
+ (local.get $1)
+ )
+ )
)
diff --git a/test/passes/merge-locals.wast b/test/passes/merge-locals_all-features.wast
index c47dfd125..a7f61796a 100644
--- a/test/passes/merge-locals.wast
+++ b/test/passes/merge-locals_all-features.wast
@@ -375,5 +375,17 @@
)
)
)
+ (func $subtype-test
+ (local $0 anyref)
+ (local $1 nullref)
+ (local $2 nullref)
+ (local.set $0
+ (local.get $1)
+ )
+ (local.set $2
+ ;; This should NOT become $0, because types of $0 and $1 are different
+ (local.get $1)
+ )
+ )
)
diff --git a/test/passes/optimize-instructions_enable-threads.txt b/test/passes/optimize-instructions_all-features.txt
index 8f9ee1843..53c28e896 100644
--- a/test/passes/optimize-instructions_enable-threads.txt
+++ b/test/passes/optimize-instructions_all-features.txt
@@ -3337,3 +3337,9 @@
)
)
)
+(module
+ (type $none_=>_anyref (func (result anyref)))
+ (func $test (; 0 ;) (result anyref)
+ (ref.null)
+ )
+)
diff --git a/test/passes/optimize-instructions_enable-threads.wast b/test/passes/optimize-instructions_all-features.wast
index 243cb79d7..75993effa 100644
--- a/test/passes/optimize-instructions_enable-threads.wast
+++ b/test/passes/optimize-instructions_all-features.wast
@@ -3783,3 +3783,13 @@
)
)
)
+(module
+ ;; Tests when if arms are subtype of if's type
+ (func $test (result anyref)
+ (if (result anyref)
+ (i32.const 0)
+ (ref.null)
+ (ref.null)
+ )
+ )
+)
diff --git a/test/passes/precompute_all-features.txt b/test/passes/precompute_all-features.txt
index 901757b99..b24c96159 100644
--- a/test/passes/precompute_all-features.txt
+++ b/test/passes/precompute_all-features.txt
@@ -4,6 +4,7 @@
(type $none_=>_f64 (func (result f64)))
(type $none_=>_v128 (func (result v128)))
(type $i32_=>_none (func (param i32)))
+ (type $none_=>_nullref (func (result nullref)))
(memory $0 512 512)
(data (i32.const 0) "passive")
(global $global i32 (i32.const 1))
@@ -249,4 +250,7 @@
(i32.const 12)
)
)
+ (func $reftype-test (; 17 ;) (result nullref)
+ (ref.null)
+ )
)
diff --git a/test/passes/precompute_all-features.wast b/test/passes/precompute_all-features.wast
index 28c570b7a..74b8f1317 100644
--- a/test/passes/precompute_all-features.wast
+++ b/test/passes/precompute_all-features.wast
@@ -344,4 +344,8 @@
(i32.const 12)
)
)
+ ;; Check if Precompute pass does not crash on reference types
+ (func $reftype-test (result nullref)
+ (ref.null)
+ )
)
diff --git a/test/passes/remove-unused-module-elements_all-features.txt b/test/passes/remove-unused-module-elements_all-features.txt
index eb5d177dd..8d5c4a2b6 100644
--- a/test/passes/remove-unused-module-elements_all-features.txt
+++ b/test/passes/remove-unused-module-elements_all-features.txt
@@ -310,3 +310,15 @@
)
)
)
+(module
+ (type $none_=>_none (func))
+ (export "test" (func $test))
+ (func $foo (; 0 ;)
+ (nop)
+ )
+ (func $test (; 1 ;)
+ (drop
+ (ref.func $foo)
+ )
+ )
+)
diff --git a/test/passes/remove-unused-module-elements_all-features.wast b/test/passes/remove-unused-module-elements_all-features.wast
index 57d376d31..fcde89b3c 100644
--- a/test/passes/remove-unused-module-elements_all-features.wast
+++ b/test/passes/remove-unused-module-elements_all-features.wast
@@ -286,3 +286,12 @@
)
)
)
+(module ;; functions referenced by ref.func cannot be removed
+ (export "test" $test)
+ (func $foo)
+ (func $test
+ (drop
+ (ref.func $foo)
+ )
+ )
+)
diff --git a/test/passes/simplify-globals-optimizing_enable-mutable-globals.wast b/test/passes/simplify-globals-optimizing_enable-mutable-globals.wast
index f8a099e95..91ef66ebf 100644
--- a/test/passes/simplify-globals-optimizing_enable-mutable-globals.wast
+++ b/test/passes/simplify-globals-optimizing_enable-mutable-globals.wast
@@ -126,4 +126,3 @@
(global.get $g1)
)
)
-
diff --git a/test/passes/simplify-globals_enable-mutable-globals.txt b/test/passes/simplify-globals_all-features.txt
index 8146bb942..d467925ec 100644
--- a/test/passes/simplify-globals_enable-mutable-globals.txt
+++ b/test/passes/simplify-globals_all-features.txt
@@ -211,3 +211,22 @@
(i32.const 100)
)
)
+(module
+ (type $none_=>_none (func))
+ (import "env" "global-1" (global $g1 anyref))
+ (global $g2 anyref (global.get $g1))
+ (global $g3 anyref (ref.null))
+ (func $test1 (; 0 ;)
+ (drop
+ (global.get $g1)
+ )
+ (drop
+ (global.get $g1)
+ )
+ )
+ (func $test2 (; 1 ;)
+ (drop
+ (ref.null)
+ )
+ )
+)
diff --git a/test/passes/simplify-globals_enable-mutable-globals.wast b/test/passes/simplify-globals_all-features.wast
index f8a099e95..f7470f959 100644
--- a/test/passes/simplify-globals_enable-mutable-globals.wast
+++ b/test/passes/simplify-globals_all-features.wast
@@ -126,4 +126,16 @@
(global.get $g1)
)
)
-
+;; Reference type tests
+(module
+ (import "env" "global-1" (global $g1 anyref))
+ (global $g2 (mut anyref) (global.get $g1))
+ (global $g3 anyref (ref.null))
+ (func $test1
+ (drop (global.get $g1))
+ (drop (global.get $g2))
+ )
+ (func $test2
+ (drop (global.get $g3))
+ )
+)
diff --git a/test/passes/simplify-locals_all-features.txt b/test/passes/simplify-locals_all-features.txt
index 0902a607e..60459d1a8 100644
--- a/test/passes/simplify-locals_all-features.txt
+++ b/test/passes/simplify-locals_all-features.txt
@@ -1873,3 +1873,16 @@
)
)
)
+(module
+ (type $none_=>_funcref (func (result funcref)))
+ (func $subtype-test (; 0 ;) (result funcref)
+ (local $0 nullref)
+ (local $1 funcref)
+ (local $2 funcref)
+ (block $block
+ (nop)
+ )
+ (nop)
+ (local.get $0)
+ )
+)
diff --git a/test/passes/simplify-locals_all-features.wast b/test/passes/simplify-locals_all-features.wast
index ff362db64..a819dda15 100644
--- a/test/passes/simplify-locals_all-features.wast
+++ b/test/passes/simplify-locals_all-features.wast
@@ -1655,3 +1655,19 @@
)
)
)
+(module
+ (func $subtype-test (result funcref)
+ (local $0 nullref)
+ (local $1 funcref)
+ (local $2 funcref)
+ (block
+ (local.set $1
+ (local.get $0)
+ )
+ )
+ (local.set $2
+ (local.get $1)
+ )
+ (local.get $1)
+ )
+)
diff --git a/test/passes/translate-to-fuzz_all-features.txt b/test/passes/translate-to-fuzz_all-features.txt
index 50c7658d8..3255c757d 100644
--- a/test/passes/translate-to-fuzz_all-features.txt
+++ b/test/passes/translate-to-fuzz_all-features.txt
@@ -1,32 +1,69 @@
(module
- (type $none_=>_i32 (func (result i32)))
(type $none_=>_none (func))
+ (type $none_=>_i32 (func (result i32)))
+ (type $none_=>_i64 (func (result i64)))
(type $i32_=>_none (func (param i32)))
(type $i64_=>_none (func (param i64)))
(type $f32_=>_none (func (param f32)))
(type $f64_=>_none (func (param f64)))
- (type $f64_f32_=>_none (func (param f64 f32)))
+ (type $f64_exnref_=>_none (func (param f64 exnref)))
(type $v128_=>_none (func (param v128)))
- (type $f64_i32_=>_v128 (func (param f64 i32) (result v128)))
+ (type $anyref_i64_i32_f32_nullref_exnref_=>_none (func (param anyref i64 i32 f32 nullref exnref)))
+ (type $nullref_=>_none (func (param nullref)))
+ (type $exnref_=>_none (func (param exnref)))
+ (type $exnref_f32_v128_i32_funcref_=>_none (func (param exnref f32 v128 i32 funcref)))
+ (type $i64_=>_i32 (func (param i64) (result i32)))
+ (type $f32_=>_i64 (func (param f32) (result i64)))
+ (type $none_=>_f32 (func (result f32)))
+ (type $none_=>_funcref (func (result funcref)))
+ (type $v128_anyref_i32_i32_=>_funcref (func (param v128 anyref i32 i32) (result funcref)))
+ (type $f64_i32_i64_f64_f32_=>_anyref (func (param f64 i32 i64 f64 f32) (result anyref)))
+ (type $nullref_=>_anyref (func (param nullref) (result anyref)))
+ (type $i32_exnref_exnref_v128_v128_v128_=>_nullref (func (param i32 exnref exnref v128 v128 v128) (result nullref)))
+ (type $f32_v128_v128_f32_=>_nullref (func (param f32 v128 v128 f32) (result nullref)))
+ (type $v128_=>_nullref (func (param v128) (result nullref)))
(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-nullref" (func $log-nullref (param nullref)))
+ (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")
- (table $0 0 funcref)
+ (table $0 10 10 funcref)
+ (elem (i32.const 0) $func_8 $func_13 $func_13 $func_13 $func_14 $func_15 $func_17 $func_23 $func_23 $func_31)
(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 funcref) (ref.null))
+ (global $global$6 (mut anyref) (ref.null))
+ (global $global$7 (mut nullref) (ref.null))
+ (global $global$8 (mut nullref) (ref.null))
(global $hangLimit (mut i32) (i32.const 10))
- (event $event$0 (attr 0) (param f64 f32))
+ (event $event$0 (attr 0) (param f64 exnref))
+ (event $event$1 (attr 0) (param exnref f32 v128 i32 funcref))
(export "hashMemory" (func $hashMemory))
(export "memory" (memory $0))
+ (export "func_8" (func $func_8))
+ (export "func_9_invoker" (func $func_9_invoker))
+ (export "func_11_invoker" (func $func_11_invoker))
+ (export "func_13" (func $func_13))
+ (export "func_15_invoker" (func $func_15_invoker))
+ (export "func_17_invoker" (func $func_17_invoker))
+ (export "func_19_invoker" (func $func_19_invoker))
+ (export "func_23_invoker" (func $func_23_invoker))
+ (export "func_25_invoker" (func $func_25_invoker))
+ (export "func_27_invoker" (func $func_27_invoker))
+ (export "func_29_invoker" (func $func_29_invoker))
+ (export "func_31" (func $func_31))
+ (export "func_31_invoker" (func $func_31_invoker))
+ (export "func_34" (func $func_34))
+ (export "func_34_invoker" (func $func_34_invoker))
(export "hangLimitInitializer" (func $hangLimitInitializer))
- (func $hashMemory (; 5 ;) (result i32)
+ (func $hashMemory (; 7 ;) (result i32)
(local $0 i32)
(local.set $0
(i32.const 5381)
@@ -257,7 +294,158 @@
)
(local.get $0)
)
- (func $func_6 (; 6 ;) (result i32)
+ (func $func_8 (; 8 ;)
+ (local $0 v128)
+ (local $1 exnref)
+ (local $2 f64)
+ (local $3 f32)
+ (local $4 i64)
+ (local $5 funcref)
+ (local $6 v128)
+ (local $7 funcref)
+ (local $8 i64)
+ (local $9 funcref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return)
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$0
+ (nop)
+ (local.set $9
+ (local.tee $7
+ (local.tee $7
+ (local.tee $9
+ (local.tee $5
+ (local.tee $7
+ (local.get $9)
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ (func $func_9 (; 9 ;) (param $0 anyref) (param $1 i64) (param $2 i32) (param $3 f32) (param $4 nullref) (param $5 exnref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return)
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (call $log-exnref
+ (block $label$0
+ (call $log-f64
+ (f64.const 27)
+ )
+ (return)
+ )
+ )
+ )
+ (func $func_9_invoker (; 10 ;)
+ (call $func_9
+ (ref.null)
+ (i64.const -114)
+ (i32.const -1)
+ (f32.const -nan:0x7ffff0)
+ (ref.null)
+ (ref.null)
+ )
+ (call $func_9
+ (ref.null)
+ (i64.const -128)
+ (i32.const 2147483647)
+ (f32.const 2305843009213693952)
+ (ref.null)
+ (ref.null)
+ )
+ (call $func_9
+ (ref.null)
+ (i64.const -84)
+ (i32.const -77)
+ (f32.const 65463)
+ (ref.null)
+ (ref.null)
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ )
+ (func $func_11 (; 11 ;) (param $0 f32) (param $1 v128) (param $2 v128) (param $3 f32) (result nullref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (ref.null)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (ref.null)
+ )
+ (func $func_11_invoker (; 12 ;)
+ (drop
+ (call $func_11
+ (f32.const -4)
+ (v128.const i32x4 0xffffffe8 0x00000a12 0x00000002 0xffffff80)
+ (v128.const i32x4 0x00000000 0x00000001 0x00000000 0x40000000)
+ (f32.const 4503599627370496)
+ )
+ )
+ (drop
+ (call $func_11
+ (f32.const 2.7426516613360263e-09)
+ (v128.const i32x4 0x0d080315 0x00001811 0xfffffc00 0x0000007f)
+ (v128.const i32x4 0x0000187f 0x042c50ee 0x005c171b 0x001a1b1a)
+ (f32.const -nan:0x7ffff0)
+ )
+ )
+ )
+ (func $func_13 (; 13 ;) (result i64)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (i64.const 114)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (i64.const 9093677305969276536)
+ )
+ (func $func_14 (; 14 ;) (result i64)
(local $0 i64)
(block
(if
@@ -265,7 +453,7 @@
(global.get $hangLimit)
)
(return
- (i32.const 1296977737)
+ (local.get $0)
)
)
(global.set $hangLimit
@@ -277,20 +465,192 @@
)
(block $label$0
(nop)
+ (return
+ (i64.const 302456592)
+ )
+ )
+ )
+ (func $func_15 (; 15 ;) (param $0 v128) (param $1 anyref) (param $2 i32) (param $3 i32) (result funcref)
+ (local $4 funcref)
+ (local $5 f64)
+ (local $6 i32)
+ (local $7 i64)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (local.get $4)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$0
+ (call $log-exnref
+ (ref.null)
+ )
+ (return
+ (local.get $4)
+ )
+ )
+ )
+ (func $func_15_invoker (; 16 ;)
+ (drop
+ (call $func_15
+ (v128.const i32x4 0x00080000 0x1a180e76 0x3a25515d 0xffff8001)
+ (ref.null)
+ (i32.const 202116108)
+ (i32.const 151587164)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ )
+ (func $func_17 (; 17 ;) (result i32)
+ (local $0 i64)
+ (local $1 v128)
+ (local $2 v128)
+ (local $3 f32)
+ (local $4 funcref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (i32.const 332)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$0
+ (loop $label$1
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (i32.const -128)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$2
+ (nop)
+ (nop)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ (return
+ (i32.const 84215045)
+ )
+ )
+ )
+ (func $func_17_invoker (; 18 ;)
+ (drop
+ (call $func_17)
+ )
+ )
+ (func $func_19 (; 19 ;) (param $0 i64) (result i32)
+ (local $1 f32)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (i32.const 2)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (i32.const 65536)
+ )
+ (func $func_19_invoker (; 20 ;)
+ (drop
+ (call $func_19
+ (i64.const 129)
+ )
+ )
+ (drop
+ (call $func_19
+ (i64.const 562949953421312)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ (drop
+ (call $func_19
+ (i64.const -32767)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ )
+ (func $func_21 (; 21 ;) (result i32)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (i32.const 90)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$0
(nop)
(return
- (i32.const -4096)
+ (i32.const 7446)
)
)
)
- (func $func_7 (; 7 ;) (param $0 f64) (param $1 i32) (result v128)
+ (func $func_22 (; 22 ;) (result f32)
+ (local $0 i64)
+ (local $1 exnref)
+ (local $2 funcref)
+ (local $3 i64)
+ (local $4 anyref)
(block
(if
(i32.eqz
(global.get $hangLimit)
)
(return
- (v128.const i32x4 0xd6000000 0xfffffff4 0x00000000 0xbf800000)
+ (f32.const 21554)
)
)
(global.set $hangLimit
@@ -300,730 +660,456 @@
)
)
)
- (block $label$0 (result v128)
- (call $log-v128
- (br_if $label$0
- (loop $label$1 (result v128)
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (v128.const i32x4 0xe7010001 0xe5bb1b00 0x15001800 0x005d0001)
- )
+ (block $label$0
+ (return
+ (f32.const -1.1754943508222875e-38)
+ )
+ )
+ )
+ (func $func_23 (; 23 ;) (param $0 nullref) (result anyref)
+ (local $1 exnref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (ref.null)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$0 (result nullref)
+ (nop)
+ (loop $label$2 (result nullref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (ref.null)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (loop $label$3 (result nullref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
)
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
+ (return
+ (ref.null)
)
)
- (block (result v128)
- (loop $label$2
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (v128.const i32x4 0x00000000 0x405ac000 0x00000000 0x40448000)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block
- (block $label$3
- (call $log-i32
- (i32.const -43)
- )
- (call $log-i32
- (call $hashMemory)
- )
- )
- (br_if $label$2
- (if (result i32)
- (if (result i32)
- (block $label$4
- (call $log-i64
- (if (result i64)
- (i32.eqz
- (block $label$5 (result i32)
- (block $label$6
- (nop)
- (nop)
- )
- (local.get $1)
- )
- )
- (block $label$7 (result i64)
- (call $log-v128
- (call $func_7
- (f64.const 404429336)
- (local.tee $1
- (i32.const 128)
- )
- )
- )
- (i64.const -131072)
- )
- (block $label$8
- (call $log-i64
- (i64.const 4294967230)
- )
- (br $label$2)
- )
- )
- )
- (br $label$2)
- )
- (block $label$9 (result i32)
- (br_if $label$1
- (i32.eqz
- (local.tee $1
- (br_if $label$9
- (i32.const 1364020300)
- (i32.eqz
- (local.tee $1
- (br_if $label$9
- (loop $label$10 (result i32)
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (v128.const i32x4 0x0000084d 0x00000000 0x00000001 0x00000000)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (i32.const 151324422)
- )
- (i32.eqz
- (i32.const 65535)
- )
- )
- )
- )
- )
- )
- )
- )
- (select
- (local.get $1)
- (i32.const -124)
- (loop $label$11
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (v128.const i32x4 0x5f5f5f5f 0xd2800000 0x59595959 0x469e9800)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block
- (block $label$12
- (loop $label$13
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (v128.const i32x4 0x00000040 0x00000000 0x80000001 0x00000000)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block $label$14
- (call $log-v128
- (v128.const i32x4 0xffea0000 0x0020ff80 0x50590000 0x1c002e39)
- )
- )
- )
- (call $log-f32
- (f32.const 35766419849216)
- )
- )
- (br_if $label$11
- (br_if $label$9
- (local.tee $1
- (i32.const -14)
- )
- (local.tee $1
- (local.tee $1
- (i32.const -67108864)
- )
- )
- )
- )
- (if
- (local.tee $1
- (local.tee $1
- (i32.const -32766)
- )
- )
- (block $label$15
- (nop)
- (br $label$11)
- )
- (block $label$16
- (loop $label$17
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (v128.const i32x4 0x00000001 0xffffffff 0xffffffeb 0xffffffff)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block
- (block $label$18
- (call $log-i32
- (local.tee $1
- (local.get $1)
- )
- )
- (br_if $label$17
- (local.tee $1
- (loop $label$19 (result i32)
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (v128.const i32x4 0x05090b0a 0x06080f09 0x00007f63 0x80000000)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block (result i32)
- (call $log-i64
- (i64.const -28)
- )
- (br_if $label$19
- (local.tee $1
- (local.get $1)
- )
- )
- (i32.const -5)
- )
- )
- )
- )
- )
- (br_if $label$17
- (local.tee $1
- (local.get $1)
- )
- )
- (call $log-i32
- (call $hashMemory)
- )
- )
- )
- (br $label$1)
- )
- )
- )
- )
- )
- )
- (block $label$20
- (nop)
- (br $label$2)
- )
- )
- (block $label$21 (result i32)
- (call $log-i64
- (if (result i64)
- (if (result i32)
- (loop $label$22
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (v128.const i32x4 0x641a061c 0x0000151a 0xffffff81 0x14071e1b)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block $label$23
- (call $log-i32
- (block $label$24 (result i32)
- (nop)
- (loop $label$25 (result i32)
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (v128.const i32x4 0x40000000 0x4f000000 0x477fe400 0x4694b200)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block (result i32)
- (nop)
- (br_if $label$25
- (i32.const 31097)
- )
- (call $func_6)
- )
- )
- )
- )
- (br $label$2)
- )
- )
- (block $label$26
- (loop $label$27
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (v128.const i32x4 0xffffffa2 0x0e0f0e09 0x0000007f 0x116f110d)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block
- (block $label$28
- (call $log-i32
- (call $hashMemory)
- )
- (call $log-i64
- (i64.const -4194304)
- )
- )
- (br_if $label$27
- (i32.eqz
- (i32.const 2147483647)
- )
- )
- (nop)
- )
- )
- (br $label$2)
- )
- (block $label$29 (result i32)
- (call $log-f64
- (f64.const 8.697524797146243e-275)
- )
- (i32.const 262144)
- )
- )
- (block $label$30
- (call $log-i64
- (i64.const -24)
- )
- (br $label$2)
- )
- (i64.mul
- (i64.const 10797)
- (i64.const 4190383344442562905)
- )
- )
- )
- (br_if $label$21
- (local.tee $1
- (loop $label$35 (result i32)
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (v128.const i32x4 0x1d131913 0x00000000 0x00000000 0x00004000)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (if (result i32)
- (i32.eqz
- (local.get $1)
- )
- (block $label$36 (result i32)
- (call $log-i64
- (i64.const 3079)
- )
- (i32.const 24684)
- )
- (local.tee $1
- (i32.const 2048)
- )
- )
- )
- )
- (i32.eqz
- (br_if $label$21
- (block $label$32 (result i32)
- (call $log-f64
- (local.tee $0
- (local.tee $0
- (f64.const 1900100968416013050458753e112)
- )
- )
- )
- (i16x8.extract_lane_u 7
- (loop $label$33 (result v128)
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (v128.const i32x4 0x1c171e11 0xfffc0000 0x00004d42 0xfc000000)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (loop $label$34 (result v128)
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (v128.const i32x4 0x80000000 0x00008000 0x00000020 0x00800000)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (v128.const i32x4 0x00000000 0x43b00000 0x00000000 0xc0300000)
- )
- )
- )
- )
- (i32.eqz
- (block $label$31
- (call $log-i32
- (call $hashMemory)
- )
- (br $label$1)
- )
- )
- )
- )
- )
- )
- (block $label$37
- (if
- (block $label$38 (result i32)
- (call $log-f64
- (local.get $0)
- )
- (local.tee $1
- (i32.const -116)
- )
- )
- (call $log-i32
- (call $hashMemory)
- )
- (block $label$39
- (call $log-i32
- (i32.const -1)
- )
- (call $log-i32
- (call $hashMemory)
- )
- )
- )
- (br $label$2)
- )
- )
- )
- (call $log-i64
- (i64.const 65481)
- )
- )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
)
- (br_if $label$1
- (i32.eqz
- (block $label$40 (result i32)
- (drop
- (block
- (if
- (i32.eqz
- (block $label$46
- (call $log-i32
- (call $hashMemory)
- )
- (block $label$47
- (call $log-v128
- (v128.const i32x4 0xfc000000 0x00000041 0x5e48481b 0x36703625)
- )
- (br $label$1)
- )
- )
- )
- (block $label$48
- (call $log-i64
- (loop $label$49 (result i64)
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (v128.const i32x4 0x16590e16 0x17590d0e 0x00000000 0x41600000)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block $label$50 (result i64)
- (i64.const -9223372036854775807)
- )
- )
- )
- (br $label$1)
- )
- (block $label$51
- (local.set $0
- (loop $label$52 (result f64)
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (v128.const i32x4 0x8e997f88 0x00b56f00 0xff010000 0x02004300)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block (result f64)
- (call $log-f64
- (f64.const 128)
- )
- (br_if $label$52
- (i32.eqz
- (block $label$53
- (call $log-f64
- (f64.const 4.955179737724083e-183)
- )
- (br $label$1)
- )
- )
- )
- (local.tee $0
- (loop $label$54 (result f64)
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (v128.const i32x4 0x00040000 0x00000050 0x00010000 0xfffffff0)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (f64.const 1.1754943508222875e-38)
- )
- )
- )
- )
- )
- (br $label$1)
- )
- )
- (br_if $label$40
- (block $label$45 (result i32)
- (call $log-f64
- (local.tee $0
- (f64.const 1073741824)
- )
- )
- (local.get $1)
- )
- (i32.eqz
- (br_if $label$40
- (local.tee $1
- (loop $label$44 (result i32)
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (v128.const i32x4 0xff520000 0x55041a00 0x15807253 0x011be7a2)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (local.get $1)
- )
- )
- (if
- (i32.eqz
- (block $label$41
- (nop)
- (br $label$1)
- )
- )
- (block $label$42
- (call $log-f32
- (f32.const 1162102144)
- )
- (br $label$1)
- )
- (block $label$43
- (call $log-v128
- (v128.const i32x4 0x00001d1c 0x00000000 0x00000000 0x00000000)
- )
- (return
- (v128.const i32x4 0x7fffc000 0x0000125f 0xff01444e 0x1d1d0b01)
- )
- )
- )
- )
- )
- )
- )
- )
- (if (result i32)
- (br_if $label$40
- (br_if $label$40
- (local.tee $1
- (local.get $1)
- )
- (br_if $label$40
- (local.get $1)
- (br_if $label$40
- (local.tee $1
- (local.tee $1
- (local.get $1)
- )
- )
- (call $hashMemory)
- )
- )
- )
- (block $label$55 (result i32)
- (call $log-i32
- (call $hashMemory)
- )
- (local.get $1)
- )
- )
- (block $label$56 (result i32)
- (call $log-f32
- (f32.const 18773)
- )
- (i32.const 23632)
- )
- (local.get $1)
- )
- )
- )
+ )
+ )
+ (block (result nullref)
+ (call $log-i32
+ (call $hashMemory)
+ )
+ (br_if $label$3
+ (i32.const 12)
+ )
+ (ref.null)
+ )
+ )
+ )
+ )
+ )
+ (func $func_23_invoker (; 24 ;)
+ (drop
+ (call $func_23
+ (ref.null)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ (drop
+ (call $func_23
+ (ref.null)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ (drop
+ (call $func_23
+ (ref.null)
+ )
+ )
+ )
+ (func $func_25 (; 25 ;) (param $0 f32) (result i64)
+ (local $1 i32)
+ (local $2 f64)
+ (local $3 funcref)
+ (local $4 i32)
+ (local $5 f32)
+ (local $6 anyref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (i64.const -9223372036854775808)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (i64.const -16)
+ )
+ (func $func_25_invoker (; 26 ;)
+ (drop
+ (call $func_25
+ (f32.const 30)
+ )
+ )
+ (drop
+ (call $func_25
+ (f32.const 17179869184)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ (drop
+ (call $func_25
+ (f32.const 2147483648)
+ )
+ )
+ (drop
+ (call $func_25
+ (f32.const -nan:0x7fffc1)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ (drop
+ (call $func_25
+ (f32.const 9223372036854775808)
+ )
+ )
+ (drop
+ (call $func_25
+ (f32.const 0)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ (drop
+ (call $func_25
+ (f32.const 8760)
+ )
+ )
+ )
+ (func $func_27 (; 27 ;) (param $0 i32) (param $1 exnref) (param $2 exnref) (param $3 v128) (param $4 v128) (param $5 v128) (result nullref)
+ (local $6 f32)
+ (local $7 v128)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (ref.null)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$0
+ (call $log-i64
+ (i64.const 84)
+ )
+ (return
+ (ref.null)
+ )
+ )
+ )
+ (func $func_27_invoker (; 28 ;)
+ (drop
+ (call $func_27
+ (i32.const -69)
+ (ref.null)
+ (ref.null)
+ (v128.const i32x4 0x00000000 0x40800800 0x00000000 0x42200000)
+ (v128.const i32x4 0x00800000 0x42dc0000 0x40000000 0xcf000000)
+ (v128.const i32x4 0x00000000 0x41e00000 0x00000000 0x38100000)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ )
+ (func $func_29 (; 29 ;) (result i32)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (i32.const 7)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (i32.const -18)
+ )
+ (func $func_29_invoker (; 30 ;)
+ (drop
+ (call $func_29)
+ )
+ )
+ (func $func_31 (; 31 ;) (param $0 v128) (result nullref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (ref.null)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (if
+ (i32.load8_s offset=22
+ (i32.and
+ (i32.const 774514976)
+ (i32.const 15)
+ )
+ )
+ (select
+ (block $label$0
+ (block $label$1
+ (block $label$5
+ (call $log-i32
+ (call $hashMemory)
)
- (v128.const i32x4 0xca000000 0x07101419 0x46b62a00 0xffffffe5)
+ (return
+ (ref.null)
+ )
+ )
+ )
+ )
+ (return_call $func_31
+ (local.tee $0
+ (v128.const i32x4 0x00000000 0xc3e00000 0x00000000 0x40b70500)
+ )
+ )
+ (i32.const 0)
+ )
+ (block $label$3
+ (nop)
+ (block $label$4
+ (call $log-f32
+ (f32.const -1152921504606846976)
+ )
+ (return_call $func_31
+ (v128.const i32x4 0x08000000 0x00000000 0xffff8000 0xffffffff)
+ )
+ )
+ )
+ )
+ )
+ (func $func_31_invoker (; 32 ;)
+ (drop
+ (call $func_31
+ (v128.const i32x4 0x00080000 0x00000081 0xffffffad 0x00000001)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ )
+ (func $func_33 (; 33 ;)
+ (local $0 i32)
+ (local $1 f64)
+ (local $2 i64)
+ (local $3 f64)
+ (local $4 i64)
+ (local $5 anyref)
+ (local $6 i32)
+ (local $7 v128)
+ (local $8 i32)
+ (local $9 f64)
+ (local $10 f64)
+ (local $11 nullref)
+ (local $12 v128)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return)
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (local.set $11
+ (ref.null)
+ )
+ )
+ (func $func_34 (; 34 ;) (param $0 f64) (param $1 i32) (param $2 i64) (param $3 f64) (param $4 f32) (result anyref)
+ (local $5 funcref)
+ (local $6 f32)
+ (local $7 funcref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (ref.null)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (ref.null)
+ )
+ (func $func_34_invoker (; 35 ;)
+ (drop
+ (call $func_34
+ (f64.const -2.2250738585072014e-308)
+ (i32.const 1679427100)
+ (i64.const 5402)
+ (f64.const -1.1754943508222875e-38)
+ (f32.const 16384)
+ )
+ )
+ (drop
+ (call $func_34
+ (f64.const 4294967296)
+ (i32.const 0)
+ (i64.const 19531)
+ (f64.const 1256914182047749521306957e208)
+ (f32.const 470816288)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ )
+ (func $func_36 (; 36 ;) (result funcref)
+ (local $0 nullref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (ref.null)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$0 (result funcref)
+ (call $log-f32
+ (block $label$1
+ (call $log-i32
+ (call $hashMemory)
+ )
+ (return
+ (ref.func $func_15_invoker)
+ )
+ )
+ )
+ (loop $label$2 (result funcref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (ref.func $func_27_invoker)
)
)
- (i32.eqz
- (i32.const 16719)
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block (result funcref)
+ (block $label$3
+ (br_if $label$2
+ (i32.const 11)
+ )
+ (nop)
+ )
+ (br_if $label$2
+ (i32.eqz
+ (i32.const -119)
+ )
+ )
+ (block (result funcref)
+ (nop)
+ (br_if $label$2
+ (i32.eqz
+ (i32.const -119)
+ )
+ )
+ (ref.func $func_34_invoker)
)
)
)
- (v128.const i32x4 0x1d735757 0xd9800000 0xffffffc5 0xc9800000)
)
)
- (func $hangLimitInitializer (; 8 ;)
+ (func $hangLimitInitializer (; 37 ;)
(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 8c34a1384..7a1000fd5 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
@@ -1,34 +1,72 @@
(module
- (type $none_=>_i32 (func (result i32)))
(type $none_=>_none (func))
+ (type $none_=>_i32 (func (result i32)))
+ (type $none_=>_i64 (func (result i64)))
(type $i32_=>_none (func (param i32)))
(type $i64_=>_none (func (param i64)))
(type $f32_=>_none (func (param f32)))
(type $f64_=>_none (func (param f64)))
- (type $f64_f32_=>_none (func (param f64 f32)))
+ (type $f64_exnref_=>_none (func (param f64 exnref)))
(type $v128_=>_none (func (param v128)))
+ (type $anyref_i64_i32_f32_nullref_exnref_=>_none (func (param anyref i64 i32 f32 nullref exnref)))
+ (type $nullref_=>_none (func (param nullref)))
+ (type $exnref_=>_none (func (param exnref)))
+ (type $exnref_f32_v128_i32_funcref_=>_none (func (param exnref f32 v128 i32 funcref)))
+ (type $i64_=>_i32 (func (param i64) (result i32)))
+ (type $f32_=>_i64 (func (param f32) (result i64)))
+ (type $none_=>_f32 (func (result f32)))
(type $f32_=>_f32 (func (param f32) (result f32)))
(type $f64_=>_f64 (func (param f64) (result f64)))
- (type $f64_i32_=>_v128 (func (param f64 i32) (result v128)))
+ (type $none_=>_funcref (func (result funcref)))
+ (type $v128_anyref_i32_i32_=>_funcref (func (param v128 anyref i32 i32) (result funcref)))
+ (type $f64_i32_i64_f64_f32_=>_anyref (func (param f64 i32 i64 f64 f32) (result anyref)))
+ (type $nullref_=>_anyref (func (param nullref) (result anyref)))
+ (type $i32_exnref_exnref_v128_v128_v128_=>_nullref (func (param i32 exnref exnref v128 v128 v128) (result nullref)))
+ (type $f32_v128_v128_f32_=>_nullref (func (param f32 v128 v128 f32) (result nullref)))
+ (type $v128_=>_nullref (func (param v128) (result nullref)))
(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-nullref" (func $log-nullref (param nullref)))
+ (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")
- (table $0 0 0 funcref)
+ (table $0 10 10 funcref)
+ (elem (i32.const 0) $func_8 $func_13 $func_13 $func_13 $func_14 $func_15 $func_17 $func_23 $func_23 $func_31)
(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 funcref) (ref.null))
+ (global $global$6 (mut anyref) (ref.null))
+ (global $global$7 (mut nullref) (ref.null))
+ (global $global$8 (mut nullref) (ref.null))
(global $hangLimit (mut i32) (i32.const 10))
- (event $event$0 (attr 0) (param f64 f32))
+ (event $event$0 (attr 0) (param f64 exnref))
+ (event $event$1 (attr 0) (param exnref f32 v128 i32 funcref))
(export "hashMemory" (func $hashMemory))
(export "memory" (memory $0))
+ (export "func_8" (func $func_8))
+ (export "func_9_invoker" (func $func_9_invoker))
+ (export "func_11_invoker" (func $func_11_invoker))
+ (export "func_13" (func $func_13))
+ (export "func_15_invoker" (func $func_15_invoker))
+ (export "func_17_invoker" (func $func_17_invoker))
+ (export "func_19_invoker" (func $func_19_invoker))
+ (export "func_23_invoker" (func $func_23_invoker))
+ (export "func_25_invoker" (func $func_25_invoker))
+ (export "func_27_invoker" (func $func_27_invoker))
+ (export "func_29_invoker" (func $func_29_invoker))
+ (export "func_31" (func $func_31))
+ (export "func_31_invoker" (func $func_31_invoker))
+ (export "func_34" (func $func_34))
+ (export "func_34_invoker" (func $func_34_invoker))
+ (export "func_36" (func $func_36))
(export "hangLimitInitializer" (func $hangLimitInitializer))
- (func $hashMemory (; 5 ;) (result i32)
+ (func $hashMemory (; 7 ;) (result i32)
(local $0 i32)
(local.set $0
(i32.const 5381)
@@ -259,15 +297,334 @@
)
(local.get $0)
)
- (func $func_6 (; 6 ;) (result i32)
+ (func $func_8 (; 8 ;)
+ (local $0 v128)
+ (local $1 exnref)
+ (local $2 f64)
+ (local $3 f32)
+ (local $4 i64)
+ (local $5 funcref)
+ (local $6 v128)
+ (local $7 funcref)
+ (local $8 i64)
+ (local $9 funcref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return)
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$0
+ (nop)
+ (local.set $9
+ (local.tee $7
+ (local.tee $7
+ (local.tee $9
+ (local.tee $5
+ (local.tee $7
+ (local.get $9)
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ (func $func_9 (; 9 ;) (param $0 anyref) (param $1 i64) (param $2 i32) (param $3 f32) (param $4 nullref) (param $5 exnref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return)
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (call $log-exnref
+ (block $label$0
+ (call $log-f64
+ (f64.const 27)
+ )
+ (return)
+ )
+ )
+ )
+ (func $func_9_invoker (; 10 ;)
+ (call $func_9
+ (ref.null)
+ (i64.const -114)
+ (i32.const -1)
+ (f32.const 0)
+ (ref.null)
+ (ref.null)
+ )
+ (call $func_9
+ (ref.null)
+ (i64.const -128)
+ (i32.const 2147483647)
+ (f32.const 2305843009213693952)
+ (ref.null)
+ (ref.null)
+ )
+ (call $func_9
+ (ref.null)
+ (i64.const -84)
+ (i32.const -77)
+ (f32.const 65463)
+ (ref.null)
+ (ref.null)
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ )
+ (func $func_11 (; 11 ;) (param $0 f32) (param $1 v128) (param $2 v128) (param $3 f32) (result nullref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (ref.null)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (ref.null)
+ )
+ (func $func_11_invoker (; 12 ;)
+ (drop
+ (call $func_11
+ (f32.const -4)
+ (v128.const i32x4 0xffffffe8 0x00000a12 0x00000002 0xffffff80)
+ (v128.const i32x4 0x00000000 0x00000001 0x00000000 0x40000000)
+ (f32.const 4503599627370496)
+ )
+ )
+ (drop
+ (call $func_11
+ (f32.const 2.7426516613360263e-09)
+ (v128.const i32x4 0x0d080315 0x00001811 0xfffffc00 0x0000007f)
+ (v128.const i32x4 0x0000187f 0x042c50ee 0x005c171b 0x001a1b1a)
+ (f32.const 0)
+ )
+ )
+ )
+ (func $func_13 (; 13 ;) (result i64)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (i64.const 114)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (i64.const 9093677305969276536)
+ )
+ (func $func_14 (; 14 ;) (result i64)
+ (local $0 i64)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (local.get $0)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$0
+ (nop)
+ (return
+ (i64.const 302456592)
+ )
+ )
+ )
+ (func $func_15 (; 15 ;) (param $0 v128) (param $1 anyref) (param $2 i32) (param $3 i32) (result funcref)
+ (local $4 funcref)
+ (local $5 f64)
+ (local $6 i32)
+ (local $7 i64)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (local.get $4)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$0
+ (call $log-exnref
+ (ref.null)
+ )
+ (return
+ (local.get $4)
+ )
+ )
+ )
+ (func $func_15_invoker (; 16 ;)
+ (drop
+ (call $func_15
+ (v128.const i32x4 0x00080000 0x1a180e76 0x3a25515d 0xffff8001)
+ (ref.null)
+ (i32.const 202116108)
+ (i32.const 151587164)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ )
+ (func $func_17 (; 17 ;) (result i32)
(local $0 i64)
+ (local $1 v128)
+ (local $2 v128)
+ (local $3 f32)
+ (local $4 funcref)
(block
(if
(i32.eqz
(global.get $hangLimit)
)
(return
- (i32.const 1296977737)
+ (i32.const 332)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$0
+ (loop $label$1
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (i32.const -128)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$2
+ (nop)
+ (nop)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ (return
+ (i32.const 84215045)
+ )
+ )
+ )
+ (func $func_17_invoker (; 18 ;)
+ (drop
+ (call $func_17)
+ )
+ )
+ (func $func_19 (; 19 ;) (param $0 i64) (result i32)
+ (local $1 f32)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (i32.const 2)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (i32.const 65536)
+ )
+ (func $func_19_invoker (; 20 ;)
+ (drop
+ (call $func_19
+ (i64.const 129)
+ )
+ )
+ (drop
+ (call $func_19
+ (i64.const 562949953421312)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ (drop
+ (call $func_19
+ (i64.const -32767)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ )
+ (func $func_21 (; 21 ;) (result i32)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (i32.const 90)
)
)
(global.set $hangLimit
@@ -279,21 +636,354 @@
)
(block $label$0
(nop)
+ (return
+ (i32.const 7446)
+ )
+ )
+ )
+ (func $func_22 (; 22 ;) (result f32)
+ (local $0 i64)
+ (local $1 exnref)
+ (local $2 funcref)
+ (local $3 i64)
+ (local $4 anyref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (f32.const 21554)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$0
+ (return
+ (f32.const -1.1754943508222875e-38)
+ )
+ )
+ )
+ (func $func_23 (; 23 ;) (param $0 nullref) (result anyref)
+ (local $1 exnref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (ref.null)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$0 (result nullref)
(nop)
+ (loop $label$2 (result nullref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (ref.null)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (loop $label$3 (result nullref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (ref.null)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block (result nullref)
+ (call $log-i32
+ (call $hashMemory)
+ )
+ (br_if $label$3
+ (i32.const 12)
+ )
+ (ref.null)
+ )
+ )
+ )
+ )
+ )
+ (func $func_23_invoker (; 24 ;)
+ (drop
+ (call $func_23
+ (ref.null)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ (drop
+ (call $func_23
+ (ref.null)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ (drop
+ (call $func_23
+ (ref.null)
+ )
+ )
+ )
+ (func $func_25 (; 25 ;) (param $0 f32) (result i64)
+ (local $1 i32)
+ (local $2 f64)
+ (local $3 funcref)
+ (local $4 i32)
+ (local $5 f32)
+ (local $6 anyref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (i64.const -9223372036854775808)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (i64.const -16)
+ )
+ (func $func_25_invoker (; 26 ;)
+ (drop
+ (call $func_25
+ (f32.const 30)
+ )
+ )
+ (drop
+ (call $func_25
+ (f32.const 17179869184)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ (drop
+ (call $func_25
+ (f32.const 2147483648)
+ )
+ )
+ (drop
+ (call $func_25
+ (f32.const 0)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ (drop
+ (call $func_25
+ (f32.const 9223372036854775808)
+ )
+ )
+ (drop
+ (call $func_25
+ (f32.const 0)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ (drop
+ (call $func_25
+ (f32.const 8760)
+ )
+ )
+ )
+ (func $func_27 (; 27 ;) (param $0 i32) (param $1 exnref) (param $2 exnref) (param $3 v128) (param $4 v128) (param $5 v128) (result nullref)
+ (local $6 f32)
+ (local $7 v128)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (ref.null)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$0
+ (call $log-i64
+ (i64.const 84)
+ )
(return
- (i32.const -4096)
+ (ref.null)
+ )
+ )
+ )
+ (func $func_27_invoker (; 28 ;)
+ (drop
+ (call $func_27
+ (i32.const -69)
+ (ref.null)
+ (ref.null)
+ (v128.const i32x4 0x00000000 0x40800800 0x00000000 0x42200000)
+ (v128.const i32x4 0x00800000 0x42dc0000 0x40000000 0xcf000000)
+ (v128.const i32x4 0x00000000 0x41e00000 0x00000000 0x38100000)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ )
+ (func $func_29 (; 29 ;) (result i32)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (i32.const 7)
+ )
)
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (i32.const -18)
+ )
+ (func $func_29_invoker (; 30 ;)
+ (drop
+ (call $func_29)
)
)
- (func $func_7 (; 7 ;) (param $0 f64) (param $1 i32) (result v128)
+ (func $func_31 (; 31 ;) (param $0 v128) (result nullref)
(block
(if
(i32.eqz
(global.get $hangLimit)
)
(return
- (v128.const i32x4 0x00008048 0x6400ed00 0x00010101 0x264ec77c)
+ (ref.null)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (if
+ (i32.load8_s offset=22
+ (i32.and
+ (i32.const 774514976)
+ (i32.const 15)
+ )
+ )
+ (select
+ (block $label$0
+ (block $label$1
+ (block $label$5
+ (call $log-i32
+ (call $hashMemory)
+ )
+ (return
+ (ref.null)
+ )
+ )
+ )
)
+ (return_call $func_31
+ (local.tee $0
+ (v128.const i32x4 0x00000000 0xc3e00000 0x00000000 0x40b70500)
+ )
+ )
+ (i32.const 0)
+ )
+ (block $label$3
+ (nop)
+ (block $label$4
+ (call $log-f32
+ (f32.const -1152921504606846976)
+ )
+ (return_call $func_31
+ (v128.const i32x4 0x08000000 0x00000000 0xffff8000 0xffffffff)
+ )
+ )
+ )
+ )
+ )
+ (func $func_31_invoker (; 32 ;)
+ (drop
+ (call $func_31
+ (v128.const i32x4 0x00080000 0x00000081 0xffffffad 0x00000001)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ )
+ (func $func_33 (; 33 ;)
+ (local $0 i32)
+ (local $1 f64)
+ (local $2 i64)
+ (local $3 f64)
+ (local $4 i64)
+ (local $5 anyref)
+ (local $6 i32)
+ (local $7 v128)
+ (local $8 i32)
+ (local $9 f64)
+ (local $10 f64)
+ (local $11 nullref)
+ (local $12 v128)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return)
)
(global.set $hangLimit
(i32.sub
@@ -302,14 +992,122 @@
)
)
)
- (v128.const i32x4 0x00000001 0x00000000 0xffffffed 0xffffffff)
+ (local.set $11
+ (ref.null)
+ )
+ )
+ (func $func_34 (; 34 ;) (param $0 f64) (param $1 i32) (param $2 i64) (param $3 f64) (param $4 f32) (result anyref)
+ (local $5 funcref)
+ (local $6 f32)
+ (local $7 funcref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (ref.null)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (ref.null)
+ )
+ (func $func_34_invoker (; 35 ;)
+ (drop
+ (call $func_34
+ (f64.const -2.2250738585072014e-308)
+ (i32.const 1679427100)
+ (i64.const 5402)
+ (f64.const -1.1754943508222875e-38)
+ (f32.const 16384)
+ )
+ )
+ (drop
+ (call $func_34
+ (f64.const 4294967296)
+ (i32.const 0)
+ (i64.const 19531)
+ (f64.const 1256914182047749521306957e208)
+ (f32.const 470816288)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ )
+ (func $func_36 (; 36 ;) (result funcref)
+ (local $0 nullref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (ref.null)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$0 (result funcref)
+ (call $log-f32
+ (block $label$1
+ (call $log-i32
+ (i32.const 117705997)
+ )
+ (return
+ (ref.func $func_15_invoker)
+ )
+ )
+ )
+ (loop $label$2 (result funcref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (ref.func $func_17)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block (result funcref)
+ (block $label$3
+ (br_if $label$3
+ (i32.const 909193002)
+ )
+ (nop)
+ )
+ (br_if $label$2
+ (i32.const -2147483648)
+ )
+ (ref.func $func_17)
+ )
+ )
+ )
)
- (func $hangLimitInitializer (; 8 ;)
+ (func $hangLimitInitializer (; 37 ;)
(global.set $hangLimit
(i32.const 10)
)
)
- (func $deNan32 (; 9 ;) (param $0 f32) (result f32)
+ (func $deNan32 (; 38 ;) (param $0 f32) (result f32)
(if (result f32)
(f32.eq
(local.get $0)
@@ -319,7 +1117,7 @@
(f32.const 0)
)
)
- (func $deNan64 (; 10 ;) (param $0 f64) (result f64)
+ (func $deNan64 (; 39 ;) (param $0 f64) (result f64)
(if (result f64)
(f64.eq
(local.get $0)
diff --git a/test/push_pop.wast b/test/push_pop.wast
index f40e30abe..d73e0dc68 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 6ab4074bf..642d97791 100644
--- a/test/push_pop.wast.from-wast
+++ b/test/push_pop.wast.from-wast
@@ -1,12 +1,20 @@
(module
+ (type $none_=>_none (func))
(type $none_=>_i32 (func (result i32)))
(type $none_=>_i64 (func (result i64)))
(type $none_=>_f32 (func (result f32)))
(type $none_=>_f64 (func (result f64)))
+ (type $none_=>_funcref (func (result funcref)))
+ (type $none_=>_anyref (func (result anyref)))
+ (type $none_=>_exnref (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 ;) (result i32)
(push
(i32.const 1)
@@ -31,4 +39,33 @@
)
(f64.pop)
)
+ (func $4 (; 4 ;) (result anyref)
+ (local $any anyref)
+ (push
+ (local.get $any)
+ )
+ (anyref.pop)
+ )
+ (func $5 (; 5 ;) (result funcref)
+ (local $fn funcref)
+ (push
+ (local.get $fn)
+ )
+ (funcref.pop)
+ )
+ (func $6 (; 6 ;)
+ (push
+ (ref.null)
+ )
+ (drop
+ (nullref.pop)
+ )
+ )
+ (func $7 (; 7 ;) (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 52db1d5fb..64d6d4abd 100644
--- a/test/push_pop.wast.fromBinary
+++ b/test/push_pop.wast.fromBinary
@@ -1,12 +1,20 @@
(module
+ (type $none_=>_none (func))
(type $none_=>_i32 (func (result i32)))
(type $none_=>_i64 (func (result i64)))
(type $none_=>_f32 (func (result f32)))
(type $none_=>_f64 (func (result f64)))
+ (type $none_=>_funcref (func (result funcref)))
+ (type $none_=>_anyref (func (result anyref)))
+ (type $none_=>_exnref (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 ;) (result i32)
(i32.const 1)
)
@@ -19,5 +27,22 @@
(func $3 (; 3 ;) (result f64)
(f64.const 1)
)
+ (func $4 (; 4 ;) (result anyref)
+ (local $0 anyref)
+ (local.get $0)
+ )
+ (func $5 (; 5 ;) (result funcref)
+ (local $0 funcref)
+ (local.get $0)
+ )
+ (func $6 (; 6 ;)
+ (drop
+ (ref.null)
+ )
+ )
+ (func $7 (; 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 52db1d5fb..64d6d4abd 100644
--- a/test/push_pop.wast.fromBinary.noDebugInfo
+++ b/test/push_pop.wast.fromBinary.noDebugInfo
@@ -1,12 +1,20 @@
(module
+ (type $none_=>_none (func))
(type $none_=>_i32 (func (result i32)))
(type $none_=>_i64 (func (result i64)))
(type $none_=>_f32 (func (result f32)))
(type $none_=>_f64 (func (result f64)))
+ (type $none_=>_funcref (func (result funcref)))
+ (type $none_=>_anyref (func (result anyref)))
+ (type $none_=>_exnref (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 ;) (result i32)
(i32.const 1)
)
@@ -19,5 +27,22 @@
(func $3 (; 3 ;) (result f64)
(f64.const 1)
)
+ (func $4 (; 4 ;) (result anyref)
+ (local $0 anyref)
+ (local.get $0)
+ )
+ (func $5 (; 5 ;) (result funcref)
+ (local $0 funcref)
+ (local.get $0)
+ )
+ (func $6 (; 6 ;)
+ (drop
+ (ref.null)
+ )
+ )
+ (func $7 (; 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 000000000..1c2602c24
--- /dev/null
+++ b/test/reference-types.wast
@@ -0,0 +1,361 @@
+;; reftype :: anyref | funcref | exnref | nullref
+
+;; 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)))
+ (type $sig_nullref (func (param nullref)))
+
+ (func $take_anyref (param anyref))
+ (func $take_funcref (param funcref))
+ (func $take_exnref (param exnref))
+ (func $take_nullref (param nullref))
+ (func $foo)
+
+ (table funcref (elem $take_anyref $take_funcref $take_exnref $take_nullref))
+
+ (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_nullref (mut nullref) (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) (local $local_nullref nullref)
+ ;; 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 (local.get $local_nullref))
+ (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))
+ (local.set $local_nullref (local.get $local_nullref))
+ (local.set $local_nullref (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 (global.get $global_nullref))
+ (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))
+ (global.set $global_nullref (global.get $global_nullref))
+ (global.set $global_nullref (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))
+ (call_indirect (type $sig_nullref) (local.get $local_nullref) (i32.const 3))
+ (call_indirect (type $sig_nullref) (ref.null) (i32.const 3))
+
+ ;; 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))
+ )
+ )
+ (drop
+ (block (result nullref)
+ (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)
+ )
+ )
+ (drop
+ (loop (result nullref)
+ (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)
+ )
+ )
+ (drop
+ (if (result nullref)
+ (i32.const 1)
+ (local.get $local_nullref)
+ (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)
+ )
+ )
+ )
+ (drop
+ (try (result nullref)
+ (ref.null)
+ (catch
+ (drop (exnref.pop))
+ (ref.null)
+ )
+ )
+ )
+
+ ;; 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 nullref)
+ (ref.null)
+ (ref.null)
+ (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_exnref)))
+ (drop (ref.is_null (ref.func $foo)))
+ (drop (ref.is_null (ref.null)))
+ )
+
+ ;; 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)
+ )
+ (func $return_nullref (result nullref) (local $local_nullref nullref)
+ (local.get $local_nullref)
+ )
+
+ ;; 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))
+ )
+ (func $return_nullref_returns (result nullref) (local $local_nullref nullref)
+ (return (local.get $local_nullref))
+ (return (ref.null))
+ )
+)
diff --git a/test/reference-types.wast.from-wast b/test/reference-types.wast.from-wast
new file mode 100644
index 000000000..598e38e70
--- /dev/null
+++ b/test/reference-types.wast.from-wast
@@ -0,0 +1,509 @@
+(module
+ (type $anyref_=>_none (func (param anyref)))
+ (type $none_=>_anyref (func (result anyref)))
+ (type $funcref_=>_none (func (param funcref)))
+ (type $nullref_=>_none (func (param nullref)))
+ (type $exnref_=>_none (func (param exnref)))
+ (type $none_=>_funcref (func (result funcref)))
+ (type $none_=>_exnref (func (result exnref)))
+ (type $none_=>_none (func))
+ (type $none_=>_nullref (func (result nullref)))
+ (type $anyref_=>_funcref (func (param anyref) (result funcref)))
+ (import "env" "import_global" (global $import_global anyref))
+ (import "env" "import_func" (func $import_func (param anyref) (result funcref)))
+ (table $0 4 4 funcref)
+ (elem (i32.const 0) $take_anyref $take_funcref $take_exnref $take_nullref)
+ (global $global_anyref (mut anyref) (ref.null))
+ (global $global_funcref (mut funcref) (ref.null))
+ (global $global_exnref (mut exnref) (ref.null))
+ (global $global_nullref (mut nullref) (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 ;) (param $0 anyref)
+ (nop)
+ )
+ (func $take_funcref (; 2 ;) (param $0 funcref)
+ (nop)
+ )
+ (func $take_exnref (; 3 ;) (param $0 exnref)
+ (nop)
+ )
+ (func $take_nullref (; 4 ;) (param $0 nullref)
+ (nop)
+ )
+ (func $foo (; 5 ;)
+ (nop)
+ )
+ (func $test (; 6 ;)
+ (local $local_anyref anyref)
+ (local $local_funcref funcref)
+ (local $local_exnref exnref)
+ (local $local_nullref nullref)
+ (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
+ (local.get $local_nullref)
+ )
+ (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)
+ )
+ (local.set $local_nullref
+ (local.get $local_nullref)
+ )
+ (local.set $local_nullref
+ (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
+ (global.get $global_nullref)
+ )
+ (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)
+ )
+ (global.set $global_nullref
+ (global.get $global_nullref)
+ )
+ (global.set $global_nullref
+ (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 $anyref_=>_none)
+ (local.get $local_anyref)
+ (i32.const 0)
+ )
+ (call_indirect (type $anyref_=>_none)
+ (local.get $local_funcref)
+ (i32.const 0)
+ )
+ (call_indirect (type $anyref_=>_none)
+ (local.get $local_exnref)
+ (i32.const 0)
+ )
+ (call_indirect (type $anyref_=>_none)
+ (ref.null)
+ (i32.const 0)
+ )
+ (call_indirect (type $funcref_=>_none)
+ (local.get $local_funcref)
+ (i32.const 1)
+ )
+ (call_indirect (type $funcref_=>_none)
+ (ref.null)
+ (i32.const 1)
+ )
+ (call_indirect (type $exnref_=>_none)
+ (local.get $local_exnref)
+ (i32.const 2)
+ )
+ (call_indirect (type $exnref_=>_none)
+ (ref.null)
+ (i32.const 2)
+ )
+ (call_indirect (type $nullref_=>_none)
+ (local.get $local_nullref)
+ (i32.const 3)
+ )
+ (call_indirect (type $nullref_=>_none)
+ (ref.null)
+ (i32.const 3)
+ )
+ (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
+ (block $block5 (result nullref)
+ (br_if $block5
+ (ref.null)
+ (i32.const 1)
+ )
+ )
+ )
+ (drop
+ (loop $loop-in (result anyref)
+ (local.get $local_anyref)
+ )
+ )
+ (drop
+ (loop $loop-in6 (result anyref)
+ (local.get $local_funcref)
+ )
+ )
+ (drop
+ (loop $loop-in7 (result anyref)
+ (local.get $local_exnref)
+ )
+ )
+ (drop
+ (loop $loop-in8 (result anyref)
+ (ref.null)
+ )
+ )
+ (drop
+ (loop $loop-in9 (result funcref)
+ (local.get $local_funcref)
+ )
+ )
+ (drop
+ (loop $loop-in10 (result funcref)
+ (ref.null)
+ )
+ )
+ (drop
+ (loop $loop-in11 (result exnref)
+ (local.get $local_exnref)
+ )
+ )
+ (drop
+ (loop $loop-in12 (result exnref)
+ (ref.null)
+ )
+ )
+ (drop
+ (loop $loop-in13 (result nullref)
+ (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
+ (if (result nullref)
+ (i32.const 1)
+ (local.get $local_nullref)
+ (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
+ (try (result nullref)
+ (ref.null)
+ (catch
+ (drop
+ (exnref.pop)
+ )
+ (ref.null)
+ )
+ )
+ )
+ (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 nullref)
+ (ref.null)
+ (ref.null)
+ (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_exnref)
+ )
+ )
+ (drop
+ (ref.is_null
+ (ref.func $foo)
+ )
+ )
+ (drop
+ (ref.is_null
+ (ref.null)
+ )
+ )
+ )
+ (func $return_anyref (; 7 ;) (result anyref)
+ (local $local_anyref anyref)
+ (local.get $local_anyref)
+ )
+ (func $return_anyref2 (; 8 ;) (result anyref)
+ (ref.func $foo)
+ )
+ (func $return_anyref3 (; 9 ;) (result anyref)
+ (local $local_exnref exnref)
+ (local.get $local_exnref)
+ )
+ (func $return_anyref4 (; 10 ;) (result anyref)
+ (ref.null)
+ )
+ (func $return_funcref (; 11 ;) (result funcref)
+ (ref.func $foo)
+ )
+ (func $return_funcref2 (; 12 ;) (result funcref)
+ (ref.null)
+ )
+ (func $return_exnref (; 13 ;) (result exnref)
+ (local $local_exnref exnref)
+ (local.get $local_exnref)
+ )
+ (func $return_exnref2 (; 14 ;) (result exnref)
+ (ref.null)
+ )
+ (func $return_nullref (; 15 ;) (result nullref)
+ (local $local_nullref nullref)
+ (local.get $local_nullref)
+ )
+ (func $return_anyref_returns (; 16 ;) (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 (; 17 ;) (result funcref)
+ (return
+ (ref.func $foo)
+ )
+ (return
+ (ref.null)
+ )
+ )
+ (func $return_exnref_returns (; 18 ;) (result exnref)
+ (local $local_exnref exnref)
+ (return
+ (local.get $local_exnref)
+ )
+ (return
+ (ref.null)
+ )
+ )
+ (func $return_nullref_returns (; 19 ;) (result nullref)
+ (local $local_nullref nullref)
+ (return
+ (local.get $local_nullref)
+ )
+ (return
+ (ref.null)
+ )
+ )
+)
diff --git a/test/reference-types.wast.fromBinary b/test/reference-types.wast.fromBinary
new file mode 100644
index 000000000..b1229db8b
--- /dev/null
+++ b/test/reference-types.wast.fromBinary
@@ -0,0 +1,492 @@
+(module
+ (type $anyref_=>_none (func (param anyref)))
+ (type $none_=>_anyref (func (result anyref)))
+ (type $funcref_=>_none (func (param funcref)))
+ (type $nullref_=>_none (func (param nullref)))
+ (type $exnref_=>_none (func (param exnref)))
+ (type $none_=>_funcref (func (result funcref)))
+ (type $none_=>_exnref (func (result exnref)))
+ (type $none_=>_none (func))
+ (type $none_=>_nullref (func (result nullref)))
+ (type $anyref_=>_funcref (func (param anyref) (result funcref)))
+ (import "env" "import_global" (global $gimport$1 anyref))
+ (import "env" "import_func" (func $import_func (param anyref) (result funcref)))
+ (table $0 4 4 funcref)
+ (elem (i32.const 0) $take_anyref $take_funcref $take_exnref $take_nullref)
+ (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 nullref) (ref.null))
+ (global $global$4 (mut anyref) (ref.func $foo))
+ (global $global$5 (mut funcref) (ref.func $foo))
+ (export "export_func" (func $import_func))
+ (export "export_global" (global $gimport$1))
+ (func $take_anyref (; 1 ;) (param $0 anyref)
+ (nop)
+ )
+ (func $take_funcref (; 2 ;) (param $0 funcref)
+ (nop)
+ )
+ (func $take_exnref (; 3 ;) (param $0 exnref)
+ (nop)
+ )
+ (func $take_nullref (; 4 ;) (param $0 nullref)
+ (nop)
+ )
+ (func $foo (; 5 ;)
+ (nop)
+ )
+ (func $test (; 6 ;)
+ (local $0 funcref)
+ (local $1 anyref)
+ (local $2 nullref)
+ (local $3 exnref)
+ (local.set $1
+ (local.get $1)
+ )
+ (local.set $1
+ (local.get $0)
+ )
+ (local.set $1
+ (local.get $3)
+ )
+ (local.set $1
+ (local.get $2)
+ )
+ (local.set $1
+ (ref.null)
+ )
+ (local.set $1
+ (ref.func $foo)
+ )
+ (local.set $0
+ (local.get $0)
+ )
+ (local.set $0
+ (ref.null)
+ )
+ (local.set $0
+ (ref.func $foo)
+ )
+ (local.set $3
+ (local.get $3)
+ )
+ (local.set $3
+ (ref.null)
+ )
+ (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
+ (global.get $global$3)
+ )
+ (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)
+ )
+ (global.set $global$3
+ (global.get $global$3)
+ )
+ (global.set $global$3
+ (ref.null)
+ )
+ (call $take_anyref
+ (local.get $1)
+ )
+ (call $take_anyref
+ (local.get $0)
+ )
+ (call $take_anyref
+ (local.get $3)
+ )
+ (call $take_anyref
+ (ref.null)
+ )
+ (call_indirect (type $anyref_=>_none)
+ (local.get $1)
+ (i32.const 0)
+ )
+ (call_indirect (type $anyref_=>_none)
+ (local.get $0)
+ (i32.const 0)
+ )
+ (call_indirect (type $anyref_=>_none)
+ (local.get $3)
+ (i32.const 0)
+ )
+ (call_indirect (type $anyref_=>_none)
+ (ref.null)
+ (i32.const 0)
+ )
+ (call_indirect (type $funcref_=>_none)
+ (local.get $0)
+ (i32.const 1)
+ )
+ (call_indirect (type $funcref_=>_none)
+ (ref.null)
+ (i32.const 1)
+ )
+ (call_indirect (type $exnref_=>_none)
+ (local.get $3)
+ (i32.const 2)
+ )
+ (call_indirect (type $exnref_=>_none)
+ (ref.null)
+ (i32.const 2)
+ )
+ (call_indirect (type $nullref_=>_none)
+ (local.get $2)
+ (i32.const 3)
+ )
+ (call_indirect (type $nullref_=>_none)
+ (ref.null)
+ (i32.const 3)
+ )
+ (drop
+ (block $label$1 (result anyref)
+ (br_if $label$1
+ (local.get $1)
+ (i32.const 1)
+ )
+ )
+ )
+ (drop
+ (block $label$2 (result anyref)
+ (br_if $label$2
+ (local.get $0)
+ (i32.const 1)
+ )
+ )
+ )
+ (drop
+ (block $label$3 (result anyref)
+ (br_if $label$3
+ (local.get $3)
+ (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
+ (block $label$7 (result nullref)
+ (br_if $label$7
+ (ref.null)
+ (i32.const 1)
+ )
+ )
+ )
+ (drop
+ (loop $label$8 (result anyref)
+ (local.get $1)
+ )
+ )
+ (drop
+ (loop $label$9 (result anyref)
+ (local.get $0)
+ )
+ )
+ (drop
+ (loop $label$10 (result anyref)
+ (local.get $3)
+ )
+ )
+ (drop
+ (loop $label$11 (result anyref)
+ (ref.null)
+ )
+ )
+ (drop
+ (loop $label$12 (result funcref)
+ (local.get $0)
+ )
+ )
+ (drop
+ (loop $label$13 (result funcref)
+ (ref.null)
+ )
+ )
+ (drop
+ (loop $label$14 (result exnref)
+ (local.get $3)
+ )
+ )
+ (drop
+ (loop $label$15 (result exnref)
+ (ref.null)
+ )
+ )
+ (drop
+ (loop $label$16 (result nullref)
+ (ref.null)
+ )
+ )
+ (drop
+ (if (result anyref)
+ (i32.const 1)
+ (local.get $1)
+ (local.get $3)
+ )
+ )
+ (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 $3)
+ (ref.null)
+ )
+ )
+ (drop
+ (if (result nullref)
+ (i32.const 1)
+ (local.get $2)
+ (ref.null)
+ )
+ )
+ (drop
+ (try (result anyref)
+ (local.get $1)
+ (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
+ (try (result nullref)
+ (ref.null)
+ (catch
+ (drop
+ (exnref.pop)
+ )
+ (ref.null)
+ )
+ )
+ )
+ (drop
+ (select (result anyref)
+ (local.get $1)
+ (ref.func $foo)
+ (i32.const 1)
+ )
+ )
+ (drop
+ (select (result anyref)
+ (local.get $3)
+ (local.get $1)
+ (i32.const 1)
+ )
+ )
+ (drop
+ (select (result anyref)
+ (local.get $1)
+ (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 $3)
+ (i32.const 1)
+ )
+ )
+ (drop
+ (select (result nullref)
+ (ref.null)
+ (ref.null)
+ (i32.const 1)
+ )
+ )
+ (drop
+ (select
+ (i32.const 0)
+ (i32.const 2)
+ (i32.const 1)
+ )
+ )
+ (drop
+ (ref.is_null
+ (local.get $1)
+ )
+ )
+ (drop
+ (ref.is_null
+ (local.get $3)
+ )
+ )
+ (drop
+ (ref.is_null
+ (ref.func $foo)
+ )
+ )
+ (drop
+ (ref.is_null
+ (ref.null)
+ )
+ )
+ )
+ (func $return_anyref (; 7 ;) (result anyref)
+ (local $0 anyref)
+ (local.get $0)
+ )
+ (func $return_anyref2 (; 8 ;) (result anyref)
+ (ref.func $foo)
+ )
+ (func $return_anyref3 (; 9 ;) (result anyref)
+ (local $0 exnref)
+ (local.get $0)
+ )
+ (func $return_anyref4 (; 10 ;) (result anyref)
+ (ref.null)
+ )
+ (func $return_funcref (; 11 ;) (result funcref)
+ (ref.func $foo)
+ )
+ (func $return_funcref2 (; 12 ;) (result funcref)
+ (ref.null)
+ )
+ (func $return_exnref (; 13 ;) (result exnref)
+ (local $0 exnref)
+ (local.get $0)
+ )
+ (func $return_exnref2 (; 14 ;) (result exnref)
+ (ref.null)
+ )
+ (func $return_nullref (; 15 ;) (result nullref)
+ (local $0 nullref)
+ (local.get $0)
+ )
+ (func $return_anyref_returns (; 16 ;) (result anyref)
+ (local $0 anyref)
+ (local $1 exnref)
+ (return
+ (local.get $0)
+ )
+ )
+ (func $return_funcref_returns (; 17 ;) (result funcref)
+ (return
+ (ref.func $foo)
+ )
+ )
+ (func $return_exnref_returns (; 18 ;) (result exnref)
+ (local $0 exnref)
+ (return
+ (local.get $0)
+ )
+ )
+ (func $return_nullref_returns (; 19 ;) (result nullref)
+ (local $0 nullref)
+ (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 000000000..aee92afc2
--- /dev/null
+++ b/test/reference-types.wast.fromBinary.noDebugInfo
@@ -0,0 +1,492 @@
+(module
+ (type $anyref_=>_none (func (param anyref)))
+ (type $none_=>_anyref (func (result anyref)))
+ (type $funcref_=>_none (func (param funcref)))
+ (type $nullref_=>_none (func (param nullref)))
+ (type $exnref_=>_none (func (param exnref)))
+ (type $none_=>_funcref (func (result funcref)))
+ (type $none_=>_exnref (func (result exnref)))
+ (type $none_=>_none (func))
+ (type $none_=>_nullref (func (result nullref)))
+ (type $anyref_=>_funcref (func (param anyref) (result funcref)))
+ (import "env" "import_global" (global $gimport$1 anyref))
+ (import "env" "import_func" (func $fimport$0 (param anyref) (result funcref)))
+ (table $0 4 4 funcref)
+ (elem (i32.const 0) $0 $1 $2 $3)
+ (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 nullref) (ref.null))
+ (global $global$4 (mut anyref) (ref.func $4))
+ (global $global$5 (mut funcref) (ref.func $4))
+ (export "export_func" (func $fimport$0))
+ (export "export_global" (global $gimport$1))
+ (func $0 (; 1 ;) (param $0 anyref)
+ (nop)
+ )
+ (func $1 (; 2 ;) (param $0 funcref)
+ (nop)
+ )
+ (func $2 (; 3 ;) (param $0 exnref)
+ (nop)
+ )
+ (func $3 (; 4 ;) (param $0 nullref)
+ (nop)
+ )
+ (func $4 (; 5 ;)
+ (nop)
+ )
+ (func $5 (; 6 ;)
+ (local $0 funcref)
+ (local $1 anyref)
+ (local $2 nullref)
+ (local $3 exnref)
+ (local.set $1
+ (local.get $1)
+ )
+ (local.set $1
+ (local.get $0)
+ )
+ (local.set $1
+ (local.get $3)
+ )
+ (local.set $1
+ (local.get $2)
+ )
+ (local.set $1
+ (ref.null)
+ )
+ (local.set $1
+ (ref.func $4)
+ )
+ (local.set $0
+ (local.get $0)
+ )
+ (local.set $0
+ (ref.null)
+ )
+ (local.set $0
+ (ref.func $4)
+ )
+ (local.set $3
+ (local.get $3)
+ )
+ (local.set $3
+ (ref.null)
+ )
+ (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
+ (global.get $global$3)
+ )
+ (global.set $global$0
+ (ref.null)
+ )
+ (global.set $global$0
+ (ref.func $4)
+ )
+ (global.set $global$1
+ (global.get $global$1)
+ )
+ (global.set $global$1
+ (ref.null)
+ )
+ (global.set $global$1
+ (ref.func $4)
+ )
+ (global.set $global$2
+ (global.get $global$2)
+ )
+ (global.set $global$2
+ (ref.null)
+ )
+ (global.set $global$3
+ (global.get $global$3)
+ )
+ (global.set $global$3
+ (ref.null)
+ )
+ (call $0
+ (local.get $1)
+ )
+ (call $0
+ (local.get $0)
+ )
+ (call $0
+ (local.get $3)
+ )
+ (call $0
+ (ref.null)
+ )
+ (call_indirect (type $anyref_=>_none)
+ (local.get $1)
+ (i32.const 0)
+ )
+ (call_indirect (type $anyref_=>_none)
+ (local.get $0)
+ (i32.const 0)
+ )
+ (call_indirect (type $anyref_=>_none)
+ (local.get $3)
+ (i32.const 0)
+ )
+ (call_indirect (type $anyref_=>_none)
+ (ref.null)
+ (i32.const 0)
+ )
+ (call_indirect (type $funcref_=>_none)
+ (local.get $0)
+ (i32.const 1)
+ )
+ (call_indirect (type $funcref_=>_none)
+ (ref.null)
+ (i32.const 1)
+ )
+ (call_indirect (type $exnref_=>_none)
+ (local.get $3)
+ (i32.const 2)
+ )
+ (call_indirect (type $exnref_=>_none)
+ (ref.null)
+ (i32.const 2)
+ )
+ (call_indirect (type $nullref_=>_none)
+ (local.get $2)
+ (i32.const 3)
+ )
+ (call_indirect (type $nullref_=>_none)
+ (ref.null)
+ (i32.const 3)
+ )
+ (drop
+ (block $label$1 (result anyref)
+ (br_if $label$1
+ (local.get $1)
+ (i32.const 1)
+ )
+ )
+ )
+ (drop
+ (block $label$2 (result anyref)
+ (br_if $label$2
+ (local.get $0)
+ (i32.const 1)
+ )
+ )
+ )
+ (drop
+ (block $label$3 (result anyref)
+ (br_if $label$3
+ (local.get $3)
+ (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
+ (block $label$7 (result nullref)
+ (br_if $label$7
+ (ref.null)
+ (i32.const 1)
+ )
+ )
+ )
+ (drop
+ (loop $label$8 (result anyref)
+ (local.get $1)
+ )
+ )
+ (drop
+ (loop $label$9 (result anyref)
+ (local.get $0)
+ )
+ )
+ (drop
+ (loop $label$10 (result anyref)
+ (local.get $3)
+ )
+ )
+ (drop
+ (loop $label$11 (result anyref)
+ (ref.null)
+ )
+ )
+ (drop
+ (loop $label$12 (result funcref)
+ (local.get $0)
+ )
+ )
+ (drop
+ (loop $label$13 (result funcref)
+ (ref.null)
+ )
+ )
+ (drop
+ (loop $label$14 (result exnref)
+ (local.get $3)
+ )
+ )
+ (drop
+ (loop $label$15 (result exnref)
+ (ref.null)
+ )
+ )
+ (drop
+ (loop $label$16 (result nullref)
+ (ref.null)
+ )
+ )
+ (drop
+ (if (result anyref)
+ (i32.const 1)
+ (local.get $1)
+ (local.get $3)
+ )
+ )
+ (drop
+ (if (result anyref)
+ (i32.const 1)
+ (ref.func $4)
+ (ref.null)
+ )
+ )
+ (drop
+ (if (result funcref)
+ (i32.const 1)
+ (ref.func $4)
+ (ref.null)
+ )
+ )
+ (drop
+ (if (result exnref)
+ (i32.const 1)
+ (local.get $3)
+ (ref.null)
+ )
+ )
+ (drop
+ (if (result nullref)
+ (i32.const 1)
+ (local.get $2)
+ (ref.null)
+ )
+ )
+ (drop
+ (try (result anyref)
+ (local.get $1)
+ (catch
+ (exnref.pop)
+ )
+ )
+ )
+ (drop
+ (try (result anyref)
+ (ref.func $4)
+ (catch
+ (drop
+ (exnref.pop)
+ )
+ (ref.null)
+ )
+ )
+ )
+ (drop
+ (try (result funcref)
+ (ref.func $4)
+ (catch
+ (drop
+ (exnref.pop)
+ )
+ (ref.null)
+ )
+ )
+ )
+ (drop
+ (try (result exnref)
+ (ref.null)
+ (catch
+ (exnref.pop)
+ )
+ )
+ )
+ (drop
+ (try (result nullref)
+ (ref.null)
+ (catch
+ (drop
+ (exnref.pop)
+ )
+ (ref.null)
+ )
+ )
+ )
+ (drop
+ (select (result anyref)
+ (local.get $1)
+ (ref.func $4)
+ (i32.const 1)
+ )
+ )
+ (drop
+ (select (result anyref)
+ (local.get $3)
+ (local.get $1)
+ (i32.const 1)
+ )
+ )
+ (drop
+ (select (result anyref)
+ (local.get $1)
+ (ref.null)
+ (i32.const 1)
+ )
+ )
+ (drop
+ (select (result anyref)
+ (ref.null)
+ (ref.func $4)
+ (i32.const 1)
+ )
+ )
+ (drop
+ (select (result funcref)
+ (ref.func $4)
+ (ref.null)
+ (i32.const 1)
+ )
+ )
+ (drop
+ (select (result exnref)
+ (ref.null)
+ (local.get $3)
+ (i32.const 1)
+ )
+ )
+ (drop
+ (select (result nullref)
+ (ref.null)
+ (ref.null)
+ (i32.const 1)
+ )
+ )
+ (drop
+ (select
+ (i32.const 0)
+ (i32.const 2)
+ (i32.const 1)
+ )
+ )
+ (drop
+ (ref.is_null
+ (local.get $1)
+ )
+ )
+ (drop
+ (ref.is_null
+ (local.get $3)
+ )
+ )
+ (drop
+ (ref.is_null
+ (ref.func $4)
+ )
+ )
+ (drop
+ (ref.is_null
+ (ref.null)
+ )
+ )
+ )
+ (func $6 (; 7 ;) (result anyref)
+ (local $0 anyref)
+ (local.get $0)
+ )
+ (func $7 (; 8 ;) (result anyref)
+ (ref.func $4)
+ )
+ (func $8 (; 9 ;) (result anyref)
+ (local $0 exnref)
+ (local.get $0)
+ )
+ (func $9 (; 10 ;) (result anyref)
+ (ref.null)
+ )
+ (func $10 (; 11 ;) (result funcref)
+ (ref.func $4)
+ )
+ (func $11 (; 12 ;) (result funcref)
+ (ref.null)
+ )
+ (func $12 (; 13 ;) (result exnref)
+ (local $0 exnref)
+ (local.get $0)
+ )
+ (func $13 (; 14 ;) (result exnref)
+ (ref.null)
+ )
+ (func $14 (; 15 ;) (result nullref)
+ (local $0 nullref)
+ (local.get $0)
+ )
+ (func $15 (; 16 ;) (result anyref)
+ (local $0 anyref)
+ (local $1 exnref)
+ (return
+ (local.get $0)
+ )
+ )
+ (func $16 (; 17 ;) (result funcref)
+ (return
+ (ref.func $4)
+ )
+ )
+ (func $17 (; 18 ;) (result exnref)
+ (local $0 exnref)
+ (return
+ (local.get $0)
+ )
+ )
+ (func $18 (; 19 ;) (result nullref)
+ (local $0 nullref)
+ (return
+ (local.get $0)
+ )
+ )
+)
+
diff --git a/test/spec/events.wast b/test/spec/events.wast
index d3371a782..c864a0c87 100644
--- a/test/spec/events.wast
+++ b/test/spec/events.wast
@@ -25,11 +25,6 @@
)
(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))
(event $e (attr 0) (type $t) (param i32 f32))
diff --git a/test/spec/old_select.wast b/test/spec/old_select.wast
index 493f67f0a..bb9c7c587 100644
--- a/test/spec/old_select.wast
+++ b/test/spec/old_select.wast
@@ -1,21 +1,61 @@
(module
+ (func $dummy)
+
(func (export "select_i32") (param $lhs i32) (param $rhs i32) (param $cond i32) (result i32)
(select (local.get $lhs) (local.get $rhs) (local.get $cond)))
-
(func (export "select_i64") (param $lhs i64) (param $rhs i64) (param $cond i32) (result i64)
(select (local.get $lhs) (local.get $rhs) (local.get $cond)))
-
(func (export "select_f32") (param $lhs f32) (param $rhs f32) (param $cond i32) (result f32)
(select (local.get $lhs) (local.get $rhs) (local.get $cond)))
-
(func (export "select_f64") (param $lhs f64) (param $rhs f64) (param $cond i32) (result f64)
(select (local.get $lhs) (local.get $rhs) (local.get $cond)))
+ (func (export "select-i32-t") (param i32 i32 i32) (result i32)
+ (select (result i32) (local.get 0) (local.get 1) (local.get 2))
+ )
+ (func (export "select-i64-t") (param i64 i64 i32) (result i64)
+ (select (result i64) (local.get 0) (local.get 1) (local.get 2))
+ )
+ (func (export "select-f32-t") (param f32 f32 i32) (result f32)
+ (select (result f32) (local.get 0) (local.get 1) (local.get 2))
+ )
+ (func (export "select-f64-t") (param f64 f64 i32) (result f64)
+ (select (result f64) (local.get 0) (local.get 1) (local.get 2))
+ )
+
+ (func (export "select-nullref") (param nullref nullref i32) (result nullref)
+ (select (result nullref) (local.get 0) (local.get 1) (local.get 2))
+ )
+ (func (export "select-funcref") (param funcref funcref i32) (result funcref)
+ (select (result funcref) (local.get 0) (local.get 1) (local.get 2))
+ )
+ (func (export "select-anyref") (param anyref anyref i32) (result anyref)
+ (select (result anyref) (local.get 0) (local.get 1) (local.get 2))
+ )
+
;; Check that both sides of the select are evaluated
(func (export "select_trap_l") (param $cond i32) (result i32)
(select (unreachable) (i32.const 0) (local.get $cond)))
(func (export "select_trap_r") (param $cond i32) (result i32)
(select (i32.const 0) (unreachable) (local.get $cond)))
+
+ (func (export "join-nullref") (param i32) (result anyref)
+ (select (result anyref) (ref.null) (ref.null) (local.get 0))
+ )
+ (func (export "join-funcref") (param i32) (result anyref)
+ (select (result anyref)
+ (ref.func $dummy)
+ (ref.null)
+ (local.get 0)
+ )
+ )
+ (func (export "join-anyref") (param i32) (param anyref) (result anyref)
+ (select (result anyref)
+ (ref.func $dummy)
+ (local.get 1)
+ (local.get 0)
+ )
+ )
)
(assert_return (invoke "select_i32" (i32.const 1) (i32.const 2) (i32.const 1)) (i32.const 1))
@@ -46,6 +86,47 @@
(assert_return (invoke "select_f64" (f64.const 2) (f64.const nan) (i32.const 0)) (f64.const nan))
(assert_return (invoke "select_f64" (f64.const 2) (f64.const nan:0x20304) (i32.const 0)) (f64.const nan:0x20304))
+(assert_return (invoke "select-i32-t" (i32.const 1) (i32.const 2) (i32.const 1)) (i32.const 1))
+(assert_return (invoke "select-i64-t" (i64.const 2) (i64.const 1) (i32.const 1)) (i64.const 2))
+(assert_return (invoke "select-f32-t" (f32.const 1) (f32.const 2) (i32.const 1)) (f32.const 1))
+(assert_return (invoke "select-f64-t" (f64.const 1) (f64.const 2) (i32.const 1)) (f64.const 1))
+(assert_return (invoke "select-nullref" (ref.null) (ref.null) (i32.const 1)) (ref.null))
+(assert_return (invoke "select-funcref" (ref.func "dummy") (ref.null) (i32.const 1)) (ref.func "dummy"))
+(assert_return (invoke "select-anyref" (ref.null) (ref.func "dummy") (i32.const 1)) (ref.null))
+
+(assert_return (invoke "select-i32-t" (i32.const 1) (i32.const 2) (i32.const 0)) (i32.const 2))
+(assert_return (invoke "select-i32-t" (i32.const 2) (i32.const 1) (i32.const 0)) (i32.const 1))
+(assert_return (invoke "select-i64-t" (i64.const 2) (i64.const 1) (i32.const -1)) (i64.const 2))
+(assert_return (invoke "select-i64-t" (i64.const 2) (i64.const 1) (i32.const 0xf0f0f0f0)) (i64.const 2))
+(assert_return (invoke "select-anyref" (ref.null) (ref.func "dummy") (i32.const 0)) (ref.func "dummy"))
+
+(assert_return (invoke "select-f32-t" (f32.const nan) (f32.const 1) (i32.const 1)) (f32.const nan))
+(assert_return (invoke "select-f32-t" (f32.const nan:0x20304) (f32.const 1) (i32.const 1)) (f32.const nan:0x20304))
+(assert_return (invoke "select-f32-t" (f32.const nan) (f32.const 1) (i32.const 0)) (f32.const 1))
+(assert_return (invoke "select-f32-t" (f32.const nan:0x20304) (f32.const 1) (i32.const 0)) (f32.const 1))
+(assert_return (invoke "select-f32-t" (f32.const 2) (f32.const nan) (i32.const 1)) (f32.const 2))
+(assert_return (invoke "select-f32-t" (f32.const 2) (f32.const nan:0x20304) (i32.const 1)) (f32.const 2))
+(assert_return (invoke "select-f32-t" (f32.const 2) (f32.const nan) (i32.const 0)) (f32.const nan))
+(assert_return (invoke "select-f32-t" (f32.const 2) (f32.const nan:0x20304) (i32.const 0)) (f32.const nan:0x20304))
+
+(assert_return (invoke "select-f64-t" (f64.const nan) (f64.const 1) (i32.const 1)) (f64.const nan))
+(assert_return (invoke "select-f64-t" (f64.const nan:0x20304) (f64.const 1) (i32.const 1)) (f64.const nan:0x20304))
+(assert_return (invoke "select-f64-t" (f64.const nan) (f64.const 1) (i32.const 0)) (f64.const 1))
+(assert_return (invoke "select-f64-t" (f64.const nan:0x20304) (f64.const 1) (i32.const 0)) (f64.const 1))
+(assert_return (invoke "select-f64-t" (f64.const 2) (f64.const nan) (i32.const 1)) (f64.const 2))
+(assert_return (invoke "select-f64-t" (f64.const 2) (f64.const nan:0x20304) (i32.const 1)) (f64.const 2))
+(assert_return (invoke "select-f64-t" (f64.const 2) (f64.const nan) (i32.const 0)) (f64.const nan))
+(assert_return (invoke "select-f64-t" (f64.const 2) (f64.const nan:0x20304) (i32.const 0)) (f64.const nan:0x20304))
+
+(assert_return (invoke "join-nullref" (i32.const 1)) (ref.null))
+(assert_return (invoke "join-nullref" (i32.const 0)) (ref.null))
+
+(assert_return_func (invoke "join-funcref" (i32.const 1)))
+(assert_return (invoke "join-funcref" (i32.const 0)) (ref.null))
+
+(assert_return_func (invoke "join-anyref" (i32.const 1) (ref.null)))
+(assert_return (invoke "join-anyref" (i32.const 0) (ref.null)) (ref.null))
+
(assert_trap (invoke "select_trap_l" (i32.const 1)) "unreachable executed")
(assert_trap (invoke "select_trap_l" (i32.const 0)) "unreachable executed")
(assert_trap (invoke "select_trap_r" (i32.const 1)) "unreachable executed")
diff --git a/test/spec/ref_func.wast b/test/spec/ref_func.wast
new file mode 100644
index 000000000..0f0ecf6a3
--- /dev/null
+++ b/test/spec/ref_func.wast
@@ -0,0 +1,44 @@
+(module
+ (func (export "f") (param $x i32) (result i32) (local.get $x))
+)
+(module
+ (func $f (import "M" "f") (param i32) (result i32))
+ (func $g (param $x i32) (result i32) (i32.add (local.get $x) (i32.const 1)))
+
+ (global anyref (ref.func $f))
+ (global anyref (ref.func $g))
+ (global funcref (ref.func $f))
+ (global funcref (ref.func $g))
+ (global $v (mut funcref) (ref.func $f))
+
+ (func (export "is_null-f") (result i32)
+ (ref.is_null (ref.func $f))
+ )
+ (func (export "is_null-g") (result i32)
+ (ref.is_null (ref.func $g))
+ )
+ (func (export "is_null-v") (result i32)
+ (ref.is_null (global.get $v))
+ )
+
+ (func (export "set-f") (global.set $v (ref.func $f)))
+ (func (export "set-g") (global.set $v (ref.func $g)))
+
+ (table $t 1 funcref)
+)
+
+(assert_return (invoke "is_null-f") (i32.const 0))
+(assert_return (invoke "is_null-g") (i32.const 0))
+(assert_return (invoke "is_null-v") (i32.const 0))
+
+(invoke "set-g")
+(invoke "set-f")
+
+(assert_invalid
+ (module
+ (func $f (import "M" "f") (param i32) (result i32))
+ (func $g (import "M" "g") (param i32) (result i32))
+ (global funcref (ref.func 7))
+ )
+ "unknown function 7"
+)
diff --git a/test/spec/ref_is_null.wast b/test/spec/ref_is_null.wast
new file mode 100644
index 000000000..dbf465149
--- /dev/null
+++ b/test/spec/ref_is_null.wast
@@ -0,0 +1,15 @@
+(module
+ (func $f1 (export "nullref") (param $x nullref) (result i32)
+ (ref.is_null (local.get $x))
+ )
+ (func $f2 (export "anyref") (param $x anyref) (result i32)
+ (ref.is_null (local.get $x))
+ )
+ (func $f3 (export "funcref") (param $x funcref) (result i32)
+ (ref.is_null (local.get $x))
+ )
+)
+
+(assert_return (invoke "nullref" (ref.null)) (i32.const 1))
+(assert_return (invoke "anyref" (ref.null)) (i32.const 1))
+(assert_return (invoke "funcref" (ref.null)) (i32.const 1))
diff --git a/test/spec/ref_null.wast b/test/spec/ref_null.wast
new file mode 100644
index 000000000..96cac314a
--- /dev/null
+++ b/test/spec/ref_null.wast
@@ -0,0 +1,13 @@
+(module
+ (func (export "anyref") (result anyref) (ref.null))
+ (func (export "funcref") (result funcref) (ref.null))
+ (func (export "nullref") (result nullref) (ref.null))
+
+ (global anyref (ref.null))
+ (global funcref (ref.null))
+ (global nullref (ref.null))
+)
+
+(assert_return (invoke "anyref") (ref.null))
+(assert_return (invoke "funcref") (ref.null))
+(assert_return (invoke "nullref") (ref.null))
diff --git a/test/unit/test_features.py b/test/unit/test_features.py
index dece97ec5..e0a3064d5 100644
--- a/test/unit/test_features.py
+++ b/test/unit/test_features.py
@@ -12,29 +12,34 @@ class FeatureValidationTest(utils.BinaryenTestCase):
self.assertIn(error, p.stderr)
self.assertIn('Fatal: error in validating input', p.stderr)
self.assertNotEqual(p.returncode, 0)
- p = shared.run_process(shared.WASM_OPT +
- ['--mvp-features', flag, '--print', '-o',
- os.devnull],
- input=module, check=False, capture_output=True)
+ p = shared.run_process(
+ shared.WASM_OPT + ['--mvp-features', '--print', '-o', os.devnull] +
+ flag,
+ input=module,
+ check=False,
+ capture_output=True)
self.assertEqual(p.returncode, 0)
def check_simd(self, module, error):
- self.check_feature(module, error, '--enable-simd')
+ self.check_feature(module, error, ['--enable-simd'])
def check_sign_ext(self, module, error):
- self.check_feature(module, error, '--enable-sign-ext')
+ self.check_feature(module, error, ['--enable-sign-ext'])
def check_bulk_mem(self, module, error):
- self.check_feature(module, error, '--enable-bulk-memory')
+ self.check_feature(module, error, ['--enable-bulk-memory'])
def check_exception_handling(self, module, error):
- self.check_feature(module, error, '--enable-exception-handling')
+ # Exception handling implies reference types
+ self.check_feature(module, error,
+ ['--enable-reference-types',
+ '--enable-exception-handling'])
def check_tail_call(self, module, error):
- self.check_feature(module, error, '--enable-tail-call')
+ self.check_feature(module, error, ['--enable-tail-call'])
def check_reference_types(self, module, error):
- self.check_feature(module, error, '--enable-reference-types')
+ self.check_feature(module, error, ['--enable-reference-types'])
def test_v128_signature(self):
module = '''