gcd_22

Marco Bodrato bodrato at mail.dm.unipi.it
Wed Aug 28 06:19:27 UTC 2019


Ciao,

Il 2019-08-28 00:09 tg at gmplib.org ha scritto:
> I broke out the unlikely up[0] code into a separate function, a 
> function
> which can be common for any size.  A function which we might call from
> asm.

Maybe tail-call?

When up[0] == 0 but U is not zero and we can not return the result... 
That's an unlikely case, but it means that one of the operands gets much 
smaller than the other. Maybe a special strategy can be used in this 
case? Maybe a division, maybe a 2-adic division, or maybe simply a loop 
that knows that U will be smaller until also V will be one (some) limb 
shorter...

...and finally tail-call to the smaller fixed-size asm function?

m


More information about the gmp-devel mailing list