Deepen parse_number_f64's powers_of_10 table

Deepen means changing the mantissa from 64 bits to 128 bits. We also
adjust the exponent bias, in anticipation of a future commit.

Binary size, before:
22232 gen/lib/c/clang-5.0-dynamic/wuffs-base-f64conv.lo
22408 gen/lib/c/clang-5.0-static/wuffs-base-f64conv.o
23816 gen/lib/c/gcc-dynamic/wuffs-base-f64conv.lo
23816 gen/lib/c/gcc-static/wuffs-base-f64conv.o

After:
27336 gen/lib/c/clang-5.0-dynamic/wuffs-base-f64conv.lo
27528 gen/lib/c/clang-5.0-static/wuffs-base-f64conv.o
28856 gen/lib/c/gcc-dynamic/wuffs-base-f64conv.lo
28856 gen/lib/c/gcc-static/wuffs-base-f64conv.o

$ g++ -O3 script/process-json-numbers.c
$ time ./a.out -parse-number-f64 < citylots.json
Before/After:
real    0m1.432s
real	0m1.421s

citylots.json is from github.com/zemirco/sf-city-lots-json
This commit is contained in:
Nigel Tao committed 2020-07-05 19:03:37 +10:00
1 parent 53da68fe4b
commit 267bfc8176
5 files changed
+1390 -1368

No files matched your search

+2 -2
View File
@@ -451,7 +451,7 @@ test_wuffs_strconv_mpb_assign_from_hpd() {
// (0xCCCCCCCCCCCCCCCE * (2 ** -67)) is roughly .1
{.str = "1",
.decimal_point = +0,
.want_mantissa = 0xCCCCCCCCCCCCCCCE,
.want_mantissa = 0xCCCCCCCCCCCCCCCC,
.want_exp2 = -67,
.want_f64 = .1},
@@ -472,7 +472,7 @@ test_wuffs_strconv_mpb_assign_from_hpd() {
// (0xC9F2C9CD04674EDE * (2 ** +36)) is roughly 1e30.
{.str = "1",
.decimal_point = +31,
.want_mantissa = 0xC9F2C9CD04674EE0,
.want_mantissa = 0xC9F2C9CD04674EDE,
.want_exp2 = +36,
.want_f64 = 1e30},