[PATCH] benchtests: Fix RESULT_ACCUM macro
Ashwin Sekhar T K
ashwin.sekhar@caviumnetworks.com
Thu Jul 6 09:57:00 GMT 2017
The new and old counts are correctly given to the RESULT_ACCUM macro as
input. There is no need to add one to the new count inside the macro.
ChangeLog:
2017-07-06 Ashwin Sekhar T K <ashwin.sekhar@caviumnetworks.com>
* scripts/bench.py (RESULT_ACCUM): Fix macro.
---
benchtests/scripts/bench.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/benchtests/scripts/bench.py b/benchtests/scripts/bench.py
index 8c1c9eeb2b..20d8682074 100755
--- a/benchtests/scripts/bench.py
+++ b/benchtests/scripts/bench.py
@@ -83,7 +83,7 @@ struct _variants variants[%(num_variants)d] = {
EPILOGUE = '''
#define RESULT(__v, __i) (variants[(__v)].in[(__i)].timing)
#define RESULT_ACCUM(r, v, i, old, new) \\
- ((RESULT ((v), (i))) = (RESULT ((v), (i)) * (old) + (r)) / ((new) + 1))
+ ((RESULT ((v), (i))) = (RESULT ((v), (i)) * (old) + (r)) / (new))
#define BENCH_FUNC(i, j) ({%(getret)s CALL_BENCH_FUNC (i, j);})
#define FUNCNAME "%(func)s"
#include "bench-skeleton.c"'''
--
2.12.2
More information about the Libc-alpha
mailing list