diff options
author | Kevin Ryde <user42@zip.com.au> | 2001-10-27 01:44:41 +0200 |
---|---|---|
committer | Kevin Ryde <user42@zip.com.au> | 2001-10-27 01:44:41 +0200 |
commit | b3db413c8299c8ab44980e0ce5704921177adeb0 (patch) | |
tree | 6de000e21f2bf67a2a602589236d187a8d5b1b99 /tests | |
parent | fb2c12c3f29b35f2b5809e4bff6efce945eedbf6 (diff) | |
download | gmp-b3db413c8299c8ab44980e0ce5704921177adeb0.tar.gz |
* tests/refmpn.c (refmpn_mod_34lsub1): New function.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/refmpn.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/refmpn.c b/tests/refmpn.c index 12f8ac5d6..230253e27 100644 --- a/tests/refmpn.c +++ b/tests/refmpn.c @@ -765,6 +765,15 @@ refmpn_preinv_mod_1 (mp_srcptr sp, mp_size_t size, mp_limb_t divisor, return refmpn_mod_1 (sp, size, divisor); } +/* This implementation will be rather slow, but has the advantage of being + in a different style than the libgmp versions. */ +mp_limb_t +refmpn_mod_34lsub1 (mp_srcptr p, mp_size_t n) +{ + ASSERT ((BITS_PER_MP_LIMB % 4) == 0); + return mpn_mod_1 (p, n, (CNST_LIMB(1) << (3 * BITS_PER_MP_LIMB / 4)) - 1); +} + mp_limb_t refmpn_divrem_1c (mp_ptr rp, mp_size_t xsize, |