Shared toom evaluation functions

Torbjorn Granlund tg at gmplib.org
Sat Nov 14 19:27:15 CET 2009


bodrato at mail.dm.unipi.it writes:

  One question: the tests in tests/mpn/toom-shared.h do compare the result
  of mpn_toomMN_mul with results from mpn_mul. This is exactly what I
  usually do, but it is safe only if toomMN is NOT integrated in mpn_mul!
  
They should definitely use refmpn_mul.  (It is automatically linked in in
the test code.)

  > there's no native implementation of add_n_sub_n for any machine...
  
  Funny!
  $grep -rl add_n_sub_n mpn/|wc
       15      15     604
  It is referenced in 15 files, it recently changed its name
  http://gmplib.org:8000/gmp/rev/674bf2af029b , but it doesn't exist :-D
  
No code has been integrated, but I have implementations for a whole
sleeve of machines.  For x86 32/64, I never got at as fast as I had
hoped (this was before the loopmixer).

  mpn_cmp basically is a macro, isn't it? My implementation of abs_sub_n is
  a small evolution of the same code. I vote for a macro.
  
It is impossible to write it as a macro, portably.  (Unless you do
something like MPN_CMP(res,op1,op1,n) with might be awkward.)

But an inline function is OK.

-- 
Torbjörn


More information about the gmp-devel mailing list