# HG changeset patch # User kabi # Date 1022160862 0 # Node ID b2fb2081dab562997914b14577c111cc79d8e33c # Parent 040d86058c4aa0afa70ed58517d924cbd8b9209c * somewhat more advanced test suit for dsp code - for now i386 only cd test ; make dsptest ; ./dsptest diff -r 040d86058c4a -r b2fb2081dab5 i386/dsputil_mmx.c --- a/i386/dsputil_mmx.c Thu May 23 12:17:08 2002 +0000 +++ b/i386/dsputil_mmx.c Thu May 23 13:34:22 2002 +0000 @@ -1082,45 +1082,4 @@ } } -#else // TESTCPU_MAIN -/* - * for testing speed of various routine - should be probably extended - * for a general purpose regression test later - * - * for now use it this way: - * - * gcc -O4 -fomit-frame-pointer -DHAVE_AV_CONFIG_H -DTESTCPU_MAIN -I../.. -o test dsputil_mmx.c - * - * in libavcodec/i386 directory - then run ./test - */ -static inline long long rdtsc() -{ - long long l; - asm volatile( "rdtsc\n\t" - : "=A" (l) - ); - return l; -} - -int main(int argc, char* argv[]) -{ - volatile int v; - int i; - const int linesize = 720; - char empty[32768]; - uint64_t te, ts = rdtsc(); - char* im, *bu = empty; - op_pixels_func fc = put_pixels_y2_mmx2; - bu += 32; - bu =(char*)(((long)bu) & ~0xf); // 16 bytes alignment - im = bu; - for(i=0; i<1000000; i++){ - fc(im, im + 1000, linesize, 16); - im += 4; // - if (im > bu + 10000) - im = bu; - } - te = rdtsc(); - printf("CPU Ticks: %7d\n", (int)(te - ts)); -} #endif