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.

__subvsi3

subvsi3.__subvsi3
pub fn __subvsi3(a: i32, b: i32) callconv(.c) i32

File

lib/compiler_rt/subvsi3.zig:9

Code

pub fn __subvsi3(a: i32, b: i32) callconv(.c) i32 {
    const sum = a -% b;
    // Overflow occurred iff the operands have opposite signs, and the sign of the
    // sum is the opposite of the lhs sign.
    if (((a ^ b) & (sum ^ a)) < 0) @panic("compiler-rt: integer overflow");
    return sum;
}