
Computer Systems: A Programmer's Perspective (3rd Edition)
3rd Edition
ISBN: 9780134092669
Author: Bryant, Randal E. Bryant, David R. O'Hallaron, David R., Randal E.; O'Hallaron, Bryant/O'hallaron
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Chapter 5.8, Problem 5.7PP
Program Plan Intro
Given C code:
void combine5(vec_ptr v, data_t *dest)
{
long i;
long length = vec_length(v);
long limit = length – 1;
data_t *data = get_vec_start(v);
data_t acc = IDENT;
for(i=0; i<limit ; i+=2)
{
acc = (acc OP data[i]) OP data[i+1];
}
for(; i<length ; i++)
{
acc = acc OP data[i];
}
*dest = acc;
}
Memory aliasing:
- It denotes a case where two pointers might designate to memory location that is same.
- The compiler should assume that unlike pointers might be aliased for safe optimizations.
- The program aspects that could limit chances for a compiler in generating optimized code denote optimization blockers.
- If a compiler is unable to determine whether two pointers might be aliased, it should adopt that either case would be possible.
- The possible optimization set is been limited in this case.
Loop unrolling:
- It denotes a program transformation that would reduce count of iterations for a loop.
- It increases count of elements computed in each iteration.
- It reduces number of operations that is not dependent to program directly.
- It reduces count of operations in critical paths of overall computations.
Expert Solution & Answer

Want to see the full answer?
Check out a sample textbook solution
Students have asked these similar questions
Design and draw a high-level "as-is" process diagram that illustrates a current process related to a product or service offered through the SSDCI.gov database.
Compare last-mile connections for connecting homes and businesses to the Internet
Explain wireless networking standards
Chapter 5 Solutions
Computer Systems: A Programmer's Perspective (3rd Edition)
Knowledge Booster
Similar questions
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning

C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr

C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning