Shared toom evaluation functions

Niels Möller nisse at lysator.liu.se
Thu Nov 19 14:21:10 CET 2009


bodrato at mail.dm.unipi.it writes:

>>   ((... + a4)*4 + a2)*4 + a0
>
> You wrote two versions: with HAVE_NATIVE_mpn_addlsh_n or without.
> Only the third not yet written needs this (re)organization ;-)

I'm thinking that one should share source code and structure for both
addlsh2_n and addlsh_n cases, by something like

#if HAVE_NATIVE_mpn_addlsh2_n
# define USE_ADDLSH2 1
#elif HAVE_NATIVE_mpn_addlsh_n
# define USE_ADDLSH2 1
# undef mpn_addlsh2_n
# define mpn_addlsh2_n(...) mpn_addlsh_n(...,2)
#else
# define USE_ADDLSH2 0
#endif

Regards,
/Niels


More information about the gmp-devel mailing list