chiark
/
gitweb
/
~mdw
/
catacomb
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e85f65d
)
math/mpreduce.c: Remove ancient debugging code.
author
Mark Wooding
<mdw@distorted.org.uk>
Mon, 5 Aug 2013 20:15:45 +0000
(21:15 +0100)
committer
Mark Wooding
<mdw@distorted.org.uk>
Mon, 5 Aug 2013 20:15:45 +0000
(21:15 +0100)
math/mpreduce.c
patch
|
blob
|
blame
|
history
diff --git
a/math/mpreduce.c
b/math/mpreduce.c
index b4543a66fbf770a3621672bca9552e83924b920a..cc74bc2b288cf1db027f107bc7980dfc34eb2205 100644
(file)
--- a/
math/mpreduce.c
+++ b/
math/mpreduce.c
@@
-180,21
+180,6
@@
int mpreduce_create(mpreduce *r, mp *p)
* the instruction's immediate operands.
*/
* the instruction's immediate operands.
*/
-#ifdef DEBUG
- for (i = 0, mp_scan(&sc, p); mp_step(&sc); i++) {
- switch (st | mp_bit(&sc)) {
- case Z | 1: st = Z1; break;
- case Z1 | 0: st = Z; printf("+ %lu\n", i - 1); break;
- case Z1 | 1: st = X; printf("- %lu\n", i - 1); break;
- case X | 0: st = X0; break;
- case X0 | 1: st = X; printf("- %lu\n", i - 1); break;
- case X0 | 0: st = Z; printf("+ %lu\n", i - 1); break;
- }
- }
- if (st >= X) printf("+ %lu\n", i - 1);
- st = Z;
-#endif
-
bb = MPW_BITS - (d + 1)%MPW_BITS;
for (i = 0, mp_scan(&sc, p); i < d && mp_step(&sc); i++) {
switch (st | mp_bit(&sc)) {
bb = MPW_BITS - (d + 1)%MPW_BITS;
for (i = 0, mp_scan(&sc, p); i < d && mp_step(&sc); i++) {
switch (st | mp_bit(&sc)) {
@@
-278,9
+263,6
@@
int mpreduce_create(mpreduce *r, mp *p)
}
DA_DESTROY(&iv);
}
DA_DESTROY(&iv);
-#ifdef DEBUG
- mpreduce_dump(r, stdout);
-#endif
return (0);
}
return (0);
}
@@
-348,15
+330,6
@@
static void run(const mpreduce_instr *i, const mpreduce_instr *il,
mpw *v, mpw z)
{
for (; i < il; i++) {
mpw *v, mpw z)
{
for (; i < il; i++) {
-#ifdef DEBUG
- mp vv;
- mp_build(&vv, v - i->argx, v + 1);
- printf(" 0x"); mp_writefile(&vv, stdout, 16);
- printf(" %c (0x%lx << %u) == 0x",
- (i->op & ~1u) == MPRI_ADD ? '+' : '-',
- (unsigned long)z,
- i->argy);
-#endif
switch (i->op) {
case MPRI_ADD: MPX_UADDN(v - i->argx, v + 1, z); break;
case MPRI_ADDLSL: mpx_uaddnlsl(v - i->argx, v + 1, z, i->argy); break;
switch (i->op) {
case MPRI_ADD: MPX_UADDN(v - i->argx, v + 1, z); break;
case MPRI_ADDLSL: mpx_uaddnlsl(v - i->argx, v + 1, z, i->argy); break;
@@
-365,11
+338,6
@@
static void run(const mpreduce_instr *i, const mpreduce_instr *il,
default:
abort();
}
default:
abort();
}
-#ifdef DEBUG
- mp_build(&vv, v - i->argx, v + 1);
- mp_writefile(&vv, stdout, 16);
- printf("\n");
-#endif
}
}
}
}
@@
-379,10
+347,6
@@
mp *mpreduce_do(mpreduce *r, mp *d, mp *x)
const mpreduce_instr *il;
mpw z;
const mpreduce_instr *il;
mpw z;
-#ifdef DEBUG
- mp *_r = 0, *_rr = 0;
-#endif
-
/* --- If source is negative, divide --- */
if (MP_NEGP(x)) {
/* --- If source is negative, divide --- */
if (MP_NEGP(x)) {
@@
-398,13
+362,6
@@
mp *mpreduce_do(mpreduce *r, mp *d, mp *x)
/* --- Stage one: trim excess words from the most significant end --- */
/* --- Stage one: trim excess words from the most significant end --- */
-#ifdef DEBUG
- _r = MP_NEW;
- mp_div(0, &_r, x, r->p);
- MP_PRINTX("x", x);
- _rr = 0;
-#endif
-
il = r->iv + r->in;
if (MP_LEN(x) >= r->lim) {
v = x->v + r->lim;
il = r->iv + r->in;
if (MP_LEN(x) >= r->lim) {
v = x->v + r->lim;
@@
-414,11
+371,6
@@
mp *mpreduce_do(mpreduce *r, mp *d, mp *x)
z = *vl;
*vl = 0;
run(r->iv, il, vl, z);
z = *vl;
*vl = 0;
run(r->iv, il, vl, z);
-#ifdef DEBUG
- MP_PRINTX("x", x);
- mp_div(0, &_rr, x, r->p);
- assert(MP_EQ(_r, _rr));
-#endif
}
}
}
}
@@
-429,11
+381,6
@@
mp *mpreduce_do(mpreduce *r, mp *d, mp *x)
z = *vl >> r->s;
*vl &= ((1 << r->s) - 1);
run(r->iv + r->in, il + r->in, vl, z);
z = *vl >> r->s;
*vl &= ((1 << r->s) - 1);
run(r->iv + r->in, il + r->in, vl, z);
-#ifdef DEBUG
- MP_PRINTX("x", x);
- mp_div(0, &_rr, x, r->p);
- assert(MP_EQ(_r, _rr));
-#endif
}
}
}
}
}
}
@@
-446,11
+393,6
@@
mp *mpreduce_do(mpreduce *r, mp *d, mp *x)
/* --- Done --- */
/* --- Done --- */
-#ifdef DEBUG
- assert(MP_EQ(_r, x));
- mp_drop(_r);
- mp_drop(_rr);
-#endif
return (x);
}
return (x);
}