Small operands gcd improvements

Torbjörn Granlund tg at
Tue Aug 6 16:09:54 UTC 2019

nisse at (Niels Möller) writes:

  Maybe easier to wait until asm files are updated so that
  HAVE_NATIVE_mpn_gcd_1 implies HAVE_NATIVE_mpn_gcd_11. Or was it some
  particular call site you had in mind?

I have seen calls to gcd_1 which could use gcd_11, presumably from
mpn_gcd (or its descendant),

I expect asm gcd_1 to disappear as the C code should be equivalent.  Do
you agree?

I suppose some hardwired stuff for the case u >> v (not bitshift, the
mathematical meaning of >>!) might want to be parameterised and also
ideally tune/tuneup'ed.

I'm speaking of this code:

      /* if u is much bigger than v, reduce using a division rather than
	 chipping away at it bit-by-bit */
      if ((ulimb >> 16) > vlimb)

(16 seems like a huge default value, btw.)

Please encrypt, key id 0xC8601622

More information about the gmp-devel mailing list