PS: mpn_sqrtrem1

Torbjörn Granlund tg at gmplib.org
Tue Dec 20 14:50:27 UTC 2016


"Marco Bodrato" <bodrato at mail.dm.unipi.it> writes:

  > On the other side, both sqrt64_ and sqrt64x2_ use invroot*invroot, maybe
  > table can store both the value and the squared value.
  
  The same comment applies also to current code in GMP, the GMP_NUMB_BITS>32
  version :-)
  
Surely possible.  The cost would be at least 768 bytes.

The x0 value which is squared is 9 bits, with the msb predictably 1.
With some extra instructions, 384 to handle that msb 16-bit entries
would work.

But with extra instructions, the benefits will quickly evaporate...

-- 
Torbjörn
Please encrypt, key id 0xC8601622


More information about the gmp-devel mailing list