Lines Matching refs:size

52 impn_mul_n_basecase (mp_ptr prodp, mp_srcptr up, mp_srcptr vp, mp_size_t size)  in impn_mul_n_basecase()  argument
64 MPN_COPY (prodp, up, size); in impn_mul_n_basecase()
66 MPN_ZERO (prodp, size); in impn_mul_n_basecase()
70 cy_limb = mpn_mul_1 (prodp, up, size, v_limb); in impn_mul_n_basecase()
72 prodp[size] = cy_limb; in impn_mul_n_basecase()
77 for (i = 1; i < size; i++) in impn_mul_n_basecase()
84 cy_limb = mpn_add_n (prodp, prodp, up, size); in impn_mul_n_basecase()
87 cy_limb = mpn_addmul_1 (prodp, up, size, v_limb); in impn_mul_n_basecase()
89 prodp[size] = cy_limb; in impn_mul_n_basecase()
96 mp_srcptr up, mp_srcptr vp, mp_size_t size, mp_ptr tspace) in impn_mul_n() argument
98 if ((size & 1) != 0) in impn_mul_n()
110 mp_size_t esize = size - 1; /* even size */ in impn_mul_n()
116 cy_limb = mpn_addmul_1 (prodp + esize, vp, size, up[esize]); in impn_mul_n()
118 prodp[esize + size] = cy_limb; in impn_mul_n()
137 mp_size_t hsize = size >> 1; in impn_mul_n()
145 MPN_MUL_N_RECURSE (prodp + size, up + hsize, vp + hsize, hsize, tspace); in impn_mul_n()
172 MPN_MUL_N_RECURSE (tspace, prodp, prodp + hsize, hsize, tspace + size); in impn_mul_n()
175 MPN_COPY (prodp + hsize, prodp + size, hsize); in impn_mul_n()
176 cy = mpn_add_n (prodp + size, prodp + size, prodp + size + hsize, hsize); in impn_mul_n()
180 cy -= mpn_sub_n (prodp + hsize, prodp + hsize, tspace, size); in impn_mul_n()
182 cy += mpn_add_n (prodp + hsize, prodp + hsize, tspace, size); in impn_mul_n()
189 MPN_MUL_N_RECURSE (tspace, up, vp, hsize, tspace + size); in impn_mul_n()
193 cy += mpn_add_n (prodp + hsize, prodp + hsize, tspace, size); in impn_mul_n()
195 mpn_add_1 (prodp + hsize + size, prodp + hsize + size, hsize, cy); in impn_mul_n()
200 mpn_add_1 (prodp + size, prodp + size, size, 1); in impn_mul_n()
205 impn_sqr_n_basecase (mp_ptr prodp, mp_srcptr up, mp_size_t size) in impn_sqr_n_basecase() argument
217 MPN_COPY (prodp, up, size); in impn_sqr_n_basecase()
219 MPN_ZERO (prodp, size); in impn_sqr_n_basecase()
223 cy_limb = mpn_mul_1 (prodp, up, size, v_limb); in impn_sqr_n_basecase()
225 prodp[size] = cy_limb; in impn_sqr_n_basecase()
230 for (i = 1; i < size; i++) in impn_sqr_n_basecase()
237 cy_limb = mpn_add_n (prodp, prodp, up, size); in impn_sqr_n_basecase()
240 cy_limb = mpn_addmul_1 (prodp, up, size, v_limb); in impn_sqr_n_basecase()
242 prodp[size] = cy_limb; in impn_sqr_n_basecase()
249 mp_srcptr up, mp_size_t size, mp_ptr tspace) in impn_sqr_n() argument
251 if ((size & 1) != 0) in impn_sqr_n()
263 mp_size_t esize = size - 1; /* even size */ in impn_sqr_n()
269 cy_limb = mpn_addmul_1 (prodp + esize, up, size, up[esize]); in impn_sqr_n()
271 prodp[esize + size] = cy_limb; in impn_sqr_n()
275 mp_size_t hsize = size >> 1; in impn_sqr_n()
282 MPN_SQR_N_RECURSE (prodp + size, up + hsize, hsize, tspace); in impn_sqr_n()
298 MPN_SQR_N_RECURSE (tspace, prodp, hsize, tspace + size); in impn_sqr_n()
301 MPN_COPY (prodp + hsize, prodp + size, hsize); in impn_sqr_n()
302 cy = mpn_add_n (prodp + size, prodp + size, prodp + size + hsize, hsize); in impn_sqr_n()
305 cy -= mpn_sub_n (prodp + hsize, prodp + hsize, tspace, size); in impn_sqr_n()
312 MPN_SQR_N_RECURSE (tspace, up, hsize, tspace + size); in impn_sqr_n()
316 cy += mpn_add_n (prodp + hsize, prodp + hsize, tspace, size); in impn_sqr_n()
318 mpn_add_1 (prodp + hsize + size, prodp + hsize + size, hsize, cy); in impn_sqr_n()
323 mpn_add_1 (prodp + size, prodp + size, size, 1); in impn_sqr_n()
329 mpn_mul_n (mp_ptr prodp, mp_srcptr up, mp_srcptr vp, mp_size_t size) in mpn_mul_n() argument
335 if (size < KARATSUBA_THRESHOLD) in mpn_mul_n()
337 impn_sqr_n_basecase (prodp, up, size); in mpn_mul_n()
342 tspace = (mp_ptr) TMP_ALLOC (2 * size * BYTES_PER_MP_LIMB); in mpn_mul_n()
343 impn_sqr_n (prodp, up, size, tspace); in mpn_mul_n()
348 if (size < KARATSUBA_THRESHOLD) in mpn_mul_n()
350 impn_mul_n_basecase (prodp, up, vp, size); in mpn_mul_n()
355 tspace = (mp_ptr) TMP_ALLOC (2 * size * BYTES_PER_MP_LIMB); in mpn_mul_n()
356 impn_mul_n (prodp, up, vp, size, tspace); in mpn_mul_n()