YoushouldhavereceivedcopiesoftheGNUGeneralPublicLicenseandthe GNULesserGeneralPublicLicensealongwiththeGNUMPLibrary.Ifnot,
see https://www.gnu.org/licenses/. */
/* For the various mpn_divexact_byN here, fall back to using either mpn_pi1_bdiv_q_1ormpn_divexact_1.Theformerhaslessoverheadandis manyfasterifitisnative.Fornow,sincempn_divexact_1isnativeon severalplatformswherempn_pi1_bdiv_q_1doesnotyetexist,donotuse
mpn_pi1_bdiv_q_1 unconditionally. FIXME. */
/* For odd divisors, mpn_divexact_1 works fine with two's complement. */ #ifndef mpn_divexact_by3 #if HAVE_NATIVE_mpn_pi1_bdiv_q_1 #define mpn_divexact_by3(dst,src,size) mpn_pi1_bdiv_q_1(dst,src,size,3,BINVERT_3,0) #else #define mpn_divexact_by3(dst,src,size) mpn_divexact_1(dst,src,size,3) #endif #endif
/* Interpolation for toom4, using the evaluation points 0, infinity, 1,-1,2,-2,1/2.Moreprecisely,wewanttocompute f(2^(GMP_NUMB_BITS*n))forapolynomialfofdegree6,giventhe sevenvalues
/* These bounds are valid for the 4x4 polynomial product of toom44,
* and they are conservative for toom53 and toom62. */
ASSERT (w1[2*n] < 2);
ASSERT (w2[2*n] < 3);
ASSERT (w3[2*n] < 4);
ASSERT (w4[2*n] < 3);
ASSERT (w5[2*n] < 2);
/* Addition chain. Note carries and the 2n'th limbs that need to be *addedin. * *Specialcareisneededforw2[2n]andthecorrespondingcarry, *sincethe"simple"wayofaddingitalltogetherwouldoverwrite *thelimbatwp[2*n]andrp[4*n](samelocation)withthesumof *thehighhalfofw3andthelowhalfofw4. * *76543210 *||||||||| *||w3(2n+1)| *||w4(2n+1)| *||w5(2n+1)|||w1(2n+1)| *+|w6(w6n)|||w2(2n+1)|w0(2n)|(sharestoragewithr) *----------------------------------------------- *r||||||||| *c7c6c5c4c3Carriestopropagate
*/
cy = mpn_add_n (rp + n, rp + n, w1, m);
MPN_INCR_U (w2 + n + 1, n , cy);
cy = mpn_add_n (rp + 3*n, rp + 3*n, w3, n);
MPN_INCR_U (w3 + n, n + 1, w2[2*n] + cy);
cy = mpn_add_n (rp + 4*n, w3 + n, w4, n);
MPN_INCR_U (w4 + n, n + 1, w3[2*n] + cy);
cy = mpn_add_n (rp + 5*n, w4 + n, w5, n);
MPN_INCR_U (w5 + n, n + 1, w4[2*n] + cy); if (w6n > n + 1)
{
cy = mpn_add_n (rp + 6*n, rp + 6*n, w5 + n, n + 1);
MPN_INCR_U (rp + 7*n + 1, w6n - n - 1, cy);
} else
{
ASSERT_NOCARRY (mpn_add_n (rp + 6*n, rp + 6*n, w5 + n, w6n)); #if WANT_ASSERT
{
mp_size_t i; for (i = w6n; i <= n; i++)
ASSERT (w5[n + i] == 0);
} #endif
}
}
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.