Re: Division call in mpn_gcd

2012-02-25 Thread Torbjorn Granlund
ni...@lysator.liu.se (Niels Möller) writes: Perhaps this is the reason for keeping redc separate? IIRC, bdiv functions return a borrow, meaning that the remainder corresponding to the computed quotient is negative, while red returns a carry which means that the computed remainder is a

Division call in mpn_gcd

2012-02-24 Thread Torbjorn Granlund
Inspired by Marc{,o}'s cleanup commits, I decided to look for TMP_ALLOC* calls that should be made into TMP_SALLOC* or TMP_BALLOC*. Then I spotted this unrelated thing: tp = TMP_ALLOC_LIMBS(talloc); if (usize n) { mpn_tdiv_qr (tp, up, 0, up, usize, vp, n); if (mpn_zero_p

Re: Division call in mpn_gcd

2012-02-24 Thread Niels Möller
Torbjorn Granlund t...@gmplib.org writes: Except that redc does not accept independent sizes. Therefore we need to use bdiv_qr. I think it should be easy to generalize at least redc_1 and redc_2 to accept independent sizes. Might require some more work for redc_n, which would need some kind

Re: Division call in mpn_gcd

2012-02-24 Thread Torbjorn Granlund
ni...@lysator.liu.se (Niels Möller) writes: Torbjorn Granlund t...@gmplib.org writes: Except that redc does not accept independent sizes. Therefore we need to use bdiv_qr. I think it should be easy to generalize at least redc_1 and redc_2 to accept independent sizes. Might