The operating system causes the program to be

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ad operation. To see this, consider the assembly code for the loop, and the translation of its first iteration into operations: Assembly Instructions .L27: incl %eax movl (%edx),%edx testl %edx,%edx jne .L27 Execution Unit Operations incl %eax.0 load (%edx.0) testl %edx.1,%edx.1 jne-taken cc.1 %eax.1 %edx.1 cc.1 254 CHAPTER 5. OPTIMIZING PROGRAM PERFORMANCE %eax.0 %edx.0 1 2 3 4 5 6 7 8 9 10 11 Cycle testl jne cc.1 incl load %eax.1 incl %eax.2 incl %edx.1 %eax.3 i=0 load Iteration 1 testl jne cc.2 %edx.2 i=1 load Iteration 2 testl jne cc.3 %edx.3 i=2 Iteration 3 Figure 5.31: Scheduling of Operations for List Length Function. The latency of the load operation limits the CPE to a minimum of 3.0. 5.13. UNDERSTANDING MEMORY PERFORMANCE 255 code/opt/copy.c 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 /* Set element of array to 0 */ static void array_clear(int *src, int *dest, int n) { int i; for (i = 0; i < n; i++) dest[i] = 0; } /* Set elements of array to 0, unrolling by 8 */ static voi...
View Full Document

This note was uploaded on 09/02/2010 for the course ELECTRICAL 360 taught by Professor Schultz during the Spring '10 term at BYU.

Ask a homework question - tutors are online