Testing latest pari + WASM + node.js... and it works?! Wow.
License: GPL3
ubuntu2004
/* Extracted from gmp-4.1.21* FIXME: This file is unused until somebody implements2* invert_word(x) = return floor( 2^(2*BIL)/x ) */3extern ulong invert_word(ulong);45#define sub_ddmmss(sh, sl, ah, al, bh, bl) \6__extension__ ({ \7ulong __x; \8__x = (al) - (bl); \9(sh) = (ah) - (bh) - (__x > (al)); \10(sl) = __x; \11})1213#define divll(x, y) \14__extension__ ({ \15register ulong _di, _x = (x), _y = (y), _q, _ql, _r; \16register ulong _xh, _xl, _k, __hire; \17\18if (_y & 0x8000000000000000UL) \19{ _k = 0; __hire = hiremainder; } \20else \21{ \22_k = bfffo(_y); \23__hire = (hiremainder << _k) | (_x >> (64 - _k)); \24_x <<= _k; _y <<= _k; \25} \26_di = invert_word(_y); \27_ql = mulll (__hire, _di); \28_q = __hire + hiremainder; \29_xl = mulll(_q, _y); _xh = hiremainder; \30sub_ddmmss (_xh, _r, __hire, _x, _xh, _xl); \31if (_xh != 0) \32{ \33sub_ddmmss (_xh, _r, _xh, _r, 0, _y); _q += 1; \34if (_xh != 0) \35{ sub_ddmmss (_xh, _r, _xh, _r, 0, _y); _q += 1; } \36} \37if (_r >= _y) \38{ _r -= _y; _q += 1; } \39hiremainder = _r >> _k; \40_q; \41})424344