Consider program P, which runs on a 1GHz machine in 10 seconds, An optimization is made to P, replacing all instances of multiplying a value by 4 (mult X, X, 4) with two instructions that set x to x + x twice (add X, X; add X, X) Call this new optimized program P’. The CPI of a multiply instruction is 4, and that of add is 1. After recompiling, the program runs in 9 seconds on machine M. How many multiples were replaced by the new compiler?
Get Answers For Free
Most questions answered within 1 hours.