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

Add a new wide-arithmetic feature for WebAssembly #132077

Merged
merged 1 commit into from
Nov 6, 2024

Conversation

alexcrichton
Copy link
Member

This commit adds a new rustc target feature named wide-arithmetic for WebAssembly targets. This corresponds to the wide-arithmetic proposal for WebAssembly which adds new instructions catered towards accelerating integer arithmetic larger than 64-bits. This proposal to WebAssembly is not standard yet so this new feature is flagged as an unstable target feature. Additionally Rust's LLVM version doesn't support this new feature yet since support will first be added in LLVM 20, so the feature filtering logic for LLVM is updated to handle this.

I'll also note that I'm not currently planning to add wasm-specific intrinsics to std::arch::wasm32 at this time. The currently proposed instructions are all accessible through i128 or u128-based operations which Rust already supports, so intrinsic shouldn't be necessary to get access to these new instructions.

@alexcrichton alexcrichton added the O-wasm Target: WASM (WebAssembly), http://webassembly.org/ label Oct 23, 2024
@rustbot
Copy link
Collaborator

rustbot commented Oct 23, 2024

r? @estebank

rustbot has assigned @estebank.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 23, 2024
@rustbot
Copy link
Collaborator

rustbot commented Oct 23, 2024

Some changes occurred in tests/ui/check-cfg

cc @Urgau

@bors
Copy link
Contributor

bors commented Oct 27, 2024

☔ The latest upstream changes (presumably #131900) made this pull request unmergeable. Please resolve the merge conflicts.

This commit adds a new rustc target feature named `wide-arithmetic` for
WebAssembly targets. This corresponds to the [wide-arithmetic] proposal
for WebAssembly which adds new instructions catered towards accelerating
integer arithmetic larger than 64-bits. This proposal to WebAssembly is
not standard yet so this new feature is flagged as an unstable target
feature. Additionally Rust's LLVM version doesn't support this new
feature yet since support will first be added in LLVM 20, so the
feature filtering logic for LLVM is updated to handle this.

I'll also note that I'm not currently planning to add wasm-specific
intrinsics to `std::arch::wasm32` at this time. The currently proposed
instructions are all accessible through `i128` or `u128`-based
operations which Rust already supports, so intrinsic shouldn't be
necessary to get access to these new instructions.

[wide-arithmetic]: https://github.com/WebAssembly/wide-arithmetic
@alexcrichton
Copy link
Member Author

ping @estebank, I'm happy to re-roll review here or otherwise seek out a reviewer if you're busy though

@jieyouxu
Copy link
Member

jieyouxu commented Nov 5, 2024

I'll take a look.
r? jieyouxu

@rustbot rustbot assigned jieyouxu and unassigned estebank Nov 5, 2024
Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

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

Since this is an unstable flag, this LGTM, thanks!

@jieyouxu
Copy link
Member

jieyouxu commented Nov 5, 2024

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Nov 5, 2024

📌 Commit f534974 has been approved by jieyouxu

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 5, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 6, 2024
…iaskrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#131261 (Stabilize `UnsafeCell::from_mut`)
 - rust-lang#131405 (bootstrap/codegen_ssa: ship llvm-strip and use it for -Cstrip)
 - rust-lang#132077 (Add a new `wide-arithmetic` feature for WebAssembly)
 - rust-lang#132562 (Remove the `wasm32-wasi` target from rustc)
 - rust-lang#132660 (Remove unused errs.rs file)

Failed merges:

 - rust-lang#131721 (Add new unstable feature `const_eq_ignore_ascii_case`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 088e698 into rust-lang:master Nov 6, 2024
6 checks passed
@rustbot rustbot added this to the 1.84.0 milestone Nov 6, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Nov 6, 2024
Rollup merge of rust-lang#132077 - alexcrichton:wide-arithmetic, r=jieyouxu

Add a new `wide-arithmetic` feature for WebAssembly

This commit adds a new rustc target feature named `wide-arithmetic` for WebAssembly targets. This corresponds to the [wide-arithmetic] proposal for WebAssembly which adds new instructions catered towards accelerating integer arithmetic larger than 64-bits. This proposal to WebAssembly is not standard yet so this new feature is flagged as an unstable target feature. Additionally Rust's LLVM version doesn't support this new feature yet since support will first be added in LLVM 20, so the feature filtering logic for LLVM is updated to handle this.

I'll also note that I'm not currently planning to add wasm-specific intrinsics to `std::arch::wasm32` at this time. The currently proposed instructions are all accessible through `i128` or `u128`-based operations which Rust already supports, so intrinsic shouldn't be necessary to get access to these new instructions.

[wide-arithmetic]: https://github.com/WebAssembly/wide-arithmetic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-wasm Target: WASM (WebAssembly), http://webassembly.org/ S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants