diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | bignum.c | 6 |
2 files changed, 8 insertions, 2 deletions
@@ -1,3 +1,7 @@ +Mon Mar 14 19:05:39 2016 NARUSE, Yui <naruse@ruby-lang.org> + + * bignum.c (big2str_2bdigits): reduce div instruction. + Mon Mar 14 18:39:53 2016 Martin Duerst <duerst@it.aoyama.ac.jp> * include/ruby/oniguruma.h, enc/unicode.c: Adjusting flag assignments @@ -4615,8 +4615,9 @@ big2str_2bdigits(struct big2str_struct *b2s, BDIGIT *xds, size_t xn, size_t tail p = buf; j = sizeof(buf); do { - p[--j] = ruby_digitmap[num % b2s->base]; + BDIGIT_DBL idx = num % b2s->base; num /= b2s->base; + p[--j] = ruby_digitmap[idx]; } while (num); len = sizeof(buf) - j; big2str_alloc(b2s, len + taillen); @@ -4626,8 +4627,9 @@ big2str_2bdigits(struct big2str_struct *b2s, BDIGIT *xds, size_t xn, size_t tail p = b2s->ptr; j = b2s->hbase2_numdigits; do { - p[--j] = ruby_digitmap[num % b2s->base]; + BDIGIT_DBL idx = num % b2s->base; num /= b2s->base; + p[--j] = ruby_digitmap[idx]; } while (j); len = b2s->hbase2_numdigits; } |