dtoa-benchmark
dtoa-benchmark copied to clipboard
Fix errors and most warnings when compiling with gcc 5.3.1, add results for corei7-6700K
These are the changes I made to get a clean build using gcc 5.3.1 on Fedora 23. There are a couple of warnings regarding members of a union being possibly uninitialized that I didn't fix because I don't understand the code:
../../src/gay/dtoa.c:3392:8: warning: ‘rv0.L[1]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
if (word0(&rv0) == Big0 && word1(&rv0) == Big1)
^
../../src/gay/dtoa.c:2503:20: note: ‘rv0.L[1]’ was declared here
U aadj2, adj, rv, rv0;
^
../../src/gay/dtoa.c: In function ‘dtoa’:
../../src/gay/dtoa.c:3988:28: warning: ‘j1’ may be used uninitialized in this function [-Wmaybe-uninitialized]
dval(&eps1) *= tens[j1 & 0xf];
^
it'd be good to merge this PR as otherwise the benchmark doesn't compile with GCC5 and GCC6 and supposedly newer GCC versions
$ make config=release64 verbose=1
==== Building dtoa (release64) ====
emyg_dtoa.c
cc -MMD -MP -D__STDC_FORMAT_MACROS=1 -DNDEBUG -Wall -O2 -m64 -msse4.2 -Wall -Wextra -o "../../intermediate/release/gmake/dtoa/x64/emyg_dtoa.o" -c "../../src/emyg/emyg_dtoa.c"
../../src/emyg/emyg_dtoa.c:54:36: error: initializer element is not constant
static const int kDpExponentBias = 0x3FF + kDpSignificandSize;
^
../../src/emyg/emyg_dtoa.c:55:35: error: initializer element is not constant
static const int kDpMinExponent = -kDpExponentBias;
^
../../src/emyg/emyg_dtoa.c: In function ‘DiyFp_multiply’:
../../src/emyg/emyg_dtoa.c:104:20: error: expected ‘)’ before numeric constant
if (l & (uint64_t(1) << 63)) // rounding
^
../../src/emyg/emyg_dtoa.c:104:23: error: expected ‘)’ before ‘<<’ token
if (l & (uint64_t(1) << 63)) // rounding
^
../../src/emyg/emyg_dtoa.c:106:29: error: ‘e’ undeclared (first use in this function)
return DiyFp_from_parts(h, e + rhs.e + 64);
Merged into https://github.com/leo-yuriev/dtoa-benchmark