|
LMMP 4.3.0
Lamina High-Precision Arithmetic Library
|
#include "lmmp/lmmpn.h"函数 | |
| 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_shr1add_nc_ (mp_ptr dst, mp_srcptr numa, mp_srcptr numb, mp_size_t n, mp_limb_t c) |
| 带进位加法后右移1位 [dst,n] = ([numa,n] + [numb,n] + c) >> 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 | |
| mp_limb_t | lmmp_shr1sub_nc_ (mp_ptr dst, mp_srcptr numa, mp_srcptr numb, mp_size_t n, mp_limb_t c) |
| 带借位减法后右移1位 [dst,n] = ([numa,n] - [numb,n] - c) >> 1 | |
| mp_limb_t | lmmp_shr_ (mp_ptr dst, mp_srcptr numa, mp_size_t na, mp_size_t shr) |
| Copyright (C) 2026 HJimmyK (Jericho Knox) | |
| mp_limb_t | lmmp_shr_c_ (mp_ptr dst, mp_srcptr numa, mp_size_t na, mp_size_t shr, mp_limb_t c) |
| 带进位的右移操作 [dst,na] = [numa,na]>>shr,dst的高shr位填充c的高shr位 | |
加法后右移1位 [dst,n] = ([numa,n] + [numb,n]) >> 1
| dst | 结果输出指针 |
| numa | 第一个加数指针 |
| numb | 第二个加数指针 |
| n | limb长度 |
引用了 lmmp_shr1add_n_(), lmmp_shr1add_nc_(), n , 以及 numb.
被这些函数引用 bench_shr1add_n(), lmmp_mul_toom32_(), lmmp_mullh_(), lmmp_shr1add_n_(), lmmp_toom_couple_handling_(), lmmp_toom_interp12_(), lmmp_toom_interp16_(), lmmp_toom_interp5_(), lmmp_toom_interp6_(), lmmp_toom_interp7_() , 以及 TEST_CASE().
带进位加法后右移1位 [dst,n] = ([numa,n] + [numb,n] + c) >> 1
| dst | 结果输出指针 |
| numa | 第一个加数指针 |
| numb | 第二个加数指针 |
| n | limb长度 |
| c | 初始进位值 [0|1] |
引用了 lmmp_shr1add_nc_(), n , 以及 numb.
被这些函数引用 lmmp_mul_fft_crt_(), lmmp_mullh_(), lmmp_mullo_crt_(), lmmp_shr1add_n_(), lmmp_shr1add_nc_(), lmmp_sqr_fft_(), mrs_mul_core_(), mrs_sqr_core_() , 以及 TEST_CASE().
减法后右移1位 [dst,n] = ([numa,n] - [numb,n]) >> 1
| dst | 结果输出指针 |
| numa | 被减数指针 |
| numb | 减数指针 |
| n | 操作数的位数(limb数量) |
引用了 lmmp_shr1sub_n_(), lmmp_shr1sub_nc_(), n , 以及 numb.
被这些函数引用 bench_shr1sub_n(), lmmp_mul_toom32_(), lmmp_mullh_(), lmmp_shr1sub_n_(), lmmp_toom_couple_handling_(), lmmp_toom_interp12_(), lmmp_toom_interp16_(), lmmp_toom_interp5_(), lmmp_toom_interp6_(), lmmp_toom_interp7_() , 以及 TEST_CASE().
带借位减法后右移1位 [dst,n] = ([numa,n] - [numb,n] - c) >> 1
| dst | 结果输出指针 |
| numa | 被减数指针 |
| numb | 减数指针 |
| n | limb长度 |
| c | 初始借位值 [0|1] |
引用了 lmmp_shr1sub_nc_(), n , 以及 numb.
被这些函数引用 lmmp_mullh_(), lmmp_shr1sub_n_(), lmmp_shr1sub_nc_() , 以及 TEST_CASE().
Copyright (C) 2026 HJimmyK (Jericho Knox)
右移操作 [dst,na] = [numa,na]>>shr,dst的高shr位填充0
This file is part of LMMP.
LMMP is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library. If not, see https://www.gnu.org/licenses/.
SPDX-License-Identifier: LGPL-3.0-or-later
Copyright (C) 2026 HJimmyK (Jericho Knox)
| dst | 结果输出指针 |
| numa | 源操作数指针 |
| na | limb长度 |
| shr | 右移的位数 (0~63) |
引用了 LIMB_BITS, lmmp_copy , 以及 lmmp_shr_().
被这些函数引用 bench_shr(), dec_pow_extend_(), ipn_lucas_i_(), ipn_mont_half_(), ipn_notrial_i_(), lmmp_bninv_(), lmmp_cbrt_(), lmmp_div_(), lmmp_fft_extract_coef_(), lmmp_from_decimal_(), lmmp_gcdext_derive_(), lmmp_invsqrt_newton_(), lmmp_mullh_(), lmmp_nthroot_(), lmmp_powmod_(), lmmp_shr_(), lmmp_sqrt_(), lmmp_sqrt_divide_(), lmmp_sqrt_newton_(), lmmp_to_str_divide_(), lmmp_toom_couple_handling_(), lmmp_toom_interp6_(), lmmp_toom_interp7_(), nthroot_top_limbs_(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE() , 以及 TEST_CASE().
带进位的右移操作 [dst,na] = [numa,na]>>shr,dst的高shr位填充c的高shr位
| dst | 结果输出指针 |
| numa | 源操作数指针 |
| na | limb长度 |
| shr | 右移的位数 (0~63) |
| c | 进位值(其低(64-shr)位必须为0) |
引用了 LIMB_BITS, lmmp_copy , 以及 lmmp_shr_c_().
被这些函数引用 lmmp_inv_(), lmmp_mullh_(), lmmp_shr_c_(), TEST_CASE() , 以及 TEST_CASE().