- "======= ============== ============== ============== ==============\n"
- " Size Cache to cache Cache to mem Mem to cache Mem to mem\n"
- "(bytes) (ticks) (ticks) (ticks) (ticks)\n"
- "------- -------------- -------------- -------------- --------------");
-
- /* Do tests where size is a variable */
- for (i = 0; i < num_buf_sizes; i++) {
- ALL_PERF_TESTS_FOR_SIZE((size_t)buf_sizes[i]);
- }
- printf("\n------- -------------- -------------- -------------- --------------");
- /* Do tests where size is a compile-time constant */
- ALL_PERF_TESTS_FOR_SIZE(63U);
- ALL_PERF_TESTS_FOR_SIZE(64U);
- ALL_PERF_TESTS_FOR_SIZE(65U);
- ALL_PERF_TESTS_FOR_SIZE(255U);
- ALL_PERF_TESTS_FOR_SIZE(256U);
- ALL_PERF_TESTS_FOR_SIZE(257U);
- ALL_PERF_TESTS_FOR_SIZE(1023U);
- ALL_PERF_TESTS_FOR_SIZE(1024U);
- ALL_PERF_TESTS_FOR_SIZE(1025U);
- ALL_PERF_TESTS_FOR_SIZE(1518U);
-
- printf("\n======= ============== ============== ============== ==============\n\n");
-
+ "======= ================= ================= ================= =================\n"
+ " Size Cache to cache Cache to mem Mem to cache Mem to mem\n"
+ "(bytes) (ticks) (ticks) (ticks) (ticks)\n"
+ "------- ----------------- ----------------- ----------------- -----------------");
+
+ printf("\n================================= %2dB aligned =================================",
+ ALIGNMENT_UNIT);
+ /* Do aligned tests where size is a variable */
+ gettimeofday(&tv_begin, NULL);
+ perf_test_variable_aligned();
+ gettimeofday(&tv_end, NULL);
+ time_aligned = (double)(tv_end.tv_sec - tv_begin.tv_sec)
+ + ((double)tv_end.tv_usec - tv_begin.tv_usec)/1000000;
+ printf("\n------- ----------------- ----------------- ----------------- -----------------");
+ /* Do aligned tests where size is a compile-time constant */
+ gettimeofday(&tv_begin, NULL);
+ perf_test_constant_aligned();
+ gettimeofday(&tv_end, NULL);
+ time_aligned_const = (double)(tv_end.tv_sec - tv_begin.tv_sec)
+ + ((double)tv_end.tv_usec - tv_begin.tv_usec)/1000000;
+ printf("\n================================== Unaligned ==================================");
+ /* Do unaligned tests where size is a variable */
+ gettimeofday(&tv_begin, NULL);
+ perf_test_variable_unaligned();
+ gettimeofday(&tv_end, NULL);
+ time_unaligned = (double)(tv_end.tv_sec - tv_begin.tv_sec)
+ + ((double)tv_end.tv_usec - tv_begin.tv_usec)/1000000;
+ printf("\n------- ----------------- ----------------- ----------------- -----------------");
+ /* Do unaligned tests where size is a compile-time constant */
+ gettimeofday(&tv_begin, NULL);
+ perf_test_constant_unaligned();
+ gettimeofday(&tv_end, NULL);
+ time_unaligned_const = (double)(tv_end.tv_sec - tv_begin.tv_sec)
+ + ((double)tv_end.tv_usec - tv_begin.tv_usec)/1000000;
+ printf("\n======= ================= ================= ================= =================\n\n");
+
+ printf("Test Execution Time (seconds):\n");
+ printf("Aligned variable copy size = %8.3f\n", time_aligned);
+ printf("Aligned constant copy size = %8.3f\n", time_aligned_const);
+ printf("Unaligned variable copy size = %8.3f\n", time_unaligned);
+ printf("Unaligned constant copy size = %8.3f\n", time_unaligned_const);