Question: 8. Assume that computer M1 has CPU clock rate 2GHz, and supports four classes of instructions: ALU, load, store, branch/jump. Load has CPI = 5,

8. Assume that computer M1 has CPU clock rate 2GHz, and supports four classes of instructions: ALU, load, store, branch/jump. Load has CPI = 5, store has CPI =4, ALU instruction has CPI = 4, and branch/jump has CPI = 3. The following program P is used in testing the computer performance:

F: SUBI SP, SP, #16 // (*) make room on the stack

STUR X19, [SP, #0] // preserve X19

STUR X30, [SP, #8] // preserve the return location

ADD X19, X2, X3 // calculate c + d

// Clean up in preparation for tail call

LDUR X19, [SP, #0]

LDUR X30, [SP, #8]

ADDI SP, SP, #16 // (*)

B F // call g(g(a,b),c+d) with tail-call optimization

a. What is the average CPI for program P?

b. Another computer M2 with clock rate of 500MHz has the same performance as computer M1 when it runs the program P. What is the average CPI of computer M2?

 
 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!