[Gmp-commit] /home/hgfiles/gmp: Document mpn_sqr_n.
mercurial at gmplib.org
mercurial at gmplib.org
Wed Dec 2 18:38:54 CET 2009
details: /home/hgfiles/gmp/rev/81474868a318
changeset: 12960:81474868a318
user: Torbjorn Granlund <tege at gmplib.org>
date: Wed Dec 02 18:38:51 2009 +0100
description:
Document mpn_sqr_n.
diffstat:
ChangeLog | 6 ++++--
doc/gmp.texi | 35 ++++++++++++++++++++++++-----------
2 files changed, 28 insertions(+), 13 deletions(-)
diffs (82 lines):
diff -r 9e60b40a32ad -r 81474868a318 ChangeLog
--- a/ChangeLog Wed Dec 02 18:00:31 2009 +0100
+++ b/ChangeLog Wed Dec 02 18:38:51 2009 +0100
@@ -7,6 +7,8 @@
2009-12-02 Torbjorn Granlund <tege at gmplib.org>
+ * doc/gmp.texi (Low-level Functions): Document mpn_sqr_n.
+
* tune/speed.c (routine): Add mpn_binvert.
* tune/tuneup.c: Tune BINV_NEWTON_THRESHOLD.
@@ -15,7 +17,7 @@
* tune/common.c (speed_mpn_binvert): New function.
* gmp-impl.h: Provide declarations for corresponding threshold vars.
* tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add binvert.c.
-
+
* tune/tuneup.c: Tune DC_BDIV_QR_THRESHOLD and DC_BDIV_Q_THRESHOLD.
(tune_dc_bdiv): New function.
(tune_dc_div): New name for tune_dc.
@@ -26,7 +28,7 @@
* gmp-impl.h: Provide declarations for corresponding threshold vars.
* tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add dcpi1_bdiv_qr.c and
dcpi1_bdiv_q.c.
-
+
2009-12-01 Marco Bodrato <bodrato at mail.dm.unipi.it>
* mpn/generic/toom53_mul.c: Removed double computation of vinf.
diff -r 9e60b40a32ad -r 81474868a318 doc/gmp.texi
--- a/doc/gmp.texi Wed Dec 02 18:00:31 2009 +0100
+++ b/doc/gmp.texi Wed Dec 02 18:38:51 2009 +0100
@@ -5156,6 +5156,30 @@
The destination has to have space for 2*@var{n} limbs, even if the product's
most significant limb is zero. No overlap is permitted between the
destination and either source.
+
+If the two input operands are the same, use @code{mpn_sqr_n}.
+ at end deftypefun
+
+ at deftypefun mp_limb_t mpn_mul (mp_limb_t *@var{rp}, const mp_limb_t *@var{s1p}, mp_size_t @var{s1n}, const mp_limb_t *@var{s2p}, mp_size_t @var{s2n})
+Multiply @{@var{s1p}, @var{s1n}@} and @{@var{s2p}, @var{s2n}@}, and write the
+(@var{s1n}+ at var{s2n})-limb result to @var{rp}. Return the most significant
+limb of the result.
+
+The destination has to have space for @var{s1n} + @var{s2n} limbs, even if the
+product's most significant limb is zero. No overlap is permitted between the
+destination and either source.
+
+This function requires that @var{s1n} is greater than or equal to
+ at var{s2n}.
+ at end deftypefun
+
+ at deftypefun void mpn_sqr_n (mp_limb_t *@var{rp}, const mp_limb_t *@var{s1p}, mp_size_t @var{n})
+Compute the square of @{@var{s1p}, @var{n}@} and write the 2*@var{n}-limb
+result to @var{rp}.
+
+The destination has to have space for 2*@var{n} limbs, even if the product's
+most significant limb is zero. No overlap is permitted between the
+destination and either source.
@end deftypefun
@deftypefun mp_limb_t mpn_mul_1 (mp_limb_t *@var{rp}, const mp_limb_t *@var{s1p}, mp_size_t @var{n}, mp_limb_t @var{s2limb})
@@ -5194,17 +5218,6 @@
in assembly for most CPUs.
@end deftypefun
- at deftypefun mp_limb_t mpn_mul (mp_limb_t *@var{rp}, const mp_limb_t *@var{s1p}, mp_size_t @var{s1n}, const mp_limb_t *@var{s2p}, mp_size_t @var{s2n})
-Multiply @{@var{s1p}, @var{s1n}@} and @{@var{s2p}, @var{s2n}@}, and write the
-result to @var{rp}. Return the most significant limb of the result.
-
-The destination has to have space for @var{s1n} + @var{s2n} limbs, even if the
-result might be one limb smaller.
-
-This function requires that @var{s1n} is greater than or equal to
- at var{s2n}. The destination must be distinct from both input operands.
- at end deftypefun
-
@deftypefun void mpn_tdiv_qr (mp_limb_t *@var{qp}, mp_limb_t *@var{rp}, mp_size_t @var{qxn}, const mp_limb_t *@var{np}, mp_size_t @var{nn}, const mp_limb_t *@var{dp}, mp_size_t @var{dn})
Divide @{@var{np}, @var{nn}@} by @{@var{dp}, @var{dn}@} and put the quotient
at @{@var{qp}, @var{nn}@minus{}@var{dn}+1@} and the remainder at @{@var{rp},
More information about the gmp-commit
mailing list