]> mj.ucw.cz Git - libucw.git/blobdiff - debug/sorter/retros.c
Merge with git+ssh://git.ucw.cz/projects/sherlock/GIT/sherlock.git
[libucw.git] / debug / sorter / retros.c
index 52d4690b2e5ee772746c1b6c7313acf12c1dccca..e85dfe853934e528ce344d2157bc27748c0f53ff 100644 (file)
@@ -1,5 +1,7 @@
 /*
 /*
- *  An experiment with sorting algorithms
+ *  Experiments with various sorting algorithms
+ *
+ *  (c) 2007 Martin Mares <mj@ucw.cz>
  */
 
 #include "sherlock/sherlock.h"
  */
 
 #include "sherlock/sherlock.h"
@@ -185,8 +187,8 @@ static void r1c_sse_sort(void)
   struct elt *ptrs[256], *x, *lim;
 
   ASSERT(sizeof(struct elt) == 16);
   struct elt *ptrs[256], *x, *lim;
 
   ASSERT(sizeof(struct elt) == 16);
-  ASSERT(!((addr_int_t)alt & 15));
-  ASSERT(!((addr_int_t)ary & 15));
+  ASSERT(!((uintptr_t)alt & 15));
+  ASSERT(!((uintptr_t)ary & 15));
 
   x = ary; lim = ary + n;
   bzero(cnt, sizeof(cnt));
 
   x = ary; lim = ary + n;
   bzero(cnt, sizeof(cnt));
@@ -695,7 +697,8 @@ int main(int argc, char **argv)
     array0[i] = array1[i] = (struct elt) { 0 };
 
   mk_ary();
     array0[i] = array1[i] = (struct elt) { 0 };
 
   mk_ary();
-  init_timer();
+  timestamp_t timer;
+  init_timer(&timer);
   for (uns i=0; i<5; i++)
     {
 #if 1
   for (uns i=0; i<5; i++)
     {
 #if 1
@@ -708,9 +711,9 @@ int main(int argc, char **argv)
        ary[j] = alt[j];
 #endif
     }
        ary[j] = alt[j];
 #endif
     }
-  log(L_DEBUG, "memcpy: %d", get_timer()/10);
+  log(L_DEBUG, "memcpy: %d", get_timer(&timer)/10);
 
 
-#define BENCH(type, name, func) mk_##type(); init_timer(); func; log(L_DEBUG, name ": %d", get_timer()); chk_##type()
+#define BENCH(type, name, func) mk_##type(); init_timer(&timer); func; log(L_DEBUG, name ": %d", get_timer(&timer)); chk_##type()
 
   //BENCH(ary, "qsort", qsort(ary, n, sizeof(struct elt), comp));
   //BENCH(ary, "arraysort", as_sort(n, ary));
 
   //BENCH(ary, "qsort", qsort(ary, n, sizeof(struct elt), comp));
   //BENCH(ary, "arraysort", as_sort(n, ary));