Skip to content

Commit 85830eb

Browse files
committed
Add spin_loop hint for LoongArch
1 parent 176d8db commit 85830eb

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

library/core/src/hint.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,16 @@ pub fn spin_loop() {
301301
// with support for the v6 feature.
302302
unsafe { crate::arch::arm::__yield() };
303303
}
304+
305+
#[cfg(target_arch = "loongarch32")]
306+
{
307+
crate::arch::loongarch32::ibar::<0>();
308+
}
309+
310+
#[cfg(target_arch = "loongarch64")]
311+
{
312+
crate::arch::loongarch64::ibar::<0>();
313+
}
304314
}
305315

306316
/// An identity function that *__hints__* to the compiler to be maximally pessimistic about what

0 commit comments

Comments
 (0)