| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
The memory64 `table.wast` test has started to depend on
function-references and gc (which WABT doesn't support yet), so vendor
an older version of the test.
|
| |
|
|
|
|
|
| |
See https://github.com/WebAssembly/memory64/issues/51
Includes workaround for #2422
|
|
|
|
|
|
|
| |
The main change here is because `comments.wast` was updated to include
a "quoted" module at the top level.
Previously quoted modules had only been used as part of invalid or
malformed assertion expressions.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Updates wasm-c-api submodule
Fixes #1600
|
|
|
|
|
| |
WastParser now handles the abbreviated (no tableidx) forms of
table.{get,set,size,grow,fill} (needed after
https://github.com/WebAssembly/spec/pull/1582).
|
|
|
| |
This change incorporates [simd-everywhere](https://github.com/simd-everywhere/simde) into the wasm2c output, which maps wasm SIMD C intrinsics to any supported target architecture.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This makes wasm2c serialize each function type, rather than registering
function types at module-initialization time. The serialized function
type is the SHA-256 of the mangled param and result types (with a space
between params and results).
At runtime in call_indirect, a known (immediate) function type is
compared against the function type stored in a funcref structure. For
call_indirects to functions local to the module, or for any
call_indirect when the toolchain merges string constants across
compilation units (generally, GCC and clang), this can be done by
comparing the pointers to each function type. Otherwise, the actual
32-byte values are compared.
The function type IDs can be looked up at runtime with
`Z_[modname]_get_func_type`, which matches the API from
`wasm_rt_register_func_type`. A new `callback` example demos this.
wasm2c does the SHA-256 either by linking against libcrypto or, if not
available or if requested via `cmake -DUSE_INTERNAL_SHA256=ON`, by using
a vendored (header-only) PicoSHA2. There is no runtime dependency on
SHA-256 in the wasm2c runtime or generated modules.
This eliminates the last of the per-module state, so this commit also removes
the [modname]_init_module() function and the s_module_initialized bool.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As well as the testsuite update there are two notable changes that
come with it here. These can both be split out an landed first if
it makes sense.
1. wasm2c now supports element sections containing externref. Currently
only the null reference is supported.
2. element segments no longer use funcref as the default element type
but instead, unless explicitly included in the binary, the
element type defaults to the type of the table in which the segment
is active.
Fixes: #1612 #2022
|
| |
|
| |
|
|
|
|
| |
Remove test/binary/bad-function-missing-end.txt which is now
covered upstream: https://github.com/WebAssembly/spec/pull/1405
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
bulk-memory-operations and reference-types were completely
removed from the upstream testsuite becuase there were
merged into the upstream spec:
https://github.com/WebAssembly/testsuite/pull/44
In order to land this I had to disable several spec tests
under wasm2c because it lacks support for mutli-table and
reference types. I filed #1737 to track this.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Bump third_party/testsuite
* Run test/update-spec-tests.py
* Skip new simd tests that are not implemented
* Rebase some tests in test/spec based on latest update to testsuite
* Define global_i64 for wasm2c global tests
* Skip more simd tests due to updated/new instructions
|
|
|
|
|
|
|
|
|
| |
This is an incremental bump of testsuite, the TOT has SIMD tests
which won't work yet.
The main fix is for a test added to the spec repo that has an invalid
functype in the type section. Based on the spec, the functype should be
a single byte 0x60. The leb encoding only comes into effect with the GC
proposal.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Update testsuite
* Update test results
* Disallow lane nums with optional + for simd ops
* Update simd support
* Mark `test/spec/func.txt` as failing
Co-authored-by: Darin Morrison <darinmorrison@users.noreply.github.com>
|
|
|
| |
(this is HEAD~1 as of this writing, HEAD containing the Memory64 tests which I want to land separately)
|
|
|
|
|
|
|
|
|
|
|
|
| |
The interpreter and wasm2c were incorrectly handling some float-to-int
conversions. For clarity, the wasm2c implementations of these
conversions now matches the implementation in interp-math.h more closely
(e.g. the numeric ranges are written as `x >= min && x <= max` in both
cases).
Quite a few wasm2c tests were previously being skipped, since wasm2c
doesn't currently support multi-value; it's better instead to duplicate
the tests here and disable the parts that are not supported so we don't
lose test coverage.
|
|
|
|
|
|
|
|
|
| |
See https://github.com/WebAssembly/reference-types/issues/99.
This change also updates the testsuite, so the spec tests pass too.
In addition, the behavior of `br_table` is no longer different from MVP,
and has a text to confirm this. That is now fixed in `type-checker.cc`
too.
|
|
|
|
|
|
|
|
| |
Main changes:
* Rename `anyref` -> `externref`
* Remove `nullref`
* Rename `hostref` -> `externref`
* `ref.null` and `ref.is_null` now have "ref kind" parameter
* Add ref kind keywords: `func`, `extern`, `exn`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I've been used the tests from wasi-sdk to get started:
https://github.com/WebAssembly/wasi-sdk/tree/master/tests
All these tests now pass. Still this isn't saying much, there are still
some big missing pieces. Started using the new serdes
(serialize/deserialze) API in uvwasi. I think we are almost at the
point were we can look at auto-generating some of this stuff from witx
to avoid having the hand code all this marshelling stuff.
Add support for ArgumentCount::ZeroOrMore to OptionParser and also the
ability to force the end of option processing using `--`. This allows
is to pass options through the underlying wasi program when running
wasm-interp.
|
|
|
|
| |
This is almost enough to pass all the tiny tests in the wasi-sdk
repo.
|
|
|
|
|
|
|
| |
Includes the three merged proposals (nontrapping-float-to-int,
sign-extension, multi-value).
It also has one bug fix when parsing table limits (when the min or max
size does not fit in a 32-bit int).
|
|
|
|
|
|
|
|
|
|
| |
This is proof of concept that only implements the `proc_exit` and
`fd_write` APIs.
Extending this to the full WASI API will to follow assuming this
approach seems reasonable.
Fixes #1409
|
|
|
|
| |
* Add i{8x16,16x8,32x4}.abs instructions
* Implement IntAbs in interp-math.h
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The new table-sub test, checks whether the subtyping is handled
properly w/ table.init and table.copy instructions.
The BeginElemSegment callback can't pass the element type anymore, since
it's not known yet. The callback also can't be deferred, since the
BeginElemSegmentInitExpr callback has to happen after the
BeginElemSegment callback, but the reference type is not always known
until after the initializer expression is read. To work around this, I
added a new OnElemSegmentElemType callback.
Other element segment changes:
* The element type must be tracked in the SharedValidator
* A subtle fix: when writing out the segment flags, we need to take into
account whether the element type of the segment is not funcref, even
if there are no element expressions. In that case, we have to use flag
bit 0x4 (SegUseElemExprs).
In addition, the TableCopy and TableInit instructions weren't handling
table indexes fully.
* TableCopy variables are read in the parser (both optional)
* TableCopy names are now resolved + applied
* TableCopy indexes are now validated
* TableInit table variables are read in the parser; this is subtle,
since the text format has order $table $segment, but the $table is
optional.
|
|
|
|
|
| |
The main change here is the addition of declared elem sections.
|
|
|
|
| |
All tests except `threads` pass.
|
|
|
|
|
|
|
|
|
|
| |
* Remove `assert_return_func`. This is now handled by using
`assert_return` with `(ref.func)`.
* The reference types proposal depends on the bulk memory proposal, so
using `--enable-reference-types` automatically includes
`--enable-bulk-memory`.
* `table.fill` no longer clamps to the valid range, and instead checks
before writing anything. This matches the other bulk instructions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The two primary changes involved are:
1. Removal of `assert_return_canonical_nan`/`arithetic nan` in favor of
special `nan:canonical`/`nan:arithmetic` constants that can only be
used in test expectations.
See: https://github.com/WebAssembly/spec/pull/1104
2. New trapping behaviour for bulk memory operations. Range checks are
now performed up front for opterations such as memory.fill and
memory.copy.
See: https://github.com/webassembly/bulk-memory-operations/issues/111
And: https://github.com/webassembly/bulk-memory-operations/pull/123
The old behaviour is still kept around to support table.fill which
is defined in reference-types proposal and has yet to be updated.
|
|
|
|
|
|
|
| |
The only major change to the interpreter is to move segment
initialization out `ReadBinaryInterp` (in the binary reader) and into
interp.cc. This is because the test suite now expects out of bound
semgments to be reported during initialization rather than reported
as validation errors.
|
|
|
|
|
| |
* Remove passive keyword from bulk-memory
* Fix rounding on hex floats
* Allow underscores in NaN payloads
|
| |
|
|
|
|
|
|
|
|
|
|
| |
When a module is instantiated, and the start function traps, the
contents of the memory and the table may have been modified. This case
is handled by the `assert_uninstantiable` check in a wast test.
In spectest-interp, assert_uninstantiable would instantiate the module,
but was incorrectly resetting the environment. In run-spec-wasm2c, the
`assert_uninstantiable` tests weren't being run at all. Now the module's
`init` function is run, and it is expected to trap.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
This huge PR does all the renaming as described in issue #933. It also
updates to the latest testsuite so the new names are used.
The old names of the MVP instructions are still supported for
convenience (though we should remove those too at some point), but the
old simd and atomic instruction names are no longer supported.
|
| |
|
|
|
|
| |
Also fix bug when parsing elem/data segment; the table/memory index is
stored as an LEB128, not a U8.
|
| |
|
|
|
|
|
| |
Use commit right before 87a4cdd, which introduced "missing member
initializer" warning that breaks the build, but move away from the
version that is using `tr1` namespace disabled in Visual Studio.
|
|
|
|
|
|
|
|
| |
The newest testsuite update enables mutable globals by default, which
matches the v1 WebAssembly spec.
This change changes the default for all wabt tools, and changes the flag
to `--disable-mutable-globals` in case you need the previous behavior.
This flag will likely be removed in the future.
|