authorgravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2021-05-02 18:52:08+02:00
committergravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2021-05-03 12:32:13+02:00
loga7f3e12d23aa59ef3a6d78b1eb10a2a0d688906a
treee45bea1ae26df926f17da6e584ab80736c1b84c4
parent792cf925ec170ddcb42a2d78ab8f464642e92b17

std: Add fallback on pre-v6 ARM targets

Thanks xackus for noticing the missing else branch.

1 files changed, 3 insertions(+), 1 deletions(-)

lib/std/Thread.zig+3-1
......@@ -76,7 +76,9 @@ pub fn spinLoopHint() callconv(.Inline) void {
7676 .arm, .armeb, .thumb, .thumbeb => {
7777 // `yield` was introduced in v6k but are also available on v6m.
7878 const can_yield = comptime std.Target.arm.featureSetHasAny(std.Target.current.cpu.features, .{ .has_v6k, .has_v6m });
79 if (can_yield) asm volatile ("yield" ::: "memory");
79 if (can_yield) asm volatile ("yield" ::: "memory")
80 // Fallback.
81 else asm volatile ("" ::: "memory");
8082 },
8183 .aarch64, .aarch64_be, .aarch64_32 => {
8284 asm volatile ("isb" ::: "memory");