Lines Matching full:size

21 #define MPN_MUL_N_RECURSE(prodp, up, vp, size, tspace)		\  argument
23 if ((size) < KARATSUBA_THRESHOLD) \
24 mul_n_basecase(prodp, up, vp, size); \
26 mul_n(prodp, up, vp, size, tspace); \
29 #define MPN_SQR_N_RECURSE(prodp, up, size, tspace) \ argument
31 if ((size) < KARATSUBA_THRESHOLD) \
32 mpih_sqr_n_basecase(prodp, up, size); \
34 mpih_sqr_n(prodp, up, size, tspace); \
38 * both with SIZE limbs, and store the result at PRODP. 2 * SIZE limbs are
55 mul_n_basecase(mpi_ptr_t prodp, mpi_ptr_t up, mpi_ptr_t vp, mpi_size_t size) in mul_n_basecase() argument
66 MPN_COPY(prodp, up, size); in mul_n_basecase()
68 MPN_ZERO(prodp, size); in mul_n_basecase()
71 cy = mpihelp_mul_1(prodp, up, size, v_limb); in mul_n_basecase()
73 prodp[size] = cy; in mul_n_basecase()
78 for (i = 1; i < size; i++) { in mul_n_basecase()
83 cy = mpihelp_add_n(prodp, prodp, up, size); in mul_n_basecase()
85 cy = mpihelp_addmul_1(prodp, up, size, v_limb); in mul_n_basecase()
87 prodp[size] = cy; in mul_n_basecase()
96 mpi_size_t size, mpi_ptr_t tspace) in mul_n() argument
98 if (size & 1) { in mul_n()
99 /* The size is odd, and the code below doesn't handle that. in mul_n()
100 * Multiply the least significant (size - 1) limbs with a recursive in mul_n()
104 * code below behave as if the size were even, and let it check for in mul_n()
105 * odd size in the end. I.e., in essence move this code to the end. in mul_n()
109 mpi_size_t esize = size - 1; /* even size */ in mul_n()
115 cy_limb = mpihelp_addmul_1(prodp + esize, vp, size, up[esize]); in mul_n()
116 prodp[esize + size] = cy_limb; in mul_n()
133 mpi_size_t hsize = size >> 1; in mul_n()
142 MPN_MUL_N_RECURSE(prodp + size, up + hsize, vp + hsize, hsize, in mul_n()
167 tspace + size); in mul_n()
170 MPN_COPY(prodp + hsize, prodp + size, hsize); in mul_n()
171 cy = mpihelp_add_n(prodp + size, prodp + size, in mul_n()
172 prodp + size + hsize, hsize); in mul_n()
178 size); in mul_n()
182 size); in mul_n()
190 MPN_MUL_N_RECURSE(tspace, up, vp, hsize, tspace + size); in mul_n()
194 cy += mpihelp_add_n(prodp + hsize, prodp + hsize, tspace, size); in mul_n()
196 mpihelp_add_1(prodp + hsize + size, in mul_n()
197 prodp + hsize + size, hsize, cy); in mul_n()
203 mpihelp_add_1(prodp + size, prodp + size, size, 1); in mul_n()
207 void mpih_sqr_n_basecase(mpi_ptr_t prodp, mpi_ptr_t up, mpi_size_t size) in mpih_sqr_n_basecase() argument
218 MPN_COPY(prodp, up, size); in mpih_sqr_n_basecase()
220 MPN_ZERO(prodp, size); in mpih_sqr_n_basecase()
223 cy_limb = mpihelp_mul_1(prodp, up, size, v_limb); in mpih_sqr_n_basecase()
225 prodp[size] = cy_limb; in mpih_sqr_n_basecase()
230 for (i = 1; i < size; i++) { in mpih_sqr_n_basecase()
235 cy_limb = mpihelp_add_n(prodp, prodp, up, size); in mpih_sqr_n_basecase()
237 cy_limb = mpihelp_addmul_1(prodp, up, size, v_limb); in mpih_sqr_n_basecase()
239 prodp[size] = cy_limb; in mpih_sqr_n_basecase()
245 mpih_sqr_n(mpi_ptr_t prodp, mpi_ptr_t up, mpi_size_t size, mpi_ptr_t tspace) in mpih_sqr_n() argument
247 if (size & 1) { in mpih_sqr_n()
248 /* The size is odd, and the code below doesn't handle that. in mpih_sqr_n()
249 * Multiply the least significant (size - 1) limbs with a recursive in mpih_sqr_n()
253 * code below behave as if the size were even, and let it check for in mpih_sqr_n()
254 * odd size in the end. I.e., in essence move this code to the end. in mpih_sqr_n()
258 mpi_size_t esize = size - 1; /* even size */ in mpih_sqr_n()
264 cy_limb = mpihelp_addmul_1(prodp + esize, up, size, up[esize]); in mpih_sqr_n()
266 prodp[esize + size] = cy_limb; in mpih_sqr_n()
268 mpi_size_t hsize = size >> 1; in mpih_sqr_n()
276 MPN_SQR_N_RECURSE(prodp + size, up + hsize, hsize, tspace); in mpih_sqr_n()
289 MPN_SQR_N_RECURSE(tspace, prodp, hsize, tspace + size); in mpih_sqr_n()
292 MPN_COPY(prodp + hsize, prodp + size, hsize); in mpih_sqr_n()
293 cy = mpihelp_add_n(prodp + size, prodp + size, in mpih_sqr_n()
294 prodp + size + hsize, hsize); in mpih_sqr_n()
297 cy -= mpihelp_sub_n(prodp + hsize, prodp + hsize, tspace, size); in mpih_sqr_n()
304 MPN_SQR_N_RECURSE(tspace, up, hsize, tspace + size); in mpih_sqr_n()
307 cy += mpihelp_add_n(prodp + hsize, prodp + hsize, tspace, size); in mpih_sqr_n()
309 mpihelp_add_1(prodp + hsize + size, in mpih_sqr_n()
310 prodp + hsize + size, hsize, cy); in mpih_sqr_n()
316 mpihelp_add_1(prodp + size, prodp + size, size, 1); in mpih_sqr_n()