Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement the wide-arithmetic proposal #9403

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

alexcrichton
Copy link
Member

This commit implements the wide-arithmetic proposal in Wasmtime. This is a pretty easy proposal to implement due to Cranelift already having support for all the various instructions. The features implemented here are:

  • Cranelift support for the four new instructions.
  • A new Config::wasm_wide_arithmetic option.
  • A new -Wwide-arithmetic CLI flag.
  • A new wasmtime_config_wasm_wide_arithmetic_set C API function.
  • Support for fuzzing this proposal
    • Generation is implemented in wasm-smith .
    • While it's off-by-default in wasm-smith it's enabled-by-default here.
    • Differential execution is only possible against Wasmtime right now.
    • Single-instruction module support was added for these new instructions.
  • Tests for some simple cases plus randomly-generated tests.
  • Example disassemblies for new instructions on Cranelift architectures.

This commit implements the [wide-arithmetic] proposal in Wasmtime. This
is a pretty easy proposal to implement due to Cranelift already having
support for all the various instructions. The features implemented here
are:

* Cranelift support for the four new instructions.
* A new `Config::wasm_wide_arithmetic` option.
* A new `-Wwide-arithmetic` CLI flag.
* A new `wasmtime_config_wasm_wide_arithmetic_set` C API function.
* Support for fuzzing this proposal
  * Generation is implemented in `wasm-smith` .
  * While it's off-by-default in `wasm-smith` it's enabled-by-default here.
  * Differential execution is only possible against Wasmtime right now.
  * Single-instruction module support was added for these new instructions.
* Tests for some simple cases plus randomly-generated tests.
* Example disassemblies for new instructions on Cranelift architectures.

[wide-arithmetic]: https://github.com/WebAssembly/wide-arithmetic
@alexcrichton alexcrichton requested review from a team as code owners October 8, 2024 21:37
@alexcrichton alexcrichton requested review from fitzgen and removed request for a team October 8, 2024 21:37
Copy link
Member

@fitzgen fitzgen left a comment

Choose a reason for hiding this comment

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

Very nice!

@fitzgen fitzgen added this pull request to the merge queue Oct 8, 2024
Merged via the queue into bytecodealliance:main with commit 72ded10 Oct 8, 2024
41 checks passed
@alexcrichton alexcrichton deleted the wide-arithmetic branch October 8, 2024 22:21
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.

2 participants