Skip to content

Conversation

@AugustusHuang
Copy link
Contributor

No description provided.

@jfbastien
Copy link
Member

Confirming that Xuxing Huang is a member of the W3C CG. Thanks!

@rossberg
Copy link
Member

lgtm

@AugustusHuang
Copy link
Contributor Author

Picked +/-0, +/- INT_MAX, +/-1 to test Int2Float, 0, 1, +/- MOST-POSITIVE-DOUBLE(SINGLE)-FLOAT, +/- LEAST-POSITIVE-DOUBLE(SINGLE)-FLOAT to test reinterpretFloat2Int, some of the results of reinterpretInt2Float will generate NaN so I didn't add them. All tests have one or more random cases :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The wasm parser does recognize hexadecimal constants now, so you can write the constant directly now instead of writing it in decimal and having a comment :-).

@sunfishcode
Copy link
Member

This looks good!

One thing to watch out for: Constants such as 2147483647, 9223372036854775807, and 1234567890 are not exactly representable as f32 values; the wasm parser is silently rounding them. This is obviously not ideal. Eventually we should implement hexadecimal float literal parsing, and then we'll probably convert most of these tests to use it, but if you want to be tidy in the mean time, it'd be nice to avoid values that need rounding.

If you're interested in writing more conversion tests, here are some further ideas :-) :

  • Conversions with unsigned inputs will need to be tested with the maximum unsigned value of the type. For example, we'll need to test f32.convert_u/i32 against 0xffffffff and so on.
  • Conversions involving floating point will need to be tested for correct rounding. For example, the trunc conversions are defined to round toward zero, so we should make sure that a positive number rounds down even when the nearest integer is up, and a negative number rounds up even when the nearest integer is down, and so on. For conversions that round to nearest, we should test that a positive number is rounded down to nearest, a negative number is rounded up to nearest, and a number halfway between two integers is rounded to the even integer.
  • trunc conversions will need to test that values just outside the i32 range can be rounded into a valid i32 value.

We'll also eventually need to add -0, NaN, Infinity, and trapping cases, though as you noticed these aren't all convenient to do right now. I have some possible ideas for this in this branch, though there's discussion ongoing about them in #70.

sunfishcode added a commit that referenced this pull request Sep 23, 2015
@sunfishcode sunfishcode merged commit 8cb562c into WebAssembly:master Sep 23, 2015
littledan pushed a commit to littledan/spec that referenced this pull request Mar 4, 2018
littledan pushed a commit to littledan/spec that referenced this pull request Mar 4, 2018
Revert "Update docs to allow import/export mut globals (WebAssembly#81)"

This reverts commit 5d2ad6e.

Revert "Support import/export mut globals in interpreter (WebAssembly#80)"

This reverts commit 07a6fb2.
eqrion pushed a commit to eqrion/wasm-spec that referenced this pull request Jul 18, 2019
dhil pushed a commit to dhil/webassembly-spec that referenced this pull request Mar 2, 2023
dhil added a commit to dhil/webassembly-spec that referenced this pull request Aug 30, 2024
This patch redefines the `switch` instruction such that it only takes a single immediate type (in addition to the tag).

Resolves WebAssembly#76.
stevenfontanella pushed a commit to stevenfontanella/spec that referenced this pull request Nov 12, 2025
spec:
    WebAssembly@22854975
  exception-handling:
    WebAssembly/exception-handling@d399b9e0

The `update-testsuite.sh` will not include files under `legacy` as
well as `core`.  This is so that the legacy exception handling tests
are now included.

The test updates themselves were automatically generated by
`update-testsuite.sh`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants