summaryrefslogtreecommitdiff
path: root/bignum.c
AgeCommit message (Collapse)Author
2013-09-01* bignum.c: Remove BITSPERDIG >= INT_MAX test. The static assertion,akr
SIZEOF_BDIGITS <= sizeof(BDIGIT) is enough. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-01* bignum.c (maxpow_in_bdigit): Removed.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-01* numeric.c (rb_fix_bit_length): Moved from bignum.c.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42752 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-01[DOC]akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-01* internal.h (bit_length): Moved from bignum.c.akr
(nlz_int): Ditto. (nlz_long): Ditto. (nlz_long_long): Ditto. (nlz_int128): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-31* bignum.c (bit_length): Renamed from bitsize.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-31* bignum.c (rb_big_bit_length): New method.akr
(rb_fix_bit_length): Ditto. [ruby-core:56247] [Feature #8700] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-31* bignum.c: Use GMP to accelerate big Bignum multiplication.akr
(bary_mul_gmp): New function. (bary_mul): Use bary_mul_gmp. (bigsq): Use different threshold with GMP. * configure.in: Detect GMP. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-24* bignum.c (BARY_SHORT_MUL): Renamed from BARY_MUL1.akr
(bary_short_mul): Renamed from bary_mul1. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-18* bignum.c (rb_big2str1): Make an expression more explicit.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-17* bignum.c (rb_big2str1): Use power_level instead of bitsize(xn).akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42602 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-17* bignum.c (BIGDIVREM_EXTRA_WORDS): Redefine to 1.akr
(bigdivrem_num_extra_words): Removed. (bigdivrem_normal): Simplefied. (big2str_karatsuba): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-16* bignum.c (bigdivrem_single1): Renamed from bigdivrem_single. Addakr
x_higher_bdigit argument. (bigdivrem_single): Just call bigdivrem_single1. (bigdivrem_restoring): Use bigdivrem_single1 to avoid memmove. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-16* bignum.c (bary_small_rshift): Specify the higher BDIGIT instead ofakr
sign bit. (big_shift3): Follow the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42575 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-15* bignum.c (bary_mul_toom3): Reduce a branch.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42574 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-15* bignum.c (bigdivrem_single): Use shift when y is a power of two.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-15* bignum.c (bigdivrem_restoring): Use bigdivrem_single if non-topmostakr
BDIGITs of y are zero. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-15* bignum.c (rb_big2str1): Truncate topmost zeros of x.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-15* bignum.c (bary_divmod): Simplify an expression.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-15* bignum.c (bigdivrem_normal): Remove a local variable.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42567 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-15* bignum.c (big2str_karatsuba): Use bigdivrem_restoring directly toakr
reduce working buffer and memory copy. (rb_big2str1): Allocate working buffer for big2str_karatsuba here. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42566 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-13* bignum.c (bigdivrem_restoring): xn argument removed.akr
(bigdivrem_normal): Follow the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-13* bignum.c (big_div_struct): Remove xn and j field. Add zn field. akr
(bigdivrem1): Follow the above change. (bigdivrem_restoring): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42545 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-13* bignum.c (big_div_struct): ynzero field removed.akr
(bigdivrem1): Follow the above change. (bigdivrem_restoring): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-13* bignum.c (bigdivrem_restoring): Extracted from bigdivrem_normal.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-10* bignum.c (bitsize): Fix a conditional expression.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-09* bignum.c (big_div_struct): Use size_t.akr
(bigdivrem1): Ditto. (bigdivrem_num_extra_words): Ditto. (bigdivrem_single): Ditto. (bigdivrem_normal): Ditto. (bary_divmod): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-09bignum.c: suppress warningnobu
* bignum.c (rb_big_mul_karatsuba): suppress logical-op-parentheses warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42470 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-07* bignum.c (rb_big_odd_p): Check the bignum length.akr
(rb_big_even_p): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-07* bignum.c (dbl2big): A condition simplified.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-06* bignum.c (nlz16): Removed.akr
(nlz32): Ditto. (nlz64): Ditto. (nlz128): Ditto. (nlz_int): New function. (nlz_long): New function. (nlz_long_long): New function. (nlz_int128): New function. (nlz): Follow above changes. (bitsize): Follow above changes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-06* bignum.c (rb_big_realloc): Use VALGRIND_MAKE_MEM_UNDEFINED toakr
declare undefined memory area. (bignew_1): Ditto. * internal.h (VALGRIND_MAKE_MEM_DEFINED): Moved from gc.c (VALGRIND_MAKE_MEM_UNDEFINED): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-05* bignum.c: Rename local variables.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-03* bignum.c (BARY_TRUNC): New macro.akr
(bary_cmp): Use BARY_TRUNC. (bary_mul_toom3): Ditto. (bary_divmod): Ditto. (abs2twocomp): Ditto. (bigfixize): Ditto. (rb_cstr_to_inum): Ditto. (big2str_karatsuba): Ditto. (bigdivrem): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-03* bignum.c (big2str_karatsuba): Don't allocate new temporary bufferakr
if the buffer is enough for current invocation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-03bignum.c: suppress warningsnobu
* bignum.c (power_cache_get_power): declare as inline before call to suppress warnings from gcc 4.2. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-03* bignum.c (bary2bdigitdbl): New function.akr
(bdigitdbl2bary): Ditto. (bary_mul_single): Use bdigitdbl2bary. (power_cache_get_power): Ditto. (bary_divmod): Use bary2bdigitdbl. (big2str_orig): Ditto. (bigdivrem): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-03* bignum.c: The branch condition of selecting multiplicationakr
algorighms should check smaller argument because Karatsuba and Toom3 is effective only if both arguments are big. (bary_mul_toom3_branch): Compare the smaller argument to TOOM3_MUL_DIGITS. (bary_mul): Compare the smaller argument to KARATSUBA_MUL_DIGITS. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-03* bignum.c (big2str_orig): Receive the number to stringize asakr
BDIGIT array and size. (big2str_karatsuba): Receive the number to stringize as BDIGIT array and size. Use an temporary array of BDIGIT. (rb_big2str1): Follow the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-03* bignum.c (MAX_BASE36_POWER_TABLE_ENTRIES): Renamed fromakr
MAX_BIG2STR_TABLE_ENTRIES. (base36_power_cache): Renamed from big2str_power_cache. (base36_numdigits_cache): Renamed from big2str_numdigits_cache. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-02* bignum.c (big2str_orig): Refactored.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42344 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-02* bignum.c (big2str_orig): Rename a local variable.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42343 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-02* bignum.c (bigadd_core): Removed.akr
(bigadd): Use bary_add instead of bigadd_core. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-02* bignum.c (rb_big2str1): Simplify power_level calculation.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-02* bignum.c (power_cache_get_power): Appry bigtrunc to the result ofakr
bigsq. (big2str_karatsuba): Fix number of leading zero characters. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-02bignum.c: suppress a warningnobu
* bignum.c (rb_cstr_to_inum): remove set but unused variable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-02* bignum.c (big2str_karatsuba): Reduce power_level more than one atakr
recursion, if possible. (rb_big2str1): Follow the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42325 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-02* bignum.c (bary_mul): Swap x and y for bary_mul1 if x is longer than y.akr
[ruby-dev:47565] [Bug #8719] Reported by Narihiro Nakamura. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42324 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-01* bignum.c (big2str_orig): Remove len argument.akr
(big2str_karatsuba): Ditto. (rb_big2str1): Follow above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-01* bignum.c (rb_big2str1): Remove a local variable.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42310 b2dd03c8-39d4-4d8f-98ff-823fe69b080e