/* mpn_mod_1_1p (ap, n, b, cps) Divide (ap,,n) by b. Return the single-limb remainder.
Contributed to the GNU project by Torbjorn Granlund and Niels Möller. Based on a suggestion by Peter L. Montgomery.
THE FUNCTIONS IN THIS FILE ARE INTERNAL WITH MUTABLE INTERFACES. IT IS ONLY SAFE TO REACH THEM THROUGH DOCUMENTED INTERFACES. IN FACT, IT IS ALMOST GUARANTEED THAT THEY WILL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
Copyright 2008-2011, 2013 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify it under the terms of either:
* 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.
or
* the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
or both in parallel, as here.
The GNU MP 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 General Public License for more details.
You should have received copies of the GNU General Public License and the GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
#include"gmp-impl.h" #include"longlong.h"
#ifndef MOD_1_1P_METHOD # define MOD_1_1P_METHOD 1 /* need to make sure this is 2 for asm testing */ #endif
/* Define some longlong.h-style macros, but for wider operations. * add_mssaaaa is like longlong.h's add_ssaaaa, but also generates
* carry out, in the form of a mask. */
for (i = n - 3; i >= 0; i -= 1)
{ /* rr = ap[i] < B + LO(rr) * (B mod b) <= (B-1)(b-1) + HI(rr) * (B^2 mod b) <= (B-1)(b-1)
*/
umul_ppmm (ph, pl, rl, B1modb);
add_ssaaaa (ph, pl, ph, pl, CNST_LIMB(0), ap[i]);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.