gcd_22

Torbjörn Granlund tg at gmplib.org
Tue Aug 27 19:10:30 UTC 2019


Marco Bodrato <bodrato at mail.dm.unipi.it> writes:

  This unlikely branch may end up with an odd up[0]...

Ineed.

  > 	}
  >       int cnt;
  >       count_trailing_zeros (cnt, up[0]);
  >       mpn_rshift (up, up, N, cnt);

  ... and on some platform mpn_rshift may not support cnt==0.

That was taken care of in ny last version.

  Maybe (for the C version) we should duplicate the ctz/shift
  instruction, both inside the UNLIKELY (*up == 0) branch (deciding
  whether to shift or copy) and in an else (likely) branch.

I added a goto, I think that is an OK solution.

-- 
Torbjörn
Please encrypt, key id 0xC8601622


More information about the gmp-devel mailing list