Advertisement
Guest User

Untitled

a guest
Apr 12th, 2014
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 0.98 KB | None | 0 0
  1. +typedef uint8_t v32 __attribute__ ((__vector_size__ (32)));
  2. +void * cpy128(void * to, void * from) {
  3. +  v32 * vto = to, * vfrom = from;
  4. +  *vto++ = *vfrom++;
  5. +  *vto++ = *vfrom++;
  6. +  *vto++ = *vfrom++;
  7. +  *vto++ = *vfrom++;
  8. +  return to;
  9. +}
  10. +
  11.  static void
  12.  runtest(struct part *p, struct test *t)
  13.  {
  14. @@ -232,9 +230,13 @@ runtest(struct part *p, struct test *t)
  15.         for (k = 0; k < passes; k++) {
  16.                 fprintf(stderr, ".");
  17.  
  18. +               uint64_t i = rounds, len = strlen(t->string) + 1;
  19. +               char buff[len + 4096];
  20. +               char string[len + 4096]; memcpy(string, t->string, len);
  21.                 gettimeofday(&begin, NULL);
  22. -               for (i = 0; i < rounds; i++)
  23. -                       go(p, t->string, t->needle);
  24. +               do {
  25. +                 p->f(cpy128(buff, string), t->needle);
  26. +               } while(--i);
  27.                 gettimeofday(&end, NULL);
  28.  
  29.                 time = (end.tv_sec - begin.tv_sec) * 1000.0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement