|
|
@ -150,7 +150,7 @@ inline uint32_t divUnit(uint32_t *pr, uint32_t H, uint32_t L, uint32_t y) |
|
|
|
#if MCL_SIZEOF_UNIT == 8 |
|
|
|
#if MCL_SIZEOF_UNIT == 8 |
|
|
|
inline uint64_t divUnit(uint64_t *pr, uint64_t H, uint64_t L, uint64_t y) |
|
|
|
inline uint64_t divUnit(uint64_t *pr, uint64_t H, uint64_t L, uint64_t y) |
|
|
|
{ |
|
|
|
{ |
|
|
|
#if defined(MCL_VINT_64BIT_PORTABLE) |
|
|
|
#if defined(MCL_VINT_64BIT_PORTABLE) || (defined(_MSC_VER) && _MSC_VER < 1920) |
|
|
|
uint32_t px[4] = { uint32_t(L), uint32_t(L >> 32), uint32_t(H), uint32_t(H >> 32) }; |
|
|
|
uint32_t px[4] = { uint32_t(L), uint32_t(L >> 32), uint32_t(H), uint32_t(H >> 32) }; |
|
|
|
uint32_t py[2] = { uint32_t(y), uint32_t(y >> 32) }; |
|
|
|
uint32_t py[2] = { uint32_t(y), uint32_t(y >> 32) }; |
|
|
|
size_t xn = 4; |
|
|
|
size_t xn = 4; |
|
|
@ -162,7 +162,7 @@ inline uint64_t divUnit(uint64_t *pr, uint64_t H, uint64_t L, uint64_t y) |
|
|
|
*pr = make64(r[1], r[0]); |
|
|
|
*pr = make64(r[1], r[0]); |
|
|
|
return make64(q[1], q[0]); |
|
|
|
return make64(q[1], q[0]); |
|
|
|
#elif defined(_MSC_VER) |
|
|
|
#elif defined(_MSC_VER) |
|
|
|
#error "divUnit for uint64_t is not supported" |
|
|
|
return _udiv128(H, L, y, pr); |
|
|
|
#else |
|
|
|
#else |
|
|
|
typedef __attribute__((mode(TI))) unsigned int uint128; |
|
|
|
typedef __attribute__((mode(TI))) unsigned int uint128; |
|
|
|
uint128 t = (uint128(H) << 64) | L; |
|
|
|
uint128 t = (uint128(H) << 64) | L; |
|
|
|