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.

__hexagon_divsi3

hexagon.__hexagon_divsi3
fn __hexagon_divsi3() callconv(.naked) noreturn

File

lib/compiler_rt/hexagon.zig:6

Code

fn __hexagon_divsi3() callconv(.naked) noreturn {
    asm volatile (
        \\ {
        \\   p0 = cmp.ge(r0,#0)
        \\   p1 = cmp.ge(r1,#0)
        \\   r1 = abs(r0)
        \\   r2 = abs(r1)
        \\  }
        \\  {
        \\   r3 = cl0(r1)
        \\   r4 = cl0(r2)
        \\   r5 = sub(r1,r2)
        \\   p2 = cmp.gtu(r2,r1)
        \\  }
        \\  {
        \\   r0 = #0
        \\   p1 = xor(p0,p1)
        \\   p0 = cmp.gtu(r2,r5)
        \\   if (p2) jumpr r31
        \\  }
        \\
        \\  {
        \\   r0 = mux(p1,#-1,#1)
        \\   if (p0) jumpr r31
        \\   r4 = sub(r4,r3)
        \\   r3 = #1
        \\  }
        \\  {
        \\   r0 = #0
        \\   r3:2 = vlslw(r3:2,r4)
        \\   loop0(1f,r4)
        \\  }
        \\  .falign
        \\ 1:
        \\  {
        \\   p0 = cmp.gtu(r2,r1)
        \\   if (!p0.new) r1 = sub(r1,r2)
        \\   if (!p0.new) r0 = add(r0,r3)
        \\   r3:2 = vlsrw(r3:2,#1)
        \\  }:endloop0
        \\  {
        \\   p0 = cmp.gtu(r2,r1)
        \\   if (!p0.new) r0 = add(r0,r3)
        \\   if (!p1) jumpr r31
        \\  }
        \\  {
        \\   r0 = neg(r0)
        \\   jumpr r31
        \\  }
    );
}