From fa8d9c7e2be2b8953d1d3f2732c34741debd133a Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 12 Mar 2016 20:41:10 +0100 Subject: 64 bits (severely) outshines 16 bits and 8 bits in performance: do some cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/internals.h | 1 - src/zsets.c | 19 ------------------- 2 files changed, 20 deletions(-) (limited to 'src') diff --git a/src/internals.h b/src/internals.h index b4e6039..25a640a 100644 --- a/src/internals.h +++ b/src/internals.h @@ -40,7 +40,6 @@ #define LIST_CONSTS\ X(libzahl_const_1e19, zsetu, 10000000000000000000ULL) /* The largest power of 10 < 2⁶⁴. */\ - X(libzahl_const_1e9, zsetu, 1000000000ULL) /* The largest power of 10 < 2³². */\ X(libzahl_const_1, zsetu, 1)\ X(libzahl_const_2, zsetu, 2)\ X(libzahl_const_4, zsetu, 4) diff --git a/src/zsets.c b/src/zsets.c index fb44db4..d4bedc0 100644 --- a/src/zsets.c +++ b/src/zsets.c @@ -26,7 +26,6 @@ zsets(z_t a, const char *str) SET_SIGNUM(a, 0); -#if 1 zset(libzahl_tmp_str_num, libzahl_const_1e19); switch ((str_end - str) % 19) { while (*str) { @@ -44,24 +43,6 @@ zsets(z_t a, const char *str) zadd(a, a, libzahl_tmp_str_num); } } -#else - zset(libzahl_tmp_str_num, libzahl_const_1); - switch ((str_end - str) % 9) { - while (*str) { - zmul(a, a, libzahl_const_1e9); - temp = 0; -#define X(n)\ - case n:\ - temp *= 10, temp += *str++ & 15; - X(0) X(8) X(7) X(6) X(5) X(4) X(3) X(2) X(1) -#undef X - if (!temp) - continue; - libzahl_tmp_str_num->chars[0] = temp; - zadd(a, a, libzahl_tmp_str_num); - } - } -#endif if (neg) SET_SIGNUM(a, -zsignum(a)); -- cgit v1.2.3-70-g09d2