Skip to content

atomic volatile: add intrinsics - #160058

Open
RalfJung wants to merge 1 commit into
rust-lang:mainfrom
RalfJung:atomic-volatile
Open

atomic volatile: add intrinsics#160058
RalfJung wants to merge 1 commit into
rust-lang:mainfrom
RalfJung:atomic-volatile

Conversation

@RalfJung

@RalfJung RalfJung commented Jul 28, 2026

Copy link
Copy Markdown
Member

Extend the atomic load/store intrinsics to also support volatile atomic load/store.
Tracking issue: #158947.
Library APIs that use these intrinsics will be added inn a future PR.

The GCC and cranelift implementations ignore the volatile flag, not sure how that should be implemented for them.

@rustbot

rustbot commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

rustc_codegen_gcc is developed in its own repository. If possible, consider making this change to rust-lang/rustc_codegen_gcc instead.

cc @antoyo, @GuillaumeGomez

Some changes occurred to the intrinsics. Make sure the CTFE / Miri interpreter
gets adapted for the changes, if necessary.

cc @rust-lang/miri, @oli-obk, @lcnr

rustc_codegen_cranelift is developed in its own repository. If possible, consider making this change to rust-lang/rustc_codegen_cranelift instead.

cc @bjorn3

miri is developed in its own repository. If the Miri part of this change can be broken out, consider making this change to rust-lang/miri instead. However, if Miri needs adjusting for rustc changes, just ignore this message.

cc @rust-lang/miri

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. 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. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jul 28, 2026
@rustbot

rustbot commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

r? @nia-e

rustbot has assigned @nia-e.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: libs
  • libs expanded to 12 candidates
  • Random selection from 6 candidates

@rust-log-analyzer

This comment has been minimized.

@nia-e

nia-e commented Jul 28, 2026

Copy link
Copy Markdown
Member

library stuff looks fine, but the rest is not my prerogative :D

r? compiler

@rustbot rustbot assigned TaKO8Ki and unassigned nia-e Jul 28, 2026
@rust-log-analyzer

This comment has been minimized.

@bjorn3

bjorn3 commented Jul 28, 2026

Copy link
Copy Markdown
Member

Cranelift doesn't currently have a way to do volatile memory operations. In the past this was not an issue given the lack of optimizations on memory operations, but those recently got added, so volatile support now needs to be added on the Cranelift side.

@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@rustbot

rustbot commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri

Some changes occurred to the CTFE machinery

cc @oli-obk, @lcnr

@rustbot

rustbot commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

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

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. 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. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants