Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Consider program P running on a 1-GHz machine M in 10 seconds. Someone optimizes P by replacing all instances of multiplying a value x by
Consider program P running on a 1-GHz machine M in 10 seconds. Someone optimizes P by replacing all instances of multiplying a value x by 2 (multx.r,2) with a single add instruction (add xx.r) and by replacing all instances of multiplying by 4 (mult x.x,4) with a single shift instruction (s11 xx,2). The optimized program P' runs in 8.6 seconds on the same machine. If the CPI of mult is 4, and the CPI of each add and s11 is 2, how many multiplies (total- both multiplies by 2 and multiplies by 4) were replaced by the optimization? 1. Consider program P running on a 1-GHz machine M in 10 seconds. Someone optimizes P by replacing all instances of multiplying a value x by 2 (multx.r,2) with a single add instruction (add xx.r) and by replacing all instances of multiplying by 4 (mult x.x,4) with a single shift instruction (s11 xx,2). The optimized program P' runs in 8.6 seconds on the same machine. If the CPI of mult is 4, and the CPI of each add and s11 is 2, how many multiplies (total- both multiplies by 2 and multiplies by 4) were replaced by the optimization? 1
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