summaryrefslogtreecommitdiff
path: root/test/update-spec-tests.py
Commit message (Collapse)AuthorAgeFilesLines
* Update testsuite (for SIMD) (#1373)Ben Smith2020-03-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Remove support for python2 (#1321)Sam Clegg2020-01-311-2/+1
|
* Run update-spec-tests.py and add resulting missing tests (#1263)Sam Clegg2019-12-121-0/+1
| | | | This found one bug in the parsing of active elem segments with uncref style elements.
* Switch python indentation from 2-space to 4-space (#1145)Sam Clegg2019-08-151-52/+52
| | | | | | | | 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.
* Run flake8 on the whole repository (#1144)Guanzhong Chen2019-08-151-7/+1
|
* Implement bulk memory in the interpreter (#1074)Ben Smith2019-05-071-0/+1
| | | | | | | | | * 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
* Run more proposal spec tests (#964)Ben Smith2018-11-301-5/+12
| | | | These tests are already included in third_party/testsuite. The `update-spec-tests.py` script just needs to be updated to include them.
* Fix some multi-value bugs; run spec testsBen Smith2018-09-061-16/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* [wasm2c] Add spec tests; fix update-spec-tests.py (#891)Ben Smith2018-08-141-13/+20
| | | | `update-spec-tests.py` now will update the tests in the `test/wasm2c/spec` directory.
* Add support for yapf python formatting tool (#276)Sam Clegg2017-01-181-2/+4
| | | | | | | | | | | | | | * 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.
* fix the interp/ tests, move the spec tests outBen Smith2016-09-291-1/+1
| | | | | Mostly just requires proper implementation of drop/tee_local in wasm-binary-reader-interpreter.c and wasm-interpreter.c.
* python3 supportBen Smith2016-09-011-2/+3
|
* update testsuite, handle implicit func types (#96)Ben Smith2016-08-041-0/+68
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.