diff options
author | Marco Bodrato <bodrato@mail.dm.unipi.it> | 2019-11-09 12:47:42 +0100 |
---|---|---|
committer | Marco Bodrato <bodrato@mail.dm.unipi.it> | 2019-11-09 12:47:42 +0100 |
commit | b621455485570bc24d2873336439cf6bdfd7e375 (patch) | |
tree | 300512ab6aec3bd16953e2c7a16c87f58160f9e3 /tune/speed.h | |
parent | 65d0c41ccaf684366e7395c4406b63472075974e (diff) | |
download | gmp-b621455485570bc24d2873336439cf6bdfd7e375.tar.gz |
tune/speed*: add optional r flag for mpz_powm
Diffstat (limited to 'tune/speed.h')
-rw-r--r-- | tune/speed.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tune/speed.h b/tune/speed.h index 18f54600a..d66a79418 100644 --- a/tune/speed.h +++ b/tune/speed.h @@ -2638,7 +2638,10 @@ int speed_routine_count_zeros_setup (struct speed_params *, mp_ptr, int, int); SPEED_RESTRICT_COND (s->size >= 1); \ \ mpz_init (r); \ - mpz_init_set_n (b, s->xp, s->size); \ + if (s->r < 2) \ + mpz_init_set_n (b, s->xp, s->size); \ + else \ + mpz_init_set_ui (b, s->r); \ mpz_init_set_n (m, s->yp, s->size); \ mpz_setbit (m, 0); /* force m to odd */ \ mpz_init_set_n (e, s->xp_block, 6); \ |