[Gmp-commit] /home/hgfiles/gmp: 2 new changesets
mercurial at gmplib.org
mercurial at gmplib.org
Mon Jan 4 21:24:13 CET 2010
details: /home/hgfiles/gmp/rev/38ba2587bf5a
changeset: 13318:38ba2587bf5a
user: Torbjorn Granlund <tege at gmplib.org>
date: Mon Jan 04 20:40:24 2010 +0100
description:
Whitespace cleanup.
details: /home/hgfiles/gmp/rev/5a9cc22e310a
changeset: 13319:5a9cc22e310a
user: Torbjorn Granlund <tege at gmplib.org>
date: Mon Jan 04 21:24:09 2010 +0100
description:
Trivial merge.
diffstat:
ChangeLog | 2 ++
mpn/generic/mullo_n.c | 4 ++--
mpn/generic/mulmod_bnm1.c | 6 +++---
mpn/generic/sqrmod_bnm1.c | 6 +++---
mpn/generic/toom32_mul.c | 2 +-
mpn/generic/toom6h_mul.c | 4 ++--
mpn/generic/toom8h_mul.c | 6 +++---
mpn/generic/toom_couple_handling.c | 2 +-
mpn/generic/toom_interpolate_12pts.c | 2 +-
mpn/generic/toom_interpolate_16pts.c | 2 +-
tune/speed.h | 13 +++++++------
11 files changed, 26 insertions(+), 23 deletions(-)
diffs (221 lines):
diff -r f4ed09601598 -r 5a9cc22e310a ChangeLog
--- a/ChangeLog Mon Jan 04 15:49:38 2010 +0100
+++ b/ChangeLog Mon Jan 04 21:24:09 2010 +0100
@@ -1,5 +1,7 @@
2010-01-04 Torbjorn Granlund <tege at gmplib.org>
+ * tune/speed.h (SPEED_ROUTINE_MPN_MULMOD_BNM1_ROUNDED): Clean up.
+
* mpn/generic/mul.c: Simplify rational expression.
* gmp-impl.h: Cleanup threshold variables; remove obsolete ones and
diff -r f4ed09601598 -r 5a9cc22e310a mpn/generic/mullo_n.c
--- a/mpn/generic/mullo_n.c Mon Jan 04 15:49:38 2010 +0100
+++ b/mpn/generic/mullo_n.c Mon Jan 04 21:24:09 2010 +0100
@@ -145,7 +145,7 @@
ASSERT (MPN_SAME_OR_SEPARATE2_P(rp, n, tp, 2*n));
/* Divide-and-conquer */
-
+
/* We need fractional approximation of the value 0 < a <= 1/2
giving the minimum in the function k=(1-a)^e/(1-2*a^e).
*/
@@ -164,7 +164,7 @@
n2 = n - n1;
/* Split as x = x1 2^(n2 GMP_NUMB_BITS) + x0,
- y = y1 2^(n2 GMP_NUMB_BITS) + y0 */
+ y = y1 2^(n2 GMP_NUMB_BITS) + y0 */
/* x0 * y0 */
mpn_mul_n (tp, xp, yp, n2);
diff -r f4ed09601598 -r 5a9cc22e310a mpn/generic/mulmod_bnm1.c
--- a/mpn/generic/mulmod_bnm1.c Mon Jan 04 15:49:38 2010 +0100
+++ b/mpn/generic/mulmod_bnm1.c Mon Jan 04 21:24:09 2010 +0100
@@ -124,7 +124,7 @@
/* Compute xm = a*b mod (B^n - 1), xp = a*b mod (B^n + 1)
and crt together as
- x = -xp * B^n + (B^n + 1) * [ (xp + xm)/2 mod (B^n-1)]
+ x = -xp * B^n + (B^n + 1) * [ (xp + xm)/2 mod (B^n-1)]
*/
#define a0 ap
@@ -273,11 +273,11 @@
MPN_INCR_U(rp, n, cy);
/* Compute the highest half:
- ([(xp + xm)/2 mod (B^n-1)] - xp ) * B^n
+ ([(xp + xm)/2 mod (B^n-1)] - xp ) * B^n
*/
cy = xp[n] + mpn_sub_n (rp + n, rp, xp, n);
/* cy = 1 only if {xp,n+1} is not ZERO, i.e. {rp,n} is not ZERO.
- DECR will affect _at most_ the lowest n limbs. */
+ DECR will affect _at most_ the lowest n limbs. */
MPN_DECR_U (rp, 2*n, cy);
#undef a0
diff -r f4ed09601598 -r 5a9cc22e310a mpn/generic/sqrmod_bnm1.c
--- a/mpn/generic/sqrmod_bnm1.c Mon Jan 04 15:49:38 2010 +0100
+++ b/mpn/generic/sqrmod_bnm1.c Mon Jan 04 21:24:09 2010 +0100
@@ -119,7 +119,7 @@
/* Compute xm = a^2 mod (B^n - 1), xp = a^2 mod (B^n + 1)
and crt together as
- x = -xp * B^n + (B^n + 1) * [ (xp + xm)/2 mod (B^n-1)]
+ x = -xp * B^n + (B^n + 1) * [ (xp + xm)/2 mod (B^n-1)]
*/
#define a0 ap
@@ -238,11 +238,11 @@
MPN_INCR_U(rp, n, cy);
/* Compute the highest half:
- ([(xp + xm)/2 mod (B^n-1)] - xp ) * B^n
+ ([(xp + xm)/2 mod (B^n-1)] - xp ) * B^n
*/
cy = xp[n] + mpn_sub_n (rp + n, rp, xp, n);
/* cy = 1 only if {xp,n+1} is not ZERO, i.e. {rp,n} is not ZERO.
- DECR will affect _at most_ the lowest n limbs. */
+ DECR will affect _at most_ the lowest n limbs. */
MPN_DECR_U (rp, 2*n, cy);
#undef a0
diff -r f4ed09601598 -r 5a9cc22e310a mpn/generic/toom32_mul.c
--- a/mpn/generic/toom32_mul.c Mon Jan 04 15:49:38 2010 +0100
+++ b/mpn/generic/toom32_mul.c Mon Jan 04 21:24:09 2010 +0100
@@ -188,7 +188,7 @@
if (bp1_hi != 0)
cy += mpn_add_n (v1 + n, v1 + n, ap1, n);
v1[2 * n] = cy;
-
+
TOOM32_MUL_N_REC (vm1, am1, bm1, n, scratch_out);
if (hi)
hi = mpn_add_n (vm1+n, vm1+n, bm1, n);
diff -r f4ed09601598 -r 5a9cc22e310a mpn/generic/toom6h_mul.c
--- a/mpn/generic/toom6h_mul.c Mon Jan 04 15:49:38 2010 +0100
+++ b/mpn/generic/toom6h_mul.c Mon Jan 04 21:24:09 2010 +0100
@@ -113,7 +113,7 @@
{ p = 8; q = 5; }
else if( an * LIMIT_denominat < LIMIT_numerator * 2 * bn ) /* is 4*... < 8*... */
{ p = 8; q = 4; }
- else
+ else
{ p = 9; q = 4; }
half = (p ^ q) & 1;
@@ -205,7 +205,7 @@
TOOM6H_MUL_N_REC(pp, ap, bp, n, wsi);
/* Infinity */
- if( half != 0) {
+ if( half != 0) {
if(s>t) {
TOOM6H_MUL_REC(r0, ap + p * n, s, bp + q * n, t, wsi);
} else {
diff -r f4ed09601598 -r 5a9cc22e310a mpn/generic/toom8h_mul.c
--- a/mpn/generic/toom8h_mul.c Mon Jan 04 15:49:38 2010 +0100
+++ b/mpn/generic/toom8h_mul.c Mon Jan 04 21:24:09 2010 +0100
@@ -149,7 +149,7 @@
else if (GMP_NUMB_BITS <= 12*3 ||
an * LIMIT_denominat < LIMIT_numerator * 3 * bn ) /* is 4*... <12*... */
{ p =12; q = 4; }
- else
+ else
{ p =13; q = 4; }
half = (p+q)&1;
@@ -236,7 +236,7 @@
if (q == 3)
sign ^= mpn_toom_eval_dgr3_pm1 (v3, v1, bp, n, t, pp);
else
- sign ^= mpn_toom_eval_pm1 (v3, v1, q, bp, n, t, pp);
+ sign ^= mpn_toom_eval_pm1 (v3, v1, q, bp, n, t, pp);
TOOM8H_MUL_N_REC(pp, v0, v1, n + 1, wse); /* A(-1)*B(-1) */
TOOM8H_MUL_N_REC(r4, v2, v3, n + 1, wse); /* A(1)*B(1) */
mpn_toom_couple_handling (r4, 2 * n + 1, pp, sign, n, 0, 0);
@@ -258,7 +258,7 @@
TOOM8H_MUL_N_REC(pp, ap, bp, n, wsi);
/* Infinity */
- if( half != 0) {
+ if( half != 0) {
if(s>t) {
TOOM8H_MUL_REC(r0, ap + p * n, s, bp + q * n, t, wsi);
} else {
diff -r f4ed09601598 -r 5a9cc22e310a mpn/generic/toom_couple_handling.c
--- a/mpn/generic/toom_couple_handling.c Mon Jan 04 15:49:38 2010 +0100
+++ b/mpn/generic/toom_couple_handling.c Mon Jan 04 21:24:09 2010 +0100
@@ -27,7 +27,7 @@
#include "gmp.h"
#include "gmp-impl.h"
-/* Gets {pp,n} and (sign?-1:1)*{np,n}. Computes at once:
+/* Gets {pp,n} and (sign?-1:1)*{np,n}. Computes at once:
{pp,n} <- ({pp,n}+{np,n})/2^{ps+1}
{pn,n} <- ({pp,n}-{np,n})/2^{ns+1}
Finally recompose them obtaining:
diff -r f4ed09601598 -r 5a9cc22e310a mpn/generic/toom_interpolate_12pts.c
--- a/mpn/generic/toom_interpolate_12pts.c Mon Jan 04 15:49:38 2010 +0100
+++ b/mpn/generic/toom_interpolate_12pts.c Mon Jan 04 21:24:09 2010 +0100
@@ -197,7 +197,7 @@
#define r0 (pp +11 * n) /* s+t <= 2*n */
/******************************* interpolation *****************************/
- if (half != 0) {
+ if (half != 0) {
cy = mpn_sub_n (r3, r3, r0, spt);
MPN_DECR_U (r3 + spt, n3p1 - spt, cy);
diff -r f4ed09601598 -r 5a9cc22e310a mpn/generic/toom_interpolate_16pts.c
--- a/mpn/generic/toom_interpolate_16pts.c Mon Jan 04 15:49:38 2010 +0100
+++ b/mpn/generic/toom_interpolate_16pts.c Mon Jan 04 21:24:09 2010 +0100
@@ -286,7 +286,7 @@
ASSERT( spt <= 2 * n );
/******************************* interpolation *****************************/
- if( half != 0) {
+ if( half != 0) {
cy = mpn_sub_n (r4, r4, r0, spt);
MPN_DECR_U (r4 + spt, n3p1 - spt, cy);
diff -r f4ed09601598 -r 5a9cc22e310a tune/speed.h
--- a/tune/speed.h Mon Jan 04 15:49:38 2010 +0100
+++ b/tune/speed.h Mon Jan 04 21:24:09 2010 +0100
@@ -1055,27 +1055,28 @@
mp_ptr wp, tp; \
unsigned i; \
double t; \
- mp_size_t size; \
+ mp_size_t size, itch; \
TMP_DECL; \
\
SPEED_RESTRICT_COND (s->size >= 1); \
\
size = mpn_mulmod_bnm1_next_size (s->size); \
+ itch = mpn_mulmod_bnm1_itch (size); \
\
TMP_MARK; \
- SPEED_TMP_ALLOC_LIMBS (wp, 2*size, s->align_wp); /* FIXME 2* */ \
- SPEED_TMP_ALLOC_LIMBS (tp, 3 * size + 100, s->align_wp2); \
+ SPEED_TMP_ALLOC_LIMBS (wp, size, s->align_wp); \
+ SPEED_TMP_ALLOC_LIMBS (tp, itch, s->align_wp2); \
\
speed_operand_src (s, s->xp, s->size); \
speed_operand_src (s, s->yp, s->size); \
- speed_operand_dst (s, wp, 2 * size); \
- speed_operand_dst (s, tp, 3 * size + 100); /* FIXME: Use itch function */ \
+ speed_operand_dst (s, wp, size); \
+ speed_operand_dst (s, tp, itch); \
speed_cache_fill (s); \
\
speed_starttime (); \
i = s->reps; \
do \
- function (wp, size, s->xp, s->size, s->yp, s->size, tp); \
+ function (wp, size, s->xp, s->size, s->yp, s->size, tp); \
while (--i != 0); \
t = speed_endtime (); \
\
More information about the gmp-commit
mailing list