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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started