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_ldset4_acq

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

File

lib/compiler_rt/aarch64_outline_atomics.zig:1194

Code

fn __aarch64_ldset4_acq() align(16) callconv(.naked) void {
    @setRuntimeSafety(false);
    asm volatile (
        \\        cbz     w16, 8f
        \\        .inst 0x38200020 + 0x3000 + 0x80000000 + 0x800000
        \\        ret
        \\8:
        \\        mov    w16, w0
        \\0:
        \\        ldaxr   w0, [x1]
        \\        orr     w17, w0, w16
        \\        stxr   w15, w17, [x1]
        \\        cbnz   w15, 0b
        \\1:
        \\        ret
        :
        : [__aarch64_have_lse_atomics] "{w16}" (__aarch64_have_lse_atomics),
        : .{ .w15 = true, .w16 = true, .w17 = true, .memory = true });
    unreachable;
}