Mercurial > mplayer.hg
comparison TOOLS/fastmemcpybench.c @ 28871:5643b5e6bee0
Make fastmemcpybench almost working - only thing missing is a way to
override HAVE_MMX etc. from config.h.
author | reimar |
---|---|
date | Mon, 09 Mar 2009 12:59:14 +0000 |
parents | 04a232eb5f0d |
children | b29169fccda9 |
comparison
equal
deleted
inserted
replaced
28870:ff88625be902 | 28871:5643b5e6bee0 |
---|---|
16 #include <unistd.h> | 16 #include <unistd.h> |
17 #include <fcntl.h> | 17 #include <fcntl.h> |
18 #include <sys/mman.h> | 18 #include <sys/mman.h> |
19 #include <sys/time.h> | 19 #include <sys/time.h> |
20 #include <inttypes.h> | 20 #include <inttypes.h> |
21 #include "libvo/fastmemcpy.h" | |
21 | 22 |
22 //#define ARR_SIZE 100000 | 23 //#define ARR_SIZE 100000 |
23 #define ARR_SIZE (1024*768*2) | 24 #define ARR_SIZE (1024*768*2) |
24 | 25 |
25 #ifdef CONFIG_MGA | 26 #ifdef CONFIG_MGA |
111 marr1[i] = marr2[i] = i; | 112 marr1[i] = marr2[i] = i; |
112 | 113 |
113 t = GetTimer(); | 114 t = GetTimer(); |
114 v1 = read_tsc(); | 115 v1 = read_tsc(); |
115 for (i = 0; i < 100; i++) | 116 for (i = 0; i < 100; i++) |
116 memcpy(marr1, marr2, ARR_SIZE - 16); | 117 fast_memcpy(marr1, marr2, ARR_SIZE - 16); |
117 v2 = read_tsc(); | 118 v2 = read_tsc(); |
118 t = GetTimer() - t; | 119 t = GetTimer() - t; |
119 // ARR_SIZE*100 / (1024*1024) / (t/1000000) = ARR_SIZE*95.36743 / t | 120 // ARR_SIZE*100 / (1024*1024) / (t/1000000) = ARR_SIZE*95.36743 / t |
120 printf(NAME ": CPU clocks=%llu = %dus (%5.3ffps) %5.1fMB/s\n", v2-v1, t, | 121 printf(NAME ": CPU clocks=%llu = %dus (%5.3ffps) %5.1fMB/s\n", v2-v1, t, |
121 100000000.0f/(float)t, (float)ARR_SIZE*95.36743f/(float)t); | 122 100000000.0f/(float)t, (float)ARR_SIZE*95.36743f/(float)t); |