Skip to content

Commit c3e2ec1

Browse files
committed
Cleaning.
1 parent bad32be commit c3e2ec1

1 file changed

Lines changed: 17 additions & 18 deletions

File tree

‎benchmark/parse.cpp‎

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,11 @@ int main(int argc, char *argv[]) {
116116
LinuxEvents<PERF_TYPE_HARDWARE> unified(evts);
117117
vector<unsigned long long> results;
118118
results.resize(evts.size());
119-
unsigned long cy0 = 0, cy1 = 0, cy2 = 0, cy3 = 0;
120-
unsigned long cl0 = 0, cl1 = 0, cl2 = 0, cl3 = 0;
121-
unsigned long mis0 = 0, mis1 = 0, mis2 = 0, mis3 = 0;
122-
unsigned long cref0 = 0, cref1 = 0, cref2 = 0, cref3 = 0;
123-
unsigned long cmis0 = 0, cmis1 = 0, cmis2 = 0, cmis3 = 0;
119+
unsigned long cy0 = 0, cy1 = 0, cy2 = 0;
120+
unsigned long cl0 = 0, cl1 = 0, cl2 = 0;
121+
unsigned long mis0 = 0, mis1 = 0, mis2 = 0;
122+
unsigned long cref0 = 0, cref1 = 0, cref2 = 0;
123+
unsigned long cmis0 = 0, cmis1 = 0, cmis2 = 0;
124124
#endif
125125
bool isok = true;
126126

@@ -169,11 +169,11 @@ int main(int argc, char *argv[]) {
169169
isok = isok && unified_machine(p.data(), p.size(), pj);
170170
#ifndef SQUASH_COUNTERS
171171
unified.end(results);
172-
cy3 += results[0];
173-
cl3 += results[1];
174-
mis3 += results[2];
175-
cref3 += results[3];
176-
cmis3 += results[4];
172+
cy2 += results[0];
173+
cl2 += results[1];
174+
mis2 += results[2];
175+
cref2 += results[3];
176+
cmis2 += results[4];
177177
if (!isok) {
178178
cout << "Failed out during stage 34\n";
179179
break;
@@ -190,12 +190,11 @@ int main(int argc, char *argv[]) {
190190
return EXIT_FAILURE;
191191
}
192192
#ifndef SQUASH_COUNTERS
193-
unsigned long total = cy0 + cy1 + cy2 + cy3;
193+
unsigned long total = cy0 + cy1 + cy2;
194194
if (justdata) {
195195
float cpb0 = (double)cy0 / (iterations * p.size());
196196
float cpb1 = (double)cy1 / (iterations * p.size());
197197
float cpb2 = (double)cy2 / (iterations * p.size());
198-
float cpb3 = (double)cy3 / (iterations * p.size());
199198
float cpbtotal = (double)total / (iterations * p.size());
200199
char *newfile = (char *)malloc(strlen(filename) + 1);
201200
if (newfile == NULL)
@@ -209,7 +208,7 @@ int main(int argc, char *argv[]) {
209208
break;
210209
}
211210
}
212-
printf("\"%s\"\t%f\t%f\t%f\t%f\t%f\n", snewfile, cpb0, cpb1, cpb2, cpb3,
211+
printf("\"%s\"\t%f\t%f\t%f\t%f\n", snewfile, cpb0, cpb1, cpb2,
213212
cpbtotal);
214213
free(newfile);
215214
} else {
@@ -236,13 +235,13 @@ int main(int argc, char *argv[]) {
236235
printf("stage 2 instructions: %10lu cycles: %10lu (%.2f %%) ins/cycles: "
237236
"%.2f mis. branches: %10lu (cycles/mis.branch %.2f) cache "
238237
"accesses: %10lu (failure %10lu)\n",
239-
cl3 / iterations, cy3 / iterations, 100. * cy3 / total,
240-
(double)cl3 / cy3, mis3 / iterations, (double)cy3 / mis3,
241-
cref3 / iterations, cmis3 / iterations);
238+
cl2 / iterations, cy2 / iterations, 100. * cy2 / total,
239+
(double)cl2 / cy2, mis2 / iterations, (double)cy2 / mis2,
240+
cref2 / iterations, cmis2 / iterations);
242241
printf(" stage 2 runs at %.2f cycles per input byte and ",
243-
(double)cy3 / (iterations * p.size()));
242+
(double)cy2 / (iterations * p.size()));
244243
printf("%.2f cycles per structural character.\n",
245-
(double)cy3 / (iterations * pj.n_structural_indexes));
244+
(double)cy2 / (iterations * pj.n_structural_indexes));
246245

247246
printf(" all stages: %.2f cycles per input byte.\n",
248247
(double)total / (iterations * p.size()));

0 commit comments

Comments
 (0)