[Gmp-commit] /var/hg/gmp: 3 new changesets
mercurial at gmplib.org
mercurial at gmplib.org
Sun Jun 8 03:52:57 UTC 2014
details: /var/hg/gmp/rev/02c14b4610a5
changeset: 16421:02c14b4610a5
user: Marco Bodrato <bodrato at mail.dm.unipi.it>
date: Sun Jun 08 05:40:27 2014 +0200
description:
mpn/generic/mul.c: Comments on scratch needs.
details: /var/hg/gmp/rev/d7ad6f75fd6a
changeset: 16422:d7ad6f75fd6a
user: Marco Bodrato <bodrato at mail.dm.unipi.it>
date: Sun Jun 08 05:49:55 2014 +0200
description:
mpn/generic/mul.c: Smaller scratch allocation in the Toom3X branch.
details: /var/hg/gmp/rev/aa7097c2b641
changeset: 16423:aa7097c2b641
user: Marco Bodrato <bodrato at mail.dm.unipi.it>
date: Sun Jun 08 05:51:40 2014 +0200
description:
ChangeLog
diffstat:
ChangeLog | 2 +-
mpn/generic/mul.c | 17 ++++++++++++-----
2 files changed, 13 insertions(+), 6 deletions(-)
diffs (45 lines):
diff -r bd72997f2dc4 -r aa7097c2b641 ChangeLog
--- a/ChangeLog Sun Jun 08 04:55:54 2014 +0200
+++ b/ChangeLog Sun Jun 08 05:51:40 2014 +0200
@@ -1,6 +1,6 @@
2014-06-08 Marco Bodrato <bodrato at mail.dm.unipi.it>
- * mpn/generic/mul.c: Tighter allocation in the Toom2X branch.
+ * mpn/generic/mul.c: Tighter allocation in Toom{2,3}X branches.
2014-06-06 Torbjörn Granlund <tege at gmplib.org>
diff -r bd72997f2dc4 -r aa7097c2b641 mpn/generic/mul.c
--- a/mpn/generic/mul.c Sun Jun 08 04:55:54 2014 +0200
+++ b/mpn/generic/mul.c Sun Jun 08 05:51:40 2014 +0200
@@ -211,10 +211,9 @@
#define ITCH_TOOMX2 (9 * vn / 2 + GMP_NUMB_BITS * 2)
scratch = TMP_SALLOC_LIMBS (ITCH_TOOMX2);
- ASSERT (mpn_toom42_mul_itch (2 * vn, vn) <= ITCH_TOOMX2);
- ASSERT (mpn_toom22_mul_itch ((5*vn-1)/4, vn) <= ITCH_TOOMX2);
- ASSERT (mpn_toom32_mul_itch ((7*vn-1)/4, vn) <= ITCH_TOOMX2);
- ASSERT (mpn_toom42_mul_itch (3 * vn - 1, vn) <= ITCH_TOOMX2);
+ ASSERT (mpn_toom22_mul_itch ((5*vn-1)/4, vn) <= ITCH_TOOMX2); /* 5vn/2+ */
+ ASSERT (mpn_toom32_mul_itch ((7*vn-1)/4, vn) <= ITCH_TOOMX2); /* 7vn/6+ */
+ ASSERT (mpn_toom42_mul_itch (3 * vn - 1, vn) <= ITCH_TOOMX2); /* 9vn/2+ */
#undef ITCH_TOOMX2
/* FIXME: This condition (repeated in the loop below) leaves from a vn*vn
@@ -282,7 +281,15 @@
mp_ptr scratch;
TMP_DECL; TMP_MARK;
- scratch = TMP_ALLOC_LIMBS (ITCH);
+#define ITCH_TOOMX3 (4 * vn + GMP_NUMB_BITS)
+ scratch = TMP_SALLOC_LIMBS (ITCH_TOOMX3);
+ ASSERT (mpn_toom33_mul_itch ((7*vn-1)/6, vn) <= ITCH_TOOMX3); /* 7vn/2+ */
+ ASSERT (mpn_toom43_mul_itch ((3*vn-1)/2, vn) <= ITCH_TOOMX3); /* 9vn/4+ */
+ ASSERT (mpn_toom32_mul_itch ((7*vn-1)/4, vn) <= ITCH_TOOMX3); /* 7vn/6+ */
+ ASSERT (mpn_toom53_mul_itch ((11*vn-1)/6, vn) <= ITCH_TOOMX3); /* 11vn/3+ */
+ ASSERT (mpn_toom42_mul_itch ((5*vn-1)/2, vn) <= ITCH_TOOMX3); /* 15vn/4+ */
+ ASSERT (mpn_toom63_mul_itch ((5*vn-1)/2, vn) <= ITCH_TOOMX3); /* 15vn/4+ */
+#undef ITCH_TOOMX3
if (2 * un >= 5 * vn)
{
More information about the gmp-commit
mailing list