ruby-changes:29732
From: akr <ko1@a...>
Date: Fri, 5 Jul 2013 06:04:33 +0900 (JST)
Subject: [ruby-changes:29732] akr:r41784 (trunk): * bignum.c (BARY_MUL1): Renamed from BARY_MUL.
akr 2013-07-05 06:04:21 +0900 (Fri, 05 Jul 2013) New Revision: 41784 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=41784 Log: * bignum.c (BARY_MUL1): Renamed from BARY_MUL. (bary_mul1): Renamed from bary_mul. (bary_mul): Renamed from bary_mul2. Modified files: trunk/ChangeLog trunk/bignum.c Index: ChangeLog =================================================================== --- ChangeLog (revision 41783) +++ ChangeLog (revision 41784) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Fri Jul 5 05:39:53 2013 Tanaka Akira <akr@f...> + + * bignum.c (BARY_MUL1): Renamed from BARY_MUL. + (bary_mul1): Renamed from bary_mul. + (bary_mul): Renamed from bary_mul2. + Fri Jul 5 04:58:05 2013 Tanaka Akira <akr@f...> * bignum.c (bary_mul_balance): Extracted from bigmul1_balance and Index: bignum.c =================================================================== --- bignum.c (revision 41783) +++ bignum.c (revision 41784) @@ -86,7 +86,7 @@ static VALUE big_three = Qnil; https://github.com/ruby/ruby/blob/trunk/bignum.c#L86 #define BARY_ADD(z, x, y) bary_add(BARY_ARGS(z), BARY_ARGS(x), BARY_ARGS(y)) #define BARY_SUB(z, x, y) bary_sub(BARY_ARGS(z), BARY_ARGS(x), BARY_ARGS(y)) -#define BARY_MUL(z, x, y) bary_mul(BARY_ARGS(z), BARY_ARGS(x), BARY_ARGS(y)) +#define BARY_MUL1(z, x, y) bary_mul1(BARY_ARGS(z), BARY_ARGS(x), BARY_ARGS(y)) #define BARY_DIVMOD(q, r, x, y) bary_divmod(BARY_ARGS(q), BARY_ARGS(r), BARY_ARGS(x), BARY_ARGS(y)) #define BARY_ZERO_P(x) bary_zero_p(BARY_ARGS(x)) @@ -99,8 +99,8 @@ static VALUE big_three = Qnil; https://github.com/ruby/ruby/blob/trunk/bignum.c#L99 static BDIGIT bary_small_lshift(BDIGIT *zds, BDIGIT *xds, long n, int shift); static void bary_small_rshift(BDIGIT *zds, BDIGIT *xds, long n, int shift, int sign_bit); static void bary_unpack(BDIGIT *bdigits, size_t num_bdigits, const void *words, size_t numwords, size_t wordsize, size_t nails, int flags); +static void bary_mul1(BDIGIT *zds, size_t zl, BDIGIT *xds, size_t xl, BDIGIT *yds, size_t yl); static void bary_mul(BDIGIT *zds, size_t zl, BDIGIT *xds, size_t xl, BDIGIT *yds, size_t yl); -static void bary_mul2(BDIGIT *zds, size_t zl, BDIGIT *xds, size_t xl, BDIGIT *yds, size_t yl); static void bary_sub(BDIGIT *zds, size_t zn, BDIGIT *xds, size_t xn, BDIGIT *yds, size_t yn); static void bary_divmod(BDIGIT *qds, size_t nq, BDIGIT *rds, size_t nr, BDIGIT *xds, size_t nx, BDIGIT *yds, size_t ny); static void bary_add(BDIGIT *zds, size_t zn, BDIGIT *xds, size_t xn, BDIGIT *yds, size_t yn); @@ -923,7 +923,7 @@ absint_numwords_generic(size_t numbytes, https://github.com/ruby/ruby/blob/trunk/bignum.c#L923 bary_unpack(BARY_ARGS(numbytes_bary), &numbytes, 1, sizeof(numbytes), 0, INTEGER_PACK_NATIVE_BYTE_ORDER); - BARY_MUL(val_numbits_bary, numbytes_bary, char_bit); + BARY_MUL1(val_numbits_bary, numbytes_bary, char_bit); if (nlz_bits_in_msbyte) BARY_SUB(val_numbits_bary, val_numbits_bary, nlz_bits_in_msbyte_bary); bary_unpack(BARY_ARGS(word_numbits_bary), &word_numbits, 1, sizeof(word_numbits), 0, @@ -2372,11 +2372,11 @@ rb_cstr_to_inum(const char *str, int bas https://github.com/ruby/ruby/blob/trunk/bignum.c#L2372 for (unit = 2; unit < num_bdigits; unit *= 2) { for (i = 0; i < num_bdigits; i += unit*2) { if (2*unit <= num_bdigits - i) { - bary_mul2(vds+i, unit*2, BDIGITS(powerv), RBIGNUM_LEN(powerv), uds+i+unit, unit); + bary_mul(vds+i, unit*2, BDIGITS(powerv), RBIGNUM_LEN(powerv), uds+i+unit, unit); bary_add(vds+i, unit*2, vds+i, unit*2, uds+i, unit); } else if (unit <= num_bdigits - i) { - bary_mul2(vds+i, num_bdigits-i, BDIGITS(powerv), RBIGNUM_LEN(powerv), uds+i+unit, num_bdigits-(i+unit)); + bary_mul(vds+i, num_bdigits-i, BDIGITS(powerv), RBIGNUM_LEN(powerv), uds+i+unit, num_bdigits-(i+unit)); bary_add(vds+i, num_bdigits-i, vds+i, num_bdigits-i, uds+i, unit); } else { @@ -3949,7 +3949,7 @@ bary_mul_balance(BDIGIT *zds, size_t zl, https://github.com/ruby/ruby/blob/trunk/bignum.c#L3949 n = 0; while (yl > 0) { r = xl > yl ? yl : xl; - bary_mul2(wds, xl + r, xds, xl, yds + n, r); + bary_mul(wds, xl + r, xds, xl, yds + n, r); bary_add(zds + n, zl - n, zds + n, zl - n, wds, xl + r); @@ -3962,7 +3962,7 @@ bary_mul_balance(BDIGIT *zds, size_t zl, https://github.com/ruby/ruby/blob/trunk/bignum.c#L3962 } static void -bary_mul(BDIGIT *zds, size_t zl, BDIGIT *xds, size_t xl, BDIGIT *yds, size_t yl) +bary_mul1(BDIGIT *zds, size_t zl, BDIGIT *xds, size_t xl, BDIGIT *yds, size_t yl) { size_t l; @@ -3980,12 +3980,12 @@ bary_mul(BDIGIT *zds, size_t zl, BDIGIT https://github.com/ruby/ruby/blob/trunk/bignum.c#L3980 } static void -bary_mul2(BDIGIT *zds, size_t zl, BDIGIT *xds, size_t xl, BDIGIT *yds, size_t yl) +bary_mul(BDIGIT *zds, size_t zl, BDIGIT *xds, size_t xl, BDIGIT *yds, size_t yl) { assert(xl + yl <= zl); if ((xl < yl ? xl : yl) < KARATSUBA_MUL_DIGITS) - bary_mul(zds, zl, xds, xl, yds, yl); + bary_mul1(zds, zl, xds, xl, yds, yl); else { VALUE x, y, z; x = bignew(xl, 1); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/