authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-08-09 16:08:52+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-08-09 17:53:04+02:00
logb29a6e3925311d01296156992cc71c1c8f39b07c
tree11fc5f94b83cecd07a27a9bb30d0f6cf944e2117
parent0125c27363f8b36d17ce53fee33a7e807c9ce167
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.atomic: fix conditions for using yield on arm/thumb in spinLoopHint


1 files changed, 5 insertions(+), 2 deletions(-)

lib/std/atomic.zig+5-2
......@@ -377,13 +377,16 @@ pub inline fn spinLoopHint() void {
377377 .aarch64_be,
378378 => asm volatile ("isb"),
379379
380 // `yield` was introduced in v6k but is also available on v6m.
381380 // https://www.keil.com/support/man/docs/armasm/armasm_dom1361289926796.htm
382381 .arm,
383382 .armeb,
383 => if (comptime builtin.cpu.has(.arm, .has_v6k)) {
384 asm volatile ("yield");
385 },
386
384387 .thumb,
385388 .thumbeb,
386 => if (comptime builtin.cpu.hasAny(.arm, &.{ .has_v6k, .has_v6m })) {
389 => if (comptime builtin.cpu.hasAny(.arm, &.{ .has_v6m, .thumb2 })) {
387390 asm volatile ("yield");
388391 },
389392