Lines Matching refs:prodp

34 #define MPN_MUL_N_RECURSE(prodp, up, vp, size, tspace)		\  argument
37 mul_n_basecase(prodp, up, vp, size); \
39 mul_n(prodp, up, vp, size, tspace); \
42 #define MPN_SQR_N_RECURSE(prodp, up, size, tspace) \ argument
45 mpih_sqr_n_basecase(prodp, up, size); \
47 mpih_sqr_n(prodp, up, size, tspace); \
68 mul_n_basecase(mpi_ptr_t prodp, mpi_ptr_t up, mpi_ptr_t vp, mpi_size_t size) in mul_n_basecase() argument
79 MPN_COPY(prodp, up, size); in mul_n_basecase()
81 MPN_ZERO(prodp, size); in mul_n_basecase()
84 cy = mpihelp_mul_1(prodp, up, size, v_limb); in mul_n_basecase()
86 prodp[size] = cy; in mul_n_basecase()
87 prodp++; in mul_n_basecase()
96 cy = mpihelp_add_n(prodp, prodp, up, size); in mul_n_basecase()
98 cy = mpihelp_addmul_1(prodp, up, size, v_limb); in mul_n_basecase()
100 prodp[size] = cy; in mul_n_basecase()
101 prodp++; in mul_n_basecase()
108 mul_n(mpi_ptr_t prodp, mpi_ptr_t up, mpi_ptr_t vp, in mul_n() argument
125 MPN_MUL_N_RECURSE(prodp, up, vp, esize, tspace); in mul_n()
126 cy_limb = mpihelp_addmul_1(prodp + esize, up, esize, vp[esize]); in mul_n()
127 prodp[esize + esize] = cy_limb; in mul_n()
128 cy_limb = mpihelp_addmul_1(prodp + esize, vp, size, up[esize]); in mul_n()
129 prodp[esize + size] = cy_limb; in mul_n()
155 MPN_MUL_N_RECURSE(prodp + size, up + hsize, vp + hsize, hsize, in mul_n()
162 mpihelp_sub_n(prodp, up + hsize, up, hsize); in mul_n()
165 mpihelp_sub_n(prodp, up, up + hsize, hsize); in mul_n()
169 mpihelp_sub_n(prodp + hsize, vp + hsize, vp, hsize); in mul_n()
172 mpihelp_sub_n(prodp + hsize, vp, vp + hsize, hsize); in mul_n()
179 MPN_MUL_N_RECURSE(tspace, prodp, prodp + hsize, hsize, in mul_n()
183 MPN_COPY(prodp + hsize, prodp + size, hsize); in mul_n()
184 cy = mpihelp_add_n(prodp + size, prodp + size, in mul_n()
185 prodp + size + hsize, hsize); in mul_n()
190 mpihelp_sub_n(prodp + hsize, prodp + hsize, tspace, in mul_n()
194 mpihelp_add_n(prodp + hsize, prodp + hsize, tspace, in mul_n()
207 cy += mpihelp_add_n(prodp + hsize, prodp + hsize, tspace, size); in mul_n()
209 mpihelp_add_1(prodp + hsize + size, in mul_n()
210 prodp + hsize + size, hsize, cy); in mul_n()
212 MPN_COPY(prodp, tspace, hsize); in mul_n()
213 cy = mpihelp_add_n(prodp + hsize, prodp + hsize, tspace + hsize, in mul_n()
216 mpihelp_add_1(prodp + size, prodp + size, size, 1); in mul_n()
220 void mpih_sqr_n_basecase(mpi_ptr_t prodp, mpi_ptr_t up, mpi_size_t size) in mpih_sqr_n_basecase() argument
231 MPN_COPY(prodp, up, size); in mpih_sqr_n_basecase()
233 MPN_ZERO(prodp, size); in mpih_sqr_n_basecase()
236 cy_limb = mpihelp_mul_1(prodp, up, size, v_limb); in mpih_sqr_n_basecase()
238 prodp[size] = cy_limb; in mpih_sqr_n_basecase()
239 prodp++; in mpih_sqr_n_basecase()
248 cy_limb = mpihelp_add_n(prodp, prodp, up, size); in mpih_sqr_n_basecase()
250 cy_limb = mpihelp_addmul_1(prodp, up, size, v_limb); in mpih_sqr_n_basecase()
252 prodp[size] = cy_limb; in mpih_sqr_n_basecase()
253 prodp++; in mpih_sqr_n_basecase()
258 mpih_sqr_n(mpi_ptr_t prodp, mpi_ptr_t up, mpi_size_t size, mpi_ptr_t tspace) in mpih_sqr_n() argument
274 MPN_SQR_N_RECURSE(prodp, up, esize, tspace); in mpih_sqr_n()
275 cy_limb = mpihelp_addmul_1(prodp + esize, up, esize, up[esize]); in mpih_sqr_n()
276 prodp[esize + esize] = cy_limb; in mpih_sqr_n()
277 cy_limb = mpihelp_addmul_1(prodp + esize, up, size, up[esize]); in mpih_sqr_n()
279 prodp[esize + size] = cy_limb; in mpih_sqr_n()
289 MPN_SQR_N_RECURSE(prodp + size, up + hsize, hsize, tspace); in mpih_sqr_n()
295 mpihelp_sub_n(prodp, up + hsize, up, hsize); in mpih_sqr_n()
297 mpihelp_sub_n(prodp, up, up + hsize, hsize); in mpih_sqr_n()
302 MPN_SQR_N_RECURSE(tspace, prodp, hsize, tspace + size); in mpih_sqr_n()
305 MPN_COPY(prodp + hsize, prodp + size, hsize); in mpih_sqr_n()
306 cy = mpihelp_add_n(prodp + size, prodp + size, in mpih_sqr_n()
307 prodp + size + hsize, hsize); in mpih_sqr_n()
310 cy -= mpihelp_sub_n(prodp + hsize, prodp + hsize, tspace, size); in mpih_sqr_n()
320 cy += mpihelp_add_n(prodp + hsize, prodp + hsize, tspace, size); in mpih_sqr_n()
322 mpihelp_add_1(prodp + hsize + size, in mpih_sqr_n()
323 prodp + hsize + size, hsize, cy); in mpih_sqr_n()
325 MPN_COPY(prodp, tspace, hsize); in mpih_sqr_n()
326 cy = mpihelp_add_n(prodp + hsize, prodp + hsize, tspace + hsize, in mpih_sqr_n()
329 mpihelp_add_1(prodp + size, prodp + size, size, 1); in mpih_sqr_n()
334 mpihelp_mul_karatsuba_case(mpi_ptr_t prodp, in mpihelp_mul_karatsuba_case() argument
350 MPN_MUL_N_RECURSE(prodp, up, vp, vsize, ctx->tspace); in mpihelp_mul_karatsuba_case()
352 prodp += vsize; in mpihelp_mul_karatsuba_case()
371 cy = mpihelp_add_n(prodp, prodp, ctx->tp, vsize); in mpihelp_mul_karatsuba_case()
372 mpihelp_add_1(prodp + vsize, ctx->tp + vsize, vsize, in mpihelp_mul_karatsuba_case()
374 prodp += vsize; in mpihelp_mul_karatsuba_case()
399 cy = mpihelp_add_n(prodp, prodp, ctx->tspace, vsize); in mpihelp_mul_karatsuba_case()
400 mpihelp_add_1(prodp + vsize, ctx->tspace + vsize, usize, cy); in mpihelp_mul_karatsuba_case()
440 mpihelp_mul(mpi_ptr_t prodp, mpi_ptr_t up, mpi_size_t usize, in mpihelp_mul() argument
443 mpi_ptr_t prod_endp = prodp + usize + vsize - 1; in mpihelp_mul()
461 MPN_COPY(prodp, up, usize); in mpihelp_mul()
463 MPN_ZERO(prodp, usize); in mpihelp_mul()
466 cy = mpihelp_mul_1(prodp, up, usize, v_limb); in mpihelp_mul()
468 prodp[usize] = cy; in mpihelp_mul()
469 prodp++; in mpihelp_mul()
478 cy = mpihelp_add_n(prodp, prodp, up, in mpihelp_mul()
481 cy = mpihelp_addmul_1(prodp, up, usize, v_limb); in mpihelp_mul()
483 prodp[usize] = cy; in mpihelp_mul()
484 prodp++; in mpihelp_mul()
492 if (mpihelp_mul_karatsuba_case(prodp, up, usize, vp, vsize, &ctx) < 0) in mpihelp_mul()