Add a new performance benchmark: tinycc.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5394
This commit is contained in:
Nicholas Nethercote 2005-12-20 23:02:43 +00:00
parent cd0478d807
commit 20ff27ca6a
6 changed files with 21909 additions and 4 deletions

View File

@ -1,22 +1,27 @@
noinst_SCRIPTS = vg_perf
noinst_HEADERS = stdarg.h stddef.h
EXTRA_DIST = $(noinst_SCRIPTS) \
bigcode.vgperf \
bz2.vgperf \
fbench.vgperf \
ffbench.vgperf \
heap.vgperf \
sarp.vgperf
sarp.vgperf \
tinycc.vgperf
check_PROGRAMS = \
bigcode bz2 fbench ffbench heap sarp
bigcode bz2 fbench ffbench heap sarp tinycc
AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -g -O
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/include -I$(top_builddir)/include
AM_CXXFLAGS = $(AM_CFLAGS)
# Extra stuff
fbench_LDADD = -lm
ffbench_LDADD = -lm
fbench_LDADD = -lm
ffbench_LDADD = -lm
tinycc_CFLAGS =
tinycc_LDADD = -ldl

View File

@ -53,4 +53,11 @@ ffbench:
- Weaknesses: Dominated by the inner loop, which is quite long and flatters
Valgrind due to the small dispatcher overhead.
tinycc:
- Description: A very small and fast C compiler. A munged version of
Fabrice Bellard's TinyCC compiling itself multiple times.
- Strengths: A real program, lots of code (top 100 blocks only account for
47% of execution), involves large irregular data structures
(presumably, since it's a compiler).
- Weaknesses None, really, it's a good benchmark.

17
perf/stdarg.h Normal file
View File

@ -0,0 +1,17 @@
// njn: used by tinycc
#ifndef _STDARG_H
#define _STDARG_H
typedef char *va_list;
/* only correct for i386 */
#define va_start(ap,last) ap = ((char *)&(last)) + ((sizeof(last)+3)&~3)
#define va_arg(ap,type) (ap += (sizeof(type)+3)&~3, *(type *)(ap - ((sizeof(type)+3)&~3)))
#define va_end(ap)
/* fix a buggy dependency on GCC in libio.h */
typedef va_list __gnuc_va_list;
#define _VA_LIST_DEFINED
#endif

23
perf/stddef.h Normal file
View File

@ -0,0 +1,23 @@
// njn: used by tinycc
#ifndef _STDDEF_H
#define _STDDEF_H
#define NULL ((void *)0)
typedef __SIZE_TYPE__ size_t;
typedef __WCHAR_TYPE__ wchar_t;
typedef __PTRDIFF_TYPE__ ptrdiff_t;
#define offsetof(type, field) ((size_t) &((type *)0)->field)
/* need to do that because of glibc 2.1 bug (should have a way to test
presence of 'long long' without __GNUC__, or TCC should define
__GNUC__ ? */
#if !defined(__int8_t_defined) && !defined(__dietlibc__)
#define __int8_t_defined
typedef char int8_t;
typedef short int int16_t;
typedef int int32_t;
typedef long long int int64_t;
#endif
#endif

21850
perf/tinycc.c Normal file

File diff suppressed because it is too large Load Diff

3
perf/tinycc.vgperf Normal file
View File

@ -0,0 +1,3 @@
prog: tinycc
args: tinycc.c -I. -ldl
tools: none memcheck