commit fa8d9c7e2be2b8953d1d3f2732c34741debd133a
Author: Mattias Andrée <maandree_AT_kth.se>
AuthorDate: Sat Mar 12 20:41:10 2016 +0100
Commit: Mattias Andrée <maandree_AT_kth.se>
CommitDate: Sat Mar 12 20:41:22 2016 +0100
64 bits (severely) outshines 16 bits and 8 bits in performance: do some cleanup
Signed-off-by: Mattias Andrée <maandree_AT_kth.se>
diff --git a/src/internals.h b/src/internals.h
index b4e6039..25a640a 100644
--- a/src/internals.h
+++ b/src/internals.h
_AT_@ -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
_AT_@ -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) {
_AT_@ -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));
Received on Sat Mar 12 2016 - 20:41:49 CET
This archive was generated by hypermail 2.3.0
: Sat Mar 12 2016 - 20:48:16 CET