summaryrefslogtreecommitdiff
path: root/scripts
Commit message (Collapse)AuthorAgeFilesLines
...
* Prototype SIMD extending pairwise add instructions (#3466)Thomas Lively2021-01-051-2/+4
| | | | | | As proposed in https://github.com/WebAssembly/simd/pull/380, using the opcodes used in LLVM and V8. Since these opcodes overlap with the opcodes of i64x2.all_true and i64x2.any_true, which have long since been removed from the SIMD proposal, this PR also removes those instructions.
* When looking for node binary, search for 'node' before 'nodejs' (#3164)Sam Clegg2020-12-301-1/+1
| | | | | | | `node` is he name used by the upstream project. `nodejs` is a legacy name used on older debian/ubunru systems. Searching for `nodejs` first meant it was finding my local (old) `nodejs` package even those I have a more recent `node` in my $PATH.
* Fixed wasm-emscripten-finalize AsmConstWalker not handling 64-bit pointers ↵Wouter van Oortmerssen2020-12-142-4/+16
| | | | | (#3431) Also improved the LLD test scripts to accomodate 64-bit tests.
* Prototype SIMD instructions implemented in LLVM (#3440)Thomas Lively2020-12-111-0/+10
| | | | | | - i64x2.eq (https://github.com/WebAssembly/simd/pull/381) - i64x2 widens (https://github.com/WebAssembly/simd/pull/290) - i64x2.bitmask (https://github.com/WebAssembly/simd/pull/368) - signselect ops (https://github.com/WebAssembly/simd/pull/124)
* Improve lit support (#3426)Sam Clegg2020-12-091-3/+14
| | | | | | | | This uses the same technique used in llvm-lit to enable running on in-tree tests with out-of-tree builds. So you can run something like this: ../binaryen-out/bin/binaryen-lit test/lit/
* [GC] Add basic RTT support (#3432)Alon Zakai2020-12-081-0/+2
| | | | | | | | | | | | | | | | This adds rtt.canon and rtt.sub together with RTT type support that is necessary for them. Together this lets us test roundtripping the instructions and types. Also fixes a missing traversal over globals in collectHeapTypes, which the example from the GC docs requires, as the RTTs are in globals there. This does not yet add full interpreter support and other things. It disables initial contents on GC in the fuzzer, to avoid the fuzzer breaking. Renames the binary ID for exnref, which is being removed from the spec, and which overlaps with the binary ID for rtt.
* [Fuzzer] Use liftoff when running d8, to avoid nondeterminism (#3402)Alon Zakai2020-12-011-5/+18
| | | | | | | When running d8, run it in liftoff, to avoid tiering up causing nondeterminism in the results. When we do want to compare the tiers, we already do so in CompareVMs. This fixes others places where we just wanted to run some JS in some VM.
* [TypedFunctionReferences] Enable call_ref in fuzzer, and fix minor misc fuzz ↵Alon Zakai2020-11-252-2/+14
| | | | | | | | | | | | | | | | | | | | bugs (#3401) * Count signatures in tuple locals. * Count nested signature types (confirming @aheejin was right, that was missing). * Inlining was using the wrong type. * OptimizeInstructions should return -1 for unhandled types, not error. * The fuzzer should check for ref types as well, not just typed function references, similar to what GC does. * The fuzzer now creates a function if it has no other option for creating a constant expression of a function type, then does a ref.func of that. * Handle unreachability in call_ref binary reading. * S-expression parsing fixes in more places, and add a tiny fuzzer for it. * Switch fuzzer test to just have the metrics, and not print all the fuzz output which changes a lot. Also fix noprint handling which only worked on binaries before. * Fix Properties::getLiteral() to use the specific function type properly, and make Literal's function constructor require that, to prevent future bugs. * Turn all input types into nullable types, for now.
* [TypedFunctionReferences] Implement call_ref (#3396)Alon Zakai2020-11-241-0/+3
| | | | | | | | Includes minimal support in various passes. Also includes actual optimization work in Directize, which was easy to add. Almost has fuzzer support, but the actual makeCallRef is just a stub so far. Includes s-parser support for parsing typed function references types.
* Introduce lit/FileCheck tests (#3367)Thomas Lively2020-11-184-4/+57
| | | | | | | | | | | | | | | lit and FileCheck are the tools used to run the majority of tests in LLVM. Each lit test file contains the commands to be run for that test, so lit tests are much more flexible and can be more precise than our current ad hoc testing system. FileCheck reads expected test output from comments, so it allows test output to be written alongside and interspersed with test input, making tests more readable and precise than in our current system. This PR adds a new suite to check.py that runs lit tests in the test/lit directory. A few tests have been ported to demonstrate the features of the new test runner. This change is motivated by a need for greater flexibility in testing wasm-split. See #3359.
* Rename atomic.notify and *.atomic.wait (#3353)Heejin Ahn2020-11-131-3/+3
| | | | | | | | | | | | | | - atomic.notify -> memory.atomic.notify - i32.atomic.wait -> memory.atomic.wait32 - i64.atomic.wait -> memory.atomic.wait64 See WebAssembly/threads#149. This renames instruction name printing but not the internal data structure names, such as `AtomicNotify`, which are not always the same as printed instruction names anyway. This also does not modify C API. But this fixes interface functions in binaryen.js because it seems binaryen.js's interface functions all follow the corresponding instruction names.
* [Fuzzer] Compare D8 on Liftoff and TurboFan (#3342)Alon Zakai2020-11-121-23/+18
| | | | | | | | | Previously we picked one of the two compilers at the top level. But that doesn't actually compare between them directly - each entire run used one of the two. Instead, add separate "VMs" for each of them, and keep the existing D8 VM as well (which tests tiering up). The code also seems nicer this way.
* [Fuzzer] Add a chance to pick particularly important initial contents (#3343)Alon Zakai2020-11-121-1/+13
| | | | | | | | | | | | OptimizeInstructions is seeing the most work these days, so it's good for the fuzzer to focus on that some more. Also move some code around in the main test wast: it's useful to put each feature in its own module to maximize the chance of getting them to be used. That is, if a module has a single use of atomics, then if atomics are disabled in the current run, we can't use any of the module and we skip initial contents entirely. Moving each feature to it's own module reduces that risk. (We do pick randomly between the modules, and atm a small module has the same chance as a big one, but this still seems worth it.)
* Allow setting the path to libbinaryen.so shared library (#3025)rathann2020-11-101-0/+9
| | | | This makes it easier to install libbinaryen.so into an alternative locations. Fixes part of issue #2999 for me.
* wasm2js: Remove global dict arguments to asmFunc (#3325)Sam Clegg2020-11-051-1/+1
|
* Remove remaining bits of C API tracing, which has been removed (#3322)Alon Zakai2020-11-051-37/+0
| | | It was removed in #2841
* wasm-emscripten-finalize: Remove staticBump from metadata (#3300)Sam Clegg2020-10-291-1/+0
| | | | | | Emscripten no longer needs this information as of https://github.com/emscripten-core/emscripten/pull/12643. This also removes the need to export __data_end.
* Prototype new SIMD multiplications (#3291)Thomas Lively2020-10-281-0/+13
| | | | | | | Including saturating, rounding Q15 multiplication as proposed in https://github.com/WebAssembly/simd/pull/365 and extending multiplications as proposed in https://github.com/WebAssembly/simd/pull/376. Since these are just prototypes, skips adding them to the C or JS APIs and the fuzzer, as well as implementing them in the interpreter.
* Fuzzer: Add an option to fuzz with initial wasm contents (#3276)Alon Zakai2020-10-271-46/+155
| | | | | | | | | | | | | | | | | | | | | | | | | Previously the fuzzer constructed a new random valid wasm file from scratch. The new --initial-fuzz=FILENAME option makes it start from an existing wasm file, and then add random contents on top of that. It also randomly modifies the existing contents, for example tweaking a Const, replacing some nodes with other things of the same type, etc. It also has a chance to replace a drop with a logging (as some of our tests just drop a result, and we match the optimized output's wasm instead of the result; by logging, the fuzzer can check things). The goal is to find bugs by using existing hand-written testcases as a basis. This PR uses the test suite's testcases as initial fuzz contents. This can find issues as they often check for corner cases - they are designed to be "interesting", which random data may be less likely to find. This has found several bugs already, see recent fuzz fixes. I mentioned the first few on Twitter but past 4 I stopped counting... https://twitter.com/kripken/status/1314323318036602880 This required various changes to the fuzzer's generation to account for the fact that there can be existing functions and so forth before it starts to run, so it needs to avoid collisions and so forth.
* Implement i8x16.popcnt (#3286)Thomas Lively2020-10-271-0/+1
| | | | | | As proposed in https://github.com/WebAssembly/simd/pull/379. Since this instruction is still being evaluated for inclusion in the SIMD proposal, this PR does not add support for it to the C/JS APIs or to the fuzzer. This PR also performs a drive-by fix for unrelated instructions in c-api-kitchen-sink.c
* Implement v128.{load,store}{8,16,32,64}_lane instructions (#3278)Thomas Lively2020-10-221-0/+8
| | | | | | | These instructions are proposed in https://github.com/WebAssembly/simd/pull/350. This PR implements them throughout Binaryen except in the C/JS APIs and in the fuzzer, where it leaves TODOs instead. Right now these instructions are just being implemented for prototyping so adding them to the APIs isn't critical and they aren't generally available to be fuzzed in Wasm engines.
* Fuzzer: improve random selection of features (#3268)Alon Zakai2020-10-211-5/+4
| | | | We used to either apply all, or pick each at random. Also add a chance to pick none at all.
* Fuzzer: Handle the case where we can't even generate the wasm file (#3270)Alon Zakai2020-10-211-0/+25
| | | | If we can't run the -ttf stage, there is no point in printing out the instructions to reduce things - we can't reduce without a wasm.
* Fuzzer: run emcc with memory growth enabled, to allow larger things to run ↵Alon Zakai2020-10-211-1/+5
| | | | (#3269)
* Remove remnants of spec interpreter, and excess mozjs warning (#3262)Alon Zakai2020-10-201-18/+0
| | | | | The spec interpreter is no longer used at all. Mozjs is still used optionally, but while it was crucial in the past for test coverage, it is entirely optional now and not run by default, so no need to warn.
* Remove process_optimize_instructions.py which is no longer needed after ↵Max Graey2020-10-191-16/+0
| | | | #3200 (#3258)
* Asyncify fuzzing harness fix for growth (#3205)Alon Zakai2020-10-091-2/+9
| | | | | Fuzzing Asyncify on data with a memory growth showed that the harness did not handle a growth. When growth happens we must recreate the view. For simplicity, always refresh, in a location that dominates all the uses.
* Fix split_wast on asserts before the first module (#3206)Alon Zakai2020-10-091-0/+6
| | | | | | | | Normally a wast file has a module and then asserts on it, but some tests have just asserts without a module. In that case, set the module to None. (This can happen if the asserts do not refer to a module, and are at the top of the wast file.)
* wasm2js: override incoming memory's grow method (#3185)Sam Clegg2020-09-302-6/+3
| | | | | | | | | | This will allow for the completely removal of `__growWasmMemory` as a followup. We currently unconditionally generate this function in `generateMemoryGrowthFunction`. See #3180
* GC: Add stubs for the remaining instructions (#3174)Daniel Wirtz2020-09-291-1/+19
| | | NFC, except adding most of the boilerplate for the remaining GC instructions. Each implementation site is marked with a respective `TODO (gc): theInstruction` in between the typical boilerplate code.
* Cleanup emcc-tests.sh (#3170)Sam Clegg2020-09-241-5/+6
| | | | | | - Use ninja - Use a sub-directory - Don't use emmake when running make/ninja (this is redundant if you use emconfigure to configure the build).
* GC: Add i31 instructions (#3154)Daniel Wirtz2020-09-241-2/+5
| | | Adds the `i31.new` and `i31.get_s/u` instructions for creating and working with `i31ref` typed values. Does not include fuzzer integration just yet because the fuzzer expects that trivial values it creates are suitable in global initializers, which is not the case for trivial `i31ref` expressions.
* Remove stale test output (#3157)Sam Clegg2020-09-211-0/+14
| | | | | | | | | | | | These test output files are ignored and so contain stale output that is neither checked during `check.py` not updated during `auto_update_tests.py`. There are three clases to tests here: 1. Spec tests that end in 64.wast are ignored by scripts/test/wasm2js.py 2. Spec tests that are globallyi ignoed by shared.py:SPEC_TESTS_TO_SKIP 3. hello_world.2asm.js.. I cant tell where this came remove it seems like an anomaly.
* wasm2js: Support exported tables (#3152)Sam Clegg2020-09-212-5/+3
|
* GC: Add ref.eq instruction (#3145)Daniel Wirtz2020-09-211-1/+3
| | | With `eqref` now integrated, the `ref.eq` instruction can be implemented. The only valid LHS and RHS value is `(ref.null eq)` for now, but implementation and fuzzer integration is otherwise complete.
* Initial implementation of "Memory64" proposal (#3130)Wouter van Oortmerssen2020-09-181-0/+3
| | | Also includes a lot of new spec tests that eventually need to go into the spec repo
* Improve testing on Windows (#3142)Wouter van Oortmerssen2020-09-172-1/+12
| | | | | | This PR contains: - Changes that enable/disable tests on Windows to allow for better local testing. - Also changes many abort() into Fatal() when it is really just exiting on error. This is because abort() generates a dialog window on Windows which is not great in automated scripts. - Improvements to CMake to better work with the project in IDEs (VS).
* Refactor Host expression to MemorySize and MemoryGrow (#3137)Daniel Wirtz2020-09-171-2/+2
| | | Aligns the internal representations of `memory.size` and `memory.grow` with other more recent memory instructions by removing the legacy `Host` expression class and adding separate expression classes for `MemorySize` and `MemoryGrow`. Simplifies related APIs, but is also a breaking API change.
* Add GC feature flag (#3135)Daniel Wirtz2020-09-171-5/+5
| | | Adds the `--enable-gc` feature flag, so far enabling the `anyref` type incl. subtyping, and removes the temporary `--enable-anyref` feature flag that it replaces.
* Add mozjs, V8 and WABT setup script (#3053)Daniel Wirtz2020-09-141-1/+7
| | | Adds a new script `./third_party/setup.py` to conveniently install necessary dependencies for testing and fuzzing, including the SpiderMonkey JS shell (mozjs), the V8 JS shell and WABT. Other scripts now automatically pick these up when installed and fall back to look for the tools in PATH like before.
* Include potentially out-of-tree bin directory in reduce.sh (#3120)Daniel Wirtz2020-09-121-1/+2
| | | Since #3050 the fuzzer can test out-of-tree builds using the `--binaryen-bin` argument, but the argument was not yet added to the generated `reduce.sh` on fuzzing failures. This change adds it.
* Update Pop text format to handle tuples (#3116)Thomas Lively2020-09-111-10/+2
| | | | | | | | | | | Previously Pops were printed as ({type}.pop), and if the popped type was a tuple, something like ((i32, i64).pop) would get printed. However, the parser didn't support pops of anything besides single basic types. This PR changes the text format to be (pop <type>*) and adds support for parsing pops of tuples of basic types. The text format change is designed to make parsing simpler. This change is necessary for writing Poppy IR tests (see #3059) that contain break or return instructions that consume multiple values, since in Poppy IR that requires tuple-typed pops.
* Remove scripts/spidermonkify.py (#3112)Sam Clegg2020-09-111-48/+0
|
* Add anyref feature and type (#3109)Daniel Wirtz2020-09-102-4/+13
| | | Adds `anyref` type, which is enabled by a new feature `--enable-anyref`. This type is primarily used for testing that passes correctly handle subtype relationships so that the codebase will continue to be prepared for future subtyping. Since `--enable-anyref` is meaningless without also using `--enable-reference-types`, this PR also makes it a validation error to pass only the former (and similarly makes it a validation error to enable exception handling without enabling reference types).
* Update reference types (#3084)Daniel Wirtz2020-09-091-1/+0
| | | | | | | Align with the current state of the reference types proposal: * Remove `nullref` * Remove `externref` and `funcref` subtyping * A `Literal` of a nullable reference type can now represent `null` (previously was type `nullref`) * Update the tests and temporarily comment out those tests relying on subtyping
* Stay on C++14 for now (#3108)Daniel Wirtz2020-09-081-1/+1
| | | | | Switch us back to C++ standard support to 14 (for now), so we can easily upgrade again once the autoroller issues are resolved (atm the chromium roller does not have a libc++ with c++17 support).
* Upgrade to C++17 (#3103)Daniel Wirtz2020-09-061-0/+4
|
* Use fnmatch for test filtering (#3068)Thomas Lively2020-08-211-1/+2
| | | Allows for using `*` wildcards and simplifies the code!
* Test-runner can filter tests by name (#3067)Wouter van Oortmerssen2020-08-201-0/+6
|
* Harmonize auto updater with test runner: wasm-opt should update .fromBinary ↵Alon Zakai2020-08-201-0/+26
| | | | | | | outputs (#3066) It was confusing that you had to run ./auto_update_tests.py binfmt to update a test checked by ./check.py wasm-opt. Instead, make ./auto_update_tests.py wasm-opt update those, so it's symmetrical.