Each word is read from the le and converted to lower

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: tions, involve several subtle issues. As with the load operation, in most cases the store operation can operate in a fully pipelined mode, beginning 256 CHAPTER 5. OPTIMIZING PROGRAM PERFORMANCE code/opt/copy.c 1 2 3 4 5 6 7 8 9 10 11 /* Write to static void { int cnt int val dest, read from src */ write_read(int *src, int *dest, int n) = n; = 0; while (cnt--) { *dest = val; val = (*src)+1; } } code/opt/copy.c Example A: write_read(&a[0],&a[1],3) Initial cnt a val –10 3 17 0 Iter. 1 2 –10 0 –9 Iter. 2 1 –10 –9 –9 Iter. 3 0 –10 –9 –9 Example B: write_read(&a[0],&a[0],3) Initial cnt a val –10 3 17 0 Iter. 1 2 0 17 1 Iter. 2 1 1 17 2 Iter. 3 0 2 17 3 Figure 5.33: Code to Write and Read Memory Locations, Along with Illustrative Executions. This function highlights the interactions between stores and loads when arguments src and dest are equal. a new store on every cycle. For example, consider the functions shown in Figure 5.32 that set the elements of an array...
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