A question on mpn_aorslsh1_n function pairs

Torbjorn Granlund tg at gmplib.org
Wed Dec 25 10:58:05 UTC 2013


Anil Singhar <anil.singhar at linaro.org> writes:

  Could someone please help me understand the return values of the following
  functions:
  
  i) mpn_addlsh1_n : rp[] = up[] + (vp[] << 1)
  
  - is the return value = (vp[num_limbs -1] >> 63) + carry from the above
  addition ?
  
  ii) mpn_sublsh1_n : rp[] = up[] - (vp[] << 1)
  
  - Is the return value = "Borrow from the above subtraction" - (vp[num_limbs
  -1] >> 63) ?
  
These functions are internal, and as such we don't have much
documentation for them.  An idea of their current behaviour could be
gathered by the current implementations, and by tests/refmpn.c.

We may of course change the behaviour of internal functions at any time,
or for that matter remove them.

Torbjörn


More information about the gmp-discuss mailing list