-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Add spin_loop_hint intrinsic #58870
Add spin_loop_hint intrinsic #58870
Conversation
r? @estebank (rust_highfive has picked a reviewer for you, use r? to override) |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
What did I do wrong? |
@@ -689,6 +690,27 @@ impl IntrinsicCallMethods<'tcx> for Builder<'a, 'll, 'tcx> { | |||
return; | |||
} | |||
|
|||
"spin_loop_hint" => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can (should) be implemented as a call to @llvm.x86.sse2.pause()
on x86/x86_64.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(i.e. __mm_pause
on x86 and an equivalent on Aarch still needs to be implemented(?))
I have a feeling that these instructions should be exposed by coresimd instead. |
r? @nagisa |
I think this should remain in |
I don’t mind them being exposed by |
I see. Maybe I will send coresimd a PR tomorrow. |
This removes one occurrence of inline assembly in libcore, leaving only:
This makes life easier for alternative codegen backends which don't (yet) support inline asm by not needing to patch libcore to remove it.
cc https://github.com/bjorn3/rustc_codegen_cranelift/issues/337