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

non-temporal stores: document interaction with Rust memory model #1534

Merged
merged 1 commit into from
Feb 21, 2024

Conversation

RalfJung
Copy link
Member

This is my proposed alternative to #1457. It builds on the model I sketched here.

Changing the docs alone is not sufficient IMO, we also should stop using LLVM's non-temporal hint as LLVM passes do not properly take into account the non-standard nature of non-temporal stores. Originally I thought these all have to become inline assembly, but now I noticed that some of these operations are using different LLVM intrinsics:

    #[link_name = "llvm.x86.sse4a.movnt.sd"]
    fn movntsd(x: *mut f64, y: __m128d);
    #[link_name = "llvm.x86.sse4a.movnt.ss"]
    fn movntss(x: *mut f32, y: __m128);

Do these intrinsics exist for the other operations as well, e.g. for movntps? I found llvm.x86.avx.movnt.ps.256 but ofc for the SSE intrinsic we'd want the 128bit version of that. If that exists, using those might be better than using inline assembly? Though of course if LLVM passes treat these intrinsics like regular stores, that would still be wrong.

@rustbot
Copy link
Collaborator

rustbot commented Feb 18, 2024

r? @Amanieu

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

@RalfJung RalfJung force-pushed the non-temporal-store branch 2 times, most recently from 684844e to d236e1c Compare February 19, 2024 07:31
@RalfJung
Copy link
Member Author

CI failures seem unrelated to this PR.

@Amanieu Amanieu merged commit c8ae80e into rust-lang:master Feb 21, 2024
27 checks passed
@RalfJung RalfJung deleted the non-temporal-store branch February 21, 2024 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants