rustc: Stabilize the WebAssembly wide-arithmetic feature - #160877
rustc: Stabilize the WebAssembly wide-arithmetic feature#160877alexcrichton wants to merge 1 commit into
wide-arithmetic feature#160877Conversation
|
Some changes occurred in src/doc/rustc/src/platform-support cc @Noratrieb |
|
rustbot has assigned @JonathanBrouwer. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
I'll note that I'm doing this initially as "just a PR" since IIRC that's the process for stabilizing minor target features, but please let me know if there's a separate process I should follow and I'd be happy to do so! Also, I've got a sibling PR for the reference. |
Could you point me to what precedent your basing this on? (i.e. previous PRs that did the same?)
But I've never reviewed a stabilization of a target feature before, so I could very well be missing something |
|
My historical data point here is #131080, but I'd also be happy to go the MCP route as I suspect it won't be really all that much extra work. Do you have a preference though of MCP vs FCP-here? |
|
Ooh I found further on in the page
So we should start an FCP here |
This commit stabilizes the `wide-arithmetic` target feature for WebAssembly targets. This [upstream WebAssembly proposal][repo] has [now reached phase 4][phase] in the WebAssembly CG standardization process which means that it's expected to ship shortly in browsers/engines and is considered stable. This is intended to be a sibling PR to rust-lang/rust to reflect the stability of the proposal in LLVM/engines to allow users to enable this in downstream code without warnings. To recap what `wide-arithmetic` is -- this is a target feature for all WebAssembly targets for Rust. This feature corresponds to the LLVM `wide-arithmetic` target feature and gates generation of four new instructions added in the [wide-arithmetic proposal][repo], primarily centered around 128-bit addition/subtraction and a widening 64x64-bit multiply producing a 128-bit result. This target feature has no library APIs, no impact on the Rust language, nor any impact on ABIs anywhere. The only change is that more efficient codegen is generated for some operations, primarily 128-bit multiplication. Generally speaking it's expected that users should be able to enable this feature, recompile with today's source code, and see speedups if these operations are bottlenecks. This feature is off-by-default and requires `-Ctarget-feature=...` or similar to enable it. This feature will not be on-by-default for quite some time while engine support percolates and (ideally) becomes pervasive. [repo]: https://github.com/webassembly/wide-arithmetic [phase]: WebAssembly/proposals#239
fb9ccd8 to
3a51e4d
Compare
|
I was just gonna say I don't think we have any test coverage for the target feature, but you were a few seconds quicker :p |
|
@rfcbot fcp merge |
|
@wesleywiser has proposed to merge this. The next step is review by the rest of the tagged team members:
No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
|
cc @rust-lang/lang @rust-lang/lang-docs @rust-lang/fls |
|
Yay for a better output from https://doc.rust-lang.org/std/primitive.u64.html#method.carrying_mul_add in WASM :) |
This commit stabilizes the
wide-arithmetictarget feature for WebAssembly targets. This upstream WebAssembly proposal has now reached phase 4 in the WebAssembly CG standardization process which means that it's expected to ship shortly in browsers/engines and is considered stable. This is intended to be a sibling PR to rust-lang/rust to reflect the stability of the proposal in LLVM/engines to allow users to enable this in downstream code without warnings.To recap what
wide-arithmeticis -- this is a target feature for all WebAssembly targets for Rust. This feature corresponds to the LLVMwide-arithmetictarget feature and gates generation of four new instructions added in the wide-arithmetic proposal, primarily centered around 128-bit addition/subtraction and a widening 64x64-bit multiply producing a 128-bit result. This target feature has no library APIs, no impact on the Rust language, nor any impact on ABIs anywhere. The only change is that more efficient codegen is generated for some operations, primarily 128-bit multiplication. Generally speaking it's expected that users should be able to enable this feature, recompile with today's source code, and see speedups if these operations are bottlenecks.This feature is off-by-default and requires
-Ctarget-feature=...or similar to enable it. This feature will not be on-by-default for quite some time while engine support percolates and (ideally) becomes pervasive.