mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
Rollup merge of #91548 - luojia65:hint-spin-loop-riscv, r=Amanieu
Add spin_loop hint for RISC-V architecture This commit uses the PAUSE instruction (https://github.com/rust-lang/stdarch/pull/1262) to implement RISC-V spin loop, and updates `stdarch` submodule to use the merged PAUSE instruction.
This commit is contained in:
commit
60b9f3130d
@ -137,6 +137,11 @@ pub fn spin_loop() {
|
||||
unsafe { crate::arch::arm::__yield() };
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))]
|
||||
{
|
||||
crate::arch::riscv::pause();
|
||||
}
|
||||
}
|
||||
|
||||
/// An identity function that *__hints__* to the compiler to be maximally pessimistic about what
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit cfba59fccd90b3b52a614120834320f764ab08d1
|
||||
Subproject commit b70ae88ef2a6c83acad0a1e83d5bd78f9655fd05
|
Loading…
Reference in New Issue
Block a user