Computer Systems: A Programmer's Perspective Plus Mastering Engineering With Pearson Etext -- Access Card Package (3rd Edition)
Computer Systems: A Programmer's Perspective Plus Mastering Engineering With Pearson Etext -- Access Card Package (3rd Edition)
3rd Edition
ISBN: 9780134123837
Author: Randal E. Bryant, David R. O'Hallaron
Publisher: PEARSON
Question
Book Icon
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.

Blurred answer
Students have asked these similar questions
Problem 15 (#2.3.30).If f and f◦g are one-to-one, does it follow that g must be one-to-one? Justify your answer.
3. The diagram below shows the main land routes for vehicular traffic between points A and G in a city. The figures in the arcs represent the cost of traveling between each pair of nodes.   a) Manually apply Dijkstra's algorithm to find the cheapest route between A and G (visited nodes and total distance). b) Formulate a linear programming problem in extended form, to determine the shortest route to travel from A to G. Do not use subscripts, name 14 variables, for example XFE would be the variable that indicates that the arc from F to E is used. c) If there is a fixed cost for visiting each node, modify the formulation of the problem to include said fixed cost in the objective function, and the variables and restrictions that are required.     NODE A B C D E F G FIXED COST 25 18 32 20 28 18 34
4.1.1 Complete solution and answer only no need explanation Given three data points (1,6), (3,28), and (10, 231), What is the value of y at x = 2 if the function y = 2x2 + 3x + 1 passes through the three data points.
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education