| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
This pull request implements EHv4. Binary is mostly untested until
interp is working.
|
| |
|
|
|
|
|
|
|
|
| |
This adds support for the new opcodes from the Relaxed SIMD proposal
(https://github.com/WebAssembly/relaxed-simd) behind the
"--enable-relaxed-simd" flag.
The exception is the f32x4.relaxed_dot_bf16x8_add_f32x4 instruction
which is not yet implemented.
|
|
|
| |
Fixes: #2018
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The primary changes here are to the interpreter and how it handles
initializer expressions. With this change we model these are normal
function that we run during module initialization.
I imagine we could optimize this further by creating one long function
and encoding the `global.set`/`memory.init`/`table.init` into the
function itself, but this change seems like a good first step to make
the current tests pass.
|
|
|
|
|
|
|
|
| |
This PR imports the spec tests from the Wasm testsuite repo and adds infrastructure to run them correctly.
* Adds test expectations for exception handling proposal spec tests.
* Adds missing tag signature matching code for import tests.
* Adds support for the `assert_exception` command used in new tests.
* Fix filename normalization for the spec test runner.
|
| |
|
|
|
|
|
| |
Maintain an explict list of exclusions and process all other
directories. This means that we will notice as new proposals
get added.
|
|
|
|
|
| |
This was removed as part of #1712 but I think it still needs to be here
until simd is actually merge into the main spec repo and no longer
exists as proposal in the testsuite repo.
|
|
|
|
|
|
|
|
|
| |
This features was finished earlier this year:
https://github.com/WebAssembly/proposals/blob/master/finished-proposals.md
One thing to note is that the version of the spec tests we currently
have in third_party/testsuite doesn't have ref types merged yet so
this change disables ref types when running some of those tests. This
can be removed in a followup when we update the testsuite.
|
|
|
|
|
|
|
|
|
|
|
| |
This features was finished earlier this year:
https://github.com/WebAssembly/proposals/blob/master/finished-proposals.md
One thing to note is that the version of the spec tests we currently
have in third_party/testsuite doesn't have bulk memory merged yet so
this change disables bulk memory when running some of those tests. This
will be removed in a followup when we update the testsuite.
Fixes: #1717
|
|
|
|
|
| |
* SIMD is now phase 5, enable it by default
* Update test flags, rebase test, and docs
|
|
|
|
|
| |
These uncovered some things the previous tests didn't!
Also required the switching of the location of the index as discussed in https://github.com/WebAssembly/memory64/issues/5
Also one small .py change that ensures the new tests have consistent posix paths.
|
|
|
| |
(this is HEAD~1 as of this writing, HEAD containing the Memory64 tests which I want to land separately)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Lots of changes necessary to make this work, as well as some bug fixes.
The main change is allowing `nan:canonical` and `nan:arithmetic` as a
possible value for each lane of a `v128`. This needs to propogate
through the parser, IR, the JSON format, and the spec interpreter.
This also changes the format of the spec JSON file, where a SIMD value
is now stored as a list of values instead of a single u128:
```
{"type": "v128", "lane_type": "i32", "value": ["0", "0", "0", "0"]}
```
Since the lane type can be `i8` and `i16`, these types can now be used
in more places (not just the decompiler). They'll be used for the GC
proposal too (for packed values), so I've updated them to use the binary
value specified for that proposal.
Here are the actual SIMD fixes:
* SIMD lanes are malformed if they don't match the binary format, but
invalid if they are smaller than the lane width. For example,
`i8x16.extract_lane_s` is malformed if the lane is >= 256, because the
lane is stored as a byte. But it is invalid if the lane is >= 16.
* The `i8x16.narrow_i16x8_u`, `i16x8.narrow_i32x4_u` and
`i64x2.load_32x2_u` instructions were not handling sign-extension
propoerly.
TODO: This code is pretty clumsy now; it would be better to have a
universal `Value` and `ExpectedValue` that can be used everywhere, so
the logic doesn't need to be duplicated.
|
| |
|
|
|
|
| |
This found one bug in the parsing of active elem segments with
uncref style elements.
|
|
|
|
|
|
|
|
| |
pep8 specifies 4 space indentation. The use of 2 spaces is, I believe,
a historical anomaly where certain large organizations such as google
chose 2 over 4 and have yet to make the switch.
For a project like wabt with little python code I think the cost of
switching is small enough to justify the churn.
|
| |
|
|
|
|
|
|
|
|
|
| |
* Implement bulk memory in interpreter
* Read/Write elem_type in element segments
* Binary format
* Text format (`(elem passive funcref...)`)
* Add DataSegment runtime objects
* Only initialize active data segments when instantiating
|
|
|
|
| |
These tests are already included in third_party/testsuite. The
`update-spec-tests.py` script just needs to be updated to include them.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Running the multi-value spec tests found a few bugs:
* DropKeep needs to copy the kept values backward when the regions
overlap.
* Type names need to be resolved to indexes in block declarations
(e.g. `block (type $foo)`)
* `if` without an `else` is valid, it just behaves as though the `else`
is empty, which will pass the params through as results.
* When validating function signatures, we need to also check block
declaration signatures.
* Split `ResolveFuncType` into two functions:
`ResolveFuncTypeWithEmptySignature` and
`ResolveImplicitlyDefinedFunctionType`.
* When resolving implicitly defined function types, we only create an
implicit function type when the type is not inlinable; i.e. only for
block/loop/if with 0 or 1 result values and no params.
* Change `update-spec-tests` to include the `multi-value` proposal repo
from the testsuite.
|
|
|
|
| |
`update-spec-tests.py` now will update the tests in the
`test/wasm2c/spec` directory.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add support for yapf python formatting tool
This changs adds .style.yapf to define the python style
we are using.
I also ran yapf over all the python files:
$ yapf -i `git ls-files *.py`
Going forward, we should probably add a travis test to
prevent regressions. We should probably also switch to
more conventional 4-space indentation, which is used by
almost everybody outside of Google.
|
|
|
|
|
| |
Mostly just requires proper implementation of drop/tee_local in
wasm-binary-reader-interpreter.c and wasm-interpreter.c.
|
| |
|
|
Change 7c482b1a of the spec repo now requires that implicit function
types are created when creating a new func or import, but only when the
type is not explicitly specified, and the have not been specified. For
example:
```
(func (param i32))
(import "foo" "bar" (result i32)
```
This was previously done in sexpr-wasm when writing the binary, but now
these types can be referenced by `call_import`, so it has to be handled
earlier.
Since all signatures are now defined in the module, I made it so the
function signature is shared with the module function types. The tricky
part here is when a function type and an explicit signature are both
specified:
```
(func (type $t) (param f32) ...)
```
In this case, we need to keep the explicit signature around long enough
to be checked against the function type, so it must be owned by the
function. The WASM_FUNC_DECLARATION_FLAG_SHARED_SIGNATURE flag specifies
this case.
To simplify code that uses the AST, I reverted many of the
changes introduced in 73e5bc7d. Now the function declaration's signature
is always valid to access, and will have been resolved if it was
specified with a func type instead of an explicit signature.
Some other changes:
* There was a bug in the interpreter's `f32.demote/f64` rounding when
given a value that is very close to positive or negative F32_MAX
* Added `update-spec-tests.py` to more easily update the spec tests in
`test/interp/spec/*.txt` from the files in
`third_party/testsuite/*.wast`. Previously I would just do it
manually.
|