From 51efcd19a5e7e033128b4f194e39b6e2f6dab4e9 Mon Sep 17 00:00:00 2001 From: MITSUNARI Shigeo Date: Wed, 26 Sep 2018 05:02:52 +0900 Subject: [PATCH] remove old code --- include/mcl/vint.hpp | 42 ------------------------------------------ 1 file changed, 42 deletions(-) diff --git a/include/mcl/vint.hpp b/include/mcl/vint.hpp index 45c2f5f..948c9c7 100644 --- a/include/mcl/vint.hpp +++ b/include/mcl/vint.hpp @@ -599,7 +599,6 @@ void divNM(T *q, size_t qn, T *r, const T *x, size_t xn, const T *y, size_t yn) return; } assert(yn >= 2); -#if 1 /* bitwise left shift x and y to adjust MSB of y[yn - 1] = 1 */ @@ -656,47 +655,6 @@ void divNM(T *q, size_t qn, T *r, const T *x, size_t xn, const T *y, size_t yn) copyN(r, xx, xn); } clearN(r + xn, rn - xn); -#else - T *qOrg = q; - if (q) { - if (q == x || q == y) { - q = (T*)CYBOZU_ALLOCA(sizeof(T) * qn); - } - clearN(q, qn); - } - T *rr = (T*)CYBOZU_ALLOCA(sizeof(T) * xn); - copyN(rr, x, xn); - T *t = (T*)CYBOZU_ALLOCA(sizeof(T) * (xn + 2)); - size_t yb = getBitSize(y, yn); - const size_t unitBitSize = sizeof(T) * 8; - while (vint::compareNM(rr, xn, y, yn) >= 0) { - size_t xb = getBitSize(rr, xn); - if (xb <= yb + 1) { - vint::subNM(rr, rr, xn, y, yn); - xn = getRealSize(rr, xn); - if (q) vint::addu1(q, q, qn, 1); - continue; - } - assert(xb > yb + 1); - size_t w = fp::min_(unitBitSize, xb - yb); - vint::shrN(t, rr, xn, xb - w); - T q0 = t[0]; - t[yn] = vint::mulu1(t, y, yn, q0); - vint::shlN(t, t, yn + 1, xb - w - yb); - vint::subN(rr, rr, t, xn); - xn = getRealSize(rr, xn); - if (q) { - clearN(t, qn); - t[0] = q0; - vint::shlN(t, t, 1, xb - w - yb); - vint::addN(q, q, t, qn); - } - } - copyN(r, rr, rn); - if (q && q != qOrg) { - copyN(qOrg, q, qn); - } -#endif } #ifndef MCL_VINT_FIXED_BUFFER