aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--bignum.c6
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 5928f66580..a3f9fbdb1e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/bignum.c b/bignum.c
index 1f9dfb56aa..34c846a8f3 100644
--- a/bignum.c
+++ b/bignum.c
@@ -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;
}