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

rustc: Prepare the `atomics` feature for wasm #53878

Merged
merged 1 commit into from Sep 5, 2018

Conversation

Projects
None yet
5 participants
@alexcrichton
Member

alexcrichton commented Sep 1, 2018

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.

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.
@rust-highfive

This comment has been minimized.

Show comment
Hide comment
@rust-highfive

rust-highfive Sep 1, 2018

Collaborator

r? @pnkfelix

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

Collaborator

rust-highfive commented Sep 1, 2018

r? @pnkfelix

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

@alexcrichton

This comment has been minimized.

Show comment
Hide comment
@alexcrichton
Member

alexcrichton commented Sep 1, 2018

r? @eddyb

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

@eddyb

This comment has been minimized.

Show comment
Hide comment
@eddyb

eddyb Sep 4, 2018

Member

@bors r+

Member

eddyb commented Sep 4, 2018

@bors r+

@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Sep 4, 2018

Contributor

📌 Commit fc497d0 has been approved by eddyb

Contributor

bors commented Sep 4, 2018

📌 Commit fc497d0 has been approved by eddyb

@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Sep 5, 2018

Contributor

⌛️ Testing commit fc497d0 with merge d8af8b6...

Contributor

bors commented Sep 5, 2018

⌛️ Testing commit fc497d0 with merge d8af8b6...

bors added a commit that referenced this pull request Sep 5, 2018

Auto merge of #53878 - alexcrichton:wasm-atomics-feature, r=eddyb
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

This comment has been minimized.

Show comment
Hide comment
@bors

bors Sep 5, 2018

Contributor

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

Contributor

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

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details

@alexcrichton alexcrichton deleted the alexcrichton:wasm-atomics-feature branch Sep 5, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment