Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions src/dmd/backend/divcoeff.d
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void u128Div(ullong xh, ullong xl, ullong yh, ullong yl, ullong *pqh, ullong *pq

//ullong xxh = xh, xxl = xl, yyh = yh, yyl = yl;

// assert(yh || yl); // no div-by-0 bugs
assert(yh || yl); // no div-by-0 bugs

// left justify y
uint shiftcount = 1;
Expand Down Expand Up @@ -117,9 +117,9 @@ void u128Div(ullong xh, ullong xl, ullong yh, ullong yl, ullong *pqh, ullong *pq

extern (C) bool choose_multiplier(int N, ullong d, int prec, ullong *pm, int *pshpost)
{
// assert(N == 32 || N == 64);
// assert(prec <= N);
// assert(d > 1 && (d & (d - 1)));
assert(N == 32 || N == 64);
assert(prec <= N);
assert(d > 1 && (d & (d - 1)));

// Compute b such that 2**(b-1) < d <= 2**b
// which is the number of significant bits in d
Expand Down Expand Up @@ -205,8 +205,8 @@ extern (C) bool choose_multiplier(int N, ullong d, int prec, ullong *pm, int *ps
*pm = mhighl;
mhighbit = mhighh & 1;
}
// else
// assert(0);
else
assert(0);

*pshpost = shpost;
return mhighbit;
Expand Down Expand Up @@ -243,7 +243,7 @@ extern (C) bool udiv_coefficients(int N, ullong d, int *pshpre, ullong *pm, int
}
*pshpre = e;
mhighbit = choose_multiplier(N, d, N - e, pm, pshpost);
// assert(mhighbit == false);
assert(mhighbit == false);
}
else
*pshpre = 0;
Expand Down Expand Up @@ -290,10 +290,10 @@ unittest
bool mhighbit = udiv_coefficients(ps.N, ps.d, &shpre, &m, &shpost);

//printf("[%d] %d %d %llx %d\n", i, shpre, mhighbit, m, shpost);
// assert(shpre == ps.shpre);
// assert(mhighbit == ps.highbit);
// assert(m == ps.m);
// assert(shpost == ps.shpost);
assert(shpre == ps.shpre);
assert(mhighbit == ps.highbit);
assert(m == ps.m);
assert(shpost == ps.shpost);
}
}

Expand Down