binvert_limb speedup on 64 bit machines with UHWtype

Marco Bodrato bodrato at mail.dm.unipi.it
Sun Feb 27 18:13:24 CET 2022


Ciao Torbjörn,

Il 2022-02-27 10:53 Torbjörn Granlund ha scritto:
> Perhaps one could write it (n & 0xff)/2 and get better code

Actually, this trick is already used! In tune/modlinv.c :-/
The following line dates back to 2002:
     __inv = binvert_limb_table[(__n&0xFF)/2]; /*  8 */          \

I did never look into that file :-)

Ĝis,
m


More information about the gmp-devel mailing list