#[inline]
#[unstable(feature = "renamed_spin_loop", issue = "55002")]
pub fn spin_loop() {
- #[cfg(
- all(
- any(target_arch = "x86", target_arch = "x86_64"),
- target_feature = "sse2"
- )
- )] {
- #[cfg(target_arch = "x86")] {
+ #[cfg(all(any(target_arch = "x86", target_arch = "x86_64"), target_feature = "sse2"))]
+ {
+ #[cfg(target_arch = "x86")]
+ {
unsafe { crate::arch::x86::_mm_pause() };
}
- #[cfg(target_arch = "x86_64")] {
+ #[cfg(target_arch = "x86_64")]
+ {
unsafe { crate::arch::x86_64::_mm_pause() };
}
}
- #[cfg(
- any(
- target_arch = "aarch64",
- all(target_arch = "arm", target_feature = "v6")
- )
- )] {
- #[cfg(target_arch = "aarch64")] {
+ #[cfg(any(target_arch = "aarch64", all(target_arch = "arm", target_feature = "v6")))]
+ {
+ #[cfg(target_arch = "aarch64")]
+ {
unsafe { crate::arch::aarch64::__yield() };
}
- #[cfg(target_arch = "arm")] {
+ #[cfg(target_arch = "arm")]
+ {
unsafe { crate::arch::arm::__yield() };
}
}
pub fn black_box<T>(dummy: T) -> T {
// We need to "use" the argument in some way LLVM can't introspect, and on
// targets that support it we can typically leverage inline assembly to do
- // this. LLVM's intepretation of inline assembly is that it's, well, a black
+ // this. LLVM's interpretation of inline assembly is that it's, well, a black
// box. This isn't the greatest implementation since it probably deoptimizes
// more than we want, but it's so far good enough.
unsafe {