Lines Matching refs:prodp
21 #define MPN_MUL_N_RECURSE(prodp, up, vp, size, tspace) \ argument
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
32 mpih_sqr_n_basecase(prodp, up, size); \
34 mpih_sqr_n(prodp, up, size, tspace); \
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()
74 prodp++; 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()
88 prodp++; in mul_n_basecase()
95 mul_n(mpi_ptr_t prodp, mpi_ptr_t up, mpi_ptr_t vp, in mul_n() argument
112 MPN_MUL_N_RECURSE(prodp, up, vp, esize, tspace); in mul_n()
113 cy_limb = mpihelp_addmul_1(prodp + esize, up, esize, vp[esize]); in mul_n()
114 prodp[esize + esize] = cy_limb; 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()
142 MPN_MUL_N_RECURSE(prodp + size, up + hsize, vp + hsize, hsize, in mul_n()
149 mpihelp_sub_n(prodp, up + hsize, up, hsize); in mul_n()
152 mpihelp_sub_n(prodp, up, up + hsize, hsize); in mul_n()
156 mpihelp_sub_n(prodp + hsize, vp + hsize, vp, hsize); in mul_n()
159 mpihelp_sub_n(prodp + hsize, vp, vp + hsize, hsize); in mul_n()
166 MPN_MUL_N_RECURSE(tspace, prodp, prodp + hsize, hsize, 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()
177 mpihelp_sub_n(prodp + hsize, prodp + hsize, tspace, in mul_n()
181 mpihelp_add_n(prodp + hsize, prodp + hsize, tspace, 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()
199 MPN_COPY(prodp, tspace, hsize); in mul_n()
200 cy = mpihelp_add_n(prodp + hsize, prodp + hsize, tspace + hsize, 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()
226 prodp++; 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()
240 prodp++; 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
261 MPN_SQR_N_RECURSE(prodp, up, esize, tspace); in mpih_sqr_n()
262 cy_limb = mpihelp_addmul_1(prodp + esize, up, esize, up[esize]); in mpih_sqr_n()
263 prodp[esize + esize] = cy_limb; 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()
276 MPN_SQR_N_RECURSE(prodp + size, up + hsize, hsize, tspace); in mpih_sqr_n()
282 mpihelp_sub_n(prodp, up + hsize, up, hsize); in mpih_sqr_n()
284 mpihelp_sub_n(prodp, up, up + hsize, hsize); 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()
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()
312 MPN_COPY(prodp, tspace, hsize); in mpih_sqr_n()
313 cy = mpihelp_add_n(prodp + hsize, prodp + hsize, tspace + hsize, in mpih_sqr_n()
316 mpihelp_add_1(prodp + size, prodp + size, size, 1); in mpih_sqr_n()
321 mpihelp_mul_karatsuba_case(mpi_ptr_t prodp, in mpihelp_mul_karatsuba_case() argument
337 MPN_MUL_N_RECURSE(prodp, up, vp, vsize, ctx->tspace); in mpihelp_mul_karatsuba_case()
339 prodp += vsize; in mpihelp_mul_karatsuba_case()
358 cy = mpihelp_add_n(prodp, prodp, ctx->tp, vsize); in mpihelp_mul_karatsuba_case()
359 mpihelp_add_1(prodp + vsize, ctx->tp + vsize, vsize, in mpihelp_mul_karatsuba_case()
361 prodp += vsize; in mpihelp_mul_karatsuba_case()
386 cy = mpihelp_add_n(prodp, prodp, ctx->tspace, vsize); in mpihelp_mul_karatsuba_case()
387 mpihelp_add_1(prodp + vsize, ctx->tspace + vsize, usize, cy); in mpihelp_mul_karatsuba_case()
427 mpihelp_mul(mpi_ptr_t prodp, mpi_ptr_t up, mpi_size_t usize, in mpihelp_mul() argument
430 mpi_ptr_t prod_endp = prodp + usize + vsize - 1; in mpihelp_mul()
448 MPN_COPY(prodp, up, usize); in mpihelp_mul()
450 MPN_ZERO(prodp, usize); in mpihelp_mul()
453 cy = mpihelp_mul_1(prodp, up, usize, v_limb); in mpihelp_mul()
455 prodp[usize] = cy; in mpihelp_mul()
456 prodp++; in mpihelp_mul()
465 cy = mpihelp_add_n(prodp, prodp, up, in mpihelp_mul()
468 cy = mpihelp_addmul_1(prodp, up, usize, v_limb); in mpihelp_mul()
470 prodp[usize] = cy; in mpihelp_mul()
471 prodp++; in mpihelp_mul()
479 if (mpihelp_mul_karatsuba_case(prodp, up, usize, vp, vsize, &ctx) < 0) in mpihelp_mul()