Let us analyze the relative performance of using conditional data transfers versus conditional control transfers for the
Question:
Let us analyze the relative performance of using conditional data transfers versus conditional control transfers for the programs you wrote for Problems 4.5 and 4.6. Assume that we are using these programs to compute the sum of the absolute values of a very long array, and so the overall performance is determined largely by the number of cycles required by the inner loop. Assume that our jump instructions are predicted as being taken, and that around 50% of the array values are positive.
A. On average, how many instructions are executed in the inner loops of the two programs?
B. On average, how many bubbles would be injected into the inner loops of the two programs?
C. What is the average number of clock cycles required per array element for the two programs?
Problems 4.5
Modify the Y86-64 code for the sum function (Figure 4.6) to implement a function absSum that computes the sum of absolute values of an array. Use a conditional jump instruction within your inner loop.
Problems 4.6
Modify the Y86-64 code for the sum function (Figure 4.6) to implement a function absSum that computes the sum of absolute values of an array. Use a conditional move instruction within your inner loop.
Figure 4.6
Step by Step Answer:
Computer Systems A Programmers Perspective
ISBN: 9781292101767
3rd Global Edition
Authors: Randal E. Bryant, David R. O'Hallaron