7#include "../../../include/lammp/impl/tmp_alloc.h"
8#include "../../../include/lammp/lmmpn.h"
9#include "../../../include/lammp/numth.h"
13 if (b##_i_##n >= rn) \
14 lmmp_mul_(dst, b##_i_, b##_i_##n, sq, rn); \
16 lmmp_mul_(dst, sq, rn, b##_i_, b##_i_##n); \
18 rn -= (dst[rn - 1] == 0) ? 1 : 0; \
21 if (b##_i_##n >= rn) \
22 lmmp_mul_(sq, b##_i_, b##_i_##n, dst, rn); \
24 lmmp_mul_(sq, dst, rn, b##_i_, b##_i_##n); \
26 rn -= (sq[rn - 1] == 0) ? 1 : 0; \
38#define new_b(_i_) mp_ptr restrict b##_i_ = TALLOC_TYPE(b##_i_##n, mp_limb_t)
55 while ((exp & (0x3ull << ((i--) * 2))) == 0);
60 for (j = i + 1; j != -1; --j) {
61 int p = (exp & (0x3ull << (j * 2))) >> (j * 2);
73 for (++i; i != -1; --i) {
74 int p = (exp & (0x3ull << (i * 2))) >> (i * 2);
89 rn -= (dst[rn - 1] == 0) ? 1 : 0;
92 rn -= (sq[rn - 1] == 0) ? 1 : 0;
96 rn -= (sq[rn - 1] == 0) ? 1 : 0;
99 rn -= (dst[rn - 1] == 0) ? 1 : 0;
#define lmmp_debug_assert(x)
const mp_limb_t * mp_srcptr
#define lmmp_param_assert(x)
void lmmp_mul_(mp_ptr dst, mp_srcptr numa, mp_size_t na, mp_srcptr numb, mp_size_t nb)
不等长大数乘法操作 [dst,na+nb] = [numa,na] * [numb,nb]
void lmmp_sqr_(mp_ptr dst, mp_srcptr numa, mp_size_t na)
大数平方操作 [dst,2*na] = [numa,na]^2
mp_size_t lmmp_pow_win2_(mp_ptr restrict dst, mp_size_t rn, mp_srcptr restrict base, mp_size_t n, ulong exp)
#define BALLOC_TYPE(n, type)