summaryrefslogtreecommitdiff
path: root/src/wasm-features.h
Commit message (Collapse)AuthorAgeFilesLines
* [typed-cont] Add feature flag (#5996)Frank Emrich2023-10-051-1/+8
| | | | | | | This PR is part of a series that adds basic support for the [typed continuations proposal](https://github.com/wasmfx/specfx). This particular PR simply extends `FeatureSet` with a corresponding entry for this proposal.
* Remove the GCNNLocals feature (#5080)Thomas Lively2023-08-311-35/+10
| | | | | Now that the WasmGC spec has settled on a way of validating non-nullable locals, we no longer need this experimental feature that allowed nonstandard uses of non-nullable locals.
* Rename multimemory flag (#5890)Ashley Nelson2023-08-211-5/+5
| | | Renaming the multimemory flag in Binaryen to match its naming in LLVM.
* Update default features to match new llvm defaults (#5212)Sam Clegg2022-11-031-2/+6
| | | See: https://reviews.llvm.org/D125728
* [NFC] Add namespacing to wasm-features.h (#5152)Alon Zakai2022-10-181-0/+4
|
* Remove typed-function-references feature (#5030)Thomas Lively2022-09-091-16/+7
| | | | | | | | | | | | | | | | In practice typed function references will not ship before GC and is not independently useful, so it's not necessary to have a separate feature for it. Roll the functionality previously enabled by --enable-typed-function-references into --enable-gc instead. This also avoids a problem with the ongoing implementation of the new GC bottom heap types. That change will make all ref.null instructions in Binaryen IR refer to one of the bottom heap types. But since those bottom types are introduced in GC, it's not valid to emit them in binaries unless unless GC is enabled. The fix if only reference types is enabled is to emit (ref.null func) instead of (ref.null nofunc), but that doesn't always work if typed function references are enabled because a function type more specific than func may be required. Getting rid of typed function references as a separate feature makes this a nonissue.
* Adding Multi-Memories Wasm Feature (#4968)Ashley Nelson2022-08-251-2/+7
| | | Adding multi-memories to the the list of wasm-features.
* [Strings] Add feature flag for Strings proposal (#4766)Alon Zakai2022-06-301-2/+7
|
* [NFC] Refactor Feature::All to match FeatureSet.setAll() (#4557)Alon Zakai2022-03-311-6/+10
| | | | | | | | | | | As we recently noted in #4555, that Feature::All and FeatureSet.setAll() are different is potentially confusing... I think the best thing is to make them identical. This does that, and adds a new Feature::AllPossible which is everything possible and not just the set of all features that are enabled by -all. This undoes part of #4555 as now the old/simpler code works properly.
* Add support for extended-const proposal (#4529)Sam Clegg2022-03-191-1/+6
| | | See https://github.com/WebAssembly/extended-const
* Fix errors when building in C++20 mode (#4528)Jakub Szewczyk2022-03-181-3/+3
| | | | | | | * use [[noreturn]] available since C++11 instead of compiler-specific attributes * replace deprecated std::is_pod with is_trivial&&is_standard_layout (also available since C++11/14) * explicitly capture this in [=] lambdas * extra const functions in FeatureSet, fix implicit cast warning by using the features field directly * Use CMAKE_CXX_STANDARD to ensure the C++ standard parameter is set on all targets, remove manual compiler flag workaround.
* Add feature flag for relaxed-simd (#4183)Ng Zhi An2021-09-231-1/+6
|
* [Wasm GC] Add experimental support for non-nullable locals (#3932)Alon Zakai2021-06-151-3/+22
| | | | | | | | | | | | | | This adds a new feature flag, GCNNLocals that enables support for non-nullable locals. No validation is applied to check that they are actually assigned before their use yet - this just allows experimentation to begin. This feature is not enabled by default even with -all. If we enabled it, then it would take effect in most of our tests and likely confuse current users as well. Instead, the flag must be opted in explicitly using --enable-gc-nn-locals. That is, this is an experimental feature flag, and as such must be explicitly enabled. (Once the spec stabilizes, we will remove the feature anyhow when we implement the final status of non-nullability. )
* Print the features section in a comment (#3563)Alon Zakai2021-02-121-0/+15
|
* [TypedFunctionReferences] Add Typed Function References feature and use the ↵Alon Zakai2020-11-231-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | types (#3388) This adds the new feature and starts to use the new types where relevant. We use them even without the feature being enabled, as we don't know the features during wasm loading - but the hope is that given the type is a subtype, it should all work out. In practice, if you print out the internal type you may see a typed function reference-specific type for a ref.func for example, instead of a generic funcref, but it should not affect anything else. This PR does not support non-nullable types, that is, everything is nullable for now. As suggested by @tlively this is simpler for now and leaves nullability for later work (which will apparently require let or something else, and many passes may need to be changed). To allow this PR to work, we need to provide a type on creating a RefFunc. The wasm-builder.h internal API is updated for this, as are the C and JS APIs, which are breaking changes. cc @dcodeIO We must also write and read function types properly. This PR improves collectSignatures to find all the types, and also to sort them by the dependencies between them (as we can't emit X in the binary if it depends on Y, and Y has not been emitted - we need to give Y's index). This sorting ends up changing a few test outputs. InstrumentLocals support for printing function types that are not funcref is disabled for now, until we figure out how to make that work and/or decide if it's important enough to work on. The fuzzer has various fixes to emit valid types for things (mostly whitespace there). Also two drive-by fixes to call makeTrivial where it should be (when we fail to create a specific node, we can't just try to make another node, in theory it could infinitely recurse). Binary writing changes here to replace calls to a standalone function to write out a type with one that is called on the binary writer object itself, which maintains a mapping of type indexes (getFunctionSignatureByIndex).
* Validate memory64 (#3202)Alon Zakai2020-10-081-0/+1
|
* Initial implementation of "Memory64" proposal (#3130)Wouter van Oortmerssen2020-09-181-1/+5
| | | Also includes a lot of new spec tests that eventually need to go into the spec repo
* 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 anyref feature and type (#3109)Daniel Wirtz2020-09-101-1/+6
| | | 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).
* Remove `constexpr` that causes GCC build to fail (#2828)Thomas Lively2020-05-041-1/+1
| | | | | | | GCC complains that the enclosing class of the constexpr member function is not a literal type. This change removes the constexpr qualifier to fix the GCC build. Fixes #2827.
* Add multivalue feature (#2668)Thomas Lively2020-02-271-27/+10
|
* Use FeatureSet instead of FeatureSet::Feature(NFC) (#2562)Heejin Ahn2020-01-021-2/+3
| | | | | This uses `FeatureSet` in place of `FeatureSet::Feature` when possible, making it possible for functions take a set of multiple features as one argument.
* Add string parameter to WASM_UNREACHABLE (#2499)Sam Clegg2019-12-051-1/+2
| | | | | This works more like llvm's unreachable handler in that is preserves information even in release builds.
* Fix #2430 properly (#2449)Alon Zakai2019-11-181-10/+10
|
* Cast to bool after bitwise operations, to avoid an MSVC warning (#2431)Alon Zakai2019-11-121-10/+12
| | | | Fixes #2430
* Add initial support for anyref as an opaque type (#2294)Jay Phelps2019-08-201-1/+9
| | | | | | | | | | | | | Another round of trying to push upstream things from my fork. This PR only adds support for anyref itself as an opaque type. It does NOT implement the full [reference types proposal](https://github.com/WebAssembly/reference-types/blob/master/proposals/reference-types/Overview.md)--so no table.get/set/grow/etc or ref.null, ref.func, etc. Figured it was easier to review and merge as we go, especially if I did something fundamentally wrong. *** I did put it under the `--enable-reference-types` flag as I imagine that even though this PR doesn't complete the full feature set, it probably is the right home. Lmk if not. I'll also be adding a few github comments to places I want to point out/question.
* Initial tail call implementation (#2197)Thomas Lively2019-07-031-2/+9
| | | | | | | | | | | Including parsing, printing, assembling, disassembling. TODO: - interpreting - effects - finalization and typing - fuzzing - JS/C API
* Features C/JS API (#2049)Thomas Lively2019-05-171-1/+0
| | | | | Add feature handling to the C/JS APIs. No features are enabled by default, so all used features will have to be explicitly enabled in order for modules to validate.
* Add exception handling feature (#2083)Heejin Ahn2019-05-031-1/+10
| | | This only adds the feature and its flag and not the instructions yet.
* clang-tidy braces changes (#2075)Alon Zakai2019-05-011-6/+12
| | | Applies the changes in #2065, and temprarily disables the hook since it's too slow to run on a change this large. We should re-enable it in a later commit.
* Apply format changes from #2048 (#2059)Alon Zakai2019-04-261-19/+31
| | | Mass change to apply clang-format to everything. We are applying this in a PR by me so the (git) blame is all mine ;) but @aheejin did all the work to get clang-format set up and all the manual work to tidy up some things to make the output nicer in #2048
* Change default feature set to MVP (#1993)Thomas Lively2019-04-161-0/+8
| | | | | In the absence of the target features section or command line flags. When there are command line flags, it is an error if they do not exactly match the target features section, except if --detect-features has been provided. Also adds a --print-features pass to print the command line flags for all enabled options and uses it to make the feature tests more rigorous.
* Move features from passOptions to Module (#2001)Thomas Lively2019-04-121-3/+3
| | | | | This allows us to emit a (potentially modified) target features section and conditionally emit other sections such as the DataCount section based on the presence of features.
* Add feature options to emscripten metadata (#1982)Thomas Lively2019-04-051-0/+25
| | | Emscripten runs wasm-emscripten-finalize before running wasm-opt, so the target features section is stripped out before optimizations are run. One option would have been to add another wasm-opt invocation at the very end to strip the target features section, but dumping the features as metadata avoids the extra tool invocation. In the long run, it would be nice to have only as single binaryen invocation to do all the work that needs doing.
* Use target features section in wasm-opt (#1967)Thomas Lively2019-04-031-0/+5
| | | | | | | If the user does not supply features explicitly on the command line, read and use the features in the target features section for validation and passes. If the user does supply features explicitly, error if they are not a superset of the features marked as used in the target features section and the user does not explicitly handle this.
* Validate that types match features (#1949)Thomas Lively2019-03-181-0/+70
Refactors features into a new wasm-features.h file and updates the validator to check that all types are allowed. Currently this is only relevant for the v128 SIMD type, but new types will be added in the future. The test for this change is in #1948.