Skip to content

rustc: Prepare the atomics feature for wasm #53878

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
Sep 5, 2018

Conversation

alexcrichton
Copy link
Member

This commit adds a few changes for atomic instructions on the
wasm32-unknown-unknown target. Atomic instructions are not yet stable in
WebAssembly itself but there are multiple implementations and LLVM has support
for the proposed instruction set, so let's work on exposing it!

Here there are a few inclusions:

  • The atomics feature was whitelisted for LLVM, allowing code in Rust to
    enable/disable/gate on this.

  • The singlethread option is turned off for wasm when the atomics feature is
    enabled. This means that by default wasm won't be lowering with atomics, but
    when atomics are enabled globally we'll turn off single-threaded mode to
    actually codegen atomics. This probably isn't what we'll want in the long term
    but for now it should work.

  • Finally the maximum atomic width is increased to 64 to reflect the current
    wasm spec.

This commit adds a few changes for atomic instructions on the
`wasm32-unknown-unknown` target. Atomic instructions are not yet stable in
WebAssembly itself but there are multiple implementations and LLVM has support
for the proposed instruction set, so let's work on exposing it!

Here there are a few inclusions:

* The `atomics` feature was whitelisted for LLVM, allowing code in Rust to
  enable/disable/gate on this.

* The `singlethread` option is turned off for wasm when the `atomics` feature is
  enabled. This means that by default wasm won't be lowering with atomics, but
  when atomics are enabled globally we'll turn off single-threaded mode to
  actually codegen atomics. This probably isn't what we'll want in the long term
  but for now it should work.

* Finally the maximum atomic width is increased to 64 to reflect the current
  wasm spec.
@rust-highfive
Copy link
Contributor

r? @pnkfelix

(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 Sep 1, 2018
@alexcrichton
Copy link
Member Author

r? @eddyb

@rust-highfive rust-highfive assigned eddyb and unassigned pnkfelix Sep 1, 2018
@eddyb
Copy link
Member

eddyb commented Sep 4, 2018

@bors r+

@bors
Copy link
Collaborator

bors commented Sep 4, 2018

📌 Commit fc497d0 has been approved by eddyb

@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 Sep 4, 2018
@bors
Copy link
Collaborator

bors commented Sep 5, 2018

⌛ Testing commit fc497d0 with merge d8af8b6...

bors added a commit that referenced this pull request Sep 5, 2018
rustc: Prepare the `atomics` feature for wasm

This commit adds a few changes for atomic instructions on the
`wasm32-unknown-unknown` target. Atomic instructions are not yet stable in
WebAssembly itself but there are multiple implementations and LLVM has support
for the proposed instruction set, so let's work on exposing it!

Here there are a few inclusions:

* The `atomics` feature was whitelisted for LLVM, allowing code in Rust to
  enable/disable/gate on this.

* The `singlethread` option is turned off for wasm when the `atomics` feature is
  enabled. This means that by default wasm won't be lowering with atomics, but
  when atomics are enabled globally we'll turn off single-threaded mode to
  actually codegen atomics. This probably isn't what we'll want in the long term
  but for now it should work.

* Finally the maximum atomic width is increased to 64 to reflect the current
  wasm spec.
@bors
Copy link
Collaborator

bors commented Sep 5, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: eddyb
Pushing d8af8b6 to master...

@bors bors merged commit fc497d0 into rust-lang:master Sep 5, 2018
@alexcrichton alexcrichton deleted the wasm-atomics-feature branch September 5, 2018 16:23
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.

5 participants