diff --git a/.gitattributes b/.gitattributes index 11500f6f73c..61d299b53fc 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,2 @@ *.py text eol=lf *.sh text eol=lf -test/binaryen.js/*.txt text eol=lf diff --git a/CMakeLists.txt b/CMakeLists.txt index 1836d955659..1758a4ddcb1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -462,9 +462,8 @@ if(EMSCRIPTEN) target_link_libraries(binaryen_wasm "-sEXPORT_NAME=Binaryen") target_link_libraries(binaryen_wasm "-sNODERAWFS=0") target_link_libraries(binaryen_wasm "-sEXPORT_ES6") - target_link_libraries(binaryen_wasm "-sEXPORTED_RUNTIME_METHODS=allocateUTF8OnStack,stringToAscii") - target_link_libraries(binaryen_wasm "-sEXPORTED_FUNCTIONS=_malloc,_free") - target_link_libraries(binaryen_wasm "--post-js=${CMAKE_CURRENT_SOURCE_DIR}/src/js/binaryen.js-post.js") + target_link_libraries(binaryen_wasm "-sEXPORTED_RUNTIME_METHODS=allocateUTF8OnStack,UTF8ToString,stringToAscii,stackSave,stackRestore,stackAlloc") + target_link_libraries(binaryen_wasm "-sEXPORTED_FUNCTIONS=_malloc,_free,out") target_link_libraries(binaryen_wasm "-msign-ext") target_link_libraries(binaryen_wasm "-mbulk-memory") target_link_libraries(binaryen_wasm optimized "--closure=1") @@ -500,9 +499,8 @@ if(EMSCRIPTEN) else() target_link_libraries(binaryen_js "-sEXPORT_ES6=1") endif() - target_link_libraries(binaryen_js "-sEXPORTED_RUNTIME_METHODS=allocateUTF8OnStack,stringToAscii") - target_link_libraries(binaryen_js "-sEXPORTED_FUNCTIONS=_malloc,_free") - target_link_libraries(binaryen_js "--post-js=${CMAKE_CURRENT_SOURCE_DIR}/src/js/binaryen.js-post.js") + target_link_libraries(binaryen_js "-sEXPORTED_RUNTIME_METHODS=allocateUTF8OnStack,UTF8ToString,stringToAscii,stackSave,stackRestore,stackAlloc") + target_link_libraries(binaryen_js "-sEXPORTED_FUNCTIONS=_malloc,_free,out") # js_of_ocaml needs a specified variable with special comment to provide the library to consumers if(JS_OF_OCAML) target_link_libraries(binaryen_js "--extern-pre-js=${CMAKE_CURRENT_SOURCE_DIR}/src/js/binaryen.jsoo-extern-pre.js") diff --git a/Contributing.md b/Contributing.md index 6a738f9a342..75e245f2a01 100644 --- a/Contributing.md +++ b/Contributing.md @@ -26,8 +26,6 @@ Use this handy checklist to make sure your new instructions are fully supported: - [ ] Support added in various classes inheriting OverriddenVisitor (and possibly other non-OverriddenVisitor classes as necessary) - [ ] Support added to src/tools/fuzzing.h - [ ] C API support added in src/binaryen-c.h and src/binaryen-c.cpp - - [ ] JS API support added in src/js/binaryen.js-post.js - [ ] C API tested in test/example/c-api-kitchen-sink.c - - [ ] JS API tested in test/binaryen.js/kitchen-sink.js - [ ] Tests added in test/spec - [ ] Tests added in top-level test/ diff --git a/check.py b/check.py index 5c0e19ff3d9..760dfcaacbe 100755 --- a/check.py +++ b/check.py @@ -21,7 +21,6 @@ import unittest from collections import OrderedDict -from scripts.test import binaryenjs from scripts.test import lld from scripts.test import shared from scripts.test import support @@ -370,8 +369,6 @@ def run(): ('validator', run_validator_tests), ('example', run_example_tests), ('unit', run_unittest), - ('binaryenjs', binaryenjs.test_binaryen_js), - ('binaryenjs_wasm', binaryenjs.test_binaryen_wasm), ('lit', run_lit), ('gtest', run_gtest), ]) @@ -380,7 +377,7 @@ def run(): # Run all the tests def main(): all_suites = TEST_SUITES.keys() - skip_by_default = ['binaryenjs', 'binaryenjs_wasm'] + skip_by_default = [] if shared.options.list_suites: for suite in all_suites: diff --git a/scripts/auto_update_tests.py b/scripts/auto_update_tests.py index 527b1280fb0..f95736a2ae8 100755 --- a/scripts/auto_update_tests.py +++ b/scripts/auto_update_tests.py @@ -19,7 +19,6 @@ import sys from collections import OrderedDict -from test import binaryenjs from test import lld from test import shared from test import support @@ -173,14 +172,13 @@ def update_lit_tests(): ('spec', update_spec_tests), ('lld', lld.update_lld_tests), ('wasm2js', wasm2js.update_wasm2js_tests), - ('binaryenjs', binaryenjs.update_binaryen_js_tests), ('lit', update_lit_tests), ]) def main(): all_suites = TEST_SUITES.keys() - skip_by_default = ['binaryenjs'] + skip_by_default = [] if shared.options.list_suites: for suite in all_suites: diff --git a/scripts/emcc-tests.sh b/scripts/emcc-tests.sh index 409ba256ed4..2ee0e4cc940 100755 --- a/scripts/emcc-tests.sh +++ b/scripts/emcc-tests.sh @@ -7,12 +7,8 @@ mkdir -p emcc-build echo "emcc-tests: build:wasm" emcmake cmake -B emcc-build -DCMAKE_BUILD_TYPE=Release -G Ninja ninja -C emcc-build binaryen_wasm -echo "emcc-tests: test:wasm" -./check.py --binaryen-bin=emcc-build/bin binaryenjs_wasm echo "emcc-tests: done:wasm" echo "emcc-tests: build:js" ninja -C emcc-build binaryen_js -echo "emcc-tests: test:js" -./check.py --binaryen-bin=emcc-build/bin binaryenjs echo "emcc-tests: done:js" diff --git a/scripts/test/binaryenjs.py b/scripts/test/binaryenjs.py deleted file mode 100644 index d546ced1336..00000000000 --- a/scripts/test/binaryenjs.py +++ /dev/null @@ -1,115 +0,0 @@ -# Copyright 2016 WebAssembly Community Group participants -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -import subprocess - -from . import shared -from . import support - - -def do_test_binaryen_js_with(which): - if not (shared.MOZJS or shared.NODEJS): - shared.fail_with_error('no vm to run binaryen.js tests') - - node_has_wasm = shared.NODEJS and support.node_has_webassembly(shared.NODEJS) - if not os.path.exists(which): - shared.fail_with_error('no ' + which + ' build to test') - - print('\n[ checking binaryen.js testcases (' + which + ')... ]\n') - - for s in sorted(os.listdir(os.path.join(shared.options.binaryen_test, 'binaryen.js'))): - if not s.endswith('.js'): - continue - print(s) - f = open('a.mjs', 'w') - # avoid stdout/stderr ordering issues in some js shells - use just stdout - f.write(''' - console.warn = console.error = console.log; - ''') - binaryen_js = open(which).read() - f.write(binaryen_js) - test_path = os.path.join(shared.options.binaryen_test, 'binaryen.js', s) - test_src = open(test_path).read() - f.write(support.js_test_wrap().replace('%TEST%', test_src)) - f.close() - - def test(cmd): - if 'fatal' not in s: - out = support.run_command(cmd, stderr=subprocess.STDOUT) - else: - # expect an error - the specific error code will depend on the vm - out = support.run_command(cmd, stderr=subprocess.STDOUT, expected_status=None) - expected = open(os.path.join(shared.options.binaryen_test, 'binaryen.js', s + '.txt')).read() - if expected not in out: - shared.fail(out, expected) - - # run in all possible shells - if shared.MOZJS: - test([shared.MOZJS, '-m', 'a.mjs']) - if shared.NODEJS: - if node_has_wasm or 'WebAssembly.' not in test_src: - test([shared.NODEJS, '--experimental-wasm-eh', 'a.mjs']) - else: - print('Skipping ' + test_path + ' because WebAssembly might not be supported') - - -def update_binaryen_js_tests(): - if not (shared.MOZJS or shared.NODEJS): - print('no vm to run binaryen.js tests') - return - - if not os.path.exists(shared.BINARYEN_JS): - print('no binaryen.js build to test') - return - - print('\n[ checking binaryen.js testcases... ]\n') - node_has_wasm = shared.NODEJS and support.node_has_webassembly(shared.NODEJS) - for s in shared.get_tests(shared.get_test_dir('binaryen.js'), ['.js']): - basename = os.path.basename(s) - print(basename) - f = open('a.mjs', 'w') - # avoid stdout/stderr ordering issues in some js shells - use just stdout - f.write(''' - console.warn = console.error = console.log; - ''') - f.write(open(shared.BINARYEN_JS).read()) - test_src = open(s).read() - f.write(support.js_test_wrap().replace('%TEST%', test_src)) - f.close() - - def update(cmd): - if 'fatal' not in basename: - out = support.run_command(cmd, stderr=subprocess.STDOUT) - else: - # expect an error - the specific error code will depend on the vm - out = support.run_command(cmd, stderr=subprocess.STDOUT, expected_status=None) - with open(s + '.txt', 'w') as o: - o.write(out) - - # run in available shell - if shared.MOZJS: - update([shared.MOZJS, '-m', 'a.mjs']) - elif node_has_wasm or 'WebAssembly.' not in test_src: - update([shared.NODEJS, 'a.mjs']) - else: - print('Skipping ' + basename + ' because WebAssembly might not be supported') - - -def test_binaryen_js(): - do_test_binaryen_js_with(shared.BINARYEN_JS) - - -def test_binaryen_wasm(): - do_test_binaryen_js_with(shared.BINARYEN_WASM) diff --git a/scripts/test/support.py b/scripts/test/support.py index 3a6ed9bc25d..8cd4c04448f 100644 --- a/scripts/test/support.py +++ b/scripts/test/support.py @@ -188,20 +188,3 @@ def run_command(cmd, expected_status=0, stderr=None, raise Exception(('run_command unexpected stderr', "expected '%s', actual '%s'" % (expected_err, err))) return out - - -def node_has_webassembly(cmd): - cmd = [cmd, '-e', 'process.stdout.write(typeof WebAssembly)'] - return run_command(cmd) == 'object' - - -def js_test_wrap(): - # common wrapper code for JS tests, waiting for binaryen.js to become ready - # and providing common utility used by all tests: - return ''' - (async function __in_test_code__() { - var binaryen = await Binaryen() - function assert(x) { if (!x) throw Error('Test assertion failed'); } - %TEST% - })(); - ''' diff --git a/test/binaryen.js/atomics.js b/test/binaryen.js/atomics.js deleted file mode 100644 index 471e4c52923..00000000000 --- a/test/binaryen.js/atomics.js +++ /dev/null @@ -1,87 +0,0 @@ -var wast = ` -(module - (memory $0 1 1 shared) -) -`; - -var module = binaryen.parseText(wast); - -// i32/i64.atomic.load/store -module.addFunction("main", binaryen.none, binaryen.none, [], module.block("", [ - // i32 - module.i32.atomic.store(0, - module.i32.const(0), - module.i32.atomic.load(0, - module.i32.const(0) - ) - ), - // i32 as u8 - module.i32.atomic.store8(0, - module.i32.const(0), - module.i32.atomic.load8_u(0, - module.i32.const(0) - ) - ), - // i32 as u16 - module.i32.atomic.store16(0, - module.i32.const(0), - module.i32.atomic.load16_u(0, - module.i32.const(0) - ) - ), - // i64 - module.i64.atomic.store(0, - module.i32.const(0), - module.i64.atomic.load(0, - module.i32.const(0) - ) - ), - // i64 as u8 - module.i64.atomic.store8(0, - module.i32.const(0), - module.i64.atomic.load8_u(0, - module.i32.const(0) - ) - ), - // i64 as u16 - module.i64.atomic.store16(0, - module.i32.const(0), - module.i64.atomic.load16_u(0, - module.i32.const(0) - ) - ), - // i64 as u32 - module.i64.atomic.store32(0, - module.i32.const(0), - module.i64.atomic.load32_u(0, - module.i32.const(0) - ) - ), - // wait and notify - module.drop( - module.memory.atomic.wait32( - module.i32.const(0), - module.i32.const(0), - module.i64.const(0) - ) - ), - module.drop( - module.memory.atomic.wait64( - module.i32.const(0), - module.i64.const(0), - module.i64.const(0) - ) - ), - module.drop( - module.memory.atomic.notify( - module.i32.const(0), - module.i32.const(0) - ) - ), - // fence - module.atomic.fence() -])); - -module.setFeatures(binaryen.Features.Atomics); -assert(module.validate()); -console.log(module.emitText()); diff --git a/test/binaryen.js/atomics.js.txt b/test/binaryen.js/atomics.js.txt deleted file mode 100644 index aec17b82af1..00000000000 --- a/test/binaryen.js/atomics.js.txt +++ /dev/null @@ -1,70 +0,0 @@ -(module - (type $0 (func)) - (memory $0 1 1 shared) - (func $main - (i32.atomic.store - (i32.const 0) - (i32.atomic.load - (i32.const 0) - ) - ) - (i32.atomic.store8 - (i32.const 0) - (i32.atomic.load8_u - (i32.const 0) - ) - ) - (i32.atomic.store16 - (i32.const 0) - (i32.atomic.load16_u - (i32.const 0) - ) - ) - (i64.atomic.store - (i32.const 0) - (i64.atomic.load - (i32.const 0) - ) - ) - (i64.atomic.store8 - (i32.const 0) - (i64.atomic.load8_u - (i32.const 0) - ) - ) - (i64.atomic.store16 - (i32.const 0) - (i64.atomic.load16_u - (i32.const 0) - ) - ) - (i64.atomic.store32 - (i32.const 0) - (i64.atomic.load32_u - (i32.const 0) - ) - ) - (drop - (memory.atomic.wait32 - (i32.const 0) - (i32.const 0) - (i64.const 0) - ) - ) - (drop - (memory.atomic.wait64 - (i32.const 0) - (i64.const 0) - (i64.const 0) - ) - ) - (drop - (memory.atomic.notify - (i32.const 0) - (i32.const 0) - ) - ) - (atomic.fence) - ) -) - diff --git a/test/binaryen.js/copy-expression.js b/test/binaryen.js/copy-expression.js deleted file mode 100644 index 261c028faba..00000000000 --- a/test/binaryen.js/copy-expression.js +++ /dev/null @@ -1,31 +0,0 @@ -var module = new binaryen.Module(); - -// Create an expression and copy it -var original = module.block(null, [ - module.if( - module.local.get(0, binaryen.i32), - module.i32.const(1), - module.i32.const(2) - ) -], binaryen.i32); -var copy = module.copyExpression(original); - -// Check that the expression incl. sub-expressions are copies -assert(original !== copy); - -var originalInfo = binaryen.getExpressionInfo(original); -assert(originalInfo.children.length === 1); - -var copyInfo = binaryen.getExpressionInfo(copy); -assert(originalInfo.children.length === copyInfo.children.length); -assert(originalInfo.children[0] !== copyInfo.children[0]); - -var originalIfInfo = binaryen.getExpressionInfo(originalInfo.children[0]); -var copyIfInfo = binaryen.getExpressionInfo(copyInfo.children[0]); - -assert(originalIfInfo.condition !== copyIfInfo.condition); -assert(originalIfInfo.ifTrue !== copyIfInfo.ifTrue); -assert(originalIfInfo.ifFalse !== copyIfInfo.ifFalse); - -// Check that both are otherwise identical -assert(binaryen.emitText(original) === binaryen.emitText(copy)); diff --git a/test/binaryen.js/copy-expression.js.txt b/test/binaryen.js/copy-expression.js.txt deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/test/binaryen.js/custom-section.js b/test/binaryen.js/custom-section.js deleted file mode 100644 index b0965b4c031..00000000000 --- a/test/binaryen.js/custom-section.js +++ /dev/null @@ -1,6 +0,0 @@ -var module = new binaryen.Module(); - -module.addCustomSection("hello", [119, 111, 114, 108, 100]); - -assert(module.validate()); -console.log(module.emitText()); diff --git a/test/binaryen.js/custom-section.js.txt b/test/binaryen.js/custom-section.js.txt deleted file mode 100644 index 9f5aeb00148..00000000000 --- a/test/binaryen.js/custom-section.js.txt +++ /dev/null @@ -1,4 +0,0 @@ -(module - ;; custom section "hello", size 5, contents: "world" -) - diff --git a/test/binaryen.js/debug-info.js b/test/binaryen.js/debug-info.js deleted file mode 100644 index 44eca1b07d3..00000000000 --- a/test/binaryen.js/debug-info.js +++ /dev/null @@ -1,43 +0,0 @@ -var wast = ` -(module - (type $v (func)) - (memory $0 0) - (export "test" (func $test)) - (func $test (; 0 ;) (type $v)) -) -`; - -// Use defaults (should not emit debug info) -console.log("=== default ==="); -console.log("debugInfo=" + binaryen.getDebugInfo()); -var module = binaryen.parseText(wast); -var binary = module.emitBinary(); -module.dispose(); -module = binaryen.readBinary(binary); -console.log(module.emitText()); -assert(module.validate()); -module.dispose(); - -// With debug info -console.log("=== with debug info ==="); -binaryen.setDebugInfo(true); -console.log("debugInfo=" + binaryen.getDebugInfo()); -module = binaryen.parseText(wast); -binary = module.emitBinary(); -module.dispose(); -module = binaryen.readBinary(binary); -console.log(module.emitText()); -assert(module.validate()); -module.dispose(); - -// Without debug info -console.log("=== without debug info ==="); -binaryen.setDebugInfo(false); -console.log("debugInfo=" + binaryen.getDebugInfo()); -module = binaryen.parseText(wast); -binary = module.emitBinary(); -module.dispose(); -module = binaryen.readBinary(binary); -console.log(module.emitText()); -assert(module.validate()); -module.dispose(); diff --git a/test/binaryen.js/debug-info.js.txt b/test/binaryen.js/debug-info.js.txt deleted file mode 100644 index 7802e341539..00000000000 --- a/test/binaryen.js/debug-info.js.txt +++ /dev/null @@ -1,33 +0,0 @@ -=== default === -debugInfo=false -(module - (type $0 (func)) - (memory $0 0) - (export "test" (func $0)) - (func $0 - (nop) - ) -) - -=== with debug info === -debugInfo=true -(module - (type $v (func)) - (memory $0 0) - (export "test" (func $test)) - (func $test - (nop) - ) -) - -=== without debug info === -debugInfo=false -(module - (type $0 (func)) - (memory $0 0) - (export "test" (func $0)) - (func $0 - (nop) - ) -) - diff --git a/test/binaryen.js/debug-names.js b/test/binaryen.js/debug-names.js deleted file mode 100644 index 0be6bf36517..00000000000 --- a/test/binaryen.js/debug-names.js +++ /dev/null @@ -1,42 +0,0 @@ -var wast = ` -(module $hel - (memory $lo 0 0) - (table $wor 0 0 funcref) - (global $ld i32 (i32.const 0)) - (func $of (param $wasm i32) - (local $!#$%&'*+-./:<=>?@\\^_\`|~ f64) - ) -) -`; - -console.log("=== input wast ===" + wast); - -var module = binaryen.parseText(wast); - -console.log("=== parsed wast ===\n" + module.emitText()); - -var func = binaryen.Function(module.getFunction("of")); -assert(func.numLocals === 2); -assert(func.hasLocalName(0) === true); -assert(func.getLocalName(0) === "wasm"); -assert(func.hasLocalName(1) === true); -assert(func.getLocalName(1) === "!#$%&'*+-./:<=>?@\\^_\`|~"); -assert(func.hasLocalName(2) === false); -func.setLocalName(0, "js"); -assert(func.getLocalName(0) === "js"); - -binaryen.setDebugInfo(true); - -var module2 = binaryen.readBinary(module.emitBinary()); - -module.dispose(); - -console.log("=== roundtripped ===\n" + module2.emitText()); - -var module3 = binaryen.readBinary(module2.emitBinary()); - -module2.dispose(); - -console.log("=== roundtripped again ===\n" + module3.emitText()); - -module3.dispose(); diff --git a/test/binaryen.js/debug-names.js.txt b/test/binaryen.js/debug-names.js.txt deleted file mode 100644 index dc66048ca80..00000000000 --- a/test/binaryen.js/debug-names.js.txt +++ /dev/null @@ -1,46 +0,0 @@ -=== input wast === -(module $hel - (memory $lo 0 0) - (table $wor 0 0 funcref) - (global $ld i32 (i32.const 0)) - (func $of (param $wasm i32) - (local $!#$%&'*+-./:<=>?@\^_`|~ f64) - ) -) - -=== parsed wast === -(module $hel - (type $0 (func (param i32))) - (global $ld i32 (i32.const 0)) - (memory $lo 0 0) - (table $wor 0 0 funcref) - (func $of (param $wasm i32) - (local $!#$%&'*+-./:<=>?@\^_`|~ f64) - (nop) - ) -) - -=== roundtripped === -(module $hel - (type $0 (func (param i32))) - (global $ld i32 (i32.const 0)) - (memory $lo 0 0) - (table $wor 0 0 funcref) - (func $of (param $js i32) - (local $!#$%&'*+-./:<=>?@\5c^_`|~ f64) - (nop) - ) -) - -=== roundtripped again === -(module $hel - (type $0 (func (param i32))) - (global $ld i32 (i32.const 0)) - (memory $lo 0 0) - (table $wor 0 0 funcref) - (func $of (param $js i32) - (local $!#$%&'*+-./:<=>?@\5c^_`|~ f64) - (nop) - ) -) - diff --git a/test/binaryen.js/emit_asmjs.js b/test/binaryen.js/emit_asmjs.js deleted file mode 100644 index e7b9afee2a7..00000000000 --- a/test/binaryen.js/emit_asmjs.js +++ /dev/null @@ -1,9 +0,0 @@ -var module = new binaryen.Module(); - -module.addFunction("main", binaryen.i32, binaryen.i32, [], module.local.get(0, binaryen.i32)); - -module.addFunctionExport("main", "main"); - -assert(module.validate()); // should validate before calling emitAsmjs - -console.log(module.emitAsmjs()); diff --git a/test/binaryen.js/emit_asmjs.js.txt b/test/binaryen.js/emit_asmjs.js.txt deleted file mode 100644 index 3ee0705da94..00000000000 --- a/test/binaryen.js/emit_asmjs.js.txt +++ /dev/null @@ -1,26 +0,0 @@ - -function asmFunc(imports) { - var Math_imul = Math.imul; - var Math_fround = Math.fround; - var Math_abs = Math.abs; - var Math_clz32 = Math.clz32; - var Math_min = Math.min; - var Math_max = Math.max; - var Math_floor = Math.floor; - var Math_ceil = Math.ceil; - var Math_trunc = Math.trunc; - var Math_sqrt = Math.sqrt; - function main($0) { - $0 = $0 | 0; - return $0 | 0; - } - - return { - "main": main - }; -} - -var retasmFunc = asmFunc({ -}); -export var main = retasmFunc.main; - diff --git a/test/binaryen.js/exception-handling.js b/test/binaryen.js/exception-handling.js deleted file mode 100644 index ec158552124..00000000000 --- a/test/binaryen.js/exception-handling.js +++ /dev/null @@ -1,85 +0,0 @@ -function cleanInfo(info) { - var ret = {}; - for (var x in info) { - // Filter out address pointers and only print meaningful info - if (x == 'id' || x == 'type' || x == 'name' || x == 'tag' || - x == 'target' || x == 'hasCatchAll' || x == 'delegateTarget' || - x == 'isDelegate') { - ret[x] = info[x]; - } - } - return ret; -} - -function stringify(expr) { - return JSON.stringify(cleanInfo(binaryen.getExpressionInfo(expr))); -} - -var module = new binaryen.Module(); -module.setFeatures(binaryen.Features.ReferenceTypes | - binaryen.Features.ExceptionHandling); - -module.addTag("e", binaryen.i32, binaryen.none); - -// (try $l0 -// (do -// (throw $e (i32.const 0)) -// ) -// (catch -// (drop (pop i32)) -// (rethrow $l0) -// ) -// ) -var throw_ = module.throw("e", [module.i32.const(0)]); -var rethrow = module.rethrow("l0"); -var try_catch = module.try( - "l0", - throw_, - ["e"], - [ - module.block(null, - [ - module.drop(module.i32.pop()), - rethrow - ], - binaryen.none - ) - ], - '' -); - -// (try $try_outer -// (do -// (try -// (do -// (throw $a-tag (i32.const 0)) -// ) -// (delegate $try_outer) -// ) -// ) -// (catch_all) -// ) -var try_delegate = module.try( - 'try_outer', - module.try( - '', - throw_, - [], - [], - 'try_outer' - ), - [], - [module.nop()], - '' -); - -var body = module.block('', [try_catch, try_delegate]) -var func = module.addFunction("test", binaryen.none, binaryen.none, [], body); - -console.log(module.emitText()); -assert(module.validate()); - -console.log("getExpressionInfo(throw) = " + stringify(throw_)); -console.log("getExpressionInfo(rethrow) = " + stringify(rethrow)); -console.log("getExpressionInfo(try_catch) = " + stringify(try_catch)); -console.log("getExpressionInfo(try_delegate) = " + stringify(try_delegate)); diff --git a/test/binaryen.js/exception-handling.js.txt b/test/binaryen.js/exception-handling.js.txt deleted file mode 100644 index d2a0c6dd62f..00000000000 --- a/test/binaryen.js/exception-handling.js.txt +++ /dev/null @@ -1,40 +0,0 @@ -(module - (type $0 (func (param i32))) - (type $1 (func)) - (tag $e (param i32)) - (func $test - (try $l0 - (do - (throw $e - (i32.const 0) - ) - ) - (catch $e - (drop - (pop i32) - ) - (rethrow $l0) - ) - ) - (try $try_outer - (do - (try - (do - (throw $e - (i32.const 0) - ) - ) - (delegate $try_outer) - ) - ) - (catch_all - (nop) - ) - ) - ) -) - -getExpressionInfo(throw) = {"id":53,"type":1,"tag":"e"} -getExpressionInfo(rethrow) = {"id":54,"type":1,"target":"l0"} -getExpressionInfo(try_catch) = {"id":51,"type":1,"name":"l0","hasCatchAll":0,"delegateTarget":"","isDelegate":0} -getExpressionInfo(try_delegate) = {"id":51,"type":0,"name":"try_outer","hasCatchAll":1,"delegateTarget":"","isDelegate":0} diff --git a/test/binaryen.js/expressionrunner.js b/test/binaryen.js/expressionrunner.js deleted file mode 100644 index 7071f950d24..00000000000 --- a/test/binaryen.js/expressionrunner.js +++ /dev/null @@ -1,205 +0,0 @@ -var Flags = binaryen.ExpressionRunner.Flags; -console.log("// ExpressionRunner.Flags.Default = " + Flags.Default); -console.log("// ExpressionRunner.Flags.PreserveSideeffects = " + Flags.PreserveSideeffects); -console.log("// ExpressionRunner.Flags.TraverseCalls = " + Flags.TraverseCalls); - -function assertDeepEqual(x, y) { - if (typeof x === "object") { - for (let i in x) assertDeepEqual(x[i], y[i]); - for (let i in y) assertDeepEqual(x[i], y[i]); - } else { - assert(x === y); - } -} - -var module = new binaryen.Module(); -module.addGlobal("aGlobal", binaryen.i32, true, module.i32.const(0)); - -// Should evaluate down to a constant -var runner = new binaryen.ExpressionRunner(module); -var expr = runner.runAndDispose( - module.i32.add( - module.i32.const(1), - module.i32.const(2) - ) -); -assertDeepEqual( - binaryen.getExpressionInfo(expr), - { - id: binaryen.ExpressionIds.Const, - type: binaryen.i32, - value: 3 - } -); - -// Should traverse control structures -runner = new binaryen.ExpressionRunner(module); -expr = runner.runAndDispose( - module.i32.add( - module.i32.const(1), - module.if( - module.i32.const(0), - module.i32.const(0), - module.i32.const(3) - ) - ), -); -assertDeepEqual( - binaryen.getExpressionInfo(expr), - { - id: binaryen.ExpressionIds.Const, - type: binaryen.i32, - value: 4 - } -); - -// Should be unable to evaluate a local if not explicitly specified -runner = new binaryen.ExpressionRunner(module); -expr = runner.runAndDispose( - module.i32.add( - module.local.get(0, binaryen.i32), - module.i32.const(1) - ) -); -assert(expr === 0); - -// Should handle traps properly -runner = new binaryen.ExpressionRunner(module); -expr = runner.runAndDispose( - module.unreachable() -); -assert(expr === 0); - -// Should ignore `local.tee` side-effects if just evaluating the expression -runner = new binaryen.ExpressionRunner(module); -expr = runner.runAndDispose( - module.i32.add( - module.local.tee(0, module.i32.const(4), binaryen.i32), - module.i32.const(1) - ) -); -assertDeepEqual( - binaryen.getExpressionInfo(expr), - { - id: binaryen.ExpressionIds.Const, - type: binaryen.i32, - value: 5 - } -); - -// Should preserve any side-effects if explicitly requested -runner = new binaryen.ExpressionRunner(module, Flags.PreserveSideeffects); -expr = runner.runAndDispose( - module.i32.add( - module.local.tee(0, module.i32.const(4), binaryen.i32), - module.i32.const(1) - ) -); -assert(expr === 0); - -// Should work with temporary values if just evaluating the expression -runner = new binaryen.ExpressionRunner(module); -expr = runner.runAndDispose( - module.i32.add( - module.block(null, [ - module.local.set(0, module.i32.const(2)), - module.local.get(0, binaryen.i32) - ], binaryen.i32), - module.block(null, [ - module.global.set("aGlobal", module.i32.const(4)), - module.global.get("aGlobal", binaryen.i32) - ], binaryen.i32) - ) -); -assertDeepEqual( - binaryen.getExpressionInfo(expr), - { - id: binaryen.ExpressionIds.Const, - type: binaryen.i32, - value: 6 - } -); - -// Should pick up explicitly preset values -runner = new binaryen.ExpressionRunner(module, Flags.PreserveSideeffects); -assert(runner.setLocalValue(0, module.i32.const(3))); -assert(runner.setGlobalValue("aGlobal", module.i32.const(4))); -expr = runner.runAndDispose( - module.i32.add( - module.local.get(0, binaryen.i32), - module.global.get("aGlobal", binaryen.i32) - ) -); -assertDeepEqual( - binaryen.getExpressionInfo(expr), - { - id: binaryen.ExpressionIds.Const, - type: binaryen.i32, - value: 7 - } -); - -// Should traverse into (simple) functions if requested -runner = new binaryen.ExpressionRunner(module, Flags.TraverseCalls); -module.addFunction("add", binaryen.createType([ binaryen.i32, binaryen.i32 ]), binaryen.i32, [], - module.block(null, [ - module.i32.add( - module.local.get(0, binaryen.i32), - module.local.get(1, binaryen.i32) - ) - ], binaryen.i32) -); -assert(runner.setLocalValue(0, module.i32.const(1))); -expr = runner.runAndDispose( - module.i32.add( - module.i32.add( - module.local.get(0, binaryen.i32), - module.call("add", [ - module.i32.const(2), - module.i32.const(4) - ], binaryen.i32) - ), - module.local.get(0, binaryen.i32) - ) -); -assertDeepEqual( - binaryen.getExpressionInfo(expr), - { - id: binaryen.ExpressionIds.Const, - type: binaryen.i32, - value: 8 - } -); - -// Should not attempt to traverse into functions if not explicitly set -runner = new binaryen.ExpressionRunner(module); -expr = runner.runAndDispose( - module.i32.add( - module.i32.const(1), - module.call("add", [ - module.i32.const(3), - module.i32.const(4) - ], binaryen.i32) - ) -); -assert(expr === 0); - -// Should stop on maxDepth -runner = new binaryen.ExpressionRunner(module, Flags.Default, 1); -expr = runner.runAndDispose( - module.block(null, [ - module.i32.const(1), - ], binaryen.i32) -); -assert(expr === 0); - -// Should not loop infinitely -runner = new binaryen.ExpressionRunner(module, Flags.Default, 50, 3); -expr = runner.runAndDispose( - module.loop("theLoop", - module.br("theLoop") - ) -); -assert(expr === 0); - -module.dispose(); diff --git a/test/binaryen.js/expressionrunner.js.txt b/test/binaryen.js/expressionrunner.js.txt deleted file mode 100644 index 7d686bd2881..00000000000 --- a/test/binaryen.js/expressionrunner.js.txt +++ /dev/null @@ -1,3 +0,0 @@ -// ExpressionRunner.Flags.Default = 0 -// ExpressionRunner.Flags.PreserveSideeffects = 1 -// ExpressionRunner.Flags.TraverseCalls = 2 diff --git a/test/binaryen.js/expressions.js b/test/binaryen.js/expressions.js deleted file mode 100644 index bd681f86dfe..00000000000 --- a/test/binaryen.js/expressions.js +++ /dev/null @@ -1,1829 +0,0 @@ -function assertDeepEqual(x, y) { - if (typeof x === "object") { - for (let i in x) assertDeepEqual(x[i], y[i]); - for (let i in y) assertDeepEqual(x[i], y[i]); - } else { - assert(x === y); - } -} - -console.log("# Expression"); -(function testWrapper() { - var theExpression = binaryen.Block(42); // works without new - assert(theExpression instanceof binaryen.Block); - assert(theExpression instanceof binaryen.Expression); - assert(theExpression.constructor === binaryen.Block); - assert(typeof binaryen.Block.getId === "function"); // proto - assert(typeof binaryen.Block.getName === "function"); // own - assert(typeof theExpression.getId === "function"); // proto - assert(typeof theExpression.getName === "function"); // own - assert((theExpression | 0) === 42); // via valueOf -})(); - -console.log("# Block"); -(function testBlock() { - const module = new binaryen.Module(); - - const theBlock = binaryen.Block(module.block(null, [])); - assert(theBlock instanceof binaryen.Block); - assert(theBlock instanceof binaryen.Expression); - assert(theBlock.id === binaryen.BlockId); - assert(theBlock.name === null); - assert(theBlock.type === binaryen.none); - - theBlock.name ="theName"; - assert(theBlock.name === "theName"); - theBlock.type = binaryen.i32; - assert(theBlock.type === binaryen.i32); - assert(theBlock.numChildren === 0); - assertDeepEqual(theBlock.children, []); - assertDeepEqual(theBlock.getChildren(), []); - - var child1 = module.i32.const(1); - theBlock.appendChild(child1); - assert(theBlock.numChildren === 1); - assert(theBlock.getChildAt(0) === child1); - var child2 = module.i32.const(2); - theBlock.insertChildAt(1, child2); - assert(theBlock.numChildren === 2); - assert(theBlock.getChildAt(0) === child1); - assert(theBlock.getChildAt(1) === child2); - var child0 = module.i32.const(0); - theBlock.insertChildAt(0, child0); - assert(theBlock.numChildren === 3); - assert(theBlock.getChildAt(0) === child0); - assert(theBlock.getChildAt(1) === child1); - assert(theBlock.getChildAt(2) === child2); - var newChild1 = module.i32.const(11); - theBlock.setChildAt(1, newChild1); - assert(theBlock.numChildren === 3); - assert(theBlock.getChildAt(0) === child0); - assert(theBlock.getChildAt(1) === newChild1); - assert(theBlock.getChildAt(2) === child2); - theBlock.removeChildAt(1); - assert(theBlock.numChildren === 2); - assert(theBlock.getChildAt(0) === child0); - assert(theBlock.getChildAt(1) === child2); - theBlock.removeChildAt(1); - assert(theBlock.numChildren === 1); - assert(theBlock.getChildAt(0) === child0); - theBlock.finalize(); - - console.log(theBlock.toText()); - assert( - theBlock.toText() - == - "(block $theName (result i32)\n (i32.const 0)\n)\n" - ); - theBlock.removeChildAt(0); - assert(theBlock.numChildren === 0); - - module.dispose(); -})(); - -console.log("# If"); -(function testIf() { - const module = new binaryen.Module(); - - var condition = module.i32.const(1); - var ifTrue = module.i32.const(2); - var ifFalse = module.i32.const(3); - const theIf = binaryen.If(module.if(condition, ifTrue, ifFalse)); - assert(theIf instanceof binaryen.If); - assert(theIf instanceof binaryen.Expression); - assert(theIf.id === binaryen.IfId); - assert(theIf.condition === condition); - assert(theIf.ifTrue === ifTrue); - assert(theIf.ifFalse === ifFalse); - assert(theIf.type == binaryen.i32); - - theIf.condition = condition = module.i32.const(4); - assert(theIf.condition === condition); - theIf.ifTrue = ifTrue = module.i32.const(5); - assert(theIf.ifTrue === ifTrue); - theIf.ifFalse = ifFalse = module.i32.const(6); - assert(theIf.ifFalse === ifFalse); - theIf.finalize(); - - console.log(theIf.toText()); - assert( - theIf.toText() - == - "(if (result i32)\n (i32.const 4)\n (then\n (i32.const 5)\n )\n (else\n (i32.const 6)\n )\n)\n" - ); - - theIf.ifFalse = null; - assert(!theIf.ifFalse); - console.log(theIf.toText()); - assert( - theIf.toText() - == - "(if (result i32)\n (i32.const 4)\n (then\n (i32.const 5)\n )\n)\n" - ); - - module.dispose(); -})(); - -console.log("# Loop"); -(function testLoop() { - const module = new binaryen.Module(); - - var name = null; - var body = module.i32.const(1); - const theLoop = binaryen.Loop(module.loop(name, body)); - assert(theLoop instanceof binaryen.Loop); - assert(theLoop instanceof binaryen.Expression); - assert(theLoop.id === binaryen.LoopId); - assert(theLoop.name === name); - assert(theLoop.body === body); - assert(theLoop.type === binaryen.i32); - - theLoop.name = name = "theName"; - assert(theLoop.name === name); - theLoop.body = body = module.drop(body); - assert(theLoop.body === body); - theLoop.finalize(); - assert(theLoop.type === binaryen.none); - - console.log(theLoop.toText()); - assert( - theLoop.toText() - == - "(loop $theName\n (drop\n (i32.const 1)\n )\n)\n" - ); - - module.dispose(); -})(); - -console.log("# Break"); -(function testBreak() { - const module = new binaryen.Module(); - - var name = "theName"; - var condition = module.i32.const(1); - var value = module.i32.const(2); - const theBreak = binaryen.Break(module.br(name, condition, value)); - assert(theBreak instanceof binaryen.Break); - assert(theBreak instanceof binaryen.Expression); - assert(theBreak.name === name); - assert(theBreak.condition === condition); - assert(theBreak.value === value); - assert(theBreak.type === binaryen.i32); - - theBreak.name = name = "theNewName"; - assert(theBreak.name === "theNewName"); - theBreak.condition = condition = module.i32.const(3); - assert(theBreak.condition === condition); - theBreak.value = value = module.i32.const(4); - assert(theBreak.value === value); - theBreak.finalize(); - - console.log(theBreak.toText()); - assert( - theBreak.toText() - == - "(br_if $theNewName\n (i32.const 4)\n (i32.const 3)\n)\n" - ); - - module.dispose(); -})(); - -console.log("# Switch"); -(function testSwitch() { - const module = new binaryen.Module(); - - var names = ["a", "b"]; - var defaultName = "c"; - var condition = module.i32.const(1); - var value = module.i32.const(2); - const theSwitch = binaryen.Switch(module.switch(names, defaultName, condition, value)); - assert(theSwitch instanceof binaryen.Switch); - assert(theSwitch instanceof binaryen.Expression); - assert(theSwitch.numNames === 2); - assertDeepEqual(theSwitch.names, names); - assert(theSwitch.defaultName === defaultName); - assert(theSwitch.condition === condition); - assert(theSwitch.value === value); - assert(theSwitch.type === binaryen.unreachable); - - names = [ - "1", // set - "2", //set - "3" // append - ] - theSwitch.setNames(names); - assertDeepEqual(theSwitch.names, names); - theSwitch.names = names = [ - "x", // set - // remove - // remove - ]; - assertDeepEqual(theSwitch.names, names); - assertDeepEqual(theSwitch.getNames(), names); - theSwitch.insertNameAt(1, "y"); - theSwitch.condition = condition = module.i32.const(3); - assert(theSwitch.condition === condition); - theSwitch.value = value = module.i32.const(4); - assert(theSwitch.value === value); - theSwitch.finalize(); - - console.log(theSwitch.toText()); - assert( - theSwitch.toText() - == - "(br_table $x $y $c\n (i32.const 4)\n (i32.const 3)\n)\n" - ); - - module.dispose(); -})(); - -console.log("# Call"); -(function testCall() { - const module = new binaryen.Module(); - - var target = "foo"; - var operands = [ - module.i32.const(1), - module.i32.const(2) - ]; - const theCall = binaryen.Call(module.call(target, operands, binaryen.i32)); - assert(theCall instanceof binaryen.Call); - assert(theCall instanceof binaryen.Expression); - assert(theCall.target === target); - assertDeepEqual(theCall.operands, operands); - assertDeepEqual(theCall.getOperands(), operands); - assert(theCall.return === false); - assert(theCall.type === binaryen.i32); - - theCall.target = "bar"; - assert(theCall.target === "bar"); - theCall.operands = operands = [ - module.i32.const(3), // set - module.i32.const(4), // set - module.i32.const(5) // append - ]; - assertDeepEqual(theCall.operands, operands); - operands = [ - module.i32.const(6) // set - // remove - // remove - ]; - theCall.setOperands(operands); - assertDeepEqual(theCall.operands, operands); - theCall.insertOperandAt(0, module.i32.const(7)); - theCall.return = true; - assert(theCall.return === true); - theCall.finalize(); - assert(theCall.type === binaryen.unreachable); // finalized tail call - - theCall.return = false; - theCall.type = binaryen.i32; - theCall.finalize(); - assert(theCall.type === binaryen.i32); // finalized call - - console.log(theCall.toText()); - assert( - theCall.toText() - == - "(call $bar\n (i32.const 7)\n (i32.const 6)\n)\n" - ); - - module.dispose(); -})(); - -console.log("# CallIndirect"); -(function testCallIndirect() { - const module = new binaryen.Module(); - - var table = "0"; - var target = module.i32.const(42); - var params = binaryen.none; - var results = binaryen.none; - var operands = [ - module.i32.const(1), - module.i32.const(2) - ]; - const theCallIndirect = binaryen.CallIndirect(module.call_indirect(table, target, operands, params, results)); - assert(theCallIndirect instanceof binaryen.CallIndirect); - assert(theCallIndirect instanceof binaryen.Expression); - assert(theCallIndirect.table === table); - assert(theCallIndirect.target === target); - assertDeepEqual(theCallIndirect.operands, operands); - assert(theCallIndirect.params === params); - assert(theCallIndirect.results === results); - assert(theCallIndirect.return === false); - assert(theCallIndirect.type === theCallIndirect.results); - - theCallIndirect.target = target = module.i32.const(9000); - assert(theCallIndirect.target === target); - theCallIndirect.operands = operands = [ - module.i32.const(3), // set - module.i32.const(4), // set - module.i32.const(5) // append - ]; - assertDeepEqual(theCallIndirect.operands, operands); - operands = [ - module.i32.const(6) // set - // remove - // remove - ]; - theCallIndirect.setOperands(operands); - assertDeepEqual(theCallIndirect.operands, operands); - assertDeepEqual(theCallIndirect.getOperands(), operands); - theCallIndirect.insertOperandAt(0, module.i32.const(7)); - theCallIndirect.return = true; - assert(theCallIndirect.return === true); - theCallIndirect.params = params = binaryen.createType([ binaryen.i32, binaryen.i32 ]); - assert(theCallIndirect.params === params); - theCallIndirect.results = results = binaryen.i32; - assert(theCallIndirect.results === results); - theCallIndirect.finalize(); - assert(theCallIndirect.type === binaryen.unreachable); // finalized tail call - - theCallIndirect.return = false; - theCallIndirect.finalize(); - assert(theCallIndirect.type === results); // finalized call - - console.log(theCallIndirect.toText()); - assert( - theCallIndirect.toText() - == - "(call_indirect $0 (type $func.0)\n (i32.const 7)\n (i32.const 6)\n (i32.const 9000)\n)\n" - ); - - module.dispose(); -})(); - -console.log("# LocalGet"); -(function testLocalGet() { - const module = new binaryen.Module(); - - var index = 1; - var type = binaryen.i32; - const theLocalGet = binaryen.LocalGet(module.local.get(index, type)); - assert(theLocalGet instanceof binaryen.LocalGet); - assert(theLocalGet instanceof binaryen.Expression); - assert(theLocalGet.index === index); - assert(theLocalGet.type === type); - - theLocalGet.index = index = 2; - assert(theLocalGet.index === index); - theLocalGet.type = type = binaryen.f64; - assert(theLocalGet.type === type); - theLocalGet.finalize(); - - console.log(theLocalGet.toText()); - assert( - theLocalGet.toText() - == - "(local.get $2)\n" - ); - - module.dispose(); -})(); - -console.log("# LocalSet"); -(function testLocalSet() { - const module = new binaryen.Module(); - - var index = 1; - var value = module.i32.const(1); - const theLocalSet = binaryen.LocalSet(module.local.set(index, value)); - assert(theLocalSet instanceof binaryen.LocalSet); - assert(theLocalSet instanceof binaryen.Expression); - assert(theLocalSet.index === index); - assert(theLocalSet.value === value); - assert(theLocalSet.tee === false); - assert(theLocalSet.type == binaryen.none); - - theLocalSet.index = index = 2; - assert(theLocalSet.index === index); - theLocalSet.value = value = module.i32.const(3); - assert(theLocalSet.value === value); - theLocalSet.type = binaryen.i32; - assert(theLocalSet.type === binaryen.i32); - assert(theLocalSet.tee === true); - theLocalSet.type = binaryen.none; - theLocalSet.finalize(); - - console.log(theLocalSet.toText()); - assert( - theLocalSet.toText() - == - "(local.set $2\n (i32.const 3)\n)\n" - ); - - module.dispose(); -})(); - -console.log("# GlobalGet"); -(function testGlobalGet() { - const module = new binaryen.Module(); - - var name = "a"; - var type = binaryen.i32; - const theGlobalGet = binaryen.GlobalGet(module.global.get(name, type)); - assert(theGlobalGet instanceof binaryen.GlobalGet); - assert(theGlobalGet instanceof binaryen.Expression); - assert(theGlobalGet.name === name); - assert(theGlobalGet.type === type); - - theGlobalGet.name = name = "b"; - assert(theGlobalGet.name === name); - theGlobalGet.type = type = binaryen.f64; - assert(theGlobalGet.type === type); - theGlobalGet.finalize(); - - console.log(theGlobalGet.toText()); - assert( - theGlobalGet.toText() - == - "(global.get $b)\n" - ); - - module.dispose(); -})(); - -console.log("# GlobalSet"); -(function testGlobalSet() { - const module = new binaryen.Module(); - - var name = "a"; - var value = module.i32.const(1); - const theGlobalSet = binaryen.GlobalSet(module.global.set(name, value)); - assert(theGlobalSet instanceof binaryen.GlobalSet); - assert(theGlobalSet instanceof binaryen.Expression); - assert(theGlobalSet.name === name); - assert(theGlobalSet.value === value); - assert(theGlobalSet.type == binaryen.none); - - theGlobalSet.name = name = "b"; - assert(theGlobalSet.name === name); - theGlobalSet.value = value = module.f64.const(3); - assert(theGlobalSet.value === value); - theGlobalSet.finalize(); - - console.log(theGlobalSet.toText()); - assert( - theGlobalSet.toText() - == - "(global.set $b\n (f64.const 3)\n)\n" - ); - - module.dispose(); -})(); - -console.log("# MemorySize"); -(function testMemorySize() { - const module = new binaryen.Module(); - module.setMemory(1, 1, null); - var type = binaryen.i32; - const theMemorySize = binaryen.MemorySize(module.memory.size()); - assert(theMemorySize instanceof binaryen.MemorySize); - assert(theMemorySize instanceof binaryen.Expression); - assert(theMemorySize.type === type); - - theMemorySize.type = type = binaryen.f64; - assert(theMemorySize.type === type); - theMemorySize.finalize(); - assert(theMemorySize.type === binaryen.i32); - - console.log(theMemorySize.toText()); - assert( - theMemorySize.toText() - == - "(memory.size $0)\n" - ); - - module.dispose(); -})(); - -console.log("# MemoryGrow"); -(function testMemoryGrow() { - const module = new binaryen.Module(); - module.setMemory(1, 1, null); - - var type = binaryen.i32; - var delta = module.i32.const(1); - const theMemoryGrow = binaryen.MemoryGrow(module.memory.grow(delta)); - assert(theMemoryGrow instanceof binaryen.MemoryGrow); - assert(theMemoryGrow instanceof binaryen.Expression); - assert(theMemoryGrow.delta === delta); - assert(theMemoryGrow.type === type); - - theMemoryGrow.delta = delta = module.i32.const(2); - assert(theMemoryGrow.delta === delta); - theMemoryGrow.type = type = binaryen.f64; - assert(theMemoryGrow.type === type); - theMemoryGrow.finalize(); - assert(theMemoryGrow.type === binaryen.i32); - - console.log(theMemoryGrow.toText()); - assert( - theMemoryGrow.toText() - == - "(memory.grow $0\n (i32.const 2)\n)\n" - ); - - module.dispose(); -})(); - -console.log("# Load"); -(function testLoad() { - const module = new binaryen.Module(); - module.setMemory(1, 1, null); - - var offset = 16; - var align = 2; - var ptr = module.i32.const(64); - const theLoad = binaryen.Load(module.i32.load(offset, align, ptr)); - assert(theLoad instanceof binaryen.Load); - assert(theLoad instanceof binaryen.Expression); - assert(theLoad.offset === offset); - assert(theLoad.align === align); - assert(theLoad.ptr === ptr); - assert(theLoad.bytes === 4); - assert(theLoad.signed === true); - assert(theLoad.atomic === false); - assert(theLoad.type == binaryen.i32); - - theLoad.offset = offset = 32; - assert(theLoad.offset === offset); - theLoad.align = align = 4; - assert(theLoad.align === align); - theLoad.ptr = ptr = module.i32.const(128); - assert(theLoad.ptr === ptr); - theLoad.type = binaryen.i64; - assert(theLoad.type === binaryen.i64); - theLoad.signed = false; - assert(theLoad.signed === false); - theLoad.bytes = 8; - assert(theLoad.bytes === 8); - theLoad.atomic = true; - assert(theLoad.atomic === true); - theLoad.finalize(); - assert(theLoad.align === 4); - - console.log(theLoad.toText()); - assert( - theLoad.toText() - == - "(i64.atomic.load $0 offset=32 align=4\n (i32.const 128)\n)\n" - ); - - module.dispose(); -})(); - -console.log("# Store"); -(function testStore() { - const module = new binaryen.Module(); - module.setMemory(1, 1, null); - - var offset = 16; - var align = 2; - var ptr = module.i32.const(64); - var value = module.i32.const(1); - const theStore = binaryen.Store(module.i32.store(offset, align, ptr, value)); - assert(theStore instanceof binaryen.Store); - assert(theStore instanceof binaryen.Expression); - assert(theStore.offset === offset); - assert(theStore.align === align); - assert(theStore.ptr === ptr); - assert(theStore.value === value); - assert(theStore.bytes === 4); - assert(theStore.atomic === false); - assert(theStore.valueType === binaryen.i32); - assert(theStore.type === binaryen.none); - - theStore.offset = offset = 32; - assert(theStore.offset === offset); - theStore.align = align = 4; - assert(theStore.align === align); - theStore.ptr = ptr = module.i32.const(128); - assert(theStore.ptr === ptr); - theStore.value = value = module.i32.const(2); - assert(theStore.value === value); - theStore.signed = false; - assert(theStore.signed === false); - theStore.valueType = binaryen.i64; - assert(theStore.valueType === binaryen.i64); - theStore.bytes = 8; - assert(theStore.bytes === 8); - theStore.atomic = true; - assert(theStore.atomic === true); - theStore.finalize(); - assert(theStore.align === 4); - - console.log(theStore.toText()); - assert( - theStore.toText() - == - "(i64.atomic.store $0 offset=32 align=4\n (i32.const 128)\n (i32.const 2)\n)\n" - ); - - module.dispose(); -})(); - -console.log("# Const"); -(function testConst() { - const module = new binaryen.Module(); - - const theConst = binaryen.Const(module.i32.const(1)); - assert(theConst instanceof binaryen.Const); - assert(theConst instanceof binaryen.Expression); - assert(theConst.valueI32 === 1); - theConst.valueI32 = 2; - assert(theConst.valueI32 === 2); - assert(theConst.type === binaryen.i32); - - theConst.valueI64Low = 3; - assert(theConst.valueI64Low === 3); - theConst.valueI64High = 4; - assert(theConst.valueI64High === 4); - theConst.finalize(); - assert(theConst.type == binaryen.i64); - - theConst.valueF32 = 5; - assert(theConst.valueF32 === 5); - theConst.finalize(); - assert(theConst.type === binaryen.f32); - - theConst.valueF64 = 6; - assert(theConst.valueF64 === 6); - theConst.finalize(); - assert(theConst.type === binaryen.f64); - - theConst.valueV128 = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]; - assertDeepEqual(theConst.valueV128, [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]); - theConst.finalize(); - assert(theConst.type === binaryen.v128); - - console.log(theConst.toText()); - assert( - theConst.toText() - == - "(v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)\n" - ); - - module.dispose(); -})(); - -console.log("# Unary"); -(function testUnary() { - const module = new binaryen.Module(); - - var op = binaryen.Operations.EqZInt32; - var value = module.i32.const(1); - const theUnary = binaryen.Unary(module.i32.eqz(value)); - assert(theUnary instanceof binaryen.Unary); - assert(theUnary instanceof binaryen.Expression); - assert(theUnary.op === op); - assert(theUnary.value === value); - assert(theUnary.type === binaryen.i32); - - theUnary.op = op = binaryen.Operations.EqZInt64; - assert(theUnary.op === op); - theUnary.value = value = module.i64.const(2); - assert(theUnary.value === value); - theUnary.type = binaryen.f32; - theUnary.finalize(); - assert(theUnary.type === binaryen.i32); - - console.log(theUnary.toText()); - assert( - theUnary.toText() - == - "(i64.eqz\n (i64.const 2)\n)\n" - ); - - module.dispose(); -})(); - -console.log("# Binary"); -(function testBinary() { - const module = new binaryen.Module(); - - var op = binaryen.Operations.AddInt32; - var left = module.i32.const(1); - var right = module.i32.const(2); - const theBinary = binaryen.Binary(module.i32.add(left, right)); - assert(theBinary instanceof binaryen.Binary); - assert(theBinary instanceof binaryen.Expression); - assert(theBinary.op === op); - assert(theBinary.left === left); - assert(theBinary.right === right); - assert(theBinary.type === binaryen.i32); - - theBinary.op = op = binaryen.Operations.AddInt64; - assert(theBinary.op === op); - theBinary.left = left = module.i64.const(3); - assert(theBinary.left === left); - theBinary.right = right = module.i64.const(4); - assert(theBinary.right === right); - theBinary.type = binaryen.f32; - theBinary.finalize(); - assert(theBinary.type === binaryen.i64); - - console.log(theBinary.toText()); - assert( - theBinary.toText() - == - "(i64.add\n (i64.const 3)\n (i64.const 4)\n)\n" - ); - - module.dispose(); -})(); - -console.log("# Select"); -(function testSelect() { - const module = new binaryen.Module(); - - var condition = module.i32.const(1); - var ifTrue = module.i32.const(2); - var ifFalse = module.i32.const(3); - const theSelect = binaryen.Select(module.select(condition, ifTrue, ifFalse)); assert(theSelect.ifTrue === ifTrue); - assert(theSelect instanceof binaryen.Select); - assert(theSelect instanceof binaryen.Expression); - assert(theSelect.condition === condition); - assert(theSelect.ifTrue === ifTrue); - assert(theSelect.ifFalse === ifFalse); - assert(theSelect.type === binaryen.i32); - - theSelect.condition = condition = module.i32.const(4); - assert(theSelect.condition === condition); - theSelect.ifTrue = ifTrue = module.i64.const(5); - assert(theSelect.ifTrue === ifTrue); - theSelect.ifFalse = ifFalse = module.i64.const(6); - assert(theSelect.ifFalse === ifFalse); - theSelect.finalize(); - assert(theSelect.type === binaryen.i64); - - console.log(theSelect.toText()); - assert( - theSelect.toText() - == - "(select\n (i64.const 5)\n (i64.const 6)\n (i32.const 4)\n)\n" - ); - - module.dispose(); -})(); - -console.log("# Drop"); -(function testDrop() { - const module = new binaryen.Module(); - - var value = module.i32.const(1); - const theDrop = binaryen.Drop(module.drop(value)); - assert(theDrop instanceof binaryen.Drop); - assert(theDrop instanceof binaryen.Expression); - assert(theDrop.value === value); - assert(theDrop.type === binaryen.none); - - theDrop.value = value = module.i32.const(2); - assert(theDrop.value === value); - - theDrop.finalize(); - assert(theDrop.type === binaryen.none); - - console.log(theDrop.toText()); - assert( - theDrop.toText() - == - "(drop\n (i32.const 2)\n)\n" - ); - - module.dispose(); -})(); - -console.log("# Return"); -(function testReturn() { - const module = new binaryen.Module(); - - var value = module.i32.const(1); - const theReturn = binaryen.Return(module.return(value)); - assert(theReturn instanceof binaryen.Return); - assert(theReturn instanceof binaryen.Expression); - assert(theReturn.value === value); - assert(theReturn.type === binaryen.unreachable); - - theReturn.value = value = module.i32.const(2); - assert(theReturn.value === value); - - theReturn.finalize(); - assert(theReturn.type === binaryen.unreachable); - - console.log(theReturn.toText()); - assert( - theReturn.toText() - == - "(return\n (i32.const 2)\n)\n" - ); - - module.dispose(); -})(); - -console.log("# AtomicRMW"); -(function testAtomicRMW() { - const module = new binaryen.Module(); - module.setMemory(1, 1, null); - - var op = binaryen.Operations.AtomicRMWAdd; - var offset = 8; - var ptr = module.i32.const(2); - var value = module.i32.const(3); - const theAtomicRMW = binaryen.AtomicRMW(module.i32.atomic.rmw.add(offset, ptr, value)); - assert(theAtomicRMW instanceof binaryen.AtomicRMW); - assert(theAtomicRMW instanceof binaryen.Expression); - assert(theAtomicRMW.op === op); - assert(theAtomicRMW.bytes === 4); - assert(theAtomicRMW.offset === offset); - assert(theAtomicRMW.ptr === ptr); - assert(theAtomicRMW.value === value); - assert(theAtomicRMW.type === binaryen.i32); - - theAtomicRMW.op = op = binaryen.Operations.AtomicRMWSub; - assert(theAtomicRMW.op === op); - theAtomicRMW.bytes = 2; - assert(theAtomicRMW.bytes === 2); - theAtomicRMW.offset = offset = 16; - assert(theAtomicRMW.offset === offset); - theAtomicRMW.ptr = ptr = module.i32.const(4); - assert(theAtomicRMW.ptr === ptr); - theAtomicRMW.value = value = module.i64.const(5); - assert(theAtomicRMW.value === value); - theAtomicRMW.type = binaryen.i64; - theAtomicRMW.finalize(); - assert(theAtomicRMW.type === binaryen.i64); - - console.log(theAtomicRMW.toText()); - assert( - theAtomicRMW.toText() - == - "(i64.atomic.rmw16.sub_u $0 offset=16\n (i32.const 4)\n (i64.const 5)\n)\n" - ); - - module.dispose(); -})(); - -console.log("# AtomicCmpxchg"); -(function testAtomicCmpxchg() { - const module = new binaryen.Module(); - module.setMemory(1, 1, null); - - var offset = 8; - var ptr = module.i32.const(2); - var expected = module.i32.const(3); - var replacement = module.i32.const(4); - const theAtomicCmpxchg = binaryen.AtomicCmpxchg(module.i32.atomic.rmw.cmpxchg(offset, ptr, expected, replacement)); - assert(theAtomicCmpxchg instanceof binaryen.AtomicCmpxchg); - assert(theAtomicCmpxchg instanceof binaryen.Expression); - assert(theAtomicCmpxchg.bytes === 4); - assert(theAtomicCmpxchg.offset === offset); - assert(theAtomicCmpxchg.ptr === ptr); - assert(theAtomicCmpxchg.expected === expected); - assert(theAtomicCmpxchg.replacement === replacement); - assert(theAtomicCmpxchg.type === binaryen.i32); - - theAtomicCmpxchg.bytes = 2; - assert(theAtomicCmpxchg.bytes === 2); - theAtomicCmpxchg.offset = offset = 16; - assert(theAtomicCmpxchg.offset === offset); - theAtomicCmpxchg.ptr = ptr = module.i32.const(5); - assert(theAtomicCmpxchg.ptr === ptr); - theAtomicCmpxchg.expected = expected = module.i64.const(6); - assert(theAtomicCmpxchg.expected === expected); - theAtomicCmpxchg.replacement = replacement = module.i64.const(7); - assert(theAtomicCmpxchg.replacement === replacement); - theAtomicCmpxchg.type = binaryen.i64; - theAtomicCmpxchg.finalize(); - assert(theAtomicCmpxchg.type === binaryen.i64); - - console.log(theAtomicCmpxchg.toText()); - assert( - theAtomicCmpxchg.toText() - == - "(i64.atomic.rmw16.cmpxchg_u $0 offset=16\n (i32.const 5)\n (i64.const 6)\n (i64.const 7)\n)\n" - ); - - module.dispose(); -})(); - -console.log("# AtomicWait"); -(function testAtomicWait() { - const module = new binaryen.Module(); - module.setMemory(1, 1, null); - - var ptr = module.i32.const(2); - var expected = module.i32.const(3); - var timeout = module.i64.const(4); - const theAtomicWait = binaryen.AtomicWait(module.memory.atomic.wait32(ptr, expected, timeout)); - assert(theAtomicWait instanceof binaryen.AtomicWait); - assert(theAtomicWait instanceof binaryen.Expression); - assert(theAtomicWait.ptr === ptr); - assert(theAtomicWait.expected === expected); - assert(theAtomicWait.expectedType === binaryen.i32); - assert(theAtomicWait.timeout === timeout); - assert(theAtomicWait.type === binaryen.i32); - - theAtomicWait.ptr = ptr = module.i32.const(5); - assert(theAtomicWait.ptr === ptr); - theAtomicWait.expected = expected = module.i32.const(6); - assert(theAtomicWait.expected === expected); - theAtomicWait.expectedType = binaryen.i64; - assert(theAtomicWait.expectedType === binaryen.i64); - theAtomicWait.timeout = timeout = module.i64.const(7); - assert(theAtomicWait.timeout === timeout); - theAtomicWait.type = binaryen.f64; - theAtomicWait.finalize(); - assert(theAtomicWait.type === binaryen.i32); - - console.log(theAtomicWait.toText()); - assert( - theAtomicWait.toText() - == - "(memory.atomic.wait64 $0\n (i32.const 5)\n (i32.const 6)\n (i64.const 7)\n)\n" - ); - - module.dispose(); -})(); - -console.log("# AtomicNotify"); -(function testAtomicNotify() { - const module = new binaryen.Module(); - module.setMemory(1, 1, null); - - var ptr = module.i32.const(1); - var notifyCount = module.i32.const(2); - const theAtomicNotify = binaryen.AtomicNotify(module.memory.atomic.notify(ptr, notifyCount)); - assert(theAtomicNotify instanceof binaryen.AtomicNotify); - assert(theAtomicNotify instanceof binaryen.Expression); - assert(theAtomicNotify.ptr === ptr); - assert(theAtomicNotify.notifyCount === notifyCount); - assert(theAtomicNotify.type === binaryen.i32); - - theAtomicNotify.ptr = ptr = module.i32.const(3); - assert(theAtomicNotify.ptr === ptr); - theAtomicNotify.notifyCount = notifyCount = module.i32.const(4); - assert(theAtomicNotify.notifyCount === notifyCount); - theAtomicNotify.type = binaryen.f64; - theAtomicNotify.finalize(); - assert(theAtomicNotify.type === binaryen.i32); - - console.log(theAtomicNotify.toText()); - assert( - theAtomicNotify.toText() - == - "(memory.atomic.notify $0\n (i32.const 3)\n (i32.const 4)\n)\n" - ); - - module.dispose(); -})(); - -console.log("# AtomicFence"); -(function testAtomicFence() { - const module = new binaryen.Module(); - - const theAtomicFence = binaryen.AtomicFence(module.atomic.fence()); - assert(theAtomicFence instanceof binaryen.AtomicFence); - assert(theAtomicFence instanceof binaryen.Expression); - assert(theAtomicFence.order === 0); // reserved, not yet used - assert(theAtomicFence.type === binaryen.none); - - theAtomicFence.order = 1; - assert(theAtomicFence.order === 1); - theAtomicFence.type = binaryen.f64; - theAtomicFence.finalize(); - assert(theAtomicFence.type === binaryen.none); - - console.log(theAtomicFence.toText()); - assert( - theAtomicFence.toText() - == - "(atomic.fence)\n" - ); - - module.dispose(); -})(); - -console.log("# SIMDExtract"); -(function testSIMDExtract() { - const module = new binaryen.Module(); - - var op = binaryen.Operations.ExtractLaneSVecI8x16; - var vec = module.v128.const([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]); - var index = 0; - const theSIMDExtract = binaryen.SIMDExtract(module.i8x16.extract_lane_s(vec, index)); - assert(theSIMDExtract instanceof binaryen.SIMDExtract); - assert(theSIMDExtract instanceof binaryen.Expression); - assert(theSIMDExtract.op === op); - assert(theSIMDExtract.vec === vec); - assert(theSIMDExtract.index === index); - assert(theSIMDExtract.type === binaryen.i32); - - theSIMDExtract.op = op = binaryen.Operations.ExtractLaneSVecI16x8; - assert(theSIMDExtract.op === op); - theSIMDExtract.vec = vec = module.v128.const([1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]); - assert(theSIMDExtract.vec === vec); - theSIMDExtract.index = index = 1; - assert(theSIMDExtract.index === index); - theSIMDExtract.type = binaryen.f64; - theSIMDExtract.finalize(); - assert(theSIMDExtract.type === binaryen.i32); - - console.log(theSIMDExtract.toText()); - assert( - theSIMDExtract.toText() - == - "(i16x8.extract_lane_s 1\n (v128.const i32x4 0x01010101 0x01010101 0x01010101 0x01010101)\n)\n" - ); - - module.dispose(); -})(); - -console.log("# SIMDReplace"); -(function testSIMDReplace() { - const module = new binaryen.Module(); - - var op = binaryen.Operations.ReplaceLaneVecI8x16; - var vec = module.v128.const([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]); - var index = 0; - var value = module.i32.const(1); - const theSIMDReplace = binaryen.SIMDReplace(module.i8x16.replace_lane(vec, index, value)); - assert(theSIMDReplace instanceof binaryen.SIMDReplace); - assert(theSIMDReplace instanceof binaryen.Expression); - assert(theSIMDReplace.op === op); - assert(theSIMDReplace.vec === vec); - assert(theSIMDReplace.index === index); - assert(theSIMDReplace.value === value); - assert(theSIMDReplace.type === binaryen.v128); - - theSIMDReplace.op = op = binaryen.Operations.ReplaceLaneVecI16x8; - assert(theSIMDReplace.op === op); - theSIMDReplace.vec = vec = module.v128.const([1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]); - assert(theSIMDReplace.vec === vec); - theSIMDReplace.index = index = 1; - assert(theSIMDReplace.index === index); - theSIMDReplace.value = value = module.i32.const(2); - assert(theSIMDReplace.value === value); - theSIMDReplace.type = binaryen.f64; - theSIMDReplace.finalize(); - assert(theSIMDReplace.type === binaryen.v128); - - console.log(theSIMDReplace.toText()); - assert( - theSIMDReplace.toText() - == - "(i16x8.replace_lane 1\n (v128.const i32x4 0x01010101 0x01010101 0x01010101 0x01010101)\n (i32.const 2)\n)\n" - ); - - module.dispose(); -})(); - -console.log("# SIMDShuffle"); -(function testSIMDShuffle() { - const module = new binaryen.Module(); - - var left = module.v128.const([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]); - var right = module.v128.const([2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]); - var mask = [3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]; - const theSIMDShuffle = binaryen.SIMDShuffle(module.i8x16.shuffle(left, right, mask)); - assert(theSIMDShuffle instanceof binaryen.SIMDShuffle); - assert(theSIMDShuffle instanceof binaryen.Expression); - assert(theSIMDShuffle.left === left); - assert(theSIMDShuffle.right === right); - assertDeepEqual(theSIMDShuffle.mask, mask); - assert(theSIMDShuffle.type === binaryen.v128); - - theSIMDShuffle.left = left = module.v128.const([1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]); - assert(theSIMDShuffle.left === left); - theSIMDShuffle.right = right = module.v128.const([2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2]); - assert(theSIMDShuffle.right === right); - theSIMDShuffle.mask = mask = [3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3]; - assertDeepEqual(theSIMDShuffle.mask, mask); - theSIMDShuffle.type = binaryen.f64; - theSIMDShuffle.finalize(); - assert(theSIMDShuffle.type === binaryen.v128); - - console.log(theSIMDShuffle.toText()); - assert( - theSIMDShuffle.toText() - == - "(i8x16.shuffle 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3\n (v128.const i32x4 0x01010101 0x01010101 0x01010101 0x01010101)\n (v128.const i32x4 0x02020202 0x02020202 0x02020202 0x02020202)\n)\n" - ); - - module.dispose(); -})(); - -console.log("# SIMDTernary"); -(function testSIMDTernary() { - const module = new binaryen.Module(); - - var op = binaryen.Operations.BitselectVec128; - var a = module.v128.const([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]); - var b = module.v128.const([2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]); - var c = module.v128.const([3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]); - const theSIMDTernary = binaryen.SIMDTernary(module.v128.bitselect(a, b, c)); - assert(theSIMDTernary instanceof binaryen.SIMDTernary); - assert(theSIMDTernary instanceof binaryen.Expression); - assert(theSIMDTernary.op === op); - assert(theSIMDTernary.a === a); - assert(theSIMDTernary.b === b); - assert(theSIMDTernary.c === c); - assert(theSIMDTernary.type === binaryen.v128); - - console.log(theSIMDTernary.toText() + "\n"); - assert( - theSIMDTernary.toText() - == - "(v128.bitselect\n (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)\n (v128.const i32x4 0x05040302 0x09080706 0x0d0c0b0a 0x11100f0e)\n (v128.const i32x4 0x06050403 0x0a090807 0x0e0d0c0b 0x1211100f)\n)\n" - ); - - module.dispose(); -})(); - -console.log("# SIMDShift"); -(function testSIMDShift() { - const module = new binaryen.Module(); - - var op = binaryen.Operations.BitselectVec128; - var vec = module.v128.const([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]); - var shift = module.i32.const(1); - const theSIMDShift = binaryen.SIMDShift(module.i8x16.shl(vec, shift)); - assert(theSIMDShift instanceof binaryen.SIMDShift); - assert(theSIMDShift instanceof binaryen.Expression); - assert(theSIMDShift.op === op); - assert(theSIMDShift.vec === vec); - assert(theSIMDShift.shift === shift); - assert(theSIMDShift.type === binaryen.v128); - - theSIMDShift.op = op = binaryen.Operations.ShrSVecI8x16; - assert(theSIMDShift.op === op); - theSIMDShift.vec = vec = module.v128.const([1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]); - assert(theSIMDShift.vec === vec); - theSIMDShift.shift = shift = module.i32.const(2); - assert(theSIMDShift.shift === shift); - theSIMDShift.type = binaryen.f64; - theSIMDShift.finalize(); - assert(theSIMDShift.type === binaryen.v128); - - console.log(theSIMDShift.toText()); - assert( - theSIMDShift.toText() - == - "(i8x16.shr_s\n (v128.const i32x4 0x01010101 0x01010101 0x01010101 0x01010101)\n (i32.const 2)\n)\n" - ); - - module.dispose(); -})(); - -console.log("# SIMDLoad"); -(function testSIMDLoad() { - const module = new binaryen.Module(); - module.setMemory(1, 1, null); - - var op = binaryen.Operations.Load8x8SVec128; - var offset = 16; - var align = 2; - var ptr = module.i32.const(1); - const theSIMDLoad = binaryen.SIMDLoad(module.v128.load8x8_s(offset, align, ptr)); - assert(theSIMDLoad instanceof binaryen.SIMDLoad); - assert(theSIMDLoad instanceof binaryen.Expression); - assert(theSIMDLoad.offset === offset); - assert(theSIMDLoad.align === align); - assert(theSIMDLoad.ptr === ptr); - assert(theSIMDLoad.type === binaryen.v128); - - theSIMDLoad.op = op = binaryen.Operations.Load8SplatVec128; - assert(theSIMDLoad.op === op); - theSIMDLoad.offset = offset = 32; - assert(theSIMDLoad.offset === offset); - theSIMDLoad.align = align = 4; - assert(theSIMDLoad.align === align); - theSIMDLoad.ptr = ptr = module.i32.const(2); - assert(theSIMDLoad.ptr === ptr); - theSIMDLoad.type = binaryen.f64; - theSIMDLoad.finalize(); - assert(theSIMDLoad.type === binaryen.v128); - - console.log(theSIMDLoad.toText()); - assert( - theSIMDLoad.toText() - == - "(v128.load8_splat $0 offset=32 align=4\n (i32.const 2)\n)\n" - ); - - module.dispose(); -})(); - -console.log("# SIMDLoadStoreLane"); -(function testSIMDLoadStoreLane() { - const module = new binaryen.Module(); - module.setMemory(1, 1, null); - - var op = binaryen.Operations.Load8LaneVec128; - var offset = 16; - var index = 1; - var align = 1; - var ptr = module.i32.const(1); - var vec = module.v128.const([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]); - const theSIMDLoadStoreLane = binaryen.SIMDLoadStoreLane(module.v128.load8_lane(offset, align, index, ptr, vec)); - assert(theSIMDLoadStoreLane instanceof binaryen.SIMDLoadStoreLane); - assert(theSIMDLoadStoreLane instanceof binaryen.Expression); - assert(theSIMDLoadStoreLane.op === op); - assert(theSIMDLoadStoreLane.offset === offset); - assert(theSIMDLoadStoreLane.align === align); - assert(theSIMDLoadStoreLane.index === index); - assert(theSIMDLoadStoreLane.ptr === ptr); - assert(theSIMDLoadStoreLane.vec === vec); - assert(theSIMDLoadStoreLane.type === binaryen.v128); - assert(theSIMDLoadStoreLane.store === false); - - theSIMDLoadStoreLane.op = op = binaryen.Operations.Load16LaneVec128; - assert(theSIMDLoadStoreLane.op === op); - theSIMDLoadStoreLane.offset = offset = 32; - assert(theSIMDLoadStoreLane.offset === offset); - theSIMDLoadStoreLane.align = align = 2; - assert(theSIMDLoadStoreLane.align === align); - theSIMDLoadStoreLane.index = index = 2; - assert(theSIMDLoadStoreLane.index === index); - theSIMDLoadStoreLane.ptr = ptr = module.i32.const(2); - assert(theSIMDLoadStoreLane.ptr === ptr); - theSIMDLoadStoreLane.vec = vec = module.v128.const([1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]); - assert(theSIMDLoadStoreLane.vec === vec); - theSIMDLoadStoreLane.type = binaryen.f64; - theSIMDLoadStoreLane.finalize(); - assert(theSIMDLoadStoreLane.type === binaryen.v128); - - console.log(theSIMDLoadStoreLane.toText()); - assert( - theSIMDLoadStoreLane.toText() - == - "(v128.load16_lane $0 offset=32 2\n (i32.const 2)\n (v128.const i32x4 0x01010101 0x01010101 0x01010101 0x01010101)\n)\n" - ); - - theSIMDLoadStoreLane.op = op = binaryen.Operations.Store16LaneVec128; - assert(theSIMDLoadStoreLane.op === op); - theSIMDLoadStoreLane.type = binaryen.f64; - assert(theSIMDLoadStoreLane.store === true); - theSIMDLoadStoreLane.finalize(); - assert(theSIMDLoadStoreLane.type === binaryen.none); - - console.log(theSIMDLoadStoreLane.toText()); - assert( - theSIMDLoadStoreLane.toText() - == - "(v128.store16_lane $0 offset=32 2\n (i32.const 2)\n (v128.const i32x4 0x01010101 0x01010101 0x01010101 0x01010101)\n)\n" - ); - - module.dispose(); -})(); - -console.log("# MemoryInit"); -(function testMemoryInit() { - const module = new binaryen.Module(); - module.setMemory(1, 1, null); - - var segment = "1"; - var dest = module.i32.const(2); - var offset = module.i32.const(3); - var size = module.i32.const(4); - const theMemoryInit = binaryen.MemoryInit(module.memory.init(segment, dest, offset, size)); - assert(theMemoryInit instanceof binaryen.MemoryInit); - assert(theMemoryInit instanceof binaryen.Expression); - assert(theMemoryInit.segment === segment); - assert(theMemoryInit.dest === dest); - assert(theMemoryInit.offset === offset); - assert(theMemoryInit.size === size); - assert(theMemoryInit.type === binaryen.none); - - theMemoryInit.segment = segment = "5"; - assert(theMemoryInit.segment === "5"); - theMemoryInit.dest = dest = module.i32.const(6); - assert(theMemoryInit.dest === dest); - theMemoryInit.offset = offset = module.i32.const(7); - assert(theMemoryInit.offset === offset); - theMemoryInit.size = size = module.i32.const(8); - assert(theMemoryInit.size === size); - theMemoryInit.type = binaryen.f64; - theMemoryInit.finalize(); - assert(theMemoryInit.type === binaryen.none); - - console.log(theMemoryInit.toText()); - assert( - theMemoryInit.toText() - == - "(memory.init $0 $5\n (i32.const 6)\n (i32.const 7)\n (i32.const 8)\n)\n" - ); - - module.dispose(); -})(); - -console.log("# DataDrop"); -(function testDataDrop() { - const module = new binaryen.Module(); - - var segment = "1"; - const theDataDrop = binaryen.DataDrop(module.data.drop(segment)); - assert(theDataDrop instanceof binaryen.DataDrop); - assert(theDataDrop instanceof binaryen.Expression); - assert(theDataDrop.segment === segment); - assert(theDataDrop.type === binaryen.none); - - theDataDrop.segment = segment = "2"; - assert(theDataDrop.segment === "2"); - theDataDrop.type = binaryen.f64; - theDataDrop.finalize(); - assert(theDataDrop.type === binaryen.none); - - console.log(theDataDrop.toText()); - assert( - theDataDrop.toText() - == - "(data.drop $2)\n" - ); - - module.dispose(); -})(); - -console.log("# MemoryCopy"); -(function testMemoryCopy() { - const module = new binaryen.Module(); - module.setMemory(1, 1, null); - - var dest = module.i32.const(1); - var source = module.i32.const(2); - var size = module.i32.const(3); - const theMemoryCopy = binaryen.MemoryCopy(module.memory.copy(dest, source, size)); - assert(theMemoryCopy instanceof binaryen.MemoryCopy); - assert(theMemoryCopy instanceof binaryen.Expression); - assert(theMemoryCopy.dest === dest); - assert(theMemoryCopy.source === source); - assert(theMemoryCopy.size === size); - assert(theMemoryCopy.type === binaryen.none); - - theMemoryCopy.dest = dest = module.i32.const(4); - assert(theMemoryCopy.dest === dest); - theMemoryCopy.source = source = module.i32.const(5); - assert(theMemoryCopy.source === source); - theMemoryCopy.size = size = module.i32.const(6); - assert(theMemoryCopy.size === size); - theMemoryCopy.type = binaryen.f64; - theMemoryCopy.finalize(); - assert(theMemoryCopy.type === binaryen.none); - - console.log(theMemoryCopy.toText()); - assert( - theMemoryCopy.toText() - == - "(memory.copy $0 $0\n (i32.const 4)\n (i32.const 5)\n (i32.const 6)\n)\n" - ); - - module.dispose(); -})(); - -console.log("# MemoryFill"); -(function testMemoryFill() { - const module = new binaryen.Module(); - module.setMemory(1, 1, null); - - var dest = module.i32.const(1); - var value = module.i32.const(2); - var size = module.i32.const(3); - const theMemoryFill = binaryen.MemoryFill(module.memory.fill(dest, value, size)); - assert(theMemoryFill instanceof binaryen.MemoryFill); - assert(theMemoryFill instanceof binaryen.Expression); - assert(theMemoryFill.dest === dest); - assert(theMemoryFill.value === value); - assert(theMemoryFill.size === size); - assert(theMemoryFill.type === binaryen.none); - - theMemoryFill.dest = dest = module.i32.const(4); - assert(theMemoryFill.dest === dest); - theMemoryFill.value = value = module.i32.const(5); - assert(theMemoryFill.value === value); - theMemoryFill.size = size = module.i32.const(6); - assert(theMemoryFill.size === size); - theMemoryFill.type = binaryen.f64; - theMemoryFill.finalize(); - assert(theMemoryFill.type === binaryen.none); - - console.log(theMemoryFill.toText()); - assert( - theMemoryFill.toText() - == - "(memory.fill $0\n (i32.const 4)\n (i32.const 5)\n (i32.const 6)\n)\n" - ); - - module.dispose(); -})(); - -console.log("# RefIsNull"); -(function testRefIsNull() { - const module = new binaryen.Module(); - - var value = module.local.get(1, binaryen.externref); - const theRefIsNull = binaryen.RefIsNull(module.ref.is_null(value)); - assert(theRefIsNull instanceof binaryen.RefIsNull); - assert(theRefIsNull instanceof binaryen.Expression); - assert(theRefIsNull.value === value); - assert(theRefIsNull.type === binaryen.i32); - - theRefIsNull.value = value = module.local.get(2, binaryen.externref); - assert(theRefIsNull.value === value); - theRefIsNull.type = binaryen.f64; - theRefIsNull.finalize(); - assert(theRefIsNull.type === binaryen.i32); - - console.log(theRefIsNull.toText()); - assert( - theRefIsNull.toText() - == - "(ref.is_null\n (local.get $2)\n)\n" - ); - - module.dispose(); -})(); - -console.log("# RefAs"); -(function testRefAs() { - const module = new binaryen.Module(); - - var op = binaryen.Operations.RefAsNonNull; - var value = module.local.get(1, binaryen.anyref); - var externref = module.local.get(3, binaryen.externref); - const theRefAs = binaryen.RefAs(module.ref.as_non_null(value)); - assert(theRefAs instanceof binaryen.RefAs); - assert(theRefAs instanceof binaryen.Expression); - assert(theRefAs.op === op); - assert(theRefAs.value === value); - assert(theRefAs.type !== binaryen.i32); // TODO: === (ref any) - - theRefAs.op = op = binaryen.Operations.RefAsExternExternalize; - assert(theRefAs.op === op); - theRefAs.op = op = binaryen.Operations.RefAsNonNull; - theRefAs.value = value = module.local.get(2, binaryen.anyref); - assert(theRefAs.value === value); - theRefAs.type = binaryen.f64; - theRefAs.finalize(); - assert(theRefAs.type !== binaryen.f64); // TODO: === (ref any) - - console.log(theRefAs.toText()); - assert( - theRefAs.toText() - == - "(ref.as_non_null\n (local.get $2)\n)\n" - ); - - // TODO: extern.externalize and extern.internalize - - module.dispose(); -})(); - -console.log("# RefFunc"); -(function testRefFunc() { - const module = new binaryen.Module(); - - var func = "a"; - const theRefFunc = binaryen.RefFunc(module.ref.func(func, binaryen.funcref)); - assert(theRefFunc instanceof binaryen.RefFunc); - assert(theRefFunc instanceof binaryen.Expression); - assert(theRefFunc.func === func); - // TODO: check the type. the type is (ref func), that is, a non-nullable func, - // which differs from funcref. we don't have the ability to create such - // a type in the C/JS APIs yet. - - theRefFunc.func = func = "b"; - assert(theRefFunc.func === func); - theRefFunc.type = binaryen.f64; - theRefFunc.finalize(); - // TODO The type is a subtype of funcref, but we can't check that in the JS - // API atm. - - console.log(theRefFunc.toText()); - assert( - theRefFunc.toText() - == - "(ref.func $b)\n" - ); - - module.dispose(); -})(); - -console.log("# RefEq"); -(function testRefEq() { - const module = new binaryen.Module(); - - var left = module.local.get(0, binaryen.eqref); - var right = module.local.get(1, binaryen.eqref); - const theRefEq = binaryen.RefEq(module.ref.eq(left, right)); - assert(theRefEq instanceof binaryen.RefEq); - assert(theRefEq instanceof binaryen.Expression); - assert(theRefEq.left === left); - assert(theRefEq.right === right); - assert(theRefEq.type === binaryen.i32); - - theRefEq.left = left = module.local.get(2, binaryen.eqref); - assert(theRefEq.left === left); - theRefEq.right = right = module.local.get(3, binaryen.eqref); - assert(theRefEq.right === right); - theRefEq.type = binaryen.f64; - theRefEq.finalize(); - assert(theRefEq.type === binaryen.i32); - - console.log(theRefEq.toText()); - assert( - theRefEq.toText() - == - "(ref.eq\n (local.get $2)\n (local.get $3)\n)\n" - ); - - module.dispose(); -})(); - -console.log("# Try"); -(function testTry() { - const module = new binaryen.Module(); - module.addTag("tag1", 0, binaryen.none, binaryen.none); - module.addTag("tag2", 0, binaryen.none, binaryen.none); - module.addTag("tag3", 0, binaryen.none, binaryen.none); - - var body = module.i32.const(1); - var catchBodies = [ - module.i32.const(2), - module.i32.const(3) - ]; - const theTry = binaryen.Try(module.try('', body, ["tag1"], catchBodies, '')); - assert(theTry instanceof binaryen.Try); - assert(theTry instanceof binaryen.Expression); - assert(theTry.body === body); - assertDeepEqual(theTry.catchBodies, catchBodies); - assert(theTry.type === binaryen.i32); - assert(theTry.getNumCatchTags() == 1); - assert(theTry.getNumCatchBodies() == 2); - assert(theTry.hasCatchAll() == 1); - console.log(theTry.toText()); - - theTry.body = body = module.i32.const(4); - assert(theTry.body === body); - catchBodies = [ - module.i32.const(5) // set - //remove - ]; - theTry.setCatchBodies(catchBodies); - assertDeepEqual(theTry.catchBodies, catchBodies); - assertDeepEqual(theTry.getCatchBodies(), catchBodies); - console.log(theTry.toText()); - - theTry.insertCatchTagAt(1, "tag2"); - theTry.insertCatchBodyAt(0, module.i32.const(6)); - assert(theTry.getNumCatchTags() == 2); - assert(theTry.getNumCatchBodies() == 2); - assert(theTry.hasCatchAll() == 0); - console.log(theTry.toText()); - - assert(theTry.removeCatchTagAt(1) == "tag2"); - theTry.removeCatchBodyAt(1); - assert(theTry.getNumCatchTags() == 1); - assert(theTry.getNumCatchBodies() == 1); - console.log(theTry.toText()); - - theTry.appendCatchTag("tag3"); - theTry.appendCatchBody(module.drop(module.i32.const(7))); - assert(theTry.getCatchTagAt(0) == "tag1"); - assert(theTry.getCatchTagAt(1) == "tag3"); - theTry.setCatchTags(["tag2", "tag3"]); - assertDeepEqual(theTry.getCatchTags(), ["tag2", "tag3"]); - theTry.setCatchBodies([module.i32.const(8), module.i32.const(9)]); - assert(theTry.getCatchTagAt(0) == "tag2"); - assert(theTry.getCatchTagAt(1) == "tag3"); - theTry.setCatchTagAt(1, "tag1"); - theTry.setCatchBodyAt(1, module.i32.const(10)); - assert(theTry.getCatchTagAt(1) == "tag1"); - console.log(theTry.toText()); - - theTry.type = binaryen.f64; - theTry.finalize(); - assert(theTry.type === binaryen.i32); - - console.log(theTry.toText()); - - const tryDelegate = binaryen.Try(module.try('', body, [], [], "try_blah")); - assert(tryDelegate.isDelegate() == 1); - assert(tryDelegate.getDelegateTarget() == "try_blah"); - tryDelegate.setDelegateTarget("try_outer"); - assert(tryDelegate.getDelegateTarget() == "try_outer"); - console.log(tryDelegate.toText()); - - module.dispose(); -})(); - -console.log("# Throw"); -(function testThrow() { - const module = new binaryen.Module(); - - var tag = "foo"; - var operands = [ - module.i32.const(1), - module.i32.const(2) - ]; - const theThrow = binaryen.Throw(module.throw(tag, operands)); - assert(theThrow instanceof binaryen.Throw); - assert(theThrow instanceof binaryen.Expression); - assert(theThrow.tag === tag); - assertDeepEqual(theThrow.operands, operands); - assert(theThrow.type === binaryen.unreachable); - - theThrow.tag = "bar"; - assert(theThrow.tag === "bar"); - theThrow.operands = operands = [ - module.i32.const(3), // set - module.i32.const(4), // set - module.i32.const(5) // append - ]; - assertDeepEqual(theThrow.operands, operands); - assertDeepEqual(theThrow.getOperands(), operands); - operands = [ - module.i32.const(6) // set - // remove - // remove - ]; - theThrow.setOperands(operands); - assertDeepEqual(theThrow.operands, operands); - theThrow.insertOperandAt(1, module.i32.const(7)); - theThrow.type = binaryen.f64; - theThrow.finalize(); - assert(theThrow.type === binaryen.unreachable); - - console.log(theThrow.toText()); - assert( - theThrow.toText() - == - "(throw $bar\n (i32.const 6)\n (i32.const 7)\n)\n" - ); - - module.dispose(); -})(); - -console.log("# Rethrow"); -(function testRethrow() { - const module = new binaryen.Module(); - - const theRethrow = binaryen.Rethrow(module.rethrow("l0")); - assert(theRethrow instanceof binaryen.Rethrow); - assert(theRethrow instanceof binaryen.Expression); - assert(theRethrow.target === "l0"); - assert(theRethrow.type === binaryen.unreachable); - - theRethrow.target = "l1"; - assert(theRethrow.target === "l1"); - theRethrow.type = binaryen.f64; - theRethrow.finalize(); - assert(theRethrow.type === binaryen.unreachable); - - console.log(theRethrow.toText()); - assert( - theRethrow.toText() - == - "(rethrow $l1)\n" - ); - - module.dispose(); -})(); - -console.log("# TupleMake"); -(function testTupleMake() { - const module = new binaryen.Module(); - - var operands = [ - module.i32.const(1), - module.i32.const(2) - ]; - var type = binaryen.createType([ binaryen.i32, binaryen.i32 ]); - const theTupleMake = binaryen.TupleMake(module.tuple.make(operands)); - assert(theTupleMake instanceof binaryen.TupleMake); - assert(theTupleMake instanceof binaryen.Expression); - assertDeepEqual(theTupleMake.operands, operands); - assert(theTupleMake.type === type); - - theTupleMake.operands = operands = [ - module.i32.const(3), // set - module.i32.const(4), // set - module.i32.const(5) // append - ]; - assertDeepEqual(theTupleMake.operands, operands); - operands = [ - module.i32.const(6) // set - // remove - // remove - ]; - theTupleMake.setOperands(operands); - assertDeepEqual(theTupleMake.operands, operands); - assertDeepEqual(theTupleMake.getOperands(), operands); - theTupleMake.insertOperandAt(1, module.i32.const(7)); - theTupleMake.type = binaryen.f64; - theTupleMake.finalize(); - assert(theTupleMake.type === type); - - console.log(theTupleMake.toText()); - assert( - theTupleMake.toText() - == - "(tuple.make 2\n (i32.const 6)\n (i32.const 7)\n)\n" - ); - - module.dispose(); -})(); - -console.log("# TupleExtract"); -(function testTupleExtract() { - const module = new binaryen.Module(); - - var tuple = module.tuple.make([ - module.i32.const(1), - module.i32.const(2) - ]); - var index = 1; - const theTupleExtract = binaryen.TupleExtract(module.tuple.extract(tuple, index)); - assert(theTupleExtract instanceof binaryen.TupleExtract); - assert(theTupleExtract instanceof binaryen.Expression); - assert(theTupleExtract.tuple === tuple); - assert(theTupleExtract.index === index); - assert(theTupleExtract.type === binaryen.i32); - - theTupleExtract.tuple = tuple = module.tuple.make([ - module.f64.const(3), - module.f64.const(4) - ]); - assert(theTupleExtract.tuple === tuple); - theTupleExtract.index = index = 0; - assert(theTupleExtract.index === index); - theTupleExtract.type = binaryen.i32; - theTupleExtract.finalize(); - assert(theTupleExtract.type === binaryen.f64); - - console.log(theTupleExtract.toText()); - assert( - theTupleExtract.toText() - == - "(tuple.extract 2 0\n (tuple.make 2\n (f64.const 3)\n (f64.const 4)\n )\n)\n" - ); - - module.dispose(); -})(); - -console.log("# RefI31"); -(function testRefI31() { - const module = new binaryen.Module(); - - var value = module.local.get(1, binaryen.i32); - const theRefI31 = binaryen.RefI31(module.ref.i31(value)); - assert(theRefI31 instanceof binaryen.RefI31); - assert(theRefI31 instanceof binaryen.Expression); - assert(theRefI31.value === value); - // assert(theRefI31.type === binaryen.?); // TODO: (ref i31) - - theRefI31.value = value = module.local.get(2, binaryen.i32); - assert(theRefI31.value === value); - theRefI31.type = binaryen.f64; - theRefI31.finalize(); - // assert(theRefI31.type === binaryen.?); // TODO: (ref i31) - - console.log(theRefI31.toText()); - assert( - theRefI31.toText() - == - "(ref.i31\n (local.get $2)\n)\n" - ); - - module.dispose(); -})(); - -console.log("# I31Get"); -(function testI31Get() { - const module = new binaryen.Module(); - - var i31 = module.local.get(1, binaryen.i31ref); - const theI31Get = binaryen.I31Get(module.i31.get_s(i31)); - assert(theI31Get instanceof binaryen.I31Get); - assert(theI31Get instanceof binaryen.Expression); - assert(theI31Get.i31 === i31); - assert(theI31Get.signed === true); - assert(theI31Get.type === binaryen.i32); - - theI31Get.i31 = i31 = module.local.get(2, binaryen.i31ref); - assert(theI31Get.i31 === i31); - theI31Get.signed = false; - assert(theI31Get.signed === false); - theI31Get.type = binaryen.f64; - theI31Get.finalize(); - assert(theI31Get.type === binaryen.i32); - - console.log(theI31Get.toText()); - assert( - theI31Get.toText() - == - "(i31.get_u\n (local.get $2)\n)\n" - ); - - module.dispose(); -})(); diff --git a/test/binaryen.js/expressions.js.txt b/test/binaryen.js/expressions.js.txt deleted file mode 100644 index 5d6c37c6bc6..00000000000 --- a/test/binaryen.js/expressions.js.txt +++ /dev/null @@ -1,348 +0,0 @@ -# Expression -# Block -(block $theName (result i32) - (i32.const 0) -) - -# If -(if (result i32) - (i32.const 4) - (then - (i32.const 5) - ) - (else - (i32.const 6) - ) -) - -(if (result i32) - (i32.const 4) - (then - (i32.const 5) - ) -) - -# Loop -(loop $theName - (drop - (i32.const 1) - ) -) - -# Break -(br_if $theNewName - (i32.const 4) - (i32.const 3) -) - -# Switch -(br_table $x $y $c - (i32.const 4) - (i32.const 3) -) - -# Call -(call $bar - (i32.const 7) - (i32.const 6) -) - -# CallIndirect -(call_indirect $0 (type $func.0) - (i32.const 7) - (i32.const 6) - (i32.const 9000) -) - -# LocalGet -(local.get $2) - -# LocalSet -(local.set $2 - (i32.const 3) -) - -# GlobalGet -(global.get $b) - -# GlobalSet -(global.set $b - (f64.const 3) -) - -# MemorySize -(memory.size $0) - -# MemoryGrow -(memory.grow $0 - (i32.const 2) -) - -# Load -(i64.atomic.load $0 offset=32 align=4 - (i32.const 128) -) - -# Store -(i64.atomic.store $0 offset=32 align=4 - (i32.const 128) - (i32.const 2) -) - -# Const -(v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - -# Unary -(i64.eqz - (i64.const 2) -) - -# Binary -(i64.add - (i64.const 3) - (i64.const 4) -) - -# Select -(select - (i64.const 5) - (i64.const 6) - (i32.const 4) -) - -# Drop -(drop - (i32.const 2) -) - -# Return -(return - (i32.const 2) -) - -# AtomicRMW -(i64.atomic.rmw16.sub_u $0 offset=16 - (i32.const 4) - (i64.const 5) -) - -# AtomicCmpxchg -(i64.atomic.rmw16.cmpxchg_u $0 offset=16 - (i32.const 5) - (i64.const 6) - (i64.const 7) -) - -# AtomicWait -(memory.atomic.wait64 $0 - (i32.const 5) - (i32.const 6) - (i64.const 7) -) - -# AtomicNotify -(memory.atomic.notify $0 - (i32.const 3) - (i32.const 4) -) - -# AtomicFence -(atomic.fence) - -# SIMDExtract -(i16x8.extract_lane_s 1 - (v128.const i32x4 0x01010101 0x01010101 0x01010101 0x01010101) -) - -# SIMDReplace -(i16x8.replace_lane 1 - (v128.const i32x4 0x01010101 0x01010101 0x01010101 0x01010101) - (i32.const 2) -) - -# SIMDShuffle -(i8x16.shuffle 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 - (v128.const i32x4 0x01010101 0x01010101 0x01010101 0x01010101) - (v128.const i32x4 0x02020202 0x02020202 0x02020202 0x02020202) -) - -# SIMDTernary -(v128.bitselect - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x05040302 0x09080706 0x0d0c0b0a 0x11100f0e) - (v128.const i32x4 0x06050403 0x0a090807 0x0e0d0c0b 0x1211100f) -) - - -# SIMDShift -(i8x16.shr_s - (v128.const i32x4 0x01010101 0x01010101 0x01010101 0x01010101) - (i32.const 2) -) - -# SIMDLoad -(v128.load8_splat $0 offset=32 align=4 - (i32.const 2) -) - -# SIMDLoadStoreLane -(v128.load16_lane $0 offset=32 2 - (i32.const 2) - (v128.const i32x4 0x01010101 0x01010101 0x01010101 0x01010101) -) - -(v128.store16_lane $0 offset=32 2 - (i32.const 2) - (v128.const i32x4 0x01010101 0x01010101 0x01010101 0x01010101) -) - -# MemoryInit -(memory.init $0 $5 - (i32.const 6) - (i32.const 7) - (i32.const 8) -) - -# DataDrop -(data.drop $2) - -# MemoryCopy -(memory.copy $0 $0 - (i32.const 4) - (i32.const 5) - (i32.const 6) -) - -# MemoryFill -(memory.fill $0 - (i32.const 4) - (i32.const 5) - (i32.const 6) -) - -# RefIsNull -(ref.is_null - (local.get $2) -) - -# RefAs -(ref.as_non_null - (local.get $2) -) - -# RefFunc -(ref.func $b) - -# RefEq -(ref.eq - (local.get $2) - (local.get $3) -) - -# Try -(try (result i32) - (do - (i32.const 1) - ) - (catch $tag1 - (i32.const 2) - ) - (catch_all - (i32.const 3) - ) -) - -(try (result i32) - (do - (i32.const 4) - ) - (catch $tag1 - (i32.const 5) - ) -) - -(try (result i32) - (do - (i32.const 4) - ) - (catch $tag1 - (i32.const 6) - ) - (catch $tag2 - (i32.const 5) - ) -) - -(try (result i32) - (do - (i32.const 4) - ) - (catch $tag1 - (i32.const 6) - ) -) - -(try (result i32) - (do - (i32.const 4) - ) - (catch $tag2 - (i32.const 8) - ) - (catch $tag1 - (i32.const 10) - ) -) - -(try (result i32) - (do - (i32.const 4) - ) - (catch $tag2 - (i32.const 8) - ) - (catch $tag1 - (i32.const 10) - ) -) - -(try (result i32) - (do - (i32.const 4) - ) - (delegate $try_outer) -) - -# Throw -(throw $bar - (i32.const 6) - (i32.const 7) -) - -# Rethrow -(rethrow $l1) - -# TupleMake -(tuple.make 2 - (i32.const 6) - (i32.const 7) -) - -# TupleExtract -(tuple.extract 2 0 - (tuple.make 2 - (f64.const 3) - (f64.const 4) - ) -) - -# RefI31 -(ref.i31 - (local.get $2) -) - -# I31Get -(i31.get_u - (local.get $2) -) - diff --git a/test/binaryen.js/fast-math.js b/test/binaryen.js/fast-math.js deleted file mode 100644 index 48b575b4155..00000000000 --- a/test/binaryen.js/fast-math.js +++ /dev/null @@ -1,3 +0,0 @@ -console.log("// fastMath=" + binaryen.getFastMath()); -binaryen.setFastMath(true); -assert(binaryen.getFastMath() == true); diff --git a/test/binaryen.js/fast-math.js.txt b/test/binaryen.js/fast-math.js.txt deleted file mode 100644 index 0a0d43cb6f9..00000000000 --- a/test/binaryen.js/fast-math.js.txt +++ /dev/null @@ -1 +0,0 @@ -// fastMath=false diff --git a/test/binaryen.js/functions.js b/test/binaryen.js/functions.js deleted file mode 100644 index 84f59350bf1..00000000000 --- a/test/binaryen.js/functions.js +++ /dev/null @@ -1,75 +0,0 @@ -function cleanInfo(info) { - var ret = {}; - for (var x in info) { - if (x !== 'name' && x !== 'body' && x !== 'type') { - ret[x] = info[x]; - } - } - return ret; -} - -var module = new binaryen.Module(); - -var func = module.addFunction("a-function", binaryen.none, binaryen.i32, [], - module.i32.add( - module.i32.const(1), - module.i32.const(2) - ) -); - -console.log("GetFunction is equal: " + (func === module.getFunction("a-function"))); - -module.runPassesOnFunction(func, ["precompute"]); - -var funcInfo = binaryen.getFunctionInfo(func); -console.log("getFunctionInfo=" + JSON.stringify(cleanInfo(funcInfo))); -var expInfo = binaryen.getExpressionInfo(funcInfo.body); -console.log("getExpressionInfo(body)=" + JSON.stringify(cleanInfo(expInfo))); -console.log(binaryen.emitText(funcInfo.body)); - -module.removeFunction("a-function"); - -assert(module.validate()); - -console.log(module.emitText()); - -// Test wrapper - -func = module.addFunction("b-function", - binaryen.createType([binaryen.i32, binaryen.i32]), - binaryen.i32, - [ binaryen.i32, binaryen.f64 ], - module.local.tee(2, - module.i32.add( - module.local.get(0, binaryen.i32), - module.local.get(1, binaryen.i32) - ), - binaryen.i32 - ) -); -binaryen.Function.setLocalName(func, 0, "a"); -binaryen.Function.setLocalName(func, 1, "b"); -binaryen.Function.setLocalName(func, 2, "ret"); -binaryen.Function.setLocalName(func, 3, "unused"); - -var theFunc = binaryen.Function(func); -assert(theFunc.name === "b-function"); -assert(theFunc.params === binaryen.createType([binaryen.i32, binaryen.i32])); -assert(theFunc.results === binaryen.i32); -assert(theFunc.numVars === 2); -assert(theFunc.getVar(0) === binaryen.i32); -assert(theFunc.getVar(1) === binaryen.f64); -assert(theFunc.numLocals === 4); -assert(theFunc.getLocalName(0) === "a"); -assert(theFunc.getLocalName(1) === "b"); -assert(theFunc.getLocalName(2) === "ret"); -assert(theFunc.getLocalName(3) === "unused"); -theFunc.setLocalName(2, "res"); -assert(theFunc.getLocalName(2) === "res"); -assert((theFunc | 0) === func); - -assert(module.validate()); - -console.log(module.emitText()); - -module.dispose(); diff --git a/test/binaryen.js/functions.js.txt b/test/binaryen.js/functions.js.txt deleted file mode 100644 index c353d8cd67e..00000000000 --- a/test/binaryen.js/functions.js.txt +++ /dev/null @@ -1,22 +0,0 @@ -GetFunction is equal: true -getFunctionInfo={"module":"","base":"","params":0,"results":2,"vars":[]} -getExpressionInfo(body)={"id":14,"value":3} -(i32.const 3) - -(module -) - -(module - (type $0 (func (param i32 i32) (result i32))) - (func $b-function (param $a i32) (param $b i32) (result i32) - (local $res i32) - (local $unused f64) - (local.tee $res - (i32.add - (local.get $a) - (local.get $b) - ) - ) - ) -) - diff --git a/test/binaryen.js/global.js b/test/binaryen.js/global.js deleted file mode 100644 index b0baf25999d..00000000000 --- a/test/binaryen.js/global.js +++ /dev/null @@ -1,37 +0,0 @@ -function cleanInfo(info) { - var ret = {}; - for (var x in info) { - if (x !== 'name' && x !== 'body' && x !== 'type' && x !== 'init') { - ret[x] = info[x]; - } - } - return ret; -} - -var module = new binaryen.Module(); -module.setFeatures(binaryen.Features.MVP | binaryen.Features.MutableGlobals); - -var initExpr = module.i32.const(1); -var global = module.addGlobal("a-global", binaryen.i32, false, initExpr); - -console.log("GetGlobal is equal: " + (global === module.getGlobal("a-global"))); - -var globalInfo = binaryen.getGlobalInfo(global); -console.log("getGlobalInfo=" + JSON.stringify(cleanInfo(globalInfo))); - -var initExpInfo = binaryen.getExpressionInfo(globalInfo.init); -console.log("getExpressionInfo(init)=" + JSON.stringify(cleanInfo(initExpInfo))); -console.log(binaryen.emitText(globalInfo.init)); - -module.addGlobalExport("a-global", "a-global-exp"); -module.addGlobalImport("a-global-imp", "module", "base", binaryen.i32, false); -module.addGlobalImport("a-mut-global-imp", "module", "base", binaryen.i32, true); - -assert(module.validate()); -console.log(module.emitText()); - -module.removeGlobal("a-global"); -module.removeExport("a-global-exp"); - -assert(module.validate()); -console.log(module.emitText()); diff --git a/test/binaryen.js/global.js.txt b/test/binaryen.js/global.js.txt deleted file mode 100644 index 3185794d9dd..00000000000 --- a/test/binaryen.js/global.js.txt +++ /dev/null @@ -1,17 +0,0 @@ -GetGlobal is equal: true -getGlobalInfo={"module":"","base":"","mutable":false} -getExpressionInfo(init)={"id":14,"value":1} -(i32.const 1) - -(module - (import "module" "base" (global $a-global-imp i32)) - (import "module" "base" (global $a-mut-global-imp (mut i32))) - (global $a-global i32 (i32.const 1)) - (export "a-global-exp" (global $a-global)) -) - -(module - (import "module" "base" (global $a-global-imp i32)) - (import "module" "base" (global $a-mut-global-imp (mut i32))) -) - diff --git a/test/binaryen.js/hello-world.js b/test/binaryen.js/hello-world.js deleted file mode 100644 index d82de61162d..00000000000 --- a/test/binaryen.js/hello-world.js +++ /dev/null @@ -1,49 +0,0 @@ -// "hello world" type example: create a function that adds two i32s and -// returns the result - -// Create a module to work on -var module = new binaryen.Module(); - -// Start to create the function, starting with the contents: Get the 0 and -// 1 arguments, and add them, then return them -var left = module.local.get(0, binaryen.i32); -var right = module.local.get(1, binaryen.i32); -var add = module.i32.add(left, right); -var ret = module.return(add); - -// Create the add function -// Note: no additional local variables (that's the []) -var ii = binaryen.createType([binaryen.i32, binaryen.i32]) -module.addFunction('adder', ii, binaryen.i32, [], ret); - -// Export the function, so we can call it later (for simplicity we -// export it as the same name as it has internally) -module.addFunctionExport('adder', 'adder'); - -// Print out the text -console.log(module.emitText()); - -// Optimize the module! This removes the 'return', since the -// output of the add can just fall through -module.optimize(); - -// Print out the optimized module's text -console.log('optimized:\n\n' + module.emitText()); - -// Get the binary in typed array form -var binary = module.emitBinary(); -console.log('binary size: ' + binary.length); -console.log(); -assert(module.validate()); - -// We don't need the Binaryen module anymore, so we can tell it to -// clean itself up -module.dispose(); - -// Compile the binary and create an instance -var wasm = new WebAssembly.Instance(new WebAssembly.Module(binary), {}) -console.log("exports: " + Object.keys(wasm.exports).sort().join(",")); -console.log(); - -// Call the code! -console.log('an addition: ' + wasm.exports.adder(40, 2)); diff --git a/test/binaryen.js/hello-world.js.txt b/test/binaryen.js/hello-world.js.txt deleted file mode 100644 index 3f9296adfcc..00000000000 --- a/test/binaryen.js/hello-world.js.txt +++ /dev/null @@ -1,31 +0,0 @@ -(module - (type $0 (func (param i32 i32) (result i32))) - (export "adder" (func $adder)) - (func $adder (param $0 i32) (param $1 i32) (result i32) - (return - (i32.add - (local.get $0) - (local.get $1) - ) - ) - ) -) - -optimized: - -(module - (type $0 (func (param i32 i32) (result i32))) - (export "adder" (func $adder)) - (func $adder (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32) - (i32.add - (local.get $0) - (local.get $1) - ) - ) -) - -binary size: 43 - -exports: adder - -an addition: 42 diff --git a/test/binaryen.js/inlining-options.js b/test/binaryen.js/inlining-options.js deleted file mode 100644 index bc716bf9166..00000000000 --- a/test/binaryen.js/inlining-options.js +++ /dev/null @@ -1,15 +0,0 @@ -console.log("// alwaysInlineMaxSize=" + binaryen.getAlwaysInlineMaxSize()); -binaryen.setAlwaysInlineMaxSize(11); -assert(binaryen.getAlwaysInlineMaxSize() == 11); - -console.log("// flexibleInlineMaxSize=" + binaryen.getFlexibleInlineMaxSize()); -binaryen.setFlexibleInlineMaxSize(22); -assert(binaryen.getFlexibleInlineMaxSize() == 22); - -console.log("// oneCallerInlineMaxSize=" + binaryen.getOneCallerInlineMaxSize()); -binaryen.setOneCallerInlineMaxSize(33); -assert(binaryen.getOneCallerInlineMaxSize() == 33); - -console.log("// allowInliningFunctionsWithLoops=" + binaryen.getAllowInliningFunctionsWithLoops()); -binaryen.setAllowInliningFunctionsWithLoops(true); -assert(binaryen.getAllowInliningFunctionsWithLoops() == true); diff --git a/test/binaryen.js/inlining-options.js.txt b/test/binaryen.js/inlining-options.js.txt deleted file mode 100644 index d4b658d45a9..00000000000 --- a/test/binaryen.js/inlining-options.js.txt +++ /dev/null @@ -1,4 +0,0 @@ -// alwaysInlineMaxSize=2 -// flexibleInlineMaxSize=20 -// oneCallerInlineMaxSize=-1 -// allowInliningFunctionsWithLoops=false diff --git a/test/binaryen.js/kitchen-sink.js b/test/binaryen.js/kitchen-sink.js deleted file mode 100644 index 235d09f3e89..00000000000 --- a/test/binaryen.js/kitchen-sink.js +++ /dev/null @@ -1,1179 +0,0 @@ -// kitchen sink, tests the full API - -function cleanInfo(info) { - var ret = {}; - for (var x in info) { - if (x !== 'value') { - ret[x] = info[x]; - } - } - return ret; -} - -var module; - -// helpers - -var v128_bytes = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; - -function makeInt32(x) { - return module.i32.const(x); -} - -function makeFloat32(x) { - return module.f32.const(x); -} - -function makeInt64(l, h) { - return module.i64.const(l, h); -} - -function makeFloat64(x) { - return module.f64.const(x); -} - -function makeVec128(i8s) { - return module.v128.const(i8s) -} - -function makeSomething() { - return makeInt32(1337); -} - -function makeDroppedInt32(x) { - return module.drop(module.i32.const(x)); -} - -// tests - -function test_types() { - console.log(" // BinaryenTypeNone: " + binaryen.none); - console.log(" //", binaryen.expandType(binaryen.none).join(",")); - - console.log(" // BinaryenTypeUnreachable: " + binaryen.unreachable); - console.log(" //", binaryen.expandType(binaryen.unreachable).join(",")); - - console.log(" // BinaryenTypeInt32: " + binaryen.i32); - console.log(" //", binaryen.expandType(binaryen.i32).join(",")); - - console.log(" // BinaryenTypeInt64: " + binaryen.i64); - console.log(" //", binaryen.expandType(binaryen.i64).join(",")); - - console.log(" // BinaryenTypeFloat32: " + binaryen.f32); - console.log(" //", binaryen.expandType(binaryen.f32).join(",")); - - console.log(" // BinaryenTypeFloat64: " + binaryen.f64); - console.log(" //", binaryen.expandType(binaryen.f64).join(",")); - - console.log(" // BinaryenTypeVec128: " + binaryen.v128); - console.log(" //", binaryen.expandType(binaryen.v128).join(",")); - - console.log(" // BinaryenTypeAuto: " + binaryen.auto); - - var i32_pair = binaryen.createType([binaryen.i32, binaryen.i32]); - console.log(" //", binaryen.expandType(i32_pair).join(",")); - - var duplicate_pair = binaryen.createType([binaryen.i32, binaryen.i32]); - console.log(" //", binaryen.expandType(duplicate_pair).join(",")); - - assert(i32_pair == duplicate_pair); - - var f32_pair = binaryen.createType([binaryen.f32, binaryen.f32]); - console.log(" //", binaryen.expandType(f32_pair).join(",")); -} - -function test_features() { - console.log("Features.MVP: " + binaryen.Features.MVP); - console.log("Features.Atomics: " + binaryen.Features.Atomics); - console.log("Features.BulkMemory: " + binaryen.Features.BulkMemory); - console.log("Features.MutableGlobals: " + binaryen.Features.MutableGlobals); - console.log("Features.NontrappingFPToInt: " + binaryen.Features.NontrappingFPToInt); - console.log("Features.SignExt: " + binaryen.Features.SignExt); - console.log("Features.SIMD128: " + binaryen.Features.SIMD128); - console.log("Features.ExceptionHandling: " + binaryen.Features.ExceptionHandling); - console.log("Features.TailCall: " + binaryen.Features.TailCall); - console.log("Features.ReferenceTypes: " + binaryen.Features.ReferenceTypes); - console.log("Features.Multivalue: " + binaryen.Features.Multivalue); - console.log("Features.GC: " + binaryen.Features.GC); - console.log("Features.Memory64: " + binaryen.Features.Memory64); - console.log("Features.RelaxedSIMD: " + binaryen.Features.RelaxedSIMD); - console.log("Features.ExtendedConst: " + binaryen.Features.ExtendedConst); - console.log("Features.Strings: " + binaryen.Features.Strings); - console.log("Features.MultiMemory: " + binaryen.Features.MultiMemory); - console.log("Features.All: " + binaryen.Features.All); -} - -function test_ids() { - console.log("InvalidId: " + binaryen.InvalidId); - console.log("BlockId: " + binaryen.BlockId); - console.log("IfId: " + binaryen.IfId); - console.log("LoopId: " + binaryen.LoopId); - console.log("BreakId: " + binaryen.BreakId); - console.log("SwitchId: " + binaryen.SwitchId); - console.log("CallId: " + binaryen.CallId); - console.log("CallIndirectId: " + binaryen.CallIndirectId); - console.log("LocalGetId: " + binaryen.LocalGetId); - console.log("LocalSetId: " + binaryen.LocalSetId); - console.log("GlobalGetId: " + binaryen.GlobalGetId); - console.log("GlobalSetId: " + binaryen.GlobalSetId); - console.log("LoadId: " + binaryen.LoadId); - console.log("StoreId: " + binaryen.StoreId); - console.log("ConstId: " + binaryen.ConstId); - console.log("UnaryId: " + binaryen.UnaryId); - console.log("BinaryId: " + binaryen.BinaryId); - console.log("SelectId: " + binaryen.SelectId); - console.log("DropId: " + binaryen.DropId); - console.log("ReturnId: " + binaryen.ReturnId); - console.log("MemorySizeId: " + binaryen.MemorySizeId); - console.log("MemoryGrowId: " + binaryen.MemoryGrowId); - console.log("NopId: " + binaryen.NopId); - console.log("UnreachableId: " + binaryen.UnreachableId); - console.log("AtomicCmpxchgId: " + binaryen.AtomicCmpxchgId); - console.log("AtomicRMWId: " + binaryen.AtomicRMWId); - console.log("AtomicWaitId: " + binaryen.AtomicWaitId); - console.log("AtomicNotifyId: " + binaryen.AtomicNotifyId); - console.log("SIMDExtractId: " + binaryen.SIMDExtractId); - console.log("SIMDReplaceId: " + binaryen.SIMDReplaceId); - console.log("SIMDShuffleId: " + binaryen.SIMDShuffleId); - console.log("SIMDTernaryId: " + binaryen.SIMDTernaryId); - console.log("SIMDShiftId: " + binaryen.SIMDShiftId); - console.log("SIMDLoadId: " + binaryen.SIMDLoadId); - console.log("SIMDLoadStoreLaneId: " + binaryen.SIMDLoadStoreLaneId); - console.log("MemoryInitId: " + binaryen.MemoryInitId); - console.log("DataDropId: " + binaryen.DataDropId); - console.log("MemoryCopyId: " + binaryen.MemoryCopyId); - console.log("MemoryFillId: " + binaryen.MemoryFillId); - console.log("PopId: " + binaryen.PopId); - console.log("RefNullId: " + binaryen.RefNullId); - console.log("RefIsNullId: " + binaryen.RefIsNullId); - console.log("RefFuncId: " + binaryen.RefFuncId); - console.log("RefEqId: " + binaryen.RefEqId); - console.log("TableGetId: " + binaryen.TableGetId); - console.log("TableSetId: " + binaryen.TableSetId); - console.log("TableSizeId: " + binaryen.TableSizeId); - console.log("TableGrowId: " + binaryen.TableGrowId); - console.log("TryId: " + binaryen.TryId); - console.log("ThrowId: " + binaryen.ThrowId); - console.log("RethrowId: " + binaryen.RethrowId); - console.log("TupleMakeId: " + binaryen.TupleMakeId); - console.log("TupleExtractId: " + binaryen.TupleExtractId); - console.log("RefI31Id: " + binaryen.RefI31Id); - console.log("I31GetId: " + binaryen.I31GetId); - console.log("CallRefId: " + binaryen.CallRefId); - console.log("RefTestId: " + binaryen.RefTestId); - console.log("RefCastId: " + binaryen.RefCastId); - console.log("BrOnId: " + binaryen.BrOnId); - console.log("StructNewId: " + binaryen.StructNewId); - console.log("StructGetId: " + binaryen.StructGetId); - console.log("StructSetId: " + binaryen.StructSetId); - console.log("ArrayNewId: " + binaryen.ArrayNewId); - console.log("ArrayNewFixedId: " + binaryen.ArrayNewFixedId); - console.log("ArrayGetId: " + binaryen.ArrayGetId); - console.log("ArraySetId: " + binaryen.ArraySetId); - console.log("ArrayLenId: " + binaryen.ArrayLenId); - console.log("ArrayCopy: " + binaryen.ArrayCopyId); - console.log("RefAs: " + binaryen.RefAsId); - console.log("StringNew: " + binaryen.StringNewId); - console.log("StringConst: " + binaryen.StringConstId); - console.log("StringMeasure: " + binaryen.StringMeasureId); - console.log("StringEncode: " + binaryen.StringEncodeId); - console.log("StringConcat: " + binaryen.StringConcatId); - console.log("StringEq: " + binaryen.StringEqId); - console.log("StringAs: " + binaryen.StringAsId); - console.log("StringWTF8Advance: " + binaryen.StringWTF8AdvanceId); - console.log("StringWTF16Get: " + binaryen.StringWTF16GetId); - console.log("StringIterNext: " + binaryen.StringIterNextId); - console.log("StringIterMove: " + binaryen.StringIterMoveId); - console.log("StringSliceWTF: " + binaryen.StringSliceWTFId); - console.log("StringSliceIter: " + binaryen.StringSliceIterId); -} - -function test_core() { - - // Module creation - - module = new binaryen.Module(); - // Memory - module.setMemory(1, 256, "mem", [ - { - passive: false, - offset: module.i32.const(10), - data: "hello, world".split('').map(function(x) { return x.charCodeAt(0) }) - }, - { - passive: true, - offset: null, - data: "I am passive".split('').map(function(x) { return x.charCodeAt(0) }) - } - ], true); - - // Create a tag - var tag = module.addTag("a-tag", binaryen.i32, binaryen.none); - - // Literals and consts - - var constI32 = module.i32.const(1), - constI64 = module.i64.const(2), - constF32 = module.f32.const(3.14), - constF64 = module.f64.const(2.1828), - constF32Bits = module.f32.const_bits(0xffff1234), - constF64Bits = module.f64.const_bits(0x5678abcd, 0xffff1234); - - var iIfF = binaryen.createType([binaryen.i32, binaryen.i64, binaryen.f32, binaryen.f64]) - - var temp1 = makeInt32(1), temp2 = makeInt32(2), temp3 = makeInt32(3), - temp4 = makeInt32(4), temp5 = makeInt32(5), - temp6 = makeInt32(0), temp7 = makeInt32(1), - temp8 = makeInt32(0), temp9 = makeInt32(1), - temp10 = makeInt32(1), temp11 = makeInt32(3), temp12 = makeInt32(5), - temp13 = makeInt32(10), temp14 = makeInt32(11), - temp15 = makeInt32(110), temp16 = makeInt64(111); - - var valueList = [ - // Unary - module.i32.clz(module.i32.const(-10)), - module.i64.ctz(module.i64.const(-22, -1)), - module.i32.popcnt(module.i32.const(-10)), - module.f32.neg(module.f32.const(-33.612)), - module.f64.abs(module.f64.const(-9005.841)), - module.f32.ceil(module.f32.const(-33.612)), - module.f64.floor(module.f64.const(-9005.841)), - module.f32.trunc(module.f32.const(-33.612)), - module.f32.nearest(module.f32.const(-33.612)), - module.f64.sqrt(module.f64.const(-9005.841)), - module.i32.eqz(module.i32.const(-10)), - module.i64.extend_s(module.i32.const(-10)), - module.i64.extend_u(module.i32.const(-10)), - module.i32.wrap(module.i64.const(-22, -1)), - module.i32.trunc_s.f32(module.f32.const(-33.612)), - module.i64.trunc_s.f32(module.f32.const(-33.612)), - module.i32.trunc_u.f32(module.f32.const(-33.612)), - module.i64.trunc_u.f32(module.f32.const(-33.612)), - module.i32.trunc_s.f64(module.f64.const(-9005.841)), - module.i64.trunc_s.f64(module.f64.const(-9005.841)), - module.i32.trunc_u.f64(module.f64.const(-9005.841)), - module.i64.trunc_u.f64(module.f64.const(-9005.841)), - module.i32.trunc_s_sat.f32(module.f32.const(-33.612)), - module.i64.trunc_s_sat.f32(module.f32.const(-33.612)), - module.i32.trunc_u_sat.f32(module.f32.const(-33.612)), - module.i64.trunc_u_sat.f32(module.f32.const(-33.612)), - module.i32.trunc_s_sat.f64(module.f64.const(-9005.841)), - module.i64.trunc_s_sat.f64(module.f64.const(-9005.841)), - module.i32.trunc_u_sat.f64(module.f64.const(-9005.841)), - module.i64.trunc_u_sat.f64(module.f64.const(-9005.841)), - module.i32.reinterpret(module.f32.const(-33.612)), - module.i64.reinterpret(module.f64.const(-9005.841)), - module.f32.convert_s.i32(module.i32.const(-10)), - module.f64.convert_s.i32(module.i32.const(-10)), - module.f32.convert_u.i32(module.i32.const(-10)), - module.f64.convert_u.i32(module.i32.const(-10)), - module.f32.convert_s.i64(module.i64.const(-22, -1)), - module.f64.convert_s.i64(module.i64.const(-22, -1)), - module.f32.convert_u.i64(module.i64.const(-22, -1)), - module.f64.convert_u.i64(module.i64.const(-22, -1)), - module.f64.promote(module.f32.const(-33.612)), - module.f32.demote(module.f64.const(-9005.841)), - module.f32.reinterpret(module.i32.const(-10)), - module.f64.reinterpret(module.i64.const(-22, -1)), - module.i8x16.splat(module.i32.const(42)), - module.i16x8.splat(module.i32.const(42)), - module.i32x4.splat(module.i32.const(42)), - module.i64x2.splat(module.i64.const(123, 456)), - module.f32x4.splat(module.f32.const(42.0)), - module.f64x2.splat(module.f64.const(42.0)), - module.v128.not(module.v128.const(v128_bytes)), - module.v128.any_true(module.v128.const(v128_bytes)), - module.i8x16.popcnt(module.v128.const(v128_bytes)), - module.i8x16.abs(module.v128.const(v128_bytes)), - module.i8x16.neg(module.v128.const(v128_bytes)), - module.i8x16.all_true(module.v128.const(v128_bytes)), - module.i8x16.bitmask(module.v128.const(v128_bytes)), - module.i16x8.abs(module.v128.const(v128_bytes)), - module.i16x8.neg(module.v128.const(v128_bytes)), - module.i16x8.all_true(module.v128.const(v128_bytes)), - module.i16x8.bitmask(module.v128.const(v128_bytes)), - module.i16x8.extadd_pairwise_i8x16_s(module.v128.const(v128_bytes)), - module.i16x8.extadd_pairwise_i8x16_u(module.v128.const(v128_bytes)), - module.i32x4.abs(module.v128.const(v128_bytes)), - module.i32x4.neg(module.v128.const(v128_bytes)), - module.i32x4.all_true(module.v128.const(v128_bytes)), - module.i32x4.bitmask(module.v128.const(v128_bytes)), - module.i32x4.extadd_pairwise_i16x8_s(module.v128.const(v128_bytes)), - module.i32x4.extadd_pairwise_i16x8_u(module.v128.const(v128_bytes)), - module.i64x2.abs(module.v128.const(v128_bytes)), - module.i64x2.neg(module.v128.const(v128_bytes)), - module.i64x2.all_true(module.v128.const(v128_bytes)), - module.i64x2.bitmask(module.v128.const(v128_bytes)), - module.f32x4.abs(module.v128.const(v128_bytes)), - module.f32x4.neg(module.v128.const(v128_bytes)), - module.f32x4.sqrt(module.v128.const(v128_bytes)), - module.f64x2.abs(module.v128.const(v128_bytes)), - module.f64x2.neg(module.v128.const(v128_bytes)), - module.f64x2.sqrt(module.v128.const(v128_bytes)), - module.f64x2.convert_low_i32x4_s(module.v128.const(v128_bytes)), - module.f64x2.convert_low_i32x4_u(module.v128.const(v128_bytes)), - module.f64x2.promote_low_f32x4(module.v128.const(v128_bytes)), - module.i32x4.trunc_sat_f32x4_s(module.v128.const(v128_bytes)), - module.i32x4.trunc_sat_f32x4_u(module.v128.const(v128_bytes)), - module.f32x4.convert_i32x4_s(module.v128.const(v128_bytes)), - module.f32x4.convert_i32x4_u(module.v128.const(v128_bytes)), - module.f32x4.demote_f64x2_zero(module.v128.const(v128_bytes)), - module.i16x8.extend_low_i8x16_s(module.v128.const(v128_bytes)), - module.i16x8.extend_high_i8x16_s(module.v128.const(v128_bytes)), - module.i16x8.extend_low_i8x16_u(module.v128.const(v128_bytes)), - module.i16x8.extend_high_i8x16_u(module.v128.const(v128_bytes)), - module.i32x4.extend_low_i16x8_s(module.v128.const(v128_bytes)), - module.i32x4.extend_high_i16x8_s(module.v128.const(v128_bytes)), - module.i32x4.extend_low_i16x8_u(module.v128.const(v128_bytes)), - module.i32x4.extend_high_i16x8_u(module.v128.const(v128_bytes)), - module.i32x4.trunc_sat_f64x2_s_zero(module.v128.const(v128_bytes)), - module.i32x4.trunc_sat_f64x2_u_zero(module.v128.const(v128_bytes)), - module.i64x2.extend_low_i32x4_s(module.v128.const(v128_bytes)), - module.i64x2.extend_high_i32x4_s(module.v128.const(v128_bytes)), - module.i64x2.extend_low_i32x4_u(module.v128.const(v128_bytes)), - module.i64x2.extend_high_i32x4_u(module.v128.const(v128_bytes)), - // Binary - module.i32.add(module.i32.const(-10), module.i32.const(-11)), - module.f64.sub(module.f64.const(-9005.841), module.f64.const(-9007.333)), - module.i32.div_s(module.i32.const(-10), module.i32.const(-11)), - module.i64.div_u(module.i64.const(-22, 0), module.i64.const(-23, 0)), - module.i64.rem_s(module.i64.const(-22, 0), module.i64.const(-23, 0)), - module.i32.rem_u(module.i32.const(-10), module.i32.const(-11)), - module.i32.and(module.i32.const(-10), module.i32.const(-11)), - module.i64.or(module.i64.const(-22, 0), module.i64.const(-23, 0)), - module.i32.xor(module.i32.const(-10), module.i32.const(-11)), - module.i64.shl(module.i64.const(-22, 0), module.i64.const(-23, 0)), - module.i64.shr_u(module.i64.const(-22, 0), module.i64.const(-23, 0)), - module.i32.shr_s(module.i32.const(-10), module.i32.const(-11)), - module.i32.rotl(module.i32.const(-10), module.i32.const(-11)), - module.i64.rotr(module.i64.const(-22, 0), module.i64.const(-23, 0)), - module.f32.div(module.f32.const(-33.612), module.f32.const(-62.5)), - module.f64.copysign(module.f64.const(-9005.841), module.f64.const(-9007.333)), - module.f32.min(module.f32.const(-33.612), module.f32.const(-62.5)), - module.f64.max(module.f64.const(-9005.841), module.f64.const(-9007.333)), - module.i32.eq(module.i32.const(-10), module.i32.const(-11)), - module.f32.ne(module.f32.const(-33.612), module.f32.const(-62.5)), - module.i32.lt_s(module.i32.const(-10), module.i32.const(-11)), - module.i64.lt_u(module.i64.const(-22, 0), module.i64.const(-23, 0)), - module.i64.le_s(module.i64.const(-22, 0), module.i64.const(-23, 0)), - module.i32.le_u(module.i32.const(-10), module.i32.const(-11)), - module.i64.gt_s(module.i64.const(-22, 0), module.i64.const(-23, 0)), - module.i32.gt_u(module.i32.const(-10), module.i32.const(-11)), - module.i32.ge_s(module.i32.const(-10), module.i32.const(-11)), - module.i64.ge_u(module.i64.const(-22, 0), module.i64.const(-23, 0)), - module.f32.lt(module.f32.const(-33.612), module.f32.const(-62.5)), - module.f64.le(module.f64.const(-9005.841), module.f64.const(-9007.333)), - module.f64.gt(module.f64.const(-9005.841), module.f64.const(-9007.333)), - module.f32.ge(module.f32.const(-33.612), module.f32.const(-62.5)), - module.i8x16.eq(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i8x16.ne(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i8x16.lt_s(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i8x16.lt_u(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i8x16.gt_s(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i8x16.gt_u(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i8x16.le_s(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i8x16.le_u(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i8x16.ge_s(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i8x16.ge_u(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i16x8.eq(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i16x8.ne(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i16x8.lt_s(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i16x8.lt_u(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i16x8.gt_s(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i16x8.gt_u(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i16x8.le_s(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i16x8.le_u(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i16x8.ge_s(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i16x8.ge_u(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i32x4.eq(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i32x4.ne(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i32x4.lt_s(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i32x4.lt_u(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i32x4.gt_s(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i32x4.gt_u(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i32x4.le_s(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i32x4.le_u(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i32x4.ge_s(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i32x4.ge_u(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i64x2.eq(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i64x2.ne(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i64x2.lt_s(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i64x2.gt_s(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i64x2.le_s(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i64x2.ge_s(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.f32x4.eq(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.f32x4.ne(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.f32x4.lt(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.f32x4.gt(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.f32x4.le(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.f32x4.ge(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.f64x2.eq(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.f64x2.ne(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.f64x2.lt(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.f64x2.gt(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.f64x2.le(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.f64x2.ge(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.v128.and(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.v128.or(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.v128.xor(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.v128.andnot(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i8x16.add(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i8x16.add_saturate_s(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i8x16.add_saturate_u(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i8x16.sub(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i8x16.sub_saturate_s(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i8x16.sub_saturate_u(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i8x16.min_s(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i8x16.min_u(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i8x16.max_s(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i8x16.max_u(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i8x16.avgr_u(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i16x8.add(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i16x8.add_saturate_s(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i16x8.add_saturate_u(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i16x8.sub(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i16x8.sub_saturate_s(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i16x8.sub_saturate_u(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i16x8.mul(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i16x8.min_s(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i16x8.min_u(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i16x8.max_s(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i16x8.max_u(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i16x8.avgr_u(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i16x8.q15mulr_sat_s(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i16x8.extmul_low_i8x16_s(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i16x8.extmul_high_i8x16_s(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i16x8.extmul_low_i8x16_u(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i16x8.extmul_high_i8x16_u(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i32x4.add(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i32x4.sub(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i32x4.mul(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i32x4.min_s(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i32x4.min_u(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i32x4.max_s(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i32x4.max_u(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i32x4.dot_i16x8_s(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i32x4.extmul_low_i16x8_s(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i32x4.extmul_high_i16x8_s(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i32x4.extmul_low_i16x8_u(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i32x4.extmul_high_i16x8_u(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i64x2.add(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i64x2.sub(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i64x2.mul(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i64x2.extmul_low_i32x4_s(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i64x2.extmul_high_i32x4_s(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i64x2.extmul_low_i32x4_u(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i64x2.extmul_high_i32x4_u(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.f32x4.add(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.f32x4.sub(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.f32x4.mul(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.f32x4.div(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.f32x4.min(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.f32x4.max(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.f32x4.pmin(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.f32x4.pmax(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.f32x4.ceil(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.f32x4.floor(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.f32x4.trunc(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.f32x4.nearest(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.f64x2.add(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.f64x2.sub(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.f64x2.mul(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.f64x2.div(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.f64x2.min(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.f64x2.max(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.f64x2.pmin(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.f64x2.pmax(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.f64x2.ceil(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.f64x2.floor(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.f64x2.trunc(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.f64x2.nearest(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i8x16.narrow_i16x8_s(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i8x16.narrow_i16x8_u(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i16x8.narrow_i32x4_s(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i16x8.narrow_i32x4_u(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - module.i8x16.swizzle(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - // SIMD lane manipulation - module.i8x16.extract_lane_s(module.v128.const(v128_bytes), 1), - module.i8x16.extract_lane_u(module.v128.const(v128_bytes), 1), - module.i16x8.extract_lane_s(module.v128.const(v128_bytes), 1), - module.i16x8.extract_lane_u(module.v128.const(v128_bytes), 1), - module.i32x4.extract_lane(module.v128.const(v128_bytes), 1), - module.i64x2.extract_lane(module.v128.const(v128_bytes), 1), - module.f32x4.extract_lane(module.v128.const(v128_bytes), 1), - module.f64x2.extract_lane(module.v128.const(v128_bytes), 1), - module.i16x8.replace_lane(module.v128.const(v128_bytes), 1, module.i32.const(42)), - module.i8x16.replace_lane(module.v128.const(v128_bytes), 1, module.i32.const(42)), - module.i32x4.replace_lane(module.v128.const(v128_bytes), 1, module.i32.const(42)), - module.i64x2.replace_lane(module.v128.const(v128_bytes), 1, module.i64.const(42, 43)), - module.f32x4.replace_lane(module.v128.const(v128_bytes), 1, module.f32.const(42)), - module.f64x2.replace_lane(module.v128.const(v128_bytes), 1, module.f64.const(42)), - // SIMD shift - module.i8x16.shl(module.v128.const(v128_bytes), module.i32.const(1)), - module.i8x16.shr_s(module.v128.const(v128_bytes), module.i32.const(1)), - module.i8x16.shr_u(module.v128.const(v128_bytes), module.i32.const(1)), - module.i16x8.shl(module.v128.const(v128_bytes), module.i32.const(1)), - module.i16x8.shr_s(module.v128.const(v128_bytes), module.i32.const(1)), - module.i16x8.shr_u(module.v128.const(v128_bytes), module.i32.const(1)), - module.i32x4.shl(module.v128.const(v128_bytes), module.i32.const(1)), - module.i32x4.shr_s(module.v128.const(v128_bytes), module.i32.const(1)), - module.i32x4.shr_u(module.v128.const(v128_bytes), module.i32.const(1)), - module.i64x2.shl(module.v128.const(v128_bytes), module.i32.const(1)), - module.i64x2.shr_s(module.v128.const(v128_bytes), module.i32.const(1)), - module.i64x2.shr_u(module.v128.const(v128_bytes), module.i32.const(1)), - // SIMD load - module.v128.load8_splat(0, 1, module.i32.const(128)), - module.v128.load16_splat(16, 1, module.i32.const(128)), - module.v128.load32_splat(16, 4, module.i32.const(128)), - module.v128.load64_splat(0, 4, module.i32.const(128)), - module.v128.load8x8_s(0, 8, module.i32.const(128)), - module.v128.load8x8_u(0, 8, module.i32.const(128)), - module.v128.load16x4_s(0, 8, module.i32.const(128)), - module.v128.load16x4_u(0, 8, module.i32.const(128)), - module.v128.load32x2_s(0, 8, module.i32.const(128)), - module.v128.load32x2_u(0, 8, module.i32.const(128)), - module.v128.load32_zero(0, 4, module.i32.const(128)), - module.v128.load64_zero(0, 8, module.i32.const(128)), - // SIMD load/store lane - module.v128.load8_lane(0, 1, 0, module.i32.const(128), module.v128.const(v128_bytes)), - module.v128.load8_lane(1, 1, 15, module.i32.const(128), module.v128.const(v128_bytes)), - module.v128.load16_lane(0, 2, 0, module.i32.const(128), module.v128.const(v128_bytes)), - module.v128.load16_lane(2, 1, 7, module.i32.const(128), module.v128.const(v128_bytes)), - module.v128.load32_lane(0, 4, 0, module.i32.const(128), module.v128.const(v128_bytes)), - module.v128.load32_lane(4, 2, 3, module.i32.const(128), module.v128.const(v128_bytes)), - module.v128.load64_lane(0, 8, 0, module.i32.const(128), module.v128.const(v128_bytes)), - module.v128.load64_lane(8, 4, 1, module.i32.const(128), module.v128.const(v128_bytes)), - module.v128.store8_lane(0, 1, 0, module.i32.const(128), module.v128.const(v128_bytes)), - module.v128.store8_lane(1, 1, 15, module.i32.const(128), module.v128.const(v128_bytes)), - module.v128.store16_lane(0, 2, 0, module.i32.const(128), module.v128.const(v128_bytes)), - module.v128.store16_lane(2, 1, 7, module.i32.const(128), module.v128.const(v128_bytes)), - module.v128.store32_lane(0, 4, 0, module.i32.const(128), module.v128.const(v128_bytes)), - module.v128.store32_lane(4, 2, 3, module.i32.const(128), module.v128.const(v128_bytes)), - module.v128.store64_lane(0, 8, 0, module.i32.const(128), module.v128.const(v128_bytes)), - module.v128.store64_lane(8, 4, 1, module.i32.const(128), module.v128.const(v128_bytes)), - // Other SIMD - module.i8x16.shuffle(module.v128.const(v128_bytes), module.v128.const(v128_bytes), v128_bytes), - module.v128.bitselect(module.v128.const(v128_bytes), module.v128.const(v128_bytes), module.v128.const(v128_bytes)), - // Bulk memory - module.memory.init("0", makeInt32(1024), makeInt32(0), makeInt32(12)), - module.data.drop("0"), - module.memory.copy(makeInt32(2048), makeInt32(1024), makeInt32(12)), - module.memory.fill(makeInt32(0), makeInt32(42), makeInt32(1024)), - // All the rest - module.block('', []), // block with no name - module.if(temp1, temp2, temp3), - module.if(temp4, temp5), - module.loop("in", makeInt32(0)), - module.loop(null, makeInt32(0)), - module.break("the-value", temp6, temp7), - module.break("the-nothing", makeInt32(2)), - module.break("the-value", null, makeInt32(3)), - module.break("the-nothing"), - module.switch([ "the-value" ], "the-value", temp8, temp9), - module.switch([ "the-nothing" ], "the-nothing", makeInt32(2)), - module.i32.eqz( // check the output type of the call node - module.call("kitchen()sinker", [ makeInt32(13), makeInt64(37, 0), makeFloat32(1.3), makeFloat64(3.7) ], binaryen.i32) - ), - module.i32.eqz( // check the output type of the call node - module.i32.trunc_s.f32( - module.call("an-imported", [ makeInt32(13), makeFloat64(3.7) ], binaryen.f32) - ) - ), - module.i32.eqz( // check the output type of the call node - module.call_indirect("t0", makeInt32(2449), [ makeInt32(13), makeInt64(37, 0), makeFloat32(1.3), makeFloat64(3.7) ], iIfF, binaryen.i32) - ), - module.drop(module.local.get(0, binaryen.i32)), - module.local.set(0, makeInt32(101)), - module.drop(module.local.tee(0, makeInt32(102), binaryen.i32)), - module.i32.load(0, 0, makeInt32(1)), - module.i64.load16_s(2, 1, makeInt32(8)), - module.f32.load(0, 0, makeInt32(2)), - module.f64.load(2, 8, makeInt32(9)), - module.i32.store(0, 0, temp13, temp14), - module.i64.store(2, 4, temp15, temp16), - module.select(temp10, temp11, temp12), - module.return(makeInt32(1337)), - // Tail Call - module.return_call("kitchen()sinker", [ makeInt32(13), makeInt64(37, 0), makeFloat32(1.3), makeFloat64(3.7) ], binaryen.i32), - module.return_call_indirect("t0", 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(binaryen.externref)), - module.ref.is_null(module.ref.null(binaryen.funcref)), - module.ref.is_null(module.ref.func("kitchen()sinker", binaryen.funcref)), - module.select(temp10, module.ref.null(binaryen.funcref), module.ref.func("kitchen()sinker", binaryen.funcref), binaryen.funcref), - - // GC - module.ref.eq(module.ref.null(binaryen.eqref), module.ref.null(binaryen.eqref)), - - // Exception handling - module.try( - '', - module.throw("a-tag", [module.i32.const(0)]), - ["a-tag"], - [module.drop(module.i32.pop())], - '' - ), - - // Atomics - module.i32.atomic.store(0, - module.i32.const(0), - module.i32.atomic.load(0, - module.i32.const(0) - ) - ), - module.drop( - module.memory.atomic.wait32( - module.i32.const(0), - module.i32.const(0), - module.i64.const(0) - ) - ), - module.drop( - module.memory.atomic.notify( - module.i32.const(0), - module.i32.const(0) - ) - ), - module.atomic.fence(), - - // Tuples - module.tuple.make( - [ makeInt32(13), makeInt64(37, 0), makeFloat32(1.3), makeFloat64(3.7) ] - ), - module.tuple.extract( - module.tuple.make( - [ makeInt32(13), makeInt64(37, 0), makeFloat32(1.3), makeFloat64(3.7) ] - ), 2 - ), - - // Pop - module.i32.pop(), - module.i64.pop(), - module.f32.pop(), - module.f64.pop(), - module.v128.pop(), - module.funcref.pop(), - module.externref.pop(), - module.anyref.pop(), - module.eqref.pop(), - module.i31ref.pop(), - module.structref.pop(), - module.stringref.pop(), - module.stringview_wtf8.pop(), - module.stringview_wtf16.pop(), - module.stringview_iter.pop(), - - // Memory - module.memory.size(), - module.memory.grow(makeInt32(0)), - - // GC - module.ref.i31( - module.i32.const(0) - ), - module.i31.get_s( - module.ref.i31( - module.i32.const(1) - ) - ), - module.i31.get_u( - module.ref.i31( - module.i32.const(2) - ) - ), - - // Other - module.nop(), - module.unreachable(), - ]; - - // Test expression utility - console.log("getExpressionInfo=" + JSON.stringify(cleanInfo(binaryen.getExpressionInfo(valueList[3])))); - console.log(binaryen.emitText(valueList[3])); // test printing a standalone expression - - console.log("getExpressionInfo(i32.const)=" + JSON.stringify(binaryen.getExpressionInfo(module.i32.const(5)))); - console.log("getExpressionInfo(i64.const)=" + JSON.stringify(binaryen.getExpressionInfo(module.i64.const(6, 7)))); - console.log("getExpressionInfo(f32.const)=" + JSON.stringify(binaryen.getExpressionInfo(module.f32.const(8.5)))); - console.log("getExpressionInfo(f64.const)=" + JSON.stringify(binaryen.getExpressionInfo(module.f64.const(9.5)))); - var elements = binaryen.getExpressionInfo( - module.tuple.make([ makeInt32(13), makeInt64(37, 0), makeFloat32(1.3), makeFloat64(3.7) ]) - ).operands; - for (var i = 0; i < elements.length; i++) { - console.log("getExpressionInfo(tuple[" + i + "])=" + JSON.stringify(binaryen.getExpressionInfo(elements[i]))); - } - - // Make the main body of the function. and one block with a return value, one without - var value = module.block("the-value", valueList); - var droppedValue = module.drop(value); - var nothing = module.block("the-nothing", [ droppedValue ]); - var body = module.block("the-body", [ nothing, makeInt32(42) ]); - - // Create the function - var sinker = module.addFunction("kitchen()sinker", iIfF, binaryen.i32, [ binaryen.i32 ], body); - - // Create a global - var initExpr = module.i32.const(1); - var global = module.addGlobal("a-global", binaryen.i32, false, initExpr) - - // Imports - - var iF = binaryen.createType([binaryen.i32, binaryen.f64]); - module.addFunctionImport("an-imported", "module", "base", iF, binaryen.f32); - module.addGlobalImport("a-global-imp", "module", "base", binaryen.i32, false); - module.addGlobalImport("a-mut-global-imp", "module", "base", binaryen.i32, true); - module.addTagImport("a-tag-imp", "module", "base", binaryen.i32, binaryen.none); - - // Exports - - module.addFunctionExport("kitchen()sinker", "kitchen_sinker"); - module.addGlobalExport("a-global", "a-global-exp"); - module.addTagExport("a-tag", "a-tag-exp"); - - // Tables - module.addTable("t1", 0, 2); - var tablePtr = module.getTable("t1"); - assert(tablePtr !== 0); - assert(tablePtr === module.getTableByIndex(0)); - - var table = binaryen.getTableInfo(tablePtr); - assert(table.name === "t1"); - assert(table.module === ""); - assert(table.base === ""); - assert(table.initial === 0); - assert(table.max === 2); - - module.removeTable("t1"); - assert(module.getNumTables() === 0); - - module.addTable("t0", 1, 0xffffffff); - module.addActiveElementSegment("t0", "e0", [ binaryen.getFunctionInfo(sinker).name ]); - assert(module.getNumTables() === 1); - assert(module.getNumElementSegments() === 1); - - // Start function. One per module - var starter = module.addFunction("starter", binaryen.none, binaryen.none, [], module.nop()); - module.setStart(starter); - - // A bunch of our code needs drop, auto-add it - module.autoDrop(); - - var features = binaryen.Features.All; - module.setFeatures(features); - assert(module.getFeatures() == features); - console.log(module.emitText()); - - // Verify it validates - assert(module.validate()); - - // Print it out - console.log(module.emitText()); - - // Clean up the module, which owns all the objects we created above - module.dispose(); -} - -function makeCallCheck(x) { - return module.call("check", [ makeInt32(x) ], binaryen.None); -} - -function test_relooper() { - module = new binaryen.Module(); - var localTypes = [ binaryen.i32 ]; - - module.addFunctionImport("check", "module", "check", binaryen.i32, binaryen.none); - - { // trivial: just one block - var relooper = new binaryen.Relooper(module); - var block = relooper.addBlock(makeCallCheck(1337)); - var body = relooper.renderAndDispose(block, 0, module); - module.addFunction("just-one-block", binaryen.none, binaryen.none, localTypes, body); - } - { // two blocks - var relooper = new binaryen.Relooper(module); - var block0 = relooper.addBlock(makeCallCheck(0)); - var block1 = relooper.addBlock(makeCallCheck(1)); - relooper.addBranch(block0, block1); // no condition, no code on branch - var body = relooper.renderAndDispose(block0, 0, module); - module.addFunction("two-blocks", binaryen.none, binaryen.none, localTypes, body); - } - { // two blocks with code between them - var relooper = new binaryen.Relooper(module); - var block0 = relooper.addBlock(makeCallCheck(0)); - var block1 = relooper.addBlock(makeCallCheck(1)); - relooper.addBranch(block0, block1, null, makeDroppedInt32(77)); // code on branch - var body = relooper.renderAndDispose(block0, 0, module); - module.addFunction("two-blocks-plus-code", binaryen.none, binaryen.none, localTypes, body); - } - { // two blocks in a loop - var relooper = new binaryen.Relooper(module); - var block0 = relooper.addBlock(makeCallCheck(0)); - var block1 = relooper.addBlock(makeCallCheck(1)); - relooper.addBranch(block0, block1, null, null); - relooper.addBranch(block1, block0, null, null); - var body = relooper.renderAndDispose(block0, 0, module); - module.addFunction("loop", binaryen.none, binaryen.none, localTypes, body); - } - { // two blocks in a loop with codes - var relooper = new binaryen.Relooper(module); - var block0 = relooper.addBlock(makeCallCheck(0)); - var block1 = relooper.addBlock(makeCallCheck(1)); - relooper.addBranch(block0, block1, null, makeDroppedInt32(33)); - relooper.addBranch(block1, block0, null, makeDroppedInt32(-66)); - var body = relooper.renderAndDispose(block0, 0, module); - module.addFunction("loop-plus-code", binaryen.none, binaryen.none, localTypes, body); - } - { // split - var relooper = new binaryen.Relooper(module); - var block0 = relooper.addBlock(makeCallCheck(0)); - var block1 = relooper.addBlock(makeCallCheck(1)); - var block2 = relooper.addBlock(makeCallCheck(2)); - relooper.addBranch(block0, block1, makeInt32(55), null); - relooper.addBranch(block0, block2, null, null); - var body = relooper.renderAndDispose(block0, 0, module); - module.addFunction("split", binaryen.none, binaryen.none, localTypes, body); - } - { // split + code - var relooper = new binaryen.Relooper(module); - var block0 = relooper.addBlock(makeCallCheck(0)); - var block1 = relooper.addBlock(makeCallCheck(1)); - var block2 = relooper.addBlock(makeCallCheck(2)); - var temp = makeDroppedInt32(10); - relooper.addBranch(block0, block1, makeInt32(55), temp); - relooper.addBranch(block0, block2, null, makeDroppedInt32(20)); - var body = relooper.renderAndDispose(block0, 0, module); - module.addFunction("split-plus-code", binaryen.none, binaryen.none, localTypes, body); - } - { // if - var relooper = new binaryen.Relooper(module); - var block0 = relooper.addBlock(makeCallCheck(0)); - var block1 = relooper.addBlock(makeCallCheck(1)); - var block2 = relooper.addBlock(makeCallCheck(2)); - relooper.addBranch(block0, block1, makeInt32(55), null); - relooper.addBranch(block0, block2, null, null); - relooper.addBranch(block1, block2, null, null); - var body = relooper.renderAndDispose(block0, 0, module); - module.addFunction("if", binaryen.none, binaryen.none, localTypes, body); - } - { // if + code - var relooper = new binaryen.Relooper(module); - var block0 = relooper.addBlock(makeCallCheck(0)); - var block1 = relooper.addBlock(makeCallCheck(1)); - var block2 = relooper.addBlock(makeCallCheck(2)); - temp = makeDroppedInt32(-1); - relooper.addBranch(block0, block1, makeInt32(55), temp); - relooper.addBranch(block0, block2, null, makeDroppedInt32(-2)); - relooper.addBranch(block1, block2, null, makeDroppedInt32(-3)); - var body = relooper.renderAndDispose(block0, 0, module); - module.addFunction("if-plus-code", binaryen.none, binaryen.none, localTypes, body); - } - { // if-else - var relooper = new binaryen.Relooper(module); - var block0 = relooper.addBlock(makeCallCheck(0)); - var block1 = relooper.addBlock(makeCallCheck(1)); - var block2 = relooper.addBlock(makeCallCheck(2)); - var block3 = relooper.addBlock(makeCallCheck(3)); - relooper.addBranch(block0, block1, makeInt32(55), null); - relooper.addBranch(block0, block2, null, null); - relooper.addBranch(block1, block3, null, null); - relooper.addBranch(block2, block3, null, null); - var body = relooper.renderAndDispose(block0, 0, module); - module.addFunction("if-else", binaryen.none, binaryen.none, localTypes, body); - } - { // loop+tail - var relooper = new binaryen.Relooper(module); - var block0 = relooper.addBlock(makeCallCheck(0)); - var block1 = relooper.addBlock(makeCallCheck(1)); - var block2 = relooper.addBlock(makeCallCheck(2)); - relooper.addBranch(block0, block1, null, null); - relooper.addBranch(block1, block0, makeInt32(10), null); - relooper.addBranch(block1, block2, null, null); - var body = relooper.renderAndDispose(block0, 0, module); - module.addFunction("loop-tail", binaryen.none, binaryen.none, localTypes, body); - } - { // nontrivial loop + phi to head - var relooper = new binaryen.Relooper(module); - var block0 = relooper.addBlock(makeCallCheck(0)); - var block1 = relooper.addBlock(makeCallCheck(1)); - var block2 = relooper.addBlock(makeCallCheck(2)); - var block3 = relooper.addBlock(makeCallCheck(3)); - var block4 = relooper.addBlock(makeCallCheck(4)); - var block5 = relooper.addBlock(makeCallCheck(5)); - var block6 = relooper.addBlock(makeCallCheck(6)); - relooper.addBranch(block0, block1, null, makeDroppedInt32(10)); - relooper.addBranch(block1, block2, makeInt32(-2), null); - relooper.addBranch(block1, block6, null, makeDroppedInt32(20)); - relooper.addBranch(block2, block3, makeInt32(-6), null); - relooper.addBranch(block2, block1, null, makeDroppedInt32(30)); - relooper.addBranch(block3, block4, makeInt32(-10), null); - relooper.addBranch(block3, block5, null, null); - relooper.addBranch(block4, block5, null, null); - relooper.addBranch(block5, block6, null, makeDroppedInt32(40)); - var body = relooper.renderAndDispose(block0, 0, module); - module.addFunction("nontrivial-loop-plus-phi-to-head", binaryen.none, binaryen.none, localTypes, body); - } - { // switch - var relooper = new binaryen.Relooper(module); - temp = makeInt32(-99); - var block0 = relooper.addBlockWithSwitch(makeCallCheck(0), temp); - var block1 = relooper.addBlock(makeCallCheck(1)); - var block2 = relooper.addBlock(makeCallCheck(2)); - var block3 = relooper.addBlock(makeCallCheck(3)); - relooper.addBranchForSwitch(block0, block1, [ 2, 5 ]); - relooper.addBranchForSwitch(block0, block2, [4], makeDroppedInt32(55)); - relooper.addBranchForSwitch(block0, block3, [], null); - var body = relooper.renderAndDispose(block0, 0, module); - module.addFunction("switch", binaryen.none, binaryen.none, localTypes, body); - } - { // duff's device - var relooper = new binaryen.Relooper(module); - var block0 = relooper.addBlock(makeCallCheck(0)); - var block1 = relooper.addBlock(makeCallCheck(1)); - var block2 = relooper.addBlock(makeCallCheck(2)); - relooper.addBranch(block0, block1, makeInt32(10), null); - relooper.addBranch(block0, block2, null, null); - relooper.addBranch(block1, block2, null, null); - relooper.addBranch(block2, block1, null, null); - var body = relooper.renderAndDispose(block0, 3, module); // use $3 as the helper var - module.addFunction("duffs-device", binaryen.none, binaryen.none, [ binaryen.i32, binaryen.i32, binaryen.i64, binaryen.i32, binaryen.f32, binaryen.f64, binaryen.i32 ], body); - } - - { // return in a block - var relooper = new binaryen.Relooper(module); - var list = module.block("the-list", [ makeCallCheck(42), module.return(makeInt32(1337)) ]); - var block = relooper.addBlock(list); - var body = relooper.renderAndDispose(block, 0, module); - module.addFunction("return", binaryen.none, binaryen.i32, localTypes, body); - } - - console.log("raw:"); - console.log(module.emitText()); - - assert(module.validate()); - - module.runPasses(["precompute"]); - - assert(module.validate()); - - module.optimize(); - - assert(module.validate()); - - console.log("optimized:"); - console.log(module.emitText()); - - module.dispose(); -} - -function test_binaries() { - var buffer, size; - - { // create a module and write it to binary - module = new binaryen.Module(); - module.setFeatures(binaryen.Features.All); - var ii = binaryen.createType([binaryen.i32, binaryen.i32]); - var x = module.local.get(0, binaryen.i32), - y = module.local.get(1, binaryen.i32); - var add = module.i32.add(x, y); - var adder = module.addFunction("adder", ii, binaryen.i32, [], add); - var initExpr = module.i32.const(3); - var global = module.addGlobal("a-global", binaryen.i32, false, initExpr) - var tag = module.addTag("a-tag", binaryen.createType([binaryen.i32, binaryen.i32]), binaryen.none); - binaryen.setDebugInfo(true); // include names section - buffer = module.emitBinary(); - binaryen.setDebugInfo(false); - size = buffer.length; // write out the module - module.dispose(); - } - - assert(size > 0); - assert(size < 512); // this is a tiny module - - // read the module from the binary - module = binaryen.readBinary(buffer); - module.setFeatures(binaryen.Features.All); - - // validate, print, and free - assert(module.validate()); - console.log("module loaded from binary form:"); - console.log(module.emitText()); - module.dispose(); -} - -function test_interpret() { - // create a simple module with a start method that prints a number, and interpret it, printing that number. - module = new binaryen.Module(); - - module.addFunctionImport("print-i32", "spectest", "print", binaryen.i32, binaryen.none); - var call = module.call("print-i32", [ makeInt32(1234) ], binaryen.None); - var starter = module.addFunction("starter", binaryen.none, binaryen.none, [], call); - module.setStart(starter); - - console.log(module.emitText()); - assert(module.validate()); - module.interpret(); - module.dispose(); -} - -function test_nonvalid() { - // create a module that fails to validate - module = new binaryen.Module(); - - var func = module.addFunction("func", binaryen.none, binaryen.none, [ binaryen.i32 ], - module.local.set(0, makeInt64(1234, 0)) // wrong type! - ); - - console.log(module.emitText()); - console.log("validation: " + module.validate()); - - module.dispose(); -} - -function test_parsing() { - var text; - - // create a module and write it to text - module = new binaryen.Module(); - module.setFeatures(binaryen.Features.All); - - var ii = binaryen.createType([binaryen.i32, binaryen.i32]); - var x = module.local.get(0, binaryen.i32), - y = module.local.get(1, binaryen.i32); - var add = module.i32.add(x, y); - var adder = module.addFunction("adder", ii, binaryen.i32, [], add); - var initExpr = module.i32.const(3); - var global = module.addGlobal("a-global", binaryen.i32, false, initExpr) - var tag = module.addTag("a-tag", binaryen.i32, binaryen.none); - text = module.emitText(); - module.dispose(); - module = null; - console.log('test_parsing text:\n' + text); - - text = text.replace('adder', 'ADD_ER'); - - var module2 = binaryen.parseText(text); - module2.setFeatures(binaryen.Features.All); - assert(module2.validate()); - console.log("module loaded from text form:"); - console.log(module2.emitText()); - module2.dispose(); -} - -function test_internals() { - console.log('sizeof Literal: ' + binaryen['_BinaryenSizeofLiteral']()); -} - -function test_for_each() { - module = new binaryen.Module(); - - var funcNames = [ "fn0", "fn1", "fn2" ]; - - var fns = [ - module.addFunction(funcNames[0], binaryen.none, binaryen.none, [], module.nop()), - module.addFunction(funcNames[1], binaryen.none, binaryen.none, [], module.nop()), - module.addFunction(funcNames[2], binaryen.none, binaryen.none, [], module.nop()) - ]; - - var i; - for (i = 0; i < module.getNumFunctions(); i++) { - assert(module.getFunctionByIndex(i) === fns[i]); - } - - var exps = [ - module.addFunctionExport(funcNames[0], "export0"), - module.addFunctionExport(funcNames[1], "export1"), - module.addFunctionExport(funcNames[2], "export2") - ]; - - for (i = 0; i < module.getNumExports(); i++) { - assert(module.getExportByIndex(i) === exps[i]); - } - - var expected_offsets = [10, 125, null]; - var expected_data = ["hello, world", "segment data 2", "hello, passive"]; - var expected_passive = [false, false, true]; - - var glos = [ - module.addGlobal("a-global", binaryen.i32, false, module.i32.const(expected_offsets[1])), - module.addGlobal("a-global2", binaryen.i32, false, module.i32.const(2)), - module.addGlobal("a-global3", binaryen.i32, false, module.i32.const(3)) - ]; - - for (i = 0; i < module.getNumGlobals(); i++) { - assert(module.getGlobalByIndex(i) === glos[i]); - } - - module.setMemory(1, 256, "mem", [ - { - passive: expected_passive[0], - offset: module.i32.const(expected_offsets[0]), - data: expected_data[0].split('').map(function(x) { return x.charCodeAt(0) }) - }, - { - passive: expected_passive[1], - offset: module.global.get("a-global"), - data: expected_data[1].split('').map(function(x) { return x.charCodeAt(0) }) - }, - { - passive: expected_passive[2], - offset: expected_offsets[2], - data: expected_data[2].split('').map(function(x) { return x.charCodeAt(0) }) - } - ], false); - for (i = 0; i < module.getNumMemorySegments(); i++) { - var segment = module.getMemorySegmentInfoByIndex(i); - assert(expected_offsets[i] === segment.offset); - var data8 = new Uint8Array(segment.data); - var str = String.fromCharCode.apply(null, data8); - assert(expected_data[i] === str); - assert(expected_passive[i] === segment.passive); - } - - module.addTable("t0", 1, 0xffffffff); - var ftable = module.getTable("t0"); - var constExprRef = module.i32.const(0); - module.addActiveElementSegment("t0", "e0", funcNames, constExprRef); - - var tableInfo = binaryen.getTableInfo(ftable); - assert("" === tableInfo.module); - assert("" === tableInfo.base); - - var segments = module.getTableSegments(ftable); - assert(1 === segments.length); - - var elemSegment = binaryen.getElementSegmentInfo(segments[0]); - assert(constExprRef === elemSegment.offset); - assert(3 === elemSegment.data.length); - for (i = 0; i < elemSegment.data.length; i++) { - assert(funcNames[i] === elemSegment.data[i]); - } - - console.log(module.emitText()); - module.dispose(); -} - -function test_expression_info() { - module = new binaryen.Module(); - module.setMemory(1, 1, null); - - // Issue #2392 - console.log("getExpressionInfo(memory.grow)=" + JSON.stringify(binaryen.getExpressionInfo(module.memory.grow(1)))); - - // Issue #2396 - console.log("getExpressionInfo(switch)=" + JSON.stringify(binaryen.getExpressionInfo(module.switch([ "label" ], "label", 0)))); - - module.dispose(); -} - -test_types(); -test_features(); -test_ids(); -test_core(); -test_relooper(); -test_binaries(); -test_interpret(); -test_nonvalid(); -test_parsing(); -test_internals(); -test_for_each(); -test_expression_info(); diff --git a/test/binaryen.js/kitchen-sink.js.txt b/test/binaryen.js/kitchen-sink.js.txt deleted file mode 100644 index b5a9b713e9d..00000000000 --- a/test/binaryen.js/kitchen-sink.js.txt +++ /dev/null @@ -1,4946 +0,0 @@ - // BinaryenTypeNone: 0 - // - // BinaryenTypeUnreachable: 1 - // 1 - // BinaryenTypeInt32: 2 - // 2 - // BinaryenTypeInt64: 3 - // 3 - // BinaryenTypeFloat32: 4 - // 4 - // BinaryenTypeFloat64: 5 - // 5 - // BinaryenTypeVec128: 6 - // 6 - // BinaryenTypeAuto: -1 - // 2,2 - // 2,2 - // 4,4 -Features.MVP: 0 -Features.Atomics: 1 -Features.BulkMemory: 16 -Features.MutableGlobals: 2 -Features.NontrappingFPToInt: 4 -Features.SignExt: 32 -Features.SIMD128: 8 -Features.ExceptionHandling: 64 -Features.TailCall: 128 -Features.ReferenceTypes: 256 -Features.Multivalue: 512 -Features.GC: 1024 -Features.Memory64: 2048 -Features.RelaxedSIMD: 4096 -Features.ExtendedConst: 8192 -Features.Strings: 16384 -Features.MultiMemory: 32768 -Features.All: 131071 -InvalidId: 0 -BlockId: 1 -IfId: 2 -LoopId: 3 -BreakId: 4 -SwitchId: 5 -CallId: 6 -CallIndirectId: 7 -LocalGetId: 8 -LocalSetId: 9 -GlobalGetId: 10 -GlobalSetId: 11 -LoadId: 12 -StoreId: 13 -ConstId: 14 -UnaryId: 15 -BinaryId: 16 -SelectId: 17 -DropId: 18 -ReturnId: 19 -MemorySizeId: 20 -MemoryGrowId: 21 -NopId: 22 -UnreachableId: 23 -AtomicCmpxchgId: 25 -AtomicRMWId: 24 -AtomicWaitId: 26 -AtomicNotifyId: 27 -SIMDExtractId: 29 -SIMDReplaceId: 30 -SIMDShuffleId: 31 -SIMDTernaryId: 32 -SIMDShiftId: 33 -SIMDLoadId: 34 -SIMDLoadStoreLaneId: 35 -MemoryInitId: 36 -DataDropId: 37 -MemoryCopyId: 38 -MemoryFillId: 39 -PopId: 40 -RefNullId: 41 -RefIsNullId: 42 -RefFuncId: 43 -RefEqId: 44 -TableGetId: 45 -TableSetId: 46 -TableSizeId: 47 -TableGrowId: 48 -TryId: 51 -ThrowId: 53 -RethrowId: 54 -TupleMakeId: 56 -TupleExtractId: 57 -RefI31Id: 58 -I31GetId: 59 -CallRefId: 60 -RefTestId: 61 -RefCastId: 62 -BrOnId: 63 -StructNewId: 64 -StructGetId: 65 -StructSetId: 66 -ArrayNewId: 67 -ArrayNewFixedId: 70 -ArrayGetId: 71 -ArraySetId: 72 -ArrayLenId: 73 -ArrayCopy: 74 -RefAs: 78 -StringNew: 79 -StringConst: 80 -StringMeasure: 81 -StringEncode: 82 -StringConcat: 83 -StringEq: 84 -StringAs: 85 -StringWTF8Advance: 86 -StringWTF16Get: 87 -StringIterNext: 88 -StringIterMove: 89 -StringSliceWTF: 90 -StringSliceIter: 91 -getExpressionInfo={"id":15,"type":4,"op":6} -(f32.neg - (f32.const -33.61199951171875) -) - -getExpressionInfo(i32.const)={"id":14,"type":2,"value":5} -getExpressionInfo(i64.const)={"id":14,"type":3,"value":{"low":6,"high":7}} -getExpressionInfo(f32.const)={"id":14,"type":4,"value":8.5} -getExpressionInfo(f64.const)={"id":14,"type":5,"value":9.5} -getExpressionInfo(tuple[0])={"id":14,"type":2,"value":13} -getExpressionInfo(tuple[1])={"id":14,"type":3,"value":{"low":37,"high":0}} -getExpressionInfo(tuple[2])={"id":14,"type":4,"value":1.2999999523162842} -getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7} -(module - (type $0 (func (param i32 i64 f32 f64) (result i32))) - (type $1 (func (param i32))) - (type $2 (func (param i32 f64) (result f32))) - (type $3 (func)) - (import "module" "base" (global $a-global-imp i32)) - (import "module" "base" (global $a-mut-global-imp (mut i32))) - (import "module" "base" (func $an-imported (type $2) (param i32 f64) (result f32))) - (import "module" "base" (tag $a-tag-imp (param i32))) - (global $a-global i32 (i32.const 1)) - (memory $0 1 256 shared) - (data $0 (i32.const 10) "hello, world") - (data $1 "I am passive") - (table $t0 1 funcref) - (elem $e0 (i32.const 0) $"kitchen()sinker") - (tag $a-tag (param i32)) - (export "mem" (memory $0)) - (export "kitchen_sinker" (func $"kitchen()sinker")) - (export "a-global-exp" (global $a-global)) - (export "a-tag-exp" (tag $a-tag)) - (start $starter) - (func $"kitchen()sinker" (type $0) (param $0 i32) (param $1 i64) (param $2 f32) (param $3 f64) (result i32) - (local $4 i32) - (block $the-body (result i32) - (block $the-nothing - (drop - (block $the-value (result i32) - (drop - (i32.clz - (i32.const -10) - ) - ) - (drop - (i64.ctz - (i64.const -22) - ) - ) - (drop - (i32.popcnt - (i32.const -10) - ) - ) - (drop - (f32.neg - (f32.const -33.61199951171875) - ) - ) - (drop - (f64.abs - (f64.const -9005.841) - ) - ) - (drop - (f32.ceil - (f32.const -33.61199951171875) - ) - ) - (drop - (f64.floor - (f64.const -9005.841) - ) - ) - (drop - (f32.trunc - (f32.const -33.61199951171875) - ) - ) - (drop - (f32.nearest - (f32.const -33.61199951171875) - ) - ) - (drop - (f64.sqrt - (f64.const -9005.841) - ) - ) - (drop - (i32.eqz - (i32.const -10) - ) - ) - (drop - (i64.extend_i32_s - (i32.const -10) - ) - ) - (drop - (i64.extend_i32_u - (i32.const -10) - ) - ) - (drop - (i32.wrap_i64 - (i64.const -22) - ) - ) - (drop - (i32.trunc_f32_s - (f32.const -33.61199951171875) - ) - ) - (drop - (i64.trunc_f32_s - (f32.const -33.61199951171875) - ) - ) - (drop - (i32.trunc_f32_u - (f32.const -33.61199951171875) - ) - ) - (drop - (i64.trunc_f32_u - (f32.const -33.61199951171875) - ) - ) - (drop - (i32.trunc_f64_s - (f64.const -9005.841) - ) - ) - (drop - (i64.trunc_f64_s - (f64.const -9005.841) - ) - ) - (drop - (i32.trunc_f64_u - (f64.const -9005.841) - ) - ) - (drop - (i64.trunc_f64_u - (f64.const -9005.841) - ) - ) - (drop - (i32.trunc_sat_f32_s - (f32.const -33.61199951171875) - ) - ) - (drop - (i64.trunc_sat_f32_s - (f32.const -33.61199951171875) - ) - ) - (drop - (i32.trunc_sat_f32_u - (f32.const -33.61199951171875) - ) - ) - (drop - (i64.trunc_sat_f32_u - (f32.const -33.61199951171875) - ) - ) - (drop - (i32.trunc_sat_f64_s - (f64.const -9005.841) - ) - ) - (drop - (i64.trunc_sat_f64_s - (f64.const -9005.841) - ) - ) - (drop - (i32.trunc_sat_f64_u - (f64.const -9005.841) - ) - ) - (drop - (i64.trunc_sat_f64_u - (f64.const -9005.841) - ) - ) - (drop - (i32.reinterpret_f32 - (f32.const -33.61199951171875) - ) - ) - (drop - (i64.reinterpret_f64 - (f64.const -9005.841) - ) - ) - (drop - (f32.convert_i32_s - (i32.const -10) - ) - ) - (drop - (f64.convert_i32_s - (i32.const -10) - ) - ) - (drop - (f32.convert_i32_u - (i32.const -10) - ) - ) - (drop - (f64.convert_i32_u - (i32.const -10) - ) - ) - (drop - (f32.convert_i64_s - (i64.const -22) - ) - ) - (drop - (f64.convert_i64_s - (i64.const -22) - ) - ) - (drop - (f32.convert_i64_u - (i64.const -22) - ) - ) - (drop - (f64.convert_i64_u - (i64.const -22) - ) - ) - (drop - (f64.promote_f32 - (f32.const -33.61199951171875) - ) - ) - (drop - (f32.demote_f64 - (f64.const -9005.841) - ) - ) - (drop - (f32.reinterpret_i32 - (i32.const -10) - ) - ) - (drop - (f64.reinterpret_i64 - (i64.const -22) - ) - ) - (drop - (i8x16.splat - (i32.const 42) - ) - ) - (drop - (i16x8.splat - (i32.const 42) - ) - ) - (drop - (i32x4.splat - (i32.const 42) - ) - ) - (drop - (i64x2.splat - (i64.const 1958505087099) - ) - ) - (drop - (f32x4.splat - (f32.const 42) - ) - ) - (drop - (f64x2.splat - (f64.const 42) - ) - ) - (drop - (v128.not - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (v128.any_true - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.popcnt - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.abs - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.neg - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.all_true - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.bitmask - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.abs - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.neg - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.all_true - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.bitmask - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.extadd_pairwise_i8x16_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.extadd_pairwise_i8x16_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.abs - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.neg - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.all_true - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.bitmask - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.extadd_pairwise_i16x8_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.extadd_pairwise_i16x8_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.abs - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.neg - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.all_true - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.bitmask - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.abs - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.neg - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.sqrt - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.abs - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.neg - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.sqrt - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.convert_low_i32x4_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.convert_low_i32x4_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.promote_low_f32x4 - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.trunc_sat_f32x4_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.trunc_sat_f32x4_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.convert_i32x4_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.convert_i32x4_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.demote_f64x2_zero - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.extend_low_i8x16_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.extend_high_i8x16_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.extend_low_i8x16_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.extend_high_i8x16_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.extend_low_i16x8_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.extend_high_i16x8_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.extend_low_i16x8_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.extend_high_i16x8_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.trunc_sat_f64x2_s_zero - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.trunc_sat_f64x2_u_zero - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.extend_low_i32x4_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.extend_high_i32x4_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.extend_low_i32x4_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.extend_high_i32x4_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32.add - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (f64.sub - (f64.const -9005.841) - (f64.const -9007.333) - ) - ) - (drop - (i32.div_s - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i64.div_u - (i64.const 4294967274) - (i64.const 4294967273) - ) - ) - (drop - (i64.rem_s - (i64.const 4294967274) - (i64.const 4294967273) - ) - ) - (drop - (i32.rem_u - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i32.and - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i64.or - (i64.const 4294967274) - (i64.const 4294967273) - ) - ) - (drop - (i32.xor - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i64.shl - (i64.const 4294967274) - (i64.const 4294967273) - ) - ) - (drop - (i64.shr_u - (i64.const 4294967274) - (i64.const 4294967273) - ) - ) - (drop - (i32.shr_s - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i32.rotl - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i64.rotr - (i64.const 4294967274) - (i64.const 4294967273) - ) - ) - (drop - (f32.div - (f32.const -33.61199951171875) - (f32.const -62.5) - ) - ) - (drop - (f64.copysign - (f64.const -9005.841) - (f64.const -9007.333) - ) - ) - (drop - (f32.min - (f32.const -33.61199951171875) - (f32.const -62.5) - ) - ) - (drop - (f64.max - (f64.const -9005.841) - (f64.const -9007.333) - ) - ) - (drop - (i32.eq - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (f32.ne - (f32.const -33.61199951171875) - (f32.const -62.5) - ) - ) - (drop - (i32.lt_s - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i64.lt_u - (i64.const 4294967274) - (i64.const 4294967273) - ) - ) - (drop - (i64.le_s - (i64.const 4294967274) - (i64.const 4294967273) - ) - ) - (drop - (i32.le_u - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i64.gt_s - (i64.const 4294967274) - (i64.const 4294967273) - ) - ) - (drop - (i32.gt_u - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i32.ge_s - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i64.ge_u - (i64.const 4294967274) - (i64.const 4294967273) - ) - ) - (drop - (f32.lt - (f32.const -33.61199951171875) - (f32.const -62.5) - ) - ) - (drop - (f64.le - (f64.const -9005.841) - (f64.const -9007.333) - ) - ) - (drop - (f64.gt - (f64.const -9005.841) - (f64.const -9007.333) - ) - ) - (drop - (f32.ge - (f32.const -33.61199951171875) - (f32.const -62.5) - ) - ) - (drop - (i8x16.eq - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.ne - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.lt_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.lt_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.gt_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.gt_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.le_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.le_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.ge_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.ge_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.eq - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.ne - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.lt_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.lt_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.gt_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.gt_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.le_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.le_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.ge_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.ge_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.eq - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.ne - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.lt_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.lt_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.gt_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.gt_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.le_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.le_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.ge_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.ge_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.eq - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.ne - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.lt_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.gt_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.le_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.ge_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.eq - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.ne - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.lt - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.gt - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.le - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.ge - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.eq - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.ne - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.lt - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.gt - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.le - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.ge - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (v128.and - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (v128.or - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (v128.xor - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (v128.andnot - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.add - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.add_sat_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.add_sat_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.sub - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.sub_sat_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.sub_sat_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.min_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.min_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.max_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.max_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.avgr_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.add - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.add_sat_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.add_sat_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.sub - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.sub_sat_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.sub_sat_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.mul - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.min_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.min_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.max_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.max_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.avgr_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.q15mulr_sat_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.extmul_low_i8x16_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.extmul_high_i8x16_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.extmul_low_i8x16_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.extmul_high_i8x16_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.add - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.sub - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.mul - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.min_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.min_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.max_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.max_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.dot_i16x8_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.extmul_low_i16x8_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.extmul_high_i16x8_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.extmul_low_i16x8_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.extmul_high_i16x8_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.add - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.sub - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.mul - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.extmul_low_i32x4_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.extmul_high_i32x4_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.extmul_low_i32x4_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.extmul_high_i32x4_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.add - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.sub - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.mul - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.div - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.min - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.max - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.pmin - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.pmax - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.ceil - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.floor - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.trunc - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.nearest - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.add - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.sub - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.mul - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.div - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.min - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.max - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.pmin - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.pmax - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.ceil - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.floor - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.trunc - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.nearest - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.narrow_i16x8_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.narrow_i16x8_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.narrow_i32x4_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.narrow_i32x4_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.swizzle - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.extract_lane_s 1 - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.extract_lane_u 1 - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.extract_lane_s 1 - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.extract_lane_u 1 - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.extract_lane 1 - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.extract_lane 1 - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.extract_lane 1 - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.extract_lane 1 - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.replace_lane 1 - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (i32.const 42) - ) - ) - (drop - (i8x16.replace_lane 1 - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (i32.const 42) - ) - ) - (drop - (i32x4.replace_lane 1 - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (i32.const 42) - ) - ) - (drop - (i64x2.replace_lane 1 - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (i64.const 184683593770) - ) - ) - (drop - (f32x4.replace_lane 1 - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (f32.const 42) - ) - ) - (drop - (f64x2.replace_lane 1 - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (f64.const 42) - ) - ) - (drop - (i8x16.shl - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (i32.const 1) - ) - ) - (drop - (i8x16.shr_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (i32.const 1) - ) - ) - (drop - (i8x16.shr_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (i32.const 1) - ) - ) - (drop - (i16x8.shl - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (i32.const 1) - ) - ) - (drop - (i16x8.shr_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (i32.const 1) - ) - ) - (drop - (i16x8.shr_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (i32.const 1) - ) - ) - (drop - (i32x4.shl - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (i32.const 1) - ) - ) - (drop - (i32x4.shr_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (i32.const 1) - ) - ) - (drop - (i32x4.shr_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (i32.const 1) - ) - ) - (drop - (i64x2.shl - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (i32.const 1) - ) - ) - (drop - (i64x2.shr_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (i32.const 1) - ) - ) - (drop - (i64x2.shr_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (i32.const 1) - ) - ) - (drop - (v128.load8_splat - (i32.const 128) - ) - ) - (drop - (v128.load16_splat offset=16 align=1 - (i32.const 128) - ) - ) - (drop - (v128.load32_splat offset=16 - (i32.const 128) - ) - ) - (drop - (v128.load64_splat align=4 - (i32.const 128) - ) - ) - (drop - (v128.load8x8_s - (i32.const 128) - ) - ) - (drop - (v128.load8x8_u - (i32.const 128) - ) - ) - (drop - (v128.load16x4_s - (i32.const 128) - ) - ) - (drop - (v128.load16x4_u - (i32.const 128) - ) - ) - (drop - (v128.load32x2_s - (i32.const 128) - ) - ) - (drop - (v128.load32x2_u - (i32.const 128) - ) - ) - (drop - (v128.load32_zero - (i32.const 128) - ) - ) - (drop - (v128.load64_zero - (i32.const 128) - ) - ) - (drop - (v128.load8_lane 0 - (i32.const 128) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (v128.load8_lane offset=1 15 - (i32.const 128) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (v128.load16_lane 0 - (i32.const 128) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (v128.load16_lane offset=2 align=1 7 - (i32.const 128) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (v128.load32_lane 0 - (i32.const 128) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (v128.load32_lane offset=4 align=2 3 - (i32.const 128) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (v128.load64_lane 0 - (i32.const 128) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (v128.load64_lane offset=8 align=4 1 - (i32.const 128) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (v128.store8_lane 0 - (i32.const 128) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - (v128.store8_lane offset=1 15 - (i32.const 128) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - (v128.store16_lane 0 - (i32.const 128) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - (v128.store16_lane offset=2 align=1 7 - (i32.const 128) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - (v128.store32_lane 0 - (i32.const 128) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - (v128.store32_lane offset=4 align=2 3 - (i32.const 128) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - (v128.store64_lane 0 - (i32.const 128) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - (v128.store64_lane offset=8 align=4 1 - (i32.const 128) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - (drop - (i8x16.shuffle 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (v128.bitselect - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (memory.init $0 - (i32.const 1024) - (i32.const 0) - (i32.const 12) - ) - (data.drop $0) - (memory.copy - (i32.const 2048) - (i32.const 1024) - (i32.const 12) - ) - (memory.fill - (i32.const 0) - (i32.const 42) - (i32.const 1024) - ) - (block - ) - (if - (i32.const 1) - (then - (drop - (i32.const 2) - ) - ) - (else - (drop - (i32.const 3) - ) - ) - ) - (if - (i32.const 4) - (then - (drop - (i32.const 5) - ) - ) - ) - (drop - (loop $in (result i32) - (i32.const 0) - ) - ) - (drop - (loop (result i32) - (i32.const 0) - ) - ) - (drop - (br_if $the-value - (i32.const 1) - (i32.const 0) - ) - ) - (br_if $the-nothing - (i32.const 2) - ) - (br $the-value - (i32.const 3) - ) - (br $the-nothing) - (br_table $the-value $the-value - (i32.const 1) - (i32.const 0) - ) - (br_table $the-nothing $the-nothing - (i32.const 2) - ) - (drop - (i32.eqz - (call $"kitchen()sinker" - (i32.const 13) - (i64.const 37) - (f32.const 1.2999999523162842) - (f64.const 3.7) - ) - ) - ) - (drop - (i32.eqz - (i32.trunc_f32_s - (call $an-imported - (i32.const 13) - (f64.const 3.7) - ) - ) - ) - ) - (drop - (i32.eqz - (call_indirect $t0 (type $0) - (i32.const 13) - (i64.const 37) - (f32.const 1.2999999523162842) - (f64.const 3.7) - (i32.const 2449) - ) - ) - ) - (drop - (local.get $0) - ) - (local.set $0 - (i32.const 101) - ) - (drop - (local.tee $0 - (i32.const 102) - ) - ) - (drop - (i32.load - (i32.const 1) - ) - ) - (drop - (i64.load16_s offset=2 align=1 - (i32.const 8) - ) - ) - (drop - (f32.load - (i32.const 2) - ) - ) - (drop - (f64.load offset=2 - (i32.const 9) - ) - ) - (i32.store - (i32.const 10) - (i32.const 11) - ) - (i64.store offset=2 align=4 - (i32.const 110) - (i64.const 111) - ) - (drop - (select - (i32.const 3) - (i32.const 5) - (i32.const 1) - ) - ) - (return - (i32.const 1337) - ) - (return_call $"kitchen()sinker" - (i32.const 13) - (i64.const 37) - (f32.const 1.2999999523162842) - (f64.const 3.7) - ) - (return_call_indirect $t0 (type $0) - (i32.const 13) - (i64.const 37) - (f32.const 1.2999999523162842) - (f64.const 3.7) - (i32.const 2449) - ) - (drop - (ref.is_null - (ref.null noextern) - ) - ) - (drop - (ref.is_null - (ref.null nofunc) - ) - ) - (drop - (ref.is_null - (ref.func $"kitchen()sinker") - ) - ) - (drop - (select (result funcref) - (ref.null nofunc) - (ref.func $"kitchen()sinker") - (i32.const 1) - ) - ) - (drop - (ref.eq - (ref.null none) - (ref.null none) - ) - ) - (try - (do - (throw $a-tag - (i32.const 0) - ) - ) - (catch $a-tag - (drop - (pop i32) - ) - ) - ) - (i32.atomic.store - (i32.const 0) - (i32.atomic.load - (i32.const 0) - ) - ) - (drop - (memory.atomic.wait32 - (i32.const 0) - (i32.const 0) - (i64.const 0) - ) - ) - (drop - (memory.atomic.notify - (i32.const 0) - (i32.const 0) - ) - ) - (atomic.fence) - (tuple.drop 4 - (tuple.make 4 - (i32.const 13) - (i64.const 37) - (f32.const 1.2999999523162842) - (f64.const 3.7) - ) - ) - (drop - (tuple.extract 4 2 - (tuple.make 4 - (i32.const 13) - (i64.const 37) - (f32.const 1.2999999523162842) - (f64.const 3.7) - ) - ) - ) - (drop - (pop i32) - ) - (drop - (pop i64) - ) - (drop - (pop f32) - ) - (drop - (pop f64) - ) - (drop - (pop v128) - ) - (drop - (pop funcref) - ) - (drop - (pop externref) - ) - (drop - (pop anyref) - ) - (drop - (pop eqref) - ) - (drop - (pop i31ref) - ) - (drop - (pop structref) - ) - (drop - (pop stringref) - ) - (drop - (pop stringview_wtf8) - ) - (drop - (pop stringview_wtf16) - ) - (drop - (pop stringview_iter) - ) - (drop - (memory.size) - ) - (drop - (memory.grow - (i32.const 0) - ) - ) - (drop - (ref.i31 - (i32.const 0) - ) - ) - (drop - (i31.get_s - (ref.i31 - (i32.const 1) - ) - ) - ) - (drop - (i31.get_u - (ref.i31 - (i32.const 2) - ) - ) - ) - (nop) - (unreachable) - ) - ) - ) - (i32.const 42) - ) - ) - (func $starter (type $3) - (nop) - ) -) - -(module - (type $0 (func (param i32 i64 f32 f64) (result i32))) - (type $1 (func (param i32))) - (type $2 (func (param i32 f64) (result f32))) - (type $3 (func)) - (import "module" "base" (global $a-global-imp i32)) - (import "module" "base" (global $a-mut-global-imp (mut i32))) - (import "module" "base" (func $an-imported (type $2) (param i32 f64) (result f32))) - (import "module" "base" (tag $a-tag-imp (param i32))) - (global $a-global i32 (i32.const 1)) - (memory $0 1 256 shared) - (data $0 (i32.const 10) "hello, world") - (data $1 "I am passive") - (table $t0 1 funcref) - (elem $e0 (i32.const 0) $"kitchen()sinker") - (tag $a-tag (param i32)) - (export "mem" (memory $0)) - (export "kitchen_sinker" (func $"kitchen()sinker")) - (export "a-global-exp" (global $a-global)) - (export "a-tag-exp" (tag $a-tag)) - (start $starter) - (func $"kitchen()sinker" (type $0) (param $0 i32) (param $1 i64) (param $2 f32) (param $3 f64) (result i32) - (local $4 i32) - (block $the-body (result i32) - (block $the-nothing - (drop - (block $the-value (result i32) - (drop - (i32.clz - (i32.const -10) - ) - ) - (drop - (i64.ctz - (i64.const -22) - ) - ) - (drop - (i32.popcnt - (i32.const -10) - ) - ) - (drop - (f32.neg - (f32.const -33.61199951171875) - ) - ) - (drop - (f64.abs - (f64.const -9005.841) - ) - ) - (drop - (f32.ceil - (f32.const -33.61199951171875) - ) - ) - (drop - (f64.floor - (f64.const -9005.841) - ) - ) - (drop - (f32.trunc - (f32.const -33.61199951171875) - ) - ) - (drop - (f32.nearest - (f32.const -33.61199951171875) - ) - ) - (drop - (f64.sqrt - (f64.const -9005.841) - ) - ) - (drop - (i32.eqz - (i32.const -10) - ) - ) - (drop - (i64.extend_i32_s - (i32.const -10) - ) - ) - (drop - (i64.extend_i32_u - (i32.const -10) - ) - ) - (drop - (i32.wrap_i64 - (i64.const -22) - ) - ) - (drop - (i32.trunc_f32_s - (f32.const -33.61199951171875) - ) - ) - (drop - (i64.trunc_f32_s - (f32.const -33.61199951171875) - ) - ) - (drop - (i32.trunc_f32_u - (f32.const -33.61199951171875) - ) - ) - (drop - (i64.trunc_f32_u - (f32.const -33.61199951171875) - ) - ) - (drop - (i32.trunc_f64_s - (f64.const -9005.841) - ) - ) - (drop - (i64.trunc_f64_s - (f64.const -9005.841) - ) - ) - (drop - (i32.trunc_f64_u - (f64.const -9005.841) - ) - ) - (drop - (i64.trunc_f64_u - (f64.const -9005.841) - ) - ) - (drop - (i32.trunc_sat_f32_s - (f32.const -33.61199951171875) - ) - ) - (drop - (i64.trunc_sat_f32_s - (f32.const -33.61199951171875) - ) - ) - (drop - (i32.trunc_sat_f32_u - (f32.const -33.61199951171875) - ) - ) - (drop - (i64.trunc_sat_f32_u - (f32.const -33.61199951171875) - ) - ) - (drop - (i32.trunc_sat_f64_s - (f64.const -9005.841) - ) - ) - (drop - (i64.trunc_sat_f64_s - (f64.const -9005.841) - ) - ) - (drop - (i32.trunc_sat_f64_u - (f64.const -9005.841) - ) - ) - (drop - (i64.trunc_sat_f64_u - (f64.const -9005.841) - ) - ) - (drop - (i32.reinterpret_f32 - (f32.const -33.61199951171875) - ) - ) - (drop - (i64.reinterpret_f64 - (f64.const -9005.841) - ) - ) - (drop - (f32.convert_i32_s - (i32.const -10) - ) - ) - (drop - (f64.convert_i32_s - (i32.const -10) - ) - ) - (drop - (f32.convert_i32_u - (i32.const -10) - ) - ) - (drop - (f64.convert_i32_u - (i32.const -10) - ) - ) - (drop - (f32.convert_i64_s - (i64.const -22) - ) - ) - (drop - (f64.convert_i64_s - (i64.const -22) - ) - ) - (drop - (f32.convert_i64_u - (i64.const -22) - ) - ) - (drop - (f64.convert_i64_u - (i64.const -22) - ) - ) - (drop - (f64.promote_f32 - (f32.const -33.61199951171875) - ) - ) - (drop - (f32.demote_f64 - (f64.const -9005.841) - ) - ) - (drop - (f32.reinterpret_i32 - (i32.const -10) - ) - ) - (drop - (f64.reinterpret_i64 - (i64.const -22) - ) - ) - (drop - (i8x16.splat - (i32.const 42) - ) - ) - (drop - (i16x8.splat - (i32.const 42) - ) - ) - (drop - (i32x4.splat - (i32.const 42) - ) - ) - (drop - (i64x2.splat - (i64.const 1958505087099) - ) - ) - (drop - (f32x4.splat - (f32.const 42) - ) - ) - (drop - (f64x2.splat - (f64.const 42) - ) - ) - (drop - (v128.not - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (v128.any_true - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.popcnt - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.abs - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.neg - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.all_true - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.bitmask - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.abs - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.neg - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.all_true - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.bitmask - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.extadd_pairwise_i8x16_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.extadd_pairwise_i8x16_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.abs - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.neg - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.all_true - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.bitmask - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.extadd_pairwise_i16x8_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.extadd_pairwise_i16x8_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.abs - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.neg - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.all_true - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.bitmask - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.abs - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.neg - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.sqrt - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.abs - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.neg - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.sqrt - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.convert_low_i32x4_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.convert_low_i32x4_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.promote_low_f32x4 - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.trunc_sat_f32x4_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.trunc_sat_f32x4_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.convert_i32x4_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.convert_i32x4_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.demote_f64x2_zero - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.extend_low_i8x16_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.extend_high_i8x16_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.extend_low_i8x16_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.extend_high_i8x16_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.extend_low_i16x8_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.extend_high_i16x8_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.extend_low_i16x8_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.extend_high_i16x8_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.trunc_sat_f64x2_s_zero - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.trunc_sat_f64x2_u_zero - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.extend_low_i32x4_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.extend_high_i32x4_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.extend_low_i32x4_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.extend_high_i32x4_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32.add - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (f64.sub - (f64.const -9005.841) - (f64.const -9007.333) - ) - ) - (drop - (i32.div_s - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i64.div_u - (i64.const 4294967274) - (i64.const 4294967273) - ) - ) - (drop - (i64.rem_s - (i64.const 4294967274) - (i64.const 4294967273) - ) - ) - (drop - (i32.rem_u - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i32.and - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i64.or - (i64.const 4294967274) - (i64.const 4294967273) - ) - ) - (drop - (i32.xor - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i64.shl - (i64.const 4294967274) - (i64.const 4294967273) - ) - ) - (drop - (i64.shr_u - (i64.const 4294967274) - (i64.const 4294967273) - ) - ) - (drop - (i32.shr_s - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i32.rotl - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i64.rotr - (i64.const 4294967274) - (i64.const 4294967273) - ) - ) - (drop - (f32.div - (f32.const -33.61199951171875) - (f32.const -62.5) - ) - ) - (drop - (f64.copysign - (f64.const -9005.841) - (f64.const -9007.333) - ) - ) - (drop - (f32.min - (f32.const -33.61199951171875) - (f32.const -62.5) - ) - ) - (drop - (f64.max - (f64.const -9005.841) - (f64.const -9007.333) - ) - ) - (drop - (i32.eq - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (f32.ne - (f32.const -33.61199951171875) - (f32.const -62.5) - ) - ) - (drop - (i32.lt_s - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i64.lt_u - (i64.const 4294967274) - (i64.const 4294967273) - ) - ) - (drop - (i64.le_s - (i64.const 4294967274) - (i64.const 4294967273) - ) - ) - (drop - (i32.le_u - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i64.gt_s - (i64.const 4294967274) - (i64.const 4294967273) - ) - ) - (drop - (i32.gt_u - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i32.ge_s - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i64.ge_u - (i64.const 4294967274) - (i64.const 4294967273) - ) - ) - (drop - (f32.lt - (f32.const -33.61199951171875) - (f32.const -62.5) - ) - ) - (drop - (f64.le - (f64.const -9005.841) - (f64.const -9007.333) - ) - ) - (drop - (f64.gt - (f64.const -9005.841) - (f64.const -9007.333) - ) - ) - (drop - (f32.ge - (f32.const -33.61199951171875) - (f32.const -62.5) - ) - ) - (drop - (i8x16.eq - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.ne - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.lt_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.lt_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.gt_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.gt_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.le_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.le_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.ge_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.ge_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.eq - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.ne - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.lt_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.lt_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.gt_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.gt_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.le_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.le_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.ge_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.ge_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.eq - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.ne - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.lt_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.lt_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.gt_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.gt_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.le_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.le_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.ge_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.ge_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.eq - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.ne - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.lt_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.gt_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.le_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.ge_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.eq - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.ne - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.lt - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.gt - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.le - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.ge - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.eq - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.ne - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.lt - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.gt - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.le - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.ge - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (v128.and - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (v128.or - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (v128.xor - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (v128.andnot - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.add - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.add_sat_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.add_sat_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.sub - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.sub_sat_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.sub_sat_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.min_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.min_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.max_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.max_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.avgr_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.add - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.add_sat_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.add_sat_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.sub - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.sub_sat_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.sub_sat_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.mul - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.min_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.min_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.max_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.max_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.avgr_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.q15mulr_sat_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.extmul_low_i8x16_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.extmul_high_i8x16_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.extmul_low_i8x16_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.extmul_high_i8x16_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.add - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.sub - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.mul - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.min_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.min_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.max_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.max_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.dot_i16x8_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.extmul_low_i16x8_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.extmul_high_i16x8_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.extmul_low_i16x8_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.extmul_high_i16x8_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.add - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.sub - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.mul - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.extmul_low_i32x4_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.extmul_high_i32x4_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.extmul_low_i32x4_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.extmul_high_i32x4_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.add - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.sub - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.mul - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.div - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.min - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.max - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.pmin - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.pmax - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.ceil - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.floor - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.trunc - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.nearest - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.add - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.sub - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.mul - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.div - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.min - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.max - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.pmin - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.pmax - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.ceil - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.floor - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.trunc - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.nearest - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.narrow_i16x8_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.narrow_i16x8_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.narrow_i32x4_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.narrow_i32x4_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.swizzle - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.extract_lane_s 1 - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i8x16.extract_lane_u 1 - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.extract_lane_s 1 - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.extract_lane_u 1 - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i32x4.extract_lane 1 - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i64x2.extract_lane 1 - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f32x4.extract_lane 1 - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (f64x2.extract_lane 1 - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (i16x8.replace_lane 1 - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (i32.const 42) - ) - ) - (drop - (i8x16.replace_lane 1 - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (i32.const 42) - ) - ) - (drop - (i32x4.replace_lane 1 - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (i32.const 42) - ) - ) - (drop - (i64x2.replace_lane 1 - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (i64.const 184683593770) - ) - ) - (drop - (f32x4.replace_lane 1 - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (f32.const 42) - ) - ) - (drop - (f64x2.replace_lane 1 - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (f64.const 42) - ) - ) - (drop - (i8x16.shl - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (i32.const 1) - ) - ) - (drop - (i8x16.shr_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (i32.const 1) - ) - ) - (drop - (i8x16.shr_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (i32.const 1) - ) - ) - (drop - (i16x8.shl - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (i32.const 1) - ) - ) - (drop - (i16x8.shr_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (i32.const 1) - ) - ) - (drop - (i16x8.shr_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (i32.const 1) - ) - ) - (drop - (i32x4.shl - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (i32.const 1) - ) - ) - (drop - (i32x4.shr_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (i32.const 1) - ) - ) - (drop - (i32x4.shr_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (i32.const 1) - ) - ) - (drop - (i64x2.shl - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (i32.const 1) - ) - ) - (drop - (i64x2.shr_s - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (i32.const 1) - ) - ) - (drop - (i64x2.shr_u - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (i32.const 1) - ) - ) - (drop - (v128.load8_splat - (i32.const 128) - ) - ) - (drop - (v128.load16_splat offset=16 align=1 - (i32.const 128) - ) - ) - (drop - (v128.load32_splat offset=16 - (i32.const 128) - ) - ) - (drop - (v128.load64_splat align=4 - (i32.const 128) - ) - ) - (drop - (v128.load8x8_s - (i32.const 128) - ) - ) - (drop - (v128.load8x8_u - (i32.const 128) - ) - ) - (drop - (v128.load16x4_s - (i32.const 128) - ) - ) - (drop - (v128.load16x4_u - (i32.const 128) - ) - ) - (drop - (v128.load32x2_s - (i32.const 128) - ) - ) - (drop - (v128.load32x2_u - (i32.const 128) - ) - ) - (drop - (v128.load32_zero - (i32.const 128) - ) - ) - (drop - (v128.load64_zero - (i32.const 128) - ) - ) - (drop - (v128.load8_lane 0 - (i32.const 128) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (v128.load8_lane offset=1 15 - (i32.const 128) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (v128.load16_lane 0 - (i32.const 128) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (v128.load16_lane offset=2 align=1 7 - (i32.const 128) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (v128.load32_lane 0 - (i32.const 128) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (v128.load32_lane offset=4 align=2 3 - (i32.const 128) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (v128.load64_lane 0 - (i32.const 128) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (v128.load64_lane offset=8 align=4 1 - (i32.const 128) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (v128.store8_lane 0 - (i32.const 128) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - (v128.store8_lane offset=1 15 - (i32.const 128) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - (v128.store16_lane 0 - (i32.const 128) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - (v128.store16_lane offset=2 align=1 7 - (i32.const 128) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - (v128.store32_lane 0 - (i32.const 128) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - (v128.store32_lane offset=4 align=2 3 - (i32.const 128) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - (v128.store64_lane 0 - (i32.const 128) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - (v128.store64_lane offset=8 align=4 1 - (i32.const 128) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - (drop - (i8x16.shuffle 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (drop - (v128.bitselect - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) - ) - ) - (memory.init $0 - (i32.const 1024) - (i32.const 0) - (i32.const 12) - ) - (data.drop $0) - (memory.copy - (i32.const 2048) - (i32.const 1024) - (i32.const 12) - ) - (memory.fill - (i32.const 0) - (i32.const 42) - (i32.const 1024) - ) - (block - ) - (if - (i32.const 1) - (then - (drop - (i32.const 2) - ) - ) - (else - (drop - (i32.const 3) - ) - ) - ) - (if - (i32.const 4) - (then - (drop - (i32.const 5) - ) - ) - ) - (drop - (loop $in (result i32) - (i32.const 0) - ) - ) - (drop - (loop (result i32) - (i32.const 0) - ) - ) - (drop - (br_if $the-value - (i32.const 1) - (i32.const 0) - ) - ) - (br_if $the-nothing - (i32.const 2) - ) - (br $the-value - (i32.const 3) - ) - (br $the-nothing) - (br_table $the-value $the-value - (i32.const 1) - (i32.const 0) - ) - (br_table $the-nothing $the-nothing - (i32.const 2) - ) - (drop - (i32.eqz - (call $"kitchen()sinker" - (i32.const 13) - (i64.const 37) - (f32.const 1.2999999523162842) - (f64.const 3.7) - ) - ) - ) - (drop - (i32.eqz - (i32.trunc_f32_s - (call $an-imported - (i32.const 13) - (f64.const 3.7) - ) - ) - ) - ) - (drop - (i32.eqz - (call_indirect $t0 (type $0) - (i32.const 13) - (i64.const 37) - (f32.const 1.2999999523162842) - (f64.const 3.7) - (i32.const 2449) - ) - ) - ) - (drop - (local.get $0) - ) - (local.set $0 - (i32.const 101) - ) - (drop - (local.tee $0 - (i32.const 102) - ) - ) - (drop - (i32.load - (i32.const 1) - ) - ) - (drop - (i64.load16_s offset=2 align=1 - (i32.const 8) - ) - ) - (drop - (f32.load - (i32.const 2) - ) - ) - (drop - (f64.load offset=2 - (i32.const 9) - ) - ) - (i32.store - (i32.const 10) - (i32.const 11) - ) - (i64.store offset=2 align=4 - (i32.const 110) - (i64.const 111) - ) - (drop - (select - (i32.const 3) - (i32.const 5) - (i32.const 1) - ) - ) - (return - (i32.const 1337) - ) - (return_call $"kitchen()sinker" - (i32.const 13) - (i64.const 37) - (f32.const 1.2999999523162842) - (f64.const 3.7) - ) - (return_call_indirect $t0 (type $0) - (i32.const 13) - (i64.const 37) - (f32.const 1.2999999523162842) - (f64.const 3.7) - (i32.const 2449) - ) - (drop - (ref.is_null - (ref.null noextern) - ) - ) - (drop - (ref.is_null - (ref.null nofunc) - ) - ) - (drop - (ref.is_null - (ref.func $"kitchen()sinker") - ) - ) - (drop - (select (result funcref) - (ref.null nofunc) - (ref.func $"kitchen()sinker") - (i32.const 1) - ) - ) - (drop - (ref.eq - (ref.null none) - (ref.null none) - ) - ) - (try - (do - (throw $a-tag - (i32.const 0) - ) - ) - (catch $a-tag - (drop - (pop i32) - ) - ) - ) - (i32.atomic.store - (i32.const 0) - (i32.atomic.load - (i32.const 0) - ) - ) - (drop - (memory.atomic.wait32 - (i32.const 0) - (i32.const 0) - (i64.const 0) - ) - ) - (drop - (memory.atomic.notify - (i32.const 0) - (i32.const 0) - ) - ) - (atomic.fence) - (tuple.drop 4 - (tuple.make 4 - (i32.const 13) - (i64.const 37) - (f32.const 1.2999999523162842) - (f64.const 3.7) - ) - ) - (drop - (tuple.extract 4 2 - (tuple.make 4 - (i32.const 13) - (i64.const 37) - (f32.const 1.2999999523162842) - (f64.const 3.7) - ) - ) - ) - (drop - (pop i32) - ) - (drop - (pop i64) - ) - (drop - (pop f32) - ) - (drop - (pop f64) - ) - (drop - (pop v128) - ) - (drop - (pop funcref) - ) - (drop - (pop externref) - ) - (drop - (pop anyref) - ) - (drop - (pop eqref) - ) - (drop - (pop i31ref) - ) - (drop - (pop structref) - ) - (drop - (pop stringref) - ) - (drop - (pop stringview_wtf8) - ) - (drop - (pop stringview_wtf16) - ) - (drop - (pop stringview_iter) - ) - (drop - (memory.size) - ) - (drop - (memory.grow - (i32.const 0) - ) - ) - (drop - (ref.i31 - (i32.const 0) - ) - ) - (drop - (i31.get_s - (ref.i31 - (i32.const 1) - ) - ) - ) - (drop - (i31.get_u - (ref.i31 - (i32.const 2) - ) - ) - ) - (nop) - (unreachable) - ) - ) - ) - (i32.const 42) - ) - ) - (func $starter (type $3) - (nop) - ) -) - -raw: -(module - (type $0 (func)) - (type $1 (func (param i32))) - (type $2 (func (result i32))) - (import "module" "check" (func $check (param i32))) - (func $just-one-block - (local $0 i32) - (call $check - (i32.const 1337) - ) - ) - (func $two-blocks - (local $0 i32) - (block - (call $check - (i32.const 0) - ) - (call $check - (i32.const 1) - ) - ) - ) - (func $two-blocks-plus-code - (local $0 i32) - (block - (block - (call $check - (i32.const 0) - ) - (drop - (i32.const 77) - ) - ) - (call $check - (i32.const 1) - ) - ) - ) - (func $loop - (local $0 i32) - (loop $shape$0$continue - (block - (call $check - (i32.const 0) - ) - (call $check - (i32.const 1) - ) - ) - (block - (br $shape$0$continue) - ) - ) - ) - (func $loop-plus-code - (local $0 i32) - (loop $shape$0$continue - (block - (block - (call $check - (i32.const 0) - ) - (drop - (i32.const 33) - ) - ) - (call $check - (i32.const 1) - ) - ) - (block - (drop - (i32.const -66) - ) - (br $shape$0$continue) - ) - ) - ) - (func $split - (local $0 i32) - (call $check - (i32.const 0) - ) - (if - (i32.const 55) - (then - (block - (call $check - (i32.const 1) - ) - ) - ) - (else - (block - (call $check - (i32.const 2) - ) - ) - ) - ) - ) - (func $split-plus-code - (local $0 i32) - (call $check - (i32.const 0) - ) - (if - (i32.const 55) - (then - (drop - (i32.const 10) - ) - (block - (call $check - (i32.const 1) - ) - ) - ) - (else - (drop - (i32.const 20) - ) - (block - (call $check - (i32.const 2) - ) - ) - ) - ) - ) - (func $if - (local $0 i32) - (block $block$3$break - (call $check - (i32.const 0) - ) - (if - (i32.const 55) - (then - (block - (call $check - (i32.const 1) - ) - (block - (br $block$3$break) - ) - ) - ) - (else - (br $block$3$break) - ) - ) - ) - (block - (call $check - (i32.const 2) - ) - ) - ) - (func $if-plus-code - (local $0 i32) - (block $block$3$break - (call $check - (i32.const 0) - ) - (if - (i32.const 55) - (then - (drop - (i32.const -1) - ) - (block - (call $check - (i32.const 1) - ) - (block - (drop - (i32.const -3) - ) - (br $block$3$break) - ) - ) - ) - (else - (drop - (i32.const -2) - ) - (br $block$3$break) - ) - ) - ) - (block - (call $check - (i32.const 2) - ) - ) - ) - (func $if-else - (local $0 i32) - (block $block$4$break - (call $check - (i32.const 0) - ) - (if - (i32.const 55) - (then - (block - (call $check - (i32.const 1) - ) - (block - (br $block$4$break) - ) - ) - ) - (else - (block - (call $check - (i32.const 2) - ) - (block - (br $block$4$break) - ) - ) - ) - ) - ) - (block - (call $check - (i32.const 3) - ) - ) - ) - (func $loop-tail - (local $0 i32) - (block $block$3$break - (loop $shape$0$continue - (block - (call $check - (i32.const 0) - ) - (call $check - (i32.const 1) - ) - ) - (if - (i32.const 10) - (then - (br $shape$0$continue) - ) - (else - (br $block$3$break) - ) - ) - ) - ) - (block - (call $check - (i32.const 2) - ) - ) - ) - (func $nontrivial-loop-plus-phi-to-head - (local $0 i32) - (block $block$2$break - (call $check - (i32.const 0) - ) - (block - (drop - (i32.const 10) - ) - (br $block$2$break) - ) - ) - (block - (block $block$7$break - (block $block$4$break - (loop $shape$1$continue - (block $block$3$break - (call $check - (i32.const 1) - ) - (if - (i32.const -2) - (then - (br $block$3$break) - ) - (else - (drop - (i32.const 20) - ) - (br $block$7$break) - ) - ) - ) - (block - (call $check - (i32.const 2) - ) - (if - (i32.const -6) - (then - (br $block$4$break) - ) - (else - (drop - (i32.const 30) - ) - (br $shape$1$continue) - ) - ) - ) - ) - ) - (block - (block $block$6$break - (call $check - (i32.const 3) - ) - (if - (i32.const -10) - (then - (block - (call $check - (i32.const 4) - ) - (block - (br $block$6$break) - ) - ) - ) - (else - (br $block$6$break) - ) - ) - ) - (block - (call $check - (i32.const 5) - ) - (block - (drop - (i32.const 40) - ) - (br $block$7$break) - ) - ) - ) - ) - (block - (call $check - (i32.const 6) - ) - ) - ) - ) - (func $switch - (local $0 i32) - (call $check - (i32.const 0) - ) - (block $switch$1$leave - (block $switch$1$default - (block $switch$1$case$3 - (block $switch$1$case$2 - (br_table $switch$1$default $switch$1$default $switch$1$case$2 $switch$1$default $switch$1$case$3 $switch$1$case$2 $switch$1$default - (i32.const -99) - ) - ) - (block - (block - (call $check - (i32.const 1) - ) - ) - ) - (br $switch$1$leave) - ) - (block - (drop - (i32.const 55) - ) - (block - (call $check - (i32.const 2) - ) - ) - ) - (br $switch$1$leave) - ) - (block - (block - (call $check - (i32.const 3) - ) - ) - ) - (br $switch$1$leave) - ) - ) - (func $duffs-device - (local $0 i32) - (local $1 i32) - (local $2 i64) - (local $3 i32) - (local $4 f32) - (local $5 f64) - (local $6 i32) - (block - (block $block$3$break - (block $block$2$break - (call $check - (i32.const 0) - ) - (if - (i32.const 10) - (then - (local.set $3 - (i32.const 2) - ) - (br $block$2$break) - ) - (else - (local.set $3 - (i32.const 3) - ) - (br $block$3$break) - ) - ) - ) - ) - ) - (loop $shape$1$continue - (if - (i32.eq - (local.get $3) - (i32.const 2) - ) - (then - (local.set $3 - (i32.const 0) - ) - (call $check - (i32.const 1) - ) - (block - (local.set $3 - (i32.const 3) - ) - (br $shape$1$continue) - ) - ) - (else - (if - (i32.eq - (local.get $3) - (i32.const 3) - ) - (then - (local.set $3 - (i32.const 0) - ) - (call $check - (i32.const 2) - ) - (block - (local.set $3 - (i32.const 2) - ) - (br $shape$1$continue) - ) - ) - ) - ) - ) - ) - ) - (func $return (result i32) - (local $0 i32) - (block - (call $check - (i32.const 42) - ) - (return - (i32.const 1337) - ) - ) - ) -) - -optimized: -(module -) - -module loaded from binary form: -(module - (type $0 (func (param i32 i32))) - (type $1 (func (param i32 i32) (result i32))) - (global $a-global i32 (i32.const 3)) - (tag $a-tag (param i32 i32)) - (func $adder (type $1) (param $0 i32) (param $1 i32) (result i32) - (i32.add - (local.get $0) - (local.get $1) - ) - ) -) - -(module - (type $0 (func (param i32))) - (type $1 (func)) - (import "spectest" "print" (func $print-i32 (param i32))) - (start $starter) - (func $starter - (call $print-i32 - (i32.const 1234) - ) - ) -) - -1234 : i32 -(module - (type $0 (func)) - (func $func - (local $0 i32) - (local.set $0 - (i64.const 1234) - ) - ) -) - -[wasm-validator error in function func] local.set's value type must be correct, on -(local.set $0 - (i64.const 1234) -) -validation: 0 -test_parsing text: -(module - (type $0 (func (param i32))) - (type $1 (func (param i32 i32) (result i32))) - (global $a-global i32 (i32.const 3)) - (tag $a-tag (param i32)) - (func $adder (type $1) (param $0 i32) (param $1 i32) (result i32) - (i32.add - (local.get $0) - (local.get $1) - ) - ) -) - -module loaded from text form: -(module - (type $0 (func (param i32))) - (type $1 (func (param i32 i32) (result i32))) - (global $a-global i32 (i32.const 3)) - (tag $a-tag (param i32)) - (func $ADD_ER (type $1) (param $0 i32) (param $1 i32) (result i32) - (i32.add - (local.get $0) - (local.get $1) - ) - ) -) - -sizeof Literal: 24 -(module - (type $0 (func)) - (global $a-global i32 (i32.const 125)) - (global $a-global2 i32 (i32.const 2)) - (global $a-global3 i32 (i32.const 3)) - (memory $0 1 256) - (data $0 (i32.const 10) "hello, world") - (data $1 (global.get $a-global) "segment data 2") - (data $2 "hello, passive") - (table $t0 1 funcref) - (elem $e0 (i32.const 0) $fn0 $fn1 $fn2) - (export "export0" (func $fn0)) - (export "export1" (func $fn1)) - (export "export2" (func $fn2)) - (export "mem" (memory $0)) - (func $fn0 - (nop) - ) - (func $fn1 - (nop) - ) - (func $fn2 - (nop) - ) -) - -getExpressionInfo(memory.grow)={"id":21,"type":2,"delta":1} -getExpressionInfo(switch)={"id":5,"type":1,"names":["label"],"defaultName":"label","condition":0,"value":0} diff --git a/test/binaryen.js/low-memory-unused.js b/test/binaryen.js/low-memory-unused.js deleted file mode 100644 index 3413edb37d1..00000000000 --- a/test/binaryen.js/low-memory-unused.js +++ /dev/null @@ -1,38 +0,0 @@ -var wast = ` -(module - (memory $0 1) - (export "test" (func $test)) - (func $test (param $0 i32) (result i32) - (i32.load - (i32.add - (local.get $0) - (i32.const 128) - ) - ) - ) -) -`; - -console.log("=== input wast ===" + wast); - -var module = binaryen.parseText(wast); - -console.log("=== unoptimized ==="); -assert(module.validate()); -console.log(module.emitText()); - -console.log("=== optimized, lowMemoryUnused=" + binaryen.getLowMemoryUnused() + " ==="); -module.optimize(); -assert(module.validate()); -console.log(module.emitText()); - -binaryen.setLowMemoryUnused(true); -assert(binaryen.getLowMemoryUnused()); -console.log(); - -console.log("=== optimized, lowMemoryUnused=" + binaryen.getLowMemoryUnused() + " ==="); -module.optimize(); -assert(module.validate()); -console.log(module.emitText()); - -module.dispose(); diff --git a/test/binaryen.js/low-memory-unused.js.txt b/test/binaryen.js/low-memory-unused.js.txt deleted file mode 100644 index 99c68225904..00000000000 --- a/test/binaryen.js/low-memory-unused.js.txt +++ /dev/null @@ -1,57 +0,0 @@ -=== input wast === -(module - (memory $0 1) - (export "test" (func $test)) - (func $test (param $0 i32) (result i32) - (i32.load - (i32.add - (local.get $0) - (i32.const 128) - ) - ) - ) -) - -=== unoptimized === -(module - (type $0 (func (param i32) (result i32))) - (memory $0 1) - (export "test" (func $test)) - (func $test (param $0 i32) (result i32) - (i32.load - (i32.add - (local.get $0) - (i32.const 128) - ) - ) - ) -) - -=== optimized, lowMemoryUnused=false === -(module - (type $0 (func (param i32) (result i32))) - (memory $0 1) - (export "test" (func $test)) - (func $test (; has Stack IR ;) (param $0 i32) (result i32) - (i32.load - (i32.add - (local.get $0) - (i32.const 128) - ) - ) - ) -) - - -=== optimized, lowMemoryUnused=true === -(module - (type $0 (func (param i32) (result i32))) - (memory $0 1) - (export "test" (func $test)) - (func $test (; has Stack IR ;) (param $0 i32) (result i32) - (i32.load offset=128 - (local.get $0) - ) - ) -) - diff --git a/test/binaryen.js/memory-info.js b/test/binaryen.js/memory-info.js deleted file mode 100644 index 16ec8675319..00000000000 --- a/test/binaryen.js/memory-info.js +++ /dev/null @@ -1,35 +0,0 @@ -var module = new binaryen.Module(); -assert(module.validate()); -console.log(JSON.stringify(module.hasMemory())); - -var initial = 1, maximum = 64; - -// Not shared -module = new binaryen.Module(); -module.setMemory(initial, maximum, ''); -assert(module.validate()); -console.log(JSON.stringify(module.hasMemory())); -console.log(JSON.stringify(module.getMemoryInfo())); - -// Shared -module = new binaryen.Module(); -module.setFeatures(binaryen.Features.MVP | binaryen.Features.Atomics); -module.setMemory(initial, maximum, '', [], true); -assert(module.validate()); -console.log(JSON.stringify(module.hasMemory())); -console.log(JSON.stringify(module.getMemoryInfo())); - -// Imported, not shared -module = new binaryen.Module(); -module.addMemoryImport('my_mem', 'env', 'memory', false); -assert(module.validate()); -console.log(JSON.stringify(module.hasMemory())); -console.log(JSON.stringify(module.getMemoryInfo())); - -// Imported, shared -module = new binaryen.Module(); -module.setFeatures(binaryen.Features.MVP | binaryen.Features.Atomics); -module.addMemoryImport('my_mem', 'env', 'memory', true); -assert(module.validate()); -console.log(JSON.stringify(module.hasMemory())); -console.log(JSON.stringify(module.getMemoryInfo())); diff --git a/test/binaryen.js/memory-info.js.txt b/test/binaryen.js/memory-info.js.txt deleted file mode 100644 index 079b7aba9d3..00000000000 --- a/test/binaryen.js/memory-info.js.txt +++ /dev/null @@ -1,9 +0,0 @@ -false -true -{"module":"","base":"","initial":1,"shared":false,"is64":false,"max":64} -true -{"module":"","base":"","initial":1,"shared":true,"is64":false,"max":64} -true -{"module":"env","base":"memory","initial":0,"shared":false,"is64":false,"max":65536} -true -{"module":"env","base":"memory","initial":0,"shared":true,"is64":false,"max":65536} diff --git a/test/binaryen.js/optimize-levels.js b/test/binaryen.js/optimize-levels.js deleted file mode 100644 index 6d9dbc26286..00000000000 --- a/test/binaryen.js/optimize-levels.js +++ /dev/null @@ -1,61 +0,0 @@ -var wast = ` -(module - (type $i (func (param i32) (result i32))) - (memory $0 0) - (export "test" (func $test)) - (func $test (; 0 ;) (type $i) (param $0 i32) (result i32) - (block (result i32) - (if (result i32) - (local.get $0) - (then (local.get $0)) - (else (i32.const 0)) - ) - ) - ) -) -`; - -console.log("=== input wast ===" + wast); - -function printOptions() { - console.log("optimizeLevel=" + binaryen.getOptimizeLevel()); - console.log("shrinkLevel=" + binaryen.getShrinkLevel()); -} - -// Use defaults (should be equal to -Os below) -var module = binaryen.parseText(wast); - -console.log("=== unoptimized ==="); -assert(module.validate()); -console.log(module.emitText()); - -module.optimize(); -console.log("=== optimized using defaults ==="); -printOptions(); -assert(module.validate()); -console.log(module.emitText()); -module.dispose(); - -// Use -O0 (should remove the block) -module = binaryen.parseText(wast); - -binaryen.setOptimizeLevel(0); -binaryen.setShrinkLevel(0); -module.optimize(); -console.log("=== optimized with -O0 ==="); -printOptions(); -assert(module.validate()); -console.log(module.emitText()); -module.dispose(); - -// Use -Os (should remove the block and convert to a select) -module = binaryen.parseText(wast); - -binaryen.setOptimizeLevel(2); -binaryen.setShrinkLevel(1); -module.optimize(); -console.log("=== optimized with -Os ==="); -printOptions(); -assert(module.validate()); -console.log(module.emitText()); -module.dispose(); diff --git a/test/binaryen.js/optimize-levels.js.txt b/test/binaryen.js/optimize-levels.js.txt deleted file mode 100644 index ed928fbef15..00000000000 --- a/test/binaryen.js/optimize-levels.js.txt +++ /dev/null @@ -1,67 +0,0 @@ -=== input wast === -(module - (type $i (func (param i32) (result i32))) - (memory $0 0) - (export "test" (func $test)) - (func $test (; 0 ;) (type $i) (param $0 i32) (result i32) - (block (result i32) - (if (result i32) - (local.get $0) - (then (local.get $0)) - (else (i32.const 0)) - ) - ) - ) -) - -=== unoptimized === -(module - (type $i (func (param i32) (result i32))) - (memory $0 0) - (export "test" (func $test)) - (func $test (param $0 i32) (result i32) - (if (result i32) - (local.get $0) - (then - (local.get $0) - ) - (else - (i32.const 0) - ) - ) - ) -) - -=== optimized using defaults === -optimizeLevel=2 -shrinkLevel=1 -(module - (type $i (func (param i32) (result i32))) - (export "test" (func $test)) - (func $test (; has Stack IR ;) (param $0 i32) (result i32) - (local.get $0) - ) -) - -=== optimized with -O0 === -optimizeLevel=0 -shrinkLevel=0 -(module - (type $i (func (param i32) (result i32))) - (export "test" (func $test)) - (func $test (param $0 i32) (result i32) - (local.get $0) - ) -) - -=== optimized with -Os === -optimizeLevel=2 -shrinkLevel=1 -(module - (type $i (func (param i32) (result i32))) - (export "test" (func $test)) - (func $test (; has Stack IR ;) (param $0 i32) (result i32) - (local.get $0) - ) -) - diff --git a/test/binaryen.js/pass-arguments.js b/test/binaryen.js/pass-arguments.js deleted file mode 100644 index 2aacf4ab947..00000000000 --- a/test/binaryen.js/pass-arguments.js +++ /dev/null @@ -1,13 +0,0 @@ -assert(binaryen.getPassArgument("theKey") === null); - -binaryen.setPassArgument("theKey", "theValue"); -assert(binaryen.getPassArgument("theKey") === "theValue"); - -binaryen.setPassArgument("theKey", null); -assert(binaryen.getPassArgument("theKey") === null); - -binaryen.setPassArgument("theKey", "theValue2"); -assert(binaryen.getPassArgument("theKey") === "theValue2"); - -binaryen.clearPassArguments(); -assert(binaryen.getPassArgument("theKey") === null); diff --git a/test/binaryen.js/pass-arguments.js.txt b/test/binaryen.js/pass-arguments.js.txt deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/test/binaryen.js/reloc.js b/test/binaryen.js/reloc.js deleted file mode 100644 index 0235ea4136e..00000000000 --- a/test/binaryen.js/reloc.js +++ /dev/null @@ -1,21 +0,0 @@ -var module = new binaryen.Module(); - -// memory with offset - -module.addGlobalImport("memory_base", "env", "memory_base", binaryen.i32, false); -module.setMemory(1, -1, null, [ - { - offset: module.global.get("memory_base", binaryen.i32), - data: "data data".split('').map(function(x) { return x.charCodeAt(0) }) - } -]); - -// table with offset - -var func = module.addFunction("func", binaryen.none, binaryen.none, [], module.nop()); - -module.addGlobalImport("table_base", "env", "table_base", binaryen.i32, false); -module.addTable("0", 1, -1, binaryen.funcref); -module.addActiveElementSegment("0", "0", [ "func", "func" ], module.global.get("table_base", binaryen.i32)); -assert(module.validate()); -console.log(module.emitText()); diff --git a/test/binaryen.js/reloc.js.txt b/test/binaryen.js/reloc.js.txt deleted file mode 100644 index 0aa075841e1..00000000000 --- a/test/binaryen.js/reloc.js.txt +++ /dev/null @@ -1,13 +0,0 @@ -(module - (type $0 (func)) - (import "env" "memory_base" (global $memory_base i32)) - (import "env" "table_base" (global $table_base i32)) - (memory $0 1) - (data $0 (global.get $memory_base) "data data") - (table $0 1 funcref) - (elem $0 (global.get $table_base) $func $func) - (func $func - (nop) - ) -) - diff --git a/test/binaryen.js/sideffects.js b/test/binaryen.js/sideffects.js deleted file mode 100644 index be5414aed4e..00000000000 --- a/test/binaryen.js/sideffects.js +++ /dev/null @@ -1,134 +0,0 @@ -console.log("SideEffects.None=" + binaryen.SideEffects.None); -console.log("SideEffects.Branches=" + binaryen.SideEffects.Branches); -console.log("SideEffects.Calls=" + binaryen.SideEffects.Calls); -console.log("SideEffects.ReadsLocal=" + binaryen.SideEffects.ReadsLocal); -console.log("SideEffects.WritesLocal=" + binaryen.SideEffects.WritesLocal); -console.log("SideEffects.ReadsGlobal=" + binaryen.SideEffects.ReadsGlobal); -console.log("SideEffects.WritesGlobal=" + binaryen.SideEffects.WritesGlobal); -console.log("SideEffects.ReadsMemory=" + binaryen.SideEffects.ReadsMemory); -console.log("SideEffects.WritesMemory=" + binaryen.SideEffects.WritesMemory); -console.log("SideEffects.ReadsTable=" + binaryen.SideEffects.ReadsTable); -console.log("SideEffects.WritesTable=" + binaryen.SideEffects.WritesTable); -console.log("SideEffects.ImplicitTrap=" + binaryen.SideEffects.ImplicitTrap); -console.log("SideEffects.IsAtomic=" + binaryen.SideEffects.IsAtomic); -console.log("SideEffects.Throws=" + binaryen.SideEffects.Throws); -console.log("SideEffects.DanglingPop=" + binaryen.SideEffects.DanglingPop); -console.log("SideEffects.TrapsNeverHappen=" + binaryen.SideEffects.TrapsNeverHappen); -console.log("SideEffects.Any=" + binaryen.SideEffects.Any); - -var module = new binaryen.Module(); -module.setMemory(1, 1, null); -assert( - binaryen.getSideEffects( - module.i32.const(1), - module - ) - == - binaryen.SideEffects.None -); -assert( - binaryen.getSideEffects( - module.br("test"), - module - ) - == - binaryen.SideEffects.Branches -); -assert( - binaryen.getSideEffects( - module.call("test", [], binaryen.i32), - module - ) - == - binaryen.SideEffects.Calls -); -assert( - binaryen.getSideEffects( - module.local.get("test", binaryen.i32), - module - ) - == - binaryen.SideEffects.ReadsLocal -); -assert( - binaryen.getSideEffects( - module.local.set("test", - module.i32.const(1) - ), - module - ) - == - binaryen.SideEffects.WritesLocal -); - -// Add a global for the test, as computing side effects will look for it. -module.addGlobal('test', binaryen.i32, true, module.i32.const(42)); - -assert( - binaryen.getSideEffects( - module.global.get("test", binaryen.i32), - module - ) - == - binaryen.SideEffects.ReadsGlobal -); -assert( - binaryen.getSideEffects( - module.global.set("test", module.i32.const(1)), - module - ) - == - binaryen.SideEffects.WritesGlobal -); -assert( - binaryen.getSideEffects( - module.i32.load(0, 0, - module.i32.const(0) - ), - module - ) - == - binaryen.SideEffects.ReadsMemory | binaryen.SideEffects.ImplicitTrap -); -assert( - binaryen.getSideEffects( - module.i32.store(0, 0, - module.i32.const(0), - module.i32.const(1) - ), - module - ) - == - binaryen.SideEffects.WritesMemory | binaryen.SideEffects.ImplicitTrap -); -assert( - binaryen.getSideEffects( - module.i32.div_s( - module.i32.const(1), - module.i32.const(0) - ), - module - ) - == - binaryen.SideEffects.ImplicitTrap -); - -// If exception handling feature is enabled, calls can throw -module.setFeatures(binaryen.Features.All); -assert( - binaryen.getSideEffects( - module.call("test", [], binaryen.i32), - module - ) - == - binaryen.SideEffects.Calls | binaryen.SideEffects.Throws -); - -assert( - binaryen.getSideEffects( - module.drop(module.i32.pop()), - module - ) - == - binaryen.SideEffects.DanglingPop -); diff --git a/test/binaryen.js/sideffects.js.txt b/test/binaryen.js/sideffects.js.txt deleted file mode 100644 index b582d70bdc0..00000000000 --- a/test/binaryen.js/sideffects.js.txt +++ /dev/null @@ -1,17 +0,0 @@ -SideEffects.None=0 -SideEffects.Branches=1 -SideEffects.Calls=2 -SideEffects.ReadsLocal=4 -SideEffects.WritesLocal=8 -SideEffects.ReadsGlobal=16 -SideEffects.WritesGlobal=32 -SideEffects.ReadsMemory=64 -SideEffects.WritesMemory=128 -SideEffects.ReadsTable=256 -SideEffects.WritesTable=512 -SideEffects.ImplicitTrap=1024 -SideEffects.IsAtomic=2048 -SideEffects.Throws=4096 -SideEffects.DanglingPop=8192 -SideEffects.TrapsNeverHappen=16384 -SideEffects.Any=32767 diff --git a/test/binaryen.js/sieve.js b/test/binaryen.js/sieve.js deleted file mode 100644 index 4ba61a43492..00000000000 --- a/test/binaryen.js/sieve.js +++ /dev/null @@ -1,75 +0,0 @@ -// Create a module to work on -var module = new binaryen.Module(); - -// Set a memory of initially one page, maximum 100 pages -module.setMemory(1, 100); - -var body = module.block( - null, - [ - // if the current memory size is too small, grow it - module.if( - module.i32.lt_u( - module.i32.mul( - module.memory.size(), - module.i32.const(65536) - ), - module.local.get(0, binaryen.i32) - ), - module.drop( - module.memory.grow( - module.i32.sub( - module.i32.div_u( - module.i32.add( - module.local.get(0, binaryen.i32), - module.i32.const(65535) - ), - module.i32.const(65536) - ), - module.memory.size() - ) - ) - ) - ), - // first, clear memory - module.local.set(1, module.i32.const(0)), - module.loop('clear', module.block(null, [ - module.i32.store8(0, 1, - module.local.get(1, binaryen.i32), - module.i32.const(0) - ), - module.local.set(1, module.i32.add( - module.local.get(1, binaryen.i32), - module.i32.const(1) - )), - module.br_if('clear', module.i32.eq( - module.local.get(1, binaryen.i32), - module.local.get(0, binaryen.i32) - )) - ])), - // perform the sieve TODO - // calculate how many primes there are - module.return(module.local.get(0, binaryen.i32)) - ], - binaryen.none -); - -// Create the add function -// Note: no additional local variables (that's the []) -module.addFunction('sieve', binaryen.i32, binaryen.i32, [binaryen.i32], body); - -// Export the function, so we can call it later (for simplicity we -// export it as the same name as it has internally) -module.addFunctionExport('sieve', 'sieve'); - -if (!module.validate()) throw 'did not validate :('; - -// Print out the text -console.log(module.emitText()); - -// Optimize the module! This removes the 'return', since the -// output of the add can just fall through -module.optimize(); - -// Print out the optimized module's text -console.log('optimized:\n\n' + module.emitText()); diff --git a/test/binaryen.js/sieve.js.txt b/test/binaryen.js/sieve.js.txt deleted file mode 100644 index 46e5d3b398c..00000000000 --- a/test/binaryen.js/sieve.js.txt +++ /dev/null @@ -1,112 +0,0 @@ -(module - (type $0 (func (param i32) (result i32))) - (memory $0 1 100) - (export "sieve" (func $sieve)) - (func $sieve (param $0 i32) (result i32) - (local $1 i32) - (if - (i32.lt_u - (i32.mul - (memory.size) - (i32.const 65536) - ) - (local.get $0) - ) - (then - (drop - (memory.grow - (i32.sub - (i32.div_u - (i32.add - (local.get $0) - (i32.const 65535) - ) - (i32.const 65536) - ) - (memory.size) - ) - ) - ) - ) - ) - (local.set $1 - (i32.const 0) - ) - (loop $clear - (i32.store8 - (local.get $1) - (i32.const 0) - ) - (local.set $1 - (i32.add - (local.get $1) - (i32.const 1) - ) - ) - (br_if $clear - (i32.eq - (local.get $1) - (local.get $0) - ) - ) - ) - (return - (local.get $0) - ) - ) -) - -optimized: - -(module - (type $0 (func (param i32) (result i32))) - (memory $0 1 100) - (export "sieve" (func $sieve)) - (func $sieve (; has Stack IR ;) (param $0 i32) (result i32) - (local $1 i32) - (if - (i32.lt_u - (i32.shl - (memory.size) - (i32.const 16) - ) - (local.get $0) - ) - (then - (drop - (memory.grow - (i32.sub - (i32.shr_u - (i32.add - (local.get $0) - (i32.const 65535) - ) - (i32.const 16) - ) - (memory.size) - ) - ) - ) - ) - ) - (loop $clear - (i32.store8 - (local.get $1) - (i32.const 0) - ) - (br_if $clear - (i32.eq - (local.tee $1 - (i32.add - (local.get $1) - (i32.const 1) - ) - ) - (local.get $0) - ) - ) - ) - (local.get $0) - ) -) - diff --git a/test/binaryen.js/simd.js b/test/binaryen.js/simd.js deleted file mode 100644 index 347bb8682e7..00000000000 --- a/test/binaryen.js/simd.js +++ /dev/null @@ -1,5 +0,0 @@ -var module = new binaryen.Module(); - -var expr = module.v128.const([1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0, 0]); -var info = binaryen.getExpressionInfo(expr); -console.log("v128.const i8x16 0x" + info.value.map(b => b.toString(16)).join(" 0x")); diff --git a/test/binaryen.js/simd.js.txt b/test/binaryen.js/simd.js.txt deleted file mode 100644 index d4facdde5d1..00000000000 --- a/test/binaryen.js/simd.js.txt +++ /dev/null @@ -1 +0,0 @@ -v128.const i8x16 0x1 0x0 0x0 0x0 0x2 0x0 0x0 0x0 0x3 0x0 0x0 0x0 0x4 0x0 0x0 0x0 diff --git a/test/binaryen.js/sourcemap.js b/test/binaryen.js/sourcemap.js deleted file mode 100644 index 90f41c72099..00000000000 --- a/test/binaryen.js/sourcemap.js +++ /dev/null @@ -1,38 +0,0 @@ -var module = new binaryen.Module(); - -var fileIndex = module.addDebugInfoFileName("module.c"); - -console.log(module.getDebugInfoFileName(fileIndex)); -console.log(); - -var expr = module.i32.const(1); -var body = module.block("", [ - expr -], binaryen.i32); - -var func = module.addFunction("main", binaryen.none, binaryen.i32, [], body); - -module.setDebugLocation(func, expr, fileIndex, 1, 2); -module.setDebugLocation(func, body, fileIndex, 0, 3); - -var output = module.emitBinary("module.wasm.map"); -assert(module.validate()); - -function dumpBinary(buffer) { - var hex = [], o, b, h; - for (var i = 0; i < buffer.length; ++i) { - o = i.toString(16); - while (o.length < 3) o = "0" + o; - if ((i & 15) === 0) hex.push((i ? "\n" : "") + o + ":"); - if ((b = buffer[i]) >= 0x21 && b <= 0x7e) - h = String.fromCharCode(b) + ' '; - else if ((h = b.toString(16)).length < 2) - h = "0" + h; - hex.push(h); - } - console.log(hex.join(" ")); -} - -dumpBinary(output.binary); -console.log(); -console.log(output.sourceMap); diff --git a/test/binaryen.js/sourcemap.js.txt b/test/binaryen.js/sourcemap.js.txt deleted file mode 100644 index edb2d86a701..00000000000 --- a/test/binaryen.js/sourcemap.js.txt +++ /dev/null @@ -1,8 +0,0 @@ -module.c - -000: 00 a s m 01 00 00 00 01 05 01 ` 00 01 7f 03 -010: 02 01 00 0a 06 01 04 00 A 01 0b 00 ! 10 s o -020: u r c e M a p p i n g U R L 0f m -030: o d u l e . w a s m . m a p - -{"version":3,"sources":["module.c"],"names":[],"mappings":"wBAAE"} diff --git a/test/binaryen.js/stackir.js b/test/binaryen.js/stackir.js deleted file mode 100644 index d797aa6d818..00000000000 --- a/test/binaryen.js/stackir.js +++ /dev/null @@ -1,29 +0,0 @@ -var wast = ` -(module - (type $i (func (param i32) (result i32))) - (memory $0 0) - (export "test" (func $test)) - (func $test (; 0 ;) (type $i) (param $0 i32) (result i32) - (block (result i32) - (block (result i32) - (if (result i32) - (local.get $0) - (then (local.get $0)) - (else (i32.const 0)) - ) - ) - ) - ) -) -`; - -console.log("=== input wast ===" + wast); - -var module = binaryen.parseText(wast); -assert(module.validate()); - -console.log("=== default ==="); -console.log(module.emitStackIR()); - -console.log("=== optimize ==="); // should omit the second block -console.log(module.emitStackIR(true)); diff --git a/test/binaryen.js/stackir.js.txt b/test/binaryen.js/stackir.js.txt deleted file mode 100644 index bd906c388b0..00000000000 --- a/test/binaryen.js/stackir.js.txt +++ /dev/null @@ -1,48 +0,0 @@ -=== input wast === -(module - (type $i (func (param i32) (result i32))) - (memory $0 0) - (export "test" (func $test)) - (func $test (; 0 ;) (type $i) (param $0 i32) (result i32) - (block (result i32) - (block (result i32) - (if (result i32) - (local.get $0) - (then (local.get $0)) - (else (i32.const 0)) - ) - ) - ) - ) -) - -=== default === -(module - (type $i (func (param i32) (result i32))) - (memory $0 0) - (export "test" (func $test)) - (func $test (param $0 i32) (result i32) - local.get $0 - if (result i32) - local.get $0 - else - i32.const 0 - end - ) -) - -=== optimize === -(module - (type $i (func (param i32) (result i32))) - (memory $0 0) - (export "test" (func $test)) - (func $test (param $0 i32) (result i32) - local.get $0 - if (result i32) - local.get $0 - else - i32.const 0 - end - ) -) - diff --git a/test/binaryen.js/tag.js b/test/binaryen.js/tag.js deleted file mode 100644 index 88783fe5511..00000000000 --- a/test/binaryen.js/tag.js +++ /dev/null @@ -1,33 +0,0 @@ -function cleanInfo(info) { - var ret = {}; - for (var x in info) { - ret[x] = info[x]; - } - return ret; -} - -var module = new binaryen.Module(); -module.setFeatures(binaryen.Features.ReferenceTypes | - binaryen.Features.ExceptionHandling | - binaryen.Features.Multivalue); - -var pairType = binaryen.createType([binaryen.i32, binaryen.f32]); - -var tag = module.addTag("a-tag", binaryen.i32, binaryen.none); - -console.log("GetTag is equal: " + (tag === module.getTag("a-tag"))); - -var tagInfo = binaryen.getTagInfo(tag); -console.log("getTagInfo=" + JSON.stringify(cleanInfo(tagInfo))); - -module.addTagExport("a-tag", "a-tag-exp"); -module.addTagImport("a-tag-imp", "module", "base", pairType, binaryen.none); - -assert(module.validate()); -console.log(module.emitText()); - -module.removeExport("a-tag-exp"); -module.removeTag("a-tag"); - -assert(module.validate()); -console.log(module.emitText()); diff --git a/test/binaryen.js/tag.js.txt b/test/binaryen.js/tag.js.txt deleted file mode 100644 index 06c0c9d68fa..00000000000 --- a/test/binaryen.js/tag.js.txt +++ /dev/null @@ -1,15 +0,0 @@ -GetTag is equal: true -getTagInfo={"name":"a-tag","module":"","base":"","params":2,"results":0} -(module - (type $0 (func (param i32))) - (type $1 (func (param i32 f32))) - (import "module" "base" (tag $a-tag-imp (param i32 f32))) - (tag $a-tag (param i32)) - (export "a-tag-exp" (tag $a-tag)) -) - -(module - (type $0 (func (param i32 f32))) - (import "module" "base" (tag $a-tag-imp (param i32 f32))) -) - diff --git a/test/binaryen.js/tail_calls.js b/test/binaryen.js/tail_calls.js deleted file mode 100644 index 61fe5d829fb..00000000000 --- a/test/binaryen.js/tail_calls.js +++ /dev/null @@ -1,37 +0,0 @@ -var module = new binaryen.Module(); - -module.setFeatures(binaryen.Features.TailCall); - -module.addTableImport("0", "env", "table"); - -var foo = module.addFunction( - "foo", - binaryen.none, - binaryen.none, - [], - module.return_call("foo", [], binaryen.none, binaryen.none) -); - -var bar = module.addFunction( - "bar", - binaryen.none, - binaryen.none, - [], - module.return_call_indirect( - "0", - module.i32.const(0), - [], - binaryen.none, - binaryen.none - ) -); - -assert(module.validate()); - -console.log( - binaryen.getExpressionInfo(binaryen.getFunctionInfo(foo).body).isReturn -); - -console.log( - binaryen.getExpressionInfo(binaryen.getFunctionInfo(bar).body).isReturn -); diff --git a/test/binaryen.js/tail_calls.js.txt b/test/binaryen.js/tail_calls.js.txt deleted file mode 100644 index bb101b641b9..00000000000 --- a/test/binaryen.js/tail_calls.js.txt +++ /dev/null @@ -1,2 +0,0 @@ -true -true diff --git a/test/binaryen.js/validation_errors.js b/test/binaryen.js/validation_errors.js deleted file mode 100644 index 57e37d8ba32..00000000000 --- a/test/binaryen.js/validation_errors.js +++ /dev/null @@ -1,25 +0,0 @@ -(function() { - var mod = new binaryen.Module(); - var func = mod.addFunction("test", binaryen.none, binaryen.none, [], - mod.block("", [ - mod.drop( - mod.global.get("missing", binaryen.i32) - ) - ]) - ); - mod.addExport("test", func); - console.log(mod.validate()) -})(); - -(function() { - var mod = new binaryen.Module(); - var func = mod.addFunction("test", binaryen.none, binaryen.none, [], - mod.block("", [ - mod.drop( - mod.local.get(0, binaryen.i32) - ) - ]) - ); - mod.addFunctionExport("test", "test", func); - console.log(mod.validate()) -})(); diff --git a/test/binaryen.js/validation_errors.js.txt b/test/binaryen.js/validation_errors.js.txt deleted file mode 100644 index 9e4bb1a759f..00000000000 --- a/test/binaryen.js/validation_errors.js.txt +++ /dev/null @@ -1,6 +0,0 @@ -[wasm-validator error in function test] unexpected false: global.get name must be valid, on -(global.get $missing) -0 -[wasm-validator error in function test] unexpected false: local.get index must be small enough, on -(local.get $0) -0 diff --git a/test/binaryen.js/zero-filled-memory.js b/test/binaryen.js/zero-filled-memory.js deleted file mode 100644 index 0638c77440f..00000000000 --- a/test/binaryen.js/zero-filled-memory.js +++ /dev/null @@ -1,31 +0,0 @@ -var wast = String.raw` -(module - (import "env" "memory" (memory $0 1)) - (data (i32.const 1024) "\00\00\00\00") - (export "memory" (memory $0)) -) -`; - -console.log("=== input wast ===" + wast); - -var module = binaryen.parseText(wast); - -console.log("=== unoptimized ==="); -assert(module.validate()); -console.log(module.emitText()); - -console.log("=== optimized, zeroFilledMemory=" + binaryen.getZeroFilledMemory() + " ==="); -module.optimize(); -assert(module.validate()); -console.log(module.emitText()); - -binaryen.setZeroFilledMemory(true); -assert(binaryen.getZeroFilledMemory()); -console.log(); - -console.log("=== optimized, zeroFilledMemory=" + binaryen.getZeroFilledMemory() + " ==="); -module.optimize(); -assert(module.validate()); -console.log(module.emitText()); - -module.dispose(); diff --git a/test/binaryen.js/zero-filled-memory.js.txt b/test/binaryen.js/zero-filled-memory.js.txt deleted file mode 100644 index dec414e3b5e..00000000000 --- a/test/binaryen.js/zero-filled-memory.js.txt +++ /dev/null @@ -1,28 +0,0 @@ -=== input wast === -(module - (import "env" "memory" (memory $0 1)) - (data (i32.const 1024) "\00\00\00\00") - (export "memory" (memory $0)) -) - -=== unoptimized === -(module - (import "env" "memory" (memory $0 1)) - (data $0 (i32.const 1024) "\00\00\00\00") - (export "memory" (memory $0)) -) - -=== optimized, zeroFilledMemory=false === -(module - (import "env" "memory" (memory $0 1)) - (data $0 (i32.const 1024) "\00\00\00\00") - (export "memory" (memory $0)) -) - - -=== optimized, zeroFilledMemory=true === -(module - (import "env" "memory" (memory $0 1)) - (export "memory" (memory $0)) -) -