Torbjörn Granlund tg at
Tue Aug 25 11:43:04 UTC 2015

"Marco Bodrato" <bodrato at> writes:

  If you pass NULL, you'll not avoid any pesky branch :-D

  If you pass a static "1", and do not branch, you will end up allocating
  space and loosing time to multiply NUM(op1) by one...
My idea was to have a file-local mpz_struct, which could be checked for
in the helper to suppress *some* of the more expensive operations.  Or

I am less eager to mess up mpq than e.g. mpn for the sake of
performance.  Suppressing all denomonator ops for op2=mpz seem like
overkill, and then we might as well reimplement mpq_cmp_z.  We should
remember that mpq programs will spend almost all time in gcd
computations anyway.  :-)

Please encrypt, key id 0xC8601622

More information about the gmp-devel mailing list