Likely GMP bug

Torbjörn Granlund tg at
Sun May 27 14:08:18 UTC 2018

"Marco Bodrato" <bodrato at> writes:

  Or we can simply "strip U maybe" before entering the loop.

  I suggest:

I agree with that change, perhaps without the

goto next_line

part.  :-)

We might want to revisit this code for other reasons too.  I expect
gcd_1 to be quite important.  The hardwired 16 bit difference for using
plain division is unlikely to be universally optimal.  We might even
want to tune for that.

We never did anything about slow count_loading_zeros/count_trailing_zeros,
The USE_ZEROTAB might not be the best way for code clarity; instead we
could define some count_trailing_zeros_best_for_small_counts and define
that to count_trailing_zeros when that is fast.

For now, I'd suggest to just rip out USE_ZEROTAB.

Please encrypt, key id 0xC8601622

More information about the gmp-bugs mailing list