clean up memcpy_speed
authorDavid Schleef <ds@schleef.org>
Sun, 13 Jun 2010 19:26:32 +0000 (12:26 -0700)
committerDavid Schleef <ds@schleef.org>
Sun, 13 Jun 2010 19:26:32 +0000 (12:26 -0700)
testsuite/memcpy_speed.c

index 89b8d54..a840a91 100644 (file)
@@ -4,6 +4,8 @@
 #include <string.h>
 #include <math.h>
 
+#define ORC_ENABLE_UNSTABLE_API
+
 #include <orc/orc.h>
 #include <orc-test/orctest.h>
 #include <orc-test/orcprofile.h>
@@ -32,7 +34,7 @@ main(int argc, char *argv[])
 
   s = malloc(1024*1024*64+1024);
   d = malloc(1024*1024*64+1024);
-  src = ALIGN(s,128);
+  src = ORC_PTR_OFFSET(ALIGN(s,128),0);
   dest = ALIGN(d,128);
 
   orc_profile_init (&prof);
@@ -42,35 +44,6 @@ main(int argc, char *argv[])
   }
   orc_profile_get_ave_std (&prof, &null, &std);
 
-#if 0
- // printf("orc_memset:\n");
-  for(i=10;i<26;i++){
-    orc_profile_init (&prof);
-    orc_profile_init (&prof_libc);
-    for(j=0;j<10;j++){
-      orc_profile_start(&prof);
-      orc_memset (dest, 0, 1<<i);
-      orc_profile_stop(&prof);
-      orc_profile_start(&prof_libc);
-      memset (dest, 0, 1<<i);
-      orc_profile_stop(&prof_libc);
-    }
-
-    orc_profile_get_ave_std (&prof, &ave, &std);
-    orc_profile_get_ave_std (&prof_libc, &ave_libc, &std_libc);
-
-#if 0
-    printf("%d: %10.4g %10.4g %10.4g %10.4g (libc %10.4g)\n", i, ave, std,
-        ave/(1<<i), cpufreq/(ave/(1<<i)),
-        cpufreq/(ave_libc/(1<<i)));
-    printf("%d %10.4g %10.4g %10.4g\n", i,
-        cpufreq/(ave/(1<<i)), cpufreq/(ave_libc/(1<<i)));
-#endif
-  }
-#endif
-
-  //printf("orc_memcpy:\n");
-  //for(i=10;i<26;i++){
   for(i=0;i<200;i++){
     double x = i*0.1 + 6.0;
     int size = pow(2.0, x);