Shared toom evaluation functions

Torbjorn Granlund tg at gmplib.org
Mon Nov 16 19:17:09 CET 2009


bodrato at mail.dm.unipi.it writes:

  > I forgot to say: Please test that on sopme x86_64 machine (make && make
  check) shoudl do it, and then commit it!
  
  Done.
  
Grazie!

  > I checked in a aorrlsh2_n for x86_64.  It runs at 2.5 c/l on AMD K8-K10
  and 3.0 c/l on Core 2 and i7.
  >
  > You said it was useful.  Now use it.  :-)
  
  Done :-)
  
  Both evaluation I changed used addlsh_n(.,.,.,2); and both had a small
  bug, that remained undetected, because we don't HAVE_NATIVE_mpn_addlsh_n,
  anywhere.
  
Unsurprising.  Untested code is broken code.

It turns out that we do have addlsh_n, but that configure.in had not be
taught to include it in any configuration.

  I can't see any use for rsblsh2_n, yet. sublsh2_n could be used in
  toom_interpolate_6pts.c#l137, maybe also rsblsh2_n can be used there,
  obtaining -w2 and changing the sign again later.
  
No sublsh2_n yet, though.  It is harder to get that fast.

  About rsblsh1_n: comments in gmp-impl.h declare that it "returns the
  borrow out (-1, 0, 1)", but if we mean borrow = -carry... then it seems
  like it returns "the carry". I'm using it and it works.
  
Well...  I cleaned up rsblsh2_n's return value now, -1...3 should be its
range, I think.

-- 
Torbjörn


More information about the gmp-devel mailing list