prim 678 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #! /bin/awk -f
  2. BEGIN {
  3. purpose = "report times for microbenchmarks"
  4. nmach = 0;
  5. test_callind = "18";
  6. test_callimm = "18";
  7. test_addreg = "20";
  8. test_loadreg = "21";
  9. }
  10. {
  11. mach = $1
  12. test = $2
  13. iter = $3
  14. time = $6 + $8
  15. if (machi[mach] == 0) {
  16. machn[nmach] = mach;
  17. machi[mach] = 1;
  18. ++nmach;
  19. }
  20. ns_per_op = time / iter * 1000000
  21. times[mach "_" test] = ns_per_op;
  22. }
  23. END {
  24. for (i=0; i<nmach; ++i) {
  25. m = machn[i];
  26. ind = times[m "_" test_callind];
  27. imm = times[m "_" test_callimm];
  28. add = times[m "_" test_addreg];
  29. load = times[m "_" test_loadreg];
  30. printf ("%s|%1.3f|%1.3f|%1.3f|%1.3f\n", m, ind, imm, add, load);
  31. }
  32. }