From: David Schleef Date: Tue, 6 Jul 2010 19:32:20 +0000 (-0700) Subject: memcpy_speed: take unalignment parameter on cmd line X-Git-Tag: orc-0.4.6~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1eb416c3b7e79ccf54d184dfdfcabc3299bbf049;p=platform%2Fupstream%2Forc.git memcpy_speed: take unalignment parameter on cmd line --- diff --git a/testsuite/memcpy_speed.c b/testsuite/memcpy_speed.c index a840a91..da673d1 100644 --- a/testsuite/memcpy_speed.c +++ b/testsuite/memcpy_speed.c @@ -25,6 +25,7 @@ main(int argc, char *argv[]) double null; int i,j; double cpufreq; + int unalign; //const uint8_t zero = 0; orc_init (); @@ -32,9 +33,15 @@ main(int argc, char *argv[]) //cpufreq = 2333e6; cpufreq = 1; + if (argc > 1) { + unalign = strtoul (argv[1], NULL, 0); + } else { + unalign = 0; + } + s = malloc(1024*1024*64+1024); d = malloc(1024*1024*64+1024); - src = ORC_PTR_OFFSET(ALIGN(s,128),0); + src = ORC_PTR_OFFSET(ALIGN(s,128),unalign); dest = ALIGN(d,128); orc_profile_init (&prof); @@ -43,11 +50,12 @@ main(int argc, char *argv[]) orc_profile_stop(&prof); } orc_profile_get_ave_std (&prof, &null, &std); - - for(i=0;i<200;i++){ + + for(i=0;i<160;i++){ double x = i*0.1 + 6.0; int size = pow(2.0, x); + orc_profile_init (&prof); for(j=0;j<10;j++){ orc_profile_start(&prof); @@ -65,14 +73,14 @@ main(int argc, char *argv[]) orc_profile_get_ave_std (&prof, &ave, &std); orc_profile_get_ave_std (&prof_libc, &ave_libc, &std_libc); - ave -= null + 60; - ave_libc -= null + 35; + ave -= null + 65 + 20; + ave_libc -= null + 40; //printf("%d: %10.4g %10.4g %10.4g %10.4g (libc %10.4g)\n", i, ave, std, // ave/(1<