Skip to content

std: Enable atomic.fence emission on wasm32 #73036

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

Merged
merged 1 commit into from
Jun 12, 2020

Conversation

alexcrichton
Copy link
Member

@alexcrichton alexcrichton commented Jun 5, 2020

This commit removes the #[cfg] guards in atomic::fence on wasm
targets. Since these guards were originally added the upstream wasm
specification for threads gained an atomic.fence instruction, so LLVM
no longer panics on these intrinsics.

Although there aren't a ton of tests in-repo for this right now I've
tested locally and all of these fences generate atomic.fence
instructions in wasm.

Closes #65687
Closes #72997

This commit removes the `#[cfg]` guards in `atomic::fence` on wasm
targets. Since these guards were originally added the upstream wasm
specification for threads gained an `atomic.fence` instruction, so LLVM
no longer panics on these intrinsics.

Although there aren't a ton of tests in-repo for this right now I've
tested locally and all of these fences generate `atomic.fence`
instructions in wasm.

Closes rust-lang#72997
@rust-highfive
Copy link
Contributor

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 5, 2020
@Mark-Simulacrum
Copy link
Member

I suppose adding codegen tests for intrinsics doesn't seem to make that much sense, and it seems like this is the obvious thing to do. @bors r+

@bors
Copy link
Collaborator

bors commented Jun 5, 2020

📌 Commit 05b2d3f has been approved by Mark-Simulacrum

@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 Jun 5, 2020
@nikomatsakis
Copy link
Contributor

r? @Mark-Simulacrum

@kubo39
Copy link
Contributor

kubo39 commented Jun 7, 2020

This can close #65687 also, right?

@alexcrichton
Copy link
Member Author

Indeed!

bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 11, 2020
Rollup of 7 pull requests

Successful merges:

 - rust-lang#73033 (Fix #[thread_local] statics as asm! sym operands)
 - rust-lang#73036 (std: Enable atomic.fence emission on wasm32)
 - rust-lang#73163 (Add long error explanation for E0724)
 - rust-lang#73187 (Remove missed `cfg(bootstrap)`)
 - rust-lang#73195 (Provide suggestion to convert numeric op LHS rather than unwrapping RHS)
 - rust-lang#73247 (Add various Zulip notifications for prioritization)
 - rust-lang#73254 (Add comment about LocalDefId -> DefId)

Failed merges:

r? @ghost
@bors bors merged commit 3b41e54 into rust-lang:master Jun 12, 2020
@alexcrichton alexcrichton deleted the update-wasm-fence branch July 23, 2020 21:21
@cuviper cuviper added this to the 1.46 milestone May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Web Assembly Atomic fence support in atomic::fence implement fence for wasm32
7 participants