26 mp_ptr a = alloc_limbs(
n), b = alloc_limbs(
n), d = alloc_limbs(
n + 1);
27 fill_random(a,
n, 0x5152535455565758ull +
n);
28 fill_random(b,
n, 0x6162636465666768ull +
n);
38 mp_ptr a = alloc_limbs(
n), b = alloc_limbs(
n), d = alloc_limbs(
n + 1);
39 fill_random(a,
n, 0x7172737475767778ull +
n);
40 fill_random(b,
n, 0x8182838485868788ull +
n);
50 mp_ptr a = alloc_limbs(
n), b = alloc_limbs(
n), d = alloc_limbs(
n);
51 fill_random(a,
n, 0xd1d2d3d4d5d6d7d8ull +
n);
52 fill_random(b,
n, 0xe1e2e3e4e5e6e7e8ull +
n);
62 mp_ptr a = alloc_limbs(
n), b = alloc_limbs(
n), d = alloc_limbs(
n);
63 fill_random(a,
n, 0xf1f2f3f4f5f6f7f8ull +
n);
64 fill_random(b,
n, 0x1112131415162718ull +
n);
74 setvbuf(stdout, NULL, _IONBF, 0);
76 puts(
"[lmmpn/addsub_shift]");
static double bench_shr1add_n(mp_size_t n, const bench_options *o)
static double bench_subshl1_n(mp_size_t n, const bench_options *o)
static double bench_addshl1_n(mp_size_t n, const bench_options *o)
Copyright (C) 2026 HJimmyK (Jericho Knox)
static double bench_shr1sub_n(mp_size_t n, const bench_options *o)
int main(void)
Copyright (C) 2026 HJimmyK (Jericho Knox)
void lmmp_free(void *ptr)
内存释放函数(调用lmmp_heap_free_fn)
void lmmp_global_init(void)
全局初始化函数(线程局部的)
void lmmp_global_deinit(void)
全局释放函数(线程局部的)
mp_limb_t lmmp_shr1add_n_(mp_ptr dst, mp_srcptr numa, mp_srcptr numb, mp_size_t n)
加法后右移1位 [dst,n] = ([numa,n] + [numb,n]) >> 1
mp_limb_t lmmp_subshl1_n_(mp_ptr dst, mp_srcptr numa, mp_srcptr numb, mp_size_t n)
减法结合左移1位操作 [dst,n] = [numa,n] - ([numb,n] << 1)
mp_limb_t lmmp_addshl1_n_(mp_ptr dst, mp_srcptr numa, mp_srcptr numb, mp_size_t n)
加法结合左移1位操作 [dst,n] = [numa,n] + ([numb,n] << 1)
mp_limb_t lmmp_shr1sub_n_(mp_ptr dst, mp_srcptr numa, mp_srcptr numb, mp_size_t n)
减法后右移1位 [dst,n] = ([numa,n] - [numb,n]) >> 1
#define BENCH_MEASURE(result, options,...)