Zig 0.17.0-dev (Split by item)

This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig library itself.

__aarch64_cas4_acq_rel

aarch64_outline_atomics.__aarch64_cas4_acq_rel
fn __aarch64_cas4_acq_rel() align(16) callconv(.naked) void

File

lib/compiler_rt/aarch64_outline_atomics.zig:1334

Code

fn __aarch64_cas4_acq_rel() align(16) callconv(.naked) void {
    @setRuntimeSafety(false);
    asm volatile (
        \\        cbz     w16, 8f
        \\        .inst 0x08a07c41 + 0x80000000 + 0x408000
        \\        ret
        \\8:
        \\        mov    w16, w0
        \\0:
        \\        ldaxr   w0, [x2]
        \\        cmp    w0, w16
        \\        bne    1f
        \\        stlxr   w17, w1, [x2]
        \\        cbnz   w17, 0b
        \\1:
        \\        ret
        :
        : [__aarch64_have_lse_atomics] "{w16}" (__aarch64_have_lse_atomics),
        : .{ .w15 = true, .w16 = true, .w17 = true, .memory = true });
    unreachable;
}