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:
Matthias Krüger 2021-12-11 17:35:26 +01:00 committed by GitHub
commit 60b9f3130d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -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