[x264-devel] commit: checkasm --bench=function_name (Loren Merritt )
git version control
git at videolan.org
Wed Jun 18 15:47:20 CEST 2008
x264 | branch: master | Loren Merritt <pengvado at akuvian.org> | Thu Jun 12 08:43:41 2008 -0600| [cb29306fabf20ae4935906f18ed7869afcf837c3]
checkasm --bench=function_name
> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=cb29306fabf20ae4935906f18ed7869afcf837c3
---
tools/checkasm.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/tools/checkasm.c b/tools/checkasm.c
index b9e3205..3a8f30b 100644
--- a/tools/checkasm.c
+++ b/tools/checkasm.c
@@ -37,6 +37,8 @@ typedef struct {
} bench_func_t;
int do_bench = 0;
+int bench_pattern_len = 0;
+const char *bench_pattern = "";
char func_name[100];
static bench_func_t benchs[MAX_FUNCS];
@@ -151,7 +153,7 @@ long x264_checkasm_call( long (*func)(), int *ok, ... );
#endif
#define call_bench(func,cpu,...)\
- if(do_bench)\
+ if( do_bench && !strncmp(func_name, bench_pattern, bench_pattern_len) )\
{\
uint32_t tsum = 0;\
int tcount = 0;\
@@ -1166,13 +1168,18 @@ int main(int argc, char *argv[])
int ret = 0;
int i;
- if( argc > 1 && !strcmp( argv[1], "--bench" ) )
+ if( argc > 1 && !strncmp( argv[1], "--bench", 7 ) )
{
#if !defined(ARCH_X86) && !defined(ARCH_X86_64)
fprintf( stderr, "no --bench for your cpu until you port rdtsc\n" );
return 1;
#endif
do_bench = 1;
+ if( argv[1][7] == '=' )
+ {
+ bench_pattern = argv[1]+8;
+ bench_pattern_len = strlen(bench_pattern);
+ }
argc--;
argv++;
}
More information about the x264-devel
mailing list