[Gmp-commit] /var/hg/gmp: 3 new changesets
mercurial at gmplib.org
mercurial at gmplib.org
Tue Dec 3 20:35:23 UTC 2013
details: /var/hg/gmp/rev/02d47ba45b92
changeset: 16094:02d47ba45b92
user: Torbjorn Granlund <tege at gmplib.org>
date: Tue Dec 03 20:16:39 2013 +0100
description:
(BINVERT_15): Fix typo.
details: /var/hg/gmp/rev/3b414952e61c
changeset: 16095:3b414952e61c
user: Torbjorn Granlund <tege at gmplib.org>
date: Tue Dec 03 20:34:53 2013 +0100
description:
Make constant args asm inlines become limbs.
details: /var/hg/gmp/rev/5831f8fb7143
changeset: 16096:5831f8fb7143
user: Torbjorn Granlund <tege at gmplib.org>
date: Tue Dec 03 21:35:19 2013 +0100
description:
ChangeLog
diffstat:
ChangeLog | 21 +++++++++++++++++++++
mpn/generic/div_qr_1.c | 2 +-
mpn/generic/div_qr_1n_pi1.c | 10 +++++-----
mpn/generic/div_qr_2.c | 10 +++++-----
mpn/generic/mod_1_1.c | 4 ++--
mpn/generic/mod_1_2.c | 6 +++---
mpn/generic/mod_1_3.c | 6 +++---
mpn/generic/mod_1_4.c | 8 ++++----
mpn/generic/mulmid_basecase.c | 2 +-
mpn/generic/sqrmod_bnm1.c | 2 +-
mpn/generic/toom_interpolate_7pts.c | 4 ++--
mpn/sparc64/mod_1_4.c | 16 ++++++++--------
12 files changed, 56 insertions(+), 35 deletions(-)
diffs (truncated from 347 to 300 lines):
diff -r 3ca46fdebbda -r 5831f8fb7143 ChangeLog
--- a/ChangeLog Mon Dec 02 20:31:04 2013 +0100
+++ b/ChangeLog Tue Dec 03 21:35:19 2013 +0100
@@ -1,3 +1,21 @@
+2013-12-03 Torbjorn Granlund <tege at gmplib.org>
+
+ * mpn/generic/div_qr_1.c: Make constant args asm inlines become limbs.
+ * mpn/generic/div_qr_1n_pi1.c: Likewise.
+ * mpn/generic/div_qr_2.c: Likewise.
+ * mpn/generic/div_qr_2.c: Likewise.
+ * mpn/generic/mod_1_1.c: Likewise.
+ * mpn/generic/mod_1_2.c: Likewise.
+ * mpn/generic/mod_1_3.c: Likewise.
+ * mpn/generic/mod_1_4.c: Likewise.
+ * mpn/generic/mulmid_basecase.c: Likewise.
+ * mpn/generic/mulmod_bnm1.c: Likewise.
+ * mpn/generic/sqrmod_bnm1.c: Likewise.
+ * mpn/sparc64/divrem_1.c: Likewise.
+ * mpn/sparc64/mod_1_4.c: Likewise.
+
+ * mpn/generic/toom_interpolate_7pts.c (BINVERT_15): Fix typo.
+
2013-11-11 Torbjorn Granlund <tege at gmplib.org>
* mpn/x86_64/dos64.m4 (CALL): Provide to override default.
@@ -811,6 +829,9 @@
* mpn/arm/dive_1.asm: Rewrite count-trailing-zeros code, using private
table.
+ * mpn/arm: Canonicalise arm assembly to use old style "mov ... lsl" for
+ shift ops.
+
2013-04-07 Torbjorn Granlund <tege at gmplib.org>
* mpn/sparc64/ultrasparct3/mod_34lsub1.asm: New file.
diff -r 3ca46fdebbda -r 5831f8fb7143 mpn/generic/div_qr_1.c
--- a/mpn/generic/div_qr_1.c Mon Dec 02 20:31:04 2013 +0100
+++ b/mpn/generic/div_qr_1.c Tue Dec 03 21:35:19 2013 +0100
@@ -82,7 +82,7 @@
&& BELOW_THRESHOLD (n, DIV_QR_1_UNNORM_THRESHOLD))
{
uh = up[--n];
- udiv_qrnnd (*qh, uh, 0, uh, d);
+ udiv_qrnnd (*qh, uh, CNST_LIMB(0), uh, d);
cnt = 0;
goto plain;
}
diff -r 3ca46fdebbda -r 5831f8fb7143 mpn/generic/div_qr_1n_pi1.c
--- a/mpn/generic/div_qr_1n_pi1.c Mon Dec 02 20:31:04 2013 +0100
+++ b/mpn/generic/div_qr_1n_pi1.c Tue Dec 03 21:35:19 2013 +0100
@@ -228,9 +228,9 @@
* +---+---+---+
*/
umul_ppmm (p1, t, u1, dinv);
- add_ssaaaa (q2, q1, -u2, u2 & dinv, 0, u1);
- add_ssaaaa (q2, q1, q2, q1, 0, p1);
- add_ssaaaa (q2, q1, q2, q1, 0, q0);
+ add_ssaaaa (q2, q1, -u2, u2 & dinv, CNST_LIMB()0, u1);
+ add_ssaaaa (q2, q1, q2, q1, CNST_LIMB(0), p1);
+ add_ssaaaa (q2, q1, q2, q1, CNST_LIMB(0), q0);
q0 = t;
umul_ppmm (p1, p0, u1, B2);
@@ -238,7 +238,7 @@
u0 -= (-cy) & d;
/* Final q update */
- add_ssaaaa (q2, q1, q2, q1, 0, cy);
+ add_ssaaaa (q2, q1, q2, q1, CNST_LIMB(0), cy);
qp[j+1] = q1;
MPN_INCR_U (qp+j+2, n-j-2, q2);
@@ -253,7 +253,7 @@
u1 -= (-t) & d;
udiv_qrnnd_preinv (t, u0, u1, u0, d, dinv);
- add_ssaaaa (q1, q0, q1, q0, 0, t);
+ add_ssaaaa (q1, q0, q1, q0, CNST_LIMB(0), t);
MPN_INCR_U (qp+1, n-1, q1);
diff -r 3ca46fdebbda -r 5831f8fb7143 mpn/generic/div_qr_2.c
--- a/mpn/generic/div_qr_2.c Mon Dec 02 20:31:04 2013 +0100
+++ b/mpn/generic/div_qr_2.c Tue Dec 03 21:35:19 2013 +0100
@@ -114,7 +114,7 @@
#endif
/* Typically used with r1, r0 same as n3, n2. Other types of overlap
- between inputs and outputs not supported. */
+ between inputs and outputs are not supported. */
#define udiv_qr_4by2(q1,q0, r1,r0, n3,n2,n1,n0, d1,d0, di1,di0) \
do { \
mp_limb_t _q3, _q2a, _q2, _q1, _q2c, _q1c, _q1d, _q0; \
@@ -128,10 +128,10 @@
umul_ppmm (_q1d,_q0, n2, di0); \
add_sssaaaa (_q3,_q2,_q1, _q2,_q1, _q2a,_q1d); \
\
- add_ssaaaa (r1, r0, n3, n2, 0, 1); /* FIXME: combine as in x86_64 asm */ \
+ add_ssaaaa (r1, r0, n3, n2, CNST_LIMB(0), CNST_LIMB(1)); \
\
/* [q3,q2,q1,q0] += [n3,n3,n1,n0] */ \
- add_csaac (_c, _q0, _q0, n0, 0); \
+ add_csaac (_c, _q0, _q0, n0, CNST_LIMB(0)); \
add_csaac (_c, _q1, _q1, n1, _c); \
add_csaac (_c, _q2, _q2, r0, _c); \
_q3 = _q3 + r1 + _c; \
@@ -143,14 +143,14 @@
\
_mask = -(mp_limb_t) (r1 >= _q1 & (r1 > _q1 | r0 >= _q0)); /* (r1,r0) >= (q1,q0) */ \
add_ssaaaa (r1, r0, r1, r0, d1 & _mask, d0 & _mask); \
- sub_ddmmss (_q3, _q2, _q3, _q2, 0, -_mask); \
+ sub_ddmmss (_q3, _q2, _q3, _q2, CNST_LIMB(0), -_mask); \
\
if (UNLIKELY (r1 >= d1)) \
{ \
if (r1 > d1 || r0 >= d0) \
{ \
sub_ddmmss (r1, r0, r1, r0, d1, d0); \
- add_ssaaaa (_q3, _q2, _q3, _q2, 0, 1); \
+ add_ssaaaa (_q3, _q2, _q3, _q2, CNST_LIMB(0), CNST_LIMB(1));\
} \
} \
(q1) = _q3; \
diff -r 3ca46fdebbda -r 5831f8fb7143 mpn/generic/mod_1_1.c
--- a/mpn/generic/mod_1_1.c Mon Dec 02 20:31:04 2013 +0100
+++ b/mpn/generic/mod_1_1.c Tue Dec 03 21:35:19 2013 +0100
@@ -191,7 +191,7 @@
rl = ap[n - 1];
umul_ppmm (ph, pl, rl, B1modb);
- add_ssaaaa (rh, rl, ph, pl, 0, ap[n - 2]);
+ add_ssaaaa (rh, rl, ph, pl, CNST_LIMB(0), ap[n - 2]);
for (i = n - 3; i >= 0; i -= 1)
{
@@ -200,7 +200,7 @@
+ HI(rr) * (B^2 mod b) <= (B-1)(b-1)
*/
umul_ppmm (ph, pl, rl, B1modb);
- add_ssaaaa (ph, pl, ph, pl, 0, ap[i]);
+ add_ssaaaa (ph, pl, ph, pl, CNST_LIMB(0), ap[i]);
umul_ppmm (rh, rl, rh, B2modb);
add_ssaaaa (rh, rl, rh, rl, ph, pl);
diff -r 3ca46fdebbda -r 5831f8fb7143 mpn/generic/mod_1_2.c
--- a/mpn/generic/mod_1_2.c Mon Dec 02 20:31:04 2013 +0100
+++ b/mpn/generic/mod_1_2.c Tue Dec 03 21:35:19 2013 +0100
@@ -97,7 +97,7 @@
}
umul_ppmm (ph, pl, ap[n - 2], B1modb);
- add_ssaaaa (ph, pl, ph, pl, 0, ap[n - 3]);
+ add_ssaaaa (ph, pl, ph, pl, CNST_LIMB(0), ap[n - 3]);
umul_ppmm (rh, rl, ap[n - 1], B2modb);
add_ssaaaa (rh, rl, rh, rl, ph, pl);
n--;
@@ -116,7 +116,7 @@
+ HI(rr) * (B^3 mod b) <= (B-1)(b-1)
*/
umul_ppmm (ph, pl, ap[i + 1], B1modb);
- add_ssaaaa (ph, pl, ph, pl, 0, ap[i + 0]);
+ add_ssaaaa (ph, pl, ph, pl, CNST_LIMB(0), ap[i + 0]);
umul_ppmm (ch, cl, rl, B2modb);
add_ssaaaa (ph, pl, ph, pl, ch, cl);
@@ -126,7 +126,7 @@
}
umul_ppmm (rh, cl, rh, B1modb);
- add_ssaaaa (rh, rl, rh, rl, 0, cl);
+ add_ssaaaa (rh, rl, rh, rl, CNST_LIMB(0), cl);
cnt = cps[1];
bi = cps[0];
diff -r 3ca46fdebbda -r 5831f8fb7143 mpn/generic/mod_1_3.c
--- a/mpn/generic/mod_1_3.c Mon Dec 02 20:31:04 2013 +0100
+++ b/mpn/generic/mod_1_3.c Tue Dec 03 21:35:19 2013 +0100
@@ -95,7 +95,7 @@
{
case 0:
umul_ppmm (ph, pl, ap[n - 2], B1modb);
- add_ssaaaa (ph, pl, ph, pl, 0, ap[n - 3]);
+ add_ssaaaa (ph, pl, ph, pl, CNST_LIMB(0), ap[n - 3]);
umul_ppmm (rh, rl, ap[n - 1], B2modb);
add_ssaaaa (rh, rl, rh, rl, ph, pl);
n -= 3;
@@ -121,7 +121,7 @@
+ HI(rr) * (B^4 mod b) <= (B-1)(b-1)
*/
umul_ppmm (ph, pl, ap[i + 1], B1modb);
- add_ssaaaa (ph, pl, ph, pl, 0, ap[i + 0]);
+ add_ssaaaa (ph, pl, ph, pl, CNST_LIMB(0), ap[i + 0]);
umul_ppmm (ch, cl, ap[i + 2], B2modb);
add_ssaaaa (ph, pl, ph, pl, ch, cl);
@@ -134,7 +134,7 @@
}
umul_ppmm (rh, cl, rh, B1modb);
- add_ssaaaa (rh, rl, rh, rl, 0, cl);
+ add_ssaaaa (rh, rl, rh, rl, CNST_LIMB(0), cl);
cnt = cps[1];
bi = cps[0];
diff -r 3ca46fdebbda -r 5831f8fb7143 mpn/generic/mod_1_4.c
--- a/mpn/generic/mod_1_4.c Mon Dec 02 20:31:04 2013 +0100
+++ b/mpn/generic/mod_1_4.c Tue Dec 03 21:35:19 2013 +0100
@@ -96,7 +96,7 @@
{
case 0:
umul_ppmm (ph, pl, ap[n - 3], B1modb);
- add_ssaaaa (ph, pl, ph, pl, 0, ap[n - 4]);
+ add_ssaaaa (ph, pl, ph, pl, CNST_LIMB(0), ap[n - 4]);
umul_ppmm (ch, cl, ap[n - 2], B2modb);
add_ssaaaa (ph, pl, ph, pl, ch, cl);
umul_ppmm (rh, rl, ap[n - 1], B3modb);
@@ -115,7 +115,7 @@
break;
case 3:
umul_ppmm (ph, pl, ap[n - 2], B1modb);
- add_ssaaaa (ph, pl, ph, pl, 0, ap[n - 3]);
+ add_ssaaaa (ph, pl, ph, pl, CNST_LIMB(0), ap[n - 3]);
umul_ppmm (rh, rl, ap[n - 1], B2modb);
add_ssaaaa (rh, rl, rh, rl, ph, pl);
n -= 3;
@@ -132,7 +132,7 @@
+ HI(rr) * (B^5 mod b) <= (B-1)(b-1)
*/
umul_ppmm (ph, pl, ap[i + 1], B1modb);
- add_ssaaaa (ph, pl, ph, pl, 0, ap[i + 0]);
+ add_ssaaaa (ph, pl, ph, pl, CNST_LIMB(0), ap[i + 0]);
umul_ppmm (ch, cl, ap[i + 2], B2modb);
add_ssaaaa (ph, pl, ph, pl, ch, cl);
@@ -148,7 +148,7 @@
}
umul_ppmm (rh, cl, rh, B1modb);
- add_ssaaaa (rh, rl, rh, rl, 0, cl);
+ add_ssaaaa (rh, rl, rh, rl, CNST_LIMB(0), cl);
cnt = cps[1];
bi = cps[0];
diff -r 3ca46fdebbda -r 5831f8fb7143 mpn/generic/mulmid_basecase.c
--- a/mpn/generic/mulmid_basecase.c Mon Dec 02 20:31:04 2013 +0100
+++ b/mpn/generic/mulmid_basecase.c Tue Dec 03 21:35:19 2013 +0100
@@ -58,7 +58,7 @@
{
up--, vp++;
cy = mpn_addmul_1 (rp, up, un, vp[0]);
- add_ssaaaa (hi, lo, hi, lo, 0, cy);
+ add_ssaaaa (hi, lo, hi, lo, CNST_LIMB(0), cy);
}
/* store final limbs */
diff -r 3ca46fdebbda -r 5831f8fb7143 mpn/generic/sqrmod_bnm1.c
--- a/mpn/generic/sqrmod_bnm1.c Mon Dec 02 20:31:04 2013 +0100
+++ b/mpn/generic/sqrmod_bnm1.c Tue Dec 03 21:35:19 2013 +0100
@@ -221,7 +221,7 @@
the rsh1add was a simple rshift: the top bit is 0. cy=1 => hi=0. */
#endif
#if GMP_NAIL_BITS == 0
- add_ssaaaa(cy, rp[n-1], cy, rp[n-1], 0, hi);
+ add_ssaaaa(cy, rp[n-1], cy, rp[n-1], CNST_LIMB(0), hi);
#else
cy += (hi & rp[n-1]) >> (GMP_NUMB_BITS-1);
rp[n-1] ^= hi;
diff -r 3ca46fdebbda -r 5831f8fb7143 mpn/generic/toom_interpolate_7pts.c
--- a/mpn/generic/toom_interpolate_7pts.c Mon Dec 02 20:31:04 2013 +0100
+++ b/mpn/generic/toom_interpolate_7pts.c Tue Dec 03 21:35:19 2013 +0100
@@ -1,6 +1,6 @@
/* mpn_toom_interpolate_7pts -- Interpolate for toom44, 53, 62.
- Contributed to the GNU project by Niels Möller.
+ Contributed to the GNU project by Niels Möller.
Improvements by Marco Bodrato.
THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE. IT IS ONLY
@@ -33,7 +33,7 @@
((((GMP_NUMB_MAX / 9) << (6 - GMP_NUMB_BITS % 6)) * 8 & GMP_NUMB_MAX) | 0x39)
#define BINVERT_15 \
- ((((GMP_NUMB_MAX >> (GMP_NUMB_BITS % 4)) / 15) * 14 * 16 & GMP_NUMB_MAX) + 15))
+ ((((GMP_NUMB_MAX >> (GMP_NUMB_BITS % 4)) / 15) * 14 * 16 & GMP_NUMB_MAX) + 15)
/* For the various mpn_divexact_byN here, fall back to using either
mpn_pi1_bdiv_q_1 or mpn_divexact_1. The former has less overhead and is
diff -r 3ca46fdebbda -r 5831f8fb7143 mpn/sparc64/mod_1_4.c
--- a/mpn/sparc64/mod_1_4.c Mon Dec 02 20:31:04 2013 +0100
+++ b/mpn/sparc64/mod_1_4.c Tue Dec 03 21:35:19 2013 +0100
@@ -53,16 +53,16 @@
ASSERT (B1modb <= b); /* NB: not fully reduced mod b */
cps[2] = B1modb >> cnt;
- udiv_rnnd_preinv (B2modb, B1modb, 0, b, bi);
+ udiv_rnnd_preinv (B2modb, B1modb, CNST_LIMB(0), b, bi);
cps[3] = B2modb >> cnt;
- udiv_rnnd_preinv (B3modb, B2modb, 0, b, bi);
+ udiv_rnnd_preinv (B3modb, B2modb, CNST_LIMB(0), b, bi);
More information about the gmp-commit
mailing list