From 7cc102a4ee349e31baf2ee24be0634ad80fe4cdc Mon Sep 17 00:00:00 2001 From: Jonathan 'theJPster' Pallant Date: Fri, 19 Dec 2025 11:02:19 +0000 Subject: [PATCH] Revised yield hints Turns out v7 targets always have v6t2 set, so that line was redundant. Also add a link to the Arm Armv7 A.R.M. --- library/core/src/hint.rs | 7 ++++--- library/stdarch/crates/core_arch/src/arm_shared/hints.rs | 3 +-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/library/core/src/hint.rs b/library/core/src/hint.rs index e945b40dfaa5..b7f78288b2b6 100644 --- a/library/core/src/hint.rs +++ b/library/core/src/hint.rs @@ -298,11 +298,12 @@ pub fn spin_loop() { all(target_feature = "v6k", not(target_feature = "thumb-mode")), target_feature = "v6t2", all(target_feature = "v6", target_feature = "mclass"), - target_feature = "v7", ) ) => { - // SAFETY: the `cfg` attr ensures that we only execute this on arm targets - // with support for the v6 feature. + // SAFETY: the `cfg` attr ensures that we only execute this on arm + // targets with support for the this feature. On ARMv6 in Thumb + // mode, T2 is required (see Arm DDI0406C Section A8.8.427), + // otherwise ARMv6-M or ARMv6K is enough unsafe { crate::arch::arm::__yield() } } target_arch = "loongarch32" => crate::arch::loongarch32::ibar::<0>(), diff --git a/library/stdarch/crates/core_arch/src/arm_shared/hints.rs b/library/stdarch/crates/core_arch/src/arm_shared/hints.rs index dade0d99e5a2..8a25cc1163cc 100644 --- a/library/stdarch/crates/core_arch/src/arm_shared/hints.rs +++ b/library/stdarch/crates/core_arch/src/arm_shared/hints.rs @@ -83,12 +83,11 @@ pub unsafe fn __sevl() { /// improve overall system performance. // Section 10.1 of ACLE says that the supported arches are: 8, 6K, 6-M // LLVM says "instruction requires: armv6k" -// On ARMv6 in Thumb mode, T2 is required. +// On ARMv6 in Thumb mode, T2 is required (see Arm DDI0406C Section A8.8.427) #[cfg(any( all(target_feature = "v6k", not(target_feature = "thumb-mode")), target_feature = "v6t2", all(target_feature = "v6", target_feature = "mclass"), - target_feature = "v7", target_arch = "aarch64", target_arch = "arm64ec", doc