[Gmp-commit] /home/hgfiles/gmp: 3 new changesets
mercurial at gmplib.org
mercurial at gmplib.org
Thu Jan 7 00:20:31 CET 2010
details: /home/hgfiles/gmp/rev/53f1c6b0a233
changeset: 13340:53f1c6b0a233
user: Torbjorn Granlund <tege at gmplib.org>
date: Thu Jan 07 00:13:28 2010 +0100
description:
Use SB division for small quotients as well as small divisors.
details: /home/hgfiles/gmp/rev/2a9d0f267515
changeset: 13341:2a9d0f267515
user: Torbjorn Granlund <tege at gmplib.org>
date: Thu Jan 07 00:17:24 2010 +0100
description:
Add all lately defined thresholds.
details: /home/hgfiles/gmp/rev/49908b4a94c9
changeset: 13342:49908b4a94c9
user: Torbjorn Granlund <tege at gmplib.org>
date: Thu Jan 07 00:20:20 2010 +0100
description:
(check_one): Get rid of the poorly managed variable tn.
diffstat:
ChangeLog | 15 ++++++-
mpn/generic/div_q.c | 8 ++-
mpn/minithres/gmp-mparam.h | 98 ++++++++++++++++++++++++++-------------------
tests/mpn/t-div.c | 6 +-
4 files changed, 77 insertions(+), 50 deletions(-)
diffs (223 lines):
diff -r a676181b4cb9 -r 49908b4a94c9 ChangeLog
--- a/ChangeLog Wed Jan 06 21:38:37 2010 +0100
+++ b/ChangeLog Thu Jan 07 00:20:20 2010 +0100
@@ -1,3 +1,16 @@
+2010-01-07 Torbjorn Granlund <tege at gmplib.org>
+
+ * Version 5.0.0 released.
+
+ From Niels Möller:
+ * tests/mpn/t-div.c (check_one): Get rid of the poorly managed variable
+ tn.
+
+ * mpn/minithres/gmp-mparam.h: Add all lately defined thresholds.
+
+ * mpn/generic/div_q.c: Use SB division for small quotients as well as
+ small divisors. Fix typo in itch call.
+
2010-01-06 Niels Möller <nisse at lysator.liu.se>
* tests/mpn/t-div.c (check_one): Checking based on multiplication,
@@ -5,8 +18,6 @@
2010-01-06 Torbjorn Granlund <tege at gmplib.org>
- * Version 5.0.0 released.
-
* gmp-h.in (__GNU_MP__): Bump.
(__GNU_MP_VERSION,__GNU_MP_VERSION_MINOR,__GNU_MP_VERSION_PATCHLEVEL):
Bump version info.
diff -r a676181b4cb9 -r 49908b4a94c9 mpn/generic/div_q.c
--- a/mpn/generic/div_q.c Wed Jan 06 21:38:37 2010 +0100
+++ b/mpn/generic/div_q.c Thu Jan 07 00:20:20 2010 +0100
@@ -138,7 +138,8 @@
{
qh = mpn_divrem_2 (qp, 0L, new_np, new_nn, new_dp);
}
- else if (BELOW_THRESHOLD (dn, DC_DIV_Q_THRESHOLD))
+ else if (BELOW_THRESHOLD (dn, DC_DIV_Q_THRESHOLD) ||
+ BELOW_THRESHOLD (new_nn - dn, DC_DIV_Q_THRESHOLD))
{
invert_pi1 (dinv, new_dp[dn - 1], new_dp[dn - 2]);
qh = mpn_sbpi1_div_q (qp, new_np, new_nn, new_dp, dn, dinv.inv32);
@@ -153,7 +154,7 @@
}
else
{
- mp_size_t itch = mpn_mu_div_q_itch (nn, dn, 0);
+ mp_size_t itch = mpn_mu_div_q_itch (new_nn, dn, 0);
mp_ptr scratch = TMP_ALLOC_LIMBS (itch);
qh = mpn_mu_div_q (qp, new_np, new_nn, new_dp, dn, scratch);
}
@@ -169,7 +170,8 @@
{
qh = mpn_divrem_2 (qp, 0L, new_np, nn, dp);
}
- else if (BELOW_THRESHOLD (dn, DC_DIV_Q_THRESHOLD))
+ else if (BELOW_THRESHOLD (dn, DC_DIV_Q_THRESHOLD) ||
+ BELOW_THRESHOLD (nn - dn, DC_DIV_Q_THRESHOLD))
{
invert_pi1 (dinv, dh, dp[dn - 2]);
qh = mpn_sbpi1_div_q (qp, new_np, nn, dp, dn, dinv.inv32);
diff -r a676181b4cb9 -r 49908b4a94c9 mpn/minithres/gmp-mparam.h
--- a/mpn/minithres/gmp-mparam.h Wed Jan 06 21:38:37 2010 +0100
+++ b/mpn/minithres/gmp-mparam.h Thu Jan 07 00:20:20 2010 +0100
@@ -21,14 +21,37 @@
/* The values in this file are not currently minimal.
Trimming them further would be good. */
-#define MUL_TOOM22_THRESHOLD 8
-#define MUL_TOOM33_THRESHOLD 20
-#define MUL_TOOM44_THRESHOLD 24
+#define MOD_1_NORM_THRESHOLD 0 /* always */
+#define MOD_1_UNNORM_THRESHOLD 0 /* always */
+#define MOD_1_1_THRESHOLD 2
+#define MOD_1_2_THRESHOLD 3
+#define MOD_1_4_THRESHOLD 4
+#define USE_PREINV_DIVREM_1 1 /* native */
+#define USE_PREINV_MOD_1 1
+#define DIVREM_2_THRESHOLD 0 /* always */
+#define DIVEXACT_1_THRESHOLD 0 /* always (native) */
+#define MODEXACT_1_ODD_THRESHOLD 0 /* always (native) */
-#define SQR_BASECASE_THRESHOLD 0
-#define SQR_TOOM2_THRESHOLD 8
-#define SQR_TOOM3_THRESHOLD 20
-#define SQR_TOOM4_THRESHOLD 24
+#define MUL_TOOM22_THRESHOLD 8
+#define MUL_TOOM33_THRESHOLD 20
+#define MUL_TOOM44_THRESHOLD 24
+#define MUL_TOOM6H_THRESHOLD 200 /* FIXME */
+#define MUL_TOOM8H_THRESHOLD 86
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 50 /* FIXME */
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 50 /* FIXME */
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 50 /* FIXME */
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 50 /* FIXME */
+
+#define SQR_BASECASE_THRESHOLD 0
+#define SQR_TOOM2_THRESHOLD 8
+#define SQR_TOOM3_THRESHOLD 20
+#define SQR_TOOM4_THRESHOLD 24
+#define SQR_TOOM6H_THRESHOLD 200 /* FIXME */
+#define SQR_TOOM8H_THRESHOLD 86
+
+#define MULMOD_BNM1_THRESHOLD 10
+#define SQRMOD_BNM1_THRESHOLD 10
#define MUL_FFT_TABLE {64, 256, 1024, 4096, 8192, 65536, 0}
#define MUL_FFT_MODF_THRESHOLD 65
@@ -38,42 +61,35 @@
#define SQR_FFT_MODF_THRESHOLD 65
#define SQR_FFT_THRESHOLD 200
-#define MULLO_BASECASE_THRESHOLD 0
-#define MULLO_DC_THRESHOLD 2
-#define MULLO_MUL_N_THRESHOLD 4
+#define MULLO_BASECASE_THRESHOLD 0
+#define MULLO_DC_THRESHOLD 2
+#define MULLO_MUL_N_THRESHOLD 4
-#define MULMOD_BNM1_THRESHOLD 10
+#define DC_DIV_QR_THRESHOLD 6
+#define DC_DIVAPPR_Q_THRESHOLD 6
+#define DC_BDIV_QR_THRESHOLD 4
+#define DC_BDIV_Q_THRESHOLD 4
-#define DC_DIV_QR_THRESHOLD 6
-#define DC_DIVAPPR_Q_THRESHOLD 6
-#define DC_BDIV_QR_THRESHOLD 4
-#define MU_BDIV_QR_THRESHOLD 10
-#define DC_BDIV_Q_THRESHOLD 4
-#define MU_BDIV_Q_THRESHOLD 10
-#define BINV_NEWTON_THRESHOLD 6
-#define INV_MULMOD_BNM1_THRESHOLD 2
-#define INV_NEWTON_THRESHOLD 6
-#define INV_APPR_THRESHOLD 4
-#define REDC_1_TO_REDC_N_THRESHOLD 4
+#define INV_MULMOD_BNM1_THRESHOLD 2
+#define INV_NEWTON_THRESHOLD 6
+#define INV_APPR_THRESHOLD 4
-#define MATRIX22_STRASSEN_THRESHOLD 2
-#define HGCD_THRESHOLD 10
-#define GCD_DC_THRESHOLD 20
-#define GCDEXT_SCHOENHAGE_THRESHOLD 20
-#define JACOBI_BASE_METHOD 1
+#define BINV_NEWTON_THRESHOLD 6
+#define REDC_1_TO_REDC_N_THRESHOLD 4
-#define MOD_1_NORM_THRESHOLD 0 /* always */
-#define MOD_1_UNNORM_THRESHOLD 0 /* always */
-#define MOD_1_1_THRESHOLD 2
-#define MOD_1_2_THRESHOLD 3
-#define MOD_1_4_THRESHOLD 4
-#define USE_PREINV_DIVREM_1 1 /* native */
-#define USE_PREINV_MOD_1 1
-#define DIVREM_2_THRESHOLD 0 /* always */
-#define DIVEXACT_1_THRESHOLD 0 /* always (native) */
-#define MODEXACT_1_ODD_THRESHOLD 0 /* always (native) */
+#define MU_DIV_QR_THRESHOLD 8
+#define MU_DIVAPPR_Q_THRESHOLD 8
+#define MUPI_DIV_QR_THRESHOLD 8
+#define MU_BDIV_QR_THRESHOLD 8
+#define MU_BDIV_Q_THRESHOLD 8
-#define GET_STR_DC_THRESHOLD 4
-#define GET_STR_PRECOMPUTE_THRESHOLD 10
-#define SET_STR_THRESHOLD 64
-#define SET_STR_PRECOMPUTE_THRESHOLD 100
+#define MATRIX22_STRASSEN_THRESHOLD 2
+#define HGCD_THRESHOLD 10
+#define GCD_DC_THRESHOLD 20
+#define GCDEXT_SCHOENHAGE_THRESHOLD 20
+#define JACOBI_BASE_METHOD 1
+
+#define GET_STR_DC_THRESHOLD 4
+#define GET_STR_PRECOMPUTE_THRESHOLD 10
+#define SET_STR_THRESHOLD 64
+#define SET_STR_PRECOMPUTE_THRESHOLD 100
diff -r a676181b4cb9 -r 49908b4a94c9 tests/mpn/t-div.c
--- a/tests/mpn/t-div.c Wed Jan 06 21:38:37 2010 +0100
+++ b/tests/mpn/t-div.c Thu Jan 07 00:20:20 2010 +0100
@@ -59,7 +59,6 @@
{
mp_size_t qn = nn - dn + 1;
mp_ptr tp;
- mp_size_t tn;
const char *msg;
const char *tvalue;
mp_limb_t i;
@@ -79,7 +78,6 @@
{
msg = "q too large";
tvalue = "Q*D";
- tn = nn + 1;
error:
printf ("\r*******************************************************************************\n");
printf ("%s and failed test %lu: %s\n", fname, test, msg);
@@ -98,14 +96,12 @@
if (!mpn_zero_p (tp + dn, nn - dn) || mpn_cmp (tp, dp, dn) >= 0)
{
msg = "q too small";
- MPN_NORMALIZE (tp, tn);
goto error;
}
if (rp && mpn_cmp (rp, tp, dn) != 0)
{
msg = "r incorrect";
- tn = dn;
goto error;
}
@@ -114,7 +110,9 @@
/* These are *bit* sizes. */
+#ifndef SIZE_LOG
#define SIZE_LOG 17
+#endif
#define MAX_DN (1L << SIZE_LOG)
#define MAX_NN (1L << (SIZE_LOG + 1))
More information about the gmp-commit
mailing list