https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117266

--- Comment #11 from H. Peter Anvin <hpa at zytor dot com> ---
For the record, MSVC has the following intrinsics, and no, I'm very much 
not in favor of their particular prototypes (a structure like div_t 
would be better than what they have.)

#include <immintrin.h>

unsigned __int64 _udiv128(
    unsigned __int64 highDividend,
    unsigned __int64 lowDividend,
    unsigned __int64 divisor,
    unsigned __int64 *remainder
);

__int64 _div128(
    __int64 highDividend,
    __int64 lowDividend,
    __int64 divisor,
    __int64 *remainder
);

For extra "flavor", the prototype for the 64/32 -> 32 version is
inconsistent in that it uses int64 instead of 2x int32:

unsigned int _udiv64(
    unsigned __int64 dividend,
    unsigned int divisor,
    unsigned int* remainder
);

int _div64(
    __int64 dividend,
    int divisor,
    int* remainder
);

Reply via email to