diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | doc/gmp.texi | 15 |
2 files changed, 21 insertions, 1 deletions
@@ -1,7 +1,12 @@ +2015-05-28 Niels Möller <nisse@lysator.liu.se> + + * doc/gmp.texi (Low-level Functions): Document mpn_divexact_1 and + mpn_cnd_swap (the latter was forgotten for the 2015-02-08 change). + 2015-05-24 Marco Bodrato <bodrato@mail.dm.unipi.it> * mpq/div.c: Reduce memory use. - * tests/mpq/reuse.c: Test also mpq_FUNCTION (x,x,x). + * tests/mpq/reuse.c: Test also mpq_FUNCTION (x,x,x). * mpz/swap.c: Use _SWAP macros. 2015-05-18 Torbjörn Granlund <torbjorng@google.com> diff --git a/doc/gmp.texi b/doc/gmp.texi index eff6bc3a1..9a6a4b941 100644 --- a/doc/gmp.texi +++ b/doc/gmp.texi @@ -5370,6 +5370,14 @@ separate, not partially overlapping. performance.] @end deftypefun +@deftypefun void mpn_divexact_1 (mp_limb_t * @var{rp}, const mp_limb_t * @var{sp}, mp_size_t @var{n}, mp_limb_t @var{d}) +Divide @{@var{sp}, @var{n}@} by @var{d}, expecting it to divide exactly, and +writing the result to @{@var{rp}, @var{n}@}. If @var{d} doesn't divide +exactly, the value written to @{@var{rp}, @var{n}@} is undefined. The areas at +@var{rp} and @var{sp} have to be identical or completely separate, not +partially overlapping. +@end deftypefun + @deftypefn Macro mp_limb_t mpn_divexact_by3 (mp_limb_t *@var{rp}, mp_limb_t *@var{sp}, @w{mp_size_t @var{n}}) @deftypefnx Function mp_limb_t mpn_divexact_by3c (mp_limb_t *@var{rp}, mp_limb_t *@var{sp}, @w{mp_size_t @var{n}}, mp_limb_t @var{carry}) Divide @{@var{sp}, @var{n}@} by 3, expecting it to divide exactly, and writing @@ -5704,6 +5712,13 @@ requirements are guaranteed to be at most @var{n} limbs, and increase monotonously in the operand size. @end deftypefun +@deftypefun void mpn_cnd_swap (mp_limb_t @var{cnd}, volatile mp_limb_t *@var{ap}, volatile mp_limb_t *@var{bp}, mp_size_t @var{n}) +If @var{cnd} is non-zero, swaps the contents of the areas @{@var{ap},@var{n}@} +and @{@var{bp},@var{n}@}. Otherwise, the areas are left unmodified. +Implemented using logical operations on the limbs, with the same memory +accesses independent of the value of @var{cnd}. +@end deftypefun + @deftypefun void mpn_sec_mul (mp_limb_t *@var{rp}, const mp_limb_t *@var{ap}, mp_size_t @var{an}, const mp_limb_t *@var{bp}, mp_size_t @var{bn}, mp_limb_t *@var{tp}) @deftypefunx mp_size_t mpn_sec_mul_itch (mp_size_t @var{an}, mp_size_t @var{bn}) Set @var{R} to @math{A @times{} B}, where @var{A} = @{@var{ap},@var{an}@}, |