@ -715,11 +715,12 @@ struct Code : public mcl::Generator {
Operand z = mul(x, y);
storeN(z, pz);
ret(Void);
} else if (N >= 8 && (N % 2) == 0) {
} else if (N > 8 && (N % 2) == 0) {
/*
W = 1 << half
(aW + b)(cW + d) = acW^2 + (ad + bc)W + bd
ad + bc = (a + b)(c + d) - ac - bd
@note Karatsuba is slower for N = 8
*/
const int H = N / 2;
const int half = bit / 2;
@ -70,7 +70,7 @@ void bench(Unit *x, Unit *y, const Unit *p)
{
printf("N=%zd\n", N);
Unit xx[N * 2], yy[N * 2];
const int C = 1000;
const int C = 10000;
CYBOZU_BENCH_C("mulPre", C, mulPre<N>, xx, x, y);
CYBOZU_BENCH_C("sqrPre", C, sqrPre<N>, yy, x);
CYBOZU_BENCH_C("mod ", C, mod<N>, yy, xx, p);