binvert_limb speedup on 64 bit machines with UHWtype

Torbjörn Granlund tg at gmplib.org
Sun Feb 27 10:53:41 CET 2022


John Gatrell <gatrelljm at gmail.com> writes:

  I noticed that replacing '(n/2)&0x7F' with '(unsigned char)n/2', may give a
  hint to assembler implementers that the 7F mask is unnecessary.
  For your consideration

It is necessary to portably extract the least significant bits.

Perhaps one could write it (n & 0xff)/2 and get better code from some
compilers, as there are special instructions for "& 0xff" which then
would be obvious to compilers.

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


More information about the gmp-devel mailing list