-
Notifications
You must be signed in to change notification settings - Fork 13k
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 for RISC-V architecture #91548
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Mark-Simulacrum (or someone else) soon. Please see the contribution instructions for more information. |
This commit also updates `stdarch` git submodule.
6293c09
to
70855b2
Compare
|
@Disasm Pause is in RISC-V I's hint space. It's unlike other architectures, although this extension is optional, these hint instructions will still run (but effectively as an no-op) on unsupported platforms (other architectures may throw illegal instruction). This design may make it useful on standard library functions for all platforms if I am correct ;) |
@luojia65 where can I read more about it? It's not obvious that this instruction is guaranteed to work even if not supported. |
r? @Amanieu |
@bors r+ |
📌 Commit 70855b2 has been approved by |
…anieu Add spin_loop hint for RISC-V architecture This commit uses the PAUSE instruction (rust-lang/stdarch#1262) to implement RISC-V spin loop, and updates `stdarch` submodule to use the merged PAUSE instruction.
…anieu Add spin_loop hint for RISC-V architecture This commit uses the PAUSE instruction (rust-lang/stdarch#1262) to implement RISC-V spin loop, and updates `stdarch` submodule to use the merged PAUSE instruction.
Probably caused this rollup failure, please check: #91658 (comment) |
Hello! I fixed probable rollup error in rust-lang/stdarch#1264, and updated submodule to include this fix. Now this pull request may build with CI passed. r? @Amanieu |
@bors r+ |
📌 Commit 0ccf58b has been approved by |
…anieu Add spin_loop hint for RISC-V architecture This commit uses the PAUSE instruction (rust-lang/stdarch#1262) to implement RISC-V spin loop, and updates `stdarch` submodule to use the merged PAUSE instruction.
…anieu Add spin_loop hint for RISC-V architecture This commit uses the PAUSE instruction (rust-lang/stdarch#1262) to implement RISC-V spin loop, and updates `stdarch` submodule to use the merged PAUSE instruction.
…anieu Add spin_loop hint for RISC-V architecture This commit uses the PAUSE instruction (rust-lang/stdarch#1262) to implement RISC-V spin loop, and updates `stdarch` submodule to use the merged PAUSE instruction.
…askrgr Rollup of 6 pull requests Successful merges: - rust-lang#83174 (Suggest using a temporary variable to fix borrowck errors) - rust-lang#89734 (Point at capture points for non-`'static` reference crossing a `yield` point) - rust-lang#90270 (Make `Borrow` and `BorrowMut` impls `const`) - rust-lang#90741 (Const `Option::cloned`) - rust-lang#91548 (Add spin_loop hint for RISC-V architecture) - rust-lang#91721 (Minor improvements to `future::join!`'s implementation) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This commit uses the PAUSE instruction (rust-lang/stdarch#1262) to implement RISC-V spin loop, and updates
stdarch
submodule to use the merged PAUSE instruction.