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.

__mulsi3

mulXi3.__mulsi3
pub fn __mulsi3(a: i32, b: i32) callconv(.c) i32

File

lib/compiler_rt/mulXi3.zig:18

Code

pub fn __mulsi3(a: i32, b: i32) callconv(.c) i32 {
    var ua: u32 = @bitCast(a);
    var ub: u32 = @bitCast(b);
    var r: u32 = 0;

    while (ua > 0) {
        if ((ua & 1) != 0) r +%= ub;
        ua >>= 1;
        ub <<= 1;
    }

    return @bitCast(r);
}