src/ppe/pk/ppe42/ppe42_gcc.c
// For the signed cases, we need to handle the special case that the dividend
// or divisor is the most negative integer.  
//
// If the dividend is the most negative integer, then dividing this integer by
// -1 would overflow as a positive quotient, so we set quotient and remainder
// to 0 in this case.  For divide by 1, the quotient is the most negative
// integer. Otherwise we adjust the dividend by the absolute value of the
// divisor, then fix up the quotient later by adding or subtracting 1.
//
// If the divisor is the most negative integer, then the quotient is always 0
// unless the dividend is also the most negative integer, in which case the
// quotient is 1 and the remainder is 0.
//
For the signed cases, we need to handle the special case that the dividend
or divisor is the most negative integer.

If the dividend is the most negative integer, then dividing this integer by
1 would overflow as a positive quotient, so we set quotient and remainder
to 0 in this case.  For divide by 1, the quotient is the most negative
integer. Otherwise we adjust the dividend by the absolute value of the
divisor, then fix up the quotient later by adding or subtracting 1.

If the divisor is the most negative integer, then the quotient is always 0
unless the dividend is also the most negative integer, in which case the
quotient is 1 and the remainder is 0.
For the signed cases we need to handle the special case that the dividend or divisor is the most negative integer . If the dividend is the most negative integer then dividing this integer by 1 would overflow as a positive quotient so we set quotient and remainder to 0 in this case . For divide by 1 the quotient is the most negative integer . Otherwise we adjust the dividend by the absolute value of the divisor then fix up the quotient later by adding or subtracting 1 . If the divisor is the most negative integer then the quotient is always 0 unless the dividend is also the most negative integer in which case the quotient is 1 and the remainder is 0 .
uint64_t 
__udivdi3(uint64_t u, uint64_t v)
{
    uint64_t quotient, remainder;
    __ppe42_udiv64(u, v, &quotient, &remainder);
    return quotient;
}
uint64_t __udivdi3 ( uint64_t u , uint64_t v ) { uint64_t quotient , remainder ; __ppe42_udiv64 ( u , v , & quotient , & remainder ) ; return quotient ; }
For the signed cases, we need to handle the special case that the dividend
or divisor is the most negative integer.
For the signed cases we need to handle the special case that the dividend or divisor is the most negative integer .